summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.inc121
-rw-r--r--ObsoleteFiles.inc65
-rw-r--r--UPDATING14
-rw-r--r--bin/cat/Makefile.depend2
-rw-r--r--bin/chflags/Makefile.depend1
-rw-r--r--bin/chio/Makefile.depend1
-rw-r--r--bin/chmod/Makefile.depend1
-rw-r--r--bin/chmod/chmod.c6
-rw-r--r--bin/cp/Makefile.depend1
-rw-r--r--bin/cp/cp.113
-rw-r--r--bin/cp/cp.c40
-rw-r--r--bin/cp/extern.h2
-rw-r--r--bin/cp/utils.c114
-rw-r--r--bin/csh/Makefile.depend2
-rw-r--r--bin/date/Makefile.depend1
-rw-r--r--bin/dd/Makefile.depend1
-rw-r--r--bin/df/Makefile.depend1
-rw-r--r--bin/domainname/Makefile.depend1
-rw-r--r--bin/echo/Makefile.depend1
-rw-r--r--bin/ed/Makefile.depend1
-rw-r--r--bin/expr/Makefile.depend1
-rw-r--r--bin/freebsd-version/Makefile.depend1
-rw-r--r--bin/getfacl/Makefile.depend1
-rw-r--r--bin/hostname/Makefile.depend1
-rw-r--r--bin/kenv/Makefile.depend1
-rw-r--r--bin/kill/Makefile.depend1
-rw-r--r--bin/ln/Makefile.depend1
-rw-r--r--bin/ls/Makefile2
-rw-r--r--bin/ls/Makefile.depend1
-rw-r--r--bin/ls/extern.h11
-rw-r--r--bin/ls/ls.15
-rw-r--r--bin/ls/ls.c63
-rw-r--r--bin/ls/print.c169
-rw-r--r--bin/ls/util.c52
-rw-r--r--bin/mkdir/Makefile.depend1
-rw-r--r--bin/mv/Makefile.depend1
-rw-r--r--bin/pax/Makefile.depend1
-rw-r--r--bin/pkill/Makefile.depend1
-rw-r--r--bin/ps/Makefile.depend1
-rw-r--r--bin/ps/ps.15
-rw-r--r--bin/ps/ps.c7
-rw-r--r--bin/pwait/Makefile.depend1
-rw-r--r--bin/pwd/Makefile.depend1
-rw-r--r--bin/rcp/Makefile.depend1
-rw-r--r--bin/realpath/Makefile.depend1
-rw-r--r--bin/rm/Makefile.depend1
-rw-r--r--bin/rmail/Makefile.depend1
-rw-r--r--bin/rmdir/Makefile.depend1
-rw-r--r--bin/setfacl/Makefile.depend1
-rw-r--r--bin/sh/Makefile.depend2
-rw-r--r--bin/sleep/Makefile.depend1
-rw-r--r--bin/stty/Makefile.depend1
-rw-r--r--bin/sync/Makefile.depend1
-rw-r--r--bin/test/Makefile.depend1
-rw-r--r--bin/uuidgen/Makefile.depend1
-rw-r--r--cddl/contrib/opensolaris/cmd/lockstat/lockstat.18
-rw-r--r--cddl/contrib/opensolaris/cmd/lockstat/lockstat.c42
-rw-r--r--cddl/contrib/opensolaris/cmd/zdb/zdb.c14
-rw-r--r--cddl/contrib/opensolaris/cmd/zfs/zfs_main.c41
-rw-r--r--cddl/contrib/opensolaris/cmd/ztest/ztest.c19
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h18
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c50
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.h4
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c20
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c8
-rw-r--r--cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c5
-rw-r--r--cddl/lib/drti/Makefile.depend1
-rw-r--r--cddl/lib/libavl/Makefile.depend1
-rw-r--r--cddl/lib/libctf/Makefile.depend1
-rw-r--r--cddl/lib/libdtrace/Makefile.depend1
-rw-r--r--cddl/lib/libnvpair/Makefile.depend1
-rw-r--r--cddl/lib/libumem/Makefile.depend1
-rw-r--r--cddl/lib/libuutil/Makefile.depend1
-rw-r--r--cddl/lib/libzfs/Makefile.depend1
-rw-r--r--cddl/lib/libzfs_core/Makefile.depend1
-rw-r--r--cddl/lib/libzpool/Makefile.depend1
-rw-r--r--cddl/sbin/zfs/Makefile.depend1
-rw-r--r--cddl/sbin/zpool/Makefile.depend1
-rw-r--r--cddl/usr.bin/ctfconvert/Makefile.depend1
-rw-r--r--cddl/usr.bin/ctfdump/Makefile.depend1
-rw-r--r--cddl/usr.bin/ctfmerge/Makefile.depend1
-rw-r--r--cddl/usr.bin/sgsmsg/Makefile.depend1
-rw-r--r--cddl/usr.bin/zinject/Makefile.depend1
-rw-r--r--cddl/usr.bin/zstreamdump/Makefile.depend1
-rw-r--r--cddl/usr.bin/ztest/Makefile.depend1
-rw-r--r--cddl/usr.sbin/dtrace/Makefile.depend1
-rw-r--r--cddl/usr.sbin/dtruss/Makefile.depend1
-rw-r--r--cddl/usr.sbin/lockstat/Makefile.depend1
-rw-r--r--cddl/usr.sbin/zdb/Makefile.depend1
-rw-r--r--cddl/usr.sbin/zhack/Makefile.depend1
-rw-r--r--contrib/bmake/ChangeLog6
-rw-r--r--contrib/bmake/Makefile4
-rw-r--r--contrib/bmake/bmake.120
-rw-r--r--contrib/bmake/bmake.cat113
-rw-r--r--contrib/bmake/make.120
-rw-r--r--contrib/bmake/mk/ChangeLog26
-rw-r--r--contrib/bmake/mk/dirdeps.mk14
-rw-r--r--contrib/bmake/mk/gendirdeps.mk4
-rw-r--r--contrib/bmake/mk/install-mk4
-rw-r--r--contrib/bmake/mk/meta.stage.mk6
-rw-r--r--contrib/bmake/mk/meta.sys.mk13
-rwxr-xr-xcontrib/bmake/mk/mkopt.sh19
-rw-r--r--contrib/bmake/targ.c6
-rw-r--r--contrib/diff/src/context.c2
-rw-r--r--contrib/dtc/checks.c4
-rw-r--r--contrib/elftoolchain/common/_elftc.h5
-rw-r--r--contrib/elftoolchain/common/elfdefinitions.h3
-rw-r--r--contrib/elftoolchain/elfcopy/elfcopy.h3
-rw-r--r--contrib/elftoolchain/elfcopy/main.c20
-rw-r--r--contrib/elftoolchain/elfcopy/sections.c89
-rw-r--r--contrib/elftoolchain/elfcopy/symbols.c94
-rw-r--r--contrib/elftoolchain/libdwarf/libdwarf_reloc.c3
-rw-r--r--contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c472
-rw-r--r--contrib/elftoolchain/libelftc/os.Linux.mk4
-rw-r--r--contrib/elftoolchain/readelf/readelf.14
-rw-r--r--contrib/elftoolchain/readelf/readelf.c71
-rw-r--r--contrib/file/ChangeLog53
-rw-r--r--contrib/file/Makefile.in44
-rw-r--r--contrib/file/TODO3
-rw-r--r--contrib/file/aclocal.m467
-rwxr-xr-xcontrib/file/compile2
-rw-r--r--contrib/file/config.h.in12
-rwxr-xr-xcontrib/file/configure72
-rw-r--r--contrib/file/configure.ac10
-rwxr-xr-xcontrib/file/depcomp2
-rw-r--r--contrib/file/doc/Makefile.in22
-rw-r--r--contrib/file/doc/file.man38
-rw-r--r--contrib/file/doc/libmagic.man8
-rwxr-xr-xcontrib/file/ltmain.sh6
-rw-r--r--contrib/file/magic/Magdir/android8
-rw-r--r--contrib/file/magic/Magdir/apple11
-rw-r--r--contrib/file/magic/Magdir/archive7
-rw-r--r--contrib/file/magic/Magdir/audio19
-rw-r--r--contrib/file/magic/Magdir/cafebabe12
-rw-r--r--contrib/file/magic/Magdir/cbor21
-rw-r--r--contrib/file/magic/Magdir/commands4
-rw-r--r--contrib/file/magic/Magdir/compress3
-rw-r--r--contrib/file/magic/Magdir/console16
-rw-r--r--contrib/file/magic/Magdir/dyadic7
-rw-r--r--contrib/file/magic/Magdir/filesystems3
-rw-r--r--contrib/file/magic/Magdir/gnu6
-rw-r--r--contrib/file/magic/Magdir/images72
-rw-r--r--contrib/file/magic/Magdir/jpeg12
-rw-r--r--contrib/file/magic/Magdir/linux27
-rw-r--r--contrib/file/magic/Magdir/mach4
-rw-r--r--contrib/file/magic/Magdir/mathematica13
-rw-r--r--contrib/file/magic/Magdir/misctools13
-rw-r--r--contrib/file/magic/Magdir/modem13
-rw-r--r--contrib/file/magic/Magdir/mozilla3
-rw-r--r--contrib/file/magic/Magdir/nasa7
-rw-r--r--contrib/file/magic/Magdir/os25
-rw-r--r--contrib/file/magic/Magdir/pdf7
-rw-r--r--contrib/file/magic/Magdir/perl48
-rw-r--r--contrib/file/magic/Magdir/riff3
-rw-r--r--contrib/file/magic/Magdir/sereal24
-rw-r--r--contrib/file/magic/Magdir/sgml34
-rw-r--r--contrib/file/magic/Magdir/varied.script10
-rw-r--r--contrib/file/magic/Magdir/vorbis28
-rw-r--r--contrib/file/magic/Makefile.am4
-rw-r--r--contrib/file/magic/Makefile.in26
-rwxr-xr-xcontrib/file/missing6
-rw-r--r--contrib/file/python/Makefile.in22
-rw-r--r--contrib/file/src/Makefile.in31
-rw-r--r--contrib/file/src/apprentice.c46
-rw-r--r--contrib/file/src/ascmagic.c6
-rw-r--r--contrib/file/src/cdf.c124
-rw-r--r--contrib/file/src/cdf.h9
-rw-r--r--contrib/file/src/compress.c19
-rw-r--r--contrib/file/src/encoding.c38
-rw-r--r--contrib/file/src/file.c61
-rw-r--r--contrib/file/src/file.h21
-rw-r--r--contrib/file/src/file_opts.h10
-rw-r--r--contrib/file/src/fsmagic.c4
-rw-r--r--contrib/file/src/funcs.c36
-rw-r--r--contrib/file/src/gmtime_r.c19
-rw-r--r--contrib/file/src/is_tar.c4
-rw-r--r--contrib/file/src/localtime_r.c19
-rw-r--r--contrib/file/src/magic.c166
-rw-r--r--contrib/file/src/magic.h53
-rw-r--r--contrib/file/src/magic.h.in51
-rw-r--r--contrib/file/src/print.c40
-rw-r--r--contrib/file/src/readcdf.c142
-rw-r--r--contrib/file/src/readelf.c10
-rw-r--r--contrib/file/src/softmagic.c85
-rw-r--r--contrib/file/tests/Makefile.in23
-rw-r--r--contrib/gcc/config/arm/lib1funcs.asm2
-rw-r--r--contrib/gcc/mkconfig.sh2
-rw-r--r--contrib/libxo/libxo/libxo.c3
-rw-r--r--contrib/llvm/include/llvm/Target/TargetCallingConv.h11
-rw-r--r--contrib/llvm/include/llvm/Target/TargetLowering.h5
-rw-r--r--contrib/llvm/lib/Analysis/ScalarEvolutionExpander.cpp9
-rw-r--r--contrib/llvm/lib/CodeGen/MachineCopyPropagation.cpp7
-rw-r--r--contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp22
-rw-r--r--contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp6
-rw-r--r--contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp2
-rw-r--r--contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp3
-rw-r--r--contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp39
-rw-r--r--contrib/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp7
-rw-r--r--contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp30
-rw-r--r--contrib/llvm/lib/IR/ConstantFold.cpp33
-rw-r--r--contrib/llvm/lib/IR/GCOV.cpp4
-rw-r--r--contrib/llvm/lib/Support/Unix/Memory.inc15
-rw-r--r--contrib/llvm/lib/Support/Windows/explicit_symbols.inc6
-rw-r--r--contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp23
-rw-r--r--contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp11
-rw-r--r--contrib/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp53
-rw-r--r--contrib/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp43
-rw-r--r--contrib/llvm/lib/Target/Mips/Mips.td12
-rw-r--r--contrib/llvm/lib/Target/Mips/Mips16InstrInfo.cpp3
-rw-r--r--contrib/llvm/lib/Target/Mips/Mips32r6InstrInfo.td4
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsCCState.cpp4
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsCallingConv.td6
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp55
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsISelLowering.h2
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsInstrFPU.td28
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsRegisterInfo.td2
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp8
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsSEISelLowering.cpp23
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp3
-rw-r--r--contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp18
-rw-r--r--contrib/llvm/lib/Target/R600/AMDGPU.td5
-rw-r--r--contrib/llvm/lib/Target/R600/AMDGPUAlwaysInlinePass.cpp5
-rw-r--r--contrib/llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp7
-rw-r--r--contrib/llvm/lib/Target/R600/AMDGPUISelDAGToDAG.cpp44
-rw-r--r--contrib/llvm/lib/Target/R600/AMDGPUISelLowering.cpp20
-rw-r--r--contrib/llvm/lib/Target/R600/AMDGPUInstrInfo.h6
-rw-r--r--contrib/llvm/lib/Target/R600/AMDGPUInstrInfo.td7
-rw-r--r--contrib/llvm/lib/Target/R600/AMDGPUInstructions.td25
-rw-r--r--contrib/llvm/lib/Target/R600/AMDGPUIntrinsics.td1
-rw-r--r--contrib/llvm/lib/Target/R600/AMDGPUSubtarget.cpp2
-rw-r--r--contrib/llvm/lib/Target/R600/AMDGPUSubtarget.h9
-rw-r--r--contrib/llvm/lib/Target/R600/CaymanInstructions.td2
-rw-r--r--contrib/llvm/lib/Target/R600/EvergreenInstructions.td2
-rw-r--r--contrib/llvm/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp2
-rw-r--r--contrib/llvm/lib/Target/R600/Processors.td8
-rw-r--r--contrib/llvm/lib/Target/R600/R600ISelLowering.cpp6
-rw-r--r--contrib/llvm/lib/Target/R600/R600Instructions.td2
-rw-r--r--contrib/llvm/lib/Target/R600/SIAnnotateControlFlow.cpp29
-rw-r--r--contrib/llvm/lib/Target/R600/SIDefines.h3
-rw-r--r--contrib/llvm/lib/Target/R600/SIFoldOperands.cpp16
-rw-r--r--contrib/llvm/lib/Target/R600/SIISelLowering.cpp101
-rw-r--r--contrib/llvm/lib/Target/R600/SIInsertWaits.cpp34
-rw-r--r--contrib/llvm/lib/Target/R600/SIInstrFormats.td36
-rw-r--r--contrib/llvm/lib/Target/R600/SIInstrInfo.cpp84
-rw-r--r--contrib/llvm/lib/Target/R600/SIInstrInfo.h26
-rw-r--r--contrib/llvm/lib/Target/R600/SIInstrInfo.td758
-rw-r--r--contrib/llvm/lib/Target/R600/SIInstructions.td594
-rw-r--r--contrib/llvm/lib/Target/R600/SILowerControlFlow.cpp79
-rw-r--r--contrib/llvm/lib/Target/R600/SIRegisterInfo.cpp74
-rw-r--r--contrib/llvm/lib/Target/R600/SIRegisterInfo.h4
-rw-r--r--contrib/llvm/lib/Target/R600/SIRegisterInfo.td4
-rw-r--r--contrib/llvm/lib/Target/R600/VIInstrFormats.td26
-rw-r--r--contrib/llvm/lib/Target/R600/VIInstructions.td41
-rw-r--r--contrib/llvm/lib/Target/X86/X86FrameLowering.cpp84
-rw-r--r--contrib/llvm/lib/Target/X86/X86FrameLowering.h8
-rw-r--r--contrib/llvm/lib/Target/X86/X86ISelLowering.cpp124
-rw-r--r--contrib/llvm/lib/Target/X86/X86InstrControl.td3
-rw-r--r--contrib/llvm/lib/Target/X86/X86IntrinsicsInfo.h2
-rw-r--r--contrib/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp19
-rw-r--r--contrib/llvm/lib/Transforms/Scalar/GVN.cpp10
-rw-r--r--contrib/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp3
-rw-r--r--contrib/llvm/patches/README.TXT8
-rw-r--r--contrib/llvm/patches/patch-01-freebsd-kprintf.diff10
-rw-r--r--contrib/llvm/patches/patch-07-llvm-r227752-boot2-shrink.diff10
-rw-r--r--contrib/llvm/patches/patch-08-llvm-r227089-fix-mips-i128.diff1950
-rw-r--r--contrib/llvm/patches/patch-08-llvm-r230348-arm-fix-bad-ha.diff (renamed from contrib/llvm/patches/patch-10-llvm-r230348-arm-fix-bad-ha.diff)8
-rw-r--r--contrib/llvm/patches/patch-09-clang-r227115-constantarraytype.diff (renamed from contrib/llvm/patches/patch-12-clang-r227115-constantarraytype.diff)0
-rw-r--r--contrib/llvm/patches/patch-09-llvm-r230058-indirectbrs-assert.diff55
-rw-r--r--contrib/llvm/patches/patch-11-llvm-r231227-aarch64-tls-relocs.diff811
-rw-r--r--contrib/llvm/patches/patch-13-llvm-r229911-uleb128-commas.diff77
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td5
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/TargetCXXABI.h10
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h6
-rw-r--r--contrib/llvm/tools/clang/include/clang/Sema/Sema.h1
-rw-r--r--contrib/llvm/tools/clang/include/clang/Sema/Template.h7
-rw-r--r--contrib/llvm/tools/clang/lib/AST/ASTContext.cpp4
-rw-r--r--contrib/llvm/tools/clang/lib/AST/ASTDiagnostic.cpp53
-rw-r--r--contrib/llvm/tools/clang/lib/AST/Decl.cpp3
-rw-r--r--contrib/llvm/tools/clang/lib/Analysis/ThreadSafety.cpp4
-rw-r--r--contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp39
-rw-r--r--contrib/llvm/tools/clang/lib/Basic/TargetInfo.cpp1
-rw-r--r--contrib/llvm/tools/clang/lib/Basic/Targets.cpp20
-rw-r--r--contrib/llvm/tools/clang/lib/Basic/Version.cpp2
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp1
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp3
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp2
-rw-r--r--contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp2
-rw-r--r--contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp7
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp5
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp21
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp7
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp10
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp56
-rw-r--r--contrib/mdocml/read.c27
-rw-r--r--contrib/netbsd-tests/lib/libc/c063/t_faccessat.c3
-rw-r--r--contrib/netbsd-tests/lib/libc/c063/t_openat.c3
-rw-r--r--contrib/netbsd-tests/lib/libc/c063/t_readlinkat.c3
-rw-r--r--contrib/netbsd-tests/lib/libc/c063/t_unlinkat.c3
-rw-r--r--contrib/netbsd-tests/lib/libc/string/t_memmem.c2
-rw-r--r--contrib/ntp/ntpd/ntp_control.c2
-rw-r--r--contrib/sendmail/libsm/sscanf.c2
-rw-r--r--contrib/top/top.local.hs (renamed from contrib/top/top.local.H)0
-rw-r--r--contrib/top/top.xs (renamed from contrib/top/top.X)0
-rw-r--r--contrib/traceroute/traceroute.819
-rw-r--r--contrib/traceroute/traceroute.c225
-rw-r--r--crypto/openssh/moduli536
-rw-r--r--crypto/openssl/CHANGES77
-rwxr-xr-xcrypto/openssl/Configure10
-rw-r--r--crypto/openssl/Makefile28
-rw-r--r--crypto/openssl/Makefile.org26
-rw-r--r--crypto/openssl/NEWS12
-rw-r--r--crypto/openssl/README2
-rw-r--r--crypto/openssl/apps/Makefile19
-rw-r--r--crypto/openssl/apps/apps.c6
-rw-r--r--crypto/openssl/apps/asn1pars.c2
-rw-r--r--crypto/openssl/apps/ca.c10
-rw-r--r--crypto/openssl/apps/cms.c2
-rw-r--r--crypto/openssl/apps/dhparam.c4
-rw-r--r--crypto/openssl/apps/enc.c13
-rw-r--r--crypto/openssl/apps/gendh.c2
-rw-r--r--crypto/openssl/apps/ocsp.c2
-rw-r--r--crypto/openssl/apps/s_cb.c3
-rw-r--r--crypto/openssl/apps/s_client.c15
-rw-r--r--crypto/openssl/apps/s_server.c73
-rw-r--r--crypto/openssl/apps/s_time.c2
-rw-r--r--crypto/openssl/apps/smime.c2
-rw-r--r--crypto/openssl/apps/srp.c4
-rw-r--r--crypto/openssl/apps/verify.c2
-rw-r--r--crypto/openssl/crypto/Makefile11
-rw-r--r--crypto/openssl/crypto/aes/Makefile2
-rw-r--r--crypto/openssl/crypto/asn1/Makefile2
-rw-r--r--crypto/openssl/crypto/asn1/a_int.c6
-rw-r--r--crypto/openssl/crypto/asn1/asn1_gen.c40
-rw-r--r--crypto/openssl/crypto/asn1/asn_mime.c3
-rw-r--r--crypto/openssl/crypto/asn1/bio_ndef.c4
-rw-r--r--crypto/openssl/crypto/asn1/tasn_new.c3
-rw-r--r--crypto/openssl/crypto/asn1/tasn_prn.c2
-rw-r--r--crypto/openssl/crypto/asn1/x_x509.c4
-rw-r--r--crypto/openssl/crypto/bf/Makefile2
-rw-r--r--crypto/openssl/crypto/bio/Makefile2
-rw-r--r--crypto/openssl/crypto/bio/b_print.c45
-rw-r--r--crypto/openssl/crypto/bio/bf_nbio.c6
-rw-r--r--crypto/openssl/crypto/bio/bio_lib.c8
-rw-r--r--crypto/openssl/crypto/bio/bss_dgram.c21
-rw-r--r--crypto/openssl/crypto/bn/Makefile2
-rw-r--r--crypto/openssl/crypto/bn/bn.h5
-rw-r--r--crypto/openssl/crypto/bn/bn_err.c6
-rw-r--r--crypto/openssl/crypto/bn/bn_gf2m.c15
-rw-r--r--crypto/openssl/crypto/bn/bn_lcl.h2
-rw-r--r--crypto/openssl/crypto/bn/bn_print.c7
-rw-r--r--crypto/openssl/crypto/bn/bn_rand.c10
-rw-r--r--crypto/openssl/crypto/bn/bn_shift.c10
-rw-r--r--crypto/openssl/crypto/buffer/Makefile2
-rw-r--r--crypto/openssl/crypto/buffer/buffer.c2
-rw-r--r--crypto/openssl/crypto/camellia/Makefile2
-rw-r--r--crypto/openssl/crypto/cast/Makefile2
-rw-r--r--crypto/openssl/crypto/cmac/Makefile2
-rw-r--r--crypto/openssl/crypto/cmac/cmac.c2
-rw-r--r--crypto/openssl/crypto/cms/Makefile2
-rw-r--r--crypto/openssl/crypto/cms/cms_pwri.c7
-rw-r--r--crypto/openssl/crypto/cms/cms_smime.c2
-rw-r--r--crypto/openssl/crypto/comp/Makefile2
-rw-r--r--crypto/openssl/crypto/conf/Makefile2
-rw-r--r--crypto/openssl/crypto/cryptlib.c2
-rw-r--r--crypto/openssl/crypto/des/Makefile2
-rw-r--r--crypto/openssl/crypto/des/des.c6
-rw-r--r--crypto/openssl/crypto/des/enc_writ.c7
-rw-r--r--crypto/openssl/crypto/dh/Makefile2
-rw-r--r--crypto/openssl/crypto/dh/dh_ameth.c2
-rw-r--r--crypto/openssl/crypto/dsa/Makefile2
-rw-r--r--crypto/openssl/crypto/dsa/dsa_gen.c3
-rw-r--r--crypto/openssl/crypto/dsa/dsa_ossl.c8
-rw-r--r--crypto/openssl/crypto/dso/Makefile2
-rw-r--r--crypto/openssl/crypto/dso/dso_lib.c2
-rw-r--r--crypto/openssl/crypto/ec/Makefile2
-rw-r--r--crypto/openssl/crypto/ec/ec2_oct.c2
-rw-r--r--crypto/openssl/crypto/ec/ec_asn1.c20
-rw-r--r--crypto/openssl/crypto/ec/ec_check.c2
-rw-r--r--crypto/openssl/crypto/ec/ec_key.c2
-rw-r--r--crypto/openssl/crypto/ec/ec_lcl.h8
-rw-r--r--crypto/openssl/crypto/ec/ec_lib.c7
-rw-r--r--crypto/openssl/crypto/ec/eck_prn.c4
-rw-r--r--crypto/openssl/crypto/ec/ecp_oct.c2
-rw-r--r--crypto/openssl/crypto/ec/ectest.c24
-rw-r--r--crypto/openssl/crypto/ecdh/Makefile2
-rw-r--r--crypto/openssl/crypto/ecdsa/Makefile2
-rw-r--r--crypto/openssl/crypto/ecdsa/ecdsatest.c4
-rw-r--r--crypto/openssl/crypto/engine/Makefile2
-rw-r--r--crypto/openssl/crypto/engine/eng_table.c6
-rw-r--r--crypto/openssl/crypto/err/Makefile2
-rw-r--r--crypto/openssl/crypto/evp/Makefile2
-rw-r--r--crypto/openssl/crypto/evp/bio_ok.c3
-rw-r--r--crypto/openssl/crypto/evp/e_aes.c7
-rw-r--r--crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c9
-rw-r--r--crypto/openssl/crypto/evp/e_rc4_hmac_md5.c10
-rw-r--r--crypto/openssl/crypto/evp/encode.c2
-rw-r--r--crypto/openssl/crypto/evp/evp.h4
-rw-r--r--crypto/openssl/crypto/evp/p_seal.c5
-rw-r--r--crypto/openssl/crypto/hmac/Makefile2
-rw-r--r--crypto/openssl/crypto/hmac/hmac.c19
-rw-r--r--crypto/openssl/crypto/hmac/hmactest.c179
-rw-r--r--crypto/openssl/crypto/idea/Makefile2
-rw-r--r--crypto/openssl/crypto/jpake/Makefile2
-rw-r--r--crypto/openssl/crypto/krb5/Makefile2
-rw-r--r--crypto/openssl/crypto/lhash/Makefile2
-rw-r--r--crypto/openssl/crypto/md2/Makefile2
-rw-r--r--crypto/openssl/crypto/md32_common.h4
-rw-r--r--crypto/openssl/crypto/md4/Makefile2
-rw-r--r--crypto/openssl/crypto/md5/Makefile2
-rw-r--r--crypto/openssl/crypto/mdc2/Makefile2
-rw-r--r--crypto/openssl/crypto/mem.c3
-rw-r--r--crypto/openssl/crypto/modes/Makefile2
-rw-r--r--crypto/openssl/crypto/modes/gcm128.c2
-rw-r--r--crypto/openssl/crypto/objects/Makefile2
-rw-r--r--crypto/openssl/crypto/objects/o_names.c2
-rw-r--r--crypto/openssl/crypto/objects/obj_dat.c7
-rw-r--r--crypto/openssl/crypto/objects/objects.README8
-rw-r--r--crypto/openssl/crypto/objects/objects.pl2
-rw-r--r--crypto/openssl/crypto/ocsp/Makefile2
-rw-r--r--crypto/openssl/crypto/ocsp/ocsp_ext.c4
-rw-r--r--crypto/openssl/crypto/ocsp/ocsp_vfy.c21
-rw-r--r--crypto/openssl/crypto/opensslv.h6
-rw-r--r--crypto/openssl/crypto/pem/Makefile2
-rw-r--r--crypto/openssl/crypto/pem/pem_lib.c2
-rw-r--r--crypto/openssl/crypto/pem/pem_pk8.c2
-rw-r--r--crypto/openssl/crypto/pkcs12/Makefile2
-rw-r--r--crypto/openssl/crypto/pkcs12/p12_mutl.c3
-rw-r--r--crypto/openssl/crypto/pkcs7/Makefile2
-rw-r--r--crypto/openssl/crypto/pkcs7/pk7_doit.c16
-rw-r--r--crypto/openssl/crypto/pqueue/Makefile2
-rw-r--r--crypto/openssl/crypto/rand/Makefile2
-rw-r--r--crypto/openssl/crypto/rc2/Makefile2
-rw-r--r--crypto/openssl/crypto/rc4/Makefile2
-rw-r--r--crypto/openssl/crypto/rc5/Makefile2
-rw-r--r--crypto/openssl/crypto/ripemd/Makefile2
-rw-r--r--crypto/openssl/crypto/rsa/Makefile2
-rw-r--r--crypto/openssl/crypto/rsa/rsa_pmeth.c8
-rw-r--r--crypto/openssl/crypto/seed/Makefile2
-rw-r--r--crypto/openssl/crypto/sha/Makefile2
-rw-r--r--crypto/openssl/crypto/srp/Makefile2
-rw-r--r--crypto/openssl/crypto/srp/srp_vfy.c9
-rw-r--r--crypto/openssl/crypto/stack/Makefile2
-rw-r--r--crypto/openssl/crypto/store/Makefile2
-rw-r--r--crypto/openssl/crypto/threads/th-lock.c12
-rw-r--r--crypto/openssl/crypto/ts/Makefile2
-rw-r--r--crypto/openssl/crypto/txt_db/Makefile2
-rw-r--r--crypto/openssl/crypto/ui/Makefile2
-rw-r--r--crypto/openssl/crypto/whrlpool/Makefile2
-rw-r--r--crypto/openssl/crypto/x509/Makefile2
-rw-r--r--crypto/openssl/crypto/x509/x509_lu.c2
-rw-r--r--crypto/openssl/crypto/x509/x509_vfy.c226
-rw-r--r--crypto/openssl/crypto/x509/x509_vfy.h6
-rw-r--r--crypto/openssl/crypto/x509/x509_vpm.c2
-rw-r--r--crypto/openssl/crypto/x509/x509type.c3
-rw-r--r--crypto/openssl/crypto/x509v3/Makefile2
-rw-r--r--crypto/openssl/crypto/x509v3/v3_alt.c18
-rw-r--r--crypto/openssl/crypto/x509v3/v3_cpols.c8
-rw-r--r--crypto/openssl/crypto/x509v3/v3_utl.c4
-rw-r--r--crypto/openssl/doc/apps/cms.pod5
-rw-r--r--crypto/openssl/doc/apps/config.pod53
-rw-r--r--crypto/openssl/doc/apps/dhparam.pod13
-rw-r--r--crypto/openssl/doc/apps/ocsp.pod11
-rw-r--r--crypto/openssl/doc/apps/s_client.pod7
-rw-r--r--crypto/openssl/doc/apps/s_server.pod9
-rw-r--r--crypto/openssl/doc/apps/smime.pod4
-rw-r--r--crypto/openssl/doc/apps/verify.pod13
-rw-r--r--crypto/openssl/doc/crypto/BN_rand.pod3
-rw-r--r--crypto/openssl/doc/crypto/BN_set_bit.pod8
-rw-r--r--crypto/openssl/doc/crypto/X509_VERIFY_PARAM_set_flags.pod8
-rw-r--r--crypto/openssl/doc/crypto/pem.pod27
-rw-r--r--crypto/openssl/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod106
-rw-r--r--crypto/openssl/e_os2.h8
-rw-r--r--crypto/openssl/engines/Makefile13
-rw-r--r--crypto/openssl/engines/ccgost/Makefile18
-rw-r--r--crypto/openssl/engines/ccgost/e_gost_err.c3
-rw-r--r--crypto/openssl/engines/ccgost/e_gost_err.h1
-rw-r--r--crypto/openssl/engines/ccgost/gost2001.c229
-rw-r--r--crypto/openssl/engines/ccgost/gost94_keyx.c6
-rw-r--r--crypto/openssl/engines/ccgost/gost_ameth.c36
-rw-r--r--crypto/openssl/engines/ccgost/gost_pmeth.c2
-rw-r--r--crypto/openssl/engines/ccgost/gost_sign.c87
-rw-r--r--crypto/openssl/engines/e_sureware.c27
-rw-r--r--crypto/openssl/ssl/Makefile54
-rw-r--r--crypto/openssl/ssl/d1_both.c46
-rw-r--r--crypto/openssl/ssl/d1_clnt.c10
-rw-r--r--crypto/openssl/ssl/d1_lib.c3
-rw-r--r--crypto/openssl/ssl/d1_pkt.c2
-rw-r--r--crypto/openssl/ssl/d1_srvr.c28
-rw-r--r--crypto/openssl/ssl/s2_pkt.c14
-rw-r--r--crypto/openssl/ssl/s2_srvr.c104
-rw-r--r--crypto/openssl/ssl/s3_both.c2
-rw-r--r--crypto/openssl/ssl/s3_cbc.c16
-rw-r--r--crypto/openssl/ssl/s3_clnt.c273
-rw-r--r--crypto/openssl/ssl/s3_pkt.c13
-rw-r--r--crypto/openssl/ssl/s3_srvr.c230
-rw-r--r--crypto/openssl/ssl/ssl.h4
-rw-r--r--crypto/openssl/ssl/ssl_err.c3
-rw-r--r--crypto/openssl/ssl/ssl_lib.c8
-rw-r--r--crypto/openssl/ssl/ssl_locl.h1
-rw-r--r--crypto/openssl/ssl/ssl_sess.c131
-rw-r--r--crypto/openssl/ssl/ssl_stat.c6
-rw-r--r--crypto/openssl/ssl/ssltest.c20
-rw-r--r--crypto/openssl/ssl/t1_enc.c9
-rw-r--r--crypto/openssl/ssl/t1_lib.c174
-rw-r--r--crypto/openssl/ssl/tls_srp.c3
-rwxr-xr-xcrypto/openssl/util/mk1mf.pl2
-rw-r--r--crypto/openssl/util/mkerr.pl21
-rw-r--r--crypto/openssl/util/pl/BC-32.pl2
-rw-r--r--crypto/openssl/util/pl/VC-32.pl2
-rw-r--r--etc/Makefile10
-rw-r--r--etc/mtree/BSD.debug.dist2
-rw-r--r--etc/mtree/BSD.usr.dist2
-rw-r--r--etc/sendmail/Makefile.depend1
-rw-r--r--games/caesar/Makefile.depend1
-rw-r--r--games/factor/Makefile.depend1
-rw-r--r--games/fortune/datfiles/Makefile.depend1
-rw-r--r--games/fortune/fortune/Makefile.depend1
-rw-r--r--games/fortune/strfile/Makefile.depend1
-rw-r--r--games/fortune/unstr/Makefile.depend1
-rw-r--r--games/grdc/Makefile.depend1
-rw-r--r--games/grdc/grdc.c10
-rw-r--r--games/morse/Makefile.depend1
-rw-r--r--games/number/Makefile.depend1
-rw-r--r--games/pom/Makefile.depend1
-rw-r--r--games/primes/Makefile.depend1
-rw-r--r--games/random/Makefile.depend1
-rw-r--r--gnu/lib/csu/Makefile.depend2
-rw-r--r--gnu/lib/libdialog/Makefile.depend1
-rw-r--r--gnu/lib/libgcc/Makefile.depend3
-rw-r--r--gnu/lib/libgcov/Makefile.depend2
-rw-r--r--gnu/lib/libgomp/Makefile.depend1
-rw-r--r--gnu/lib/libreadline/history/Makefile15
-rw-r--r--gnu/lib/libreadline/history/Makefile.depend19
-rw-r--r--gnu/lib/libreadline/history/doc/Makefile12
-rw-r--r--gnu/lib/libreadline/readline/Makefile13
-rw-r--r--gnu/lib/libreadline/readline/Makefile.depend1
-rw-r--r--gnu/lib/libregex/Makefile.depend1
-rw-r--r--gnu/lib/libssp/Makefile.depend1
-rw-r--r--gnu/lib/libssp/libssp_nonshared/Makefile.depend1
-rw-r--r--gnu/lib/libstdc++/Makefile.depend1
-rw-r--r--gnu/lib/libsupc++/Makefile.depend1
-rw-r--r--gnu/usr.bin/binutils/addr2line/Makefile.depend1
-rw-r--r--gnu/usr.bin/binutils/ar/Makefile.depend1
-rw-r--r--gnu/usr.bin/binutils/as/Makefile.depend1
-rw-r--r--gnu/usr.bin/binutils/doc/Makefile.depend1
-rw-r--r--gnu/usr.bin/binutils/ld/Makefile.depend.amd642
-rw-r--r--gnu/usr.bin/binutils/ld/Makefile.depend.host2
-rw-r--r--gnu/usr.bin/binutils/libbfd/Makefile.depend.amd641
-rw-r--r--gnu/usr.bin/binutils/libbfd/Makefile.depend.host1
-rw-r--r--gnu/usr.bin/binutils/libbinutils/Makefile.depend1
-rw-r--r--gnu/usr.bin/binutils/libiberty/Makefile.depend1
-rw-r--r--gnu/usr.bin/binutils/libopcodes/Makefile.depend1
-rw-r--r--gnu/usr.bin/binutils/nm/Makefile.depend1
-rw-r--r--gnu/usr.bin/binutils/objcopy/Makefile.depend1
-rw-r--r--gnu/usr.bin/binutils/objdump/Makefile.depend1
-rw-r--r--gnu/usr.bin/binutils/ranlib/Makefile.depend1
-rw-r--r--gnu/usr.bin/binutils/readelf/Makefile.depend1
-rw-r--r--gnu/usr.bin/binutils/size/Makefile.depend1
-rw-r--r--gnu/usr.bin/binutils/strings/Makefile.depend1
-rw-r--r--gnu/usr.bin/binutils/strip/Makefile.depend1
-rw-r--r--gnu/usr.bin/cc/c++/Makefile.depend1
-rw-r--r--gnu/usr.bin/cc/c++filt/Makefile.depend1
-rw-r--r--gnu/usr.bin/cc/cc/Makefile.depend1
-rw-r--r--gnu/usr.bin/cc/cc1/Makefile.depend1
-rw-r--r--gnu/usr.bin/cc/cc1plus/Makefile.depend1
-rw-r--r--gnu/usr.bin/cc/cc_int/Makefile.depend1
-rw-r--r--gnu/usr.bin/cc/cc_tools/Makefile7
-rw-r--r--gnu/usr.bin/cc/cc_tools/Makefile.depend1
-rw-r--r--gnu/usr.bin/cc/cpp/Makefile.depend1
-rw-r--r--gnu/usr.bin/cc/gcov/Makefile.depend1
-rw-r--r--gnu/usr.bin/cc/include/Makefile.depend1
-rw-r--r--gnu/usr.bin/cc/libcpp/Makefile.depend1
-rw-r--r--gnu/usr.bin/cc/libdecnumber/Makefile.depend1
-rw-r--r--gnu/usr.bin/cc/libiberty/Makefile.depend1
-rw-r--r--gnu/usr.bin/dialog/Makefile.depend1
-rw-r--r--gnu/usr.bin/diff/Makefile.depend1
-rw-r--r--gnu/usr.bin/diff3/Makefile.depend1
-rw-r--r--gnu/usr.bin/dtc/Makefile.depend1
-rw-r--r--gnu/usr.bin/gdb/gdb/Makefile.depend1
-rw-r--r--gnu/usr.bin/gdb/gdbserver/Makefile.depend1
-rw-r--r--gnu/usr.bin/gdb/gdbtui/Makefile.depend1
-rw-r--r--gnu/usr.bin/gdb/kgdb/Makefile.depend.amd641
-rw-r--r--gnu/usr.bin/gdb/libgdb/Makefile.depend.amd641
-rw-r--r--gnu/usr.bin/gperf/Makefile.depend1
-rw-r--r--gnu/usr.bin/grep/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/contrib/mm/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/font/devX100-12/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/font/devX100/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/font/devX75-12/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/font/devX75/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/font/devascii/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/font/devcp1047/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/font/devdvi/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/font/devhtml/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/font/devkoi8-r/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/font/devlatin1/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/font/devlbp/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/font/devlj4/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/font/devps/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/font/devutf8/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/man/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/src/devices/grodvi/Makefile.depend2
-rw-r--r--gnu/usr.bin/groff/src/devices/grohtml/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/src/devices/grolbp/Makefile.depend2
-rw-r--r--gnu/usr.bin/groff/src/devices/grolj4/Makefile.depend2
-rw-r--r--gnu/usr.bin/groff/src/devices/grops/Makefile.depend2
-rw-r--r--gnu/usr.bin/groff/src/devices/grotty/Makefile.depend2
-rw-r--r--gnu/usr.bin/groff/src/libs/libbib/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/src/libs/libdriver/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/src/libs/libgroff/Makefile.depend2
-rw-r--r--gnu/usr.bin/groff/src/preproc/eqn/Makefile.depend2
-rw-r--r--gnu/usr.bin/groff/src/preproc/grn/Makefile.depend2
-rw-r--r--gnu/usr.bin/groff/src/preproc/html/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/src/preproc/pic/Makefile.depend2
-rw-r--r--gnu/usr.bin/groff/src/preproc/refer/Makefile.depend2
-rw-r--r--gnu/usr.bin/groff/src/preproc/tbl/Makefile.depend2
-rw-r--r--gnu/usr.bin/groff/src/roff/groff/Makefile.depend2
-rw-r--r--gnu/usr.bin/groff/src/roff/grog/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/src/roff/nroff/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/src/roff/psroff/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/src/roff/troff/Makefile.depend2
-rw-r--r--gnu/usr.bin/groff/src/utils/addftinfo/Makefile.depend2
-rw-r--r--gnu/usr.bin/groff/src/utils/afmtodit/Makefile.depend1
-rw-r--r--gnu/usr.bin/groff/src/utils/hpftodit/Makefile.depend2
-rw-r--r--gnu/usr.bin/groff/src/utils/indxbib/Makefile.depend2
-rw-r--r--gnu/usr.bin/groff/src/utils/lkbib/Makefile.depend2
-rw-r--r--gnu/usr.bin/groff/src/utils/lookbib/Makefile.depend2
-rw-r--r--gnu/usr.bin/groff/src/utils/pfbtops/Makefile.depend2
-rw-r--r--gnu/usr.bin/groff/src/utils/tfmtodit/Makefile.depend2
-rw-r--r--gnu/usr.bin/groff/tmac/Makefile.depend1
-rw-r--r--gnu/usr.bin/rcs/ci/Makefile.depend1
-rw-r--r--gnu/usr.bin/rcs/co/Makefile.depend1
-rw-r--r--gnu/usr.bin/rcs/ident/Makefile.depend1
-rw-r--r--gnu/usr.bin/rcs/lib/Makefile.depend1
-rw-r--r--gnu/usr.bin/rcs/merge/Makefile.depend1
-rw-r--r--gnu/usr.bin/rcs/rcs/Makefile.depend1
-rw-r--r--gnu/usr.bin/rcs/rcsclean/Makefile.depend1
-rw-r--r--gnu/usr.bin/rcs/rcsdiff/Makefile.depend1
-rw-r--r--gnu/usr.bin/rcs/rcsfreeze/Makefile.depend1
-rw-r--r--gnu/usr.bin/rcs/rcsmerge/Makefile.depend1
-rw-r--r--gnu/usr.bin/rcs/rlog/Makefile.depend1
-rw-r--r--gnu/usr.bin/sdiff/Makefile.depend1
-rw-r--r--gnu/usr.bin/send-pr/COPYING339
-rw-r--r--gnu/usr.bin/send-pr/Makefile35
-rw-r--r--gnu/usr.bin/send-pr/Makefile.depend14
-rw-r--r--gnu/usr.bin/send-pr/README43
-rw-r--r--gnu/usr.bin/send-pr/categories21
-rw-r--r--gnu/usr.bin/send-pr/doc/Makefile4
-rw-r--r--gnu/usr.bin/send-pr/doc/categ.texi125
-rw-r--r--gnu/usr.bin/send-pr/doc/fields.texi522
-rw-r--r--gnu/usr.bin/send-pr/doc/s-usage.texi570
-rw-r--r--gnu/usr.bin/send-pr/doc/send-pr.texi658
-rw-r--r--gnu/usr.bin/send-pr/doc/states.texi58
-rw-r--r--gnu/usr.bin/send-pr/doc/version.texi3
-rwxr-xr-xgnu/usr.bin/send-pr/install-sid.sh82
-rw-r--r--gnu/usr.bin/send-pr/send-pr-el.in813
-rw-r--r--gnu/usr.bin/send-pr/send-pr.1355
-rw-r--r--gnu/usr.bin/send-pr/send-pr.sh591
-rw-r--r--include/Makefile2
-rw-r--r--include/Makefile.depend3
-rw-r--r--include/arpa/Makefile4
-rw-r--r--include/arpa/Makefile.depend1
-rw-r--r--include/gssapi/Makefile.depend1
-rw-r--r--include/protocols/Makefile.depend1
-rw-r--r--include/rpc/Makefile.depend1
-rw-r--r--include/rpcsvc/Makefile.depend1
-rw-r--r--include/xlocale/Makefile.depend1
-rw-r--r--kerberos5/lib/libasn1/Makefile.depend2
-rw-r--r--kerberos5/lib/libgssapi_krb5/Makefile.depend1
-rw-r--r--kerberos5/lib/libgssapi_ntlm/Makefile.depend1
-rw-r--r--kerberos5/lib/libgssapi_spnego/Makefile.depend1
-rw-r--r--kerberos5/lib/libhdb/Makefile.depend1
-rw-r--r--kerberos5/lib/libheimbase/Makefile.depend2
-rw-r--r--kerberos5/lib/libheimipcc/Makefile.depend2
-rw-r--r--kerberos5/lib/libheimipcs/Makefile.depend1
-rw-r--r--kerberos5/lib/libheimntlm/Makefile.depend1
-rw-r--r--kerberos5/lib/libhx509/Makefile1
-rw-r--r--kerberos5/lib/libhx509/Makefile.depend3
-rw-r--r--kerberos5/lib/libkadm5clnt/Makefile.depend1
-rw-r--r--kerberos5/lib/libkadm5srv/Makefile.depend1
-rw-r--r--kerberos5/lib/libkafs5/Makefile.depend1
-rw-r--r--kerberos5/lib/libkdc/Makefile.depend1
-rw-r--r--kerberos5/lib/libkrb5/Makefile.depend2
-rw-r--r--kerberos5/lib/libroken/Makefile.depend2
-rw-r--r--kerberos5/lib/libsl/Makefile.depend1
-rw-r--r--kerberos5/lib/libvers/Makefile.depend1
-rw-r--r--kerberos5/lib/libwind/Makefile.depend2
-rw-r--r--kerberos5/libexec/digest-service/Makefile.depend1
-rw-r--r--kerberos5/libexec/hprop/Makefile.depend1
-rw-r--r--kerberos5/libexec/hpropd/Makefile.depend1
-rw-r--r--kerberos5/libexec/ipropd-master/Makefile.depend1
-rw-r--r--kerberos5/libexec/ipropd-slave/Makefile.depend1
-rw-r--r--kerberos5/libexec/kadmind/Makefile.depend1
-rw-r--r--kerberos5/libexec/kcm/Makefile.depend1
-rw-r--r--kerberos5/libexec/kdc/Makefile.depend1
-rw-r--r--kerberos5/libexec/kdigest/Makefile.depend1
-rw-r--r--kerberos5/libexec/kfd/Makefile.depend1
-rw-r--r--kerberos5/libexec/kimpersonate/Makefile.depend1
-rw-r--r--kerberos5/libexec/kpasswdd/Makefile.depend1
-rw-r--r--kerberos5/tools/asn1_compile/Makefile.depend1
-rw-r--r--kerberos5/tools/make-roken/Makefile.depend1
-rw-r--r--kerberos5/tools/slc/Makefile.depend1
-rw-r--r--kerberos5/usr.bin/hxtool/Makefile.depend1
-rw-r--r--kerberos5/usr.bin/kadmin/Makefile.depend1
-rw-r--r--kerberos5/usr.bin/kcc/Makefile.depend1
-rw-r--r--kerberos5/usr.bin/kdestroy/Makefile.depend1
-rw-r--r--kerberos5/usr.bin/kf/Makefile.depend1
-rw-r--r--kerberos5/usr.bin/kgetcred/Makefile.depend1
-rw-r--r--kerberos5/usr.bin/kinit/Makefile.depend1
-rw-r--r--kerberos5/usr.bin/kpasswd/Makefile.depend1
-rw-r--r--kerberos5/usr.bin/krb5-config/Makefile.depend1
-rw-r--r--kerberos5/usr.bin/ksu/Makefile.depend1
-rw-r--r--kerberos5/usr.bin/string2key/Makefile.depend1
-rw-r--r--kerberos5/usr.bin/verify_krb5_conf/Makefile.depend1
-rw-r--r--kerberos5/usr.sbin/iprop-log/Makefile.depend1
-rw-r--r--kerberos5/usr.sbin/kstash/Makefile.depend1
-rw-r--r--kerberos5/usr.sbin/ktutil/Makefile.depend1
-rw-r--r--lib/Makefile1
-rw-r--r--lib/atf/libatf-c++/Makefile.depend1
-rw-r--r--lib/atf/libatf-c/Makefile.depend1
-rw-r--r--lib/clang/clang.build.mk2
-rw-r--r--lib/clang/include/Makefile2
-rw-r--r--lib/clang/include/Makefile.depend1
-rw-r--r--lib/clang/include/clang/Basic/Version.inc8
-rw-r--r--lib/clang/include/clang/Config/config.h2
-rw-r--r--lib/clang/include/llvm/Config/config.h11
-rw-r--r--lib/clang/include/llvm/Config/llvm-config.h4
-rw-r--r--lib/clang/libclanganalysis/Makefile.depend1
-rw-r--r--lib/clang/libclangarcmigrate/Makefile.depend1
-rw-r--r--lib/clang/libclangast/Makefile.depend1
-rw-r--r--lib/clang/libclangbasic/Makefile.depend1
-rw-r--r--lib/clang/libclangcodegen/Makefile.depend1
-rw-r--r--lib/clang/libclangdriver/Makefile.depend1
-rw-r--r--lib/clang/libclangedit/Makefile.depend1
-rw-r--r--lib/clang/libclangfrontend/Makefile.depend1
-rw-r--r--lib/clang/libclangfrontendtool/Makefile.depend1
-rw-r--r--lib/clang/libclanglex/Makefile.depend1
-rw-r--r--lib/clang/libclangparse/Makefile.depend1
-rw-r--r--lib/clang/libclangrewrite/Makefile.depend1
-rw-r--r--lib/clang/libclangrewritefrontend/Makefile.depend1
-rw-r--r--lib/clang/libclangsema/Makefile.depend1
-rw-r--r--lib/clang/libclangserialization/Makefile.depend1
-rw-r--r--lib/clang/libclangstaticanalyzercheckers/Makefile.depend1
-rw-r--r--lib/clang/libclangstaticanalyzercore/Makefile.depend1
-rw-r--r--lib/clang/libclangstaticanalyzerfrontend/Makefile.depend1
-rw-r--r--lib/clang/libllvmaarch64asmparser/Makefile.depend1
-rw-r--r--lib/clang/libllvmaarch64codegen/Makefile.depend204
-rw-r--r--lib/clang/libllvmaarch64desc/Makefile.depend1
-rw-r--r--lib/clang/libllvmaarch64disassembler/Makefile.depend1
-rw-r--r--lib/clang/libllvmaarch64info/Makefile.depend1
-rw-r--r--lib/clang/libllvmaarch64instprinter/Makefile.depend1
-rw-r--r--lib/clang/libllvmaarch64utils/Makefile.depend1
-rw-r--r--lib/clang/libllvmanalysis/Makefile.depend1
-rw-r--r--lib/clang/libllvmarmasmparser/Makefile.depend1
-rw-r--r--lib/clang/libllvmarmcodegen/Makefile.depend1
-rw-r--r--lib/clang/libllvmarmdesc/Makefile.depend1
-rw-r--r--lib/clang/libllvmarmdisassembler/Makefile.depend1
-rw-r--r--lib/clang/libllvmarminfo/Makefile.depend1
-rw-r--r--lib/clang/libllvmarminstprinter/Makefile.depend1
-rw-r--r--lib/clang/libllvmasmparser/Makefile.depend1
-rw-r--r--lib/clang/libllvmasmprinter/Makefile.depend1
-rw-r--r--lib/clang/libllvmbitreader/Makefile.depend1
-rw-r--r--lib/clang/libllvmbitwriter/Makefile.depend1
-rw-r--r--lib/clang/libllvmcodegen/Makefile.depend1
-rw-r--r--lib/clang/libllvmcore/Makefile.depend1
-rw-r--r--lib/clang/libllvmdebuginfo/Makefile.depend1
-rw-r--r--lib/clang/libllvmexecutionengine/Makefile.depend1
-rw-r--r--lib/clang/libllvminstcombine/Makefile.depend1
-rw-r--r--lib/clang/libllvminstrumentation/Makefile.depend1
-rw-r--r--lib/clang/libllvminterpreter/Makefile.depend1
-rw-r--r--lib/clang/libllvmipa/Makefile.depend1
-rw-r--r--lib/clang/libllvmipo/Makefile.depend1
-rw-r--r--lib/clang/libllvmirreader/Makefile.depend1
-rw-r--r--lib/clang/libllvmlinker/Makefile.depend1
-rw-r--r--lib/clang/libllvmmc/Makefile.depend1
-rw-r--r--lib/clang/libllvmmcdisassembler/Makefile.depend1
-rw-r--r--lib/clang/libllvmmcjit/Makefile.depend1
-rw-r--r--lib/clang/libllvmmcparser/Makefile.depend1
-rw-r--r--lib/clang/libllvmmipsasmparser/Makefile.depend1
-rw-r--r--lib/clang/libllvmmipscodegen/Makefile.depend1
-rw-r--r--lib/clang/libllvmmipsdesc/Makefile.depend1
-rw-r--r--lib/clang/libllvmmipsdisassembler/Makefile.depend1
-rw-r--r--lib/clang/libllvmmipsinfo/Makefile.depend1
-rw-r--r--lib/clang/libllvmmipsinstprinter/Makefile.depend1
-rw-r--r--lib/clang/libllvmobjcarcopts/Makefile.depend1
-rw-r--r--lib/clang/libllvmobject/Makefile.depend1
-rw-r--r--lib/clang/libllvmoption/Makefile.depend1
-rw-r--r--lib/clang/libllvmpowerpcasmparser/Makefile.depend1
-rw-r--r--lib/clang/libllvmpowerpccodegen/Makefile.depend1
-rw-r--r--lib/clang/libllvmpowerpcdesc/Makefile.depend1
-rw-r--r--lib/clang/libllvmpowerpcdisassembler/Makefile.depend1
-rw-r--r--lib/clang/libllvmpowerpcinfo/Makefile.depend1
-rw-r--r--lib/clang/libllvmpowerpcinstprinter/Makefile.depend1
-rw-r--r--lib/clang/libllvmprofiledata/Makefile.depend1
-rw-r--r--lib/clang/libllvmruntimedyld/Makefile.depend1
-rw-r--r--lib/clang/libllvmscalaropts/Makefile.depend1
-rw-r--r--lib/clang/libllvmselectiondag/Makefile.depend1
-rw-r--r--lib/clang/libllvmsparcasmparser/Makefile.depend1
-rw-r--r--lib/clang/libllvmsparccodegen/Makefile.depend1
-rw-r--r--lib/clang/libllvmsparcdesc/Makefile.depend1
-rw-r--r--lib/clang/libllvmsparcdisassembler/Makefile.depend1
-rw-r--r--lib/clang/libllvmsparcinfo/Makefile.depend1
-rw-r--r--lib/clang/libllvmsparcinstprinter/Makefile.depend1
-rw-r--r--lib/clang/libllvmsupport/Makefile.depend1
-rw-r--r--lib/clang/libllvmtablegen/Makefile.depend1
-rw-r--r--lib/clang/libllvmtarget/Makefile.depend1
-rw-r--r--lib/clang/libllvmtransformutils/Makefile.depend1
-rw-r--r--lib/clang/libllvmvectorize/Makefile.depend1
-rw-r--r--lib/clang/libllvmx86asmparser/Makefile.depend1
-rw-r--r--lib/clang/libllvmx86codegen/Makefile.depend1
-rw-r--r--lib/clang/libllvmx86desc/Makefile.depend1
-rw-r--r--lib/clang/libllvmx86disassembler/Makefile.depend1
-rw-r--r--lib/clang/libllvmx86info/Makefile.depend1
-rw-r--r--lib/clang/libllvmx86instprinter/Makefile.depend1
-rw-r--r--lib/clang/libllvmx86utils/Makefile.depend1
-rw-r--r--lib/csu/amd64/Makefile.depend1
-rw-r--r--lib/csu/arm/Makefile.depend1
-rw-r--r--lib/csu/i386/Makefile.depend1
-rw-r--r--lib/csu/mips/Makefile.depend1
-rw-r--r--lib/csu/powerpc/Makefile.depend1
-rw-r--r--lib/csu/powerpc64/Makefile.depend1
-rw-r--r--lib/csu/sparc64/Makefile.depend1
-rw-r--r--lib/libalias/libalias/Makefile.depend1
-rw-r--r--lib/libalias/modules/cuseeme/Makefile.depend3
-rw-r--r--lib/libalias/modules/dummy/Makefile.depend3
-rw-r--r--lib/libalias/modules/ftp/Makefile.depend3
-rw-r--r--lib/libalias/modules/irc/Makefile.depend3
-rw-r--r--lib/libalias/modules/nbt/Makefile.depend3
-rw-r--r--lib/libalias/modules/pptp/Makefile.depend3
-rw-r--r--lib/libalias/modules/skinny/Makefile.depend3
-rw-r--r--lib/libalias/modules/smedia/Makefile.depend3
-rw-r--r--lib/libarchive/Makefile.depend1
-rw-r--r--lib/libauditd/Makefile.depend1
-rw-r--r--lib/libbegemot/Makefile.depend1
-rw-r--r--lib/libblocksruntime/Makefile.depend1
-rw-r--r--lib/libbluetooth/Makefile.depend1
-rw-r--r--lib/libbsm/Makefile.depend1
-rw-r--r--lib/libbsnmp/libbsnmp/Makefile.depend1
-rw-r--r--lib/libbz2/Makefile.depend1
-rw-r--r--lib/libc++/Makefile.depend1
-rw-r--r--lib/libc/Makefile.depend2
-rw-r--r--lib/libc/aarch64/gen/setjmp.S2
-rw-r--r--lib/libc/arm/SYS.h4
-rw-r--r--lib/libc/arm/aeabi/aeabi_asm_double.S10
-rw-r--r--lib/libc/arm/aeabi/aeabi_asm_float.S10
-rw-r--r--lib/libc/arm/gen/_setjmp.S14
-rw-r--r--lib/libc/arm/gen/setjmp.S8
-rw-r--r--lib/libc/arm/string/ffs.S1
-rw-r--r--lib/libc/arm/string/memmove.S22
-rw-r--r--lib/libc/arm/string/memset.S22
-rw-r--r--lib/libc/arm/string/strcmp.S1
-rw-r--r--lib/libc/arm/string/strlen.S4
-rw-r--r--lib/libc/arm/string/strncmp.S3
-rw-r--r--lib/libc/arm/sys/fork.S49
-rw-r--r--lib/libc/gen/fpclassify.c10
-rw-r--r--lib/libc/gen/isinf.c8
-rw-r--r--lib/libc/mips/sys/Makefile.inc2
-rw-r--r--lib/libc/mips/sys/fork.S57
-rw-r--r--lib/libc/resolv/res_comp.c6
-rw-r--r--lib/libc/string/memmem.322
-rw-r--r--lib/libc/string/memmem.c6
-rw-r--r--lib/libc/string/strchr.38
-rw-r--r--lib/libc/xdr/xdr.c134
-rw-r--r--lib/libc/xdr/xdr_array.c23
-rw-r--r--lib/libc/xdr/xdr_float.c4
-rw-r--r--lib/libc/xdr/xdr_mem.c50
-rw-r--r--lib/libc/xdr/xdr_rec.c98
-rw-r--r--lib/libc/xdr/xdr_reference.c18
-rw-r--r--lib/libc/xdr/xdr_sizeof.c29
-rw-r--r--lib/libc/xdr/xdr_stdio.c37
-rw-r--r--lib/libc_nonshared/Makefile.depend1
-rw-r--r--lib/libcalendar/Makefile.depend1
-rw-r--r--lib/libcam/Makefile.depend1
-rw-r--r--lib/libcapsicum/Makefile.depend1
-rw-r--r--lib/libclang_rt/Makefile.inc2
-rw-r--r--lib/libcom_err/Makefile.depend2
-rw-r--r--lib/libcompat/Makefile.depend3
-rw-r--r--lib/libcompiler_rt/Makefile.depend1
-rw-r--r--lib/libcrypt/Makefile.depend2
-rw-r--r--lib/libcrypt/tests/Makefile.depend1
-rw-r--r--lib/libcrypt/tests/crypt_tests.c1
-rw-r--r--lib/libcuse/Makefile.depend1
-rw-r--r--lib/libcxxrt/Makefile.depend1
-rw-r--r--lib/libcxxrt/Makefile.depend.host1
-rw-r--r--lib/libdevinfo/Makefile.depend1
-rw-r--r--lib/libdevstat/Makefile.depend1
-rw-r--r--lib/libdevstat/devstat.c2
-rw-r--r--lib/libdpv/Makefile.depend1
-rw-r--r--lib/libdpv/dprompt.c3
-rw-r--r--lib/libdpv/dpv.c2
-rw-r--r--lib/libdwarf/Makefile.depend1
-rw-r--r--lib/libedit/Makefile.depend2
-rw-r--r--lib/libedit/edit/readline/Makefile.depend1
-rw-r--r--lib/libedit/edit/readline/readline.h17
-rw-r--r--lib/libedit/readline.c22
-rw-r--r--lib/libelf/Makefile.depend1
-rw-r--r--lib/libelftc/elftc_version.c2
-rw-r--r--lib/libevent/Makefile.depend1
-rw-r--r--lib/libexecinfo/Makefile.depend1
-rw-r--r--lib/libexpat/Makefile.depend1
-rw-r--r--lib/libfetch/Makefile.depend1
-rw-r--r--lib/libfigpar/Makefile.depend1
-rw-r--r--lib/libgeom/Makefile.depend1
-rw-r--r--lib/libgpib/Makefile.depend1
-rw-r--r--lib/libgpio/Makefile.depend1
-rw-r--r--lib/libgssapi/Makefile.depend2
-rw-r--r--lib/libgssapi/gss_accept_sec_context.c6
-rw-r--r--lib/libiconv_modules/BIG5/Makefile.depend1
-rw-r--r--lib/libiconv_modules/DECHanyu/Makefile.depend1
-rw-r--r--lib/libiconv_modules/EUC/Makefile.depend1
-rw-r--r--lib/libiconv_modules/EUCTW/Makefile.depend1
-rw-r--r--lib/libiconv_modules/GBK2K/Makefile.depend1
-rw-r--r--lib/libiconv_modules/HZ/Makefile.depend1
-rw-r--r--lib/libiconv_modules/ISO2022/Makefile.depend1
-rw-r--r--lib/libiconv_modules/JOHAB/Makefile.depend1
-rw-r--r--lib/libiconv_modules/MSKanji/Makefile.depend1
-rw-r--r--lib/libiconv_modules/UES/Makefile.depend1
-rw-r--r--lib/libiconv_modules/UTF1632/Makefile.depend1
-rw-r--r--lib/libiconv_modules/UTF7/Makefile.depend1
-rw-r--r--lib/libiconv_modules/UTF7/citrus_utf7.c49
-rw-r--r--lib/libiconv_modules/UTF8/Makefile.depend1
-rw-r--r--lib/libiconv_modules/VIQR/Makefile.depend1
-rw-r--r--lib/libiconv_modules/ZW/Makefile.depend1
-rw-r--r--lib/libiconv_modules/iconv_none/Makefile.depend1
-rw-r--r--lib/libiconv_modules/iconv_std/Makefile.depend1
-rw-r--r--lib/libiconv_modules/mapper_646/Makefile.depend1
-rw-r--r--lib/libiconv_modules/mapper_none/Makefile.depend1
-rw-r--r--lib/libiconv_modules/mapper_parallel/Makefile.depend1
-rw-r--r--lib/libiconv_modules/mapper_serial/Makefile.depend1
-rw-r--r--lib/libiconv_modules/mapper_std/Makefile.depend1
-rw-r--r--lib/libiconv_modules/mapper_zone/Makefile.depend1
-rw-r--r--lib/libipsec/Makefile.depend1
-rw-r--r--lib/libjail/Makefile.depend1
-rw-r--r--lib/libkiconv/Makefile.depend1
-rw-r--r--lib/libkvm/Makefile.depend1
-rw-r--r--lib/libldns/Makefile.depend2
-rw-r--r--lib/liblzma/Makefile.depend1
-rw-r--r--lib/libmagic/Makefile.depend1
-rw-r--r--lib/libmagic/config.h18
-rw-r--r--lib/libmd/Makefile.depend3
-rw-r--r--lib/libmd/Makefile.depend.host4
-rw-r--r--lib/libmemstat/Makefile.depend1
-rw-r--r--lib/libmilter/Makefile.depend1
-rw-r--r--lib/libmp/Makefile.depend1
-rw-r--r--lib/libmt/Makefile.depend1
-rw-r--r--lib/libnetbsd/Makefile.depend1
-rw-r--r--lib/libnetgraph/Makefile.depend1
-rw-r--r--lib/libngatm/Makefile.depend1
-rw-r--r--lib/libnv/Makefile.depend1
-rw-r--r--lib/libohash/Makefile.depend1
-rw-r--r--lib/libopie/Makefile.depend2
-rw-r--r--lib/libpam/libpam/Makefile.depend2
-rw-r--r--lib/libpam/modules/pam_chroot/Makefile.depend5
-rw-r--r--lib/libpam/modules/pam_deny/Makefile.depend5
-rw-r--r--lib/libpam/modules/pam_echo/Makefile.depend5
-rw-r--r--lib/libpam/modules/pam_exec/Makefile.depend5
-rw-r--r--lib/libpam/modules/pam_ftpusers/Makefile.depend5
-rw-r--r--lib/libpam/modules/pam_group/Makefile.depend5
-rw-r--r--lib/libpam/modules/pam_guest/Makefile.depend5
-rw-r--r--lib/libpam/modules/pam_krb5/Makefile.depend9
-rw-r--r--lib/libpam/modules/pam_ksu/Makefile.depend10
-rw-r--r--lib/libpam/modules/pam_lastlog/Makefile.depend5
-rw-r--r--lib/libpam/modules/pam_login_access/Makefile.depend5
-rw-r--r--lib/libpam/modules/pam_nologin/Makefile.depend4
-rw-r--r--lib/libpam/modules/pam_opie/Makefile.depend4
-rw-r--r--lib/libpam/modules/pam_opieaccess/Makefile.depend4
-rw-r--r--lib/libpam/modules/pam_passwdqc/Makefile.depend4
-rw-r--r--lib/libpam/modules/pam_permit/Makefile.depend5
-rw-r--r--lib/libpam/modules/pam_radius/Makefile.depend4
-rw-r--r--lib/libpam/modules/pam_rhosts/Makefile.depend5
-rw-r--r--lib/libpam/modules/pam_rootok/Makefile.depend5
-rw-r--r--lib/libpam/modules/pam_securetty/Makefile.depend5
-rw-r--r--lib/libpam/modules/pam_self/Makefile.depend5
-rw-r--r--lib/libpam/modules/pam_ssh/Makefile.depend5
-rw-r--r--lib/libpam/modules/pam_tacplus/Makefile.depend4
-rw-r--r--lib/libpam/modules/pam_unix/Makefile.depend4
-rw-r--r--lib/libpam/static_modules/Makefile11
-rw-r--r--lib/libpam/static_modules/Makefile.depend5
-rw-r--r--lib/libpcap/Makefile.depend1
-rw-r--r--lib/libpmc/Makefile.depend1
-rw-r--r--lib/libpmc/libpmc.c63
-rw-r--r--lib/libproc/Makefile.depend1
-rw-r--r--lib/libprocstat/Makefile.depend2
-rw-r--r--lib/libprocstat/libprocstat.c4
-rw-r--r--lib/libprocstat/zfs/Makefile.depend1
-rw-r--r--lib/libradius/Makefile.depend2
-rw-r--r--lib/librpcsec_gss/Makefile.depend1
-rw-r--r--lib/librpcsvc/Makefile.depend1
-rw-r--r--lib/librt/Makefile.depend1
-rw-r--r--lib/librtld_db/Makefile.depend1
-rw-r--r--lib/libsbuf/Makefile2
-rw-r--r--lib/libsbuf/Makefile.depend1
-rw-r--r--lib/libsbuf/Symbol.map4
-rw-r--r--lib/libsbuf/Version.def3
-rw-r--r--lib/libsdp/Makefile.depend1
-rw-r--r--lib/libsm/Makefile.depend1
-rw-r--r--lib/libsmb/Makefile.depend1
-rw-r--r--lib/libsmdb/Makefile.depend1
-rw-r--r--lib/libsmutil/Makefile.depend1
-rw-r--r--lib/libsqlite3/Makefile.depend1
-rw-r--r--lib/libstand/Makefile.depend1
-rw-r--r--lib/libstdbuf/Makefile.depend1
-rw-r--r--lib/libstdthreads/Makefile.depend1
-rw-r--r--lib/libtacplus/Makefile.depend4
-rw-r--r--lib/libtelnet/Makefile.depend1
-rw-r--r--lib/libthr/Makefile.depend3
-rw-r--r--lib/libthread_db/Makefile.depend1
-rw-r--r--lib/libucl/Makefile.depend1
-rw-r--r--lib/libufs/Makefile.depend1
-rw-r--r--lib/libugidfw/Makefile.depend1
-rw-r--r--lib/libugidfw/ugidfw.c18
-rw-r--r--lib/libulog/Makefile.depend2
-rw-r--r--lib/libunbound/Makefile.depend1
-rw-r--r--lib/libusb/Makefile.depend1
-rw-r--r--lib/libusbhid/Makefile.depend1
-rw-r--r--lib/libutil/Makefile8
-rw-r--r--lib/libutil/Makefile.depend2
-rw-r--r--lib/libutil/hexdump.319
-rw-r--r--lib/libutil/kinfo_getallproc.33
-rw-r--r--lib/libutil/kinfo_getfile.33
-rw-r--r--lib/libutil/kinfo_getproc.33
-rw-r--r--lib/libutil/kinfo_getvmmap.33
-rw-r--r--lib/libutil/kinfo_getvmobject.374
-rw-r--r--lib/libutil/kinfo_getvmobject.c (renamed from usr.bin/csup/token.l)107
-rw-r--r--lib/libutil/libutil.h2
-rw-r--r--lib/libutil/pw_util.34
-rw-r--r--lib/libvgl/Makefile.depend1
-rw-r--r--lib/libvmmapi/Makefile.depend1
-rw-r--r--lib/libwrap/Makefile.depend1
-rw-r--r--lib/libxo/Makefile.depend1
-rw-r--r--lib/liby/Makefile.depend1
-rw-r--r--lib/libypclnt/Makefile.depend2
-rw-r--r--lib/libz/Makefile.depend3
-rw-r--r--lib/msun/Makefile.depend3
-rw-r--r--lib/ncurses/form/Makefile.depend1
-rw-r--r--lib/ncurses/formw/Makefile.depend1
-rw-r--r--lib/ncurses/menu/Makefile.depend1
-rw-r--r--lib/ncurses/menuw/Makefile.depend1
-rw-r--r--lib/ncurses/ncurses/Makefile.depend1
-rw-r--r--lib/ncurses/ncursesw/Makefile.depend1
-rw-r--r--lib/ncurses/panel/Makefile.depend1
-rw-r--r--lib/ncurses/panelw/Makefile.depend1
-rw-r--r--libexec/atf/atf-check/Makefile.depend1
-rw-r--r--libexec/atf/atf-sh/Makefile.depend1
-rw-r--r--libexec/atrun/Makefile.depend1
-rw-r--r--libexec/bootpd/Makefile.depend1
-rw-r--r--libexec/bootpd/bootpgw/Makefile.depend1
-rw-r--r--libexec/bootpd/tools/bootpef/Makefile.depend1
-rw-r--r--libexec/bootpd/tools/bootptest/Makefile.depend1
-rw-r--r--libexec/comsat/Makefile.depend1
-rw-r--r--libexec/fingerd/Makefile.depend1
-rw-r--r--libexec/ftpd/Makefile2
-rw-r--r--libexec/ftpd/Makefile.depend1
-rw-r--r--libexec/getty/Makefile.depend1
-rw-r--r--libexec/mail.local/Makefile.depend1
-rw-r--r--libexec/mknetid/Makefile.depend1
-rw-r--r--libexec/pppoed/Makefile.depend1
-rw-r--r--libexec/rbootd/Makefile.depend1
-rw-r--r--libexec/revnetgroup/Makefile.depend1
-rw-r--r--libexec/rlogind/Makefile.depend1
-rw-r--r--libexec/rpc.rquotad/Makefile.depend1
-rw-r--r--libexec/rpc.rstatd/Makefile.depend1
-rw-r--r--libexec/rpc.rusersd/Makefile.depend1
-rw-r--r--libexec/rpc.rwalld/Makefile.depend1
-rw-r--r--libexec/rpc.sprayd/Makefile.depend1
-rw-r--r--libexec/rshd/Makefile.depend1
-rw-r--r--libexec/rtld-elf/Makefile.depend1
-rw-r--r--libexec/save-entropy/Makefile.depend1
-rw-r--r--libexec/smrsh/Makefile.depend1
-rw-r--r--libexec/talkd/Makefile.depend1
-rw-r--r--libexec/tcpd/Makefile.depend1
-rw-r--r--libexec/telnetd/Makefile.depend1
-rw-r--r--libexec/tftp-proxy/Makefile.depend1
-rw-r--r--libexec/tftpd/Makefile.depend1
-rw-r--r--libexec/ulog-helper/Makefile.depend1
-rw-r--r--libexec/ypxfr/Makefile.depend1
-rw-r--r--libexec/ypxfr/ypxfr_main.c4
-rw-r--r--release/Makefile.ec28
-rw-r--r--release/Makefile.mirrors107
-rw-r--r--release/arm/BEAGLEBONE.conf4
-rw-r--r--release/arm/CUBOX-HUMMINGBOARD.conf39
-rw-r--r--release/arm/GUMSTIX.conf37
-rw-r--r--release/arm/PANDABOARD.conf4
-rw-r--r--release/arm/RPI-B.conf2
-rw-r--r--release/arm/RPI2.conf4
-rw-r--r--release/arm/WANDBOARD.conf8
-rw-r--r--release/tools/arm.subr12
-rw-r--r--rescue/librescue/Makefile.depend1
-rw-r--r--sbin/adjkerntz/Makefile.depend1
-rw-r--r--sbin/atm/atmconfig/Makefile.depend1
-rw-r--r--sbin/badsect/Makefile1
-rw-r--r--sbin/badsect/Makefile.depend1
-rw-r--r--sbin/bsdlabel/Makefile.depend1
-rw-r--r--sbin/camcontrol/Makefile2
-rw-r--r--sbin/camcontrol/Makefile.depend1
-rw-r--r--sbin/camcontrol/attrib.c509
-rw-r--r--sbin/camcontrol/camcontrol.8145
-rw-r--r--sbin/camcontrol/camcontrol.c30
-rw-r--r--sbin/camcontrol/camcontrol.h3
-rw-r--r--sbin/camcontrol/persist.c4
-rw-r--r--sbin/ccdconfig/Makefile.depend1
-rw-r--r--sbin/clri/Makefile.depend1
-rw-r--r--sbin/comcontrol/Makefile.depend1
-rw-r--r--sbin/conscontrol/Makefile.depend1
-rw-r--r--sbin/ddb/Makefile.depend1
-rw-r--r--sbin/devd/Makefile.depend1
-rw-r--r--sbin/devfs/Makefile.depend1
-rw-r--r--sbin/dhclient/Makefile.depend1
-rw-r--r--sbin/dhclient/dhclient.c8
-rw-r--r--sbin/dmesg/Makefile.depend1
-rw-r--r--sbin/dump/Makefile.depend1
-rw-r--r--sbin/dumpfs/Makefile.depend1
-rw-r--r--sbin/dumpfs/dumpfs.c2
-rw-r--r--sbin/dumpon/Makefile.depend1
-rw-r--r--sbin/etherswitchcfg/Makefile.depend1
-rw-r--r--sbin/fdisk/Makefile.depend1
-rw-r--r--sbin/fdisk_pc98/Makefile.depend1
-rw-r--r--sbin/ffsinfo/Makefile.depend1
-rw-r--r--sbin/fsck/Makefile.depend1
-rw-r--r--sbin/fsck_ffs/Makefile.depend1
-rw-r--r--sbin/fsck_msdosfs/Makefile.depend1
-rw-r--r--sbin/fsdb/Makefile.depend1
-rw-r--r--sbin/fsirand/Makefile.depend1
-rw-r--r--sbin/gbde/Makefile.depend1
-rw-r--r--sbin/geom/class/cache/Makefile.depend1
-rw-r--r--sbin/geom/class/concat/Makefile.depend1
-rw-r--r--sbin/geom/class/eli/Makefile.depend1
-rw-r--r--sbin/geom/class/eli/geom_eli.c2
-rw-r--r--sbin/geom/class/journal/Makefile.depend1
-rw-r--r--sbin/geom/class/label/Makefile.depend1
-rw-r--r--sbin/geom/class/mirror/Makefile.depend1
-rw-r--r--sbin/geom/class/mountver/Makefile.depend1
-rw-r--r--sbin/geom/class/multipath/Makefile.depend1
-rw-r--r--sbin/geom/class/multipath/gmultipath.818
-rw-r--r--sbin/geom/class/nop/Makefile.depend1
-rw-r--r--sbin/geom/class/part/Makefile.depend1
-rw-r--r--sbin/geom/class/raid/Makefile.depend1
-rw-r--r--sbin/geom/class/raid3/Makefile.depend1
-rw-r--r--sbin/geom/class/sched/Makefile.depend1
-rw-r--r--sbin/geom/class/shsec/Makefile.depend1
-rw-r--r--sbin/geom/class/stripe/Makefile.depend1
-rw-r--r--sbin/geom/class/virstor/Makefile.depend1
-rw-r--r--sbin/geom/core/Makefile.depend1
-rw-r--r--sbin/ggate/ggatec/Makefile.depend1
-rw-r--r--sbin/ggate/ggated/Makefile.depend1
-rw-r--r--sbin/ggate/ggatel/Makefile.depend1
-rw-r--r--sbin/growfs/Makefile.depend1
-rw-r--r--sbin/gvinum/Makefile.depend1
-rw-r--r--sbin/hastctl/Makefile.depend1
-rw-r--r--sbin/hastd/Makefile.depend1
-rw-r--r--sbin/ifconfig/Makefile.depend1
-rw-r--r--sbin/init/Makefile.depend1
-rw-r--r--sbin/ipf/ipf/Makefile.depend1
-rw-r--r--sbin/ipf/ipfs/Makefile.depend1
-rw-r--r--sbin/ipf/ipfstat/Makefile.depend1
-rw-r--r--sbin/ipf/ipftest/Makefile.depend1
-rw-r--r--sbin/ipf/ipmon/Makefile.depend1
-rw-r--r--sbin/ipf/ipnat/Makefile.depend1
-rw-r--r--sbin/ipf/ippool/Makefile.depend1
-rw-r--r--sbin/ipf/ipresend/Makefile.depend1
-rw-r--r--sbin/ipf/libipf/Makefile.depend1
-rw-r--r--sbin/ipfw/Makefile.depend1
-rw-r--r--sbin/iscontrol/Makefile.depend1
-rw-r--r--sbin/kldconfig/Makefile.depend1
-rw-r--r--sbin/kldload/Makefile.depend1
-rw-r--r--sbin/kldstat/Makefile.depend1
-rw-r--r--sbin/kldunload/Makefile.depend1
-rw-r--r--sbin/ldconfig/Makefile.depend1
-rw-r--r--sbin/mca/Makefile5
-rw-r--r--sbin/mca/Makefile.depend19
-rw-r--r--sbin/mca/mca.873
-rw-r--r--sbin/mca/mca.c547
-rw-r--r--sbin/md5/Makefile.depend1
-rw-r--r--sbin/mdconfig/Makefile.depend1
-rw-r--r--sbin/mdmfs/Makefile.depend1
-rw-r--r--sbin/mknod/Makefile.depend1
-rw-r--r--sbin/mksnap_ffs/Makefile.depend1
-rw-r--r--sbin/mount/Makefile.depend1
-rw-r--r--sbin/mount_cd9660/Makefile.depend1
-rw-r--r--sbin/mount_fusefs/Makefile.depend1
-rw-r--r--sbin/mount_msdosfs/Makefile.depend1
-rw-r--r--sbin/mount_nfs/Makefile.depend1
-rw-r--r--sbin/mount_nullfs/Makefile.depend1
-rw-r--r--sbin/mount_udf/Makefile.depend1
-rw-r--r--sbin/mount_unionfs/Makefile.depend1
-rw-r--r--sbin/natd/Makefile.depend1
-rw-r--r--sbin/newfs/Makefile.depend1
-rw-r--r--sbin/newfs_msdos/Makefile.depend1
-rw-r--r--sbin/nfsiod/Makefile.depend1
-rw-r--r--sbin/nos-tun/Makefile.depend1
-rw-r--r--sbin/nvmecontrol/Makefile.depend1
-rw-r--r--sbin/pfctl/Makefile.depend1
-rw-r--r--sbin/pflogd/Makefile.depend1
-rw-r--r--sbin/ping/Makefile.depend1
-rw-r--r--sbin/ping6/Makefile.depend1
-rw-r--r--sbin/quotacheck/Makefile.depend1
-rw-r--r--sbin/rcorder/Makefile.depend1
-rw-r--r--sbin/reboot/Makefile.depend1
-rw-r--r--sbin/recoverdisk/Makefile.depend1
-rw-r--r--sbin/resolvconf/Makefile.depend1
-rw-r--r--sbin/restore/Makefile.depend1
-rw-r--r--sbin/route/Makefile.depend1
-rw-r--r--sbin/routed/Makefile.depend1
-rw-r--r--sbin/routed/rtquery/Makefile.depend1
-rw-r--r--sbin/rtsol/Makefile.depend1
-rw-r--r--sbin/savecore/Makefile.depend1
-rw-r--r--sbin/sconfig/Makefile.depend1
-rw-r--r--sbin/setkey/Makefile.depend1
-rw-r--r--sbin/shutdown/Makefile.depend1
-rw-r--r--sbin/spppcontrol/Makefile.depend1
-rw-r--r--sbin/sunlabel/Makefile.depend1
-rw-r--r--sbin/swapon/Makefile.depend1
-rw-r--r--sbin/sysctl/Makefile.depend1
-rw-r--r--sbin/tunefs/Makefile.depend1
-rw-r--r--sbin/umount/Makefile.depend1
-rw-r--r--secure/lib/libcrypto/Makefile.depend2
-rw-r--r--secure/lib/libcrypto/Makefile.inc4
-rw-r--r--secure/lib/libcrypto/engines/lib4758cca/Makefile.depend1
-rw-r--r--secure/lib/libcrypto/engines/libaep/Makefile.depend1
-rw-r--r--secure/lib/libcrypto/engines/libatalla/Makefile.depend1
-rw-r--r--secure/lib/libcrypto/engines/libchil/Makefile.depend1
-rw-r--r--secure/lib/libcrypto/engines/libcswift/Makefile.depend1
-rw-r--r--secure/lib/libcrypto/engines/libgost/Makefile.depend1
-rw-r--r--secure/lib/libcrypto/engines/libnuron/Makefile.depend1
-rw-r--r--secure/lib/libcrypto/engines/libsureware/Makefile.depend1
-rw-r--r--secure/lib/libcrypto/engines/libubsec/Makefile.depend1
-rw-r--r--secure/lib/libcrypto/man/ASN1_OBJECT_new.34
-rw-r--r--secure/lib/libcrypto/man/ASN1_STRING_length.34
-rw-r--r--secure/lib/libcrypto/man/ASN1_STRING_new.34
-rw-r--r--secure/lib/libcrypto/man/ASN1_STRING_print_ex.34
-rw-r--r--secure/lib/libcrypto/man/ASN1_generate_nconf.34
-rw-r--r--secure/lib/libcrypto/man/BIO_ctrl.34
-rw-r--r--secure/lib/libcrypto/man/BIO_f_base64.34
-rw-r--r--secure/lib/libcrypto/man/BIO_f_buffer.34
-rw-r--r--secure/lib/libcrypto/man/BIO_f_cipher.34
-rw-r--r--secure/lib/libcrypto/man/BIO_f_md.34
-rw-r--r--secure/lib/libcrypto/man/BIO_f_null.34
-rw-r--r--secure/lib/libcrypto/man/BIO_f_ssl.34
-rw-r--r--secure/lib/libcrypto/man/BIO_find_type.34
-rw-r--r--secure/lib/libcrypto/man/BIO_new.34
-rw-r--r--secure/lib/libcrypto/man/BIO_new_CMS.34
-rw-r--r--secure/lib/libcrypto/man/BIO_push.34
-rw-r--r--secure/lib/libcrypto/man/BIO_read.34
-rw-r--r--secure/lib/libcrypto/man/BIO_s_accept.34
-rw-r--r--secure/lib/libcrypto/man/BIO_s_bio.34
-rw-r--r--secure/lib/libcrypto/man/BIO_s_connect.34
-rw-r--r--secure/lib/libcrypto/man/BIO_s_fd.34
-rw-r--r--secure/lib/libcrypto/man/BIO_s_file.34
-rw-r--r--secure/lib/libcrypto/man/BIO_s_mem.34
-rw-r--r--secure/lib/libcrypto/man/BIO_s_null.34
-rw-r--r--secure/lib/libcrypto/man/BIO_s_socket.34
-rw-r--r--secure/lib/libcrypto/man/BIO_set_callback.34
-rw-r--r--secure/lib/libcrypto/man/BIO_should_retry.34
-rw-r--r--secure/lib/libcrypto/man/BN_BLINDING_new.34
-rw-r--r--secure/lib/libcrypto/man/BN_CTX_new.34
-rw-r--r--secure/lib/libcrypto/man/BN_CTX_start.34
-rw-r--r--secure/lib/libcrypto/man/BN_add.34
-rw-r--r--secure/lib/libcrypto/man/BN_add_word.34
-rw-r--r--secure/lib/libcrypto/man/BN_bn2bin.34
-rw-r--r--secure/lib/libcrypto/man/BN_cmp.34
-rw-r--r--secure/lib/libcrypto/man/BN_copy.34
-rw-r--r--secure/lib/libcrypto/man/BN_generate_prime.34
-rw-r--r--secure/lib/libcrypto/man/BN_mod_inverse.34
-rw-r--r--secure/lib/libcrypto/man/BN_mod_mul_montgomery.34
-rw-r--r--secure/lib/libcrypto/man/BN_mod_mul_reciprocal.34
-rw-r--r--secure/lib/libcrypto/man/BN_new.34
-rw-r--r--secure/lib/libcrypto/man/BN_num_bytes.34
-rw-r--r--secure/lib/libcrypto/man/BN_rand.37
-rw-r--r--secure/lib/libcrypto/man/BN_set_bit.312
-rw-r--r--secure/lib/libcrypto/man/BN_swap.34
-rw-r--r--secure/lib/libcrypto/man/BN_zero.34
-rw-r--r--secure/lib/libcrypto/man/CMS_add0_cert.34
-rw-r--r--secure/lib/libcrypto/man/CMS_add1_recipient_cert.34
-rw-r--r--secure/lib/libcrypto/man/CMS_add1_signer.34
-rw-r--r--secure/lib/libcrypto/man/CMS_compress.34
-rw-r--r--secure/lib/libcrypto/man/CMS_decrypt.34
-rw-r--r--secure/lib/libcrypto/man/CMS_encrypt.34
-rw-r--r--secure/lib/libcrypto/man/CMS_final.34
-rw-r--r--secure/lib/libcrypto/man/CMS_get0_RecipientInfos.34
-rw-r--r--secure/lib/libcrypto/man/CMS_get0_SignerInfos.34
-rw-r--r--secure/lib/libcrypto/man/CMS_get0_type.34
-rw-r--r--secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.34
-rw-r--r--secure/lib/libcrypto/man/CMS_sign.34
-rw-r--r--secure/lib/libcrypto/man/CMS_sign_receipt.34
-rw-r--r--secure/lib/libcrypto/man/CMS_uncompress.34
-rw-r--r--secure/lib/libcrypto/man/CMS_verify.34
-rw-r--r--secure/lib/libcrypto/man/CMS_verify_receipt.34
-rw-r--r--secure/lib/libcrypto/man/CONF_modules_free.34
-rw-r--r--secure/lib/libcrypto/man/CONF_modules_load_file.34
-rw-r--r--secure/lib/libcrypto/man/CRYPTO_set_ex_data.34
-rw-r--r--secure/lib/libcrypto/man/DH_generate_key.34
-rw-r--r--secure/lib/libcrypto/man/DH_generate_parameters.34
-rw-r--r--secure/lib/libcrypto/man/DH_get_ex_new_index.34
-rw-r--r--secure/lib/libcrypto/man/DH_new.34
-rw-r--r--secure/lib/libcrypto/man/DH_set_method.34
-rw-r--r--secure/lib/libcrypto/man/DH_size.34
-rw-r--r--secure/lib/libcrypto/man/DSA_SIG_new.34
-rw-r--r--secure/lib/libcrypto/man/DSA_do_sign.34
-rw-r--r--secure/lib/libcrypto/man/DSA_dup_DH.34
-rw-r--r--secure/lib/libcrypto/man/DSA_generate_key.34
-rw-r--r--secure/lib/libcrypto/man/DSA_generate_parameters.34
-rw-r--r--secure/lib/libcrypto/man/DSA_get_ex_new_index.34
-rw-r--r--secure/lib/libcrypto/man/DSA_new.34
-rw-r--r--secure/lib/libcrypto/man/DSA_set_method.34
-rw-r--r--secure/lib/libcrypto/man/DSA_sign.34
-rw-r--r--secure/lib/libcrypto/man/DSA_size.34
-rw-r--r--secure/lib/libcrypto/man/ERR_GET_LIB.34
-rw-r--r--secure/lib/libcrypto/man/ERR_clear_error.34
-rw-r--r--secure/lib/libcrypto/man/ERR_error_string.34
-rw-r--r--secure/lib/libcrypto/man/ERR_get_error.34
-rw-r--r--secure/lib/libcrypto/man/ERR_load_crypto_strings.34
-rw-r--r--secure/lib/libcrypto/man/ERR_load_strings.34
-rw-r--r--secure/lib/libcrypto/man/ERR_print_errors.34
-rw-r--r--secure/lib/libcrypto/man/ERR_put_error.34
-rw-r--r--secure/lib/libcrypto/man/ERR_remove_state.34
-rw-r--r--secure/lib/libcrypto/man/ERR_set_mark.34
-rw-r--r--secure/lib/libcrypto/man/EVP_BytesToKey.34
-rw-r--r--secure/lib/libcrypto/man/EVP_DigestInit.34
-rw-r--r--secure/lib/libcrypto/man/EVP_DigestSignInit.34
-rw-r--r--secure/lib/libcrypto/man/EVP_DigestVerifyInit.34
-rw-r--r--secure/lib/libcrypto/man/EVP_EncryptInit.34
-rw-r--r--secure/lib/libcrypto/man/EVP_OpenInit.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_CTX_new.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_cmp.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_decrypt.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_derive.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_encrypt.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_keygen.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_new.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_print_private.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_sign.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_verify.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_verify_recover.34
-rw-r--r--secure/lib/libcrypto/man/EVP_SealInit.34
-rw-r--r--secure/lib/libcrypto/man/EVP_SignInit.34
-rw-r--r--secure/lib/libcrypto/man/EVP_VerifyInit.34
-rw-r--r--secure/lib/libcrypto/man/OBJ_nid2obj.34
-rw-r--r--secure/lib/libcrypto/man/OPENSSL_Applink.34
-rw-r--r--secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.34
-rw-r--r--secure/lib/libcrypto/man/OPENSSL_config.34
-rw-r--r--secure/lib/libcrypto/man/OPENSSL_ia32cap.34
-rw-r--r--secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.34
-rw-r--r--secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.34
-rw-r--r--secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.34
-rw-r--r--secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.34
-rw-r--r--secure/lib/libcrypto/man/PKCS12_create.34
-rw-r--r--secure/lib/libcrypto/man/PKCS12_parse.34
-rw-r--r--secure/lib/libcrypto/man/PKCS7_decrypt.34
-rw-r--r--secure/lib/libcrypto/man/PKCS7_encrypt.34
-rw-r--r--secure/lib/libcrypto/man/PKCS7_sign.34
-rw-r--r--secure/lib/libcrypto/man/PKCS7_sign_add_signer.34
-rw-r--r--secure/lib/libcrypto/man/PKCS7_verify.34
-rw-r--r--secure/lib/libcrypto/man/RAND_add.34
-rw-r--r--secure/lib/libcrypto/man/RAND_bytes.34
-rw-r--r--secure/lib/libcrypto/man/RAND_cleanup.34
-rw-r--r--secure/lib/libcrypto/man/RAND_egd.34
-rw-r--r--secure/lib/libcrypto/man/RAND_load_file.34
-rw-r--r--secure/lib/libcrypto/man/RAND_set_rand_method.34
-rw-r--r--secure/lib/libcrypto/man/RSA_blinding_on.34
-rw-r--r--secure/lib/libcrypto/man/RSA_check_key.34
-rw-r--r--secure/lib/libcrypto/man/RSA_generate_key.34
-rw-r--r--secure/lib/libcrypto/man/RSA_get_ex_new_index.34
-rw-r--r--secure/lib/libcrypto/man/RSA_new.34
-rw-r--r--secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.34
-rw-r--r--secure/lib/libcrypto/man/RSA_print.34
-rw-r--r--secure/lib/libcrypto/man/RSA_private_encrypt.34
-rw-r--r--secure/lib/libcrypto/man/RSA_public_encrypt.34
-rw-r--r--secure/lib/libcrypto/man/RSA_set_method.34
-rw-r--r--secure/lib/libcrypto/man/RSA_sign.34
-rw-r--r--secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.34
-rw-r--r--secure/lib/libcrypto/man/RSA_size.34
-rw-r--r--secure/lib/libcrypto/man/SMIME_read_CMS.34
-rw-r--r--secure/lib/libcrypto/man/SMIME_read_PKCS7.34
-rw-r--r--secure/lib/libcrypto/man/SMIME_write_CMS.34
-rw-r--r--secure/lib/libcrypto/man/SMIME_write_PKCS7.34
-rw-r--r--secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.34
-rw-r--r--secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.34
-rw-r--r--secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.34
-rw-r--r--secure/lib/libcrypto/man/X509_NAME_print_ex.34
-rw-r--r--secure/lib/libcrypto/man/X509_STORE_CTX_get_error.34
-rw-r--r--secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.34
-rw-r--r--secure/lib/libcrypto/man/X509_STORE_CTX_new.34
-rw-r--r--secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.34
-rw-r--r--secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.34
-rw-r--r--secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.312
-rw-r--r--secure/lib/libcrypto/man/X509_new.34
-rw-r--r--secure/lib/libcrypto/man/X509_verify_cert.34
-rw-r--r--secure/lib/libcrypto/man/bio.34
-rw-r--r--secure/lib/libcrypto/man/blowfish.34
-rw-r--r--secure/lib/libcrypto/man/bn.34
-rw-r--r--secure/lib/libcrypto/man/bn_internal.34
-rw-r--r--secure/lib/libcrypto/man/buffer.34
-rw-r--r--secure/lib/libcrypto/man/crypto.34
-rw-r--r--secure/lib/libcrypto/man/d2i_ASN1_OBJECT.34
-rw-r--r--secure/lib/libcrypto/man/d2i_CMS_ContentInfo.34
-rw-r--r--secure/lib/libcrypto/man/d2i_DHparams.34
-rw-r--r--secure/lib/libcrypto/man/d2i_DSAPublicKey.34
-rw-r--r--secure/lib/libcrypto/man/d2i_ECPrivateKey.34
-rw-r--r--secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.34
-rw-r--r--secure/lib/libcrypto/man/d2i_RSAPublicKey.34
-rw-r--r--secure/lib/libcrypto/man/d2i_X509.34
-rw-r--r--secure/lib/libcrypto/man/d2i_X509_ALGOR.34
-rw-r--r--secure/lib/libcrypto/man/d2i_X509_CRL.34
-rw-r--r--secure/lib/libcrypto/man/d2i_X509_NAME.34
-rw-r--r--secure/lib/libcrypto/man/d2i_X509_REQ.34
-rw-r--r--secure/lib/libcrypto/man/d2i_X509_SIG.34
-rw-r--r--secure/lib/libcrypto/man/des.34
-rw-r--r--secure/lib/libcrypto/man/dh.34
-rw-r--r--secure/lib/libcrypto/man/dsa.34
-rw-r--r--secure/lib/libcrypto/man/ecdsa.34
-rw-r--r--secure/lib/libcrypto/man/engine.34
-rw-r--r--secure/lib/libcrypto/man/err.34
-rw-r--r--secure/lib/libcrypto/man/evp.34
-rw-r--r--secure/lib/libcrypto/man/hmac.34
-rw-r--r--secure/lib/libcrypto/man/i2d_CMS_bio_stream.34
-rw-r--r--secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.34
-rw-r--r--secure/lib/libcrypto/man/lh_stats.34
-rw-r--r--secure/lib/libcrypto/man/lhash.34
-rw-r--r--secure/lib/libcrypto/man/md5.34
-rw-r--r--secure/lib/libcrypto/man/mdc2.34
-rw-r--r--secure/lib/libcrypto/man/pem.331
-rw-r--r--secure/lib/libcrypto/man/rand.34
-rw-r--r--secure/lib/libcrypto/man/rc4.34
-rw-r--r--secure/lib/libcrypto/man/ripemd.34
-rw-r--r--secure/lib/libcrypto/man/rsa.34
-rw-r--r--secure/lib/libcrypto/man/sha.34
-rw-r--r--secure/lib/libcrypto/man/threads.34
-rw-r--r--secure/lib/libcrypto/man/ui.34
-rw-r--r--secure/lib/libcrypto/man/ui_compat.34
-rw-r--r--secure/lib/libcrypto/man/x509.34
-rw-r--r--secure/lib/libssh/Makefile.depend2
-rw-r--r--secure/lib/libssl/Makefile.depend2
-rw-r--r--secure/lib/libssl/man/SSL_CIPHER_get_name.34
-rw-r--r--secure/lib/libssl/man/SSL_COMP_add_compression_method.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_add_session.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_ctrl.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_flush_sessions.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_free.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_get_ex_new_index.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_get_verify_mode.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_load_verify_locations.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_new.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_sess_number.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_sessions.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_cert_store.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_cipher_list.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_client_CA_list.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_generate_session_id.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_info_callback.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_max_cert_list.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_mode.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_msg_callback.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_options.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_read_ahead.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_session_id_context.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_ssl_version.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_timeout.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3112
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_verify.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_use_certificate.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.34
-rw-r--r--secure/lib/libssl/man/SSL_SESSION_free.34
-rw-r--r--secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.34
-rw-r--r--secure/lib/libssl/man/SSL_SESSION_get_time.34
-rw-r--r--secure/lib/libssl/man/SSL_accept.34
-rw-r--r--secure/lib/libssl/man/SSL_alert_type_string.34
-rw-r--r--secure/lib/libssl/man/SSL_clear.34
-rw-r--r--secure/lib/libssl/man/SSL_connect.34
-rw-r--r--secure/lib/libssl/man/SSL_do_handshake.34
-rw-r--r--secure/lib/libssl/man/SSL_free.34
-rw-r--r--secure/lib/libssl/man/SSL_get_SSL_CTX.34
-rw-r--r--secure/lib/libssl/man/SSL_get_ciphers.34
-rw-r--r--secure/lib/libssl/man/SSL_get_client_CA_list.34
-rw-r--r--secure/lib/libssl/man/SSL_get_current_cipher.34
-rw-r--r--secure/lib/libssl/man/SSL_get_default_timeout.34
-rw-r--r--secure/lib/libssl/man/SSL_get_error.34
-rw-r--r--secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.34
-rw-r--r--secure/lib/libssl/man/SSL_get_ex_new_index.34
-rw-r--r--secure/lib/libssl/man/SSL_get_fd.34
-rw-r--r--secure/lib/libssl/man/SSL_get_peer_cert_chain.34
-rw-r--r--secure/lib/libssl/man/SSL_get_peer_certificate.34
-rw-r--r--secure/lib/libssl/man/SSL_get_psk_identity.34
-rw-r--r--secure/lib/libssl/man/SSL_get_rbio.34
-rw-r--r--secure/lib/libssl/man/SSL_get_session.34
-rw-r--r--secure/lib/libssl/man/SSL_get_verify_result.34
-rw-r--r--secure/lib/libssl/man/SSL_get_version.34
-rw-r--r--secure/lib/libssl/man/SSL_library_init.34
-rw-r--r--secure/lib/libssl/man/SSL_load_client_CA_file.34
-rw-r--r--secure/lib/libssl/man/SSL_new.34
-rw-r--r--secure/lib/libssl/man/SSL_pending.34
-rw-r--r--secure/lib/libssl/man/SSL_read.34
-rw-r--r--secure/lib/libssl/man/SSL_rstate_string.34
-rw-r--r--secure/lib/libssl/man/SSL_session_reused.34
-rw-r--r--secure/lib/libssl/man/SSL_set_bio.34
-rw-r--r--secure/lib/libssl/man/SSL_set_connect_state.34
-rw-r--r--secure/lib/libssl/man/SSL_set_fd.34
-rw-r--r--secure/lib/libssl/man/SSL_set_session.34
-rw-r--r--secure/lib/libssl/man/SSL_set_shutdown.34
-rw-r--r--secure/lib/libssl/man/SSL_set_verify_result.34
-rw-r--r--secure/lib/libssl/man/SSL_shutdown.34
-rw-r--r--secure/lib/libssl/man/SSL_state_string.34
-rw-r--r--secure/lib/libssl/man/SSL_want.34
-rw-r--r--secure/lib/libssl/man/SSL_write.34
-rw-r--r--secure/lib/libssl/man/d2i_SSL_SESSION.34
-rw-r--r--secure/lib/libssl/man/ssl.34
-rw-r--r--secure/libexec/sftp-server/Makefile.depend1
-rw-r--r--secure/libexec/ssh-keysign/Makefile.depend1
-rw-r--r--secure/libexec/ssh-pkcs11-helper/Makefile.depend1
-rw-r--r--secure/usr.bin/bdes/Makefile.depend1
-rw-r--r--secure/usr.bin/openssl/Makefile.depend1
-rw-r--r--secure/usr.bin/openssl/man/CA.pl.14
-rw-r--r--secure/usr.bin/openssl/man/asn1parse.14
-rw-r--r--secure/usr.bin/openssl/man/c_rehash.14
-rw-r--r--secure/usr.bin/openssl/man/ca.14
-rw-r--r--secure/usr.bin/openssl/man/ciphers.14
-rw-r--r--secure/usr.bin/openssl/man/cms.111
-rw-r--r--secure/usr.bin/openssl/man/crl.14
-rw-r--r--secure/usr.bin/openssl/man/crl2pkcs7.14
-rw-r--r--secure/usr.bin/openssl/man/dgst.14
-rw-r--r--secure/usr.bin/openssl/man/dhparam.117
-rw-r--r--secure/usr.bin/openssl/man/dsa.14
-rw-r--r--secure/usr.bin/openssl/man/dsaparam.14
-rw-r--r--secure/usr.bin/openssl/man/ec.14
-rw-r--r--secure/usr.bin/openssl/man/ecparam.14
-rw-r--r--secure/usr.bin/openssl/man/enc.14
-rw-r--r--secure/usr.bin/openssl/man/errstr.14
-rw-r--r--secure/usr.bin/openssl/man/gendsa.14
-rw-r--r--secure/usr.bin/openssl/man/genpkey.14
-rw-r--r--secure/usr.bin/openssl/man/genrsa.14
-rw-r--r--secure/usr.bin/openssl/man/nseq.14
-rw-r--r--secure/usr.bin/openssl/man/ocsp.111
-rw-r--r--secure/usr.bin/openssl/man/openssl.14
-rw-r--r--secure/usr.bin/openssl/man/passwd.14
-rw-r--r--secure/usr.bin/openssl/man/pkcs12.14
-rw-r--r--secure/usr.bin/openssl/man/pkcs7.14
-rw-r--r--secure/usr.bin/openssl/man/pkcs8.14
-rw-r--r--secure/usr.bin/openssl/man/pkey.14
-rw-r--r--secure/usr.bin/openssl/man/pkeyparam.14
-rw-r--r--secure/usr.bin/openssl/man/pkeyutl.14
-rw-r--r--secure/usr.bin/openssl/man/rand.14
-rw-r--r--secure/usr.bin/openssl/man/req.14
-rw-r--r--secure/usr.bin/openssl/man/rsa.14
-rw-r--r--secure/usr.bin/openssl/man/rsautl.14
-rw-r--r--secure/usr.bin/openssl/man/s_client.112
-rw-r--r--secure/usr.bin/openssl/man/s_server.111
-rw-r--r--secure/usr.bin/openssl/man/s_time.14
-rw-r--r--secure/usr.bin/openssl/man/sess_id.14
-rw-r--r--secure/usr.bin/openssl/man/smime.111
-rw-r--r--secure/usr.bin/openssl/man/speed.14
-rw-r--r--secure/usr.bin/openssl/man/spkac.14
-rw-r--r--secure/usr.bin/openssl/man/ts.14
-rw-r--r--secure/usr.bin/openssl/man/tsget.14
-rw-r--r--secure/usr.bin/openssl/man/verify.115
-rw-r--r--secure/usr.bin/openssl/man/version.14
-rw-r--r--secure/usr.bin/openssl/man/x509.14
-rw-r--r--secure/usr.bin/openssl/man/x509v3_config.14
-rw-r--r--secure/usr.bin/scp/Makefile.depend1
-rw-r--r--secure/usr.bin/sftp/Makefile.depend1
-rw-r--r--secure/usr.bin/ssh-add/Makefile.depend1
-rw-r--r--secure/usr.bin/ssh-agent/Makefile.depend1
-rw-r--r--secure/usr.bin/ssh-keygen/Makefile.depend1
-rw-r--r--secure/usr.bin/ssh-keyscan/Makefile.depend1
-rw-r--r--secure/usr.bin/ssh/Makefile.depend1
-rw-r--r--secure/usr.sbin/sshd/Makefile.depend1
-rw-r--r--share/colldef/Makefile.depend1
-rw-r--r--share/dict/Makefile.depend1
-rw-r--r--share/doc/IPv6/Makefile.depend1
-rw-r--r--share/doc/atf/Makefile1
-rw-r--r--share/doc/atf/Makefile.depend1
-rw-r--r--share/doc/legal/intel_ipw/Makefile.depend1
-rw-r--r--share/doc/legal/intel_iwi/Makefile.depend1
-rw-r--r--share/doc/legal/intel_iwn/Makefile.depend1
-rw-r--r--share/doc/legal/intel_wpi/Makefile.depend1
-rw-r--r--share/doc/legal/realtek/Makefile1
-rw-r--r--share/doc/legal/realtek/Makefile.depend1
-rw-r--r--share/doc/llvm/Makefile2
-rw-r--r--share/doc/llvm/Makefile.depend1
-rw-r--r--share/doc/llvm/clang/Makefile1
-rw-r--r--share/doc/llvm/clang/Makefile.depend1
-rw-r--r--share/doc/papers/bufbio/bio.ms8
-rw-r--r--share/doc/pjdfstest/Makefile2
-rw-r--r--share/dtrace/toolkit/Makefile.depend1
-rwxr-xr-xshare/examples/bhyve/vmrun.sh30
-rw-r--r--share/examples/ipfilter/Makefile.depend1
-rw-r--r--share/examples/libvgl/Makefile.depend1
-rw-r--r--share/examples/pf/Makefile.depend1
-rw-r--r--share/i18n/csmapper/APPLE/Makefile.depend1
-rw-r--r--share/i18n/csmapper/AST/Makefile.depend1
-rw-r--r--share/i18n/csmapper/BIG5/Makefile.depend1
-rw-r--r--share/i18n/csmapper/CNS/Makefile.depend1
-rw-r--r--share/i18n/csmapper/CP/Makefile.depend1
-rw-r--r--share/i18n/csmapper/EBCDIC/Makefile.depend1
-rw-r--r--share/i18n/csmapper/GB/Makefile.depend1
-rw-r--r--share/i18n/csmapper/GEORGIAN/Makefile.depend1
-rw-r--r--share/i18n/csmapper/ISO-8859/Makefile.depend1
-rw-r--r--share/i18n/csmapper/ISO646/Makefile.depend1
-rw-r--r--share/i18n/csmapper/JIS/Makefile.depend1
-rw-r--r--share/i18n/csmapper/KAZAKH/Makefile.depend1
-rw-r--r--share/i18n/csmapper/KOI/Makefile.depend1
-rw-r--r--share/i18n/csmapper/KS/Makefile.depend1
-rw-r--r--share/i18n/csmapper/MISC/Makefile.depend1
-rw-r--r--share/i18n/csmapper/Makefile.depend1
-rw-r--r--share/i18n/csmapper/TCVN/Makefile.depend1
-rw-r--r--share/i18n/esdb/APPLE/Makefile.depend1
-rw-r--r--share/i18n/esdb/AST/Makefile.depend1
-rw-r--r--share/i18n/esdb/BIG5/Makefile.depend1
-rw-r--r--share/i18n/esdb/CP/Makefile.depend1
-rw-r--r--share/i18n/esdb/DEC/Makefile.depend1
-rw-r--r--share/i18n/esdb/EBCDIC/Makefile.depend1
-rw-r--r--share/i18n/esdb/EUC/Makefile.depend1
-rw-r--r--share/i18n/esdb/GB/Makefile.depend1
-rw-r--r--share/i18n/esdb/GEORGIAN/Makefile.depend1
-rw-r--r--share/i18n/esdb/ISO-2022/Makefile.depend1
-rw-r--r--share/i18n/esdb/ISO-8859/Makefile.depend1
-rw-r--r--share/i18n/esdb/ISO646/Makefile.depend1
-rw-r--r--share/i18n/esdb/KAZAKH/Makefile.depend1
-rw-r--r--share/i18n/esdb/KOI/Makefile.depend1
-rw-r--r--share/i18n/esdb/MISC/Makefile.depend1
-rw-r--r--share/i18n/esdb/Makefile.depend1
-rw-r--r--share/i18n/esdb/TCVN/Makefile.depend1
-rw-r--r--share/i18n/esdb/UTF/Makefile.depend1
-rw-r--r--share/man/man1/Makefile.depend1
-rw-r--r--share/man/man3/Makefile.depend1
-rw-r--r--share/man/man3/pthread_setspecific.35
-rw-r--r--share/man/man4/Makefile2
-rw-r--r--share/man/man4/Makefile.depend1
-rw-r--r--share/man/man4/bwn.410
-rw-r--r--share/man/man4/em.427
-rw-r--r--share/man/man4/geom.45
-rw-r--r--share/man/man4/geom_map.44
-rw-r--r--share/man/man4/gre.440
-rw-r--r--share/man/man4/ig4.479
-rw-r--r--share/man/man4/man4.arm/Makefile.depend1
-rw-r--r--share/man/man4/man4.i386/Makefile.depend1
-rw-r--r--share/man/man4/man4.powerpc/Makefile.depend1
-rw-r--r--share/man/man4/man4.sparc64/Makefile.depend1
-rw-r--r--share/man/man4/sfxge.445
-rw-r--r--share/man/man4/ugold.460
-rw-r--r--share/man/man5/Makefile.depend1
-rw-r--r--share/man/man5/src.conf.533
-rw-r--r--share/man/man6/Makefile.depend1
-rw-r--r--share/man/man7/Makefile.depend1
-rw-r--r--share/man/man8/Makefile4
-rw-r--r--share/man/man8/Makefile.depend1
-rw-r--r--share/man/man9/Makefile6
-rw-r--r--share/man/man9/Makefile.depend1
-rw-r--r--share/man/man9/PCI_IOV_ADD_VF.9 (renamed from share/man/man9/PCI_ADD_VF.9)31
-rw-r--r--share/man/man9/PCI_IOV_INIT.9 (renamed from share/man/man9/PCI_INIT_IOV.9)19
-rw-r--r--share/man/man9/PCI_IOV_UNINIT.9 (renamed from share/man/man9/PCI_UNINIT_IOV.9)23
-rw-r--r--share/man/man9/pci.917
-rw-r--r--share/man/man9/pci_iov_schema.96
-rw-r--r--share/man/man9/sbuf.920
-rw-r--r--share/man/man9/sleep.915
-rw-r--r--share/me/Makefile.depend1
-rw-r--r--share/misc/Makefile.depend1
-rw-r--r--share/misc/committers-ports.dot5
-rw-r--r--share/mk/Makefile3
-rw-r--r--share/mk/auto.obj.mk6
-rw-r--r--share/mk/bsd.init.mk5
-rw-r--r--share/mk/bsd.lib.mk6
-rw-r--r--share/mk/bsd.opts.mk9
-rw-r--r--share/mk/bsd.own.mk7
-rw-r--r--share/mk/dirdeps.mk1
-rw-r--r--share/mk/gendirdeps.mk5
-rw-r--r--share/mk/host-target.mk3
-rw-r--r--share/mk/install-new.mk1
-rw-r--r--share/mk/local.autodep.mk1
-rw-r--r--share/mk/local.dirdeps.mk2
-rw-r--r--share/mk/local.gendirdeps.mk5
-rw-r--r--share/mk/local.init.mk1
-rw-r--r--share/mk/local.meta.sys.mk11
-rw-r--r--share/mk/local.sys.mk12
-rw-r--r--share/mk/meta.autodep.mk1
-rw-r--r--share/mk/meta.stage.mk1
-rw-r--r--share/mk/meta.subdir.mk3
-rw-r--r--share/mk/meta.sys.mk1
-rwxr-xr-xshare/mk/meta2deps.py225
-rwxr-xr-xshare/mk/meta2deps.sh36
-rw-r--r--share/mk/src.libnames.mk2
-rw-r--r--share/mk/src.opts.mk8
-rw-r--r--share/mk/src.sys.mk10
-rwxr-xr-xshare/mk/stage-install.sh1
-rw-r--r--share/mk/sys.dependfile.mk1
-rw-r--r--share/mk/sys.mk81
-rw-r--r--share/mklocale/Makefile.depend1
-rw-r--r--share/monetdef/Makefile.depend1
-rw-r--r--share/msgdef/Makefile.depend1
-rw-r--r--share/numericdef/Makefile.depend1
-rw-r--r--share/security/Makefile.depend1
-rw-r--r--share/sendmail/Makefile.depend1
-rw-r--r--share/skel/Makefile.depend1
-rw-r--r--share/snmp/mibs/Makefile.depend1
-rw-r--r--share/syscons/fonts/Makefile.depend1
-rw-r--r--share/syscons/keymaps/Makefile.depend1
-rw-r--r--share/syscons/scrnmaps/Makefile.depend1
-rw-r--r--share/tabset/Makefile.depend1
-rw-r--r--share/termcap/Makefile.depend1
-rw-r--r--share/timedef/Makefile.depend1
-rw-r--r--share/zoneinfo/Makefile.depend1
-rw-r--r--sys/Makefile4
-rw-r--r--sys/amd64/amd64/elf_machdep.c1
-rw-r--r--sys/amd64/amd64/gdb_machdep.c4
-rw-r--r--sys/amd64/amd64/initcpu.c1
-rw-r--r--sys/amd64/amd64/machdep.c4
-rw-r--r--sys/amd64/amd64/pmap.c9
-rw-r--r--sys/amd64/amd64/trap.c14
-rw-r--r--sys/amd64/amd64/vm_machdep.c2
-rw-r--r--sys/amd64/conf/NOTES17
-rw-r--r--sys/amd64/ia32/ia32_reg.c6
-rw-r--r--sys/amd64/ia32/ia32_signal.c12
-rw-r--r--sys/amd64/include/md_var.h1
-rw-r--r--sys/amd64/include/vmm.h26
-rw-r--r--sys/amd64/include/vmparam.h5
-rw-r--r--sys/amd64/linux/Makefile17
-rw-r--r--sys/amd64/linux/linux.h549
-rw-r--r--sys/amd64/linux/linux_dummy.c141
-rw-r--r--sys/amd64/linux/linux_genassym.c15
-rw-r--r--sys/amd64/linux/linux_ipc64.h142
-rw-r--r--sys/amd64/linux/linux_locore.s76
-rw-r--r--sys/amd64/linux/linux_machdep.c433
-rw-r--r--sys/amd64/linux/linux_proto.h1663
-rw-r--r--sys/amd64/linux/linux_support.s124
-rw-r--r--sys/amd64/linux/linux_syscall.h310
-rw-r--r--sys/amd64/linux/linux_syscalls.c325
-rw-r--r--sys/amd64/linux/linux_sysent.c335
-rw-r--r--sys/amd64/linux/linux_systrace_args.c6885
-rw-r--r--sys/amd64/linux/linux_sysvec.c946
-rw-r--r--sys/amd64/linux/linux_vdso.lds.s69
-rw-r--r--sys/amd64/linux/syscalls.conf11
-rw-r--r--sys/amd64/linux/syscalls.master515
-rw-r--r--sys/amd64/linux32/linux.h139
-rw-r--r--sys/amd64/linux32/linux32_dummy.c20
-rw-r--r--sys/amd64/linux32/linux32_genassym.c4
-rw-r--r--sys/amd64/linux32/linux32_locore.s158
-rw-r--r--sys/amd64/linux32/linux32_machdep.c130
-rw-r--r--sys/amd64/linux32/linux32_proto.h110
-rw-r--r--sys/amd64/linux32/linux32_syscall.h10
-rw-r--r--sys/amd64/linux32/linux32_syscalls.c9
-rw-r--r--sys/amd64/linux32/linux32_sysent.c45
-rw-r--r--sys/amd64/linux32/linux32_systrace_args.c474
-rw-r--r--sys/amd64/linux32/linux32_sysvec.c201
-rw-r--r--sys/amd64/linux32/linux32_vdso.lds.s66
-rw-r--r--sys/amd64/linux32/syscalls.master71
-rw-r--r--sys/amd64/vmm/amd/svm.c27
-rw-r--r--sys/amd64/vmm/intel/vmx.c37
-rw-r--r--sys/amd64/vmm/intel/vmx.h2
-rw-r--r--sys/amd64/vmm/intel/vmx_msr.c3
-rw-r--r--sys/amd64/vmm/vmm.c114
-rw-r--r--sys/amd64/vmm/vmm_instruction_emul.c2
-rw-r--r--sys/amd64/vmm/vmm_stat.c1
-rw-r--r--sys/amd64/vmm/vmm_stat.h1
-rw-r--r--sys/arm/arm/bcopyinout.S9
-rw-r--r--sys/arm/arm/bcopyinout_xscale.S12
-rw-r--r--sys/arm/arm/blockio.S6
-rw-r--r--sys/arm/arm/bus_space_base.c16
-rw-r--r--sys/arm/arm/busdma_machdep-v6.c44
-rw-r--r--sys/arm/arm/busdma_machdep.c26
-rw-r--r--sys/arm/arm/copystr.S5
-rw-r--r--sys/arm/arm/cpu_asm-v6.S72
-rw-r--r--sys/arm/arm/cpufunc.c142
-rw-r--r--sys/arm/arm/cpufunc_asm_arm11x6.S40
-rw-r--r--sys/arm/arm/cpufunc_asm_arm9.S4
-rw-r--r--sys/arm/arm/cpufunc_asm_armv6.S6
-rw-r--r--sys/arm/arm/cpufunc_asm_armv7.S2
-rw-r--r--sys/arm/arm/cpufunc_asm_xscale_c3.S4
-rw-r--r--sys/arm/arm/cpuinfo.c8
-rw-r--r--sys/arm/arm/db_interface.c3
-rw-r--r--sys/arm/arm/elf_machdep.c1
-rw-r--r--sys/arm/arm/elf_trampoline.c27
-rw-r--r--sys/arm/arm/exception.S37
-rw-r--r--sys/arm/arm/fiq.c2
-rw-r--r--sys/arm/arm/fusu.S6
-rw-r--r--sys/arm/arm/genassym.c6
-rw-r--r--sys/arm/arm/generic_timer.c112
-rw-r--r--sys/arm/arm/gic.c4
-rw-r--r--sys/arm/arm/intr.c4
-rw-r--r--sys/arm/arm/locore-v4.S3
-rw-r--r--sys/arm/arm/machdep.c168
-rw-r--r--sys/arm/arm/mp_machdep.c6
-rw-r--r--sys/arm/arm/mpcore_timer.c4
-rw-r--r--sys/arm/arm/nexus.c4
-rw-r--r--sys/arm/arm/physmem.c2
-rw-r--r--sys/arm/arm/pl190.c8
-rw-r--r--sys/arm/arm/pl310.c30
-rw-r--r--sys/arm/arm/pmap-v6-new.c7
-rw-r--r--sys/arm/arm/pmap-v6.c38
-rw-r--r--sys/arm/arm/pmap.c70
-rw-r--r--sys/arm/arm/stack_machdep.c10
-rw-r--r--sys/arm/arm/support.S4
-rw-r--r--sys/arm/arm/swtch.S34
-rw-r--r--sys/arm/arm/sys_machdep.c82
-rw-r--r--sys/arm/arm/trap-v6.c25
-rw-r--r--sys/arm/arm/trap.c15
-rw-r--r--sys/arm/arm/vfp.c4
-rw-r--r--sys/arm/arm/vm_machdep.c24
-rw-r--r--sys/arm/broadcom/bcm2835/bcm2835_sdhci.c18
-rw-r--r--sys/arm/broadcom/bcm2835/bcm2835_spi.c25
-rw-r--r--sys/arm/conf/ALPINE2
-rw-r--r--sys/arm/conf/BEAGLEBONE2
-rw-r--r--sys/arm/conf/CUBIEBOARD2
-rw-r--r--sys/arm/conf/CUBIEBOARD22
-rw-r--r--sys/arm/conf/DOCKSTAR1
-rw-r--r--sys/arm/conf/DREAMPLUG-10011
-rw-r--r--sys/arm/conf/EFIKA_MX2
-rw-r--r--sys/arm/conf/EXYNOS5.common2
-rw-r--r--sys/arm/conf/NOTES23
-rw-r--r--sys/arm/conf/PANDABOARD2
-rw-r--r--sys/arm/conf/RK31882
-rw-r--r--sys/arm/conf/RPI-B1
-rw-r--r--sys/arm/conf/RPI21
-rw-r--r--sys/arm/conf/SOCKIT.common2
-rw-r--r--sys/arm/conf/VIRT6
-rw-r--r--sys/arm/conf/VYBRID2
-rw-r--r--sys/arm/conf/YYHD1826
-rw-r--r--sys/arm/conf/ZEDBOARD2
-rw-r--r--sys/arm/freescale/imx/imx6_sdma.c1
-rw-r--r--sys/arm/include/_types.h6
-rw-r--r--sys/arm/include/asm.h2
-rw-r--r--sys/arm/include/cpu-v6.h13
-rw-r--r--sys/arm/include/pcpu.h9
-rw-r--r--sys/arm/include/proc.h4
-rw-r--r--sys/arm/include/sysreg.h2
-rw-r--r--sys/arm/include/vmparam.h5
-rw-r--r--sys/arm/qemu/files.qemu3
-rw-r--r--sys/arm/qemu/virt_mp.c (renamed from usr.bin/csup/attrstack.c)107
-rw-r--r--sys/arm/ti/am335x/am335x_lcd.c4
-rw-r--r--sys/arm/ti/am335x/am335x_pmic.c154
-rw-r--r--sys/arm/ti/am335x/tps65217x.h114
-rw-r--r--sys/arm64/acpica/OsdEnvironment.c (renamed from usr.bin/csup/rcstokenizer.l)83
-rw-r--r--sys/arm64/acpica/acpi_machdep.c217
-rw-r--r--sys/arm64/acpica/acpi_wakeup.c (renamed from usr.bin/csup/parse.y)86
-rw-r--r--sys/arm64/arm64/db_interface.c4
-rw-r--r--sys/arm64/arm64/db_trace.c25
-rw-r--r--sys/arm64/arm64/exception.S21
-rw-r--r--sys/arm64/arm64/gic.c58
-rw-r--r--sys/arm64/arm64/gic.h (renamed from usr.bin/csup/fixups.h)42
-rw-r--r--sys/arm64/arm64/gic_acpi.c161
-rw-r--r--sys/arm64/arm64/gic_fdt.c87
-rw-r--r--sys/arm64/arm64/machdep.c2
-rw-r--r--sys/arm64/arm64/nexus.c166
-rw-r--r--sys/arm64/arm64/unwind.c (renamed from usr.bin/csup/idcache.h)39
-rw-r--r--sys/arm64/arm64/vfp.c2
-rw-r--r--sys/arm64/conf/GENERIC1
-rw-r--r--sys/arm64/include/acpica_machdep.h (renamed from usr.bin/csup/proto.h)41
-rw-r--r--sys/arm64/include/atomic.h28
-rw-r--r--sys/arm64/include/iodev.h65
-rw-r--r--sys/arm64/include/pci_cfgreg.h1
-rw-r--r--sys/arm64/include/pcpu.h3
-rw-r--r--sys/arm64/include/stack.h8
-rw-r--r--sys/arm64/include/vmparam.h5
-rw-r--r--sys/boot/efi/libefi/Makefile.depend1
-rw-r--r--sys/boot/efi/loader/arch/arm64/exec.c40
-rw-r--r--sys/boot/fdt/dts/arm/meson3.dtsi (renamed from usr.bin/csup/diff.h)73
-rw-r--r--sys/boot/fdt/dts/arm/sun4i-a10.dtsi1
-rw-r--r--sys/boot/fdt/dts/arm/sun7i-a20.dtsi1
-rw-r--r--sys/boot/fdt/dts/arm/vsatv102-m6.dts11
-rw-r--r--sys/boot/fdt/dts/arm/yyhd18-m3.dts237
-rw-r--r--sys/boot/ficl/Makefile.depend1
-rw-r--r--sys/boot/forth/support.4th6
-rw-r--r--sys/boot/i386/boot0/Makefile.depend1
-rw-r--r--sys/boot/i386/boot0sio/Makefile.depend1
-rw-r--r--sys/boot/i386/boot2/Makefile.depend1
-rw-r--r--sys/boot/i386/loader/Makefile.depend1
-rw-r--r--sys/boot/i386/zfsloader/Makefile.depend1
-rw-r--r--sys/boot/uboot/lib/module.c4
-rw-r--r--sys/boot/userboot/userboot/conf.c3
-rw-r--r--sys/boot/zfs/zfsimpl.c4
-rw-r--r--sys/cam/cam.c50
-rw-r--r--sys/cam/cam.h12
-rw-r--r--sys/cam/ctl/ctl.c4
-rw-r--r--sys/cam/ctl/scsi_ctl.c18
-rw-r--r--sys/cam/scsi/scsi_all.c892
-rw-r--r--sys/cam/scsi/scsi_all.h283
-rw-r--r--sys/cddl/compat/opensolaris/sys/nvpair.h4
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c14
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c6
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c2
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c5
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h4
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h4
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c18
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c1
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c28
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c4
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c33
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c24
-rw-r--r--sys/cddl/dev/dtrace/amd64/dtrace_asm.S2
-rw-r--r--sys/cddl/dev/dtrace/arm/dtrace_asm.S1
-rw-r--r--sys/cddl/dev/dtrace/i386/dtrace_asm.S2
-rw-r--r--sys/compat/ia32/ia32_sysvec.c1
-rw-r--r--sys/compat/linprocfs/linprocfs.c177
-rw-r--r--sys/compat/linsysfs/linsysfs.c10
-rw-r--r--sys/compat/linux/check_error.d4
-rw-r--r--sys/compat/linux/check_internal_locks.d35
-rw-r--r--sys/compat/linux/linux.c205
-rw-r--r--sys/compat/linux/linux.h95
-rw-r--r--sys/compat/linux/linux_common.c93
-rw-r--r--sys/compat/linux/linux_emul.c512
-rw-r--r--sys/compat/linux/linux_emul.h92
-rw-r--r--sys/compat/linux/linux_event.c890
-rw-r--r--sys/compat/linux/linux_event.h (renamed from usr.bin/csup/pathcomp.h)44
-rw-r--r--sys/compat/linux/linux_file.c75
-rw-r--r--sys/compat/linux/linux_file.h71
-rw-r--r--sys/compat/linux/linux_fork.c304
-rw-r--r--sys/compat/linux/linux_futex.c212
-rw-r--r--sys/compat/linux/linux_futex.h3
-rw-r--r--sys/compat/linux/linux_getcwd.c4
-rw-r--r--sys/compat/linux/linux_ioctl.c59
-rw-r--r--sys/compat/linux/linux_ioctl.h13
-rw-r--r--sys/compat/linux/linux_ipc.c10
-rw-r--r--sys/compat/linux/linux_ipc.h4
-rw-r--r--sys/compat/linux/linux_mib.c366
-rw-r--r--sys/compat/linux/linux_mib.h19
-rw-r--r--sys/compat/linux/linux_misc.c824
-rw-r--r--sys/compat/linux/linux_misc.h42
-rw-r--r--sys/compat/linux/linux_signal.c348
-rw-r--r--sys/compat/linux/linux_signal.h26
-rw-r--r--sys/compat/linux/linux_socket.c524
-rw-r--r--sys/compat/linux/linux_socket.h155
-rw-r--r--sys/compat/linux/linux_stats.c107
-rw-r--r--sys/compat/linux/linux_sysctl.c8
-rw-r--r--sys/compat/linux/linux_time.c277
-rw-r--r--sys/compat/linux/linux_timer.c27
-rw-r--r--sys/compat/linux/linux_timer.h23
-rw-r--r--sys/compat/linux/linux_uid16.c10
-rw-r--r--sys/compat/linux/linux_util.c115
-rw-r--r--sys/compat/linux/linux_util.h6
-rw-r--r--sys/compat/linux/linux_vdso.c244
-rw-r--r--sys/compat/linux/linux_vdso.h65
-rw-r--r--sys/compat/linux/stats_timing.d1
-rw-r--r--sys/compat/svr4/imgact_svr4.c2
-rw-r--r--sys/compat/svr4/svr4_misc.c20
-rw-r--r--sys/compat/svr4/svr4_resource.c16
-rw-r--r--sys/compat/svr4/svr4_sysvec.c1
-rw-r--r--sys/conf/NOTES5
-rw-r--r--sys/conf/files58
-rw-r--r--sys/conf/files.amd64102
-rw-r--r--sys/conf/files.arm5
-rw-r--r--sys/conf/files.arm648
-rw-r--r--sys/conf/files.i38624
-rw-r--r--sys/conf/files.pc9817
-rw-r--r--sys/conf/files.powerpc7
-rw-r--r--sys/conf/kern.post.mk20
-rw-r--r--sys/conf/kern.pre.mk25
-rw-r--r--sys/conf/kmod.mk2
-rw-r--r--sys/conf/options4
-rw-r--r--sys/conf/options.arm1
-rw-r--r--sys/contrib/dev/acpica/common/ahuuids.c76
-rw-r--r--sys/contrib/dev/acpica/include/acuuid.h44
-rw-r--r--sys/dev/acpi_support/acpi_ibm.c65
-rw-r--r--sys/dev/acpica/Osd/OsdHardware.c10
-rw-r--r--sys/dev/acpica/acpi_cpu.c18
-rw-r--r--sys/dev/ahci/ahci.h2
-rw-r--r--sys/dev/aic7xxx/aic79xx_pci.c14
-rw-r--r--sys/dev/ath/ath_rate/sample/sample.c13
-rw-r--r--sys/dev/ath/if_ath.c172
-rw-r--r--sys/dev/ath/if_ath_rx.c8
-rw-r--r--sys/dev/ath/if_ath_rx.h3
-rw-r--r--sys/dev/ath/if_ath_tdma.c2
-rw-r--r--sys/dev/ath/if_ath_tx.c4
-rw-r--r--sys/dev/ath/if_athvar.h3
-rw-r--r--sys/dev/atkbdc/psm.c121
-rw-r--r--sys/dev/bwi/bwimac.c57
-rw-r--r--sys/dev/bwi/bwimac.h1
-rw-r--r--sys/dev/bwi/if_bwi.c35
-rw-r--r--sys/dev/bwi/if_bwi_pci.c20
-rw-r--r--sys/dev/bwn/if_bwn.c21
-rw-r--r--sys/dev/bxe/bxe.c118
-rw-r--r--sys/dev/bxe/bxe.h6
-rw-r--r--sys/dev/bxe/ecore_reg.h1
-rw-r--r--sys/dev/cxgbe/t4_main.c22
-rw-r--r--sys/dev/cxgbe/t4_netmap.c2
-rw-r--r--sys/dev/cxgbe/t4_sge.c2
-rw-r--r--sys/dev/drm/drmP.h10
-rw-r--r--sys/dev/drm/drm_agpsupport.c35
-rw-r--r--sys/dev/drm/drm_bufs.c10
-rw-r--r--sys/dev/drm/drm_drv.c22
-rw-r--r--sys/dev/drm/drm_irq.c6
-rw-r--r--sys/dev/drm/i915_drv.c8
-rw-r--r--sys/dev/drm/mach64_drv.c4
-rw-r--r--sys/dev/drm/mga_drv.c8
-rw-r--r--sys/dev/drm/r128_drv.c4
-rw-r--r--sys/dev/drm/radeon_drv.c4
-rw-r--r--sys/dev/drm/savage_drv.c4
-rw-r--r--sys/dev/drm/sis_drv.c4
-rw-r--r--sys/dev/drm/tdfx_drv.c4
-rw-r--r--sys/dev/drm2/drm_bufs.c4
-rw-r--r--sys/dev/drm2/i915/i915_gem.c5
-rw-r--r--sys/dev/dwc/if_dwc.c7
-rw-r--r--sys/dev/e1000/e1000_defines.h2
-rw-r--r--sys/dev/e1000/if_em.c702
-rw-r--r--sys/dev/e1000/if_em.h58
-rw-r--r--sys/dev/fdt/fdt_common.c17
-rw-r--r--sys/dev/fdt/fdt_common.h1
-rw-r--r--sys/dev/gpio/gpioled.c27
-rw-r--r--sys/dev/hwpmc/hwpmc_armv7.c90
-rw-r--r--sys/dev/hwpmc/hwpmc_armv7.h5
-rw-r--r--sys/dev/hwpmc/hwpmc_mod.c6
-rw-r--r--sys/dev/hwpmc/pmc_events.h369
-rw-r--r--sys/dev/ichiic/ig4_iic.c966
-rw-r--r--sys/dev/ichiic/ig4_pci.c192
-rw-r--r--sys/dev/ichiic/ig4_reg.h622
-rw-r--r--sys/dev/ichiic/ig4_var.h96
-rw-r--r--sys/dev/ichsmb/ichsmb_pci.c8
-rw-r--r--sys/dev/if_ndis/if_ndis.c12
-rw-r--r--sys/dev/ipw/if_ipw.c9
-rw-r--r--sys/dev/iwi/if_iwi.c14
-rw-r--r--sys/dev/iwn/if_iwn.c35
-rw-r--r--sys/dev/ixgbe/if_ix.c1128
-rw-r--r--sys/dev/ixgbe/if_ixv.c92
-rw-r--r--sys/dev/ixgbe/ix_txrx.c33
-rw-r--r--sys/dev/ixgbe/ixgbe.h221
-rw-r--r--sys/dev/ixgbe/ixgbe_mbx.h27
-rw-r--r--sys/dev/ixgbe/ixgbe_vf.c57
-rw-r--r--sys/dev/ixl/i40e_adminq.c62
-rw-r--r--sys/dev/ixl/i40e_adminq.h3
-rw-r--r--sys/dev/ixl/i40e_adminq_cmd.h123
-rw-r--r--sys/dev/ixl/i40e_common.c653
-rw-r--r--sys/dev/ixl/i40e_devids.h68
-rw-r--r--sys/dev/ixl/i40e_hmc.c69
-rw-r--r--sys/dev/ixl/i40e_hmc.h12
-rw-r--r--sys/dev/ixl/i40e_lan_hmc.c29
-rw-r--r--sys/dev/ixl/i40e_nvm.c53
-rw-r--r--sys/dev/ixl/i40e_osdep.h10
-rw-r--r--sys/dev/ixl/i40e_prototype.h32
-rw-r--r--sys/dev/ixl/i40e_register.h1941
-rw-r--r--sys/dev/ixl/i40e_type.h201
-rw-r--r--sys/dev/ixl/i40e_virtchnl.h21
-rw-r--r--sys/dev/ixl/if_ixl.c189
-rw-r--r--sys/dev/ixl/if_ixlv.c36
-rw-r--r--sys/dev/ixl/ixl.h1
-rw-r--r--sys/dev/ixl/ixlv.h1
-rw-r--r--sys/dev/ixl/ixlvc.c20
-rw-r--r--sys/dev/led/led.c3
-rw-r--r--sys/dev/malo/if_malo.c11
-rw-r--r--sys/dev/mfi/mfi.c4
-rw-r--r--sys/dev/mmc/mmcsd.c25
-rw-r--r--sys/dev/mpr/mpi/mpi2.h8
-rw-r--r--sys/dev/mpr/mpi/mpi2_cnfg.h8
-rw-r--r--sys/dev/mpr/mpi/mpi2_hbd.h8
-rw-r--r--sys/dev/mpr/mpi/mpi2_history.txt8
-rw-r--r--sys/dev/mpr/mpi/mpi2_init.h8
-rw-r--r--sys/dev/mpr/mpi/mpi2_ioc.h8
-rw-r--r--sys/dev/mpr/mpi/mpi2_ra.h8
-rw-r--r--sys/dev/mpr/mpi/mpi2_raid.h8
-rw-r--r--sys/dev/mpr/mpi/mpi2_sas.h8
-rw-r--r--sys/dev/mpr/mpi/mpi2_targ.h8
-rw-r--r--sys/dev/mpr/mpi/mpi2_tool.h8
-rw-r--r--sys/dev/mpr/mpi/mpi2_type.h8
-rw-r--r--sys/dev/mpr/mpr.c90
-rw-r--r--sys/dev/mpr/mpr_config.c5
-rw-r--r--sys/dev/mpr/mpr_ioctl.h7
-rw-r--r--sys/dev/mpr/mpr_mapping.c72
-rw-r--r--sys/dev/mpr/mpr_mapping.h10
-rw-r--r--sys/dev/mpr/mpr_pci.c14
-rw-r--r--sys/dev/mpr/mpr_sas.c476
-rw-r--r--sys/dev/mpr/mpr_sas.h31
-rw-r--r--sys/dev/mpr/mpr_sas_lsi.c362
-rw-r--r--sys/dev/mpr/mpr_user.c41
-rw-r--r--sys/dev/mpr/mprvar.h38
-rw-r--r--sys/dev/mwl/if_mwl.c28
-rw-r--r--sys/dev/nand/nfc_rb.c12
-rw-r--r--sys/dev/netmap/if_em_netmap.h2
-rw-r--r--sys/dev/ofw/ofw_bus_subr.c22
-rw-r--r--sys/dev/ofw/ofw_bus_subr.h3
-rw-r--r--sys/dev/pci/pci.c14
-rw-r--r--sys/dev/pci/pci_host_generic.c626
-rw-r--r--sys/dev/pci/pci_if.m17
-rw-r--r--sys/dev/pci/pci_iov.c14
-rw-r--r--sys/dev/pci/pci_iov.h (renamed from usr.bin/csup/auth.h)25
-rw-r--r--sys/dev/pci/pci_iov_if.m (renamed from usr.bin/atf/Makefile)28
-rw-r--r--sys/dev/pci/pcivar.h15
-rw-r--r--sys/dev/pci/vga_pci.c7
-rw-r--r--sys/dev/proto/proto.h6
-rw-r--r--sys/dev/proto/proto_bus_pci.c20
-rw-r--r--sys/dev/proto/proto_busdma.c301
-rw-r--r--sys/dev/proto/proto_busdma.h75
-rw-r--r--sys/dev/proto/proto_core.c96
-rw-r--r--sys/dev/proto/proto_dev.h35
-rw-r--r--sys/dev/psci/psci.c57
-rw-r--r--sys/dev/ral/rt2560.c25
-rw-r--r--sys/dev/ral/rt2661.c23
-rw-r--r--sys/dev/ral/rt2860.c19
-rw-r--r--sys/dev/sfxge/common/ef10_tlv_layout.h691
-rw-r--r--sys/dev/sfxge/common/efsys.h114
-rw-r--r--sys/dev/sfxge/common/efx.h909
-rw-r--r--sys/dev/sfxge/common/efx_bootcfg.c45
-rw-r--r--sys/dev/sfxge/common/efx_check.h388
-rw-r--r--sys/dev/sfxge/common/efx_crc32.c127
-rw-r--r--sys/dev/sfxge/common/efx_ev.c686
-rw-r--r--sys/dev/sfxge/common/efx_filter.c1722
-rw-r--r--sys/dev/sfxge/common/efx_hash.c333
-rw-r--r--sys/dev/sfxge/common/efx_impl.h659
-rw-r--r--sys/dev/sfxge/common/efx_intr.c436
-rw-r--r--sys/dev/sfxge/common/efx_mac.c481
-rw-r--r--sys/dev/sfxge/common/efx_mcdi.c1607
-rw-r--r--sys/dev/sfxge/common/efx_mcdi.h164
-rw-r--r--sys/dev/sfxge/common/efx_mon.c156
-rw-r--r--sys/dev/sfxge/common/efx_nic.c511
-rw-r--r--sys/dev/sfxge/common/efx_nvram.c556
-rw-r--r--sys/dev/sfxge/common/efx_phy.c199
-rw-r--r--sys/dev/sfxge/common/efx_phy_ids.h53
-rw-r--r--sys/dev/sfxge/common/efx_port.c76
-rw-r--r--sys/dev/sfxge/common/efx_regs.h45
-rw-r--r--sys/dev/sfxge/common/efx_regs_ef10.h1168
-rw-r--r--sys/dev/sfxge/common/efx_regs_mcdi.h9206
-rw-r--r--sys/dev/sfxge/common/efx_regs_pci.h734
-rw-r--r--sys/dev/sfxge/common/efx_rx.c921
-rw-r--r--sys/dev/sfxge/common/efx_sram.c75
-rw-r--r--sys/dev/sfxge/common/efx_tx.c868
-rw-r--r--sys/dev/sfxge/common/efx_types.h122
-rw-r--r--sys/dev/sfxge/common/efx_vpd.c76
-rw-r--r--sys/dev/sfxge/common/efx_wol.c92
-rw-r--r--sys/dev/sfxge/common/hunt_ev.c1010
-rw-r--r--sys/dev/sfxge/common/hunt_filter.c1376
-rw-r--r--sys/dev/sfxge/common/hunt_impl.h1015
-rw-r--r--sys/dev/sfxge/common/hunt_intr.c155
-rw-r--r--sys/dev/sfxge/common/hunt_mac.c685
-rw-r--r--sys/dev/sfxge/common/hunt_mcdi.c465
-rw-r--r--sys/dev/sfxge/common/hunt_nic.c1741
-rw-r--r--sys/dev/sfxge/common/hunt_nvram.c1538
-rw-r--r--sys/dev/sfxge/common/hunt_phy.c701
-rw-r--r--sys/dev/sfxge/common/hunt_rx.c765
-rw-r--r--sys/dev/sfxge/common/hunt_sram.c69
-rwxr-xr-xsys/dev/sfxge/common/hunt_tx.c679
-rw-r--r--sys/dev/sfxge/common/hunt_vpd.c435
-rw-r--r--sys/dev/sfxge/common/mcdi_mon.c552
-rw-r--r--sys/dev/sfxge/common/mcdi_mon.h76
-rw-r--r--sys/dev/sfxge/common/siena_flash.h130
-rw-r--r--sys/dev/sfxge/common/siena_impl.h157
-rw-r--r--sys/dev/sfxge/common/siena_mac.c250
-rw-r--r--sys/dev/sfxge/common/siena_mcdi.c354
-rw-r--r--sys/dev/sfxge/common/siena_mon.c284
-rw-r--r--sys/dev/sfxge/common/siena_nic.c663
-rw-r--r--sys/dev/sfxge/common/siena_nvram.c252
-rw-r--r--sys/dev/sfxge/common/siena_phy.c221
-rw-r--r--sys/dev/sfxge/common/siena_sram.c43
-rw-r--r--sys/dev/sfxge/common/siena_vpd.c81
-rw-r--r--sys/dev/sfxge/sfxge.c339
-rw-r--r--sys/dev/sfxge/sfxge.h82
-rw-r--r--sys/dev/sfxge/sfxge_dma.c45
-rw-r--r--sys/dev/sfxge/sfxge_ev.c113
-rw-r--r--sys/dev/sfxge/sfxge_intr.c58
-rw-r--r--sys/dev/sfxge/sfxge_ioc.h112
-rw-r--r--sys/dev/sfxge/sfxge_mcdi.c179
-rw-r--r--sys/dev/sfxge/sfxge_nvram.c203
-rw-r--r--sys/dev/sfxge/sfxge_port.c202
-rw-r--r--sys/dev/sfxge/sfxge_rx.c183
-rw-r--r--sys/dev/sfxge/sfxge_rx.h56
-rw-r--r--sys/dev/sfxge/sfxge_tx.c501
-rw-r--r--sys/dev/sfxge/sfxge_tx.h51
-rw-r--r--sys/dev/sfxge/sfxge_version.h44
-rw-r--r--sys/dev/uart/uart_dev_ns8250.c8
-rw-r--r--sys/dev/usb/controller/dwc_otg.c108
-rw-r--r--sys/dev/usb/misc/ugold.c405
-rw-r--r--sys/dev/usb/quirk/usb_quirk.c1
-rw-r--r--sys/dev/usb/template/usb_template.c3
-rw-r--r--sys/dev/usb/template/usb_template.h1
-rw-r--r--sys/dev/usb/template/usb_template_midi.c240
-rw-r--r--sys/dev/usb/usb_dev.c3
-rw-r--r--sys/dev/usb/usb_ioctl.h1
-rw-r--r--sys/dev/usb/usbdevs8
-rw-r--r--sys/dev/usb/wlan/if_rsu.c6
-rw-r--r--sys/dev/usb/wlan/if_rum.c16
-rw-r--r--sys/dev/usb/wlan/if_run.c43
-rw-r--r--sys/dev/usb/wlan/if_uath.c18
-rw-r--r--sys/dev/usb/wlan/if_upgt.c8
-rw-r--r--sys/dev/usb/wlan/if_ural.c10
-rw-r--r--sys/dev/usb/wlan/if_urtw.c13
-rw-r--r--sys/dev/usb/wlan/if_urtwn.c6
-rw-r--r--sys/dev/usb/wlan/if_zyd.c10
-rw-r--r--sys/dev/virtio/network/if_vtnet.c2
-rw-r--r--sys/dev/wi/if_wi.c25
-rw-r--r--sys/dev/wi/if_wivar.h2
-rw-r--r--sys/dev/wpi/if_wpi.c24
-rw-r--r--sys/dev/wpi/if_wpivar.h4
-rw-r--r--sys/dev/wtap/if_wtap.c9
-rw-r--r--sys/dev/wtap/if_wtapvar.h1
-rw-r--r--sys/dev/wtap/wtap_hal/hal.c2
-rw-r--r--sys/dev/xen/blkback/blkback.c222
-rw-r--r--sys/dev/xen/blkfront/blkfront.c175
-rw-r--r--sys/dev/xen/blkfront/block.h20
-rw-r--r--sys/fs/devfs/devfs_vnops.c65
-rw-r--r--sys/fs/ext2fs/ext2_vnops.c1
-rw-r--r--sys/fs/fdescfs/fdesc_vfsops.c4
-rw-r--r--sys/fs/nfs/nfs.h4
-rw-r--r--sys/fs/nfs/nfsdport.h2
-rw-r--r--sys/fs/nfs/nfsrvstate.h12
-rw-r--r--sys/fs/nfsserver/nfs_nfsdkrpc.c10
-rw-r--r--sys/fs/nfsserver/nfs_nfsdport.c13
-rw-r--r--sys/fs/nfsserver/nfs_nfsdserv.c22
-rw-r--r--sys/fs/nfsserver/nfs_nfsdsocket.c22
-rw-r--r--sys/fs/nfsserver/nfs_nfsdstate.c80
-rw-r--r--sys/fs/nfsserver/nfs_nfsdsubs.c23
-rw-r--r--sys/fs/procfs/procfs_ctl.c1
-rw-r--r--sys/fs/procfs/procfs_map.c14
-rw-r--r--sys/fs/pseudofs/pseudofs.c2
-rw-r--r--sys/fs/tmpfs/tmpfs_subr.c10
-rw-r--r--sys/fs/unionfs/union_vfsops.c9
-rw-r--r--sys/geom/part/g_part_gpt.c2
-rw-r--r--sys/i386/conf/NOTES17
-rw-r--r--sys/i386/i386/elf_machdep.c1
-rw-r--r--sys/i386/i386/exception.s36
-rw-r--r--sys/i386/i386/gdb_machdep.c16
-rw-r--r--sys/i386/i386/initcpu.c1
-rw-r--r--sys/i386/i386/machdep.c9
-rw-r--r--sys/i386/i386/pmap.c1
-rw-r--r--sys/i386/i386/trap.c12
-rw-r--r--sys/i386/ibcs2/ibcs2_misc.c28
-rw-r--r--sys/i386/ibcs2/ibcs2_sysvec.c1
-rw-r--r--sys/i386/include/asmacros.h9
-rw-r--r--sys/i386/include/gdb_machdep.h2
-rw-r--r--sys/i386/include/md_var.h1
-rw-r--r--sys/i386/include/vmparam.h5
-rw-r--r--sys/i386/linux/imgact_linux.c2
-rw-r--r--sys/i386/linux/linux.h135
-rw-r--r--sys/i386/linux/linux_dummy.c20
-rw-r--r--sys/i386/linux/linux_genassym.c3
-rw-r--r--sys/i386/linux/linux_locore.s154
-rw-r--r--sys/i386/linux/linux_machdep.c88
-rw-r--r--sys/i386/linux/linux_proto.h118
-rw-r--r--sys/i386/linux/linux_ptrace.c3
-rw-r--r--sys/i386/linux/linux_syscall.h12
-rw-r--r--sys/i386/linux/linux_syscalls.c11
-rw-r--r--sys/i386/linux/linux_sysent.c47
-rw-r--r--sys/i386/linux/linux_systrace_args.c486
-rw-r--r--sys/i386/linux/linux_sysvec.c200
-rw-r--r--sys/i386/linux/linux_vdso.lds.s65
-rw-r--r--sys/i386/linux/syscalls.master77
-rw-r--r--sys/kern/imgact_aout.c3
-rw-r--r--sys/kern/imgact_elf.c38
-rw-r--r--sys/kern/imgact_gzip.c2
-rw-r--r--sys/kern/init_main.c9
-rw-r--r--sys/kern/kern_descrip.c82
-rw-r--r--sys/kern/kern_event.c41
-rw-r--r--sys/kern/kern_exec.c13
-rw-r--r--sys/kern/kern_exit.c44
-rw-r--r--sys/kern/kern_fork.c10
-rw-r--r--sys/kern/kern_kthread.c2
-rw-r--r--sys/kern/kern_mutex.c34
-rw-r--r--sys/kern/kern_proc.c22
-rw-r--r--sys/kern/kern_prot.c5
-rw-r--r--sys/kern/kern_resource.c92
-rw-r--r--sys/kern/kern_rwlock.c56
-rw-r--r--sys/kern/kern_sig.c13
-rw-r--r--sys/kern/kern_sx.c51
-rw-r--r--sys/kern/kern_synch.c6
-rw-r--r--sys/kern/kern_syscalls.c3
-rw-r--r--sys/kern/kern_tc.c109
-rw-r--r--sys/kern/kern_thr.c49
-rw-r--r--sys/kern/kern_thread.c58
-rw-r--r--sys/kern/p1003_1b.c121
-rw-r--r--sys/kern/subr_prf.c63
-rw-r--r--sys/kern/subr_syscall.c4
-rw-r--r--sys/kern/subr_taskqueue.c19
-rw-r--r--sys/kern/subr_trap.c11
-rw-r--r--sys/kern/subr_uio.c6
-rw-r--r--sys/kern/subr_witness.c17
-rw-r--r--sys/kern/sys_process.c78
-rw-r--r--sys/kern/sysv_shm.c2
-rw-r--r--sys/kern/tty_pts.c4
-rw-r--r--sys/kern/uipc_shm.c60
-rw-r--r--sys/kern/uipc_sockbuf.c4
-rw-r--r--sys/kern/uipc_syscalls.c5
-rw-r--r--sys/kern/uipc_usrreq.c2
-rw-r--r--sys/kern/vfs_cluster.c2
-rw-r--r--sys/kern/vfs_init.c4
-rw-r--r--sys/kern/vfs_mount.c30
-rw-r--r--sys/kern/vfs_subr.c3
-rw-r--r--sys/kern/vfs_vnops.c131
-rw-r--r--sys/libkern/arm/memcpy.S4
-rw-r--r--sys/mips/conf/AR71XX_BASE3
-rw-r--r--sys/mips/conf/AR724X_BASE3
-rw-r--r--sys/mips/conf/AR934X_BASE2
-rw-r--r--sys/mips/include/pcpu.h1
-rw-r--r--sys/mips/include/vmparam.h5
-rw-r--r--sys/mips/mips/elf_machdep.c2
-rw-r--r--sys/mips/mips/freebsd32_machdep.c7
-rw-r--r--sys/mips/mips/pm_machdep.c6
-rw-r--r--sys/modules/Makefile5
-rw-r--r--sys/modules/em/Makefile3
-rw-r--r--sys/modules/geom/geom_map/Makefile8
-rw-r--r--sys/modules/i2c/controllers/Makefile2
-rw-r--r--sys/modules/i2c/controllers/ichiic/Makefile8
-rw-r--r--[-rwxr-xr-x]sys/modules/ixl/Makefile4
-rwxr-xr-xsys/modules/ixlv/Makefile2
-rw-r--r--sys/modules/ixv/Makefile5
-rw-r--r--sys/modules/linprocfs/Makefile7
-rw-r--r--sys/modules/linsysfs/Makefile7
-rw-r--r--sys/modules/linux/Makefile41
-rw-r--r--sys/modules/linux64/Makefile55
-rw-r--r--sys/modules/linux_common/Makefile25
-rw-r--r--sys/modules/proto/Makefile1
-rw-r--r--sys/modules/pseudofs/Makefile6
-rw-r--r--sys/modules/sfxge/Makefile24
-rw-r--r--sys/modules/usb/template/Makefile3
-rw-r--r--sys/modules/usb/ugold/Makefile13
-rw-r--r--sys/net80211/ieee80211.c154
-rw-r--r--sys/net80211/ieee80211.h6
-rw-r--r--sys/net80211/ieee80211_acl.c19
-rw-r--r--sys/net80211/ieee80211_adhoc.c29
-rw-r--r--sys/net80211/ieee80211_amrr.c12
-rw-r--r--sys/net80211/ieee80211_crypto_ccmp.c6
-rw-r--r--sys/net80211/ieee80211_crypto_tkip.c6
-rw-r--r--sys/net80211/ieee80211_crypto_wep.c6
-rw-r--r--sys/net80211/ieee80211_ddb.c1
-rw-r--r--sys/net80211/ieee80211_dfs.c22
-rw-r--r--sys/net80211/ieee80211_freebsd.c126
-rw-r--r--sys/net80211/ieee80211_freebsd.h80
-rw-r--r--sys/net80211/ieee80211_hostap.c21
-rw-r--r--sys/net80211/ieee80211_ht.c17
-rw-r--r--sys/net80211/ieee80211_hwmp.c33
-rw-r--r--sys/net80211/ieee80211_input.c17
-rw-r--r--sys/net80211/ieee80211_input.h1
-rw-r--r--sys/net80211/ieee80211_ioctl.c41
-rw-r--r--sys/net80211/ieee80211_mesh.c75
-rw-r--r--sys/net80211/ieee80211_mesh.h4
-rw-r--r--sys/net80211/ieee80211_monitor.c5
-rw-r--r--sys/net80211/ieee80211_node.c46
-rw-r--r--sys/net80211/ieee80211_output.c28
-rw-r--r--sys/net80211/ieee80211_power.c7
-rw-r--r--sys/net80211/ieee80211_proto.c13
-rw-r--r--sys/net80211/ieee80211_proto.h12
-rw-r--r--sys/net80211/ieee80211_radiotap.c9
-rw-r--r--sys/net80211/ieee80211_ratectl_none.c2
-rw-r--r--sys/net80211/ieee80211_regdomain.c18
-rw-r--r--sys/net80211/ieee80211_rssadapt.c12
-rw-r--r--sys/net80211/ieee80211_scan.c57
-rw-r--r--sys/net80211/ieee80211_scan.h33
-rw-r--r--sys/net80211/ieee80211_scan_sta.c25
-rw-r--r--sys/net80211/ieee80211_scan_sw.c114
-rw-r--r--sys/net80211/ieee80211_scan_sw.h29
-rw-r--r--sys/net80211/ieee80211_sta.c33
-rw-r--r--sys/net80211/ieee80211_superg.c6
-rw-r--r--sys/net80211/ieee80211_tdma.c16
-rw-r--r--sys/net80211/ieee80211_tdma.h3
-rw-r--r--sys/net80211/ieee80211_var.h28
-rw-r--r--sys/net80211/ieee80211_wds.c16
-rw-r--r--sys/netinet/sctp_asconf.c22
-rw-r--r--sys/netinet/sctp_cc_functions.c9
-rw-r--r--sys/netinet/sctp_constants.h27
-rw-r--r--sys/netinet/sctp_indata.c74
-rw-r--r--sys/netinet/sctp_input.c86
-rw-r--r--sys/netinet/sctp_output.c219
-rw-r--r--sys/netinet/sctp_pcb.c7
-rw-r--r--sys/netinet/sctp_sysctl.c1
-rw-r--r--sys/netinet/sctp_timer.c8
-rw-r--r--sys/netinet/sctp_uio.h7
-rw-r--r--sys/netinet/sctp_usrreq.c148
-rw-r--r--sys/netinet/sctputil.c35
-rw-r--r--sys/netinet/tcp_timer.c55
-rw-r--r--sys/netinet/tcp_timer.h6
-rw-r--r--sys/netinet6/in6.c2
-rw-r--r--sys/netinet6/nd6.c3
-rw-r--r--sys/netinet6/sctp6_usrreq.c6
-rw-r--r--sys/netipsec/key.c8
-rw-r--r--sys/netipsec/key.h1
-rw-r--r--sys/netpfil/pf/pf_norm.c12
-rw-r--r--sys/ofed/drivers/infiniband/core/umem.c2
-rw-r--r--sys/ofed/drivers/infiniband/hw/mthca/mthca_memfree.c3
-rw-r--r--sys/ofed/drivers/net/mlx4/en_netdev.c23
-rw-r--r--sys/ofed/drivers/net/mlx4/port.c157
-rw-r--r--sys/ofed/include/linux/mlx4/device.h23
-rw-r--r--sys/opencrypto/cryptodeflate.c16
-rw-r--r--sys/powerpc/conf/NOTES22
-rw-r--r--sys/powerpc/include/vmparam.h5
-rw-r--r--sys/powerpc/powerpc/elf32_machdep.c1
-rw-r--r--sys/powerpc/powerpc/elf64_machdep.c1
-rw-r--r--sys/powerpc/powerpc/exec_machdep.c6
-rw-r--r--sys/powerpc/powerpc/trap.c4
-rw-r--r--sys/sparc64/include/vmparam.h5
-rw-r--r--sys/sparc64/sparc64/elf_machdep.c1
-rw-r--r--sys/sparc64/sparc64/machdep.c4
-rw-r--r--sys/sparc64/sparc64/trap.c4
-rw-r--r--sys/sys/bus.h2
-rw-r--r--sys/sys/file.h18
-rw-r--r--sys/sys/filedesc.h4
-rw-r--r--sys/sys/ktr_class.h3
-rw-r--r--sys/sys/lockstat.h3
-rw-r--r--sys/sys/mman.h2
-rw-r--r--sys/sys/nlist_aout.h2
-rw-r--r--sys/sys/param.h2
-rw-r--r--sys/sys/pmc.h7
-rw-r--r--sys/sys/proc.h17
-rw-r--r--sys/sys/resourcevar.h11
-rw-r--r--sys/sys/sbuf.h10
-rw-r--r--sys/sys/sockio.h2
-rw-r--r--sys/sys/syscallsubr.h17
-rw-r--r--sys/sys/sysent.h1
-rw-r--r--sys/sys/systm.h2
-rw-r--r--sys/sys/user.h21
-rw-r--r--sys/sys/vnode.h3
-rw-r--r--sys/ufs/ffs/ffs_softdep.c181
-rw-r--r--sys/ufs/ffs/ffs_suspend.c2
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c10
-rw-r--r--sys/ufs/ffs/ffs_vnops.c18
-rw-r--r--sys/ufs/ufs/ufs_bmap.c2
-rw-r--r--sys/ufs/ufs/ufs_dirhash.c4
-rw-r--r--sys/vm/swap_pager.c4
-rw-r--r--sys/vm/vm_extern.h14
-rw-r--r--sys/vm/vm_fault.c13
-rw-r--r--sys/vm/vm_glue.c17
-rw-r--r--sys/vm/vm_kern.c3
-rw-r--r--sys/vm/vm_map.c14
-rw-r--r--sys/vm/vm_mmap.c343
-rw-r--r--sys/vm/vm_object.c157
-rw-r--r--sys/vm/vm_object.h1
-rw-r--r--sys/vm/vm_page.c2
-rw-r--r--sys/vm/vm_pageout.c2
-rw-r--r--sys/vm/vm_reserv.c3
-rw-r--r--sys/vm/vm_unix.c8
-rw-r--r--sys/x86/acpica/madt.c97
-rw-r--r--sys/x86/iommu/busdma_dmar.c4
-rw-r--r--sys/x86/iommu/intel_idpgtbl.c8
-rw-r--r--sys/x86/iommu/intel_qi.c2
-rw-r--r--sys/x86/x86/identcpu.c183
-rw-r--r--sys/x86/xen/xenpv.c7
-rw-r--r--sys/xen/blkif.h8
-rw-r--r--sys/xen/interface/io/blkif.h42
-rw-r--r--tests/Makefile4
-rw-r--r--tests/sys/kern/ptrace_test.c274
-rw-r--r--tests/sys/pjdfstest/pjdfstest/Makefile2
-rw-r--r--tools/build/Makefile.depend1
-rw-r--r--tools/build/mk/OptionalObsoleteFiles.inc120
-rw-r--r--tools/build/options/WITHOUT_MANDOCDB6
-rw-r--r--tools/bus_space/C/Makefile3
-rw-r--r--tools/bus_space/C/lang.c120
-rw-r--r--tools/bus_space/C/libbus.h71
-rw-r--r--tools/bus_space/Makefile.inc2
-rw-r--r--tools/bus_space/Python/Makefile2
-rw-r--r--tools/bus_space/Python/lang.c182
-rw-r--r--tools/bus_space/bus.c (renamed from tools/bus_space/bus_space.c)2
-rw-r--r--tools/bus_space/bus.h (renamed from tools/bus_space/bus_space.h)0
-rw-r--r--tools/bus_space/busdma.c437
-rw-r--r--tools/bus_space/busdma.h (renamed from tools/bus_space/C/libbus_space.h)33
-rw-r--r--tools/regression/file/closefrom/Makefile9
-rw-r--r--tools/regression/file/closefrom/closefrom.c274
-rw-r--r--tools/regression/file/closefrom/closefrom.t10
-rw-r--r--tools/regression/include/stdatomic/Makefile.depend1
-rw-r--r--tools/tools/ath/ath_ee_9300_print/Makefile.depend1
-rw-r--r--tools/tools/drm/radeon/mkregtable/Makefile.depend1
-rw-r--r--tools/tools/makeroot/Makefile.depend1
-rw-r--r--tools/tools/usbtest/Makefile.depend1
-rw-r--r--usr.bin/Makefile2
-rw-r--r--usr.bin/alias/Makefile.depend1
-rw-r--r--usr.bin/apply/Makefile.depend1
-rw-r--r--usr.bin/ar/Makefile.depend1
-rw-r--r--usr.bin/asa/Makefile.depend1
-rw-r--r--usr.bin/at/Makefile.depend1
-rw-r--r--usr.bin/atf/Makefile.inc4
-rw-r--r--usr.bin/atf/atf-sh/Makefile66
-rw-r--r--usr.bin/atf/atf-sh/Makefile.depend24
-rw-r--r--usr.bin/atf/atf-sh/tests/Makefile26
-rw-r--r--usr.bin/atf/tests/Makefile10
-rw-r--r--usr.bin/atm/sscop/Makefile.depend1
-rw-r--r--usr.bin/awk/Makefile.depend1
-rw-r--r--usr.bin/banner/Makefile.depend1
-rw-r--r--usr.bin/basename/Makefile.depend1
-rw-r--r--usr.bin/bc/Makefile.depend1
-rw-r--r--usr.bin/biff/Makefile.depend1
-rw-r--r--usr.bin/bluetooth/bthost/Makefile.depend1
-rw-r--r--usr.bin/bluetooth/btsockstat/Makefile.depend1
-rw-r--r--usr.bin/bluetooth/rfcomm_sppd/Makefile.depend1
-rw-r--r--usr.bin/bmake/Makefile4
-rw-r--r--usr.bin/bmake/Makefile.depend1
-rw-r--r--usr.bin/bmake/Makefile.inc2
-rw-r--r--usr.bin/brandelf/Makefile.depend1
-rw-r--r--usr.bin/bsdiff/bsdiff/Makefile.depend1
-rw-r--r--usr.bin/bsdiff/bspatch/Makefile.depend1
-rw-r--r--usr.bin/bzip2/Makefile.depend1
-rw-r--r--usr.bin/bzip2recover/Makefile.depend1
-rw-r--r--usr.bin/c89/Makefile.depend1
-rw-r--r--usr.bin/c99/Makefile.depend1
-rw-r--r--usr.bin/calendar/Makefile.depend1
-rw-r--r--usr.bin/calendar/calendars/calendar.holiday2
-rw-r--r--usr.bin/cap_mkdb/Makefile.depend1
-rw-r--r--usr.bin/catman/Makefile.depend1
-rw-r--r--usr.bin/chat/Makefile.depend1
-rw-r--r--usr.bin/checknr/Makefile.depend1
-rw-r--r--usr.bin/chkey/Makefile.depend1
-rw-r--r--usr.bin/chpass/Makefile.depend1
-rw-r--r--usr.bin/cksum/Makefile.depend1
-rw-r--r--usr.bin/clang/clang-tblgen/Makefile.depend1
-rw-r--r--usr.bin/clang/clang/Makefile.depend1
-rw-r--r--usr.bin/clang/tblgen/Makefile.depend1
-rw-r--r--usr.bin/cmp/Makefile.depend1
-rw-r--r--usr.bin/col/Makefile.depend1
-rw-r--r--usr.bin/colcrt/Makefile.depend1
-rw-r--r--usr.bin/colcrt/colcrt.16
-rw-r--r--usr.bin/colldef/Makefile.depend1
-rw-r--r--usr.bin/colrm/Makefile.depend1
-rw-r--r--usr.bin/colrm/colrm.111
-rw-r--r--usr.bin/column/Makefile.depend1
-rw-r--r--usr.bin/comm/Makefile.depend1
-rw-r--r--usr.bin/compile_et/Makefile.depend1
-rw-r--r--usr.bin/compress/Makefile.depend1
-rw-r--r--usr.bin/cpio/Makefile.depend1
-rw-r--r--usr.bin/cpuset/Makefile.depend1
-rw-r--r--usr.bin/csplit/Makefile.depend1
-rw-r--r--usr.bin/csup/Makefile42
-rw-r--r--usr.bin/csup/Makefile.depend30
-rw-r--r--usr.bin/csup/README39
-rw-r--r--usr.bin/csup/TODO28
-rw-r--r--usr.bin/csup/attrstack.h40
-rw-r--r--usr.bin/csup/auth.c331
-rw-r--r--usr.bin/csup/config.c579
-rw-r--r--usr.bin/csup/config.h127
-rw-r--r--usr.bin/csup/cpasswd.1119
-rwxr-xr-xusr.bin/csup/cpasswd.sh135
-rw-r--r--usr.bin/csup/csup.1996
-rw-r--r--usr.bin/csup/detailer.c603
-rw-r--r--usr.bin/csup/detailer.h33
-rw-r--r--usr.bin/csup/diff.c438
-rw-r--r--usr.bin/csup/fattr.c981
-rw-r--r--usr.bin/csup/fattr.h118
-rw-r--r--usr.bin/csup/fattr_bsd.h52
-rw-r--r--usr.bin/csup/fattr_posix.h48
-rw-r--r--usr.bin/csup/fixups.c199
-rw-r--r--usr.bin/csup/fnmatch.c197
-rw-r--r--usr.bin/csup/fnmatch.h56
-rw-r--r--usr.bin/csup/globtree.c393
-rw-r--r--usr.bin/csup/globtree.h45
-rw-r--r--usr.bin/csup/idcache.c421
-rw-r--r--usr.bin/csup/keyword.c526
-rw-r--r--usr.bin/csup/keyword.h54
-rw-r--r--usr.bin/csup/lex.rcs.c2094
-rw-r--r--usr.bin/csup/lister.c569
-rw-r--r--usr.bin/csup/lister.h33
-rw-r--r--usr.bin/csup/main.c346
-rw-r--r--usr.bin/csup/main.h29
-rw-r--r--usr.bin/csup/misc.c644
-rw-r--r--usr.bin/csup/misc.h146
-rw-r--r--usr.bin/csup/mux.c1202
-rw-r--r--usr.bin/csup/mux.h45
-rw-r--r--usr.bin/csup/pathcomp.c182
-rw-r--r--usr.bin/csup/proto.c1006
-rw-r--r--usr.bin/csup/rcsfile.c1414
-rw-r--r--usr.bin/csup/rcsfile.h74
-rw-r--r--usr.bin/csup/rcsparse.c366
-rw-r--r--usr.bin/csup/rcsparse.h41
-rw-r--r--usr.bin/csup/rcstokenizer.h333
-rw-r--r--usr.bin/csup/rsyncfile.c223
-rw-r--r--usr.bin/csup/rsyncfile.h41
-rw-r--r--usr.bin/csup/status.c875
-rw-r--r--usr.bin/csup/status.h72
-rw-r--r--usr.bin/csup/stream.c1303
-rw-r--r--usr.bin/csup/stream.h84
-rw-r--r--usr.bin/csup/threads.c177
-rw-r--r--usr.bin/csup/threads.h38
-rw-r--r--usr.bin/csup/token.h49
-rw-r--r--usr.bin/csup/updater.c2043
-rw-r--r--usr.bin/csup/updater.h33
-rw-r--r--usr.bin/ctags/Makefile.depend1
-rw-r--r--usr.bin/ctlstat/Makefile.depend1
-rw-r--r--usr.bin/cut/Makefile.depend1
-rw-r--r--usr.bin/dc/Makefile.depend1
-rw-r--r--usr.bin/dirname/Makefile.depend1
-rw-r--r--usr.bin/du/Makefile.depend1
-rw-r--r--usr.bin/ee/Makefile.depend1
-rw-r--r--usr.bin/elf2aout/Makefile.depend1
-rw-r--r--usr.bin/elfdump/Makefile.depend1
-rw-r--r--usr.bin/enigma/Makefile.depend1
-rw-r--r--usr.bin/env/Makefile.depend1
-rw-r--r--usr.bin/expand/Makefile.depend1
-rw-r--r--usr.bin/expand/expand.16
-rw-r--r--usr.bin/false/Makefile.depend1
-rw-r--r--usr.bin/fetch/Makefile.depend1
-rw-r--r--usr.bin/file/Makefile.depend1
-rw-r--r--usr.bin/file2c/Makefile.depend1
-rw-r--r--usr.bin/find/Makefile.depend1
-rw-r--r--usr.bin/finger/Makefile.depend1
-rw-r--r--usr.bin/fmt/Makefile.depend1
-rw-r--r--usr.bin/fold/Makefile.depend1
-rw-r--r--usr.bin/fold/fold.129
-rw-r--r--usr.bin/from/Makefile.depend1
-rw-r--r--usr.bin/fstat/Makefile.depend1
-rw-r--r--usr.bin/fsync/Makefile.depend1
-rw-r--r--usr.bin/ftp/Makefile.depend1
-rw-r--r--usr.bin/gcore/Makefile.depend1
-rw-r--r--usr.bin/gencat/Makefile.depend1
-rw-r--r--usr.bin/getconf/Makefile.depend1
-rw-r--r--usr.bin/getent/Makefile.depend1
-rw-r--r--usr.bin/getopt/Makefile.depend1
-rw-r--r--usr.bin/gprof/Makefile.depend1
-rw-r--r--usr.bin/grep/Makefile.depend1
-rw-r--r--usr.bin/gzip/Makefile.depend1
-rw-r--r--usr.bin/head/Makefile.depend1
-rw-r--r--usr.bin/hexdump/Makefile.depend1
-rw-r--r--usr.bin/host/Makefile.depend1
-rw-r--r--usr.bin/id/Makefile.depend1
-rw-r--r--usr.bin/indent/Makefile.depend1
-rw-r--r--usr.bin/ipcrm/Makefile.depend1
-rw-r--r--usr.bin/ipcs/Makefile.depend1
-rw-r--r--usr.bin/join/Makefile.depend1
-rw-r--r--usr.bin/jot/Makefile.depend1
-rw-r--r--usr.bin/kdump/Makefile13
-rw-r--r--usr.bin/kdump/Makefile.depend1
-rw-r--r--usr.bin/kdump/kdump.c46
-rw-r--r--usr.bin/kdump/linux32_syscalls.conf11
-rw-r--r--usr.bin/keylogin/Makefile2
-rw-r--r--usr.bin/keylogin/Makefile.depend1
-rw-r--r--usr.bin/keylogout/Makefile.depend1
-rw-r--r--usr.bin/killall/Makefile.depend1
-rw-r--r--usr.bin/ktrace/Makefile.depend1
-rw-r--r--usr.bin/ktrdump/Makefile.depend1
-rw-r--r--usr.bin/lam/Makefile.depend1
-rw-r--r--usr.bin/last/Makefile.depend1
-rw-r--r--usr.bin/last/last.113
-rw-r--r--usr.bin/lastcomm/Makefile.depend1
-rw-r--r--usr.bin/ldd/Makefile.depend1
-rw-r--r--usr.bin/leave/Makefile.depend1
-rw-r--r--usr.bin/less/Makefile.depend1
-rw-r--r--usr.bin/lessecho/Makefile.depend1
-rw-r--r--usr.bin/lesskey/Makefile.depend1
-rw-r--r--usr.bin/lex/Makefile.depend1
-rw-r--r--usr.bin/lex/lib/Makefile.depend1
-rw-r--r--usr.bin/limits/Makefile.depend1
-rw-r--r--usr.bin/locale/Makefile.depend1
-rw-r--r--usr.bin/locate/bigram/Makefile.depend1
-rw-r--r--usr.bin/locate/code/Makefile.depend1
-rw-r--r--usr.bin/locate/locate/Makefile.depend1
-rw-r--r--usr.bin/lock/Makefile.depend1
-rw-r--r--usr.bin/lockf/Makefile.depend1
-rw-r--r--usr.bin/logger/Makefile.depend1
-rw-r--r--usr.bin/login/Makefile.depend1
-rw-r--r--usr.bin/logins/Makefile.depend1
-rw-r--r--usr.bin/logname/Makefile.depend1
-rw-r--r--usr.bin/look/Makefile.depend1
-rw-r--r--usr.bin/lorder/Makefile.depend1
-rw-r--r--usr.bin/lsvfs/Makefile.depend1
-rw-r--r--usr.bin/lzmainfo/Makefile.depend1
-rw-r--r--usr.bin/m4/Makefile.depend1
-rw-r--r--usr.bin/mail/Makefile2
-rw-r--r--usr.bin/mail/Makefile.depend1
-rw-r--r--usr.bin/mail/main.c2
-rw-r--r--usr.bin/make/Makefile.depend1
-rw-r--r--usr.bin/makewhatis/Makefile.depend1
-rw-r--r--usr.bin/man/Makefile14
-rw-r--r--usr.bin/man/Makefile.depend1
-rw-r--r--usr.bin/mandoc/Makefile13
-rw-r--r--usr.bin/mandoc/Makefile.depend1
-rw-r--r--usr.bin/mesg/Makefile.depend1
-rw-r--r--usr.bin/minigzip/Makefile.depend1
-rw-r--r--usr.bin/ministat/Makefile.depend1
-rw-r--r--usr.bin/mkcsmapper_static/Makefile1
-rw-r--r--usr.bin/mkcsmapper_static/Makefile.depend1
-rw-r--r--usr.bin/mkdep/Makefile.depend1
-rw-r--r--usr.bin/mkesdb_static/Makefile1
-rw-r--r--usr.bin/mkfifo/Makefile.depend1
-rw-r--r--usr.bin/mkimg/tests/img-1x1-4096-apm.vhdf.gz.uu22
-rw-r--r--usr.bin/mkimg/tests/img-1x1-4096-bsd.vhdf.gz.uu19
-rw-r--r--usr.bin/mkimg/tests/img-1x1-4096-ebr.vhdf.gz.uu21
-rw-r--r--usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdf.gz.uu30
-rw-r--r--usr.bin/mkimg/tests/img-1x1-4096-mbr.vhdf.gz.uu22
-rw-r--r--usr.bin/mkimg/tests/img-1x1-4096-pc98.vhdf.gz.uu20
-rw-r--r--usr.bin/mkimg/tests/img-1x1-4096-vtoc8.vhdf.gz.uu20
-rw-r--r--usr.bin/mkimg/tests/img-1x1-512-apm.vhdf.gz.uu22
-rw-r--r--usr.bin/mkimg/tests/img-1x1-512-bsd.vhdf.gz.uu19
-rw-r--r--usr.bin/mkimg/tests/img-1x1-512-ebr.vhdf.gz.uu21
-rw-r--r--usr.bin/mkimg/tests/img-1x1-512-gpt.vhdf.gz.uu29
-rw-r--r--usr.bin/mkimg/tests/img-1x1-512-mbr.vhdf.gz.uu22
-rw-r--r--usr.bin/mkimg/tests/img-1x1-512-pc98.vhdf.gz.uu20
-rw-r--r--usr.bin/mkimg/tests/img-1x1-512-vtoc8.vhdf.gz.uu20
-rw-r--r--usr.bin/mkimg/tests/img-63x255-4096-apm.vhdf.gz.uu22
-rw-r--r--usr.bin/mkimg/tests/img-63x255-4096-bsd.vhdf.gz.uu20
-rw-r--r--usr.bin/mkimg/tests/img-63x255-4096-ebr.vhdf.gz.uu22
-rw-r--r--usr.bin/mkimg/tests/img-63x255-4096-gpt.vhdf.gz.uu30
-rw-r--r--usr.bin/mkimg/tests/img-63x255-4096-mbr.vhdf.gz.uu22
-rw-r--r--usr.bin/mkimg/tests/img-63x255-4096-pc98.vhdf.gz.uu22
-rw-r--r--usr.bin/mkimg/tests/img-63x255-4096-vtoc8.vhdf.gz.uu20
-rw-r--r--usr.bin/mkimg/tests/img-63x255-512-apm.vhdf.gz.uu22
-rw-r--r--usr.bin/mkimg/tests/img-63x255-512-bsd.vhdf.gz.uu20
-rw-r--r--usr.bin/mkimg/tests/img-63x255-512-ebr.vhdf.gz.uu22
-rw-r--r--usr.bin/mkimg/tests/img-63x255-512-gpt.vhdf.gz.uu30
-rw-r--r--usr.bin/mkimg/tests/img-63x255-512-mbr.vhdf.gz.uu22
-rw-r--r--usr.bin/mkimg/tests/img-63x255-512-pc98.vhdf.gz.uu22
-rw-r--r--usr.bin/mkimg/tests/img-63x255-512-vtoc8.vhdf.gz.uu20
-rw-r--r--usr.bin/mkimg/vhd.c107
-rw-r--r--usr.bin/mklocale/Makefile.depend1
-rw-r--r--usr.bin/mkstr/Makefile.depend1
-rw-r--r--usr.bin/mkstr/mkstr.114
-rw-r--r--usr.bin/mkstr/mkstr.c6
-rw-r--r--usr.bin/mktemp/Makefile.depend1
-rw-r--r--usr.bin/mkulzma/Makefile.depend1
-rw-r--r--usr.bin/mkuzip/Makefile.depend1
-rw-r--r--usr.bin/msgs/Makefile.depend1
-rw-r--r--usr.bin/mt/Makefile.depend1
-rw-r--r--usr.bin/nc/Makefile.depend1
-rw-r--r--usr.bin/ncal/Makefile.depend1
-rw-r--r--usr.bin/netstat/Makefile.depend1
-rw-r--r--usr.bin/newgrp/Makefile.depend1
-rw-r--r--usr.bin/newkey/Makefile.depend1
-rw-r--r--usr.bin/nfsstat/Makefile.depend1
-rw-r--r--usr.bin/nice/Makefile.depend1
-rw-r--r--usr.bin/nl/Makefile.depend1
-rw-r--r--usr.bin/nohup/Makefile.depend1
-rw-r--r--usr.bin/opieinfo/Makefile.depend1
-rw-r--r--usr.bin/opiekey/Makefile.depend1
-rw-r--r--usr.bin/opiepasswd/Makefile.depend1
-rw-r--r--usr.bin/pagesize/Makefile.depend1
-rw-r--r--usr.bin/pamtest/Makefile.depend1
-rw-r--r--usr.bin/passwd/Makefile.depend1
-rw-r--r--usr.bin/paste/Makefile.depend1
-rw-r--r--usr.bin/pathchk/Makefile.depend1
-rw-r--r--usr.bin/perror/Makefile.depend1
-rw-r--r--usr.bin/pr/Makefile.depend1
-rw-r--r--usr.bin/printenv/Makefile.depend1
-rw-r--r--usr.bin/printf/Makefile.depend1
-rw-r--r--usr.bin/procstat/Makefile.depend1
-rw-r--r--usr.bin/quota/Makefile.depend1
-rw-r--r--usr.bin/rctl/Makefile.depend1
-rw-r--r--usr.bin/renice/Makefile.depend1
-rw-r--r--usr.bin/rev/Makefile.depend1
-rw-r--r--usr.bin/revoke/Makefile.depend1
-rw-r--r--usr.bin/rlogin/Makefile.depend1
-rw-r--r--usr.bin/rpcgen/Makefile.depend1
-rw-r--r--usr.bin/rpcinfo/Makefile.depend1
-rw-r--r--usr.bin/rs/Makefile.depend1
-rw-r--r--usr.bin/rsh/Makefile2
-rw-r--r--usr.bin/rsh/Makefile.depend1
-rw-r--r--usr.bin/rsh/rsh.c6
-rw-r--r--usr.bin/rup/Makefile3
-rw-r--r--usr.bin/rup/Makefile.depend1
-rw-r--r--usr.bin/ruptime/Makefile.depend1
-rw-r--r--usr.bin/rusers/Makefile.depend1
-rw-r--r--usr.bin/rwall/Makefile.depend1
-rw-r--r--usr.bin/rwho/Makefile.depend1
-rw-r--r--usr.bin/script/Makefile.depend1
-rw-r--r--usr.bin/sed/Makefile.depend1
-rw-r--r--usr.bin/seq/Makefile.depend1
-rw-r--r--usr.bin/setchannel/Makefile.depend1
-rw-r--r--usr.bin/shar/Makefile.depend1
-rw-r--r--usr.bin/showmount/Makefile.depend1
-rw-r--r--usr.bin/smbutil/Makefile.depend1
-rw-r--r--usr.bin/sockstat/Makefile.depend1
-rw-r--r--usr.bin/sort/Makefile.depend1
-rw-r--r--usr.bin/split/Makefile.depend1
-rw-r--r--usr.bin/ssh-copy-id/Makefile.depend1
-rw-r--r--usr.bin/stat/Makefile.depend1
-rw-r--r--usr.bin/stdbuf/Makefile.depend1
-rw-r--r--usr.bin/su/Makefile.depend1
-rw-r--r--usr.bin/svn/lib/libapr/Makefile.depend1
-rw-r--r--usr.bin/svn/lib/libapr_util/Makefile.depend1
-rw-r--r--usr.bin/svn/lib/libserf/Makefile.depend1
-rw-r--r--usr.bin/svn/lib/libsvn_client/Makefile.depend1
-rw-r--r--usr.bin/svn/lib/libsvn_delta/Makefile.depend1
-rw-r--r--usr.bin/svn/lib/libsvn_diff/Makefile.depend1
-rw-r--r--usr.bin/svn/lib/libsvn_fs/Makefile.depend1
-rw-r--r--usr.bin/svn/lib/libsvn_fs_fs/Makefile.depend1
-rw-r--r--usr.bin/svn/lib/libsvn_fs_util/Makefile.depend1
-rw-r--r--usr.bin/svn/lib/libsvn_ra/Makefile.depend1
-rw-r--r--usr.bin/svn/lib/libsvn_ra_local/Makefile.depend1
-rw-r--r--usr.bin/svn/lib/libsvn_ra_serf/Makefile.depend1
-rw-r--r--usr.bin/svn/lib/libsvn_ra_svn/Makefile.depend1
-rw-r--r--usr.bin/svn/lib/libsvn_repos/Makefile.depend1
-rw-r--r--usr.bin/svn/lib/libsvn_subr/Makefile.depend1
-rw-r--r--usr.bin/svn/lib/libsvn_wc/Makefile.depend1
-rw-r--r--usr.bin/svn/svn/Makefile.depend1
-rw-r--r--usr.bin/svn/svnadmin/Makefile.depend1
-rw-r--r--usr.bin/svn/svndumpfilter/Makefile.depend1
-rw-r--r--usr.bin/svn/svnlook/Makefile.depend1
-rw-r--r--usr.bin/svn/svnmucc/Makefile.depend1
-rw-r--r--usr.bin/svn/svnrdump/Makefile.depend1
-rw-r--r--usr.bin/svn/svnserve/Makefile.depend1
-rw-r--r--usr.bin/svn/svnsync/Makefile.depend1
-rw-r--r--usr.bin/svn/svnversion/Makefile.depend1
-rw-r--r--usr.bin/systat/Makefile2
-rw-r--r--usr.bin/systat/Makefile.depend1
-rw-r--r--usr.bin/systat/main.c1
-rw-r--r--usr.bin/tabs/Makefile.depend1
-rw-r--r--usr.bin/tail/Makefile.depend1
-rw-r--r--usr.bin/talk/Makefile.depend1
-rw-r--r--usr.bin/tar/Makefile.depend1
-rw-r--r--usr.bin/tcopy/Makefile.depend1
-rw-r--r--usr.bin/tee/Makefile.depend1
-rw-r--r--usr.bin/telnet/Makefile.depend1
-rw-r--r--usr.bin/tftp/Makefile.depend1
-rw-r--r--usr.bin/time/Makefile.depend1
-rw-r--r--usr.bin/timeout/Makefile.depend1
-rw-r--r--usr.bin/tip/tip/Makefile.depend1
-rw-r--r--usr.bin/top/Makefile4
-rw-r--r--usr.bin/top/Makefile.depend1
-rw-r--r--usr.bin/touch/Makefile.depend1
-rw-r--r--usr.bin/tput/Makefile.depend1
-rw-r--r--usr.bin/tr/Makefile.depend1
-rw-r--r--usr.bin/true/Makefile.depend1
-rw-r--r--usr.bin/truncate/Makefile.depend1
-rw-r--r--usr.bin/truss/Makefile.depend.amd641
-rw-r--r--usr.bin/tset/Makefile.depend1
-rw-r--r--usr.bin/tset/tset.123
-rw-r--r--usr.bin/tsort/Makefile.depend1
-rw-r--r--usr.bin/tty/Makefile.depend1
-rw-r--r--usr.bin/ul/Makefile.depend1
-rw-r--r--usr.bin/uname/Makefile.depend1
-rw-r--r--usr.bin/unexpand/Makefile.depend1
-rw-r--r--usr.bin/unifdef/Makefile.depend1
-rw-r--r--usr.bin/uniq/Makefile.depend1
-rw-r--r--usr.bin/units/Makefile.depend1
-rw-r--r--usr.bin/unvis/Makefile.depend1
-rw-r--r--usr.bin/unzip/Makefile.depend1
-rw-r--r--usr.bin/usbhidaction/Makefile.depend1
-rw-r--r--usr.bin/usbhidctl/Makefile.depend1
-rw-r--r--usr.bin/users/Makefile.depend1
-rw-r--r--usr.bin/uudecode/Makefile.depend1
-rw-r--r--usr.bin/uuencode/Makefile.depend1
-rw-r--r--usr.bin/vacation/Makefile.depend1
-rw-r--r--usr.bin/vgrind/Makefile.depend1
-rw-r--r--usr.bin/vgrind/RETEST/Makefile.depend1
-rw-r--r--usr.bin/vgrind/regexp.c4
-rw-r--r--usr.bin/vgrind/vgrindefs.c4
-rw-r--r--usr.bin/vi/Makefile.depend1
-rw-r--r--usr.bin/vis/Makefile.depend1
-rw-r--r--usr.bin/vmstat/Makefile.depend1
-rw-r--r--usr.bin/vmstat/vmstat.85
-rw-r--r--usr.bin/vmstat/vmstat.c135
-rw-r--r--usr.bin/vtfontcvt/Makefile2
-rw-r--r--usr.bin/vtfontcvt/Makefile.depend1
-rw-r--r--usr.bin/w/Makefile.depend1
-rw-r--r--usr.bin/wall/Makefile.depend1
-rw-r--r--usr.bin/wc/Makefile.depend1
-rw-r--r--usr.bin/what/Makefile.depend1
-rw-r--r--usr.bin/whereis/Makefile.depend1
-rw-r--r--usr.bin/which/Makefile.depend1
-rw-r--r--usr.bin/who/Makefile.depend1
-rw-r--r--usr.bin/whois/Makefile.depend1
-rw-r--r--usr.bin/write/Makefile.depend1
-rw-r--r--usr.bin/xargs/Makefile.depend1
-rw-r--r--usr.bin/xinstall/Makefile.depend1
-rw-r--r--usr.bin/xinstall/Makefile.depend.host2
-rw-r--r--usr.bin/xlint/lint1/Makefile.depend1
-rw-r--r--usr.bin/xlint/lint2/Makefile.depend1
-rw-r--r--usr.bin/xlint/llib/Makefile.depend1
-rw-r--r--usr.bin/xlint/xlint/Makefile.depend1
-rw-r--r--usr.bin/xstr/Makefile.depend1
-rw-r--r--usr.bin/xz/Makefile.depend1
-rw-r--r--usr.bin/xzdec/Makefile.depend1
-rw-r--r--usr.bin/yacc/Makefile.depend1
-rw-r--r--usr.bin/yes/Makefile.depend1
-rw-r--r--usr.bin/ypcat/Makefile.depend1
-rw-r--r--usr.bin/ypmatch/Makefile.depend1
-rw-r--r--usr.bin/ypwhich/Makefile.depend1
-rw-r--r--usr.sbin/ac/Makefile.depend1
-rw-r--r--usr.sbin/accton/Makefile.depend1
-rw-r--r--usr.sbin/acpi/acpiconf/Makefile.depend1
-rw-r--r--usr.sbin/acpi/acpidb/Makefile.depend1
-rw-r--r--usr.sbin/acpi/acpidump/Makefile.depend1
-rw-r--r--usr.sbin/acpi/iasl/Makefile.depend1
-rw-r--r--usr.sbin/adduser/Makefile.depend1
-rw-r--r--usr.sbin/amd/amd/Makefile.depend1
-rw-r--r--usr.sbin/amd/amq/Makefile.depend1
-rw-r--r--usr.sbin/amd/fixmount/Makefile.depend1
-rw-r--r--usr.sbin/amd/fsinfo/Makefile.depend1
-rw-r--r--usr.sbin/amd/hlfsd/Makefile.depend1
-rw-r--r--usr.sbin/amd/include/Makefile.depend1
-rw-r--r--usr.sbin/amd/libamu/Makefile.depend1
-rw-r--r--usr.sbin/amd/mk-amd-map/Makefile.depend1
-rw-r--r--usr.sbin/amd/pawd/Makefile.depend1
-rw-r--r--usr.sbin/amd/scripts/Makefile.depend1
-rw-r--r--usr.sbin/amd/wire-test/Makefile.depend1
-rw-r--r--usr.sbin/ancontrol/Makefile.depend1
-rw-r--r--usr.sbin/apm/Makefile.depend1
-rw-r--r--usr.sbin/apmd/Makefile.depend1
-rw-r--r--usr.sbin/arp/Makefile.depend1
-rw-r--r--usr.sbin/asf/Makefile.depend1
-rw-r--r--usr.sbin/audit/Makefile.depend1
-rw-r--r--usr.sbin/auditd/Makefile.depend1
-rw-r--r--usr.sbin/auditreduce/Makefile.depend1
-rw-r--r--usr.sbin/authpf/Makefile.depend1
-rw-r--r--usr.sbin/bhyve/bhyverun.c14
-rw-r--r--usr.sbin/bluetooth/ath3kfw/Makefile.depend1
-rw-r--r--usr.sbin/bluetooth/bcmfw/Makefile.depend1
-rw-r--r--usr.sbin/bluetooth/bt3cfw/Makefile.depend1
-rw-r--r--usr.sbin/bluetooth/bthidcontrol/Makefile.depend1
-rw-r--r--usr.sbin/bluetooth/bthidd/Makefile.depend1
-rw-r--r--usr.sbin/bluetooth/btpand/Makefile.depend1
-rw-r--r--usr.sbin/bluetooth/hccontrol/Makefile.depend1
-rw-r--r--usr.sbin/bluetooth/hcsecd/Makefile.depend1
-rw-r--r--usr.sbin/bluetooth/hcseriald/Makefile.depend1
-rw-r--r--usr.sbin/bluetooth/l2control/Makefile.depend1
-rw-r--r--usr.sbin/bluetooth/l2ping/Makefile.depend1
-rw-r--r--usr.sbin/bluetooth/rfcomm_pppd/Makefile.depend1
-rw-r--r--usr.sbin/bluetooth/sdpcontrol/Makefile.depend1
-rw-r--r--usr.sbin/bluetooth/sdpd/Makefile.depend1
-rw-r--r--usr.sbin/boot0cfg/Makefile.depend1
-rw-r--r--usr.sbin/boot98cfg/Makefile.depend1
-rw-r--r--usr.sbin/bootparamd/bootparamd/Makefile.depend1
-rw-r--r--usr.sbin/bootparamd/callbootd/Makefile.depend1
-rw-r--r--usr.sbin/bsdconfig/packages/Makefile.depend1
-rw-r--r--usr.sbin/bsdconfig/packages/include/Makefile.depend1
-rw-r--r--usr.sbin/bsdconfig/share/packages/Makefile.depend1
-rw-r--r--usr.sbin/bsdinstall/Makefile.depend1
-rw-r--r--usr.sbin/bsdinstall/distextract/Makefile.depend1
-rw-r--r--usr.sbin/bsdinstall/distfetch/Makefile.depend1
-rw-r--r--usr.sbin/bsdinstall/partedit/Makefile.depend1
-rw-r--r--usr.sbin/bsdinstall/scripts/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/bsnmpd/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/gensnmptree/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/modules/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_atm/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_bridge/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_hast/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_hostres/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_lm75/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_mibII/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_netgraph/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_pf/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_target/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_usm/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_vacm/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_wlan/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/tools/bsnmptools/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/tools/libbsnmptools/Makefile.depend1
-rw-r--r--usr.sbin/btxld/Makefile.depend1
-rw-r--r--usr.sbin/cdcontrol/Makefile.depend1
-rw-r--r--usr.sbin/chkgrp/Makefile.depend1
-rw-r--r--usr.sbin/chown/Makefile.depend1
-rw-r--r--usr.sbin/chroot/Makefile.depend1
-rw-r--r--usr.sbin/ckdist/Makefile.depend1
-rw-r--r--usr.sbin/clear_locks/Makefile.depend1
-rw-r--r--usr.sbin/config/Makefile.depend1
-rw-r--r--usr.sbin/cpucontrol/Makefile.depend1
-rw-r--r--usr.sbin/crashinfo/Makefile.depend1
-rw-r--r--usr.sbin/cron/cron/Makefile.depend1
-rw-r--r--usr.sbin/cron/crontab/Makefile.depend1
-rw-r--r--usr.sbin/cron/lib/Makefile.depend1
-rw-r--r--usr.sbin/crunch/crunchgen/Makefile.depend1
-rw-r--r--usr.sbin/crunch/crunchide/Makefile.depend1
-rw-r--r--usr.sbin/ctladm/Makefile.depend1
-rw-r--r--usr.sbin/ctld/login.c2
-rw-r--r--usr.sbin/ctm/ctm/Makefile.depend1
-rw-r--r--usr.sbin/ctm/ctm_dequeue/Makefile.depend1
-rw-r--r--usr.sbin/ctm/ctm_rmail/Makefile.depend1
-rw-r--r--usr.sbin/ctm/ctm_smail/Makefile.depend1
-rw-r--r--usr.sbin/daemon/Makefile.depend1
-rw-r--r--usr.sbin/dconschat/Makefile.depend1
-rw-r--r--usr.sbin/devinfo/Makefile.depend1
-rw-r--r--usr.sbin/digictl/Makefile.depend1
-rw-r--r--usr.sbin/diskinfo/Makefile.depend1
-rw-r--r--usr.sbin/dumpcis/Makefile.depend1
-rw-r--r--usr.sbin/editmap/Makefile.depend1
-rw-r--r--usr.sbin/edquota/Makefile.depend1
-rw-r--r--usr.sbin/eeprom/Makefile.depend1
-rw-r--r--usr.sbin/etcupdate/Makefile.depend1
-rw-r--r--usr.sbin/extattr/Makefile.depend1
-rw-r--r--usr.sbin/extattrctl/Makefile.depend1
-rw-r--r--usr.sbin/fdcontrol/Makefile.depend1
-rw-r--r--usr.sbin/fdformat/Makefile.depend1
-rw-r--r--usr.sbin/fdread/Makefile.depend1
-rw-r--r--usr.sbin/fdwrite/Makefile.depend1
-rw-r--r--usr.sbin/fifolog/fifolog_create/Makefile.depend1
-rw-r--r--usr.sbin/fifolog/fifolog_reader/Makefile.depend1
-rw-r--r--usr.sbin/fifolog/fifolog_writer/Makefile.depend1
-rw-r--r--usr.sbin/fifolog/lib/Makefile.depend1
-rw-r--r--usr.sbin/flowctl/Makefile.depend1
-rw-r--r--usr.sbin/freebsd-update/Makefile.depend1
-rw-r--r--usr.sbin/fwcontrol/Makefile.depend1
-rw-r--r--usr.sbin/getfmac/Makefile.depend1
-rw-r--r--usr.sbin/getpmac/Makefile.depend1
-rw-r--r--usr.sbin/gpioctl/Makefile.depend1
-rw-r--r--usr.sbin/gssd/Makefile.depend1
-rw-r--r--usr.sbin/gstat/Makefile.depend1
-rw-r--r--usr.sbin/i2c/Makefile.depend1
-rw-r--r--usr.sbin/ifmcstat/Makefile.depend1
-rw-r--r--usr.sbin/inetd/Makefile.depend1
-rw-r--r--usr.sbin/iostat/Makefile.depend1
-rw-r--r--usr.sbin/ip6addrctl/Makefile.depend1
-rw-r--r--usr.sbin/ipfwpcap/Makefile.depend1
-rw-r--r--usr.sbin/jail/Makefile.depend1
-rw-r--r--usr.sbin/jexec/Makefile.depend1
-rw-r--r--usr.sbin/jls/Makefile.depend1
-rw-r--r--usr.sbin/kbdcontrol/Makefile.depend1
-rw-r--r--usr.sbin/kbdmap/Makefile.depend1
-rw-r--r--usr.sbin/keyserv/Makefile.depend1
-rw-r--r--usr.sbin/kgmon/Makefile.depend1
-rw-r--r--usr.sbin/kgzip/Makefile.depend1
-rw-r--r--usr.sbin/kldxref/Makefile.depend1
-rw-r--r--usr.sbin/lastlogin/Makefile.depend1
-rw-r--r--usr.sbin/lmcconfig/Makefile.depend1
-rw-r--r--usr.sbin/lpr/chkprintcap/Makefile.depend1
-rw-r--r--usr.sbin/lpr/common_source/Makefile.depend1
-rw-r--r--usr.sbin/lpr/filters.ru/Makefile.depend1
-rw-r--r--usr.sbin/lpr/filters.ru/koi2855/Makefile.depend1
-rw-r--r--usr.sbin/lpr/filters.ru/koi2alt/Makefile.depend1
-rw-r--r--usr.sbin/lpr/filters/Makefile.depend1
-rw-r--r--usr.sbin/lpr/lp/Makefile.depend1
-rw-r--r--usr.sbin/lpr/lpc/Makefile.depend1
-rw-r--r--usr.sbin/lpr/lpd/Makefile.depend1
-rw-r--r--usr.sbin/lpr/lpq/Makefile.depend1
-rw-r--r--usr.sbin/lpr/lpr/Makefile.depend1
-rw-r--r--usr.sbin/lpr/lprm/Makefile.depend1
-rw-r--r--usr.sbin/lpr/lptest/Makefile.depend1
-rw-r--r--usr.sbin/lpr/pac/Makefile.depend1
-rw-r--r--usr.sbin/lptcontrol/Makefile.depend1
-rw-r--r--usr.sbin/mailstats/Makefile.depend1
-rw-r--r--usr.sbin/mailwrapper/Makefile.depend1
-rw-r--r--usr.sbin/makefs/Makefile.depend1
-rw-r--r--usr.sbin/makemap/Makefile.depend1
-rw-r--r--usr.sbin/manctl/Makefile.depend1
-rw-r--r--usr.sbin/memcontrol/Makefile.depend1
-rw-r--r--usr.sbin/mergemaster/Makefile.depend1
-rw-r--r--usr.sbin/mfiutil/Makefile.depend1
-rw-r--r--usr.sbin/mixer/Makefile.depend1
-rw-r--r--usr.sbin/mld6query/Makefile.depend1
-rw-r--r--usr.sbin/mlxcontrol/Makefile.depend1
-rw-r--r--usr.sbin/mount_smbfs/Makefile.depend1
-rw-r--r--usr.sbin/mountd/Makefile.depend1
-rw-r--r--usr.sbin/moused/Makefile.depend1
-rw-r--r--usr.sbin/mptable/Makefile.depend1
-rw-r--r--usr.sbin/mptutil/Makefile.depend1
-rw-r--r--usr.sbin/mtest/Makefile.depend1
-rw-r--r--usr.sbin/mtree/Makefile.depend1
-rw-r--r--usr.sbin/ndiscvt/Makefile.depend1
-rw-r--r--usr.sbin/ndp/Makefile.depend1
-rw-r--r--usr.sbin/newsyslog/Makefile.depend1
-rw-r--r--usr.sbin/nfscbd/Makefile.depend1
-rw-r--r--usr.sbin/nfsd/Makefile.depend1
-rw-r--r--usr.sbin/nfsdumpstate/Makefile.depend1
-rw-r--r--usr.sbin/nfsrevoke/Makefile.depend1
-rw-r--r--usr.sbin/nfsuserd/Makefile.depend1
-rw-r--r--usr.sbin/ngctl/Makefile.depend1
-rw-r--r--usr.sbin/nghook/Makefile.depend1
-rw-r--r--usr.sbin/nmtree/Makefile.depend1
-rw-r--r--usr.sbin/nologin/Makefile.depend1
-rw-r--r--usr.sbin/nscd/Makefile.depend1
-rw-r--r--usr.sbin/ntp/Makefile.inc2
-rw-r--r--usr.sbin/ntp/config.h4
-rw-r--r--usr.sbin/ntp/doc/Makefile.depend1
-rw-r--r--usr.sbin/ntp/libntp/Makefile.depend1
-rw-r--r--usr.sbin/ntp/libntpevent/Makefile.depend1
-rw-r--r--usr.sbin/ntp/libopts/Makefile.depend1
-rw-r--r--usr.sbin/ntp/libparse/Makefile.depend1
-rw-r--r--usr.sbin/ntp/ntp-keygen/Makefile2
-rw-r--r--usr.sbin/ntp/ntp-keygen/Makefile.depend1
-rw-r--r--usr.sbin/ntp/ntpd/Makefile4
-rw-r--r--usr.sbin/ntp/ntpd/Makefile.depend1
-rw-r--r--usr.sbin/ntp/ntpdate/Makefile6
-rw-r--r--usr.sbin/ntp/ntpdate/Makefile.depend1
-rw-r--r--usr.sbin/ntp/ntpdc/Makefile6
-rw-r--r--usr.sbin/ntp/ntpdc/Makefile.depend1
-rw-r--r--usr.sbin/ntp/ntpq/Makefile6
-rw-r--r--usr.sbin/ntp/ntpq/Makefile.depend1
-rw-r--r--usr.sbin/ntp/ntptime/Makefile.depend1
-rw-r--r--usr.sbin/ntp/sntp/Makefile4
-rw-r--r--usr.sbin/ntp/sntp/Makefile.depend1
-rw-r--r--usr.sbin/ofwdump/Makefile.depend1
-rw-r--r--usr.sbin/pc-sysinstall/backend-partmanager/Makefile.depend1
-rw-r--r--usr.sbin/pc-sysinstall/backend-query/Makefile.depend1
-rw-r--r--usr.sbin/pc-sysinstall/backend/Makefile.depend1
-rw-r--r--usr.sbin/pc-sysinstall/conf/Makefile.depend1
-rw-r--r--usr.sbin/pc-sysinstall/doc/Makefile.depend1
-rw-r--r--usr.sbin/pc-sysinstall/examples/Makefile.depend1
-rw-r--r--usr.sbin/pc-sysinstall/pc-sysinstall/Makefile.depend1
-rw-r--r--usr.sbin/pciconf/Makefile.depend1
-rw-r--r--usr.sbin/periodic/Makefile.depend1
-rw-r--r--usr.sbin/pkg/Makefile.depend1
-rw-r--r--usr.sbin/pmcannotate/Makefile.depend1
-rw-r--r--usr.sbin/pmccontrol/Makefile.depend1
-rw-r--r--usr.sbin/pmcstat/Makefile.depend1
-rw-r--r--usr.sbin/pmcstat/pmcstat.86
-rw-r--r--usr.sbin/pmcstat/pmcstat.c45
-rw-r--r--usr.sbin/pnpinfo/Makefile.depend1
-rw-r--r--usr.sbin/portsnap/make_index/Makefile.depend1
-rw-r--r--usr.sbin/portsnap/phttpget/Makefile.depend1
-rw-r--r--usr.sbin/portsnap/portsnap/Makefile.depend1
-rw-r--r--usr.sbin/powerd/Makefile.depend1
-rw-r--r--usr.sbin/ppp/Makefile.depend1
-rw-r--r--usr.sbin/pppctl/Makefile.depend1
-rw-r--r--usr.sbin/praliases/Makefile.depend1
-rw-r--r--usr.sbin/praudit/Makefile.depend1
-rw-r--r--usr.sbin/procctl/Makefile.depend1
-rw-r--r--usr.sbin/pstat/Makefile.depend1
-rw-r--r--usr.sbin/pw/Makefile2
-rw-r--r--usr.sbin/pw/Makefile.depend1
-rw-r--r--usr.sbin/pw/grupd.c27
-rw-r--r--usr.sbin/pw/pw.821
-rw-r--r--usr.sbin/pw/pw.c179
-rw-r--r--usr.sbin/pw/pw.h30
-rw-r--r--usr.sbin/pw/pw_conf.c235
-rw-r--r--usr.sbin/pw/pw_group.c128
-rw-r--r--usr.sbin/pw/pw_user.c483
-rw-r--r--usr.sbin/pw/pwupd.c29
-rw-r--r--usr.sbin/pw/pwupd.h52
-rw-r--r--usr.sbin/pw/tests/Makefile4
-rw-r--r--usr.sbin/pw/tests/pw-modified.conf62
-rw-r--r--usr.sbin/pw/tests/pw.conf62
-rwxr-xr-xusr.sbin/pw/tests/pw_config.sh26
-rwxr-xr-xusr.sbin/pw/tests/pw_groupmod.sh11
-rwxr-xr-xusr.sbin/pw/tests/pw_useradd.sh10
-rwxr-xr-xusr.sbin/pw/tests/pw_usermod.sh27
-rw-r--r--usr.sbin/pwd_mkdb/Makefile.depend1
-rw-r--r--usr.sbin/pwd_mkdb/pwd_mkdb.834
-rw-r--r--usr.sbin/pwd_mkdb/pwd_mkdb.c185
-rw-r--r--usr.sbin/quot/Makefile.depend1
-rw-r--r--usr.sbin/quotaon/Makefile.depend1
-rw-r--r--usr.sbin/rarpd/Makefile.depend1
-rw-r--r--usr.sbin/repquota/Makefile.depend1
-rw-r--r--usr.sbin/rip6query/Makefile.depend1
-rw-r--r--usr.sbin/rmt/Makefile.depend1
-rw-r--r--usr.sbin/route6d/Makefile.depend1
-rw-r--r--usr.sbin/rpc.lockd/Makefile.depend1
-rw-r--r--usr.sbin/rpc.statd/Makefile.depend1
-rw-r--r--usr.sbin/rpc.umntall/Makefile.depend1
-rw-r--r--usr.sbin/rpc.yppasswdd/Makefile.depend1
-rw-r--r--usr.sbin/rpc.ypupdated/Makefile.depend1
-rw-r--r--usr.sbin/rpc.ypxfrd/Makefile.depend1
-rw-r--r--usr.sbin/rpcbind/Makefile.depend1
-rw-r--r--usr.sbin/rrenumd/Makefile.depend1
-rw-r--r--usr.sbin/rtadvctl/Makefile.depend1
-rw-r--r--usr.sbin/rtadvd/Makefile.depend1
-rw-r--r--usr.sbin/rtprio/Makefile.depend1
-rw-r--r--usr.sbin/rtsold/Makefile.depend1
-rw-r--r--usr.sbin/rwhod/Makefile.depend1
-rw-r--r--usr.sbin/sa/Makefile.depend1
-rw-r--r--usr.sbin/sendmail/Makefile.depend1
-rw-r--r--usr.sbin/service/Makefile.depend1
-rw-r--r--usr.sbin/services_mkdb/Makefile.depend1
-rw-r--r--usr.sbin/setfib/Makefile.depend1
-rw-r--r--usr.sbin/setfmac/Makefile.depend1
-rw-r--r--usr.sbin/setpmac/Makefile.depend1
-rw-r--r--usr.sbin/sicontrol/Makefile.depend1
-rw-r--r--usr.sbin/smbmsg/Makefile.depend1
-rw-r--r--usr.sbin/snapinfo/Makefile.depend1
-rw-r--r--usr.sbin/spkrtest/Makefile.depend1
-rw-r--r--usr.sbin/spray/Makefile.depend1
-rw-r--r--usr.sbin/syslogd/Makefile.depend1
-rw-r--r--usr.sbin/tcpdchk/Makefile.depend1
-rw-r--r--usr.sbin/tcpdmatch/Makefile.depend1
-rw-r--r--usr.sbin/tcpdrop/Makefile.depend1
-rw-r--r--usr.sbin/tcpdump/tcpdump/Makefile.depend1
-rw-r--r--usr.sbin/timed/timed/Makefile.depend1
-rw-r--r--usr.sbin/timed/timedc/Makefile.depend1
-rw-r--r--usr.sbin/traceroute/Makefile.depend1
-rw-r--r--usr.sbin/traceroute6/Makefile.depend1
-rw-r--r--usr.sbin/trpt/Makefile.depend1
-rw-r--r--usr.sbin/tzsetup/Makefile.depend1
-rw-r--r--usr.sbin/uathload/Makefile.depend1
-rw-r--r--usr.sbin/ugidfw/Makefile.depend1
-rw-r--r--usr.sbin/uhsoctl/Makefile.depend1
-rw-r--r--usr.sbin/usbconfig/Makefile.depend1
-rw-r--r--usr.sbin/usbdump/Makefile.depend1
-rw-r--r--usr.sbin/utx/Makefile.depend1
-rw-r--r--usr.sbin/vidcontrol/Makefile.depend1
-rw-r--r--usr.sbin/vipw/Makefile.depend1
-rw-r--r--usr.sbin/wake/Makefile.depend1
-rw-r--r--usr.sbin/watch/Makefile.depend1
-rw-r--r--usr.sbin/watchdogd/Makefile.depend1
-rw-r--r--usr.sbin/wlandebug/Makefile.depend1
-rw-r--r--usr.sbin/wlconfig/Makefile.depend1
-rw-r--r--usr.sbin/wpa/hostapd/Makefile.depend1
-rw-r--r--usr.sbin/wpa/hostapd_cli/Makefile.depend1
-rw-r--r--usr.sbin/wpa/ndis_events/Makefile.depend1
-rw-r--r--usr.sbin/wpa/wpa_cli/Makefile.depend1
-rw-r--r--usr.sbin/wpa/wpa_passphrase/Makefile.depend1
-rw-r--r--usr.sbin/wpa/wpa_supplicant/Makefile.depend1
-rw-r--r--usr.sbin/yp_mkdb/Makefile.depend1
-rw-r--r--usr.sbin/ypbind/Makefile.depend1
-rw-r--r--usr.sbin/yppoll/Makefile.depend1
-rw-r--r--usr.sbin/yppoll/yppoll.822
-rw-r--r--usr.sbin/yppoll/yppoll.c10
-rw-r--r--usr.sbin/yppush/Makefile.depend1
-rw-r--r--usr.sbin/yppush/yppush_main.c10
-rw-r--r--usr.sbin/ypserv/Makefile.depend1
-rw-r--r--usr.sbin/ypset/Makefile.depend1
-rw-r--r--usr.sbin/zic/zdump/Makefile.depend1
-rw-r--r--usr.sbin/zic/zic/Makefile.depend1
-rw-r--r--usr.sbin/zzz/Makefile.depend1
3180 files changed, 84991 insertions, 49412 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 7539a14..1679404 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -1276,8 +1276,8 @@ _sed= usr.bin/sed
.endif
.if ${BOOTSTRAPPING} < 1000002
-_m4= lib/libohash \
- usr.bin/m4
+_libohash= lib/libohash
+_m4= usr.bin/m4
${_bt}-usr.bin/m4: ${_bt}-lib/libohash
.endif
@@ -1363,6 +1363,15 @@ _kerberos5_bootstrap_tools= \
.ORDER: ${_kerberos5_bootstrap_tools:C/^/${_bt}-/g}
.endif
+.if ${MK_MANDOCDB} != "no"
+_libohash?= lib/libohash
+_makewhatis= lib/libsqlite3 \
+ usr.bin/mandoc
+${_bt}-usr.bin/mandoc: ${_bt}-lib/libohash ${_bt}-lib/libsqlite3
+.else
+_makewhatis=usr.bin/makewhatis
+.endif
+
# Rebuild up-to-date libmd for xinstall
${_bt}-usr.bin/xinstall: ${_bt}-lib/libmd
@@ -1383,7 +1392,8 @@ bootstrap-tools: .PHONY
${_awk} \
${_cat} \
usr.bin/lorder \
- usr.bin/makewhatis \
+ ${_libohash} \
+ ${_makewhatis} \
usr.bin/rpcgen \
${_sed} \
${_yacc} \
@@ -1755,6 +1765,7 @@ _cddl_lib= cddl/lib
cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L
cddl/lib/libzfs__L: lib/libgeom__L
cddl/lib/libctf__L: lib/libz__L
+.endif
# cddl/lib/libdtrace requires lib/libproc and lib/librtld_db; it's only built
# on select architectures though (see cddl/lib/Makefile)
.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \
@@ -1762,7 +1773,6 @@ cddl/lib/libctf__L: lib/libz__L
${MACHINE_CPUARCH} == "arm"
_prebuild_libs+= lib/libproc lib/librtld_db
.endif
-.endif
.if ${MK_CRYPT} != "no"
.if ${MK_OPENSSL} != "no"
@@ -1806,9 +1816,10 @@ kerberos5/lib/libroken__L: lib/libcrypt__L
kerberos5/lib/libwind__L: kerberos5/lib/libroken__L lib/libcom_err__L
kerberos5/lib/libheimbase__L: lib/libthr__L
kerberos5/lib/libheimipcc__L: kerberos5/lib/libroken__L kerberos5/lib/libheimbase__L lib/libthr__L
-lib/libsqlite3__L: lib/libthr__L
.endif
+lib/libsqlite3__L: lib/libthr__L
+
.if ${MK_GSSAPI} != "no"
_lib_libgssapi= lib/libgssapi
.endif
diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc
index ecba9fe..f8de1b3 100644
--- a/ObsoleteFiles.inc
+++ b/ObsoleteFiles.inc
@@ -38,6 +38,71 @@
# xargs -n1 | sort | uniq -d;
# done
+# 20150528: PCI IOV device driver methods moved to a separate kobj interface.
+OLD_FILES+=usr/share/man/man9/PCI_ADD_VF.9
+OLD_FILES+=usr/share/man/man9/PCI_INIT_IOV.9
+OLD_FILES+=usr/share/man/man9/PCI_UNINIT_IOV.9
+# 20150525: new clang import which bumps version from 3.6.0 to 3.6.1.
+OLD_FILES+=usr/lib/clang/3.6.0/include/__stddef_max_align_t.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/__wmmintrin_aes.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/__wmmintrin_pclmul.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/adxintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/altivec.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/ammintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/arm_acle.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/arm_neon.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/avx2intrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/avx512bwintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/avx512erintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/avx512fintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/avx512vlbwintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/avx512vlintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/avxintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/bmi2intrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/bmiintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/cpuid.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/emmintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/f16cintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/fma4intrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/fmaintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/ia32intrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/immintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/lzcntintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/mm3dnow.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/mm_malloc.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/mmintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/module.modulemap
+OLD_FILES+=usr/lib/clang/3.6.0/include/nmmintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/pmmintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/popcntintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/prfchwintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/rdseedintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/rtmintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/shaintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/smmintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/tbmintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/tmmintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/wmmintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/x86intrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/xmmintrin.h
+OLD_FILES+=usr/lib/clang/3.6.0/include/xopintrin.h
+OLD_DIRS+=usr/lib/clang/3.6.0/include
+OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.asan-i386.a
+OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.asan-x86_64.a
+OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.asan_cxx-i386.a
+OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.asan_cxx-x86_64.a
+OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.profile-arm.a
+OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.profile-i386.a
+OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.profile-x86_64.a
+OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.san-i386.a
+OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.san-x86_64.a
+OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.ubsan-i386.a
+OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.ubsan-x86_64.a
+OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.ubsan_cxx-i386.a
+OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.ubsan_cxx-x86_64.a
+OLD_DIRS+=usr/lib/clang/3.6.0/lib/freebsd
+OLD_DIRS+=usr/lib/clang/3.6.0/lib
+OLD_DIRS+=usr/lib/clang/3.6.0
# 20150521
OLD_FILES+=usr/bin/demandoc
OLD_FILES+=usr/share/man/man1/demandoc.1.gz
diff --git a/UPDATING b/UPDATING
index d961aa3..d94af48 100644
--- a/UPDATING
+++ b/UPDATING
@@ -31,6 +31,20 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
+20150604:
+ Generation of legacy formatted entries have been disabled by default
+ in pwd_mkdb(8), as all base system consumers of the legacy formatted
+ entries were converted to use the new format by default when the new,
+ machine independent format have been added and supported since FreeBSD
+ 5.x.
+
+ Please see the pwd_mkdb(8) manual page for further details.
+
+20150525:
+ Clang and llvm have been upgraded to 3.6.1 release. Please see the
+ 20141231 entry below for information about prerequisites and upgrading,
+ if you are not already using 3.5.0 or higher.
+
20150521:
TI platform code switched to using vendor DTS files and this update
may break existing systems running on Beaglebone, Beaglebone Black,
diff --git a/bin/cat/Makefile.depend b/bin/cat/Makefile.depend
index f4b5142..f767986 100644
--- a/bin/cat/Makefile.depend
+++ b/bin/cat/Makefile.depend
@@ -1,3 +1,5 @@
+# $FreeBSD$
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/chflags/Makefile.depend b/bin/chflags/Makefile.depend
index f4b5142..3646e2e 100644
--- a/bin/chflags/Makefile.depend
+++ b/bin/chflags/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/chio/Makefile.depend b/bin/chio/Makefile.depend
index f4b5142..3646e2e 100644
--- a/bin/chio/Makefile.depend
+++ b/bin/chio/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/chmod/Makefile.depend b/bin/chmod/Makefile.depend
index f4b5142..3646e2e 100644
--- a/bin/chmod/Makefile.depend
+++ b/bin/chmod/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/chmod/chmod.c b/bin/chmod/chmod.c
index 9b80157..2ccce2d 100644
--- a/bin/chmod/chmod.c
+++ b/bin/chmod/chmod.c
@@ -162,14 +162,16 @@ done: argv += optind;
atflag = AT_SYMLINK_NOFOLLOW;
switch (p->fts_info) {
- case FTS_D: /* Change it at FTS_DP. */
+ case FTS_D:
if (!Rflag)
fts_set(ftsp, p, FTS_SKIP);
- continue;
+ break;
case FTS_DNR: /* Warn, chmod. */
warnx("%s: %s", p->fts_path, strerror(p->fts_errno));
rval = 1;
break;
+ case FTS_DP: /* Already changed at FTS_D. */
+ continue;
case FTS_ERR: /* Warn, continue. */
case FTS_NS:
warnx("%s: %s", p->fts_path, strerror(p->fts_errno));
diff --git a/bin/cp/Makefile.depend b/bin/cp/Makefile.depend
index f4b5142..3646e2e 100644
--- a/bin/cp/Makefile.depend
+++ b/bin/cp/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/cp/cp.1 b/bin/cp/cp.1
index 169f350..9bbd9d6 100644
--- a/bin/cp/cp.1
+++ b/bin/cp/cp.1
@@ -32,7 +32,7 @@
.\" @(#)cp.1 8.3 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
-.Dd March 15, 2013
+.Dd June 6, 2015
.Dt CP 1
.Os
.Sh NAME
@@ -45,7 +45,7 @@
.Op Fl H | Fl L | Fl P
.Oc
.Op Fl f | i | n
-.Op Fl alpvx
+.Op Fl alpsvx
.Ar source_file target_file
.Nm
.Oo
@@ -53,7 +53,7 @@
.Op Fl H | Fl L | Fl P
.Oc
.Op Fl f | i | n
-.Op Fl alpvx
+.Op Fl alpsvx
.Ar source_file ... target_directory
.Sh DESCRIPTION
In the first synopsis form, the
@@ -179,6 +179,8 @@ If the source file has both its set-user-ID and set-group-ID bits on,
and either the user ID or group ID cannot be preserved, neither
the set-user-ID nor set-group-ID bits are preserved in the copy's
permissions.
+.It Fl s
+Create symbolic links to regular files in a hierarchy instead of copying.
.It Fl v
Cause
.Nm
@@ -298,7 +300,10 @@ differ as they copy special files as normal
files while recreating a hierarchy.
.Pp
The
-.Fl v
+.Fl l,
+.Fl s,
+.Fl v,
+.Fl x
and
.Fl n
options are non-standard and their use in scripts is not recommended.
diff --git a/bin/cp/cp.c b/bin/cp/cp.c
index 2ad5f4a..11e3633 100644
--- a/bin/cp/cp.c
+++ b/bin/cp/cp.c
@@ -75,15 +75,15 @@ __FBSDID("$FreeBSD$");
#include "extern.h"
#define STRIP_TRAILING_SLASH(p) { \
- while ((p).p_end > (p).p_path + 1 && (p).p_end[-1] == '/') \
- *--(p).p_end = 0; \
+ while ((p).p_end > (p).p_path + 1 && (p).p_end[-1] == '/') \
+ *--(p).p_end = 0; \
}
static char emptystring[] = "";
PATH_T to = { to.p_path, emptystring, "" };
-int fflag, iflag, lflag, nflag, pflag, vflag;
+int fflag, iflag, lflag, nflag, pflag, sflag, vflag;
static int Rflag, rflag;
volatile sig_atomic_t info;
@@ -102,7 +102,7 @@ main(int argc, char *argv[])
fts_options = FTS_NOCHDIR | FTS_PHYSICAL;
Hflag = Lflag = 0;
- while ((ch = getopt(argc, argv, "HLPRafilnprvx")) != -1)
+ while ((ch = getopt(argc, argv, "HLPRafilnprsvx")) != -1)
switch (ch) {
case 'H':
Hflag = 1;
@@ -145,6 +145,9 @@ main(int argc, char *argv[])
rflag = Lflag = 1;
Hflag = 0;
break;
+ case 's':
+ sflag = 1;
+ break;
case 'v':
vflag = 1;
break;
@@ -163,6 +166,8 @@ main(int argc, char *argv[])
if (Rflag && rflag)
errx(1, "the -R and -r options may not be specified together");
+ if (lflag && sflag)
+ errx(1, "the -l and -s options may not be specified together");
if (rflag)
Rflag = 1;
if (Rflag) {
@@ -183,7 +188,7 @@ main(int argc, char *argv[])
if (strlcpy(to.p_path, target, sizeof(to.p_path)) >= sizeof(to.p_path))
errx(1, "%s: name too long", target);
to.p_end = to.p_path + strlen(to.p_path);
- if (to.p_path == to.p_end) {
+ if (to.p_path == to.p_end) {
*to.p_end++ = '.';
*to.p_end = 0;
}
@@ -240,10 +245,10 @@ main(int argc, char *argv[])
type = FILE_TO_FILE;
if (have_trailing_slash && type == FILE_TO_FILE) {
- if (r == -1)
+ if (r == -1) {
errx(1, "directory %s does not exist",
- to.p_path);
- else
+ to.p_path);
+ } else
errx(1, "%s is not a directory", to.p_path);
}
} else
@@ -294,8 +299,8 @@ copy(char *argv[], enum op type, int fts_options)
/*
* If we are in case (2) or (3) above, we need to append the
- * source name to the target name.
- */
+ * source name to the target name.
+ */
if (type != FILE_TO_FILE) {
/*
* Need to remember the roots of traversals to create
@@ -374,7 +379,8 @@ copy(char *argv[], enum op type, int fts_options)
mode = curr->fts_statp->st_mode;
if ((mode & (S_ISUID | S_ISGID | S_ISTXT)) ||
((mode | S_IRWXU) & mask) != (mode & mask))
- if (chmod(to.p_path, mode & mask) != 0){
+ if (chmod(to.p_path, mode & mask) !=
+ 0) {
warn("chmod: %s", to.p_path);
rval = 1;
}
@@ -382,7 +388,7 @@ copy(char *argv[], enum op type, int fts_options)
continue;
}
- /* Not an error but need to remember it happened */
+ /* Not an error but need to remember it happened. */
if (stat(to.p_path, &to_stat) == -1)
dne = 1;
else {
@@ -408,7 +414,7 @@ copy(char *argv[], enum op type, int fts_options)
switch (curr->fts_statp->st_mode & S_IFMT) {
case S_IFLNK:
- /* Catch special case of a non-dangling symlink */
+ /* Catch special case of a non-dangling symlink. */
if ((fts_options & FTS_LOGICAL) ||
((fts_options & FTS_COMFOLLOW) &&
curr->fts_level == 0)) {
@@ -433,7 +439,7 @@ copy(char *argv[], enum op type, int fts_options)
* modified by the umask. Trade-off between being
* able to write the directory (if from directory is
* 555) and not causing a permissions race. If the
- * umask blocks owner writes, we fail..
+ * umask blocks owner writes, we fail.
*/
if (dne) {
if (mkdir(to.p_path,
@@ -452,7 +458,7 @@ copy(char *argv[], enum op type, int fts_options)
break;
case S_IFBLK:
case S_IFCHR:
- if (Rflag) {
+ if (Rflag && !sflag) {
if (copy_special(curr->fts_statp, !dne))
badcp = rval = 1;
} else {
@@ -462,10 +468,10 @@ copy(char *argv[], enum op type, int fts_options)
break;
case S_IFSOCK:
warnx("%s is a socket (not copied).",
- curr->fts_path);
+ curr->fts_path);
break;
case S_IFIFO:
- if (Rflag) {
+ if (Rflag && !sflag) {
if (copy_fifo(curr->fts_statp, !dne))
badcp = rval = 1;
} else {
diff --git a/bin/cp/extern.h b/bin/cp/extern.h
index 94c416b..f8c20da 100644
--- a/bin/cp/extern.h
+++ b/bin/cp/extern.h
@@ -37,7 +37,7 @@ typedef struct {
} PATH_T;
extern PATH_T to;
-extern int fflag, iflag, lflag, nflag, pflag, vflag;
+extern int fflag, iflag, lflag, nflag, pflag, sflag, vflag;
extern volatile sig_atomic_t info;
__BEGIN_DECLS
diff --git a/bin/cp/utils.c b/bin/cp/utils.c
index f58ed7a..11a3568 100644
--- a/bin/cp/utils.c
+++ b/bin/cp/utils.c
@@ -57,15 +57,19 @@ __FBSDID("$FreeBSD$");
#define cp_pct(x, y) ((y == 0) ? 0 : (int)(100.0 * (x) / (y)))
-/* Memory strategy threshold, in pages: if physmem is larger then this, use a
- * large buffer */
+/*
+ * Memory strategy threshold, in pages: if physmem is larger then this, use a
+ * large buffer.
+ */
#define PHYSPAGES_THRESHOLD (32*1024)
-/* Maximum buffer size in bytes - do not allow it to grow larger than this */
+/* Maximum buffer size in bytes - do not allow it to grow larger than this. */
#define BUFSIZE_MAX (2*1024*1024)
-/* Small (default) buffer size in bytes. It's inefficient for this to be
- * smaller than MAXPHYS */
+/*
+ * Small (default) buffer size in bytes. It's inefficient for this to be
+ * smaller than MAXPHYS.
+ */
#define BUFSIZE_SMALL (MAXPHYS)
int
@@ -77,13 +81,15 @@ copy_file(const FTSENT *entp, int dne)
ssize_t wcount;
size_t wresid;
off_t wtotal;
- int ch, checkch, from_fd = 0, rcount, rval, to_fd = 0;
+ int ch, checkch, from_fd, rcount, rval, to_fd;
char *bufp;
#ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED
char *p;
#endif
- if ((from_fd = open(entp->fts_path, O_RDONLY, 0)) == -1) {
+ from_fd = to_fd = -1;
+ if (!lflag && !sflag &&
+ (from_fd = open(entp->fts_path, O_RDONLY, 0)) == -1) {
warn("%s", entp->fts_path);
return (1);
}
@@ -103,63 +109,65 @@ copy_file(const FTSENT *entp, int dne)
if (nflag) {
if (vflag)
printf("%s not overwritten\n", to.p_path);
- (void)close(from_fd);
- return (1);
+ rval = 1;
+ goto done;
} else if (iflag) {
(void)fprintf(stderr, "overwrite %s? %s",
- to.p_path, YESNO);
+ to.p_path, YESNO);
checkch = ch = getchar();
while (ch != '\n' && ch != EOF)
ch = getchar();
if (checkch != 'y' && checkch != 'Y') {
- (void)close(from_fd);
(void)fprintf(stderr, "not overwritten\n");
- return (1);
+ rval = 1;
+ goto done;
}
}
-
+
if (fflag) {
- /* remove existing destination file name,
- * create a new file */
- (void)unlink(to.p_path);
- if (!lflag)
- to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT,
- fs->st_mode & ~(S_ISUID | S_ISGID));
- } else {
- if (!lflag)
- /* overwrite existing destination file name */
- to_fd = open(to.p_path, O_WRONLY | O_TRUNC, 0);
+ /*
+ * Remove existing destination file name create a new
+ * file.
+ */
+ (void)unlink(to.p_path);
+ if (!lflag && !sflag) {
+ to_fd = open(to.p_path,
+ O_WRONLY | O_TRUNC | O_CREAT,
+ fs->st_mode & ~(S_ISUID | S_ISGID));
+ }
+ } else if (!lflag && !sflag) {
+ /* Overwrite existing destination file name. */
+ to_fd = open(to.p_path, O_WRONLY | O_TRUNC, 0);
}
- } else {
- if (!lflag)
- to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT,
- fs->st_mode & ~(S_ISUID | S_ISGID));
+ } else if (!lflag && !sflag) {
+ to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT,
+ fs->st_mode & ~(S_ISUID | S_ISGID));
}
-
- if (to_fd == -1) {
+
+ if (!lflag && !sflag && to_fd == -1) {
warn("%s", to.p_path);
- (void)close(from_fd);
- return (1);
+ rval = 1;
+ goto done;
}
rval = 0;
- if (!lflag) {
+ if (!lflag && !sflag) {
/*
- * Mmap and write if less than 8M (the limit is so we don't totally
- * trash memory on big files. This is really a minor hack, but it
- * wins some CPU back.
+ * Mmap and write if less than 8M (the limit is so we don't
+ * totally trash memory on big files. This is really a minor
+ * hack, but it wins some CPU back.
* Some filesystems, such as smbnetfs, don't support mmap,
* so this is a best-effort attempt.
*/
#ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED
if (S_ISREG(fs->st_mode) && fs->st_size > 0 &&
- fs->st_size <= 8 * 1024 * 1024 &&
+ fs->st_size <= 8 * 1024 * 1024 &&
(p = mmap(NULL, (size_t)fs->st_size, PROT_READ,
MAP_SHARED, from_fd, (off_t)0)) != MAP_FAILED) {
wtotal = 0;
for (bufp = p, wresid = fs->st_size; ;
- bufp += wcount, wresid -= (size_t)wcount) {
+ bufp += wcount, wresid -= (size_t)wcount) {
wcount = write(to_fd, bufp, wresid);
if (wcount <= 0)
break;
@@ -204,7 +212,7 @@ copy_file(const FTSENT *entp, int dne)
wtotal = 0;
while ((rcount = read(from_fd, buf, bufsize)) > 0) {
for (bufp = buf, wresid = rcount; ;
- bufp += wcount, wresid -= wcount) {
+ bufp += wcount, wresid -= wcount) {
wcount = write(to_fd, bufp, wresid);
if (wcount <= 0)
break;
@@ -230,13 +238,18 @@ copy_file(const FTSENT *entp, int dne)
rval = 1;
}
}
- } else {
+ } else if (lflag) {
if (link(entp->fts_path, to.p_path)) {
warn("%s", to.p_path);
rval = 1;
}
+ } else if (sflag) {
+ if (symlink(entp->fts_path, to.p_path)) {
+ warn("%s", to.p_path);
+ rval = 1;
+ }
}
-
+
/*
* Don't remove the target even after an error. The target might
* not be a regular file, or its attributes might be important,
@@ -244,7 +257,7 @@ copy_file(const FTSENT *entp, int dne)
* to remove it if we created it and its length is 0.
*/
- if (!lflag) {
+ if (!lflag && !sflag) {
if (pflag && setfile(fs, to_fd))
rval = 1;
if (pflag && preserve_fd_acls(from_fd, to_fd) != 0)
@@ -255,8 +268,9 @@ copy_file(const FTSENT *entp, int dne)
}
}
- (void)close(from_fd);
-
+done:
+ if (from_fd != -1)
+ (void)close(from_fd);
return (rval);
}
@@ -338,7 +352,7 @@ setfile(struct stat *fs, int fd)
fdval = fd != -1;
islink = !fdval && S_ISLNK(fs->st_mode);
fs->st_mode &= S_ISUID | S_ISGID | S_ISVTX |
- S_IRWXU | S_IRWXG | S_IRWXO;
+ S_IRWXU | S_IRWXG | S_IRWXO;
tspec[0] = fs->st_atim;
tspec[1] = fs->st_mtim;
@@ -353,7 +367,7 @@ setfile(struct stat *fs, int fd)
else {
gotstat = 1;
ts.st_mode &= S_ISUID | S_ISGID | S_ISVTX |
- S_IRWXU | S_IRWXG | S_IRWXO;
+ S_IRWXU | S_IRWXG | S_IRWXO;
}
/*
* Changing the ownership probably won't succeed, unless we're root
@@ -477,7 +491,7 @@ preserve_dir_acls(struct stat *fs, char *source_dir, char *dest_dir)
return (0);
/*
- * If the file is a link we will not follow it
+ * If the file is a link we will not follow it.
*/
if (S_ISLNK(fs->st_mode)) {
aclgetf = acl_get_link_np;
@@ -536,8 +550,10 @@ usage(void)
{
(void)fprintf(stderr, "%s\n%s\n",
-"usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpvx] source_file target_file",
-" cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpvx] source_file ... "
-"target_directory");
+ "usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpsvx] "
+ "source_file target_file",
+ " cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpsvx] "
+ "source_file ... "
+ "target_directory");
exit(EX_USAGE);
}
diff --git a/bin/csh/Makefile.depend b/bin/csh/Makefile.depend
index 0ab05ce..ab84f40 100644
--- a/bin/csh/Makefile.depend
+++ b/bin/csh/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
include \
diff --git a/bin/date/Makefile.depend b/bin/date/Makefile.depend
index 725077b..26cae4e 100644
--- a/bin/date/Makefile.depend
+++ b/bin/date/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/dd/Makefile.depend b/bin/dd/Makefile.depend
index f4b5142..3646e2e 100644
--- a/bin/dd/Makefile.depend
+++ b/bin/dd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/df/Makefile.depend b/bin/df/Makefile.depend
index 04ae687..137678c 100644
--- a/bin/df/Makefile.depend
+++ b/bin/df/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/domainname/Makefile.depend b/bin/domainname/Makefile.depend
index f4b5142..3646e2e 100644
--- a/bin/domainname/Makefile.depend
+++ b/bin/domainname/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/echo/Makefile.depend b/bin/echo/Makefile.depend
index f4b5142..3646e2e 100644
--- a/bin/echo/Makefile.depend
+++ b/bin/echo/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/ed/Makefile.depend b/bin/ed/Makefile.depend
index e9b5ed1..fc0b633 100644
--- a/bin/ed/Makefile.depend
+++ b/bin/ed/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/expr/Makefile.depend b/bin/expr/Makefile.depend
index ef4e1b5..9d55364 100644
--- a/bin/expr/Makefile.depend
+++ b/bin/expr/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/freebsd-version/Makefile.depend b/bin/freebsd-version/Makefile.depend
index 11aba52..f80275d 100644
--- a/bin/freebsd-version/Makefile.depend
+++ b/bin/freebsd-version/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/getfacl/Makefile.depend b/bin/getfacl/Makefile.depend
index f4b5142..3646e2e 100644
--- a/bin/getfacl/Makefile.depend
+++ b/bin/getfacl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/hostname/Makefile.depend b/bin/hostname/Makefile.depend
index f4b5142..3646e2e 100644
--- a/bin/hostname/Makefile.depend
+++ b/bin/hostname/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/kenv/Makefile.depend b/bin/kenv/Makefile.depend
index f4b5142..3646e2e 100644
--- a/bin/kenv/Makefile.depend
+++ b/bin/kenv/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/kill/Makefile.depend b/bin/kill/Makefile.depend
index f4b5142..3646e2e 100644
--- a/bin/kill/Makefile.depend
+++ b/bin/kill/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/ln/Makefile.depend b/bin/ln/Makefile.depend
index f4b5142..3646e2e 100644
--- a/bin/ln/Makefile.depend
+++ b/bin/ln/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/ls/Makefile b/bin/ls/Makefile
index 58206e0..3349b7a 100644
--- a/bin/ls/Makefile
+++ b/bin/ls/Makefile
@@ -10,7 +10,7 @@ LIBADD= util
.if !defined(RELEASE_CRUNCH) && \
${MK_LS_COLORS} != no
CFLAGS+= -DCOLORLS
-LIBADD+= termcapw
+LIBADD+= termcapw xo
.endif
.include <bsd.prog.mk>
diff --git a/bin/ls/Makefile.depend b/bin/ls/Makefile.depend
index d735a01..e36f602 100644
--- a/bin/ls/Makefile.depend
+++ b/bin/ls/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/ls/extern.h b/bin/ls/extern.h
index 90a20a8..e4b5059 100644
--- a/bin/ls/extern.h
+++ b/bin/ls/extern.h
@@ -45,14 +45,17 @@ int revsizecmp(const FTSENT *, const FTSENT *);
void printcol(const DISPLAY *);
void printlong(const DISPLAY *);
-int printname(const char *);
+int printname(const char *, const char *);
void printscol(const DISPLAY *);
void printstream(const DISPLAY *);
void usage(void);
-int prn_normal(const char *);
+int prn_normal(const char *, const char *);
+char * getname(const char *);
size_t len_octal(const char *, int);
-int prn_octal(const char *);
-int prn_printable(const char *);
+int prn_octal(const char *, const char *);
+char * get_octal(const char *);
+int prn_printable(const char *, const char *);
+char * get_printable(const char *);
#ifdef COLORLS
void parsecolors(const char *cs);
void colorquit(int);
diff --git a/bin/ls/ls.1 b/bin/ls/ls.1
index ee8e4ff..3e02229 100644
--- a/bin/ls/ls.1
+++ b/bin/ls/ls.1
@@ -32,7 +32,7 @@
.\" @(#)ls.1 8.7 (Berkeley) 7/29/94
.\" $FreeBSD$
.\"
-.Dd April 4, 2014
+.Dd June 8, 2015
.Dt LS 1
.Os
.Sh NAME
@@ -40,6 +40,7 @@
.Nd list directory contents
.Sh SYNOPSIS
.Nm
+.Op Fl -libxo
.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1,
.Op Fl D Ar format
.Op Ar
@@ -797,9 +798,11 @@ specification.
.Xr getfacl 1 ,
.Xr sort 1 ,
.Xr xterm 1 ,
+.Xr libxo 3 ,
.Xr localeconv 3 ,
.Xr strftime 3 ,
.Xr strmode 3 ,
+.Xr xo_parse_args 3 ,
.Xr termcap 5 ,
.Xr maclabel 7 ,
.Xr sticky 7 ,
diff --git a/bin/ls/ls.c b/bin/ls/ls.c
index a46f358..926d2bc 100644
--- a/bin/ls/ls.c
+++ b/bin/ls/ls.c
@@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$");
#include <termcap.h>
#include <signal.h>
#endif
+#include <libxo/xo.h>
#include "ls.h"
#include "extern.h"
@@ -185,6 +186,12 @@ main(int argc, char *argv[])
fts_options = FTS_PHYSICAL;
if (getenv("LS_SAMESORT"))
f_samesort = 1;
+
+ argc = xo_parse_args(argc, argv);
+ if (argc < 0)
+ return (1);
+ xo_set_flags(NULL, XOF_COLUMNS);
+
while ((ch = getopt(argc, argv,
"1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,")) != -1) {
switch (ch) {
@@ -381,7 +388,7 @@ main(int argc, char *argv[])
f_color = 1;
}
#else
- warnx("color support not compiled in");
+ xo_warnx("color support not compiled in");
#endif /*COLORLS*/
#ifdef COLORLS
@@ -413,9 +420,14 @@ main(int argc, char *argv[])
/*
* If not -F, -P, -d or -l options, follow any symbolic links listed on
- * the command line.
+ * the command line, unless in color mode in which case we need to
+ * distinguish file type for a symbolic link itself and its target.
*/
- if (!f_nofollow && !f_longform && !f_listdir && (!f_type || f_slash))
+ if (!f_nofollow && !f_longform && !f_listdir && (!f_type || f_slash)
+#ifdef COLORLS
+ && !f_color
+#endif
+ )
fts_options |= FTS_COMFOLLOW;
/*
@@ -474,10 +486,13 @@ main(int argc, char *argv[])
else
printfcn = printcol;
+ xo_open_container("file-information");
if (argc)
traverse(argc, argv, fts_options);
else
traverse(1, dotav, fts_options);
+ xo_close_container("file-information");
+ xo_finish();
exit(rval);
}
@@ -495,10 +510,11 @@ traverse(int argc, char *argv[], int options)
FTS *ftsp;
FTSENT *p, *chp;
int ch_options;
+ int first = 1;
if ((ftsp =
fts_open(argv, options, f_nosort ? NULL : mastercmp)) == NULL)
- err(1, "fts_open");
+ xo_err(1, "fts_open");
/*
* We ignore errors from fts_children here since they will be
@@ -520,11 +536,11 @@ traverse(int argc, char *argv[], int options)
while ((p = fts_read(ftsp)) != NULL)
switch (p->fts_info) {
case FTS_DC:
- warnx("%s: directory causes a cycle", p->fts_name);
+ xo_warnx("%s: directory causes a cycle", p->fts_name);
break;
case FTS_DNR:
case FTS_ERR:
- warnx("%s: %s", p->fts_path, strerror(p->fts_errno));
+ xo_warnx("%s: %s", p->fts_path, strerror(p->fts_errno));
rval = 1;
break;
case FTS_D:
@@ -532,31 +548,40 @@ traverse(int argc, char *argv[], int options)
p->fts_name[0] == '.' && !f_listdot)
break;
+ if (first) {
+ first = 0;
+ xo_open_list("directory");
+ }
+ xo_open_instance("directory");
+
/*
* If already output something, put out a newline as
* a separator. If multiple arguments, precede each
* directory with its name.
*/
if (output) {
- putchar('\n');
- (void)printname(p->fts_path);
- puts(":");
+ xo_emit("\n");
+ (void)printname("path", p->fts_path);
+ xo_emit(":\n");
} else if (argc > 1) {
- (void)printname(p->fts_path);
- puts(":");
+ (void)printname("path", p->fts_path);
+ xo_emit(":\n");
output = 1;
}
chp = fts_children(ftsp, ch_options);
display(p, chp, options);
+ xo_close_instance("directory");
if (!f_recursive && chp != NULL)
(void)fts_set(ftsp, p, FTS_SKIP);
break;
default:
break;
}
+ if (!first)
+ xo_close_list("directory");
if (errno)
- err(1, "fts_read");
+ xo_err(1, "fts_read");
}
/*
@@ -603,7 +628,7 @@ display(const FTSENT *p, FTSENT *list, int options)
/* Fill-in "::" as "0:0:0" for the sake of scanf. */
jinitmax = malloc(strlen(initmax) * 2 + 2);
if (jinitmax == NULL)
- err(1, "malloc");
+ xo_err(1, "malloc");
initmax2 = jinitmax;
if (*initmax == ':')
strcpy(initmax2, "0:"), initmax2 += 2;
@@ -674,7 +699,7 @@ display(const FTSENT *p, FTSENT *list, int options)
flags = NULL;
for (cur = list, entries = 0; cur; cur = cur->fts_link) {
if (cur->fts_info == FTS_ERR || cur->fts_info == FTS_NS) {
- warnx("%s: %s",
+ xo_warnx("%s: %s",
cur->fts_name, strerror(cur->fts_errno));
cur->fts_number = NO_PRINT;
rval = 1;
@@ -740,7 +765,7 @@ display(const FTSENT *p, FTSENT *list, int options)
flags = strdup("-");
}
if (flags == NULL)
- err(1, "fflagstostr");
+ xo_err(1, "fflagstostr");
flen = strlen(flags);
if (flen > (size_t)maxflags)
maxflags = flen;
@@ -754,7 +779,7 @@ display(const FTSENT *p, FTSENT *list, int options)
error = mac_prepare_file_label(&label);
if (error == -1) {
- warn("MAC label for %s/%s",
+ xo_warn("MAC label for %s/%s",
cur->fts_parent->fts_path,
cur->fts_name);
goto label_out;
@@ -775,7 +800,7 @@ display(const FTSENT *p, FTSENT *list, int options)
error = mac_get_link(name,
label);
if (error == -1) {
- warn("MAC label for %s/%s",
+ xo_warn("MAC label for %s/%s",
cur->fts_parent->fts_path,
cur->fts_name);
mac_free(label);
@@ -785,7 +810,7 @@ display(const FTSENT *p, FTSENT *list, int options)
error = mac_to_text(label,
&labelstr);
if (error == -1) {
- warn("MAC label for %s/%s",
+ xo_warn("MAC label for %s/%s",
cur->fts_parent->fts_path,
cur->fts_name);
mac_free(label);
@@ -803,7 +828,7 @@ label_out:
if ((np = malloc(sizeof(NAMES) + labelstrlen +
ulen + glen + flen + 4)) == NULL)
- err(1, "malloc");
+ xo_err(1, "malloc");
np->user = &np->data[0];
(void)strcpy(np->user, user);
diff --git a/bin/ls/print.c b/bin/ls/print.c
index 930d6ea..c96fe7c 100644
--- a/bin/ls/print.c
+++ b/bin/ls/print.c
@@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$");
#include <termcap.h>
#include <signal.h>
#endif
+#include <libxo/xo.h>
#include "ls.h"
#include "extern.h"
@@ -65,9 +66,9 @@ __FBSDID("$FreeBSD$");
static int printaname(const FTSENT *, u_long, u_long);
static void printdev(size_t, dev_t);
static void printlink(const FTSENT *);
-static void printtime(time_t);
+static void printtime(const char *, time_t);
static int printtype(u_int);
-static void printsize(size_t, off_t);
+static void printsize(const char *, size_t, off_t);
#ifdef COLORLS
static void endcolor(int);
static int colortype(mode_t);
@@ -109,26 +110,46 @@ printscol(const DISPLAY *dp)
{
FTSENT *p;
+ xo_open_list("entry");
for (p = dp->list; p; p = p->fts_link) {
if (IS_NOPRINT(p))
continue;
+ xo_open_instance("entry");
(void)printaname(p, dp->s_inode, dp->s_block);
- (void)putchar('\n');
+ xo_close_instance("entry");
+ xo_emit("\n");
}
+ xo_close_list("entry");
}
/*
* print name in current style
*/
int
-printname(const char *name)
+printname(const char *field, const char *name)
+{
+ char fmt[BUFSIZ];
+ char *s = getname(name);
+ int rc;
+
+ snprintf(fmt, sizeof(fmt), "{:%s/%%hs}", field);
+ rc = xo_emit(fmt, s);
+ free(s);
+ return rc;
+}
+
+/*
+ * print name in current style
+ */
+char *
+getname(const char *name)
{
if (f_octal || f_octal_escape)
- return prn_octal(name);
+ return get_octal(name);
else if (f_nonprint)
- return prn_printable(name);
+ return get_printable(name);
else
- return prn_normal(name);
+ return strdup(name);
}
void
@@ -144,46 +165,59 @@ printlong(const DISPLAY *dp)
if ((dp->list == NULL || dp->list->fts_level != FTS_ROOTLEVEL) &&
(f_longform || f_size)) {
- (void)printf("total %lu\n", howmany(dp->btotal, blocksize));
+ xo_emit("{L:total} {:total-blocks/%lu}\n",
+ howmany(dp->btotal, blocksize));
}
+ xo_open_list("entry");
for (p = dp->list; p; p = p->fts_link) {
+ char *name;
if (IS_NOPRINT(p))
continue;
+ xo_open_instance("entry");
sp = p->fts_statp;
+ name = getname(p->fts_name);
+ if (name)
+ xo_emit("{ke:name}", name);
if (f_inode)
- (void)printf("%*ju ",
+ xo_emit("{:inode/%*ju} ",
dp->s_inode, (uintmax_t)sp->st_ino);
if (f_size)
- (void)printf("%*jd ",
+ xo_emit("{:blocks/%*jd} ",
dp->s_block, howmany(sp->st_blocks, blocksize));
strmode(sp->st_mode, buf);
aclmode(buf, p);
np = p->fts_pointer;
- (void)printf("%s %*u %-*s %-*s ", buf, dp->s_nlink,
- sp->st_nlink, dp->s_user, np->user, dp->s_group,
- np->group);
+ xo_attr("value", "%03o", (int) sp->st_mode & ALLPERMS);
+ xo_emit("{t:mode/%s} {:links/%*u} {:user/%-*s} {:group/%-*s} ",
+ buf, dp->s_nlink, sp->st_nlink,
+ dp->s_user, np->user, dp->s_group, np->group);
if (f_flags)
- (void)printf("%-*s ", dp->s_flags, np->flags);
+ xo_emit("{:flags/%-*s} ", dp->s_flags, np->flags);
if (f_label)
- (void)printf("%-*s ", dp->s_label, np->label);
+ xo_emit("{:label/%-*s} ", dp->s_label, np->label);
if (S_ISCHR(sp->st_mode) || S_ISBLK(sp->st_mode))
printdev(dp->s_size, sp->st_rdev);
else
- printsize(dp->s_size, sp->st_size);
+ printsize("size", dp->s_size, sp->st_size);
if (f_accesstime)
- printtime(sp->st_atime);
+ printtime("access-time", sp->st_atime);
else if (f_birthtime)
- printtime(sp->st_birthtime);
+ printtime("birth-time", sp->st_birthtime);
else if (f_statustime)
- printtime(sp->st_ctime);
+ printtime("change-time", sp->st_ctime);
else
- printtime(sp->st_mtime);
+ printtime("modify-time", sp->st_mtime);
#ifdef COLORLS
if (f_color)
color_printed = colortype(sp->st_mode);
#endif
- (void)printname(p->fts_name);
+
+ if (name) {
+ xo_emit("{dk:name}", name);
+ free(name);
+ }
+
#ifdef COLORLS
if (f_color && color_printed)
endcolor(0);
@@ -192,8 +226,10 @@ printlong(const DISPLAY *dp)
(void)printtype(sp->st_mode);
if (S_ISLNK(sp->st_mode))
printlink(p);
- (void)putchar('\n');
+ xo_close_instance("entry");
+ xo_emit("\n");
}
+ xo_close_list("entry");
}
void
@@ -208,17 +244,17 @@ printstream(const DISPLAY *dp)
/* XXX strlen does not take octal escapes into account. */
if (strlen(p->fts_name) + chcnt +
(p->fts_link ? 2 : 0) >= (unsigned)termwidth) {
- putchar('\n');
+ xo_emit("\n");
chcnt = 0;
}
chcnt += printaname(p, dp->s_inode, dp->s_block);
if (p->fts_link) {
- printf(", ");
+ xo_emit(", ");
chcnt += 2;
}
}
if (chcnt)
- putchar('\n');
+ xo_emit("\n");
}
void
@@ -252,7 +288,6 @@ printcol(const DISPLAY *dp)
if (dp->entries > lastentries) {
if ((narray =
realloc(array, dp->entries * sizeof(FTSENT *))) == NULL) {
- warn(NULL);
printscol(dp);
return;
}
@@ -283,17 +318,21 @@ printcol(const DISPLAY *dp)
if ((dp->list == NULL || dp->list->fts_level != FTS_ROOTLEVEL) &&
(f_longform || f_size)) {
- (void)printf("total %lu\n", howmany(dp->btotal, blocksize));
+ xo_emit("{L:total} {:total-blocks/%lu}\n",
+ howmany(dp->btotal, blocksize));
}
+ xo_open_list("entry");
base = 0;
for (row = 0; row < numrows; ++row) {
endcol = colwidth;
if (!f_sortacross)
base = row;
for (col = 0, chcnt = 0; col < numcols; ++col) {
+ xo_open_instance("entry");
chcnt += printaname(array[base], dp->s_inode,
dp->s_block);
+ xo_close_instance("entry");
if (f_sortacross)
base++;
else
@@ -304,13 +343,14 @@ printcol(const DISPLAY *dp)
<= endcol) {
if (f_sortacross && col + 1 >= numcols)
break;
- (void)putchar(f_notabs ? ' ' : '\t');
+ xo_emit(f_notabs ? " " : "\t");
chcnt = cnt;
}
endcol += colwidth;
}
- (void)putchar('\n');
+ xo_emit("\n");
}
+ xo_close_list("entry");
}
/*
@@ -329,16 +369,16 @@ printaname(const FTSENT *p, u_long inodefield, u_long sizefield)
sp = p->fts_statp;
chcnt = 0;
if (f_inode)
- chcnt += printf("%*ju ",
+ chcnt += xo_emit("{:inode/%*ju} ",
(int)inodefield, (uintmax_t)sp->st_ino);
if (f_size)
- chcnt += printf("%*jd ",
+ chcnt += xo_emit("{:size/%*jd} ",
(int)sizefield, howmany(sp->st_blocks, blocksize));
#ifdef COLORLS
if (f_color)
color_printed = colortype(sp->st_mode);
#endif
- chcnt += printname(p->fts_name);
+ chcnt += printname("name", p->fts_name);
#ifdef COLORLS
if (f_color && color_printed)
endcolor(0);
@@ -354,14 +394,14 @@ printaname(const FTSENT *p, u_long inodefield, u_long sizefield)
static void
printdev(size_t width, dev_t dev)
{
-
- (void)printf("%#*jx ", (u_int)width, (uintmax_t)dev);
+ xo_emit("{:device/%#*jx} ", (u_int)width, (uintmax_t)dev);
}
static void
-printtime(time_t ftime)
+printtime(const char *field, time_t ftime)
{
char longstring[80];
+ char fmt[BUFSIZ];
static time_t now = 0;
const char *format;
static int d_first = -1;
@@ -384,8 +424,10 @@ printtime(time_t ftime)
/* mmm dd yyyy || dd mmm yyyy */
format = d_first ? "%e %b %Y" : "%b %e %Y";
strftime(longstring, sizeof(longstring), format, localtime(&ftime));
- fputs(longstring, stdout);
- fputc(' ', stdout);
+
+ snprintf(fmt, sizeof(fmt), "{:%s/%%s} ", field);
+ xo_attr("value", "%ld", (long) ftime);
+ xo_emit(fmt, longstring);
}
static int
@@ -394,7 +436,7 @@ printtype(u_int mode)
if (f_slash) {
if ((mode & S_IFMT) == S_IFDIR) {
- (void)putchar('/');
+ xo_emit("{D:\\/}{e:type/directory}");
return (1);
}
return (0);
@@ -402,25 +444,25 @@ printtype(u_int mode)
switch (mode & S_IFMT) {
case S_IFDIR:
- (void)putchar('/');
+ xo_emit("{D:/\\/}{e:type/directory}");
return (1);
case S_IFIFO:
- (void)putchar('|');
+ xo_emit("{D:|}{e:type/fifo}");
return (1);
case S_IFLNK:
- (void)putchar('@');
+ xo_emit("{D:@}{e:type/link}");
return (1);
case S_IFSOCK:
- (void)putchar('=');
+ xo_emit("{D:=}{e:type/socket}");
return (1);
case S_IFWHT:
- (void)putchar('%');
+ xo_emit("{D:%}{e:type/whiteout}");
return (1);
default:
break;
}
if (mode & (S_IXUSR | S_IXGRP | S_IXOTH)) {
- (void)putchar('*');
+ xo_emit("{D:*}{e:executable/}");
return (1);
}
return (0);
@@ -430,7 +472,7 @@ printtype(u_int mode)
static int
putch(int c)
{
- (void)putchar(c);
+ xo_emit("{D:/%c}", c);
return 0;
}
@@ -539,7 +581,7 @@ parsecolors(const char *cs)
if (c[j] >= '0' && c[j] <= '7') {
colors[i].num[j] = c[j] - '0';
if (!legacy_warn) {
- warnx("LSCOLORS should use "
+ xo_warnx("LSCOLORS should use "
"characters a-h instead of 0-9 ("
"see the manual page)");
}
@@ -552,7 +594,7 @@ parsecolors(const char *cs)
} else if (tolower((unsigned char)c[j]) == 'x')
colors[i].num[j] = -1;
else {
- warnx("invalid character '%c' in LSCOLORS"
+ xo_warnx("invalid character '%c' in LSCOLORS"
" env var", c[j]);
colors[i].num[j] = -1;
}
@@ -584,18 +626,19 @@ printlink(const FTSENT *p)
(void)snprintf(name, sizeof(name),
"%s/%s", p->fts_parent->fts_accpath, p->fts_name);
if ((lnklen = readlink(name, path, sizeof(path) - 1)) == -1) {
- (void)fprintf(stderr, "\nls: %s: %s\n", name, strerror(errno));
+ xo_error("\nls: %s: %s\n", name, strerror(errno));
return;
}
path[lnklen] = '\0';
- (void)printf(" -> ");
- (void)printname(path);
+ xo_emit(" -> ");
+ (void)printname("target", path);
}
static void
-printsize(size_t width, off_t bytes)
+printsize(const char *field, size_t width, off_t bytes)
{
-
+ char fmt[BUFSIZ];
+
if (f_humanval) {
/*
* Reserve one space before the size and allocate room for
@@ -605,13 +648,15 @@ printsize(size_t width, off_t bytes)
humanize_number(buf, sizeof(buf), (int64_t)bytes, "",
HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL);
- (void)printf("%*s ", (u_int)width, buf);
- } else if (f_thousands) { /* with commas */
+ snprintf(fmt, sizeof(fmt), "{:%s/%%%ds} ", field, (int) width);
+ xo_attr("value", "%jd", (intmax_t) bytes);
+ xo_emit(fmt, buf);
+ } else { /* with commas */
/* This format assignment needed to work round gcc bug. */
- const char *format = "%*j'd ";
- (void)printf(format, (u_int)width, bytes);
- } else
- (void)printf("%*jd ", (u_int)width, bytes);
+ snprintf(fmt, sizeof(fmt), "{:%s/%%%dj%sd} ",
+ field, (int) width, f_thousands ? "'" : "");
+ xo_emit(fmt, (intmax_t) bytes);
+ }
}
/*
@@ -654,7 +699,7 @@ aclmode(char *buf, const FTSENT *p)
type = ACL_TYPE_NFS4;
supports_acls = 1;
} else if (ret < 0 && errno != EINVAL) {
- warn("%s", name);
+ xo_warn("%s", name);
return;
}
if (supports_acls == 0) {
@@ -663,7 +708,7 @@ aclmode(char *buf, const FTSENT *p)
type = ACL_TYPE_ACCESS;
supports_acls = 1;
} else if (ret < 0 && errno != EINVAL) {
- warn("%s", name);
+ xo_warn("%s", name);
return;
}
}
@@ -672,12 +717,12 @@ aclmode(char *buf, const FTSENT *p)
return;
facl = acl_get_link_np(name, type);
if (facl == NULL) {
- warn("%s", name);
+ xo_warn("%s", name);
return;
}
if (acl_is_trivial_np(facl, &trivial)) {
acl_free(facl);
- warn("%s", name);
+ xo_warn("%s", name);
return;
}
if (!trivial)
diff --git a/bin/ls/util.c b/bin/ls/util.c
index f8466cd..b75cbec 100644
--- a/bin/ls/util.c
+++ b/bin/ls/util.c
@@ -50,13 +50,19 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <wchar.h>
#include <wctype.h>
+#include <libxo/xo.h>
#include "ls.h"
#include "extern.h"
int
-prn_normal(const char *s)
+prn_normal(const char *field, const char *s)
{
+ char fmt[_POSIX2_LINE_MAX];
+
+ snprintf(fmt, sizeof(fmt), "{:%s/%%hs}", field);
+ return xo_emit(fmt, s);
+#if 0
mbstate_t mbs;
wchar_t wc;
int i, n;
@@ -83,43 +89,47 @@ prn_normal(const char *s)
n += wcwidth(wc);
}
return (n);
+#endif
}
-int
-prn_printable(const char *s)
+char *
+get_printable(const char *s)
{
mbstate_t mbs;
wchar_t wc;
int i, n;
size_t clen;
+ int slen = strlen(s);
+ char *buf = alloca(slen + 1), *bp = buf;
memset(&mbs, 0, sizeof(mbs));
n = 0;
while ((clen = mbrtowc(&wc, s, MB_LEN_MAX, &mbs)) != 0) {
if (clen == (size_t)-1) {
- putchar('?');
+ *bp++ = '?';
s++;
n++;
memset(&mbs, 0, sizeof(mbs));
continue;
}
if (clen == (size_t)-2) {
- putchar('?');
+ *bp++ = '?';
n++;
break;
}
if (!iswprint(wc)) {
- putchar('?');
+ *bp++ = '?';
s += clen;
n++;
continue;
}
for (i = 0; i < (int)clen; i++)
- putchar((unsigned char)s[i]);
+ *bp++ = (unsigned char)s[i];
s += clen;
n += wcwidth(wc);
}
- return (n);
+ *bp = '\0';
+ return strdup(buf);
}
/*
@@ -165,8 +175,8 @@ len_octal(const char *s, int len)
return (r);
}
-int
-prn_octal(const char *s)
+char *
+get_octal(const char *s)
{
static const char esc[] = "\\\\\"\"\aa\bb\ff\nn\rr\tt\vv";
const char *p;
@@ -175,6 +185,8 @@ prn_octal(const char *s)
size_t clen;
unsigned char ch;
int goodchar, i, len, prtlen;
+ int slen = strlen(s);
+ char *buf = alloca(slen * 4 + 1), *bp = buf;
memset(&mbs, 0, sizeof(mbs));
len = 0;
@@ -182,7 +194,7 @@ prn_octal(const char *s)
goodchar = clen != (size_t)-1 && clen != (size_t)-2;
if (goodchar && iswprint(wc) && wc != L'\"' && wc != L'\\') {
for (i = 0; i < (int)clen; i++)
- putchar((unsigned char)s[i]);
+ *bp++ = (unsigned char)s[i];
len += wcwidth(wc);
} else if (goodchar && f_octal_escape &&
#if WCHAR_MIN < 0
@@ -190,8 +202,8 @@ prn_octal(const char *s)
#endif
wc <= (wchar_t)UCHAR_MAX &&
(p = strchr(esc, (char)wc)) != NULL) {
- putchar('\\');
- putchar(p[1]);
+ *bp ++ = '\\';
+ *bp++ = p[1];
len += 2;
} else {
if (goodchar)
@@ -202,10 +214,10 @@ prn_octal(const char *s)
prtlen = strlen(s);
for (i = 0; i < prtlen; i++) {
ch = (unsigned char)s[i];
- putchar('\\');
- putchar('0' + (ch >> 6));
- putchar('0' + ((ch >> 3) & 7));
- putchar('0' + (ch & 7));
+ *bp++ = '\\';
+ *bp++ = '0' + (ch >> 6);
+ *bp++ = '0' + ((ch >> 3) & 7);
+ *bp++ = '0' + (ch & 7);
len += 4;
}
}
@@ -217,13 +229,15 @@ prn_octal(const char *s)
} else
s += clen;
}
- return (len);
+
+ *bp = '\0';
+ return strdup(buf);
}
void
usage(void)
{
- (void)fprintf(stderr,
+ xo_error(
#ifdef COLORLS
"usage: ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1,] [-D format]"
#else
diff --git a/bin/mkdir/Makefile.depend b/bin/mkdir/Makefile.depend
index f4b5142..3646e2e 100644
--- a/bin/mkdir/Makefile.depend
+++ b/bin/mkdir/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/mv/Makefile.depend b/bin/mv/Makefile.depend
index f4b5142..3646e2e 100644
--- a/bin/mv/Makefile.depend
+++ b/bin/mv/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/pax/Makefile.depend b/bin/pax/Makefile.depend
index f4b5142..3646e2e 100644
--- a/bin/pax/Makefile.depend
+++ b/bin/pax/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/pkill/Makefile.depend b/bin/pkill/Makefile.depend
index 7a06b0f..a1ac545 100644
--- a/bin/pkill/Makefile.depend
+++ b/bin/pkill/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/ps/Makefile.depend b/bin/ps/Makefile.depend
index a6a55ba..aeeba62 100644
--- a/bin/ps/Makefile.depend
+++ b/bin/ps/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/ps/ps.1 b/bin/ps/ps.1
index 369e1d7..c777a6b 100644
--- a/bin/ps/ps.1
+++ b/bin/ps/ps.1
@@ -29,7 +29,7 @@
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
-.Dd May 22, 2015
+.Dd May 27, 2015
.Dt PS 1
.Os
.Sh NAME
@@ -350,6 +350,9 @@ the include file
.In sys/proc.h :
.Bl -column P2_INHERIT_PROTECTED 0x00000001
.It Dv "P2_INHERIT_PROTECTED" Ta No "0x00000001" Ta "New children get P_PROTECTED"
+.It Dv "P2_NOTRACE" Ta No "0x00000002" Ta "No ptrace(2) attach or coredumps"
+.It Dv "P2_NOTRACE_EXEC" Ta No "0x00000004" Ta "Keep P2_NOPTRACE on exec(2)"
+.It Dv "P2_AST_SU" Ta No "0x00000008" Ta "Handles SU ast for kthreads"
.El
.It Cm label
The MAC label of the process.
diff --git a/bin/ps/ps.c b/bin/ps/ps.c
index 0e5dd56..e86cfa8 100644
--- a/bin/ps/ps.c
+++ b/bin/ps/ps.c
@@ -180,7 +180,7 @@ main(int argc, char *argv[])
KINFO_STR *ks;
struct varent *vent;
struct winsize ws = { .ws_row = 0 };
- const char *nlistf, *memf, *fmtstr, *str;
+ const char *nlistf, *memf, *str;
char *cols;
int all, ch, elem, flag, _fmt, i, lineno, linelen, left;
int descendancy, nentries, nkept, nselectors;
@@ -649,11 +649,6 @@ main(int argc, char *argv[])
linelen = 0;
xo_open_instance("process");
STAILQ_FOREACH(vent, &varlist, next_ve) {
- if (vent->var->flag & LJUST)
- fmtstr = "%-*s";
- else
- fmtstr = "%*s";
-
ks = STAILQ_FIRST(&kinfo[i].ki_ks);
STAILQ_REMOVE_HEAD(&kinfo[i].ki_ks, ks_next);
/* Truncate rightmost column if necessary. */
diff --git a/bin/pwait/Makefile.depend b/bin/pwait/Makefile.depend
index f4b5142..3646e2e 100644
--- a/bin/pwait/Makefile.depend
+++ b/bin/pwait/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/pwd/Makefile.depend b/bin/pwd/Makefile.depend
index f4b5142..3646e2e 100644
--- a/bin/pwd/Makefile.depend
+++ b/bin/pwd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/rcp/Makefile.depend b/bin/rcp/Makefile.depend
index f4b5142..3646e2e 100644
--- a/bin/rcp/Makefile.depend
+++ b/bin/rcp/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/realpath/Makefile.depend b/bin/realpath/Makefile.depend
index 461e710..9cb890b 100644
--- a/bin/realpath/Makefile.depend
+++ b/bin/realpath/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/rm/Makefile.depend b/bin/rm/Makefile.depend
index f4b5142..3646e2e 100644
--- a/bin/rm/Makefile.depend
+++ b/bin/rm/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/rmail/Makefile.depend b/bin/rmail/Makefile.depend
index b0f36f6..377032c 100644
--- a/bin/rmail/Makefile.depend
+++ b/bin/rmail/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/rmdir/Makefile.depend b/bin/rmdir/Makefile.depend
index f4b5142..3646e2e 100644
--- a/bin/rmdir/Makefile.depend
+++ b/bin/rmdir/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/setfacl/Makefile.depend b/bin/setfacl/Makefile.depend
index f4b5142..3646e2e 100644
--- a/bin/setfacl/Makefile.depend
+++ b/bin/setfacl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/sh/Makefile.depend b/bin/sh/Makefile.depend
index 9e17d64..9eb4fba 100644
--- a/bin/sh/Makefile.depend
+++ b/bin/sh/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
include \
diff --git a/bin/sleep/Makefile.depend b/bin/sleep/Makefile.depend
index f4b5142..3646e2e 100644
--- a/bin/sleep/Makefile.depend
+++ b/bin/sleep/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/stty/Makefile.depend b/bin/stty/Makefile.depend
index f4b5142..3646e2e 100644
--- a/bin/stty/Makefile.depend
+++ b/bin/stty/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/sync/Makefile.depend b/bin/sync/Makefile.depend
index 461e710..9cb890b 100644
--- a/bin/sync/Makefile.depend
+++ b/bin/sync/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/test/Makefile.depend b/bin/test/Makefile.depend
index f4b5142..3646e2e 100644
--- a/bin/test/Makefile.depend
+++ b/bin/test/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/uuidgen/Makefile.depend b/bin/uuidgen/Makefile.depend
index 461e710..9cb890b 100644
--- a/bin/uuidgen/Makefile.depend
+++ b/bin/uuidgen/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 b/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1
index a725c8b..1aa73cc 100644
--- a/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1
+++ b/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1
@@ -21,7 +21,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 8, 2014
+.Dd May 24, 2015
.Dt LOCKSTAT 1
.Os
.Sh NAME
@@ -29,7 +29,7 @@
.Nd report kernel lock and profiling statistics
.Sh SYNOPSIS
.Nm
-.Op Fl ACEHI
+.Op Fl ACEHIV
.Op Fl e Ar event-list
.Op Fl i Ar rate
.Op Fl b | t | h | s Ar depth
@@ -90,6 +90,10 @@ to
is restricted to super-user by default.
.Sh OPTIONS
The following options are supported:
+.Bl -tag -width indent
+.It Fl V
+Print the D program used to gather the requested data.
+.El
.Ss Event Selection
If no event selection options are specified, the default is
.Fl C .
diff --git a/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c b/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c
index ad512c1..5c71160 100644
--- a/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c
+++ b/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c
@@ -157,14 +157,22 @@ static ls_event_info_t g_event_info[LS_MAX_EVENTS] = {
"lockstat:::rw-block", "arg2 != 0 && arg3 == 1" },
{ 'C', "Lock", "R/W reader blocked by write wanted", "nsec",
"lockstat:::rw-block", "arg2 != 0 && arg3 == 0 && arg4" },
- { 'C', "Lock", "Unknown event (type 8)", "units" },
- { 'C', "Lock", "Unknown event (type 9)", "units" },
- { 'C', "Lock", "Unknown event (type 10)", "units" },
- { 'C', "Lock", "Unknown event (type 11)", "units" },
- { 'C', "Lock", "Unknown event (type 12)", "units" },
- { 'C', "Lock", "Unknown event (type 13)", "units" },
- { 'C', "Lock", "Unknown event (type 14)", "units" },
- { 'C', "Lock", "Unknown event (type 15)", "units" },
+ { 'C', "Lock", "R/W writer spin on writer", "nsec",
+ "lockstat:::rw-spin", "arg2 == 0 && arg3 == 1" },
+ { 'C', "Lock", "R/W writer spin on readers", "nsec",
+ "lockstat:::rw-spin", "arg2 == 0 && arg3 == 0 && arg4" },
+ { 'C', "Lock", "R/W reader spin on writer", "nsec",
+ "lockstat:::rw-spin", "arg2 != 0 && arg3 == 1" },
+ { 'C', "Lock", "R/W reader spin on write wanted", "nsec",
+ "lockstat:::rw-spin", "arg2 != 0 && arg3 == 0 && arg4" },
+ { 'C', "Lock", "SX exclusive block", "nsec",
+ "lockstat:::sx-block", "arg2 == 0" },
+ { 'C', "Lock", "SX shared block", "nsec",
+ "lockstat:::sx-block", "arg2 != 0" },
+ { 'C', "Lock", "SX exclusive spin", "nsec",
+ "lockstat:::sx-spin", "arg2 == 0" },
+ { 'C', "Lock", "SX shared spin", "nsec",
+ "lockstat:::sx-spin", "arg2 != 0" },
{ 'C', "Lock", "Unknown event (type 16)", "units" },
{ 'C', "Lock", "Unknown event (type 17)", "units" },
{ 'C', "Lock", "Unknown event (type 18)", "units" },
@@ -188,13 +196,17 @@ static ls_event_info_t g_event_info[LS_MAX_EVENTS] = {
"lockstat:::spin-release", NULL,
"lockstat:::spin-acquire" },
{ 'H', "Lock", "R/W writer hold", "nsec",
- "lockstat:::rw-release", "arg1 == 0",
- "lockstat:::rw-acquire" },
+ "lockstat::rw_wunlock:rw-release", NULL,
+ "lockstat::rw_wlock:rw-acquire" },
{ 'H', "Lock", "R/W reader hold", "nsec",
- "lockstat:::rw-release", "arg1 != 0",
- "lockstat:::rw-acquire" },
- { 'H', "Lock", "Unknown event (type 36)", "units" },
- { 'H', "Lock", "Unknown event (type 37)", "units" },
+ "lockstat::rw_runlock:rw-release", NULL,
+ "lockstat::rw_rlock:rw-acquire" },
+ { 'H', "Lock", "SX shared hold", "nsec",
+ "lockstat::sx_sunlock:sx-release", NULL,
+ "lockstat::sx_slock:sx-acquire" },
+ { 'H', "Lock", "SX exclusive hold", "nsec",
+ "lockstat::sx_xunlock:sx-release", NULL,
+ "lockstat::sx_xlock:sx-acquire" },
{ 'H', "Lock", "Unknown event (type 38)", "units" },
{ 'H', "Lock", "Unknown event (type 39)", "units" },
{ 'H', "Lock", "Unknown event (type 40)", "units" },
@@ -299,6 +311,8 @@ usage(void)
{
(void) fprintf(stderr,
"Usage: lockstat [options] command [args]\n"
+ "\nGeneral options:\n\n"
+ " -V print the corresponding D program\n"
"\nEvent selection options:\n\n"
" -C watch contention events [on by default]\n"
" -E watch error events [off by default]\n"
diff --git a/cddl/contrib/opensolaris/cmd/zdb/zdb.c b/cddl/contrib/opensolaris/cmd/zdb/zdb.c
index 34912cd..45b6dbd 100644
--- a/cddl/contrib/opensolaris/cmd/zdb/zdb.c
+++ b/cddl/contrib/opensolaris/cmd/zdb/zdb.c
@@ -90,10 +90,10 @@ uint8_t dump_opt[256];
typedef void object_viewer_t(objset_t *, uint64_t, void *data, size_t size);
extern void dump_intent_log(zilog_t *);
-uint64_t *zopt_object = NULL;
-int zopt_objects = 0;
-libzfs_handle_t *g_zfs;
-uint64_t max_inflight = 1000;
+static uint64_t *zopt_object = NULL;
+static int zopt_objects = 0;
+static libzfs_handle_t *g_zfs;
+static uint64_t max_inflight = 1000;
/*
* These libumem hooks provide a reasonable set of defaults for the allocator's
@@ -1488,16 +1488,14 @@ dump_deadlist(dsl_deadlist_t *dl)
dle = AVL_NEXT(&dl->dl_tree, dle)) {
if (dump_opt['d'] >= 5) {
char buf[128];
- (void) snprintf(buf, sizeof (buf), "mintxg %llu -> ",
- (longlong_t)dle->dle_mintxg,
+ (void) snprintf(buf, sizeof (buf), "mintxg %llu -> "
+ "obj %llu", (longlong_t)dle->dle_mintxg,
(longlong_t)dle->dle_bpobj.bpo_object);
-
dump_bpobj(&dle->dle_bpobj, buf, 0);
} else {
(void) printf("mintxg %llu -> obj %llu\n",
(longlong_t)dle->dle_mintxg,
(longlong_t)dle->dle_bpobj.bpo_object);
-
}
}
}
diff --git a/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c b/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
index d7c702b..389b248 100644
--- a/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
+++ b/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
@@ -593,6 +593,17 @@ finish_progress(char *done)
}
/*
+ * Check if the dataset is mountable and should be automatically mounted.
+ */
+static boolean_t
+should_auto_mount(zfs_handle_t *zhp)
+{
+ if (!zfs_prop_valid_for_type(ZFS_PROP_CANMOUNT, zfs_get_type(zhp)))
+ return (B_FALSE);
+ return (zfs_prop_get_int(zhp, ZFS_PROP_CANMOUNT) == ZFS_CANMOUNT_ON);
+}
+
+/*
* zfs clone [-p] [-o prop=value] ... <snap> <fs | vol>
*
* Given an existing dataset, create a writable copy whose initial contents
@@ -677,9 +688,22 @@ zfs_do_clone(int argc, char **argv)
clone = zfs_open(g_zfs, argv[1], ZFS_TYPE_DATASET);
if (clone != NULL) {
- if (zfs_get_type(clone) != ZFS_TYPE_VOLUME)
- if ((ret = zfs_mount(clone, NULL, 0)) == 0)
- ret = zfs_share(clone);
+ /*
+ * If the user doesn't want the dataset
+ * automatically mounted, then skip the mount/share
+ * step.
+ */
+ if (should_auto_mount(clone)) {
+ if ((ret = zfs_mount(clone, NULL, 0)) != 0) {
+ (void) fprintf(stderr, gettext("clone "
+ "successfully created, "
+ "but not mounted\n"));
+ } else if ((ret = zfs_share(clone)) != 0) {
+ (void) fprintf(stderr, gettext("clone "
+ "successfully created, "
+ "but not shared\n"));
+ }
+ }
zfs_close(clone);
}
}
@@ -728,7 +752,6 @@ zfs_do_create(int argc, char **argv)
int ret = 1;
nvlist_t *props;
uint64_t intval;
- int canmount = ZFS_CANMOUNT_OFF;
if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0)
nomem();
@@ -868,19 +891,15 @@ zfs_do_create(int argc, char **argv)
goto error;
ret = 0;
- /*
- * if the user doesn't want the dataset automatically mounted,
- * then skip the mount/share step
- */
- if (zfs_prop_valid_for_type(ZFS_PROP_CANMOUNT, type))
- canmount = zfs_prop_get_int(zhp, ZFS_PROP_CANMOUNT);
/*
* Mount and/or share the new filesystem as appropriate. We provide a
* verbose error message to let the user know that their filesystem was
* in fact created, even if we failed to mount or share it.
+ * If the user doesn't want the dataset automatically mounted,
+ * then skip the mount/share step altogether.
*/
- if (!nomount && canmount == ZFS_CANMOUNT_ON) {
+ if (!nomount && should_auto_mount(zhp)) {
if (zfs_mount(zhp, NULL, 0) != 0) {
(void) fprintf(stderr, gettext("filesystem "
"successfully created, but not mounted\n"));
diff --git a/cddl/contrib/opensolaris/cmd/ztest/ztest.c b/cddl/contrib/opensolaris/cmd/ztest/ztest.c
index ab69154..0695834 100644
--- a/cddl/contrib/opensolaris/cmd/ztest/ztest.c
+++ b/cddl/contrib/opensolaris/cmd/ztest/ztest.c
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2012 Martin Matuska <mm@FreeBSD.org>. All rights reserved.
* Copyright (c) 2013 Steven Hartland. All rights reserved.
@@ -969,21 +969,6 @@ ztest_random_spa_version(uint64_t initial_version)
return (version);
}
-/*
- * Find the largest ashift used
- */
-static uint64_t
-ztest_spa_get_ashift() {
- uint64_t i;
- uint64_t ashift = SPA_MINBLOCKSHIFT;
- vdev_t *rvd = ztest_spa->spa_root_vdev;
-
- for (i = 0; i < rvd->vdev_children; i++) {
- ashift = MAX(ashift, rvd->vdev_child[i]->vdev_ashift);
- }
- return (ashift);
-}
-
static int
ztest_random_blocksize(void)
{
@@ -995,7 +980,7 @@ ztest_random_blocksize(void)
int maxbs = SPA_OLD_MAXBLOCKSHIFT;
if (spa_maxblocksize(ztest_spa) == SPA_MAXBLOCKSIZE)
maxbs = 20;
- block_shift = ztest_random(maxbs - ztest_spa_get_ashift() + 1);
+ block_shift = ztest_random(maxbs - ztest_spa->spa_max_ashift + 1);
return (1 << (SPA_MINBLOCKSHIFT + block_shift));
}
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h
index 51bed72..36cc539 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h
@@ -156,6 +156,21 @@ typedef struct dt_module {
#define DT_DM_KERNEL 0x2 /* module is associated with a kernel object */
#define DT_DM_PRIMARY 0x4 /* module is a krtld primary kernel object */
+#ifdef __FreeBSD__
+/*
+ * A representation of a FreeBSD kernel module, used when checking module
+ * dependencies. This differs from dt_module_t, which refers to a KLD in the
+ * case of kernel probes. Since modules can be identified regardless of whether
+ * they've been compiled into the kernel, we use them to identify DTrace
+ * modules.
+ */
+typedef struct dt_kmodule {
+ struct dt_kmodule *dkm_next; /* hash table entry */
+ char *dkm_name; /* string name of module */
+ dt_module_t *dkm_module; /* corresponding KLD module */
+} dt_kmodule_t;
+#endif
+
typedef struct dt_provmod {
char *dp_name; /* name of provider module */
struct dt_provmod *dp_next; /* next module */
@@ -235,6 +250,9 @@ struct dtrace_hdl {
dt_idhash_t *dt_tls; /* hash table of thread-local identifiers */
dt_list_t dt_modlist; /* linked list of dt_module_t's */
dt_module_t **dt_mods; /* hash table of dt_module_t's */
+#ifdef __FreeBSD__
+ dt_kmodule_t **dt_kmods; /* hash table of dt_kmodule_t's */
+#endif
uint_t dt_modbuckets; /* number of module hash buckets */
uint_t dt_nmods; /* number of modules in hash and list */
dt_provmod_t *dt_provmod; /* linked list of provider modules */
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c
index b3fe516..77f9223 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c
@@ -37,6 +37,7 @@
#else
#include <sys/param.h>
#include <sys/linker.h>
+#include <sys/module.h>
#include <sys/stat.h>
#endif
@@ -542,6 +543,22 @@ dt_module_lookup_by_ctf(dtrace_hdl_t *dtp, ctf_file_t *ctfp)
return (ctfp ? ctf_getspecific(ctfp) : NULL);
}
+#ifdef __FreeBSD__
+dt_kmodule_t *
+dt_kmodule_lookup(dtrace_hdl_t *dtp, const char *name)
+{
+ uint_t h = dt_strtab_hash(name, NULL) % dtp->dt_modbuckets;
+ dt_kmodule_t *dkmp;
+
+ for (dkmp = dtp->dt_kmods[h]; dkmp != NULL; dkmp = dkmp->dkm_next) {
+ if (strcmp(dkmp->dkm_name, name) == 0)
+ return (dkmp);
+ }
+
+ return (NULL);
+}
+#endif
+
static int
dt_module_load_sect(dtrace_hdl_t *dtp, dt_module_t *dmp, ctf_sect_t *ctsp)
{
@@ -1124,6 +1141,12 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat)
char fname[MAXPATHLEN];
struct stat64 st;
int fd, err, bits;
+#ifdef __FreeBSD__
+ struct module_stat ms;
+ dt_kmodule_t *dkmp;
+ uint_t h;
+ int modid;
+#endif
dt_module_t *dmp;
const char *s;
@@ -1270,6 +1293,33 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat)
if (dmp->dm_info.objfs_info_primary)
dmp->dm_flags |= DT_DM_PRIMARY;
+#ifdef __FreeBSD__
+ ms.version = sizeof(ms);
+ for (modid = kldfirstmod(k_stat->id); modid > 0;
+ modid = modnext(modid)) {
+ if (modstat(modid, &ms) != 0) {
+ dt_dprintf("modstat failed for id %d in %s: %s\n",
+ modid, k_stat->name, strerror(errno));
+ continue;
+ }
+ if (dt_kmodule_lookup(dtp, ms.name) != NULL)
+ continue;
+
+ dkmp = malloc(sizeof (*dkmp));
+ if (dkmp == NULL) {
+ dt_dprintf("failed to allocate memory\n");
+ dt_module_destroy(dtp, dmp);
+ return;
+ }
+
+ h = dt_strtab_hash(ms.name, NULL) % dtp->dt_modbuckets;
+ dkmp->dkm_next = dtp->dt_kmods[h];
+ dkmp->dkm_name = strdup(ms.name);
+ dkmp->dkm_module = dmp;
+ dtp->dt_kmods[h] = dkmp;
+ }
+#endif
+
dt_dprintf("opened %d-bit module %s (%s) [%d]\n",
bits, dmp->dm_name, dmp->dm_file, dmp->dm_modid);
}
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.h b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.h
index d103e02..6db16cc 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.h
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.h
@@ -44,6 +44,10 @@ extern void dt_module_destroy(dtrace_hdl_t *, dt_module_t *);
extern dt_module_t *dt_module_lookup_by_name(dtrace_hdl_t *, const char *);
extern dt_module_t *dt_module_lookup_by_ctf(dtrace_hdl_t *, ctf_file_t *);
+#ifdef __FreeBSD__
+extern dt_kmodule_t *dt_kmodule_lookup(dtrace_hdl_t *, const char *);
+#endif
+
extern int dt_module_hasctf(dtrace_hdl_t *, dt_module_t *);
extern ctf_file_t *dt_module_getctf(dtrace_hdl_t *, dt_module_t *);
extern dt_ident_t *dt_module_extern(dtrace_hdl_t *, dt_module_t *,
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
index 80e4be9..ac0524b 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
@@ -1178,6 +1178,9 @@ alloc:
#endif
dtp->dt_modbuckets = _dtrace_strbuckets;
dtp->dt_mods = calloc(dtp->dt_modbuckets, sizeof (dt_module_t *));
+#ifdef __FreeBSD__
+ dtp->dt_kmods = calloc(dtp->dt_modbuckets, sizeof (dt_module_t *));
+#endif
dtp->dt_provbuckets = _dtrace_strbuckets;
dtp->dt_provs = calloc(dtp->dt_provbuckets, sizeof (dt_provider_t *));
dt_proc_hash_create(dtp);
@@ -1199,6 +1202,7 @@ alloc:
if (dtp->dt_mods == NULL || dtp->dt_provs == NULL ||
dtp->dt_procs == NULL || dtp->dt_ld_path == NULL ||
#ifdef __FreeBSD__
+ dtp->dt_kmods == NULL ||
dtp->dt_objcopy_path == NULL ||
#endif
dtp->dt_cpp_path == NULL || dtp->dt_cpp_argv == NULL)
@@ -1621,6 +1625,10 @@ dtrace_close(dtrace_hdl_t *dtp)
dtrace_prog_t *pgp;
dt_xlator_t *dxp;
dt_dirpath_t *dirp;
+#ifdef __FreeBSD__
+ dt_kmodule_t *dkm;
+ uint_t h;
+#endif
int i;
if (dtp->dt_procs != NULL)
@@ -1648,6 +1656,15 @@ dtrace_close(dtrace_hdl_t *dtp)
if (dtp->dt_tls != NULL)
dt_idhash_destroy(dtp->dt_tls);
+#ifdef __FreeBSD__
+ for (h = 0; h < dtp->dt_modbuckets; h++)
+ while ((dkm = dtp->dt_kmods[h]) != NULL) {
+ dtp->dt_kmods[h] = dkm->dkm_next;
+ free(dkm->dkm_name);
+ free(dkm);
+ }
+#endif
+
while ((dmp = dt_list_next(&dtp->dt_modlist)) != NULL)
dt_module_destroy(dtp, dmp);
@@ -1697,6 +1714,9 @@ dtrace_close(dtrace_hdl_t *dtp)
#endif
free(dtp->dt_mods);
+#ifdef __FreeBSD__
+ free(dtp->dt_kmods);
+#endif
free(dtp->dt_provs);
free(dtp);
}
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c
index bd0d708..550a436 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c
@@ -278,6 +278,14 @@ dt_pragma_depends(const char *prname, dt_node_t *cnp)
} else if (strcmp(cnp->dn_string, "module") == 0) {
dt_module_t *mp = dt_module_lookup_by_name(dtp, nnp->dn_string);
found = mp != NULL && dt_module_getctf(dtp, mp) != NULL;
+#ifdef __FreeBSD__
+ if (!found) {
+ dt_kmodule_t *dkmp = dt_kmodule_lookup(dtp,
+ nnp->dn_string);
+ found = dkmp != NULL &&
+ dt_module_getctf(dtp, dkmp->dkm_module) != NULL;
+ }
+#endif
} else if (strcmp(cnp->dn_string, "library") == 0) {
if (yypcb->pcb_cflags & DTRACE_C_CTL) {
assert(dtp->dt_filetag != NULL);
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
index c4e9ada..0987024 100644
--- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
+++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
@@ -23,6 +23,7 @@
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright 2015 RackTop Systems.
*/
/*
@@ -1094,11 +1095,7 @@ zpool_open_func(void *arg)
}
(void) close(fd);
-
rn->rn_config = config;
- if (config != NULL) {
- assert(rn->rn_nozpool == B_FALSE);
- }
}
/*
diff --git a/cddl/lib/drti/Makefile.depend b/cddl/lib/drti/Makefile.depend
index 2c564fe..422dbea 100644
--- a/cddl/lib/drti/Makefile.depend
+++ b/cddl/lib/drti/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/cddl/lib/libavl/Makefile.depend b/cddl/lib/libavl/Makefile.depend
index c9d74dc..3699b06 100644
--- a/cddl/lib/libavl/Makefile.depend
+++ b/cddl/lib/libavl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/cddl/lib/libctf/Makefile.depend b/cddl/lib/libctf/Makefile.depend
index b1a0bae..4b536f7 100644
--- a/cddl/lib/libctf/Makefile.depend
+++ b/cddl/lib/libctf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/cddl/lib/libdtrace/Makefile.depend b/cddl/lib/libdtrace/Makefile.depend
index 411b469..124d5c7 100644
--- a/cddl/lib/libdtrace/Makefile.depend
+++ b/cddl/lib/libdtrace/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/cddl/lib/libnvpair/Makefile.depend b/cddl/lib/libnvpair/Makefile.depend
index a83fb20..3dce64a 100644
--- a/cddl/lib/libnvpair/Makefile.depend
+++ b/cddl/lib/libnvpair/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/cddl/lib/libumem/Makefile.depend b/cddl/lib/libumem/Makefile.depend
index c9d74dc..3699b06 100644
--- a/cddl/lib/libumem/Makefile.depend
+++ b/cddl/lib/libumem/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/cddl/lib/libuutil/Makefile.depend b/cddl/lib/libuutil/Makefile.depend
index 593d407..dde2d60 100644
--- a/cddl/lib/libuutil/Makefile.depend
+++ b/cddl/lib/libuutil/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/cddl/lib/libzfs/Makefile.depend b/cddl/lib/libzfs/Makefile.depend
index 3380eff..8c2b34b 100644
--- a/cddl/lib/libzfs/Makefile.depend
+++ b/cddl/lib/libzfs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/cddl/lib/libzfs_core/Makefile.depend b/cddl/lib/libzfs_core/Makefile.depend
index 3abceb8..9e7fae2 100644
--- a/cddl/lib/libzfs_core/Makefile.depend
+++ b/cddl/lib/libzfs_core/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/cddl/lib/libzpool/Makefile.depend b/cddl/lib/libzpool/Makefile.depend
index 667f0fd..cb67e22 100644
--- a/cddl/lib/libzpool/Makefile.depend
+++ b/cddl/lib/libzpool/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/cddl/sbin/zfs/Makefile.depend b/cddl/sbin/zfs/Makefile.depend
index 2648cea..03bb95d 100644
--- a/cddl/sbin/zfs/Makefile.depend
+++ b/cddl/sbin/zfs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/cddl/sbin/zpool/Makefile.depend b/cddl/sbin/zpool/Makefile.depend
index 80ee84f..08245ad 100644
--- a/cddl/sbin/zpool/Makefile.depend
+++ b/cddl/sbin/zpool/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/cddl/usr.bin/ctfconvert/Makefile.depend b/cddl/usr.bin/ctfconvert/Makefile.depend
index 6a7ea61..f479cfc 100644
--- a/cddl/usr.bin/ctfconvert/Makefile.depend
+++ b/cddl/usr.bin/ctfconvert/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/cddl/usr.bin/ctfdump/Makefile.depend b/cddl/usr.bin/ctfdump/Makefile.depend
index 2dd7922..6b3e8f7 100644
--- a/cddl/usr.bin/ctfdump/Makefile.depend
+++ b/cddl/usr.bin/ctfdump/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/cddl/usr.bin/ctfmerge/Makefile.depend b/cddl/usr.bin/ctfmerge/Makefile.depend
index 6a7ea61..f479cfc 100644
--- a/cddl/usr.bin/ctfmerge/Makefile.depend
+++ b/cddl/usr.bin/ctfmerge/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/cddl/usr.bin/sgsmsg/Makefile.depend b/cddl/usr.bin/sgsmsg/Makefile.depend
index 7e64306..b767569 100644
--- a/cddl/usr.bin/sgsmsg/Makefile.depend
+++ b/cddl/usr.bin/sgsmsg/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/cddl/usr.bin/zinject/Makefile.depend b/cddl/usr.bin/zinject/Makefile.depend
index 1e6ee39..deb1256 100644
--- a/cddl/usr.bin/zinject/Makefile.depend
+++ b/cddl/usr.bin/zinject/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/cddl/usr.bin/zstreamdump/Makefile.depend b/cddl/usr.bin/zstreamdump/Makefile.depend
index 7f2f2a4..138e88b 100644
--- a/cddl/usr.bin/zstreamdump/Makefile.depend
+++ b/cddl/usr.bin/zstreamdump/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/cddl/usr.bin/ztest/Makefile.depend b/cddl/usr.bin/ztest/Makefile.depend
index 1e6ee39..deb1256 100644
--- a/cddl/usr.bin/ztest/Makefile.depend
+++ b/cddl/usr.bin/ztest/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/cddl/usr.sbin/dtrace/Makefile.depend b/cddl/usr.sbin/dtrace/Makefile.depend
index 516fe67..2efd35c 100644
--- a/cddl/usr.sbin/dtrace/Makefile.depend
+++ b/cddl/usr.sbin/dtrace/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/cddl/usr.sbin/dtruss/Makefile.depend b/cddl/usr.sbin/dtruss/Makefile.depend
index 57b7e10..d14a02b 100644
--- a/cddl/usr.sbin/dtruss/Makefile.depend
+++ b/cddl/usr.sbin/dtruss/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/cddl/usr.sbin/lockstat/Makefile.depend b/cddl/usr.sbin/lockstat/Makefile.depend
index 08502fb..70f0672 100644
--- a/cddl/usr.sbin/lockstat/Makefile.depend
+++ b/cddl/usr.sbin/lockstat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/cddl/usr.sbin/zdb/Makefile.depend b/cddl/usr.sbin/zdb/Makefile.depend
index 1e6ee39..deb1256 100644
--- a/cddl/usr.sbin/zdb/Makefile.depend
+++ b/cddl/usr.sbin/zdb/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/cddl/usr.sbin/zhack/Makefile.depend b/cddl/usr.sbin/zhack/Makefile.depend
index 1e6ee39..deb1256 100644
--- a/cddl/usr.sbin/zhack/Makefile.depend
+++ b/cddl/usr.sbin/zhack/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/contrib/bmake/ChangeLog b/contrib/bmake/ChangeLog
index f46e95d..e1d6f10 100644
--- a/contrib/bmake/ChangeLog
+++ b/contrib/bmake/ChangeLog
@@ -1,3 +1,9 @@
+2015-06-06 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile (MAKE_VERSION): 20150606
+ Merge with NetBSD make, pick up
+ o make.1: document .OBJDIR target
+
2015-05-05 Simon J. Gerraty <sjg@bad.crufty.net>
* Makefile (MAKE_VERSION): 20150505
diff --git a/contrib/bmake/Makefile b/contrib/bmake/Makefile
index 803997a..e5427a8 100644
--- a/contrib/bmake/Makefile
+++ b/contrib/bmake/Makefile
@@ -1,7 +1,7 @@
-# $Id: Makefile,v 1.38 2015/05/05 21:58:05 sjg Exp $
+# $Id: Makefile,v 1.39 2015/06/07 15:54:37 sjg Exp $
# Base version on src date
-MAKE_VERSION= 20150505
+MAKE_VERSION= 20150606
PROG= bmake
diff --git a/contrib/bmake/bmake.1 b/contrib/bmake/bmake.1
index 702d392..39d28c4 100644
--- a/contrib/bmake/bmake.1
+++ b/contrib/bmake/bmake.1
@@ -1,4 +1,4 @@
-.\" $NetBSD: make.1,v 1.247 2015/04/10 08:43:32 wiz Exp $
+.\" $NetBSD: make.1,v 1.249 2015/06/05 07:33:40 wiz Exp $
.\"
.\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" from: @(#)make.1 8.4 (Berkeley) 3/19/94
.\"
-.Dd April 9, 2015
+.Dd June 4, 2015
.Dt MAKE 1
.Os
.Sh NAME
@@ -993,14 +993,15 @@ This is especially useful with
.Ql Ev MAKEOBJDIR .
.Pp
.Ql Va .OBJDIR
-may be modified in the makefile as a global variable.
+may be modified in the makefile via the special target
+.Ql Ic .OBJDIR .
In all cases,
.Nm
will
.Xr chdir 2
-to
+to the specified directory if it exists, and set
.Ql Va .OBJDIR
-and set
+and
.Ql Ev PWD
to that directory before executing any targets.
.
@@ -2001,6 +2002,15 @@ Disable parallel mode.
Synonym for
.Ic .NOTPARALLEL ,
for compatibility with other pmake variants.
+.It Ic .OBJDIR
+The source is a new value for
+.Ql Va .OBJDIR .
+If it exists,
+.Nm
+will
+.Xr chdir 2
+to it and update the value of
+.Ql Va .OBJDIR .
.It Ic .ORDER
The named targets are made in sequence.
This ordering does not add targets to the list of targets to be made.
diff --git a/contrib/bmake/bmake.cat1 b/contrib/bmake/bmake.cat1
index 5c62c1b..4d43e2d 100644
--- a/contrib/bmake/bmake.cat1
+++ b/contrib/bmake/bmake.cat1
@@ -647,10 +647,10 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS
may be used. This is especially useful with
`MAKEOBJDIR'.
- `_._O_B_J_D_I_R' may be modified in the makefile as a global
- variable. In all cases, bbmmaakkee will chdir(2) to `_._O_B_J_D_I_R'
- and set `PWD' to that directory before executing any tar-
- gets.
+ `_._O_B_J_D_I_R' may be modified in the makefile via the special
+ target `..OOBBJJDDIIRR'. In all cases, bbmmaakkee will chdir(2) to
+ the specified directory if it exists, and set `_._O_B_J_D_I_R'
+ and `PWD' to that directory before executing any targets.
_._P_A_R_S_E_D_I_R A path to the directory of the current `_M_a_k_e_f_i_l_e' being
parsed.
@@ -1271,6 +1271,9 @@ SSPPEECCIIAALL TTAARRGGEETTSS
Synonym for ..NNOOTTPPAARRAALLLLEELL, for compatibility with other pmake
variants.
+ ..OOBBJJDDIIRR The source is a new value for `_._O_B_J_D_I_R'. If it exists, bbmmaakkee
+ will chdir(2) to it and update the value of `_._O_B_J_D_I_R'.
+
..OORRDDEERR The named targets are made in sequence. This ordering does not
add targets to the list of targets to be made. Since the depen-
dents of a target do not get built until the target itself could
@@ -1449,4 +1452,4 @@ BBUUGGSS
There is no way of escaping a space character in a filename.
-NetBSD 5.1 April 9, 2015 NetBSD 5.1
+NetBSD 5.1 June 4, 2015 NetBSD 5.1
diff --git a/contrib/bmake/make.1 b/contrib/bmake/make.1
index 3acc02a..38bba31 100644
--- a/contrib/bmake/make.1
+++ b/contrib/bmake/make.1
@@ -1,4 +1,4 @@
-.\" $NetBSD: make.1,v 1.247 2015/04/10 08:43:32 wiz Exp $
+.\" $NetBSD: make.1,v 1.249 2015/06/05 07:33:40 wiz Exp $
.\"
.\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" from: @(#)make.1 8.4 (Berkeley) 3/19/94
.\"
-.Dd April 9, 2015
+.Dd June 4, 2015
.Dt MAKE 1
.Os
.Sh NAME
@@ -1004,14 +1004,15 @@ This is especially useful with
.Ql Ev MAKEOBJDIR .
.Pp
.Ql Va .OBJDIR
-may be modified in the makefile as a global variable.
+may be modified in the makefile via the special target
+.Ql Ic .OBJDIR .
In all cases,
.Nm
will
.Xr chdir 2
-to
+to the specified directory if it exists, and set
.Ql Va .OBJDIR
-and set
+and
.Ql Ev PWD
to that directory before executing any targets.
.
@@ -2012,6 +2013,15 @@ Disable parallel mode.
Synonym for
.Ic .NOTPARALLEL ,
for compatibility with other pmake variants.
+.It Ic .OBJDIR
+The source is a new value for
+.Ql Va .OBJDIR .
+If it exists,
+.Nm
+will
+.Xr chdir 2
+to it and update the value of
+.Ql Va .OBJDIR .
.It Ic .ORDER
The named targets are made in sequence.
This ordering does not add targets to the list of targets to be made.
diff --git a/contrib/bmake/mk/ChangeLog b/contrib/bmake/mk/ChangeLog
index 9b4059e1..85c8ae1 100644
--- a/contrib/bmake/mk/ChangeLog
+++ b/contrib/bmake/mk/ChangeLog
@@ -1,3 +1,29 @@
+2015-06-06 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * install-mk (MK_VERSION): 20150606
+
+ * dirdeps.mk: don't rely on manually maintained Makefile.depend
+ to set DEP_RELDIR and reset DIRDEPS.
+ By setting DEP_RELDIR ourselves we can skip :tA
+
+ * gendirdeps.mk: skip setting DEP_RELDIR.
+
+2015-05-24 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * dirdeps.mk: avoid wildcards like make(bootstrap*)
+
+2015-05-20 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * install-mk (MK_VERSION): 20150520
+
+ * dirdeps.mk: when we are building dirdeps cache file we *want*
+ meta_oodate to look at all the Makefile.depend files, so
+ set .MAKE.DEPENDFILE to something that won't match.
+
+ * meta.stage.mk: for STAGE_AS_* basename of file may not be unique
+ so first use absolute path as key.
+ Also skip staging at level 0.
+
2015-04-30 Simon J. Gerraty <sjg@bad.crufty.net>
* install-mk (MK_VERSION): 20150430
diff --git a/contrib/bmake/mk/dirdeps.mk b/contrib/bmake/mk/dirdeps.mk
index 4186346..4aa101f 100644
--- a/contrib/bmake/mk/dirdeps.mk
+++ b/contrib/bmake/mk/dirdeps.mk
@@ -1,4 +1,4 @@
-# $Id: dirdeps.mk,v 1.51 2015/05/06 06:07:30 sjg Exp $
+# $Id: dirdeps.mk,v 1.54 2015/06/08 20:55:11 sjg Exp $
# Copyright (c) 2010-2013, Juniper Networks, Inc.
# All rights reserved.
@@ -383,6 +383,7 @@ ${DIRDEPS_CACHE}: .META .NOMETA_CMP
DIRDEPS="${DIRDEPS}" \
MAKEFLAGS= ${.MAKE} -C ${_CURDIR} -f ${BUILD_DIRDEPS_MAKEFILE} \
${BUILD_DIRDEPS_TARGETS} BUILD_DIRDEPS_CACHE=yes \
+ .MAKE.DEPENDFILE=.none \
3>&1 1>&2 | sed 's,${SRCTOP},$${SRCTOP},g' >> ${.TARGET}.new && \
mv ${.TARGET}.new ${.TARGET}
@@ -587,6 +588,11 @@ _qm := ${_m:C;(\.depend)$;\1.${d:E};:${M_dep_qual_fixes:ts:}}
_DEP_TARGET_SPEC := ${d:E}
# some makefiles may still look at this
_DEP_MACHINE := ${d:E:C/,.*//}
+# set this "just in case"
+# we can skip :tA since we computed the path above
+DEP_RELDIR := ${_m:H:S,${SRCTOP}/,,}
+# and reset this
+DIRDEPS =
.if ${_debug_reldir} && ${_qm} != ${_m}
.info loading ${_m} for ${d:E}
.endif
@@ -602,13 +608,15 @@ _DEP_MACHINE := ${d:E:C/,.*//}
.elif ${.MAKE.LEVEL} > 42
.error You should have stopped recursing by now.
.else
-_DEP_RELDIR := ${DEP_RELDIR}
+# we are building something
+DEP_RELDIR := ${RELDIR}
+_DEP_RELDIR := ${RELDIR}
# pickup local dependencies
.-include <.depend>
.endif
# bootstrapping new dependencies made easy?
-.if make(bootstrap*) && !target(bootstrap)
+.if (make(bootstrap) || make(bootstrap-recurse)) && !target(bootstrap)
.if exists(${.CURDIR}/${.MAKE.DEPENDFILE:T})
# stop here
diff --git a/contrib/bmake/mk/gendirdeps.mk b/contrib/bmake/mk/gendirdeps.mk
index 28e1f21..614a20e 100644
--- a/contrib/bmake/mk/gendirdeps.mk
+++ b/contrib/bmake/mk/gendirdeps.mk
@@ -1,4 +1,4 @@
-# $Id: gendirdeps.mk,v 1.26 2014/09/05 04:40:52 sjg Exp $
+# $Id: gendirdeps.mk,v 1.27 2015/06/08 20:55:11 sjg Exp $
# Copyright (c) 2010-2013, Juniper Networks, Inc.
# All rights reserved.
@@ -311,7 +311,6 @@ CAT_DEPEND ?= .depend
# to output _{VAR} tokens which we will turn into proper ${VAR} references.
${_DEPENDFILE}: ${CAT_DEPEND:M.depend} ${META_FILES:O:u:@m@${exists($m):?$m:}@} ${_this} ${META2DEPS}
@(echo '# Autogenerated - do NOT edit!'; echo; \
- echo 'DEP_RELDIR := $${_PARSEDIR:S,$${SRCTOP}/,,}'; echo; \
echo 'DIRDEPS = \'; \
echo '${DIRDEPS:@d@ $d \\${.newline}@}'; echo; \
${_include_src_dirdeps} \
@@ -332,7 +331,6 @@ all: ${_DEPENDFILE}
${_DEPENDFILE}: ${MAKEFILE} ${_this}
@(echo '# Autogenerated - do NOT edit!'; echo; \
- echo 'DEP_RELDIR := $${_PARSEDIR:S,$${SRCTOP}/,,}'; echo; \
echo 'DIRDEPS = \'; \
echo '${DIRDEPS:@d@ $d \\${.newline}@}'; echo; \
echo '.include <dirdeps.mk>'; \
diff --git a/contrib/bmake/mk/install-mk b/contrib/bmake/mk/install-mk
index 598cf39..05facd5 100644
--- a/contrib/bmake/mk/install-mk
+++ b/contrib/bmake/mk/install-mk
@@ -55,7 +55,7 @@
# Simon J. Gerraty <sjg@crufty.net>
# RCSid:
-# $Id: install-mk,v 1.110 2015/05/01 06:37:49 sjg Exp $
+# $Id: install-mk,v 1.112 2015/06/08 20:55:11 sjg Exp $
#
# @(#) Copyright (c) 1994 Simon J. Gerraty
#
@@ -70,7 +70,7 @@
# sjg@crufty.net
#
-MK_VERSION=20150430
+MK_VERSION=20150606
OWNER=
GROUP=
MODE=444
diff --git a/contrib/bmake/mk/meta.stage.mk b/contrib/bmake/mk/meta.stage.mk
index cd95113..588f50e 100644
--- a/contrib/bmake/mk/meta.stage.mk
+++ b/contrib/bmake/mk/meta.stage.mk
@@ -1,4 +1,4 @@
-# $Id: meta.stage.mk,v 1.34 2014/11/20 22:40:08 sjg Exp $
+# $Id: meta.stage.mk,v 1.35 2015/05/20 06:40:33 sjg Exp $
#
# @(#) Copyright (c) 2011, Simon J. Gerraty
#
@@ -218,7 +218,7 @@ STAGE_AS.$s ?= ${.ALLSRC:N.dirdep}
stage_as: stage_as.$s
stage_as.$s: .dirdep
- @${STAGE_AS_SCRIPT}; StageAs ${FLAGS.$@} ${STAGE_FILES_DIR.$s:U${STAGE_DIR.$s}:${STAGE_DIR_FILTER}} ${STAGE_AS.$s:@f@$f ${STAGE_AS_${f:T}:U${f:T}}@}
+ @${STAGE_AS_SCRIPT}; StageAs ${FLAGS.$@} ${STAGE_FILES_DIR.$s:U${STAGE_DIR.$s}:${STAGE_DIR_FILTER}} ${STAGE_AS.$s:@f@$f ${STAGE_AS_${f:tA}:U${STAGE_AS_${f:T}:U${f:T}}}@}
@touch $@
.endfor
@@ -238,7 +238,9 @@ staging:
# generally we want staging to wait until everything else is done
STAGING_WAIT ?= .WAIT
+.if ${.MAKE.LEVEL} > 0
all: ${STAGING_WAIT} staging
+.endif
.if exists(${.PARSEDIR}/stage-install.sh) && !defined(STAGE_INSTALL)
# this will run install(1) and then followup with .dirdep files.
diff --git a/contrib/bmake/mk/meta.sys.mk b/contrib/bmake/mk/meta.sys.mk
index bcafd55..1f7ac49 100644
--- a/contrib/bmake/mk/meta.sys.mk
+++ b/contrib/bmake/mk/meta.sys.mk
@@ -1,4 +1,4 @@
-# $Id: meta.sys.mk,v 1.20 2014/08/04 05:12:27 sjg Exp $
+# $Id: meta.sys.mk,v 1.21 2015/06/01 22:43:49 sjg Exp $
#
# @(#) Copyright (c) 2010, Simon J. Gerraty
@@ -108,11 +108,16 @@ _metaError: .NOMETA .NOTMAIN
.if ${.MAKE.MODE:Mmeta*} != ""
MKDEP_MK = meta.autodep.mk
-# if we think we are updating dependencies,
-# then filemon had better be present
-.if ${UPDATE_DEPENDFILE:Uyes:tl} != "no" && !exists(/dev/filemon)
+.if ${UPDATE_DEPENDFILE:Uyes:tl} != "no"
+.if ${.MAKEFLAGS:Uno:M-k} != ""
+# make this more obvious
+.warning Setting UPDATE_DEPENDFILE=NO due to -k
+UPDATE_DEPENDFILE= NO
+.export UPDATE_DEPENDFILE
+.elif !exists(/dev/filemon)
.error ${.newline}ERROR: The filemon module (/dev/filemon) is not loaded.
.endif
+.endif
.if ${.MAKE.LEVEL} == 0
# make sure dirdeps target exists and do it first
diff --git a/contrib/bmake/mk/mkopt.sh b/contrib/bmake/mk/mkopt.sh
index 38b624e..c3a39c5 100755
--- a/contrib/bmake/mk/mkopt.sh
+++ b/contrib/bmake/mk/mkopt.sh
@@ -1,5 +1,5 @@
:
-# $Id: mkopt.sh,v 1.8 2014/11/15 07:07:18 sjg Exp $
+# $Id: mkopt.sh,v 1.10 2015/06/07 17:29:08 sjg Exp $
#
# @(#) Copyright (c) 2014, Simon J. Gerraty
#
@@ -19,9 +19,10 @@
# no need to be included more than once
_MKOPT_SH=:
+_MKOPT_PREFIX=${_MKOPT_PREFIX:-MK_}
#
-# _mk_opt OPT default
+# _mk_opt default OPT
#
# Set MK_$OPT
#
@@ -35,7 +36,7 @@ _MKOPT_SH=:
#
_mk_opt() {
_d=$1
- _mo=MK_$2 _wo=WITHOUT_$2 _wi=WITH_$2
+ _mo=${_MKOPT_PREFIX}$2 _wo=WITHOUT_$2 _wi=WITH_$2
eval "_mov=\$$_mo _wov=\$$_wo _wiv=\$$_wi"
case "$_wiv" in
@@ -63,15 +64,23 @@ _mk_opts() {
_d=no
for _o in "$@"
do
- case "$_o" in
+ case "$_o" in
+ */*) # option is dirname default comes from basename
+ eval "_d=\$${_MKOPT_PREFIX}${_o#*/}"
+ _o=${_o%/*}
+ ;;
yes|no) _d=$_o; continue;;
esac
_mk_opt $_d $_o
done
}
+# handle either options.mk style OPTIONS_DEFAULT_*
+# or FreeBSD's new bsd.mkopt.mk style __DEFAULT_*_OPTIONS
_mk_opts_defaults() {
- _mk_opts no $__DEFAULT_NO_OPTIONS yes $__DEFAULT_YES_OPTIONS
+ _mk_opts no $OPTIONS_DEFAULT_NO $__DEFAULT_NO_OPTIONS \
+ yes $OPTIONS_DEFAULT_YES $__DEFAULT_YES_OPTIONS \
+ $OPTIONS_DEFAULT_DEPENDENT $__DEFAULT_DEPENDENT_OPTIONS
}
case "/$0" in
diff --git a/contrib/bmake/targ.c b/contrib/bmake/targ.c
index 527206e..5db5477 100644
--- a/contrib/bmake/targ.c
+++ b/contrib/bmake/targ.c
@@ -1,4 +1,4 @@
-/* $NetBSD: targ.c,v 1.59 2014/09/07 20:55:34 joerg Exp $ */
+/* $NetBSD: targ.c,v 1.60 2015/05/25 09:01:06 manu Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: targ.c,v 1.59 2014/09/07 20:55:34 joerg Exp $";
+static char rcsid[] = "$NetBSD: targ.c,v 1.60 2015/05/25 09:01:06 manu Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)targ.c 8.2 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: targ.c,v 1.59 2014/09/07 20:55:34 joerg Exp $");
+__RCSID("$NetBSD: targ.c,v 1.60 2015/05/25 09:01:06 manu Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/contrib/diff/src/context.c b/contrib/diff/src/context.c
index 4937ce2..73bde69 100644
--- a/contrib/diff/src/context.c
+++ b/contrib/diff/src/context.c
@@ -62,7 +62,7 @@ print_context_label (char const *mark,
{
time_t sec = inf->stat.st_mtime;
verify (info_preserved, sizeof inf->stat.st_mtime <= sizeof sec);
- sprintf (buf, "%jd.%.9d", (intmax_t)sec, nsec);
+ sprintf (buf, "%jd.%.9ld", (intmax_t)sec, nsec);
}
fprintf (outfile, "%s %s\t%s\n", mark, inf->name, buf);
}
diff --git a/contrib/dtc/checks.c b/contrib/dtc/checks.c
index 11a4086..f704694 100644
--- a/contrib/dtc/checks.c
+++ b/contrib/dtc/checks.c
@@ -624,11 +624,11 @@ static void check_avoid_default_addr_size(struct check *c, struct node *dt,
if (!reg && !ranges)
return;
- if ((node->parent->addr_cells == -1))
+ if (node->parent->addr_cells == -1)
FAIL(c, "Relying on default #address-cells value for %s",
node->fullpath);
- if ((node->parent->size_cells == -1))
+ if (node->parent->size_cells == -1)
FAIL(c, "Relying on default #size-cells value for %s",
node->fullpath);
}
diff --git a/contrib/elftoolchain/common/_elftc.h b/contrib/elftoolchain/common/_elftc.h
index 45f0abd..6769519 100644
--- a/contrib/elftoolchain/common/_elftc.h
+++ b/contrib/elftoolchain/common/_elftc.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: _elftc.h 3175 2015-03-27 17:21:24Z emaste $
+ * $Id: _elftc.h 3209 2015-05-17 13:40:46Z kaiwang27 $
*/
/**
@@ -342,12 +342,13 @@ struct name { \
#if defined(__GLIBC__) || defined(__linux__)
-
+#ifndef _GNU_SOURCE
/*
* GLIBC based systems have a global 'char *' pointer referencing
* the executable's name.
*/
extern const char *program_invocation_short_name;
+#endif /* !_GNU_SOURCE */
#define ELFTC_GETPROGNAME() program_invocation_short_name
diff --git a/contrib/elftoolchain/common/elfdefinitions.h b/contrib/elftoolchain/common/elfdefinitions.h
index a53acde..58554fef 100644
--- a/contrib/elftoolchain/common/elfdefinitions.h
+++ b/contrib/elftoolchain/common/elfdefinitions.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: elfdefinitions.h 3178 2015-03-30 18:29:13Z emaste $
+ * $Id: elfdefinitions.h 3198 2015-05-14 18:36:19Z emaste $
*/
/*
@@ -565,6 +565,7 @@ _ELF_DEFINE_EM(EM_SPARC, 2, "SPARC") \
_ELF_DEFINE_EM(EM_386, 3, "Intel 80386") \
_ELF_DEFINE_EM(EM_68K, 4, "Motorola 68000") \
_ELF_DEFINE_EM(EM_88K, 5, "Motorola 88000") \
+_ELF_DEFINE_EM(EM_IAMCU, 6, "Intel MCU") \
_ELF_DEFINE_EM(EM_860, 7, "Intel 80860") \
_ELF_DEFINE_EM(EM_MIPS, 8, "MIPS I Architecture") \
_ELF_DEFINE_EM(EM_S370, 9, "IBM System/370 Processor") \
diff --git a/contrib/elftoolchain/elfcopy/elfcopy.h b/contrib/elftoolchain/elfcopy/elfcopy.h
index b750246..48574b5 100644
--- a/contrib/elftoolchain/elfcopy/elfcopy.h
+++ b/contrib/elftoolchain/elfcopy/elfcopy.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: elfcopy.h 3173 2015-03-27 16:46:13Z emaste $
+ * $Id: elfcopy.h 3221 2015-05-24 23:42:43Z kaiwang27 $
*/
#include <sys/queue.h>
@@ -237,6 +237,7 @@ struct elfcopy {
uint64_t *secndx; /* section index map. */
uint64_t *symndx; /* symbol index map. */
unsigned char *v_rel; /* symbols needed by relocation. */
+ unsigned char *v_grp; /* symbols refered by section group. */
unsigned char *v_secsym; /* sections with section symbol. */
STAILQ_HEAD(, segment) v_seg; /* list of segments. */
STAILQ_HEAD(, sec_action) v_sac;/* list of section operations. */
diff --git a/contrib/elftoolchain/elfcopy/main.c b/contrib/elftoolchain/elfcopy/main.c
index a48aea5..cbd48d3 100644
--- a/contrib/elftoolchain/elfcopy/main.c
+++ b/contrib/elftoolchain/elfcopy/main.c
@@ -39,7 +39,7 @@
#include "elfcopy.h"
-ELFTC_VCSID("$Id: main.c 3174 2015-03-27 17:13:41Z emaste $");
+ELFTC_VCSID("$Id: main.c 3216 2015-05-23 21:16:36Z kaiwang27 $");
enum options
{
@@ -404,8 +404,19 @@ create_elf(struct elfcopy *ecp)
* Insert SHDR table into the internal section list as a "pseudo"
* section, so later it will get sorted and resynced just as "normal"
* sections.
+ *
+ * Under FreeBSD, Binutils objcopy always put the section header
+ * at the end of all the sections. We want to do the same here.
+ *
+ * However, note that the behaviour is still different with Binutils:
+ * elfcopy checks the FreeBSD OSABI tag to tell whether it needs to
+ * move the section headers, while Binutils is probably configured
+ * this way when it's compiled on FreeBSD.
*/
- shtab = insert_shtab(ecp, 0);
+ if (oeh.e_ident[EI_OSABI] == ELFOSABI_FREEBSD)
+ shtab = insert_shtab(ecp, 1);
+ else
+ shtab = insert_shtab(ecp, 0);
/*
* Resync section offsets in the output object. This is needed
@@ -485,6 +496,11 @@ free_elf(struct elfcopy *ecp)
free(sec);
}
}
+
+ if (ecp->secndx != NULL) {
+ free(ecp->secndx);
+ ecp->secndx = NULL;
+ }
}
/* Create a temporary file. */
diff --git a/contrib/elftoolchain/elfcopy/sections.c b/contrib/elftoolchain/elfcopy/sections.c
index 7c43a35..a6fd25d 100644
--- a/contrib/elftoolchain/elfcopy/sections.c
+++ b/contrib/elftoolchain/elfcopy/sections.c
@@ -34,7 +34,7 @@
#include "elfcopy.h"
-ELFTC_VCSID("$Id: sections.c 3185 2015-04-11 08:56:34Z kaiwang27 $");
+ELFTC_VCSID("$Id: sections.c 3220 2015-05-24 23:42:39Z kaiwang27 $");
static void add_gnu_debuglink(struct elfcopy *ecp);
static uint32_t calc_crc32(const char *p, size_t len, uint32_t crc);
@@ -56,6 +56,7 @@ static void print_data(const char *d, size_t sz);
static void print_section(struct section *s);
static void *read_section(struct section *s, size_t *size);
static void update_reloc(struct elfcopy *ecp, struct section *s);
+static void update_section_group(struct elfcopy *ecp, struct section *s);
int
is_remove_section(struct elfcopy *ecp, const char *name)
@@ -552,6 +553,14 @@ copy_content(struct elfcopy *ecp)
(s->type == SHT_REL || s->type == SHT_RELA))
filter_reloc(ecp, s);
+ /*
+ * The section indices in the SHT_GROUP section needs
+ * to be updated since we might have stripped some
+ * sections and changed section numbering.
+ */
+ if (s->type == SHT_GROUP)
+ update_section_group(ecp, s);
+
if (is_modify_section(ecp, s->name))
modify_section(ecp, s);
@@ -571,6 +580,71 @@ copy_content(struct elfcopy *ecp)
}
}
+
+/*
+ * Update section group section. The section indices in the SHT_GROUP
+ * section need update after section numbering changed.
+ */
+static void
+update_section_group(struct elfcopy *ecp, struct section *s)
+{
+ GElf_Shdr ish;
+ Elf_Data *id;
+ uint32_t *ws, *wd;
+ uint64_t n;
+ size_t ishnum;
+ int i, j;
+
+ if (!elf_getshnum(ecp->ein, &ishnum))
+ errx(EXIT_FAILURE, "elf_getshnum failed: %s",
+ elf_errmsg(-1));
+
+ if (gelf_getshdr(s->is, &ish) == NULL)
+ errx(EXIT_FAILURE, "gelf_getehdr() failed: %s",
+ elf_errmsg(-1));
+
+ if ((id = elf_getdata(s->is, NULL)) == NULL)
+ errx(EXIT_FAILURE, "elf_getdata() failed: %s",
+ elf_errmsg(-1));
+
+ if (ish.sh_size == 0)
+ return;
+
+ if (ish.sh_entsize == 0)
+ ish.sh_entsize = 4;
+
+ ws = id->d_buf;
+
+ /* We only support COMDAT section. */
+#ifndef GRP_COMDAT
+#define GRP_COMDAT 0x1
+#endif
+ if ((*ws & GRP_COMDAT) == 0)
+ return;
+
+ if ((s->buf = malloc(ish.sh_size)) == NULL)
+ err(EXIT_FAILURE, "malloc failed");
+
+ s->sz = ish.sh_size;
+
+ wd = s->buf;
+
+ /* Copy the flag word as-is. */
+ *wd = *ws;
+
+ /* Update the section indices. */
+ n = ish.sh_size / ish.sh_entsize;
+ for(i = 1, j = 1; (uint64_t)i < n; i++) {
+ if (ws[i] != SHN_UNDEF && ws[i] < ishnum &&
+ ecp->secndx[ws[i]] != 0)
+ wd[j++] = ecp->secndx[ws[i]];
+ else
+ s->sz -= 4;
+ }
+
+ s->nocopy = 1;
+}
+
/*
* Filter relocation entries, only keep those entries whose
* symbol is in the keep list.
@@ -1028,8 +1102,11 @@ copy_shdr(struct elfcopy *ecp, struct section *s, const char *name, int copy,
osh.sh_flags |= SHF_WRITE;
if (sec_flags & SF_CODE)
osh.sh_flags |= SHF_EXECINSTR;
- } else
+ } else {
osh.sh_flags = ish.sh_flags;
+ if (ish.sh_type == SHT_REL || ish.sh_type == SHT_RELA)
+ osh.sh_flags |= SHF_INFO_LINK;
+ }
}
if (name == NULL)
@@ -1272,6 +1349,14 @@ set_shstrtab(struct elfcopy *ecp)
s = ecp->shstrtab;
+ if (s->os == NULL) {
+ /* Input object does not contain .shstrtab section */
+ if ((s->os = elf_newscn(ecp->eout)) == NULL)
+ errx(EXIT_FAILURE, "elf_newscn failed: %s",
+ elf_errmsg(-1));
+ insert_to_sec_list(ecp, s, 1);
+ }
+
if (gelf_getshdr(s->os, &sh) == NULL)
errx(EXIT_FAILURE, "692 gelf_getshdr() failed: %s",
elf_errmsg(-1));
diff --git a/contrib/elftoolchain/elfcopy/symbols.c b/contrib/elftoolchain/elfcopy/symbols.c
index 4a7d38a..05bcd7a 100644
--- a/contrib/elftoolchain/elfcopy/symbols.c
+++ b/contrib/elftoolchain/elfcopy/symbols.c
@@ -33,7 +33,7 @@
#include "elfcopy.h"
-ELFTC_VCSID("$Id: symbols.c 3191 2015-05-04 17:07:01Z jkoshy $");
+ELFTC_VCSID("$Id: symbols.c 3222 2015-05-24 23:47:23Z kaiwang27 $");
/* Symbol table buffer structure. */
struct symbuf {
@@ -77,7 +77,8 @@ static int is_weak_symbol(unsigned char st_info);
static int lookup_exact_string(hash_head *hash, const char *buf,
const char *s);
static int generate_symbols(struct elfcopy *ecp);
-static void mark_symbols(struct elfcopy *ecp, size_t sc);
+static void mark_reloc_symbols(struct elfcopy *ecp, size_t sc);
+static void mark_section_group_symbols(struct elfcopy *ecp, size_t sc);
static int match_wildcard(const char *name, const char *pattern);
uint32_t str_hash(const char *s);
@@ -160,6 +161,10 @@ is_needed_symbol(struct elfcopy *ecp, int i, GElf_Sym *s)
if (BIT_ISSET(ecp->v_rel, i))
return (1);
+ /* Symbols refered by COMDAT sections are needed. */
+ if (BIT_ISSET(ecp->v_grp, i))
+ return (1);
+
/*
* For relocatable files (.o files), global and weak symbols
* are needed.
@@ -207,7 +212,10 @@ is_remove_symbol(struct elfcopy *ecp, size_t sc, int i, GElf_Sym *s,
return (1);
if (ecp->v_rel == NULL)
- mark_symbols(ecp, sc);
+ mark_reloc_symbols(ecp, sc);
+
+ if (ecp->v_grp == NULL)
+ mark_section_group_symbols(ecp, sc);
if (is_needed_symbol(ecp, i, s))
return (0);
@@ -233,7 +241,7 @@ is_remove_symbol(struct elfcopy *ecp, size_t sc, int i, GElf_Sym *s,
* Mark symbols refered by relocation entries.
*/
static void
-mark_symbols(struct elfcopy *ecp, size_t sc)
+mark_reloc_symbols(struct elfcopy *ecp, size_t sc)
{
const char *name;
Elf_Data *d;
@@ -311,6 +319,49 @@ mark_symbols(struct elfcopy *ecp, size_t sc)
elf_errmsg(elferr));
}
+static void
+mark_section_group_symbols(struct elfcopy *ecp, size_t sc)
+{
+ const char *name;
+ Elf_Scn *s;
+ GElf_Shdr sh;
+ size_t indx;
+ int elferr;
+
+ ecp->v_grp = calloc((sc + 7) / 8, 1);
+ if (ecp->v_grp == NULL)
+ err(EXIT_FAILURE, "calloc failed");
+
+ if (elf_getshstrndx(ecp->ein, &indx) == 0)
+ errx(EXIT_FAILURE, "elf_getshstrndx failed: %s",
+ elf_errmsg(-1));
+
+ s = NULL;
+ while ((s = elf_nextscn(ecp->ein, s)) != NULL) {
+ if (gelf_getshdr(s, &sh) != &sh)
+ errx(EXIT_FAILURE, "elf_getshdr failed: %s",
+ elf_errmsg(-1));
+
+ if (sh.sh_type != SHT_GROUP)
+ continue;
+
+ if ((name = elf_strptr(ecp->ein, indx, sh.sh_name)) == NULL)
+ errx(EXIT_FAILURE, "elf_strptr failed: %s",
+ elf_errmsg(-1));
+ if (is_remove_section(ecp, name))
+ continue;
+
+ if (sh.sh_info > 0 && sh.sh_info < sc)
+ BIT_SET(ecp->v_grp, sh.sh_info);
+ else if (sh.sh_info != 0)
+ warnx("invalid symbox index");
+ }
+ elferr = elf_errno();
+ if (elferr != 0)
+ errx(EXIT_FAILURE, "elf_nextscn failed: %s",
+ elf_errmsg(elferr));
+}
+
static int
generate_symbols(struct elfcopy *ecp)
{
@@ -351,6 +402,8 @@ generate_symbols(struct elfcopy *ecp)
ecp->symtab->buf = sy_buf;
ecp->strtab->buf = st_buf;
+ gsym = NULL;
+
/*
* Create bit vector v_secsym, which is used to mark sections
* that already have corresponding STT_SECTION symbols.
@@ -384,7 +437,7 @@ generate_symbols(struct elfcopy *ecp)
/* Symbol table should exist if this function is called. */
if (symndx == 0) {
warnx("can't find .strtab section");
- return (0);
+ goto clean;
}
/* Locate .symtab of input object. */
@@ -413,7 +466,6 @@ generate_symbols(struct elfcopy *ecp)
* output object, it is used by update_reloc() later to update
* relocation information.
*/
- gsym = NULL;
sc = ish.sh_size / ish.sh_entsize;
if (sc > 0) {
ecp->symndx = calloc(sc, sizeof(*ecp->symndx));
@@ -427,7 +479,7 @@ generate_symbols(struct elfcopy *ecp)
if (elferr != 0)
errx(EXIT_FAILURE, "elf_getdata failed: %s",
elf_errmsg(elferr));
- return (0);
+ goto clean;
}
} else
return (0);
@@ -523,7 +575,7 @@ generate_symbols(struct elfcopy *ecp)
* check if that only local symbol is the reserved symbol.
*/
if (sy_buf->nls <= 1 && sy_buf->ngs == 0)
- return (0);
+ goto clean;
/*
* Create STT_SECTION symbols for sections that do not already
@@ -550,6 +602,7 @@ generate_symbols(struct elfcopy *ecp)
sym.st_value = s->vma;
sym.st_size = 0;
sym.st_info = GELF_ST_INFO(STB_LOCAL, STT_SECTION);
+ sym.st_other = STV_DEFAULT;
/*
* Don't let add_to_symtab() touch sym.st_shndx.
* In this case, we know the index already.
@@ -583,6 +636,12 @@ generate_symbols(struct elfcopy *ecp)
}
return (1);
+
+clean:
+ free(gsym);
+ free_symtab(ecp);
+
+ return (0);
}
void
@@ -624,7 +683,9 @@ create_symtab(struct elfcopy *ecp)
if (((ecp->flags & SYMTAB_INTACT) == 0) && !generate_symbols(ecp)) {
TAILQ_REMOVE(&ecp->v_sec, ecp->symtab, sec_list);
TAILQ_REMOVE(&ecp->v_sec, ecp->strtab, sec_list);
+ free(ecp->symtab->buf);
free(ecp->symtab);
+ free(ecp->strtab->buf);
free(ecp->strtab);
ecp->symtab = NULL;
ecp->strtab = NULL;
@@ -697,6 +758,23 @@ free_symtab(struct elfcopy *ecp)
}
}
}
+
+ if (ecp->symndx != NULL) {
+ free(ecp->symndx);
+ ecp->symndx = NULL;
+ }
+ if (ecp->v_rel != NULL) {
+ free(ecp->v_rel);
+ ecp->v_rel = NULL;
+ }
+ if (ecp->v_grp != NULL) {
+ free(ecp->v_grp);
+ ecp->v_grp = NULL;
+ }
+ if (ecp->v_secsym != NULL) {
+ free(ecp->v_secsym);
+ ecp->v_secsym = NULL;
+ }
}
void
diff --git a/contrib/elftoolchain/libdwarf/libdwarf_reloc.c b/contrib/elftoolchain/libdwarf/libdwarf_reloc.c
index 96bb785..4ae8f5c 100644
--- a/contrib/elftoolchain/libdwarf/libdwarf_reloc.c
+++ b/contrib/elftoolchain/libdwarf/libdwarf_reloc.c
@@ -26,7 +26,7 @@
#include "_libdwarf.h"
-ELFTC_VCSID("$Id: libdwarf_reloc.c 3149 2015-02-15 19:00:06Z emaste $");
+ELFTC_VCSID("$Id: libdwarf_reloc.c 3198 2015-05-14 18:36:19Z emaste $");
Dwarf_Unsigned
_dwarf_get_reloc_type(Dwarf_P_Debug dbg, int is64)
@@ -75,6 +75,7 @@ _dwarf_get_reloc_size(Dwarf_Debug dbg, Dwarf_Unsigned rel_type)
return (4);
break;
case EM_386:
+ case EM_IAMCU:
if (rel_type == R_386_32)
return (4);
break;
diff --git a/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c b/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c
index 1cdb0e7..e8fd78f 100644
--- a/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c
+++ b/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c
@@ -36,7 +36,7 @@
#include "_libelftc.h"
-ELFTC_VCSID("$Id: libelftc_dem_gnu3.c 3194 2015-05-05 17:55:16Z emaste $");
+ELFTC_VCSID("$Id: libelftc_dem_gnu3.c 3212 2015-05-17 13:40:55Z kaiwang27 $");
/**
* @file cpp_demangle.c
@@ -50,7 +50,7 @@ ELFTC_VCSID("$Id: libelftc_dem_gnu3.c 3194 2015-05-05 17:55:16Z emaste $");
enum type_qualifier {
TYPE_PTR, TYPE_REF, TYPE_CMX, TYPE_IMG, TYPE_EXT, TYPE_RST, TYPE_VAT,
- TYPE_CST
+ TYPE_CST, TYPE_VEC
};
struct vector_type_qualifier {
@@ -84,6 +84,7 @@ struct cpp_demangle_data {
int func_type;
const char *cur; /* current mangled name ptr */
const char *last_sname; /* last source name */
+ int push_head;
};
#define CPP_DEMANGLE_TRY_LIMIT 128
@@ -112,6 +113,8 @@ static int cpp_demangle_read_array(struct cpp_demangle_data *);
static int cpp_demangle_read_encoding(struct cpp_demangle_data *);
static int cpp_demangle_read_expr_primary(struct cpp_demangle_data *);
static int cpp_demangle_read_expression(struct cpp_demangle_data *);
+static int cpp_demangle_read_expression_flat(struct cpp_demangle_data *,
+ char **);
static int cpp_demangle_read_expression_binary(struct cpp_demangle_data *,
const char *, size_t);
static int cpp_demangle_read_expression_unary(struct cpp_demangle_data *,
@@ -123,8 +126,12 @@ static int cpp_demangle_read_function(struct cpp_demangle_data *, int *,
static int cpp_demangle_local_source_name(struct cpp_demangle_data *ddata);
static int cpp_demangle_read_local_name(struct cpp_demangle_data *);
static int cpp_demangle_read_name(struct cpp_demangle_data *);
+static int cpp_demangle_read_name_flat(struct cpp_demangle_data *,
+ char**);
static int cpp_demangle_read_nested_name(struct cpp_demangle_data *);
static int cpp_demangle_read_number(struct cpp_demangle_data *, long *);
+static int cpp_demangle_read_number_as_string(struct cpp_demangle_data *,
+ char **);
static int cpp_demangle_read_nv_offset(struct cpp_demangle_data *);
static int cpp_demangle_read_offset(struct cpp_demangle_data *);
static int cpp_demangle_read_offset_number(struct cpp_demangle_data *);
@@ -138,6 +145,8 @@ static int cpp_demangle_read_tmpl_arg(struct cpp_demangle_data *);
static int cpp_demangle_read_tmpl_args(struct cpp_demangle_data *);
static int cpp_demangle_read_tmpl_param(struct cpp_demangle_data *);
static int cpp_demangle_read_type(struct cpp_demangle_data *, int);
+static int cpp_demangle_read_type_flat(struct cpp_demangle_data *,
+ char **);
static int cpp_demangle_read_uqname(struct cpp_demangle_data *);
static int cpp_demangle_read_v_offset(struct cpp_demangle_data *);
static char *decode_fp_to_double(const char *, size_t);
@@ -156,8 +165,6 @@ static int vector_type_qualifier_init(struct vector_type_qualifier *);
static int vector_type_qualifier_push(struct vector_type_qualifier *,
enum type_qualifier);
-static int cpp_demangle_gnu3_push_head;
-
/**
* @brief Decode the input string by IA-64 C++ ABI style.
*
@@ -190,7 +197,6 @@ cpp_demangle_gnu3(const char *org)
if (!cpp_demangle_data_init(&ddata, org + 2))
return (NULL);
- cpp_demangle_gnu3_push_head = 0;
rtn = NULL;
if (!cpp_demangle_read_encoding(&ddata))
@@ -277,6 +283,7 @@ cpp_demangle_data_init(struct cpp_demangle_data *d, const char *cur)
d->func_type = 0;
d->cur = cur;
d->last_sname = NULL;
+ d->push_head = 0;
return (1);
@@ -309,7 +316,6 @@ cpp_demangle_push_fp(struct cpp_demangle_data *ddata,
fp = ddata->cur;
while (*ddata->cur != 'E')
++ddata->cur;
- ++ddata->cur;
if ((f = decoder(fp, ddata->cur - fp)) == NULL)
return (0);
@@ -320,6 +326,8 @@ cpp_demangle_push_fp(struct cpp_demangle_data *ddata,
free(f);
+ ++ddata->cur;
+
return (rtn);
}
@@ -331,7 +339,7 @@ cpp_demangle_push_str(struct cpp_demangle_data *ddata, const char *str,
if (ddata == NULL || str == NULL || len == 0)
return (0);
- if (cpp_demangle_gnu3_push_head > 0)
+ if (ddata->push_head > 0)
return (vector_str_push(&ddata->output_tmp, str, len));
return (vector_str_push(&ddata->output, str, len));
@@ -403,7 +411,8 @@ cpp_demangle_push_type_qualifier(struct cpp_demangle_data *ddata,
if (type_str != NULL) {
if (!vector_str_push(&subst_v, "*", 1))
goto clean;
- if (!cpp_demangle_push_subst_v(ddata, &subst_v))
+ if (!cpp_demangle_push_subst_v(ddata,
+ &subst_v))
goto clean;
}
break;
@@ -414,7 +423,8 @@ cpp_demangle_push_type_qualifier(struct cpp_demangle_data *ddata,
if (type_str != NULL) {
if (!vector_str_push(&subst_v, "&", 1))
goto clean;
- if (!cpp_demangle_push_subst_v(ddata, &subst_v))
+ if (!cpp_demangle_push_subst_v(ddata,
+ &subst_v))
goto clean;
}
break;
@@ -425,7 +435,8 @@ cpp_demangle_push_type_qualifier(struct cpp_demangle_data *ddata,
if (type_str != NULL) {
if (!vector_str_push(&subst_v, " complex", 8))
goto clean;
- if (!cpp_demangle_push_subst_v(ddata, &subst_v))
+ if (!cpp_demangle_push_subst_v(ddata,
+ &subst_v))
goto clean;
}
break;
@@ -434,23 +445,26 @@ cpp_demangle_push_type_qualifier(struct cpp_demangle_data *ddata,
if (!cpp_demangle_push_str(ddata, " imaginary", 10))
goto clean;
if (type_str != NULL) {
- if (!vector_str_push(&subst_v, " imaginary", 10))
+ if (!vector_str_push(&subst_v, " imaginary",
+ 10))
goto clean;
- if (!cpp_demangle_push_subst_v(ddata, &subst_v))
+ if (!cpp_demangle_push_subst_v(ddata,
+ &subst_v))
goto clean;
}
break;
case TYPE_EXT:
- if (e_idx > v->ext_name.size - 1)
+ if (v->ext_name.size == 0 ||
+ e_idx > v->ext_name.size - 1)
goto clean;
- if ((e_len = strlen(v->ext_name.container[e_idx])) == 0)
+ if ((e_len = strlen(v->ext_name.container[e_idx])) ==
+ 0)
goto clean;
- if ((buf = malloc(sizeof(char) * (e_len + 1))) == NULL)
+ if ((buf = malloc(e_len + 2)) == NULL)
goto clean;
-
- memcpy(buf, " ", 1);
- memcpy(buf + 1, v->ext_name.container[e_idx], e_len);
+ snprintf(buf, e_len + 2, " %s",
+ v->ext_name.container[e_idx]);
if (!cpp_demangle_push_str(ddata, buf, e_len + 1)) {
free(buf);
@@ -463,7 +477,8 @@ cpp_demangle_push_type_qualifier(struct cpp_demangle_data *ddata,
free(buf);
goto clean;
}
- if (!cpp_demangle_push_subst_v(ddata, &subst_v)) {
+ if (!cpp_demangle_push_subst_v(ddata,
+ &subst_v)) {
free(buf);
goto clean;
}
@@ -478,7 +493,8 @@ cpp_demangle_push_type_qualifier(struct cpp_demangle_data *ddata,
if (type_str != NULL) {
if (!vector_str_push(&subst_v, " restrict", 9))
goto clean;
- if (!cpp_demangle_push_subst_v(ddata, &subst_v))
+ if (!cpp_demangle_push_subst_v(ddata,
+ &subst_v))
goto clean;
}
break;
@@ -489,7 +505,8 @@ cpp_demangle_push_type_qualifier(struct cpp_demangle_data *ddata,
if (type_str != NULL) {
if (!vector_str_push(&subst_v, " volatile", 9))
goto clean;
- if (!cpp_demangle_push_subst_v(ddata, &subst_v))
+ if (!cpp_demangle_push_subst_v(ddata,
+ &subst_v))
goto clean;
}
break;
@@ -500,11 +517,42 @@ cpp_demangle_push_type_qualifier(struct cpp_demangle_data *ddata,
if (type_str != NULL) {
if (!vector_str_push(&subst_v, " const", 6))
goto clean;
- if (!cpp_demangle_push_subst_v(ddata, &subst_v))
+ if (!cpp_demangle_push_subst_v(ddata,
+ &subst_v))
goto clean;
}
break;
+ case TYPE_VEC:
+ if (v->ext_name.size == 0 ||
+ e_idx > v->ext_name.size - 1)
+ goto clean;
+ if ((e_len = strlen(v->ext_name.container[e_idx])) ==
+ 0)
+ goto clean;
+ if ((buf = malloc(e_len + 12)) == NULL)
+ goto clean;
+ snprintf(buf, e_len + 12, " __vector(%s)",
+ v->ext_name.container[e_idx]);
+ if (!cpp_demangle_push_str(ddata, buf, e_len + 11)) {
+ free(buf);
+ goto clean;
+ }
+ if (type_str != NULL) {
+ if (!vector_str_push(&subst_v, buf,
+ e_len + 11)) {
+ free(buf);
+ goto clean;
+ }
+ if (!cpp_demangle_push_subst_v(ddata,
+ &subst_v)) {
+ free(buf);
+ goto clean;
+ }
+ }
+ free(buf);
+ ++e_idx;
+ break;
};
--idx;
}
@@ -655,10 +703,14 @@ cpp_demangle_read_expr_primary(struct cpp_demangle_data *ddata)
switch (*ddata->cur) {
case 'b':
+ if (*(ddata->cur + 2) != 'E')
+ return (0);
switch (*(++ddata->cur)) {
case '0':
+ ddata->cur += 2;
return (cpp_demangle_push_str(ddata, "false", 5));
case '1':
+ ddata->cur += 2;
return (cpp_demangle_push_str(ddata, "true", 4));
default:
return (0);
@@ -707,7 +759,8 @@ cpp_demangle_read_expr_primary(struct cpp_demangle_data *ddata)
++ddata->cur;
}
++ddata->cur;
- return (cpp_demangle_push_str(ddata, num, ddata->cur - num));
+ return (cpp_demangle_push_str(ddata, num,
+ ddata->cur - num - 1));
default:
return (0);
@@ -999,6 +1052,38 @@ cpp_demangle_read_expression(struct cpp_demangle_data *ddata)
}
static int
+cpp_demangle_read_expression_flat(struct cpp_demangle_data *ddata, char **str)
+{
+ struct vector_str *output;
+ size_t i, p_idx, idx, exp_len;
+ char *exp;
+
+ output = ddata->push_head > 0 ? &ddata->output_tmp :
+ &ddata->output;
+
+ p_idx = output->size;
+
+ if (!cpp_demangle_read_expression(ddata))
+ return (0);
+
+ if ((exp = vector_str_substr(output, p_idx, output->size - 1,
+ &exp_len)) == NULL)
+ return (0);
+
+ idx = output->size;
+ for (i = p_idx; i < idx; ++i) {
+ if (!vector_str_pop(output)) {
+ free(exp);
+ return (0);
+ }
+ }
+
+ *str = exp;
+
+ return (1);
+}
+
+static int
cpp_demangle_read_expression_binary(struct cpp_demangle_data *ddata,
const char *name, size_t len)
{
@@ -1127,12 +1212,65 @@ cpp_demangle_read_function(struct cpp_demangle_data *ddata, int *ext_c,
static int
cpp_demangle_read_encoding(struct cpp_demangle_data *ddata)
{
+ char *name, *type, *num_str;
+ long offset;
+ int rtn;
if (ddata == NULL || *ddata->cur == '\0')
return (0);
/* special name */
switch (SIMPLE_HASH(*ddata->cur, *(ddata->cur + 1))) {
+ case SIMPLE_HASH('G', 'A'):
+ if (!cpp_demangle_push_str(ddata, "hidden alias for ", 17))
+ return (0);
+ ddata->cur += 2;
+ if (*ddata->cur == '\0')
+ return (0);
+ return (cpp_demangle_read_encoding(ddata));
+
+ case SIMPLE_HASH('G', 'R'):
+ if (!cpp_demangle_push_str(ddata, "reference temporary #", 21))
+ return (0);
+ ddata->cur += 2;
+ if (*ddata->cur == '\0')
+ return (0);
+ if (!cpp_demangle_read_name_flat(ddata, &name))
+ return (0);
+ rtn = 0;
+ if (!cpp_demangle_read_number_as_string(ddata, &num_str))
+ goto clean1;
+ if (!cpp_demangle_push_str(ddata, num_str, strlen(num_str)))
+ goto clean2;
+ if (!cpp_demangle_push_str(ddata, " for ", 5))
+ goto clean2;
+ if (!cpp_demangle_push_str(ddata, name, strlen(name)))
+ goto clean2;
+ rtn = 1;
+ clean2:
+ free(num_str);
+ clean1:
+ free(name);
+ return (rtn);
+
+ case SIMPLE_HASH('G', 'T'):
+ ddata->cur += 2;
+ if (*ddata->cur == '\0')
+ return (0);
+ switch (*ddata->cur) {
+ case 'n':
+ if (!cpp_demangle_push_str(ddata,
+ "non-transaction clone for ", 26))
+ return (0);
+ case 't':
+ default:
+ if (!cpp_demangle_push_str(ddata,
+ "transaction clone for ", 22))
+ return (0);
+ }
+ ++ddata->cur;
+ return (cpp_demangle_read_encoding(ddata));
+
case SIMPLE_HASH('G', 'V'):
/* sentry object for 1 time init */
if (!cpp_demangle_push_str(ddata, "guard variable for ", 20))
@@ -1154,14 +1292,49 @@ cpp_demangle_read_encoding(struct cpp_demangle_data *ddata)
return (0);
return (cpp_demangle_read_encoding(ddata));
+ case SIMPLE_HASH('T', 'C'):
+ /* construction vtable */
+ if (!cpp_demangle_push_str(ddata, "construction vtable for ",
+ 24))
+ return (0);
+ ddata->cur += 2;
+ if (*ddata->cur == '\0')
+ return (0);
+ if (!cpp_demangle_read_type_flat(ddata, &type))
+ return (0);
+ rtn = 0;
+ if (!cpp_demangle_read_number(ddata, &offset))
+ goto clean3;
+ if (*ddata->cur++ != '_')
+ goto clean3;
+ if (!cpp_demangle_read_type(ddata, 0))
+ goto clean3;
+ if (!cpp_demangle_push_str(ddata, "-in-", 4))
+ goto clean3;
+ if (!cpp_demangle_push_str(ddata, type, strlen(type)))
+ goto clean3;
+ rtn = 1;
+ clean3:
+ free(type);
+ return (rtn);
+
case SIMPLE_HASH('T', 'D'):
/* typeinfo common proxy */
break;
+ case SIMPLE_HASH('T', 'F'):
+ /* typeinfo fn */
+ if (!cpp_demangle_push_str(ddata, "typeinfo fn for ", 16))
+ return (0);
+ ddata->cur += 2;
+ if (*ddata->cur == '\0')
+ return (0);
+ return (cpp_demangle_read_type(ddata, 0));
+
case SIMPLE_HASH('T', 'h'):
/* virtual function non-virtual override thunk */
- if (cpp_demangle_push_str(ddata,
- "virtual function non-virtual override ", 38) == 0)
+ if (!cpp_demangle_push_str(ddata,
+ "virtual function non-virtual override ", 38))
return (0);
ddata->cur += 2;
if (*ddata->cur == '\0')
@@ -1170,24 +1343,51 @@ cpp_demangle_read_encoding(struct cpp_demangle_data *ddata)
return (0);
return (cpp_demangle_read_encoding(ddata));
+ case SIMPLE_HASH('T', 'H'):
+ /* TLS init function */
+ if (!cpp_demangle_push_str(ddata, "TLS init function for ",
+ 22))
+ return (0);
+ ddata->cur += 2;
+ if (*ddata->cur == '\0')
+ return (0);
+ break;
+
case SIMPLE_HASH('T', 'I'):
/* typeinfo structure */
- /* FALLTHROUGH */
+ if (!cpp_demangle_push_str(ddata, "typeinfo for ", 13))
+ return (0);
+ ddata->cur += 2;
+ if (*ddata->cur == '\0')
+ return (0);
+ return (cpp_demangle_read_type(ddata, 0));
+
+ case SIMPLE_HASH('T', 'J'):
+ /* java class */
+ if (!cpp_demangle_push_str(ddata, "java Class for ", 15))
+ return (0);
+ ddata->cur += 2;
+ if (*ddata->cur == '\0')
+ return (0);
+ return (cpp_demangle_read_type(ddata, 0));
+
case SIMPLE_HASH('T', 'S'):
/* RTTI name (NTBS) */
- if (!cpp_demangle_push_str(ddata, "typeinfo for ", 14))
+ if (!cpp_demangle_push_str(ddata, "typeinfo name for ", 18))
return (0);
ddata->cur += 2;
if (*ddata->cur == '\0')
return (0);
- return (cpp_demangle_read_type(ddata, 1));
+ return (cpp_demangle_read_type(ddata, 0));
case SIMPLE_HASH('T', 'T'):
/* VTT table */
if (!cpp_demangle_push_str(ddata, "VTT for ", 8))
return (0);
ddata->cur += 2;
- return (cpp_demangle_read_type(ddata, 1));
+ if (*ddata->cur == '\0')
+ return (0);
+ return (cpp_demangle_read_type(ddata, 0));
case SIMPLE_HASH('T', 'v'):
/* virtual function virtual override thunk */
@@ -1208,7 +1408,17 @@ cpp_demangle_read_encoding(struct cpp_demangle_data *ddata)
ddata->cur += 2;
if (*ddata->cur == '\0')
return (0);
- return (cpp_demangle_read_type(ddata, 1));
+ return (cpp_demangle_read_type(ddata, 0));
+
+ case SIMPLE_HASH('T', 'W'):
+ /* TLS wrapper function */
+ if (!cpp_demangle_push_str(ddata, "TLS wrapper function for ",
+ 25))
+ return (0);
+ ddata->cur += 2;
+ if (*ddata->cur == '\0')
+ return (0);
+ break;
};
return (cpp_demangle_read_name(ddata));
@@ -1270,8 +1480,7 @@ cpp_demangle_read_name(struct cpp_demangle_data *ddata)
if (ddata == NULL || *ddata->cur == '\0')
return (0);
- output = cpp_demangle_gnu3_push_head > 0 ?
- &ddata->output_tmp : &ddata->output;
+ output = ddata->push_head > 0 ? &ddata->output_tmp : &ddata->output;
subst_str = NULL;
@@ -1327,6 +1536,38 @@ clean:
}
static int
+cpp_demangle_read_name_flat(struct cpp_demangle_data *ddata, char **str)
+{
+ struct vector_str *output;
+ size_t i, p_idx, idx, name_len;
+ char *name;
+
+ output = ddata->push_head > 0 ? &ddata->output_tmp :
+ &ddata->output;
+
+ p_idx = output->size;
+
+ if (!cpp_demangle_read_name(ddata))
+ return (0);
+
+ if ((name = vector_str_substr(output, p_idx, output->size - 1,
+ &name_len)) == NULL)
+ return (0);
+
+ idx = output->size;
+ for (i = p_idx; i < idx; ++i) {
+ if (!vector_str_pop(output)) {
+ free(name);
+ return (0);
+ }
+ }
+
+ *str = name;
+
+ return (1);
+}
+
+static int
cpp_demangle_read_nested_name(struct cpp_demangle_data *ddata)
{
struct vector_str *output, v;
@@ -1355,8 +1596,7 @@ cpp_demangle_read_nested_name(struct cpp_demangle_data *ddata)
++ddata->cur;
}
- output = cpp_demangle_gnu3_push_head > 0 ?
- &ddata->output_tmp : &ddata->output;
+ output = ddata->push_head > 0 ? &ddata->output_tmp : &ddata->output;
if (!vector_str_init(&v))
return (0);
@@ -1453,6 +1693,24 @@ cpp_demangle_read_number(struct cpp_demangle_data *ddata, long *rtn)
}
static int
+cpp_demangle_read_number_as_string(struct cpp_demangle_data *ddata, char **str)
+{
+ long n;
+
+ if (!cpp_demangle_read_number(ddata, &n)) {
+ *str = NULL;
+ return (0);
+ }
+
+ if (asprintf(str, "%ld", n) < 0) {
+ *str = NULL;
+ return (0);
+ }
+
+ return (1);
+}
+
+static int
cpp_demangle_read_nv_offset(struct cpp_demangle_data *ddata)
{
@@ -1581,9 +1839,18 @@ static int
cpp_demangle_read_sname(struct cpp_demangle_data *ddata)
{
long len;
+ int err;
if (ddata == NULL || cpp_demangle_read_number(ddata, &len) == 0 ||
- len <= 0 || cpp_demangle_push_str(ddata, ddata->cur, len) == 0)
+ len <= 0)
+ return (0);
+
+ if (len == 12 && (memcmp("_GLOBAL__N_1", ddata->cur, 12) == 0))
+ err = cpp_demangle_push_str(ddata, "(anonymous namespace)", 21);
+ else
+ err = cpp_demangle_push_str(ddata, ddata->cur, len);
+
+ if (err == 0)
return (0);
assert(ddata->output.size > 0);
@@ -1732,8 +1999,7 @@ cpp_demangle_read_subst_std(struct cpp_demangle_data *ddata)
ddata->cur += 2;
- output = cpp_demangle_gnu3_push_head > 0 ?
- &ddata->output_tmp : &ddata->output;
+ output = ddata->push_head > 0 ? &ddata->output_tmp : &ddata->output;
p_idx = output->size;
if (!cpp_demangle_read_uqname(ddata))
@@ -1783,8 +2049,7 @@ cpp_demangle_read_subst_stdtmpl(struct cpp_demangle_data *ddata,
if (ddata == NULL || str == NULL || len == 0)
return (0);
- output = cpp_demangle_gnu3_push_head > 0 ? &ddata->output_tmp :
- &ddata->output;
+ output = ddata->push_head > 0 ? &ddata->output_tmp : &ddata->output;
p_idx = output->size;
substr = NULL;
@@ -1852,8 +2117,7 @@ cpp_demangle_read_tmpl_args(struct cpp_demangle_data *ddata)
return (0);
limit = 0;
- v = cpp_demangle_gnu3_push_head > 0 ?
- &ddata->output_tmp : &ddata->output;
+ v = ddata->push_head > 0 ? &ddata->output_tmp : &ddata->output;
for (;;) {
idx = v->size;
if (!cpp_demangle_read_tmpl_arg(ddata))
@@ -1936,14 +2200,14 @@ cpp_demangle_read_type(struct cpp_demangle_data *ddata, int delimit)
size_t p_idx, type_str_len;
int extern_c, is_builtin;
long len;
- char *type_str;
+ char *type_str, *exp_str, *num_str;
if (ddata == NULL)
return (0);
output = &ddata->output;
if (!strncmp(ddata->output.container[ddata->output.size - 1], ">", 1)) {
- cpp_demangle_gnu3_push_head++;
+ ddata->push_head++;
output = &ddata->output_tmp;
} else if (delimit == 1) {
if (ddata->paren == false) {
@@ -1978,7 +2242,7 @@ cpp_demangle_read_type(struct cpp_demangle_data *ddata, int delimit)
extern_c = 0;
is_builtin = 1;
p_idx = output->size;
- type_str = NULL;
+ type_str = exp_str = num_str = NULL;
again:
/* builtin type */
switch (*ddata->cur) {
@@ -2024,6 +2288,82 @@ again:
++ddata->cur;
goto rtn;
+ case 'D':
+ ++ddata->cur;
+ switch (*ddata->cur) {
+ case 'd':
+ /* IEEE 754r decimal floating point (64 bits) */
+ if (!cpp_demangle_push_str(ddata, "decimal64", 9))
+ goto clean;
+ ++ddata->cur;
+ break;
+ case 'e':
+ /* IEEE 754r decimal floating point (128 bits) */
+ if (!cpp_demangle_push_str(ddata, "decimal128", 10))
+ goto clean;
+ ++ddata->cur;
+ break;
+ case 'f':
+ /* IEEE 754r decimal floating point (32 bits) */
+ if (!cpp_demangle_push_str(ddata, "decimal32", 9))
+ goto clean;
+ ++ddata->cur;
+ break;
+ case 'h':
+ /* IEEE 754r half-precision floating point (16 bits) */
+ if (!cpp_demangle_push_str(ddata, "half", 4))
+ goto clean;
+ ++ddata->cur;
+ break;
+ case 'i':
+ /* char32_t */
+ if (!cpp_demangle_push_str(ddata, "char32_t", 8))
+ goto clean;
+ ++ddata->cur;
+ break;
+ case 'n':
+ /* std::nullptr_t (i.e., decltype(nullptr)) */
+ if (!cpp_demangle_push_str(ddata, "decltype(nullptr)",
+ 17))
+ goto clean;
+ ++ddata->cur;
+ break;
+ case 's':
+ /* char16_t */
+ if (!cpp_demangle_push_str(ddata, "char16_t", 8))
+ goto clean;
+ ++ddata->cur;
+ break;
+ case 'v':
+ /* gcc vector_size extension. */
+ ++ddata->cur;
+ if (*ddata->cur == '_') {
+ ++ddata->cur;
+ if (!cpp_demangle_read_expression_flat(ddata,
+ &exp_str))
+ goto clean;
+ if (!vector_str_push(&v.ext_name, exp_str,
+ strlen(exp_str)))
+ goto clean;
+ } else {
+ if (!cpp_demangle_read_number_as_string(ddata,
+ &num_str))
+ goto clean;
+ if (!vector_str_push(&v.ext_name, num_str,
+ strlen(num_str)))
+ goto clean;
+ }
+ if (*ddata->cur != '_')
+ goto clean;
+ ++ddata->cur;
+ if (!vector_type_qualifier_push(&v, TYPE_VEC))
+ goto clean;
+ goto again;
+ default:
+ goto clean;
+ }
+ goto rtn;
+
case 'e':
/* long double */
if (!cpp_demangle_push_str(ddata, "long double", 11))
@@ -2118,7 +2458,7 @@ again:
case 'o':
/* unsigned __int128 */
- if (!cpp_demangle_push_str(ddata, "unsigned _;int128", 17))
+ if (!cpp_demangle_push_str(ddata, "unsigned __int128", 17))
goto clean;
++ddata->cur;
goto rtn;
@@ -2189,6 +2529,8 @@ again:
if (!vector_str_push(&v.ext_name, ddata->cur, len))
return (0);
ddata->cur += len;
+ if (!vector_type_qualifier_push(&v, TYPE_EXT))
+ goto clean;
goto again;
case 'v':
@@ -2253,14 +2595,16 @@ rtn:
goto clean;
free(type_str);
+ free(exp_str);
+ free(num_str);
vector_type_qualifier_dest(&v);
- if (cpp_demangle_gnu3_push_head > 0) {
+ if (ddata->push_head > 0) {
if (*ddata->cur == 'I' && cpp_demangle_read_tmpl_args(ddata)
== 0)
return (0);
- if (--cpp_demangle_gnu3_push_head > 0)
+ if (--ddata->push_head > 0)
return (1);
if (!vector_str_push(&ddata->output_tmp, " ", 1))
@@ -2284,11 +2628,45 @@ rtn:
return (1);
clean:
free(type_str);
+ free(exp_str);
+ free(num_str);
vector_type_qualifier_dest(&v);
return (0);
}
+static int
+cpp_demangle_read_type_flat(struct cpp_demangle_data *ddata, char **str)
+{
+ struct vector_str *output;
+ size_t i, p_idx, idx, type_len;
+ char *type;
+
+ output = ddata->push_head > 0 ? &ddata->output_tmp :
+ &ddata->output;
+
+ p_idx = output->size;
+
+ if (!cpp_demangle_read_type(ddata, 0))
+ return (0);
+
+ if ((type = vector_str_substr(output, p_idx, output->size - 1,
+ &type_len)) == NULL)
+ return (0);
+
+ idx = output->size;
+ for (i = p_idx; i < idx; ++i) {
+ if (!vector_str_pop(output)) {
+ free(type);
+ return (0);
+ }
+ }
+
+ *str = type;
+
+ return (1);
+}
+
/*
* read unqualified-name, unqualified name are operator-name, ctor-dtor-name,
* source-name
diff --git a/contrib/elftoolchain/libelftc/os.Linux.mk b/contrib/elftoolchain/libelftc/os.Linux.mk
index 9730bf6..d99117d 100644
--- a/contrib/elftoolchain/libelftc/os.Linux.mk
+++ b/contrib/elftoolchain/libelftc/os.Linux.mk
@@ -1,3 +1,3 @@
-# $Id: os.Linux.mk 994 2010-06-13 10:39:19Z jkoshy $
+# $Id: os.Linux.mk 3210 2015-05-17 13:40:49Z kaiwang27 $
-CFLAGS+= -Wall
+CFLAGS+= -Wall -D_GNU_SOURCE
diff --git a/contrib/elftoolchain/readelf/readelf.1 b/contrib/elftoolchain/readelf/readelf.1
index a71e85f..701d500 100644
--- a/contrib/elftoolchain/readelf/readelf.1
+++ b/contrib/elftoolchain/readelf/readelf.1
@@ -22,7 +22,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: readelf.1 3195 2015-05-12 17:22:19Z emaste $
+.\" $Id: readelf.1 3219 2015-05-24 23:42:34Z kaiwang27 $
.\"
.Dd September 13, 2012
.Os
@@ -90,7 +90,7 @@ sections in the ELF object.
.It Fl e | Fl -headers
Print all program, file and section headers in the ELF object.
.It Fl g | Fl -section-groups
-This option is recognized, but is ignored.
+Print the contents of the section groups in the ELF object.
.It Fl h | Fl -file-header
Print the file header of the ELF object.
.It Fl l | Fl -program-headers
diff --git a/contrib/elftoolchain/readelf/readelf.c b/contrib/elftoolchain/readelf/readelf.c
index 29bc389..b1b81a3 100644
--- a/contrib/elftoolchain/readelf/readelf.c
+++ b/contrib/elftoolchain/readelf/readelf.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2009-2014 Kai Wang
+ * Copyright (c) 2009-2015 Kai Wang
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,7 @@
#include "_elftc.h"
-ELFTC_VCSID("$Id: readelf.c 3189 2015-04-20 17:02:01Z emaste $");
+ELFTC_VCSID("$Id: readelf.c 3223 2015-05-25 20:37:57Z emaste $");
/*
* readelf(1) options.
@@ -302,6 +302,7 @@ static void dump_gnu_hash(struct readelf *re, struct section *s);
static void dump_hash(struct readelf *re);
static void dump_phdr(struct readelf *re);
static void dump_ppc_attributes(uint8_t *p, uint8_t *pe);
+static void dump_section_groups(struct readelf *re);
static void dump_symtab(struct readelf *re, int i);
static void dump_symtabs(struct readelf *re);
static uint8_t *dump_unknown_tag(uint64_t tag, uint8_t *p);
@@ -445,6 +446,7 @@ elf_machine(unsigned int mach)
case EM_SPARC: return "Sun SPARC";
case EM_386: return "Intel i386";
case EM_68K: return "Motorola 68000";
+ case EM_IAMCU: return "Intel MCU";
case EM_88K: return "Motorola 88000";
case EM_860: return "Intel i860";
case EM_MIPS: return "MIPS R3000 Big-Endian only";
@@ -1050,6 +1052,7 @@ r_type(unsigned int mach, unsigned int type)
switch(mach) {
case EM_NONE: return "";
case EM_386:
+ case EM_IAMCU:
switch(type) {
case 0: return "R_386_NONE";
case 1: return "R_386_32";
@@ -2381,6 +2384,7 @@ dwarf_reg(unsigned int mach, unsigned int reg)
switch (mach) {
case EM_386:
+ case EM_IAMCU:
switch (reg) {
case 0: return "eax";
case 1: return "ecx";
@@ -4047,6 +4051,61 @@ dump_liblist(struct readelf *re)
#undef Elf_Lib
+static void
+dump_section_groups(struct readelf *re)
+{
+ struct section *s;
+ const char *symname;
+ Elf_Data *d;
+ uint32_t *w;
+ int i, j, elferr;
+ size_t n;
+
+ for (i = 0; (size_t) i < re->shnum; i++) {
+ s = &re->sl[i];
+ if (s->type != SHT_GROUP)
+ continue;
+ (void) elf_errno();
+ if ((d = elf_getdata(s->scn, NULL)) == NULL) {
+ elferr = elf_errno();
+ if (elferr != 0)
+ warnx("elf_getdata failed: %s",
+ elf_errmsg(elferr));
+ continue;
+ }
+ if (d->d_size <= 0)
+ continue;
+
+ w = d->d_buf;
+
+ /* We only support COMDAT section. */
+#ifndef GRP_COMDAT
+#define GRP_COMDAT 0x1
+#endif
+ if ((*w++ & GRP_COMDAT) == 0)
+ return;
+
+ if (s->entsize == 0)
+ s->entsize = 4;
+
+ symname = get_symbol_name(re, s->link, s->info);
+ n = s->sz / s->entsize;
+ if (n-- < 1)
+ return;
+
+ printf("\nCOMDAT group section [%5d] `%s' [%s] contains %ju"
+ " sections:\n", i, s->name, symname, (uintmax_t)n);
+ printf(" %-10.10s %s\n", "[Index]", "Name");
+ for (j = 0; (size_t) j < n; j++, w++) {
+ if (*w >= re->shnum) {
+ warnx("invalid section index: %u", *w);
+ continue;
+ }
+ printf(" [%5u] %s\n", *w, re->sl[*w].name);
+ }
+ }
+}
+
static uint8_t *
dump_unknown_tag(uint64_t tag, uint8_t *p)
{
@@ -6838,6 +6897,8 @@ dump_elf(struct readelf *re)
dump_phdr(re);
if (re->options & RE_SS)
dump_shdr(re);
+ if (re->options & RE_G)
+ dump_section_groups(re);
if (re->options & RE_D)
dump_dynamic(re);
if (re->options & RE_R)
@@ -7311,7 +7372,7 @@ Usage: %s [options] file...\n\
-c | --archive-index Print the archive symbol table for archives.\n\
-d | --dynamic Print the contents of SHT_DYNAMIC sections.\n\
-e | --headers Print all headers in the object.\n\
- -g | --section-groups (accepted, but ignored)\n\
+ -g | --section-groups Print the contents of the section groups.\n\
-h | --file-header Print the file header for the object.\n\
-l | --program-headers Print the PHDR table for the object.\n\
-n | --notes Print the contents of SHT_NOTE sections.\n\
@@ -7365,8 +7426,8 @@ main(int argc, char **argv)
re->options |= RE_AA;
break;
case 'a':
- re->options |= RE_AA | RE_D | RE_H | RE_II | RE_L |
- RE_R | RE_SS | RE_S | RE_VV;
+ re->options |= RE_AA | RE_D | RE_G | RE_H | RE_II |
+ RE_L | RE_R | RE_SS | RE_S | RE_VV;
break;
case 'c':
re->options |= RE_C;
diff --git a/contrib/file/ChangeLog b/contrib/file/ChangeLog
index 98cdcc4..0922fc7 100644
--- a/contrib/file/ChangeLog
+++ b/contrib/file/ChangeLog
@@ -1,3 +1,56 @@
+2015-06-11 8:52 Christos Zoulas <christos@zoulas.com>
+
+ * redo long option encoding to fix off-by-one in 5.23
+
+2015-06-10 13:50 Christos Zoulas <christos@zoulas.com>
+
+ * release 5.23
+
+2015-06-09 16:10 Christos Zoulas <christos@zoulas.com>
+
+ * Fix issue with regex range for magic with offset
+ * Always return true from mget with USE (success to mget not match
+ indication). Fixes mime evaluation after USE magic
+ * PR/459: Don't insert magic entries to the list if there are parsing
+ errors for them.
+
+2015-06-03 16:00 Christos Zoulas <christos@zoulas.com>
+
+ * PR/455: Add utf-7 encoding
+
+2015-06-03 14:30 Christos Zoulas <christos@zoulas.com>
+
+ * PR/455: Implement -Z, look inside, but don't report on compression
+ * PR/454: Fix allocation error on bad magic.
+
+2015-05-29 10:30 Christos Zoulas <christos@zoulas.com>
+
+ * handle MAGIC_CONTINUE everywhere, not just in softmagic
+
+2015-05-21 14:30 Christos Zoulas <christos@zoulas.com>
+
+ * don't print descriptions for NAME types when mime.
+
+2015-04-09 15:59 Christos Zoulas <christos@zoulas.com>
+
+ * Add --extension to list the known extensions for this file type
+ Idea by Andrew J Roazen
+
+2015-02-14 12:23 Christos Zoulas <christos@zoulas.com>
+
+ * Bump file search buffer size to 1M.
+
+2015-01-09 14:35 Christos Zoulas <christos@zoulas.com>
+
+ * Fix multiple issues with date formats reported by Christoph Biedl:
+ - T_LOCAL meaning was reversed
+ - Arithmetic did not work
+ Also stop adjusting daylight savings for gmt printing.
+
+2015-01-05 13:00 Christos Zoulas <christos@zoulas.com>
+
+ * PR/411: Fix memory corruption from corrupt cdf file.
+
2015-01-02 15:15 Christos Zoulas <christos@zoulas.com>
* release 5.22
diff --git a/contrib/file/Makefile.in b/contrib/file/Makefile.in
index eed0318..cb2dfc3 100644
--- a/contrib/file/Makefile.in
+++ b/contrib/file/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
@SET_MAKE@
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -77,11 +87,6 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/configure $(am__configure_deps) \
- $(srcdir)/config.h.in AUTHORS COPYING ChangeLog INSTALL NEWS \
- README TODO compile config.guess config.sub depcomp install-sh \
- missing ltmain.sh
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -89,6 +94,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+ $(am__configure_deps) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
@@ -152,6 +159,9 @@ ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \
+ COPYING ChangeLog INSTALL NEWS README TODO compile \
+ config.guess config.sub depcomp install-sh ltmain.sh missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@@ -336,7 +346,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -567,15 +576,15 @@ dist-xz: distdir
$(am__post_remove_distdir)
dist-tarZ: distdir
- @echo WARNING: "Support for shar distribution archives is" \
- "deprecated." >&2
+ @echo WARNING: "Support for distribution archives compressed with" \
+ "legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
- @echo WARNING: "Support for distribution archives compressed with" \
- "legacy program 'compress' is deprecated." >&2
+ @echo WARNING: "Support for shar distribution archives is" \
+ "deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
@@ -611,16 +620,17 @@ distcheck: dist
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
- mkdir $(distdir)/_build $(distdir)/_inst
+ mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
- && $(am__cd) $(distdir)/_build \
- && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ && $(am__cd) $(distdir)/_build/sub \
+ && ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
+ --srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
@@ -797,6 +807,8 @@ uninstall-am:
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am
+.PRECIOUS: Makefile
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/contrib/file/TODO b/contrib/file/TODO
index eef01ed..5c2ed49 100644
--- a/contrib/file/TODO
+++ b/contrib/file/TODO
@@ -17,3 +17,6 @@ hard-wired routines). In this regard, note that hplip, which is
BSD-licensed, has a magic reimplementation in Python.
Read the kerberos magic entry for more ideas.
+
+Write a string merger to make magic entry sizes dynamic.
+Strings will be converted to offsets from the string table.
diff --git a/contrib/file/aclocal.m4 b/contrib/file/aclocal.m4
index a9ddc4b..4398374 100644
--- a/contrib/file/aclocal.m4
+++ b/contrib/file/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.14 -*- Autoconf -*-
+# generated automatically by aclocal 1.15 -*- Autoconf -*-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -21,7 +21,7 @@ If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
# visibility.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2005, 2008, 2010-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2008, 2010-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -98,7 +98,7 @@ AC_DEFUN([gl_VISIBILITY],
[Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
])
-# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -110,10 +110,10 @@ AC_DEFUN([gl_VISIBILITY],
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.14'
+[am__api_version='1.15'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.14], [],
+m4_if([$1], [1.15], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -129,14 +129,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.14])dnl
+[AM_AUTOMAKE_VERSION([1.15])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -181,15 +181,14 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -220,7 +219,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -411,7 +410,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -487,7 +486,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -577,8 +576,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver). The
+# system "awk" is bad on some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
@@ -651,7 +650,11 @@ to "yes", and re-run configure.
END
AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
fi
-fi])
+fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
+])
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
@@ -680,7 +683,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -691,7 +694,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -701,7 +704,7 @@ if test x"${install_sh}" != xset; then
fi
AC_SUBST([install_sh])])
-# Copyright (C) 2003-2013 Free Software Foundation, Inc.
+# Copyright (C) 2003-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -722,7 +725,7 @@ AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -772,7 +775,7 @@ rm -f confinc confmf
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -811,7 +814,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -840,7 +843,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -887,7 +890,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -906,7 +909,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -987,7 +990,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
-# Copyright (C) 2009-2013 Free Software Foundation, Inc.
+# Copyright (C) 2009-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1047,7 +1050,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1075,7 +1078,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006-2013 Free Software Foundation, Inc.
+# Copyright (C) 2006-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1094,7 +1097,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004-2013 Free Software Foundation, Inc.
+# Copyright (C) 2004-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/contrib/file/compile b/contrib/file/compile
index 531136b..a85b723 100755
--- a/contrib/file/compile
+++ b/contrib/file/compile
@@ -3,7 +3,7 @@
scriptversion=2012-10-14.11; # UTC
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
diff --git a/contrib/file/config.h.in b/contrib/file/config.h.in
index 066bd2f..0397fe4 100644
--- a/contrib/file/config.h.in
+++ b/contrib/file/config.h.in
@@ -62,6 +62,9 @@
/* Define to 1 if you have the `getpagesize' function. */
#undef HAVE_GETPAGESIZE
+/* Define to 1 if you have the `gmtime_r' function. */
+#undef HAVE_GMTIME_R
+
/* Define to 1 if the system has the type `intptr_t'. */
#undef HAVE_INTPTR_T
@@ -80,6 +83,9 @@
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
+/* Define to 1 if you have the `localtime_r' function. */
+#undef HAVE_LOCALTIME_R
+
/* Define to 1 if mbrtowc and mbstate_t are properly declared. */
#undef HAVE_MBRTOWC
@@ -107,6 +113,12 @@
/* Define to 1 if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
+/* Define to 1 if you have the <signal.h> header file. */
+#undef HAVE_SIGNAL_H
+
+/* Have sig_t type */
+#undef HAVE_SIG_T
+
/* Define to 1 if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
diff --git a/contrib/file/configure b/contrib/file/configure
index 3cf1d77..e77c3b0 100755
--- a/contrib/file/configure
+++ b/contrib/file/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for file 5.22.
+# Generated by GNU Autoconf 2.69 for file 5.23.
#
# Report bugs to <christos@astron.com>.
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='file'
PACKAGE_TARNAME='file'
-PACKAGE_VERSION='5.22'
-PACKAGE_STRING='file 5.22'
+PACKAGE_VERSION='5.23'
+PACKAGE_STRING='file 5.23'
PACKAGE_BUGREPORT='christos@astron.com'
PACKAGE_URL=''
@@ -1327,7 +1327,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures file 5.22 to adapt to many kinds of systems.
+\`configure' configures file 5.23 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1397,7 +1397,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of file 5.22:";;
+ short | recursive ) echo "Configuration of file 5.23:";;
esac
cat <<\_ACEOF
@@ -1507,7 +1507,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-file configure 5.22
+file configure 5.23
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2163,7 +2163,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by file $as_me 5.22, which was
+It was created by file $as_me 5.23, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2514,7 +2514,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-am__api_version='1.14'
+am__api_version='1.15'
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -2715,8 +2715,8 @@ test "$program_suffix" != NONE &&
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
@@ -2735,7 +2735,7 @@ else
$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -3029,7 +3029,7 @@ fi
# Define the identity of the package.
PACKAGE='file'
- VERSION='5.22'
+ VERSION='5.23'
cat >>confdefs.h <<_ACEOF
@@ -3063,8 +3063,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
mkdir_p='$(MKDIR_P)'
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver). The
+# system "awk" is bad on some platforms.
# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AMTAR='$${TAR-tar}'
@@ -3121,6 +3121,7 @@ END
as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
fi
fi
+
# Check whether --enable-silent-rules was given.
if test "${enable_silent_rules+set}" = set; then :
enableval=$enable_silent_rules;
@@ -12785,7 +12786,7 @@ fi
done
-for ac_header in getopt.h err.h xlocale.h
+for ac_header in getopt.h err.h xlocale.h signal.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -12823,6 +12824,17 @@ fi
done
+ac_fn_c_check_type "$LINENO" "sig_t" "ac_cv_type_sig_t" "
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+"
+if test "x$ac_cv_type_sig_t" = xyes; then :
+
+$as_echo "#define HAVE_SIG_T 1" >>confdefs.h
+
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
@@ -14308,6 +14320,32 @@ esac
fi
+ac_fn_c_check_func "$LINENO" "localtime_r" "ac_cv_func_localtime_r"
+if test "x$ac_cv_func_localtime_r" = xyes; then :
+ $as_echo "#define HAVE_LOCALTIME_R 1" >>confdefs.h
+
+else
+ case " $LIBOBJS " in
+ *" localtime_r.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS localtime_r.$ac_objext"
+ ;;
+esac
+
+fi
+
+ac_fn_c_check_func "$LINENO" "gmtime_r" "ac_cv_func_gmtime_r"
+if test "x$ac_cv_func_gmtime_r" = xyes; then :
+ $as_echo "#define HAVE_GMTIME_R 1" >>confdefs.h
+
+else
+ case " $LIBOBJS " in
+ *" gmtime_r.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS gmtime_r.$ac_objext"
+ ;;
+esac
+
+fi
+
ac_fn_c_check_func "$LINENO" "pread" "ac_cv_func_pread"
if test "x$ac_cv_func_pread" = xyes; then :
$as_echo "#define HAVE_PREAD 1" >>confdefs.h
@@ -14998,7 +15036,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by file $as_me 5.22, which was
+This file was extended by file $as_me 5.23, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -15064,7 +15102,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-file config.status 5.22
+file config.status 5.23
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/contrib/file/configure.ac b/contrib/file/configure.ac
index 1e2457c..857b7fe 100644
--- a/contrib/file/configure.ac
+++ b/contrib/file/configure.ac
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT([file],[5.22],[christos@astron.com])
+AC_INIT([file],[5.23],[christos@astron.com])
AM_INIT_AUTOMAKE([subdir-objects foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
@@ -82,9 +82,13 @@ AC_HEADER_MAJOR
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(stdint.h fcntl.h locale.h stdint.h inttypes.h unistd.h)
AC_CHECK_HEADERS(stddef.h utime.h wchar.h wctype.h limits.h)
-AC_CHECK_HEADERS(getopt.h err.h xlocale.h)
+AC_CHECK_HEADERS(getopt.h err.h xlocale.h signal.h)
AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h)
AC_CHECK_HEADERS(zlib.h)
+AC_CHECK_TYPE([sig_t],[AC_DEFINE([HAVE_SIG_T],1,[Have sig_t type])],,[
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
@@ -141,7 +145,7 @@ dnl Checks for functions
AC_CHECK_FUNCS(strerror strndup strtoul mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale setlocale)
dnl Provide implementation of some required functions if necessary
-AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline ctime_r asctime_r pread strcasestr fmtcheck)
+AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline ctime_r asctime_r localtime_r gmtime_r pread strcasestr fmtcheck)
dnl Checks for libraries
AC_CHECK_LIB(z,gzopen)
diff --git a/contrib/file/depcomp b/contrib/file/depcomp
index 4ebd5b3..fc98710 100755
--- a/contrib/file/depcomp
+++ b/contrib/file/depcomp
@@ -3,7 +3,7 @@
scriptversion=2013-05-30.07; # UTC
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/contrib/file/doc/Makefile.in b/contrib/file/doc/Makefile.in
index 8d0fa7b..165918a 100644
--- a/contrib/file/doc/Makefile.in
+++ b/contrib/file/doc/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
@SET_MAKE@
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -77,7 +87,6 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = doc
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -85,6 +94,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@@ -144,6 +154,7 @@ man5dir = $(mandir)/man5
NROFF = nroff
MANS = $(man_MANS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
@@ -286,7 +297,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign doc/Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -642,6 +652,8 @@ uninstall-man: uninstall-man1 uninstall-man3 uninstall-man4 \
tags-am uninstall uninstall-am uninstall-man uninstall-man1 \
uninstall-man3 uninstall-man4 uninstall-man5
+.PRECIOUS: Makefile
+
file.1: Makefile file.man
@rm -f $@
diff --git a/contrib/file/doc/file.man b/contrib/file/doc/file.man
index 109c676..d4d3e58 100644
--- a/contrib/file/doc/file.man
+++ b/contrib/file/doc/file.man
@@ -1,5 +1,5 @@
-.\" $File: file.man,v 1.111 2014/12/16 23:18:40 christos Exp $
-.Dd December 16, 2014
+.\" $File: file.man,v 1.117 2015/06/03 19:51:27 christos Exp $
+.Dd June 3, 2015
.Dt FILE __CSECTION__
.Os
.Sh NAME
@@ -8,8 +8,9 @@
.Sh SYNOPSIS
.Nm
.Bk -words
-.Op Fl bcEhiklLNnprsvz0
+.Op Fl bcEhiklLNnprsvzZ0
.Op Fl Fl apple
+.Op Fl Fl extension
.Op Fl Fl mime-encoding
.Op Fl Fl mime-type
.Op Fl e Ar testname
@@ -213,6 +214,8 @@ Consults magic files.
.It tar
Examines tar files.
.El
+.It Fl Fl extension
+Print a slash-separated list of valid extensions for the file type found.
.It Fl F , Fl Fl separator Ar separator
Use the specified string as the separator between the filename and the
file result returned.
@@ -343,6 +346,9 @@ since on some systems it reports a zero size for raw disk partitions.
Print the version of the program and exit.
.It Fl z , Fl Fl uncompress
Try to look inside compressed files.
+.It Fl Z , Fl Fl uncompress-noreport
+Try to look inside compressed files, but report information about the contents
+only not the compression.
.It Fl 0 , Fl Fl print0
Output a null character
.Sq \e0
@@ -587,20 +593,30 @@ last-pushed (most specific, one hopes) value at the end, or
use a default if the list is empty.
This should not slow down evaluation.
.Pp
+The handling of
+.Dv MAGIC_CONTINUE
+and printing \e012- between entries is clumsy and complicated; refactor
+and centralize.
+.Pp
+Some of the encoding logic is hard-coded in encoding.c and can be moved
+to the magic files if we had a !:charset annotation
+.Pp
Continue to squash all magic bugs.
See Debian BTS for a good source.
.Pp
Store arbitrarily long strings, for example for %s patterns, so that
they can be printed out.
Fixes Debian bug #271672.
-Would require more complex store/load code in apprentice.
+This can be done by allocating strings in a string pool, storing the
+string pool at the end of the magic file and converting all the string
+pointers to relative offsets from the string pool.
.Pp
Add syntax for relative offsets after current level (Debian bug #466037).
.Pp
Make file -ki work, i.e. give multiple MIME types.
.Pp
Add a zip library so we can peek inside Office2007 documents to
-figure out what they are.
+print more details about their contents.
.Pp
Add an option to print URLs for the sources of the file descriptions.
.Pp
@@ -610,6 +626,9 @@ string to be looked up in a table).
This would avoid adding the same magic repeatedly for each new
hash-bang interpreter.
.Pp
+When a file descriptor is available, we can skip and adjust the buffer
+instead of the hacky buffer management we do now.
+.Pp
Fix
.Dq name
and
@@ -627,6 +646,15 @@ Make
more efficient by keeping a sorted list of names.
Special-case ^ to flip endianness in the parser so that it does not
have to be escaped, and document it.
+.Pp
+If the offsets specified internally in the file exceed the buffer size
+(
+.Dv HOWMANY
+variable in file.h), then we don't seek to that offset, but we give up.
+It would be better if buffer managements was done when the file descriptor
+is available so move around the file.
+One must be careful though because this has performance (and thus security
+considerations).
.Sh AVAILABILITY
You can obtain the original author's latest version by anonymous FTP
on
diff --git a/contrib/file/doc/libmagic.man b/contrib/file/doc/libmagic.man
index 3c907ca..64170a3 100644
--- a/contrib/file/doc/libmagic.man
+++ b/contrib/file/doc/libmagic.man
@@ -1,4 +1,4 @@
-.\" $File: libmagic.man,v 1.34 2014/12/16 23:18:40 christos Exp $
+.\" $File: libmagic.man,v 1.37 2015/06/03 18:21:24 christos Exp $
.\"
.\" Copyright (c) Christos Zoulas 2003.
.\" All Rights Reserved.
@@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd December 16, 2014
+.Dd June 3, 2015
.Dt LIBMAGIC 3
.Os
.Sh NAME
@@ -132,6 +132,10 @@ Treat operating system errors while trying to open files and follow symlinks
as real errors, instead of printing them in the magic buffer.
.It Dv MAGIC_APPLE
Return the Apple creator and type.
+.It Dv MAGIC_EXTENSION
+Return a slash-separated list of extensions for this file type.
+.It Dv MAGIC_COMPRESS_TRANSP
+Don't report on compression, only report about the uncompressed data.
.It Dv MAGIC_NO_CHECK_APPTYPE
Don't check for
.Dv EMX
diff --git a/contrib/file/ltmain.sh b/contrib/file/ltmain.sh
index f53abfd..f07ffc8 100755
--- a/contrib/file/ltmain.sh
+++ b/contrib/file/ltmain.sh
@@ -6900,7 +6900,11 @@ func_mode_link ()
# Finalize command for both is simple: just hardcode it.
if test "$hardcode_direct" = yes &&
test "$hardcode_direct_absolute" = no; then
- add="$libdir/$linklib"
+ if test -f "$inst_prefix_dir$libdir/$linklib"; then
+ add="$inst_prefix_dir$libdir/$linklib"
+ else
+ add="$libdir/$linklib"
+ fi
elif test "$hardcode_minus_L" = yes; then
add_dir="-L$libdir"
add="-l$name"
diff --git a/contrib/file/magic/Magdir/android b/contrib/file/magic/Magdir/android
index da98b57..7675c1c 100644
--- a/contrib/file/magic/Magdir/android
+++ b/contrib/file/magic/Magdir/android
@@ -1,6 +1,6 @@
#------------------------------------------------------------
-# $File: android,v 1.7 2014/11/10 05:08:23 christos Exp $
+# $File: android,v 1.8 2015/03/19 18:04:37 christos Exp $
# Various android related magic entries
#------------------------------------------------------------
@@ -137,3 +137,9 @@
>16 lelong x \b, Total of %d
>12 lelong x \b %d-byte output blocks in
>20 lelong x \b %d input chunks.
+
+# Android binary XML magic
+# In include/androidfw/ResourceTypes.h:
+# RES_XML_TYPE = 0x0003 followed by the size of the header (ResXMLTree_header),
+# which is 8 bytes (2 bytes type + 2 bytes header size + 4 bytes size).
+0 lelong 0x00080003 Android binary XML
diff --git a/contrib/file/magic/Magdir/apple b/contrib/file/magic/Magdir/apple
index e3dd059..dcfa878 100644
--- a/contrib/file/magic/Magdir/apple
+++ b/contrib/file/magic/Magdir/apple
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: apple,v 1.29 2014/04/30 21:41:02 christos Exp $
+# $File: apple,v 1.30 2015/04/13 13:09:06 christos Exp $
# apple: file(1) magic for Apple file formats
#
0 search/1/t FiLeStArTfIlEsTaRt binscii (apple ][) text
@@ -300,3 +300,12 @@
#http://wiki.mozilla.org/DS_Store_File_Format`
#http://en.wikipedia.org/wiki/.DS_Store
0 string \0\0\0\1Bud1\0 Apple Desktop Services Store
+
+# HFS/HFS+ Resource fork files (andrew.roazen@nau.edu Apr 13 2015)
+# Usually not in separate files, but have either filename rsrc with
+# no extension, or a filename corresponding to another file, with
+# extensions rsr/rsrc
+0 string \000\000\001\000
+>4 leshort 0
+>>16 lelong 0 Apple HFS/HFS+ resource fork
+
diff --git a/contrib/file/magic/Magdir/archive b/contrib/file/magic/Magdir/archive
index 4ef73a7..30cced0 100644
--- a/contrib/file/magic/Magdir/archive
+++ b/contrib/file/magic/Magdir/archive
@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
-# $File: archive,v 1.88 2014/08/16 10:42:17 christos Exp $
+# $File: archive,v 1.90 2015/04/24 15:44:12 christos Exp $
# archive: file(1) magic for archive formats (see also "msdos" for self-
# extracting compressed archives)
#
@@ -714,7 +714,7 @@
>>>4 byte 0x0a \b, at least v1.0 to extract
>>>4 byte 0x0b \b, at least v1.1 to extract
>>>4 byte 0x14 \b, at least v2.0 to extract
->>>4 byte 0x2d \b, at least v3.0 to extract
+>>>4 byte 0x2d \b, at least v4.5 to extract
>>>0x161 string WINZIP \b, WinZIP self-extracting
# StarView Metafile
@@ -911,6 +911,9 @@
# ZPAQ: http://mattmahoney.net/dc/zpaq.html
0 string zPQ ZPAQ stream
>3 byte x \b, level %d
+# From: Barry Carter <carter.barry@gmail.com>
+# http://encode.ru/threads/456-zpaq-updates/page32
+0 string 7kSt ZPAQ file
# BBeB ebook, unencrypted (LRF format)
# URL: http://www.sven.de/librie/Librie/LrfFormat
diff --git a/contrib/file/magic/Magdir/audio b/contrib/file/magic/Magdir/audio
index 338d8ae..e1d52c2 100644
--- a/contrib/file/magic/Magdir/audio
+++ b/contrib/file/magic/Magdir/audio
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: audio,v 1.71 2014/05/14 23:30:28 christos Exp $
+# $File: audio,v 1.73 2015/03/15 23:21:42 christos Exp $
# audio: file(1) magic for sound formats (see also "iff")
#
# Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com),
@@ -300,7 +300,7 @@
>>5 byte &0x40 \b, extended header
>>5 byte &0x20 \b, experimental
>>5 byte &0x10 \b, footer present
->(6.I) indirect x \b, contains:
+>(6.I+10) indirect x \b, contains:
# NSF (NES sound file) magic
0 string NESM\x1a NES Sound File
@@ -313,6 +313,21 @@
>122 byte&0x1 =1 PAL
>122 byte&0x1 =0 NTSC
+# NSFE (Extended NES sound file) magic
+# http://slickproductions.org/docs/NSF/nsfespec.txt
+# From: David Pflug <david@pflug.email>
+0 string NSFE Extended NES Sound File
+>48 search/0x1000 auth
+>>&0 string >\0 ("%s"
+>>>&1 string >\0 by %s
+>>>>&1 string >\0 \b, copyright %s
+>>>>>&1 string >\0 \b, ripped by %s
+>20 byte x \b), %d tracks,
+>18 byte&0x2 =1 dual PAL/NTSC
+>18 byte&0x2 =0
+>>18 byte&0x1 =1 PAL
+>>18 byte&0x1 =0 NTSC
+
# Type: SNES SPC700 sound files
# From: Josh Triplett <josh@freedesktop.org>
0 string SNES-SPC700\ Sound\ File\ Data\ v SNES SPC700 sound file
diff --git a/contrib/file/magic/Magdir/cafebabe b/contrib/file/magic/Magdir/cafebabe
index 4c58fc6..51e97c4 100644
--- a/contrib/file/magic/Magdir/cafebabe
+++ b/contrib/file/magic/Magdir/cafebabe
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: cafebabe,v 1.17 2015/01/01 17:07:00 christos Exp $
+# $File: cafebabe,v 1.20 2015/05/29 14:21:58 christos Exp $
# Cafe Babes unite!
#
# Since Java bytecode and Mach-O universal binaries have the same magic number,
@@ -28,6 +28,8 @@
>>4 belong 0x0030 (Java 1.4)
>>4 belong 0x0031 (Java 1.5)
>>4 belong 0x0032 (Java 1.6)
+>>4 belong 0x0033 (Java 1.7)
+>>4 belong 0x0034 (Java 1.8)
0 belong 0xcafed00d JAR compressed with pack200,
>5 byte x version %d.
@@ -50,14 +52,18 @@
0 belong 0xcafebabe
>4 belong 1 Mach-O universal binary with 1 architecture:
+!:mime application/x-mach-binary
>>8 use mach-o \b
>4 belong >1
>>4 belong <20 Mach-O universal binary with %d architectures:
+!:mime application/x-mach-binary
>>>8 use mach-o \b
>>>28 use mach-o \b
->>4 belong >2
+>>4 belong 2
>>>48 use mach-o \b
->>4 belong >3
+>>4 belong 3
>>>68 use mach-o \b
+>>4 belong 4
+>>>88 use mach-o \b
### MACH-O END ###
diff --git a/contrib/file/magic/Magdir/cbor b/contrib/file/magic/Magdir/cbor
new file mode 100644
index 0000000..c780dc6
--- /dev/null
+++ b/contrib/file/magic/Magdir/cbor
@@ -0,0 +1,21 @@
+
+#------------------------------------------------------------------------------
+# $File: cbor,v 1.1 2015/01/28 01:05:21 christos Exp $
+# cbor: file(1) magic for CBOR files as defined in RFC 7049
+
+0 string \xd9\xd9\xf7 Concise Binary Object Representation (CBOR) container
+!:mime application/cbor
+>3 ubyte <0x20 (positive integer)
+>3 ubyte <0x40
+>>3 ubyte >0x1f (negative integer)
+>3 ubyte <0x60
+>>3 ubyte >0x3f (byte string)
+>3 ubyte <0x80
+>>3 ubyte >0x5f (text string)
+>3 ubyte <0xa0
+>3 ubyte >0x7f (array)
+>3 ubyte <0xc0
+>>3 ubyte >0x9f (map)
+>3 ubyte <0xe0
+>>3 ubyte >0xbf (tagged)
+>3 ubyte >0xdf (other)
diff --git a/contrib/file/magic/Magdir/commands b/contrib/file/magic/Magdir/commands
index 3d97489..153af5e 100644
--- a/contrib/file/magic/Magdir/commands
+++ b/contrib/file/magic/Magdir/commands
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: commands,v 1.51 2014/09/27 00:12:55 christos Exp $
+# $File: commands,v 1.52 2015/06/04 19:16:55 christos Exp $
# commands: file(1) magic for various shells and interpreters
#
#0 string/w : shell archive or script for antique kernel text
@@ -78,6 +78,8 @@
!:mime text/x-shellscript
0 string/wb #!\ /usr/local/bin/bash Bourne-Again shell script executable (binary data)
!:mime text/x-shellscript
+0 string/wt #!\ /usr/bin/env\ bash Bourne-Again shell script text executable
+!:mime text/x-shellscript
# PHP scripts
# Ulf Harnhammar <ulfh@update.uu.se>
diff --git a/contrib/file/magic/Magdir/compress b/contrib/file/magic/Magdir/compress
index beb8ebe..c2266d4 100644
--- a/contrib/file/magic/Magdir/compress
+++ b/contrib/file/magic/Magdir/compress
@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
-# $File: compress,v 1.62 2014/09/13 14:27:12 christos Exp $
+# $File: compress,v 1.63 2015/03/11 19:27:35 christos Exp $
# compress: file(1) magic for pure-compression formats (no archives)
#
# compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc.
@@ -201,6 +201,7 @@
# http://tukaani.org/xz/xz-file-format.txt
0 ustring \xFD7zXZ\x00 XZ compressed data
+!:strength * 2
!:mime application/x-xz
# https://github.com/ckolivas/lrzip/blob/master/doc/magic.header.txt
diff --git a/contrib/file/magic/Magdir/console b/contrib/file/magic/Magdir/console
index 27227a4..9dee3ff 100644
--- a/contrib/file/magic/Magdir/console
+++ b/contrib/file/magic/Magdir/console
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: console,v 1.19 2013/02/06 14:18:52 christos Exp $
+# $File: console,v 1.20 2015/03/15 23:21:42 christos Exp $
# Console game magic
# Toby Deshane <hac@shoelace.digivill.net>
# ines: file(1) magic for Marat's iNES Nintendo Entertainment System
@@ -177,9 +177,19 @@
# From: Serge van den Boom <svdb@stack.nl>
0 string \x01ZZZZZ\x01 3DO "Opera" file system
-# From Gurkan Sengun <gurkan@linuks.mine.nu>, www.linuks.mine.nu
+# From: Gurkan Sengun <gurkan@linuks.mine.nu>, www.linuks.mine.nu
+# From: David Pflug <david@pflug.email>
+# is the offset 12 or the offset 16 correct?
+# GBS (Game Boy Sound) magic
+# ftp://ftp.modland.com/pub/documents/format_documentation/\
+# Gameboy%20Sound%20System%20(.gbs).txt
0 string GBS Nintendo Gameboy Music/Audio Data
-12 string GameBoy\ Music\ Module Nintendo Gameboy Music Module
+#12 string GameBoy\ Music\ Module Nintendo Gameboy Music Module
+>16 string >\0 ("%s" by
+>48 string >\0 %s, copyright
+>80 string >\0 %s),
+>3 byte x version %d,
+>4 byte x %d tracks
# Playstations Patch Files from: From: Thomas Klausner <tk@giga.or.at>
0 string PPF30 Playstation Patch File version 3.0
diff --git a/contrib/file/magic/Magdir/dyadic b/contrib/file/magic/Magdir/dyadic
index 18f18bc..ab73465 100644
--- a/contrib/file/magic/Magdir/dyadic
+++ b/contrib/file/magic/Magdir/dyadic
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: dyadic,v 1.6 2014/06/01 19:14:42 christos Exp $
+# $File: dyadic,v 1.7 2015/05/27 18:02:48 christos Exp $
# Dyadic: file(1) magic for Dyalog APL.
#
# updated by Joerg Jenderek at Oct 2013
@@ -46,6 +46,11 @@
>>>1 byte 0x12 component file 64-bit level 3 journaled checksummed
>>>1 byte 0x13 component file 32-bit non-journaled checksummed
>>>1 byte 0x14 component file 64-bit non-journaled checksummed
+>>>1 byte 0x15 component file under construction
+>>>1 byte 0x16 DFS component file 64-bit level 1 journaled checksummed
+>>>1 byte 0x17 DFS component file 64-bit level 2 journaled checksummed
+>>>1 byte 0x18 DFS component file 64-bit level 3 journaled checksummed
+>>>1 byte 0x19 external workspace
>>>1 byte 0x80 DDB
>>>2 byte x version %d
>>>3 byte x \b.%d
diff --git a/contrib/file/magic/Magdir/filesystems b/contrib/file/magic/Magdir/filesystems
index 939a092..d8a802a 100644
--- a/contrib/file/magic/Magdir/filesystems
+++ b/contrib/file/magic/Magdir/filesystems
@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
-# $File: filesystems,v 1.108 2015/01/01 17:43:47 christos Exp $
+# $File: filesystems,v 1.109 2015/02/22 01:22:54 christos Exp $
# filesystems: file(1) magic for different filesystems
#
0 name partid
@@ -1928,6 +1928,7 @@
>>38917 string 3 (version 2.0)
>>38917 byte >0x33 (unknown version, ID 0x%X)
>>38917 byte <0x31 (unknown version, ID 0x%X)
+>0x1FE leshort 0xAA55 (DOS/MBR boot sector)
# "application id" which appears to be used as a volume label
>32808 string/T >\0 '%s'
>34816 string \000CD001\001EL\ TORITO\ SPECIFICATION (bootable)
diff --git a/contrib/file/magic/Magdir/gnu b/contrib/file/magic/Magdir/gnu
index e4a0a16..c94cefc 100644
--- a/contrib/file/magic/Magdir/gnu
+++ b/contrib/file/magic/Magdir/gnu
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: gnu,v 1.15 2014/02/06 14:21:02 christos Exp $
+# $File: gnu,v 1.16 2015/04/19 22:59:25 christos Exp $
# gnu: file(1) magic for various GNU tools
#
# GNU nlsutils message catalog file format
@@ -79,5 +79,7 @@
0 long 0x950412DE GNU-format message catalog data
# gettext message catalogue
-0 regex \^msgid\ GNU gettext message catalogue text
+0 search/1024 \nmsgid
+>&0 search/1024 \nmsgstr GNU gettext message catalogue text
+!:strength +100
!:mime text/x-po
diff --git a/contrib/file/magic/Magdir/images b/contrib/file/magic/Magdir/images
index 672dd88..e6dd414 100644
--- a/contrib/file/magic/Magdir/images
+++ b/contrib/file/magic/Magdir/images
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: images,v 1.102 2015/01/02 02:36:35 christos Exp $
+# $File: images,v 1.106 2015/02/22 01:26:05 christos Exp $
# images: file(1) magic for image formats (see also "iff", and "c-lang" for
# XPM bitmaps)
#
@@ -36,42 +36,48 @@
# PBMPLUS images
# The next byte following the magic is always whitespace.
# strength is changed to try these patterns before "x86 boot sector"
+0 name netpbm
+>3 regex/s =[0-9]{1,50}\ [0-9]{1,50} Netpbm PPM image data
+>>&0 regex =[0-9]{1,50} \b, size = %s x
+>>>&0 regex =[0-9]{1,50} \b %s
+
0 search/1 P1
->3 regex =[0-9]{0,50}\ [0-9]{0,50} Netpbm PBM image text
->3 regex =[0-9]{1,50}\ \b, size = %sx
->>3 regex =\ [0-9]{1,50} \b%s
+>0 use netpbm
+>>0 string x \b, bitmap
!:strength + 45
!:mime image/x-portable-bitmap
+
0 search/1 P2
->3 regex =[0-9]{0,50}\ [0-9]{0,50} Netpbm PGM image text
->3 regex =[0-9]{1,50}\ \b, size = %sx
->>3 regex =\ [0-9]{1,50} \b%s
+>0 use netpbm
+>>0 string x \b, greymap
!:strength + 45
!:mime image/x-portable-greymap
+
0 search/1 P3
->3 regex =[0-9]{0,50}\ [0-9]{0,50} Netpbm PPM image text
->3 regex =[0-9]{1,50}\ \b, size = %sx
->>3 regex =\ [0-9]{1,50} \b%s
+>0 use netpbm
+>>0 string x \b, pixmap
!:strength + 45
!:mime image/x-portable-pixmap
+
+
0 string P4
->3 regex =[0-9]{0,50}\ [0-9]{0,50} Netpbm PBM "rawbits" image data
->3 regex =[0-9]{1,50}\ \b, size = %sx
->>3 regex =\ [0-9]{1,50} \b%s
+>0 use netpbm
+>>0 string x \b, rawbits, bitmap
!:strength + 45
!:mime image/x-portable-bitmap
+
0 string P5
->3 regex =[0-9]{0,50}\ [0-9]{0,50} Netpbm PGM "rawbits" image data
->3 regex =[0-9]{1,50}\ \b, size = %sx
->>3 regex =\ [0-9]{1,50} \b%s
+>0 use netpbm
+>>0 string x \b, rawbits, greymap
!:strength + 45
!:mime image/x-portable-greymap
+
0 string P6
->3 regex =[0-9]{0,50}\ [0-9]{0,50} Netpbm PPM "rawbits" image data
->3 regex =[0-9]{1,50}\ \b, size = %sx
->>3 regex =\ [0-9]{1,50} \b%s
+>0 use netpbm
+>>0 string x \b, rawbits, pixmap
!:strength + 45
!:mime image/x-portable-pixmap
+
0 string P7 Netpbm PAM image file
!:mime image/x-portable-pixmap
@@ -167,6 +173,7 @@
>>>>8 leshort x \b(unknown 0x%x)
>>>12 use tiff_entry
>0 leshort 0x106 \b, PhotometricIntepretation=
+>>8 clear x
>>8 leshort 0 \bWhiteIsZero
>>8 leshort 1 \bBlackIsZero
>>8 leshort 2 \bRGB
@@ -175,6 +182,7 @@
>>8 leshort 5 \bCMYK
>>8 leshort 6 \bYCbCr
>>8 leshort 8 \bCIELab
+>>8 default x
>>>8 leshort x \b(unknown=0x%x)
>>12 use tiff_entry
# FillOrder
@@ -678,7 +686,26 @@
>25 string >\0 dated %.14s
# GEM Image: Version 1, Headerlen 8 (Wolfram Kleff)
-0 belong 0x00010008 GEM Image data
+# Format variations from: Bernd Nuernberger <bernd.nuernberger@web.de>
+# See http://fileformats.archiveteam.org/wiki/GEM_Raster
+# For variations, also see:
+# http://www.seasip.info/Gem/ff_img.html (Ventura)
+# http://www.atari-wiki.com/?title=IMG_file (XIMG, STTT)
+# http://www.fileformat.info/format/gemraster/spec/index.htm (XIMG, STTT)
+# http://sylvana.net/1stguide/1STGUIDE.ENG (TIMG)
+0 beshort 0x0001
+>2 beshort 0x0008 GEM Image data
+>>0 use gem_info
+>2 beshort 0x0009 GEM Image data (Ventura)
+>>0 use gem_info
+16 string XIMG\0 GEM XIMG Image data
+>0 use gem_info
+16 string STTT\0\x10 GEM STTT Image data
+>0 use gem_info
+16 string TIMG\0 GEM TIMG Image data
+>0 use gem_info
+
+0 name gem_info
>12 beshort x %d x
>14 beshort x %d,
>4 beshort x %d planes,
@@ -1036,11 +1063,6 @@
# From: "Tano M. Fotang" <mfotang@quanteq.com>
0 string \x46\x4d\x52\x00 ISO/IEC 19794-2 Format Minutiae Record (FMR)
-# WEBP https://developers.google.com/speed/webp/docs/riff_container
-#0 string RIFF
-#>8 string WEBP Web/P image data
-#>>4 lelong x \b, %d bytes
-
# doc: http://www.shikino.co.jp/eng/products/images/FLOWER.jpg.zip
# example: http://www.shikino.co.jp/eng/products/images/FLOWER.wdp.zip
90 bequad 0x574D50484F544F00 JPEG-XR Image
diff --git a/contrib/file/magic/Magdir/jpeg b/contrib/file/magic/Magdir/jpeg
index cfe8973..b20b19f 100644
--- a/contrib/file/magic/Magdir/jpeg
+++ b/contrib/file/magic/Magdir/jpeg
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: jpeg,v 1.25 2015/01/02 16:56:50 christos Exp $
+# $File: jpeg,v 1.29 2015/04/10 15:36:02 christos Exp $
# JPEG images
# SunOS 5.5.1 had
#
@@ -12,7 +12,8 @@
0 beshort 0xffd8 JPEG image data
!:mime image/jpeg
!:apple 8BIMJPEG
-!:strength +2
+!:strength *3
+!:ext jpeg/jpg/jpe/jfif
>6 string JFIF \b, JFIF standard
# The following added by Erik Rossen <rossen@freesurf.ch> 1999-09-06
# in a vain attempt to add image size reporting for JFIF. Note that these
@@ -41,7 +42,8 @@
# This uses recursion...
0 name jpeg_segment
>0 beshort 0xFFFE
->>(2.S+2) use jpeg_segment
+# Recursion handled by FFE0
+#>>(2.S+2) use jpeg_segment
>>2 pstring/HJ x \b, comment: "%s"
>0 beshort 0xFFC0
@@ -70,6 +72,7 @@
>>(2.S+2) use jpeg_segment
>0 beshort 0xFFE1
+# Recursion handled by FFE0
#>>(2.S+2) use jpeg_segment
>>4 string Exif \b, Exif Standard: [
>>>10 indirect/r x
@@ -85,7 +88,8 @@
# D9: End of image
# Dn: Restart
>0 beshort&0xFFD0 =0xFFD0
->>(2.S+2) use jpeg_segment
+>>0 beshort&0xFFE0 !0xFFE0
+>>>(2.S+2) use jpeg_segment
#>0 beshort x unknown 0x%x
#>>(2.S+2) use jpeg_segment
diff --git a/contrib/file/magic/Magdir/linux b/contrib/file/magic/Magdir/linux
index d3f6a9d..44aaa66 100644
--- a/contrib/file/magic/Magdir/linux
+++ b/contrib/file/magic/Magdir/linux
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: linux,v 1.59 2014/11/03 21:03:36 christos Exp $
+# $File: linux,v 1.62 2015/05/03 13:06:36 christos Exp $
# linux: file(1) magic for Linux files
#
# Values for Linux/i386 binaries, from Daniel Quinlan <quinlan@yggdrasil.com>
@@ -432,3 +432,28 @@
>12 byte x \b, version %d
>13 byte 1 \b, require visibility
>16 string x \b, root %s
+
+# Dump files for iproute2 tool. Generated by the "ip r|a save" command. URL:
+# https://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2
+# From: Pavel Emelyanov <xemul@parallels.com>
+0 lelong 0x45311224 iproute2 routes dump
+0 lelong 0x47361222 iproute2 addresses dump
+
+# Image and service files for CRIU tool.
+# URL: http://criu.org
+# From: Pavel Emelyanov <xemul@parallels.com>
+0 lelong 0x54564319 CRIU image file v1.1
+0 lelong 0x55105940 CRIU service file
+0 lelong 0x58313116 CRIU inventory
+
+# Kdump compressed dump files
+# http://sourceforge.net/p/makedumpfile/code/ci/master/tree/IMPLEMENTATION
+
+0 string KDUMP Kdump compressed dump
+>8 long x v%d
+>12 string >\0 \b, system %s
+>77 string >\0 \b, node %s
+>142 string >\0 \b, release %s
+>207 string >\0 \b, version %s
+>272 string >\0 \b, machine %s
+>337 string >\0 \b, domain %s
diff --git a/contrib/file/magic/Magdir/mach b/contrib/file/magic/Magdir/mach
index 23b9f8a..7782e5b 100644
--- a/contrib/file/magic/Magdir/mach
+++ b/contrib/file/magic/Magdir/mach
@@ -1,6 +1,6 @@
#------------------------------------------------------------
-# $File: mach,v 1.19 2014/04/30 21:41:02 christos Exp $
+# $File: mach,v 1.20 2015/05/21 18:28:41 christos Exp $
# Mach has two magic numbers, 0xcafebabe and 0xfeedface.
# Unfortunately the first, cafebabe, is shared with
# Java ByteCode, so they are both handled in the file "cafebabe".
@@ -207,8 +207,10 @@
#
0 lelong&0xfffffffe 0xfeedface Mach-O
!:strength +1
+!:mime application/x-mach-binary
>0 use \^mach-o-be
0 belong&0xfffffffe 0xfeedface Mach-O
!:strength +1
+!:mime application/x-mach-binary
>0 use mach-o-be
diff --git a/contrib/file/magic/Magdir/mathematica b/contrib/file/magic/Magdir/mathematica
index 3c10a57..a93899e 100644
--- a/contrib/file/magic/Magdir/mathematica
+++ b/contrib/file/magic/Magdir/mathematica
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: mathematica,v 1.7 2009/09/19 16:28:10 christos Exp $
+# $File: mathematica,v 1.8 2015/04/09 20:01:40 christos Exp $
# mathematica: file(1) magic for mathematica files
# "H. Nanosecond" <aldomel@ix.netcom.com>
# Mathematica a multi-purpose math program
@@ -8,13 +8,16 @@
#mathematica .mb
0 string \064\024\012\000\035\000\000\000 Mathematica version 2 notebook
+!:ext mb
0 string \064\024\011\000\035\000\000\000 Mathematica version 2 notebook
+!:ext mb
# .ma
# multiple possibilites:
0 string (*^\n\n::[\011frontEndVersion\ =\ Mathematica notebook
#>41 string >\0 %s
+!:ext mb
#0 string (*^\n\n::[\011palette Mathematica notebook version 2.x
@@ -25,13 +28,21 @@
# generic:
0 string (*^\r\r::[\011 Mathematica notebook version 2.x
+!:ext mb
0 string (*^\r\n\r\n::[\011 Mathematica notebook version 2.x
+!:ext mb
0 string (*^\015 Mathematica notebook version 2.x
+!:ext mb
0 string (*^\n\r\n\r::[\011 Mathematica notebook version 2.x
+!:ext mb
0 string (*^\r::[\011 Mathematica notebook version 2.x
+!:ext mb
0 string (*^\r\n::[\011 Mathematica notebook version 2.x
+!:ext mb
0 string (*^\n\n::[\011 Mathematica notebook version 2.x
+!:ext mb
0 string (*^\n::[\011 Mathematica notebook version 2.x
+!:ext mb
# Mathematica .mx files
diff --git a/contrib/file/magic/Magdir/misctools b/contrib/file/magic/Magdir/misctools
index 0367ec0..d09a543 100644
--- a/contrib/file/magic/Magdir/misctools
+++ b/contrib/file/magic/Magdir/misctools
@@ -1,13 +1,22 @@
#-----------------------------------------------------------------------------
-# $File: misctools,v 1.14 2014/03/06 16:08:58 christos Exp $
+# $File: misctools,v 1.15 2015/04/15 18:29:30 christos Exp $
# misctools: file(1) magic for miscellaneous UNIX tools.
#
0 search/1 %%!! X-Post-It-Note text
0 string/c BEGIN:VCALENDAR vCalendar calendar file
!:mime text/calendar
+# updated by Joerg Jenderek at Apr 2015
+# Extension: .vcf
+# http://en.wikipedia.org/wiki/VCard
0 string/c BEGIN:VCARD vCard visiting card
-!:mime text/x-vcard
+# deprecated
+#!:mime text/x-vcard
+!:mime text/vcard
+# VERSION must come right after BEGIN for 3.0 or 4.0 except in 2.1 , where it can be anywhere
+>12 search/14000/c VERSION:
+# VERSION 2.1 , 3.0 or 4.0
+>>&0 string x \b, version %-.3s
# Summary: Libtool library file
# Extension: .la
diff --git a/contrib/file/magic/Magdir/modem b/contrib/file/magic/Magdir/modem
index 84bdb28..d3bf7fa 100644
--- a/contrib/file/magic/Magdir/modem
+++ b/contrib/file/magic/Magdir/modem
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: modem,v 1.5 2010/09/20 18:55:20 rrt Exp $
+# $File: modem,v 1.6 2015/02/14 17:35:47 christos Exp $
# modem: file(1) magic for modem programs
#
# From: Florian La Roche <florian@knorke.saar.de>
@@ -33,3 +33,14 @@
0 string PVF2\n portable voice format
>5 string >\0 (ascii %s)
+# From: Bernd Nuernberger <bernd.nuernberger@web.de>
+# Brooktrout G3 fax data incl. 128 byte header
+# Common suffixes: 3??, BRK, BRT, BTR
+0 leshort 0x01bb
+>2 leshort 0x0100 Brooktrout 301 fax image,
+>>9 leshort x %d x
+>>0x2d leshort x %d
+>>6 leshort 200 \b, fine resolution
+>>6 leshort 100 \b, normal resolution
+>>11 byte 1 \b, G3 compression
+>>11 byte 2 \b, G32D compression
diff --git a/contrib/file/magic/Magdir/mozilla b/contrib/file/magic/Magdir/mozilla
index 1f89589..173018c 100644
--- a/contrib/file/magic/Magdir/mozilla
+++ b/contrib/file/magic/Magdir/mozilla
@@ -1,9 +1,10 @@
#------------------------------------------------------------------------------
-# $File: mozilla,v 1.4 2009/09/19 16:28:11 christos Exp $
+# $File: mozilla,v 1.6 2015/01/25 16:20:46 christos Exp $
# mozilla: file(1) magic for Mozilla XUL fastload files
# (XUL.mfasl and XPC.mfasl)
# URL: http://www.mozilla.org/
# From: Josh Triplett <josh@freedesktop.org>
0 string XPCOM\nMozFASL\r\n\x1A Mozilla XUL fastload data
+0 string mozLz4a Mozilla lz4 compressed bookmark data
diff --git a/contrib/file/magic/Magdir/nasa b/contrib/file/magic/Magdir/nasa
new file mode 100644
index 0000000..49673b3
--- /dev/null
+++ b/contrib/file/magic/Magdir/nasa
@@ -0,0 +1,7 @@
+
+#------------------------------------------------------------------------------
+# nasa: file(1) magic
+
+# From: Barry Carter <carter.barry@gmail.com>
+0 string DAF/SPK NASA SPICE file (binary format)
+0 string DAFETF\ NAIF\ DAF\ ENCODED NASA SPICE file (transfer format)
diff --git a/contrib/file/magic/Magdir/os2 b/contrib/file/magic/Magdir/os2
index 8643adc..25fb728 100644
--- a/contrib/file/magic/Magdir/os2
+++ b/contrib/file/magic/Magdir/os2
@@ -1,13 +1,14 @@
#------------------------------------------------------------------------------
-# $File: os2,v 1.7 2009/09/19 16:28:11 christos Exp $
+# $File: os2,v 1.8 2015/01/05 00:17:13 christos Exp $
# os2: file(1) magic for OS/2 files
#
# Provided 1998/08/22 by
# David Mediavilla <davidme.news@REMOVEIFNOTSPAMusa.net>
1 search/1 InternetShortcut MS Windows 95 Internet shortcut text
->24 search/1 >\ (URL=<%s>)
+>17 search/100 URL= (URL=<
+>>&0 string x \b%s>)
# OS/2 URL objects
# Provided 1998/08/22 by
diff --git a/contrib/file/magic/Magdir/pdf b/contrib/file/magic/Magdir/pdf
index dc2f799..b43a675 100644
--- a/contrib/file/magic/Magdir/pdf
+++ b/contrib/file/magic/Magdir/pdf
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: pdf,v 1.7 2013/08/22 07:47:26 christos Exp $
+# $File: pdf,v 1.8 2015/01/11 18:19:18 christos Exp $
# pdf: file(1) magic for Portable Document Format
#
@@ -9,6 +9,11 @@
>5 byte x \b, version %c
>7 byte x \b.%c
+0 string \012%PDF- PDF document
+!:mime application/pdf
+>6 byte x \b, version %c
+>8 byte x \b.%c
+
# From: Nick Schmalenberger <nick@schmalenberger.us>
# Forms Data Format
0 string %FDF- FDF document
diff --git a/contrib/file/magic/Magdir/perl b/contrib/file/magic/Magdir/perl
index b5b54fb..127a373 100644
--- a/contrib/file/magic/Magdir/perl
+++ b/contrib/file/magic/Magdir/perl
@@ -1,47 +1,57 @@
#------------------------------------------------------------------------------
-# $File: perl,v 1.22 2014/04/28 12:04:35 christos Exp $
+# $File: perl,v 1.24 2015/03/27 17:58:58 christos Exp $
# perl: file(1) magic for Larry Wall's perl language.
#
# The `eval' lines recognizes an outrageously clever hack.
# Keith Waclena <keith@cerberus.uchicago.edu>
# Send additions to <perl5-porters@perl.org>
-0 search/1 eval\ "exec\ /bin/perl Perl script text
+0 search/1024 eval\ "exec\ perl Perl script text
!:mime text/x-perl
-0 search/1 eval\ "exec\ /usr/bin/perl Perl script text
+0 search/1024 eval\ "exec\ /bin/perl Perl script text
!:mime text/x-perl
-0 search/1 eval\ "exec\ /usr/local/bin/perl Perl script text
+0 search/1024 eval\ "exec\ /usr/bin/perl Perl script text
!:mime text/x-perl
-0 search/1 eval\ '(exit\ $?0)'\ &&\ eval\ 'exec Perl script text
+0 search/1024 eval\ "exec\ /usr/local/bin/perl Perl script text
!:mime text/x-perl
-0 search/1 #!/usr/bin/env\ perl Perl script text executable
+0 search/1024 eval\ 'exec\ perl Perl script text
!:mime text/x-perl
-0 search/1 #!\ /usr/bin/env\ perl Perl script text executable
+0 search/1024 eval\ 'exec\ /bin/perl Perl script text
!:mime text/x-perl
-0 search/1 #!
->0 regex \^#!.*/bin/perl$ Perl script text executable
+0 search/1024 eval\ 'exec\ /usr/bin/perl Perl script text
+!:mime text/x-perl
+0 search/1024 eval\ 'exec\ /usr/local/bin/perl Perl script text
+!:mime text/x-perl
+0 search/1024 eval\ '(exit\ $?0)'\ &&\ eval\ 'exec Perl script text
+!:mime text/x-perl
+0 search/1024 #!/usr/bin/env\ perl Perl script text executable
+!:mime text/x-perl
+0 search/1024 #!\ /usr/bin/env\ perl Perl script text executable
+!:mime text/x-perl
+0 search/1024 #!
+>0 regex \^#!.*/bin/perl([[:space:]].*)*$ Perl script text executable
!:mime text/x-perl
# by Dmitry V. Levin and Alexey Tourbin
# check the first line
-0 search/1 package
+0 search/1024 package
>0 regex \^package[\ \t]+[0-9A-Za-z_:]+\ *; Perl5 module source text
!:strength + 10
# not 'p', check other lines
-0 search/1 !p
+0 search/1024 !p
>0 regex \^package[\ \t]+[0-9A-Za-z_:]+\ *;
>>0 regex \^1\ *;|\^(use|sub|my)\ .*[(;{=] Perl5 module source text
!:strength + 10
# Perl POD documents
# From: Tom Hukins <tom@eborcom.com>
-0 search/1/W \=pod\n Perl POD document text
-0 search/1/W \n\=pod\n Perl POD document text
-0 search/1/W \=head1\ Perl POD document text
-0 search/1/W \n\=head1\ Perl POD document text
-0 search/1/W \=head2\ Perl POD document text
-0 search/1/W \n\=head2\ Perl POD document text
-0 search/1/W \=encoding\ Perl POD document text
-0 search/1/W \n\=encoding\ Perl POD document text
+0 search/1024/W \=pod\n Perl POD document text
+0 search/1024/W \n\=pod\n Perl POD document text
+0 search/1024/W \=head1\ Perl POD document text
+0 search/1024/W \n\=head1\ Perl POD document text
+0 search/1024/W \=head2\ Perl POD document text
+0 search/1024/W \n\=head2\ Perl POD document text
+0 search/1024/W \=encoding\ Perl POD document text
+0 search/1024/W \n\=encoding\ Perl POD document text
# Perl Storable data files.
diff --git a/contrib/file/magic/Magdir/riff b/contrib/file/magic/Magdir/riff
index e551292..55cfb20 100644
--- a/contrib/file/magic/Magdir/riff
+++ b/contrib/file/magic/Magdir/riff
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: riff,v 1.30 2014/09/23 17:02:12 christos Exp $
+# $File: riff,v 1.31 2015/02/14 17:30:03 christos Exp $
# riff: file(1) magic for RIFF format
# See
#
@@ -230,6 +230,7 @@
# AMV-type AVI file: http://wiki.multimedia.cx/index.php?title=AMV
>8 string AMV\040 \b, AMV
>8 string WEBP \b, Web/P image
+!:mime image/webp
>>12 use riff-walk
#
diff --git a/contrib/file/magic/Magdir/sereal b/contrib/file/magic/Magdir/sereal
index 7fa4503..ead78d5 100644
--- a/contrib/file/magic/Magdir/sereal
+++ b/contrib/file/magic/Magdir/sereal
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: sereal,v 1.2 2014/11/11 20:10:49 christos Exp $
+# $File: sereal,v 1.3 2015/02/05 19:14:45 christos Exp $
# sereal: file(1) magic the Sereal binary serialization format
#
# From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
@@ -16,10 +16,20 @@
#
# See https://github.com/Sereal/Sereal/commit/35372ae01d in the
# Sereal.git repository for test Sereal data.
-0 string \=srl Sereal data
+0 name sereal
+>4 byte&0x0F x (version %d,
+>4 byte&0xF0 0x00 uncompressed)
+>4 byte&0xF0 0x10 compressed with non-incremental Snappy)
+>4 byte&0xF0 0x20 compressed with incremental Snappy)
+>4 byte&0xF0 >0x20 unknown subformat, flag: %d>>4)
+
+0 string/b \=srl Sereal data packet
+!:mime application/sereal
+>&0 use sereal
+0 string/b \=\xF3rl Sereal data packet
!:mime application/sereal
->4 byte&0x0F x (version %d,
->4 byte&0xF0 0x00 uncompressed)
->4 byte&0xF0 0x10 compressed with non-incremental Snappy)
->4 byte&0xF0 0x20 compressed with incremental Snappy)
->4 byte&0xF0 >0x20 unknown subformat, flag: %d>>4)
+>&0 use sereal
+0 string/b \=\xC3\xB3rl Sereal data packet, UTF-8 encoded
+!:mime application/sereal
+>&0 use sereal
+
diff --git a/contrib/file/magic/Magdir/sgml b/contrib/file/magic/Magdir/sgml
index f9cab08..cf2b40e 100644
--- a/contrib/file/magic/Magdir/sgml
+++ b/contrib/file/magic/Magdir/sgml
@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
-# $File: sgml,v 1.30 2013/12/21 14:27:24 christos Exp $
+# $File: sgml,v 1.31 2015/03/11 19:38:04 christos Exp $
# Type: SVG Vectorial Graphics
# From: Noel Torres <tecnico@ejerciciosresueltos.com>
0 string \<?xml\ version="
@@ -44,24 +44,44 @@
0 search/4096/cWt \<!doctype\ html HTML document text
!:mime text/html
!:strength + 5
-0 search/4096/cwt \<head HTML document text
+
+0 search/4096/cwt \<head\> HTML document text
+!:mime text/html
+!:strength + 5
+0 search/4096/cWt \<head\ HTML document text
+!:mime text/html
+!:strength + 5
+0 search/4096/cwt \<title\> HTML document text
+!:mime text/html
+!:strength + 5
+0 search/4096/cWt \<title\ HTML document text
!:mime text/html
!:strength + 5
-0 search/4096/cwt \<title HTML document text
+0 search/4096/cwt \<html\> HTML document text
!:mime text/html
!:strength + 5
-0 search/4096/cwt \<html HTML document text
+0 search/4096/cWt \<html\ HTML document text
!:mime text/html
!:strength + 5
-0 search/4096/cwt \<script HTML document text
+0 search/4096/cwt \<script\> HTML document text
!:mime text/html
!:strength + 5
-0 search/4096/cwt \<style HTML document text
+0 search/4096/cWt \<script\ HTML document text
!:mime text/html
!:strength + 5
-0 search/4096/cwt \<table HTML document text
+0 search/4096/cwt \<style\> HTML document text
!:mime text/html
!:strength + 5
+0 search/4096/cWt \<style\ HTML document text
+!:mime text/html
+!:strength + 5
+0 search/4096/cwt \<table\> HTML document text
+!:mime text/html
+!:strength + 5
+0 search/4096/cWt \<table\ HTML document text
+!:mime text/html
+!:strength + 5
+
0 search/4096/cwt \<a\ href= HTML document text
!:mime text/html
!:strength + 5
diff --git a/contrib/file/magic/Magdir/varied.script b/contrib/file/magic/Magdir/varied.script
index eb71b2f..7f4e405 100644
--- a/contrib/file/magic/Magdir/varied.script
+++ b/contrib/file/magic/Magdir/varied.script
@@ -1,38 +1,30 @@
#------------------------------------------------------------------------------
-# $File: varied.script,v 1.10 2014/03/01 22:32:39 christos Exp $
+# $File: varied.script,v 1.11 2015/03/27 17:59:39 christos Exp $
# varied.script: file(1) magic for various interpreter scripts
0 string/t #!\ / a
>3 string >\0 %s script text executable
-!:strength / 2
0 string/b #!\ / a
>3 string >\0 %s script executable (binary data)
-!:strength / 2
0 string/t #!\t/ a
>3 string >\0 %s script text executable
-!:strength / 2
0 string/b #!\t/ a
>3 string >\0 %s script executable (binary data)
-!:strength / 2
0 string/t #!/ a
>2 string >\0 %s script text executable
-!:strength / 2
0 string/b #!/ a
>2 string >\0 %s script executable (binary data)
-!:strength / 2
0 string/t #!\ script text executable
>3 string >\0 for %s
-!:strength / 3
0 string/b #!\ script executable
>3 string >\0 for %s (binary data)
-!:strength / 3
# using env
0 string/t #!/usr/bin/env a
diff --git a/contrib/file/magic/Magdir/vorbis b/contrib/file/magic/Magdir/vorbis
index d337398..3b5e51f 100644
--- a/contrib/file/magic/Magdir/vorbis
+++ b/contrib/file/magic/Magdir/vorbis
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: vorbis,v 1.20 2014/09/23 16:35:08 christos Exp $
+# $File: vorbis,v 1.22 2015/03/28 15:14:55 christos Exp $
# vorbis: file(1) magic for Ogg/Vorbis files
#
# From Felix von Leitner <leitner@fefe.de>
@@ -47,8 +47,8 @@
# non-Vorbis content: Skeleton
>>28 string fishead\0 \b, Skeleton
!:mime video/ogg
->>>36 short x v%u
->>>40 short x \b.%u
+>>>36 leshort x v%u
+>>>40 leshort x \b.%u
# non-Vorbis content: Speex
>>28 string Speex\ \ \ \b, Speex audio
!:mime audio/ogg
@@ -122,3 +122,25 @@
>>>>>>(84.b+117) string 20020717 (1.0)
>>>>>>(84.b+117) string 20030909 (1.0.1)
>>>>>>(84.b+117) string 20040629 (1.1.0 RC1)
+
+# non-Vorbis content: Opus https://tools.ietf.org/html/draft-ietf-codec-oggopus-06#section-5
+>>28 string OpusHead \b, Opus audio,
+!:mime audio/ogg
+>>>36 ubyte >0x0F UNKNOWN VERSION %u,
+>>>36 ubyte &0x0F version 0.%d
+>>>>46 ubyte >1
+>>>>>46 ubyte !255 unknown channel mapping family %u,
+>>>>>37 ubyte x %u channels
+>>>>46 ubyte 0
+>>>>>37 ubyte 1 mono
+>>>>>37 ubyte 2 stereo
+>>>>46 ubyte 1
+>>>>>37 ubyte 1 mono
+>>>>>37 ubyte 2 stereo
+>>>>>37 ubyte 3 linear surround
+>>>>>37 ubyte 4 quadraphonic
+>>>>>37 ubyte 5 5.0 surround
+>>>>>37 ubyte 6 5.1 surround
+>>>>>37 ubyte 7 6.1 surround
+>>>>>37 ubyte 8 7.1 surround
+>>>>40 lelong !0 \b, %u Hz
diff --git a/contrib/file/magic/Makefile.am b/contrib/file/magic/Makefile.am
index 7bc327d..cb62f95 100644
--- a/contrib/file/magic/Makefile.am
+++ b/contrib/file/magic/Makefile.am
@@ -1,5 +1,5 @@
#
-# $File: Makefile.am,v 1.101 2014/12/12 16:48:39 christos Exp $
+# $File: Makefile.am,v 1.103 2015/03/17 15:15:12 christos Exp $
#
MAGIC_FRAGMENT_BASE = Magdir
MAGIC_DIR = $(top_srcdir)/magic
@@ -42,6 +42,7 @@ $(MAGIC_FRAGMENT_DIR)/c-lang \
$(MAGIC_FRAGMENT_DIR)/c64 \
$(MAGIC_FRAGMENT_DIR)/cad \
$(MAGIC_FRAGMENT_DIR)/cafebabe \
+$(MAGIC_FRAGMENT_DIR)/cbor \
$(MAGIC_FRAGMENT_DIR)/cddb \
$(MAGIC_FRAGMENT_DIR)/chord \
$(MAGIC_FRAGMENT_DIR)/cisco \
@@ -160,6 +161,7 @@ $(MAGIC_FRAGMENT_DIR)/msx \
$(MAGIC_FRAGMENT_DIR)/msvc \
$(MAGIC_FRAGMENT_DIR)/mup \
$(MAGIC_FRAGMENT_DIR)/music \
+$(MAGIC_FRAGMENT_DIR)/nasa \
$(MAGIC_FRAGMENT_DIR)/natinst \
$(MAGIC_FRAGMENT_DIR)/ncr \
$(MAGIC_FRAGMENT_DIR)/neko \
diff --git a/contrib/file/magic/Makefile.in b/contrib/file/magic/Makefile.in
index 43f42c6..f214a56 100644
--- a/contrib/file/magic/Makefile.in
+++ b/contrib/file/magic/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
@SET_MAKE@
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -78,7 +88,6 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = magic
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -86,6 +95,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@@ -139,6 +149,7 @@ am__uninstall_files_from_dir = { \
am__installdirs = "$(DESTDIR)$(pkgdatadir)"
DATA = $(pkgdata_DATA)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
@@ -262,7 +273,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
#
-# $File: Makefile.am,v 1.101 2014/12/12 16:48:39 christos Exp $
+# $File: Makefile.am,v 1.103 2015/03/17 15:15:12 christos Exp $
#
MAGIC_FRAGMENT_BASE = Magdir
MAGIC_DIR = $(top_srcdir)/magic
@@ -303,6 +314,7 @@ $(MAGIC_FRAGMENT_DIR)/c-lang \
$(MAGIC_FRAGMENT_DIR)/c64 \
$(MAGIC_FRAGMENT_DIR)/cad \
$(MAGIC_FRAGMENT_DIR)/cafebabe \
+$(MAGIC_FRAGMENT_DIR)/cbor \
$(MAGIC_FRAGMENT_DIR)/cddb \
$(MAGIC_FRAGMENT_DIR)/chord \
$(MAGIC_FRAGMENT_DIR)/cisco \
@@ -421,6 +433,7 @@ $(MAGIC_FRAGMENT_DIR)/msx \
$(MAGIC_FRAGMENT_DIR)/msvc \
$(MAGIC_FRAGMENT_DIR)/mup \
$(MAGIC_FRAGMENT_DIR)/music \
+$(MAGIC_FRAGMENT_DIR)/nasa \
$(MAGIC_FRAGMENT_DIR)/natinst \
$(MAGIC_FRAGMENT_DIR)/ncr \
$(MAGIC_FRAGMENT_DIR)/neko \
@@ -555,7 +568,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign magic/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign magic/Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -755,6 +767,8 @@ uninstall-am: uninstall-pkgdataDATA
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
ps ps-am tags-am uninstall uninstall-am uninstall-pkgdataDATA
+.PRECIOUS: Makefile
+
${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP)
@rm -fr magic
diff --git a/contrib/file/missing b/contrib/file/missing
index cdea514..f62bbae 100755
--- a/contrib/file/missing
+++ b/contrib/file/missing
@@ -1,9 +1,9 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
-scriptversion=2012-06-26.16; # UTC
+scriptversion=2013-10-28.13; # UTC
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
@@ -160,7 +160,7 @@ give_advice ()
;;
autom4te*)
echo "You might have modified some maintainer files that require"
- echo "the 'automa4te' program to be rebuilt."
+ echo "the 'autom4te' program to be rebuilt."
program_details 'autom4te'
;;
bison*|yacc*)
diff --git a/contrib/file/python/Makefile.in b/contrib/file/python/Makefile.in
index 63a34b4..70bf456 100644
--- a/contrib/file/python/Makefile.in
+++ b/contrib/file/python/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
@SET_MAKE@
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -77,7 +87,6 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = python
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am README
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -85,6 +94,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@@ -109,6 +119,7 @@ am__can_run_installinfo = \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in README
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
@@ -246,7 +257,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign python/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign python/Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -421,6 +431,8 @@ uninstall-am:
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags-am uninstall uninstall-am
+.PRECIOUS: Makefile
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/contrib/file/src/Makefile.in b/contrib/file/src/Makefile.in
index 41cb9f5..5e69c00 100644
--- a/contrib/file/src/Makefile.in
+++ b/contrib/file/src/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -17,7 +17,17 @@
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -81,10 +91,6 @@ build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = file$(EXEEXT)
subdir = src
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ctime_r.c \
- vasprintf.c asctime_r.c asprintf.c strcasestr.c pread.c \
- getline.c strlcpy.c strlcat.c fmtcheck.c getopt_long.c \
- $(top_srcdir)/depcomp $(include_HEADERS)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -92,6 +98,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \
+ $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@@ -205,6 +213,10 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+ asctime_r.c asprintf.c ctime_r.c fmtcheck.c getline.c \
+ getopt_long.c gmtime_r.c localtime_r.c pread.c strcasestr.c \
+ strlcat.c strlcpy.c vasprintf.c
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
@@ -363,7 +375,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign src/Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -485,6 +496,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/fmtcheck.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getline.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt_long.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/gmtime_r.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/localtime_r.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pread.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strcasestr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strlcat.Plo@am__quote@
@@ -774,6 +787,8 @@ uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \
tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \
uninstall-includeHEADERS uninstall-libLTLIBRARIES
+.PRECIOUS: Makefile
+
magic.h: ${HDR}
sed -e "s/X.YY/$$(echo @VERSION@ | tr -d .)/" < ${HDR} > $@
diff --git a/contrib/file/src/apprentice.c b/contrib/file/src/apprentice.c
index 47b4c87..607201c 100644
--- a/contrib/file/src/apprentice.c
+++ b/contrib/file/src/apprentice.c
@@ -32,7 +32,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: apprentice.c,v 1.229 2015/01/01 17:07:34 christos Exp $")
+FILE_RCSID("@(#)$File: apprentice.c,v 1.233 2015/06/10 00:57:41 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -149,6 +149,7 @@ private int get_op(char);
private int parse_mime(struct magic_set *, struct magic_entry *, const char *);
private int parse_strength(struct magic_set *, struct magic_entry *, const char *);
private int parse_apple(struct magic_set *, struct magic_entry *, const char *);
+private int parse_ext(struct magic_set *, struct magic_entry *, const char *);
private size_t magicsize = sizeof(struct magic);
@@ -163,6 +164,7 @@ private struct {
#define DECLARE_FIELD(name) { # name, sizeof(# name) - 1, parse_ ## name }
DECLARE_FIELD(mime),
DECLARE_FIELD(apple),
+ DECLARE_FIELD(ext),
DECLARE_FIELD(strength),
#undef DECLARE_FIELD
{ NULL, 0, NULL }
@@ -964,8 +966,9 @@ apprentice_list(struct mlist *mlist, int mode)
*ml->magic[magindex].mimetype == '\0')
magindex++;
- printf("Strength = %3" SIZE_T_FORMAT "u : %s [%s]\n",
+ printf("Strength = %3" SIZE_T_FORMAT "u@%u: %s [%s]\n",
apprentice_magic_strength(m),
+ ml->magic[magindex].lineno,
ml->magic[magindex].desc,
ml->magic[magindex].mimetype);
}
@@ -1839,15 +1842,19 @@ parse(struct magic_set *ms, struct magic_entry *me, const char *line,
}
}
/* Indirect offsets are not valid at level 0. */
- if (m->cont_level == 0 && (m->flag & (OFFADD | INDIROFFADD)))
+ if (m->cont_level == 0 && (m->flag & (OFFADD | INDIROFFADD))) {
if (ms->flags & MAGIC_CHECK)
file_magwarn(ms, "relative offset at level 0");
+ return -1;
+ }
/* get offset, then skip over it */
m->offset = (uint32_t)strtoul(l, &t, 0);
- if (l == t)
+ if (l == t) {
if (ms->flags & MAGIC_CHECK)
file_magwarn(ms, "offset `%s' invalid", l);
+ return -1;
+ }
l = t;
if (m->flag & INDIR) {
@@ -1903,7 +1910,7 @@ parse(struct magic_set *ms, struct magic_entry *me, const char *line,
file_magwarn(ms,
"indirect offset type `%c' invalid",
*l);
- break;
+ return -1;
}
l++;
}
@@ -1923,17 +1930,21 @@ parse(struct magic_set *ms, struct magic_entry *me, const char *line,
}
if (isdigit((unsigned char)*l) || *l == '-') {
m->in_offset = (int32_t)strtol(l, &t, 0);
- if (l == t)
+ if (l == t) {
if (ms->flags & MAGIC_CHECK)
file_magwarn(ms,
"in_offset `%s' invalid", l);
+ return -1;
+ }
l = t;
}
if (*l++ != ')' ||
- ((m->in_op & FILE_OPINDIRECT) && *l++ != ')'))
+ ((m->in_op & FILE_OPINDIRECT) && *l++ != ')')) {
if (ms->flags & MAGIC_CHECK)
file_magwarn(ms,
"missing ')' in indirect offset");
+ return -1;
+ }
}
EATAB;
@@ -2199,7 +2210,7 @@ parse_extra(struct magic_set *ms, struct magic_entry *me, const char *line,
size_t i;
const char *l = line;
struct magic *m = &me->mp[me->cont_count == 0 ? 0 : me->cont_count - 1];
- char *buf = (char *)m + off;
+ char *buf = CAST(char *, CAST(void *, m)) + off;
if (buf[0] != '\0') {
len = nt ? strlen(buf) : len;
@@ -2248,11 +2259,25 @@ parse_apple(struct magic_set *ms, struct magic_entry *me, const char *line)
{
struct magic *m = &me->mp[0];
- return parse_extra(ms, me, line, offsetof(struct magic, apple),
+ return parse_extra(ms, me, line,
+ CAST(off_t, offsetof(struct magic, apple)),
sizeof(m->apple), "APPLE", "!+-./", 0);
}
/*
+ * Parse a comma-separated list of extensions
+ */
+private int
+parse_ext(struct magic_set *ms, struct magic_entry *me, const char *line)
+{
+ struct magic *m = &me->mp[0];
+
+ return parse_extra(ms, me, line,
+ CAST(off_t, offsetof(struct magic, ext)),
+ sizeof(m->ext), "EXTENSION", ",!+-/", 0);
+}
+
+/*
* parse a MIME annotation line from magic file, put into magic[index - 1]
* if valid
*/
@@ -2261,7 +2286,8 @@ parse_mime(struct magic_set *ms, struct magic_entry *me, const char *line)
{
struct magic *m = &me->mp[0];
- return parse_extra(ms, me, line, offsetof(struct magic, mimetype),
+ return parse_extra(ms, me, line,
+ CAST(off_t, offsetof(struct magic, mimetype)),
sizeof(m->mimetype), "MIME", "+-/.", 1);
}
diff --git a/contrib/file/src/ascmagic.c b/contrib/file/src/ascmagic.c
index 78a6dbb..9e0f663 100644
--- a/contrib/file/src/ascmagic.c
+++ b/contrib/file/src/ascmagic.c
@@ -35,7 +35,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: ascmagic.c,v 1.91 2014/11/28 02:46:39 christos Exp $")
+FILE_RCSID("@(#)$File: ascmagic.c,v 1.92 2015/04/09 20:01:41 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -79,7 +79,7 @@ file_ascmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes,
const char *code_mime = NULL;
const char *type = NULL;
- if (ms->flags & MAGIC_APPLE)
+ if (ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))
return 0;
nbytes = trim_nuls(buf, nbytes);
@@ -123,7 +123,7 @@ file_ascmagic_with_encoding(struct magic_set *ms, const unsigned char *buf,
size_t last_line_end = (size_t)-1;
int has_long_lines = 0;
- if (ms->flags & MAGIC_APPLE)
+ if (ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))
return 0;
nbytes = trim_nuls(buf, nbytes);
diff --git a/contrib/file/src/cdf.c b/contrib/file/src/cdf.c
index 9e3cf9f..c979b1d 100644
--- a/contrib/file/src/cdf.c
+++ b/contrib/file/src/cdf.c
@@ -35,7 +35,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: cdf.c,v 1.69 2014/12/04 15:56:46 christos Exp $")
+FILE_RCSID("@(#)$File: cdf.c,v 1.76 2015/02/28 00:18:02 christos Exp $")
#endif
#include <assert.h>
@@ -73,8 +73,11 @@ static union {
#define CDF_TOLE8(x) ((uint64_t)(NEED_SWAP ? _cdf_tole8(x) : (uint64_t)(x)))
#define CDF_TOLE4(x) ((uint32_t)(NEED_SWAP ? _cdf_tole4(x) : (uint32_t)(x)))
#define CDF_TOLE2(x) ((uint16_t)(NEED_SWAP ? _cdf_tole2(x) : (uint16_t)(x)))
-#define CDF_TOLE(x) (sizeof(x) == 2 ? CDF_TOLE2(x) : (sizeof(x) == 4 ? \
- CDF_TOLE4(x) : CDF_TOLE8(x)))
+#define CDF_TOLE(x) (/*CONSTCOND*/sizeof(x) == 2 ? \
+ CDF_TOLE2(CAST(uint16_t, x)) : \
+ (/*CONSTCOND*/sizeof(x) == 4 ? \
+ CDF_TOLE4(CAST(uint32_t, x)) : \
+ CDF_TOLE8(CAST(uint64_t, x))))
#define CDF_GETUINT32(x, y) cdf_getuint32(x, y)
@@ -271,7 +274,7 @@ cdf_check_stream_offset(const cdf_stream_t *sst, const cdf_header_t *h,
const char *e = ((const char *)p) + tail;
size_t ss = sst->sst_dirlen < h->h_min_size_standard_stream ?
CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h);
- (void)&line;
+ /*LINTED*/(void)&line;
if (e >= b && (size_t)(e - b) <= ss * sst->sst_len)
return 0;
DPRINTF(("%d: offset begin %p < end %p || %" SIZE_T_FORMAT "u"
@@ -744,24 +747,33 @@ cdf_read_user_stream(const cdf_info_t *info, const cdf_header_t *h,
const cdf_sat_t *sat, const cdf_sat_t *ssat, const cdf_stream_t *sst,
const cdf_dir_t *dir, const char *name, cdf_stream_t *scn)
{
- size_t i;
const cdf_directory_t *d;
- size_t name_len = strlen(name) + 1;
+ int i = cdf_find_stream(dir, name, CDF_DIR_TYPE_USER_STREAM);
+
+ if (i <= 0)
+ return -1;
+
+ d = &dir->dir_tab[i - 1];
+ return cdf_read_sector_chain(info, h, sat, ssat, sst,
+ d->d_stream_first_sector, d->d_size, scn);
+}
+
+int
+cdf_find_stream(const cdf_dir_t *dir, const char *name, int type)
+{
+ size_t i, name_len = strlen(name) + 1;
for (i = dir->dir_len; i > 0; i--)
- if (dir->dir_tab[i - 1].d_type == CDF_DIR_TYPE_USER_STREAM &&
+ if (dir->dir_tab[i - 1].d_type == type &&
cdf_namecmp(name, dir->dir_tab[i - 1].d_name, name_len)
== 0)
break;
+ if (i > 0)
+ return i;
- if (i == 0) {
- DPRINTF(("Cannot find user stream `%s'\n", name));
- errno = ESRCH;
- return -1;
- }
- d = &dir->dir_tab[i - 1];
- return cdf_read_sector_chain(info, h, sat, ssat, sst,
- d->d_stream_first_sector, d->d_size, scn);
+ DPRINTF(("Cannot find type %d `%s'\n", type, name));
+ errno = ESRCH;
+ return 0;
}
int
@@ -998,9 +1010,13 @@ cdf_unpack_summary_info(const cdf_stream_t *sst, const cdf_header_t *h,
}
-#define extract_catalog_field(f, l) \
- memcpy(&ce[i].f, b + (l), sizeof(ce[i].f)); \
- ce[i].f = CDF_TOLE(ce[i].f)
+#define extract_catalog_field(t, f, l) \
+ if (b + l + sizeof(cep->f) > eb) { \
+ cep->ce_namlen = 0; \
+ break; \
+ } \
+ memcpy(&cep->f, b + (l), sizeof(cep->f)); \
+ ce[i].f = CAST(t, CDF_TOLE(cep->f))
int
cdf_unpack_catalog(const cdf_header_t *h, const cdf_stream_t *sst,
@@ -1010,40 +1026,58 @@ cdf_unpack_catalog(const cdf_header_t *h, const cdf_stream_t *sst,
CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h);
const char *b = CAST(const char *, sst->sst_tab);
const char *eb = b + ss * sst->sst_len;
- size_t nr, i, k;
+ size_t nr, i, j, k;
cdf_catalog_entry_t *ce;
uint16_t reclen;
const uint16_t *np;
- for (nr = 0; b < eb; nr++) {
+ for (nr = 0;; nr++) {
memcpy(&reclen, b, sizeof(reclen));
reclen = CDF_TOLE2(reclen);
if (reclen == 0)
break;
b += reclen;
+ if (b > eb)
+ break;
}
+ nr--;
*cat = CAST(cdf_catalog_t *,
malloc(sizeof(cdf_catalog_t) + nr * sizeof(*ce)));
- (*cat)->cat_num = nr;
ce = (*cat)->cat_e;
+ memset(ce, 0, nr * sizeof(*ce));
b = CAST(const char *, sst->sst_tab);
- for (i = 0; i < nr; i++) {
- extract_catalog_field(ce_namlen, 0);
- extract_catalog_field(ce_num, 2);
- extract_catalog_field(ce_timestamp, 6);
- reclen = ce[i].ce_namlen;
- ce[i].ce_namlen =
- sizeof(ce[i].ce_name) / sizeof(ce[i].ce_name[0]) - 1;
- if (ce[i].ce_namlen > reclen - 14)
- ce[i].ce_namlen = reclen - 14;
- np = CAST(const uint16_t *, (b + 16));
- for (k = 0; k < ce[i].ce_namlen; k++) {
- ce[i].ce_name[k] = np[k];
- CDF_TOLE2(ce[i].ce_name[k]);
+ for (j = i = 0; i < nr; b += reclen) {
+ cdf_catalog_entry_t *cep = &ce[j];
+ uint16_t rlen;
+
+ extract_catalog_field(uint16_t, ce_namlen, 0);
+ extract_catalog_field(uint16_t, ce_num, 4);
+ extract_catalog_field(uint64_t, ce_timestamp, 8);
+ reclen = cep->ce_namlen;
+
+ if (reclen < 14) {
+ cep->ce_namlen = 0;
+ continue;
}
- ce[i].ce_name[ce[i].ce_namlen] = 0;
- b += reclen;
+
+ cep->ce_namlen = __arraycount(cep->ce_name) - 1;
+ rlen = reclen - 14;
+ if (cep->ce_namlen > rlen)
+ cep->ce_namlen = rlen;
+
+ np = CAST(const uint16_t *, CAST(const void *, (b + 16)));
+ if (CAST(const char *, np + cep->ce_namlen) > eb) {
+ cep->ce_namlen = 0;
+ break;
+ }
+
+ for (k = 0; k < cep->ce_namlen; k++)
+ cep->ce_name[k] = np[k]; /* XXX: CDF_TOLE2? */
+ cep->ce_name[cep->ce_namlen] = 0;
+ j = i;
+ i++;
}
+ (*cat)->cat_num = j;
return 0;
}
@@ -1188,11 +1222,12 @@ cdf_dump_sat(const char *prefix, const cdf_sat_t *sat, size_t size)
}
void
-cdf_dump(void *v, size_t len)
+cdf_dump(const void *v, size_t len)
{
size_t i, j;
- unsigned char *p = v;
+ const unsigned char *p = v;
char abuf[16];
+
(void)fprintf(stderr, "%.4x: ", 0);
for (i = 0, j = 0; i < len; i++, p++) {
(void)fprintf(stderr, "%.2x ", *p);
@@ -1327,10 +1362,10 @@ cdf_dump_property_info(const cdf_property_info_t *info, size_t count)
cdf_print_elapsed_time(buf, sizeof(buf), tp);
(void)fprintf(stderr, "timestamp %s\n", buf);
} else {
- char buf[26];
+ char tbuf[26];
cdf_timestamp_to_timespec(&ts, tp);
(void)fprintf(stderr, "timestamp %s",
- cdf_ctime(&ts.tv_sec, buf));
+ cdf_ctime(&ts.tv_sec, tbuf));
}
break;
case CDF_CLIPBOARD:
@@ -1401,7 +1436,10 @@ main(int argc, char *argv[])
cdf_dir_t dir;
cdf_info_t info;
const cdf_directory_t *root;
-
+#ifdef __linux__
+#define getprogname() __progname
+ extern char *__progname;
+#endif
if (argc < 2) {
(void)fprintf(stderr, "Usage: %s <filename>\n", getprogname());
return -1;
@@ -1453,8 +1491,8 @@ main(int argc, char *argv[])
else
cdf_dump_summary_info(&h, &scn);
#endif
- if (cdf_read_catalog(&info, &h, &sat, &ssat, &sst, &dir,
- &scn) == -1)
+ if (cdf_read_user_stream(&info, &h, &sat, &ssat, &sst,
+ &dir, "Catalog", &scn) == -1)
warn("Cannot read catalog");
#ifdef CDF_DEBUG
else
diff --git a/contrib/file/src/cdf.h b/contrib/file/src/cdf.h
index 64e3648..cee8d77 100644
--- a/contrib/file/src/cdf.h
+++ b/contrib/file/src/cdf.h
@@ -314,12 +314,7 @@ int cdf_read_property_info(const cdf_stream_t *, const cdf_header_t *, uint32_t,
int cdf_read_user_stream(const cdf_info_t *, const cdf_header_t *,
const cdf_sat_t *, const cdf_sat_t *, const cdf_stream_t *,
const cdf_dir_t *, const char *, cdf_stream_t *);
-#define cdf_read_catalog(info, header, sat, ssat, stream, dir, scn) \
- cdf_read_user_stream(info, header, sat, ssat, stream, dir, "Catalog", \
- scn)
-#define cdf_read_encrypted_package(info, header, sat, ssat, stream, dir, scn) \
- cdf_read_user_stream(info, header, sat, ssat, stream, dir, \
- "EncryptedPackage", scn)
+int cdf_find_stream(const cdf_dir_t *, const char *, int);
int cdf_read_summary_info(const cdf_info_t *, const cdf_header_t *,
const cdf_sat_t *, const cdf_sat_t *, const cdf_stream_t *,
const cdf_dir_t *, cdf_stream_t *);
@@ -339,7 +334,7 @@ char *cdf_u16tos8(char *, size_t, const uint16_t *);
#ifdef CDF_DEBUG
void cdf_dump_header(const cdf_header_t *);
void cdf_dump_sat(const char *, const cdf_sat_t *, size_t);
-void cdf_dump(void *, size_t);
+void cdf_dump(const void *, size_t);
void cdf_dump_stream(const cdf_header_t *, const cdf_stream_t *);
void cdf_dump_dir(const cdf_info_t *, const cdf_header_t *, const cdf_sat_t *,
const cdf_sat_t *, const cdf_stream_t *, const cdf_dir_t *);
diff --git a/contrib/file/src/compress.c b/contrib/file/src/compress.c
index e968bb4..539031e 100644
--- a/contrib/file/src/compress.c
+++ b/contrib/file/src/compress.c
@@ -35,7 +35,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: compress.c,v 1.77 2014/12/12 16:33:01 christos Exp $")
+FILE_RCSID("@(#)$File: compress.c,v 1.80 2015/06/03 18:21:24 christos Exp $")
#endif
#include "magic.h"
@@ -45,7 +45,12 @@ FILE_RCSID("@(#)$File: compress.c,v 1.77 2014/12/12 16:33:01 christos Exp $")
#endif
#include <string.h>
#include <errno.h>
+#ifdef HAVE_SIGNAL_H
#include <signal.h>
+# ifndef HAVE_SIG_T
+typedef void (*sig_t)(int);
+# endif /* HAVE_SIG_T */
+#endif
#if !defined(__MINGW32__) && !defined(WIN32)
#include <sys/ioctl.h>
#endif
@@ -104,12 +109,16 @@ file_zmagic(struct magic_set *ms, int fd, const char *name,
size_t i, nsz;
int rv = 0;
int mime = ms->flags & MAGIC_MIME;
+#ifdef HAVE_SIGNAL_H
sig_t osigpipe;
+#endif
if ((ms->flags & MAGIC_COMPRESS) == 0)
return 0;
+#ifdef HAVE_SIGNAL_H
osigpipe = signal(SIGPIPE, SIG_IGN);
+#endif
for (i = 0; i < ncompr; i++) {
if (nbytes < compr[i].maglen)
continue;
@@ -121,7 +130,8 @@ file_zmagic(struct magic_set *ms, int fd, const char *name,
if (file_buffer(ms, -1, name, newbuf, nsz) == -1)
goto error;
- if (mime == MAGIC_MIME || mime == 0) {
+ if ((ms->flags & MAGIC_COMPRESS_TRANSP) == 0 &&
+ (mime == MAGIC_MIME || mime == 0)) {
if (file_printf(ms, mime ?
" compressed-encoding=" : " (") == -1)
goto error;
@@ -136,7 +146,9 @@ file_zmagic(struct magic_set *ms, int fd, const char *name,
}
}
error:
+#ifdef HAVE_SIGNAL_H
(void)signal(SIGPIPE, osigpipe);
+#endif
free(newbuf);
ms->flags |= MAGIC_COMPRESS;
return rv;
@@ -383,7 +395,6 @@ uncompressbuf(struct magic_set *ms, int fd, size_t method,
int fdin[2], fdout[2];
int status;
ssize_t r;
- pid_t pid;
#ifdef BUILTIN_DECOMPRESS
/* FIXME: This doesn't cope with bzip2 */
@@ -397,7 +408,7 @@ uncompressbuf(struct magic_set *ms, int fd, size_t method,
file_error(ms, errno, "cannot create pipe");
return NODATA;
}
- switch (pid = fork()) {
+ switch (fork()) {
case 0: /* child */
(void) close(0);
if (fd != -1) {
diff --git a/contrib/file/src/encoding.c b/contrib/file/src/encoding.c
index c1b23cc..3c116cd 100644
--- a/contrib/file/src/encoding.c
+++ b/contrib/file/src/encoding.c
@@ -35,7 +35,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: encoding.c,v 1.10 2014/09/11 12:08:52 christos Exp $")
+FILE_RCSID("@(#)$File: encoding.c,v 1.13 2015/06/04 19:16:28 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -47,6 +47,7 @@ FILE_RCSID("@(#)$File: encoding.c,v 1.10 2014/09/11 12:08:52 christos Exp $")
private int looks_ascii(const unsigned char *, size_t, unichar *, size_t *);
private int looks_utf8_with_BOM(const unsigned char *, size_t, unichar *,
size_t *);
+private int looks_utf7(const unsigned char *, size_t, unichar *, size_t *);
private int looks_ucs16(const unsigned char *, size_t, unichar *, size_t *);
private int looks_latin1(const unsigned char *, size_t, unichar *, size_t *);
private int looks_extended(const unsigned char *, size_t, unichar *, size_t *);
@@ -88,9 +89,15 @@ file_encoding(struct magic_set *ms, const unsigned char *buf, size_t nbytes, uni
}
if (looks_ascii(buf, nbytes, *ubuf, ulen)) {
- DPRINTF(("ascii %" SIZE_T_FORMAT "u\n", *ulen));
- *code = "ASCII";
- *code_mime = "us-ascii";
+ if (looks_utf7(buf, nbytes, *ubuf, ulen) > 0) {
+ DPRINTF(("utf-7 %" SIZE_T_FORMAT "u\n", *ulen));
+ *code = "UTF-7 Unicode";
+ *code_mime = "utf-7";
+ } else {
+ DPRINTF(("ascii %" SIZE_T_FORMAT "u\n", *ulen));
+ *code = "ASCII";
+ *code_mime = "us-ascii";
+ }
} else if (looks_utf8_with_BOM(buf, nbytes, *ubuf, ulen) > 0) {
DPRINTF(("utf8/bom %" SIZE_T_FORMAT "u\n", *ulen));
*code = "UTF-8 Unicode (with BOM)";
@@ -199,8 +206,8 @@ file_encoding(struct magic_set *ms, const unsigned char *buf, size_t nbytes, uni
#define X 3 /* character appears in non-ISO extended ASCII (Mac, IBM PC) */
private char text_chars[256] = {
- /* BEL BS HT LF FF CR */
- F, F, F, F, F, F, F, T, T, T, T, F, T, T, F, F, /* 0x0X */
+ /* BEL BS HT LF VT FF CR */
+ F, F, F, F, F, F, F, T, T, T, T, T, T, T, F, F, /* 0x0X */
/* ESC */
F, F, F, F, F, F, F, F, F, F, F, T, F, F, F, F, /* 0x1X */
T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, /* 0x2X */
@@ -372,6 +379,25 @@ looks_utf8_with_BOM(const unsigned char *buf, size_t nbytes, unichar *ubuf,
}
private int
+looks_utf7(const unsigned char *buf, size_t nbytes, unichar *ubuf, size_t *ulen)
+{
+ if (nbytes > 4 && buf[0] == '+' && buf[1] == '/' && buf[2] == 'v')
+ switch (buf[3]) {
+ case '8':
+ case '9':
+ case '+':
+ case '/':
+ if (ubuf)
+ *ulen = 0;
+ return 1;
+ default:
+ return -1;
+ }
+ else
+ return -1;
+}
+
+private int
looks_ucs16(const unsigned char *buf, size_t nbytes, unichar *ubuf,
size_t *ulen)
{
diff --git a/contrib/file/src/file.c b/contrib/file/src/file.c
index 546fd8b..c700f66 100644
--- a/contrib/file/src/file.c
+++ b/contrib/file/src/file.c
@@ -32,7 +32,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: file.c,v 1.160 2014/12/16 23:18:40 christos Exp $")
+FILE_RCSID("@(#)$File: file.c,v 1.164 2015/06/03 18:21:24 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -68,14 +68,14 @@ int getopt_long(int argc, char * const *argv, const char *optstring, const struc
#endif
#ifdef S_IFLNK
-#define FILE_FLAGS "-bcEhikLlNnprsvz0"
+#define FILE_FLAGS "-bcEhikLlNnprsvzZ0"
#else
-#define FILE_FLAGS "-bcEiklNnprsvz0"
+#define FILE_FLAGS "-bcEiklNnprsvzZ0"
#endif
# define USAGE \
"Usage: %s [" FILE_FLAGS \
- "] [--apple] [--mime-encoding] [--mime-type]\n" \
+ "] [--apple] [--extension] [--mime-encoding] [--mime-type]\n" \
" [-e testname] [-F separator] [-f namefile] [-m magicfiles] " \
"file ...\n" \
" %s -C [-m magicfiles]\n" \
@@ -89,16 +89,21 @@ private int /* Global command-line options */
private const char *separator = ":"; /* Default field separator */
private const struct option long_options[] = {
+#define OPT_HELP 1
+#define OPT_APPLE 2
+#define OPT_EXTENSIONS 3
+#define OPT_MIME_TYPE 4
+#define OPT_MIME_ENCODING 5
#define OPT(shortname, longname, opt, doc) \
{longname, opt, NULL, shortname},
-#define OPT_LONGONLY(longname, opt, doc) \
- {longname, opt, NULL, 0},
+#define OPT_LONGONLY(longname, opt, doc, id) \
+ {longname, opt, NULL, id},
#include "file_opts.h"
#undef OPT
#undef OPT_LONGONLY
{0, 0, NULL, 0}
};
-#define OPTSTRING "bcCde:Ef:F:hiklLm:nNpP:rsvz0"
+#define OPTSTRING "bcCde:Ef:F:hiklLm:nNpP:rsvzZ0"
private const struct {
const char *name;
@@ -130,8 +135,14 @@ private struct {
private char *progname; /* used throughout */
+#ifdef __dead
+__dead
+#endif
private void usage(void);
private void docprint(const char *);
+#ifdef __dead
+__dead
+#endif
private void help(void);
private int unwrap(struct magic_set *, const char *);
@@ -176,21 +187,20 @@ main(int argc, char *argv[])
while ((c = getopt_long(argc, argv, OPTSTRING, long_options,
&longindex)) != -1)
switch (c) {
- case 0 :
- switch (longindex) {
- case 0:
- help();
- break;
- case 10:
- flags |= MAGIC_APPLE;
- break;
- case 11:
- flags |= MAGIC_MIME_TYPE;
- break;
- case 12:
- flags |= MAGIC_MIME_ENCODING;
- break;
- }
+ case OPT_HELP:
+ help();
+ break;
+ case OPT_APPLE:
+ flags |= MAGIC_APPLE;
+ break;
+ case OPT_EXTENSIONS:
+ flags |= MAGIC_EXTENSION;
+ break;
+ case OPT_MIME_TYPE:
+ flags |= MAGIC_MIME_TYPE;
+ break;
+ case OPT_MIME_ENCODING:
+ flags |= MAGIC_MIME_ENCODING;
break;
case '0':
nulsep = 1;
@@ -262,7 +272,6 @@ main(int argc, char *argv[])
case 'r':
flags |= MAGIC_RAW;
break;
- break;
case 's':
flags |= MAGIC_DEVICES;
break;
@@ -276,6 +285,10 @@ main(int argc, char *argv[])
case 'z':
flags |= MAGIC_COMPRESS;
break;
+
+ case 'Z':
+ flags |= MAGIC_COMPRESS|MAGIC_COMPRESS_TRANSP;
+ break;
#ifdef S_IFLNK
case 'L':
flags |= MAGIC_SYMLINK;
@@ -583,7 +596,7 @@ help(void)
#define OPT(shortname, longname, opt, doc) \
fprintf(stdout, " -%c, --" longname, shortname), \
docprint(doc);
-#define OPT_LONGONLY(longname, opt, doc) \
+#define OPT_LONGONLY(longname, opt, doc, id) \
fprintf(stdout, " --" longname), \
docprint(doc);
#include "file_opts.h"
diff --git a/contrib/file/src/file.h b/contrib/file/src/file.h
index 01aa37a..1b4ef6f 100644
--- a/contrib/file/src/file.h
+++ b/contrib/file/src/file.h
@@ -27,7 +27,7 @@
*/
/*
* file.h - definitions for file(1) program
- * @(#)$File: file.h,v 1.164 2015/01/01 17:07:34 christos Exp $
+ * @(#)$File: file.h,v 1.168 2015/04/09 20:01:41 christos Exp $
*/
#ifndef __file_h__
@@ -126,7 +126,7 @@
#endif
#ifndef HOWMANY
-# define HOWMANY (256 * 1024) /* how much of the file to look at */
+# define HOWMANY (1024 * 1024) /* how much of the file to look at */
#endif
#define MAXMAGIS 8192 /* max entries in any one magic file
or directory */
@@ -135,8 +135,8 @@
#define MAXstring 64 /* max len of "string" types */
#define MAGICNO 0xF11E041C
-#define VERSIONNO 12
-#define FILE_MAGICSIZE 248
+#define VERSIONNO 13
+#define FILE_MAGICSIZE 312
#define FILE_LOAD 0
#define FILE_CHECK 1
@@ -307,7 +307,9 @@ struct magic {
/* Words 33-52 */
char mimetype[MAXMIME]; /* MIME type */
/* Words 53-54 */
- char apple[8];
+ char apple[8]; /* APPLE CREATOR/TYPE */
+ /* Words 55-63 */
+ char ext[64]; /* Popular extensions */
};
#define BIT(A) (1 << (A))
@@ -564,6 +566,12 @@ char *ctime_r(const time_t *, char *);
#ifndef HAVE_ASCTIME_R
char *asctime_r(const struct tm *, char *);
#endif
+#ifndef HAVE_GMTIME_R
+struct tm *gmtime_r(const time_t *, struct tm *);
+#endif
+#ifndef HAVE_LOCALTIME_R
+struct tm *localtime_r(const time_t *, struct tm *);
+#endif
#ifndef HAVE_FMTCHECK
const char *fmtcheck(const char *, const char *)
__attribute__((__format_arg__(2)));
@@ -590,5 +598,8 @@ static const char *rcsid(const char *p) { \
#else
#define FILE_RCSID(id)
#endif
+#ifndef __RCSID
+#define __RCSID(a)
+#endif
#endif /* __file_h__ */
diff --git a/contrib/file/src/file_opts.h b/contrib/file/src/file_opts.h
index 3286ac6..2e30d06 100644
--- a/contrib/file/src/file_opts.h
+++ b/contrib/file/src/file_opts.h
@@ -12,11 +12,12 @@
* switch statement!
*/
-OPT_LONGONLY("help", 0, " display this help and exit\n")
+OPT_LONGONLY("help", 0, " display this help and exit\n", OPT_HELP)
OPT('v', "version", 0, " output version information and exit\n")
OPT('m', "magic-file", 1, " LIST use LIST as a colon-separated list of magic\n"
" number files\n")
OPT('z', "uncompress", 0, " try to look inside compressed files\n")
+OPT('Z', "uncompress-noreport", 0, " only print the contents of compressed files\n")
OPT('b', "brief", 0, " do not prepend filenames to output lines\n")
OPT('c', "checking-printout", 0, " print the parsed form of the magic file, use in\n"
" conjunction with -m to debug a new magic file\n"
@@ -28,9 +29,10 @@ OPT('f', "files-from", 1, " FILE read the filenames to be examined from FIL
OPT('F', "separator", 1, " STRING use string as separator instead of `:'\n")
OPT('i', "mime", 0, " output MIME type strings (--mime-type and\n"
" --mime-encoding)\n")
-OPT_LONGONLY("apple", 0, " output the Apple CREATOR/TYPE\n")
-OPT_LONGONLY("mime-type", 0, " output the MIME type\n")
-OPT_LONGONLY("mime-encoding", 0, " output the MIME encoding\n")
+OPT_LONGONLY("apple", 0, " output the Apple CREATOR/TYPE\n", OPT_APPLE)
+OPT_LONGONLY("extension", 0, " output a slash-separated list of extensions\n", OPT_EXTENSIONS)
+OPT_LONGONLY("mime-type", 0, " output the MIME type\n", OPT_MIME_TYPE)
+OPT_LONGONLY("mime-encoding", 0, " output the MIME encoding\n", OPT_MIME_ENCODING)
OPT('k', "keep-going", 0, " don't stop at the first match\n")
OPT('l', "list", 0, " list magic strength\n")
#ifdef S_IFLNK
diff --git a/contrib/file/src/fsmagic.c b/contrib/file/src/fsmagic.c
index 1e8fd74..27f982a 100644
--- a/contrib/file/src/fsmagic.c
+++ b/contrib/file/src/fsmagic.c
@@ -32,7 +32,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: fsmagic.c,v 1.75 2014/12/04 15:56:46 christos Exp $")
+FILE_RCSID("@(#)$File: fsmagic.c,v 1.76 2015/04/09 20:01:41 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -110,7 +110,7 @@ file_fsmagic(struct magic_set *ms, const char *fn, struct stat *sb)
struct stat tstatbuf;
#endif
- if (ms->flags & MAGIC_APPLE)
+ if (ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))
return 0;
if (fn == NULL)
return 0;
diff --git a/contrib/file/src/funcs.c b/contrib/file/src/funcs.c
index a60ccaa..dc7bbd1 100644
--- a/contrib/file/src/funcs.c
+++ b/contrib/file/src/funcs.c
@@ -27,7 +27,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: funcs.c,v 1.79 2014/12/16 20:52:49 christos Exp $")
+FILE_RCSID("@(#)$File: funcs.c,v 1.82 2015/06/03 18:01:20 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -159,8 +159,20 @@ file_badread(struct magic_set *ms)
}
#ifndef COMPILE_ONLY
+
+static int
+checkdone(struct magic_set *ms, int *rv)
+{
+ if ((ms->flags & MAGIC_CONTINUE) == 0)
+ return 1;
+ if (file_printf(ms, "\n- ") == -1)
+ *rv = -1;
+ return 0;
+}
+
+/*ARGSUSED*/
protected int
-file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((unused)),
+file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((__unused__)),
const void *buf, size_t nb)
{
int m = 0, rv = 0, looks_text = 0;
@@ -214,7 +226,8 @@ file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((unu
if ((m = file_is_tar(ms, ubuf, nb)) != 0) {
if ((ms->flags & MAGIC_DEBUG) != 0)
(void)fprintf(stderr, "tar %d\n", m);
- goto done;
+ if (checkdone(ms, &rv))
+ goto done;
}
/* Check if we have a CDF file */
@@ -222,7 +235,8 @@ file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((unu
if ((m = file_trycdf(ms, fd, ubuf, nb)) != 0) {
if ((ms->flags & MAGIC_DEBUG) != 0)
(void)fprintf(stderr, "cdf %d\n", m);
- goto done;
+ if (checkdone(ms, &rv))
+ goto done;
}
/* try soft magic tests */
@@ -249,7 +263,8 @@ file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((unu
"elf %d\n", m);
}
#endif
- goto done;
+ if (checkdone(ms, &rv))
+ goto done;
}
/* try text properties */
@@ -258,7 +273,8 @@ file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((unu
if ((m = file_ascmagic(ms, ubuf, nb, looks_text)) != 0) {
if ((ms->flags & MAGIC_DEBUG) != 0)
(void)fprintf(stderr, "ascmagic %d\n", m);
- goto done;
+ if (checkdone(ms, &rv))
+ goto done;
}
}
@@ -400,7 +416,7 @@ file_check_mem(struct magic_set *ms, unsigned int level)
size_t len;
if (level >= ms->c.len) {
- len = (ms->c.len += 20) * sizeof(*ms->c.li);
+ len = (ms->c.len = 20 + level) * sizeof(*ms->c.li);
ms->c.li = CAST(struct level_info *, (ms->c.li == NULL) ?
malloc(len) :
realloc(ms->c.li, len));
@@ -549,9 +565,9 @@ file_printable(char *buf, size_t bufsiz, const char *str)
if (ptr >= eptr - 3)
break;
*ptr++ = '\\';
- *ptr++ = ((*s >> 6) & 7) + '0';
- *ptr++ = ((*s >> 3) & 7) + '0';
- *ptr++ = ((*s >> 0) & 7) + '0';
+ *ptr++ = ((CAST(unsigned int, *s) >> 6) & 7) + '0';
+ *ptr++ = ((CAST(unsigned int, *s) >> 3) & 7) + '0';
+ *ptr++ = ((CAST(unsigned int, *s) >> 0) & 7) + '0';
}
*ptr = '\0';
return buf;
diff --git a/contrib/file/src/gmtime_r.c b/contrib/file/src/gmtime_r.c
new file mode 100644
index 0000000..963dfee
--- /dev/null
+++ b/contrib/file/src/gmtime_r.c
@@ -0,0 +1,19 @@
+/* $File: gmtime_r.c,v 1.1 2015/01/09 19:28:32 christos Exp $ */
+
+#include "file.h"
+#ifndef lint
+FILE_RCSID("@(#)$File: gmtime_r.c,v 1.1 2015/01/09 19:28:32 christos Exp $")
+#endif /* lint */
+#include <time.h>
+#include <string.h>
+
+/* asctime_r is not thread-safe anyway */
+struct tm *
+gmtime_r(const time_t t, struct tm *tm)
+{
+ struct tm *tmp = gmtime(t);
+ if (tmp == NULL)
+ return NULL;
+ memcpy(tm, tmp, sizeof(*tm));
+ return tmp;
+}
diff --git a/contrib/file/src/is_tar.c b/contrib/file/src/is_tar.c
index 876c631..a3e5dbf 100644
--- a/contrib/file/src/is_tar.c
+++ b/contrib/file/src/is_tar.c
@@ -40,7 +40,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: is_tar.c,v 1.37 2010/11/30 14:58:53 rrt Exp $")
+FILE_RCSID("@(#)$File: is_tar.c,v 1.38 2015/04/09 20:01:41 christos Exp $")
#endif
#include "magic.h"
@@ -69,7 +69,7 @@ file_is_tar(struct magic_set *ms, const unsigned char *buf, size_t nbytes)
int tar;
int mime = ms->flags & MAGIC_MIME;
- if ((ms->flags & MAGIC_APPLE) != 0)
+ if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
return 0;
tar = is_tar(buf, nbytes);
diff --git a/contrib/file/src/localtime_r.c b/contrib/file/src/localtime_r.c
new file mode 100644
index 0000000..69d78d9
--- /dev/null
+++ b/contrib/file/src/localtime_r.c
@@ -0,0 +1,19 @@
+/* $File: localtime_r.c,v 1.1 2015/01/09 19:28:32 christos Exp $ */
+
+#include "file.h"
+#ifndef lint
+FILE_RCSID("@(#)$File: localtime_r.c,v 1.1 2015/01/09 19:28:32 christos Exp $")
+#endif /* lint */
+#include <time.h>
+#include <string.h>
+
+/* asctime_r is not thread-safe anyway */
+struct tm *
+localtime_r(const time_t t, struct tm *tm)
+{
+ struct tm *tmp = localtime(t);
+ if (tmp == NULL)
+ return NULL;
+ memcpy(tm, tmp, sizeof(*tm));
+ return tmp;
+}
diff --git a/contrib/file/src/magic.c b/contrib/file/src/magic.c
index d16f8c6..bc8c344 100644
--- a/contrib/file/src/magic.c
+++ b/contrib/file/src/magic.c
@@ -33,7 +33,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: magic.c,v 1.91 2014/12/16 23:18:40 christos Exp $")
+FILE_RCSID("@(#)$File: magic.c,v 1.93 2015/04/15 23:47:58 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -83,6 +83,86 @@ private const char *file_or_fd(struct magic_set *, const char *, int);
#define STDIN_FILENO 0
#endif
+#ifdef WIN32
+/* HINSTANCE of this shared library. Needed for get_default_magic() */
+static HINSTANCE _w32_dll_instance = NULL;
+
+static void
+_w32_append_path(char **hmagicpath, const char *fmt, ...)
+{
+ char *tmppath;
+ char *newpath;
+ va_list ap;
+
+ va_start(ap, fmt);
+ if (vasprintf(&tmppath, fmt, ap) < 0) {
+ va_end(ap);
+ return;
+ }
+ va_end(ap);
+
+ if (access(tmppath, R_OK) == -1)
+ goto out;
+
+ if (*hmagicpath == NULL) {
+ *hmagicpath = tmppath;
+ return;
+ }
+
+ if (asprintf(&newpath, "%s%c%s", *hmagicpath, PATHSEP, tmppath) < 0)
+ goto out;
+
+ free(*hmagicpath);
+ free(tmppath);
+ *hmagicpath = newpath;
+ return;
+out:
+ free(tmppath);
+}
+
+static void
+_w32_get_magic_relative_to(char **hmagicpath, HINSTANCE module)
+{
+ static const char *trypaths[] = {
+ "%s/share/misc/magic.mgc",
+ "%s/magic.mgc",
+ };
+ LPSTR dllpath;
+ size_t sp;
+
+ dllpath = calloc(MAX_PATH + 1, sizeof(*dllpath));
+
+ if (!GetModuleFileNameA(module, dllpath, MAX_PATH))
+ goto out;
+
+ PathRemoveFileSpecA(dllpath);
+
+ sp = strlen(dllpath);
+ if (sp > 3 && stricmp(&dllpath[sp - 3], "bin") == 0) {
+ _w32_append_path(hmagicpath,
+ "%s/../share/misc/magic.mgc", dllpath);
+ goto out;
+ }
+
+ for (sp = 0; sp < __arraycount(trypaths); sp++)
+ _w32_append_path(hmagicpath, trypaths[sp], dllpath);
+out:
+ free(dllpath);
+}
+
+/* Placate GCC by offering a sacrificial previous prototype */
+BOOL WINAPI DllMain(HINSTANCE, DWORD, LPVOID);
+
+BOOL WINAPI
+DllMain(HINSTANCE hinstDLL, DWORD fdwReason,
+ LPVOID lpvReserved __attribute__((__unused__)))
+{
+ if (fdwReason == DLL_PROCESS_ATTACH)
+ _w32_dll_instance = hinstDLL;
+ return TRUE;
+}
+#endif
+
private const char *
get_default_magic(void)
{
@@ -126,75 +206,33 @@ out:
free(hmagicpath);
return MAGIC;
#else
- char *hmagicp;
- char *tmppath = NULL;
- LPTSTR dllpath;
hmagicpath = NULL;
-#define APPENDPATH() \
- do { \
- if (tmppath && access(tmppath, R_OK) != -1) { \
- if (hmagicpath == NULL) \
- hmagicpath = tmppath; \
- else { \
- if (asprintf(&hmagicp, "%s%c%s", hmagicpath, \
- PATHSEP, tmppath) >= 0) { \
- free(hmagicpath); \
- hmagicpath = hmagicp; \
- } \
- free(tmppath); \
- } \
- tmppath = NULL; \
- } \
- } while (/*CONSTCOND*/0)
-
if (default_magic) {
free(default_magic);
default_magic = NULL;
}
- /* First, try to get user-specific magic file */
- if ((home = getenv("LOCALAPPDATA")) == NULL) {
- if ((home = getenv("USERPROFILE")) != NULL)
- if (asprintf(&tmppath,
- "%s/Local Settings/Application Data%s", home,
- hmagic) < 0)
- tmppath = NULL;
- } else {
- if (asprintf(&tmppath, "%s%s", home, hmagic) < 0)
- tmppath = NULL;
- }
+ /* First, try to get a magic file from user-application data */
+ if ((home = getenv("LOCALAPPDATA")) != NULL)
+ _w32_append_path(&hmagicpath, "%s%s", home, hmagic);
- APPENDPATH();
+ /* Second, try to get a magic file from the user profile data */
+ if ((home = getenv("USERPROFILE")) != NULL)
+ _w32_append_path(&hmagicpath,
+ "%s/Local Settings/Application Data%s", home, hmagic);
- /* Second, try to get a magic file from Common Files */
- if ((home = getenv("COMMONPROGRAMFILES")) != NULL) {
- if (asprintf(&tmppath, "%s%s", home, hmagic) >= 0)
- APPENDPATH();
- }
+ /* Third, try to get a magic file from Common Files */
+ if ((home = getenv("COMMONPROGRAMFILES")) != NULL)
+ _w32_append_path(&hmagicpath, "%s%s", home, hmagic);
- /* Third, try to get magic file relative to dll location */
- dllpath = malloc(sizeof(*dllpath) * (MAX_PATH + 1));
- dllpath[MAX_PATH] = 0; /* just in case long path gets truncated and not null terminated */
- if (GetModuleFileNameA(NULL, dllpath, MAX_PATH)){
- PathRemoveFileSpecA(dllpath);
- if (strlen(dllpath) > 3 &&
- stricmp(&dllpath[strlen(dllpath) - 3], "bin") == 0) {
- if (asprintf(&tmppath,
- "%s/../share/misc/magic.mgc", dllpath) >= 0)
- APPENDPATH();
- } else {
- if (asprintf(&tmppath,
- "%s/share/misc/magic.mgc", dllpath) >= 0)
- APPENDPATH();
- else if (asprintf(&tmppath,
- "%s/magic.mgc", dllpath) >= 0)
- APPENDPATH();
- }
- }
+ /* Fourth, try to get magic file relative to exe location */
+ _w32_get_magic_relative_to(&hmagicpath, NULL);
+
+ /* Fifth, try to get magic file relative to dll location */
+ _w32_get_magic_relative_to(&hmagicpath, _w32_dll_instance);
- /* Don't put MAGIC constant - it likely points to a file within MSys
- tree */
+ /* Avoid MAGIC constant - it likely points to a file within MSys tree */
default_magic = hmagicpath;
return default_magic;
#endif
@@ -543,19 +581,19 @@ magic_setparam(struct magic_set *ms, int param, const void *val)
{
switch (param) {
case MAGIC_PARAM_INDIR_MAX:
- ms->indir_max = *(const size_t *)val;
+ ms->indir_max = (uint16_t)*(const size_t *)val;
return 0;
case MAGIC_PARAM_NAME_MAX:
- ms->name_max = *(const size_t *)val;
+ ms->name_max = (uint16_t)*(const size_t *)val;
return 0;
case MAGIC_PARAM_ELF_PHNUM_MAX:
- ms->elf_phnum_max = *(const size_t *)val;
+ ms->elf_phnum_max = (uint16_t)*(const size_t *)val;
return 0;
case MAGIC_PARAM_ELF_SHNUM_MAX:
- ms->elf_shnum_max = *(const size_t *)val;
+ ms->elf_shnum_max = (uint16_t)*(const size_t *)val;
return 0;
case MAGIC_PARAM_ELF_NOTES_MAX:
- ms->elf_notes_max = *(const size_t *)val;
+ ms->elf_notes_max = (uint16_t)*(const size_t *)val;
return 0;
default:
errno = EINVAL;
diff --git a/contrib/file/src/magic.h b/contrib/file/src/magic.h
index 721712f..0d64316 100644
--- a/contrib/file/src/magic.h
+++ b/contrib/file/src/magic.h
@@ -29,30 +29,35 @@
#include <sys/types.h>
-#define MAGIC_NONE 0x000000 /* No flags */
-#define MAGIC_DEBUG 0x000001 /* Turn on debugging */
-#define MAGIC_SYMLINK 0x000002 /* Follow symlinks */
-#define MAGIC_COMPRESS 0x000004 /* Check inside compressed files */
-#define MAGIC_DEVICES 0x000008 /* Look at the contents of devices */
-#define MAGIC_MIME_TYPE 0x000010 /* Return the MIME type */
-#define MAGIC_CONTINUE 0x000020 /* Return all matches */
-#define MAGIC_CHECK 0x000040 /* Print warnings to stderr */
-#define MAGIC_PRESERVE_ATIME 0x000080 /* Restore access time on exit */
-#define MAGIC_RAW 0x000100 /* Don't translate unprintable chars */
-#define MAGIC_ERROR 0x000200 /* Handle ENOENT etc as real errors */
-#define MAGIC_MIME_ENCODING 0x000400 /* Return the MIME encoding */
+#define MAGIC_NONE 0x0000000 /* No flags */
+#define MAGIC_DEBUG 0x0000001 /* Turn on debugging */
+#define MAGIC_SYMLINK 0x0000002 /* Follow symlinks */
+#define MAGIC_COMPRESS 0x0000004 /* Check inside compressed files */
+#define MAGIC_DEVICES 0x0000008 /* Look at the contents of devices */
+#define MAGIC_MIME_TYPE 0x0000010 /* Return the MIME type */
+#define MAGIC_CONTINUE 0x0000020 /* Return all matches */
+#define MAGIC_CHECK 0x0000040 /* Print warnings to stderr */
+#define MAGIC_PRESERVE_ATIME 0x0000080 /* Restore access time on exit */
+#define MAGIC_RAW 0x0000100 /* Don't convert unprintable chars */
+#define MAGIC_ERROR 0x0000200 /* Handle ENOENT etc as real errors */
+#define MAGIC_MIME_ENCODING 0x0000400 /* Return the MIME encoding */
#define MAGIC_MIME (MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
-#define MAGIC_APPLE 0x000800 /* Return the Apple creator and type */
-
-#define MAGIC_NO_CHECK_COMPRESS 0x001000 /* Don't check for compressed files */
-#define MAGIC_NO_CHECK_TAR 0x002000 /* Don't check for tar files */
-#define MAGIC_NO_CHECK_SOFT 0x004000 /* Don't check magic entries */
-#define MAGIC_NO_CHECK_APPTYPE 0x008000 /* Don't check application type */
-#define MAGIC_NO_CHECK_ELF 0x010000 /* Don't check for elf details */
-#define MAGIC_NO_CHECK_TEXT 0x020000 /* Don't check for text files */
-#define MAGIC_NO_CHECK_CDF 0x040000 /* Don't check for cdf files */
-#define MAGIC_NO_CHECK_TOKENS 0x100000 /* Don't check tokens */
-#define MAGIC_NO_CHECK_ENCODING 0x200000 /* Don't check text encodings */
+#define MAGIC_APPLE 0x0000800 /* Return the Apple creator/type */
+#define MAGIC_EXTENSION 0x1000000 /* Return a /-separated list of
+ * extensions */
+#define MAGIC_COMPRESS_TRANSP 0x2000000 /* Check inside compressed files
+ * but not report compression */
+#define MAGIC_NODESC (MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
+
+#define MAGIC_NO_CHECK_COMPRESS 0x0001000 /* Don't check for compressed files */
+#define MAGIC_NO_CHECK_TAR 0x0002000 /* Don't check for tar files */
+#define MAGIC_NO_CHECK_SOFT 0x0004000 /* Don't check magic entries */
+#define MAGIC_NO_CHECK_APPTYPE 0x0008000 /* Don't check application type */
+#define MAGIC_NO_CHECK_ELF 0x0010000 /* Don't check for elf details */
+#define MAGIC_NO_CHECK_TEXT 0x0020000 /* Don't check for text files */
+#define MAGIC_NO_CHECK_CDF 0x0040000 /* Don't check for cdf files */
+#define MAGIC_NO_CHECK_TOKENS 0x0100000 /* Don't check tokens */
+#define MAGIC_NO_CHECK_ENCODING 0x0200000 /* Don't check text encodings */
/* No built-in tests; only consult the magic file */
#define MAGIC_NO_CHECK_BUILTIN ( \
@@ -75,7 +80,7 @@
#define MAGIC_NO_CHECK_FORTRAN 0x000000 /* Don't check ascii/fortran */
#define MAGIC_NO_CHECK_TROFF 0x000000 /* Don't check ascii/troff */
-#define MAGIC_VERSION 521 /* This implementation */
+#define MAGIC_VERSION 522 /* This implementation */
#ifdef __cplusplus
diff --git a/contrib/file/src/magic.h.in b/contrib/file/src/magic.h.in
index 0d4c5ce..500bdbd 100644
--- a/contrib/file/src/magic.h.in
+++ b/contrib/file/src/magic.h.in
@@ -29,30 +29,35 @@
#include <sys/types.h>
-#define MAGIC_NONE 0x000000 /* No flags */
-#define MAGIC_DEBUG 0x000001 /* Turn on debugging */
-#define MAGIC_SYMLINK 0x000002 /* Follow symlinks */
-#define MAGIC_COMPRESS 0x000004 /* Check inside compressed files */
-#define MAGIC_DEVICES 0x000008 /* Look at the contents of devices */
-#define MAGIC_MIME_TYPE 0x000010 /* Return the MIME type */
-#define MAGIC_CONTINUE 0x000020 /* Return all matches */
-#define MAGIC_CHECK 0x000040 /* Print warnings to stderr */
-#define MAGIC_PRESERVE_ATIME 0x000080 /* Restore access time on exit */
-#define MAGIC_RAW 0x000100 /* Don't translate unprintable chars */
-#define MAGIC_ERROR 0x000200 /* Handle ENOENT etc as real errors */
-#define MAGIC_MIME_ENCODING 0x000400 /* Return the MIME encoding */
+#define MAGIC_NONE 0x0000000 /* No flags */
+#define MAGIC_DEBUG 0x0000001 /* Turn on debugging */
+#define MAGIC_SYMLINK 0x0000002 /* Follow symlinks */
+#define MAGIC_COMPRESS 0x0000004 /* Check inside compressed files */
+#define MAGIC_DEVICES 0x0000008 /* Look at the contents of devices */
+#define MAGIC_MIME_TYPE 0x0000010 /* Return the MIME type */
+#define MAGIC_CONTINUE 0x0000020 /* Return all matches */
+#define MAGIC_CHECK 0x0000040 /* Print warnings to stderr */
+#define MAGIC_PRESERVE_ATIME 0x0000080 /* Restore access time on exit */
+#define MAGIC_RAW 0x0000100 /* Don't convert unprintable chars */
+#define MAGIC_ERROR 0x0000200 /* Handle ENOENT etc as real errors */
+#define MAGIC_MIME_ENCODING 0x0000400 /* Return the MIME encoding */
#define MAGIC_MIME (MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
-#define MAGIC_APPLE 0x000800 /* Return the Apple creator and type */
-
-#define MAGIC_NO_CHECK_COMPRESS 0x001000 /* Don't check for compressed files */
-#define MAGIC_NO_CHECK_TAR 0x002000 /* Don't check for tar files */
-#define MAGIC_NO_CHECK_SOFT 0x004000 /* Don't check magic entries */
-#define MAGIC_NO_CHECK_APPTYPE 0x008000 /* Don't check application type */
-#define MAGIC_NO_CHECK_ELF 0x010000 /* Don't check for elf details */
-#define MAGIC_NO_CHECK_TEXT 0x020000 /* Don't check for text files */
-#define MAGIC_NO_CHECK_CDF 0x040000 /* Don't check for cdf files */
-#define MAGIC_NO_CHECK_TOKENS 0x100000 /* Don't check tokens */
-#define MAGIC_NO_CHECK_ENCODING 0x200000 /* Don't check text encodings */
+#define MAGIC_APPLE 0x0000800 /* Return the Apple creator/type */
+#define MAGIC_EXTENSION 0x1000000 /* Return a /-separated list of
+ * extensions */
+#define MAGIC_COMPRESS_TRANSP 0x2000000 /* Check inside compressed files
+ * but not report compression */
+#define MAGIC_NODESC (MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
+
+#define MAGIC_NO_CHECK_COMPRESS 0x0001000 /* Don't check for compressed files */
+#define MAGIC_NO_CHECK_TAR 0x0002000 /* Don't check for tar files */
+#define MAGIC_NO_CHECK_SOFT 0x0004000 /* Don't check magic entries */
+#define MAGIC_NO_CHECK_APPTYPE 0x0008000 /* Don't check application type */
+#define MAGIC_NO_CHECK_ELF 0x0010000 /* Don't check for elf details */
+#define MAGIC_NO_CHECK_TEXT 0x0020000 /* Don't check for text files */
+#define MAGIC_NO_CHECK_CDF 0x0040000 /* Don't check for cdf files */
+#define MAGIC_NO_CHECK_TOKENS 0x0100000 /* Don't check tokens */
+#define MAGIC_NO_CHECK_ENCODING 0x0200000 /* Don't check text encodings */
/* No built-in tests; only consult the magic file */
#define MAGIC_NO_CHECK_BUILTIN ( \
diff --git a/contrib/file/src/print.c b/contrib/file/src/print.c
index fa81798..07ae8f6 100644
--- a/contrib/file/src/print.c
+++ b/contrib/file/src/print.c
@@ -32,7 +32,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: print.c,v 1.76 2013/02/26 18:25:00 christos Exp $")
+FILE_RCSID("@(#)$File: print.c,v 1.79 2015/01/09 19:28:32 christos Exp $")
#endif /* lint */
#include <string.h>
@@ -164,6 +164,7 @@ file_mdump(struct magic *m)
case FILE_MELDATE:
(void)fprintf(stderr, "%s,",
file_fmttime(m->value.l, 0, tbuf));
+ break;
case FILE_QDATE:
case FILE_LEQDATE:
case FILE_BEQDATE:
@@ -231,40 +232,27 @@ protected const char *
file_fmttime(uint64_t v, int flags, char *buf)
{
char *pp;
- time_t t = (time_t)v;
- struct tm *tm;
+ time_t t;
+ struct tm *tm, tmz;
if (flags & FILE_T_WINDOWS) {
struct timespec ts;
- cdf_timestamp_to_timespec(&ts, t);
+ cdf_timestamp_to_timespec(&ts, v);
t = ts.tv_sec;
+ } else {
+ // XXX: perhaps detect and print something if overflow
+ // on 32 bit time_t?
+ t = (time_t)v;
}
if (flags & FILE_T_LOCAL) {
- pp = ctime_r(&t, buf);
+ tm = localtime_r(&t, &tmz);
} else {
-#ifndef HAVE_DAYLIGHT
- private int daylight = 0;
-#ifdef HAVE_TM_ISDST
- private time_t now = (time_t)0;
-
- if (now == (time_t)0) {
- struct tm *tm1;
- (void)time(&now);
- tm1 = localtime(&now);
- if (tm1 == NULL)
- goto out;
- daylight = tm1->tm_isdst;
- }
-#endif /* HAVE_TM_ISDST */
-#endif /* HAVE_DAYLIGHT */
- if (daylight)
- t += 3600;
- tm = gmtime(&t);
- if (tm == NULL)
- goto out;
- pp = asctime_r(tm, buf);
+ tm = gmtime_r(&t, &tmz);
}
+ if (tm == NULL)
+ goto out;
+ pp = asctime_r(tm, buf);
if (pp == NULL)
goto out;
diff --git a/contrib/file/src/readcdf.c b/contrib/file/src/readcdf.c
index 635a926..99d8ec0 100644
--- a/contrib/file/src/readcdf.c
+++ b/contrib/file/src/readcdf.c
@@ -26,7 +26,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: readcdf.c,v 1.49 2014/12/04 15:56:46 christos Exp $")
+FILE_RCSID("@(#)$File: readcdf.c,v 1.53 2015/04/09 20:01:41 christos Exp $")
#endif
#include <assert.h>
@@ -39,6 +39,10 @@ FILE_RCSID("@(#)$File: readcdf.c,v 1.49 2014/12/04 15:56:46 christos Exp $")
#include "cdf.h"
#include "magic.h"
+#ifndef __arraycount
+#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
+#endif
+
#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
static const struct nv {
@@ -96,6 +100,10 @@ cdf_clsid_to_mime(const uint64_t clsid[2], const struct cv *cv)
if (clsid[0] == cv[i].clsid[0] && clsid[1] == cv[i].clsid[1])
return cv[i].mime;
}
+#ifdef CDF_DEBUG
+ fprintf(stderr, "unknown mime %" PRIx64 ", %" PRIx64 "\n", clsid[0],
+ clsid[1]);
+#endif
return NULL;
}
@@ -117,6 +125,9 @@ cdf_app_to_mime(const char *vbuf, const struct nv *nv)
rv = nv[i].mime;
break;
}
+#ifdef CDF_DEBUG
+ fprintf(stderr, "unknown app %s\n", vbuf);
+#endif
#ifdef USE_C_LOCALE
(void)uselocale(old_lc_ctype);
freelocale(c_lc_ctype);
@@ -343,6 +354,90 @@ format_clsid(char *buf, size_t len, const uint64_t uuid[2]) {
}
#endif
+private int
+cdf_file_catalog_info(struct magic_set *ms, const cdf_info_t *info,
+ const cdf_header_t *h, const cdf_sat_t *sat, const cdf_sat_t *ssat,
+ const cdf_stream_t *sst, const cdf_dir_t *dir, cdf_stream_t *scn)
+{
+ int i;
+
+ if ((i = cdf_read_user_stream(info, h, sat, ssat, sst,
+ dir, "Catalog", scn)) == -1)
+ return i;
+#ifdef CDF_DEBUG
+ cdf_dump_catalog(&h, &scn);
+#endif
+ if ((i = cdf_file_catalog(ms, h, scn)) == -1)
+ return -1;
+ return i;
+}
+
+private struct sinfo {
+ const char *name;
+ const char *mime;
+ const char *sections[5];
+ const int types[5];
+} sectioninfo[] = {
+ { "Encrypted", "encrypted",
+ {
+ "EncryptedPackage", NULL, NULL, NULL, NULL,
+ },
+ {
+ CDF_DIR_TYPE_USER_STREAM, 0, 0, 0, 0,
+
+ },
+ },
+ { "QuickBooks", "quickbooks",
+ {
+#if 0
+ "TaxForms", "PDFTaxForms", "modulesInBackup",
+#endif
+ "mfbu_header", NULL, NULL, NULL, NULL,
+ },
+ {
+#if 0
+ CDF_DIR_TYPE_USER_STORAGE,
+ CDF_DIR_TYPE_USER_STORAGE,
+ CDF_DIR_TYPE_USER_STREAM,
+#endif
+ CDF_DIR_TYPE_USER_STREAM,
+ 0, 0, 0, 0
+ },
+ },
+};
+
+private int
+cdf_file_dir_info(struct magic_set *ms, const cdf_dir_t *dir)
+{
+ size_t sd, j;
+
+ for (sd = 0; sd < __arraycount(sectioninfo); sd++) {
+ const struct sinfo *si = &sectioninfo[sd];
+ for (j = 0; si->sections[j]; j++) {
+ if (cdf_find_stream(dir, si->sections[j], si->types[j])
+ <= 0) {
+#ifdef CDF_DEBUG
+ fprintf(stderr, "Can't read %s\n",
+ si->sections[j]);
+#endif
+ break;
+ }
+ }
+ if (si->sections[j] != NULL)
+ continue;
+ if (NOTMIME(ms)) {
+ if (file_printf(ms, "CDFV2 %s", si->name) == -1)
+ return -1;
+ } else {
+ if (file_printf(ms, "application/CDFV2-%s",
+ si->mime) == -1)
+ return -1;
+ }
+ return 1;
+ }
+ return -1;
+}
+
protected int
file_trycdf(struct magic_set *ms, int fd, const unsigned char *buf,
size_t nbytes)
@@ -354,13 +449,12 @@ file_trycdf(struct magic_set *ms, int fd, const unsigned char *buf,
cdf_dir_t dir;
int i;
const char *expn = "";
- const char *corrupt = "corrupt: ";
const cdf_directory_t *root_storage;
info.i_fd = fd;
info.i_buf = buf;
info.i_len = nbytes;
- if (ms->flags & MAGIC_APPLE)
+ if (ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))
return 0;
if (cdf_read_header(&info, &h) == -1)
return 0;
@@ -435,30 +529,21 @@ file_trycdf(struct magic_set *ms, int fd, const unsigned char *buf,
if ((i = cdf_read_summary_info(&info, &h, &sat, &ssat, &sst, &dir,
&scn)) == -1) {
- if (errno == ESRCH) {
- if ((i = cdf_read_catalog(&info, &h, &sat, &ssat, &sst,
- &dir, &scn)) == -1) {
- corrupt = expn;
- if ((i = cdf_read_encrypted_package(&info, &h,
- &sat, &ssat, &sst, &dir, &scn)) == -1)
- expn = "No summary info";
- else {
- expn = "Encrypted";
- i = -1;
- }
- goto out4;
- }
-#ifdef CDF_DEBUG
- cdf_dump_catalog(&h, &scn);
-#endif
- if ((i = cdf_file_catalog(ms, &h, &scn))
- < 0)
- expn = "Can't expand catalog";
- } else {
+ if (errno != ESRCH) {
expn = "Cannot read summary info";
- }
- goto out4;
- }
+ goto out4;
+ }
+ i = cdf_file_catalog_info(ms, &info, &h, &sat, &ssat, &sst,
+ &dir, &scn);
+ if (i > 0)
+ goto out4;
+ i = cdf_file_dir_info(ms, &dir);
+ if (i < 0)
+ expn = "Cannot read section info";
+ goto out4;
+ }
+
+
#ifdef CDF_DEBUG
cdf_dump_summary_info(&h, &scn);
#endif
@@ -509,11 +594,10 @@ out0:
"Composite Document File V2 Document") == -1)
return -1;
if (*expn)
- if (file_printf(ms, ", %s%s", corrupt, expn) == -1)
+ if (file_printf(ms, ", %s", expn) == -1)
return -1;
} else {
- if (file_printf(ms, "application/CDFV2-%s",
- *corrupt ? "corrupt" : "encrypted") == -1)
+ if (file_printf(ms, "application/CDFV2-unknown") == -1)
return -1;
}
i = 1;
diff --git a/contrib/file/src/readelf.c b/contrib/file/src/readelf.c
index d159620..55009e8 100644
--- a/contrib/file/src/readelf.c
+++ b/contrib/file/src/readelf.c
@@ -27,7 +27,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: readelf.c,v 1.117 2014/12/16 23:29:42 christos Exp $")
+FILE_RCSID("@(#)$File: readelf.c,v 1.119 2015/04/09 20:01:41 christos Exp $")
#endif
#ifdef BUILTIN_ELF
@@ -482,6 +482,7 @@ do_note_freebsd_version(struct magic_set *ms, int swap, void *v)
}
private int
+/*ARGSUSED*/
do_bid_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
int swap __attribute__((__unused__)), uint32_t namesz, uint32_t descsz,
size_t noff, size_t doff, int *flags)
@@ -622,7 +623,7 @@ do_pax_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
return 1;
for (i = 0; i < __arraycount(pax); i++) {
- if (((1 << i) & desc) == 0)
+ if (((1 << (int)i) & desc) == 0)
continue;
if (file_printf(ms, "%s%s", did++ ? "," : "",
pax[i]) == -1)
@@ -1008,7 +1009,8 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num,
}
/* Read offset of name section to be able to read section names later */
- if (pread(fd, xsh_addr, xsh_sizeof, off + size * strtab) < (ssize_t)xsh_sizeof) {
+ if (pread(fd, xsh_addr, xsh_sizeof, CAST(off_t, (off + size * strtab)))
+ < (ssize_t)xsh_sizeof) {
file_badread(ms);
return -1;
}
@@ -1351,7 +1353,7 @@ file_tryelf(struct magic_set *ms, int fd, const unsigned char *buf,
Elf64_Ehdr elf64hdr;
uint16_t type, phnum, shnum, notecount;
- if (ms->flags & (MAGIC_MIME|MAGIC_APPLE))
+ if (ms->flags & (MAGIC_MIME|MAGIC_APPLE|MAGIC_EXTENSION))
return 0;
/*
* ELF executables have multiple section headers in arbitrary
diff --git a/contrib/file/src/softmagic.c b/contrib/file/src/softmagic.c
index 5e277e3..15a092f 100644
--- a/contrib/file/src/softmagic.c
+++ b/contrib/file/src/softmagic.c
@@ -32,7 +32,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: softmagic.c,v 1.206 2015/01/01 17:07:34 christos Exp $")
+FILE_RCSID("@(#)$File: softmagic.c,v 1.216 2015/06/09 22:17:52 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -147,7 +147,7 @@ match(struct magic_set *ms, struct magic *magic, uint32_t nmagic,
unsigned int cont_level = 0;
int returnvalv = 0, e; /* if a match is found it is set to 1*/
int firstline = 1; /* a flag to print X\n X\n- X */
- int print = (ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0;
+ int print = (ms->flags & MAGIC_NODESC) == 0;
if (returnval == NULL)
returnval = &returnvalv;
@@ -361,6 +361,7 @@ match(struct magic_set *ms, struct magic *magic, uint32_t nmagic,
if ((ms->flags & MAGIC_CONTINUE) == 0 && *printed_something) {
return *returnval; /* don't keep searching */
}
+ cont_level = 0;
}
return *returnval; /* This is hit if -k is set or there is no match */
}
@@ -518,7 +519,7 @@ mprint(struct magic_set *ms, struct magic *m)
t = ms->offset + strlen(str);
if (*m->value.s == '\0')
- str[strcspn(str, "\n")] = '\0';
+ str[strcspn(str, "\r\n")] = '\0';
if (m->str_flags & STRING_TRIM) {
char *last;
@@ -547,7 +548,7 @@ mprint(struct magic_set *ms, struct magic *m)
case FILE_LEDATE:
case FILE_MEDATE:
if (file_printf(ms, F(ms, m, "%s"),
- file_fmttime(p->l + m->num_mask, FILE_T_LOCAL, tbuf)) == -1)
+ file_fmttime(p->l, 0, tbuf)) == -1)
return -1;
t = ms->offset + sizeof(uint32_t);
break;
@@ -557,7 +558,7 @@ mprint(struct magic_set *ms, struct magic *m)
case FILE_LELDATE:
case FILE_MELDATE:
if (file_printf(ms, F(ms, m, "%s"),
- file_fmttime(p->l + m->num_mask, 0, tbuf)) == -1)
+ file_fmttime(p->l, FILE_T_LOCAL, tbuf)) == -1)
return -1;
t = ms->offset + sizeof(uint32_t);
break;
@@ -566,7 +567,7 @@ mprint(struct magic_set *ms, struct magic *m)
case FILE_BEQDATE:
case FILE_LEQDATE:
if (file_printf(ms, F(ms, m, "%s"),
- file_fmttime(p->q + m->num_mask, FILE_T_LOCAL, tbuf)) == -1)
+ file_fmttime(p->q, 0, tbuf)) == -1)
return -1;
t = ms->offset + sizeof(uint64_t);
break;
@@ -575,7 +576,7 @@ mprint(struct magic_set *ms, struct magic *m)
case FILE_BEQLDATE:
case FILE_LEQLDATE:
if (file_printf(ms, F(ms, m, "%s"),
- file_fmttime(p->q + m->num_mask, 0, tbuf)) == -1)
+ file_fmttime(p->q, FILE_T_LOCAL, tbuf)) == -1)
return -1;
t = ms->offset + sizeof(uint64_t);
break;
@@ -584,14 +585,14 @@ mprint(struct magic_set *ms, struct magic *m)
case FILE_BEQWDATE:
case FILE_LEQWDATE:
if (file_printf(ms, F(ms, m, "%s"),
- file_fmttime(p->q + m->num_mask, FILE_T_WINDOWS, tbuf)) == -1)
+ file_fmttime(p->q, FILE_T_WINDOWS, tbuf)) == -1)
return -1;
t = ms->offset + sizeof(uint64_t);
break;
- case FILE_FLOAT:
- case FILE_BEFLOAT:
- case FILE_LEFLOAT:
+ case FILE_FLOAT:
+ case FILE_BEFLOAT:
+ case FILE_LEFLOAT:
vf = p->f;
switch (check_fmt(ms, m)) {
case -1:
@@ -609,9 +610,9 @@ mprint(struct magic_set *ms, struct magic *m)
t = ms->offset + sizeof(float);
break;
- case FILE_DOUBLE:
- case FILE_BEDOUBLE:
- case FILE_LEDOUBLE:
+ case FILE_DOUBLE:
+ case FILE_BEDOUBLE:
+ case FILE_LEDOUBLE:
vd = p->d;
switch (check_fmt(ms, m)) {
case -1:
@@ -629,6 +630,7 @@ mprint(struct magic_set *ms, struct magic *m)
t = ms->offset + sizeof(double);
break;
+ case FILE_SEARCH:
case FILE_REGEX: {
char *cp;
int rval;
@@ -652,16 +654,6 @@ mprint(struct magic_set *ms, struct magic *m)
break;
}
- case FILE_SEARCH:
- if (file_printf(ms, F(ms, m, "%s"),
- file_printable(sbuf, sizeof(sbuf), m->value.s)) == -1)
- return -1;
- if ((m->str_flags & REGEX_OFFSET_START))
- t = ms->search.offset;
- else
- t = ms->search.offset + m->vallen;
- break;
-
case FILE_DEFAULT:
case FILE_CLEAR:
if (file_printf(ms, "%s", m->desc) == -1)
@@ -716,7 +708,7 @@ moffset(struct magic_set *ms, struct magic *m)
uint32_t t;
if (*m->value.s == '\0')
- p->s[strcspn(p->s, "\n")] = '\0';
+ p->s[strcspn(p->s, "\r\n")] = '\0';
t = CAST(uint32_t, (ms->offset + strlen(p->s)));
if (m->type == FILE_PSTRING)
t += (uint32_t)file_pstring_length_size(m);
@@ -978,8 +970,7 @@ mconvert(struct magic_set *ms, struct magic *m, int flip)
case FILE_BELDATE:
p->l = (int32_t)
((p->hl[0]<<24)|(p->hl[1]<<16)|(p->hl[2]<<8)|(p->hl[3]));
- if (type == FILE_BELONG)
- cvt_32(p, m);
+ cvt_32(p, m);
return 1;
case FILE_BEQUAD:
case FILE_BEQDATE:
@@ -990,8 +981,7 @@ mconvert(struct magic_set *ms, struct magic *m, int flip)
((uint64_t)p->hq[2]<<40)|((uint64_t)p->hq[3]<<32)|
((uint64_t)p->hq[4]<<24)|((uint64_t)p->hq[5]<<16)|
((uint64_t)p->hq[6]<<8)|((uint64_t)p->hq[7]));
- if (type == FILE_BEQUAD)
- cvt_64(p, m);
+ cvt_64(p, m);
return 1;
case FILE_LESHORT:
p->h = (short)((p->hs[1]<<8)|(p->hs[0]));
@@ -1002,8 +992,7 @@ mconvert(struct magic_set *ms, struct magic *m, int flip)
case FILE_LELDATE:
p->l = (int32_t)
((p->hl[3]<<24)|(p->hl[2]<<16)|(p->hl[1]<<8)|(p->hl[0]));
- if (type == FILE_LELONG)
- cvt_32(p, m);
+ cvt_32(p, m);
return 1;
case FILE_LEQUAD:
case FILE_LEQDATE:
@@ -1014,16 +1003,14 @@ mconvert(struct magic_set *ms, struct magic *m, int flip)
((uint64_t)p->hq[5]<<40)|((uint64_t)p->hq[4]<<32)|
((uint64_t)p->hq[3]<<24)|((uint64_t)p->hq[2]<<16)|
((uint64_t)p->hq[1]<<8)|((uint64_t)p->hq[0]));
- if (type == FILE_LEQUAD)
- cvt_64(p, m);
+ cvt_64(p, m);
return 1;
case FILE_MELONG:
case FILE_MEDATE:
case FILE_MELDATE:
p->l = (int32_t)
((p->hl[1]<<24)|(p->hl[0]<<16)|(p->hl[3]<<8)|(p->hl[2]));
- if (type == FILE_MELONG)
- cvt_32(p, m);
+ cvt_32(p, m);
return 1;
case FILE_FLOAT:
cvt_float(p, m);
@@ -1116,13 +1103,11 @@ mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir,
bytecnt = m->str_range;
}
- if (bytecnt == 0)
- bytecnt = 8192;
- if (bytecnt > nbytes)
- bytecnt = nbytes;
+ if (bytecnt == 0 || bytecnt > nbytes - offset)
+ bytecnt = nbytes - offset;
buf = RCAST(const char *, s) + offset;
- end = last = RCAST(const char *, s) + bytecnt;
+ end = last = RCAST(const char *, s) + bytecnt + offset;
/* mget() guarantees buf <= last */
for (lines = linecnt, b = buf; lines && b < end &&
((b = CAST(const char *,
@@ -1582,7 +1567,9 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
offset = ((((offset >> 0) & 0x7f) << 0) |
(((offset >> 8) & 0x7f) << 7) |
(((offset >> 16) & 0x7f) << 14) |
- (((offset >> 24) & 0x7f) << 21)) + 10;
+ (((offset >> 24) & 0x7f) << 21));
+ if ((ms->flags & MAGIC_DEBUG) != 0)
+ fprintf(stderr, "id3 offs=%u\n", offset);
break;
default:
break;
@@ -1666,7 +1653,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
case FILE_INDIRECT:
if (m->str_flags & INDIRECT_RELATIVE)
- offset += o;
+ offset += CAST(uint32_t, o);
if (offset == 0)
return 0;
@@ -1687,7 +1674,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
return -1;
if (rv == 1) {
- if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 &&
+ if ((ms->flags & MAGIC_NODESC) == 0 &&
file_printf(ms, F(ms, m, "%u"), offset) == -1) {
free(rbuf);
return -1;
@@ -1721,9 +1708,11 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
printed_something, need_separator, returnval);
if (rv != 1)
*need_separator = oneed_separator;
- return rv;
+ return 1;
case FILE_NAME:
+ if (ms->flags & MAGIC_NODESC)
+ return 1;
if (file_printf(ms, "%s", m->desc) == -1)
return -1;
return 1;
@@ -1965,6 +1954,7 @@ magiccheck(struct magic_set *ms, struct magic *m)
m->str_flags);
if (v == 0) { /* found match */
ms->search.offset += idx;
+ ms->search.rm_len = m->str_range - idx;
break;
}
}
@@ -2148,6 +2138,11 @@ handle_annotation(struct magic_set *ms, struct magic *m)
return -1;
return 1;
}
+ if (ms->flags & MAGIC_EXTENSION) {
+ if (file_printf(ms, "%s", m->ext) == -1)
+ return -1;
+ return 1;
+ }
if ((ms->flags & MAGIC_MIME_TYPE) && m->mimetype[0]) {
if (file_printf(ms, "%s", m->mimetype) == -1)
return -1;
@@ -2159,7 +2154,7 @@ handle_annotation(struct magic_set *ms, struct magic *m)
private int
print_sep(struct magic_set *ms, int firstline)
{
- if (ms->flags & MAGIC_MIME)
+ if (ms->flags & MAGIC_NODESC)
return 0;
if (firstline)
return 0;
diff --git a/contrib/file/tests/Makefile.in b/contrib/file/tests/Makefile.in
index 691692b..6638369 100644
--- a/contrib/file/tests/Makefile.in
+++ b/contrib/file/tests/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
@SET_MAKE@
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -78,8 +88,6 @@ build_triplet = @build@
host_triplet = @host@
check_PROGRAMS = test$(EXEEXT)
subdir = tests
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp README
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -87,6 +95,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@@ -158,6 +167,7 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
@@ -306,7 +316,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign tests/Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -595,6 +604,8 @@ uninstall-am:
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am
+.PRECIOUS: Makefile
+
check-local:
MAGIC=$(top_builddir)/magic/magic ./test
for i in $T/*.testfile; do echo Running test: $$i; MAGIC=$(top_builddir)/magic/magic ./test $$i $${i%%.testfile}.result; done
diff --git a/contrib/gcc/config/arm/lib1funcs.asm b/contrib/gcc/config/arm/lib1funcs.asm
index c29f894..73c453d 100644
--- a/contrib/gcc/config/arm/lib1funcs.asm
+++ b/contrib/gcc/config/arm/lib1funcs.asm
@@ -252,7 +252,7 @@ SYM (\name):
#ifdef __thumb__
#define THUMB_FUNC .thumb_func
-#define THUMB_CODE .force_thumb
+#define THUMB_CODE .thumb
#else
#define THUMB_FUNC
#define THUMB_CODE
diff --git a/contrib/gcc/mkconfig.sh b/contrib/gcc/mkconfig.sh
index b2af0d0..d47667d 100644
--- a/contrib/gcc/mkconfig.sh
+++ b/contrib/gcc/mkconfig.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-set -x
+
# Copyright (C) 2001, 2002, 2006 Free Software Foundation, Inc.
# This file is part of GCC.
diff --git a/contrib/libxo/libxo/libxo.c b/contrib/libxo/libxo/libxo.c
index 4fd18fd..bb4ce2e 100644
--- a/contrib/libxo/libxo/libxo.c
+++ b/contrib/libxo/libxo/libxo.c
@@ -2077,7 +2077,8 @@ xo_format_string_direct (xo_handle_t *xop, xo_buffer_t *xbp,
ilen = mbrtowc(&wc, cp, ilen, &xop->xo_mbstate);
if (ilen < 0) { /* Invalid data; skip */
xo_failure(xop, "invalid mbs char: %02hhx", *cp);
- continue;
+ wc = L'?';
+ ilen = 1;
}
if (ilen == 0) { /* Hit a wide NUL character */
len = 0;
diff --git a/contrib/llvm/include/llvm/Target/TargetCallingConv.h b/contrib/llvm/include/llvm/Target/TargetCallingConv.h
index a0f2674..9071bfe 100644
--- a/contrib/llvm/include/llvm/Target/TargetCallingConv.h
+++ b/contrib/llvm/include/llvm/Target/TargetCallingConv.h
@@ -134,6 +134,8 @@ namespace ISD {
/// Index original Function's argument.
unsigned OrigArgIndex;
+ /// Sentinel value for implicit machine-level input arguments.
+ static const unsigned NoArgIndex = UINT_MAX;
/// Offset in bytes of current input value relative to the beginning of
/// original argument. E.g. if argument was splitted into four 32 bit
@@ -147,6 +149,15 @@ namespace ISD {
VT = vt.getSimpleVT();
ArgVT = argvt;
}
+
+ bool isOrigArg() const {
+ return OrigArgIndex != NoArgIndex;
+ }
+
+ unsigned getOrigArgIndex() const {
+ assert(OrigArgIndex != NoArgIndex && "Implicit machine-level argument");
+ return OrigArgIndex;
+ }
};
/// OutputArg - This struct carries flags and a value for a
diff --git a/contrib/llvm/include/llvm/Target/TargetLowering.h b/contrib/llvm/include/llvm/Target/TargetLowering.h
index c5fed02..43d6f27 100644
--- a/contrib/llvm/include/llvm/Target/TargetLowering.h
+++ b/contrib/llvm/include/llvm/Target/TargetLowering.h
@@ -2806,6 +2806,11 @@ public:
virtual bool useLoadStackGuardNode() const {
return false;
}
+
+ /// Returns true if arguments should be sign-extended in lib calls.
+ virtual bool shouldSignExtendTypeInLibCall(EVT Type, bool IsSigned) const {
+ return IsSigned;
+ }
};
/// Given an LLVM IR type and return type attributes, compute the return value
diff --git a/contrib/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/contrib/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
index 59f19a0..7e9e351 100644
--- a/contrib/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
+++ b/contrib/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
@@ -1776,9 +1776,12 @@ unsigned SCEVExpander::replaceCongruentIVs(Loop *L, const DominatorTree *DT,
<< *IsomorphicInc << '\n');
Value *NewInc = OrigInc;
if (OrigInc->getType() != IsomorphicInc->getType()) {
- Instruction *IP = isa<PHINode>(OrigInc)
- ? (Instruction*)L->getHeader()->getFirstInsertionPt()
- : OrigInc->getNextNode();
+ Instruction *IP = nullptr;
+ if (PHINode *PN = dyn_cast<PHINode>(OrigInc))
+ IP = PN->getParent()->getFirstInsertionPt();
+ else
+ IP = OrigInc->getNextNode();
+
IRBuilder<> Builder(IP);
Builder.SetCurrentDebugLocation(IsomorphicInc->getDebugLoc());
NewInc = Builder.
diff --git a/contrib/llvm/lib/CodeGen/MachineCopyPropagation.cpp b/contrib/llvm/lib/CodeGen/MachineCopyPropagation.cpp
index cbd6272..9611122 100644
--- a/contrib/llvm/lib/CodeGen/MachineCopyPropagation.cpp
+++ b/contrib/llvm/lib/CodeGen/MachineCopyPropagation.cpp
@@ -75,10 +75,9 @@ MachineCopyPropagation::SourceNoLongerAvailable(unsigned Reg,
I != E; ++I) {
unsigned MappedDef = *I;
// Source of copy is no longer available for propagation.
- if (AvailCopyMap.erase(MappedDef)) {
- for (MCSubRegIterator SR(MappedDef, TRI); SR.isValid(); ++SR)
- AvailCopyMap.erase(*SR);
- }
+ AvailCopyMap.erase(MappedDef);
+ for (MCSubRegIterator SR(MappedDef, TRI); SR.isValid(); ++SR)
+ AvailCopyMap.erase(*SR);
}
}
}
diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index afb986f..1df61e4 100644
--- a/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -1160,13 +1160,6 @@ void DAGCombiner::Run(CombineLevel AtLevel) {
LegalOperations = Level >= AfterLegalizeVectorOps;
LegalTypes = Level >= AfterLegalizeTypes;
- // Early exit if this basic block is in an optnone function.
- AttributeSet FnAttrs =
- DAG.getMachineFunction().getFunction()->getAttributes();
- if (FnAttrs.hasAttribute(AttributeSet::FunctionIndex,
- Attribute::OptimizeNone))
- return;
-
// Add all the dag nodes to the worklist.
for (SelectionDAG::allnodes_iterator I = DAG.allnodes_begin(),
E = DAG.allnodes_end(); I != E; ++I)
@@ -2788,9 +2781,13 @@ SDValue DAGCombiner::visitAND(SDNode *N) {
SplatBitSize = SplatBitSize * 2)
SplatValue |= SplatValue.shl(SplatBitSize);
- Constant = APInt::getAllOnesValue(BitWidth);
- for (unsigned i = 0, n = SplatBitSize/BitWidth; i < n; ++i)
- Constant &= SplatValue.lshr(i*BitWidth).zextOrTrunc(BitWidth);
+ // Make sure that variable 'Constant' is only set if 'SplatBitSize' is a
+ // multiple of 'BitWidth'. Otherwise, we could propagate a wrong value.
+ if (SplatBitSize % BitWidth == 0) {
+ Constant = APInt::getAllOnesValue(BitWidth);
+ for (unsigned i = 0, n = SplatBitSize/BitWidth; i < n; ++i)
+ Constant &= SplatValue.lshr(i*BitWidth).zextOrTrunc(BitWidth);
+ }
}
}
@@ -11043,7 +11040,9 @@ SDValue DAGCombiner::visitBUILD_VECTOR(SDNode *N) {
} else if (VecInT.getSizeInBits() == VT.getSizeInBits() * 2) {
// If the input vector is too large, try to split it.
// We don't support having two input vectors that are too large.
- if (VecIn2.getNode())
+ // If the zero vector was used, we can not split the vector,
+ // since we'd need 3 inputs.
+ if (UsesZeroVector || VecIn2.getNode())
return SDValue();
if (!TLI.isExtractSubvectorCheap(VT, VT.getVectorNumElements()))
@@ -11055,7 +11054,6 @@ SDValue DAGCombiner::visitBUILD_VECTOR(SDNode *N) {
DAG.getConstant(VT.getVectorNumElements(), TLI.getVectorIdxTy()));
VecIn1 = DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, VT, VecIn1,
DAG.getConstant(0, TLI.getVectorIdxTy()));
- UsesZeroVector = false;
} else
return SDValue();
}
diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index 97fed23..c46539b 100644
--- a/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -497,7 +497,7 @@ bool FastISel::selectGetElementPtr(const User *I) {
OI != E; ++OI) {
const Value *Idx = *OI;
if (auto *StTy = dyn_cast<StructType>(Ty)) {
- unsigned Field = cast<ConstantInt>(Idx)->getZExtValue();
+ uint64_t Field = cast<ConstantInt>(Idx)->getZExtValue();
if (Field) {
// N = N + Offset
TotalOffs += DL.getStructLayout(StTy)->getElementOffset(Field);
@@ -518,8 +518,8 @@ bool FastISel::selectGetElementPtr(const User *I) {
if (CI->isZero())
continue;
// N = N + Offset
- TotalOffs +=
- DL.getTypeAllocSize(Ty) * cast<ConstantInt>(CI)->getSExtValue();
+ uint64_t IdxN = CI->getValue().sextOrTrunc(64).getSExtValue();
+ TotalOffs += DL.getTypeAllocSize(Ty) * IdxN;
if (TotalOffs >= MaxOffs) {
N = fastEmit_ri_(VT, ISD::ADD, N, NIsKill, TotalOffs, VT);
if (!N) // Unhandled operand. Halt "fast" selection and bail.
diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp b/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
index 4591e79..b596715 100644
--- a/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+++ b/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
@@ -658,7 +658,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_XINT_TO_FP(SDNode *N) {
NVT, N->getOperand(0));
return TLI.makeLibCall(DAG, LC,
TLI.getTypeToTransformTo(*DAG.getContext(), RVT),
- &Op, 1, false, dl).first;
+ &Op, 1, Signed, dl).first;
}
diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
index 8b54e65..5222de1 100644
--- a/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
+++ b/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
@@ -1423,9 +1423,10 @@ SUnit *ScheduleDAGRRList::PickNodeToScheduleBottomUp() {
// If one or more successors has been unscheduled, then the current
// node is no longer available.
- if (!TrySU->isAvailable)
+ if (!TrySU->isAvailable || !TrySU->NodeQueueId)
CurSU = AvailableQueue->pop();
else {
+ // Available and in AvailableQueue
AvailableQueue->remove(TrySU);
CurSU = TrySU;
}
diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 551da20..fe9e442 100644
--- a/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -3399,30 +3399,21 @@ void SelectionDAGBuilder::visitGetElementPtr(const User &I) {
Ty = StTy->getElementType(Field);
} else {
Ty = cast<SequentialType>(Ty)->getElementType();
+ MVT PtrTy = DAG.getTargetLoweringInfo().getPointerTy(AS);
+ unsigned PtrSize = PtrTy.getSizeInBits();
+ APInt ElementSize(PtrSize, DL->getTypeAllocSize(Ty));
// If this is a constant subscript, handle it quickly.
- const TargetLowering &TLI = DAG.getTargetLoweringInfo();
- if (const ConstantInt *CI = dyn_cast<ConstantInt>(Idx)) {
- if (CI->isZero()) continue;
- uint64_t Offs =
- DL->getTypeAllocSize(Ty)*cast<ConstantInt>(CI)->getSExtValue();
- SDValue OffsVal;
- EVT PTy = TLI.getPointerTy(AS);
- unsigned PtrBits = PTy.getSizeInBits();
- if (PtrBits < 64)
- OffsVal = DAG.getNode(ISD::TRUNCATE, getCurSDLoc(), PTy,
- DAG.getConstant(Offs, MVT::i64));
- else
- OffsVal = DAG.getConstant(Offs, PTy);
-
- N = DAG.getNode(ISD::ADD, getCurSDLoc(), N.getValueType(), N,
- OffsVal);
+ if (const auto *CI = dyn_cast<ConstantInt>(Idx)) {
+ if (CI->isZero())
+ continue;
+ APInt Offs = ElementSize * CI->getValue().sextOrTrunc(PtrSize);
+ SDValue OffsVal = DAG.getConstant(Offs, PtrTy);
+ N = DAG.getNode(ISD::ADD, getCurSDLoc(), N.getValueType(), N, OffsVal);
continue;
}
// N = N + Idx * ElementSize;
- APInt ElementSize =
- APInt(TLI.getPointerSizeInBits(AS), DL->getTypeAllocSize(Ty));
SDValue IdxN = getValue(Idx);
// If the index is smaller or larger than intptr_t, truncate or extend
@@ -5727,6 +5718,11 @@ void SelectionDAGBuilder::LowerCallTo(ImmutableCallSite CS, SDValue Callee,
// Skip the first return-type Attribute to get to params.
Entry.setAttributes(&CS, i - CS.arg_begin() + 1);
Args.push_back(Entry);
+
+ // If we have an explicit sret argument that is an Instruction, (i.e., it
+ // might point to function-local memory), we can't meaningfully tail-call.
+ if (Entry.isSRet && isa<Instruction>(V))
+ isTailCall = false;
}
// Check if target-independent constraints permit a tail call here.
@@ -7353,6 +7349,10 @@ TargetLowering::LowerCallTo(TargetLowering::CallLoweringInfo &CLI) const {
Entry.Alignment = Align;
CLI.getArgs().insert(CLI.getArgs().begin(), Entry);
CLI.RetTy = Type::getVoidTy(CLI.RetTy->getContext());
+
+ // sret demotion isn't compatible with tail-calls, since the sret argument
+ // points into the callers stack frame.
+ CLI.IsTailCall = false;
} else {
for (unsigned I = 0, E = RetTys.size(); I != E; ++I) {
EVT VT = RetTys[I];
@@ -7638,7 +7638,8 @@ void SelectionDAGISel::LowerArguments(const Function &F) {
ISD::ArgFlagsTy Flags;
Flags.setSRet();
MVT RegisterVT = TLI->getRegisterType(*DAG.getContext(), ValueVTs[0]);
- ISD::InputArg RetArg(Flags, RegisterVT, ValueVTs[0], true, 0, 0);
+ ISD::InputArg RetArg(Flags, RegisterVT, ValueVTs[0], true,
+ ISD::InputArg::NoArgIndex, 0);
Ins.push_back(RetArg);
}
diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/contrib/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 72e0aca..f12c035 100644
--- a/contrib/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/contrib/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -96,18 +96,19 @@ TargetLowering::makeLibCall(SelectionDAG &DAG,
for (unsigned i = 0; i != NumOps; ++i) {
Entry.Node = Ops[i];
Entry.Ty = Entry.Node.getValueType().getTypeForEVT(*DAG.getContext());
- Entry.isSExt = isSigned;
- Entry.isZExt = !isSigned;
+ Entry.isSExt = shouldSignExtendTypeInLibCall(Ops[i].getValueType(), isSigned);
+ Entry.isZExt = !shouldSignExtendTypeInLibCall(Ops[i].getValueType(), isSigned);
Args.push_back(Entry);
}
SDValue Callee = DAG.getExternalSymbol(getLibcallName(LC), getPointerTy());
Type *RetTy = RetVT.getTypeForEVT(*DAG.getContext());
TargetLowering::CallLoweringInfo CLI(DAG);
+ bool signExtend = shouldSignExtendTypeInLibCall(RetVT, isSigned);
CLI.setDebugLoc(dl).setChain(DAG.getEntryNode())
.setCallee(getLibcallCallingConv(LC), RetTy, Callee, std::move(Args), 0)
.setNoReturn(doesNotReturn).setDiscardResult(!isReturnValueUsed)
- .setSExtResult(isSigned).setZExtResult(!isSigned);
+ .setSExtResult(signExtend).setZExtResult(!signExtend);
return LowerCallTo(CLI);
}
diff --git a/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp b/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
index 21893d2..d75be28 100644
--- a/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
+++ b/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
@@ -177,25 +177,30 @@ bool RuntimeDyldMachO::isCompatibleFile(const object::ObjectFile &Obj) const {
}
template <typename Impl>
-void RuntimeDyldMachOCRTPBase<Impl>::finalizeLoad(const ObjectFile &ObjImg,
+void RuntimeDyldMachOCRTPBase<Impl>::finalizeLoad(const ObjectFile &Obj,
ObjSectionToIDMap &SectionMap) {
unsigned EHFrameSID = RTDYLD_INVALID_SECTION_ID;
unsigned TextSID = RTDYLD_INVALID_SECTION_ID;
unsigned ExceptTabSID = RTDYLD_INVALID_SECTION_ID;
- ObjSectionToIDMap::iterator i, e;
- for (i = SectionMap.begin(), e = SectionMap.end(); i != e; ++i) {
- const SectionRef &Section = i->first;
+ for (const auto &Section : Obj.sections()) {
StringRef Name;
Section.getName(Name);
- if (Name == "__eh_frame")
- EHFrameSID = i->second;
- else if (Name == "__text")
- TextSID = i->second;
+
+ // Force emission of the __text, __eh_frame, and __gcc_except_tab sections
+ // if they're present. Otherwise call down to the impl to handle other
+ // sections that have already been emitted.
+ if (Name == "__text")
+ TextSID = findOrEmitSection(Obj, Section, true, SectionMap);
+ else if (Name == "__eh_frame")
+ EHFrameSID = findOrEmitSection(Obj, Section, false, SectionMap);
else if (Name == "__gcc_except_tab")
- ExceptTabSID = i->second;
- else
- impl().finalizeSection(ObjImg, i->second, Section);
+ ExceptTabSID = findOrEmitSection(Obj, Section, true, SectionMap);
+ else {
+ auto I = SectionMap.find(Section);
+ if (I != SectionMap.end())
+ impl().finalizeSection(Obj, I->second, Section);
+ }
}
UnregisteredEHFrameSections.push_back(
EHFrameRelatedSections(EHFrameSID, TextSID, ExceptTabSID));
@@ -238,7 +243,8 @@ unsigned char *RuntimeDyldMachOCRTPBase<Impl>::processFDE(unsigned char *P,
}
static int64_t computeDelta(SectionEntry *A, SectionEntry *B) {
- int64_t ObjDistance = A->ObjAddress - B->ObjAddress;
+ int64_t ObjDistance =
+ static_cast<int64_t>(A->ObjAddress) - static_cast<int64_t>(B->ObjAddress);
int64_t MemDistance = A->LoadAddress - B->LoadAddress;
return ObjDistance - MemDistance;
}
diff --git a/contrib/llvm/lib/IR/ConstantFold.cpp b/contrib/llvm/lib/IR/ConstantFold.cpp
index 9176bf2..39d9a1d 100644
--- a/contrib/llvm/lib/IR/ConstantFold.cpp
+++ b/contrib/llvm/lib/IR/ConstantFold.cpp
@@ -1120,27 +1120,18 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode,
return ConstantInt::get(CI1->getContext(), C1V | C2V);
case Instruction::Xor:
return ConstantInt::get(CI1->getContext(), C1V ^ C2V);
- case Instruction::Shl: {
- uint32_t shiftAmt = C2V.getZExtValue();
- if (shiftAmt < C1V.getBitWidth())
- return ConstantInt::get(CI1->getContext(), C1V.shl(shiftAmt));
- else
- return UndefValue::get(C1->getType()); // too big shift is undef
- }
- case Instruction::LShr: {
- uint32_t shiftAmt = C2V.getZExtValue();
- if (shiftAmt < C1V.getBitWidth())
- return ConstantInt::get(CI1->getContext(), C1V.lshr(shiftAmt));
- else
- return UndefValue::get(C1->getType()); // too big shift is undef
- }
- case Instruction::AShr: {
- uint32_t shiftAmt = C2V.getZExtValue();
- if (shiftAmt < C1V.getBitWidth())
- return ConstantInt::get(CI1->getContext(), C1V.ashr(shiftAmt));
- else
- return UndefValue::get(C1->getType()); // too big shift is undef
- }
+ case Instruction::Shl:
+ if (C2V.ult(C1V.getBitWidth()))
+ return ConstantInt::get(CI1->getContext(), C1V.shl(C2V));
+ return UndefValue::get(C1->getType()); // too big shift is undef
+ case Instruction::LShr:
+ if (C2V.ult(C1V.getBitWidth()))
+ return ConstantInt::get(CI1->getContext(), C1V.lshr(C2V));
+ return UndefValue::get(C1->getType()); // too big shift is undef
+ case Instruction::AShr:
+ if (C2V.ult(C1V.getBitWidth()))
+ return ConstantInt::get(CI1->getContext(), C1V.ashr(C2V));
+ return UndefValue::get(C1->getType()); // too big shift is undef
}
}
diff --git a/contrib/llvm/lib/IR/GCOV.cpp b/contrib/llvm/lib/IR/GCOV.cpp
index 245c500..88e0cd0 100644
--- a/contrib/llvm/lib/IR/GCOV.cpp
+++ b/contrib/llvm/lib/IR/GCOV.cpp
@@ -263,10 +263,12 @@ bool GCOVFunction::readGCDA(GCOVBuffer &Buff, GCOV::GCOVVersion Version) {
// required to combine the edge counts that are contained in the GCDA file.
for (uint32_t BlockNo = 0; Count > 0; ++BlockNo) {
// The last block is always reserved for exit block
- if (BlockNo >= Blocks.size()-1) {
+ if (BlockNo >= Blocks.size()) {
errs() << "Unexpected number of edges (in " << Name << ").\n";
return false;
}
+ if (BlockNo == Blocks.size() - 1)
+ errs() << "(" << Name << ") has arcs from exit block.\n";
GCOVBlock &Block = *Blocks[BlockNo];
for (size_t EdgeNo = 0, End = Block.getNumDstEdges(); EdgeNo < End;
++EdgeNo) {
diff --git a/contrib/llvm/lib/Support/Unix/Memory.inc b/contrib/llvm/lib/Support/Unix/Memory.inc
index 7ccde46..c421ee8 100644
--- a/contrib/llvm/lib/Support/Unix/Memory.inc
+++ b/contrib/llvm/lib/Support/Unix/Memory.inc
@@ -333,23 +333,12 @@ void Memory::InvalidateInstructionCache(const void *Addr,
for (intptr_t Line = StartLine; Line < EndLine; Line += LineSize)
asm volatile("icbi 0, %0" : : "r"(Line));
asm volatile("isync");
-# elif (defined(__arm__) || defined(__aarch64__)) && defined(__GNUC__)
+# elif (defined(__arm__) || defined(__aarch64__) || defined(__mips__)) && \
+ defined(__GNUC__)
// FIXME: Can we safely always call this for __GNUC__ everywhere?
const char *Start = static_cast<const char *>(Addr);
const char *End = Start + Len;
__clear_cache(const_cast<char *>(Start), const_cast<char *>(End));
-# elif defined(__mips__)
- const char *Start = static_cast<const char *>(Addr);
-# if defined(ANDROID)
- // The declaration of "cacheflush" in Android bionic:
- // extern int cacheflush(long start, long end, long flags);
- const char *End = Start + Len;
- long LStart = reinterpret_cast<long>(const_cast<char *>(Start));
- long LEnd = reinterpret_cast<long>(const_cast<char *>(End));
- cacheflush(LStart, LEnd, BCACHE);
-# else
- cacheflush(const_cast<char *>(Start), Len, BCACHE);
-# endif
# endif
#endif // end apple
diff --git a/contrib/llvm/lib/Support/Windows/explicit_symbols.inc b/contrib/llvm/lib/Support/Windows/explicit_symbols.inc
index cd56b13..bbbf7ea 100644
--- a/contrib/llvm/lib/Support/Windows/explicit_symbols.inc
+++ b/contrib/llvm/lib/Support/Windows/explicit_symbols.inc
@@ -10,9 +10,15 @@
#ifdef HAVE___CHKSTK
EXPLICIT_SYMBOL(__chkstk)
#endif
+#ifdef HAVE___CHKSTK_MS
+ EXPLICIT_SYMBOL(__chkstk_ms)
+#endif
#ifdef HAVE____CHKSTK
EXPLICIT_SYMBOL(___chkstk)
#endif
+#ifdef HAVE____CHKSTK_MS
+ EXPLICIT_SYMBOL(___chkstk_ms)
+#endif
#ifdef HAVE___MAIN
EXPLICIT_SYMBOL(__main) // FIXME: Don't call it.
#endif
diff --git a/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index 9b6a100..6458d56 100644
--- a/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -2031,18 +2031,19 @@ SDValue AArch64TargetLowering::LowerFormalArguments(
unsigned CurArgIdx = 0;
for (unsigned i = 0; i != NumArgs; ++i) {
MVT ValVT = Ins[i].VT;
- std::advance(CurOrigArg, Ins[i].OrigArgIndex - CurArgIdx);
- CurArgIdx = Ins[i].OrigArgIndex;
-
- // Get type of the original argument.
- EVT ActualVT = getValueType(CurOrigArg->getType(), /*AllowUnknown*/ true);
- MVT ActualMVT = ActualVT.isSimple() ? ActualVT.getSimpleVT() : MVT::Other;
- // If ActualMVT is i1/i8/i16, we should set LocVT to i8/i8/i16.
- if (ActualMVT == MVT::i1 || ActualMVT == MVT::i8)
- ValVT = MVT::i8;
- else if (ActualMVT == MVT::i16)
- ValVT = MVT::i16;
+ if (Ins[i].isOrigArg()) {
+ std::advance(CurOrigArg, Ins[i].getOrigArgIndex() - CurArgIdx);
+ CurArgIdx = Ins[i].getOrigArgIndex();
+ // Get type of the original argument.
+ EVT ActualVT = getValueType(CurOrigArg->getType(), /*AllowUnknown*/ true);
+ MVT ActualMVT = ActualVT.isSimple() ? ActualVT.getSimpleVT() : MVT::Other;
+ // If ActualMVT is i1/i8/i16, we should set LocVT to i8/i8/i16.
+ if (ActualMVT == MVT::i1 || ActualMVT == MVT::i8)
+ ValVT = MVT::i8;
+ else if (ActualMVT == MVT::i16)
+ ValVT = MVT::i16;
+ }
CCAssignFn *AssignFn = CCAssignFnForCall(CallConv, /*IsVarArg=*/false);
bool Res =
AssignFn(i, ValVT, ValVT, CCValAssign::Full, Ins[i].Flags, CCInfo);
diff --git a/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp b/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp
index e4bea5f..a3a76e6 100644
--- a/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -3092,8 +3092,11 @@ ARMTargetLowering::LowerFormalArguments(SDValue Chain,
for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
CCValAssign &VA = ArgLocs[i];
- std::advance(CurOrigArg, Ins[VA.getValNo()].OrigArgIndex - CurArgIdx);
- CurArgIdx = Ins[VA.getValNo()].OrigArgIndex;
+ if (Ins[VA.getValNo()].isOrigArg()) {
+ std::advance(CurOrigArg,
+ Ins[VA.getValNo()].getOrigArgIndex() - CurArgIdx);
+ CurArgIdx = Ins[VA.getValNo()].getOrigArgIndex();
+ }
// Arguments stored in registers.
if (VA.isRegLoc()) {
EVT RegVT = VA.getLocVT();
@@ -3173,7 +3176,7 @@ ARMTargetLowering::LowerFormalArguments(SDValue Chain,
assert(VA.isMemLoc());
assert(VA.getValVT() != MVT::i64 && "i64 should already be lowered");
- int index = ArgLocs[i].getValNo();
+ int index = VA.getValNo();
// Some Ins[] entries become multiple ArgLoc[] entries.
// Process them only once.
@@ -3186,6 +3189,8 @@ ARMTargetLowering::LowerFormalArguments(SDValue Chain,
// Since they could be overwritten by lowering of arguments in case of
// a tail call.
if (Flags.isByVal()) {
+ assert(Ins[index].isOrigArg() &&
+ "Byval arguments cannot be implicit");
unsigned CurByValIndex = CCInfo.getInRegsParamsProcessed();
ByValStoreOffset = RoundUpToAlignment(ByValStoreOffset, Flags.getByValAlign());
diff --git a/contrib/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/contrib/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
index 7db5b34..699dfae 100644
--- a/contrib/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
+++ b/contrib/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
@@ -3667,43 +3667,44 @@ bool MipsAsmParser::parseDirectiveModule() {
return false;
}
- if (Lexer.is(AsmToken::Identifier)) {
- StringRef Option = Parser.getTok().getString();
- Parser.Lex();
-
- if (Option == "oddspreg") {
- getTargetStreamer().emitDirectiveModuleOddSPReg(true, isABI_O32());
- clearFeatureBits(Mips::FeatureNoOddSPReg, "nooddspreg");
+ StringRef Option;
+ if (Parser.parseIdentifier(Option)) {
+ reportParseError("expected .module option identifier");
+ return false;
+ }
- if (getLexer().isNot(AsmToken::EndOfStatement)) {
- reportParseError("unexpected token, expected end of statement");
- return false;
- }
+ if (Option == "oddspreg") {
+ getTargetStreamer().emitDirectiveModuleOddSPReg(true, isABI_O32());
+ clearFeatureBits(Mips::FeatureNoOddSPReg, "nooddspreg");
+ // If this is not the end of the statement, report an error.
+ if (getLexer().isNot(AsmToken::EndOfStatement)) {
+ reportParseError("unexpected token, expected end of statement");
return false;
- } else if (Option == "nooddspreg") {
- if (!isABI_O32()) {
- Error(L, "'.module nooddspreg' requires the O32 ABI");
- return false;
- }
+ }
- getTargetStreamer().emitDirectiveModuleOddSPReg(false, isABI_O32());
- setFeatureBits(Mips::FeatureNoOddSPReg, "nooddspreg");
+ return false; // parseDirectiveModule has finished successfully.
+ } else if (Option == "nooddspreg") {
+ if (!isABI_O32()) {
+ Error(L, "'.module nooddspreg' requires the O32 ABI");
+ return false;
+ }
- if (getLexer().isNot(AsmToken::EndOfStatement)) {
- reportParseError("unexpected token, expected end of statement");
- return false;
- }
+ getTargetStreamer().emitDirectiveModuleOddSPReg(false, isABI_O32());
+ setFeatureBits(Mips::FeatureNoOddSPReg, "nooddspreg");
+ // If this is not the end of the statement, report an error.
+ if (getLexer().isNot(AsmToken::EndOfStatement)) {
+ reportParseError("unexpected token, expected end of statement");
return false;
- } else if (Option == "fp") {
- return parseDirectiveModuleFP();
}
+ return false; // parseDirectiveModule has finished successfully.
+ } else if (Option == "fp") {
+ return parseDirectiveModuleFP();
+ } else {
return Error(L, "'" + Twine(Option) + "' is not a valid .module option.");
}
-
- return false;
}
/// parseDirectiveModuleFP
diff --git a/contrib/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp b/contrib/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp
index da33f3b..d42b948 100644
--- a/contrib/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp
+++ b/contrib/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp
@@ -259,6 +259,11 @@ static DecodeStatus DecodeCacheOp(MCInst &Inst,
uint64_t Address,
const void *Decoder);
+static DecodeStatus DecodeCacheOpR6(MCInst &Inst,
+ unsigned Insn,
+ uint64_t Address,
+ const void *Decoder);
+
static DecodeStatus DecodeCacheOpMM(MCInst &Inst,
unsigned Insn,
uint64_t Address,
@@ -304,6 +309,10 @@ static DecodeStatus DecodeFMem3(MCInst &Inst, unsigned Insn,
uint64_t Address,
const void *Decoder);
+static DecodeStatus DecodeFMemCop2R6(MCInst &Inst, unsigned Insn,
+ uint64_t Address,
+ const void *Decoder);
+
static DecodeStatus DecodeSpecial3LlSc(MCInst &Inst,
unsigned Insn,
uint64_t Address,
@@ -1118,6 +1127,23 @@ static DecodeStatus DecodeCacheOpMM(MCInst &Inst,
return MCDisassembler::Success;
}
+static DecodeStatus DecodeCacheOpR6(MCInst &Inst,
+ unsigned Insn,
+ uint64_t Address,
+ const void *Decoder) {
+ int Offset = fieldFromInstruction(Insn, 7, 9);
+ unsigned Hint = fieldFromInstruction(Insn, 16, 5);
+ unsigned Base = fieldFromInstruction(Insn, 21, 5);
+
+ Base = getReg(Decoder, Mips::GPR32RegClassID, Base);
+
+ Inst.addOperand(MCOperand::CreateReg(Base));
+ Inst.addOperand(MCOperand::CreateImm(Offset));
+ Inst.addOperand(MCOperand::CreateImm(Hint));
+
+ return MCDisassembler::Success;
+}
+
static DecodeStatus DecodeSyncI(MCInst &Inst,
unsigned Insn,
uint64_t Address,
@@ -1354,6 +1380,23 @@ static DecodeStatus DecodeFMem3(MCInst &Inst,
return MCDisassembler::Success;
}
+static DecodeStatus DecodeFMemCop2R6(MCInst &Inst,
+ unsigned Insn,
+ uint64_t Address,
+ const void *Decoder) {
+ int Offset = SignExtend32<11>(Insn & 0x07ff);
+ unsigned Reg = fieldFromInstruction(Insn, 16, 5);
+ unsigned Base = fieldFromInstruction(Insn, 11, 5);
+
+ Reg = getReg(Decoder, Mips::COP2RegClassID, Reg);
+ Base = getReg(Decoder, Mips::GPR32RegClassID, Base);
+
+ Inst.addOperand(MCOperand::CreateReg(Reg));
+ Inst.addOperand(MCOperand::CreateReg(Base));
+ Inst.addOperand(MCOperand::CreateImm(Offset));
+
+ return MCDisassembler::Success;
+}
static DecodeStatus DecodeSpecial3LlSc(MCInst &Inst,
unsigned Insn,
uint64_t Address,
diff --git a/contrib/llvm/lib/Target/Mips/Mips.td b/contrib/llvm/lib/Target/Mips/Mips.td
index 3e1d047..5ad5683 100644
--- a/contrib/llvm/lib/Target/Mips/Mips.td
+++ b/contrib/llvm/lib/Target/Mips/Mips.td
@@ -58,15 +58,15 @@ def MipsInstrInfo : InstrInfo;
//===----------------------------------------------------------------------===//
def FeatureNoABICalls : SubtargetFeature<"noabicalls", "NoABICalls", "true",
- "Disable SVR4-style position-independent code.">;
+ "Disable SVR4-style position-independent code">;
def FeatureGP64Bit : SubtargetFeature<"gp64", "IsGP64bit", "true",
- "General Purpose Registers are 64-bit wide.">;
+ "General Purpose Registers are 64-bit wide">;
def FeatureFP64Bit : SubtargetFeature<"fp64", "IsFP64bit", "true",
- "Support 64-bit FP registers.">;
+ "Support 64-bit FP registers">;
def FeatureFPXX : SubtargetFeature<"fpxx", "IsFPXX", "true",
- "Support for FPXX.">;
+ "Support for FPXX">;
def FeatureNaN2008 : SubtargetFeature<"nan2008", "IsNaN2008bit", "true",
- "IEEE 754-2008 NaN encoding.">;
+ "IEEE 754-2008 NaN encoding">;
def FeatureSingleFloat : SubtargetFeature<"single-float", "IsSingleFloat",
"true", "Only supports single precision float">;
def FeatureO32 : SubtargetFeature<"o32", "ABI", "MipsABIInfo::O32()",
@@ -81,7 +81,7 @@ def FeatureNoOddSPReg : SubtargetFeature<"nooddspreg", "UseOddSPReg", "false",
"Disable odd numbered single-precision "
"registers">;
def FeatureVFPU : SubtargetFeature<"vfpu", "HasVFPU",
- "true", "Enable vector FPU instructions.">;
+ "true", "Enable vector FPU instructions">;
def FeatureMips1 : SubtargetFeature<"mips1", "MipsArchVersion", "Mips1",
"Mips I ISA Support [highly experimental]">;
def FeatureMips2 : SubtargetFeature<"mips2", "MipsArchVersion", "Mips2",
diff --git a/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.cpp b/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.cpp
index 976becc..7e1fbfd 100644
--- a/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.cpp
+++ b/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.cpp
@@ -293,6 +293,9 @@ void Mips16InstrInfo::adjustStackPtrBigUnrestricted(
void Mips16InstrInfo::adjustStackPtr(unsigned SP, int64_t Amount,
MachineBasicBlock &MBB,
MachineBasicBlock::iterator I) const {
+ if (Amount == 0)
+ return;
+
if (isInt<16>(Amount)) // need to change to addiu sp, ....and isInt<16>
BuildAddiuSpImm(MBB, I, Amount);
else
diff --git a/contrib/llvm/lib/Target/Mips/Mips32r6InstrInfo.td b/contrib/llvm/lib/Target/Mips/Mips32r6InstrInfo.td
index 185d12e..49c6322 100644
--- a/contrib/llvm/lib/Target/Mips/Mips32r6InstrInfo.td
+++ b/contrib/llvm/lib/Target/Mips/Mips32r6InstrInfo.td
@@ -379,7 +379,6 @@ class JMP_IDX_COMPACT_DESC_BASE<string opstr, DAGOperand opnd,
list<dag> Pattern = [];
bit isTerminator = 1;
bit hasDelaySlot = 0;
- string DecoderMethod = "DecodeSimm16";
}
class JIALC_DESC : JMP_IDX_COMPACT_DESC_BASE<"jialc", calloffset16,
@@ -550,6 +549,7 @@ class CACHE_HINT_DESC<string instr_asm, Operand MemOpnd,
dag InOperandList = (ins MemOpnd:$addr, uimm5:$hint);
string AsmString = !strconcat(instr_asm, "\t$hint, $addr");
list<dag> Pattern = [];
+ string DecoderMethod = "DecodeCacheOpR6";
}
class CACHE_DESC : CACHE_HINT_DESC<"cache", mem_simm9, GPR32Opnd>;
@@ -561,6 +561,7 @@ class COP2LD_DESC_BASE<string instr_asm, RegisterOperand COPOpnd> {
string AsmString = !strconcat(instr_asm, "\t$rt, $addr");
list<dag> Pattern = [];
bit mayLoad = 1;
+ string DecoderMethod = "DecodeFMemCop2R6";
}
class LDC2_R6_DESC : COP2LD_DESC_BASE<"ldc2", COP2Opnd>;
@@ -572,6 +573,7 @@ class COP2ST_DESC_BASE<string instr_asm, RegisterOperand COPOpnd> {
string AsmString = !strconcat(instr_asm, "\t$rt, $addr");
list<dag> Pattern = [];
bit mayStore = 1;
+ string DecoderMethod = "DecodeFMemCop2R6";
}
class SDC2_R6_DESC : COP2ST_DESC_BASE<"sdc2", COP2Opnd>;
diff --git a/contrib/llvm/lib/Target/Mips/MipsCCState.cpp b/contrib/llvm/lib/Target/Mips/MipsCCState.cpp
index e18cc8b..b808129 100644
--- a/contrib/llvm/lib/Target/Mips/MipsCCState.cpp
+++ b/contrib/llvm/lib/Target/Mips/MipsCCState.cpp
@@ -132,8 +132,8 @@ void MipsCCState::PreAnalyzeFormalArgumentsForF128(
continue;
}
- assert(Ins[i].OrigArgIndex < MF.getFunction()->arg_size());
- std::advance(FuncArg, Ins[i].OrigArgIndex);
+ assert(Ins[i].getOrigArgIndex() < MF.getFunction()->arg_size());
+ std::advance(FuncArg, Ins[i].getOrigArgIndex());
OriginalArgWasF128.push_back(
originalTypeIsF128(FuncArg->getType(), nullptr));
diff --git a/contrib/llvm/lib/Target/Mips/MipsCallingConv.td b/contrib/llvm/lib/Target/Mips/MipsCallingConv.td
index 90bf9f3..dcd88f2 100644
--- a/contrib/llvm/lib/Target/Mips/MipsCallingConv.td
+++ b/contrib/llvm/lib/Target/Mips/MipsCallingConv.td
@@ -123,7 +123,7 @@ def CC_MipsN_SoftFloat : CallingConv<[
]>;
def CC_MipsN : CallingConv<[
- CCIfType<[i8, i16, i32],
+ CCIfType<[i8, i16, i32, i64],
CCIfSubtargetNot<"isLittle()",
CCIfInReg<CCPromoteToUpperBitsInType<i64>>>>,
@@ -159,6 +159,10 @@ def CC_MipsN : CallingConv<[
// N32/64 variable arguments.
// All arguments are passed in integer registers.
def CC_MipsN_VarArg : CallingConv<[
+ CCIfType<[i8, i16, i32, i64],
+ CCIfSubtargetNot<"isLittle()",
+ CCIfInReg<CCPromoteToUpperBitsInType<i64>>>>,
+
// All integers are promoted to 64-bit.
CCIfType<[i8, i16, i32], CCPromoteToType<i64>>,
diff --git a/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp b/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp
index c6045fe..37fc784 100644
--- a/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp
+++ b/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp
@@ -619,6 +619,33 @@ static SDValue performSELECTCombine(SDNode *N, SelectionDAG &DAG,
return SDValue();
}
+static SDValue performCMovFPCombine(SDNode *N, SelectionDAG &DAG,
+ TargetLowering::DAGCombinerInfo &DCI,
+ const MipsSubtarget &Subtarget) {
+ if (DCI.isBeforeLegalizeOps())
+ return SDValue();
+
+ SDValue ValueIfTrue = N->getOperand(0), ValueIfFalse = N->getOperand(2);
+
+ ConstantSDNode *FalseC = dyn_cast<ConstantSDNode>(ValueIfFalse);
+ if (!FalseC || FalseC->getZExtValue())
+ return SDValue();
+
+ // Since RHS (False) is 0, we swap the order of the True/False operands
+ // (obviously also inverting the condition) so that we can
+ // take advantage of conditional moves using the $0 register.
+ // Example:
+ // return (a != 0) ? x : 0;
+ // load $reg, x
+ // movz $reg, $0, a
+ unsigned Opc = (N->getOpcode() == MipsISD::CMovFP_T) ? MipsISD::CMovFP_F :
+ MipsISD::CMovFP_T;
+
+ SDValue FCC = N->getOperand(1), Glue = N->getOperand(3);
+ return DAG.getNode(Opc, SDLoc(N), ValueIfFalse.getValueType(),
+ ValueIfFalse, FCC, ValueIfTrue, Glue);
+}
+
static SDValue performANDCombine(SDNode *N, SelectionDAG &DAG,
TargetLowering::DAGCombinerInfo &DCI,
const MipsSubtarget &Subtarget) {
@@ -752,6 +779,9 @@ SDValue MipsTargetLowering::PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI)
return performDivRemCombine(N, DAG, DCI, Subtarget);
case ISD::SELECT:
return performSELECTCombine(N, DAG, DCI, Subtarget);
+ case MipsISD::CMovFP_F:
+ case MipsISD::CMovFP_T:
+ return performCMovFPCombine(N, DAG, DCI, Subtarget);
case ISD::AND:
return performANDCombine(N, DAG, DCI, Subtarget);
case ISD::OR:
@@ -2039,7 +2069,7 @@ SDValue MipsTargetLowering::lowerShiftLeftParts(SDValue Op,
SDValue Or = DAG.getNode(ISD::OR, DL, VT, ShiftLeftHi, ShiftRightLo);
SDValue ShiftLeftLo = DAG.getNode(ISD::SHL, DL, VT, Lo, Shamt);
SDValue Cond = DAG.getNode(ISD::AND, DL, MVT::i32, Shamt,
- DAG.getConstant(0x20, MVT::i32));
+ DAG.getConstant(VT.getSizeInBits(), MVT::i32));
Lo = DAG.getNode(ISD::SELECT, DL, VT, Cond,
DAG.getConstant(0, VT), ShiftLeftLo);
Hi = DAG.getNode(ISD::SELECT, DL, VT, Cond, ShiftLeftLo, Or);
@@ -2078,11 +2108,12 @@ SDValue MipsTargetLowering::lowerShiftRightParts(SDValue Op, SelectionDAG &DAG,
SDValue ShiftRightHi = DAG.getNode(IsSRA ? ISD::SRA : ISD::SRL,
DL, VT, Hi, Shamt);
SDValue Cond = DAG.getNode(ISD::AND, DL, MVT::i32, Shamt,
- DAG.getConstant(0x20, MVT::i32));
- SDValue Shift31 = DAG.getNode(ISD::SRA, DL, VT, Hi, DAG.getConstant(31, VT));
+ DAG.getConstant(VT.getSizeInBits(), MVT::i32));
+ SDValue Ext = DAG.getNode(ISD::SRA, DL, VT, Hi,
+ DAG.getConstant(VT.getSizeInBits() - 1, VT));
Lo = DAG.getNode(ISD::SELECT, DL, VT, Cond, ShiftRightHi, Or);
Hi = DAG.getNode(ISD::SELECT, DL, VT, Cond,
- IsSRA ? Shift31 : DAG.getConstant(0, VT), ShiftRightHi);
+ IsSRA ? Ext : DAG.getConstant(0, VT), ShiftRightHi);
SDValue Ops[2] = {Lo, Hi};
return DAG.getMergeValues(Ops, DL);
@@ -2902,13 +2933,16 @@ MipsTargetLowering::LowerFormalArguments(SDValue Chain,
for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
CCValAssign &VA = ArgLocs[i];
- std::advance(FuncArg, Ins[i].OrigArgIndex - CurArgIdx);
- CurArgIdx = Ins[i].OrigArgIndex;
+ if (Ins[i].isOrigArg()) {
+ std::advance(FuncArg, Ins[i].getOrigArgIndex() - CurArgIdx);
+ CurArgIdx = Ins[i].getOrigArgIndex();
+ }
EVT ValVT = VA.getValVT();
ISD::ArgFlagsTy Flags = Ins[i].Flags;
bool IsRegLoc = VA.isRegLoc();
if (Flags.isByVal()) {
+ assert(Ins[i].isOrigArg() && "Byval arguments cannot be implicit");
unsigned FirstByValReg, LastByValReg;
unsigned ByValIdx = CCInfo.getInRegsParamsProcessed();
CCInfo.getInRegsParamInfo(ByValIdx, FirstByValReg, LastByValReg);
@@ -3029,6 +3063,15 @@ MipsTargetLowering::CanLowerReturn(CallingConv::ID CallConv,
return CCInfo.CheckReturn(Outs, RetCC_Mips);
}
+bool
+MipsTargetLowering::shouldSignExtendTypeInLibCall(EVT Type, bool IsSigned) const {
+ if (Subtarget.hasMips3() && Subtarget.abiUsesSoftFloat()) {
+ if (Type == MVT::i32)
+ return true;
+ }
+ return IsSigned;
+}
+
SDValue
MipsTargetLowering::LowerReturn(SDValue Chain,
CallingConv::ID CallConv, bool IsVarArg,
diff --git a/contrib/llvm/lib/Target/Mips/MipsISelLowering.h b/contrib/llvm/lib/Target/Mips/MipsISelLowering.h
index 4132de6..4da337a 100644
--- a/contrib/llvm/lib/Target/Mips/MipsISelLowering.h
+++ b/contrib/llvm/lib/Target/Mips/MipsISelLowering.h
@@ -472,6 +472,8 @@ namespace llvm {
const SmallVectorImpl<SDValue> &OutVals,
SDLoc dl, SelectionDAG &DAG) const override;
+ bool shouldSignExtendTypeInLibCall(EVT Type, bool IsSigned) const override;
+
// Inline asm support
ConstraintType
getConstraintType(const std::string &Constraint) const override;
diff --git a/contrib/llvm/lib/Target/Mips/MipsInstrFPU.td b/contrib/llvm/lib/Target/Mips/MipsInstrFPU.td
index 2aa8328..ed97cb4 100644
--- a/contrib/llvm/lib/Target/Mips/MipsInstrFPU.td
+++ b/contrib/llvm/lib/Target/Mips/MipsInstrFPU.td
@@ -458,42 +458,42 @@ def FSUB_S : MMRel, ADDS_FT<"sub.s", FGR32Opnd, II_SUB_S, 0, fsub>,
defm FSUB : ADDS_M<"sub.d", II_SUB_D, 0, fsub>, ADDS_FM<0x01, 17>;
def MADD_S : MMRel, MADDS_FT<"madd.s", FGR32Opnd, II_MADD_S, fadd>,
- MADDS_FM<4, 0>, ISA_MIPS32R2_NOT_32R6_64R6;
+ MADDS_FM<4, 0>, INSN_MIPS4_32R2_NOT_32R6_64R6;
def MSUB_S : MMRel, MADDS_FT<"msub.s", FGR32Opnd, II_MSUB_S, fsub>,
- MADDS_FM<5, 0>, ISA_MIPS32R2_NOT_32R6_64R6;
+ MADDS_FM<5, 0>, INSN_MIPS4_32R2_NOT_32R6_64R6;
let AdditionalPredicates = [NoNaNsFPMath] in {
def NMADD_S : MMRel, NMADDS_FT<"nmadd.s", FGR32Opnd, II_NMADD_S, fadd>,
- MADDS_FM<6, 0>, ISA_MIPS32R2_NOT_32R6_64R6;
+ MADDS_FM<6, 0>, INSN_MIPS4_32R2_NOT_32R6_64R6;
def NMSUB_S : MMRel, NMADDS_FT<"nmsub.s", FGR32Opnd, II_NMSUB_S, fsub>,
- MADDS_FM<7, 0>, ISA_MIPS32R2_NOT_32R6_64R6;
+ MADDS_FM<7, 0>, INSN_MIPS4_32R2_NOT_32R6_64R6;
}
def MADD_D32 : MMRel, MADDS_FT<"madd.d", AFGR64Opnd, II_MADD_D, fadd>,
- MADDS_FM<4, 1>, ISA_MIPS32R2_NOT_32R6_64R6, FGR_32;
+ MADDS_FM<4, 1>, INSN_MIPS4_32R2_NOT_32R6_64R6, FGR_32;
def MSUB_D32 : MMRel, MADDS_FT<"msub.d", AFGR64Opnd, II_MSUB_D, fsub>,
- MADDS_FM<5, 1>, ISA_MIPS32R2_NOT_32R6_64R6, FGR_32;
+ MADDS_FM<5, 1>, INSN_MIPS4_32R2_NOT_32R6_64R6, FGR_32;
let AdditionalPredicates = [NoNaNsFPMath] in {
def NMADD_D32 : MMRel, NMADDS_FT<"nmadd.d", AFGR64Opnd, II_NMADD_D, fadd>,
- MADDS_FM<6, 1>, ISA_MIPS32R2_NOT_32R6_64R6, FGR_32;
+ MADDS_FM<6, 1>, INSN_MIPS4_32R2_NOT_32R6_64R6, FGR_32;
def NMSUB_D32 : MMRel, NMADDS_FT<"nmsub.d", AFGR64Opnd, II_NMSUB_D, fsub>,
- MADDS_FM<7, 1>, ISA_MIPS32R2_NOT_32R6_64R6, FGR_32;
+ MADDS_FM<7, 1>, INSN_MIPS4_32R2_NOT_32R6_64R6, FGR_32;
}
-let isCodeGenOnly=1 in {
+let DecoderNamespace = "Mips64" in {
def MADD_D64 : MADDS_FT<"madd.d", FGR64Opnd, II_MADD_D, fadd>,
- MADDS_FM<4, 1>, ISA_MIPS32R2_NOT_32R6_64R6, FGR_64;
+ MADDS_FM<4, 1>, INSN_MIPS4_32R2_NOT_32R6_64R6, FGR_64;
def MSUB_D64 : MADDS_FT<"msub.d", FGR64Opnd, II_MSUB_D, fsub>,
- MADDS_FM<5, 1>, ISA_MIPS32R2_NOT_32R6_64R6, FGR_64;
+ MADDS_FM<5, 1>, INSN_MIPS4_32R2_NOT_32R6_64R6, FGR_64;
}
let AdditionalPredicates = [NoNaNsFPMath],
- isCodeGenOnly=1 in {
+ DecoderNamespace = "Mips64" in {
def NMADD_D64 : NMADDS_FT<"nmadd.d", FGR64Opnd, II_NMADD_D, fadd>,
- MADDS_FM<6, 1>, ISA_MIPS32R2_NOT_32R6_64R6, FGR_64;
+ MADDS_FM<6, 1>, INSN_MIPS4_32R2_NOT_32R6_64R6, FGR_64;
def NMSUB_D64 : NMADDS_FT<"nmsub.d", FGR64Opnd, II_NMSUB_D, fsub>,
- MADDS_FM<7, 1>, ISA_MIPS32R2_NOT_32R6_64R6, FGR_64;
+ MADDS_FM<7, 1>, INSN_MIPS4_32R2_NOT_32R6_64R6, FGR_64;
}
//===----------------------------------------------------------------------===//
diff --git a/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.td b/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.td
index 2b3b6c1..1eb8d9a 100644
--- a/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.td
+++ b/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.td
@@ -388,6 +388,8 @@ def MSA128W: RegisterClass<"Mips", [v4i32, v4f32], 128,
(sequence "W%u", 0, 31)>;
def MSA128D: RegisterClass<"Mips", [v2i64, v2f64], 128,
(sequence "W%u", 0, 31)>;
+def MSA128WEvens: RegisterClass<"Mips", [v4i32, v4f32], 128,
+ (decimate (sequence "W%u", 0, 31), 2)>;
def MSACtrl: RegisterClass<"Mips", [i32], 32, (add
MSAIR, MSACSR, MSAAccess, MSASave, MSAModify, MSARequest, MSAMap, MSAUnmap)>;
diff --git a/contrib/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp b/contrib/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp
index cb7ac40..8c2620c 100644
--- a/contrib/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp
+++ b/contrib/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp
@@ -258,8 +258,12 @@ SDNode *MipsSEDAGToDAGISel::selectAddESubE(unsigned MOp, SDValue InFlag,
CurDAG->getTargetConstant(Mips::sub_32, VT));
}
- SDNode *AddCarry = CurDAG->getMachineNode(ADDuOp, DL, VT,
- SDValue(Carry, 0), RHS);
+ // Generate a second addition only if we know that RHS is not a
+ // constant-zero node.
+ SDNode *AddCarry = Carry;
+ ConstantSDNode *C = dyn_cast<ConstantSDNode>(RHS);
+ if (!C || C->getZExtValue())
+ AddCarry = CurDAG->getMachineNode(ADDuOp, DL, VT, SDValue(Carry, 0), RHS);
return CurDAG->SelectNodeTo(Node, MOp, VT, MVT::Glue, LHS,
SDValue(AddCarry, 0));
diff --git a/contrib/llvm/lib/Target/Mips/MipsSEISelLowering.cpp b/contrib/llvm/lib/Target/Mips/MipsSEISelLowering.cpp
index 3f865af..2c033ce 100644
--- a/contrib/llvm/lib/Target/Mips/MipsSEISelLowering.cpp
+++ b/contrib/llvm/lib/Target/Mips/MipsSEISelLowering.cpp
@@ -2883,10 +2883,21 @@ emitCOPY_FW(MachineInstr *MI, MachineBasicBlock *BB) const{
unsigned Ws = MI->getOperand(1).getReg();
unsigned Lane = MI->getOperand(2).getImm();
- if (Lane == 0)
- BuildMI(*BB, MI, DL, TII->get(Mips::COPY), Fd).addReg(Ws, 0, Mips::sub_lo);
- else {
- unsigned Wt = RegInfo.createVirtualRegister(&Mips::MSA128WRegClass);
+ if (Lane == 0) {
+ unsigned Wt = Ws;
+ if (!Subtarget.useOddSPReg()) {
+ // We must copy to an even-numbered MSA register so that the
+ // single-precision sub-register is also guaranteed to be even-numbered.
+ Wt = RegInfo.createVirtualRegister(&Mips::MSA128WEvensRegClass);
+
+ BuildMI(*BB, MI, DL, TII->get(Mips::COPY), Wt).addReg(Ws);
+ }
+
+ BuildMI(*BB, MI, DL, TII->get(Mips::COPY), Fd).addReg(Wt, 0, Mips::sub_lo);
+ } else {
+ unsigned Wt = RegInfo.createVirtualRegister(
+ Subtarget.useOddSPReg() ? &Mips::MSA128WRegClass :
+ &Mips::MSA128WEvensRegClass);
BuildMI(*BB, MI, DL, TII->get(Mips::SPLATI_W), Wt).addReg(Ws).addImm(Lane);
BuildMI(*BB, MI, DL, TII->get(Mips::COPY), Fd).addReg(Wt, 0, Mips::sub_lo);
@@ -2948,7 +2959,9 @@ MipsSETargetLowering::emitINSERT_FW(MachineInstr *MI,
unsigned Wd_in = MI->getOperand(1).getReg();
unsigned Lane = MI->getOperand(2).getImm();
unsigned Fs = MI->getOperand(3).getReg();
- unsigned Wt = RegInfo.createVirtualRegister(&Mips::MSA128WRegClass);
+ unsigned Wt = RegInfo.createVirtualRegister(
+ Subtarget.useOddSPReg() ? &Mips::MSA128WRegClass :
+ &Mips::MSA128WEvensRegClass);
BuildMI(*BB, MI, DL, TII->get(Mips::SUBREG_TO_REG), Wt)
.addImm(0)
diff --git a/contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp b/contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp
index 74f291f..180b043 100644
--- a/contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp
+++ b/contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp
@@ -364,6 +364,9 @@ void MipsSEInstrInfo::adjustStackPtr(unsigned SP, int64_t Amount,
unsigned ADDu = STI.isABI_N64() ? Mips::DADDu : Mips::ADDu;
unsigned ADDiu = STI.isABI_N64() ? Mips::DADDiu : Mips::ADDiu;
+ if (Amount == 0)
+ return;
+
if (isInt<16>(Amount))// addi sp, sp, amount
BuildMI(MBB, I, DL, get(ADDiu), SP).addReg(SP).addImm(Amount);
else { // Expand immediate that doesn't fit in 16-bit.
diff --git a/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
index 5c52bb1..e580c81 100644
--- a/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -2688,9 +2688,10 @@ PPCTargetLowering::LowerFormalArguments_64SVR4(
unsigned ObjSize = ObjectVT.getStoreSize();
unsigned ArgSize = ObjSize;
ISD::ArgFlagsTy Flags = Ins[ArgNo].Flags;
- std::advance(FuncArg, Ins[ArgNo].OrigArgIndex - CurArgIdx);
- CurArgIdx = Ins[ArgNo].OrigArgIndex;
-
+ if (Ins[ArgNo].isOrigArg()) {
+ std::advance(FuncArg, Ins[ArgNo].getOrigArgIndex() - CurArgIdx);
+ CurArgIdx = Ins[ArgNo].getOrigArgIndex();
+ }
/* Respect alignment of argument on the stack. */
unsigned Align =
CalculateStackSlotAlignment(ObjectVT, OrigVT, Flags, PtrByteSize);
@@ -2704,6 +2705,8 @@ PPCTargetLowering::LowerFormalArguments_64SVR4(
// FIXME the codegen can be much improved in some cases.
// We do not have to keep everything in memory.
if (Flags.isByVal()) {
+ assert(Ins[ArgNo].isOrigArg() && "Byval arguments cannot be implicit");
+
// ObjSize is the true size, ArgSize rounded up to multiple of registers.
ObjSize = Flags.getByValSize();
ArgSize = ((ObjSize + PtrByteSize - 1)/PtrByteSize) * PtrByteSize;
@@ -3064,9 +3067,10 @@ PPCTargetLowering::LowerFormalArguments_Darwin(
unsigned ObjSize = ObjectVT.getSizeInBits()/8;
unsigned ArgSize = ObjSize;
ISD::ArgFlagsTy Flags = Ins[ArgNo].Flags;
- std::advance(FuncArg, Ins[ArgNo].OrigArgIndex - CurArgIdx);
- CurArgIdx = Ins[ArgNo].OrigArgIndex;
-
+ if (Ins[ArgNo].isOrigArg()) {
+ std::advance(FuncArg, Ins[ArgNo].getOrigArgIndex() - CurArgIdx);
+ CurArgIdx = Ins[ArgNo].getOrigArgIndex();
+ }
unsigned CurArgOffset = ArgOffset;
// Varargs or 64 bit Altivec parameters are padded to a 16 byte boundary.
@@ -3087,6 +3091,8 @@ PPCTargetLowering::LowerFormalArguments_Darwin(
// FIXME the codegen can be much improved in some cases.
// We do not have to keep everything in memory.
if (Flags.isByVal()) {
+ assert(Ins[ArgNo].isOrigArg() && "Byval arguments cannot be implicit");
+
// ObjSize is the true size, ArgSize rounded up to multiple of registers.
ObjSize = Flags.getByValSize();
ArgSize = ((ObjSize + PtrByteSize - 1)/PtrByteSize) * PtrByteSize;
diff --git a/contrib/llvm/lib/Target/R600/AMDGPU.td b/contrib/llvm/lib/Target/R600/AMDGPU.td
index 1df4448..03f2bbe 100644
--- a/contrib/llvm/lib/Target/R600/AMDGPU.td
+++ b/contrib/llvm/lib/Target/R600/AMDGPU.td
@@ -97,6 +97,11 @@ def FeatureVGPRSpilling : SubtargetFeature<"vgpr-spilling",
"true",
"Enable spilling of VGPRs to scratch memory">;
+def FeatureSGPRInitBug : SubtargetFeature<"sgpr-init-bug",
+ "SGPRInitBug",
+ "true",
+ "VI SGPR initilization bug requiring a fixed SGPR allocation size">;
+
class SubtargetFeatureFetchLimit <string Value> :
SubtargetFeature <"fetch"#Value,
"TexVTXClauseSize",
diff --git a/contrib/llvm/lib/Target/R600/AMDGPUAlwaysInlinePass.cpp b/contrib/llvm/lib/Target/R600/AMDGPUAlwaysInlinePass.cpp
index b545b45..0b426bc 100644
--- a/contrib/llvm/lib/Target/R600/AMDGPUAlwaysInlinePass.cpp
+++ b/contrib/llvm/lib/Target/R600/AMDGPUAlwaysInlinePass.cpp
@@ -40,7 +40,8 @@ bool AMDGPUAlwaysInline::runOnModule(Module &M) {
std::vector<Function*> FuncsToClone;
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
Function &F = *I;
- if (!F.hasLocalLinkage() && !F.isDeclaration() && !F.use_empty())
+ if (!F.hasLocalLinkage() && !F.isDeclaration() && !F.use_empty() &&
+ !F.hasFnAttribute(Attribute::NoInline))
FuncsToClone.push_back(&F);
}
@@ -54,7 +55,7 @@ bool AMDGPUAlwaysInline::runOnModule(Module &M) {
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
Function &F = *I;
- if (F.hasLocalLinkage()) {
+ if (F.hasLocalLinkage() && !F.hasFnAttribute(Attribute::NoInline)) {
F.addFnAttr(Attribute::AlwaysInline);
}
}
diff --git a/contrib/llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp b/contrib/llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp
index 6185e36..1fae26e 100644
--- a/contrib/llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp
+++ b/contrib/llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp
@@ -343,6 +343,13 @@ void AMDGPUAsmPrinter::getSIProgramInfo(SIProgramInfo &ProgInfo,
ProgInfo.NumVGPR = MaxVGPR + 1;
ProgInfo.NumSGPR = MaxSGPR + 1;
+ if (STM.hasSGPRInitBug()) {
+ if (ProgInfo.NumSGPR > AMDGPUSubtarget::FIXED_SGPR_COUNT_FOR_INIT_BUG)
+ llvm_unreachable("Too many SGPRs used with the SGPR init bug");
+
+ ProgInfo.NumSGPR = AMDGPUSubtarget::FIXED_SGPR_COUNT_FOR_INIT_BUG;
+ }
+
ProgInfo.VGPRBlocks = (ProgInfo.NumVGPR - 1) / 4;
ProgInfo.SGPRBlocks = (ProgInfo.NumSGPR - 1) / 8;
// Set the value to initialize FP_ROUND and FP_DENORM parts of the mode
diff --git a/contrib/llvm/lib/Target/R600/AMDGPUISelDAGToDAG.cpp b/contrib/llvm/lib/Target/R600/AMDGPUISelDAGToDAG.cpp
index 15112c7..68d557a 100644
--- a/contrib/llvm/lib/Target/R600/AMDGPUISelDAGToDAG.cpp
+++ b/contrib/llvm/lib/Target/R600/AMDGPUISelDAGToDAG.cpp
@@ -439,6 +439,31 @@ SDNode *AMDGPUDAGToDAGISel::Select(SDNode *N) {
break;
}
+ case ISD::STORE: {
+ // Handle i64 stores here for the same reason mentioned above for loads.
+ StoreSDNode *ST = cast<StoreSDNode>(N);
+ SDValue Value = ST->getValue();
+ if (Value.getValueType() != MVT::i64 || ST->isTruncatingStore())
+ break;
+
+ SDValue NewValue = CurDAG->getNode(ISD::BITCAST, SDLoc(N),
+ MVT::v2i32, Value);
+ SDValue NewStore = CurDAG->getStore(ST->getChain(), SDLoc(N), NewValue,
+ ST->getBasePtr(), ST->getMemOperand());
+
+ CurDAG->ReplaceAllUsesOfValueWith(SDValue(N, 0), NewStore);
+
+ if (NewValue.getOpcode() == ISD::BITCAST) {
+ Select(NewStore.getNode());
+ return SelectCode(NewValue.getNode());
+ }
+
+ // getNode() may fold the bitcast if its input was another bitcast. If that
+ // happens we should only select the new store.
+ N = NewStore.getNode();
+ break;
+ }
+
case AMDGPUISD::REGISTER_LOAD: {
if (ST.getGeneration() <= AMDGPUSubtarget::NORTHERN_ISLANDS)
break;
@@ -761,6 +786,8 @@ SDNode *AMDGPUDAGToDAGISel::SelectADD_SUB_I64(SDNode *N) {
return CurDAG->SelectNodeTo(N, AMDGPU::REG_SEQUENCE, MVT::i64, Args);
}
+// We need to handle this here because tablegen doesn't support matching
+// instructions with multiple outputs.
SDNode *AMDGPUDAGToDAGISel::SelectDIV_SCALE(SDNode *N) {
SDLoc SL(N);
EVT VT = N->getValueType(0);
@@ -770,19 +797,12 @@ SDNode *AMDGPUDAGToDAGISel::SelectDIV_SCALE(SDNode *N) {
unsigned Opc
= (VT == MVT::f64) ? AMDGPU::V_DIV_SCALE_F64 : AMDGPU::V_DIV_SCALE_F32;
- const SDValue Zero = CurDAG->getTargetConstant(0, MVT::i32);
- const SDValue False = CurDAG->getTargetConstant(0, MVT::i1);
- SDValue Ops[] = {
- Zero, // src0_modifiers
- N->getOperand(0), // src0
- Zero, // src1_modifiers
- N->getOperand(1), // src1
- Zero, // src2_modifiers
- N->getOperand(2), // src2
- False, // clamp
- Zero // omod
- };
+ // src0_modifiers, src0, src1_modifiers, src1, src2_modifiers, src2, clamp, omod
+ SDValue Ops[8];
+ SelectVOP3Mods0(N->getOperand(0), Ops[1], Ops[0], Ops[6], Ops[7]);
+ SelectVOP3Mods(N->getOperand(1), Ops[3], Ops[2]);
+ SelectVOP3Mods(N->getOperand(2), Ops[5], Ops[4]);
return CurDAG->SelectNodeTo(N, Opc, VT, MVT::i1, Ops);
}
diff --git a/contrib/llvm/lib/Target/R600/AMDGPUISelLowering.cpp b/contrib/llvm/lib/Target/R600/AMDGPUISelLowering.cpp
index 2adcdf1..b137053 100644
--- a/contrib/llvm/lib/Target/R600/AMDGPUISelLowering.cpp
+++ b/contrib/llvm/lib/Target/R600/AMDGPUISelLowering.cpp
@@ -141,9 +141,6 @@ AMDGPUTargetLowering::AMDGPUTargetLowering(TargetMachine &TM) :
setOperationAction(ISD::STORE, MVT::v2f32, Promote);
AddPromotedToType(ISD::STORE, MVT::v2f32, MVT::v2i32);
- setOperationAction(ISD::STORE, MVT::i64, Promote);
- AddPromotedToType(ISD::STORE, MVT::i64, MVT::v2i32);
-
setOperationAction(ISD::STORE, MVT::v4f32, Promote);
AddPromotedToType(ISD::STORE, MVT::v4f32, MVT::v4i32);
@@ -162,9 +159,6 @@ AMDGPUTargetLowering::AMDGPUTargetLowering(TargetMachine &TM) :
// Custom lowering of vector stores is required for local address space
// stores.
setOperationAction(ISD::STORE, MVT::v4i32, Custom);
- // XXX: Native v2i32 local address space stores are possible, but not
- // currently implemented.
- setOperationAction(ISD::STORE, MVT::v2i32, Custom);
setTruncStoreAction(MVT::v2i32, MVT::v2i16, Custom);
setTruncStoreAction(MVT::v2i32, MVT::v2i8, Custom);
@@ -832,11 +826,9 @@ SDValue AMDGPUTargetLowering::LowerGlobalAddress(AMDGPUMachineFunction* MFI,
SDValue AMDGPUTargetLowering::LowerCONCAT_VECTORS(SDValue Op,
SelectionDAG &DAG) const {
SmallVector<SDValue, 8> Args;
- SDValue A = Op.getOperand(0);
- SDValue B = Op.getOperand(1);
- DAG.ExtractVectorElements(A, Args);
- DAG.ExtractVectorElements(B, Args);
+ for (const SDUse &U : Op->ops())
+ DAG.ExtractVectorElements(U.get(), Args);
return DAG.getNode(ISD::BUILD_VECTOR, SDLoc(Op), Op.getValueType(), Args);
}
@@ -881,9 +873,6 @@ SDValue AMDGPUTargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op,
return LowerIntrinsicIABS(Op, DAG);
case AMDGPUIntrinsic::AMDGPU_lrp:
return LowerIntrinsicLRP(Op, DAG);
- case AMDGPUIntrinsic::AMDGPU_fract:
- case AMDGPUIntrinsic::AMDIL_fraction: // Legacy name.
- return DAG.getNode(AMDGPUISD::FRACT, DL, VT, Op.getOperand(1));
case AMDGPUIntrinsic::AMDGPU_clamp:
case AMDGPUIntrinsic::AMDIL_clamp: // Legacy name.
@@ -913,10 +902,9 @@ SDValue AMDGPUTargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op,
}
case Intrinsic::AMDGPU_div_fmas:
- // FIXME: Dropping bool parameter. Work is needed to support the implicit
- // read from VCC.
return DAG.getNode(AMDGPUISD::DIV_FMAS, DL, VT,
- Op.getOperand(1), Op.getOperand(2), Op.getOperand(3));
+ Op.getOperand(1), Op.getOperand(2), Op.getOperand(3),
+ Op.getOperand(4));
case Intrinsic::AMDGPU_div_fixup:
return DAG.getNode(AMDGPUISD::DIV_FIXUP, DL, VT,
diff --git a/contrib/llvm/lib/Target/R600/AMDGPUInstrInfo.h b/contrib/llvm/lib/Target/R600/AMDGPUInstrInfo.h
index e28ce0f..202183c 100644
--- a/contrib/llvm/lib/Target/R600/AMDGPUInstrInfo.h
+++ b/contrib/llvm/lib/Target/R600/AMDGPUInstrInfo.h
@@ -140,6 +140,12 @@ public:
/// not exist. If Opcode is not a pseudo instruction, this is identity.
int pseudoToMCOpcode(int Opcode) const;
+ /// \brief Return the descriptor of the target-specific machine instruction
+ /// that corresponds to the specified pseudo or native opcode.
+ const MCInstrDesc &getMCOpcodeFromPseudo(unsigned Opcode) const {
+ return get(pseudoToMCOpcode(Opcode));
+ }
+
//===---------------------------------------------------------------------===//
// Pure virtual funtions to be implemented by sub-classes.
//===---------------------------------------------------------------------===//
diff --git a/contrib/llvm/lib/Target/R600/AMDGPUInstrInfo.td b/contrib/llvm/lib/Target/R600/AMDGPUInstrInfo.td
index 0e34392b..d657ad0 100644
--- a/contrib/llvm/lib/Target/R600/AMDGPUInstrInfo.td
+++ b/contrib/llvm/lib/Target/R600/AMDGPUInstrInfo.td
@@ -35,6 +35,11 @@ def AMDGPUDivScaleOp : SDTypeProfile<2, 3,
[SDTCisFP<0>, SDTCisInt<1>, SDTCisSameAs<0, 2>, SDTCisSameAs<0, 3>, SDTCisSameAs<0, 4>]
>;
+// float, float, float, vcc
+def AMDGPUFmasOp : SDTypeProfile<1, 4,
+ [SDTCisFP<0>, SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisSameAs<0, 3>, SDTCisInt<4>]
+>;
+
//===----------------------------------------------------------------------===//
// AMDGPU DAG Nodes
//
@@ -153,7 +158,7 @@ def AMDGPUdiv_scale : SDNode<"AMDGPUISD::DIV_SCALE", AMDGPUDivScaleOp>;
// Special case divide FMA with scale and flags (src0 = Quotient,
// src1 = Denominator, src2 = Numerator).
-def AMDGPUdiv_fmas : SDNode<"AMDGPUISD::DIV_FMAS", SDTFPTernaryOp>;
+def AMDGPUdiv_fmas : SDNode<"AMDGPUISD::DIV_FMAS", AMDGPUFmasOp>;
// Single or double precision division fixup.
// Special case divide fixup and flags(src0 = Quotient, src1 =
diff --git a/contrib/llvm/lib/Target/R600/AMDGPUInstructions.td b/contrib/llvm/lib/Target/R600/AMDGPUInstructions.td
index 4e536c3..34b1fc8 100644
--- a/contrib/llvm/lib/Target/R600/AMDGPUInstructions.td
+++ b/contrib/llvm/lib/Target/R600/AMDGPUInstructions.td
@@ -164,10 +164,6 @@ class PrivateStore <SDPatternOperator op> : PrivateMemOp <
(ops node:$value, node:$ptr), (op node:$value, node:$ptr)
>;
-def extloadi8_private : PrivateLoad <extloadi8>;
-def sextloadi8_private : PrivateLoad <sextloadi8>;
-def extloadi16_private : PrivateLoad <extloadi16>;
-def sextloadi16_private : PrivateLoad <sextloadi16>;
def load_private : PrivateLoad <load>;
def truncstorei8_private : PrivateStore <truncstorei8>;
@@ -231,6 +227,9 @@ def sextloadi8_local : PatFrag<(ops node:$ptr), (sextloadi8 node:$ptr), [{
return isLocalLoad(dyn_cast<LoadSDNode>(N));
}]>;
+def extloadi8_private : PrivateLoad <az_extloadi8>;
+def sextloadi8_private : PrivateLoad <sextloadi8>;
+
def az_extloadi16 : PatFrag<(ops node:$ptr), (az_extload node:$ptr), [{
return cast<LoadSDNode>(N)->getMemoryVT() == MVT::i16;
}]>;
@@ -267,6 +266,9 @@ def sextloadi16_local : PatFrag<(ops node:$ptr), (sextloadi16 node:$ptr), [{
return isLocalLoad(dyn_cast<LoadSDNode>(N));
}]>;
+def extloadi16_private : PrivateLoad <az_extloadi16>;
+def sextloadi16_private : PrivateLoad <sextloadi16>;
+
def az_extloadi32 : PatFrag<(ops node:$ptr), (az_extload node:$ptr), [{
return cast<LoadSDNode>(N)->getMemoryVT() == MVT::i32;
}]>;
@@ -649,17 +651,10 @@ class RcpPat<Instruction RcpInst, ValueType vt> : Pat <
(RcpInst $src)
>;
-multiclass RsqPat<Instruction RsqInst, ValueType vt> {
- def : Pat <
- (fdiv FP_ONE, (fsqrt vt:$src)),
- (RsqInst $src)
- >;
-
- def : Pat <
- (AMDGPUrcp (fsqrt vt:$src)),
- (RsqInst $src)
- >;
-}
+class RsqPat<Instruction RsqInst, ValueType vt> : Pat <
+ (AMDGPUrcp (fsqrt vt:$src)),
+ (RsqInst $src)
+>;
include "R600Instructions.td"
include "R700Instructions.td"
diff --git a/contrib/llvm/lib/Target/R600/AMDGPUIntrinsics.td b/contrib/llvm/lib/Target/R600/AMDGPUIntrinsics.td
index eee9c29..ab489cd 100644
--- a/contrib/llvm/lib/Target/R600/AMDGPUIntrinsics.td
+++ b/contrib/llvm/lib/Target/R600/AMDGPUIntrinsics.td
@@ -68,6 +68,7 @@ let TargetPrefix = "AMDGPU", isTarget = 1 in {
def int_AMDGPU_bfe_u32 : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
def int_AMDGPU_bfm : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
def int_AMDGPU_brev : Intrinsic<[llvm_i32_ty], [llvm_i32_ty], [IntrNoMem]>;
+ def int_AMDGPU_flbit_i32 : Intrinsic<[llvm_i32_ty], [llvm_i32_ty], [IntrNoMem]>;
def int_AMDGPU_barrier_local : Intrinsic<[], [], []>;
def int_AMDGPU_barrier_global : Intrinsic<[], [], []>;
}
diff --git a/contrib/llvm/lib/Target/R600/AMDGPUSubtarget.cpp b/contrib/llvm/lib/Target/R600/AMDGPUSubtarget.cpp
index b1c7498..87cdb5f 100644
--- a/contrib/llvm/lib/Target/R600/AMDGPUSubtarget.cpp
+++ b/contrib/llvm/lib/Target/R600/AMDGPUSubtarget.cpp
@@ -80,7 +80,7 @@ AMDGPUSubtarget::AMDGPUSubtarget(StringRef TT, StringRef GPU, StringRef FS,
FlatAddressSpace(false), EnableIRStructurizer(true),
EnablePromoteAlloca(false), EnableIfCvt(true),
EnableLoadStoreOpt(false), WavefrontSize(0), CFALUBug(false), LocalMemorySize(0),
- EnableVGPRSpilling(false),
+ EnableVGPRSpilling(false),SGPRInitBug(false),
DL(computeDataLayout(initializeSubtargetDependencies(GPU, FS))),
FrameLowering(TargetFrameLowering::StackGrowsUp,
64 * 16, // Maximum stack alignment (long16)
diff --git a/contrib/llvm/lib/Target/R600/AMDGPUSubtarget.h b/contrib/llvm/lib/Target/R600/AMDGPUSubtarget.h
index 566b45c..eeb41d3 100644
--- a/contrib/llvm/lib/Target/R600/AMDGPUSubtarget.h
+++ b/contrib/llvm/lib/Target/R600/AMDGPUSubtarget.h
@@ -45,6 +45,10 @@ public:
VOLCANIC_ISLANDS,
};
+ enum {
+ FIXED_SGPR_COUNT_FOR_INIT_BUG = 80
+ };
+
private:
std::string DevName;
bool Is64bit;
@@ -66,6 +70,7 @@ private:
bool CFALUBug;
int LocalMemorySize;
bool EnableVGPRSpilling;
+ bool SGPRInitBug;
const DataLayout DL;
AMDGPUFrameLowering FrameLowering;
@@ -203,6 +208,10 @@ public:
return LocalMemorySize;
}
+ bool hasSGPRInitBug() const {
+ return SGPRInitBug;
+ }
+
unsigned getAmdKernelCodeChipID() const;
bool enableMachineScheduler() const override {
diff --git a/contrib/llvm/lib/Target/R600/CaymanInstructions.td b/contrib/llvm/lib/Target/R600/CaymanInstructions.td
index 58b5ce2..433c3fc 100644
--- a/contrib/llvm/lib/Target/R600/CaymanInstructions.td
+++ b/contrib/llvm/lib/Target/R600/CaymanInstructions.td
@@ -46,7 +46,7 @@ def SIN_cm : SIN_Common<0x8D>;
def COS_cm : COS_Common<0x8E>;
} // End isVector = 1
-defm : RsqPat<RECIPSQRT_IEEE_cm, f32>;
+def : RsqPat<RECIPSQRT_IEEE_cm, f32>;
def : POW_Common <LOG_IEEE_cm, EXP_IEEE_cm, MUL>;
diff --git a/contrib/llvm/lib/Target/R600/EvergreenInstructions.td b/contrib/llvm/lib/Target/R600/EvergreenInstructions.td
index f24f76b..299d1fa 100644
--- a/contrib/llvm/lib/Target/R600/EvergreenInstructions.td
+++ b/contrib/llvm/lib/Target/R600/EvergreenInstructions.td
@@ -69,7 +69,7 @@ def EXP_IEEE_eg : EXP_IEEE_Common<0x81>;
def LOG_IEEE_eg : LOG_IEEE_Common<0x83>;
def RECIP_CLAMPED_eg : RECIP_CLAMPED_Common<0x84>;
def RECIPSQRT_IEEE_eg : RECIPSQRT_IEEE_Common<0x89>;
-defm : RsqPat<RECIPSQRT_IEEE_eg, f32>;
+def : RsqPat<RECIPSQRT_IEEE_eg, f32>;
def SIN_eg : SIN_Common<0x8D>;
def COS_eg : COS_Common<0x8E>;
diff --git a/contrib/llvm/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp b/contrib/llvm/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp
index 8271c6f..b66ed10 100644
--- a/contrib/llvm/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp
+++ b/contrib/llvm/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp
@@ -291,6 +291,8 @@ void AMDGPUInstPrinter::printOperand(const MCInst *MI, unsigned OpNo,
printImmediate64(Op.getImm(), O);
else
llvm_unreachable("Invalid register class size");
+ } else if (Desc.OpInfo[OpNo].OperandType == MCOI::OPERAND_IMMEDIATE) {
+ printImmediate32(Op.getImm(), O);
} else {
// We hit this for the immediate instruction bits that don't yet have a
// custom printer.
diff --git a/contrib/llvm/lib/Target/R600/Processors.td b/contrib/llvm/lib/Target/R600/Processors.td
index cff97cd..e5fef0c 100644
--- a/contrib/llvm/lib/Target/R600/Processors.td
+++ b/contrib/llvm/lib/Target/R600/Processors.td
@@ -113,8 +113,12 @@ def : ProcessorModel<"mullins", SIQuarterSpeedModel, [FeatureSeaIslands]>;
// Volcanic Islands
//===----------------------------------------------------------------------===//
-def : ProcessorModel<"tonga", SIFullSpeedModel, [FeatureVolcanicIslands]>;
+def : ProcessorModel<"tonga", SIQuarterSpeedModel,
+ [FeatureVolcanicIslands, FeatureSGPRInitBug]
+>;
-def : ProcessorModel<"iceland", SIQuarterSpeedModel, [FeatureVolcanicIslands]>;
+def : ProcessorModel<"iceland", SIQuarterSpeedModel,
+ [FeatureVolcanicIslands, FeatureSGPRInitBug]
+>;
def : ProcessorModel<"carrizo", SIQuarterSpeedModel, [FeatureVolcanicIslands]>;
diff --git a/contrib/llvm/lib/Target/R600/R600ISelLowering.cpp b/contrib/llvm/lib/Target/R600/R600ISelLowering.cpp
index 595f698..2e1b094 100644
--- a/contrib/llvm/lib/Target/R600/R600ISelLowering.cpp
+++ b/contrib/llvm/lib/Target/R600/R600ISelLowering.cpp
@@ -838,6 +838,10 @@ SDValue R600TargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) const
case Intrinsic::AMDGPU_rsq:
// XXX - I'm assuming SI's RSQ_LEGACY matches R600's behavior.
return DAG.getNode(AMDGPUISD::RSQ_LEGACY, DL, VT, Op.getOperand(1));
+
+ case AMDGPUIntrinsic::AMDGPU_fract:
+ case AMDGPUIntrinsic::AMDIL_fraction: // Legacy name.
+ return DAG.getNode(AMDGPUISD::FRACT, DL, VT, Op.getOperand(1));
}
// break out of case ISD::INTRINSIC_WO_CHAIN in switch(Op.getOpcode())
break;
@@ -1694,7 +1698,7 @@ SDValue R600TargetLowering::LowerFormalArguments(
// XXX - I think PartOffset should give you this, but it seems to give the
// size of the register which isn't useful.
- unsigned ValBase = ArgLocs[In.OrigArgIndex].getLocMemOffset();
+ unsigned ValBase = ArgLocs[In.getOrigArgIndex()].getLocMemOffset();
unsigned PartOffset = VA.getLocMemOffset();
unsigned Offset = 36 + VA.getLocMemOffset();
diff --git a/contrib/llvm/lib/Target/R600/R600Instructions.td b/contrib/llvm/lib/Target/R600/R600Instructions.td
index b1d3ce2..05957d2 100644
--- a/contrib/llvm/lib/Target/R600/R600Instructions.td
+++ b/contrib/llvm/lib/Target/R600/R600Instructions.td
@@ -1193,7 +1193,7 @@ let Predicates = [isR600] in {
def TGSI_LIT_Z_r600 : TGSI_LIT_Z_Common<MUL_LIT_r600, LOG_CLAMPED_r600, EXP_IEEE_r600>;
def : Pat<(fsqrt f32:$src), (MUL $src, (RECIPSQRT_CLAMPED_r600 $src))>;
- defm : RsqPat<RECIPSQRT_IEEE_r600, f32>;
+ def : RsqPat<RECIPSQRT_IEEE_r600, f32>;
def : FROUNDPat <CNDGE_r600, CNDGT_r600>;
diff --git a/contrib/llvm/lib/Target/R600/SIAnnotateControlFlow.cpp b/contrib/llvm/lib/Target/R600/SIAnnotateControlFlow.cpp
index c99219d..b8165fb 100644
--- a/contrib/llvm/lib/Target/R600/SIAnnotateControlFlow.cpp
+++ b/contrib/llvm/lib/Target/R600/SIAnnotateControlFlow.cpp
@@ -83,7 +83,7 @@ class SIAnnotateControlFlow : public FunctionPass {
void insertElse(BranchInst *Term);
- Value *handleLoopCondition(Value *Cond, PHINode *Broken);
+ Value *handleLoopCondition(Value *Cond, PHINode *Broken, llvm::Loop *L);
void handleLoop(BranchInst *Term);
@@ -207,8 +207,17 @@ void SIAnnotateControlFlow::insertElse(BranchInst *Term) {
}
/// \brief Recursively handle the condition leading to a loop
-Value *SIAnnotateControlFlow::handleLoopCondition(Value *Cond, PHINode *Broken) {
- if (PHINode *Phi = dyn_cast<PHINode>(Cond)) {
+Value *SIAnnotateControlFlow::handleLoopCondition(Value *Cond, PHINode *Broken,
+ llvm::Loop *L) {
+
+ // Only search through PHI nodes which are inside the loop. If we try this
+ // with PHI nodes that are outside of the loop, we end up inserting new PHI
+ // nodes outside of the loop which depend on values defined inside the loop.
+ // This will break the module with
+ // 'Instruction does not dominate all users!' errors.
+ PHINode *Phi = nullptr;
+ if ((Phi = dyn_cast<PHINode>(Cond)) && L->contains(Phi)) {
+
BasicBlock *Parent = Phi->getParent();
PHINode *NewPhi = PHINode::Create(Int64, 0, "", &Parent->front());
Value *Ret = NewPhi;
@@ -223,7 +232,7 @@ Value *SIAnnotateControlFlow::handleLoopCondition(Value *Cond, PHINode *Broken)
}
Phi->setIncomingValue(i, BoolFalse);
- Value *PhiArg = handleLoopCondition(Incoming, Broken);
+ Value *PhiArg = handleLoopCondition(Incoming, Broken, L);
NewPhi->addIncoming(PhiArg, From);
}
@@ -253,7 +262,12 @@ Value *SIAnnotateControlFlow::handleLoopCondition(Value *Cond, PHINode *Broken)
} else if (Instruction *Inst = dyn_cast<Instruction>(Cond)) {
BasicBlock *Parent = Inst->getParent();
- TerminatorInst *Insert = Parent->getTerminator();
+ Instruction *Insert;
+ if (L->contains(Inst)) {
+ Insert = Parent->getTerminator();
+ } else {
+ Insert = L->getHeader()->getFirstNonPHIOrDbgOrLifetime();
+ }
Value *Args[] = { Cond, Broken };
return CallInst::Create(IfBreak, Args, "", Insert);
@@ -265,14 +279,15 @@ Value *SIAnnotateControlFlow::handleLoopCondition(Value *Cond, PHINode *Broken)
/// \brief Handle a back edge (loop)
void SIAnnotateControlFlow::handleLoop(BranchInst *Term) {
+ BasicBlock *BB = Term->getParent();
+ llvm::Loop *L = LI->getLoopFor(BB);
BasicBlock *Target = Term->getSuccessor(1);
PHINode *Broken = PHINode::Create(Int64, 0, "", &Target->front());
Value *Cond = Term->getCondition();
Term->setCondition(BoolTrue);
- Value *Arg = handleLoopCondition(Cond, Broken);
+ Value *Arg = handleLoopCondition(Cond, Broken, L);
- BasicBlock *BB = Term->getParent();
for (pred_iterator PI = pred_begin(Target), PE = pred_end(Target);
PI != PE; ++PI) {
diff --git a/contrib/llvm/lib/Target/R600/SIDefines.h b/contrib/llvm/lib/Target/R600/SIDefines.h
index 7601794..b540140 100644
--- a/contrib/llvm/lib/Target/R600/SIDefines.h
+++ b/contrib/llvm/lib/Target/R600/SIDefines.h
@@ -35,7 +35,8 @@ enum {
SMRD = 1 << 16,
DS = 1 << 17,
MIMG = 1 << 18,
- FLAT = 1 << 19
+ FLAT = 1 << 19,
+ WQM = 1 << 20
};
}
diff --git a/contrib/llvm/lib/Target/R600/SIFoldOperands.cpp b/contrib/llvm/lib/Target/R600/SIFoldOperands.cpp
index d8ffa4f..cb24bba 100644
--- a/contrib/llvm/lib/Target/R600/SIFoldOperands.cpp
+++ b/contrib/llvm/lib/Target/R600/SIFoldOperands.cpp
@@ -209,7 +209,12 @@ bool SIFoldOperands::runOnMachineFunction(MachineFunction &MF) {
APInt Imm;
if (FoldingImm) {
- const TargetRegisterClass *UseRC = MRI.getRegClass(UseOp.getReg());
+ unsigned UseReg = UseOp.getReg();
+ const TargetRegisterClass *UseRC
+ = TargetRegisterInfo::isVirtualRegister(UseReg) ?
+ MRI.getRegClass(UseReg) :
+ TRI.getRegClass(UseReg);
+
Imm = APInt(64, OpToFold.getImm());
// Split 64-bit constants into 32-bits for folding.
@@ -228,8 +233,13 @@ bool SIFoldOperands::runOnMachineFunction(MachineFunction &MF) {
// In order to fold immediates into copies, we need to change the
// copy to a MOV.
if (UseMI->getOpcode() == AMDGPU::COPY) {
- unsigned MovOp = TII->getMovOpcode(
- MRI.getRegClass(UseMI->getOperand(0).getReg()));
+ unsigned DestReg = UseMI->getOperand(0).getReg();
+ const TargetRegisterClass *DestRC
+ = TargetRegisterInfo::isVirtualRegister(DestReg) ?
+ MRI.getRegClass(DestReg) :
+ TRI.getRegClass(DestReg);
+
+ unsigned MovOp = TII->getMovOpcode(DestRC);
if (MovOp == AMDGPU::COPY)
continue;
diff --git a/contrib/llvm/lib/Target/R600/SIISelLowering.cpp b/contrib/llvm/lib/Target/R600/SIISelLowering.cpp
index 6b2ea06..32ae605 100644
--- a/contrib/llvm/lib/Target/R600/SIISelLowering.cpp
+++ b/contrib/llvm/lib/Target/R600/SIISelLowering.cpp
@@ -89,8 +89,6 @@ SITargetLowering::SITargetLowering(TargetMachine &TM) :
setOperationAction(ISD::STORE, MVT::v16i32, Custom);
setOperationAction(ISD::STORE, MVT::i1, Custom);
- setOperationAction(ISD::STORE, MVT::i32, Custom);
- setOperationAction(ISD::STORE, MVT::v2i32, Custom);
setOperationAction(ISD::STORE, MVT::v4i32, Custom);
setOperationAction(ISD::SELECT, MVT::i64, Custom);
@@ -158,8 +156,6 @@ SITargetLowering::SITargetLowering(TargetMachine &TM) :
for (MVT VT : MVT::fp_valuetypes())
setLoadExtAction(ISD::EXTLOAD, VT, MVT::f32, Expand);
- setTruncStoreAction(MVT::i32, MVT::i8, Custom);
- setTruncStoreAction(MVT::i32, MVT::i16, Custom);
setTruncStoreAction(MVT::f64, MVT::f32, Expand);
setTruncStoreAction(MVT::i64, MVT::i32, Expand);
setTruncStoreAction(MVT::v8i32, MVT::v8i16, Expand);
@@ -214,6 +210,7 @@ SITargetLowering::SITargetLowering(TargetMachine &TM) :
}
setOperationAction(ISD::FDIV, MVT::f32, Custom);
+ setOperationAction(ISD::FDIV, MVT::f64, Custom);
setTargetDAGCombine(ISD::FADD);
setTargetDAGCombine(ISD::FSUB);
@@ -314,9 +311,8 @@ bool SITargetLowering::allowsMisalignedMemoryAccesses(EVT VT,
if (!VT.isSimple() || VT == MVT::Other)
return false;
- // XXX - CI changes say "Support for unaligned memory accesses" but I don't
- // see what for specifically. The wording everywhere else seems to be the
- // same.
+ // TODO - CI+ supports unaligned memory accesses, but this requires driver
+ // support.
// XXX - The only mention I see of this in the ISA manual is for LDS direct
// reads the "byte address and must be dword aligned". Is it also true for the
@@ -328,12 +324,18 @@ bool SITargetLowering::allowsMisalignedMemoryAccesses(EVT VT,
return Align % 4 == 0;
}
+ // Smaller than dword value must be aligned.
+ // FIXME: This should be allowed on CI+
+ if (VT.bitsLT(MVT::i32))
+ return false;
+
// 8.1.6 - For Dword or larger reads or writes, the two LSBs of the
// byte-address are ignored, thus forcing Dword alignment.
// This applies to private, global, and constant memory.
if (IsFast)
*IsFast = true;
- return VT.bitsGT(MVT::i32);
+
+ return VT.bitsGT(MVT::i32) && Align % 4 == 0;
}
EVT SITargetLowering::getOptimalMemOpType(uint64_t Size, unsigned DstAlign,
@@ -448,7 +450,7 @@ SDValue SITargetLowering::LowerFormalArguments(
// We REALLY want the ORIGINAL number of vertex elements here, e.g. a
// three or five element vertex only needs three or five registers,
// NOT four or eigth.
- Type *ParamType = FType->getParamType(Arg.OrigArgIndex);
+ Type *ParamType = FType->getParamType(Arg.getOrigArgIndex());
unsigned NumElements = ParamType->getVectorNumElements();
for (unsigned j = 0; j != NumElements; ++j) {
@@ -531,7 +533,7 @@ SDValue SITargetLowering::LowerFormalArguments(
Offset, Ins[i].Flags.isSExt());
const PointerType *ParamTy =
- dyn_cast<PointerType>(FType->getParamType(Ins[i].OrigArgIndex));
+ dyn_cast<PointerType>(FType->getParamType(Ins[i].getOrigArgIndex()));
if (Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS &&
ParamTy && ParamTy->getAddressSpace() == AMDGPUAS::LOCAL_ADDRESS) {
// On SI local pointers are just offsets into LDS, so they are always
@@ -566,7 +568,7 @@ SDValue SITargetLowering::LowerFormalArguments(
if (Arg.VT.isVector()) {
// Build a vector from the registers
- Type *ParamType = FType->getParamType(Arg.OrigArgIndex);
+ Type *ParamType = FType->getParamType(Arg.getOrigArgIndex());
unsigned NumElements = ParamType->getVectorNumElements();
SmallVector<SDValue, 4> Regs;
@@ -919,6 +921,12 @@ SDValue SITargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op,
Op.getOperand(1),
Op.getOperand(2),
Op.getOperand(3));
+
+ case AMDGPUIntrinsic::AMDGPU_fract:
+ case AMDGPUIntrinsic::AMDIL_fraction: // Legacy name.
+ return DAG.getNode(ISD::FSUB, DL, VT, Op.getOperand(1),
+ DAG.getNode(ISD::FFLOOR, DL, VT, Op.getOperand(1)));
+
default:
return AMDGPUTargetLowering::LowerOperation(Op, DAG);
}
@@ -1104,7 +1112,70 @@ SDValue SITargetLowering::LowerFDIV32(SDValue Op, SelectionDAG &DAG) const {
}
SDValue SITargetLowering::LowerFDIV64(SDValue Op, SelectionDAG &DAG) const {
- return SDValue();
+ if (DAG.getTarget().Options.UnsafeFPMath)
+ return LowerFastFDIV(Op, DAG);
+
+ SDLoc SL(Op);
+ SDValue X = Op.getOperand(0);
+ SDValue Y = Op.getOperand(1);
+
+ const SDValue One = DAG.getConstantFP(1.0, MVT::f64);
+
+ SDVTList ScaleVT = DAG.getVTList(MVT::f64, MVT::i1);
+
+ SDValue DivScale0 = DAG.getNode(AMDGPUISD::DIV_SCALE, SL, ScaleVT, Y, Y, X);
+
+ SDValue NegDivScale0 = DAG.getNode(ISD::FNEG, SL, MVT::f64, DivScale0);
+
+ SDValue Rcp = DAG.getNode(AMDGPUISD::RCP, SL, MVT::f64, DivScale0);
+
+ SDValue Fma0 = DAG.getNode(ISD::FMA, SL, MVT::f64, NegDivScale0, Rcp, One);
+
+ SDValue Fma1 = DAG.getNode(ISD::FMA, SL, MVT::f64, Rcp, Fma0, Rcp);
+
+ SDValue Fma2 = DAG.getNode(ISD::FMA, SL, MVT::f64, NegDivScale0, Fma1, One);
+
+ SDValue DivScale1 = DAG.getNode(AMDGPUISD::DIV_SCALE, SL, ScaleVT, X, Y, X);
+
+ SDValue Fma3 = DAG.getNode(ISD::FMA, SL, MVT::f64, Fma1, Fma2, Fma1);
+ SDValue Mul = DAG.getNode(ISD::FMUL, SL, MVT::f64, DivScale1, Fma3);
+
+ SDValue Fma4 = DAG.getNode(ISD::FMA, SL, MVT::f64,
+ NegDivScale0, Mul, DivScale1);
+
+ SDValue Scale;
+
+ if (Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS) {
+ // Workaround a hardware bug on SI where the condition output from div_scale
+ // is not usable.
+
+ const SDValue Hi = DAG.getConstant(1, MVT::i32);
+
+ // Figure out if the scale to use for div_fmas.
+ SDValue NumBC = DAG.getNode(ISD::BITCAST, SL, MVT::v2i32, X);
+ SDValue DenBC = DAG.getNode(ISD::BITCAST, SL, MVT::v2i32, Y);
+ SDValue Scale0BC = DAG.getNode(ISD::BITCAST, SL, MVT::v2i32, DivScale0);
+ SDValue Scale1BC = DAG.getNode(ISD::BITCAST, SL, MVT::v2i32, DivScale1);
+
+ SDValue NumHi = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, SL, MVT::i32, NumBC, Hi);
+ SDValue DenHi = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, SL, MVT::i32, DenBC, Hi);
+
+ SDValue Scale0Hi
+ = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, SL, MVT::i32, Scale0BC, Hi);
+ SDValue Scale1Hi
+ = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, SL, MVT::i32, Scale1BC, Hi);
+
+ SDValue CmpDen = DAG.getSetCC(SL, MVT::i1, DenHi, Scale0Hi, ISD::SETEQ);
+ SDValue CmpNum = DAG.getSetCC(SL, MVT::i1, NumHi, Scale1Hi, ISD::SETEQ);
+ Scale = DAG.getNode(ISD::XOR, SL, MVT::i1, CmpNum, CmpDen);
+ } else {
+ Scale = DivScale1.getValue(1);
+ }
+
+ SDValue Fmas = DAG.getNode(AMDGPUISD::DIV_FMAS, SL, MVT::f64,
+ Fma4, Fma3, Mul, Scale);
+
+ return DAG.getNode(AMDGPUISD::DIV_FIXUP, SL, MVT::f64, Fmas, Y, X);
}
SDValue SITargetLowering::LowerFDIV(SDValue Op, SelectionDAG &DAG) const {
@@ -1125,11 +1196,6 @@ SDValue SITargetLowering::LowerSTORE(SDValue Op, SelectionDAG &DAG) const {
EVT VT = Store->getMemoryVT();
// These stores are legal.
- if (Store->getAddressSpace() == AMDGPUAS::LOCAL_ADDRESS &&
- VT.isVector() && VT.getVectorNumElements() == 2 &&
- VT.getVectorElementType() == MVT::i32)
- return SDValue();
-
if (Store->getAddressSpace() == AMDGPUAS::PRIVATE_ADDRESS) {
if (VT.isVector() && VT.getVectorNumElements() > 4)
return ScalarizeVectorStore(Op, DAG);
@@ -1524,6 +1590,7 @@ SDValue SITargetLowering::PerformDAGCombine(SDNode *N,
case AMDGPUISD::UMAX:
case AMDGPUISD::UMIN: {
if (DCI.getDAGCombineLevel() >= AfterLegalizeDAG &&
+ N->getValueType(0) != MVT::f64 &&
getTargetMachine().getOptLevel() > CodeGenOpt::None)
return performMin3Max3Combine(N, DCI);
break;
diff --git a/contrib/llvm/lib/Target/R600/SIInsertWaits.cpp b/contrib/llvm/lib/Target/R600/SIInsertWaits.cpp
index 181b116..50f20ac 100644
--- a/contrib/llvm/lib/Target/R600/SIInsertWaits.cpp
+++ b/contrib/llvm/lib/Target/R600/SIInsertWaits.cpp
@@ -82,6 +82,8 @@ private:
/// \brief Type of the last opcode.
InstType LastOpcodeType;
+ bool LastInstWritesM0;
+
/// \brief Get increment/decrement amount for this instruction.
Counters getHwCounts(MachineInstr &MI);
@@ -106,6 +108,9 @@ private:
/// \brief Resolve all operand dependencies to counter requirements
Counters handleOperands(MachineInstr &MI);
+ /// \brief Insert S_NOP between an instruction writing M0 and S_SENDMSG.
+ void handleSendMsg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I);
+
public:
SIInsertWaits(TargetMachine &tm) :
MachineFunctionPass(ID),
@@ -269,6 +274,7 @@ void SIInsertWaits::pushInstruction(MachineBasicBlock &MBB,
// Insert a NOP to break the clause.
BuildMI(MBB, I, DebugLoc(), TII->get(AMDGPU::S_NOP))
.addImm(0);
+ LastInstWritesM0 = false;
}
if (TII->isSMRD(I->getOpcode()))
@@ -362,6 +368,7 @@ bool SIInsertWaits::insertWait(MachineBasicBlock &MBB,
((Counts.Named.LGKM & 0x7) << 8));
LastOpcodeType = OTHER;
+ LastInstWritesM0 = false;
return true;
}
@@ -403,6 +410,30 @@ Counters SIInsertWaits::handleOperands(MachineInstr &MI) {
return Result;
}
+void SIInsertWaits::handleSendMsg(MachineBasicBlock &MBB,
+ MachineBasicBlock::iterator I) {
+ if (TRI->ST.getGeneration() < AMDGPUSubtarget::VOLCANIC_ISLANDS)
+ return;
+
+ // There must be "S_NOP 0" between an instruction writing M0 and S_SENDMSG.
+ if (LastInstWritesM0 && I->getOpcode() == AMDGPU::S_SENDMSG) {
+ BuildMI(MBB, I, DebugLoc(), TII->get(AMDGPU::S_NOP)).addImm(0);
+ LastInstWritesM0 = false;
+ return;
+ }
+
+ // Set whether this instruction sets M0
+ LastInstWritesM0 = false;
+
+ unsigned NumOperands = I->getNumOperands();
+ for (unsigned i = 0; i < NumOperands; i++) {
+ const MachineOperand &Op = I->getOperand(i);
+
+ if (Op.isReg() && Op.isDef() && Op.getReg() == AMDGPU::M0)
+ LastInstWritesM0 = true;
+ }
+}
+
// FIXME: Insert waits listed in Table 4.2 "Required User-Inserted Wait States"
// around other non-memory instructions.
bool SIInsertWaits::runOnMachineFunction(MachineFunction &MF) {
@@ -417,6 +448,7 @@ bool SIInsertWaits::runOnMachineFunction(MachineFunction &MF) {
WaitedOn = ZeroCounts;
LastIssued = ZeroCounts;
LastOpcodeType = OTHER;
+ LastInstWritesM0 = false;
memset(&UsedRegs, 0, sizeof(UsedRegs));
memset(&DefinedRegs, 0, sizeof(DefinedRegs));
@@ -433,7 +465,9 @@ bool SIInsertWaits::runOnMachineFunction(MachineFunction &MF) {
Changes |= insertWait(MBB, I, LastIssued);
else
Changes |= insertWait(MBB, I, handleOperands(*I));
+
pushInstruction(MBB, I);
+ handleSendMsg(MBB, I);
}
// Wait for everything at the end of the MBB
diff --git a/contrib/llvm/lib/Target/R600/SIInstrFormats.td b/contrib/llvm/lib/Target/R600/SIInstrFormats.td
index 09c0cbe..b825208 100644
--- a/contrib/llvm/lib/Target/R600/SIInstrFormats.td
+++ b/contrib/llvm/lib/Target/R600/SIInstrFormats.td
@@ -38,6 +38,7 @@ class InstSI <dag outs, dag ins, string asm, list<dag> pattern> :
field bits<1> DS = 0;
field bits<1> MIMG = 0;
field bits<1> FLAT = 0;
+ field bits<1> WQM = 0;
// These need to be kept in sync with the enum in SIInstrFlags.
let TSFlags{0} = VM_CNT;
@@ -64,6 +65,7 @@ class InstSI <dag outs, dag ins, string asm, list<dag> pattern> :
let TSFlags{17} = DS;
let TSFlags{18} = MIMG;
let TSFlags{19} = FLAT;
+ let TSFlags{20} = WQM;
// Most instructions require adjustments after selection to satisfy
// operand requirements.
@@ -295,18 +297,32 @@ class VOP1e <bits<8> op> : Enc32 {
}
class VOP2e <bits<6> op> : Enc32 {
+ bits<8> vdst;
+ bits<9> src0;
+ bits<8> src1;
- bits<8> VDST;
- bits<9> SRC0;
- bits<8> VSRC1;
-
- let Inst{8-0} = SRC0;
- let Inst{16-9} = VSRC1;
- let Inst{24-17} = VDST;
+ let Inst{8-0} = src0;
+ let Inst{16-9} = src1;
+ let Inst{24-17} = vdst;
let Inst{30-25} = op;
let Inst{31} = 0x0; //encoding
}
+class VOP2_MADKe <bits<6> op> : Enc64 {
+
+ bits<8> vdst;
+ bits<9> src0;
+ bits<8> vsrc1;
+ bits<32> src2;
+
+ let Inst{8-0} = src0;
+ let Inst{16-9} = vsrc1;
+ let Inst{24-17} = vdst;
+ let Inst{30-25} = op;
+ let Inst{31} = 0x0; // encoding
+ let Inst{63-32} = src2;
+}
+
class VOP3e <bits<9> op> : Enc64 {
bits<8> dst;
@@ -554,9 +570,6 @@ class VOP1 <bits<8> op, dag outs, dag ins, string asm, list<dag> pattern> :
class VOP2 <bits<6> op, dag outs, dag ins, string asm, list<dag> pattern> :
VOP2Common <outs, ins, asm, pattern>, VOP2e<op>;
-class VOP3b <bits<9> op, dag outs, dag ins, string asm, list<dag> pattern> :
- VOP3Common <outs, ins, asm, pattern>, VOP3be<op>;
-
class VOPC <bits<8> op, dag ins, string asm, list<dag> pattern> :
VOPCCommon <ins, asm, pattern>, VOPCe <op>;
@@ -585,9 +598,6 @@ class DS <dag outs, dag ins, string asm, list<dag> pattern> :
let SchedRW = [WriteLDS];
}
-class DS_si <bits<8> op, dag outs, dag ins, string asm, list<dag> pattern> :
- DS <outs, ins, asm, pattern>, DSe<op>;
-
class MUBUF <dag outs, dag ins, string asm, list<dag> pattern> :
InstSI<outs, ins, asm, pattern> {
diff --git a/contrib/llvm/lib/Target/R600/SIInstrInfo.cpp b/contrib/llvm/lib/Target/R600/SIInstrInfo.cpp
index 80b560e..5ab33b4 100644
--- a/contrib/llvm/lib/Target/R600/SIInstrInfo.cpp
+++ b/contrib/llvm/lib/Target/R600/SIInstrInfo.cpp
@@ -121,12 +121,20 @@ bool SIInstrInfo::areLoadsFromSameBasePtr(SDNode *Load0, SDNode *Load1,
if (Load0->getOperand(0) != Load1->getOperand(0))
return false;
+ const ConstantSDNode *Load0Offset =
+ dyn_cast<ConstantSDNode>(Load0->getOperand(1));
+ const ConstantSDNode *Load1Offset =
+ dyn_cast<ConstantSDNode>(Load1->getOperand(1));
+
+ if (!Load0Offset || !Load1Offset)
+ return false;
+
// Check chain.
if (findChainOperand(Load0) != findChainOperand(Load1))
return false;
- Offset0 = cast<ConstantSDNode>(Load0->getOperand(1))->getZExtValue();
- Offset1 = cast<ConstantSDNode>(Load1->getOperand(1))->getZExtValue();
+ Offset0 = Load0Offset->getZExtValue();
+ Offset1 = Load1Offset->getZExtValue();
return true;
}
@@ -333,6 +341,21 @@ SIInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
return;
} else if (AMDGPU::SReg_64RegClass.contains(DestReg)) {
+ if (DestReg == AMDGPU::VCC) {
+ if (AMDGPU::SReg_64RegClass.contains(SrcReg)) {
+ BuildMI(MBB, MI, DL, get(AMDGPU::S_MOV_B64), AMDGPU::VCC)
+ .addReg(SrcReg, getKillRegState(KillSrc));
+ } else {
+ // FIXME: Hack until VReg_1 removed.
+ assert(AMDGPU::VGPR_32RegClass.contains(SrcReg));
+ BuildMI(MBB, MI, DL, get(AMDGPU::V_CMP_NE_I32_e32), AMDGPU::VCC)
+ .addImm(0)
+ .addReg(SrcReg, getKillRegState(KillSrc));
+ }
+
+ return;
+ }
+
assert(AMDGPU::SReg_64RegClass.contains(SrcReg));
BuildMI(MBB, MI, DL, get(AMDGPU::S_MOV_B64), DestReg)
.addReg(SrcReg, getKillRegState(KillSrc));
@@ -408,11 +431,15 @@ unsigned SIInstrInfo::commuteOpcode(unsigned Opcode) const {
int NewOpc;
// Try to map original to commuted opcode
- if ((NewOpc = AMDGPU::getCommuteRev(Opcode)) != -1)
+ NewOpc = AMDGPU::getCommuteRev(Opcode);
+ // Check if the commuted (REV) opcode exists on the target.
+ if (NewOpc != -1 && pseudoToMCOpcode(NewOpc) != -1)
return NewOpc;
// Try to map commuted to original opcode
- if ((NewOpc = AMDGPU::getCommuteOrig(Opcode)) != -1)
+ NewOpc = AMDGPU::getCommuteOrig(Opcode);
+ // Check if the original (non-REV) opcode exists on the target.
+ if (NewOpc != -1 && pseudoToMCOpcode(NewOpc) != -1)
return NewOpc;
return Opcode;
@@ -1121,6 +1148,8 @@ bool SIInstrInfo::verifyInstruction(const MachineInstr *MI,
return false;
}
+ int RegClass = Desc.OpInfo[i].RegClass;
+
switch (Desc.OpInfo[i].OperandType) {
case MCOI::OPERAND_REGISTER:
if (MI->getOperand(i).isImm() || MI->getOperand(i).isFPImm()) {
@@ -1131,7 +1160,7 @@ bool SIInstrInfo::verifyInstruction(const MachineInstr *MI,
case AMDGPU::OPERAND_REG_IMM32:
break;
case AMDGPU::OPERAND_REG_INLINE_C:
- if (MI->getOperand(i).isImm() && !isInlineConstant(MI->getOperand(i))) {
+ if (isLiteralConstant(MI->getOperand(i))) {
ErrInfo = "Illegal immediate value for operand.";
return false;
}
@@ -1152,7 +1181,6 @@ bool SIInstrInfo::verifyInstruction(const MachineInstr *MI,
if (!MI->getOperand(i).isReg())
continue;
- int RegClass = Desc.OpInfo[i].RegClass;
if (RegClass != -1) {
unsigned Reg = MI->getOperand(i).getReg();
if (TargetRegisterInfo::isVirtualRegister(Reg))
@@ -1197,31 +1225,6 @@ bool SIInstrInfo::verifyInstruction(const MachineInstr *MI,
}
}
- // Verify SRC1 for VOP2 and VOPC
- if (Src1Idx != -1 && (isVOP2(Opcode) || isVOPC(Opcode))) {
- const MachineOperand &Src1 = MI->getOperand(Src1Idx);
- if (Src1.isImm()) {
- ErrInfo = "VOP[2C] src1 cannot be an immediate.";
- return false;
- }
- }
-
- // Verify VOP3
- if (isVOP3(Opcode)) {
- if (Src0Idx != -1 && isLiteralConstant(MI->getOperand(Src0Idx))) {
- ErrInfo = "VOP3 src0 cannot be a literal constant.";
- return false;
- }
- if (Src1Idx != -1 && isLiteralConstant(MI->getOperand(Src1Idx))) {
- ErrInfo = "VOP3 src1 cannot be a literal constant.";
- return false;
- }
- if (Src2Idx != -1 && isLiteralConstant(MI->getOperand(Src2Idx))) {
- ErrInfo = "VOP3 src2 cannot be a literal constant.";
- return false;
- }
- }
-
// Verify misc. restrictions on specific instructions.
if (Desc.getOpcode() == AMDGPU::V_DIV_SCALE_F32 ||
Desc.getOpcode() == AMDGPU::V_DIV_SCALE_F64) {
@@ -1292,6 +1295,7 @@ unsigned SIInstrInfo::getVALUOp(const MachineInstr &MI) {
case AMDGPU::S_BCNT1_I32_B32: return AMDGPU::V_BCNT_U32_B32_e64;
case AMDGPU::S_FF1_I32_B32: return AMDGPU::V_FFBL_B32_e32;
case AMDGPU::S_FLBIT_I32_B32: return AMDGPU::V_FFBH_U32_e32;
+ case AMDGPU::S_FLBIT_I32: return AMDGPU::V_FFBH_I32_e64;
}
}
@@ -2043,6 +2047,24 @@ void SIInstrInfo::moveToVALU(MachineInstr &TopInst) const {
swapOperands(Inst);
}
break;
+ case AMDGPU::S_LSHL_B64:
+ if (ST.getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS) {
+ NewOpcode = AMDGPU::V_LSHLREV_B64;
+ swapOperands(Inst);
+ }
+ break;
+ case AMDGPU::S_ASHR_I64:
+ if (ST.getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS) {
+ NewOpcode = AMDGPU::V_ASHRREV_I64;
+ swapOperands(Inst);
+ }
+ break;
+ case AMDGPU::S_LSHR_B64:
+ if (ST.getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS) {
+ NewOpcode = AMDGPU::V_LSHRREV_B64;
+ swapOperands(Inst);
+ }
+ break;
case AMDGPU::S_BFE_U64:
case AMDGPU::S_BFM_B64:
diff --git a/contrib/llvm/lib/Target/R600/SIInstrInfo.h b/contrib/llvm/lib/Target/R600/SIInstrInfo.h
index 28cd27d..1298030 100644
--- a/contrib/llvm/lib/Target/R600/SIInstrInfo.h
+++ b/contrib/llvm/lib/Target/R600/SIInstrInfo.h
@@ -204,6 +204,10 @@ public:
return get(Opcode).TSFlags & SIInstrFlags::FLAT;
}
+ bool isWQM(uint16_t Opcode) const {
+ return get(Opcode).TSFlags & SIInstrFlags::WQM;
+ }
+
bool isInlineConstant(const APInt &Imm) const;
bool isInlineConstant(const MachineOperand &MO) const;
bool isLiteralConstant(const MachineOperand &MO) const;
@@ -243,7 +247,27 @@ public:
/// the register class of its machine operand.
/// to infer the correct register class base on the other operands.
const TargetRegisterClass *getOpRegClass(const MachineInstr &MI,
- unsigned OpNo) const;\
+ unsigned OpNo) const;
+
+ /// \brief Return the size in bytes of the operand OpNo on the given
+ // instruction opcode.
+ unsigned getOpSize(uint16_t Opcode, unsigned OpNo) const {
+ const MCOperandInfo &OpInfo = get(Opcode).OpInfo[OpNo];
+
+ if (OpInfo.RegClass == -1) {
+ // If this is an immediate operand, this must be a 32-bit literal.
+ assert(OpInfo.OperandType == MCOI::OPERAND_IMMEDIATE);
+ return 4;
+ }
+
+ return RI.getRegClass(OpInfo.RegClass)->getSize();
+ }
+
+ /// \brief This form should usually be preferred since it handles operands
+ /// with unknown register classes.
+ unsigned getOpSize(const MachineInstr &MI, unsigned OpNo) const {
+ return getOpRegClass(MI, OpNo)->getSize();
+ }
/// \returns true if it is legal for the operand at index \p OpNo
/// to read a VGPR.
diff --git a/contrib/llvm/lib/Target/R600/SIInstrInfo.td b/contrib/llvm/lib/Target/R600/SIInstrInfo.td
index 175e11d..a749e7f 100644
--- a/contrib/llvm/lib/Target/R600/SIInstrInfo.td
+++ b/contrib/llvm/lib/Target/R600/SIInstrInfo.td
@@ -383,15 +383,13 @@ class SOP1_Pseudo <string opName, dag outs, dag ins, list<dag> pattern> :
let isPseudo = 1;
}
-class SOP1_Real_si <sop1 op, string opName, dag outs, dag ins, string asm,
- list<dag> pattern> :
- SOP1 <outs, ins, asm, pattern>,
+class SOP1_Real_si <sop1 op, string opName, dag outs, dag ins, string asm> :
+ SOP1 <outs, ins, asm, []>,
SOP1e <op.SI>,
SIMCInstr<opName, SISubtarget.SI>;
-class SOP1_Real_vi <sop1 op, string opName, dag outs, dag ins, string asm,
- list<dag> pattern> :
- SOP1 <outs, ins, asm, pattern>,
+class SOP1_Real_vi <sop1 op, string opName, dag outs, dag ins, string asm> :
+ SOP1 <outs, ins, asm, []>,
SOP1e <op.VI>,
SIMCInstr<opName, SISubtarget.VI>;
@@ -400,10 +398,10 @@ multiclass SOP1_32 <sop1 op, string opName, list<dag> pattern> {
pattern>;
def _si : SOP1_Real_si <op, opName, (outs SReg_32:$dst), (ins SSrc_32:$src0),
- opName#" $dst, $src0", pattern>;
+ opName#" $dst, $src0">;
def _vi : SOP1_Real_vi <op, opName, (outs SReg_32:$dst), (ins SSrc_32:$src0),
- opName#" $dst, $src0", pattern>;
+ opName#" $dst, $src0">;
}
multiclass SOP1_64 <sop1 op, string opName, list<dag> pattern> {
@@ -411,10 +409,10 @@ multiclass SOP1_64 <sop1 op, string opName, list<dag> pattern> {
pattern>;
def _si : SOP1_Real_si <op, opName, (outs SReg_64:$dst), (ins SSrc_64:$src0),
- opName#" $dst, $src0", pattern>;
+ opName#" $dst, $src0">;
def _vi : SOP1_Real_vi <op, opName, (outs SReg_64:$dst), (ins SSrc_64:$src0),
- opName#" $dst, $src0", pattern>;
+ opName#" $dst, $src0">;
}
// no input, 64-bit output.
@@ -422,12 +420,12 @@ multiclass SOP1_64_0 <sop1 op, string opName, list<dag> pattern> {
def "" : SOP1_Pseudo <opName, (outs SReg_64:$dst), (ins), pattern>;
def _si : SOP1_Real_si <op, opName, (outs SReg_64:$dst), (ins),
- opName#" $dst", pattern> {
+ opName#" $dst"> {
let SSRC0 = 0;
}
def _vi : SOP1_Real_vi <op, opName, (outs SReg_64:$dst), (ins),
- opName#" $dst", pattern> {
+ opName#" $dst"> {
let SSRC0 = 0;
}
}
@@ -438,10 +436,10 @@ multiclass SOP1_32_64 <sop1 op, string opName, list<dag> pattern> {
pattern>;
def _si : SOP1_Real_si <op, opName, (outs SReg_32:$dst), (ins SSrc_64:$src0),
- opName#" $dst, $src0", pattern>;
+ opName#" $dst, $src0">;
def _vi : SOP1_Real_vi <op, opName, (outs SReg_32:$dst), (ins SSrc_64:$src0),
- opName#" $dst, $src0", pattern>;
+ opName#" $dst, $src0">;
}
class SOP2_Pseudo<string opName, dag outs, dag ins, list<dag> pattern> :
@@ -451,15 +449,13 @@ class SOP2_Pseudo<string opName, dag outs, dag ins, list<dag> pattern> :
let Size = 4;
}
-class SOP2_Real_si<sop2 op, string opName, dag outs, dag ins, string asm,
- list<dag> pattern> :
- SOP2<outs, ins, asm, pattern>,
+class SOP2_Real_si<sop2 op, string opName, dag outs, dag ins, string asm> :
+ SOP2<outs, ins, asm, []>,
SOP2e<op.SI>,
SIMCInstr<opName, SISubtarget.SI>;
-class SOP2_Real_vi<sop2 op, string opName, dag outs, dag ins, string asm,
- list<dag> pattern> :
- SOP2<outs, ins, asm, pattern>,
+class SOP2_Real_vi<sop2 op, string opName, dag outs, dag ins, string asm> :
+ SOP2<outs, ins, asm, []>,
SOP2e<op.VI>,
SIMCInstr<opName, SISubtarget.VI>;
@@ -469,11 +465,11 @@ multiclass SOP2_SELECT_32 <sop2 op, string opName, list<dag> pattern> {
def _si : SOP2_Real_si <op, opName, (outs SReg_32:$dst),
(ins SSrc_32:$src0, SSrc_32:$src1, SCCReg:$scc),
- opName#" $dst, $src0, $src1 [$scc]", pattern>;
+ opName#" $dst, $src0, $src1 [$scc]">;
def _vi : SOP2_Real_vi <op, opName, (outs SReg_32:$dst),
(ins SSrc_32:$src0, SSrc_32:$src1, SCCReg:$scc),
- opName#" $dst, $src0, $src1 [$scc]", pattern>;
+ opName#" $dst, $src0, $src1 [$scc]">;
}
multiclass SOP2_32 <sop2 op, string opName, list<dag> pattern> {
@@ -481,10 +477,10 @@ multiclass SOP2_32 <sop2 op, string opName, list<dag> pattern> {
(ins SSrc_32:$src0, SSrc_32:$src1), pattern>;
def _si : SOP2_Real_si <op, opName, (outs SReg_32:$dst),
- (ins SSrc_32:$src0, SSrc_32:$src1), opName#" $dst, $src0, $src1", pattern>;
+ (ins SSrc_32:$src0, SSrc_32:$src1), opName#" $dst, $src0, $src1">;
def _vi : SOP2_Real_vi <op, opName, (outs SReg_32:$dst),
- (ins SSrc_32:$src0, SSrc_32:$src1), opName#" $dst, $src0, $src1", pattern>;
+ (ins SSrc_32:$src0, SSrc_32:$src1), opName#" $dst, $src0, $src1">;
}
multiclass SOP2_64 <sop2 op, string opName, list<dag> pattern> {
@@ -492,10 +488,10 @@ multiclass SOP2_64 <sop2 op, string opName, list<dag> pattern> {
(ins SSrc_64:$src0, SSrc_64:$src1), pattern>;
def _si : SOP2_Real_si <op, opName, (outs SReg_64:$dst),
- (ins SSrc_64:$src0, SSrc_64:$src1), opName#" $dst, $src0, $src1", pattern>;
+ (ins SSrc_64:$src0, SSrc_64:$src1), opName#" $dst, $src0, $src1">;
def _vi : SOP2_Real_vi <op, opName, (outs SReg_64:$dst),
- (ins SSrc_64:$src0, SSrc_64:$src1), opName#" $dst, $src0, $src1", pattern>;
+ (ins SSrc_64:$src0, SSrc_64:$src1), opName#" $dst, $src0, $src1">;
}
multiclass SOP2_64_32 <sop2 op, string opName, list<dag> pattern> {
@@ -503,10 +499,10 @@ multiclass SOP2_64_32 <sop2 op, string opName, list<dag> pattern> {
(ins SSrc_64:$src0, SSrc_32:$src1), pattern>;
def _si : SOP2_Real_si <op, opName, (outs SReg_64:$dst),
- (ins SSrc_64:$src0, SSrc_32:$src1), opName#" $dst, $src0, $src1", pattern>;
+ (ins SSrc_64:$src0, SSrc_32:$src1), opName#" $dst, $src0, $src1">;
def _vi : SOP2_Real_vi <op, opName, (outs SReg_64:$dst),
- (ins SSrc_64:$src0, SSrc_32:$src1), opName#" $dst, $src0, $src1", pattern>;
+ (ins SSrc_64:$src0, SSrc_32:$src1), opName#" $dst, $src0, $src1">;
}
@@ -527,15 +523,13 @@ class SOPK_Pseudo <string opName, dag outs, dag ins, list<dag> pattern> :
let isPseudo = 1;
}
-class SOPK_Real_si <sopk op, string opName, dag outs, dag ins, string asm,
- list<dag> pattern> :
- SOPK <outs, ins, asm, pattern>,
+class SOPK_Real_si <sopk op, string opName, dag outs, dag ins, string asm> :
+ SOPK <outs, ins, asm, []>,
SOPKe <op.SI>,
SIMCInstr<opName, SISubtarget.SI>;
-class SOPK_Real_vi <sopk op, string opName, dag outs, dag ins, string asm,
- list<dag> pattern> :
- SOPK <outs, ins, asm, pattern>,
+class SOPK_Real_vi <sopk op, string opName, dag outs, dag ins, string asm> :
+ SOPK <outs, ins, asm, []>,
SOPKe <op.VI>,
SIMCInstr<opName, SISubtarget.VI>;
@@ -544,10 +538,10 @@ multiclass SOPK_32 <sopk op, string opName, list<dag> pattern> {
pattern>;
def _si : SOPK_Real_si <op, opName, (outs SReg_32:$dst), (ins u16imm:$src0),
- opName#" $dst, $src0", pattern>;
+ opName#" $dst, $src0">;
def _vi : SOPK_Real_vi <op, opName, (outs SReg_32:$dst), (ins u16imm:$src0),
- opName#" $dst, $src0", pattern>;
+ opName#" $dst, $src0">;
}
multiclass SOPK_SCC <sopk op, string opName, list<dag> pattern> {
@@ -555,10 +549,10 @@ multiclass SOPK_SCC <sopk op, string opName, list<dag> pattern> {
(ins SReg_32:$src0, u16imm:$src1), pattern>;
def _si : SOPK_Real_si <op, opName, (outs SCCReg:$dst),
- (ins SReg_32:$src0, u16imm:$src1), opName#" $dst, $src0", pattern>;
+ (ins SReg_32:$src0, u16imm:$src1), opName#" $dst, $src0">;
def _vi : SOPK_Real_vi <op, opName, (outs SCCReg:$dst),
- (ins SReg_32:$src0, u16imm:$src1), opName#" $dst, $src0", pattern>;
+ (ins SReg_32:$src0, u16imm:$src1), opName#" $dst, $src0">;
}
//===----------------------------------------------------------------------===//
@@ -792,6 +786,7 @@ def VOP_F32_F32_I32 : VOPProfile <[f32, f32, i32, untyped]>;
def VOP_F64_F64_F64 : VOPProfile <[f64, f64, f64, untyped]>;
def VOP_F64_F64_I32 : VOPProfile <[f64, f64, i32, untyped]>;
def VOP_I32_F32_F32 : VOPProfile <[i32, f32, f32, untyped]>;
+def VOP_I32_F32_I32 : VOPProfile <[i32, f32, i32, untyped]>;
def VOP_I32_I32_I32 : VOPProfile <[i32, i32, i32, untyped]>;
def VOP_I32_I32_I32_VCC : VOPProfile <[i32, i32, i32, untyped]> {
let Src0RC32 = VCSrc_32;
@@ -808,9 +803,14 @@ def VOP_I1_F64_I32 : VOPProfile <[i1, f64, i32, untyped]> {
}
def VOP_I64_I64_I32 : VOPProfile <[i64, i64, i32, untyped]>;
+def VOP_I64_I32_I64 : VOPProfile <[i64, i32, i64, untyped]>;
def VOP_I64_I64_I64 : VOPProfile <[i64, i64, i64, untyped]>;
def VOP_F32_F32_F32_F32 : VOPProfile <[f32, f32, f32, f32]>;
+def VOP_MADK : VOPProfile <[f32, f32, f32, f32]> {
+ field dag Ins = (ins VCSrc_32:$src0, VGPR_32:$vsrc1, u32imm:$src2);
+ field string Asm = " $dst, $src0, $vsrc1, $src2";
+}
def VOP_F64_F64_F64_F64 : VOPProfile <[f64, f64, f64, f64]>;
def VOP_I32_I32_I32_I32 : VOPProfile <[i32, i32, i32, i32]>;
def VOP_I64_I32_I32_I64 : VOPProfile <[i64, i32, i32, i64]>;
@@ -847,6 +847,15 @@ multiclass VOP1_m <vop1 op, dag outs, dag ins, string asm, list<dag> pattern,
SIMCInstr <opName#"_e32", SISubtarget.VI>;
}
+multiclass VOP1SI_m <vop1 op, dag outs, dag ins, string asm, list<dag> pattern,
+ string opName> {
+ def "" : VOP1_Pseudo <outs, ins, pattern, opName>;
+
+ def _si : VOP1<op.SI, outs, ins, asm, []>,
+ SIMCInstr <opName#"_e32", SISubtarget.SI>;
+ // No VI instruction. This class is for SI only.
+}
+
class VOP2_Pseudo <dag outs, dag ins, list<dag> pattern, string opName> :
VOP2Common <outs, ins, "", pattern>,
VOP <opName>,
@@ -855,25 +864,22 @@ class VOP2_Pseudo <dag outs, dag ins, list<dag> pattern, string opName> :
}
multiclass VOP2SI_m <vop2 op, dag outs, dag ins, string asm, list<dag> pattern,
- string opName, string revOpSI> {
+ string opName, string revOp> {
def "" : VOP2_Pseudo <outs, ins, pattern, opName>,
- VOP2_REV<revOpSI#"_e32", !eq(revOpSI, opName)>;
+ VOP2_REV<revOp#"_e32", !eq(revOp, opName)>;
def _si : VOP2 <op.SI, outs, ins, opName#asm, []>,
- VOP2_REV<revOpSI#"_e32_si", !eq(revOpSI, opName)>,
SIMCInstr <opName#"_e32", SISubtarget.SI>;
}
multiclass VOP2_m <vop2 op, dag outs, dag ins, string asm, list<dag> pattern,
- string opName, string revOpSI, string revOpVI> {
+ string opName, string revOp> {
def "" : VOP2_Pseudo <outs, ins, pattern, opName>,
- VOP2_REV<revOpSI#"_e32", !eq(revOpSI, opName)>;
+ VOP2_REV<revOp#"_e32", !eq(revOp, opName)>;
def _si : VOP2 <op.SI, outs, ins, opName#asm, []>,
- VOP2_REV<revOpSI#"_e32_si", !eq(revOpSI, opName)>,
SIMCInstr <opName#"_e32", SISubtarget.SI>;
def _vi : VOP2 <op.VI, outs, ins, opName#asm, []>,
- VOP2_REV<revOpVI#"_e32_vi", !eq(revOpVI, opName)>,
SIMCInstr <opName#"_e32", SISubtarget.VI>;
}
@@ -905,6 +911,16 @@ class VOP3_Real_vi <bits<10> op, dag outs, dag ins, string asm, string opName> :
VOP3e_vi <op>,
SIMCInstr <opName#"_e64", SISubtarget.VI>;
+class VOP3b_Real_si <bits<9> op, dag outs, dag ins, string asm, string opName> :
+ VOP3Common <outs, ins, asm, []>,
+ VOP3be <op>,
+ SIMCInstr<opName#"_e64", SISubtarget.SI>;
+
+class VOP3b_Real_vi <bits<10> op, dag outs, dag ins, string asm, string opName> :
+ VOP3Common <outs, ins, asm, []>,
+ VOP3be_vi <op>,
+ SIMCInstr <opName#"_e64", SISubtarget.VI>;
+
multiclass VOP3_m <vop op, dag outs, dag ins, string asm, list<dag> pattern,
string opName, int NumSrcArgs, bit HasMods = 1> {
@@ -946,24 +962,45 @@ multiclass VOP3_1_m <vop op, dag outs, dag ins, string asm,
VOP3DisableFields<0, 0, HasMods>;
}
+multiclass VOP3SI_1_m <vop op, dag outs, dag ins, string asm,
+ list<dag> pattern, string opName, bit HasMods = 1> {
+
+ def "" : VOP3_Pseudo <outs, ins, pattern, opName>;
+
+ def _si : VOP3_Real_si <op.SI3, outs, ins, asm, opName>,
+ VOP3DisableFields<0, 0, HasMods>;
+ // No VI instruction. This class is for SI only.
+}
+
multiclass VOP3_2_m <vop op, dag outs, dag ins, string asm,
- list<dag> pattern, string opName, string revOpSI, string revOpVI,
+ list<dag> pattern, string opName, string revOp,
bit HasMods = 1, bit UseFullOp = 0> {
def "" : VOP3_Pseudo <outs, ins, pattern, opName>,
- VOP2_REV<revOpSI#"_e64", !eq(revOpSI, opName)>;
+ VOP2_REV<revOp#"_e64", !eq(revOp, opName)>;
- def _si : VOP3_Real_si <op.SI3,
- outs, ins, asm, opName>,
- VOP2_REV<revOpSI#"_e64_si", !eq(revOpSI, opName)>,
+ def _si : VOP3_Real_si <op.SI3, outs, ins, asm, opName>,
+ VOP3DisableFields<1, 0, HasMods>;
+
+ def _vi : VOP3_Real_vi <op.VI3, outs, ins, asm, opName>,
VOP3DisableFields<1, 0, HasMods>;
+}
+
+multiclass VOP3SI_2_m <vop op, dag outs, dag ins, string asm,
+ list<dag> pattern, string opName, string revOp,
+ bit HasMods = 1, bit UseFullOp = 0> {
+
+ def "" : VOP3_Pseudo <outs, ins, pattern, opName>,
+ VOP2_REV<revOp#"_e64", !eq(revOp, opName)>;
- def _vi : VOP3_Real_vi <op.VI3,
- outs, ins, asm, opName>,
- VOP2_REV<revOpVI#"_e64_vi", !eq(revOpVI, opName)>,
+ def _si : VOP3_Real_si <op.SI3, outs, ins, asm, opName>,
VOP3DisableFields<1, 0, HasMods>;
+
+ // No VI instruction. This class is for SI only.
}
+// XXX - Is v_div_scale_{f32|f64} only available in vop3b without
+// option of implicit vcc use?
multiclass VOP3b_2_m <vop op, dag outs, dag ins, string asm,
list<dag> pattern, string opName, string revOp,
bit HasMods = 1, bit UseFullOp = 0> {
@@ -974,19 +1011,27 @@ multiclass VOP3b_2_m <vop op, dag outs, dag ins, string asm,
// can write it into any SGPR. We currently don't use the carry out,
// so for now hardcode it to VCC as well.
let sdst = SIOperand.VCC, Defs = [VCC] in {
- def _si : VOP3b <op.SI3, outs, ins, asm, pattern>,
- VOP3DisableFields<1, 0, HasMods>,
- SIMCInstr<opName#"_e64", SISubtarget.SI>,
- VOP2_REV<revOp#"_e64_si", !eq(revOp, opName)>;
-
- // TODO: Do we need this VI variant here?
- /*def _vi : VOP3b_vi <op.VI3, outs, ins, asm, pattern>,
- VOP3DisableFields<1, 0, HasMods>,
- SIMCInstr<opName#"_e64", SISubtarget.VI>,
- VOP2_REV<revOp#"_e64_vi", !eq(revOp, opName)>;*/
+ def _si : VOP3b_Real_si <op.SI3, outs, ins, asm, opName>,
+ VOP3DisableFields<1, 0, HasMods>;
+
+ def _vi : VOP3b_Real_vi <op.VI3, outs, ins, asm, opName>,
+ VOP3DisableFields<1, 0, HasMods>;
} // End sdst = SIOperand.VCC, Defs = [VCC]
}
+multiclass VOP3b_3_m <vop op, dag outs, dag ins, string asm,
+ list<dag> pattern, string opName, string revOp,
+ bit HasMods = 1, bit UseFullOp = 0> {
+ def "" : VOP3_Pseudo <outs, ins, pattern, opName>;
+
+
+ def _si : VOP3b_Real_si <op.SI3, outs, ins, asm, opName>,
+ VOP3DisableFields<1, 1, HasMods>;
+
+ def _vi : VOP3b_Real_vi <op.VI3, outs, ins, asm, opName>,
+ VOP3DisableFields<1, 1, HasMods>;
+}
+
multiclass VOP3_C_m <vop op, dag outs, dag ins, string asm,
list<dag> pattern, string opName,
bit HasMods, bit defExec> {
@@ -1046,33 +1091,30 @@ multiclass VOP1Inst <vop1 op, string opName, VOPProfile P,
multiclass VOP1InstSI <vop1 op, string opName, VOPProfile P,
SDPatternOperator node = null_frag> {
- def _e32 : VOP1 <op.SI, P.Outs, P.Ins32, opName#P.Asm32, []>,
- VOP <opName>;
+ defm _e32 : VOP1SI_m <op, P.Outs, P.Ins32, opName#P.Asm32, [], opName>;
- def _e64 : VOP3Common <P.Outs, P.Ins64, opName#P.Asm64,
+ defm _e64 : VOP3SI_1_m <op, P.Outs, P.Ins64, opName#P.Asm64,
!if(P.HasModifiers,
[(set P.DstVT:$dst, (node (P.Src0VT (VOP3Mods0 P.Src0VT:$src0,
i32:$src0_modifiers, i1:$clamp, i32:$omod))))],
- [(set P.DstVT:$dst, (node P.Src0VT:$src0))])>,
- VOP <opName>,
- VOP3e <op.SI3>,
- VOP3DisableFields<0, 0, P.HasModifiers>;
+ [(set P.DstVT:$dst, (node P.Src0VT:$src0))]),
+ opName, P.HasModifiers>;
}
multiclass VOP2_Helper <vop2 op, string opName, dag outs,
dag ins32, string asm32, list<dag> pat32,
dag ins64, string asm64, list<dag> pat64,
- string revOpSI, string revOpVI, bit HasMods> {
- defm _e32 : VOP2_m <op, outs, ins32, asm32, pat32, opName, revOpSI, revOpVI>;
+ string revOp, bit HasMods> {
+ defm _e32 : VOP2_m <op, outs, ins32, asm32, pat32, opName, revOp>;
defm _e64 : VOP3_2_m <op,
- outs, ins64, opName#"_e64"#asm64, pat64, opName, revOpSI, revOpVI, HasMods
+ outs, ins64, opName#"_e64"#asm64, pat64, opName, revOp, HasMods
>;
}
multiclass VOP2Inst <vop2 op, string opName, VOPProfile P,
SDPatternOperator node = null_frag,
- string revOpSI = opName, string revOpVI = revOpSI> : VOP2_Helper <
+ string revOp = opName> : VOP2_Helper <
op, opName, P.Outs,
P.Ins32, P.Asm32, [],
P.Ins64, P.Asm64,
@@ -1082,15 +1124,30 @@ multiclass VOP2Inst <vop2 op, string opName, VOPProfile P,
i1:$clamp, i32:$omod)),
(P.Src1VT (VOP3Mods P.Src1VT:$src1, i32:$src1_modifiers))))],
[(set P.DstVT:$dst, (node P.Src0VT:$src0, P.Src1VT:$src1))]),
- revOpSI, revOpVI, P.HasModifiers
+ revOp, P.HasModifiers
>;
+multiclass VOP2InstSI <vop2 op, string opName, VOPProfile P,
+ SDPatternOperator node = null_frag,
+ string revOp = opName> {
+ defm _e32 : VOP2SI_m <op, P.Outs, P.Ins32, P.Asm32, [], opName, revOp>;
+
+ defm _e64 : VOP3SI_2_m <op, P.Outs, P.Ins64, opName#"_e64"#P.Asm64,
+ !if(P.HasModifiers,
+ [(set P.DstVT:$dst,
+ (node (P.Src0VT (VOP3Mods0 P.Src0VT:$src0, i32:$src0_modifiers,
+ i1:$clamp, i32:$omod)),
+ (P.Src1VT (VOP3Mods P.Src1VT:$src1, i32:$src1_modifiers))))],
+ [(set P.DstVT:$dst, (node P.Src0VT:$src0, P.Src1VT:$src1))]),
+ opName, revOp, P.HasModifiers>;
+}
+
multiclass VOP2b_Helper <vop2 op, string opName, dag outs,
dag ins32, string asm32, list<dag> pat32,
dag ins64, string asm64, list<dag> pat64,
string revOp, bit HasMods> {
- defm _e32 : VOP2_m <op, outs, ins32, asm32, pat32, opName, revOp, revOp>;
+ defm _e32 : VOP2_m <op, outs, ins32, asm32, pat32, opName, revOp>;
defm _e64 : VOP3b_2_m <op,
outs, ins64, opName#"_e64"#asm64, pat64, opName, revOp, HasMods
@@ -1116,16 +1173,16 @@ multiclass VOP2bInst <vop2 op, string opName, VOPProfile P,
multiclass VOP2_VI3_Helper <vop23 op, string opName, dag outs,
dag ins32, string asm32, list<dag> pat32,
dag ins64, string asm64, list<dag> pat64,
- string revOpSI, string revOpVI, bit HasMods> {
- defm _e32 : VOP2SI_m <op, outs, ins32, asm32, pat32, opName, revOpSI>;
+ string revOp, bit HasMods> {
+ defm _e32 : VOP2SI_m <op, outs, ins32, asm32, pat32, opName, revOp>;
defm _e64 : VOP3_2_m <op, outs, ins64, opName#"_e64"#asm64, pat64, opName,
- revOpSI, revOpVI, HasMods>;
+ revOp, HasMods>;
}
multiclass VOP2_VI3_Inst <vop23 op, string opName, VOPProfile P,
SDPatternOperator node = null_frag,
- string revOpSI = opName, string revOpVI = revOpSI>
+ string revOp = opName>
: VOP2_VI3_Helper <
op, opName, P.Outs,
P.Ins32, P.Asm32, [],
@@ -1136,9 +1193,26 @@ multiclass VOP2_VI3_Inst <vop23 op, string opName, VOPProfile P,
i1:$clamp, i32:$omod)),
(P.Src1VT (VOP3Mods P.Src1VT:$src1, i32:$src1_modifiers))))],
[(set P.DstVT:$dst, (node P.Src0VT:$src0, P.Src1VT:$src1))]),
- revOpSI, revOpVI, P.HasModifiers
+ revOp, P.HasModifiers
>;
+multiclass VOP2MADK <vop2 op, string opName, list<dag> pattern = []> {
+
+ def "" : VOP2_Pseudo <VOP_MADK.Outs, VOP_MADK.Ins, pattern, opName>;
+
+let isCodeGenOnly = 0 in {
+ def _si : VOP2Common <VOP_MADK.Outs, VOP_MADK.Ins,
+ !strconcat(opName, VOP_MADK.Asm), []>,
+ SIMCInstr <opName#"_e32", SISubtarget.SI>,
+ VOP2_MADKe <op.SI>;
+
+ def _vi : VOP2Common <VOP_MADK.Outs, VOP_MADK.Ins,
+ !strconcat(opName, VOP_MADK.Asm), []>,
+ SIMCInstr <opName#"_e32", SISubtarget.VI>,
+ VOP2_MADKe <op.VI>;
+} // End isCodeGenOnly = 0
+}
+
class VOPC_Pseudo <dag outs, dag ins, list<dag> pattern, string opName> :
VOPCCommon <ins, "", pattern>,
VOP <opName>,
@@ -1274,9 +1348,31 @@ multiclass VOP3Inst <vop3 op, string opName, VOPProfile P,
P.NumSrcArgs, P.HasModifiers
>;
+// Special case for v_div_fmas_{f32|f64}, since it seems to be the
+// only VOP instruction that implicitly reads VCC.
+multiclass VOP3_VCC_Inst <vop3 op, string opName,
+ VOPProfile P,
+ SDPatternOperator node = null_frag> : VOP3_Helper <
+ op, opName,
+ P.Outs,
+ (ins InputModsNoDefault:$src0_modifiers, P.Src0RC64:$src0,
+ InputModsNoDefault:$src1_modifiers, P.Src1RC64:$src1,
+ InputModsNoDefault:$src2_modifiers, P.Src2RC64:$src2,
+ ClampMod:$clamp,
+ omod:$omod),
+ " $dst, $src0_modifiers, $src1_modifiers, $src2_modifiers"#"$clamp"#"$omod",
+ [(set P.DstVT:$dst,
+ (node (P.Src0VT (VOP3Mods0 P.Src0VT:$src0, i32:$src0_modifiers,
+ i1:$clamp, i32:$omod)),
+ (P.Src1VT (VOP3Mods P.Src1VT:$src1, i32:$src1_modifiers)),
+ (P.Src2VT (VOP3Mods P.Src2VT:$src2, i32:$src2_modifiers)),
+ (i1 VCC)))],
+ 3, 1
+>;
+
multiclass VOP3b_Helper <vop op, RegisterClass vrc, RegisterOperand arc,
string opName, list<dag> pattern> :
- VOP3b_2_m <
+ VOP3b_3_m <
op, (outs vrc:$vdst, SReg_64:$sdst),
(ins InputModsNoDefault:$src0_modifiers, arc:$src0,
InputModsNoDefault:$src1_modifiers, arc:$src1,
@@ -1307,22 +1403,21 @@ class Vop3ModPat<Instruction Inst, VOPProfile P, SDPatternOperator node> : Pat<
// Interpolation opcodes
//===----------------------------------------------------------------------===//
-class VINTRP_Pseudo <string opName, dag outs, dag ins, string asm,
- list<dag> pattern> :
- VINTRPCommon <outs, ins, asm, pattern>,
+class VINTRP_Pseudo <string opName, dag outs, dag ins, list<dag> pattern> :
+ VINTRPCommon <outs, ins, "", pattern>,
SIMCInstr<opName, SISubtarget.NONE> {
let isPseudo = 1;
}
class VINTRP_Real_si <bits <2> op, string opName, dag outs, dag ins,
- string asm, list<dag> pattern> :
- VINTRPCommon <outs, ins, asm, pattern>,
+ string asm> :
+ VINTRPCommon <outs, ins, asm, []>,
VINTRPe <op>,
SIMCInstr<opName, SISubtarget.SI>;
class VINTRP_Real_vi <bits <2> op, string opName, dag outs, dag ins,
- string asm, list<dag> pattern> :
- VINTRPCommon <outs, ins, asm, pattern>,
+ string asm> :
+ VINTRPCommon <outs, ins, asm, []>,
VINTRPe_vi <op>,
SIMCInstr<opName, SISubtarget.VI>;
@@ -1331,11 +1426,11 @@ multiclass VINTRP_m <bits <2> op, string opName, dag outs, dag ins, string asm,
list<dag> pattern = []> {
let DisableEncoding = disableEncoding,
Constraints = constraints in {
- def "" : VINTRP_Pseudo <opName, outs, ins, asm, pattern>;
+ def "" : VINTRP_Pseudo <opName, outs, ins, pattern>;
- def _si : VINTRP_Real_si <op, opName, outs, ins, asm, pattern>;
+ def _si : VINTRP_Real_si <op, opName, outs, ins, asm>;
- def _vi : VINTRP_Real_vi <op, opName, outs, ins, asm, pattern>;
+ def _vi : VINTRP_Real_vi <op, opName, outs, ins, asm>;
}
}
@@ -1467,70 +1562,92 @@ multiclass DS_Store2_Helper <bits<8> op, string asm, RegisterClass regClass>
asm#" $addr, $data0, $data1"#"$offset0"#"$offset1 [M0]",
[]>;
-class DS_1A_si <bits<8> op, dag outs, dag ins, string asm, list<dag> pat> :
- DS_si <op, outs, ins, asm, pat> {
- bits<16> offset;
-
- // Single load interpret the 2 i8imm operands as a single i16 offset.
- let offset0 = offset{7-0};
- let offset1 = offset{15-8};
-
- let hasSideEffects = 0;
+// 1 address, 1 data.
+multiclass DS_1A1D_RET_m <bits<8> op, string opName, dag outs, dag ins,
+ string asm, list<dag> pat, string noRetOp> {
+ let mayLoad = 1, mayStore = 1,
+ hasPostISelHook = 1 // Adjusted to no return version.
+ in {
+ def "" : DS_Pseudo <opName, outs, ins, pat>,
+ AtomicNoRet<noRetOp, 1>;
+
+ let data1 = 0 in {
+ def _si : DS_1A_Real_si <op, opName, outs, ins, asm>;
+ def _vi : DS_1A_Real_vi <op, opName, outs, ins, asm>;
+ }
+ }
}
-// 1 address, 1 data.
-class DS_1A1D_RET <bits<8> op, string asm, RegisterClass rc, string noRetOp = ""> : DS_1A_si <
- op,
+multiclass DS_1A1D_RET <bits<8> op, string asm, RegisterClass rc,
+ string noRetOp = ""> : DS_1A1D_RET_m <
+ op, asm,
(outs rc:$vdst),
(ins i1imm:$gds, VGPR_32:$addr, rc:$data0, ds_offset:$offset, M0Reg:$m0),
- asm#" $vdst, $addr, $data0"#"$offset"#" [M0]", []>,
- AtomicNoRet<noRetOp, 1> {
-
- let data1 = 0;
- let mayStore = 1;
- let mayLoad = 1;
+ asm#" $vdst, $addr, $data0"#"$offset"#" [M0]", [], noRetOp>;
- let hasPostISelHook = 1; // Adjusted to no return version.
+// 1 address, 2 data.
+multiclass DS_1A2D_RET_m <bits<8> op, string opName, dag outs, dag ins,
+ string asm, list<dag> pat, string noRetOp> {
+ let mayLoad = 1, mayStore = 1,
+ hasPostISelHook = 1 // Adjusted to no return version.
+ in {
+ def "" : DS_Pseudo <opName, outs, ins, pat>,
+ AtomicNoRet<noRetOp, 1>;
+
+ def _si : DS_1A_Real_si <op, opName, outs, ins, asm>;
+ def _vi : DS_1A_Real_vi <op, opName, outs, ins, asm>;
+ }
}
-// 1 address, 2 data.
-class DS_1A2D_RET <bits<8> op, string asm, RegisterClass rc, string noRetOp = ""> : DS_1A_si <
- op,
+multiclass DS_1A2D_RET <bits<8> op, string asm, RegisterClass rc,
+ string noRetOp = ""> : DS_1A2D_RET_m <
+ op, asm,
(outs rc:$vdst),
(ins i1imm:$gds, VGPR_32:$addr, rc:$data0, rc:$data1, ds_offset:$offset, M0Reg:$m0),
asm#" $vdst, $addr, $data0, $data1"#"$offset"#" [M0]",
- []>,
- AtomicNoRet<noRetOp, 1> {
- let mayStore = 1;
- let mayLoad = 1;
- let hasPostISelHook = 1; // Adjusted to no return version.
-}
+ [], noRetOp>;
// 1 address, 2 data.
-class DS_1A2D_NORET <bits<8> op, string asm, RegisterClass rc, string noRetOp = asm> : DS_1A_si <
- op,
+multiclass DS_1A2D_NORET_m <bits<8> op, string opName, dag outs, dag ins,
+ string asm, list<dag> pat, string noRetOp> {
+ let mayLoad = 1, mayStore = 1 in {
+ def "" : DS_Pseudo <opName, outs, ins, pat>,
+ AtomicNoRet<noRetOp, 0>;
+
+ def _si : DS_1A_Real_si <op, opName, outs, ins, asm>;
+ def _vi : DS_1A_Real_vi <op, opName, outs, ins, asm>;
+ }
+}
+
+multiclass DS_1A2D_NORET <bits<8> op, string asm, RegisterClass rc,
+ string noRetOp = asm> : DS_1A2D_NORET_m <
+ op, asm,
(outs),
(ins i1imm:$gds, VGPR_32:$addr, rc:$data0, rc:$data1, ds_offset:$offset, M0Reg:$m0),
asm#" $addr, $data0, $data1"#"$offset"#" [M0]",
- []>,
- AtomicNoRet<noRetOp, 0> {
- let mayStore = 1;
- let mayLoad = 1;
-}
+ [], noRetOp>;
// 1 address, 1 data.
-class DS_1A1D_NORET <bits<8> op, string asm, RegisterClass rc, string noRetOp = asm> : DS_1A_si <
- op,
+multiclass DS_1A1D_NORET_m <bits<8> op, string opName, dag outs, dag ins,
+ string asm, list<dag> pat, string noRetOp> {
+ let mayLoad = 1, mayStore = 1 in {
+ def "" : DS_Pseudo <opName, outs, ins, pat>,
+ AtomicNoRet<noRetOp, 0>;
+
+ let data1 = 0 in {
+ def _si : DS_1A_Real_si <op, opName, outs, ins, asm>;
+ def _vi : DS_1A_Real_vi <op, opName, outs, ins, asm>;
+ }
+ }
+}
+
+multiclass DS_1A1D_NORET <bits<8> op, string asm, RegisterClass rc,
+ string noRetOp = asm> : DS_1A1D_NORET_m <
+ op, asm,
(outs),
(ins i1imm:$gds, VGPR_32:$addr, rc:$data0, ds_offset:$offset, M0Reg:$m0),
asm#" $addr, $data0"#"$offset"#" [M0]",
- []>,
- AtomicNoRet<noRetOp, 0> {
-
- let data1 = 0;
- let mayStore = 1;
- let mayLoad = 1;
-}
+ [], noRetOp>;
//===----------------------------------------------------------------------===//
// MTBUF classes
@@ -1596,45 +1713,111 @@ multiclass MTBUF_Load_Helper <bits<3> op, string opName,
// MUBUF classes
//===----------------------------------------------------------------------===//
-class MUBUF_si <bits<7> op, dag outs, dag ins, string asm, list<dag> pattern> :
- MUBUF <outs, ins, asm, pattern>, MUBUFe <op> {
- let lds = 0;
-}
-
-class MUBUF_vi <bits<7> op, dag outs, dag ins, string asm, list<dag> pattern> :
- MUBUF <outs, ins, asm, pattern>, MUBUFe_vi <op> {
- let lds = 0;
+class mubuf <bits<7> si, bits<7> vi = si> {
+ field bits<7> SI = si;
+ field bits<7> VI = vi;
}
class MUBUFAddr64Table <bit is_addr64, string suffix = ""> {
-
bit IsAddr64 = is_addr64;
string OpName = NAME # suffix;
}
-class MUBUFAtomicAddr64 <bits<7> op, dag outs, dag ins, string asm, list<dag> pattern>
- : MUBUF_si <op, outs, ins, asm, pattern> {
+class MUBUF_Pseudo <string opName, dag outs, dag ins, list<dag> pattern> :
+ MUBUF <outs, ins, "", pattern>,
+ SIMCInstr<opName, SISubtarget.NONE> {
+ let isPseudo = 1;
+
+ // dummy fields, so that we can use let statements around multiclasses
+ bits<1> offen;
+ bits<1> idxen;
+ bits<8> vaddr;
+ bits<1> glc;
+ bits<1> slc;
+ bits<1> tfe;
+ bits<8> soffset;
+}
+
+class MUBUF_Real_si <mubuf op, string opName, dag outs, dag ins,
+ string asm> :
+ MUBUF <outs, ins, asm, []>,
+ MUBUFe <op.SI>,
+ SIMCInstr<opName, SISubtarget.SI> {
+ let lds = 0;
+}
- let offen = 0;
- let idxen = 0;
- let addr64 = 1;
- let tfe = 0;
+class MUBUF_Real_vi <mubuf op, string opName, dag outs, dag ins,
+ string asm> :
+ MUBUF <outs, ins, asm, []>,
+ MUBUFe_vi <op.VI>,
+ SIMCInstr<opName, SISubtarget.VI> {
let lds = 0;
- let soffset = 128;
}
-class MUBUFAtomicOffset <bits<7> op, dag outs, dag ins, string asm, list<dag> pattern>
- : MUBUF_si <op, outs, ins, asm, pattern> {
+multiclass MUBUF_m <mubuf op, string opName, dag outs, dag ins, string asm,
+ list<dag> pattern> {
+
+ def "" : MUBUF_Pseudo <opName, outs, ins, pattern>,
+ MUBUFAddr64Table <0>;
- let offen = 0;
- let idxen = 0;
- let addr64 = 0;
- let tfe = 0;
+ let addr64 = 0 in {
+ def _si : MUBUF_Real_si <op, opName, outs, ins, asm>;
+ }
+
+ def _vi : MUBUF_Real_vi <op, opName, outs, ins, asm>;
+}
+
+multiclass MUBUFAddr64_m <mubuf op, string opName, dag outs,
+ dag ins, string asm, list<dag> pattern> {
+
+ def "" : MUBUF_Pseudo <opName, outs, ins, pattern>,
+ MUBUFAddr64Table <1>;
+
+ let addr64 = 1 in {
+ def _si : MUBUF_Real_si <op, opName, outs, ins, asm>;
+ }
+
+ // There is no VI version. If the pseudo is selected, it should be lowered
+ // for VI appropriately.
+}
+
+class MUBUF_si <bits<7> op, dag outs, dag ins, string asm, list<dag> pattern> :
+ MUBUF <outs, ins, asm, pattern>, MUBUFe <op> {
let lds = 0;
- let vaddr = 0;
}
-multiclass MUBUF_Atomic <bits<7> op, string name, RegisterClass rc,
+multiclass MUBUFAtomicOffset_m <mubuf op, string opName, dag outs, dag ins,
+ string asm, list<dag> pattern, bit is_return> {
+
+ def "" : MUBUF_Pseudo <opName, outs, ins, pattern>,
+ MUBUFAddr64Table <0, !if(is_return, "_RTN", "")>,
+ AtomicNoRet<NAME#"_OFFSET", is_return>;
+
+ let offen = 0, idxen = 0, tfe = 0, vaddr = 0 in {
+ let addr64 = 0 in {
+ def _si : MUBUF_Real_si <op, opName, outs, ins, asm>;
+ }
+
+ def _vi : MUBUF_Real_vi <op, opName, outs, ins, asm>;
+ }
+}
+
+multiclass MUBUFAtomicAddr64_m <mubuf op, string opName, dag outs, dag ins,
+ string asm, list<dag> pattern, bit is_return> {
+
+ def "" : MUBUF_Pseudo <opName, outs, ins, pattern>,
+ MUBUFAddr64Table <1, !if(is_return, "_RTN", "")>,
+ AtomicNoRet<NAME#"_ADDR64", is_return>;
+
+ let offen = 0, idxen = 0, addr64 = 1, tfe = 0, soffset = 128 in {
+ def _si : MUBUF_Real_si <op, opName, outs, ins, asm>;
+ }
+
+ // There is no VI version. If the pseudo is selected, it should be lowered
+ // for VI appropriately.
+}
+
+multiclass MUBUF_Atomic <mubuf op, string name, RegisterClass rc,
ValueType vt, SDPatternOperator atomic> {
let mayStore = 1, mayLoad = 1, hasPostISelHook = 1 in {
@@ -1642,208 +1825,135 @@ multiclass MUBUF_Atomic <bits<7> op, string name, RegisterClass rc,
// No return variants
let glc = 0 in {
- def _ADDR64 : MUBUFAtomicAddr64 <
- op, (outs),
+ defm _ADDR64 : MUBUFAtomicAddr64_m <
+ op, name#"_addr64", (outs),
(ins rc:$vdata, SReg_128:$srsrc, VReg_64:$vaddr,
mbuf_offset:$offset, slc:$slc),
- name#" $vdata, $vaddr, $srsrc, 0 addr64"#"$offset"#"$slc", []
- >, MUBUFAddr64Table<1>, AtomicNoRet<NAME#"_ADDR64", 0>;
+ name#" $vdata, $vaddr, $srsrc, 0 addr64"#"$offset"#"$slc", [], 0
+ >;
- def _OFFSET : MUBUFAtomicOffset <
- op, (outs),
+ defm _OFFSET : MUBUFAtomicOffset_m <
+ op, name#"_offset", (outs),
(ins rc:$vdata, SReg_128:$srsrc, mbuf_offset:$offset,
SCSrc_32:$soffset, slc:$slc),
- name#" $vdata, $srsrc, $soffset"#"$offset"#"$slc", []
- >, MUBUFAddr64Table<0>, AtomicNoRet<NAME#"_OFFSET", 0>;
+ name#" $vdata, $srsrc, $soffset"#"$offset"#"$slc", [], 0
+ >;
} // glc = 0
// Variant that return values
let glc = 1, Constraints = "$vdata = $vdata_in",
DisableEncoding = "$vdata_in" in {
- def _RTN_ADDR64 : MUBUFAtomicAddr64 <
- op, (outs rc:$vdata),
+ defm _RTN_ADDR64 : MUBUFAtomicAddr64_m <
+ op, name#"_rtn_addr64", (outs rc:$vdata),
(ins rc:$vdata_in, SReg_128:$srsrc, VReg_64:$vaddr,
mbuf_offset:$offset, slc:$slc),
name#" $vdata, $vaddr, $srsrc, 0 addr64"#"$offset"#" glc"#"$slc",
[(set vt:$vdata,
(atomic (MUBUFAddr64Atomic v4i32:$srsrc, i64:$vaddr, i16:$offset,
- i1:$slc), vt:$vdata_in))]
- >, MUBUFAddr64Table<1, "_RTN">, AtomicNoRet<NAME#"_ADDR64", 1>;
+ i1:$slc), vt:$vdata_in))], 1
+ >;
- def _RTN_OFFSET : MUBUFAtomicOffset <
- op, (outs rc:$vdata),
+ defm _RTN_OFFSET : MUBUFAtomicOffset_m <
+ op, name#"_rtn_offset", (outs rc:$vdata),
(ins rc:$vdata_in, SReg_128:$srsrc, mbuf_offset:$offset,
SCSrc_32:$soffset, slc:$slc),
name#" $vdata, $srsrc, $soffset"#"$offset"#" glc $slc",
[(set vt:$vdata,
(atomic (MUBUFOffsetAtomic v4i32:$srsrc, i32:$soffset, i16:$offset,
- i1:$slc), vt:$vdata_in))]
- >, MUBUFAddr64Table<0, "_RTN">, AtomicNoRet<NAME#"_OFFSET", 1>;
+ i1:$slc), vt:$vdata_in))], 1
+ >;
} // glc = 1
} // mayStore = 1, mayLoad = 1, hasPostISelHook = 1
}
-multiclass MUBUF_Load_Helper <bits<7> op, string asm, RegisterClass regClass,
+multiclass MUBUF_Load_Helper <mubuf op, string name, RegisterClass regClass,
ValueType load_vt = i32,
SDPatternOperator ld = null_frag> {
let mayLoad = 1, mayStore = 0 in {
-
- let addr64 = 0 in {
-
- let offen = 0, idxen = 0, vaddr = 0 in {
- def _OFFSET : MUBUF_si <op, (outs regClass:$vdata),
- (ins SReg_128:$srsrc,
- mbuf_offset:$offset, SCSrc_32:$soffset, glc:$glc,
- slc:$slc, tfe:$tfe),
- asm#" $vdata, $srsrc, $soffset"#"$offset"#"$glc"#"$slc"#"$tfe",
- [(set load_vt:$vdata, (ld (MUBUFOffset v4i32:$srsrc,
- i32:$soffset, i16:$offset,
- i1:$glc, i1:$slc, i1:$tfe)))]>,
- MUBUFAddr64Table<0>;
- }
-
- let offen = 1, idxen = 0 in {
- def _OFFEN : MUBUF_si <op, (outs regClass:$vdata),
- (ins SReg_128:$srsrc, VGPR_32:$vaddr,
- SCSrc_32:$soffset, mbuf_offset:$offset, glc:$glc, slc:$slc,
- tfe:$tfe),
- asm#" $vdata, $vaddr, $srsrc, $soffset offen"#"$offset"#"$glc"#"$slc"#"$tfe", []>;
- }
-
- let offen = 0, idxen = 1 in {
- def _IDXEN : MUBUF_si <op, (outs regClass:$vdata),
- (ins SReg_128:$srsrc, VGPR_32:$vaddr,
- mbuf_offset:$offset, SCSrc_32:$soffset, glc:$glc,
- slc:$slc, tfe:$tfe),
- asm#" $vdata, $vaddr, $srsrc, $soffset idxen"#"$offset"#"$glc"#"$slc"#"$tfe", []>;
- }
-
- let offen = 1, idxen = 1 in {
- def _BOTHEN : MUBUF_si <op, (outs regClass:$vdata),
- (ins SReg_128:$srsrc, VReg_64:$vaddr,
- SCSrc_32:$soffset, glc:$glc, slc:$slc, tfe:$tfe),
- asm#" $vdata, $vaddr, $srsrc, $soffset, idxen offen"#"$glc"#"$slc"#"$tfe", []>;
- }
- }
-
- let offen = 0, idxen = 0, addr64 = 1, glc = 0, slc = 0, tfe = 0, soffset = 128 /* ZERO */ in {
- def _ADDR64 : MUBUF_si <op, (outs regClass:$vdata),
- (ins SReg_128:$srsrc, VReg_64:$vaddr, mbuf_offset:$offset),
- asm#" $vdata, $vaddr, $srsrc, 0 addr64"#"$offset",
- [(set load_vt:$vdata, (ld (MUBUFAddr64 v4i32:$srsrc,
- i64:$vaddr, i16:$offset)))]>, MUBUFAddr64Table<1>;
- }
- }
-}
-
-multiclass MUBUF_Load_Helper_vi <bits<7> op, string asm, RegisterClass regClass,
- ValueType load_vt = i32,
- SDPatternOperator ld = null_frag> {
-
- let lds = 0, mayLoad = 1 in {
let offen = 0, idxen = 0, vaddr = 0 in {
- def _OFFSET : MUBUF_vi <op, (outs regClass:$vdata),
+ defm _OFFSET : MUBUF_m <op, name#"_offset", (outs regClass:$vdata),
(ins SReg_128:$srsrc,
mbuf_offset:$offset, SCSrc_32:$soffset, glc:$glc,
slc:$slc, tfe:$tfe),
- asm#" $vdata, $srsrc, $soffset"#"$offset"#"$glc"#"$slc"#"$tfe",
+ name#" $vdata, $srsrc, $soffset"#"$offset"#"$glc"#"$slc"#"$tfe",
[(set load_vt:$vdata, (ld (MUBUFOffset v4i32:$srsrc,
i32:$soffset, i16:$offset,
- i1:$glc, i1:$slc, i1:$tfe)))]>,
- MUBUFAddr64Table<0>;
+ i1:$glc, i1:$slc, i1:$tfe)))]>;
}
let offen = 1, idxen = 0 in {
- def _OFFEN : MUBUF_vi <op, (outs regClass:$vdata),
+ defm _OFFEN : MUBUF_m <op, name#"_offen", (outs regClass:$vdata),
(ins SReg_128:$srsrc, VGPR_32:$vaddr,
SCSrc_32:$soffset, mbuf_offset:$offset, glc:$glc, slc:$slc,
tfe:$tfe),
- asm#" $vdata, $vaddr, $srsrc, $soffset offen"#"$offset"#"$glc"#"$slc"#"$tfe", []>;
+ name#" $vdata, $vaddr, $srsrc, $soffset offen"#"$offset"#"$glc"#"$slc"#"$tfe", []>;
}
let offen = 0, idxen = 1 in {
- def _IDXEN : MUBUF_vi <op, (outs regClass:$vdata),
+ defm _IDXEN : MUBUF_m <op, name#"_idxen", (outs regClass:$vdata),
(ins SReg_128:$srsrc, VGPR_32:$vaddr,
mbuf_offset:$offset, SCSrc_32:$soffset, glc:$glc,
slc:$slc, tfe:$tfe),
- asm#" $vdata, $vaddr, $srsrc, $soffset idxen"#"$offset"#"$glc"#"$slc"#"$tfe", []>;
+ name#" $vdata, $vaddr, $srsrc, $soffset idxen"#"$offset"#"$glc"#"$slc"#"$tfe", []>;
}
let offen = 1, idxen = 1 in {
- def _BOTHEN : MUBUF_vi <op, (outs regClass:$vdata),
+ defm _BOTHEN : MUBUF_m <op, name#"_bothen", (outs regClass:$vdata),
(ins SReg_128:$srsrc, VReg_64:$vaddr,
SCSrc_32:$soffset, glc:$glc, slc:$slc, tfe:$tfe),
- asm#" $vdata, $vaddr, $srsrc, $soffset, idxen offen"#"$glc"#"$slc"#"$tfe", []>;
+ name#" $vdata, $vaddr, $srsrc, $soffset, idxen offen"#"$glc"#"$slc"#"$tfe", []>;
+ }
+
+ let offen = 0, idxen = 0, glc = 0, slc = 0, tfe = 0, soffset = 128 /* ZERO */ in {
+ defm _ADDR64 : MUBUFAddr64_m <op, name#"_addr64", (outs regClass:$vdata),
+ (ins SReg_128:$srsrc, VReg_64:$vaddr, mbuf_offset:$offset),
+ name#" $vdata, $vaddr, $srsrc, 0 addr64"#"$offset",
+ [(set load_vt:$vdata, (ld (MUBUFAddr64 v4i32:$srsrc,
+ i64:$vaddr, i16:$offset)))]>;
}
}
}
-multiclass MUBUF_Store_Helper <bits<7> op, string name, RegisterClass vdataClass,
+multiclass MUBUF_Store_Helper <mubuf op, string name, RegisterClass vdataClass,
ValueType store_vt, SDPatternOperator st> {
-
let mayLoad = 0, mayStore = 1 in {
- let addr64 = 0 in {
-
- def "" : MUBUF_si <
- op, (outs),
- (ins vdataClass:$vdata, SReg_128:$srsrc, VGPR_32:$vaddr, SCSrc_32:$soffset,
- mbuf_offset:$offset, offen:$offen, idxen:$idxen, glc:$glc, slc:$slc,
- tfe:$tfe),
- name#" $vdata, $vaddr, $srsrc, $soffset"#"$offen"#"$idxen"#"$offset"#
- "$glc"#"$slc"#"$tfe",
- []
- >;
+ defm : MUBUF_m <op, name, (outs),
+ (ins vdataClass:$vdata, SReg_128:$srsrc, VGPR_32:$vaddr, SCSrc_32:$soffset,
+ mbuf_offset:$offset, offen:$offen, idxen:$idxen, glc:$glc, slc:$slc,
+ tfe:$tfe),
+ name#" $vdata, $vaddr, $srsrc, $soffset"#"$offen"#"$idxen"#"$offset"#
+ "$glc"#"$slc"#"$tfe", []>;
let offen = 0, idxen = 0, vaddr = 0 in {
- def _OFFSET : MUBUF_si <
- op, (outs),
- (ins vdataClass:$vdata, SReg_128:$srsrc, mbuf_offset:$offset,
- SCSrc_32:$soffset, glc:$glc, slc:$slc, tfe:$tfe),
- name#" $vdata, $srsrc, $soffset"#"$offset"#"$glc"#"$slc"#"$tfe",
- [(st store_vt:$vdata, (MUBUFOffset v4i32:$srsrc, i32:$soffset,
- i16:$offset, i1:$glc, i1:$slc,
- i1:$tfe))]
- >, MUBUFAddr64Table<0>;
+ defm _OFFSET : MUBUF_m <op, name#"_offset",(outs),
+ (ins vdataClass:$vdata, SReg_128:$srsrc, mbuf_offset:$offset,
+ SCSrc_32:$soffset, glc:$glc, slc:$slc, tfe:$tfe),
+ name#" $vdata, $srsrc, $soffset"#"$offset"#"$glc"#"$slc"#"$tfe",
+ [(st store_vt:$vdata, (MUBUFOffset v4i32:$srsrc, i32:$soffset,
+ i16:$offset, i1:$glc, i1:$slc, i1:$tfe))]>;
} // offen = 0, idxen = 0, vaddr = 0
let offen = 1, idxen = 0 in {
- def _OFFEN : MUBUF_si <
- op, (outs),
- (ins vdataClass:$vdata, SReg_128:$srsrc, VGPR_32:$vaddr, SCSrc_32:$soffset,
- mbuf_offset:$offset, glc:$glc, slc:$slc, tfe:$tfe),
- name#" $vdata, $vaddr, $srsrc, $soffset offen"#"$offset"#
- "$glc"#"$slc"#"$tfe",
- []
- >;
+ defm _OFFEN : MUBUF_m <op, name#"_offen", (outs),
+ (ins vdataClass:$vdata, SReg_128:$srsrc, VGPR_32:$vaddr, SCSrc_32:$soffset,
+ mbuf_offset:$offset, glc:$glc, slc:$slc, tfe:$tfe),
+ name#" $vdata, $vaddr, $srsrc, $soffset offen"#"$offset"#
+ "$glc"#"$slc"#"$tfe", []>;
} // end offen = 1, idxen = 0
- } // End addr64 = 0
-
- def _ADDR64 : MUBUF_si <
- op, (outs),
- (ins vdataClass:$vdata, SReg_128:$srsrc, VReg_64:$vaddr, mbuf_offset:$offset),
- name#" $vdata, $vaddr, $srsrc, 0 addr64"#"$offset",
- [(st store_vt:$vdata,
- (MUBUFAddr64 v4i32:$srsrc, i64:$vaddr, i16:$offset))]>, MUBUFAddr64Table<1>
- {
-
- let mayLoad = 0;
- let mayStore = 1;
-
- // Encoding
- let offen = 0;
- let idxen = 0;
- let glc = 0;
- let addr64 = 1;
- let slc = 0;
- let tfe = 0;
- let soffset = 128; // ZERO
- }
- } // End mayLoad = 0, mayStore = 1
+ let offen = 0, idxen = 0, glc = 0, slc = 0, tfe = 0,
+ soffset = 128 /* ZERO */ in {
+ defm _ADDR64 : MUBUFAddr64_m <op, name#"_addr64", (outs),
+ (ins vdataClass:$vdata, SReg_128:$srsrc, VReg_64:$vaddr, mbuf_offset:$offset),
+ name#" $vdata, $vaddr, $srsrc, 0 addr64"#"$offset",
+ [(st store_vt:$vdata,
+ (MUBUFAddr64 v4i32:$srsrc, i64:$vaddr, i16:$offset))]>;
+ }
+ } // End mayLoad = 0, mayStore = 1
}
class FLAT_Load_Helper <bits<7> op, string asm, RegisterClass regClass> :
@@ -1912,7 +2022,7 @@ multiclass MIMG_NoSampler <bits<7> op, string asm> {
class MIMG_Sampler_Helper <bits<7> op, string asm,
RegisterClass dst_rc,
- RegisterClass src_rc> : MIMG <
+ RegisterClass src_rc, int wqm> : MIMG <
op,
(outs dst_rc:$vdata),
(ins i32imm:$dmask, i1imm:$unorm, i1imm:$glc, i1imm:$da, i1imm:$r128,
@@ -1924,33 +2034,41 @@ class MIMG_Sampler_Helper <bits<7> op, string asm,
let mayLoad = 1;
let mayStore = 0;
let hasPostISelHook = 1;
+ let WQM = wqm;
}
multiclass MIMG_Sampler_Src_Helper <bits<7> op, string asm,
RegisterClass dst_rc,
- int channels> {
- def _V1 : MIMG_Sampler_Helper <op, asm, dst_rc, VGPR_32>,
+ int channels, int wqm> {
+ def _V1 : MIMG_Sampler_Helper <op, asm, dst_rc, VGPR_32, wqm>,
MIMG_Mask<asm#"_V1", channels>;
- def _V2 : MIMG_Sampler_Helper <op, asm, dst_rc, VReg_64>,
+ def _V2 : MIMG_Sampler_Helper <op, asm, dst_rc, VReg_64, wqm>,
MIMG_Mask<asm#"_V2", channels>;
- def _V4 : MIMG_Sampler_Helper <op, asm, dst_rc, VReg_128>,
+ def _V4 : MIMG_Sampler_Helper <op, asm, dst_rc, VReg_128, wqm>,
MIMG_Mask<asm#"_V4", channels>;
- def _V8 : MIMG_Sampler_Helper <op, asm, dst_rc, VReg_256>,
+ def _V8 : MIMG_Sampler_Helper <op, asm, dst_rc, VReg_256, wqm>,
MIMG_Mask<asm#"_V8", channels>;
- def _V16 : MIMG_Sampler_Helper <op, asm, dst_rc, VReg_512>,
+ def _V16 : MIMG_Sampler_Helper <op, asm, dst_rc, VReg_512, wqm>,
MIMG_Mask<asm#"_V16", channels>;
}
multiclass MIMG_Sampler <bits<7> op, string asm> {
- defm _V1 : MIMG_Sampler_Src_Helper<op, asm, VGPR_32, 1>;
- defm _V2 : MIMG_Sampler_Src_Helper<op, asm, VReg_64, 2>;
- defm _V3 : MIMG_Sampler_Src_Helper<op, asm, VReg_96, 3>;
- defm _V4 : MIMG_Sampler_Src_Helper<op, asm, VReg_128, 4>;
+ defm _V1 : MIMG_Sampler_Src_Helper<op, asm, VGPR_32, 1, 0>;
+ defm _V2 : MIMG_Sampler_Src_Helper<op, asm, VReg_64, 2, 0>;
+ defm _V3 : MIMG_Sampler_Src_Helper<op, asm, VReg_96, 3, 0>;
+ defm _V4 : MIMG_Sampler_Src_Helper<op, asm, VReg_128, 4, 0>;
+}
+
+multiclass MIMG_Sampler_WQM <bits<7> op, string asm> {
+ defm _V1 : MIMG_Sampler_Src_Helper<op, asm, VGPR_32, 1, 1>;
+ defm _V2 : MIMG_Sampler_Src_Helper<op, asm, VReg_64, 2, 1>;
+ defm _V3 : MIMG_Sampler_Src_Helper<op, asm, VReg_96, 3, 1>;
+ defm _V4 : MIMG_Sampler_Src_Helper<op, asm, VReg_128, 4, 1>;
}
class MIMG_Gather_Helper <bits<7> op, string asm,
RegisterClass dst_rc,
- RegisterClass src_rc> : MIMG <
+ RegisterClass src_rc, int wqm> : MIMG <
op,
(outs dst_rc:$vdata),
(ins i32imm:$dmask, i1imm:$unorm, i1imm:$glc, i1imm:$da, i1imm:$r128,
@@ -1971,28 +2089,36 @@ class MIMG_Gather_Helper <bits<7> op, string asm,
// Therefore, disable all code which updates DMASK by setting these two:
let MIMG = 0;
let hasPostISelHook = 0;
+ let WQM = wqm;
}
multiclass MIMG_Gather_Src_Helper <bits<7> op, string asm,
RegisterClass dst_rc,
- int channels> {
- def _V1 : MIMG_Gather_Helper <op, asm, dst_rc, VGPR_32>,
+ int channels, int wqm> {
+ def _V1 : MIMG_Gather_Helper <op, asm, dst_rc, VGPR_32, wqm>,
MIMG_Mask<asm#"_V1", channels>;
- def _V2 : MIMG_Gather_Helper <op, asm, dst_rc, VReg_64>,
+ def _V2 : MIMG_Gather_Helper <op, asm, dst_rc, VReg_64, wqm>,
MIMG_Mask<asm#"_V2", channels>;
- def _V4 : MIMG_Gather_Helper <op, asm, dst_rc, VReg_128>,
+ def _V4 : MIMG_Gather_Helper <op, asm, dst_rc, VReg_128, wqm>,
MIMG_Mask<asm#"_V4", channels>;
- def _V8 : MIMG_Gather_Helper <op, asm, dst_rc, VReg_256>,
+ def _V8 : MIMG_Gather_Helper <op, asm, dst_rc, VReg_256, wqm>,
MIMG_Mask<asm#"_V8", channels>;
- def _V16 : MIMG_Gather_Helper <op, asm, dst_rc, VReg_512>,
+ def _V16 : MIMG_Gather_Helper <op, asm, dst_rc, VReg_512, wqm>,
MIMG_Mask<asm#"_V16", channels>;
}
multiclass MIMG_Gather <bits<7> op, string asm> {
- defm _V1 : MIMG_Gather_Src_Helper<op, asm, VGPR_32, 1>;
- defm _V2 : MIMG_Gather_Src_Helper<op, asm, VReg_64, 2>;
- defm _V3 : MIMG_Gather_Src_Helper<op, asm, VReg_96, 3>;
- defm _V4 : MIMG_Gather_Src_Helper<op, asm, VReg_128, 4>;
+ defm _V1 : MIMG_Gather_Src_Helper<op, asm, VGPR_32, 1, 0>;
+ defm _V2 : MIMG_Gather_Src_Helper<op, asm, VReg_64, 2, 0>;
+ defm _V3 : MIMG_Gather_Src_Helper<op, asm, VReg_96, 3, 0>;
+ defm _V4 : MIMG_Gather_Src_Helper<op, asm, VReg_128, 4, 0>;
+}
+
+multiclass MIMG_Gather_WQM <bits<7> op, string asm> {
+ defm _V1 : MIMG_Gather_Src_Helper<op, asm, VGPR_32, 1, 1>;
+ defm _V2 : MIMG_Gather_Src_Helper<op, asm, VReg_64, 2, 1>;
+ defm _V3 : MIMG_Gather_Src_Helper<op, asm, VReg_96, 3, 1>;
+ defm _V4 : MIMG_Gather_Src_Helper<op, asm, VReg_128, 4, 1>;
}
//===----------------------------------------------------------------------===//
diff --git a/contrib/llvm/lib/Target/R600/SIInstructions.td b/contrib/llvm/lib/Target/R600/SIInstructions.td
index 4b1a846..bbedef2 100644
--- a/contrib/llvm/lib/Target/R600/SIInstructions.td
+++ b/contrib/llvm/lib/Target/R600/SIInstructions.td
@@ -152,9 +152,11 @@ defm S_FLBIT_I32_B32 : SOP1_32 <sop1<0x15, 0x12>, "s_flbit_i32_b32",
[(set i32:$dst, (ctlz_zero_undef i32:$src0))]
>;
-//defm S_FLBIT_I32_B64 : SOP1_32 <sop1<0x16, 0x13>, "s_flbit_i32_b64", []>;
-defm S_FLBIT_I32 : SOP1_32 <sop1<0x17, 0x14>, "s_flbit_i32", []>;
-//defm S_FLBIT_I32_I64 : SOP1_32 <sop1<0x18, 0x15>, "s_flbit_i32_i64", []>;
+defm S_FLBIT_I32_B64 : SOP1_32_64 <sop1<0x16, 0x13>, "s_flbit_i32_b64", []>;
+defm S_FLBIT_I32 : SOP1_32 <sop1<0x17, 0x14>, "s_flbit_i32",
+ [(set i32:$dst, (int_AMDGPU_flbit_i32 i32:$src0))]
+>;
+defm S_FLBIT_I32_I64 : SOP1_32_64 <sop1<0x18, 0x15>, "s_flbit_i32_i64", []>;
defm S_SEXT_I32_I8 : SOP1_32 <sop1<0x19, 0x16>, "s_sext_i32_i8",
[(set i32:$dst, (sext_inreg i32:$src0, i8))]
>;
@@ -764,88 +766,88 @@ defm V_CMPX_CLASS_F64 : VOPCX_CLASS_F64 <vopc<0xb8, 0x13>, "v_cmpx_class_f64">;
//===----------------------------------------------------------------------===//
-def DS_ADD_U32 : DS_1A1D_NORET <0x0, "ds_add_u32", VGPR_32>;
-def DS_SUB_U32 : DS_1A1D_NORET <0x1, "ds_sub_u32", VGPR_32>;
-def DS_RSUB_U32 : DS_1A1D_NORET <0x2, "ds_rsub_u32", VGPR_32>;
-def DS_INC_U32 : DS_1A1D_NORET <0x3, "ds_inc_u32", VGPR_32>;
-def DS_DEC_U32 : DS_1A1D_NORET <0x4, "ds_dec_u32", VGPR_32>;
-def DS_MIN_I32 : DS_1A1D_NORET <0x5, "ds_min_i32", VGPR_32>;
-def DS_MAX_I32 : DS_1A1D_NORET <0x6, "ds_max_i32", VGPR_32>;
-def DS_MIN_U32 : DS_1A1D_NORET <0x7, "ds_min_u32", VGPR_32>;
-def DS_MAX_U32 : DS_1A1D_NORET <0x8, "ds_max_u32", VGPR_32>;
-def DS_AND_B32 : DS_1A1D_NORET <0x9, "ds_and_b32", VGPR_32>;
-def DS_OR_B32 : DS_1A1D_NORET <0xa, "ds_or_b32", VGPR_32>;
-def DS_XOR_B32 : DS_1A1D_NORET <0xb, "ds_xor_b32", VGPR_32>;
-def DS_MSKOR_B32 : DS_1A1D_NORET <0xc, "ds_mskor_b32", VGPR_32>;
-def DS_CMPST_B32 : DS_1A2D_NORET <0x10, "ds_cmpst_b32", VGPR_32>;
-def DS_CMPST_F32 : DS_1A2D_NORET <0x11, "ds_cmpst_f32", VGPR_32>;
-def DS_MIN_F32 : DS_1A1D_NORET <0x12, "ds_min_f32", VGPR_32>;
-def DS_MAX_F32 : DS_1A1D_NORET <0x13, "ds_max_f32", VGPR_32>;
-
-def DS_ADD_RTN_U32 : DS_1A1D_RET <0x20, "ds_add_rtn_u32", VGPR_32, "ds_add_u32">;
-def DS_SUB_RTN_U32 : DS_1A1D_RET <0x21, "ds_sub_rtn_u32", VGPR_32, "ds_sub_u32">;
-def DS_RSUB_RTN_U32 : DS_1A1D_RET <0x22, "ds_rsub_rtn_u32", VGPR_32, "ds_rsub_u32">;
-def DS_INC_RTN_U32 : DS_1A1D_RET <0x23, "ds_inc_rtn_u32", VGPR_32, "ds_inc_u32">;
-def DS_DEC_RTN_U32 : DS_1A1D_RET <0x24, "ds_dec_rtn_u32", VGPR_32, "ds_dec_u32">;
-def DS_MIN_RTN_I32 : DS_1A1D_RET <0x25, "ds_min_rtn_i32", VGPR_32, "ds_min_i32">;
-def DS_MAX_RTN_I32 : DS_1A1D_RET <0x26, "ds_max_rtn_i32", VGPR_32, "ds_max_i32">;
-def DS_MIN_RTN_U32 : DS_1A1D_RET <0x27, "ds_min_rtn_u32", VGPR_32, "ds_min_u32">;
-def DS_MAX_RTN_U32 : DS_1A1D_RET <0x28, "ds_max_rtn_u32", VGPR_32, "ds_max_u32">;
-def DS_AND_RTN_B32 : DS_1A1D_RET <0x29, "ds_and_rtn_b32", VGPR_32, "ds_and_b32">;
-def DS_OR_RTN_B32 : DS_1A1D_RET <0x2a, "ds_or_rtn_b32", VGPR_32, "ds_or_b32">;
-def DS_XOR_RTN_B32 : DS_1A1D_RET <0x2b, "ds_xor_rtn_b32", VGPR_32, "ds_xor_b32">;
-def DS_MSKOR_RTN_B32 : DS_1A1D_RET <0x2c, "ds_mskor_rtn_b32", VGPR_32, "ds_mskor_b32">;
-def DS_WRXCHG_RTN_B32 : DS_1A1D_RET <0x2d, "ds_wrxchg_rtn_b32", VGPR_32>;
+defm DS_ADD_U32 : DS_1A1D_NORET <0x0, "ds_add_u32", VGPR_32>;
+defm DS_SUB_U32 : DS_1A1D_NORET <0x1, "ds_sub_u32", VGPR_32>;
+defm DS_RSUB_U32 : DS_1A1D_NORET <0x2, "ds_rsub_u32", VGPR_32>;
+defm DS_INC_U32 : DS_1A1D_NORET <0x3, "ds_inc_u32", VGPR_32>;
+defm DS_DEC_U32 : DS_1A1D_NORET <0x4, "ds_dec_u32", VGPR_32>;
+defm DS_MIN_I32 : DS_1A1D_NORET <0x5, "ds_min_i32", VGPR_32>;
+defm DS_MAX_I32 : DS_1A1D_NORET <0x6, "ds_max_i32", VGPR_32>;
+defm DS_MIN_U32 : DS_1A1D_NORET <0x7, "ds_min_u32", VGPR_32>;
+defm DS_MAX_U32 : DS_1A1D_NORET <0x8, "ds_max_u32", VGPR_32>;
+defm DS_AND_B32 : DS_1A1D_NORET <0x9, "ds_and_b32", VGPR_32>;
+defm DS_OR_B32 : DS_1A1D_NORET <0xa, "ds_or_b32", VGPR_32>;
+defm DS_XOR_B32 : DS_1A1D_NORET <0xb, "ds_xor_b32", VGPR_32>;
+defm DS_MSKOR_B32 : DS_1A1D_NORET <0xc, "ds_mskor_b32", VGPR_32>;
+defm DS_CMPST_B32 : DS_1A2D_NORET <0x10, "ds_cmpst_b32", VGPR_32>;
+defm DS_CMPST_F32 : DS_1A2D_NORET <0x11, "ds_cmpst_f32", VGPR_32>;
+defm DS_MIN_F32 : DS_1A1D_NORET <0x12, "ds_min_f32", VGPR_32>;
+defm DS_MAX_F32 : DS_1A1D_NORET <0x13, "ds_max_f32", VGPR_32>;
+
+defm DS_ADD_RTN_U32 : DS_1A1D_RET <0x20, "ds_add_rtn_u32", VGPR_32, "ds_add_u32">;
+defm DS_SUB_RTN_U32 : DS_1A1D_RET <0x21, "ds_sub_rtn_u32", VGPR_32, "ds_sub_u32">;
+defm DS_RSUB_RTN_U32 : DS_1A1D_RET <0x22, "ds_rsub_rtn_u32", VGPR_32, "ds_rsub_u32">;
+defm DS_INC_RTN_U32 : DS_1A1D_RET <0x23, "ds_inc_rtn_u32", VGPR_32, "ds_inc_u32">;
+defm DS_DEC_RTN_U32 : DS_1A1D_RET <0x24, "ds_dec_rtn_u32", VGPR_32, "ds_dec_u32">;
+defm DS_MIN_RTN_I32 : DS_1A1D_RET <0x25, "ds_min_rtn_i32", VGPR_32, "ds_min_i32">;
+defm DS_MAX_RTN_I32 : DS_1A1D_RET <0x26, "ds_max_rtn_i32", VGPR_32, "ds_max_i32">;
+defm DS_MIN_RTN_U32 : DS_1A1D_RET <0x27, "ds_min_rtn_u32", VGPR_32, "ds_min_u32">;
+defm DS_MAX_RTN_U32 : DS_1A1D_RET <0x28, "ds_max_rtn_u32", VGPR_32, "ds_max_u32">;
+defm DS_AND_RTN_B32 : DS_1A1D_RET <0x29, "ds_and_rtn_b32", VGPR_32, "ds_and_b32">;
+defm DS_OR_RTN_B32 : DS_1A1D_RET <0x2a, "ds_or_rtn_b32", VGPR_32, "ds_or_b32">;
+defm DS_XOR_RTN_B32 : DS_1A1D_RET <0x2b, "ds_xor_rtn_b32", VGPR_32, "ds_xor_b32">;
+defm DS_MSKOR_RTN_B32 : DS_1A1D_RET <0x2c, "ds_mskor_rtn_b32", VGPR_32, "ds_mskor_b32">;
+defm DS_WRXCHG_RTN_B32 : DS_1A1D_RET <0x2d, "ds_wrxchg_rtn_b32", VGPR_32>;
//def DS_WRXCHG2_RTN_B32 : DS_2A0D_RET <0x2e, "ds_wrxchg2_rtn_b32", VGPR_32, "ds_wrxchg2_b32">;
//def DS_WRXCHG2ST64_RTN_B32 : DS_2A0D_RET <0x2f, "ds_wrxchg2_rtn_b32", VGPR_32, "ds_wrxchg2st64_b32">;
-def DS_CMPST_RTN_B32 : DS_1A2D_RET <0x30, "ds_cmpst_rtn_b32", VGPR_32, "ds_cmpst_b32">;
-def DS_CMPST_RTN_F32 : DS_1A2D_RET <0x31, "ds_cmpst_rtn_f32", VGPR_32, "ds_cmpst_f32">;
-def DS_MIN_RTN_F32 : DS_1A1D_RET <0x32, "ds_min_rtn_f32", VGPR_32, "ds_min_f32">;
-def DS_MAX_RTN_F32 : DS_1A1D_RET <0x33, "ds_max_rtn_f32", VGPR_32, "ds_max_f32">;
+defm DS_CMPST_RTN_B32 : DS_1A2D_RET <0x30, "ds_cmpst_rtn_b32", VGPR_32, "ds_cmpst_b32">;
+defm DS_CMPST_RTN_F32 : DS_1A2D_RET <0x31, "ds_cmpst_rtn_f32", VGPR_32, "ds_cmpst_f32">;
+defm DS_MIN_RTN_F32 : DS_1A1D_RET <0x32, "ds_min_rtn_f32", VGPR_32, "ds_min_f32">;
+defm DS_MAX_RTN_F32 : DS_1A1D_RET <0x33, "ds_max_rtn_f32", VGPR_32, "ds_max_f32">;
let SubtargetPredicate = isCI in {
-def DS_WRAP_RTN_F32 : DS_1A1D_RET <0x34, "ds_wrap_rtn_f32", VGPR_32, "ds_wrap_f32">;
+defm DS_WRAP_RTN_F32 : DS_1A1D_RET <0x34, "ds_wrap_rtn_f32", VGPR_32, "ds_wrap_f32">;
} // End isCI
-def DS_ADD_U64 : DS_1A1D_NORET <0x40, "ds_add_u64", VReg_64>;
-def DS_SUB_U64 : DS_1A1D_NORET <0x41, "ds_sub_u64", VReg_64>;
-def DS_RSUB_U64 : DS_1A1D_NORET <0x42, "ds_rsub_u64", VReg_64>;
-def DS_INC_U64 : DS_1A1D_NORET <0x43, "ds_inc_u64", VReg_64>;
-def DS_DEC_U64 : DS_1A1D_NORET <0x44, "ds_dec_u64", VReg_64>;
-def DS_MIN_I64 : DS_1A1D_NORET <0x45, "ds_min_i64", VReg_64>;
-def DS_MAX_I64 : DS_1A1D_NORET <0x46, "ds_max_i64", VReg_64>;
-def DS_MIN_U64 : DS_1A1D_NORET <0x47, "ds_min_u64", VReg_64>;
-def DS_MAX_U64 : DS_1A1D_NORET <0x48, "ds_max_u64", VReg_64>;
-def DS_AND_B64 : DS_1A1D_NORET <0x49, "ds_and_b64", VReg_64>;
-def DS_OR_B64 : DS_1A1D_NORET <0x4a, "ds_or_b64", VReg_64>;
-def DS_XOR_B64 : DS_1A1D_NORET <0x4b, "ds_xor_b64", VReg_64>;
-def DS_MSKOR_B64 : DS_1A1D_NORET <0x4c, "ds_mskor_b64", VReg_64>;
-def DS_CMPST_B64 : DS_1A2D_NORET <0x50, "ds_cmpst_b64", VReg_64>;
-def DS_CMPST_F64 : DS_1A2D_NORET <0x51, "ds_cmpst_f64", VReg_64>;
-def DS_MIN_F64 : DS_1A1D_NORET <0x52, "ds_min_f64", VReg_64>;
-def DS_MAX_F64 : DS_1A1D_NORET <0x53, "ds_max_f64", VReg_64>;
-
-def DS_ADD_RTN_U64 : DS_1A1D_RET <0x60, "ds_add_rtn_u64", VReg_64, "ds_add_u64">;
-def DS_SUB_RTN_U64 : DS_1A1D_RET <0x61, "ds_sub_rtn_u64", VReg_64, "ds_sub_u64">;
-def DS_RSUB_RTN_U64 : DS_1A1D_RET <0x62, "ds_rsub_rtn_u64", VReg_64, "ds_rsub_u64">;
-def DS_INC_RTN_U64 : DS_1A1D_RET <0x63, "ds_inc_rtn_u64", VReg_64, "ds_inc_u64">;
-def DS_DEC_RTN_U64 : DS_1A1D_RET <0x64, "ds_dec_rtn_u64", VReg_64, "ds_dec_u64">;
-def DS_MIN_RTN_I64 : DS_1A1D_RET <0x65, "ds_min_rtn_i64", VReg_64, "ds_min_i64">;
-def DS_MAX_RTN_I64 : DS_1A1D_RET <0x66, "ds_max_rtn_i64", VReg_64, "ds_max_i64">;
-def DS_MIN_RTN_U64 : DS_1A1D_RET <0x67, "ds_min_rtn_u64", VReg_64, "ds_min_u64">;
-def DS_MAX_RTN_U64 : DS_1A1D_RET <0x68, "ds_max_rtn_u64", VReg_64, "ds_max_u64">;
-def DS_AND_RTN_B64 : DS_1A1D_RET <0x69, "ds_and_rtn_b64", VReg_64, "ds_and_b64">;
-def DS_OR_RTN_B64 : DS_1A1D_RET <0x6a, "ds_or_rtn_b64", VReg_64, "ds_or_b64">;
-def DS_XOR_RTN_B64 : DS_1A1D_RET <0x6b, "ds_xor_rtn_b64", VReg_64, "ds_xor_b64">;
-def DS_MSKOR_RTN_B64 : DS_1A1D_RET <0x6c, "ds_mskor_rtn_b64", VReg_64, "ds_mskor_b64">;
-def DS_WRXCHG_RTN_B64 : DS_1A1D_RET <0x6d, "ds_wrxchg_rtn_b64", VReg_64, "ds_wrxchg_b64">;
+defm DS_ADD_U64 : DS_1A1D_NORET <0x40, "ds_add_u64", VReg_64>;
+defm DS_SUB_U64 : DS_1A1D_NORET <0x41, "ds_sub_u64", VReg_64>;
+defm DS_RSUB_U64 : DS_1A1D_NORET <0x42, "ds_rsub_u64", VReg_64>;
+defm DS_INC_U64 : DS_1A1D_NORET <0x43, "ds_inc_u64", VReg_64>;
+defm DS_DEC_U64 : DS_1A1D_NORET <0x44, "ds_dec_u64", VReg_64>;
+defm DS_MIN_I64 : DS_1A1D_NORET <0x45, "ds_min_i64", VReg_64>;
+defm DS_MAX_I64 : DS_1A1D_NORET <0x46, "ds_max_i64", VReg_64>;
+defm DS_MIN_U64 : DS_1A1D_NORET <0x47, "ds_min_u64", VReg_64>;
+defm DS_MAX_U64 : DS_1A1D_NORET <0x48, "ds_max_u64", VReg_64>;
+defm DS_AND_B64 : DS_1A1D_NORET <0x49, "ds_and_b64", VReg_64>;
+defm DS_OR_B64 : DS_1A1D_NORET <0x4a, "ds_or_b64", VReg_64>;
+defm DS_XOR_B64 : DS_1A1D_NORET <0x4b, "ds_xor_b64", VReg_64>;
+defm DS_MSKOR_B64 : DS_1A1D_NORET <0x4c, "ds_mskor_b64", VReg_64>;
+defm DS_CMPST_B64 : DS_1A2D_NORET <0x50, "ds_cmpst_b64", VReg_64>;
+defm DS_CMPST_F64 : DS_1A2D_NORET <0x51, "ds_cmpst_f64", VReg_64>;
+defm DS_MIN_F64 : DS_1A1D_NORET <0x52, "ds_min_f64", VReg_64>;
+defm DS_MAX_F64 : DS_1A1D_NORET <0x53, "ds_max_f64", VReg_64>;
+
+defm DS_ADD_RTN_U64 : DS_1A1D_RET <0x60, "ds_add_rtn_u64", VReg_64, "ds_add_u64">;
+defm DS_SUB_RTN_U64 : DS_1A1D_RET <0x61, "ds_sub_rtn_u64", VReg_64, "ds_sub_u64">;
+defm DS_RSUB_RTN_U64 : DS_1A1D_RET <0x62, "ds_rsub_rtn_u64", VReg_64, "ds_rsub_u64">;
+defm DS_INC_RTN_U64 : DS_1A1D_RET <0x63, "ds_inc_rtn_u64", VReg_64, "ds_inc_u64">;
+defm DS_DEC_RTN_U64 : DS_1A1D_RET <0x64, "ds_dec_rtn_u64", VReg_64, "ds_dec_u64">;
+defm DS_MIN_RTN_I64 : DS_1A1D_RET <0x65, "ds_min_rtn_i64", VReg_64, "ds_min_i64">;
+defm DS_MAX_RTN_I64 : DS_1A1D_RET <0x66, "ds_max_rtn_i64", VReg_64, "ds_max_i64">;
+defm DS_MIN_RTN_U64 : DS_1A1D_RET <0x67, "ds_min_rtn_u64", VReg_64, "ds_min_u64">;
+defm DS_MAX_RTN_U64 : DS_1A1D_RET <0x68, "ds_max_rtn_u64", VReg_64, "ds_max_u64">;
+defm DS_AND_RTN_B64 : DS_1A1D_RET <0x69, "ds_and_rtn_b64", VReg_64, "ds_and_b64">;
+defm DS_OR_RTN_B64 : DS_1A1D_RET <0x6a, "ds_or_rtn_b64", VReg_64, "ds_or_b64">;
+defm DS_XOR_RTN_B64 : DS_1A1D_RET <0x6b, "ds_xor_rtn_b64", VReg_64, "ds_xor_b64">;
+defm DS_MSKOR_RTN_B64 : DS_1A1D_RET <0x6c, "ds_mskor_rtn_b64", VReg_64, "ds_mskor_b64">;
+defm DS_WRXCHG_RTN_B64 : DS_1A1D_RET <0x6d, "ds_wrxchg_rtn_b64", VReg_64, "ds_wrxchg_b64">;
//def DS_WRXCHG2_RTN_B64 : DS_2A0D_RET <0x6e, "ds_wrxchg2_rtn_b64", VReg_64, "ds_wrxchg2_b64">;
//def DS_WRXCHG2ST64_RTN_B64 : DS_2A0D_RET <0x6f, "ds_wrxchg2_rtn_b64", VReg_64, "ds_wrxchg2st64_b64">;
-def DS_CMPST_RTN_B64 : DS_1A2D_RET <0x70, "ds_cmpst_rtn_b64", VReg_64, "ds_cmpst_b64">;
-def DS_CMPST_RTN_F64 : DS_1A2D_RET <0x71, "ds_cmpst_rtn_f64", VReg_64, "ds_cmpst_f64">;
-def DS_MIN_RTN_F64 : DS_1A1D_RET <0x72, "ds_min_f64", VReg_64, "ds_min_f64">;
-def DS_MAX_RTN_F64 : DS_1A1D_RET <0x73, "ds_max_f64", VReg_64, "ds_max_f64">;
+defm DS_CMPST_RTN_B64 : DS_1A2D_RET <0x70, "ds_cmpst_rtn_b64", VReg_64, "ds_cmpst_b64">;
+defm DS_CMPST_RTN_F64 : DS_1A2D_RET <0x71, "ds_cmpst_rtn_f64", VReg_64, "ds_cmpst_f64">;
+defm DS_MIN_RTN_F64 : DS_1A1D_RET <0x72, "ds_min_rtn_f64", VReg_64, "ds_min_f64">;
+defm DS_MAX_RTN_F64 : DS_1A1D_RET <0x73, "ds_max_rtn_f64", VReg_64, "ds_max_f64">;
//let SubtargetPredicate = isCI in {
// DS_CONDXCHG32_RTN_B64
@@ -874,123 +876,120 @@ defm DS_WRITE2ST64_B64 : DS_Store2_Helper <0x0000004F, "ds_write2st64_b64", VReg
defm DS_READ2_B32 : DS_Load2_Helper <0x00000037, "ds_read2_b32", VReg_64>;
defm DS_READ2ST64_B32 : DS_Load2_Helper <0x00000038, "ds_read2st64_b32", VReg_64>;
-defm DS_READ2_B64 : DS_Load2_Helper <0x00000075, "ds_read2_b64", VReg_128>;
-defm DS_READ2ST64_B64 : DS_Load2_Helper <0x00000076, "ds_read2st64_b64", VReg_128>;
+defm DS_READ2_B64 : DS_Load2_Helper <0x00000077, "ds_read2_b64", VReg_128>;
+defm DS_READ2ST64_B64 : DS_Load2_Helper <0x00000078, "ds_read2st64_b64", VReg_128>;
//===----------------------------------------------------------------------===//
// MUBUF Instructions
//===----------------------------------------------------------------------===//
-let SubtargetPredicate = isSICI in {
-
-//def BUFFER_LOAD_FORMAT_X : MUBUF_ <0x00000000, "buffer_load_format_x", []>;
-//def BUFFER_LOAD_FORMAT_XY : MUBUF_ <0x00000001, "buffer_load_format_xy", []>;
-//def BUFFER_LOAD_FORMAT_XYZ : MUBUF_ <0x00000002, "buffer_load_format_xyz", []>;
-defm BUFFER_LOAD_FORMAT_XYZW : MUBUF_Load_Helper <0x00000003, "buffer_load_format_xyzw", VReg_128>;
-//def BUFFER_STORE_FORMAT_X : MUBUF_ <0x00000004, "buffer_store_format_x", []>;
-//def BUFFER_STORE_FORMAT_XY : MUBUF_ <0x00000005, "buffer_store_format_xy", []>;
-//def BUFFER_STORE_FORMAT_XYZ : MUBUF_ <0x00000006, "buffer_store_format_xyz", []>;
-//def BUFFER_STORE_FORMAT_XYZW : MUBUF_ <0x00000007, "buffer_store_format_xyzw", []>;
+//def BUFFER_LOAD_FORMAT_X : MUBUF_ <mubuf<0x00>, "buffer_load_format_x", []>;
+//def BUFFER_LOAD_FORMAT_XY : MUBUF_ <mubuf<0x01>, "buffer_load_format_xy", []>;
+//def BUFFER_LOAD_FORMAT_XYZ : MUBUF_ <mubuf<0x02>, "buffer_load_format_xyz", []>;
+defm BUFFER_LOAD_FORMAT_XYZW : MUBUF_Load_Helper <mubuf<0x03>, "buffer_load_format_xyzw", VReg_128>;
+//def BUFFER_STORE_FORMAT_X : MUBUF_ <mubuf<0x04>, "buffer_store_format_x", []>;
+//def BUFFER_STORE_FORMAT_XY : MUBUF_ <mubuf<0x05>, "buffer_store_format_xy", []>;
+//def BUFFER_STORE_FORMAT_XYZ : MUBUF_ <mubuf<0x06>, "buffer_store_format_xyz", []>;
+//def BUFFER_STORE_FORMAT_XYZW : MUBUF_ <mubuf<0x07>, "buffer_store_format_xyzw", []>;
defm BUFFER_LOAD_UBYTE : MUBUF_Load_Helper <
- 0x00000008, "buffer_load_ubyte", VGPR_32, i32, az_extloadi8_global
+ mubuf<0x08, 0x10>, "buffer_load_ubyte", VGPR_32, i32, az_extloadi8_global
>;
defm BUFFER_LOAD_SBYTE : MUBUF_Load_Helper <
- 0x00000009, "buffer_load_sbyte", VGPR_32, i32, sextloadi8_global
+ mubuf<0x09, 0x11>, "buffer_load_sbyte", VGPR_32, i32, sextloadi8_global
>;
defm BUFFER_LOAD_USHORT : MUBUF_Load_Helper <
- 0x0000000a, "buffer_load_ushort", VGPR_32, i32, az_extloadi16_global
+ mubuf<0x0a, 0x12>, "buffer_load_ushort", VGPR_32, i32, az_extloadi16_global
>;
defm BUFFER_LOAD_SSHORT : MUBUF_Load_Helper <
- 0x0000000b, "buffer_load_sshort", VGPR_32, i32, sextloadi16_global
+ mubuf<0x0b, 0x13>, "buffer_load_sshort", VGPR_32, i32, sextloadi16_global
>;
defm BUFFER_LOAD_DWORD : MUBUF_Load_Helper <
- 0x0000000c, "buffer_load_dword", VGPR_32, i32, global_load
+ mubuf<0x0c, 0x14>, "buffer_load_dword", VGPR_32, i32, global_load
>;
defm BUFFER_LOAD_DWORDX2 : MUBUF_Load_Helper <
- 0x0000000d, "buffer_load_dwordx2", VReg_64, v2i32, global_load
+ mubuf<0x0d, 0x15>, "buffer_load_dwordx2", VReg_64, v2i32, global_load
>;
defm BUFFER_LOAD_DWORDX4 : MUBUF_Load_Helper <
- 0x0000000e, "buffer_load_dwordx4", VReg_128, v4i32, global_load
+ mubuf<0x0e, 0x17>, "buffer_load_dwordx4", VReg_128, v4i32, global_load
>;
defm BUFFER_STORE_BYTE : MUBUF_Store_Helper <
- 0x00000018, "buffer_store_byte", VGPR_32, i32, truncstorei8_global
+ mubuf<0x18>, "buffer_store_byte", VGPR_32, i32, truncstorei8_global
>;
defm BUFFER_STORE_SHORT : MUBUF_Store_Helper <
- 0x0000001a, "buffer_store_short", VGPR_32, i32, truncstorei16_global
+ mubuf<0x1a>, "buffer_store_short", VGPR_32, i32, truncstorei16_global
>;
defm BUFFER_STORE_DWORD : MUBUF_Store_Helper <
- 0x0000001c, "buffer_store_dword", VGPR_32, i32, global_store
+ mubuf<0x1c>, "buffer_store_dword", VGPR_32, i32, global_store
>;
defm BUFFER_STORE_DWORDX2 : MUBUF_Store_Helper <
- 0x0000001d, "buffer_store_dwordx2", VReg_64, v2i32, global_store
+ mubuf<0x1d>, "buffer_store_dwordx2", VReg_64, v2i32, global_store
>;
defm BUFFER_STORE_DWORDX4 : MUBUF_Store_Helper <
- 0x0000001e, "buffer_store_dwordx4", VReg_128, v4i32, global_store
+ mubuf<0x1e, 0x1f>, "buffer_store_dwordx4", VReg_128, v4i32, global_store
>;
-//def BUFFER_ATOMIC_SWAP : MUBUF_ <0x00000030, "buffer_atomic_swap", []>;
+
defm BUFFER_ATOMIC_SWAP : MUBUF_Atomic <
- 0x00000030, "buffer_atomic_swap", VGPR_32, i32, atomic_swap_global
+ mubuf<0x30, 0x40>, "buffer_atomic_swap", VGPR_32, i32, atomic_swap_global
>;
-//def BUFFER_ATOMIC_CMPSWAP : MUBUF_ <0x00000031, "buffer_atomic_cmpswap", []>;
+//def BUFFER_ATOMIC_CMPSWAP : MUBUF_ <mubuf<0x31, 0x41>, "buffer_atomic_cmpswap", []>;
defm BUFFER_ATOMIC_ADD : MUBUF_Atomic <
- 0x00000032, "buffer_atomic_add", VGPR_32, i32, atomic_add_global
+ mubuf<0x32, 0x42>, "buffer_atomic_add", VGPR_32, i32, atomic_add_global
>;
defm BUFFER_ATOMIC_SUB : MUBUF_Atomic <
- 0x00000033, "buffer_atomic_sub", VGPR_32, i32, atomic_sub_global
+ mubuf<0x33, 0x43>, "buffer_atomic_sub", VGPR_32, i32, atomic_sub_global
>;
-//def BUFFER_ATOMIC_RSUB : MUBUF_ <0x00000034, "buffer_atomic_rsub", []>;
+//def BUFFER_ATOMIC_RSUB : MUBUF_ <mubuf<0x34>, "buffer_atomic_rsub", []>; // isn't on CI & VI
defm BUFFER_ATOMIC_SMIN : MUBUF_Atomic <
- 0x00000035, "buffer_atomic_smin", VGPR_32, i32, atomic_min_global
+ mubuf<0x35, 0x44>, "buffer_atomic_smin", VGPR_32, i32, atomic_min_global
>;
defm BUFFER_ATOMIC_UMIN : MUBUF_Atomic <
- 0x00000036, "buffer_atomic_umin", VGPR_32, i32, atomic_umin_global
+ mubuf<0x36, 0x45>, "buffer_atomic_umin", VGPR_32, i32, atomic_umin_global
>;
defm BUFFER_ATOMIC_SMAX : MUBUF_Atomic <
- 0x00000037, "buffer_atomic_smax", VGPR_32, i32, atomic_max_global
+ mubuf<0x37, 0x46>, "buffer_atomic_smax", VGPR_32, i32, atomic_max_global
>;
defm BUFFER_ATOMIC_UMAX : MUBUF_Atomic <
- 0x00000038, "buffer_atomic_umax", VGPR_32, i32, atomic_umax_global
+ mubuf<0x38, 0x47>, "buffer_atomic_umax", VGPR_32, i32, atomic_umax_global
>;
defm BUFFER_ATOMIC_AND : MUBUF_Atomic <
- 0x00000039, "buffer_atomic_and", VGPR_32, i32, atomic_and_global
+ mubuf<0x39, 0x48>, "buffer_atomic_and", VGPR_32, i32, atomic_and_global
>;
defm BUFFER_ATOMIC_OR : MUBUF_Atomic <
- 0x0000003a, "buffer_atomic_or", VGPR_32, i32, atomic_or_global
+ mubuf<0x3a, 0x49>, "buffer_atomic_or", VGPR_32, i32, atomic_or_global
>;
defm BUFFER_ATOMIC_XOR : MUBUF_Atomic <
- 0x0000003b, "buffer_atomic_xor", VGPR_32, i32, atomic_xor_global
->;
-//def BUFFER_ATOMIC_INC : MUBUF_ <0x0000003c, "buffer_atomic_inc", []>;
-//def BUFFER_ATOMIC_DEC : MUBUF_ <0x0000003d, "buffer_atomic_dec", []>;
-//def BUFFER_ATOMIC_FCMPSWAP : MUBUF_ <0x0000003e, "buffer_atomic_fcmpswap", []>;
-//def BUFFER_ATOMIC_FMIN : MUBUF_ <0x0000003f, "buffer_atomic_fmin", []>;
-//def BUFFER_ATOMIC_FMAX : MUBUF_ <0x00000040, "buffer_atomic_fmax", []>;
-//def BUFFER_ATOMIC_SWAP_X2 : MUBUF_X2 <0x00000050, "buffer_atomic_swap_x2", []>;
-//def BUFFER_ATOMIC_CMPSWAP_X2 : MUBUF_X2 <0x00000051, "buffer_atomic_cmpswap_x2", []>;
-//def BUFFER_ATOMIC_ADD_X2 : MUBUF_X2 <0x00000052, "buffer_atomic_add_x2", []>;
-//def BUFFER_ATOMIC_SUB_X2 : MUBUF_X2 <0x00000053, "buffer_atomic_sub_x2", []>;
-//def BUFFER_ATOMIC_RSUB_X2 : MUBUF_X2 <0x00000054, "buffer_atomic_rsub_x2", []>;
-//def BUFFER_ATOMIC_SMIN_X2 : MUBUF_X2 <0x00000055, "buffer_atomic_smin_x2", []>;
-//def BUFFER_ATOMIC_UMIN_X2 : MUBUF_X2 <0x00000056, "buffer_atomic_umin_x2", []>;
-//def BUFFER_ATOMIC_SMAX_X2 : MUBUF_X2 <0x00000057, "buffer_atomic_smax_x2", []>;
-//def BUFFER_ATOMIC_UMAX_X2 : MUBUF_X2 <0x00000058, "buffer_atomic_umax_x2", []>;
-//def BUFFER_ATOMIC_AND_X2 : MUBUF_X2 <0x00000059, "buffer_atomic_and_x2", []>;
-//def BUFFER_ATOMIC_OR_X2 : MUBUF_X2 <0x0000005a, "buffer_atomic_or_x2", []>;
-//def BUFFER_ATOMIC_XOR_X2 : MUBUF_X2 <0x0000005b, "buffer_atomic_xor_x2", []>;
-//def BUFFER_ATOMIC_INC_X2 : MUBUF_X2 <0x0000005c, "buffer_atomic_inc_x2", []>;
-//def BUFFER_ATOMIC_DEC_X2 : MUBUF_X2 <0x0000005d, "buffer_atomic_dec_x2", []>;
-//def BUFFER_ATOMIC_FCMPSWAP_X2 : MUBUF_X2 <0x0000005e, "buffer_atomic_fcmpswap_x2", []>;
-//def BUFFER_ATOMIC_FMIN_X2 : MUBUF_X2 <0x0000005f, "buffer_atomic_fmin_x2", []>;
-//def BUFFER_ATOMIC_FMAX_X2 : MUBUF_X2 <0x00000060, "buffer_atomic_fmax_x2", []>;
-//def BUFFER_WBINVL1_SC : MUBUF_WBINVL1 <0x00000070, "buffer_wbinvl1_sc", []>;
-//def BUFFER_WBINVL1 : MUBUF_WBINVL1 <0x00000071, "buffer_wbinvl1", []>;
-
-} // End SubtargetPredicate = isSICI
+ mubuf<0x3b, 0x4a>, "buffer_atomic_xor", VGPR_32, i32, atomic_xor_global
+>;
+//def BUFFER_ATOMIC_INC : MUBUF_ <mubuf<0x3c, 0x4b>, "buffer_atomic_inc", []>;
+//def BUFFER_ATOMIC_DEC : MUBUF_ <mubuf<0x3d, 0x4c>, "buffer_atomic_dec", []>;
+//def BUFFER_ATOMIC_FCMPSWAP : MUBUF_ <mubuf<0x3e>, "buffer_atomic_fcmpswap", []>; // isn't on VI
+//def BUFFER_ATOMIC_FMIN : MUBUF_ <mubuf<0x3f>, "buffer_atomic_fmin", []>; // isn't on VI
+//def BUFFER_ATOMIC_FMAX : MUBUF_ <mubuf<0x40>, "buffer_atomic_fmax", []>; // isn't on VI
+//def BUFFER_ATOMIC_SWAP_X2 : MUBUF_X2 <mubuf<0x50, 0x60>, "buffer_atomic_swap_x2", []>;
+//def BUFFER_ATOMIC_CMPSWAP_X2 : MUBUF_X2 <mubuf<0x51, 0x61>, "buffer_atomic_cmpswap_x2", []>;
+//def BUFFER_ATOMIC_ADD_X2 : MUBUF_X2 <mubuf<0x52, 0x62>, "buffer_atomic_add_x2", []>;
+//def BUFFER_ATOMIC_SUB_X2 : MUBUF_X2 <mubuf<0x53, 0x63>, "buffer_atomic_sub_x2", []>;
+//def BUFFER_ATOMIC_RSUB_X2 : MUBUF_X2 <mubuf<0x54>, "buffer_atomic_rsub_x2", []>; // isn't on CI & VI
+//def BUFFER_ATOMIC_SMIN_X2 : MUBUF_X2 <mubuf<0x55, 0x64>, "buffer_atomic_smin_x2", []>;
+//def BUFFER_ATOMIC_UMIN_X2 : MUBUF_X2 <mubuf<0x56, 0x65>, "buffer_atomic_umin_x2", []>;
+//def BUFFER_ATOMIC_SMAX_X2 : MUBUF_X2 <mubuf<0x57, 0x66>, "buffer_atomic_smax_x2", []>;
+//def BUFFER_ATOMIC_UMAX_X2 : MUBUF_X2 <mubuf<0x58, 0x67>, "buffer_atomic_umax_x2", []>;
+//def BUFFER_ATOMIC_AND_X2 : MUBUF_X2 <mubuf<0x59, 0x68>, "buffer_atomic_and_x2", []>;
+//def BUFFER_ATOMIC_OR_X2 : MUBUF_X2 <mubuf<0x5a, 0x69>, "buffer_atomic_or_x2", []>;
+//def BUFFER_ATOMIC_XOR_X2 : MUBUF_X2 <mubuf<0x5b, 0x6a>, "buffer_atomic_xor_x2", []>;
+//def BUFFER_ATOMIC_INC_X2 : MUBUF_X2 <mubuf<0x5c, 0x6b>, "buffer_atomic_inc_x2", []>;
+//def BUFFER_ATOMIC_DEC_X2 : MUBUF_X2 <mubuf<0x5d, 0x6c>, "buffer_atomic_dec_x2", []>;
+//def BUFFER_ATOMIC_FCMPSWAP_X2 : MUBUF_X2 <mubuf<0x5e>, "buffer_atomic_fcmpswap_x2", []>; // isn't on VI
+//def BUFFER_ATOMIC_FMIN_X2 : MUBUF_X2 <mubuf<0x5f>, "buffer_atomic_fmin_x2", []>; // isn't on VI
+//def BUFFER_ATOMIC_FMAX_X2 : MUBUF_X2 <mubuf<0x60>, "buffer_atomic_fmax_x2", []>; // isn't on VI
+//def BUFFER_WBINVL1_SC : MUBUF_WBINVL1 <mubuf<0x70>, "buffer_wbinvl1_sc", []>; // isn't on CI & VI
+//def BUFFER_WBINVL1_VOL : MUBUF_WBINVL1 <mubuf<0x70, 0x3f>, "buffer_wbinvl1_vol", []>; // isn't on SI
+//def BUFFER_WBINVL1 : MUBUF_WBINVL1 <mubuf<0x71, 0x3e>, "buffer_wbinvl1", []>;
//===----------------------------------------------------------------------===//
// MTBUF Instructions
@@ -1037,63 +1036,63 @@ defm IMAGE_GET_RESINFO : MIMG_NoSampler <0x0000000e, "image_get_resinfo">;
//def IMAGE_ATOMIC_FCMPSWAP : MIMG_NoPattern_ <"image_atomic_fcmpswap", 0x0000001d>;
//def IMAGE_ATOMIC_FMIN : MIMG_NoPattern_ <"image_atomic_fmin", 0x0000001e>;
//def IMAGE_ATOMIC_FMAX : MIMG_NoPattern_ <"image_atomic_fmax", 0x0000001f>;
-defm IMAGE_SAMPLE : MIMG_Sampler <0x00000020, "image_sample">;
-defm IMAGE_SAMPLE_CL : MIMG_Sampler <0x00000021, "image_sample_cl">;
+defm IMAGE_SAMPLE : MIMG_Sampler_WQM <0x00000020, "image_sample">;
+defm IMAGE_SAMPLE_CL : MIMG_Sampler_WQM <0x00000021, "image_sample_cl">;
defm IMAGE_SAMPLE_D : MIMG_Sampler <0x00000022, "image_sample_d">;
defm IMAGE_SAMPLE_D_CL : MIMG_Sampler <0x00000023, "image_sample_d_cl">;
defm IMAGE_SAMPLE_L : MIMG_Sampler <0x00000024, "image_sample_l">;
-defm IMAGE_SAMPLE_B : MIMG_Sampler <0x00000025, "image_sample_b">;
-defm IMAGE_SAMPLE_B_CL : MIMG_Sampler <0x00000026, "image_sample_b_cl">;
+defm IMAGE_SAMPLE_B : MIMG_Sampler_WQM <0x00000025, "image_sample_b">;
+defm IMAGE_SAMPLE_B_CL : MIMG_Sampler_WQM <0x00000026, "image_sample_b_cl">;
defm IMAGE_SAMPLE_LZ : MIMG_Sampler <0x00000027, "image_sample_lz">;
-defm IMAGE_SAMPLE_C : MIMG_Sampler <0x00000028, "image_sample_c">;
-defm IMAGE_SAMPLE_C_CL : MIMG_Sampler <0x00000029, "image_sample_c_cl">;
+defm IMAGE_SAMPLE_C : MIMG_Sampler_WQM <0x00000028, "image_sample_c">;
+defm IMAGE_SAMPLE_C_CL : MIMG_Sampler_WQM <0x00000029, "image_sample_c_cl">;
defm IMAGE_SAMPLE_C_D : MIMG_Sampler <0x0000002a, "image_sample_c_d">;
defm IMAGE_SAMPLE_C_D_CL : MIMG_Sampler <0x0000002b, "image_sample_c_d_cl">;
defm IMAGE_SAMPLE_C_L : MIMG_Sampler <0x0000002c, "image_sample_c_l">;
-defm IMAGE_SAMPLE_C_B : MIMG_Sampler <0x0000002d, "image_sample_c_b">;
-defm IMAGE_SAMPLE_C_B_CL : MIMG_Sampler <0x0000002e, "image_sample_c_b_cl">;
+defm IMAGE_SAMPLE_C_B : MIMG_Sampler_WQM <0x0000002d, "image_sample_c_b">;
+defm IMAGE_SAMPLE_C_B_CL : MIMG_Sampler_WQM <0x0000002e, "image_sample_c_b_cl">;
defm IMAGE_SAMPLE_C_LZ : MIMG_Sampler <0x0000002f, "image_sample_c_lz">;
-defm IMAGE_SAMPLE_O : MIMG_Sampler <0x00000030, "image_sample_o">;
-defm IMAGE_SAMPLE_CL_O : MIMG_Sampler <0x00000031, "image_sample_cl_o">;
+defm IMAGE_SAMPLE_O : MIMG_Sampler_WQM <0x00000030, "image_sample_o">;
+defm IMAGE_SAMPLE_CL_O : MIMG_Sampler_WQM <0x00000031, "image_sample_cl_o">;
defm IMAGE_SAMPLE_D_O : MIMG_Sampler <0x00000032, "image_sample_d_o">;
defm IMAGE_SAMPLE_D_CL_O : MIMG_Sampler <0x00000033, "image_sample_d_cl_o">;
defm IMAGE_SAMPLE_L_O : MIMG_Sampler <0x00000034, "image_sample_l_o">;
-defm IMAGE_SAMPLE_B_O : MIMG_Sampler <0x00000035, "image_sample_b_o">;
-defm IMAGE_SAMPLE_B_CL_O : MIMG_Sampler <0x00000036, "image_sample_b_cl_o">;
+defm IMAGE_SAMPLE_B_O : MIMG_Sampler_WQM <0x00000035, "image_sample_b_o">;
+defm IMAGE_SAMPLE_B_CL_O : MIMG_Sampler_WQM <0x00000036, "image_sample_b_cl_o">;
defm IMAGE_SAMPLE_LZ_O : MIMG_Sampler <0x00000037, "image_sample_lz_o">;
-defm IMAGE_SAMPLE_C_O : MIMG_Sampler <0x00000038, "image_sample_c_o">;
-defm IMAGE_SAMPLE_C_CL_O : MIMG_Sampler <0x00000039, "image_sample_c_cl_o">;
+defm IMAGE_SAMPLE_C_O : MIMG_Sampler_WQM <0x00000038, "image_sample_c_o">;
+defm IMAGE_SAMPLE_C_CL_O : MIMG_Sampler_WQM <0x00000039, "image_sample_c_cl_o">;
defm IMAGE_SAMPLE_C_D_O : MIMG_Sampler <0x0000003a, "image_sample_c_d_o">;
defm IMAGE_SAMPLE_C_D_CL_O : MIMG_Sampler <0x0000003b, "image_sample_c_d_cl_o">;
defm IMAGE_SAMPLE_C_L_O : MIMG_Sampler <0x0000003c, "image_sample_c_l_o">;
-defm IMAGE_SAMPLE_C_B_O : MIMG_Sampler <0x0000003d, "image_sample_c_b_o">;
-defm IMAGE_SAMPLE_C_B_CL_O : MIMG_Sampler <0x0000003e, "image_sample_c_b_cl_o">;
+defm IMAGE_SAMPLE_C_B_O : MIMG_Sampler_WQM <0x0000003d, "image_sample_c_b_o">;
+defm IMAGE_SAMPLE_C_B_CL_O : MIMG_Sampler_WQM <0x0000003e, "image_sample_c_b_cl_o">;
defm IMAGE_SAMPLE_C_LZ_O : MIMG_Sampler <0x0000003f, "image_sample_c_lz_o">;
-defm IMAGE_GATHER4 : MIMG_Gather <0x00000040, "image_gather4">;
-defm IMAGE_GATHER4_CL : MIMG_Gather <0x00000041, "image_gather4_cl">;
+defm IMAGE_GATHER4 : MIMG_Gather_WQM <0x00000040, "image_gather4">;
+defm IMAGE_GATHER4_CL : MIMG_Gather_WQM <0x00000041, "image_gather4_cl">;
defm IMAGE_GATHER4_L : MIMG_Gather <0x00000044, "image_gather4_l">;
-defm IMAGE_GATHER4_B : MIMG_Gather <0x00000045, "image_gather4_b">;
-defm IMAGE_GATHER4_B_CL : MIMG_Gather <0x00000046, "image_gather4_b_cl">;
+defm IMAGE_GATHER4_B : MIMG_Gather_WQM <0x00000045, "image_gather4_b">;
+defm IMAGE_GATHER4_B_CL : MIMG_Gather_WQM <0x00000046, "image_gather4_b_cl">;
defm IMAGE_GATHER4_LZ : MIMG_Gather <0x00000047, "image_gather4_lz">;
-defm IMAGE_GATHER4_C : MIMG_Gather <0x00000048, "image_gather4_c">;
-defm IMAGE_GATHER4_C_CL : MIMG_Gather <0x00000049, "image_gather4_c_cl">;
+defm IMAGE_GATHER4_C : MIMG_Gather_WQM <0x00000048, "image_gather4_c">;
+defm IMAGE_GATHER4_C_CL : MIMG_Gather_WQM <0x00000049, "image_gather4_c_cl">;
defm IMAGE_GATHER4_C_L : MIMG_Gather <0x0000004c, "image_gather4_c_l">;
-defm IMAGE_GATHER4_C_B : MIMG_Gather <0x0000004d, "image_gather4_c_b">;
-defm IMAGE_GATHER4_C_B_CL : MIMG_Gather <0x0000004e, "image_gather4_c_b_cl">;
+defm IMAGE_GATHER4_C_B : MIMG_Gather_WQM <0x0000004d, "image_gather4_c_b">;
+defm IMAGE_GATHER4_C_B_CL : MIMG_Gather_WQM <0x0000004e, "image_gather4_c_b_cl">;
defm IMAGE_GATHER4_C_LZ : MIMG_Gather <0x0000004f, "image_gather4_c_lz">;
-defm IMAGE_GATHER4_O : MIMG_Gather <0x00000050, "image_gather4_o">;
-defm IMAGE_GATHER4_CL_O : MIMG_Gather <0x00000051, "image_gather4_cl_o">;
+defm IMAGE_GATHER4_O : MIMG_Gather_WQM <0x00000050, "image_gather4_o">;
+defm IMAGE_GATHER4_CL_O : MIMG_Gather_WQM <0x00000051, "image_gather4_cl_o">;
defm IMAGE_GATHER4_L_O : MIMG_Gather <0x00000054, "image_gather4_l_o">;
-defm IMAGE_GATHER4_B_O : MIMG_Gather <0x00000055, "image_gather4_b_o">;
+defm IMAGE_GATHER4_B_O : MIMG_Gather_WQM <0x00000055, "image_gather4_b_o">;
defm IMAGE_GATHER4_B_CL_O : MIMG_Gather <0x00000056, "image_gather4_b_cl_o">;
defm IMAGE_GATHER4_LZ_O : MIMG_Gather <0x00000057, "image_gather4_lz_o">;
-defm IMAGE_GATHER4_C_O : MIMG_Gather <0x00000058, "image_gather4_c_o">;
-defm IMAGE_GATHER4_C_CL_O : MIMG_Gather <0x00000059, "image_gather4_c_cl_o">;
+defm IMAGE_GATHER4_C_O : MIMG_Gather_WQM <0x00000058, "image_gather4_c_o">;
+defm IMAGE_GATHER4_C_CL_O : MIMG_Gather_WQM <0x00000059, "image_gather4_c_cl_o">;
defm IMAGE_GATHER4_C_L_O : MIMG_Gather <0x0000005c, "image_gather4_c_l_o">;
-defm IMAGE_GATHER4_C_B_O : MIMG_Gather <0x0000005d, "image_gather4_c_b_o">;
-defm IMAGE_GATHER4_C_B_CL_O : MIMG_Gather <0x0000005e, "image_gather4_c_b_cl_o">;
+defm IMAGE_GATHER4_C_B_O : MIMG_Gather_WQM <0x0000005d, "image_gather4_c_b_o">;
+defm IMAGE_GATHER4_C_B_CL_O : MIMG_Gather_WQM <0x0000005e, "image_gather4_c_b_cl_o">;
defm IMAGE_GATHER4_C_LZ_O : MIMG_Gather <0x0000005f, "image_gather4_c_lz_o">;
-defm IMAGE_GET_LOD : MIMG_Sampler <0x00000060, "image_get_lod">;
+defm IMAGE_GET_LOD : MIMG_Sampler_WQM <0x00000060, "image_get_lod">;
defm IMAGE_SAMPLE_CD : MIMG_Sampler <0x00000068, "image_sample_cd">;
defm IMAGE_SAMPLE_CD_CL : MIMG_Sampler <0x00000069, "image_sample_cd_cl">;
defm IMAGE_SAMPLE_C_CD : MIMG_Sampler <0x0000006a, "image_sample_c_cd">;
@@ -1445,53 +1444,37 @@ defm V_MIN_F32 : VOP2Inst <vop2<0xf, 0xa>, "v_min_f32", VOP_F32_F32_F32,
fminnum>;
defm V_MAX_F32 : VOP2Inst <vop2<0x10, 0xb>, "v_max_f32", VOP_F32_F32_F32,
fmaxnum>;
-defm V_MIN_I32 : VOP2Inst <vop2<0x11, 0xc>, "v_min_i32", VOP_I32_I32_I32,
- AMDGPUsmin
->;
-defm V_MAX_I32 : VOP2Inst <vop2<0x12, 0xd>, "v_max_i32", VOP_I32_I32_I32,
- AMDGPUsmax
->;
-defm V_MIN_U32 : VOP2Inst <vop2<0x13, 0xe>, "v_min_u32", VOP_I32_I32_I32,
- AMDGPUumin
->;
-defm V_MAX_U32 : VOP2Inst <vop2<0x14, 0xf>, "v_max_u32", VOP_I32_I32_I32,
- AMDGPUumax
->;
+defm V_MIN_I32 : VOP2Inst <vop2<0x11, 0xc>, "v_min_i32", VOP_I32_I32_I32>;
+defm V_MAX_I32 : VOP2Inst <vop2<0x12, 0xd>, "v_max_i32", VOP_I32_I32_I32>;
+defm V_MIN_U32 : VOP2Inst <vop2<0x13, 0xe>, "v_min_u32", VOP_I32_I32_I32>;
+defm V_MAX_U32 : VOP2Inst <vop2<0x14, 0xf>, "v_max_u32", VOP_I32_I32_I32>;
-// No non-Rev Op on VI
defm V_LSHRREV_B32 : VOP2Inst <
vop2<0x16, 0x10>, "v_lshrrev_b32", VOP_I32_I32_I32, null_frag,
- "v_lshr_b32", "v_lshrrev_b32"
+ "v_lshr_b32"
>;
-// No non-Rev OP on VI
defm V_ASHRREV_I32 : VOP2Inst <
vop2<0x18, 0x11>, "v_ashrrev_i32", VOP_I32_I32_I32, null_frag,
- "v_ashr_i32", "v_ashrrev_i32"
+ "v_ashr_i32"
>;
-// No non-Rev OP on VI
defm V_LSHLREV_B32 : VOP2Inst <
vop2<0x1a, 0x12>, "v_lshlrev_b32", VOP_I32_I32_I32, null_frag,
- "v_lshl_b32", "v_lshlrev_b32"
+ "v_lshl_b32"
>;
-defm V_AND_B32 : VOP2Inst <vop2<0x1b, 0x13>, "v_and_b32",
- VOP_I32_I32_I32, and>;
-defm V_OR_B32 : VOP2Inst <vop2<0x1c, 0x14>, "v_or_b32",
- VOP_I32_I32_I32, or
->;
-defm V_XOR_B32 : VOP2Inst <vop2<0x1d, 0x15>, "v_xor_b32",
- VOP_I32_I32_I32, xor
->;
+defm V_AND_B32 : VOP2Inst <vop2<0x1b, 0x13>, "v_and_b32", VOP_I32_I32_I32>;
+defm V_OR_B32 : VOP2Inst <vop2<0x1c, 0x14>, "v_or_b32", VOP_I32_I32_I32>;
+defm V_XOR_B32 : VOP2Inst <vop2<0x1d, 0x15>, "v_xor_b32", VOP_I32_I32_I32>;
defm V_MAC_F32 : VOP2Inst <vop2<0x1f, 0x16>, "v_mac_f32", VOP_F32_F32_F32>;
} // End isCommutable = 1
-defm V_MADMK_F32 : VOP2Inst <vop2<0x20, 0x17>, "v_madmk_f32", VOP_F32_F32_F32>;
+defm V_MADMK_F32 : VOP2MADK <vop2<0x20, 0x17>, "v_madmk_f32">;
let isCommutable = 1 in {
-defm V_MADAK_F32 : VOP2Inst <vop2<0x21, 0x18>, "v_madak_f32", VOP_F32_F32_F32>;
+defm V_MADAK_F32 : VOP2MADK <vop2<0x21, 0x18>, "v_madak_f32">;
} // End isCommutable = 1
let isCommutable = 1, Defs = [VCC] in { // Carry-out goes to VCC
@@ -1503,9 +1486,7 @@ let isCommutable = 1, Defs = [VCC] in { // Carry-out goes to VCC
defm V_ADD_I32 : VOP2bInst <vop2<0x25, 0x19>, "v_add_i32",
VOP_I32_I32_I32, add
>;
-defm V_SUB_I32 : VOP2bInst <vop2<0x26, 0x1a>, "v_sub_i32",
- VOP_I32_I32_I32, sub
->;
+defm V_SUB_I32 : VOP2bInst <vop2<0x26, 0x1a>, "v_sub_i32", VOP_I32_I32_I32>;
defm V_SUBREV_I32 : VOP2bInst <vop2<0x27, 0x1b>, "v_subrev_i32",
VOP_I32_I32_I32, null_frag, "v_sub_i32"
@@ -1513,10 +1494,10 @@ defm V_SUBREV_I32 : VOP2bInst <vop2<0x27, 0x1b>, "v_subrev_i32",
let Uses = [VCC] in { // Carry-in comes from VCC
defm V_ADDC_U32 : VOP2bInst <vop2<0x28, 0x1c>, "v_addc_u32",
- VOP_I32_I32_I32_VCC, adde
+ VOP_I32_I32_I32_VCC
>;
defm V_SUBB_U32 : VOP2bInst <vop2<0x29, 0x1d>, "v_subb_u32",
- VOP_I32_I32_I32_VCC, sube
+ VOP_I32_I32_I32_VCC
>;
defm V_SUBBREV_U32 : VOP2bInst <vop2<0x2a, 0x1e>, "v_subbrev_u32",
VOP_I32_I32_I32_VCC, null_frag, "v_subb_u32"
@@ -1529,47 +1510,41 @@ defm V_READLANE_B32 : VOP2SI_3VI_m <
vop3 <0x001, 0x289>,
"v_readlane_b32",
(outs SReg_32:$vdst),
- (ins VGPR_32:$src0, SSrc_32:$vsrc1),
- "v_readlane_b32 $vdst, $src0, $vsrc1"
+ (ins VGPR_32:$src0, SCSrc_32:$src1),
+ "v_readlane_b32 $vdst, $src0, $src1"
>;
defm V_WRITELANE_B32 : VOP2SI_3VI_m <
vop3 <0x002, 0x28a>,
"v_writelane_b32",
(outs VGPR_32:$vdst),
- (ins SReg_32:$src0, SSrc_32:$vsrc1),
- "v_writelane_b32 $vdst, $src0, $vsrc1"
+ (ins SReg_32:$src0, SCSrc_32:$src1),
+ "v_writelane_b32 $vdst, $src0, $src1"
>;
// These instructions only exist on SI and CI
let SubtargetPredicate = isSICI in {
-let isCommutable = 1 in {
-defm V_MAC_LEGACY_F32 : VOP2Inst <vop2<0x6>, "v_mac_legacy_f32",
- VOP_F32_F32_F32
->;
-} // End isCommutable = 1
-
-defm V_MIN_LEGACY_F32 : VOP2Inst <vop2<0xd>, "v_min_legacy_f32",
+defm V_MIN_LEGACY_F32 : VOP2InstSI <vop2<0xd>, "v_min_legacy_f32",
VOP_F32_F32_F32, AMDGPUfmin_legacy
>;
-defm V_MAX_LEGACY_F32 : VOP2Inst <vop2<0xe>, "v_max_legacy_f32",
+defm V_MAX_LEGACY_F32 : VOP2InstSI <vop2<0xe>, "v_max_legacy_f32",
VOP_F32_F32_F32, AMDGPUfmax_legacy
>;
let isCommutable = 1 in {
-defm V_LSHR_B32 : VOP2Inst <vop2<0x15>, "v_lshr_b32", VOP_I32_I32_I32, srl>;
-defm V_ASHR_I32 : VOP2Inst <vop2<0x17>, "v_ashr_i32",
- VOP_I32_I32_I32, sra
->;
-
-let hasPostISelHook = 1 in {
-defm V_LSHL_B32 : VOP2Inst <vop2<0x19>, "v_lshl_b32", VOP_I32_I32_I32, shl>;
-}
-
+defm V_LSHR_B32 : VOP2InstSI <vop2<0x15>, "v_lshr_b32", VOP_I32_I32_I32>;
+defm V_ASHR_I32 : VOP2InstSI <vop2<0x17>, "v_ashr_i32", VOP_I32_I32_I32>;
+defm V_LSHL_B32 : VOP2InstSI <vop2<0x19>, "v_lshl_b32", VOP_I32_I32_I32>;
} // End isCommutable = 1
} // End let SubtargetPredicate = SICI
+let isCommutable = 1 in {
+defm V_MAC_LEGACY_F32 : VOP2_VI3_Inst <vop23<0x6, 0x28e>, "v_mac_legacy_f32",
+ VOP_F32_F32_F32
+>;
+} // End isCommutable = 1
+
defm V_BFM_B32 : VOP2_VI3_Inst <vop23<0x1e, 0x293>, "v_bfm_b32", VOP_I32_I32_I32,
AMDGPUbfm
>;
@@ -1586,14 +1561,25 @@ defm V_LDEXP_F32 : VOP2_VI3_Inst <vop23<0x2b, 0x288>, "v_ldexp_f32",
VOP_F32_F32_I32, AMDGPUldexp
>;
-////def V_CVT_PKACCUM_U8_F32 : VOP2_U8 <0x0000002c, "v_cvt_pkaccum_u8_f32", []>;
-////def V_CVT_PKNORM_I16_F32 : VOP2_I16 <0x0000002d, "v_cvt_pknorm_i16_f32", []>;
-////def V_CVT_PKNORM_U16_F32 : VOP2_U16 <0x0000002e, "v_cvt_pknorm_u16_f32", []>;
+
+defm V_CVT_PKACCUM_U8_F32 : VOP2_VI3_Inst <vop23<0x2c, 0x1f0>, "v_cvt_pkaccum_u8_f32",
+ VOP_I32_F32_I32>; // TODO: set "Uses = dst"
+
+defm V_CVT_PKNORM_I16_F32 : VOP2_VI3_Inst <vop23<0x2d, 0x294>, "v_cvt_pknorm_i16_f32",
+ VOP_I32_F32_F32
+>;
+defm V_CVT_PKNORM_U16_F32 : VOP2_VI3_Inst <vop23<0x2e, 0x295>, "v_cvt_pknorm_u16_f32",
+ VOP_I32_F32_F32
+>;
defm V_CVT_PKRTZ_F16_F32 : VOP2_VI3_Inst <vop23<0x2f, 0x296>, "v_cvt_pkrtz_f16_f32",
- VOP_I32_F32_F32, int_SI_packf16
+ VOP_I32_F32_F32, int_SI_packf16
+>;
+defm V_CVT_PK_U16_U32 : VOP2_VI3_Inst <vop23<0x30, 0x297>, "v_cvt_pk_u16_u32",
+ VOP_I32_I32_I32
+>;
+defm V_CVT_PK_I16_I32 : VOP2_VI3_Inst <vop23<0x31, 0x298>, "v_cvt_pk_i16_i32",
+ VOP_I32_I32_I32
>;
-////def V_CVT_PK_U16_U32 : VOP2_U16 <0x00000030, "v_cvt_pk_u16_u32", []>;
-////def V_CVT_PK_I16_I32 : VOP2_I16 <0x00000031, "v_cvt_pk_i16_i32", []>;
//===----------------------------------------------------------------------===//
// VOP3 Instructions
@@ -1659,27 +1645,34 @@ defm V_ALIGNBYTE_B32 : VOP3Inst <vop3<0x14f, 0x1cf>, "v_alignbyte_b32",
VOP_I32_I32_I32_I32
>;
-defm V_MIN3_F32 : VOP3Inst <vop3<0x151>, "v_min3_f32",
+defm V_MIN3_F32 : VOP3Inst <vop3<0x151, 0x1d0>, "v_min3_f32",
VOP_F32_F32_F32_F32, AMDGPUfmin3>;
-defm V_MIN3_I32 : VOP3Inst <vop3<0x152>, "v_min3_i32",
+defm V_MIN3_I32 : VOP3Inst <vop3<0x152, 0x1d1>, "v_min3_i32",
VOP_I32_I32_I32_I32, AMDGPUsmin3
>;
-defm V_MIN3_U32 : VOP3Inst <vop3<0x153>, "v_min3_u32",
+defm V_MIN3_U32 : VOP3Inst <vop3<0x153, 0x1d2>, "v_min3_u32",
VOP_I32_I32_I32_I32, AMDGPUumin3
>;
-defm V_MAX3_F32 : VOP3Inst <vop3<0x154>, "v_max3_f32",
+defm V_MAX3_F32 : VOP3Inst <vop3<0x154, 0x1d3>, "v_max3_f32",
VOP_F32_F32_F32_F32, AMDGPUfmax3
>;
-defm V_MAX3_I32 : VOP3Inst <vop3<0x155>, "v_max3_i32",
+defm V_MAX3_I32 : VOP3Inst <vop3<0x155, 0x1d4>, "v_max3_i32",
VOP_I32_I32_I32_I32, AMDGPUsmax3
>;
-defm V_MAX3_U32 : VOP3Inst <vop3<0x156>, "v_max3_u32",
+defm V_MAX3_U32 : VOP3Inst <vop3<0x156, 0x1d5>, "v_max3_u32",
VOP_I32_I32_I32_I32, AMDGPUumax3
>;
-//def V_MED3_F32 : VOP3_MED3 <0x00000157, "v_med3_f32", []>;
-//def V_MED3_I32 : VOP3_MED3 <0x00000158, "v_med3_i32", []>;
-//def V_MED3_U32 : VOP3_MED3 <0x00000159, "v_med3_u32", []>;
+defm V_MED3_F32 : VOP3Inst <vop3<0x157, 0x1d6>, "v_med3_f32",
+ VOP_F32_F32_F32_F32
+>;
+defm V_MED3_I32 : VOP3Inst <vop3<0x158, 0x1d7>, "v_med3_i32",
+ VOP_I32_I32_I32_I32
+>;
+defm V_MED3_U32 : VOP3Inst <vop3<0x159, 0x1d8>, "v_med3_u32",
+ VOP_I32_I32_I32_I32
+>;
+
//def V_SAD_U8 : VOP3_U8 <0x0000015a, "v_sad_u8", []>;
//def V_SAD_HI_U8 : VOP3_U8 <0x0000015b, "v_sad_hi_u8", []>;
//def V_SAD_U16 : VOP3_U16 <0x0000015c, "v_sad_u16", []>;
@@ -1742,21 +1735,36 @@ defm V_MUL_HI_I32 : VOP3Inst <vop3<0x16c, 0x287>, "v_mul_hi_i32",
} // isCommutable = 1, SchedRW = [WriteQuarterRate32]
+let SchedRW = [WriteFloatFMA, WriteSALU] in {
defm V_DIV_SCALE_F32 : VOP3b_32 <vop3<0x16d, 0x1e0>, "v_div_scale_f32", []>;
+}
-let SchedRW = [WriteDouble] in {
+let SchedRW = [WriteDouble, WriteSALU] in {
// Double precision division pre-scale.
defm V_DIV_SCALE_F64 : VOP3b_64 <vop3<0x16e, 0x1e1>, "v_div_scale_f64", []>;
} // let SchedRW = [WriteDouble]
-let isCommutable = 1 in {
-defm V_DIV_FMAS_F32 : VOP3Inst <vop3<0x16f, 0x1e2>, "v_div_fmas_f32",
+let isCommutable = 1, Uses = [VCC] in {
+
+// v_div_fmas_f32:
+// result = src0 * src1 + src2
+// if (vcc)
+// result *= 2^32
+//
+defm V_DIV_FMAS_F32 : VOP3_VCC_Inst <vop3<0x16f, 0x1e2>, "v_div_fmas_f32",
VOP_F32_F32_F32_F32, AMDGPUdiv_fmas
>;
+
let SchedRW = [WriteDouble] in {
-defm V_DIV_FMAS_F64 : VOP3Inst <vop3<0x170, 0x1e3>, "v_div_fmas_f64",
+// v_div_fmas_f64:
+// result = src0 * src1 + src2
+// if (vcc)
+// result *= 2^64
+//
+defm V_DIV_FMAS_F64 : VOP3_VCC_Inst <vop3<0x170, 0x1e3>, "v_div_fmas_f64",
VOP_F64_F64_F64_F64, AMDGPUdiv_fmas
>;
+
} // End SchedRW = [WriteDouble]
} // End isCommutable = 1
@@ -1774,23 +1782,29 @@ defm V_TRIG_PREOP_F64 : VOP3Inst <
// These instructions only exist on SI and CI
let SubtargetPredicate = isSICI in {
-defm V_LSHL_B64 : VOP3Inst <vop3<0x161>, "v_lshl_b64",
- VOP_I64_I64_I32, shl
->;
-
-defm V_LSHR_B64 : VOP3Inst <vop3<0x162>, "v_lshr_b64",
- VOP_I64_I64_I32, srl
->;
-
-defm V_ASHR_I64 : VOP3Inst <vop3<0x163>, "v_ashr_i64",
- VOP_I64_I64_I32, sra
->;
+defm V_LSHL_B64 : VOP3Inst <vop3<0x161>, "v_lshl_b64", VOP_I64_I64_I32>;
+defm V_LSHR_B64 : VOP3Inst <vop3<0x162>, "v_lshr_b64", VOP_I64_I64_I32>;
+defm V_ASHR_I64 : VOP3Inst <vop3<0x163>, "v_ashr_i64", VOP_I64_I64_I32>;
defm V_MULLIT_F32 : VOP3Inst <vop3<0x150>, "v_mullit_f32",
VOP_F32_F32_F32_F32>;
} // End SubtargetPredicate = isSICI
+let SubtargetPredicate = isVI in {
+
+defm V_LSHLREV_B64 : VOP3Inst <vop3<0, 0x28f>, "v_lshlrev_b64",
+ VOP_I64_I32_I64
+>;
+defm V_LSHRREV_B64 : VOP3Inst <vop3<0, 0x290>, "v_lshrrev_b64",
+ VOP_I64_I32_I64
+>;
+defm V_ASHRREV_I64 : VOP3Inst <vop3<0, 0x291>, "v_ashrrev_i64",
+ VOP_I64_I32_I64
+>;
+
+} // End SubtargetPredicate = isVI
+
//===----------------------------------------------------------------------===//
// Pseudo Instructions
//===----------------------------------------------------------------------===//
@@ -1809,8 +1823,8 @@ def SGPR_USE : InstSI <(outs),(ins), "", []>;
// SI pseudo instructions. These are used by the CFG structurizer pass
// and should be lowered to ISA instructions prior to codegen.
-let mayLoad = 1, mayStore = 1, hasSideEffects = 1,
- Uses = [EXEC], Defs = [EXEC] in {
+let mayLoad = 1, mayStore = 1, hasSideEffects = 1 in {
+let Uses = [EXEC], Defs = [EXEC] in {
let isBranch = 1, isTerminator = 1 in {
@@ -1867,15 +1881,18 @@ def SI_END_CF : InstSI <
[(int_SI_end_cf i64:$saved)]
>;
+} // End Uses = [EXEC], Defs = [EXEC]
+
+let Uses = [EXEC], Defs = [EXEC,VCC] in {
def SI_KILL : InstSI <
(outs),
(ins VSrc_32:$src),
"si_kill $src",
[(int_AMDGPU_kill f32:$src)]
>;
+} // End Uses = [EXEC], Defs = [EXEC,VCC]
} // end mayLoad = 1, mayStore = 1, hasSideEffects = 1
- // Uses = [EXEC], Defs = [EXEC]
let Uses = [EXEC], Defs = [EXEC,VCC,M0] in {
@@ -2020,16 +2037,12 @@ def : Pat <
(SI_KILL 0xbf800000)
>;
-let Predicates = [isSICI] in {
-
/* int_SI_vs_load_input */
def : Pat<
(SIload_input v4i32:$tlst, imm:$attr_offset, i32:$buf_idx_vgpr),
(BUFFER_LOAD_FORMAT_XYZW_IDXEN $tlst, $buf_idx_vgpr, imm:$attr_offset, 0, 0, 0, 0)
>;
-} // End Predicates = [isSICI]
-
/* int_SI_export */
def : Pat <
(int_SI_export imm:$en, imm:$vm, imm:$done, imm:$tgt, imm:$compr,
@@ -2156,9 +2169,13 @@ def : Pat <
//===----------------------------------------------------------------------===//
let Predicates = [UnsafeFPMath] in {
-def : RcpPat<V_RCP_F64_e32, f64>;
-defm : RsqPat<V_RSQ_F64_e32, f64>;
-defm : RsqPat<V_RSQ_F32_e32, f32>;
+
+//def : RcpPat<V_RCP_F64_e32, f64>;
+//defm : RsqPat<V_RSQ_F64_e32, f64>;
+//defm : RsqPat<V_RSQ_F32_e32, f32>;
+
+def : RsqPat<V_RSQ_F32_e32, f32>;
+def : RsqPat<V_RSQ_F64_e32, f64>;
}
//===----------------------------------------------------------------------===//
@@ -2675,13 +2692,6 @@ def : Pat <
(V_MUL_LEGACY_F32_e32 $src0, (V_RCP_LEGACY_F32_e32 $src1))
>;
-def : Pat<
- (fdiv f64:$src0, f64:$src1),
- (V_MUL_F64 0 /* src0_modifiers */, $src0,
- 0 /* src1_modifiers */, (V_RCP_F64_e32 $src1),
- 0 /* clamp */, 0 /* omod */)
->;
-
def : Pat <
(int_AMDGPU_cube v4f32:$src),
(REG_SEQUENCE VReg_128,
@@ -2716,16 +2726,12 @@ class Ext32Pat <SDNode ext> : Pat <
def : Ext32Pat <zext>;
def : Ext32Pat <anyext>;
-let Predicates = [isSICI] in {
-
// Offset in an 32Bit VGPR
def : Pat <
(SIload_constant v4i32:$sbase, i32:$voff),
(BUFFER_LOAD_DWORD_OFFEN $sbase, $voff, 0, 0, 0, 0, 0)
>;
-} // End Predicates = [isSICI]
-
// The multiplication scales from [0,1] to the unsigned integer range
def : Pat <
(AMDGPUurecip i32:$src0),
@@ -2907,7 +2913,6 @@ class MUBUFScratchLoadPat <MUBUF Instr, ValueType vt, PatFrag ld> : Pat <
(Instr $srsrc, $vaddr, $soffset, $offset, 0, 0, 0)
>;
-let Predicates = [isSICI] in {
def : MUBUFScratchLoadPat <BUFFER_LOAD_SBYTE_OFFEN, i32, sextloadi8_private>;
def : MUBUFScratchLoadPat <BUFFER_LOAD_UBYTE_OFFEN, i32, extloadi8_private>;
def : MUBUFScratchLoadPat <BUFFER_LOAD_SSHORT_OFFEN, i32, sextloadi16_private>;
@@ -2915,7 +2920,6 @@ def : MUBUFScratchLoadPat <BUFFER_LOAD_USHORT_OFFEN, i32, extloadi16_private>;
def : MUBUFScratchLoadPat <BUFFER_LOAD_DWORD_OFFEN, i32, load_private>;
def : MUBUFScratchLoadPat <BUFFER_LOAD_DWORDX2_OFFEN, v2i32, load_private>;
def : MUBUFScratchLoadPat <BUFFER_LOAD_DWORDX4_OFFEN, v4i32, load_private>;
-} // End Predicates = [isSICI]
// BUFFER_LOAD_DWORD*, addr64=0
multiclass MUBUF_Load_Dword <ValueType vt, MUBUF offset, MUBUF offen, MUBUF idxen,
@@ -2954,14 +2958,12 @@ multiclass MUBUF_Load_Dword <ValueType vt, MUBUF offset, MUBUF offen, MUBUF idxe
>;
}
-let Predicates = [isSICI] in {
defm : MUBUF_Load_Dword <i32, BUFFER_LOAD_DWORD_OFFSET, BUFFER_LOAD_DWORD_OFFEN,
BUFFER_LOAD_DWORD_IDXEN, BUFFER_LOAD_DWORD_BOTHEN>;
defm : MUBUF_Load_Dword <v2i32, BUFFER_LOAD_DWORDX2_OFFSET, BUFFER_LOAD_DWORDX2_OFFEN,
BUFFER_LOAD_DWORDX2_IDXEN, BUFFER_LOAD_DWORDX2_BOTHEN>;
defm : MUBUF_Load_Dword <v4i32, BUFFER_LOAD_DWORDX4_OFFSET, BUFFER_LOAD_DWORDX4_OFFEN,
BUFFER_LOAD_DWORDX4_IDXEN, BUFFER_LOAD_DWORDX4_BOTHEN>;
-} // End Predicates = [isSICI]
class MUBUFScratchStorePat <MUBUF Instr, ValueType vt, PatFrag st> : Pat <
(st vt:$value, (MUBUFScratch v4i32:$srsrc, i32:$vaddr, i32:$soffset,
@@ -2969,13 +2971,11 @@ class MUBUFScratchStorePat <MUBUF Instr, ValueType vt, PatFrag st> : Pat <
(Instr $value, $srsrc, $vaddr, $soffset, $offset, 0, 0, 0)
>;
-let Predicates = [isSICI] in {
def : MUBUFScratchStorePat <BUFFER_STORE_BYTE_OFFEN, i32, truncstorei8_private>;
def : MUBUFScratchStorePat <BUFFER_STORE_SHORT_OFFEN, i32, truncstorei16_private>;
def : MUBUFScratchStorePat <BUFFER_STORE_DWORD_OFFEN, i32, store_private>;
def : MUBUFScratchStorePat <BUFFER_STORE_DWORDX2_OFFEN, v2i32, store_private>;
def : MUBUFScratchStorePat <BUFFER_STORE_DWORDX4_OFFEN, v4i32, store_private>;
-} // End Predicates = [isSICI]
/*
class MUBUFStore_Pattern <MUBUF Instr, ValueType vt, PatFrag st> : Pat <
@@ -3246,6 +3246,12 @@ def : Pat <
>;
def : Pat <
+ (i1 (trunc i64:$a)),
+ (V_CMP_EQ_I32_e64 (V_AND_B32_e64 (i32 1),
+ (EXTRACT_SUBREG $a, sub0)), 1)
+>;
+
+def : Pat <
(i32 (bswap i32:$a)),
(V_BFI_B32 (S_MOV_B32 0x00ff00ff),
(V_ALIGNBIT_B32 $a, $a, 24),
@@ -3257,6 +3263,28 @@ def : Pat <
(V_CNDMASK_B32_e64 $src0, $src1, $src2)
>;
+//===----------------------------------------------------------------------===//
+// Fract Patterns
+//===----------------------------------------------------------------------===//
+
+let Predicates = [isCI] in {
+
+// Convert (x - floor(x)) to fract(x)
+def : Pat <
+ (f32 (fsub (f32 (VOP3Mods f32:$x, i32:$mods)),
+ (f32 (ffloor (f32 (VOP3Mods f32:$x, i32:$mods)))))),
+ (V_FRACT_F32_e64 $mods, $x, DSTCLAMP.NONE, DSTOMOD.NONE)
+>;
+
+// Convert (x + (-floor(x))) to fract(x)
+def : Pat <
+ (f64 (fadd (f64 (VOP3Mods f64:$x, i32:$mods)),
+ (f64 (fneg (f64 (ffloor (f64 (VOP3Mods f64:$x, i32:$mods)))))))),
+ (V_FRACT_F64_e64 $mods, $x, DSTCLAMP.NONE, DSTOMOD.NONE)
+>;
+
+} // End Predicates = [isCI]
+
//============================================================================//
// Miscellaneous Optimization Patterns
//============================================================================//
diff --git a/contrib/llvm/lib/Target/R600/SILowerControlFlow.cpp b/contrib/llvm/lib/Target/R600/SILowerControlFlow.cpp
index 068b22f..c319b32 100644
--- a/contrib/llvm/lib/Target/R600/SILowerControlFlow.cpp
+++ b/contrib/llvm/lib/Target/R600/SILowerControlFlow.cpp
@@ -88,7 +88,8 @@ private:
void Kill(MachineInstr &MI);
void Branch(MachineInstr &MI);
- void LoadM0(MachineInstr &MI, MachineInstr *MovRel);
+ void LoadM0(MachineInstr &MI, MachineInstr *MovRel, int Offset = 0);
+ void computeIndirectRegAndOffset(unsigned VecReg, unsigned &Reg, int &Offset);
void IndirectSrc(MachineInstr &MI);
void IndirectDst(MachineInstr &MI);
@@ -323,7 +324,7 @@ void SILowerControlFlowPass::Kill(MachineInstr &MI) {
MI.eraseFromParent();
}
-void SILowerControlFlowPass::LoadM0(MachineInstr &MI, MachineInstr *MovRel) {
+void SILowerControlFlowPass::LoadM0(MachineInstr &MI, MachineInstr *MovRel, int Offset) {
MachineBasicBlock &MBB = *MI.getParent();
DebugLoc DL = MI.getDebugLoc();
@@ -333,8 +334,14 @@ void SILowerControlFlowPass::LoadM0(MachineInstr &MI, MachineInstr *MovRel) {
unsigned Idx = MI.getOperand(3).getReg();
if (AMDGPU::SReg_32RegClass.contains(Idx)) {
- BuildMI(MBB, &MI, DL, TII->get(AMDGPU::S_MOV_B32), AMDGPU::M0)
- .addReg(Idx);
+ if (Offset) {
+ BuildMI(MBB, &MI, DL, TII->get(AMDGPU::S_ADD_I32), AMDGPU::M0)
+ .addReg(Idx)
+ .addImm(Offset);
+ } else {
+ BuildMI(MBB, &MI, DL, TII->get(AMDGPU::S_MOV_B32), AMDGPU::M0)
+ .addReg(Idx);
+ }
MBB.insert(I, MovRel);
} else {
@@ -363,6 +370,11 @@ void SILowerControlFlowPass::LoadM0(MachineInstr &MI, MachineInstr *MovRel) {
BuildMI(MBB, &MI, DL, TII->get(AMDGPU::S_AND_SAVEEXEC_B64), AMDGPU::VCC)
.addReg(AMDGPU::VCC);
+ if (Offset) {
+ BuildMI(MBB, &MI, DL, TII->get(AMDGPU::S_ADD_I32), AMDGPU::M0)
+ .addReg(AMDGPU::M0)
+ .addImm(Offset);
+ }
// Do the actual move
MBB.insert(I, MovRel);
@@ -384,6 +396,33 @@ void SILowerControlFlowPass::LoadM0(MachineInstr &MI, MachineInstr *MovRel) {
MI.eraseFromParent();
}
+/// \param @VecReg The register which holds element zero of the vector
+/// being addressed into.
+/// \param[out] @Reg The base register to use in the indirect addressing instruction.
+/// \param[in,out] @Offset As an input, this is the constant offset part of the
+// indirect Index. e.g. v0 = v[VecReg + Offset]
+// As an output, this is a constant value that needs
+// to be added to the value stored in M0.
+void SILowerControlFlowPass::computeIndirectRegAndOffset(unsigned VecReg,
+ unsigned &Reg,
+ int &Offset) {
+ unsigned SubReg = TRI->getSubReg(VecReg, AMDGPU::sub0);
+ if (!SubReg)
+ SubReg = VecReg;
+
+ const TargetRegisterClass *RC = TRI->getPhysRegClass(SubReg);
+ int RegIdx = TRI->getHWRegIndex(SubReg) + Offset;
+
+ if (RegIdx < 0) {
+ Offset = RegIdx;
+ RegIdx = 0;
+ } else {
+ Offset = 0;
+ }
+
+ Reg = RC->getRegister(RegIdx);
+}
+
void SILowerControlFlowPass::IndirectSrc(MachineInstr &MI) {
MachineBasicBlock &MBB = *MI.getParent();
@@ -391,18 +430,18 @@ void SILowerControlFlowPass::IndirectSrc(MachineInstr &MI) {
unsigned Dst = MI.getOperand(0).getReg();
unsigned Vec = MI.getOperand(2).getReg();
- unsigned Off = MI.getOperand(4).getImm();
- unsigned SubReg = TRI->getSubReg(Vec, AMDGPU::sub0);
- if (!SubReg)
- SubReg = Vec;
+ int Off = MI.getOperand(4).getImm();
+ unsigned Reg;
+
+ computeIndirectRegAndOffset(Vec, Reg, Off);
MachineInstr *MovRel =
BuildMI(*MBB.getParent(), DL, TII->get(AMDGPU::V_MOVRELS_B32_e32), Dst)
- .addReg(SubReg + Off)
+ .addReg(Reg)
.addReg(AMDGPU::M0, RegState::Implicit)
.addReg(Vec, RegState::Implicit);
- LoadM0(MI, MovRel);
+ LoadM0(MI, MovRel, Off);
}
void SILowerControlFlowPass::IndirectDst(MachineInstr &MI) {
@@ -411,20 +450,20 @@ void SILowerControlFlowPass::IndirectDst(MachineInstr &MI) {
DebugLoc DL = MI.getDebugLoc();
unsigned Dst = MI.getOperand(0).getReg();
- unsigned Off = MI.getOperand(4).getImm();
+ int Off = MI.getOperand(4).getImm();
unsigned Val = MI.getOperand(5).getReg();
- unsigned SubReg = TRI->getSubReg(Dst, AMDGPU::sub0);
- if (!SubReg)
- SubReg = Dst;
+ unsigned Reg;
+
+ computeIndirectRegAndOffset(Dst, Reg, Off);
MachineInstr *MovRel =
BuildMI(*MBB.getParent(), DL, TII->get(AMDGPU::V_MOVRELD_B32_e32))
- .addReg(SubReg + Off, RegState::Define)
+ .addReg(Reg, RegState::Define)
.addReg(Val)
.addReg(AMDGPU::M0, RegState::Implicit)
.addReg(Dst, RegState::Implicit);
- LoadM0(MI, MovRel);
+ LoadM0(MI, MovRel, Off);
}
bool SILowerControlFlowPass::runOnMachineFunction(MachineFunction &MF) {
@@ -447,7 +486,7 @@ bool SILowerControlFlowPass::runOnMachineFunction(MachineFunction &MF) {
Next = std::next(I);
MachineInstr &MI = *I;
- if (TII->isDS(MI.getOpcode()))
+ if (TII->isWQM(MI.getOpcode()) || TII->isDS(MI.getOpcode()))
NeedWQM = true;
// Flat uses m0 in case it needs to access LDS.
@@ -513,12 +552,6 @@ bool SILowerControlFlowPass::runOnMachineFunction(MachineFunction &MF) {
case AMDGPU::SI_INDIRECT_DST_V16:
IndirectDst(MI);
break;
-
- case AMDGPU::V_INTERP_P1_F32:
- case AMDGPU::V_INTERP_P2_F32:
- case AMDGPU::V_INTERP_MOV_F32:
- NeedWQM = true;
- break;
}
}
}
diff --git a/contrib/llvm/lib/Target/R600/SIRegisterInfo.cpp b/contrib/llvm/lib/Target/R600/SIRegisterInfo.cpp
index 58c2cd1..f502991 100644
--- a/contrib/llvm/lib/Target/R600/SIRegisterInfo.cpp
+++ b/contrib/llvm/lib/Target/R600/SIRegisterInfo.cpp
@@ -14,7 +14,6 @@
#include "SIRegisterInfo.h"
-#include "AMDGPUSubtarget.h"
#include "SIInstrInfo.h"
#include "SIMachineFunctionInfo.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
@@ -47,13 +46,31 @@ BitVector SIRegisterInfo::getReservedRegs(const MachineFunction &MF) const {
Reserved.set(AMDGPU::VGPR255);
Reserved.set(AMDGPU::VGPR254);
+ // Tonga and Iceland can only allocate a fixed number of SGPRs due
+ // to a hw bug.
+ if (ST.hasSGPRInitBug()) {
+ unsigned NumSGPRs = AMDGPU::SGPR_32RegClass.getNumRegs();
+ // Reserve some SGPRs for FLAT_SCRATCH and VCC (4 SGPRs).
+ // Assume XNACK_MASK is unused.
+ unsigned Limit = AMDGPUSubtarget::FIXED_SGPR_COUNT_FOR_INIT_BUG - 4;
+
+ for (unsigned i = Limit; i < NumSGPRs; ++i) {
+ unsigned Reg = AMDGPU::SGPR_32RegClass.getRegister(i);
+ MCRegAliasIterator R = MCRegAliasIterator(Reg, this, true);
+
+ for (; R.isValid(); ++R)
+ Reserved.set(*R);
+ }
+ }
+
return Reserved;
}
unsigned SIRegisterInfo::getRegPressureSetLimit(unsigned Idx) const {
// FIXME: We should adjust the max number of waves based on LDS size.
- unsigned SGPRLimit = getNumSGPRsAllowed(ST.getMaxWavesPerCU());
+ unsigned SGPRLimit = getNumSGPRsAllowed(ST.getGeneration(),
+ ST.getMaxWavesPerCU());
unsigned VGPRLimit = getNumVGPRsAllowed(ST.getMaxWavesPerCU());
for (regclass_iterator I = regclass_begin(), E = regclass_end();
@@ -204,7 +221,9 @@ void SIRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator MI,
Ctx.emitError("Ran out of VGPRs for spilling SGPR");
}
- BuildMI(*MBB, MI, DL, TII->get(AMDGPU::V_WRITELANE_B32), Spill.VGPR)
+ BuildMI(*MBB, MI, DL,
+ TII->getMCOpcodeFromPseudo(AMDGPU::V_WRITELANE_B32),
+ Spill.VGPR)
.addReg(SubReg)
.addImm(Spill.Lane);
@@ -236,7 +255,9 @@ void SIRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator MI,
if (isM0)
SubReg = RS->scavengeRegister(&AMDGPU::SGPR_32RegClass, MI, 0);
- BuildMI(*MBB, MI, DL, TII->get(AMDGPU::V_READLANE_B32), SubReg)
+ BuildMI(*MBB, MI, DL,
+ TII->getMCOpcodeFromPseudo(AMDGPU::V_READLANE_B32),
+ SubReg)
.addReg(Spill.VGPR)
.addImm(Spill.Lane)
.addReg(MI->getOperand(0).getReg(), RegState::ImplicitDefine);
@@ -245,7 +266,22 @@ void SIRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator MI,
.addReg(SubReg);
}
}
- TII->insertNOPs(MI, 3);
+
+ // TODO: only do this when it is needed
+ switch (ST.getGeneration()) {
+ case AMDGPUSubtarget::SOUTHERN_ISLANDS:
+ // "VALU writes SGPR" -> "SMRD reads that SGPR" needs "S_NOP 3" on SI
+ TII->insertNOPs(MI, 3);
+ break;
+ case AMDGPUSubtarget::SEA_ISLANDS:
+ break;
+ default: // VOLCANIC_ISLANDS and later
+ // "VALU writes SGPR -> VMEM reads that SGPR" needs "S_NOP 4" on VI
+ // and later. This also applies to VALUs which write VCC, but we're
+ // unlikely to see VMEM use VCC.
+ TII->insertNOPs(MI, 4);
+ }
+
MI->eraseFromParent();
break;
}
@@ -490,14 +526,24 @@ unsigned SIRegisterInfo::getNumVGPRsAllowed(unsigned WaveCount) const {
}
}
-unsigned SIRegisterInfo::getNumSGPRsAllowed(unsigned WaveCount) const {
- switch(WaveCount) {
- case 10: return 48;
- case 9: return 56;
- case 8: return 64;
- case 7: return 72;
- case 6: return 80;
- case 5: return 96;
- default: return 103;
+unsigned SIRegisterInfo::getNumSGPRsAllowed(AMDGPUSubtarget::Generation gen,
+ unsigned WaveCount) const {
+ if (gen >= AMDGPUSubtarget::VOLCANIC_ISLANDS) {
+ switch (WaveCount) {
+ case 10: return 80;
+ case 9: return 80;
+ case 8: return 96;
+ default: return 102;
+ }
+ } else {
+ switch(WaveCount) {
+ case 10: return 48;
+ case 9: return 56;
+ case 8: return 64;
+ case 7: return 72;
+ case 6: return 80;
+ case 5: return 96;
+ default: return 103;
+ }
}
}
diff --git a/contrib/llvm/lib/Target/R600/SIRegisterInfo.h b/contrib/llvm/lib/Target/R600/SIRegisterInfo.h
index d908ffd..1dfe530 100644
--- a/contrib/llvm/lib/Target/R600/SIRegisterInfo.h
+++ b/contrib/llvm/lib/Target/R600/SIRegisterInfo.h
@@ -17,6 +17,7 @@
#define LLVM_LIB_TARGET_R600_SIREGISTERINFO_H
#include "AMDGPURegisterInfo.h"
+#include "AMDGPUSubtarget.h"
#include "llvm/Support/Debug.h"
namespace llvm {
@@ -111,7 +112,8 @@ struct SIRegisterInfo : public AMDGPURegisterInfo {
/// \brief Give the maximum number of SGPRs that can be used by \p WaveCount
/// concurrent waves.
- unsigned getNumSGPRsAllowed(unsigned WaveCount) const;
+ unsigned getNumSGPRsAllowed(AMDGPUSubtarget::Generation gen,
+ unsigned WaveCount) const;
unsigned findUnusedRegister(const MachineRegisterInfo &MRI,
const TargetRegisterClass *RC) const;
diff --git a/contrib/llvm/lib/Target/R600/SIRegisterInfo.td b/contrib/llvm/lib/Target/R600/SIRegisterInfo.td
index 1a1efb0..c63f305 100644
--- a/contrib/llvm/lib/Target/R600/SIRegisterInfo.td
+++ b/contrib/llvm/lib/Target/R600/SIRegisterInfo.td
@@ -209,7 +209,9 @@ def VReg_256 : RegisterClass<"AMDGPU", [v32i8, v8i32, v8f32], 256, (add VGPR_256
def VReg_512 : RegisterClass<"AMDGPU", [v16i32, v16f32], 512, (add VGPR_512)>;
-def VReg_1 : RegisterClass<"AMDGPU", [i1], 32, (add VGPR_32)>;
+def VReg_1 : RegisterClass<"AMDGPU", [i1], 32, (add VGPR_32)> {
+ let Size = 32;
+}
class RegImmOperand <RegisterClass rc> : RegisterOperand<rc> {
let OperandNamespace = "AMDGPU";
diff --git a/contrib/llvm/lib/Target/R600/VIInstrFormats.td b/contrib/llvm/lib/Target/R600/VIInstrFormats.td
index 5285d18..c242235 100644
--- a/contrib/llvm/lib/Target/R600/VIInstrFormats.td
+++ b/contrib/llvm/lib/Target/R600/VIInstrFormats.td
@@ -136,6 +136,32 @@ class VOP3e_vi <bits<10> op> : Enc64 {
let Inst{63} = src2_modifiers{0};
}
+class VOP3be_vi <bits<10> op> : Enc64 {
+ bits<8> vdst;
+ bits<2> src0_modifiers;
+ bits<9> src0;
+ bits<2> src1_modifiers;
+ bits<9> src1;
+ bits<2> src2_modifiers;
+ bits<9> src2;
+ bits<7> sdst;
+ bits<2> omod;
+ bits<1> clamp;
+
+ let Inst{7-0} = vdst;
+ let Inst{14-8} = sdst;
+ let Inst{15} = clamp;
+ let Inst{25-16} = op;
+ let Inst{31-26} = 0x34; //encoding
+ let Inst{40-32} = src0;
+ let Inst{49-41} = src1;
+ let Inst{58-50} = src2;
+ let Inst{60-59} = omod;
+ let Inst{61} = src0_modifiers{0};
+ let Inst{62} = src1_modifiers{0};
+ let Inst{63} = src2_modifiers{0};
+}
+
class EXPe_vi : EXPe {
let Inst{31-26} = 0x31; //encoding
}
diff --git a/contrib/llvm/lib/Target/R600/VIInstructions.td b/contrib/llvm/lib/Target/R600/VIInstructions.td
index 24e66ce..4a6e933 100644
--- a/contrib/llvm/lib/Target/R600/VIInstructions.td
+++ b/contrib/llvm/lib/Target/R600/VIInstructions.td
@@ -9,18 +9,6 @@
// Instruction definitions for VI and newer.
//===----------------------------------------------------------------------===//
-let SubtargetPredicate = isVI in {
-
-defm BUFFER_LOAD_DWORD_VI : MUBUF_Load_Helper_vi <
- 0x14, "buffer_load_dword", VGPR_32, i32, global_load
->;
-
-defm BUFFER_LOAD_FORMAT_XYZW_VI : MUBUF_Load_Helper_vi <
- 0x03, "buffer_load_format_xyzw", VReg_128
->;
-
-} // End SubtargetPredicate = isVI
-
//===----------------------------------------------------------------------===//
// SMEM Patterns
@@ -28,37 +16,10 @@ defm BUFFER_LOAD_FORMAT_XYZW_VI : MUBUF_Load_Helper_vi <
let Predicates = [isVI] in {
-// 1. Offset as 8bit DWORD immediate
+// 1. Offset as 20bit DWORD immediate
def : Pat <
(SIload_constant v4i32:$sbase, IMM20bit:$offset),
(S_BUFFER_LOAD_DWORD_IMM $sbase, (as_i32imm $offset))
>;
-//===----------------------------------------------------------------------===//
-// MUBUF Patterns
-//===----------------------------------------------------------------------===//
-
-// Offset in an 32Bit VGPR
-def : Pat <
- (SIload_constant v4i32:$sbase, i32:$voff),
- (BUFFER_LOAD_DWORD_VI_OFFEN $sbase, $voff, 0, 0, 0, 0, 0)
->;
-
-// Offset in an 32Bit VGPR
-def : Pat <
- (SIload_constant v4i32:$sbase, i32:$voff),
- (BUFFER_LOAD_DWORD_VI_OFFEN $sbase, $voff, 0, 0, 0, 0, 0)
->;
-
-/* int_SI_vs_load_input */
-def : Pat<
- (SIload_input v4i32:$tlst, imm:$attr_offset, i32:$buf_idx_vgpr),
- (BUFFER_LOAD_FORMAT_XYZW_VI_IDXEN $tlst, $buf_idx_vgpr, imm:$attr_offset, 0, 0, 0, 0)
->;
-
-defm : MUBUF_Load_Dword <i32, BUFFER_LOAD_DWORD_VI_OFFSET,
- BUFFER_LOAD_DWORD_VI_OFFEN,
- BUFFER_LOAD_DWORD_VI_IDXEN,
- BUFFER_LOAD_DWORD_VI_BOTHEN>;
-
} // End Predicates = [isVI]
diff --git a/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp b/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp
index f2eb6a8..66f54e9 100644
--- a/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp
+++ b/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp
@@ -392,12 +392,25 @@ static bool usesTheStack(const MachineFunction &MF) {
return false;
}
-void X86FrameLowering::getStackProbeFunction(const X86Subtarget &STI,
- unsigned &CallOp,
- const char *&Symbol) {
- CallOp = STI.is64Bit() ? X86::W64ALLOCA : X86::CALLpcrel32;
+void X86FrameLowering::emitStackProbeCall(MachineFunction &MF,
+ MachineBasicBlock &MBB,
+ MachineBasicBlock::iterator MBBI,
+ DebugLoc DL) {
+ const TargetInstrInfo &TII = *MF.getSubtarget().getInstrInfo();
+ const X86Subtarget &STI = MF.getTarget().getSubtarget<X86Subtarget>();
+ bool Is64Bit = STI.is64Bit();
+ bool IsLargeCodeModel = MF.getTarget().getCodeModel() == CodeModel::Large;
+ const X86RegisterInfo *RegInfo =
+ static_cast<const X86RegisterInfo *>(MF.getSubtarget().getRegisterInfo());
+
+ unsigned CallOp;
+ if (Is64Bit)
+ CallOp = IsLargeCodeModel ? X86::CALL64r : X86::CALL64pcrel32;
+ else
+ CallOp = X86::CALLpcrel32;
- if (STI.is64Bit()) {
+ const char *Symbol;
+ if (Is64Bit) {
if (STI.isTargetCygMing()) {
Symbol = "___chkstk_ms";
} else {
@@ -407,6 +420,37 @@ void X86FrameLowering::getStackProbeFunction(const X86Subtarget &STI,
Symbol = "_alloca";
else
Symbol = "_chkstk";
+
+ MachineInstrBuilder CI;
+
+ // All current stack probes take AX and SP as input, clobber flags, and
+ // preserve all registers. x86_64 probes leave RSP unmodified.
+ if (Is64Bit && MF.getTarget().getCodeModel() == CodeModel::Large) {
+ // For the large code model, we have to call through a register. Use R11,
+ // as it is scratch in all supported calling conventions.
+ BuildMI(MBB, MBBI, DL, TII.get(X86::MOV64ri), X86::R11)
+ .addExternalSymbol(Symbol);
+ CI = BuildMI(MBB, MBBI, DL, TII.get(CallOp)).addReg(X86::R11);
+ } else {
+ CI = BuildMI(MBB, MBBI, DL, TII.get(CallOp)).addExternalSymbol(Symbol);
+ }
+
+ unsigned AX = Is64Bit ? X86::RAX : X86::EAX;
+ unsigned SP = Is64Bit ? X86::RSP : X86::ESP;
+ CI.addReg(AX, RegState::Implicit)
+ .addReg(SP, RegState::Implicit)
+ .addReg(AX, RegState::Define | RegState::Implicit)
+ .addReg(SP, RegState::Define | RegState::Implicit)
+ .addReg(X86::EFLAGS, RegState::Define | RegState::Implicit);
+
+ if (Is64Bit) {
+ // MSVC x64's __chkstk and cygwin/mingw's ___chkstk_ms do not adjust %rsp
+ // themselves. It also does not clobber %rax so we can reuse it when
+ // adjusting %rsp.
+ BuildMI(MBB, MBBI, DL, TII.get(X86::SUB64rr), X86::RSP)
+ .addReg(X86::RSP)
+ .addReg(X86::RAX);
+ }
}
/// emitPrologue - Push callee-saved registers onto the stack, which
@@ -739,11 +783,6 @@ void X86FrameLowering::emitPrologue(MachineFunction &MF) const {
// increments is necessary to ensure that the guard pages used by the OS
// virtual memory manager are allocated in correct sequence.
if (NumBytes >= StackProbeSize && UseStackProbe) {
- const char *StackProbeSymbol;
- unsigned CallOp;
-
- getStackProbeFunction(STI, CallOp, StackProbeSymbol);
-
// Check whether EAX is livein for this function.
bool isEAXAlive = isEAXLiveIn(MF);
@@ -772,22 +811,17 @@ void X86FrameLowering::emitPrologue(MachineFunction &MF) const {
.setMIFlag(MachineInstr::FrameSetup);
}
- BuildMI(MBB, MBBI, DL,
- TII.get(CallOp))
- .addExternalSymbol(StackProbeSymbol)
- .addReg(StackPtr, RegState::Define | RegState::Implicit)
- .addReg(X86::EFLAGS, RegState::Define | RegState::Implicit)
- .setMIFlag(MachineInstr::FrameSetup);
+ // Save a pointer to the MI where we set AX.
+ MachineBasicBlock::iterator SetRAX = MBBI;
+ --SetRAX;
+
+ // Call __chkstk, __chkstk_ms, or __alloca.
+ emitStackProbeCall(MF, MBB, MBBI, DL);
+
+ // Apply the frame setup flag to all inserted instrs.
+ for (; SetRAX != MBBI; ++SetRAX)
+ SetRAX->setFlag(MachineInstr::FrameSetup);
- if (Is64Bit) {
- // MSVC x64's __chkstk and cygwin/mingw's ___chkstk_ms do not adjust %rsp
- // themself. It also does not clobber %rax so we can reuse it when
- // adjusting %rsp.
- BuildMI(MBB, MBBI, DL, TII.get(X86::SUB64rr), StackPtr)
- .addReg(StackPtr)
- .addReg(X86::RAX)
- .setMIFlag(MachineInstr::FrameSetup);
- }
if (isEAXAlive) {
// Restore EAX
MachineInstr *MI = addRegOffset(BuildMI(MF, DL, TII.get(X86::MOV32rm),
diff --git a/contrib/llvm/lib/Target/X86/X86FrameLowering.h b/contrib/llvm/lib/Target/X86/X86FrameLowering.h
index 9cb887a..448a365 100644
--- a/contrib/llvm/lib/Target/X86/X86FrameLowering.h
+++ b/contrib/llvm/lib/Target/X86/X86FrameLowering.h
@@ -27,9 +27,11 @@ public:
explicit X86FrameLowering(StackDirection D, unsigned StackAl, int LAO)
: TargetFrameLowering(StackGrowsDown, StackAl, LAO) {}
- static void getStackProbeFunction(const X86Subtarget &STI,
- unsigned &CallOp,
- const char *&Symbol);
+ /// Emit a call to the target's stack probe function. This is required for all
+ /// large stack allocations on Windows. The caller is required to materialize
+ /// the number of bytes to probe in RAX/EAX.
+ static void emitStackProbeCall(MachineFunction &MF, MachineBasicBlock &MBB,
+ MachineBasicBlock::iterator MBBI, DebugLoc DL);
void emitCalleeSavedFrameMoves(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MBBI,
diff --git a/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp b/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp
index 177299b..85978d8 100644
--- a/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -15,6 +15,7 @@
#include "X86ISelLowering.h"
#include "Utils/X86ShuffleDecode.h"
#include "X86CallingConv.h"
+#include "X86FrameLowering.h"
#include "X86InstrBuilder.h"
#include "X86MachineFunctionInfo.h"
#include "X86TargetMachine.h"
@@ -10094,12 +10095,12 @@ static SDValue lowerV2X128VectorShuffle(SDLoc DL, MVT VT, SDValue V1,
VT.getVectorNumElements() / 2);
// Check for patterns which can be matched with a single insert of a 128-bit
// subvector.
- if (isShuffleEquivalent(Mask, 0, 1, 0, 1) ||
- isShuffleEquivalent(Mask, 0, 1, 4, 5)) {
+ bool OnlyUsesV1 = isShuffleEquivalent(Mask, 0, 1, 0, 1);
+ if (OnlyUsesV1 || isShuffleEquivalent(Mask, 0, 1, 4, 5)) {
SDValue LoV = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, SubVT, V1,
DAG.getIntPtrConstant(0));
SDValue HiV = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, SubVT,
- Mask[2] < 4 ? V1 : V2, DAG.getIntPtrConstant(0));
+ OnlyUsesV1 ? V1 : V2, DAG.getIntPtrConstant(0));
return DAG.getNode(ISD::CONCAT_VECTORS, DL, VT, LoV, HiV);
}
if (isShuffleEquivalent(Mask, 0, 1, 6, 7)) {
@@ -10112,7 +10113,15 @@ static SDValue lowerV2X128VectorShuffle(SDLoc DL, MVT VT, SDValue V1,
// Otherwise form a 128-bit permutation.
// FIXME: Detect zero-vector inputs and use the VPERM2X128 to zero that half.
- unsigned PermMask = Mask[0] / 2 | (Mask[2] / 2) << 4;
+ int MaskLO = Mask[0];
+ if (MaskLO == SM_SentinelUndef)
+ MaskLO = Mask[1] == SM_SentinelUndef ? 0 : Mask[1];
+
+ int MaskHI = Mask[2];
+ if (MaskHI == SM_SentinelUndef)
+ MaskHI = Mask[3] == SM_SentinelUndef ? 0 : Mask[3];
+
+ unsigned PermMask = MaskLO / 2 | (MaskHI / 2) << 4;
return DAG.getNode(X86ISD::VPERM2X128, DL, VT, V1, V2,
DAG.getConstant(PermMask, MVT::i8));
}
@@ -17172,6 +17181,13 @@ static SDValue LowerINTRINSIC_WO_CHAIN(SDValue Op, const X86Subtarget *Subtarget
switch (IntNo) {
default: return SDValue(); // Don't custom lower most intrinsics.
+ case Intrinsic::x86_avx2_permd:
+ case Intrinsic::x86_avx2_permps:
+ // Operands intentionally swapped. Mask is last operand to intrinsic,
+ // but second operand for node/instruction.
+ return DAG.getNode(X86ISD::VPERMV, dl, Op.getValueType(),
+ Op.getOperand(2), Op.getOperand(1));
+
case Intrinsic::x86_avx512_mask_valign_q_512:
case Intrinsic::x86_avx512_mask_valign_d_512:
// Vector source operands are swapped.
@@ -21076,47 +21092,7 @@ X86TargetLowering::EmitLoweredWinAlloca(MachineInstr *MI,
assert(!Subtarget->isTargetMachO());
- // The lowering is pretty easy: we're just emitting the call to _alloca. The
- // non-trivial part is impdef of ESP.
-
- if (Subtarget->isTargetWin64()) {
- if (Subtarget->isTargetCygMing()) {
- // ___chkstk(Mingw64):
- // Clobbers R10, R11, RAX and EFLAGS.
- // Updates RSP.
- BuildMI(*BB, MI, DL, TII->get(X86::W64ALLOCA))
- .addExternalSymbol("___chkstk")
- .addReg(X86::RAX, RegState::Implicit)
- .addReg(X86::RSP, RegState::Implicit)
- .addReg(X86::RAX, RegState::Define | RegState::Implicit)
- .addReg(X86::RSP, RegState::Define | RegState::Implicit)
- .addReg(X86::EFLAGS, RegState::Define | RegState::Implicit);
- } else {
- // __chkstk(MSVCRT): does not update stack pointer.
- // Clobbers R10, R11 and EFLAGS.
- BuildMI(*BB, MI, DL, TII->get(X86::W64ALLOCA))
- .addExternalSymbol("__chkstk")
- .addReg(X86::RAX, RegState::Implicit)
- .addReg(X86::EFLAGS, RegState::Define | RegState::Implicit);
- // RAX has the offset to be subtracted from RSP.
- BuildMI(*BB, MI, DL, TII->get(X86::SUB64rr), X86::RSP)
- .addReg(X86::RSP)
- .addReg(X86::RAX);
- }
- } else {
- const char *StackProbeSymbol = (Subtarget->isTargetKnownWindowsMSVC() ||
- Subtarget->isTargetWindowsItanium())
- ? "_chkstk"
- : "_alloca";
-
- BuildMI(*BB, MI, DL, TII->get(X86::CALLpcrel32))
- .addExternalSymbol(StackProbeSymbol)
- .addReg(X86::EAX, RegState::Implicit)
- .addReg(X86::ESP, RegState::Implicit)
- .addReg(X86::EAX, RegState::Define | RegState::Implicit)
- .addReg(X86::ESP, RegState::Define | RegState::Implicit)
- .addReg(X86::EFLAGS, RegState::Define | RegState::Implicit);
- }
+ X86FrameLowering::emitStackProbeCall(*BB->getParent(), *BB, MI, DL);
MI->eraseFromParent(); // The pseudo instruction is gone now.
return BB;
@@ -25558,45 +25534,51 @@ static SDValue PerformISDSETCCCombine(SDNode *N, SelectionDAG &DAG,
if ((CC == ISD::SETNE || CC == ISD::SETEQ) && LHS.getOpcode() == ISD::SUB)
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(LHS.getOperand(0)))
if (C->getAPIntValue() == 0 && LHS.hasOneUse()) {
- SDValue addV = DAG.getNode(ISD::ADD, SDLoc(N),
- LHS.getValueType(), RHS, LHS.getOperand(1));
- return DAG.getSetCC(SDLoc(N), N->getValueType(0),
- addV, DAG.getConstant(0, addV.getValueType()), CC);
+ SDValue addV = DAG.getNode(ISD::ADD, SDLoc(N), LHS.getValueType(), RHS,
+ LHS.getOperand(1));
+ return DAG.getSetCC(SDLoc(N), N->getValueType(0), addV,
+ DAG.getConstant(0, addV.getValueType()), CC);
}
if ((CC == ISD::SETNE || CC == ISD::SETEQ) && RHS.getOpcode() == ISD::SUB)
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(RHS.getOperand(0)))
if (C->getAPIntValue() == 0 && RHS.hasOneUse()) {
- SDValue addV = DAG.getNode(ISD::ADD, SDLoc(N),
- RHS.getValueType(), LHS, RHS.getOperand(1));
- return DAG.getSetCC(SDLoc(N), N->getValueType(0),
- addV, DAG.getConstant(0, addV.getValueType()), CC);
+ SDValue addV = DAG.getNode(ISD::ADD, SDLoc(N), RHS.getValueType(), LHS,
+ RHS.getOperand(1));
+ return DAG.getSetCC(SDLoc(N), N->getValueType(0), addV,
+ DAG.getConstant(0, addV.getValueType()), CC);
}
- if (VT.getScalarType() == MVT::i1) {
- bool IsSEXT0 = (LHS.getOpcode() == ISD::SIGN_EXTEND) &&
- (LHS.getOperand(0).getValueType().getScalarType() == MVT::i1);
- bool IsVZero0 = ISD::isBuildVectorAllZeros(LHS.getNode());
- if (!IsSEXT0 && !IsVZero0)
- return SDValue();
- bool IsSEXT1 = (RHS.getOpcode() == ISD::SIGN_EXTEND) &&
- (RHS.getOperand(0).getValueType().getScalarType() == MVT::i1);
+ if (VT.getScalarType() == MVT::i1 &&
+ (CC == ISD::SETNE || CC == ISD::SETEQ || ISD::isSignedIntSetCC(CC))) {
+ bool IsSEXT0 =
+ (LHS.getOpcode() == ISD::SIGN_EXTEND) &&
+ (LHS.getOperand(0).getValueType().getScalarType() == MVT::i1);
bool IsVZero1 = ISD::isBuildVectorAllZeros(RHS.getNode());
- if (!IsSEXT1 && !IsVZero1)
- return SDValue();
+ if (!IsSEXT0 || !IsVZero1) {
+ // Swap the operands and update the condition code.
+ std::swap(LHS, RHS);
+ CC = ISD::getSetCCSwappedOperands(CC);
+
+ IsSEXT0 = (LHS.getOpcode() == ISD::SIGN_EXTEND) &&
+ (LHS.getOperand(0).getValueType().getScalarType() == MVT::i1);
+ IsVZero1 = ISD::isBuildVectorAllZeros(RHS.getNode());
+ }
if (IsSEXT0 && IsVZero1) {
- assert(VT == LHS.getOperand(0).getValueType() && "Uexpected operand type");
- if (CC == ISD::SETEQ)
+ assert(VT == LHS.getOperand(0).getValueType() &&
+ "Uexpected operand type");
+ if (CC == ISD::SETGT)
+ return DAG.getConstant(0, VT);
+ if (CC == ISD::SETLE)
+ return DAG.getConstant(1, VT);
+ if (CC == ISD::SETEQ || CC == ISD::SETGE)
return DAG.getNOT(DL, LHS.getOperand(0), VT);
+
+ assert((CC == ISD::SETNE || CC == ISD::SETLT) &&
+ "Unexpected condition code!");
return LHS.getOperand(0);
}
- if (IsSEXT1 && IsVZero0) {
- assert(VT == RHS.getOperand(0).getValueType() && "Uexpected operand type");
- if (CC == ISD::SETEQ)
- return DAG.getNOT(DL, RHS.getOperand(0), VT);
- return RHS.getOperand(0);
- }
}
return SDValue();
diff --git a/contrib/llvm/lib/Target/X86/X86InstrControl.td b/contrib/llvm/lib/Target/X86/X86InstrControl.td
index 71415c6..7baff19 100644
--- a/contrib/llvm/lib/Target/X86/X86InstrControl.td
+++ b/contrib/llvm/lib/Target/X86/X86InstrControl.td
@@ -279,7 +279,8 @@ let isCall = 1, Uses = [RSP], SchedRW = [WriteJump] in {
}
let isCall = 1, isCodeGenOnly = 1 in
- // __chkstk(MSVC): clobber R10, R11 and EFLAGS.
+ // __chkstk(MSVC): clobber R10, R11 and EFLAGS
+ // ___chkstk_ms(Mingw64): clobber R10, R11 and EFLAGS
// ___chkstk(Mingw64): clobber R10, R11, RAX and EFLAGS, and update RSP.
let Defs = [RAX, R10, R11, RSP, EFLAGS],
Uses = [RSP] in {
diff --git a/contrib/llvm/lib/Target/X86/X86IntrinsicsInfo.h b/contrib/llvm/lib/Target/X86/X86IntrinsicsInfo.h
index 7130ae2..b411d07 100644
--- a/contrib/llvm/lib/Target/X86/X86IntrinsicsInfo.h
+++ b/contrib/llvm/lib/Target/X86/X86IntrinsicsInfo.h
@@ -175,8 +175,6 @@ static const IntrinsicData IntrinsicsWithoutChain[] = {
X86_INTRINSIC_DATA(avx2_packsswb, INTR_TYPE_2OP, X86ISD::PACKSS, 0),
X86_INTRINSIC_DATA(avx2_packusdw, INTR_TYPE_2OP, X86ISD::PACKUS, 0),
X86_INTRINSIC_DATA(avx2_packuswb, INTR_TYPE_2OP, X86ISD::PACKUS, 0),
- X86_INTRINSIC_DATA(avx2_permd, INTR_TYPE_2OP, X86ISD::VPERMV, 0),
- X86_INTRINSIC_DATA(avx2_permps, INTR_TYPE_2OP, X86ISD::VPERMV, 0),
X86_INTRINSIC_DATA(avx2_phadd_d, INTR_TYPE_2OP, X86ISD::HADD, 0),
X86_INTRINSIC_DATA(avx2_phadd_w, INTR_TYPE_2OP, X86ISD::HADD, 0),
X86_INTRINSIC_DATA(avx2_phsub_d, INTR_TYPE_2OP, X86ISD::HSUB, 0),
diff --git a/contrib/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/contrib/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
index cb965fb..60b541f 100644
--- a/contrib/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
+++ b/contrib/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
@@ -47,6 +47,8 @@ using namespace llvm;
static cl::opt<std::string>
DefaultGCOVVersion("default-gcov-version", cl::init("402*"), cl::Hidden,
cl::ValueRequired);
+static cl::opt<bool> DefaultExitBlockBeforeBody("gcov-exit-block-before-body",
+ cl::init(false), cl::Hidden);
GCOVOptions GCOVOptions::getDefault() {
GCOVOptions Options;
@@ -312,7 +314,7 @@ namespace {
class GCOVFunction : public GCOVRecord {
public:
GCOVFunction(DISubprogram SP, raw_ostream *os, uint32_t Ident,
- bool UseCfgChecksum)
+ bool UseCfgChecksum, bool ExitBlockBeforeBody)
: SP(SP), Ident(Ident), UseCfgChecksum(UseCfgChecksum), CfgChecksum(0),
ReturnBlock(1, os) {
this->os = os;
@@ -322,11 +324,13 @@ namespace {
uint32_t i = 0;
for (auto &BB : *F) {
- // Skip index 1 (0, 2, 3, 4, ...) because that's assigned to the
- // ReturnBlock.
- bool first = i == 0;
- Blocks.insert(std::make_pair(&BB, GCOVBlock(i++ + !first, os)));
+ // Skip index 1 if it's assigned to the ReturnBlock.
+ if (i == 1 && ExitBlockBeforeBody)
+ ++i;
+ Blocks.insert(std::make_pair(&BB, GCOVBlock(i++, os)));
}
+ if (!ExitBlockBeforeBody)
+ ReturnBlock.Number = i;
std::string FunctionNameAndLine;
raw_string_ostream FNLOS(FunctionNameAndLine);
@@ -469,7 +473,7 @@ static bool functionHasLines(Function *F) {
if (Loc.isUnknown()) continue;
// Artificial lines such as calls to the global constructors.
- if (Loc.getLine() == 0) continue;
+ if (Loc.getLine() == 0) continue;
return true;
}
@@ -513,7 +517,8 @@ void GCOVProfiler::emitProfileNotes() {
EntryBlock.splitBasicBlock(It);
Funcs.push_back(make_unique<GCOVFunction>(SP, &out, FunctionIdent++,
- Options.UseCfgChecksum));
+ Options.UseCfgChecksum,
+ DefaultExitBlockBeforeBody));
GCOVFunction &Func = *Funcs.back();
for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) {
diff --git a/contrib/llvm/lib/Transforms/Scalar/GVN.cpp b/contrib/llvm/lib/Transforms/Scalar/GVN.cpp
index ac13eeb..1ed14d0 100644
--- a/contrib/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/contrib/llvm/lib/Transforms/Scalar/GVN.cpp
@@ -2183,12 +2183,16 @@ bool GVN::propagateEquality(Value *LHS, Value *RHS,
// Handle the floating point versions of equality comparisons too.
if ((isKnownTrue && Cmp->getPredicate() == CmpInst::FCMP_OEQ) ||
(isKnownFalse && Cmp->getPredicate() == CmpInst::FCMP_UNE)) {
- // Floating point -0.0 and 0.0 compare equal, so we can't
- // propagate a constant based on that comparison.
+
+ // Floating point -0.0 and 0.0 compare equal, so we can only
+ // propagate values if we know that we have a constant and that
+ // its value is non-zero.
+
// FIXME: We should do this optimization if 'no signed zeros' is
// applicable via an instruction-level fast-math-flag or some other
// indicator that relaxed FP semantics are being used.
- if (!isa<ConstantFP>(Op1) || !cast<ConstantFP>(Op1)->isZero())
+
+ if (isa<ConstantFP>(Op1) && !cast<ConstantFP>(Op1)->isZero())
Worklist.push_back(std::make_pair(Op0, Op1));
}
diff --git a/contrib/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp b/contrib/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
index 6cb91a1..d54c09a 100644
--- a/contrib/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
+++ b/contrib/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
@@ -288,14 +288,11 @@ bool SimplifyIndvar::strengthenOverflowingOperation(BinaryOperator *BO,
IntegerType *IT = cast<IntegerType>(IVOperand->getType());
Value *OtherOperand = nullptr;
- int OtherOperandIdx = -1;
if (BO->getOperand(0) == IVOperand) {
OtherOperand = BO->getOperand(1);
- OtherOperandIdx = 1;
} else {
assert(BO->getOperand(1) == IVOperand && "only other use!");
OtherOperand = BO->getOperand(0);
- OtherOperandIdx = 0;
}
bool Changed = false;
diff --git a/contrib/llvm/patches/README.TXT b/contrib/llvm/patches/README.TXT
index f3fc208..7bc26d2 100644
--- a/contrib/llvm/patches/README.TXT
+++ b/contrib/llvm/patches/README.TXT
@@ -1,11 +1,11 @@
This is a set of individual patches, which contain all the customizations to
llvm/clang currently in the FreeBSD base system. These can be applied in
-alphabetical order to a pristine llvm/clang 3.6.0 source tree, for example by
+alphabetical order to a pristine llvm/clang 3.6.1 source tree, for example by
doing:
-svn co https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_360/final llvm-3.6.0
-svn co https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_360/final llvm-3.6.0/tools/clang
-cd llvm-3.6.0
+svn co https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_361/final llvm-3.6.1
+svn co https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_361/final llvm-3.6.1/tools/clang
+cd llvm-3.6.1
for p in /usr/src/contrib/llvm/patches/patch-*.diff; do
patch -p0 -f -F0 -E -i $p -s || break
done
diff --git a/contrib/llvm/patches/patch-01-freebsd-kprintf.diff b/contrib/llvm/patches/patch-01-freebsd-kprintf.diff
index cccfedf..252b4cd 100644
--- a/contrib/llvm/patches/patch-01-freebsd-kprintf.diff
+++ b/contrib/llvm/patches/patch-01-freebsd-kprintf.diff
@@ -44,7 +44,7 @@ Index: tools/clang/include/clang/Sema/Sema.h
===================================================================
--- tools/clang/include/clang/Sema/Sema.h
+++ tools/clang/include/clang/Sema/Sema.h
-@@ -8566,6 +8566,7 @@ class Sema {
+@@ -8567,6 +8567,7 @@ class Sema {
FST_Strftime,
FST_Strfmon,
FST_Kprintf,
@@ -230,7 +230,7 @@ Index: tools/clang/lib/Sema/SemaChecking.cpp
===================================================================
--- tools/clang/lib/Sema/SemaChecking.cpp
+++ tools/clang/lib/Sema/SemaChecking.cpp
-@@ -2584,6 +2584,7 @@ Sema::FormatStringType Sema::GetFormatStringType(c
+@@ -2603,6 +2603,7 @@ Sema::FormatStringType Sema::GetFormatStringType(c
.Case("strftime", FST_Strftime)
.Case("strfmon", FST_Strfmon)
.Cases("kprintf", "cmn_err", "vcmn_err", "zcmn_err", FST_Kprintf)
@@ -238,7 +238,7 @@ Index: tools/clang/lib/Sema/SemaChecking.cpp
.Default(FST_Unknown);
}
-@@ -3365,6 +3366,43 @@ CheckPrintfHandler::HandlePrintfSpecifier(const an
+@@ -3384,6 +3385,43 @@ CheckPrintfHandler::HandlePrintfSpecifier(const an
CoveredArgs.set(argIndex);
}
@@ -282,7 +282,7 @@ Index: tools/clang/lib/Sema/SemaChecking.cpp
// Check for using an Objective-C specific conversion specifier
// in a non-ObjC literal.
if (!ObjCContext && CS.isObjCArg()) {
-@@ -3988,7 +4026,8 @@ void Sema::CheckFormatString(const StringLiteral *
+@@ -4007,7 +4045,8 @@ void Sema::CheckFormatString(const StringLiteral *
return;
}
@@ -292,7 +292,7 @@ Index: tools/clang/lib/Sema/SemaChecking.cpp
CheckPrintfHandler H(*this, FExpr, OrigFormatExpr, firstDataArg,
numDataArgs, (Type == FST_NSString),
Str, HasVAListArg, Args, format_idx,
-@@ -3996,7 +4035,8 @@ void Sema::CheckFormatString(const StringLiteral *
+@@ -4015,7 +4054,8 @@ void Sema::CheckFormatString(const StringLiteral *
if (!analyze_format_string::ParsePrintfString(H, Str, Str + StrLen,
getLangOpts(),
diff --git a/contrib/llvm/patches/patch-07-llvm-r227752-boot2-shrink.diff b/contrib/llvm/patches/patch-07-llvm-r227752-boot2-shrink.diff
index d5650f7..57e16d7 100644
--- a/contrib/llvm/patches/patch-07-llvm-r227752-boot2-shrink.diff
+++ b/contrib/llvm/patches/patch-07-llvm-r227752-boot2-shrink.diff
@@ -596,7 +596,7 @@ Index: lib/Target/X86/X86FrameLowering.cpp
static unsigned getLEArOpcode(unsigned IsLP64) {
return IsLP64 ? X86::LEA64r : X86::LEA32r;
}
-@@ -1848,100 +1865,6 @@ void X86FrameLowering::adjustForHiPEPrologue(Machi
+@@ -1882,100 +1899,6 @@ void X86FrameLowering::adjustForHiPEPrologue(Machi
#endif
}
@@ -697,7 +697,7 @@ Index: lib/Target/X86/X86FrameLowering.cpp
void X86FrameLowering::
eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
MachineBasicBlock::iterator I) const {
-@@ -1956,7 +1879,7 @@ eliminateCallFramePseudoInstr(MachineFunction &MF,
+@@ -1990,7 +1913,7 @@ eliminateCallFramePseudoInstr(MachineFunction &MF,
bool IsLP64 = STI.isTarget64BitLP64();
DebugLoc DL = I->getDebugLoc();
uint64_t Amount = !reserveCallFrame ? I->getOperand(0).getImm() : 0;
@@ -706,7 +706,7 @@ Index: lib/Target/X86/X86FrameLowering.cpp
I = MBB.erase(I);
if (!reserveCallFrame) {
-@@ -1976,24 +1899,18 @@ eliminateCallFramePseudoInstr(MachineFunction &MF,
+@@ -2010,24 +1933,18 @@ eliminateCallFramePseudoInstr(MachineFunction &MF,
Amount = (Amount + StackAlign - 1) / StackAlign * StackAlign;
MachineInstr *New = nullptr;
@@ -740,7 +740,7 @@ Index: lib/Target/X86/X86FrameLowering.cpp
unsigned Opc = getADDriOpcode(IsLP64, Amount);
New = BuildMI(MF, DL, TII.get(Opc), StackPtr)
.addReg(StackPtr).addImm(Amount);
-@@ -2011,13 +1928,13 @@ eliminateCallFramePseudoInstr(MachineFunction &MF,
+@@ -2045,13 +1962,13 @@ eliminateCallFramePseudoInstr(MachineFunction &MF,
return;
}
@@ -761,7 +761,7 @@ Index: lib/Target/X86/X86FrameLowering.h
===================================================================
--- lib/Target/X86/X86FrameLowering.h
+++ lib/Target/X86/X86FrameLowering.h
-@@ -64,6 +64,8 @@ class X86FrameLowering : public TargetFrameLowerin
+@@ -66,6 +66,8 @@ class X86FrameLowering : public TargetFrameLowerin
bool hasFP(const MachineFunction &MF) const override;
bool hasReservedCallFrame(const MachineFunction &MF) const override;
diff --git a/contrib/llvm/patches/patch-08-llvm-r227089-fix-mips-i128.diff b/contrib/llvm/patches/patch-08-llvm-r227089-fix-mips-i128.diff
deleted file mode 100644
index 00a44f5..0000000
--- a/contrib/llvm/patches/patch-08-llvm-r227089-fix-mips-i128.diff
+++ /dev/null
@@ -1,1950 +0,0 @@
-Pull in r227087 from upstream llvm trunk (by Vasileios Kalintiris):
-
- [mips] Add tests for bitwise binary and integer arithmetic operators.
-
- Reviewers: dsanders
-
- Subscribers: llvm-commits
-
- Differential Revision: http://reviews.llvm.org/D7125
-
-Pull in r227089 from upstream llvm trunk (by Vasileios Kalintiris):
-
- [mips] Enable arithmetic and binary operations for the i128 data type.
-
- Summary:
- This patch adds support for some operations that were missing from
- 128-bit integer types (add/sub/mul/sdiv/udiv... etc.). With these
- changes we can support the __int128_t and __uint128_t data types
- from C/C++.
-
- Depends on D7125
-
- Reviewers: dsanders
-
- Subscribers: llvm-commits
-
- Differential Revision: http://reviews.llvm.org/D7143
-
-This fixes "error in backend" messages, when compiling parts of
-compiler-rt using 128-bit integer types for mips64.
-
-Reported by: sbruno
-PR: 197259
-
-Introduced here: http://svnweb.freebsd.org/changeset/base/278367
-
-Index: lib/Target/Mips/Mips64InstrInfo.td
-===================================================================
---- lib/Target/Mips/Mips64InstrInfo.td
-+++ lib/Target/Mips/Mips64InstrInfo.td
-@@ -440,6 +440,16 @@ def : MipsPat<(i64 (sext_inreg GPR64:$src, i32)),
- // bswap MipsPattern
- def : MipsPat<(bswap GPR64:$rt), (DSHD (DSBH GPR64:$rt))>;
-
-+// Carry pattern
-+def : MipsPat<(subc GPR64:$lhs, GPR64:$rhs),
-+ (DSUBu GPR64:$lhs, GPR64:$rhs)>;
-+let AdditionalPredicates = [NotDSP] in {
-+ def : MipsPat<(addc GPR64:$lhs, GPR64:$rhs),
-+ (DADDu GPR64:$lhs, GPR64:$rhs)>;
-+ def : MipsPat<(addc GPR64:$lhs, immSExt16:$imm),
-+ (DADDiu GPR64:$lhs, imm:$imm)>;
-+}
-+
- //===----------------------------------------------------------------------===//
- // Instruction aliases
- //===----------------------------------------------------------------------===//
-Index: lib/Target/Mips/MipsISelLowering.cpp
-===================================================================
---- lib/Target/Mips/MipsISelLowering.cpp
-+++ lib/Target/Mips/MipsISelLowering.cpp
-@@ -261,6 +261,9 @@ MipsTargetLowering::MipsTargetLowering(const MipsT
- setOperationAction(ISD::LOAD, MVT::i64, Custom);
- setOperationAction(ISD::STORE, MVT::i64, Custom);
- setOperationAction(ISD::FP_TO_SINT, MVT::i64, Custom);
-+ setOperationAction(ISD::SHL_PARTS, MVT::i64, Custom);
-+ setOperationAction(ISD::SRA_PARTS, MVT::i64, Custom);
-+ setOperationAction(ISD::SRL_PARTS, MVT::i64, Custom);
- }
-
- if (!Subtarget.isGP64bit()) {
-@@ -2017,10 +2020,11 @@ SDValue MipsTargetLowering::lowerATOMIC_FENCE(SDVa
- SDValue MipsTargetLowering::lowerShiftLeftParts(SDValue Op,
- SelectionDAG &DAG) const {
- SDLoc DL(Op);
-+ MVT VT = Subtarget.isGP64bit() ? MVT::i64 : MVT::i32;
-+
- SDValue Lo = Op.getOperand(0), Hi = Op.getOperand(1);
- SDValue Shamt = Op.getOperand(2);
--
-- // if shamt < 32:
-+ // if shamt < (VT.bits):
- // lo = (shl lo, shamt)
- // hi = (or (shl hi, shamt) (srl (srl lo, 1), ~shamt))
- // else:
-@@ -2028,18 +2032,17 @@ SDValue MipsTargetLowering::lowerShiftLeftParts(SD
- // hi = (shl lo, shamt[4:0])
- SDValue Not = DAG.getNode(ISD::XOR, DL, MVT::i32, Shamt,
- DAG.getConstant(-1, MVT::i32));
-- SDValue ShiftRight1Lo = DAG.getNode(ISD::SRL, DL, MVT::i32, Lo,
-- DAG.getConstant(1, MVT::i32));
-- SDValue ShiftRightLo = DAG.getNode(ISD::SRL, DL, MVT::i32, ShiftRight1Lo,
-- Not);
-- SDValue ShiftLeftHi = DAG.getNode(ISD::SHL, DL, MVT::i32, Hi, Shamt);
-- SDValue Or = DAG.getNode(ISD::OR, DL, MVT::i32, ShiftLeftHi, ShiftRightLo);
-- SDValue ShiftLeftLo = DAG.getNode(ISD::SHL, DL, MVT::i32, Lo, Shamt);
-+ SDValue ShiftRight1Lo = DAG.getNode(ISD::SRL, DL, VT, Lo,
-+ DAG.getConstant(1, VT));
-+ SDValue ShiftRightLo = DAG.getNode(ISD::SRL, DL, VT, ShiftRight1Lo, Not);
-+ SDValue ShiftLeftHi = DAG.getNode(ISD::SHL, DL, VT, Hi, Shamt);
-+ SDValue Or = DAG.getNode(ISD::OR, DL, VT, ShiftLeftHi, ShiftRightLo);
-+ SDValue ShiftLeftLo = DAG.getNode(ISD::SHL, DL, VT, Lo, Shamt);
- SDValue Cond = DAG.getNode(ISD::AND, DL, MVT::i32, Shamt,
- DAG.getConstant(0x20, MVT::i32));
-- Lo = DAG.getNode(ISD::SELECT, DL, MVT::i32, Cond,
-- DAG.getConstant(0, MVT::i32), ShiftLeftLo);
-- Hi = DAG.getNode(ISD::SELECT, DL, MVT::i32, Cond, ShiftLeftLo, Or);
-+ Lo = DAG.getNode(ISD::SELECT, DL, VT, Cond,
-+ DAG.getConstant(0, VT), ShiftLeftLo);
-+ Hi = DAG.getNode(ISD::SELECT, DL, VT, Cond, ShiftLeftLo, Or);
-
- SDValue Ops[2] = {Lo, Hi};
- return DAG.getMergeValues(Ops, DL);
-@@ -2050,8 +2053,9 @@ SDValue MipsTargetLowering::lowerShiftRightParts(S
- SDLoc DL(Op);
- SDValue Lo = Op.getOperand(0), Hi = Op.getOperand(1);
- SDValue Shamt = Op.getOperand(2);
-+ MVT VT = Subtarget.isGP64bit() ? MVT::i64 : MVT::i32;
-
-- // if shamt < 32:
-+ // if shamt < (VT.bits):
- // lo = (or (shl (shl hi, 1), ~shamt) (srl lo, shamt))
- // if isSRA:
- // hi = (sra hi, shamt)
-@@ -2066,21 +2070,19 @@ SDValue MipsTargetLowering::lowerShiftRightParts(S
- // hi = 0
- SDValue Not = DAG.getNode(ISD::XOR, DL, MVT::i32, Shamt,
- DAG.getConstant(-1, MVT::i32));
-- SDValue ShiftLeft1Hi = DAG.getNode(ISD::SHL, DL, MVT::i32, Hi,
-- DAG.getConstant(1, MVT::i32));
-- SDValue ShiftLeftHi = DAG.getNode(ISD::SHL, DL, MVT::i32, ShiftLeft1Hi, Not);
-- SDValue ShiftRightLo = DAG.getNode(ISD::SRL, DL, MVT::i32, Lo, Shamt);
-- SDValue Or = DAG.getNode(ISD::OR, DL, MVT::i32, ShiftLeftHi, ShiftRightLo);
-- SDValue ShiftRightHi = DAG.getNode(IsSRA ? ISD::SRA : ISD::SRL, DL, MVT::i32,
-- Hi, Shamt);
-+ SDValue ShiftLeft1Hi = DAG.getNode(ISD::SHL, DL, VT, Hi,
-+ DAG.getConstant(1, VT));
-+ SDValue ShiftLeftHi = DAG.getNode(ISD::SHL, DL, VT, ShiftLeft1Hi, Not);
-+ SDValue ShiftRightLo = DAG.getNode(ISD::SRL, DL, VT, Lo, Shamt);
-+ SDValue Or = DAG.getNode(ISD::OR, DL, VT, ShiftLeftHi, ShiftRightLo);
-+ SDValue ShiftRightHi = DAG.getNode(IsSRA ? ISD::SRA : ISD::SRL,
-+ DL, VT, Hi, Shamt);
- SDValue Cond = DAG.getNode(ISD::AND, DL, MVT::i32, Shamt,
- DAG.getConstant(0x20, MVT::i32));
-- SDValue Shift31 = DAG.getNode(ISD::SRA, DL, MVT::i32, Hi,
-- DAG.getConstant(31, MVT::i32));
-- Lo = DAG.getNode(ISD::SELECT, DL, MVT::i32, Cond, ShiftRightHi, Or);
-- Hi = DAG.getNode(ISD::SELECT, DL, MVT::i32, Cond,
-- IsSRA ? Shift31 : DAG.getConstant(0, MVT::i32),
-- ShiftRightHi);
-+ SDValue Shift31 = DAG.getNode(ISD::SRA, DL, VT, Hi, DAG.getConstant(31, VT));
-+ Lo = DAG.getNode(ISD::SELECT, DL, VT, Cond, ShiftRightHi, Or);
-+ Hi = DAG.getNode(ISD::SELECT, DL, VT, Cond,
-+ IsSRA ? Shift31 : DAG.getConstant(0, VT), ShiftRightHi);
-
- SDValue Ops[2] = {Lo, Hi};
- return DAG.getMergeValues(Ops, DL);
-Index: lib/Target/Mips/MipsSEISelDAGToDAG.cpp
-===================================================================
---- lib/Target/Mips/MipsSEISelDAGToDAG.cpp
-+++ lib/Target/Mips/MipsSEISelDAGToDAG.cpp
-@@ -236,13 +236,31 @@ SDNode *MipsSEDAGToDAGISel::selectAddESubE(unsigne
- (Opc == ISD::SUBC || Opc == ISD::SUBE)) &&
- "(ADD|SUB)E flag operand must come from (ADD|SUB)C/E insn");
-
-+ unsigned SLTuOp = Mips::SLTu, ADDuOp = Mips::ADDu;
-+ if (Subtarget->isGP64bit()) {
-+ SLTuOp = Mips::SLTu64;
-+ ADDuOp = Mips::DADDu;
-+ }
-+
- SDValue Ops[] = { CmpLHS, InFlag.getOperand(1) };
- SDValue LHS = Node->getOperand(0), RHS = Node->getOperand(1);
- EVT VT = LHS.getValueType();
-
-- SDNode *Carry = CurDAG->getMachineNode(Mips::SLTu, DL, VT, Ops);
-- SDNode *AddCarry = CurDAG->getMachineNode(Mips::ADDu, DL, VT,
-+ SDNode *Carry = CurDAG->getMachineNode(SLTuOp, DL, VT, Ops);
-+
-+ if (Subtarget->isGP64bit()) {
-+ // On 64-bit targets, sltu produces an i64 but our backend currently says
-+ // that SLTu64 produces an i32. We need to fix this in the long run but for
-+ // now, just make the DAG type-correct by asserting the upper bits are zero.
-+ Carry = CurDAG->getMachineNode(Mips::SUBREG_TO_REG, DL, VT,
-+ CurDAG->getTargetConstant(0, VT),
-+ SDValue(Carry, 0),
-+ CurDAG->getTargetConstant(Mips::sub_32, VT));
-+ }
-+
-+ SDNode *AddCarry = CurDAG->getMachineNode(ADDuOp, DL, VT,
- SDValue(Carry, 0), RHS);
-+
- return CurDAG->SelectNodeTo(Node, MOp, VT, MVT::Glue, LHS,
- SDValue(AddCarry, 0));
- }
-@@ -641,7 +659,8 @@ std::pair<bool, SDNode*> MipsSEDAGToDAGISel::selec
-
- case ISD::SUBE: {
- SDValue InFlag = Node->getOperand(2);
-- Result = selectAddESubE(Mips::SUBu, InFlag, InFlag.getOperand(0), DL, Node);
-+ unsigned Opc = Subtarget->isGP64bit() ? Mips::DSUBu : Mips::SUBu;
-+ Result = selectAddESubE(Opc, InFlag, InFlag.getOperand(0), DL, Node);
- return std::make_pair(true, Result);
- }
-
-@@ -649,7 +668,8 @@ std::pair<bool, SDNode*> MipsSEDAGToDAGISel::selec
- if (Subtarget->hasDSP()) // Select DSP instructions, ADDSC and ADDWC.
- break;
- SDValue InFlag = Node->getOperand(2);
-- Result = selectAddESubE(Mips::ADDu, InFlag, InFlag.getValue(0), DL, Node);
-+ unsigned Opc = Subtarget->isGP64bit() ? Mips::DADDu : Mips::ADDu;
-+ Result = selectAddESubE(Opc, InFlag, InFlag.getValue(0), DL, Node);
- return std::make_pair(true, Result);
- }
-
-Index: lib/Target/Mips/MipsSEISelLowering.cpp
-===================================================================
---- lib/Target/Mips/MipsSEISelLowering.cpp
-+++ lib/Target/Mips/MipsSEISelLowering.cpp
-@@ -122,6 +122,8 @@ MipsSETargetLowering::MipsSETargetLowering(const M
- setOperationAction(ISD::MUL, MVT::i64, Custom);
-
- if (Subtarget.isGP64bit()) {
-+ setOperationAction(ISD::SMUL_LOHI, MVT::i64, Custom);
-+ setOperationAction(ISD::UMUL_LOHI, MVT::i64, Custom);
- setOperationAction(ISD::MULHS, MVT::i64, Custom);
- setOperationAction(ISD::MULHU, MVT::i64, Custom);
- setOperationAction(ISD::SDIVREM, MVT::i64, Custom);
-@@ -200,6 +202,8 @@ MipsSETargetLowering::MipsSETargetLowering(const M
- if (Subtarget.hasMips64r6()) {
- // MIPS64r6 replaces the accumulator-based multiplies with a three register
- // instruction
-+ setOperationAction(ISD::SMUL_LOHI, MVT::i64, Expand);
-+ setOperationAction(ISD::UMUL_LOHI, MVT::i64, Expand);
- setOperationAction(ISD::MUL, MVT::i64, Legal);
- setOperationAction(ISD::MULHS, MVT::i64, Legal);
- setOperationAction(ISD::MULHU, MVT::i64, Legal);
-Index: test/CodeGen/Mips/llvm-ir/add.ll
-===================================================================
---- test/CodeGen/Mips/llvm-ir/add.ll
-+++ test/CodeGen/Mips/llvm-ir/add.ll
-@@ -0,0 +1,115 @@
-+; RUN: llc < %s -march=mips -mcpu=mips2 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=NOT-R2-R6 -check-prefix=GP32
-+; RUN: llc < %s -march=mips -mcpu=mips32 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=NOT-R2-R6 -check-prefix=GP32
-+; RUN: llc < %s -march=mips -mcpu=mips32r2 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=R2-R6 -check-prefix=GP32
-+; RUN: llc < %s -march=mips -mcpu=mips32r6 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=R2-R6 -check-prefix=GP32
-+; RUN: llc < %s -march=mips64 -mcpu=mips3 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=NOT-R2-R6 -check-prefix=GP64
-+; RUN: llc < %s -march=mips64 -mcpu=mips4 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=NOT-R2-R6 -check-prefix=GP64
-+; RUN: llc < %s -march=mips64 -mcpu=mips64 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=NOT-R2-R6 -check-prefix=GP64
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r2 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=R2-R6 -check-prefix=GP64
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r6 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=R2-R6 -check-prefix=GP64
-+
-+define signext i1 @add_i1(i1 signext %a, i1 signext %b) {
-+entry:
-+; ALL-LABEL: add_i1:
-+
-+ ; ALL: addu $[[T0:[0-9]+]], $4, $5
-+ ; ALL: sll $[[T0]], $[[T0]], 31
-+ ; ALL: sra $2, $[[T0]], 31
-+
-+ %r = add i1 %a, %b
-+ ret i1 %r
-+}
-+
-+define signext i8 @add_i8(i8 signext %a, i8 signext %b) {
-+entry:
-+; ALL-LABEL: add_i8:
-+
-+ ; NOT-R2-R6: addu $[[T0:[0-9]+]], $4, $5
-+ ; NOT-R2-R6: sll $[[T0]], $[[T0]], 24
-+ ; NOT-R2-R6: sra $2, $[[T0]], 24
-+
-+ ; R2-R6: addu $[[T0:[0-9]+]], $4, $5
-+ ; R2-R6: seb $2, $[[T0:[0-9]+]]
-+
-+ %r = add i8 %a, %b
-+ ret i8 %r
-+}
-+
-+define signext i16 @add_i16(i16 signext %a, i16 signext %b) {
-+entry:
-+; ALL-LABEL: add_i16:
-+
-+ ; NOT-R2-R6: addu $[[T0:[0-9]+]], $4, $5
-+ ; NOT-R2-R6: sll $[[T0]], $[[T0]], 16
-+ ; NOT-R2-R6: sra $2, $[[T0]], 16
-+
-+ ; R2-R6: addu $[[T0:[0-9]+]], $4, $5
-+ ; R2-R6: seh $2, $[[T0:[0-9]+]]
-+
-+ %r = add i16 %a, %b
-+ ret i16 %r
-+}
-+
-+define signext i32 @add_i32(i32 signext %a, i32 signext %b) {
-+entry:
-+; ALL-LABEL: add_i32:
-+
-+ ; ALL: addu $2, $4, $5
-+
-+ %r = add i32 %a, %b
-+ ret i32 %r
-+}
-+
-+define signext i64 @add_i64(i64 signext %a, i64 signext %b) {
-+entry:
-+; ALL-LABEL: add_i64:
-+
-+ ; GP32: addu $3, $5, $7
-+ ; GP32: sltu $[[T0:[0-9]+]], $3, $7
-+ ; GP32: addu $[[T1:[0-9]+]], $[[T0]], $6
-+ ; GP32: addu $2, $4, $[[T1]]
-+
-+ ; GP64: daddu $2, $4, $5
-+
-+ %r = add i64 %a, %b
-+ ret i64 %r
-+}
-+
-+define signext i128 @add_i128(i128 signext %a, i128 signext %b) {
-+entry:
-+; ALL-LABEL: add_i128:
-+
-+ ; GP32: lw $[[T0:[0-9]+]], 28($sp)
-+ ; GP32: addu $[[T1:[0-9]+]], $7, $[[T0]]
-+ ; GP32: sltu $[[T2:[0-9]+]], $[[T1]], $[[T0]]
-+ ; GP32: lw $[[T3:[0-9]+]], 24($sp)
-+ ; GP32: addu $[[T4:[0-9]+]], $[[T2]], $[[T3]]
-+ ; GP32: addu $[[T5:[0-9]+]], $6, $[[T4]]
-+ ; GP32: sltu $[[T6:[0-9]+]], $[[T5]], $[[T3]]
-+ ; GP32: lw $[[T7:[0-9]+]], 20($sp)
-+ ; GP32: addu $[[T8:[0-9]+]], $[[T6]], $[[T7]]
-+ ; GP32: lw $[[T9:[0-9]+]], 16($sp)
-+ ; GP32: addu $3, $5, $[[T8]]
-+ ; GP32: sltu $[[T10:[0-9]+]], $3, $[[T7]]
-+ ; GP32: addu $[[T11:[0-9]+]], $[[T10]], $[[T9]]
-+ ; GP32: addu $2, $4, $[[T11]]
-+ ; GP32: move $4, $[[T5]]
-+ ; GP32: move $5, $[[T1]]
-+
-+ ; GP64: daddu $3, $5, $7
-+ ; GP64: sltu $[[T0:[0-9]+]], $3, $7
-+ ; GP64: daddu $[[T1:[0-9]+]], $[[T0]], $6
-+ ; GP64: daddu $2, $4, $[[T1]]
-+
-+ %r = add i128 %a, %b
-+ ret i128 %r
-+}
-Index: test/CodeGen/Mips/llvm-ir/and.ll
-===================================================================
---- test/CodeGen/Mips/llvm-ir/and.ll
-+++ test/CodeGen/Mips/llvm-ir/and.ll
-@@ -0,0 +1,94 @@
-+; RUN: llc < %s -march=mips -mcpu=mips2 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP32
-+; RUN: llc < %s -march=mips -mcpu=mips32 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP32
-+; RUN: llc < %s -march=mips -mcpu=mips32r2 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP32
-+; RUN: llc < %s -march=mips -mcpu=mips32r6 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP32
-+; RUN: llc < %s -march=mips64 -mcpu=mips3 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64
-+; RUN: llc < %s -march=mips64 -mcpu=mips4 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64
-+; RUN: llc < %s -march=mips64 -mcpu=mips64 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r2 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r6 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64
-+
-+define signext i1 @and_i1(i1 signext %a, i1 signext %b) {
-+entry:
-+; ALL-LABEL: and_i1:
-+
-+ ; ALL: and $2, $4, $5
-+
-+ %r = and i1 %a, %b
-+ ret i1 %r
-+}
-+
-+define signext i8 @and_i8(i8 signext %a, i8 signext %b) {
-+entry:
-+; ALL-LABEL: and_i8:
-+
-+ ; ALL: and $2, $4, $5
-+
-+ %r = and i8 %a, %b
-+ ret i8 %r
-+}
-+
-+define signext i16 @and_i16(i16 signext %a, i16 signext %b) {
-+entry:
-+; ALL-LABEL: and_i16:
-+
-+ ; ALL: and $2, $4, $5
-+
-+ %r = and i16 %a, %b
-+ ret i16 %r
-+}
-+
-+define signext i32 @and_i32(i32 signext %a, i32 signext %b) {
-+entry:
-+; ALL-LABEL: and_i32:
-+
-+ ; GP32: and $2, $4, $5
-+
-+ ; GP64: and $[[T0:[0-9]+]], $4, $5
-+ ; GP64: sll $2, $[[T0]], 0
-+
-+ %r = and i32 %a, %b
-+ ret i32 %r
-+}
-+
-+define signext i64 @and_i64(i64 signext %a, i64 signext %b) {
-+entry:
-+; ALL-LABEL: and_i64:
-+
-+ ; GP32: and $2, $4, $6
-+ ; GP32: and $3, $5, $7
-+
-+ ; GP64: and $2, $4, $5
-+
-+ %r = and i64 %a, %b
-+ ret i64 %r
-+}
-+
-+define signext i128 @and_i128(i128 signext %a, i128 signext %b) {
-+entry:
-+; ALL-LABEL: and_i128:
-+
-+ ; GP32: lw $[[T0:[0-9]+]], 24($sp)
-+ ; GP32: lw $[[T1:[0-9]+]], 20($sp)
-+ ; GP32: lw $[[T2:[0-9]+]], 16($sp)
-+ ; GP32: and $2, $4, $[[T2]]
-+ ; GP32: and $3, $5, $[[T1]]
-+ ; GP32: and $4, $6, $[[T0]]
-+ ; GP32: lw $[[T3:[0-9]+]], 28($sp)
-+ ; GP32: and $5, $7, $[[T3]]
-+
-+ ; GP64: and $2, $4, $6
-+ ; GP64: and $3, $5, $7
-+
-+ %r = and i128 %a, %b
-+ ret i128 %r
-+}
-Index: test/CodeGen/Mips/llvm-ir/ashr.ll
-===================================================================
---- test/CodeGen/Mips/llvm-ir/ashr.ll
-+++ test/CodeGen/Mips/llvm-ir/ashr.ll
-@@ -0,0 +1,188 @@
-+; RUN: llc < %s -march=mips -mcpu=mips2 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP32 \
-+; RUN: -check-prefix=M2 -check-prefix=NOT-R2-R6
-+; RUN: llc < %s -march=mips -mcpu=mips32 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP32 -check-prefix=NOT-R2-R6 \
-+; RUN: -check-prefix=32R1-R2
-+; RUN: llc < %s -march=mips -mcpu=mips32r2 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP32 \
-+; RUN: -check-prefix=32R1-R2 -check-prefix=R2-R6
-+; RUN: llc < %s -march=mips -mcpu=mips32r6 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP32 \
-+; RUN: -check-prefix=32R6 -check-prefix=R2-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips3 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64 \
-+; RUN: -check-prefix=M3 -check-prefix=NOT-R2-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips4 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64 \
-+; RUN: -check-prefix=GP64-NOT-R6 -check-prefix=NOT-R2-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips64 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64 \
-+; RUN: -check-prefix=GP64-NOT-R6 -check-prefix=NOT-R2-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r2 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64 \
-+; RUN: -check-prefix=GP64-NOT-R6 -check-prefix R2-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r6 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64 \
-+; RUN: -check-prefix=64R6 -check-prefix=R2-R6
-+
-+define signext i1 @ashr_i1(i1 signext %a, i1 signext %b) {
-+entry:
-+; ALL-LABEL: ashr_i1:
-+
-+ ; ALL: move $2, $4
-+
-+ %r = ashr i1 %a, %b
-+ ret i1 %r
-+}
-+
-+define signext i8 @ashr_i8(i8 signext %a, i8 signext %b) {
-+entry:
-+; ALL-LABEL: ashr_i8:
-+
-+ ; FIXME: The andi instruction is redundant.
-+ ; ALL: andi $[[T0:[0-9]+]], $5, 255
-+ ; ALL: srav $2, $4, $[[T0]]
-+
-+ %r = ashr i8 %a, %b
-+ ret i8 %r
-+}
-+
-+define signext i16 @ashr_i16(i16 signext %a, i16 signext %b) {
-+entry:
-+; ALL-LABEL: ashr_i16:
-+
-+ ; FIXME: The andi instruction is redundant.
-+ ; ALL: andi $[[T0:[0-9]+]], $5, 65535
-+ ; ALL: srav $2, $4, $[[T0]]
-+
-+ %r = ashr i16 %a, %b
-+ ret i16 %r
-+}
-+
-+define signext i32 @ashr_i32(i32 signext %a, i32 signext %b) {
-+entry:
-+; ALL-LABEL: ashr_i32:
-+
-+ ; ALL: srav $2, $4, $5
-+
-+ %r = ashr i32 %a, %b
-+ ret i32 %r
-+}
-+
-+define signext i64 @ashr_i64(i64 signext %a, i64 signext %b) {
-+entry:
-+; ALL-LABEL: ashr_i64:
-+
-+ ; M2: srav $[[T0:[0-9]+]], $4, $7
-+ ; M2: andi $[[T1:[0-9]+]], $7, 32
-+ ; M2: bnez $[[T1]], $[[BB0:BB[0-9_]+]]
-+ ; M2: move $3, $[[T0]]
-+ ; M2: srlv $[[T2:[0-9]+]], $5, $7
-+ ; M2: not $[[T3:[0-9]+]], $7
-+ ; M2: sll $[[T4:[0-9]+]], $4, 1
-+ ; M2: sllv $[[T5:[0-9]+]], $[[T4]], $[[T3]]
-+ ; M2: or $3, $[[T3]], $[[T2]]
-+ ; M2: $[[BB0]]:
-+ ; M2: beqz $[[T1]], $[[BB1:BB[0-9_]+]]
-+ ; M2: nop
-+ ; M2: sra $2, $4, 31
-+ ; M2: $[[BB1]]:
-+ ; M2: jr $ra
-+ ; M2: nop
-+
-+ ; 32R1-R2: srlv $[[T0:[0-9]+]], $5, $7
-+ ; 32R1-R2: not $[[T1:[0-9]+]], $7
-+ ; 32R1-R2: sll $[[T2:[0-9]+]], $4, 1
-+ ; 32R1-R2: sllv $[[T3:[0-9]+]], $[[T2]], $[[T1]]
-+ ; 32R1-R2: or $3, $[[T3]], $[[T0]]
-+ ; 32R1-R2: srav $[[T4:[0-9]+]], $4, $7
-+ ; 32R1-R2: andi $[[T5:[0-9]+]], $7, 32
-+ ; 32R1-R2: movn $3, $[[T4]], $[[T5]]
-+ ; 32R1-R2: sra $4, $4, 31
-+ ; 32R1-R2: jr $ra
-+ ; 32R1-R2: movn $2, $4, $[[T5]]
-+
-+ ; 32R6: srav $[[T0:[0-9]+]], $4, $7
-+ ; 32R6: andi $[[T1:[0-9]+]], $7, 32
-+ ; 32R6: seleqz $[[T2:[0-9]+]], $[[T0]], $[[T1]]
-+ ; 32R6: sra $[[T3:[0-9]+]], $4, 31
-+ ; 32R6: selnez $[[T4:[0-9]+]], $[[T3]], $[[T1]]
-+ ; 32R6: or $[[T5:[0-9]+]], $[[T4]], $[[T2]]
-+ ; 32R6: srlv $[[T6:[0-9]+]], $5, $7
-+ ; 32R6: not $[[T7:[0-9]+]], $7
-+ ; 32R6: sll $[[T8:[0-9]+]], $4, 1
-+ ; 32R6: sllv $[[T9:[0-9]+]], $[[T8]], $[[T7]]
-+ ; 32R6: or $[[T10:[0-9]+]], $[[T9]], $[[T6]]
-+ ; 32R6: seleqz $[[T11:[0-9]+]], $[[T10]], $[[T1]]
-+ ; 32R6: selnez $[[T12:[0-9]+]], $[[T0]], $[[T1]]
-+ ; 32R6: jr $ra
-+ ; 32R6: or $3, $[[T0]], $[[T11]]
-+
-+ ; FIXME: The sll instruction below is redundant.
-+ ; GP64: sll $[[T0:[0-9]+]], $5, 0
-+ ; GP64: dsrav $2, $4, $[[T0]]
-+
-+ %r = ashr i64 %a, %b
-+ ret i64 %r
-+}
-+
-+define signext i128 @ashr_i128(i128 signext %a, i128 signext %b) {
-+entry:
-+; ALL-LABEL: ashr_i128:
-+
-+ ; GP32: lw $25, %call16(__ashrti3)($gp)
-+
-+ ; M3: sll $[[T0:[0-9]+]], $7, 0
-+ ; M3: dsrav $[[T1:[0-9]+]], $4, $[[T0]]
-+ ; M3: andi $[[T2:[0-9]+]], $[[T0]], 32
-+ ; M3: bnez $[[T3:[0-9]+]], $[[BB0:BB[0-9_]+]]
-+ ; M3: move $3, $[[T1]]
-+ ; M3: dsrlv $[[T4:[0-9]+]], $5, $[[T0]]
-+ ; M3: dsll $[[T5:[0-9]+]], $4, 1
-+ ; M3: not $[[T6:[0-9]+]], $[[T0]]
-+ ; M3: dsllv $[[T7:[0-9]+]], $[[T5]], $[[T6]]
-+ ; M3: or $3, $[[T7]], $[[T4]]
-+ ; M3: $[[BB0]]:
-+ ; M3: beqz $[[T3]], $[[BB1:BB[0-9_]+]]
-+ ; M3: nop
-+ ; M3: dsra $2, $4, 31
-+ ; M3: $[[BB1]]:
-+ ; M3: jr $ra
-+ ; M3: nop
-+
-+ ; GP64-NOT-R6: sll $[[T0:[0-9]+]], $7, 0
-+ ; GP64-NOT-R6: dsrlv $[[T1:[0-9]+]], $5, $[[T0]]
-+ ; GP64-NOT-R6: dsll $[[T2:[0-9]+]], $4, 1
-+ ; GP64-NOT-R6: not $[[T3:[0-9]+]], $[[T0]]
-+ ; GP64-NOT-R6: dsllv $[[T4:[0-9]+]], $[[T2]], $[[T3]]
-+ ; GP64-NOT-R6: or $3, $[[T4]], $[[T1]]
-+ ; GP64-NOT-R6: dsrav $2, $4, $[[T0]]
-+ ; GP64-NOT-R6: andi $[[T5:[0-9]+]], $[[T0]], 32
-+
-+ ; GP64-NOT-R6: movn $3, $2, $[[T5]]
-+ ; GP64-NOT-R6: dsra $[[T6:[0-9]+]], $4, 31
-+ ; GP64-NOT-R6: jr $ra
-+ ; GP64-NOT-R6: movn $2, $[[T6]], $[[T5]]
-+
-+ ; 64R6: sll $[[T0:[0-9]+]], $7, 0
-+ ; 64R6: dsrav $[[T1:[0-9]+]], $4, $[[T0]]
-+ ; 64R6: andi $[[T2:[0-9]+]], $[[T0]], 32
-+ ; 64R6: sll $[[T3:[0-9]+]], $[[T2]], 0
-+ ; 64R6: seleqz $[[T4:[0-9]+]], $[[T1]], $[[T3]]
-+ ; 64R6: dsra $[[T5:[0-9]+]], $4, 31
-+ ; 64R6: selnez $[[T6:[0-9]+]], $[[T5]], $[[T3]]
-+ ; 64R6: or $2, $[[T6]], $[[T4]]
-+ ; 64R6: dsrlv $[[T7:[0-9]+]], $5, $[[T0]]
-+ ; 64R6: dsll $[[T8:[0-9]+]], $4, 1
-+ ; 64R6: not $[[T9:[0-9]+]], $[[T0]]
-+ ; 64R6: dsllv $[[T10:[0-9]+]], $[[T8]], $[[T9]]
-+ ; 64R6: or $[[T11:[0-9]+]], $[[T10]], $[[T7]]
-+ ; 64R6: seleqz $[[T12:[0-9]+]], $[[T11]], $[[T3]]
-+ ; 64R6: selnez $[[T13:[0-9]+]], $[[T1]], $[[T3]]
-+ ; 64R6: jr $ra
-+ ; 64R6: or $3, $[[T13]], $[[T12]]
-+
-+ %r = ashr i128 %a, %b
-+ ret i128 %r
-+}
-Index: test/CodeGen/Mips/llvm-ir/lshr.ll
-===================================================================
---- test/CodeGen/Mips/llvm-ir/lshr.ll
-+++ test/CodeGen/Mips/llvm-ir/lshr.ll
-@@ -0,0 +1,176 @@
-+; RUN: llc < %s -march=mips -mcpu=mips2 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP32 \
-+; RUN: -check-prefix=M2 -check-prefix=NOT-R2-R6
-+; RUN: llc < %s -march=mips -mcpu=mips32 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP32 -check-prefix=NOT-R2-R6 \
-+; RUN: -check-prefix=32R1-R2
-+; RUN: llc < %s -march=mips -mcpu=mips32r2 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP32 \
-+; RUN: -check-prefix=32R1-R2 -check-prefix=R2-R6
-+; RUN: llc < %s -march=mips -mcpu=mips32r6 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP32 \
-+; RUN: -check-prefix=32R6 -check-prefix=R2-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips3 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64 \
-+; RUN: -check-prefix=M3 -check-prefix=NOT-R2-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips4 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64 \
-+; RUN: -check-prefix=GP64-NOT-R6 -check-prefix=NOT-R2-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips64 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64 \
-+; RUN: -check-prefix=GP64-NOT-R6 -check-prefix=NOT-R2-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r2 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64 \
-+; RUN: -check-prefix=GP64-NOT-R6 -check-prefix R2-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r6 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64 \
-+; RUN: -check-prefix=64R6 -check-prefix=R2-R6
-+
-+define signext i1 @lshr_i1(i1 signext %a, i1 signext %b) {
-+entry:
-+; ALL-LABEL: lshr_i1:
-+
-+ ; ALL: move $2, $4
-+
-+ %r = lshr i1 %a, %b
-+ ret i1 %r
-+}
-+
-+define zeroext i8 @lshr_i8(i8 zeroext %a, i8 zeroext %b) {
-+entry:
-+; ALL-LABEL: lshr_i8:
-+
-+ ; ALL: srlv $[[T0:[0-9]+]], $4, $5
-+ ; ALL: andi $2, $[[T0]], 255
-+
-+ %r = lshr i8 %a, %b
-+ ret i8 %r
-+}
-+
-+define zeroext i16 @lshr_i16(i16 zeroext %a, i16 zeroext %b) {
-+entry:
-+; ALL-LABEL: lshr_i16:
-+
-+ ; ALL: srlv $[[T0:[0-9]+]], $4, $5
-+ ; ALL: andi $2, $[[T0]], 65535
-+
-+ %r = lshr i16 %a, %b
-+ ret i16 %r
-+}
-+
-+define signext i32 @lshr_i32(i32 signext %a, i32 signext %b) {
-+entry:
-+; ALL-LABEL: lshr_i32:
-+
-+ ; ALL: srlv $2, $4, $5
-+
-+ %r = lshr i32 %a, %b
-+ ret i32 %r
-+}
-+
-+define signext i64 @lshr_i64(i64 signext %a, i64 signext %b) {
-+entry:
-+; ALL-LABEL: lshr_i64:
-+
-+ ; M2: srlv $[[T0:[0-9]+]], $4, $7
-+ ; M2: andi $[[T1:[0-9]+]], $7, 32
-+ ; M2: bnez $[[T1]], $[[BB0:BB[0-9_]+]]
-+ ; M2: move $3, $[[T0]]
-+ ; M2: srlv $[[T2:[0-9]+]], $5, $7
-+ ; M2: not $[[T3:[0-9]+]], $7
-+ ; M2: sll $[[T4:[0-9]+]], $4, 1
-+ ; M2: sllv $[[T5:[0-9]+]], $[[T4]], $[[T3]]
-+ ; M2: or $3, $[[T3]], $[[T2]]
-+ ; M2: $[[BB0]]:
-+ ; M2: bnez $[[T1]], $[[BB1:BB[0-9_]+]]
-+ ; M2: addiu $2, $zero, 0
-+ ; M2: move $2, $[[T0]]
-+ ; M2: $[[BB1]]:
-+ ; M2: jr $ra
-+ ; M2: nop
-+
-+ ; 32R1-R2: srlv $[[T0:[0-9]+]], $5, $7
-+ ; 32R1-R2: not $[[T1:[0-9]+]], $7
-+ ; 32R1-R2: sll $[[T2:[0-9]+]], $4, 1
-+ ; 32R1-R2: sllv $[[T3:[0-9]+]], $[[T2]], $[[T1]]
-+ ; 32R1-R2: or $3, $[[T3]], $[[T0]]
-+ ; 32R1-R2: srlv $[[T4:[0-9]+]], $4, $7
-+ ; 32R1-R2: andi $[[T5:[0-9]+]], $7, 32
-+ ; 32R1-R2: movn $3, $[[T4]], $[[T5]]
-+ ; 32R1-R2: jr $ra
-+ ; 32R1-R2: movn $2, $zero, $[[T5]]
-+
-+ ; 32R6: srlv $[[T0:[0-9]+]], $5, $7
-+ ; 32R6: not $[[T1:[0-9]+]], $7
-+ ; 32R6: sll $[[T2:[0-9]+]], $4, 1
-+ ; 32R6: sllv $[[T3:[0-9]+]], $[[T2]], $[[T1]]
-+ ; 32R6: or $[[T4:[0-9]+]], $[[T3]], $[[T0]]
-+ ; 32R6: andi $[[T5:[0-9]+]], $7, 32
-+ ; 32R6: seleqz $[[T6:[0-9]+]], $[[T4]], $[[T3]]
-+ ; 32R6: srlv $[[T7:[0-9]+]], $4, $7
-+ ; 32R6: selnez $[[T8:[0-9]+]], $[[T7]], $[[T5]]
-+ ; 32R6: or $3, $[[T8]], $[[T6]]
-+ ; 32R6: jr $ra
-+ ; 32R6: seleqz $2, $[[T7]], $[[T5]]
-+
-+ ; GP64: sll $[[T0:[0-9]+]], $5, 0
-+ ; GP64: dsrlv $2, $4, $[[T0]]
-+
-+ %r = lshr i64 %a, %b
-+ ret i64 %r
-+}
-+
-+define signext i128 @lshr_i128(i128 signext %a, i128 signext %b) {
-+entry:
-+; ALL-LABEL: lshr_i128:
-+
-+ ; GP32: lw $25, %call16(__lshrti3)($gp)
-+
-+ ; M3: sll $[[T0:[0-9]+]], $7, 0
-+ ; M3: dsrlv $[[T1:[0-9]+]], $4, $[[T0]]
-+ ; M3: andi $[[T2:[0-9]+]], $[[T0]], 32
-+ ; M3: bnez $[[T3:[0-9]+]], $[[BB0:BB[0-9_]+]]
-+ ; M3: move $3, $[[T1]]
-+ ; M3: dsrlv $[[T4:[0-9]+]], $5, $[[T0]]
-+ ; M3: dsll $[[T5:[0-9]+]], $4, 1
-+ ; M3: not $[[T6:[0-9]+]], $[[T0]]
-+ ; M3: dsllv $[[T7:[0-9]+]], $[[T5]], $[[T6]]
-+ ; M3: or $3, $[[T7]], $[[T4]]
-+ ; M3: $[[BB0]]:
-+ ; M3: bnez $[[T3]], $[[BB1:BB[0-9_]+]]
-+ ; M3: daddiu $2, $zero, 0
-+ ; M3: move $2, $[[T1]]
-+ ; M3: $[[BB1]]:
-+ ; M3: jr $ra
-+ ; M3: nop
-+
-+ ; GP64-NOT-R6: sll $[[T0:[0-9]+]], $7, 0
-+ ; GP64-NOT-R6: dsrlv $[[T1:[0-9]+]], $5, $[[T0]]
-+ ; GP64-NOT-R6: dsll $[[T2:[0-9]+]], $4, 1
-+ ; GP64-NOT-R6: not $[[T3:[0-9]+]], $[[T0]]
-+ ; GP64-NOT-R6: dsllv $[[T4:[0-9]+]], $[[T2]], $[[T3]]
-+ ; GP64-NOT-R6: or $3, $[[T4]], $[[T1]]
-+ ; GP64-NOT-R6: dsrlv $2, $4, $[[T0]]
-+ ; GP64-NOT-R6: andi $[[T5:[0-9]+]], $[[T0]], 32
-+ ; GP64-NOT-R6: movn $3, $2, $[[T5]]
-+ ; GP64-NOT-R6: jr $ra
-+ ; GP64-NOT-R6: movn $2, $zero, $1
-+
-+ ; 64R6: sll $[[T0:[0-9]+]], $7, 0
-+ ; 64R6: dsrlv $[[T1:[0-9]+]], $5, $[[T0]]
-+ ; 64R6: dsll $[[T2:[0-9]+]], $4, 1
-+ ; 64R6: not $[[T3:[0-9]+]], $[[T0]]
-+ ; 64R6: dsllv $[[T4:[0-9]+]], $[[T2]], $[[T3]]
-+ ; 64R6: or $[[T5:[0-9]+]], $[[T4]], $[[T1]]
-+ ; 64R6: andi $[[T6:[0-9]+]], $[[T0]], 32
-+ ; 64R6: sll $[[T7:[0-9]+]], $[[T6]], 0
-+ ; 64R6: seleqz $[[T8:[0-9]+]], $[[T5]], $[[T7]]
-+ ; 64R6: dsrlv $[[T9:[0-9]+]], $4, $[[T0]]
-+ ; 64R6: selnez $[[T10:[0-9]+]], $[[T9]], $[[T7]]
-+ ; 64R6: or $3, $[[T10]], $[[T8]]
-+ ; 64R6: jr $ra
-+ ; 64R6: seleqz $2, $[[T0]], $[[T7]]
-+
-+ %r = lshr i128 %a, %b
-+ ret i128 %r
-+}
-Index: test/CodeGen/Mips/llvm-ir/mul.ll
-===================================================================
---- test/CodeGen/Mips/llvm-ir/mul.ll
-+++ test/CodeGen/Mips/llvm-ir/mul.ll
-@@ -1,19 +1,19 @@
--; RUN: llc < %s -march=mips -mcpu=mips2 | FileCheck %s \
--; RUN: -check-prefix=ALL -check-prefix=M2
--; RUN: llc < %s -march=mips -mcpu=mips32 | FileCheck %s \
--; RUN: -check-prefix=ALL -check-prefix=32R1-R2 -check-prefix=32R1
--; RUN: llc < %s -march=mips -mcpu=mips32r2 | FileCheck %s \
--; RUN: -check-prefix=ALL -check-prefix=32R1-R2 -check-prefix=32R2
--; RUN: llc < %s -march=mips -mcpu=mips32r6 | FileCheck %s \
--; RUN: -check-prefix=ALL -check-prefix=32R6
--; RUN: llc < %s -march=mips64 -mcpu=mips4 | FileCheck %s \
--; RUN: -check-prefix=ALL -check-prefix=M4
--; RUN: llc < %s -march=mips64 -mcpu=mips64 | FileCheck %s \
--; RUN: -check-prefix=ALL -check-prefix=64R1-R2
--; RUN: llc < %s -march=mips64 -mcpu=mips64r2 | FileCheck %s \
--; RUN: -check-prefix=ALL -check-prefix=64R1-R2
--; RUN: llc < %s -march=mips64 -mcpu=mips64r6 | FileCheck %s \
--; RUN: -check-prefix=ALL -check-prefix=64R6
-+; RUN: llc < %s -march=mips -mcpu=mips2 | FileCheck %s -check-prefix=ALL \
-+; RUN: -check-prefix=M2 -check-prefix=GP32
-+; RUN: llc < %s -march=mips -mcpu=mips32 | FileCheck %s -check-prefix=ALL \
-+; RUN: -check-prefix=32R1-R2 -check-prefix=GP32
-+; RUN: llc < %s -march=mips -mcpu=mips32r2 | FileCheck %s -check-prefix=ALL \
-+; RUN: -check-prefix=32R1-R2 -check-prefix=32R2 -check-prefix=GP32
-+; RUN: llc < %s -march=mips -mcpu=mips32r6 | FileCheck %s -check-prefix=ALL \
-+; RUN: -check-prefix=32R6 -check-prefix=GP32
-+; RUN: llc < %s -march=mips64 -mcpu=mips4 | FileCheck %s -check-prefix=ALL \
-+; RUN: -check-prefix=M4 -check-prefix=GP64-NOT-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips64 | FileCheck %s -check-prefix=ALL \
-+; RUN: -check-prefix=64R1-R2 -check-prefix=GP64-NOT-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r2 | FileCheck %s -check-prefix=ALL \
-+; RUN: -check-prefix=64R1-R2 -check-prefix=GP64 -check-prefix=GP64-NOT-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r6 | FileCheck %s -check-prefix=ALL \
-+; RUN: -check-prefix=64R6
-
- define signext i1 @mul_i1(i1 signext %a, i1 signext %b) {
- entry:
-@@ -179,3 +179,30 @@ entry:
- %r = mul i64 %a, %b
- ret i64 %r
- }
-+
-+define signext i128 @mul_i128(i128 signext %a, i128 signext %b) {
-+entry:
-+; ALL-LABEL: mul_i128:
-+
-+ ; GP32: lw $25, %call16(__multi3)($gp)
-+
-+ ; GP64-NOT-R6: dmult $4, $7
-+ ; GP64-NOT-R6: mflo $[[T0:[0-9]+]]
-+ ; GP64-NOT-R6: dmult $5, $6
-+ ; GP64-NOT-R6: mflo $[[T1:[0-9]+]]
-+ ; GP64-NOT-R6: dmultu $5, $7
-+ ; GP64-NOT-R6: mflo $3
-+ ; GP64-NOT-R6: mfhi $[[T2:[0-9]+]]
-+ ; GP64-NOT-R6: daddu $[[T3:[0-9]+]], $[[T2]], $[[T1]]
-+ ; GP64-NOT-R6: daddu $2, $[[T3:[0-9]+]], $[[T0]]
-+
-+ ; 64R6: dmul $[[T0:[0-9]+]], $5, $6
-+ ; 64R6: dmuhu $[[T1:[0-9]+]], $5, $7
-+ ; 64R6: daddu $[[T2:[0-9]+]], $[[T1]], $[[T0]]
-+ ; 64R6: dmul $[[T3:[0-9]+]], $4, $7
-+ ; 64R6: daddu $2, $[[T2]], $[[T3]]
-+ ; 64R6: dmul $3, $5, $7
-+
-+ %r = mul i128 %a, %b
-+ ret i128 %r
-+}
-Index: test/CodeGen/Mips/llvm-ir/or.ll
-===================================================================
---- test/CodeGen/Mips/llvm-ir/or.ll
-+++ test/CodeGen/Mips/llvm-ir/or.ll
-@@ -0,0 +1,95 @@
-+; RUN: llc < %s -march=mips -mcpu=mips2 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP32
-+; RUN: llc < %s -march=mips -mcpu=mips32 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP32
-+; RUN: llc < %s -march=mips -mcpu=mips32r2 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP32
-+; RUN: llc < %s -march=mips -mcpu=mips32r6 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP32
-+; RUN: llc < %s -march=mips64 -mcpu=mips3 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64
-+; RUN: llc < %s -march=mips64 -mcpu=mips4 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64
-+; RUN: llc < %s -march=mips64 -mcpu=mips64 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r2 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r6 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64
-+
-+define signext i1 @or_i1(i1 signext %a, i1 signext %b) {
-+entry:
-+; ALL-LABEL: or_i1:
-+
-+ ; ALL: or $2, $4, $5
-+
-+ %r = or i1 %a, %b
-+ ret i1 %r
-+}
-+
-+define signext i8 @or_i8(i8 signext %a, i8 signext %b) {
-+entry:
-+; ALL-LABEL: or_i8:
-+
-+ ; ALL: or $2, $4, $5
-+
-+ %r = or i8 %a, %b
-+ ret i8 %r
-+}
-+
-+define signext i16 @or_i16(i16 signext %a, i16 signext %b) {
-+entry:
-+; ALL-LABEL: or_i16:
-+
-+ ; ALL: or $2, $4, $5
-+
-+ %r = or i16 %a, %b
-+ ret i16 %r
-+}
-+
-+define signext i32 @or_i32(i32 signext %a, i32 signext %b) {
-+entry:
-+; ALL-LABEL: or_i32:
-+
-+ ; GP32: or $2, $4, $5
-+
-+ ; GP64: or $[[T0:[0-9]+]], $4, $5
-+ ; FIXME: The sll instruction below is redundant.
-+ ; GP64: sll $2, $[[T0]], 0
-+
-+ %r = or i32 %a, %b
-+ ret i32 %r
-+}
-+
-+define signext i64 @or_i64(i64 signext %a, i64 signext %b) {
-+entry:
-+; ALL-LABEL: or_i64:
-+
-+ ; GP32: or $2, $4, $6
-+ ; GP32: or $3, $5, $7
-+
-+ ; GP64: or $2, $4, $5
-+
-+ %r = or i64 %a, %b
-+ ret i64 %r
-+}
-+
-+define signext i128 @or_i128(i128 signext %a, i128 signext %b) {
-+entry:
-+; ALL-LABEL: or_i128:
-+
-+ ; GP32: lw $[[T0:[0-9]+]], 24($sp)
-+ ; GP32: lw $[[T1:[0-9]+]], 20($sp)
-+ ; GP32: lw $[[T2:[0-9]+]], 16($sp)
-+ ; GP32: or $2, $4, $[[T2]]
-+ ; GP32: or $3, $5, $[[T1]]
-+ ; GP32: or $4, $6, $[[T0]]
-+ ; GP32: lw $[[T3:[0-9]+]], 28($sp)
-+ ; GP32: or $5, $7, $[[T3]]
-+
-+ ; GP64: or $2, $4, $6
-+ ; GP64: or $3, $5, $7
-+
-+ %r = or i128 %a, %b
-+ ret i128 %r
-+}
-Index: test/CodeGen/Mips/llvm-ir/sdiv.ll
-===================================================================
---- test/CodeGen/Mips/llvm-ir/sdiv.ll
-+++ test/CodeGen/Mips/llvm-ir/sdiv.ll
-@@ -0,0 +1,136 @@
-+; RUN: llc < %s -march=mips -mcpu=mips2 | FileCheck %s \
-+; RUN: -check-prefix=NOT-R6 -check-prefix=NOT-R2-R6 -check-prefix=GP32
-+; RUN: llc < %s -march=mips -mcpu=mips32 | FileCheck %s \
-+; RUN: -check-prefix=NOT-R6 -check-prefix=NOT-R2-R6 -check-prefix=GP32
-+; RUN: llc < %s -march=mips -mcpu=mips32r2 | FileCheck %s \
-+; RUN: -check-prefix=NOT-R6 -check-prefix=R2 -check-prefix=GP32
-+; RUN: llc < %s -march=mips -mcpu=mips32r6 | FileCheck %s \
-+; RUN: -check-prefix=R6 -check-prefix=GP32
-+; RUN: llc < %s -march=mips64 -mcpu=mips3 | FileCheck %s \
-+; RUN: -check-prefix=NOT-R6 -check-prefix=NOT-R2-R6 -check-prefix=GP64-NOT-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips4 | FileCheck %s \
-+; RUN: -check-prefix=NOT-R6 -check-prefix=NOT-R2-R6 -check-prefix=GP64-NOT-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips64 | FileCheck %s \
-+; RUN: -check-prefix=NOT-R6 -check-prefix=NOT-R2-R6 -check-prefix=GP64-NOT-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r2 | FileCheck %s \
-+; RUN: -check-prefix=NOT-R6 -check-prefix=R2 -check-prefix=GP64-NOT-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r6 | FileCheck %s \
-+; RUN: -check-prefix=R6 -check-prefix=64R6
-+
-+define signext i1 @sdiv_i1(i1 signext %a, i1 signext %b) {
-+entry:
-+; ALL-LABEL: sdiv_i1:
-+
-+ ; NOT-R6: div $zero, $4, $5
-+ ; NOT-R6: teq $5, $zero, 7
-+ ; NOT-R6: mflo $[[T0:[0-9]+]]
-+ ; FIXME: The sll/sra instructions are redundant since div is signed.
-+ ; NOT-R6: sll $[[T1:[0-9]+]], $[[T0]], 31
-+ ; NOT-R6: sra $2, $[[T1]], 31
-+
-+ ; R6: div $[[T0:[0-9]+]], $4, $5
-+ ; R6: teq $5, $zero, 7
-+ ; FIXME: The sll/sra instructions are redundant since div is signed.
-+ ; R6: sll $[[T1:[0-9]+]], $[[T0]], 31
-+ ; R6: sra $2, $[[T1]], 31
-+
-+ %r = sdiv i1 %a, %b
-+ ret i1 %r
-+}
-+
-+define signext i8 @sdiv_i8(i8 signext %a, i8 signext %b) {
-+entry:
-+; ALL-LABEL: sdiv_i8:
-+
-+ ; NOT-R2-R6: div $zero, $4, $5
-+ ; NOT-R2-R6: teq $5, $zero, 7
-+ ; NOT-R2-R6: mflo $[[T0:[0-9]+]]
-+ ; FIXME: The sll/sra instructions are redundant since div is signed.
-+ ; NOT-R2-R6: sll $[[T1:[0-9]+]], $[[T0]], 24
-+ ; NOT-R2-R6: sra $2, $[[T1]], 24
-+
-+ ; R2: div $zero, $4, $5
-+ ; R2: teq $5, $zero, 7
-+ ; R2: mflo $[[T0:[0-9]+]]
-+ ; FIXME: This instruction is redundant.
-+ ; R2: seb $2, $[[T0]]
-+
-+ ; R6: div $[[T0:[0-9]+]], $4, $5
-+ ; R6: teq $5, $zero, 7
-+ ; FIXME: This instruction is redundant.
-+ ; R6: seb $2, $[[T0]]
-+
-+ %r = sdiv i8 %a, %b
-+ ret i8 %r
-+}
-+
-+define signext i16 @sdiv_i16(i16 signext %a, i16 signext %b) {
-+entry:
-+; ALL-LABEL: sdiv_i16:
-+
-+ ; NOT-R2-R6: div $zero, $4, $5
-+ ; NOT-R2-R6: teq $5, $zero, 7
-+ ; NOT-R2-R6: mflo $[[T0:[0-9]+]]
-+ ; FIXME: The sll/sra instructions are redundant since div is signed.
-+ ; NOT-R2-R6: sll $[[T1:[0-9]+]], $[[T0]], 16
-+ ; NOT-R2-R6: sra $2, $[[T1]], 16
-+
-+ ; R2: div $zero, $4, $5
-+ ; R2: teq $5, $zero, 7
-+ ; R2: mflo $[[T0:[0-9]+]]
-+ ; FIXME: This is instruction is redundant since div is signed.
-+ ; R2: seh $2, $[[T0]]
-+
-+ ; R6: div $[[T0:[0-9]+]], $4, $5
-+ ; R6: teq $5, $zero, 7
-+ ; FIXME: This is instruction is redundant since div is signed.
-+ ; R6: seh $2, $[[T0]]
-+
-+ %r = sdiv i16 %a, %b
-+ ret i16 %r
-+}
-+
-+define signext i32 @sdiv_i32(i32 signext %a, i32 signext %b) {
-+entry:
-+; ALL-LABEL: sdiv_i32:
-+
-+ ; NOT-R6: div $zero, $4, $5
-+ ; NOT-R6: teq $5, $zero, 7
-+ ; NOT-R6: mflo $2
-+
-+ ; R6: div $2, $4, $5
-+ ; R6: teq $5, $zero, 7
-+
-+ %r = sdiv i32 %a, %b
-+ ret i32 %r
-+}
-+
-+define signext i64 @sdiv_i64(i64 signext %a, i64 signext %b) {
-+entry:
-+; ALL-LABEL: sdiv_i64:
-+
-+ ; GP32: lw $25, %call16(__divdi3)($gp)
-+
-+ ; GP64-NOT-R6: ddiv $zero, $4, $5
-+ ; GP64-NOT-R6: teq $5, $zero, 7
-+ ; GP64-NOT-R6: mflo $2
-+
-+ ; 64R6: ddiv $2, $4, $5
-+ ; 64R6: teq $5, $zero, 7
-+
-+ %r = sdiv i64 %a, %b
-+ ret i64 %r
-+}
-+
-+define signext i128 @sdiv_i128(i128 signext %a, i128 signext %b) {
-+entry:
-+ ; ALL-LABEL: sdiv_i128:
-+
-+ ; GP32: lw $25, %call16(__divti3)($gp)
-+
-+ ; GP64-NOT-R6: ld $25, %call16(__divti3)($gp)
-+ ; 64R6: ld $25, %call16(__divti3)($gp)
-+
-+ %r = sdiv i128 %a, %b
-+ ret i128 %r
-+}
-Index: test/CodeGen/Mips/llvm-ir/shl.ll
-===================================================================
---- test/CodeGen/Mips/llvm-ir/shl.ll
-+++ test/CodeGen/Mips/llvm-ir/shl.ll
-@@ -0,0 +1,188 @@
-+; RUN: llc < %s -march=mips -mcpu=mips2 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP32 \
-+; RUN: -check-prefix=M2 -check-prefix=NOT-R2-R6
-+; RUN: llc < %s -march=mips -mcpu=mips32 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP32 -check-prefix=NOT-R2-R6 \
-+; RUN: -check-prefix=32R1-R2
-+; RUN: llc < %s -march=mips -mcpu=mips32r2 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP32 \
-+; RUN: -check-prefix=32R1-R2 -check-prefix=R2-R6
-+; RUN: llc < %s -march=mips -mcpu=mips32r6 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP32 \
-+; RUN: -check-prefix=32R6 -check-prefix=R2-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips3 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64 \
-+; RUN: -check-prefix=M3 -check-prefix=NOT-R2-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips4 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64 \
-+; RUN: -check-prefix=GP64-NOT-R6 -check-prefix=NOT-R2-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips64 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64 \
-+; RUN: -check-prefix=GP64-NOT-R6 -check-prefix=NOT-R2-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r2 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64 \
-+; RUN: -check-prefix=GP64-NOT-R6 -check-prefix R2-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r6 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64 \
-+; RUN: -check-prefix=64R6 -check-prefix=R2-R6
-+
-+define signext i1 @shl_i1(i1 signext %a, i1 signext %b) {
-+entry:
-+; ALL-LABEL: shl_i1:
-+
-+ ; ALL: move $2, $4
-+
-+ %r = shl i1 %a, %b
-+ ret i1 %r
-+}
-+
-+define signext i8 @shl_i8(i8 signext %a, i8 signext %b) {
-+entry:
-+; ALL-LABEL: shl_i8:
-+
-+ ; NOT-R2-R6: andi $[[T0:[0-9]+]], $5, 255
-+ ; NOT-R2-R6: sllv $[[T1:[0-9]+]], $4, $[[T0]]
-+ ; NOT-R2-R6: sll $[[T2:[0-9]+]], $[[T1]], 24
-+ ; NOT-R2-R6: sra $2, $[[T2]], 24
-+
-+ ; R2-R6: andi $[[T0:[0-9]+]], $5, 255
-+ ; R2-R6: sllv $[[T1:[0-9]+]], $4, $[[T0]]
-+ ; R2-R6: seb $2, $[[T1]]
-+
-+ %r = shl i8 %a, %b
-+ ret i8 %r
-+}
-+
-+define signext i16 @shl_i16(i16 signext %a, i16 signext %b) {
-+entry:
-+; ALL-LABEL: shl_i16:
-+
-+ ; NOT-R2-R6: andi $[[T0:[0-9]+]], $5, 65535
-+ ; NOT-R2-R6: sllv $[[T1:[0-9]+]], $4, $[[T0]]
-+ ; NOT-R2-R6: sll $[[T2:[0-9]+]], $[[T1]], 16
-+ ; NOT-R2-R6: sra $2, $[[T2]], 16
-+
-+ ; R2-R6: andi $[[T0:[0-9]+]], $5, 65535
-+ ; R2-R6: sllv $[[T1:[0-9]+]], $4, $[[T0]]
-+ ; R2-R6: seh $2, $[[T1]]
-+
-+ %r = shl i16 %a, %b
-+ ret i16 %r
-+}
-+
-+define signext i32 @shl_i32(i32 signext %a, i32 signext %b) {
-+entry:
-+; ALL-LABEL: shl_i32:
-+
-+ ; ALL: sllv $2, $4, $5
-+
-+ %r = shl i32 %a, %b
-+ ret i32 %r
-+}
-+
-+define signext i64 @shl_i64(i64 signext %a, i64 signext %b) {
-+entry:
-+; ALL-LABEL: shl_i64:
-+
-+ ; M2: sllv $[[T0:[0-9]+]], $5, $7
-+ ; M2: andi $[[T1:[0-9]+]], $7, 32
-+ ; M2: bnez $[[T1]], $[[BB0:BB[0-9_]+]]
-+ ; M2: move $2, $[[T0]]
-+ ; M2: sllv $[[T2:[0-9]+]], $4, $7
-+ ; M2: not $[[T3:[0-9]+]], $7
-+ ; M2: srl $[[T4:[0-9]+]], $5, 1
-+ ; M2: srlv $[[T5:[0-9]+]], $[[T4]], $[[T3]]
-+ ; M2: or $2, $[[T2]], $[[T3]]
-+ ; M2: $[[BB0]]:
-+ ; M2: bnez $[[T1]], $[[BB1:BB[0-9_]+]]
-+ ; M2: addiu $3, $zero, 0
-+ ; M2: move $3, $[[T0]]
-+ ; M2: $[[BB1]]:
-+ ; M2: jr $ra
-+ ; M2: nop
-+
-+ ; 32R1-R2: sllv $[[T0:[0-9]+]], $4, $7
-+ ; 32R1-R2: not $[[T1:[0-9]+]], $7
-+ ; 32R1-R2: srl $[[T2:[0-9]+]], $5, 1
-+ ; 32R1-R2: srlv $[[T3:[0-9]+]], $[[T2]], $[[T1]]
-+ ; 32R1-R2: or $2, $[[T0]], $[[T3]]
-+ ; 32R1-R2: sllv $[[T4:[0-9]+]], $5, $7
-+ ; 32R1-R2: andi $[[T5:[0-9]+]], $7, 32
-+ ; 32R1-R2: movn $2, $[[T4]], $[[T5]]
-+ ; 32R1-R2: jr $ra
-+ ; 32R1-R2: movn $3, $zero, $[[T5]]
-+
-+ ; 32R6: sllv $[[T0:[0-9]+]], $4, $7
-+ ; 32R6: not $[[T1:[0-9]+]], $7
-+ ; 32R6: srl $[[T2:[0-9]+]], $5, 1
-+ ; 32R6: srlv $[[T3:[0-9]+]], $[[T2]], $[[T1]]
-+ ; 32R6: or $[[T4:[0-9]+]], $[[T0]], $[[T3]]
-+ ; 32R6: andi $[[T5:[0-9]+]], $7, 32
-+ ; 32R6: seleqz $[[T6:[0-9]+]], $[[T4]], $[[T2]]
-+ ; 32R6: sllv $[[T7:[0-9]+]], $5, $7
-+ ; 32R6: selnez $[[T8:[0-9]+]], $[[T7]], $[[T5]]
-+ ; 32R6: or $2, $[[T8]], $[[T6]]
-+ ; 32R6: jr $ra
-+ ; 32R6: seleqz $3, $[[T7]], $[[T5]]
-+
-+ ; GP64: sll $[[T0:[0-9]+]], $5, 0
-+ ; GP64: dsllv $2, $4, $1
-+
-+ %r = shl i64 %a, %b
-+ ret i64 %r
-+}
-+
-+define signext i128 @shl_i128(i128 signext %a, i128 signext %b) {
-+entry:
-+; ALL-LABEL: shl_i128:
-+
-+ ; GP32: lw $25, %call16(__ashlti3)($gp)
-+
-+ ; M3: sll $[[T0:[0-9]+]], $7, 0
-+ ; M3: dsllv $[[T1:[0-9]+]], $5, $[[T0]]
-+ ; M3: andi $[[T2:[0-9]+]], $[[T0]], 32
-+ ; M3: bnez $[[T3:[0-9]+]], $[[BB0:BB[0-9_]+]]
-+ ; M3: move $2, $[[T1]]
-+ ; M3: dsllv $[[T4:[0-9]+]], $4, $[[T0]]
-+ ; M3: dsrl $[[T5:[0-9]+]], $5, 1
-+ ; M3: not $[[T6:[0-9]+]], $[[T0]]
-+ ; M3: dsrlv $[[T7:[0-9]+]], $[[T5]], $[[T6]]
-+ ; M3: or $2, $[[T4]], $[[T7]]
-+ ; M3: $[[BB0]]:
-+ ; M3: bnez $[[T3]], $[[BB1:BB[0-9_]+]]
-+ ; M3: daddiu $3, $zero, 0
-+ ; M3: move $3, $[[T1]]
-+ ; M3: $[[BB1]]:
-+ ; M3: jr $ra
-+ ; M3: nop
-+
-+ ; GP64-NOT-R6: sll $[[T0:[0-9]+]], $7, 0
-+ ; GP64-NOT-R6: dsllv $[[T1:[0-9]+]], $4, $[[T0]]
-+ ; GP64-NOT-R6: dsrl $[[T2:[0-9]+]], $5, 1
-+ ; GP64-NOT-R6: not $[[T3:[0-9]+]], $[[T0]]
-+ ; GP64-NOT-R6: dsrlv $[[T4:[0-9]+]], $[[T2]], $[[T3]]
-+ ; GP64-NOT-R6: or $2, $[[T1]], $[[T4]]
-+ ; GP64-NOT-R6: dsllv $3, $5, $[[T0]]
-+ ; GP64-NOT-R6: andi $[[T5:[0-9]+]], $[[T0]], 32
-+ ; GP64-NOT-R6: movn $2, $3, $[[T5]]
-+ ; GP64-NOT-R6: jr $ra
-+ ; GP64-NOT-R6: movn $3, $zero, $1
-+
-+ ; 64R6: sll $[[T0:[0-9]+]], $7, 0
-+ ; 64R6: dsllv $[[T1:[0-9]+]], $4, $[[T0]]
-+ ; 64R6: dsrl $[[T2:[0-9]+]], $5, 1
-+ ; 64R6: not $[[T3:[0-9]+]], $[[T0]]
-+ ; 64R6: dsrlv $[[T4:[0-9]+]], $[[T2]], $[[T3]]
-+ ; 64R6: or $[[T5:[0-9]+]], $[[T1]], $[[T4]]
-+ ; 64R6: andi $[[T6:[0-9]+]], $[[T0]], 32
-+ ; 64R6: sll $[[T7:[0-9]+]], $[[T6]], 0
-+ ; 64R6: seleqz $[[T8:[0-9]+]], $[[T5]], $[[T7]]
-+ ; 64R6: dsllv $[[T9:[0-9]+]], $5, $[[T0]]
-+ ; 64R6: selnez $[[T10:[0-9]+]], $[[T9]], $[[T7]]
-+ ; 64R6: or $2, $[[T10]], $[[T8]]
-+ ; 64R6: jr $ra
-+ ; 64R6: seleqz $3, $[[T0]], $[[T7]]
-+
-+ %r = shl i128 %a, %b
-+ ret i128 %r
-+}
-Index: test/CodeGen/Mips/llvm-ir/srem.ll
-===================================================================
---- test/CodeGen/Mips/llvm-ir/srem.ll
-+++ test/CodeGen/Mips/llvm-ir/srem.ll
-@@ -0,0 +1,129 @@
-+; RUN: llc < %s -march=mips -mcpu=mips2 | FileCheck %s \
-+; RUN: -check-prefix=GP32 -check-prefix=NOT-R6 -check-prefix=NOT-R2-R6
-+; RUN: llc < %s -march=mips -mcpu=mips32 | FileCheck %s \
-+; RUN: -check-prefix=GP32 -check-prefix=NOT-R6 -check-prefix=NOT-R2-R6
-+; RUN: llc < %s -march=mips -mcpu=mips32r2 | FileCheck %s -check-prefix=GP32 \
-+; RUN: -check-prefix=R2 -check-prefix=R2-R6 -check-prefix=NOT-R6
-+; RUN: llc < %s -march=mips -mcpu=mips32r6 | FileCheck %s \
-+; RUN: -check-prefix=GP32 -check-prefix=R6 -check-prefix=R2-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips3 | FileCheck %s \
-+; RUN: -check-prefix=GP64-NOT-R6 -check-prefix=NOT-R6 -check-prefix=NOT-R2-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips4 | FileCheck %s \
-+; RUN: -check-prefix=GP64-NOT-R6 -check-prefix=NOT-R6 -check-prefix=NOT-R2-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips64 | FileCheck %s \
-+; RUN: -check-prefix=GP64-NOT-R6 -check-prefix=NOT-R6 -check-prefix=NOT-R2-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r2 | FileCheck %s \
-+; RUN: -check-prefix=R2 -check-prefix=R2-R6 \
-+; RUN: -check-prefix=GP64-NOT-R6 -check-prefix=NOT-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r6 | FileCheck %s \
-+; RUN: -check-prefix=64R6 -check-prefix=R6 -check-prefix=R2-R6
-+
-+define signext i1 @srem_i1(i1 signext %a, i1 signext %b) {
-+entry:
-+; ALL-LABEL: srem_i1:
-+
-+ ; NOT-R6: div $zero, $4, $5
-+ ; NOT-R6: teq $5, $zero, 7
-+ ; NOT-R6: mfhi $[[T0:[0-9]+]]
-+ ; NOT-R6: sll $[[T1:[0-9]+]], $[[T0]], 31
-+ ; NOT-R6: sra $2, $[[T1]], 31
-+
-+ ; R6: mod $[[T0:[0-9]+]], $4, $5
-+ ; R6: teq $5, $zero, 7
-+ ; R6: sll $[[T3:[0-9]+]], $[[T0]], 31
-+ ; R6: sra $2, $[[T3]], 31
-+
-+ %r = srem i1 %a, %b
-+ ret i1 %r
-+}
-+
-+define signext i8 @srem_i8(i8 signext %a, i8 signext %b) {
-+entry:
-+; ALL-LABEL: srem_i8:
-+
-+ ; NOT-R2-R6: div $zero, $4, $5
-+ ; NOT-R2-R6: teq $5, $zero, 7
-+ ; NOT-R2-R6: mfhi $[[T0:[0-9]+]]
-+ ; NOT-R2-R6: sll $[[T1:[0-9]+]], $[[T0]], 24
-+ ; NOT-R2-R6: sra $2, $[[T1]], 24
-+
-+ ; R2: div $zero, $4, $5
-+ ; R2: teq $5, $zero, 7
-+ ; R2: mfhi $[[T0:[0-9]+]]
-+ ; R2: seb $2, $[[T0]]
-+
-+ ; R6: mod $[[T0:[0-9]+]], $4, $5
-+ ; R6: teq $5, $zero, 7
-+ ; R6: seb $2, $[[T0]]
-+
-+ %r = srem i8 %a, %b
-+ ret i8 %r
-+}
-+
-+define signext i16 @srem_i16(i16 signext %a, i16 signext %b) {
-+entry:
-+; ALL-LABEL: srem_i16:
-+
-+ ; NOT-R2-R6: div $zero, $4, $5
-+ ; NOT-R2-R6: teq $5, $zero, 7
-+ ; NOT-R2-R6: mfhi $[[T0:[0-9]+]]
-+ ; NOT-R2-R6: sll $[[T1:[0-9]+]], $[[T0]], 16
-+ ; NOT-R2-R6: sra $2, $[[T1]], 16
-+
-+ ; R2: div $zero, $4, $5
-+ ; R2: teq $5, $zero, 7
-+ ; R2: mfhi $[[T0:[0-9]+]]
-+ ; R2: seh $2, $[[T1]]
-+
-+ ; R6: mod $[[T0:[0-9]+]], $4, $5
-+ ; R6: teq $5, $zero, 7
-+ ; R6: seh $2, $[[T0]]
-+
-+ %r = srem i16 %a, %b
-+ ret i16 %r
-+}
-+
-+define signext i32 @srem_i32(i32 signext %a, i32 signext %b) {
-+entry:
-+; ALL-LABEL: srem_i32:
-+
-+ ; NOT-R6: div $zero, $4, $5
-+ ; NOT-R6: teq $5, $zero, 7
-+ ; NOT-R6: mfhi $2
-+
-+ ; R6: mod $2, $4, $5
-+ ; R6: teq $5, $zero, 7
-+
-+ %r = srem i32 %a, %b
-+ ret i32 %r
-+}
-+
-+define signext i64 @srem_i64(i64 signext %a, i64 signext %b) {
-+entry:
-+; ALL-LABEL: srem_i64:
-+
-+ ; GP32: lw $25, %call16(__moddi3)($gp)
-+
-+ ; GP64-NOT-R6: ddiv $zero, $4, $5
-+ ; GP64-NOT-R6: teq $5, $zero, 7
-+ ; GP64-NOT-R6: mfhi $2
-+
-+ ; 64R6: dmod $2, $4, $5
-+ ; 64R6: teq $5, $zero, 7
-+
-+ %r = srem i64 %a, %b
-+ ret i64 %r
-+}
-+
-+define signext i128 @srem_i128(i128 signext %a, i128 signext %b) {
-+entry:
-+; ALL-LABEL: srem_i128:
-+
-+ ; GP32: lw $25, %call16(__modti3)($gp)
-+
-+ ; GP64-NOT-R6: ld $25, %call16(__modti3)($gp)
-+ ; 64-R6: ld $25, %call16(__modti3)($gp)
-+
-+ %r = srem i128 %a, %b
-+ ret i128 %r
-+}
-Index: test/CodeGen/Mips/llvm-ir/sub.ll
-===================================================================
---- test/CodeGen/Mips/llvm-ir/sub.ll
-+++ test/CodeGen/Mips/llvm-ir/sub.ll
-@@ -0,0 +1,114 @@
-+; RUN: llc < %s -march=mips -mcpu=mips2 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=NOT-R2-R6 -check-prefix=GP32
-+; RUN: llc < %s -march=mips -mcpu=mips32 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=NOT-R2-R6 -check-prefix=GP32
-+; RUN: llc < %s -march=mips -mcpu=mips32r2 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=R2-R6 -check-prefix=GP32
-+; RUN: llc < %s -march=mips -mcpu=mips32r6 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=R2-R6 -check-prefix=GP32
-+; RUN: llc < %s -march=mips64 -mcpu=mips3 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=NOT-R2-R6 -check-prefix=GP64
-+; RUN: llc < %s -march=mips64 -mcpu=mips4 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=NOT-R2-R6 -check-prefix=GP64
-+; RUN: llc < %s -march=mips64 -mcpu=mips64 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=NOT-R2-R6 -check-prefix=GP64
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r2 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=R2-R6 -check-prefix=GP64
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r6 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=R2-R6 -check-prefix=GP64
-+
-+define signext i1 @sub_i1(i1 signext %a, i1 signext %b) {
-+entry:
-+; ALL-LABEL: sub_i1:
-+
-+ ; ALL: subu $[[T0:[0-9]+]], $4, $5
-+ ; ALL: sll $[[T0]], $[[T0]], 31
-+ ; ALL: sra $2, $[[T0]], 31
-+
-+ %r = sub i1 %a, %b
-+ ret i1 %r
-+}
-+
-+define signext i8 @sub_i8(i8 signext %a, i8 signext %b) {
-+entry:
-+; ALL-LABEL: sub_i8:
-+
-+ ; NOT-R2-R6: subu $[[T0:[0-9]+]], $4, $5
-+ ; NOT-R2-R6: sll $[[T0]], $[[T0]], 24
-+ ; NOT-R2-R6: sra $2, $[[T0]], 24
-+
-+ ; R2-R6: subu $[[T0:[0-9]+]], $4, $5
-+ ; R2-R6: seb $2, $[[T0:[0-9]+]]
-+
-+ %r = sub i8 %a, %b
-+ ret i8 %r
-+}
-+
-+define signext i16 @sub_i16(i16 signext %a, i16 signext %b) {
-+entry:
-+; ALL-LABEL: sub_i16:
-+
-+ ; NOT-R2-R6: subu $[[T0:[0-9]+]], $4, $5
-+ ; NOT-R2-R6: sll $[[T0]], $[[T0]], 16
-+ ; NOT-R2-R6: sra $2, $[[T0]], 16
-+
-+ ; R2-R6: subu $[[T0:[0-9]+]], $4, $5
-+ ; R2-R6: seh $2, $[[T0:[0-9]+]]
-+
-+ %r = sub i16 %a, %b
-+ ret i16 %r
-+}
-+
-+define signext i32 @sub_i32(i32 signext %a, i32 signext %b) {
-+entry:
-+; ALL-LABEL: sub_i32:
-+
-+ ; ALL: subu $2, $4, $5
-+
-+ %r = sub i32 %a, %b
-+ ret i32 %r
-+}
-+
-+define signext i64 @sub_i64(i64 signext %a, i64 signext %b) {
-+entry:
-+; ALL-LABEL: sub_i64:
-+
-+ ; GP32: subu $3, $5, $7
-+ ; GP32: sltu $[[T0:[0-9]+]], $5, $7
-+ ; GP32: addu $[[T1:[0-9]+]], $[[T0]], $6
-+ ; GP32: subu $2, $4, $[[T1]]
-+
-+ ; GP64: dsubu $2, $4, $5
-+
-+ %r = sub i64 %a, %b
-+ ret i64 %r
-+}
-+
-+define signext i128 @sub_i128(i128 signext %a, i128 signext %b) {
-+entry:
-+; ALL-LABEL: sub_i128:
-+
-+ ; GP32: lw $[[T0:[0-9]+]], 20($sp)
-+ ; GP32: sltu $[[T1:[0-9]+]], $5, $[[T0]]
-+ ; GP32: lw $[[T2:[0-9]+]], 16($sp)
-+ ; GP32: addu $[[T3:[0-9]+]], $[[T1]], $[[T2]]
-+ ; GP32: lw $[[T4:[0-9]+]], 24($sp)
-+ ; GP32: lw $[[T5:[0-9]+]], 28($sp)
-+ ; GP32: subu $[[T6:[0-9]+]], $7, $[[T5]]
-+ ; GP32: subu $2, $4, $[[T3]]
-+ ; GP32: sltu $[[T8:[0-9]+]], $6, $[[T4]]
-+ ; GP32: addu $[[T9:[0-9]+]], $[[T8]], $[[T0]]
-+ ; GP32: subu $3, $5, $[[T9]]
-+ ; GP32: sltu $[[T10:[0-9]+]], $7, $[[T5]]
-+ ; GP32: addu $[[T11:[0-9]+]], $[[T10]], $[[T4]]
-+ ; GP32: subu $4, $6, $[[T11]]
-+ ; GP32: move $5, $[[T6]]
-+
-+ ; GP64: dsubu $3, $5, $7
-+ ; GP64: sltu $[[T0:[0-9]+]], $5, $7
-+ ; GP64: daddu $[[T1:[0-9]+]], $[[T0]], $6
-+ ; GP64: dsubu $2, $4, $[[T1]]
-+
-+ %r = sub i128 %a, %b
-+ ret i128 %r
-+}
-Index: test/CodeGen/Mips/llvm-ir/udiv.ll
-===================================================================
---- test/CodeGen/Mips/llvm-ir/udiv.ll
-+++ test/CodeGen/Mips/llvm-ir/udiv.ll
-@@ -0,0 +1,108 @@
-+; RUN: llc < %s -march=mips -mcpu=mips2 | FileCheck %s \
-+; RUN: -check-prefix=NOT-R6 -check-prefix=GP32
-+; RUN: llc < %s -march=mips -mcpu=mips32 | FileCheck %s \
-+; RUN: -check-prefix=NOT-R6 -check-prefix=GP32
-+; RUN: llc < %s -march=mips -mcpu=mips32r2 | FileCheck %s \
-+; RUN: -check-prefix=NOT-R6 -check-prefix=GP32
-+; RUN: llc < %s -march=mips -mcpu=mips32r6 | FileCheck %s \
-+; RUN: -check-prefix=R6 -check-prefix=GP32
-+; RUN: llc < %s -march=mips64 -mcpu=mips3 | FileCheck %s \
-+; RUN: -check-prefix=NOT-R6 -check-prefix=GP64-NOT-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips4 | FileCheck %s \
-+; RUN: -check-prefix=NOT-R6 -check-prefix=GP64-NOT-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips64 | FileCheck %s \
-+; RUN: -check-prefix=NOT-R6 -check-prefix=GP64-NOT-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r2 | FileCheck %s \
-+; RUN: -check-prefix=NOT-R6 -check-prefix=GP64-NOT-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r6 | FileCheck %s \
-+; RUN: -check-prefix=R6 -check-prefix=64R6
-+
-+define zeroext i1 @udiv_i1(i1 zeroext %a, i1 zeroext %b) {
-+entry:
-+; ALL-LABEL: udiv_i1:
-+
-+ ; NOT-R6: divu $zero, $4, $5
-+ ; NOT-R6: teq $5, $zero, 7
-+ ; NOT-R6: mflo $2
-+
-+ ; R6: divu $2, $4, $5
-+ ; R6: teq $5, $zero, 7
-+
-+ %r = udiv i1 %a, %b
-+ ret i1 %r
-+}
-+
-+define zeroext i8 @udiv_i8(i8 zeroext %a, i8 zeroext %b) {
-+entry:
-+; ALL-LABEL: udiv_i8:
-+
-+ ; NOT-R6: divu $zero, $4, $5
-+ ; NOT-R6: teq $5, $zero, 7
-+ ; NOT-R6: mflo $2
-+
-+ ; R6: divu $2, $4, $5
-+ ; R6: teq $5, $zero, 7
-+
-+ %r = udiv i8 %a, %b
-+ ret i8 %r
-+}
-+
-+define zeroext i16 @udiv_i16(i16 zeroext %a, i16 zeroext %b) {
-+entry:
-+; ALL-LABEL: udiv_i16:
-+
-+ ; NOT-R6: divu $zero, $4, $5
-+ ; NOT-R6: teq $5, $zero, 7
-+ ; NOT-R6: mflo $2
-+
-+ ; R6: divu $2, $4, $5
-+ ; R6: teq $5, $zero, 7
-+
-+ %r = udiv i16 %a, %b
-+ ret i16 %r
-+}
-+
-+define signext i32 @udiv_i32(i32 signext %a, i32 signext %b) {
-+entry:
-+; ALL-LABEL: udiv_i32:
-+
-+ ; NOT-R6: divu $zero, $4, $5
-+ ; NOT-R6: teq $5, $zero, 7
-+ ; NOT-R6: mflo $2
-+
-+ ; R6: divu $2, $4, $5
-+ ; R6: teq $5, $zero, 7
-+
-+ %r = udiv i32 %a, %b
-+ ret i32 %r
-+}
-+
-+define signext i64 @udiv_i64(i64 signext %a, i64 signext %b) {
-+entry:
-+; ALL-LABEL: udiv_i64:
-+
-+ ; GP32: lw $25, %call16(__udivdi3)($gp)
-+
-+ ; GP64-NOT-R6: ddivu $zero, $4, $5
-+ ; GP64-NOT-R6: teq $5, $zero, 7
-+ ; GP64-NOT-R6: mflo $2
-+
-+ ; 64R6: ddivu $2, $4, $5
-+ ; 64R6: teq $5, $zero, 7
-+
-+ %r = udiv i64 %a, %b
-+ ret i64 %r
-+}
-+
-+define signext i128 @udiv_i128(i128 signext %a, i128 signext %b) {
-+entry:
-+; ALL-LABEL: udiv_i128:
-+
-+ ; GP32: lw $25, %call16(__udivti3)($gp)
-+
-+ ; GP64-NOT-R6: ld $25, %call16(__udivti3)($gp)
-+ ; 64-R6: ld $25, %call16(__udivti3)($gp)
-+
-+ %r = udiv i128 %a, %b
-+ ret i128 %r
-+}
-Index: test/CodeGen/Mips/llvm-ir/urem.ll
-===================================================================
---- test/CodeGen/Mips/llvm-ir/urem.ll
-+++ test/CodeGen/Mips/llvm-ir/urem.ll
-@@ -0,0 +1,145 @@
-+; RUN: llc < %s -march=mips -mcpu=mips2 | FileCheck %s \
-+; RUN: -check-prefix=GP32 -check-prefix=NOT-R6 -check-prefix=NOT-R2-R6
-+; RUN: llc < %s -march=mips -mcpu=mips32 | FileCheck %s \
-+; RUN: -check-prefix=GP32 -check-prefix=NOT-R6 -check-prefix=NOT-R2-R6
-+; RUN: llc < %s -march=mips -mcpu=mips32r2 | FileCheck %s -check-prefix=GP32 \
-+; RUN: -check-prefix=R2 -check-prefix=R2-R6 -check-prefix=NOT-R6
-+; RUN: llc < %s -march=mips -mcpu=mips32r6 | FileCheck %s \
-+; RUN: -check-prefix=GP32 -check-prefix=R6 -check-prefix=R2-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips3 | FileCheck %s \
-+; RUN: -check-prefix=GP64-NOT-R6 -check-prefix=NOT-R6 -check-prefix=NOT-R2-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips4 | FileCheck %s \
-+; RUN: -check-prefix=GP64-NOT-R6 -check-prefix=NOT-R6 -check-prefix=NOT-R2-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips64 | FileCheck %s \
-+; RUN: -check-prefix=GP64-NOT-R6 -check-prefix=NOT-R6 -check-prefix=NOT-R2-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r2 | FileCheck %s \
-+; RUN: -check-prefix=R2 -check-prefix=R2-R6 \
-+; RUN: -check-prefix=GP64-NOT-R6 -check-prefix=NOT-R6
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r6 | FileCheck %s \
-+; RUN: -check-prefix=64R6 -check-prefix=R6 -check-prefix=R2-R6
-+
-+define signext i1 @urem_i1(i1 signext %a, i1 signext %b) {
-+entry:
-+; ALL-LABEL: urem_i1:
-+
-+ ; NOT-R6: andi $[[T0:[0-9]+]], $5, 1
-+ ; NOT-R6: andi $[[T1:[0-9]+]], $4, 1
-+ ; NOT-R6: divu $zero, $[[T1]], $[[T0]]
-+ ; NOT-R6: teq $[[T0]], $zero, 7
-+ ; NOT-R6: mfhi $[[T2:[0-9]+]]
-+ ; NOT-R6: sll $[[T3:[0-9]+]], $[[T2]], 31
-+ ; NOT-R6: sra $2, $[[T3]], 31
-+
-+ ; R6: andi $[[T0:[0-9]+]], $5, 1
-+ ; R6: andi $[[T1:[0-9]+]], $4, 1
-+ ; R6: modu $[[T2:[0-9]+]], $[[T1]], $[[T0]]
-+ ; R6: teq $[[T0]], $zero, 7
-+ ; R6: sll $[[T3:[0-9]+]], $[[T2]], 31
-+ ; R6: sra $2, $[[T3]], 31
-+
-+ %r = urem i1 %a, %b
-+ ret i1 %r
-+}
-+
-+define signext i8 @urem_i8(i8 signext %a, i8 signext %b) {
-+entry:
-+; ALL-LABEL: urem_i8:
-+
-+ ; NOT-R2-R6: andi $[[T0:[0-9]+]], $5, 255
-+ ; NOT-R2-R6: andi $[[T1:[0-9]+]], $4, 255
-+ ; NOT-R2-R6: divu $zero, $[[T1]], $[[T0]]
-+ ; NOT-R2-R6: teq $[[T0]], $zero, 7
-+ ; NOT-R2-R6: mfhi $[[T2:[0-9]+]]
-+ ; NOT-R2-R6: sll $[[T3:[0-9]+]], $[[T2]], 24
-+ ; NOT-R2-R6: sra $2, $[[T3]], 24
-+
-+ ; R2: andi $[[T0:[0-9]+]], $5, 255
-+ ; R2: andi $[[T1:[0-9]+]], $4, 255
-+ ; R2: divu $zero, $[[T1]], $[[T0]]
-+ ; R2: teq $[[T0]], $zero, 7
-+ ; R2: mfhi $[[T2:[0-9]+]]
-+ ; R2: seb $2, $[[T2]]
-+
-+ ; R6: andi $[[T0:[0-9]+]], $5, 255
-+ ; R6: andi $[[T1:[0-9]+]], $4, 255
-+ ; R6: modu $[[T2:[0-9]+]], $[[T1]], $[[T0]]
-+ ; R6: teq $[[T0]], $zero, 7
-+ ; R6: seb $2, $[[T2]]
-+
-+ %r = urem i8 %a, %b
-+ ret i8 %r
-+}
-+
-+define signext i16 @urem_i16(i16 signext %a, i16 signext %b) {
-+entry:
-+; ALL-LABEL: urem_i16:
-+
-+ ; NOT-R2-R6: andi $[[T0:[0-9]+]], $5, 65535
-+ ; NOT-R2-R6: andi $[[T1:[0-9]+]], $4, 65535
-+ ; NOT-R2-R6: divu $zero, $[[T1]], $[[T0]]
-+ ; NOT-R2-R6: teq $[[T0]], $zero, 7
-+ ; NOT-R2-R6: mfhi $[[T2:[0-9]+]]
-+ ; NOT-R2-R6: sll $[[T3:[0-9]+]], $[[T2]], 16
-+ ; NOT-R2-R6: sra $2, $[[T3]], 16
-+
-+ ; R2: andi $[[T0:[0-9]+]], $5, 65535
-+ ; R2: andi $[[T1:[0-9]+]], $4, 65535
-+ ; R2: divu $zero, $[[T1]], $[[T0]]
-+ ; R2: teq $[[T0]], $zero, 7
-+ ; R2: mfhi $[[T3:[0-9]+]]
-+ ; R2: seh $2, $[[T2]]
-+
-+ ; R6: andi $[[T0:[0-9]+]], $5, 65535
-+ ; R6: andi $[[T1:[0-9]+]], $4, 65535
-+ ; R6: modu $[[T2:[0-9]+]], $[[T1]], $[[T0]]
-+ ; R6: teq $[[T0]], $zero, 7
-+ ; R6: seh $2, $[[T2]]
-+
-+ %r = urem i16 %a, %b
-+ ret i16 %r
-+}
-+
-+define signext i32 @urem_i32(i32 signext %a, i32 signext %b) {
-+entry:
-+; ALL-LABEL: urem_i32:
-+
-+ ; NOT-R6: divu $zero, $4, $5
-+ ; NOT-R6: teq $5, $zero, 7
-+ ; NOT-R6: mfhi $2
-+
-+ ; R6: modu $2, $4, $5
-+ ; R6: teq $5, $zero, 7
-+
-+ %r = urem i32 %a, %b
-+ ret i32 %r
-+}
-+
-+define signext i64 @urem_i64(i64 signext %a, i64 signext %b) {
-+entry:
-+; ALL-LABEL: urem_i64:
-+
-+ ; GP32: lw $25, %call16(__umoddi3)($gp)
-+
-+ ; GP64-NOT-R6: ddivu $zero, $4, $5
-+ ; GP64-NOT-R6: teq $5, $zero, 7
-+ ; GP64-NOT-R6: mfhi $2
-+
-+ ; 64R6: dmodu $2, $4, $5
-+ ; 64R6: teq $5, $zero, 7
-+
-+ %r = urem i64 %a, %b
-+ ret i64 %r
-+}
-+
-+define signext i128 @urem_i128(i128 signext %a, i128 signext %b) {
-+entry:
-+ ; ALL-LABEL: urem_i128:
-+
-+ ; GP32: lw $25, %call16(__umodti3)($gp)
-+
-+ ; GP64-NOT-R6: ld $25, %call16(__umodti3)($gp)
-+ ; 64-R6: ld $25, %call16(__umodti3)($gp)
-+
-+ %r = urem i128 %a, %b
-+ ret i128 %r
-+}
-Index: test/CodeGen/Mips/llvm-ir/xor.ll
-===================================================================
---- test/CodeGen/Mips/llvm-ir/xor.ll
-+++ test/CodeGen/Mips/llvm-ir/xor.ll
-@@ -0,0 +1,94 @@
-+; RUN: llc < %s -march=mips -mcpu=mips2 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP32
-+; RUN: llc < %s -march=mips -mcpu=mips32 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP32
-+; RUN: llc < %s -march=mips -mcpu=mips32r2 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP32
-+; RUN: llc < %s -march=mips -mcpu=mips32r6 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP32
-+; RUN: llc < %s -march=mips64 -mcpu=mips3 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64
-+; RUN: llc < %s -march=mips64 -mcpu=mips4 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64
-+; RUN: llc < %s -march=mips64 -mcpu=mips64 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r2 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64
-+; RUN: llc < %s -march=mips64 -mcpu=mips64r6 | FileCheck %s \
-+; RUN: -check-prefix=ALL -check-prefix=GP64
-+
-+define signext i1 @xor_i1(i1 signext %a, i1 signext %b) {
-+entry:
-+; ALL-LABEL: xor_i1:
-+
-+ ; ALL: xor $2, $4, $5
-+
-+ %r = xor i1 %a, %b
-+ ret i1 %r
-+}
-+
-+define signext i8 @xor_i8(i8 signext %a, i8 signext %b) {
-+entry:
-+; ALL-LABEL: xor_i8:
-+
-+ ; ALL: xor $2, $4, $5
-+
-+ %r = xor i8 %a, %b
-+ ret i8 %r
-+}
-+
-+define signext i16 @xor_i16(i16 signext %a, i16 signext %b) {
-+entry:
-+; ALL-LABEL: xor_i16:
-+
-+ ; ALL: xor $2, $4, $5
-+
-+ %r = xor i16 %a, %b
-+ ret i16 %r
-+}
-+
-+define signext i32 @xor_i32(i32 signext %a, i32 signext %b) {
-+entry:
-+; ALL-LABEL: xor_i32:
-+
-+ ; GP32: xor $2, $4, $5
-+
-+ ; GP64: xor $[[T0:[0-9]+]], $4, $5
-+ ; GP64: sll $2, $[[T0]], 0
-+
-+ %r = xor i32 %a, %b
-+ ret i32 %r
-+}
-+
-+define signext i64 @xor_i64(i64 signext %a, i64 signext %b) {
-+entry:
-+; ALL-LABEL: xor_i64:
-+
-+ ; GP32: xor $2, $4, $6
-+ ; GP32: xor $3, $5, $7
-+
-+ ; GP64: xor $2, $4, $5
-+
-+ %r = xor i64 %a, %b
-+ ret i64 %r
-+}
-+
-+define signext i128 @xor_i128(i128 signext %a, i128 signext %b) {
-+entry:
-+; ALL-LABEL: xor_i128:
-+
-+ ; GP32: lw $[[T0:[0-9]+]], 24($sp)
-+ ; GP32: lw $[[T1:[0-9]+]], 20($sp)
-+ ; GP32: lw $[[T2:[0-9]+]], 16($sp)
-+ ; GP32: xor $2, $4, $[[T2]]
-+ ; GP32: xor $3, $5, $[[T1]]
-+ ; GP32: xor $4, $6, $[[T0]]
-+ ; GP32: lw $[[T3:[0-9]+]], 28($sp)
-+ ; GP32: xor $5, $7, $[[T3]]
-+
-+ ; GP64: xor $2, $4, $6
-+ ; GP64: xor $3, $5, $7
-+
-+ %r = xor i128 %a, %b
-+ ret i128 %r
-+}
diff --git a/contrib/llvm/patches/patch-10-llvm-r230348-arm-fix-bad-ha.diff b/contrib/llvm/patches/patch-08-llvm-r230348-arm-fix-bad-ha.diff
index 64c558e..2896899 100644
--- a/contrib/llvm/patches/patch-10-llvm-r230348-arm-fix-bad-ha.diff
+++ b/contrib/llvm/patches/patch-08-llvm-r230348-arm-fix-bad-ha.diff
@@ -67,7 +67,7 @@ Index: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
}
}
-@@ -7696,11 +7696,8 @@ void SelectionDAGISel::LowerArguments(const Functi
+@@ -7697,11 +7697,8 @@ void SelectionDAGISel::LowerArguments(const Functi
}
if (F.getAttributes().hasAttribute(Idx, Attribute::Nest))
Flags.setNest();
@@ -80,7 +80,7 @@ Index: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
Flags.setOrigAlign(OriginalAlignment);
MVT RegisterVT = TLI->getRegisterType(*CurDAG->getContext(), VT);
-@@ -7715,6 +7712,8 @@ void SelectionDAGISel::LowerArguments(const Functi
+@@ -7716,6 +7713,8 @@ void SelectionDAGISel::LowerArguments(const Functi
MyFlags.Flags.setOrigAlign(1);
Ins.push_back(MyFlags);
}
@@ -287,7 +287,7 @@ Index: lib/Target/ARM/ARMISelLowering.cpp
===================================================================
--- lib/Target/ARM/ARMISelLowering.cpp
+++ lib/Target/ARM/ARMISelLowering.cpp
-@@ -11280,7 +11280,9 @@ static bool isHomogeneousAggregate(Type *Ty, HABas
+@@ -11285,7 +11285,9 @@ static bool isHomogeneousAggregate(Type *Ty, HABas
return (Members > 0 && Members <= 4);
}
@@ -298,7 +298,7 @@ Index: lib/Target/ARM/ARMISelLowering.cpp
bool ARMTargetLowering::functionArgumentNeedsConsecutiveRegisters(
Type *Ty, CallingConv::ID CallConv, bool isVarArg) const {
if (getEffectiveCallingConv(CallConv, isVarArg) !=
-@@ -11289,7 +11291,9 @@ bool ARMTargetLowering::functionArgumentNeedsConse
+@@ -11294,7 +11296,9 @@ bool ARMTargetLowering::functionArgumentNeedsConse
HABaseType Base = HA_UNKNOWN;
uint64_t Members = 0;
diff --git a/contrib/llvm/patches/patch-12-clang-r227115-constantarraytype.diff b/contrib/llvm/patches/patch-09-clang-r227115-constantarraytype.diff
index 33ca358..33ca358 100644
--- a/contrib/llvm/patches/patch-12-clang-r227115-constantarraytype.diff
+++ b/contrib/llvm/patches/patch-09-clang-r227115-constantarraytype.diff
diff --git a/contrib/llvm/patches/patch-09-llvm-r230058-indirectbrs-assert.diff b/contrib/llvm/patches/patch-09-llvm-r230058-indirectbrs-assert.diff
deleted file mode 100644
index 1d31c28..0000000
--- a/contrib/llvm/patches/patch-09-llvm-r230058-indirectbrs-assert.diff
+++ /dev/null
@@ -1,55 +0,0 @@
-Pull in r230058 from upstream llvm trunk (by Benjamin Kramer):
-
- LoopRotate: When reconstructing loop simplify form don't split edges
- from indirectbrs.
-
- Yet another chapter in the endless story. While this looks like we
- leave the loop in a non-canonical state this replicates the logic in
- LoopSimplify so it doesn't diverge from the canonical form in any way.
-
- PR21968
-
-This fixes a "Cannot split critical edge from IndirectBrInst" assertion
-failure when building the devel/radare2 port.
-
-Introduced here: https://svnweb.freebsd.org/changeset/base/279161
-
-Index: lib/Transforms/Scalar/LoopRotation.cpp
-===================================================================
---- lib/Transforms/Scalar/LoopRotation.cpp
-+++ lib/Transforms/Scalar/LoopRotation.cpp
-@@ -535,6 +535,8 @@ bool LoopRotate::rotateLoop(Loop *L, bool Simplifi
- Loop *PredLoop = LI->getLoopFor(*PI);
- if (!PredLoop || PredLoop->contains(Exit))
- continue;
-+ if (isa<IndirectBrInst>((*PI)->getTerminator()))
-+ continue;
- SplitLatchEdge |= L->getLoopLatch() == *PI;
- BasicBlock *ExitSplit = SplitCriticalEdge(*PI, Exit, this);
- ExitSplit->moveBefore(Exit);
-Index: test/Transforms/LoopRotate/crash.ll
-===================================================================
---- test/Transforms/LoopRotate/crash.ll
-+++ test/Transforms/LoopRotate/crash.ll
-@@ -153,3 +153,21 @@ entry:
- "5": ; preds = %"3", %entry
- ret void
- }
-+
-+; PR21968
-+define void @test8(i1 %C, i8* %P) #0 {
-+entry:
-+ br label %for.cond
-+
-+for.cond: ; preds = %for.inc, %entry
-+ br i1 %C, label %l_bad, label %for.body
-+
-+for.body: ; preds = %for.cond
-+ indirectbr i8* %P, [label %for.inc, label %l_bad]
-+
-+for.inc: ; preds = %for.body
-+ br label %for.cond
-+
-+l_bad: ; preds = %for.body, %for.cond
-+ ret void
-+}
diff --git a/contrib/llvm/patches/patch-11-llvm-r231227-aarch64-tls-relocs.diff b/contrib/llvm/patches/patch-11-llvm-r231227-aarch64-tls-relocs.diff
deleted file mode 100644
index 5c0edca..0000000
--- a/contrib/llvm/patches/patch-11-llvm-r231227-aarch64-tls-relocs.diff
+++ /dev/null
@@ -1,811 +0,0 @@
-Pull in r231227 from upstream llvm trunk (by Kristof Beyls):
-
- Fix PR22408 - LLVM producing AArch64 TLS relocations that GNU linkers
- cannot handle yet.
-
- As is described at http://llvm.org/bugs/show_bug.cgi?id=22408, the
- GNU linkers ld.bfd and ld.gold currently only support a subset of the
- whole range of AArch64 ELF TLS relocations. Furthermore, they assume
- that some of the code sequences to access thread-local variables are
- produced in a very specific sequence. When the sequence is not as the
- linker expects, it can silently mis-relaxe/mis-optimize the
- instructions.
- Even if that wouldn't be the case, it's good to produce the exact
- sequence, as that ensures that linkers can perform optimizing
- relaxations.
-
- This patch:
-
- * implements support for 16MiB TLS area size instead of 4GiB TLS area
- size. Ideally clang would grow an -mtls-size option to allow
- support for both, but that's not part of this patch.
- * by default doesn't produce local dynamic access patterns, as even
- modern ld.bfd and ld.gold linkers do not support the associated
- relocations. An option (-aarch64-elf-ldtls-generation) is added to
- enable generation of local dynamic code sequence, but is off by
- default.
- * makes sure that the exact expected code sequence for local dynamic
- and general dynamic accesses is produced, by making use of a new
- pseudo instruction. The patch also removes two
- (AArch64ISD::TLSDESC_BLR, AArch64ISD::TLSDESC_CALL) pre-existing
- AArch64-specific pseudo SDNode instructions that are superseded by
- the new one (TLSDESC_CALLSEQ).
-
-Introduced here: https://svnweb.freebsd.org/changeset/base/280865
-
-Index: lib/Target/AArch64/AArch64AsmPrinter.cpp
-===================================================================
---- lib/Target/AArch64/AArch64AsmPrinter.cpp
-+++ lib/Target/AArch64/AArch64AsmPrinter.cpp
-@@ -12,6 +12,8 @@
- //
- //===----------------------------------------------------------------------===//
-
-+#include "MCTargetDesc/AArch64AddressingModes.h"
-+#include "MCTargetDesc/AArch64MCExpr.h"
- #include "AArch64.h"
- #include "AArch64MCInstLower.h"
- #include "AArch64MachineFunctionInfo.h"
-@@ -494,12 +496,47 @@ void AArch64AsmPrinter::EmitInstruction(const Mach
- EmitToStreamer(OutStreamer, TmpInst);
- return;
- }
-- case AArch64::TLSDESC_BLR: {
-- MCOperand Callee, Sym;
-- MCInstLowering.lowerOperand(MI->getOperand(0), Callee);
-- MCInstLowering.lowerOperand(MI->getOperand(1), Sym);
-+ case AArch64::TLSDESC_CALLSEQ: {
-+ /// lower this to:
-+ /// adrp x0, :tlsdesc:var
-+ /// ldr x1, [x0, #:tlsdesc_lo12:var]
-+ /// add x0, x0, #:tlsdesc_lo12:var
-+ /// .tlsdesccall var
-+ /// blr x1
-+ /// (TPIDR_EL0 offset now in x0)
-+ const MachineOperand &MO_Sym = MI->getOperand(0);
-+ MachineOperand MO_TLSDESC_LO12(MO_Sym), MO_TLSDESC(MO_Sym);
-+ MCOperand Sym, SymTLSDescLo12, SymTLSDesc;
-+ MO_TLSDESC_LO12.setTargetFlags(AArch64II::MO_TLS | AArch64II::MO_PAGEOFF |
-+ AArch64II::MO_NC);
-+ MO_TLSDESC.setTargetFlags(AArch64II::MO_TLS | AArch64II::MO_PAGE);
-+ MCInstLowering.lowerOperand(MO_Sym, Sym);
-+ MCInstLowering.lowerOperand(MO_TLSDESC_LO12, SymTLSDescLo12);
-+ MCInstLowering.lowerOperand(MO_TLSDESC, SymTLSDesc);
-
-- // First emit a relocation-annotation. This expands to no code, but requests
-+ MCInst Adrp;
-+ Adrp.setOpcode(AArch64::ADRP);
-+ Adrp.addOperand(MCOperand::CreateReg(AArch64::X0));
-+ Adrp.addOperand(SymTLSDesc);
-+ EmitToStreamer(OutStreamer, Adrp);
-+
-+ MCInst Ldr;
-+ Ldr.setOpcode(AArch64::LDRXui);
-+ Ldr.addOperand(MCOperand::CreateReg(AArch64::X1));
-+ Ldr.addOperand(MCOperand::CreateReg(AArch64::X0));
-+ Ldr.addOperand(SymTLSDescLo12);
-+ Ldr.addOperand(MCOperand::CreateImm(0));
-+ EmitToStreamer(OutStreamer, Ldr);
-+
-+ MCInst Add;
-+ Add.setOpcode(AArch64::ADDXri);
-+ Add.addOperand(MCOperand::CreateReg(AArch64::X0));
-+ Add.addOperand(MCOperand::CreateReg(AArch64::X0));
-+ Add.addOperand(SymTLSDescLo12);
-+ Add.addOperand(MCOperand::CreateImm(AArch64_AM::getShiftValue(0)));
-+ EmitToStreamer(OutStreamer, Add);
-+
-+ // Emit a relocation-annotation. This expands to no code, but requests
- // the following instruction gets an R_AARCH64_TLSDESC_CALL.
- MCInst TLSDescCall;
- TLSDescCall.setOpcode(AArch64::TLSDESCCALL);
-@@ -506,12 +543,10 @@ void AArch64AsmPrinter::EmitInstruction(const Mach
- TLSDescCall.addOperand(Sym);
- EmitToStreamer(OutStreamer, TLSDescCall);
-
-- // Other than that it's just a normal indirect call to the function loaded
-- // from the descriptor.
-- MCInst BLR;
-- BLR.setOpcode(AArch64::BLR);
-- BLR.addOperand(Callee);
-- EmitToStreamer(OutStreamer, BLR);
-+ MCInst Blr;
-+ Blr.setOpcode(AArch64::BLR);
-+ Blr.addOperand(MCOperand::CreateReg(AArch64::X1));
-+ EmitToStreamer(OutStreamer, Blr);
-
- return;
- }
-Index: lib/Target/AArch64/AArch64CleanupLocalDynamicTLSPass.cpp
-===================================================================
---- lib/Target/AArch64/AArch64CleanupLocalDynamicTLSPass.cpp
-+++ lib/Target/AArch64/AArch64CleanupLocalDynamicTLSPass.cpp
-@@ -62,10 +62,10 @@ struct LDTLSCleanup : public MachineFunctionPass {
- for (MachineBasicBlock::iterator I = BB->begin(), E = BB->end(); I != E;
- ++I) {
- switch (I->getOpcode()) {
-- case AArch64::TLSDESC_BLR:
-+ case AArch64::TLSDESC_CALLSEQ:
- // Make sure it's a local dynamic access.
-- if (!I->getOperand(1).isSymbol() ||
-- strcmp(I->getOperand(1).getSymbolName(), "_TLS_MODULE_BASE_"))
-+ if (!I->getOperand(0).isSymbol() ||
-+ strcmp(I->getOperand(0).getSymbolName(), "_TLS_MODULE_BASE_"))
- break;
-
- if (TLSBaseAddrReg)
-Index: lib/Target/AArch64/AArch64ISelLowering.cpp
-===================================================================
---- lib/Target/AArch64/AArch64ISelLowering.cpp
-+++ lib/Target/AArch64/AArch64ISelLowering.cpp
-@@ -64,10 +64,18 @@ EnableAArch64ExtrGeneration("aarch64-extr-generati
-
- static cl::opt<bool>
- EnableAArch64SlrGeneration("aarch64-shift-insert-generation", cl::Hidden,
-- cl::desc("Allow AArch64 SLI/SRI formation"),
-- cl::init(false));
-+ cl::desc("Allow AArch64 SLI/SRI formation"),
-+ cl::init(false));
-
-+// FIXME: The necessary dtprel relocations don't seem to be supported
-+// well in the GNU bfd and gold linkers at the moment. Therefore, by
-+// default, for now, fall back to GeneralDynamic code generation.
-+cl::opt<bool> EnableAArch64ELFLocalDynamicTLSGeneration(
-+ "aarch64-elf-ldtls-generation", cl::Hidden,
-+ cl::desc("Allow AArch64 Local Dynamic TLS code generation"),
-+ cl::init(false));
-
-+
- AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM)
- : TargetLowering(TM) {
- Subtarget = &TM.getSubtarget<AArch64Subtarget>();
-@@ -760,7 +768,7 @@ const char *AArch64TargetLowering::getTargetNodeNa
- case AArch64ISD::CSNEG: return "AArch64ISD::CSNEG";
- case AArch64ISD::CSINC: return "AArch64ISD::CSINC";
- case AArch64ISD::THREAD_POINTER: return "AArch64ISD::THREAD_POINTER";
-- case AArch64ISD::TLSDESC_CALL: return "AArch64ISD::TLSDESC_CALL";
-+ case AArch64ISD::TLSDESC_CALLSEQ: return "AArch64ISD::TLSDESC_CALLSEQ";
- case AArch64ISD::ADC: return "AArch64ISD::ADC";
- case AArch64ISD::SBC: return "AArch64ISD::SBC";
- case AArch64ISD::ADDS: return "AArch64ISD::ADDS";
-@@ -3049,61 +3057,34 @@ AArch64TargetLowering::LowerDarwinGlobalTLSAddress
- /// When accessing thread-local variables under either the general-dynamic or
- /// local-dynamic system, we make a "TLS-descriptor" call. The variable will
- /// have a descriptor, accessible via a PC-relative ADRP, and whose first entry
--/// is a function pointer to carry out the resolution. This function takes the
--/// address of the descriptor in X0 and returns the TPIDR_EL0 offset in X0. All
--/// other registers (except LR, NZCV) are preserved.
-+/// is a function pointer to carry out the resolution.
- ///
--/// Thus, the ideal call sequence on AArch64 is:
-+/// The sequence is:
-+/// adrp x0, :tlsdesc:var
-+/// ldr x1, [x0, #:tlsdesc_lo12:var]
-+/// add x0, x0, #:tlsdesc_lo12:var
-+/// .tlsdesccall var
-+/// blr x1
-+/// (TPIDR_EL0 offset now in x0)
- ///
--/// adrp x0, :tlsdesc:thread_var
--/// ldr x8, [x0, :tlsdesc_lo12:thread_var]
--/// add x0, x0, :tlsdesc_lo12:thread_var
--/// .tlsdesccall thread_var
--/// blr x8
--/// (TPIDR_EL0 offset now in x0).
--///
--/// The ".tlsdesccall" directive instructs the assembler to insert a particular
--/// relocation to help the linker relax this sequence if it turns out to be too
--/// conservative.
--///
--/// FIXME: we currently produce an extra, duplicated, ADRP instruction, but this
--/// is harmless.
--SDValue AArch64TargetLowering::LowerELFTLSDescCall(SDValue SymAddr,
-- SDValue DescAddr, SDLoc DL,
-- SelectionDAG &DAG) const {
-+/// The above sequence must be produced unscheduled, to enable the linker to
-+/// optimize/relax this sequence.
-+/// Therefore, a pseudo-instruction (TLSDESC_CALLSEQ) is used to represent the
-+/// above sequence, and expanded really late in the compilation flow, to ensure
-+/// the sequence is produced as per above.
-+SDValue AArch64TargetLowering::LowerELFTLSDescCallSeq(SDValue SymAddr, SDLoc DL,
-+ SelectionDAG &DAG) const {
- EVT PtrVT = getPointerTy();
-
-- // The function we need to call is simply the first entry in the GOT for this
-- // descriptor, load it in preparation.
-- SDValue Func = DAG.getNode(AArch64ISD::LOADgot, DL, PtrVT, SymAddr);
-+ SDValue Chain = DAG.getEntryNode();
-+ SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Glue);
-
-- // TLS calls preserve all registers except those that absolutely must be
-- // trashed: X0 (it takes an argument), LR (it's a call) and NZCV (let's not be
-- // silly).
-- const TargetRegisterInfo *TRI =
-- getTargetMachine().getSubtargetImpl()->getRegisterInfo();
-- const AArch64RegisterInfo *ARI =
-- static_cast<const AArch64RegisterInfo *>(TRI);
-- const uint32_t *Mask = ARI->getTLSCallPreservedMask();
--
-- // The function takes only one argument: the address of the descriptor itself
-- // in X0.
-- SDValue Glue, Chain;
-- Chain = DAG.getCopyToReg(DAG.getEntryNode(), DL, AArch64::X0, DescAddr, Glue);
-- Glue = Chain.getValue(1);
--
-- // We're now ready to populate the argument list, as with a normal call:
-- SmallVector<SDValue, 6> Ops;
-+ SmallVector<SDValue, 2> Ops;
- Ops.push_back(Chain);
-- Ops.push_back(Func);
- Ops.push_back(SymAddr);
-- Ops.push_back(DAG.getRegister(AArch64::X0, PtrVT));
-- Ops.push_back(DAG.getRegisterMask(Mask));
-- Ops.push_back(Glue);
-
-- SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Glue);
-- Chain = DAG.getNode(AArch64ISD::TLSDESC_CALL, DL, NodeTys, Ops);
-- Glue = Chain.getValue(1);
-+ Chain = DAG.getNode(AArch64ISD::TLSDESC_CALLSEQ, DL, NodeTys, Ops);
-+ SDValue Glue = Chain.getValue(1);
-
- return DAG.getCopyFromReg(Chain, DL, AArch64::X0, PtrVT, Glue);
- }
-@@ -3114,9 +3095,18 @@ AArch64TargetLowering::LowerELFGlobalTLSAddress(SD
- assert(Subtarget->isTargetELF() && "This function expects an ELF target");
- assert(getTargetMachine().getCodeModel() == CodeModel::Small &&
- "ELF TLS only supported in small memory model");
-+ // Different choices can be made for the maximum size of the TLS area for a
-+ // module. For the small address model, the default TLS size is 16MiB and the
-+ // maximum TLS size is 4GiB.
-+ // FIXME: add -mtls-size command line option and make it control the 16MiB
-+ // vs. 4GiB code sequence generation.
- const GlobalAddressSDNode *GA = cast<GlobalAddressSDNode>(Op);
-
- TLSModel::Model Model = getTargetMachine().getTLSModel(GA->getGlobal());
-+ if (!EnableAArch64ELFLocalDynamicTLSGeneration) {
-+ if (Model == TLSModel::LocalDynamic)
-+ Model = TLSModel::GeneralDynamic;
-+ }
-
- SDValue TPOff;
- EVT PtrVT = getPointerTy();
-@@ -3127,17 +3117,20 @@ AArch64TargetLowering::LowerELFGlobalTLSAddress(SD
-
- if (Model == TLSModel::LocalExec) {
- SDValue HiVar = DAG.getTargetGlobalAddress(
-- GV, DL, PtrVT, 0, AArch64II::MO_TLS | AArch64II::MO_G1);
-+ GV, DL, PtrVT, 0, AArch64II::MO_TLS | AArch64II::MO_HI12);
- SDValue LoVar = DAG.getTargetGlobalAddress(
- GV, DL, PtrVT, 0,
-- AArch64II::MO_TLS | AArch64II::MO_G0 | AArch64II::MO_NC);
-+ AArch64II::MO_TLS | AArch64II::MO_PAGEOFF | AArch64II::MO_NC);
-
-- TPOff = SDValue(DAG.getMachineNode(AArch64::MOVZXi, DL, PtrVT, HiVar,
-- DAG.getTargetConstant(16, MVT::i32)),
-- 0);
-- TPOff = SDValue(DAG.getMachineNode(AArch64::MOVKXi, DL, PtrVT, TPOff, LoVar,
-- DAG.getTargetConstant(0, MVT::i32)),
-- 0);
-+ SDValue TPWithOff_lo =
-+ SDValue(DAG.getMachineNode(AArch64::ADDXri, DL, PtrVT, ThreadBase,
-+ HiVar, DAG.getTargetConstant(0, MVT::i32)),
-+ 0);
-+ SDValue TPWithOff =
-+ SDValue(DAG.getMachineNode(AArch64::ADDXri, DL, PtrVT, TPWithOff_lo,
-+ LoVar, DAG.getTargetConstant(0, MVT::i32)),
-+ 0);
-+ return TPWithOff;
- } else if (Model == TLSModel::InitialExec) {
- TPOff = DAG.getTargetGlobalAddress(GV, DL, PtrVT, 0, AArch64II::MO_TLS);
- TPOff = DAG.getNode(AArch64ISD::LOADgot, DL, PtrVT, TPOff);
-@@ -3152,19 +3145,6 @@ AArch64TargetLowering::LowerELFGlobalTLSAddress(SD
- DAG.getMachineFunction().getInfo<AArch64FunctionInfo>();
- MFI->incNumLocalDynamicTLSAccesses();
-
-- // Accesses used in this sequence go via the TLS descriptor which lives in
-- // the GOT. Prepare an address we can use to handle this.
-- SDValue HiDesc = DAG.getTargetExternalSymbol(
-- "_TLS_MODULE_BASE_", PtrVT, AArch64II::MO_TLS | AArch64II::MO_PAGE);
-- SDValue LoDesc = DAG.getTargetExternalSymbol(
-- "_TLS_MODULE_BASE_", PtrVT,
-- AArch64II::MO_TLS | AArch64II::MO_PAGEOFF | AArch64II::MO_NC);
--
-- // First argument to the descriptor call is the address of the descriptor
-- // itself.
-- SDValue DescAddr = DAG.getNode(AArch64ISD::ADRP, DL, PtrVT, HiDesc);
-- DescAddr = DAG.getNode(AArch64ISD::ADDlow, DL, PtrVT, DescAddr, LoDesc);
--
- // The call needs a relocation too for linker relaxation. It doesn't make
- // sense to call it MO_PAGE or MO_PAGEOFF though so we need another copy of
- // the address.
-@@ -3173,40 +3153,23 @@ AArch64TargetLowering::LowerELFGlobalTLSAddress(SD
-
- // Now we can calculate the offset from TPIDR_EL0 to this module's
- // thread-local area.
-- TPOff = LowerELFTLSDescCall(SymAddr, DescAddr, DL, DAG);
-+ TPOff = LowerELFTLSDescCallSeq(SymAddr, DL, DAG);
-
- // Now use :dtprel_whatever: operations to calculate this variable's offset
- // in its thread-storage area.
- SDValue HiVar = DAG.getTargetGlobalAddress(
-- GV, DL, MVT::i64, 0, AArch64II::MO_TLS | AArch64II::MO_G1);
-+ GV, DL, MVT::i64, 0, AArch64II::MO_TLS | AArch64II::MO_HI12);
- SDValue LoVar = DAG.getTargetGlobalAddress(
- GV, DL, MVT::i64, 0,
-- AArch64II::MO_TLS | AArch64II::MO_G0 | AArch64II::MO_NC);
-+ AArch64II::MO_TLS | AArch64II::MO_PAGEOFF | AArch64II::MO_NC);
-
-- SDValue DTPOff =
-- SDValue(DAG.getMachineNode(AArch64::MOVZXi, DL, PtrVT, HiVar,
-- DAG.getTargetConstant(16, MVT::i32)),
-- 0);
-- DTPOff =
-- SDValue(DAG.getMachineNode(AArch64::MOVKXi, DL, PtrVT, DTPOff, LoVar,
-- DAG.getTargetConstant(0, MVT::i32)),
-- 0);
--
-- TPOff = DAG.getNode(ISD::ADD, DL, PtrVT, TPOff, DTPOff);
-+ TPOff = SDValue(DAG.getMachineNode(AArch64::ADDXri, DL, PtrVT, TPOff, HiVar,
-+ DAG.getTargetConstant(0, MVT::i32)),
-+ 0);
-+ TPOff = SDValue(DAG.getMachineNode(AArch64::ADDXri, DL, PtrVT, TPOff, LoVar,
-+ DAG.getTargetConstant(0, MVT::i32)),
-+ 0);
- } else if (Model == TLSModel::GeneralDynamic) {
-- // Accesses used in this sequence go via the TLS descriptor which lives in
-- // the GOT. Prepare an address we can use to handle this.
-- SDValue HiDesc = DAG.getTargetGlobalAddress(
-- GV, DL, PtrVT, 0, AArch64II::MO_TLS | AArch64II::MO_PAGE);
-- SDValue LoDesc = DAG.getTargetGlobalAddress(
-- GV, DL, PtrVT, 0,
-- AArch64II::MO_TLS | AArch64II::MO_PAGEOFF | AArch64II::MO_NC);
--
-- // First argument to the descriptor call is the address of the descriptor
-- // itself.
-- SDValue DescAddr = DAG.getNode(AArch64ISD::ADRP, DL, PtrVT, HiDesc);
-- DescAddr = DAG.getNode(AArch64ISD::ADDlow, DL, PtrVT, DescAddr, LoDesc);
--
- // The call needs a relocation too for linker relaxation. It doesn't make
- // sense to call it MO_PAGE or MO_PAGEOFF though so we need another copy of
- // the address.
-@@ -3214,7 +3177,7 @@ AArch64TargetLowering::LowerELFGlobalTLSAddress(SD
- DAG.getTargetGlobalAddress(GV, DL, PtrVT, 0, AArch64II::MO_TLS);
-
- // Finally we can make a call to calculate the offset from tpidr_el0.
-- TPOff = LowerELFTLSDescCall(SymAddr, DescAddr, DL, DAG);
-+ TPOff = LowerELFTLSDescCallSeq(SymAddr, DL, DAG);
- } else
- llvm_unreachable("Unsupported ELF TLS access model");
-
-Index: lib/Target/AArch64/AArch64ISelLowering.h
-===================================================================
---- lib/Target/AArch64/AArch64ISelLowering.h
-+++ lib/Target/AArch64/AArch64ISelLowering.h
-@@ -29,9 +29,9 @@ enum {
- WrapperLarge, // 4-instruction MOVZ/MOVK sequence for 64-bit addresses.
- CALL, // Function call.
-
-- // Almost the same as a normal call node, except that a TLSDesc relocation is
-- // needed so the linker can relax it correctly if possible.
-- TLSDESC_CALL,
-+ // Produces the full sequence of instructions for getting the thread pointer
-+ // offset of a variable into X0, using the TLSDesc model.
-+ TLSDESC_CALLSEQ,
- ADRP, // Page address of a TargetGlobalAddress operand.
- ADDlow, // Add the low 12 bits of a TargetGlobalAddress operand.
- LOADgot, // Load from automatically generated descriptor (e.g. Global
-@@ -399,8 +399,8 @@ class AArch64TargetLowering : public TargetLowerin
- SDValue LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const;
- SDValue LowerDarwinGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const;
- SDValue LowerELFGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const;
-- SDValue LowerELFTLSDescCall(SDValue SymAddr, SDValue DescAddr, SDLoc DL,
-- SelectionDAG &DAG) const;
-+ SDValue LowerELFTLSDescCallSeq(SDValue SymAddr, SDLoc DL,
-+ SelectionDAG &DAG) const;
- SDValue LowerSETCC(SDValue Op, SelectionDAG &DAG) const;
- SDValue LowerBR_CC(SDValue Op, SelectionDAG &DAG) const;
- SDValue LowerSELECT(SDValue Op, SelectionDAG &DAG) const;
-Index: lib/Target/AArch64/AArch64InstrInfo.td
-===================================================================
---- lib/Target/AArch64/AArch64InstrInfo.td
-+++ lib/Target/AArch64/AArch64InstrInfo.td
-@@ -96,6 +96,19 @@ def SDT_AArch64ITOF : SDTypeProfile<1, 1, [SDTCis
-
- def SDT_AArch64TLSDescCall : SDTypeProfile<0, -2, [SDTCisPtrTy<0>,
- SDTCisPtrTy<1>]>;
-+
-+// Generates the general dynamic sequences, i.e.
-+// adrp x0, :tlsdesc:var
-+// ldr x1, [x0, #:tlsdesc_lo12:var]
-+// add x0, x0, #:tlsdesc_lo12:var
-+// .tlsdesccall var
-+// blr x1
-+
-+// (the TPIDR_EL0 offset is put directly in X0, hence no "result" here)
-+// number of operands (the variable)
-+def SDT_AArch64TLSDescCallSeq : SDTypeProfile<0,1,
-+ [SDTCisPtrTy<0>]>;
-+
- def SDT_AArch64WrapperLarge : SDTypeProfile<1, 4,
- [SDTCisVT<0, i64>, SDTCisVT<1, i32>,
- SDTCisSameAs<1, 2>, SDTCisSameAs<1, 3>,
-@@ -229,11 +242,12 @@ def AArch64Prefetch : SDNode<"AArch64ISD::P
- def AArch64sitof: SDNode<"AArch64ISD::SITOF", SDT_AArch64ITOF>;
- def AArch64uitof: SDNode<"AArch64ISD::UITOF", SDT_AArch64ITOF>;
-
--def AArch64tlsdesc_call : SDNode<"AArch64ISD::TLSDESC_CALL",
-- SDT_AArch64TLSDescCall,
-- [SDNPInGlue, SDNPOutGlue, SDNPHasChain,
-- SDNPVariadic]>;
-+def AArch64tlsdesc_callseq : SDNode<"AArch64ISD::TLSDESC_CALLSEQ",
-+ SDT_AArch64TLSDescCallSeq,
-+ [SDNPInGlue, SDNPOutGlue, SDNPHasChain,
-+ SDNPVariadic]>;
-
-+
- def AArch64WrapperLarge : SDNode<"AArch64ISD::WrapperLarge",
- SDT_AArch64WrapperLarge>;
-
-@@ -1049,15 +1063,16 @@ def TLSDESCCALL : Pseudo<(outs), (ins i64imm:$sym)
- let AsmString = ".tlsdesccall $sym";
- }
-
--// Pseudo-instruction representing a BLR with attached TLSDESC relocation. It
--// gets expanded to two MCInsts during lowering.
--let isCall = 1, Defs = [LR] in
--def TLSDESC_BLR
-- : Pseudo<(outs), (ins GPR64:$dest, i64imm:$sym),
-- [(AArch64tlsdesc_call GPR64:$dest, tglobaltlsaddr:$sym)]>;
-+// FIXME: maybe the scratch register used shouldn't be fixed to X1?
-+// FIXME: can "hasSideEffects be dropped?
-+let isCall = 1, Defs = [LR, X0, X1], hasSideEffects = 1,
-+ isCodeGenOnly = 1 in
-+def TLSDESC_CALLSEQ
-+ : Pseudo<(outs), (ins i64imm:$sym),
-+ [(AArch64tlsdesc_callseq tglobaltlsaddr:$sym)]>;
-+def : Pat<(AArch64tlsdesc_callseq texternalsym:$sym),
-+ (TLSDESC_CALLSEQ texternalsym:$sym)>;
-
--def : Pat<(AArch64tlsdesc_call GPR64:$dest, texternalsym:$sym),
-- (TLSDESC_BLR GPR64:$dest, texternalsym:$sym)>;
- //===----------------------------------------------------------------------===//
- // Conditional branch (immediate) instruction.
- //===----------------------------------------------------------------------===//
-Index: lib/Target/AArch64/AArch64MCInstLower.cpp
-===================================================================
---- lib/Target/AArch64/AArch64MCInstLower.cpp
-+++ lib/Target/AArch64/AArch64MCInstLower.cpp
-@@ -22,9 +22,12 @@
- #include "llvm/MC/MCExpr.h"
- #include "llvm/MC/MCInst.h"
- #include "llvm/Support/CodeGen.h"
-+#include "llvm/Support/CommandLine.h"
- #include "llvm/Target/TargetMachine.h"
- using namespace llvm;
-
-+extern cl::opt<bool> EnableAArch64ELFLocalDynamicTLSGeneration;
-+
- AArch64MCInstLower::AArch64MCInstLower(MCContext &ctx, AsmPrinter &printer)
- : Ctx(ctx), Printer(printer), TargetTriple(printer.getTargetTriple()) {}
-
-@@ -84,10 +87,16 @@ MCOperand AArch64MCInstLower::lowerSymbolOperandEL
- if (MO.isGlobal()) {
- const GlobalValue *GV = MO.getGlobal();
- Model = Printer.TM.getTLSModel(GV);
-+ if (!EnableAArch64ELFLocalDynamicTLSGeneration &&
-+ Model == TLSModel::LocalDynamic)
-+ Model = TLSModel::GeneralDynamic;
-+
- } else {
- assert(MO.isSymbol() &&
- StringRef(MO.getSymbolName()) == "_TLS_MODULE_BASE_" &&
- "unexpected external TLS symbol");
-+ // The general dynamic access sequence is used to get the
-+ // address of _TLS_MODULE_BASE_.
- Model = TLSModel::GeneralDynamic;
- }
- switch (Model) {
-@@ -123,6 +132,8 @@ MCOperand AArch64MCInstLower::lowerSymbolOperandEL
- RefFlags |= AArch64MCExpr::VK_G1;
- else if ((MO.getTargetFlags() & AArch64II::MO_FRAGMENT) == AArch64II::MO_G0)
- RefFlags |= AArch64MCExpr::VK_G0;
-+ else if ((MO.getTargetFlags() & AArch64II::MO_FRAGMENT) == AArch64II::MO_HI12)
-+ RefFlags |= AArch64MCExpr::VK_HI12;
-
- if (MO.getTargetFlags() & AArch64II::MO_NC)
- RefFlags |= AArch64MCExpr::VK_NC;
-Index: lib/Target/AArch64/Utils/AArch64BaseInfo.h
-===================================================================
---- lib/Target/AArch64/Utils/AArch64BaseInfo.h
-+++ lib/Target/AArch64/Utils/AArch64BaseInfo.h
-@@ -1229,7 +1229,7 @@ namespace AArch64II {
-
- MO_NO_FLAG,
-
-- MO_FRAGMENT = 0x7,
-+ MO_FRAGMENT = 0xf,
-
- /// MO_PAGE - A symbol operand with this flag represents the pc-relative
- /// offset of the 4K page containing the symbol. This is used with the
-@@ -1257,26 +1257,31 @@ namespace AArch64II {
- /// 0-15 of a 64-bit address, used in a MOVZ or MOVK instruction
- MO_G0 = 6,
-
-+ /// MO_HI12 - This flag indicates that a symbol operand represents the bits
-+ /// 13-24 of a 64-bit address, used in a arithmetic immediate-shifted-left-
-+ /// by-12-bits instruction.
-+ MO_HI12 = 7,
-+
- /// MO_GOT - This flag indicates that a symbol operand represents the
- /// address of the GOT entry for the symbol, rather than the address of
- /// the symbol itself.
-- MO_GOT = 8,
-+ MO_GOT = 0x10,
-
- /// MO_NC - Indicates whether the linker is expected to check the symbol
- /// reference for overflow. For example in an ADRP/ADD pair of relocations
- /// the ADRP usually does check, but not the ADD.
-- MO_NC = 0x10,
-+ MO_NC = 0x20,
-
- /// MO_TLS - Indicates that the operand being accessed is some kind of
- /// thread-local symbol. On Darwin, only one type of thread-local access
- /// exists (pre linker-relaxation), but on ELF the TLSModel used for the
- /// referee will affect interpretation.
-- MO_TLS = 0x20,
-+ MO_TLS = 0x40,
-
- /// MO_CONSTPOOL - This flag indicates that a symbol operand represents
- /// the address of a constant pool entry for the symbol, rather than the
- /// address of the symbol itself.
-- MO_CONSTPOOL = 0x40
-+ MO_CONSTPOOL = 0x80
- };
- } // end namespace AArch64II
-
-Index: test/CodeGen/AArch64/arm64-tls-dynamics.ll
-===================================================================
---- test/CodeGen/AArch64/arm64-tls-dynamics.ll
-+++ test/CodeGen/AArch64/arm64-tls-dynamics.ll
-@@ -1,5 +1,7 @@
--; RUN: llc -mtriple=arm64-none-linux-gnu -relocation-model=pic -verify-machineinstrs < %s | FileCheck %s
--; RUN: llc -mtriple=arm64-none-linux-gnu -relocation-model=pic -filetype=obj < %s | llvm-objdump -r - | FileCheck --check-prefix=CHECK-RELOC %s
-+; RUN: llc -mtriple=arm64-none-linux-gnu -relocation-model=pic -aarch64-elf-ldtls-generation=1 -verify-machineinstrs < %s | FileCheck %s
-+; RUN: llc -mtriple=arm64-none-linux-gnu -relocation-model=pic -aarch64-elf-ldtls-generation=1 -filetype=obj < %s | llvm-objdump -r - | FileCheck --check-prefix=CHECK-RELOC %s
-+; RUN: llc -mtriple=arm64-none-linux-gnu -relocation-model=pic -verify-machineinstrs < %s | FileCheck --check-prefix=CHECK-NOLD %s
-+; RUN: llc -mtriple=arm64-none-linux-gnu -relocation-model=pic -filetype=obj < %s | llvm-objdump -r - | FileCheck --check-prefix=CHECK-NOLD-RELOC %s
-
- @general_dynamic_var = external thread_local global i32
-
-@@ -9,22 +11,34 @@ define i32 @test_generaldynamic() {
- %val = load i32* @general_dynamic_var
- ret i32 %val
-
-- ; FIXME: the adrp instructions are redundant (if harmless).
--; CHECK: adrp [[TLSDESC_HI:x[0-9]+]], :tlsdesc:general_dynamic_var
--; CHECK: add x0, [[TLSDESC_HI]], :tlsdesc_lo12:general_dynamic_var
- ; CHECK: adrp x[[TLSDESC_HI:[0-9]+]], :tlsdesc:general_dynamic_var
--; CHECK: ldr [[CALLEE:x[0-9]+]], [x[[TLSDESC_HI]], :tlsdesc_lo12:general_dynamic_var]
--; CHECK: .tlsdesccall general_dynamic_var
-+; CHECK-NEXT: ldr [[CALLEE:x[0-9]+]], [x[[TLSDESC_HI]], :tlsdesc_lo12:general_dynamic_var]
-+; CHECK-NEXT: add x0, x[[TLSDESC_HI]], :tlsdesc_lo12:general_dynamic_var
-+; CHECK-NEXT: .tlsdesccall general_dynamic_var
- ; CHECK-NEXT: blr [[CALLEE]]
-
-+; CHECK-NOLD: adrp x[[TLSDESC_HI:[0-9]+]], :tlsdesc:general_dynamic_var
-+; CHECK-NOLD-NEXT: ldr [[CALLEE:x[0-9]+]], [x[[TLSDESC_HI]], :tlsdesc_lo12:general_dynamic_var]
-+; CHECK-NOLD-NEXT: add x0, x[[TLSDESC_HI]], :tlsdesc_lo12:general_dynamic_var
-+; CHECK-NOLD-NEXT: .tlsdesccall general_dynamic_var
-+; CHECK-NOLD-NEXT: blr [[CALLEE]]
-+
-+
- ; CHECK: mrs x[[TP:[0-9]+]], TPIDR_EL0
- ; CHECK: ldr w0, [x[[TP]], x0]
-+; CHECK-NOLD: mrs x[[TP:[0-9]+]], TPIDR_EL0
-+; CHECK-NOLD: ldr w0, [x[[TP]], x0]
-
- ; CHECK-RELOC: R_AARCH64_TLSDESC_ADR_PAGE21
-+; CHECK-RELOC: R_AARCH64_TLSDESC_LD64_LO12_NC
- ; CHECK-RELOC: R_AARCH64_TLSDESC_ADD_LO12_NC
--; CHECK-RELOC: R_AARCH64_TLSDESC_LD64_LO12_NC
- ; CHECK-RELOC: R_AARCH64_TLSDESC_CALL
-
-+; CHECK-NOLD-RELOC: R_AARCH64_TLSDESC_ADR_PAGE21
-+; CHECK-NOLD-RELOC: R_AARCH64_TLSDESC_LD64_LO12_NC
-+; CHECK-NOLD-RELOC: R_AARCH64_TLSDESC_ADD_LO12_NC
-+; CHECK-NOLD-RELOC: R_AARCH64_TLSDESC_CALL
-+
- }
-
- define i32* @test_generaldynamic_addr() {
-@@ -32,12 +46,10 @@ define i32* @test_generaldynamic_addr() {
-
- ret i32* @general_dynamic_var
-
-- ; FIXME: the adrp instructions are redundant (if harmless).
--; CHECK: adrp [[TLSDESC_HI:x[0-9]+]], :tlsdesc:general_dynamic_var
--; CHECK: add x0, [[TLSDESC_HI]], :tlsdesc_lo12:general_dynamic_var
- ; CHECK: adrp x[[TLSDESC_HI:[0-9]+]], :tlsdesc:general_dynamic_var
--; CHECK: ldr [[CALLEE:x[0-9]+]], [x[[TLSDESC_HI]], :tlsdesc_lo12:general_dynamic_var]
--; CHECK: .tlsdesccall general_dynamic_var
-+; CHECK-NEXT: ldr [[CALLEE:x[0-9]+]], [x[[TLSDESC_HI]], :tlsdesc_lo12:general_dynamic_var]
-+; CHECK-NEXT: add x0, x[[TLSDESC_HI]], :tlsdesc_lo12:general_dynamic_var
-+; CHECK-NEXT: .tlsdesccall general_dynamic_var
- ; CHECK-NEXT: blr [[CALLEE]]
-
- ; CHECK: mrs [[TP:x[0-9]+]], TPIDR_EL0
-@@ -44,9 +56,15 @@ define i32* @test_generaldynamic_addr() {
- ; CHECK: add x0, [[TP]], x0
-
- ; CHECK-RELOC: R_AARCH64_TLSDESC_ADR_PAGE21
-+; CHECK-RELOC: R_AARCH64_TLSDESC_LD64_LO12_NC
- ; CHECK-RELOC: R_AARCH64_TLSDESC_ADD_LO12_NC
--; CHECK-RELOC: R_AARCH64_TLSDESC_LD64_LO12_NC
- ; CHECK-RELOC: R_AARCH64_TLSDESC_CALL
-+
-+; CHECK-NOLD-RELOC: R_AARCH64_TLSDESC_ADR_PAGE21
-+; CHECK-NOLD-RELOC: R_AARCH64_TLSDESC_LD64_LO12_NC
-+; CHECK-NOLD-RELOC: R_AARCH64_TLSDESC_ADD_LO12_NC
-+; CHECK-NOLD-RELOC: R_AARCH64_TLSDESC_CALL
-+
- }
-
- @local_dynamic_var = external thread_local(localdynamic) global i32
-@@ -58,54 +76,71 @@ define i32 @test_localdynamic() {
- ret i32 %val
-
- ; CHECK: adrp x[[TLSDESC_HI:[0-9]+]], :tlsdesc:_TLS_MODULE_BASE_
--; CHECK: add x0, x[[TLSDESC_HI]], :tlsdesc_lo12:_TLS_MODULE_BASE_
--; CHECK: adrp x[[TLSDESC_HI:[0-9]+]], :tlsdesc:_TLS_MODULE_BASE_
--; CHECK: ldr [[CALLEE:x[0-9]+]], [x[[TLSDESC_HI]], :tlsdesc_lo12:_TLS_MODULE_BASE_]
--; CHECK: .tlsdesccall _TLS_MODULE_BASE_
-+; CHECK-NEXT: ldr [[CALLEE:x[0-9]+]], [x[[TLSDESC_HI]], :tlsdesc_lo12:_TLS_MODULE_BASE_]
-+; CHECK-NEXT: add x0, x[[TLSDESC_HI]], :tlsdesc_lo12:_TLS_MODULE_BASE_
-+; CHECK-NEXT: .tlsdesccall _TLS_MODULE_BASE_
- ; CHECK-NEXT: blr [[CALLEE]]
-+; CHECK-NEXT: add x[[TPOFF:[0-9]+]], x0, :dtprel_hi12:local_dynamic_var
-+; CHECK-NEXT: add x[[TPOFF]], x[[TPOFF]], :dtprel_lo12_nc:local_dynamic_var
-+; CHECK: mrs x[[TPIDR:[0-9]+]], TPIDR_EL0
-+; CHECK: ldr w0, [x[[TPIDR]], x[[TPOFF]]]
-
--; CHECK: movz [[DTP_OFFSET:x[0-9]+]], #:dtprel_g1:local_dynamic_var
--; CHECK: movk [[DTP_OFFSET]], #:dtprel_g0_nc:local_dynamic_var
-+; CHECK-NOLD: adrp x[[TLSDESC_HI:[0-9]+]], :tlsdesc:local_dynamic_var
-+; CHECK-NOLD-NEXT: ldr [[CALLEE:x[0-9]+]], [x[[TLSDESC_HI]], :tlsdesc_lo12:local_dynamic_var]
-+; CHECK-NOLD-NEXT: add x0, x[[TLSDESC_HI]], :tlsdesc_lo12:local_dynamic_var
-+; CHECK-NOLD-NEXT: .tlsdesccall local_dynamic_var
-+; CHECK-NOLD-NEXT: blr [[CALLEE]]
-+; CHECK-NOLD: mrs x[[TPIDR:[0-9]+]], TPIDR_EL0
-+; CHECK-NOLD: ldr w0, [x[[TPIDR]], x0]
-
--; CHECK: add x[[TPREL:[0-9]+]], x0, [[DTP_OFFSET]]
-
--; CHECK: mrs x[[TPIDR:[0-9]+]], TPIDR_EL0
--
--; CHECK: ldr w0, [x[[TPIDR]], x[[TPREL]]]
--
- ; CHECK-RELOC: R_AARCH64_TLSDESC_ADR_PAGE21
-+; CHECK-RELOC: R_AARCH64_TLSDESC_LD64_LO12_NC
- ; CHECK-RELOC: R_AARCH64_TLSDESC_ADD_LO12_NC
--; CHECK-RELOC: R_AARCH64_TLSDESC_LD64_LO12_NC
- ; CHECK-RELOC: R_AARCH64_TLSDESC_CALL
-+; CHECK-RELOC: R_AARCH64_TLSLD_ADD_DTPREL_HI12
-+; CHECK-RELOC: R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC
-
-+; CHECK-NOLD-RELOC: R_AARCH64_TLSDESC_ADR_PAGE21
-+; CHECK-NOLD-RELOC: R_AARCH64_TLSDESC_LD64_LO12_NC
-+; CHECK-NOLD-RELOC: R_AARCH64_TLSDESC_ADD_LO12_NC
-+; CHECK-NOLD-RELOC: R_AARCH64_TLSDESC_CALL
-+
- }
-
- define i32* @test_localdynamic_addr() {
- ; CHECK-LABEL: test_localdynamic_addr:
-
-- ret i32* @local_dynamic_var
--
- ; CHECK: adrp x[[TLSDESC_HI:[0-9]+]], :tlsdesc:_TLS_MODULE_BASE_
--; CHECK: add x0, x[[TLSDESC_HI]], :tlsdesc_lo12:_TLS_MODULE_BASE_
--; CHECK: adrp x[[TLSDESC_HI:[0-9]+]], :tlsdesc:_TLS_MODULE_BASE_
--; CHECK: ldr [[CALLEE:x[0-9]+]], [x[[TLSDESC_HI]], :tlsdesc_lo12:_TLS_MODULE_BASE_]
--; CHECK: .tlsdesccall _TLS_MODULE_BASE_
-+; CHECK-NEXT: ldr [[CALLEE:x[0-9]+]], [x[[TLSDESC_HI]], :tlsdesc_lo12:_TLS_MODULE_BASE_]
-+; CHECK-NEXT: add x0, x[[TLSDESC_HI]], :tlsdesc_lo12:_TLS_MODULE_BASE_
-+; CHECK-NEXT: .tlsdesccall _TLS_MODULE_BASE_
- ; CHECK-NEXT: blr [[CALLEE]]
-+; CHECK-NEXT: add x[[TPOFF:[0-9]+]], x0, :dtprel_hi12:local_dynamic_var
-+; CHECK-NEXT: add x[[TPOFF]], x[[TPOFF]], :dtprel_lo12_nc:local_dynamic_var
-+; CHECK: mrs x[[TPIDR:[0-9]+]], TPIDR_EL0
-+; CHECK: add x0, x[[TPIDR]], x[[TPOFF]]
-
--; CHECK: movz [[DTP_OFFSET:x[0-9]+]], #:dtprel_g1:local_dynamic_var
--; CHECK: movk [[DTP_OFFSET]], #:dtprel_g0_nc:local_dynamic_var
-+; CHECK-NOLD: adrp x[[TLSDESC_HI:[0-9]+]], :tlsdesc:local_dynamic_var
-+; CHECK-NOLD-NEXT: ldr [[CALLEE:x[0-9]+]], [x[[TLSDESC_HI]], :tlsdesc_lo12:local_dynamic_var]
-+; CHECK-NOLD-NEXT: add x0, x[[TLSDESC_HI]], :tlsdesc_lo12:local_dynamic_var
-+; CHECK-NOLD-NEXT: .tlsdesccall local_dynamic_var
-+; CHECK-NOLD-NEXT: blr [[CALLEE]]
-+; CHECK-NOLD: mrs x[[TPIDR:[0-9]+]], TPIDR_EL0
-+; CHECK-NOLD: add x0, x[[TPIDR]], x0
-+ ret i32* @local_dynamic_var
-
--; CHECK: add [[TPREL:x[0-9]+]], x0, [[DTP_OFFSET]]
--
--; CHECK: mrs [[TPIDR:x[0-9]+]], TPIDR_EL0
--
--; CHECK: add x0, [[TPIDR]], [[TPREL]]
--
- ; CHECK-RELOC: R_AARCH64_TLSDESC_ADR_PAGE21
-+; CHECK-RELOC: R_AARCH64_TLSDESC_LD64_LO12_NC
- ; CHECK-RELOC: R_AARCH64_TLSDESC_ADD_LO12_NC
--; CHECK-RELOC: R_AARCH64_TLSDESC_LD64_LO12_NC
- ; CHECK-RELOC: R_AARCH64_TLSDESC_CALL
-+; CHECK-RELOC: R_AARCH64_TLSLD_ADD_DTPREL_HI12
-+; CHECK-RELOC: R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC
-
-+; CHECK-NOLD-RELOC: R_AARCH64_TLSDESC_ADR_PAGE21
-+; CHECK-NOLD-RELOC: R_AARCH64_TLSDESC_LD64_LO12_NC
-+; CHECK-NOLD-RELOC: R_AARCH64_TLSDESC_ADD_LO12_NC
-+; CHECK-NOLD-RELOC: R_AARCH64_TLSDESC_CALL
- }
-
- ; The entire point of the local-dynamic access model is to have a single call to
-@@ -122,11 +157,10 @@ define i32 @test_localdynamic_deduplicate() {
- %sum = add i32 %val, %val2
- ret i32 %sum
-
--; CHECK: adrp x[[TLSDESC_HI:[0-9]+]], :tlsdesc:_TLS_MODULE_BASE_
--; CHECK: add x0, x[[TLSDESC_HI]], :tlsdesc_lo12:_TLS_MODULE_BASE_
--; CHECK: adrp x[[TLSDESC_HI:[0-9]+]], :tlsdesc:_TLS_MODULE_BASE_
--; CHECK: ldr [[CALLEE:x[0-9]+]], [x[[TLSDESC_HI]], :tlsdesc_lo12:_TLS_MODULE_BASE_]
--; CHECK: .tlsdesccall _TLS_MODULE_BASE_
-+; CHECK: adrp x[[DTPREL_HI:[0-9]+]], :tlsdesc:_TLS_MODULE_BASE_
-+; CHECK-NEXT: ldr [[CALLEE:x[0-9]+]], [x[[DTPREL_HI]], :tlsdesc_lo12:_TLS_MODULE_BASE_]
-+; CHECK-NEXT: add x0, x[[TLSDESC_HI]], :tlsdesc_lo12:_TLS_MODULE_BASE
-+; CHECK-NEXT: .tlsdesccall _TLS_MODULE_BASE_
- ; CHECK-NEXT: blr [[CALLEE]]
-
- ; CHECK-NOT: _TLS_MODULE_BASE_
-Index: test/CodeGen/AArch64/arm64-tls-execs.ll
-===================================================================
---- test/CodeGen/AArch64/arm64-tls-execs.ll
-+++ test/CodeGen/AArch64/arm64-tls-execs.ll
-@@ -38,14 +38,13 @@ define i32 @test_local_exec() {
- ; CHECK-LABEL: test_local_exec:
- %val = load i32* @local_exec_var
-
--; CHECK: movz [[TP_OFFSET:x[0-9]+]], #:tprel_g1:local_exec_var // encoding: [0bAAA{{[01]+}},A,0b101AAAAA,0x92]
--; CHECK: movk [[TP_OFFSET]], #:tprel_g0_nc:local_exec_var
--; CHECK: mrs x[[TP:[0-9]+]], TPIDR_EL0
--; CHECK: ldr w0, [x[[TP]], [[TP_OFFSET]]]
-+; CHECK: mrs x[[R1:[0-9]+]], TPIDR_EL0
-+; CHECK: add x[[R2:[0-9]+]], x[[R1]], :tprel_hi12:local_exec_var
-+; CHECK: add x[[R3:[0-9]+]], x[[R2]], :tprel_lo12_nc:local_exec_var
-+; CHECK: ldr w0, [x[[R3]]]
-
--; CHECK-RELOC: R_AARCH64_TLSLE_MOVW_TPREL_G1
--; CHECK-RELOC: R_AARCH64_TLSLE_MOVW_TPREL_G0_NC
--
-+; CHECK-RELOC: R_AARCH64_TLSLE_ADD_TPREL_HI12
-+; CHECK-RELOC: R_AARCH64_TLSLE_ADD_TPREL_LO12_NC
- ret i32 %val
- }
-
-@@ -53,11 +52,11 @@ define i32* @test_local_exec_addr() {
- ; CHECK-LABEL: test_local_exec_addr:
- ret i32* @local_exec_var
-
--; CHECK: movz [[TP_OFFSET:x[0-9]+]], #:tprel_g1:local_exec_var
--; CHECK: movk [[TP_OFFSET]], #:tprel_g0_nc:local_exec_var
--; CHECK: mrs [[TP:x[0-9]+]], TPIDR_EL0
--; CHECK: add x0, [[TP]], [[TP_OFFSET]]
-+; CHECK: mrs x[[R1:[0-9]+]], TPIDR_EL0
-+; CHECK: add x[[R2:[0-9]+]], x[[R1]], :tprel_hi12:local_exec_var
-+; CHECK: add x0, x[[R2]], :tprel_lo12_nc:local_exec_var
-+; CHECK: ret
-
--; CHECK-RELOC: R_AARCH64_TLSLE_MOVW_TPREL_G1
--; CHECK-RELOC: R_AARCH64_TLSLE_MOVW_TPREL_G0_NC
-+; CHECK-RELOC: R_AARCH64_TLSLE_ADD_TPREL_HI12
-+; CHECK-RELOC: R_AARCH64_TLSLE_ADD_TPREL_LO12_NC
- }
diff --git a/contrib/llvm/patches/patch-13-llvm-r229911-uleb128-commas.diff b/contrib/llvm/patches/patch-13-llvm-r229911-uleb128-commas.diff
deleted file mode 100644
index bf13463..0000000
--- a/contrib/llvm/patches/patch-13-llvm-r229911-uleb128-commas.diff
+++ /dev/null
@@ -1,77 +0,0 @@
-Pull in r229911 from upstream llvm trunk (by Benjamin Kramer):
-
- MC: Allow multiple comma-separated expressions on the .uleb128 directive.
-
- For compatiblity with GNU as. Binutils documents this as
- '.uleb128 expressions'. Subtle, isn't it?
-
-Introduced here: http://svnweb.freebsd.org/changeset/base/281775
-
-Index: lib/MC/MCParser/AsmParser.cpp
-===================================================================
---- lib/MC/MCParser/AsmParser.cpp
-+++ lib/MC/MCParser/AsmParser.cpp
-@@ -3636,22 +3636,28 @@ bool AsmParser::parseDirectiveSpace(StringRef IDVa
- }
-
- /// parseDirectiveLEB128
--/// ::= (.sleb128 | .uleb128) expression
-+/// ::= (.sleb128 | .uleb128) [ expression (, expression)* ]
- bool AsmParser::parseDirectiveLEB128(bool Signed) {
- checkForValidSection();
- const MCExpr *Value;
-
-- if (parseExpression(Value))
-- return true;
-+ for (;;) {
-+ if (parseExpression(Value))
-+ return true;
-
-- if (getLexer().isNot(AsmToken::EndOfStatement))
-- return TokError("unexpected token in directive");
-+ if (Signed)
-+ getStreamer().EmitSLEB128Value(Value);
-+ else
-+ getStreamer().EmitULEB128Value(Value);
-
-- if (Signed)
-- getStreamer().EmitSLEB128Value(Value);
-- else
-- getStreamer().EmitULEB128Value(Value);
-+ if (getLexer().is(AsmToken::EndOfStatement))
-+ break;
-
-+ if (getLexer().isNot(AsmToken::Comma))
-+ return TokError("unexpected token in directive");
-+ Lex();
-+ }
-+
- return false;
- }
-
-Index: test/MC/ELF/uleb.s
-===================================================================
---- test/MC/ELF/uleb.s
-+++ test/MC/ELF/uleb.s
-@@ -11,16 +11,17 @@ foo:
- .uleb128 128
- .uleb128 16383
- .uleb128 16384
-+ .uleb128 23, 42
-
- // ELF_32: Name: .text
- // ELF_32: SectionData (
--// ELF_32: 0000: 00017F80 01FF7F80 8001
-+// ELF_32: 0000: 00017F80 01FF7F80 8001172A
- // ELF_32: )
- // ELF_64: Name: .text
- // ELF_64: SectionData (
--// ELF_64: 0000: 00017F80 01FF7F80 8001
-+// ELF_64: 0000: 00017F80 01FF7F80 8001172A
- // ELF_64: )
- // MACHO_32: ('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
--// MACHO_32: ('_section_data', '00017f80 01ff7f80 8001')
-+// MACHO_32: ('_section_data', '00017f80 01ff7f80 8001172a')
- // MACHO_64: ('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
--// MACHO_64: ('_section_data', '00017f80 01ff7f80 8001')
-+// MACHO_64: ('_section_data', '00017f80 01ff7f80 8001172a')
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td b/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
index b173d82..1a27e7c 100644
--- a/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -6972,6 +6972,11 @@ def note_neon_vector_initializer_non_portable_q : Note<
"vcombine_%0%1(vcreate_%0%1(), vcreate_%0%1()) to initialize from integer "
"constants">;
+def err_builtin_longjmp_unsupported : Error<
+ "__builtin_longjmp is not supported for the current target">;
+def err_builtin_setjmp_unsupported : Error<
+ "__builtin_setjmp is not supported for the current target">;
+
def err_builtin_longjmp_invalid_val : Error<
"argument to __builtin_longjmp must be a constant 1">;
def err_builtin_requires_language : Error<"'%0' is only available in %1">;
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/TargetCXXABI.h b/contrib/llvm/tools/clang/include/clang/Basic/TargetCXXABI.h
index 5669d2a..42a976b 100644
--- a/contrib/llvm/tools/clang/include/clang/Basic/TargetCXXABI.h
+++ b/contrib/llvm/tools/clang/include/clang/Basic/TargetCXXABI.h
@@ -79,6 +79,12 @@ public:
/// - guard variables are smaller.
GenericAArch64,
+ /// The generic Mips ABI is a modified version of the Itanium ABI.
+ ///
+ /// At the moment, only change from the generic ABI in this case is:
+ /// - representation of member function pointers adjusted as in ARM.
+ GenericMIPS,
+
/// The Microsoft ABI is the ABI used by Microsoft Visual Studio (and
/// compatible compilers).
///
@@ -114,6 +120,7 @@ public:
case GenericARM:
case iOS:
case iOS64:
+ case GenericMIPS:
return true;
case Microsoft:
@@ -130,6 +137,7 @@ public:
case GenericARM:
case iOS:
case iOS64:
+ case GenericMIPS:
return false;
case Microsoft:
@@ -212,6 +220,7 @@ public:
case GenericItanium:
case iOS: // old iOS compilers did not follow this rule
case Microsoft:
+ case GenericMIPS:
return true;
}
llvm_unreachable("bad ABI kind");
@@ -257,6 +266,7 @@ public:
case GenericAArch64:
case GenericARM:
case iOS:
+ case GenericMIPS:
return UseTailPaddingUnlessPOD03;
// iOS on ARM64 uses the C++11 POD rules. It does not honor the
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h b/contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h
index 69a5404..7a6462c 100644
--- a/contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h
+++ b/contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h
@@ -852,6 +852,12 @@ public:
}
}
+ /// Controls if __builtin_longjmp / __builtin_setjmp can be lowered to
+ /// llvm.eh.sjlj.longjmp / llvm.eh.sjlj.setjmp.
+ virtual bool hasSjLjLowering() const {
+ return false;
+ }
+
protected:
virtual uint64_t getPointerWidthV(unsigned AddrSpace) const {
return PointerWidth;
diff --git a/contrib/llvm/tools/clang/include/clang/Sema/Sema.h b/contrib/llvm/tools/clang/include/clang/Sema/Sema.h
index cfb0ae7..3032a19 100644
--- a/contrib/llvm/tools/clang/include/clang/Sema/Sema.h
+++ b/contrib/llvm/tools/clang/include/clang/Sema/Sema.h
@@ -8550,6 +8550,7 @@ private:
bool SemaBuiltinAssume(CallExpr *TheCall);
bool SemaBuiltinAssumeAligned(CallExpr *TheCall);
bool SemaBuiltinLongjmp(CallExpr *TheCall);
+ bool SemaBuiltinSetjmp(CallExpr *TheCall);
ExprResult SemaBuiltinAtomicOverloaded(ExprResult TheCallResult);
ExprResult SemaAtomicOpsOverloaded(ExprResult TheCallResult,
AtomicExpr::AtomicOp Op);
diff --git a/contrib/llvm/tools/clang/include/clang/Sema/Template.h b/contrib/llvm/tools/clang/include/clang/Sema/Template.h
index c08a5df..8f0d9da 100644
--- a/contrib/llvm/tools/clang/include/clang/Sema/Template.h
+++ b/contrib/llvm/tools/clang/include/clang/Sema/Template.h
@@ -273,6 +273,11 @@ namespace clang {
/// outermost scope.
LocalInstantiationScope *cloneScopes(LocalInstantiationScope *Outermost) {
if (this == Outermost) return this;
+
+ // Save the current scope from SemaRef since the LocalInstantiationScope
+ // will overwrite it on construction
+ LocalInstantiationScope *oldScope = SemaRef.CurrentInstantiationScope;
+
LocalInstantiationScope *newScope =
new LocalInstantiationScope(SemaRef, CombineWithOuterScope);
@@ -299,6 +304,8 @@ namespace clang {
newScope->ArgumentPacks.push_back(NewPack);
}
}
+ // Restore the saved scope to SemaRef
+ SemaRef.CurrentInstantiationScope = oldScope;
return newScope;
}
diff --git a/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp b/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp
index 6b864d0..c9fb80c 100644
--- a/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp
@@ -682,6 +682,7 @@ CXXABI *ASTContext::createCXXABI(const TargetInfo &T) {
case TargetCXXABI::iOS:
case TargetCXXABI::iOS64:
case TargetCXXABI::GenericAArch64:
+ case TargetCXXABI::GenericMIPS:
case TargetCXXABI::GenericItanium:
return CreateItaniumCXXABI(*this);
case TargetCXXABI::Microsoft:
@@ -7873,7 +7874,7 @@ static GVALinkage basicGVALinkageForFunction(const ASTContext &Context,
// Functions specified with extern and inline in -fms-compatibility mode
// forcibly get emitted. While the body of the function cannot be later
// replaced, the function definition cannot be discarded.
- if (FD->getMostRecentDecl()->isMSExternInline())
+ if (FD->isMSExternInline())
return GVA_StrongODR;
return GVA_DiscardableODR;
@@ -8064,6 +8065,7 @@ MangleContext *ASTContext::createMangleContext() {
case TargetCXXABI::GenericAArch64:
case TargetCXXABI::GenericItanium:
case TargetCXXABI::GenericARM:
+ case TargetCXXABI::GenericMIPS:
case TargetCXXABI::iOS:
case TargetCXXABI::iOS64:
return ItaniumMangleContext::create(*this, getDiagnostics());
diff --git a/contrib/llvm/tools/clang/lib/AST/ASTDiagnostic.cpp b/contrib/llvm/tools/clang/lib/AST/ASTDiagnostic.cpp
index 3212359..000588f 100644
--- a/contrib/llvm/tools/clang/lib/AST/ASTDiagnostic.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/ASTDiagnostic.cpp
@@ -998,29 +998,27 @@ class TemplateDiff {
(!HasFromValueDecl && !HasToValueDecl)) &&
"Template argument cannot be both integer and declaration");
- unsigned ParamWidth = 128; // Safe default
- if (FromDefaultNonTypeDecl->getType()->isIntegralOrEnumerationType())
- ParamWidth = Context.getIntWidth(FromDefaultNonTypeDecl->getType());
-
if (!HasFromInt && !HasToInt && !HasFromValueDecl && !HasToValueDecl) {
Tree.SetNode(FromExpr, ToExpr);
Tree.SetDefault(FromIter.isEnd() && FromExpr, ToIter.isEnd() && ToExpr);
if (FromDefaultNonTypeDecl->getType()->isIntegralOrEnumerationType()) {
if (FromExpr)
- HasFromInt = GetInt(Context, FromIter, FromExpr, FromInt);
+ HasFromInt = GetInt(Context, FromIter, FromExpr, FromInt,
+ FromDefaultNonTypeDecl->getType());
if (ToExpr)
- HasToInt = GetInt(Context, ToIter, ToExpr, ToInt);
+ HasToInt = GetInt(Context, ToIter, ToExpr, ToInt,
+ ToDefaultNonTypeDecl->getType());
}
if (HasFromInt && HasToInt) {
Tree.SetNode(FromInt, ToInt, HasFromInt, HasToInt);
- Tree.SetSame(IsSameConvertedInt(ParamWidth, FromInt, ToInt));
+ Tree.SetSame(FromInt == ToInt);
Tree.SetKind(DiffTree::Integer);
} else if (HasFromInt || HasToInt) {
Tree.SetNode(FromInt, ToInt, HasFromInt, HasToInt);
Tree.SetSame(false);
Tree.SetKind(DiffTree::Integer);
} else {
- Tree.SetSame(IsEqualExpr(Context, ParamWidth, FromExpr, ToExpr) ||
+ Tree.SetSame(IsEqualExpr(Context, FromExpr, ToExpr) ||
(FromNullPtr && ToNullPtr));
Tree.SetNullPtr(FromNullPtr, ToNullPtr);
Tree.SetKind(DiffTree::Expression);
@@ -1030,11 +1028,17 @@ class TemplateDiff {
if (HasFromInt || HasToInt) {
if (!HasFromInt && FromExpr)
- HasFromInt = GetInt(Context, FromIter, FromExpr, FromInt);
+ HasFromInt = GetInt(Context, FromIter, FromExpr, FromInt,
+ FromDefaultNonTypeDecl->getType());
if (!HasToInt && ToExpr)
- HasToInt = GetInt(Context, ToIter, ToExpr, ToInt);
+ HasToInt = GetInt(Context, ToIter, ToExpr, ToInt,
+ ToDefaultNonTypeDecl->getType());
Tree.SetNode(FromInt, ToInt, HasFromInt, HasToInt);
- Tree.SetSame(IsSameConvertedInt(ParamWidth, FromInt, ToInt));
+ if (HasFromInt && HasToInt) {
+ Tree.SetSame(FromInt == ToInt);
+ } else {
+ Tree.SetSame(false);
+ }
Tree.SetDefault(FromIter.isEnd() && HasFromInt,
ToIter.isEnd() && HasToInt);
Tree.SetKind(DiffTree::Integer);
@@ -1210,9 +1214,11 @@ class TemplateDiff {
}
/// GetInt - Retrieves the template integer argument, including evaluating
- /// default arguments.
+ /// default arguments. If the value comes from an expression, extend the
+ /// APSInt to size of IntegerType to match the behavior in
+ /// Sema::CheckTemplateArgument
static bool GetInt(ASTContext &Context, const TSTiterator &Iter,
- Expr *ArgExpr, llvm::APInt &Int) {
+ Expr *ArgExpr, llvm::APSInt &Int, QualType IntegerType) {
// Default, value-depenedent expressions require fetching
// from the desugared TemplateArgument, otherwise expression needs to
// be evaluatable.
@@ -1224,12 +1230,14 @@ class TemplateDiff {
case TemplateArgument::Expression:
ArgExpr = Iter.getDesugar().getAsExpr();
Int = ArgExpr->EvaluateKnownConstInt(Context);
+ Int = Int.extOrTrunc(Context.getTypeSize(IntegerType));
return true;
default:
llvm_unreachable("Unexpected template argument kind");
}
} else if (ArgExpr->isEvaluatable(Context)) {
Int = ArgExpr->EvaluateKnownConstInt(Context);
+ Int = Int.extOrTrunc(Context.getTypeSize(IntegerType));
return true;
}
@@ -1302,18 +1310,8 @@ class TemplateDiff {
return nullptr;
}
- /// IsSameConvertedInt - Returns true if both integers are equal when
- /// converted to an integer type with the given width.
- static bool IsSameConvertedInt(unsigned Width, const llvm::APSInt &X,
- const llvm::APSInt &Y) {
- llvm::APInt ConvertedX = X.extOrTrunc(Width);
- llvm::APInt ConvertedY = Y.extOrTrunc(Width);
- return ConvertedX == ConvertedY;
- }
-
/// IsEqualExpr - Returns true if the expressions evaluate to the same value.
- static bool IsEqualExpr(ASTContext &Context, unsigned ParamWidth,
- Expr *FromExpr, Expr *ToExpr) {
+ static bool IsEqualExpr(ASTContext &Context, Expr *FromExpr, Expr *ToExpr) {
if (FromExpr == ToExpr)
return true;
@@ -1345,7 +1343,7 @@ class TemplateDiff {
switch (FromVal.getKind()) {
case APValue::Int:
- return IsSameConvertedInt(ParamWidth, FromVal.getInt(), ToVal.getInt());
+ return FromVal.getInt() == ToVal.getInt();
case APValue::LValue: {
APValue::LValueBase FromBase = FromVal.getLValueBase();
APValue::LValueBase ToBase = ToVal.getLValueBase();
@@ -1655,11 +1653,14 @@ class TemplateDiff {
}
Unbold();
}
-
+
/// HasExtraInfo - Returns true if E is not an integer literal or the
/// negation of an integer literal
bool HasExtraInfo(Expr *E) {
if (!E) return false;
+
+ E = E->IgnoreImpCasts();
+
if (isa<IntegerLiteral>(E)) return false;
if (UnaryOperator *UO = dyn_cast<UnaryOperator>(E))
diff --git a/contrib/llvm/tools/clang/lib/AST/Decl.cpp b/contrib/llvm/tools/clang/lib/AST/Decl.cpp
index e43c28a..dc08d23 100644
--- a/contrib/llvm/tools/clang/lib/AST/Decl.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/Decl.cpp
@@ -2674,7 +2674,8 @@ bool FunctionDecl::isMSExternInline() const {
if (!Context.getLangOpts().MSVCCompat && !hasAttr<DLLExportAttr>())
return false;
- for (const FunctionDecl *FD = this; FD; FD = FD->getPreviousDecl())
+ for (const FunctionDecl *FD = getMostRecentDecl(); FD;
+ FD = FD->getPreviousDecl())
if (FD->getStorageClass() == SC_Extern)
return true;
diff --git a/contrib/llvm/tools/clang/lib/Analysis/ThreadSafety.cpp b/contrib/llvm/tools/clang/lib/Analysis/ThreadSafety.cpp
index a986c58..f45d6e7 100644
--- a/contrib/llvm/tools/clang/lib/Analysis/ThreadSafety.cpp
+++ b/contrib/llvm/tools/clang/lib/Analysis/ThreadSafety.cpp
@@ -2108,8 +2108,8 @@ void ThreadSafetyAnalyzer::runAnalysis(AnalysisDeclContext &AC) {
// Create a dummy expression,
VarDecl *VD = const_cast<VarDecl*>(AD.getVarDecl());
- DeclRefExpr DRE(VD, false, VD->getType(), VK_LValue,
- AD.getTriggerStmt()->getLocEnd());
+ DeclRefExpr DRE(VD, false, VD->getType().getNonReferenceType(),
+ VK_LValue, AD.getTriggerStmt()->getLocEnd());
LocksetBuilder.handleCall(&DRE, DD);
break;
}
diff --git a/contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp b/contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp
index 305dcd4..118e3f3 100644
--- a/contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp
+++ b/contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp
@@ -2076,22 +2076,33 @@ bool SourceManager::isBeforeInTranslationUnit(SourceLocation LHS,
return IsBeforeInTUCache.getCachedResult(LOffs.second, ROffs.second);
}
- // This can happen if a location is in a built-ins buffer.
- // But see PR5662.
+ // If we arrived here, the location is either in a built-ins buffer or
+ // associated with global inline asm. PR5662 and PR22576 are examples.
+
// Clear the lookup cache, it depends on a common location.
IsBeforeInTUCache.clear();
- bool LIsBuiltins = strcmp("<built-in>",
- getBuffer(LOffs.first)->getBufferIdentifier()) == 0;
- bool RIsBuiltins = strcmp("<built-in>",
- getBuffer(ROffs.first)->getBufferIdentifier()) == 0;
- // built-in is before non-built-in
- if (LIsBuiltins != RIsBuiltins)
- return LIsBuiltins;
- assert(LIsBuiltins && RIsBuiltins &&
- "Non-built-in locations must be rooted in the main file");
- // Both are in built-in buffers, but from different files. We just claim that
- // lower IDs come first.
- return LOffs.first < ROffs.first;
+ llvm::MemoryBuffer *LBuf = getBuffer(LOffs.first);
+ llvm::MemoryBuffer *RBuf = getBuffer(ROffs.first);
+ bool LIsBuiltins = strcmp("<built-in>", LBuf->getBufferIdentifier()) == 0;
+ bool RIsBuiltins = strcmp("<built-in>", RBuf->getBufferIdentifier()) == 0;
+ // Sort built-in before non-built-in.
+ if (LIsBuiltins || RIsBuiltins) {
+ if (LIsBuiltins != RIsBuiltins)
+ return LIsBuiltins;
+ // Both are in built-in buffers, but from different files. We just claim that
+ // lower IDs come first.
+ return LOffs.first < ROffs.first;
+ }
+ bool LIsAsm = strcmp("<inline asm>", LBuf->getBufferIdentifier()) == 0;
+ bool RIsAsm = strcmp("<inline asm>", RBuf->getBufferIdentifier()) == 0;
+ // Sort assembler after built-ins, but before the rest.
+ if (LIsAsm || RIsAsm) {
+ if (LIsAsm != RIsAsm)
+ return RIsAsm;
+ assert(LOffs.first == ROffs.first);
+ return false;
+ }
+ llvm_unreachable("Unsortable locations found");
}
void SourceManager::PrintStats() const {
diff --git a/contrib/llvm/tools/clang/lib/Basic/TargetInfo.cpp b/contrib/llvm/tools/clang/lib/Basic/TargetInfo.cpp
index 6987cd7..871bbd5 100644
--- a/contrib/llvm/tools/clang/lib/Basic/TargetInfo.cpp
+++ b/contrib/llvm/tools/clang/lib/Basic/TargetInfo.cpp
@@ -655,6 +655,7 @@ bool TargetCXXABI::tryParse(llvm::StringRef name) {
.Case("ios", iOS)
.Case("itanium", GenericItanium)
.Case("microsoft", Microsoft)
+ .Case("mips", GenericMIPS)
.Default(unknown);
if (kind == unknown) return false;
diff --git a/contrib/llvm/tools/clang/lib/Basic/Targets.cpp b/contrib/llvm/tools/clang/lib/Basic/Targets.cpp
index bf60bbf..a7a0057 100644
--- a/contrib/llvm/tools/clang/lib/Basic/Targets.cpp
+++ b/contrib/llvm/tools/clang/lib/Basic/Targets.cpp
@@ -419,6 +419,7 @@ protected:
public:
NetBSDTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) {
this->UserLabelPrefix = "";
+ this->MCountName = "_mcount";
}
};
@@ -919,6 +920,10 @@ public:
if (RegNo == 1) return 4;
return -1;
}
+
+ bool hasSjLjLowering() const override {
+ return true;
+ }
};
const Builtin::Info PPCTargetInfo::BuiltinInfo[] = {
@@ -2181,6 +2186,10 @@ public:
CallingConv getDefaultCallingConv(CallingConvMethodType MT) const override {
return MT == CCMT_Member ? CC_X86ThisCall : CC_C;
}
+
+ bool hasSjLjLowering() const override {
+ return true;
+ }
};
bool X86TargetInfo::setFPMath(StringRef Name) {
@@ -3354,7 +3363,10 @@ public:
: WindowsTargetInfo<X86_32TargetInfo>(Triple) {
WCharType = UnsignedShort;
DoubleAlign = LongLongAlign = 64;
- DescriptionString = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32";
+ bool IsWinCOFF =
+ getTriple().isOSWindows() && getTriple().isOSBinFormatCOFF();
+ DescriptionString = IsWinCOFF ? "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
+ : "e-m:e-p:32:32-i64:64-f80:32-n8:16:32-S32";
}
void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const override {
@@ -5628,7 +5640,9 @@ public:
const std::string &CPUStr)
: TargetInfo(Triple), CPU(CPUStr), IsMips16(false), IsMicromips(false),
IsNan2008(false), IsSingleFloat(false), FloatABI(HardFloat),
- DspRev(NoDSP), HasMSA(false), HasFP64(false), ABI(ABIStr) {}
+ DspRev(NoDSP), HasMSA(false), HasFP64(false), ABI(ABIStr) {
+ TheCXXABI.set(TargetCXXABI::GenericMIPS);
+ }
bool isNaN2008Default() const {
return CPU == "mips32r6" || CPU == "mips64r6";
@@ -6662,6 +6676,8 @@ static TargetInfo *AllocateTarget(const llvm::Triple &Triple) {
switch (os) {
case llvm::Triple::Linux:
return new LinuxTargetInfo<PPC64TargetInfo>(Triple);
+ case llvm::Triple::NetBSD:
+ return new NetBSDTargetInfo<PPC64TargetInfo>(Triple);
default:
return new PPC64TargetInfo(Triple);
}
diff --git a/contrib/llvm/tools/clang/lib/Basic/Version.cpp b/contrib/llvm/tools/clang/lib/Basic/Version.cpp
index 982410b..ae9eb1a 100644
--- a/contrib/llvm/tools/clang/lib/Basic/Version.cpp
+++ b/contrib/llvm/tools/clang/lib/Basic/Version.cpp
@@ -36,7 +36,7 @@ std::string getClangRepositoryPath() {
// If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us
// pick up a tag in an SVN export, for example.
- StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_360/final/lib/Basic/Version.cpp $");
+ StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_361/final/lib/Basic/Version.cpp $");
if (URL.empty()) {
URL = SVNRepository.slice(SVNRepository.find(':'),
SVNRepository.find("/lib/Basic"));
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp
index 9f4567d..d653130 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp
@@ -64,6 +64,7 @@ static CGCXXABI *createCXXABI(CodeGenModule &CGM) {
case TargetCXXABI::GenericARM:
case TargetCXXABI::iOS:
case TargetCXXABI::iOS64:
+ case TargetCXXABI::GenericMIPS:
case TargetCXXABI::GenericItanium:
return CreateItaniumCXXABI(CGM);
case TargetCXXABI::Microsoft:
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp b/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp
index deebab8..9e88b1e 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp
@@ -339,6 +339,9 @@ CodeGen::CGCXXABI *CodeGen::CreateItaniumCXXABI(CodeGenModule &CGM) {
return new ItaniumCXXABI(CGM, /* UseARMMethodPtrABI = */ true,
/* UseARMGuardVarABI = */ true);
+ case TargetCXXABI::GenericMIPS:
+ return new ItaniumCXXABI(CGM, /* UseARMMethodPtrABI = */ true);
+
case TargetCXXABI::GenericItanium:
if (CGM.getContext().getTargetInfo().getTriple().getArch()
== llvm::Triple::le32) {
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp b/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp
index 39cc7e5..c05b23a 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp
@@ -664,7 +664,6 @@ public:
('T' << 24);
return llvm::ConstantInt::get(CGM.Int32Ty, Sig);
}
-
};
}
@@ -4455,7 +4454,6 @@ public:
llvm::AttributeSet::FunctionIndex,
B));
}
-
};
}
diff --git a/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp b/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp
index f789fd5..8bd8298 100644
--- a/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp
+++ b/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp
@@ -1724,6 +1724,7 @@ static bool findMIPSMultilibs(const llvm::Triple &TargetTriple, StringRef Path,
MultilibSet AndroidMipsMultilibs = MultilibSet()
.Maybe(Multilib("/mips-r2").flag("+march=mips32r2"))
+ .Maybe(Multilib("/mips-r6").flag("+march=mips32r6"))
.FilterOut(NonExistent);
MultilibSet DebianMipsMultilibs;
@@ -1783,6 +1784,7 @@ static bool findMIPSMultilibs(const llvm::Triple &TargetTriple, StringRef Path,
addMultilibFlag(isMips16(Args), "mips16", Flags);
addMultilibFlag(CPUName == "mips32", "march=mips32", Flags);
addMultilibFlag(CPUName == "mips32r2", "march=mips32r2", Flags);
+ addMultilibFlag(CPUName == "mips32r6", "march=mips32r6", Flags);
addMultilibFlag(CPUName == "mips64", "march=mips64", Flags);
addMultilibFlag(CPUName == "mips64r2" || CPUName == "octeon",
"march=mips64r2", Flags);
diff --git a/contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp b/contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp
index f4241a9..3550ac2 100644
--- a/contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp
@@ -662,12 +662,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
TI.getTypeWidth(TI.getWCharType()), TI, Builder);
DefineTypeSizeof("__SIZEOF_WINT_T__",
TI.getTypeWidth(TI.getWIntType()), TI, Builder);
- // This is a temporary workaround while MIPS64 has not yet fully supported
- // 128-bit integers. But declaration of int128 type is necessary even though
- // __SIZEOF_INT128__ is undefined because c++ standard header files like
- // limits throw error message if __int128 is not available.
- if (TI.hasInt128Type() && !(TI.getTriple().getArch() == llvm::Triple::mips64el
- || TI.getTriple().getArch() == llvm::Triple::mips64))
+ if (TI.hasInt128Type())
DefineTypeSizeof("__SIZEOF_INT128__", 128, TI, Builder);
DefineType("__INTMAX_TYPE__", TI.getIntMaxType(), Builder);
diff --git a/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp b/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp
index 7bf3e51..349bb32 100644
--- a/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp
@@ -345,8 +345,9 @@ bool Declarator::isDeclarationOfFunction() const {
bool Declarator::isStaticMember() {
assert(getContext() == MemberContext);
return getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_static ||
- CXXMethodDecl::isStaticOverloadedOperator(
- getName().OperatorFunctionId.Operator);
+ (getName().Kind == UnqualifiedId::IK_OperatorFunctionId &&
+ CXXMethodDecl::isStaticOverloadedOperator(
+ getName().OperatorFunctionId.Operator));
}
bool DeclSpec::hasTagDefinition() const {
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp
index 9f6c548..6ab957e 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp
@@ -297,6 +297,10 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
if (SemaBuiltinLongjmp(TheCall))
return ExprError();
break;
+ case Builtin::BI__builtin_setjmp:
+ if (SemaBuiltinSetjmp(TheCall))
+ return ExprError();
+ break;
case Builtin::BI__builtin_classify_type:
if (checkArgCount(*this, TheCall, 1)) return true;
@@ -2367,8 +2371,13 @@ bool Sema::SemaBuiltinConstantArgRange(CallExpr *TheCall, int ArgNum,
}
/// SemaBuiltinLongjmp - Handle __builtin_longjmp(void *env[5], int val).
-/// This checks that val is a constant 1.
+/// This checks that the target supports __builtin_longjmp and
+/// that val is a constant 1.
bool Sema::SemaBuiltinLongjmp(CallExpr *TheCall) {
+ if (!Context.getTargetInfo().hasSjLjLowering())
+ return Diag(TheCall->getLocStart(), diag::err_builtin_longjmp_unsupported)
+ << SourceRange(TheCall->getLocStart(), TheCall->getLocEnd());
+
Expr *Arg = TheCall->getArg(1);
llvm::APSInt Result;
@@ -2383,6 +2392,16 @@ bool Sema::SemaBuiltinLongjmp(CallExpr *TheCall) {
return false;
}
+
+/// SemaBuiltinSetjmp - Handle __builtin_setjmp(void *env[5]).
+/// This checks that the target supports __builtin_setjmp.
+bool Sema::SemaBuiltinSetjmp(CallExpr *TheCall) {
+ if (!Context.getTargetInfo().hasSjLjLowering())
+ return Diag(TheCall->getLocStart(), diag::err_builtin_setjmp_unsupported)
+ << SourceRange(TheCall->getLocStart(), TheCall->getLocEnd());
+ return false;
+}
+
namespace {
enum StringLiteralCheckType {
SLCT_NotALiteral,
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp
index 091fd27..8be1157 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp
@@ -117,7 +117,7 @@ static AvailabilityResult DiagnoseAvailabilityOfDecl(Sema &S,
case AR_Available:
case AR_NotYetIntroduced:
break;
-
+
case AR_Deprecated:
if (S.getCurContextAvailability() != AR_Deprecated)
S.EmitAvailabilityWarning(Sema::AD_Deprecation,
@@ -11630,8 +11630,11 @@ void Sema::MarkFunctionReferenced(SourceLocation Loc, FunctionDecl *Func,
} else if (CXXDestructorDecl *Destructor =
dyn_cast<CXXDestructorDecl>(Func)) {
Destructor = cast<CXXDestructorDecl>(Destructor->getFirstDecl());
- if (Destructor->isDefaulted() && !Destructor->isDeleted())
+ if (Destructor->isDefaulted() && !Destructor->isDeleted()) {
+ if (Destructor->isTrivial() && !Destructor->hasAttr<DLLExportAttr>())
+ return;
DefineImplicitDestructor(Loc, Destructor);
+ }
if (Destructor->isVirtual())
MarkVTableUsed(Loc, Destructor->getParent());
} else if (CXXMethodDecl *MethodDecl = dyn_cast<CXXMethodDecl>(Func)) {
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp
index 3e2a2de..a92b7ac 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp
@@ -5705,6 +5705,16 @@ ExprResult Sema::BuildCXXMemberCallExpr(Expr *E, NamedDecl *FoundDecl,
ExprResult Sema::BuildCXXNoexceptExpr(SourceLocation KeyLoc, Expr *Operand,
SourceLocation RParen) {
+ // If the operand is an unresolved lookup expression, the expression is ill-
+ // formed per [over.over]p1, because overloaded function names cannot be used
+ // without arguments except in explicit contexts.
+ ExprResult R = CheckPlaceholderExpr(Operand);
+ if (R.isInvalid())
+ return R;
+
+ // The operand may have been modified when checking the placeholder type.
+ Operand = R.get();
+
if (ActiveTemplateInstantiations.empty() &&
Operand->HasSideEffects(Context, false)) {
// The expression operand for noexcept is in an unevaluated expression
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp
index 67c36a5..1e71762 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp
@@ -3355,7 +3355,7 @@ Sema::SubstDefaultTemplateArgumentIfAvailable(TemplateDecl *Template,
/// \param Param The template parameter against which the argument will be
/// checked.
///
-/// \param Arg The template argument.
+/// \param Arg The template argument, which may be updated due to conversions.
///
/// \param Template The template in which the template argument resides.
///
@@ -3433,6 +3433,13 @@ bool Sema::CheckTemplateArgument(NamedDecl *Param,
if (Res.isInvalid())
return true;
+ // If the resulting expression is new, then use it in place of the
+ // old expression in the template argument.
+ if (Res.get() != Arg.getArgument().getAsExpr()) {
+ TemplateArgument TA(Res.get());
+ Arg = TemplateArgumentLoc(TA, Res.get());
+ }
+
Converted.push_back(Result);
break;
}
@@ -3640,9 +3647,14 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
TemplateArgumentListInfo &TemplateArgs,
bool PartialTemplateArgs,
SmallVectorImpl<TemplateArgument> &Converted) {
+ // Make a copy of the template arguments for processing. Only make the
+ // changes at the end when successful in matching the arguments to the
+ // template.
+ TemplateArgumentListInfo NewArgs = TemplateArgs;
+
TemplateParameterList *Params = Template->getTemplateParameters();
- SourceLocation RAngleLoc = TemplateArgs.getRAngleLoc();
+ SourceLocation RAngleLoc = NewArgs.getRAngleLoc();
// C++ [temp.arg]p1:
// [...] The type and form of each template-argument specified in
@@ -3651,7 +3663,7 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
// template-parameter-list.
bool isTemplateTemplateParameter = isa<TemplateTemplateParmDecl>(Template);
SmallVector<TemplateArgument, 2> ArgumentPack;
- unsigned ArgIdx = 0, NumArgs = TemplateArgs.size();
+ unsigned ArgIdx = 0, NumArgs = NewArgs.size();
LocalInstantiationScope InstScope(*this, true);
for (TemplateParameterList::iterator Param = Params->begin(),
ParamEnd = Params->end();
@@ -3687,21 +3699,21 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
if (ArgIdx < NumArgs) {
// Check the template argument we were given.
- if (CheckTemplateArgument(*Param, TemplateArgs[ArgIdx], Template,
+ if (CheckTemplateArgument(*Param, NewArgs[ArgIdx], Template,
TemplateLoc, RAngleLoc,
ArgumentPack.size(), Converted))
return true;
bool PackExpansionIntoNonPack =
- TemplateArgs[ArgIdx].getArgument().isPackExpansion() &&
+ NewArgs[ArgIdx].getArgument().isPackExpansion() &&
(!(*Param)->isTemplateParameterPack() || getExpandedPackSize(*Param));
if (PackExpansionIntoNonPack && isa<TypeAliasTemplateDecl>(Template)) {
// Core issue 1430: we have a pack expansion as an argument to an
// alias template, and it's not part of a parameter pack. This
// can't be canonicalized, so reject it now.
- Diag(TemplateArgs[ArgIdx].getLocation(),
+ Diag(NewArgs[ArgIdx].getLocation(),
diag::err_alias_template_expansion_into_fixed_list)
- << TemplateArgs[ArgIdx].getSourceRange();
+ << NewArgs[ArgIdx].getSourceRange();
Diag((*Param)->getLocation(), diag::note_template_param_here);
return true;
}
@@ -3733,7 +3745,7 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
}
while (ArgIdx < NumArgs) {
- Converted.push_back(TemplateArgs[ArgIdx].getArgument());
+ Converted.push_back(NewArgs[ArgIdx].getArgument());
++ArgIdx;
}
@@ -3784,8 +3796,7 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
// the default argument.
if (TemplateTypeParmDecl *TTP = dyn_cast<TemplateTypeParmDecl>(*Param)) {
if (!TTP->hasDefaultArgument())
- return diagnoseArityMismatch(*this, Template, TemplateLoc,
- TemplateArgs);
+ return diagnoseArityMismatch(*this, Template, TemplateLoc, NewArgs);
TypeSourceInfo *ArgType = SubstDefaultTemplateArgument(*this,
Template,
@@ -3801,8 +3812,7 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
} else if (NonTypeTemplateParmDecl *NTTP
= dyn_cast<NonTypeTemplateParmDecl>(*Param)) {
if (!NTTP->hasDefaultArgument())
- return diagnoseArityMismatch(*this, Template, TemplateLoc,
- TemplateArgs);
+ return diagnoseArityMismatch(*this, Template, TemplateLoc, NewArgs);
ExprResult E = SubstDefaultTemplateArgument(*this, Template,
TemplateLoc,
@@ -3819,8 +3829,7 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
= cast<TemplateTemplateParmDecl>(*Param);
if (!TempParm->hasDefaultArgument())
- return diagnoseArityMismatch(*this, Template, TemplateLoc,
- TemplateArgs);
+ return diagnoseArityMismatch(*this, Template, TemplateLoc, NewArgs);
NestedNameSpecifierLoc QualifierLoc;
TemplateName Name = SubstDefaultTemplateArgument(*this, Template,
@@ -3848,12 +3857,12 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
RAngleLoc, 0, Converted))
return true;
- // Core issue 150 (assumed resolution): if this is a template template
- // parameter, keep track of the default template arguments from the
+ // Core issue 150 (assumed resolution): if this is a template template
+ // parameter, keep track of the default template arguments from the
// template definition.
if (isTemplateTemplateParameter)
- TemplateArgs.addArgument(Arg);
-
+ NewArgs.addArgument(Arg);
+
// Move to the next template parameter and argument.
++Param;
++ArgIdx;
@@ -3865,15 +3874,18 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
// still dependent).
if (ArgIdx < NumArgs && CurrentInstantiationScope &&
CurrentInstantiationScope->getPartiallySubstitutedPack()) {
- while (ArgIdx < NumArgs &&
- TemplateArgs[ArgIdx].getArgument().isPackExpansion())
- Converted.push_back(TemplateArgs[ArgIdx++].getArgument());
+ while (ArgIdx < NumArgs && NewArgs[ArgIdx].getArgument().isPackExpansion())
+ Converted.push_back(NewArgs[ArgIdx++].getArgument());
}
// If we have any leftover arguments, then there were too many arguments.
// Complain and fail.
if (ArgIdx < NumArgs)
- return diagnoseArityMismatch(*this, Template, TemplateLoc, TemplateArgs);
+ return diagnoseArityMismatch(*this, Template, TemplateLoc, NewArgs);
+
+ // No problems found with the new argument list, propagate changes back
+ // to caller.
+ TemplateArgs = NewArgs;
return false;
}
diff --git a/contrib/mdocml/read.c b/contrib/mdocml/read.c
index 471d415..a34c9ff 100644
--- a/contrib/mdocml/read.c
+++ b/contrib/mdocml/read.c
@@ -28,6 +28,7 @@
#include <assert.h>
#include <ctype.h>
#include <errno.h>
+#include <err.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdint.h>
@@ -35,6 +36,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <zlib.h>
#include "mandoc.h"
#include "mandoc_aux.h"
@@ -792,6 +794,27 @@ mparse_readfd(struct mparse *curp, int fd, const char *file)
return(curp->file_status);
}
+/*
+ * hack to avoid depending on gnuzip(1) waiting for upstream proper
+ * support
+ */
+static int
+gunzip(const char *file)
+{
+ gzFile gz;
+ char buf[8192];
+ int r;
+
+ gz = gzopen(file, "r");
+ if (gz == NULL)
+ err(EXIT_FAILURE, "cannot open %s", file);
+
+ while ((r = gzread(gz, buf, sizeof(buf))) > 0)
+ fwrite(buf, 1, r, stdout);
+
+ gzclose(gz);
+ return (EXIT_SUCCESS);
+}
enum mandoclevel
mparse_open(struct mparse *curp, int *fd, const char *file)
{
@@ -846,9 +869,7 @@ mparse_open(struct mparse *curp, int *fd, const char *file)
perror("dup");
exit((int)MANDOCLEVEL_SYSERR);
}
- execlp("gunzip", "gunzip", "-c", file, NULL);
- perror("exec");
- exit((int)MANDOCLEVEL_SYSERR);
+ exit(gunzip(file));
default:
close(pfd[1]);
*fd = pfd[0];
diff --git a/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c b/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c
index 5afdee9..99235ea 100644
--- a/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c
+++ b/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c
@@ -40,6 +40,9 @@ __RCSID("$NetBSD: t_faccessat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $");
#include <string.h>
#include <unistd.h>
#include <sys/param.h>
+#ifdef __FreeBSD__
+#include <sys/stat.h>
+#endif
#define DIR "dir"
#define FILE "dir/faccessat"
diff --git a/contrib/netbsd-tests/lib/libc/c063/t_openat.c b/contrib/netbsd-tests/lib/libc/c063/t_openat.c
index 79b5f38..5112efc 100644
--- a/contrib/netbsd-tests/lib/libc/c063/t_openat.c
+++ b/contrib/netbsd-tests/lib/libc/c063/t_openat.c
@@ -40,6 +40,9 @@ __RCSID("$NetBSD: t_openat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $");
#include <string.h>
#include <unistd.h>
#include <sys/param.h>
+#ifdef __FreeBSD__
+#include <sys/stat.h>
+#endif
#define DIR "dir"
#define FILE "dir/openat"
diff --git a/contrib/netbsd-tests/lib/libc/c063/t_readlinkat.c b/contrib/netbsd-tests/lib/libc/c063/t_readlinkat.c
index d354ff5..c9bc267 100644
--- a/contrib/netbsd-tests/lib/libc/c063/t_readlinkat.c
+++ b/contrib/netbsd-tests/lib/libc/c063/t_readlinkat.c
@@ -40,6 +40,9 @@ __RCSID("$NetBSD: t_readlinkat.c,v 1.3 2013/03/17 04:46:06 jmmv Exp $");
#include <string.h>
#include <unistd.h>
#include <sys/param.h>
+#ifdef __FreeBSD__
+#include <sys/stat.h>
+#endif
#define DIR "dir"
#define FILE "dir/readlinkat"
diff --git a/contrib/netbsd-tests/lib/libc/c063/t_unlinkat.c b/contrib/netbsd-tests/lib/libc/c063/t_unlinkat.c
index 79aa7aa..220c4b2 100644
--- a/contrib/netbsd-tests/lib/libc/c063/t_unlinkat.c
+++ b/contrib/netbsd-tests/lib/libc/c063/t_unlinkat.c
@@ -40,6 +40,9 @@ __RCSID("$NetBSD: t_unlinkat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $");
#include <string.h>
#include <unistd.h>
#include <sys/param.h>
+#ifdef __FreeBSD__
+#include <sys/stat.h>
+#endif
#define DIR "dir"
#define FILE "dir/unlinkat"
diff --git a/contrib/netbsd-tests/lib/libc/string/t_memmem.c b/contrib/netbsd-tests/lib/libc/string/t_memmem.c
index 8734bc3..5807662 100644
--- a/contrib/netbsd-tests/lib/libc/string/t_memmem.c
+++ b/contrib/netbsd-tests/lib/libc/string/t_memmem.c
@@ -75,7 +75,7 @@ ATF_TC_HEAD(memmem_basic, tc)
ATF_TC_BODY(memmem_basic, tc)
{
-#if defined(__darwin__) || defined(__FreeBSD__)
+#if defined(__darwin__)
expect(memmem(b2, lb2, p0, lp0) == NULL);
expect(memmem(b0, lb0, p0, lp0) == NULL);
#else
diff --git a/contrib/ntp/ntpd/ntp_control.c b/contrib/ntp/ntpd/ntp_control.c
index 3e8bef0..2a1cf22 100644
--- a/contrib/ntp/ntpd/ntp_control.c
+++ b/contrib/ntp/ntpd/ntp_control.c
@@ -4,7 +4,7 @@
*/
/*
- * $FreeBSD: projects/bmake/contrib/ntp/ntpd/ntp_control.c 182007 2008-08-22 15:58:00Z roberto $
+ * $FreeBSD: head/contrib/ntp/ntpd/ntp_control.c 276071 2014-12-22 18:54:55Z delphij $
*/
#ifdef HAVE_CONFIG_H
diff --git a/contrib/sendmail/libsm/sscanf.c b/contrib/sendmail/libsm/sscanf.c
index 2515d55..2651dde 100644
--- a/contrib/sendmail/libsm/sscanf.c
+++ b/contrib/sendmail/libsm/sscanf.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: sscanf.c,v 1.26 2013/11/22 20:51:43 ca Exp $")
+SM_RCSID("@(#)$Id: sscanf.c,v 1.26 2013-11-22 20:51:43 ca Exp $")
#include <string.h>
#include <sm/varargs.h>
#include <sm/io.h>
diff --git a/contrib/top/top.local.H b/contrib/top/top.local.hs
index 9eb7a64e5..9eb7a64e5 100644
--- a/contrib/top/top.local.H
+++ b/contrib/top/top.local.hs
diff --git a/contrib/top/top.X b/contrib/top/top.xs
index 15cf2dc..15cf2dc 100644
--- a/contrib/top/top.X
+++ b/contrib/top/top.xs
diff --git a/contrib/traceroute/traceroute.8 b/contrib/traceroute/traceroute.8
index 654b538..ebfcc36 100644
--- a/contrib/traceroute/traceroute.8
+++ b/contrib/traceroute/traceroute.8
@@ -16,7 +16,7 @@
.\" $Id: traceroute.8,v 1.19 2000/09/21 08:44:19 leres Exp $
.\" $FreeBSD$
.\"
-.Dd June 19, 2012
+.Dd May 31, 2015
.Dt TRACEROUTE 8
.Os
.Sh NAME
@@ -65,7 +65,7 @@ Turn on AS# lookups and use the given server instead of the
default.
.It Fl e
Firewall evasion mode.
-Use fixed destination ports for UDP and TCP probes.
+Use fixed destination ports for UDP, UDP-Lite, TCP and SCTP probes.
The destination port does NOT increment with each packet sent.
.It Fl f Ar first_ttl
Set the initial time-to-live used in the first outgoing probe packet.
@@ -110,21 +110,24 @@ Print hop addresses numerically rather than symbolically and numerically
path).
.It Fl P Ar proto
Send packets of specified IP protocol. The currently supported protocols
-are: UDP, TCP, GRE and ICMP. Other protocols may also be specified (either by
-name or by number), though
+are: UDP, UDP-Lite, TCP, SCTP, GRE and ICMP. Other protocols may also be
+specified (either by name or by number), though
.Nm
does not implement any special knowledge of their packet formats. This
option is useful for determining which router along a path may be
blocking packets based on IP protocol number. But see BUGS below.
.It Fl p Ar port
-Protocol specific. For UDP and TCP, sets
+Protocol specific. For UDP, UDP-Lite, TCP and SCTP, sets
the base
.Ar port
number used in probes (default is 33434).
-Traceroute hopes that nothing is listening on UDP ports
-.Em base
+Traceroute hopes that nothing is listening on UDP ports (or UDP-Lite ports
+if used by
+.Nm
+and supported by the peer)
+.Em base + 1
to
-.Em base + nhops * nprobes - 1
+.Em base + nhops * nprobes
at the destination host (so an ICMP PORT_UNREACHABLE message will
be returned to terminate the route tracing). If something is
listening on a port in the default range, this option can be used
diff --git a/contrib/traceroute/traceroute.c b/contrib/traceroute/traceroute.c
index 63cefa1..28ba67b 100644
--- a/contrib/traceroute/traceroute.c
+++ b/contrib/traceroute/traceroute.c
@@ -219,6 +219,7 @@ static const char rcsid[] =
#include <netinet/ip.h>
#include <netinet/ip_var.h>
#include <netinet/ip_icmp.h>
+#include <netinet/sctp.h>
#include <netinet/udp.h>
#include <netinet/tcp.h>
#include <netinet/tcpip.h>
@@ -367,9 +368,10 @@ void freehostinfo(struct hostinfo *);
void getaddr(u_int32_t *, char *);
struct hostinfo *gethostinfo(char *);
u_short in_cksum(u_short *, int);
+u_int32_t sctp_crc32c(const void *, u_int32_t);
char *inetname(struct in_addr);
int main(int, char **);
-u_short p_cksum(struct ip *, u_short *, int);
+u_short p_cksum(struct ip *, u_short *, int, int);
int packet_ok(u_char *, int, struct sockaddr_in *, int);
char *pr_type(u_char);
void print(u_char *, int, struct sockaddr_in *);
@@ -389,8 +391,12 @@ int usleep(u_int);
void udp_prep(struct outdata *);
int udp_check(const u_char *, int);
+void udplite_prep(struct outdata *);
+int udplite_check(const u_char *, int);
void tcp_prep(struct outdata *);
int tcp_check(const u_char *, int);
+void sctp_prep(struct outdata *);
+int sctp_check(const u_char *, int);
void gre_prep(struct outdata *);
int gre_check(const u_char *, int);
void gen_prep(struct outdata *);
@@ -424,6 +430,15 @@ struct outproto protos[] = {
udp_check
},
{
+ "udplite",
+ "spt dpt cov sum",
+ IPPROTO_UDPLITE,
+ sizeof(struct udphdr),
+ 32768 + 666,
+ udplite_prep,
+ udplite_check
+ },
+ {
"tcp",
"spt dpt seq ack xxflwin sum urp",
IPPROTO_TCP,
@@ -433,6 +448,15 @@ struct outproto protos[] = {
tcp_check
},
{
+ "sctp",
+ "spt dpt vtag crc tyfllen tyfllen ",
+ IPPROTO_SCTP,
+ sizeof(struct sctphdr),
+ 32768 + 666,
+ sctp_prep,
+ sctp_check
+ },
+ {
"gre",
"flg pro len clid",
IPPROTO_GRE,
@@ -452,7 +476,7 @@ struct outproto protos[] = {
},
{
NULL,
- NULL,
+ "",
0,
2 * sizeof(u_short),
0,
@@ -541,12 +565,12 @@ main(int argc, char **argv)
case 'a':
as_path = 1;
break;
-
+
case 'A':
as_path = 1;
as_server = optarg;
break;
-
+
case 'd':
options |= SO_DEBUG;
break;
@@ -669,8 +693,11 @@ main(int argc, char **argv)
if (lsrr > 0)
optlen = (lsrr + 1) * sizeof(gwlist[0]);
- minpacket = sizeof(*outip) + proto->hdrlen + sizeof(struct outdata) + optlen;
- packlen = minpacket; /* minimum sized packet */
+ minpacket = sizeof(*outip) + proto->hdrlen + optlen;
+ if (minpacket > 40)
+ packlen = minpacket;
+ else
+ packlen = 40;
/* Process destination and optional packet size */
switch (argc - optind) {
@@ -704,6 +731,11 @@ main(int argc, char **argv)
#endif
protlen = packlen - sizeof(*outip) - optlen;
+ if ((proto->num == IPPROTO_SCTP) && (packlen & 3)) {
+ Fprintf(stderr, "%s: packet length must be a multiple of 4\n",
+ prog);
+ exit(1);
+ }
outip = (struct ip *)malloc((unsigned)packlen);
if (outip == NULL) {
@@ -931,7 +963,7 @@ main(int argc, char **argv)
as_path = 0;
}
}
-
+
#if defined(IPSEC) && defined(IPSEC_POLICY_IPSEC)
if (setpolicy(sndsock, "in bypass") < 0)
errx(1, "%s", ipsec_strerror());
@@ -1330,7 +1362,7 @@ packet_ok(register u_char *buf, int cc, register struct sockaddr_in *from,
hiplen = ((u_char *)icp + cc) - (u_char *)hip;
hlen = hip->ip_hl << 2;
inner = (u_char *)((u_char *)hip + hlen);
- if (hlen + 12 <= cc
+ if (hlen + 16 <= cc
&& hip->ip_p == proto->num
&& (*proto->check)(inner, (u_char)seq))
return (type == ICMP_TIMXCEED ? -1 : code + 1);
@@ -1343,8 +1375,8 @@ packet_ok(register u_char *buf, int cc, register struct sockaddr_in *from,
Printf("\n%d bytes from %s to ", cc, inet_ntoa(from->sin_addr));
Printf("%s: icmp type %d (%s) code %d\n",
inet_ntoa(ip->ip_dst), type, pr_type(type), icp->icmp_code);
- for (i = 4; i < cc ; i += sizeof(*lp))
- Printf("%2d: x%8.8x\n", i, *lp++);
+ for (i = 4; i <= cc - ICMP_MINLEN; i += sizeof(*lp))
+ Printf("%2d: %8.8x\n", i, ntohl(*lp++));
}
#endif
return(0);
@@ -1383,7 +1415,7 @@ udp_prep(struct outdata *outdata)
outudp->uh_ulen = htons((u_short)protlen);
outudp->uh_sum = 0;
if (doipcksum) {
- u_short sum = p_cksum(outip, (u_short*)outudp, protlen);
+ u_short sum = p_cksum(outip, (u_short*)outudp, protlen, protlen);
outudp->uh_sum = (sum) ? sum : 0xffff;
}
@@ -1400,6 +1432,32 @@ udp_check(const u_char *data, int seq)
}
void
+udplite_prep(struct outdata *outdata)
+{
+ struct udphdr *const outudp = (struct udphdr *) outp;
+
+ outudp->uh_sport = htons(ident + (fixedPort ? outdata->seq : 0));
+ outudp->uh_dport = htons(port + (fixedPort ? 0 : outdata->seq));
+ outudp->uh_ulen = htons(8);
+ outudp->uh_sum = 0;
+ if (doipcksum) {
+ u_short sum = p_cksum(outip, (u_short*)outudp, protlen, 8);
+ outudp->uh_sum = (sum) ? sum : 0xffff;
+ }
+
+ return;
+}
+
+int
+udplite_check(const u_char *data, int seq)
+{
+ struct udphdr *const udp = (struct udphdr *) data;
+
+ return (ntohs(udp->uh_sport) == ident + (fixedPort ? seq : 0) &&
+ ntohs(udp->uh_dport) == port + (fixedPort ? 0 : seq));
+}
+
+void
tcp_prep(struct outdata *outdata)
{
struct tcphdr *const tcp = (struct tcphdr *) outp;
@@ -1412,10 +1470,8 @@ tcp_prep(struct outdata *outdata)
tcp->th_flags = TH_SYN;
tcp->th_sum = 0;
- if (doipcksum) {
- u_short sum = p_cksum(outip, (u_short*)tcp, protlen);
- tcp->th_sum = (sum) ? sum : 0xffff;
- }
+ if (doipcksum)
+ tcp->th_sum = p_cksum(outip, (u_short*)tcp, protlen, protlen);
}
int
@@ -1429,6 +1485,47 @@ tcp_check(const u_char *data, int seq)
}
void
+sctp_prep(struct outdata *outdata)
+{
+ struct sctphdr *const sctp = (struct sctphdr *) outp;
+ struct sctp_chunkhdr *chk;
+
+ sctp->src_port = htons(ident);
+ sctp->dest_port = htons(port + (fixedPort ? 0 : outdata->seq));
+ sctp->v_tag = (sctp->src_port << 16) | sctp->dest_port;
+ sctp->checksum = htonl(0);
+ if (protlen >=
+ (int)(sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr))) {
+ chk = (struct sctp_chunkhdr *)(sctp + 1);
+ chk->chunk_type = SCTP_SHUTDOWN_ACK;
+ chk->chunk_flags = 0;
+ chk->chunk_length = htons(4);
+ }
+ if (protlen >=
+ (int)(sizeof(struct sctphdr) + 2 * sizeof(struct sctp_chunkhdr))) {
+ chk = chk + 1;
+ chk->chunk_type = SCTP_PAD_CHUNK;
+ chk->chunk_flags = 0;
+ chk->chunk_length = htons(protlen -
+ (sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr)));
+ }
+ if (doipcksum) {
+ sctp->checksum = sctp_crc32c(sctp, protlen);
+ }
+}
+
+int
+sctp_check(const u_char *data, int seq)
+{
+ struct sctphdr *const sctp = (struct sctphdr *) data;
+
+ return (ntohs(sctp->src_port) == ident
+ && ntohs(sctp->dest_port) == port + (fixedPort ? 0 : seq)
+ && sctp->v_tag ==
+ (u_int32_t)((sctp->src_port << 16) | sctp->dest_port));
+}
+
+void
gre_prep(struct outdata *outdata)
{
struct grehdr *const gre = (struct grehdr *) outp;
@@ -1494,8 +1591,8 @@ print(register u_char *buf, register int cc, register struct sockaddr_in *from)
/*
* Checksum routine for UDP and TCP headers.
*/
-u_short
-p_cksum(struct ip *ip, u_short *data, int len)
+u_short
+p_cksum(struct ip *ip, u_short *data, int len, int cov)
{
static struct ipovly ipo;
u_short sum[2];
@@ -1506,7 +1603,7 @@ p_cksum(struct ip *ip, u_short *data, int len)
ipo.ih_dst = ip->ip_dst;
sum[1] = in_cksum((u_short*)&ipo, sizeof(ipo)); /* pseudo ip hdr cksum */
- sum[0] = in_cksum(data, len); /* payload data cksum */
+ sum[0] = in_cksum(data, cov); /* payload data cksum */
return ~in_cksum(sum, sizeof(sum));
}
@@ -1547,6 +1644,98 @@ in_cksum(register u_short *addr, register int len)
}
/*
+ * CRC32C routine for the Stream Control Transmission Protocol
+ */
+
+#define CRC32C(c, d) (c = (c>>8) ^ crc_c[(c^(d))&0xFF])
+
+static u_int32_t crc_c[256] = {
+ 0x00000000, 0xF26B8303, 0xE13B70F7, 0x1350F3F4,
+ 0xC79A971F, 0x35F1141C, 0x26A1E7E8, 0xD4CA64EB,
+ 0x8AD958CF, 0x78B2DBCC, 0x6BE22838, 0x9989AB3B,
+ 0x4D43CFD0, 0xBF284CD3, 0xAC78BF27, 0x5E133C24,
+ 0x105EC76F, 0xE235446C, 0xF165B798, 0x030E349B,
+ 0xD7C45070, 0x25AFD373, 0x36FF2087, 0xC494A384,
+ 0x9A879FA0, 0x68EC1CA3, 0x7BBCEF57, 0x89D76C54,
+ 0x5D1D08BF, 0xAF768BBC, 0xBC267848, 0x4E4DFB4B,
+ 0x20BD8EDE, 0xD2D60DDD, 0xC186FE29, 0x33ED7D2A,
+ 0xE72719C1, 0x154C9AC2, 0x061C6936, 0xF477EA35,
+ 0xAA64D611, 0x580F5512, 0x4B5FA6E6, 0xB93425E5,
+ 0x6DFE410E, 0x9F95C20D, 0x8CC531F9, 0x7EAEB2FA,
+ 0x30E349B1, 0xC288CAB2, 0xD1D83946, 0x23B3BA45,
+ 0xF779DEAE, 0x05125DAD, 0x1642AE59, 0xE4292D5A,
+ 0xBA3A117E, 0x4851927D, 0x5B016189, 0xA96AE28A,
+ 0x7DA08661, 0x8FCB0562, 0x9C9BF696, 0x6EF07595,
+ 0x417B1DBC, 0xB3109EBF, 0xA0406D4B, 0x522BEE48,
+ 0x86E18AA3, 0x748A09A0, 0x67DAFA54, 0x95B17957,
+ 0xCBA24573, 0x39C9C670, 0x2A993584, 0xD8F2B687,
+ 0x0C38D26C, 0xFE53516F, 0xED03A29B, 0x1F682198,
+ 0x5125DAD3, 0xA34E59D0, 0xB01EAA24, 0x42752927,
+ 0x96BF4DCC, 0x64D4CECF, 0x77843D3B, 0x85EFBE38,
+ 0xDBFC821C, 0x2997011F, 0x3AC7F2EB, 0xC8AC71E8,
+ 0x1C661503, 0xEE0D9600, 0xFD5D65F4, 0x0F36E6F7,
+ 0x61C69362, 0x93AD1061, 0x80FDE395, 0x72966096,
+ 0xA65C047D, 0x5437877E, 0x4767748A, 0xB50CF789,
+ 0xEB1FCBAD, 0x197448AE, 0x0A24BB5A, 0xF84F3859,
+ 0x2C855CB2, 0xDEEEDFB1, 0xCDBE2C45, 0x3FD5AF46,
+ 0x7198540D, 0x83F3D70E, 0x90A324FA, 0x62C8A7F9,
+ 0xB602C312, 0x44694011, 0x5739B3E5, 0xA55230E6,
+ 0xFB410CC2, 0x092A8FC1, 0x1A7A7C35, 0xE811FF36,
+ 0x3CDB9BDD, 0xCEB018DE, 0xDDE0EB2A, 0x2F8B6829,
+ 0x82F63B78, 0x709DB87B, 0x63CD4B8F, 0x91A6C88C,
+ 0x456CAC67, 0xB7072F64, 0xA457DC90, 0x563C5F93,
+ 0x082F63B7, 0xFA44E0B4, 0xE9141340, 0x1B7F9043,
+ 0xCFB5F4A8, 0x3DDE77AB, 0x2E8E845F, 0xDCE5075C,
+ 0x92A8FC17, 0x60C37F14, 0x73938CE0, 0x81F80FE3,
+ 0x55326B08, 0xA759E80B, 0xB4091BFF, 0x466298FC,
+ 0x1871A4D8, 0xEA1A27DB, 0xF94AD42F, 0x0B21572C,
+ 0xDFEB33C7, 0x2D80B0C4, 0x3ED04330, 0xCCBBC033,
+ 0xA24BB5A6, 0x502036A5, 0x4370C551, 0xB11B4652,
+ 0x65D122B9, 0x97BAA1BA, 0x84EA524E, 0x7681D14D,
+ 0x2892ED69, 0xDAF96E6A, 0xC9A99D9E, 0x3BC21E9D,
+ 0xEF087A76, 0x1D63F975, 0x0E330A81, 0xFC588982,
+ 0xB21572C9, 0x407EF1CA, 0x532E023E, 0xA145813D,
+ 0x758FE5D6, 0x87E466D5, 0x94B49521, 0x66DF1622,
+ 0x38CC2A06, 0xCAA7A905, 0xD9F75AF1, 0x2B9CD9F2,
+ 0xFF56BD19, 0x0D3D3E1A, 0x1E6DCDEE, 0xEC064EED,
+ 0xC38D26C4, 0x31E6A5C7, 0x22B65633, 0xD0DDD530,
+ 0x0417B1DB, 0xF67C32D8, 0xE52CC12C, 0x1747422F,
+ 0x49547E0B, 0xBB3FFD08, 0xA86F0EFC, 0x5A048DFF,
+ 0x8ECEE914, 0x7CA56A17, 0x6FF599E3, 0x9D9E1AE0,
+ 0xD3D3E1AB, 0x21B862A8, 0x32E8915C, 0xC083125F,
+ 0x144976B4, 0xE622F5B7, 0xF5720643, 0x07198540,
+ 0x590AB964, 0xAB613A67, 0xB831C993, 0x4A5A4A90,
+ 0x9E902E7B, 0x6CFBAD78, 0x7FAB5E8C, 0x8DC0DD8F,
+ 0xE330A81A, 0x115B2B19, 0x020BD8ED, 0xF0605BEE,
+ 0x24AA3F05, 0xD6C1BC06, 0xC5914FF2, 0x37FACCF1,
+ 0x69E9F0D5, 0x9B8273D6, 0x88D28022, 0x7AB90321,
+ 0xAE7367CA, 0x5C18E4C9, 0x4F48173D, 0xBD23943E,
+ 0xF36E6F75, 0x0105EC76, 0x12551F82, 0xE03E9C81,
+ 0x34F4F86A, 0xC69F7B69, 0xD5CF889D, 0x27A40B9E,
+ 0x79B737BA, 0x8BDCB4B9, 0x988C474D, 0x6AE7C44E,
+ 0xBE2DA0A5, 0x4C4623A6, 0x5F16D052, 0xAD7D5351
+};
+
+u_int32_t
+sctp_crc32c(const void *packet, u_int32_t len)
+{
+ u_int32_t i, crc32c;
+ u_int8_t byte0, byte1, byte2, byte3;
+ const u_int8_t *buf = (const u_int8_t *)packet;
+
+ crc32c = ~0;
+ for (i = 0; i < len; i++)
+ CRC32C(crc32c, buf[i]);
+ crc32c = ~crc32c;
+ byte0 = crc32c & 0xff;
+ byte1 = (crc32c>>8) & 0xff;
+ byte2 = (crc32c>>16) & 0xff;
+ byte3 = (crc32c>>24) & 0xff;
+ crc32c = ((byte0 << 24) | (byte1 << 16) | (byte2 << 8) | byte3);
+ return htonl(crc32c);
+}
+
+/*
* Subtract 2 timeval structs: out = out - in.
* Out is assumed to be within about LONG_MAX seconds of in.
*/
diff --git a/crypto/openssh/moduli b/crypto/openssh/moduli
index 49f76ee..dff3c24 100644
--- a/crypto/openssh/moduli
+++ b/crypto/openssh/moduli
@@ -1,262 +1,276 @@
-# $OpenBSD: moduli,v 1.8 2012/08/29 05:06:54 dtucker Exp $
+# $OpenBSD: moduli,v 1.12 2015/05/22 02:45:42 dtucker Exp $
# Time Type Tests Tries Size Generator Modulus
-20120821044040 2 6 100 1023 5 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A770E2EC9F
-20120821044046 2 6 100 1023 2 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A7711F2C6B
-20120821044047 2 6 100 1023 2 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A771225323
-20120821044048 2 6 100 1023 2 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A7712507AB
-20120821044050 2 6 100 1023 2 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A7712A2DB3
-20120821044051 2 6 100 1023 5 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A7712CACEF
-20120821044053 2 6 100 1023 2 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A7713959C3
-20120821044057 2 6 100 1023 2 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A7715BBA13
-20120821044103 2 6 100 1023 5 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A77191592F
-20120821044104 2 6 100 1023 5 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A771938E1F
-20120821044106 2 6 100 1023 5 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A771A1E127
-20120821044108 2 6 100 1023 2 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A771B3CDFB
-20120821044109 2 6 100 1023 2 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A771B71913
-20120821044111 2 6 100 1023 5 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A771C2759F
-20120821044113 2 6 100 1023 5 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A771CF8ABF
-20120821044114 2 6 100 1023 2 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A771D2B49B
-20120821044116 2 6 100 1023 2 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A771DF6193
-20120821044117 2 6 100 1023 2 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A771E67E33
-20120821044120 2 6 100 1023 2 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A771FA581B
-20120821044121 2 6 100 1023 2 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A772027DDB
-20120821044123 2 6 100 1023 2 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A772093F8B
-20120821044124 2 6 100 1023 5 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A7720EEF6F
-20120821044125 2 6 100 1023 5 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A77216CAD7
-20120821044126 2 6 100 1023 2 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A77219A90B
-20120821044129 2 6 100 1023 2 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A7722A0103
-20120821044130 2 6 100 1023 5 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A772343DBF
-20120821044133 2 6 100 1023 5 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A772460C3F
-20120821044137 2 6 100 1023 5 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A7726A4E0F
-20120821044138 2 6 100 1023 2 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A772716D8B
-20120821044141 2 6 100 1023 2 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A7728D719B
-20120821044143 2 6 100 1023 2 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A77297AA8B
-20120821044145 2 6 100 1023 2 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A772A8794B
-20120821044147 2 6 100 1023 2 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A772B4D6AB
-20120821044149 2 6 100 1023 5 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A772BD325F
-20120821044150 2 6 100 1023 5 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A772BDAE07
-20120821044151 2 6 100 1023 2 D9277DAA27DB131C03B108D41A76B4DA8ACEECCCAE73D2E48CEDAAA70B09EF9F04FB020DCF36C51B8E485B26FABE0337E24232BE4F4E693548310244937433FB1A5758195DC73B84ADEF8237472C46747D79DC0A2CF8A57CE8DBD8F466A20F8551E7B1B824B2E4987A8816D9BC0741C2798F3EBAD3ADEBCC78FCE6A772C95CE3
-20120821044502 2 6 100 1535 5 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F96361507
-20120821044515 2 6 100 1535 5 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F965885BF
-20120821044519 2 6 100 1535 5 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F966006C7
-20120821044528 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F9674A0EB
-20120821044539 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F969457F3
-20120821044544 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F969BE79B
-20120821044606 2 6 100 1535 5 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F96E1E827
-20120821044623 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F9714284B
-20120821044630 2 6 100 1535 5 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F97231CB7
-20120821044636 2 6 100 1535 5 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F972E01DF
-20120821044647 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F974BCED3
-20120821044650 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F974C3A43
-20120821044653 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F974E8F73
-20120821044701 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F9763403B
-20120821044705 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F9767666B
-20120821044708 2 6 100 1535 5 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F9768D81F
-20120821044726 2 6 100 1535 5 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F979FD437
-20120821044729 2 6 100 1535 5 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F97A29BC7
-20120821044732 2 6 100 1535 5 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F97A56447
-20120821044737 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F97AEDBDB
-20120821044740 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F97B187F3
-20120821044746 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F97BC6EE3
-20120821044757 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F97DCCDEB
-20120821044817 2 6 100 1535 5 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F981975F7
-20120821044831 2 6 100 1535 5 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F983EC267
-20120821044841 2 6 100 1535 5 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F985A032F
-20120821044846 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F9863B0AB
-20120821044852 2 6 100 1535 5 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F986E5C7F
-20120821044911 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F98A8FF6B
-20120821044917 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F98B40E4B
-20120821044924 2 6 100 1535 5 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F98C5840F
-20120821044940 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F98F22CEB
-20120821044947 2 6 100 1535 5 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F99040FFF
-20120821044954 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F99139AE3
-20120821045010 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F9940BEFB
-20120821045017 2 6 100 1535 5 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F9954379F
-20120821045020 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F99548C23
-20120821045023 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F99562FC3
-20120821045028 2 6 100 1535 5 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F9960CDCF
-20120821045038 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F997AC0B3
-20120821045045 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F998D9B6B
-20120821045050 2 6 100 1535 5 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F9994BB77
-20120821045059 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F99AC001B
-20120821045101 2 6 100 1535 5 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F99AC5547
-20120821045107 2 6 100 1535 5 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F99B86567
-20120821045110 2 6 100 1535 5 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F99BA2677
-20120821045128 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F99EF4523
-20120821045154 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F9A419DAB
-20120821045214 2 6 100 1535 5 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F9A7D1E67
-20120821045218 2 6 100 1535 2 D1391174233D315398FE2830AC6B2B66BCCD01B0A634899F339B7879F1DB85712E9DC4E4B1C6C8355570C1D2DCB53493DF18175A9C53D1128B592B4C72D97136F5542FEB981CBFE8012FDD30361F288A42BD5EBB08BAB0A5640E1AC48763B2ABD1945FEE36B2D55E1D50A1C86CED9DD141C4E7BE2D32D9B562A0F8E2E927020E91F58B57EB9ACDDA106A59302D7E92AD5F6E851A45FA1CFE86029A0F727F65A8F475F33572E2FDAB6073F0C21B8B54C3823DB2EF068927E5D747498F9A826443
-20120821045639 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293680B09D63
-20120821045830 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C6042936814C2FFB
-20120821050046 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C60429368214FC53
-20120821050054 2 6 100 2047 5 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C60429368218E83F
-20120821050118 2 6 100 2047 5 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293682361D5F
-20120821050218 2 6 100 2047 5 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C6042936828ADA17
-20120821050243 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293682A8A7CB
-20120821050427 2 6 100 2047 5 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C60429368341AC87
-20120821050515 2 6 100 2047 5 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C6042936837F8657
-20120821050545 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293683A3DFD3
-20120821050554 2 6 100 2047 5 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293683A9635F
-20120821050636 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293683DF582B
-20120821050648 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293683E86803
-20120821050758 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293684495A13
-20120821050807 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C6042936844FAB5B
-20120821050849 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C60429368486D99B
-20120821050916 2 6 100 2047 5 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293684A776A7
-20120821050942 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293684C4FF73
-20120821051003 2 6 100 2047 5 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293684DB980F
-20120821051010 2 6 100 2047 5 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293684DD4FBF
-20120821051158 2 6 100 2047 5 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293685721537
-20120821051206 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293685768253
-20120821051231 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293685930F13
-20120821051240 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293685987B0B
-20120821051324 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293685D5E36B
-20120821051349 2 6 100 2047 5 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293685F3AB7F
-20120821051424 2 6 100 2047 5 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293686206187
-20120821051516 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C60429368668EB4B
-20120821051540 2 6 100 2047 5 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C60429368686EB87
-20120821051622 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293686BCCF13
-20120821051703 2 6 100 2047 5 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293686F13B9F
-20120821051715 2 6 100 2047 5 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293686FB2D4F
-20120821051837 2 6 100 2047 5 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C6042936876ED7DF
-20120821051843 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C6042936876F05DB
-20120821051930 2 6 100 2047 5 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293687AEDE8F
-20120821052131 2 6 100 2047 5 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293688637CFF
-20120821053137 2 6 100 3071 5 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF942284EA9F
-20120821053209 2 6 100 3071 5 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF94228B7F67
-20120821053317 2 6 100 3071 5 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF9422A2B3C7
-20120821053841 2 6 100 3071 5 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF94232DEF87
-20120821054039 2 6 100 3071 2 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF942359AB7B
-20120821054334 2 6 100 3071 5 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF9423A371A7
-20120821054455 2 6 100 3071 5 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF9423C1CEEF
-20120821054844 2 6 100 3071 5 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF9424273F1F
-20120821055307 2 6 100 3071 5 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF9424987667
-20120821055436 2 6 100 3071 2 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF9424B90BAB
-20120821055700 2 6 100 3071 5 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF9424F6C7CF
-20120821060224 2 6 100 3071 5 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF94258ADCEF
-20120821060334 2 6 100 3071 2 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF9425A1FCEB
-20120821060420 2 6 100 3071 2 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF9425AEBF43
-20120821060927 2 6 100 3071 5 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF942634C34F
-20120821061829 2 6 100 3071 5 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF94272F0D4F
-20120821062020 2 6 100 3071 5 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF94275B00B7
-20120821062241 2 6 100 3071 5 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF9427941F5F
-20120821063416 2 6 100 3071 5 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF9428D5E367
-20120821063648 2 6 100 3071 5 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF942917E127
-20120821064052 2 6 100 3071 2 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF9429825A2B
-20120821064951 2 6 100 3071 2 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF942A74C4EB
-20120821065736 2 6 100 3071 2 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF942B4640D3
-20120821071146 2 6 100 3071 2 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF942CCD6D1B
-20120821071337 2 6 100 3071 2 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF942CF9321B
-20120821072545 2 6 100 3071 5 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF942E48654F
-20120821075022 2 6 100 3071 2 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF9430F1B6A3
-20120821080229 2 6 100 3071 2 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF9432356F63
-20120821081230 2 6 100 3071 2 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF94333D9363
-20120821081746 2 6 100 3071 5 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF9433C6A7A7
-20120821081811 2 6 100 3071 2 DFAA35D35531E0F524F0099877A482D2AC8D589F374394A262A8E81A8A4FB2F65FADBAB395E05D147B29D486DFAA41F41597A256DA82A8B6F76401AED53D0253F956CEC610D417E42E3B287F7938FC24D8821B40BFA218A956EB7401BED6C96C68C7FD64F8170A8A76B953DD2F05420118F6B144D8FE48060A2BCB85056B478EDEF96DBC70427053ECD2958C074169E9550DD877779A3CF17C5AC850598C7586BEEA9DCFE9DD2A5FB62DF5F33EA7BC00CDA31B9D2DD721F979EA85B6E63F0C4E30BDDCD3A335522F9004C4ED50B15DC537F55324DD4FA119FB3F101467C6D7E1699DE4B3E3C478A8679B8EB3FA5C9B826B44530FD3BE9AD3063B240B0C853EBDDBD68DD940332D98F148D5D9E1DC977D60A0D23D0CA1198637FEAE4E7FAAC173AF2B84313A666CFB4EE6972811921D0AD867CE57F3BBC8D6CB057E3B66757BB46C9F72662624D44E14528327E3A7100E81A12C43C4E236118318CD90C8AA185BBB0C764826DAEAEE8DD245C5B451B4944E6122CC522D1C335C2EEF9433C94C93
-20120821084945 2 6 100 4095 5 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA45B27D047
-20120821091240 2 6 100 4095 2 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA45C370A33
-20120821092428 2 6 100 4095 2 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA45CBB9FBB
-20120821093047 2 6 100 4095 2 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA45D001E73
-20120821095420 2 6 100 4095 5 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA45E104D6F
-20120821095624 2 6 100 4095 5 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA45E21E2BF
-20120821102749 2 6 100 4095 2 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA45F9B1B7B
-20120821105854 2 6 100 4095 5 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA4610E205F
-20120821110658 2 6 100 4095 5 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA461631FBF
-20120821110744 2 6 100 4095 2 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA461635E3B
-20120821115206 2 6 100 4095 5 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA4636E0DF7
-20120821121256 2 6 100 4095 2 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA4645F38B3
-20120821121421 2 6 100 4095 2 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA46467609B
-20120821122649 2 6 100 4095 2 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA464F87D6B
-20120821122854 2 6 100 4095 2 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA46508F94B
-20120821125200 2 6 100 4095 2 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA4661CBC5B
-20120821130613 2 6 100 4095 2 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA466BC6B33
-20120821131115 2 6 100 4095 5 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA466ED9CC7
-20120821132817 2 6 100 4095 2 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA467B278B3
-20120821135349 2 6 100 4095 2 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA468D8351B
-20120821141206 2 6 100 4095 5 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA469A817A7
-20120821144909 2 6 100 4095 5 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA46B488EF7
-20120821150021 2 6 100 4095 5 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA46BC5D5E7
-20120821153843 2 6 100 4095 2 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA46D774723
-20120821162006 2 6 100 4095 2 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA46F5488DB
-20120821170404 2 6 100 4095 5 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA47157A067
-20120821173305 2 6 100 4095 2 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA472A1E94B
-20120821173936 2 6 100 4095 5 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA472E0E57F
-20120821174533 2 6 100 4095 2 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA4731F7433
-20120821180053 2 6 100 4095 5 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA473C7CE3F
-20120821180952 2 6 100 4095 5 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA4742A8237
-20120821181124 2 6 100 4095 2 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA474343C5B
-20120821183540 2 6 100 4095 2 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA4754D89DB
-20120821183852 2 6 100 4095 5 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA47569B47F
-20120821184512 2 6 100 4095 2 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA475AC57DB
-20120821184603 2 6 100 4095 2 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA475AD78CB
-20120821184701 2 6 100 4095 5 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA475B0038F
-20120821185939 2 6 100 4095 5 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA4763BD72F
-20120821190630 2 6 100 4095 5 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA476853BB7
-20120821190945 2 6 100 4095 2 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA476A47843
-20120821195501 2 6 100 4095 5 EF07B0F39662DC8600224E46AB8BE8CB72E552D52E88013D20EC039A0697ED9AAD018B16F0B910D4AD54437B8585AAA4EAE0CE216E31F50EDF0CD05DAF5E02A73D399C91B38220EC3B62C42D1CF6BF06378533A70C1F8F4F4416DD542213D3432412125FDBFF7B9473CE6F8812D860E66282C9F34C1774D1EA57D54DADDF7E37A12C4A6AD5B4A30128C29D27D03B6535C0F7A8AF857E18ECAB992984E6D546918AAACB971A2AC2C2E7AF79A9547979E6342DB7443985E5F7EDF6F9F22B600EEB42CB84A5F1ACD76E213C52E3052DAE1A9119801CFA28E6EFD4F6BC35FA06C8724D78A96AF054826C0BF865D0EC5F6F4D31C1D3F7CF2FE6F16AF267A7BA04753AEF420D4D8C36BCE8D9694814B9E9C3DF468064EB5636405C71CA9D8D50D36570B42639C9C2C02FB3A3D0C6B28DD200B0AF164C621D60B12E35E4D00129C8900F6EFDBB49FF34DD64CB13CD4087A7F84FEFD77D4E8099C2B804BA643EAFCA66D1F02BD09AE44AC83A5149F60711B7B108C01D53FF15FA59B36BE62A870F163F5063CEE103B377808343AFBD32271199E26D93734011BED2305EDE2E841EAD512E23B8C9B8CD4D398C7B4C8B76B355CC150B66B8EB7779E2CA519E10E45D0FB138676850C56F23DB135F546D364B92BC1C9423E089D30D4D57D27D7885EE14AE135A488C0542C3719FBEF46F4BB5FB53A28DA26DDF84C8BC55348A8AA478A96AEF
-20120705232031 2 6 100 6143 2 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B241215BB
-20120705233800 2 6 100 6143 2 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B246EC93B
-20120706002709 2 6 100 6143 5 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B2582B477
-20120706013826 2 6 100 6143 2 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B271419A3
-20120706014732 2 6 100 6143 2 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B273FB1BB
-20120706021008 2 6 100 6143 5 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B27B7E59F
-20120705225552 2 6 100 6143 2 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B29C4E81B
-20120705233754 2 6 100 6143 5 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B2AB07037
-20120705234834 2 6 100 6143 2 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B2AE25CBB
-20120706024556 2 6 100 6143 5 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B2EDFAA6F
-20120705233556 2 6 100 6143 2 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B30EE83EB
-20120706002117 2 6 100 6143 5 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B31E6F727
-20120705233808 2 6 100 6143 5 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B37267537
-20120706001148 2 6 100 6143 5 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B3DF98C1F
-20120706013155 2 6 100 6143 2 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B3FBB98EB
-20120706025705 2 6 100 6143 5 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B418898A7
-20120706022948 2 6 100 6143 2 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B4707179B
-20120705233534 2 6 100 6143 5 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B4F3D25C7
-20120706014542 2 6 100 6143 2 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B520205CB
-20120706030026 2 6 100 6143 2 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B539518DB
-20120706003519 2 6 100 6143 2 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B566E0243
-20120706032218 2 6 100 6143 5 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B59E508EF
-20120706033523 2 6 100 6143 5 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B5A254F5F
-20120705235242 2 6 100 6143 5 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B5B60C48F
-20120706022615 2 6 100 6143 2 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B646A1B3B
-20120706032540 2 6 100 6143 5 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B6594B14F
-20120706001843 2 6 100 6143 2 EEBCAD36F686DDEB790C1EBDF6C6355A4EEB95435785FAC26C1DDBBD0D3C284AB5B4A1D5BA22131604AAE087D8B9431038CDA76DAA9E1C8D10793F53374FDF26489D38FF13188B6961B86E44A065D2FADEFC6C9496350AFA4129C9FD1B6B321E6053A6C645978C151D623C1106FE6669C220690B637F6259522F88250CC2B1B7F170706E9CE741F6E26BB4E86FB6822B13D8A7CE99FEF5CD66EF08310ECE5CC86648BD90E1DC59332505579116D3F3C8314065DC1319BEA133ED809903CA4949905C3D21619217816465E964768FFE76BC962AACBC8FF13477990A81C8759BBE95DFFA22E299F7C0F79A0EA7C44B28E8AB96149CC213E7C886E3D0A2230D7A4176749D6EDD6FCA2F5F3E2BD10392BC818CFB25C696C1EC14CE6F23CDB6C3DA2ED77E098A874799EB65F82A4EAF85CA0C9E68278381AF964AA5816B2CDA8E1ABB2954C02F641E1F374563B0F9DBF2F1B6D8168558BB971C8F48668A8034F82908D45D4D9A9072375D00AE0D5D442C6E6B6B2E7280C104C7675FDB0795DD0D3273E74BDC7B243B7604447502EB1572A273ABA0032CDB754345B1ACDF17B5AEDA45B661DBEFDA084B1427F94C8EA62BAB6A1E05DED8F2F706445879F15FB096996765238B6B546FDE5F219B5B85B31E804A989C4959600998A03572FB59DC150714BDB0C71A236497AE79871FBEFCAFFF34D2DF0142F2AF3C9C5D92F5FC7A61A27FF9AA1EADDF3552A2BED2CC4D19FB0F67DCC02744947A42FE10B338A3A8E634B413AE46C4E644DD5934D5820C9714656171A02BBCA25AED1CCD9EB9BEF9C63E7E966B0E2E47146191ECA452588FA2AFF50AF25FABAF83E143D47A651BD9B9C37CF5D6319FDCBC2F5D4B76D07B52D857FDE48FD983F06B531F7D316E2961E17D358FE6556C82C2E78C1D9CCF68760EFD8CC692E8912914781651D834C0C766B3D71C07C91AB93619E0C06385CFAC6FA18E1DEC7F3C5EE92C906CC49A4786D24CDB4F5656DE60F1F4412367B16BDA68DA368218C16E30C48366A8C0FDFA6E708E3353B8471402A42E594903774A65EA7AB5A83D08AD10D34DB38201B44B677C3593
-20120705054703 2 6 100 8191 5 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE234453518A0F7
-20120705060217 2 6 100 8191 5 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE23445353B291F
-20120705100916 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE2344537DF8F1B
-20120705112627 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE2344538AF7C7B
-20120705121419 2 6 100 8191 5 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE23445392BB61F
-20120705162623 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE234453BD5FE03
-20120705171958 2 6 100 8191 5 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE234453C6257EF
-20120705222541 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE234453FBF1073
-20120705120012 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE2344544BA2363
-20120705143238 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE23445464ED33B
-20120705175610 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE23445486B9E93
-20120705143839 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE2344551AEBB1B
-20120705164833 2 6 100 8191 5 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE2344553053057
-20120705195911 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE2344560200E33
-20120705051445 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE23445620DCB9B
-20120705090103 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE234456453E2C3
-20120705102457 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE234456520F7B3
-20120705045958 2 6 100 8191 5 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE234456CC34FE7
-20120705064048 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE234456DBB1643
-20120705100057 2 6 100 8191 5 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE234456FACFC3F
-20120705130216 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE23445716EEFD3
-20120705184211 2 6 100 8191 5 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE2344574BD3B0F
-20120705075506 2 6 100 8191 5 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE234457918ED6F
-20120705111016 2 6 100 8191 5 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE23445857E1707
-20120705051124 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE234458C6078E3
-20120705054255 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE234458CA4E313
-20120705155949 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE234459281E7B3
-20120705065517 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE2344597A57CB3
-20120705082307 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE23445987253DB
-20120705182442 2 6 100 8191 5 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE234459E124B2F
-20120705184956 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE234459E442F5B
-20120705071209 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE23445A1E0FD83
-20120705155527 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE23445A6BDA473
-20120705103912 2 6 100 8191 5 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE23445ADCE429F
-20120705115451 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE23445AE75FB83
-20120705133531 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE23445AF5813A3
-20120705144902 2 6 100 8191 5 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE23445AFF92FDF
-20120705160631 2 6 100 8191 5 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE23445B0A9AF9F
-20120705194100 2 6 100 8191 2 DA2167F01CB32874E032B38C40FEC5F2557C9C4411B3A4B3D38C889A8BEED4EB7EF08A9A1E1EAAEEC22C2A46891D3CA84517FDFCDFA2BACBCDE2FC8EA87182542F5C8D3897B6C8A6DB951256F3DDBA7C5D6E7060925AD1F3046F49D00B433770B412DAA2A74E539EB81E3266DDDA82781BB21B19695FB925FA8BB6D249B5C33401C5D9E5C6B1719A36F1EB36E7CCD28AD98AA74DFD453D343BD189C968EB8F459809E87F77C6BA985B82B960A46660C7A277970E016EBD183CE7D6232F56EB06ECC0931024B9333879EF063F976C3603649AB9DCBE9714753E0A865020C3EF22BABF2F473F771CFC70A7C43FE320640D6E2816E88B6CA501A85A34F88EFF26AD8FFA0D11B0A21CB1A4FC7F90DB97B11BD5367302CBB45A390D2CB28CE83D50156A161D0080FD5F3961872ABC56FBCB973C517F6D7205E6CCF44E22E5DF8793D5037A9E779A52628D258CEA6B45CA4AC604CD69875D51145EE4C3D8856E24F9DBCA0134D54A734320A46A0AF52E20DD604AD465508172D4185C0D5C720B325ABC1760B1680B7BDFBAA1AE845A84AC3C7BBC53CD01C000B2186DC3915A1879224DD703E817C58F5FFCFBDF0189BB4B5033769F49852F3C48A88B88FB659B4AC96EE9DFC1D7E1760194EE4E1B6A8052BA17C827BE8A74C9F3FA7EA3236171F3DF9ACF19C40636825F1C49EFAAB12CEAD24F4585FE7C466FDE7ACF7E1FC91C8D473A8AB12C652AF568227E7CE3421256F83084D8E82DC977309E5B8C73EB8D92B71B9DAF6A53D13539D55C1A67BAC646358352529958AA3599DF0D882B8640ABFF17031C3F246A3E07F86AEB29CEACACF3B3EB931C40D292D09F4B99E08E4C68D811F9425DA30AC456107454AAC470DBD627C3EE2132E7C6FCEB61C2BA1CBE4FE6F07A2A4E398FDFBECC0283E9CF440F9F8F6893D019A98EFE992BA7433951DF341A3B3A8E879B090FB0E11907382853FBD6FA79B5B3FFF4EBE286F92A99D24C548949209867B1116BDBE1F104230EE26CCA0A12602A328B9B7A86D18415881AEFC9527AD4BB563CC330F29DF51199E1E9F0317EE6F3768C0849351FC1F95D47A1DE90484BE923ADC004D8287A90168C1D1491AD9A9B3266A826F966AA964E814F171FF9F3BA755DF83961182D95317844D6064D8BDED2DDB9AB4D74C325C1748036103690D88D85B532B692B74ED199253CB77E3BA57A2369BD9DD3B4FE68A66A1EFE507BA1F1A0164B6EDF397DF550EAC7FA155F7DED564A34DA73BC1F72E2D56CBABADAF3ED6B03C56FE00CA51548604403757ACAE67C71C564D4F688BA44465C7D3FFC84DB2BA142E06A967181CA0806E732134D795AD6E936BB25C00A14FE0DA5A83A7095D0271B380E802CD9E6E601C582EAC20CB6AC0C670108376302BA364FFD30E78D0CAB72BADB15F282CD256BC3B365896D80DC170BE23445B296E223
+20150520233853 2 6 100 1023 5 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA2AC62AF
+20150520233854 2 6 100 1023 5 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA2BCC50F
+20150520233854 2 6 100 1023 2 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA2C241F3
+20150520233855 2 6 100 1023 5 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA2DDF347
+20150520233856 2 6 100 1023 2 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA2E3FDBB
+20150520233857 2 6 100 1023 2 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA3006603
+20150520233858 2 6 100 1023 5 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA31D9C37
+20150520233859 2 6 100 1023 2 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA333355B
+20150520233900 2 6 100 1023 2 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA3428B23
+20150520233902 2 6 100 1023 2 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA37C9A43
+20150520233903 2 6 100 1023 5 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA384B367
+20150520233903 2 6 100 1023 2 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA3903453
+20150520233904 2 6 100 1023 5 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA3946C77
+20150520233904 2 6 100 1023 2 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA39F6A9B
+20150520233904 2 6 100 1023 2 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA3A0E88B
+20150520233905 2 6 100 1023 2 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA3A37763
+20150520233906 2 6 100 1023 5 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA3BBDD57
+20150520233906 2 6 100 1023 5 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA3BDCDD7
+20150520233906 2 6 100 1023 2 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA3BF5D73
+20150520233907 2 6 100 1023 2 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA3C9BB83
+20150520233908 2 6 100 1023 5 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA3E5ADCF
+20150520233909 2 6 100 1023 5 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA3F82077
+20150520233910 2 6 100 1023 5 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA406944F
+20150520233910 2 6 100 1023 5 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA40F7457
+20150520233912 2 6 100 1023 2 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA438733B
+20150520233913 2 6 100 1023 2 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA44707FB
+20150520233914 2 6 100 1023 2 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA4588A2B
+20150520233916 2 6 100 1023 2 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA48CC01B
+20150520233917 2 6 100 1023 5 DB662973FB21C0B7BF21AB46AFD3E2002AE70C92DE6B9AEAFECF7B0A96D7ACB024B7C29DB18E70CB945FA54C7773519BC7161648AFE4939058AC40ECDBBD3636F5BF45863117E955007C9D0F9333BB4EF62F7C9F6298AB79A309C734F3CF201C61EBC3926ADD4E80968A65D9F60535164ACE7A7BFEDC1022002BB2BBA4960077
+20150520234251 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A740BE2123
+20150520234255 2 6 100 1535 5 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A740D85877
+20150520234257 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A740E6494B
+20150520234301 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A741120F9B
+20150520234303 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A7411EAC5B
+20150520234304 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A7412579DB
+20150520234311 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A74167053B
+20150520234312 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A74169B303
+20150520234318 2 6 100 1535 5 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A741A3D69F
+20150520234322 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A741C07E23
+20150520234330 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A7420B48E3
+20150520234331 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A74215059B
+20150520234336 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A74240BD03
+20150520234338 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A7424D70BB
+20150520234341 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A7425C6CE3
+20150520234342 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A74264FA9B
+20150520234343 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A7426BB34B
+20150520234346 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A74285D9E3
+20150520234347 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A742878293
+20150520234348 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A74288D143
+20150520234356 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A742D55BF3
+20150520234401 2 6 100 1535 5 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A742FC8227
+20150520234410 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A7436032EB
+20150520234411 2 6 100 1535 5 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A74361377F
+20150520234415 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A7437CCCFB
+20150520234418 2 6 100 1535 5 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A743902C1F
+20150520234420 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A7439EE5DB
+20150520234422 2 6 100 1535 5 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A743AE19BF
+20150520234430 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A7440152AB
+20150520234432 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A7440C2F63
+20150520234434 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A7441FBDEB
+20150520234436 2 6 100 1535 5 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A7442C98DF
+20150520234437 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A744319703
+20150520234438 2 6 100 1535 5 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A74433E927
+20150520234444 2 6 100 1535 5 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A7446DF46F
+20150520234450 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A744A3488B
+20150520234455 2 6 100 1535 2 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A744CDAACB
+20150520234459 2 6 100 1535 5 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A744E9D8FF
+20150520234504 2 6 100 1535 5 F8F4A446A6C7196643612A6C5CC26A47E491FB737740D68BBEBF0130F7AAADC59075781FB1723B644C0ADCE548C02E726DE5233C484FB4481F3EF3ED0585A0D687B2E0A6987AD2BC910754FC1A1E06B87710CFF0BC2E9868BA15BA20C103D3DCA6B65D8D0182B277F7CAE61D83A785BDD0B3CE471B4B8FAB224438D7A6772130167110AFD1FF584861996117F67B41CF3D2D5FAB020F2EB7F53E299AACF98797AEB6BAC3F0BB892DB4E4F8CDDE28C112C73EB556D0C381C6B9CC78A745196237
+20150520235007 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031E9A9C5F7
+20150520235015 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031E9CBB21F
+20150520235039 2 6 100 2047 2 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EA2E9623
+20150520235043 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EA33E3DF
+20150520235057 2 6 100 2047 2 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EA68038B
+20150520235114 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EAAB0717
+20150520235122 2 6 100 2047 2 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EAC2A7FB
+20150520235125 2 6 100 2047 2 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EAC82DD3
+20150520235154 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EB40583F
+20150520235214 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EB94F247
+20150520235218 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EB9DF49F
+20150520235239 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EBF7BE27
+20150520235244 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EC0B4F4F
+20150520235250 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EC21070F
+20150520235256 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EC36541F
+20150520235307 2 6 100 2047 2 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EC5FE22B
+20150520235322 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031ECA1FB57
+20150520235331 2 6 100 2047 2 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031ECC3C823
+20150520235349 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031ED035187
+20150520235400 2 6 100 2047 2 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031ED2F07DB
+20150520235407 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031ED4620CF
+20150520235422 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031ED86D39F
+20150520235424 2 6 100 2047 2 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031ED86E683
+20150520235427 2 6 100 2047 2 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031ED8C3073
+20150520235443 2 6 100 2047 2 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EDCB1F63
+20150520235450 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EDE00B77
+20150520235452 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EDE42247
+20150520235458 2 6 100 2047 2 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EDF8F493
+20150520235503 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EE04D69F
+20150520235508 2 6 100 2047 2 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EE14B92B
+20150520235510 2 6 100 2047 2 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EE167933
+20150520235517 2 6 100 2047 2 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EE2DC63B
+20150520235527 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EE52259F
+20150520235539 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EE829247
+20150520235557 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EED044BF
+20150520235608 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EEFD34CF
+20150520235614 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EF0F709F
+20150520235616 2 6 100 2047 2 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EF12110B
+20150520235622 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EF25FE1F
+20150520235637 2 6 100 2047 2 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EF6BF4D3
+20150520235654 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EFAF28BF
+20150520235701 2 6 100 2047 2 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EFBFB8BB
+20150520235704 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EFC7A62F
+20150520235710 2 6 100 2047 2 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031EFD79323
+20150520235725 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031F0158F1F
+20150520235728 2 6 100 2047 2 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031F01A9E6B
+20150520235743 2 6 100 2047 2 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031F055798B
+20150520235752 2 6 100 2047 2 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031F0730BC3
+20150520235757 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031F08283FF
+20150520235825 2 6 100 2047 2 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031F0F451E3
+20150520235830 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031F0FDEFB7
+20150520235901 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031F1828ECF
+20150521000008 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031F185D7BF
+20150521000011 2 6 100 2047 2 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031F18C58FB
+20150521000014 2 6 100 2047 5 F7360753237CF1837003CDFE89D99C8149BE6C4B4CCD9D09D834FF137878C452FB4FAB5CA51BE6619BC6FEC4184FA9A96D21FDE83505B67262EEA4870FD709F4DD3A2EC36E5746ED80D762467E794FE524992EAC42D2F0F391A63E027F24411B231D25AEFE60C9329CE8FFB61A8A123C74F6755211C8CFD59915CE0DE28579B66CB426D111F90B19A5BD83AB8C2CAB09FB1F09509B029883BD154B82418B4F3A9EE4564E5F344D5B911C10829C1E975817EB2DFF49F34D95277897A7198C9C4921037B8AA091C380663A6D5260F98FA784565DE2D977C50A1079B485F4BE63B4E3D6A63FD8DD59704116A41CB1C7C2AAA449071BFBAFB0F867FCC031F191F757
+20150521000841 2 6 100 3071 2 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622CC7F06BB
+20150521001025 2 6 100 3071 2 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622CD1057AB
+20150521001131 2 6 100 3071 5 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622CD717D6F
+20150521001248 2 6 100 3071 5 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622CDDA85F7
+20150521001453 2 6 100 3071 5 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622CE8959BF
+20150521001510 2 6 100 3071 2 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622CE98227B
+20150521001623 2 6 100 3071 5 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622CEF967BF
+20150521001651 2 6 100 3071 2 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622CF18156B
+20150521001758 2 6 100 3071 5 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622CF717197
+20150521001924 2 6 100 3071 2 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622CFE1507B
+20150521002244 2 6 100 3071 5 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622D0F75427
+20150521002509 2 6 100 3071 2 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622D1BD2823
+20150521002808 2 6 100 3071 5 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622D2B4950F
+20150521002846 2 6 100 3071 5 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622D2E6D6D7
+20150521003203 2 6 100 3071 2 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622D3F5D0D3
+20150521003322 2 6 100 3071 2 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622D45851E3
+20150521003430 2 6 100 3071 5 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622D4AEE517
+20150521003629 2 6 100 3071 2 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622D5538E0B
+20150521003714 2 6 100 3071 5 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622D58BAFCF
+20150521003722 2 6 100 3071 5 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622D5916FC7
+20150521003739 2 6 100 3071 5 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622D5A378F7
+20150521004506 2 6 100 3071 2 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622D82B5113
+20150521004613 2 6 100 3071 2 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622D880CB43
+20150521004753 2 6 100 3071 2 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622D909305B
+20150521004802 2 6 100 3071 2 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622D90DBDC3
+20150521005025 2 6 100 3071 5 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622D9CBF44F
+20150521005051 2 6 100 3071 5 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622D9E89DA7
+20150521005252 2 6 100 3071 2 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622DA8BA403
+20150521005347 2 6 100 3071 2 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622DAD07F73
+20150521005825 2 6 100 3071 2 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622DC5CE5A3
+20150521005858 2 6 100 3071 5 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622DC84A597
+20150521010014 2 6 100 3071 5 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622DCE62957
+20150521010219 2 6 100 3071 5 E0C2D7F7B6E4C69A3B6632FC77BED88CAC663CE39D91DDF017816529795F33B591F80F445BE16F8FB51D11861682154B904AE2282FA0462EB6C508FD7B7AEC551A6C630FE9CC7E17E660377558E4F841CD77AABD81E6A0988823047B3A00C2E50C33035987D6EA42C65FD776051F5D43045848D4385FB37482DC9E5133D1B75E34CC81C2B87C9530F5229FF2154604A286C2E257D3A89CF330AEDBA16288E852277C5D7C6AA947B4510625312DF982A30A4D75679F707EB325CD4DF65C7A58154C6C05E28545DE69673B3EA9CCD41529A7CCEB49A3392D23E9AB083148DD956F8CA9B8CDD76496FF95B5782EE888C40EF1201EB3A52CAE1A635BBF82CD479B38DABD6DEE7A2844F8C614215B04CEBDD41039C2DC2D1CF00AFC78C0363E548FAE1DE8A7B535CC41CED767BE05F300F50C59307061ADE1CAA4614F8FEFAECE8F8C5DB3F425B348A206B0E95703EEA8785768CDB53972422C75B58A7AEA2AD9E2546EA991466E6AFE1FA157D75D3F6616DB715D10CCD6B71C73051FE622DD9517D7
+20150521011229 2 6 100 4095 2 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877F951FEB83
+20150521011834 2 6 100 4095 5 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877F960399B7
+20150521012438 2 6 100 4095 2 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877F96EE7973
+20150521014010 2 6 100 4095 2 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877F99453213
+20150521015607 2 6 100 4095 5 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877F9B549727
+20150521015640 2 6 100 4095 2 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877F9B600A7B
+20150521020946 2 6 100 4095 5 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877F9D5299DF
+20150521021536 2 6 100 4095 2 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877F9E2793D3
+20150521022706 2 6 100 4095 2 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877F9FE131CB
+20150521023922 2 6 100 4095 2 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877FA1BAC073
+20150521025234 2 6 100 4095 2 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877FA3BC9483
+20150521025424 2 6 100 4095 2 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877FA3FB3513
+20150521032445 2 6 100 4095 2 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877FA87E0FAB
+20150521032932 2 6 100 4095 5 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877FA929F00F
+20150521032947 2 6 100 4095 2 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877FA92B272B
+20150521033245 2 6 100 4095 2 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877FA9953D0B
+20150521034828 2 6 100 4095 5 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877FABDD4AEF
+20150521035044 2 6 100 4095 5 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877FAC298C7F
+20150521035111 2 6 100 4095 2 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877FAC31F17B
+20150521035749 2 6 100 4095 5 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877FAD250357
+20150521040009 2 6 100 4095 2 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877FAD788A73
+20150521040220 2 6 100 4095 2 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877FADC5F173
+20150521040316 2 6 100 4095 2 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877FADDFFC03
+20150521041042 2 6 100 4095 2 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877FAEEBDEB3
+20150521041443 2 6 100 4095 2 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877FAF7AD7BB
+20150521041831 2 6 100 4095 2 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877FB007D653
+20150521041928 2 6 100 4095 2 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877FB025C91B
+20150521042301 2 6 100 4095 2 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877FB0A4C143
+20150521042631 2 6 100 4095 5 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877FB12009F7
+20150521042740 2 6 100 4095 5 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877FB145360F
+20150521043358 2 6 100 4095 2 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877FB22FAE93
+20150521044013 2 6 100 4095 5 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877FB31527AF
+20150521044543 2 6 100 4095 5 C8BCE52E2AE7AE1EC20056B2D0764047C92392C9DF75C3A57EB8AF1062A809E6EA975D9910AA5C55833CC47D4DA76E92BF63FEBB289E5FE2ED729429DE9567D0A489FA27B41810066B96602B2E555B34628A37C4CE04984D15C36F1EAD09081D2CB2147D5F0B7E8BCF0774FFCF5F649E0CB797DD23D0801C153B6B8480828CF165C7ED3181F316F371C6EC0B6EF6B8CBE36E5A4E8C070854668AF07FE6C73C3EB817CD0E8C7F264546A1B0402AC0FCEBA5032EBA2323769CC401D262971F4B44FC1151EC4F6E761709FD6ABDC84D9C36046811F54DC86D293D16D235DC712BF7346CDAC005AE5C0DCD96480C9BD0CF7C4BD50026553E27F957B6640BA6A87C6642FF3D97A3E63DA468276E3A22C0C3F2A1CFFB4F190D5E23700BB468EA31FD3EB87B44B51BDABDB0667FCFB618CECFB2BC440A5F2E237E93A6DFF96AB3561AF5EE1BDA21720129FF2123F7038C70B4CADF1BC70B2EF5EBC264E1E3B2A4B3780D4A11507D03A498A556A923B0EFAF90D024341A47818F03D5ADD961086C2573DABF02C4E2F303817D323E1D8D88EFBE3F5E0D6688593C65254907745CA6176C8ED7D6B830875A0BA8FFEEB1882742A4553E4E55A93A7AD4F3224B7BFA03E29C77DB0FCCE0E37E6D3A64C5555ED9555FA1E2C34EC04DA3B6E0AAA7BF64879BC4724859FE806E7DC49A5394AD3D01492F05AE69CF10C67B18BDFF8E877FB3DDFBB7
+20150521004745 2 6 100 6143 2 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F52665F2B
+20150521003352 2 6 100 6143 5 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F57C7B577
+20150521005557 2 6 100 6143 5 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F591BBC57
+20150521014228 2 6 100 6143 5 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F5BDF5CE7
+20150521015455 2 6 100 6143 5 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F5C9CFD1F
+20150521001701 2 6 100 6143 2 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F5CF6FF9B
+20150521002558 2 6 100 6143 2 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F5D7C4FE3
+20150521003319 2 6 100 6143 2 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F5DE41DFB
+20150521003721 2 6 100 6143 5 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F5E1B5FAF
+20150521010943 2 6 100 6143 5 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F600B866F
+20150521014141 2 6 100 6143 2 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F61F01EC3
+20150521010312 2 6 100 6143 2 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F65EAB753
+20150521002914 2 6 100 6143 5 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F69FD9357
+20150521011058 2 6 100 6143 2 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F6C6B8513
+20150521013628 2 6 100 6143 5 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F6DE7D9EF
+20150521015040 2 6 100 6143 5 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F6EB0C897
+20150521001307 2 6 100 6143 2 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F6F15473B
+20150521012712 2 6 100 6143 2 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F7377044B
+20150521005218 2 6 100 6143 2 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F7767DEA3
+20150521003512 2 6 100 6143 5 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F7C5546F7
+20150521005420 2 6 100 6143 2 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F7D68EDC3
+20150521011347 2 6 100 6143 2 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F7E859CF3
+20150521002429 2 6 100 6143 5 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F819A93E7
+20150521004826 2 6 100 6143 5 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F88D91A57
+20150521010541 2 6 100 6143 5 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F89D29B9F
+20150521012418 2 6 100 6143 5 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F8ADC38F7
+20150521015506 2 6 100 6143 2 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F8C91980B
+20150521004000 2 6 100 6143 5 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F8E369B97
+20150521005659 2 6 100 6143 2 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F8F2B1BEB
+20150521010328 2 6 100 6143 2 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F8F7DD1D3
+20150521011152 2 6 100 6143 2 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F8FF052BB
+20150521001457 2 6 100 6143 2 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F92940463
+20150521011129 2 6 100 6143 2 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F95C47DCB
+20150521013515 2 6 100 6143 2 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F9710A103
+20150521013841 2 6 100 6143 5 D9F2DC4F4AB3E451AB7781730AE26AE5AB1927A8F93D05C7765C4F23947CBAD218690437DDE587137100CA657CB902597743E8B05CB9B821A48E081C451227F5E42404534A28EE1D0A52FA903FBB15B79139D130420B8C7BD2477CDF0C06CF4C9943DF76A74C3B503B2229A5628E13983B0426A10FD164A720488DE3A1639D004B694ADB5216C21F481519865529CE6E3C9C8B89AC00FBF2B4C1F0B0033AC2A5072A157B5D4346950917B055227557FF1EB5F0873D75E648BEE4B6F88D4B228CB89C7602E34F85BF86DDBD09CA39993C73FF59B0310754F0D24740316F7D8D21D67EC65C8715B7130EBC8E19EB712990BBB30D650ACB0B7864B632ABBC2AEE7221393A5C74B043568043480DB41821A0CE1E6D271456C2FDC243D39868FB0D7BDA3FAD5894F7DCBBC5751B77B3DF99F6E8A5BD7A5B82F594E3E0CA2BBF7DA74312227B323652E6856B597326206CAFF2380C23CF94B8CD3EAA56BE60F8C372887CD37A62FC6F5FD467ED96E7CD9C285E75C2C353E520DFB3F39FE7B8E35FFB485B1B043F52321675EDF4848266997D059810F71D21E9DB3E3AB1BCE3713DB67155F41B7C21939B285AB63DBF1770228E4EE36314310D89200F132E8ECF2968CDA0E57DBBCE589E4DDBAD009994A817032EFA52F0659A319FBD813901BF5847EC2D7979CBA5870F3DA25BE09673952628E1EA70C82EC0BE67B402E48DF85C5983516BBEEAB811D1ECAB02928D4087B826139D073501149D47B3339CDA763840E4492661FFEF96C81C816B862EEE820019CD83C93BF9DFF8EC8C59331780D5D86B164EC12BBE59F4C9E62FD7819A941D10AFE32179B2361A17618FA84864F58C09AECB817E67BC352371BB7D7F8209E4EB9002013A585092D4721B1CB464A8480CC76173989144EF51692E373E9CCEAC9807EF190D6BBDD3BB0D16CA87DC6A54890D6F074ABD83E3CF077F2F592C0745BE15D7D6871552BB6139E5CF70D684C6D1D0C4516733E0639BBEC847313BE3D1D923B6A5FAF43A5341DD8C0779881BEB92736BA4F18BD6CDC1FC922B3809ED244748101A6C7E30DDE0C232FA3F9733A497
+20150521041810 2 6 100 7679 5 D67DA234F46097F7EE3B230456E7C895BCA86395DF43D60D9D587C64EA4525FBCAD22442143068578CE8ECC8280B2D81F747B484AA668FFCDBEB067EB824B42E5FA1A40BC08EE8CC4A064298CB31C36340951EC7A006878C79C80068196180DA31E1DEF79A72B2D059203DDE461485D1B9783AF79E981CDAEF88589D8343E5B52D96FE90EA13194AFAF7459B17B80971720357ABD09CFE992966FFC1C239821C910F55D69E44277E5DE9841F4E5B2D25D6A265D321059B762F7D6AC5F0E260DEEB628D32940002B219B354486CC5BBF6390F19899EA5E145A28487029DF0517564A81FA10FA60AFA04CE77794775392829DB636E7F5EE00868D5027A6BA75CA922CEF3CA78683D14AB2E58439789033ACF441236F5E3C7849E3662B5123304F82D0061EA9C18EA1676A736FFD628AE982CCEAB8979568C43FB34207E0DEC7D8A6AA391846C910F77771ECF2D0531A234D3798BC1B1433091A895E23A77792F4BE403D526F1D260A3627F2E80E863A204A774F58D7DE2C5C4A7E463A46BC436F0B7AF07179EC334D31073BF035FD94454ECD54146473F786EA15A1CEBB3B9C0D282195AD612D33B31F5528DAB5231CB17A3DE9AB5C8BD7BF8F773C255845BC9B70A1E53A50E5AEA801FFE604A2B2C1FBE86A2A883632E7AE75ADA007FB6AB1AA529DE3151CAA8D1D07FA19EFF5679398340E720CF2CFC4E1AEDD73C44983CC8E610DD419AE2E88206573837D6E44018D9498B62F9C0B8EA7741450FC7DBFF7C546D3CBCBA5B9123577FD5531880A18F1275F9181A922803D8F03512C58B5FBBC41CE8095EDD920A3E36CEB6EDB56900E6CEC2928288909D61B3B426EBC54F0A69C261A848B358C3A8E332567B9FFC1A7A07E9414BB1F75DE0795CF87632F5D6A87A246FD4E98E70489F779FE99C5BC4DB24BFA860C3551888FC721CDBC6AB5783B02BEF893E0984B6FDB5142A1AFD3277FE8F36B87849BC00B3FB3ADAFE4EDAE4839B83894C27FEF93514D7E3FFB7A30E99C6875D96C582E81D45FB463DC37B8791FC28A759301FC2F9879960C82BC7C427382A41B9AEFAC0051A2C653E55A47B48860CDA32812A192C1508A6C012C7E4BBAB1619B7926549FD8CE27928618F035BE31D56CBC9586D88E00DA69341F6F01554E205344E49E8871CCF80F9FF5CB54479AFA66806DD02FAFEE7D43572B3AA22742635FE65BFC8004960DC679FC7F8C0E5B50B3CE1E446B7A5E189BB9AAFA06FEC472D6E67EA4905373A01A2B662F534131405FBAB9BBAE892F0C265439EA1ABC91B186B5AC1E53A0C786607B1069BC026359955CFD614D7F80DF416A08AB18991A0398A83DF3CF2D65D7BE934407F
+20150521070624 2 6 100 7679 5 D67DA234F46097F7EE3B230456E7C895BCA86395DF43D60D9D587C64EA4525FBCAD22442143068578CE8ECC8280B2D81F747B484AA668FFCDBEB067EB824B42E5FA1A40BC08EE8CC4A064298CB31C36340951EC7A006878C79C80068196180DA31E1DEF79A72B2D059203DDE461485D1B9783AF79E981CDAEF88589D8343E5B52D96FE90EA13194AFAF7459B17B80971720357ABD09CFE992966FFC1C239821C910F55D69E44277E5DE9841F4E5B2D25D6A265D321059B762F7D6AC5F0E260DEEB628D32940002B219B354486CC5BBF6390F19899EA5E145A28487029DF0517564A81FA10FA60AFA04CE77794775392829DB636E7F5EE00868D5027A6BA75CA922CEF3CA78683D14AB2E58439789033ACF441236F5E3C7849E3662B5123304F82D0061EA9C18EA1676A736FFD628AE982CCEAB8979568C43FB34207E0DEC7D8A6AA391846C910F77771ECF2D0531A234D3798BC1B1433091A895E23A77792F4BE403D526F1D260A3627F2E80E863A204A774F58D7DE2C5C4A7E463A46BC436F0B7AF07179EC334D31073BF035FD94454ECD54146473F786EA15A1CEBB3B9C0D282195AD612D33B31F5528DAB5231CB17A3DE9AB5C8BD7BF8F773C255845BC9B70A1E53A50E5AEA801FFE604A2B2C1FBE86A2A883632E7AE75ADA007FB6AB1AA529DE3151CAA8D1D07FA19EFF5679398340E720CF2CFC4E1AEDD73C44983CC8E610DD419AE2E88206573837D6E44018D9498B62F9C0B8EA7741450FC7DBFF7C546D3CBCBA5B9123577FD5531880A18F1275F9181A922803D8F03512C58B5FBBC41CE8095EDD920A3E36CEB6EDB56900E6CEC2928288909D61B3B426EBC54F0A69C261A848B358C3A8E332567B9FFC1A7A07E9414BB1F75DE0795CF87632F5D6A87A246FD4E98E70489F779FE99C5BC4DB24BFA860C3551888FC721CDBC6AB5783B02BEF893E0984B6FDB5142A1AFD3277FE8F36B87849BC00B3FB3ADAFE4EDAE4839B83894C27FEF93514D7E3FFB7A30E99C6875D96C582E81D45FB463DC37B8791FC28A759301FC2F9879960C82BC7C427382A41B9AEFAC0051A2C653E55A47B48860CDA32812A192C1508A6C012C7E4BBAB1619B7926549FD8CE27928618F035BE31D56CBC9586D88E00DA69341F6F01554E205344E49E8871CCF80F9FF5CB54479AFA66806DD02FAFEE7D43572B3AA22742635FE65BFC8004960DC679FC7F8C0E5B50B3CE1E446B7A5E189BB9AAFA06FEC472D6E67EA4905373A01A2B662F534131405FBAB9BBAE892F0C265439EA1ABC91B186B5AC1E53A0C786607B1069BC026359955CFD614D7F80DF416A08AB18991A0398A83DF3CF2D65D7BEEB1E407
+20150521051555 2 6 100 7679 2 D67DA234F46097F7EE3B230456E7C895BCA86395DF43D60D9D587C64EA4525FBCAD22442143068578CE8ECC8280B2D81F747B484AA668FFCDBEB067EB824B42E5FA1A40BC08EE8CC4A064298CB31C36340951EC7A006878C79C80068196180DA31E1DEF79A72B2D059203DDE461485D1B9783AF79E981CDAEF88589D8343E5B52D96FE90EA13194AFAF7459B17B80971720357ABD09CFE992966FFC1C239821C910F55D69E44277E5DE9841F4E5B2D25D6A265D321059B762F7D6AC5F0E260DEEB628D32940002B219B354486CC5BBF6390F19899EA5E145A28487029DF0517564A81FA10FA60AFA04CE77794775392829DB636E7F5EE00868D5027A6BA75CA922CEF3CA78683D14AB2E58439789033ACF441236F5E3C7849E3662B5123304F82D0061EA9C18EA1676A736FFD628AE982CCEAB8979568C43FB34207E0DEC7D8A6AA391846C910F77771ECF2D0531A234D3798BC1B1433091A895E23A77792F4BE403D526F1D260A3627F2E80E863A204A774F58D7DE2C5C4A7E463A46BC436F0B7AF07179EC334D31073BF035FD94454ECD54146473F786EA15A1CEBB3B9C0D282195AD612D33B31F5528DAB5231CB17A3DE9AB5C8BD7BF8F773C255845BC9B70A1E53A50E5AEA801FFE604A2B2C1FBE86A2A883632E7AE75ADA007FB6AB1AA529DE3151CAA8D1D07FA19EFF5679398340E720CF2CFC4E1AEDD73C44983CC8E610DD419AE2E88206573837D6E44018D9498B62F9C0B8EA7741450FC7DBFF7C546D3CBCBA5B9123577FD5531880A18F1275F9181A922803D8F03512C58B5FBBC41CE8095EDD920A3E36CEB6EDB56900E6CEC2928288909D61B3B426EBC54F0A69C261A848B358C3A8E332567B9FFC1A7A07E9414BB1F75DE0795CF87632F5D6A87A246FD4E98E70489F779FE99C5BC4DB24BFA860C3551888FC721CDBC6AB5783B02BEF893E0984B6FDB5142A1AFD3277FE8F36B87849BC00B3FB3ADAFE4EDAE4839B83894C27FEF93514D7E3FFB7A30E99C6875D96C582E81D45FB463DC37B8791FC28A759301FC2F9879960C82BC7C427382A41B9AEFAC0051A2C653E55A47B48860CDA32812A192C1508A6C012C7E4BBAB1619B7926549FD8CE27928618F035BE31D56CBC9586D88E00DA69341F6F01554E205344E49E8871CCF80F9FF5CB54479AFA66806DD02FAFEE7D43572B3AA22742635FE65BFC8004960DC679FC7F8C0E5B50B3CE1E446B7A5E189BB9AAFA06FEC472D6E67EA4905373A01A2B662F534131405FBAB9BBAE892F0C265439EA1ABC91B186B5AC1E53A0C786607B1069BC026359955CFD614D7F80DF416A08AB18991A0398A83DF3CF2D65D7BF50EEEC3
+20150521061258 2 6 100 7679 5 D67DA234F46097F7EE3B230456E7C895BCA86395DF43D60D9D587C64EA4525FBCAD22442143068578CE8ECC8280B2D81F747B484AA668FFCDBEB067EB824B42E5FA1A40BC08EE8CC4A064298CB31C36340951EC7A006878C79C80068196180DA31E1DEF79A72B2D059203DDE461485D1B9783AF79E981CDAEF88589D8343E5B52D96FE90EA13194AFAF7459B17B80971720357ABD09CFE992966FFC1C239821C910F55D69E44277E5DE9841F4E5B2D25D6A265D321059B762F7D6AC5F0E260DEEB628D32940002B219B354486CC5BBF6390F19899EA5E145A28487029DF0517564A81FA10FA60AFA04CE77794775392829DB636E7F5EE00868D5027A6BA75CA922CEF3CA78683D14AB2E58439789033ACF441236F5E3C7849E3662B5123304F82D0061EA9C18EA1676A736FFD628AE982CCEAB8979568C43FB34207E0DEC7D8A6AA391846C910F77771ECF2D0531A234D3798BC1B1433091A895E23A77792F4BE403D526F1D260A3627F2E80E863A204A774F58D7DE2C5C4A7E463A46BC436F0B7AF07179EC334D31073BF035FD94454ECD54146473F786EA15A1CEBB3B9C0D282195AD612D33B31F5528DAB5231CB17A3DE9AB5C8BD7BF8F773C255845BC9B70A1E53A50E5AEA801FFE604A2B2C1FBE86A2A883632E7AE75ADA007FB6AB1AA529DE3151CAA8D1D07FA19EFF5679398340E720CF2CFC4E1AEDD73C44983CC8E610DD419AE2E88206573837D6E44018D9498B62F9C0B8EA7741450FC7DBFF7C546D3CBCBA5B9123577FD5531880A18F1275F9181A922803D8F03512C58B5FBBC41CE8095EDD920A3E36CEB6EDB56900E6CEC2928288909D61B3B426EBC54F0A69C261A848B358C3A8E332567B9FFC1A7A07E9414BB1F75DE0795CF87632F5D6A87A246FD4E98E70489F779FE99C5BC4DB24BFA860C3551888FC721CDBC6AB5783B02BEF893E0984B6FDB5142A1AFD3277FE8F36B87849BC00B3FB3ADAFE4EDAE4839B83894C27FEF93514D7E3FFB7A30E99C6875D96C582E81D45FB463DC37B8791FC28A759301FC2F9879960C82BC7C427382A41B9AEFAC0051A2C653E55A47B48860CDA32812A192C1508A6C012C7E4BBAB1619B7926549FD8CE27928618F035BE31D56CBC9586D88E00DA69341F6F01554E205344E49E8871CCF80F9FF5CB54479AFA66806DD02FAFEE7D43572B3AA22742635FE65BFC8004960DC679FC7F8C0E5B50B3CE1E446B7A5E189BB9AAFA06FEC472D6E67EA4905373A01A2B662F534131405FBAB9BBAE892F0C265439EA1ABC91B186B5AC1E53A0C786607B1069BC026359955CFD614D7F80DF416A08AB18991A0398A83DF3CF2D65D7C00AF225F
+20150521034225 2 6 100 7679 2 D67DA234F46097F7EE3B230456E7C895BCA86395DF43D60D9D587C64EA4525FBCAD22442143068578CE8ECC8280B2D81F747B484AA668FFCDBEB067EB824B42E5FA1A40BC08EE8CC4A064298CB31C36340951EC7A006878C79C80068196180DA31E1DEF79A72B2D059203DDE461485D1B9783AF79E981CDAEF88589D8343E5B52D96FE90EA13194AFAF7459B17B80971720357ABD09CFE992966FFC1C239821C910F55D69E44277E5DE9841F4E5B2D25D6A265D321059B762F7D6AC5F0E260DEEB628D32940002B219B354486CC5BBF6390F19899EA5E145A28487029DF0517564A81FA10FA60AFA04CE77794775392829DB636E7F5EE00868D5027A6BA75CA922CEF3CA78683D14AB2E58439789033ACF441236F5E3C7849E3662B5123304F82D0061EA9C18EA1676A736FFD628AE982CCEAB8979568C43FB34207E0DEC7D8A6AA391846C910F77771ECF2D0531A234D3798BC1B1433091A895E23A77792F4BE403D526F1D260A3627F2E80E863A204A774F58D7DE2C5C4A7E463A46BC436F0B7AF07179EC334D31073BF035FD94454ECD54146473F786EA15A1CEBB3B9C0D282195AD612D33B31F5528DAB5231CB17A3DE9AB5C8BD7BF8F773C255845BC9B70A1E53A50E5AEA801FFE604A2B2C1FBE86A2A883632E7AE75ADA007FB6AB1AA529DE3151CAA8D1D07FA19EFF5679398340E720CF2CFC4E1AEDD73C44983CC8E610DD419AE2E88206573837D6E44018D9498B62F9C0B8EA7741450FC7DBFF7C546D3CBCBA5B9123577FD5531880A18F1275F9181A922803D8F03512C58B5FBBC41CE8095EDD920A3E36CEB6EDB56900E6CEC2928288909D61B3B426EBC54F0A69C261A848B358C3A8E332567B9FFC1A7A07E9414BB1F75DE0795CF87632F5D6A87A246FD4E98E70489F779FE99C5BC4DB24BFA860C3551888FC721CDBC6AB5783B02BEF893E0984B6FDB5142A1AFD3277FE8F36B87849BC00B3FB3ADAFE4EDAE4839B83894C27FEF93514D7E3FFB7A30E99C6875D96C582E81D45FB463DC37B8791FC28A759301FC2F9879960C82BC7C427382A41B9AEFAC0051A2C653E55A47B48860CDA32812A192C1508A6C012C7E4BBAB1619B7926549FD8CE27928618F035BE31D56CBC9586D88E00DA69341F6F01554E205344E49E8871CCF80F9FF5CB54479AFA66806DD02FAFEE7D43572B3AA22742635FE65BFC8004960DC679FC7F8C0E5B50B3CE1E446B7A5E189BB9AAFA06FEC472D6E67EA4905373A01A2B662F534131405FBAB9BBAE892F0C265439EA1ABC91B186B5AC1E53A0C786607B1069BC026359955CFD614D7F80DF416A08AB18991A0398A83DF3CF2D65D7C058D5963
+20150521035956 2 6 100 7679 5 D67DA234F46097F7EE3B230456E7C895BCA86395DF43D60D9D587C64EA4525FBCAD22442143068578CE8ECC8280B2D81F747B484AA668FFCDBEB067EB824B42E5FA1A40BC08EE8CC4A064298CB31C36340951EC7A006878C79C80068196180DA31E1DEF79A72B2D059203DDE461485D1B9783AF79E981CDAEF88589D8343E5B52D96FE90EA13194AFAF7459B17B80971720357ABD09CFE992966FFC1C239821C910F55D69E44277E5DE9841F4E5B2D25D6A265D321059B762F7D6AC5F0E260DEEB628D32940002B219B354486CC5BBF6390F19899EA5E145A28487029DF0517564A81FA10FA60AFA04CE77794775392829DB636E7F5EE00868D5027A6BA75CA922CEF3CA78683D14AB2E58439789033ACF441236F5E3C7849E3662B5123304F82D0061EA9C18EA1676A736FFD628AE982CCEAB8979568C43FB34207E0DEC7D8A6AA391846C910F77771ECF2D0531A234D3798BC1B1433091A895E23A77792F4BE403D526F1D260A3627F2E80E863A204A774F58D7DE2C5C4A7E463A46BC436F0B7AF07179EC334D31073BF035FD94454ECD54146473F786EA15A1CEBB3B9C0D282195AD612D33B31F5528DAB5231CB17A3DE9AB5C8BD7BF8F773C255845BC9B70A1E53A50E5AEA801FFE604A2B2C1FBE86A2A883632E7AE75ADA007FB6AB1AA529DE3151CAA8D1D07FA19EFF5679398340E720CF2CFC4E1AEDD73C44983CC8E610DD419AE2E88206573837D6E44018D9498B62F9C0B8EA7741450FC7DBFF7C546D3CBCBA5B9123577FD5531880A18F1275F9181A922803D8F03512C58B5FBBC41CE8095EDD920A3E36CEB6EDB56900E6CEC2928288909D61B3B426EBC54F0A69C261A848B358C3A8E332567B9FFC1A7A07E9414BB1F75DE0795CF87632F5D6A87A246FD4E98E70489F779FE99C5BC4DB24BFA860C3551888FC721CDBC6AB5783B02BEF893E0984B6FDB5142A1AFD3277FE8F36B87849BC00B3FB3ADAFE4EDAE4839B83894C27FEF93514D7E3FFB7A30E99C6875D96C582E81D45FB463DC37B8791FC28A759301FC2F9879960C82BC7C427382A41B9AEFAC0051A2C653E55A47B48860CDA32812A192C1508A6C012C7E4BBAB1619B7926549FD8CE27928618F035BE31D56CBC9586D88E00DA69341F6F01554E205344E49E8871CCF80F9FF5CB54479AFA66806DD02FAFEE7D43572B3AA22742635FE65BFC8004960DC679FC7F8C0E5B50B3CE1E446B7A5E189BB9AAFA06FEC472D6E67EA4905373A01A2B662F534131405FBAB9BBAE892F0C265439EA1ABC91B186B5AC1E53A0C786607B1069BC026359955CFD614D7F80DF416A08AB18991A0398A83DF3CF2D65D7C0616723F
+20150521054248 2 6 100 7679 5 D67DA234F46097F7EE3B230456E7C895BCA86395DF43D60D9D587C64EA4525FBCAD22442143068578CE8ECC8280B2D81F747B484AA668FFCDBEB067EB824B42E5FA1A40BC08EE8CC4A064298CB31C36340951EC7A006878C79C80068196180DA31E1DEF79A72B2D059203DDE461485D1B9783AF79E981CDAEF88589D8343E5B52D96FE90EA13194AFAF7459B17B80971720357ABD09CFE992966FFC1C239821C910F55D69E44277E5DE9841F4E5B2D25D6A265D321059B762F7D6AC5F0E260DEEB628D32940002B219B354486CC5BBF6390F19899EA5E145A28487029DF0517564A81FA10FA60AFA04CE77794775392829DB636E7F5EE00868D5027A6BA75CA922CEF3CA78683D14AB2E58439789033ACF441236F5E3C7849E3662B5123304F82D0061EA9C18EA1676A736FFD628AE982CCEAB8979568C43FB34207E0DEC7D8A6AA391846C910F77771ECF2D0531A234D3798BC1B1433091A895E23A77792F4BE403D526F1D260A3627F2E80E863A204A774F58D7DE2C5C4A7E463A46BC436F0B7AF07179EC334D31073BF035FD94454ECD54146473F786EA15A1CEBB3B9C0D282195AD612D33B31F5528DAB5231CB17A3DE9AB5C8BD7BF8F773C255845BC9B70A1E53A50E5AEA801FFE604A2B2C1FBE86A2A883632E7AE75ADA007FB6AB1AA529DE3151CAA8D1D07FA19EFF5679398340E720CF2CFC4E1AEDD73C44983CC8E610DD419AE2E88206573837D6E44018D9498B62F9C0B8EA7741450FC7DBFF7C546D3CBCBA5B9123577FD5531880A18F1275F9181A922803D8F03512C58B5FBBC41CE8095EDD920A3E36CEB6EDB56900E6CEC2928288909D61B3B426EBC54F0A69C261A848B358C3A8E332567B9FFC1A7A07E9414BB1F75DE0795CF87632F5D6A87A246FD4E98E70489F779FE99C5BC4DB24BFA860C3551888FC721CDBC6AB5783B02BEF893E0984B6FDB5142A1AFD3277FE8F36B87849BC00B3FB3ADAFE4EDAE4839B83894C27FEF93514D7E3FFB7A30E99C6875D96C582E81D45FB463DC37B8791FC28A759301FC2F9879960C82BC7C427382A41B9AEFAC0051A2C653E55A47B48860CDA32812A192C1508A6C012C7E4BBAB1619B7926549FD8CE27928618F035BE31D56CBC9586D88E00DA69341F6F01554E205344E49E8871CCF80F9FF5CB54479AFA66806DD02FAFEE7D43572B3AA22742635FE65BFC8004960DC679FC7F8C0E5B50B3CE1E446B7A5E189BB9AAFA06FEC472D6E67EA4905373A01A2B662F534131405FBAB9BBAE892F0C265439EA1ABC91B186B5AC1E53A0C786607B1069BC026359955CFD614D7F80DF416A08AB18991A0398A83DF3CF2D65D7C12F16C3F
+20150521060112 2 6 100 7679 2 D67DA234F46097F7EE3B230456E7C895BCA86395DF43D60D9D587C64EA4525FBCAD22442143068578CE8ECC8280B2D81F747B484AA668FFCDBEB067EB824B42E5FA1A40BC08EE8CC4A064298CB31C36340951EC7A006878C79C80068196180DA31E1DEF79A72B2D059203DDE461485D1B9783AF79E981CDAEF88589D8343E5B52D96FE90EA13194AFAF7459B17B80971720357ABD09CFE992966FFC1C239821C910F55D69E44277E5DE9841F4E5B2D25D6A265D321059B762F7D6AC5F0E260DEEB628D32940002B219B354486CC5BBF6390F19899EA5E145A28487029DF0517564A81FA10FA60AFA04CE77794775392829DB636E7F5EE00868D5027A6BA75CA922CEF3CA78683D14AB2E58439789033ACF441236F5E3C7849E3662B5123304F82D0061EA9C18EA1676A736FFD628AE982CCEAB8979568C43FB34207E0DEC7D8A6AA391846C910F77771ECF2D0531A234D3798BC1B1433091A895E23A77792F4BE403D526F1D260A3627F2E80E863A204A774F58D7DE2C5C4A7E463A46BC436F0B7AF07179EC334D31073BF035FD94454ECD54146473F786EA15A1CEBB3B9C0D282195AD612D33B31F5528DAB5231CB17A3DE9AB5C8BD7BF8F773C255845BC9B70A1E53A50E5AEA801FFE604A2B2C1FBE86A2A883632E7AE75ADA007FB6AB1AA529DE3151CAA8D1D07FA19EFF5679398340E720CF2CFC4E1AEDD73C44983CC8E610DD419AE2E88206573837D6E44018D9498B62F9C0B8EA7741450FC7DBFF7C546D3CBCBA5B9123577FD5531880A18F1275F9181A922803D8F03512C58B5FBBC41CE8095EDD920A3E36CEB6EDB56900E6CEC2928288909D61B3B426EBC54F0A69C261A848B358C3A8E332567B9FFC1A7A07E9414BB1F75DE0795CF87632F5D6A87A246FD4E98E70489F779FE99C5BC4DB24BFA860C3551888FC721CDBC6AB5783B02BEF893E0984B6FDB5142A1AFD3277FE8F36B87849BC00B3FB3ADAFE4EDAE4839B83894C27FEF93514D7E3FFB7A30E99C6875D96C582E81D45FB463DC37B8791FC28A759301FC2F9879960C82BC7C427382A41B9AEFAC0051A2C653E55A47B48860CDA32812A192C1508A6C012C7E4BBAB1619B7926549FD8CE27928618F035BE31D56CBC9586D88E00DA69341F6F01554E205344E49E8871CCF80F9FF5CB54479AFA66806DD02FAFEE7D43572B3AA22742635FE65BFC8004960DC679FC7F8C0E5B50B3CE1E446B7A5E189BB9AAFA06FEC472D6E67EA4905373A01A2B662F534131405FBAB9BBAE892F0C265439EA1ABC91B186B5AC1E53A0C786607B1069BC026359955CFD614D7F80DF416A08AB18991A0398A83DF3CF2D65D7C1379EA23
+20150521023340 2 6 100 7679 2 D67DA234F46097F7EE3B230456E7C895BCA86395DF43D60D9D587C64EA4525FBCAD22442143068578CE8ECC8280B2D81F747B484AA668FFCDBEB067EB824B42E5FA1A40BC08EE8CC4A064298CB31C36340951EC7A006878C79C80068196180DA31E1DEF79A72B2D059203DDE461485D1B9783AF79E981CDAEF88589D8343E5B52D96FE90EA13194AFAF7459B17B80971720357ABD09CFE992966FFC1C239821C910F55D69E44277E5DE9841F4E5B2D25D6A265D321059B762F7D6AC5F0E260DEEB628D32940002B219B354486CC5BBF6390F19899EA5E145A28487029DF0517564A81FA10FA60AFA04CE77794775392829DB636E7F5EE00868D5027A6BA75CA922CEF3CA78683D14AB2E58439789033ACF441236F5E3C7849E3662B5123304F82D0061EA9C18EA1676A736FFD628AE982CCEAB8979568C43FB34207E0DEC7D8A6AA391846C910F77771ECF2D0531A234D3798BC1B1433091A895E23A77792F4BE403D526F1D260A3627F2E80E863A204A774F58D7DE2C5C4A7E463A46BC436F0B7AF07179EC334D31073BF035FD94454ECD54146473F786EA15A1CEBB3B9C0D282195AD612D33B31F5528DAB5231CB17A3DE9AB5C8BD7BF8F773C255845BC9B70A1E53A50E5AEA801FFE604A2B2C1FBE86A2A883632E7AE75ADA007FB6AB1AA529DE3151CAA8D1D07FA19EFF5679398340E720CF2CFC4E1AEDD73C44983CC8E610DD419AE2E88206573837D6E44018D9498B62F9C0B8EA7741450FC7DBFF7C546D3CBCBA5B9123577FD5531880A18F1275F9181A922803D8F03512C58B5FBBC41CE8095EDD920A3E36CEB6EDB56900E6CEC2928288909D61B3B426EBC54F0A69C261A848B358C3A8E332567B9FFC1A7A07E9414BB1F75DE0795CF87632F5D6A87A246FD4E98E70489F779FE99C5BC4DB24BFA860C3551888FC721CDBC6AB5783B02BEF893E0984B6FDB5142A1AFD3277FE8F36B87849BC00B3FB3ADAFE4EDAE4839B83894C27FEF93514D7E3FFB7A30E99C6875D96C582E81D45FB463DC37B8791FC28A759301FC2F9879960C82BC7C427382A41B9AEFAC0051A2C653E55A47B48860CDA32812A192C1508A6C012C7E4BBAB1619B7926549FD8CE27928618F035BE31D56CBC9586D88E00DA69341F6F01554E205344E49E8871CCF80F9FF5CB54479AFA66806DD02FAFEE7D43572B3AA22742635FE65BFC8004960DC679FC7F8C0E5B50B3CE1E446B7A5E189BB9AAFA06FEC472D6E67EA4905373A01A2B662F534131405FBAB9BBAE892F0C265439EA1ABC91B186B5AC1E53A0C786607B1069BC026359955CFD614D7F80DF416A08AB18991A0398A83DF3CF2D65D7C165F2773
+20150521043505 2 6 100 7679 5 D67DA234F46097F7EE3B230456E7C895BCA86395DF43D60D9D587C64EA4525FBCAD22442143068578CE8ECC8280B2D81F747B484AA668FFCDBEB067EB824B42E5FA1A40BC08EE8CC4A064298CB31C36340951EC7A006878C79C80068196180DA31E1DEF79A72B2D059203DDE461485D1B9783AF79E981CDAEF88589D8343E5B52D96FE90EA13194AFAF7459B17B80971720357ABD09CFE992966FFC1C239821C910F55D69E44277E5DE9841F4E5B2D25D6A265D321059B762F7D6AC5F0E260DEEB628D32940002B219B354486CC5BBF6390F19899EA5E145A28487029DF0517564A81FA10FA60AFA04CE77794775392829DB636E7F5EE00868D5027A6BA75CA922CEF3CA78683D14AB2E58439789033ACF441236F5E3C7849E3662B5123304F82D0061EA9C18EA1676A736FFD628AE982CCEAB8979568C43FB34207E0DEC7D8A6AA391846C910F77771ECF2D0531A234D3798BC1B1433091A895E23A77792F4BE403D526F1D260A3627F2E80E863A204A774F58D7DE2C5C4A7E463A46BC436F0B7AF07179EC334D31073BF035FD94454ECD54146473F786EA15A1CEBB3B9C0D282195AD612D33B31F5528DAB5231CB17A3DE9AB5C8BD7BF8F773C255845BC9B70A1E53A50E5AEA801FFE604A2B2C1FBE86A2A883632E7AE75ADA007FB6AB1AA529DE3151CAA8D1D07FA19EFF5679398340E720CF2CFC4E1AEDD73C44983CC8E610DD419AE2E88206573837D6E44018D9498B62F9C0B8EA7741450FC7DBFF7C546D3CBCBA5B9123577FD5531880A18F1275F9181A922803D8F03512C58B5FBBC41CE8095EDD920A3E36CEB6EDB56900E6CEC2928288909D61B3B426EBC54F0A69C261A848B358C3A8E332567B9FFC1A7A07E9414BB1F75DE0795CF87632F5D6A87A246FD4E98E70489F779FE99C5BC4DB24BFA860C3551888FC721CDBC6AB5783B02BEF893E0984B6FDB5142A1AFD3277FE8F36B87849BC00B3FB3ADAFE4EDAE4839B83894C27FEF93514D7E3FFB7A30E99C6875D96C582E81D45FB463DC37B8791FC28A759301FC2F9879960C82BC7C427382A41B9AEFAC0051A2C653E55A47B48860CDA32812A192C1508A6C012C7E4BBAB1619B7926549FD8CE27928618F035BE31D56CBC9586D88E00DA69341F6F01554E205344E49E8871CCF80F9FF5CB54479AFA66806DD02FAFEE7D43572B3AA22742635FE65BFC8004960DC679FC7F8C0E5B50B3CE1E446B7A5E189BB9AAFA06FEC472D6E67EA4905373A01A2B662F534131405FBAB9BBAE892F0C265439EA1ABC91B186B5AC1E53A0C786607B1069BC026359955CFD614D7F80DF416A08AB18991A0398A83DF3CF2D65D7C1A3EC717
+20150521024626 2 6 100 7679 2 D67DA234F46097F7EE3B230456E7C895BCA86395DF43D60D9D587C64EA4525FBCAD22442143068578CE8ECC8280B2D81F747B484AA668FFCDBEB067EB824B42E5FA1A40BC08EE8CC4A064298CB31C36340951EC7A006878C79C80068196180DA31E1DEF79A72B2D059203DDE461485D1B9783AF79E981CDAEF88589D8343E5B52D96FE90EA13194AFAF7459B17B80971720357ABD09CFE992966FFC1C239821C910F55D69E44277E5DE9841F4E5B2D25D6A265D321059B762F7D6AC5F0E260DEEB628D32940002B219B354486CC5BBF6390F19899EA5E145A28487029DF0517564A81FA10FA60AFA04CE77794775392829DB636E7F5EE00868D5027A6BA75CA922CEF3CA78683D14AB2E58439789033ACF441236F5E3C7849E3662B5123304F82D0061EA9C18EA1676A736FFD628AE982CCEAB8979568C43FB34207E0DEC7D8A6AA391846C910F77771ECF2D0531A234D3798BC1B1433091A895E23A77792F4BE403D526F1D260A3627F2E80E863A204A774F58D7DE2C5C4A7E463A46BC436F0B7AF07179EC334D31073BF035FD94454ECD54146473F786EA15A1CEBB3B9C0D282195AD612D33B31F5528DAB5231CB17A3DE9AB5C8BD7BF8F773C255845BC9B70A1E53A50E5AEA801FFE604A2B2C1FBE86A2A883632E7AE75ADA007FB6AB1AA529DE3151CAA8D1D07FA19EFF5679398340E720CF2CFC4E1AEDD73C44983CC8E610DD419AE2E88206573837D6E44018D9498B62F9C0B8EA7741450FC7DBFF7C546D3CBCBA5B9123577FD5531880A18F1275F9181A922803D8F03512C58B5FBBC41CE8095EDD920A3E36CEB6EDB56900E6CEC2928288909D61B3B426EBC54F0A69C261A848B358C3A8E332567B9FFC1A7A07E9414BB1F75DE0795CF87632F5D6A87A246FD4E98E70489F779FE99C5BC4DB24BFA860C3551888FC721CDBC6AB5783B02BEF893E0984B6FDB5142A1AFD3277FE8F36B87849BC00B3FB3ADAFE4EDAE4839B83894C27FEF93514D7E3FFB7A30E99C6875D96C582E81D45FB463DC37B8791FC28A759301FC2F9879960C82BC7C427382A41B9AEFAC0051A2C653E55A47B48860CDA32812A192C1508A6C012C7E4BBAB1619B7926549FD8CE27928618F035BE31D56CBC9586D88E00DA69341F6F01554E205344E49E8871CCF80F9FF5CB54479AFA66806DD02FAFEE7D43572B3AA22742635FE65BFC8004960DC679FC7F8C0E5B50B3CE1E446B7A5E189BB9AAFA06FEC472D6E67EA4905373A01A2B662F534131405FBAB9BBAE892F0C265439EA1ABC91B186B5AC1E53A0C786607B1069BC026359955CFD614D7F80DF416A08AB18991A0398A83DF3CF2D65D7C202ABED3
+20150521064303 2 6 100 7679 5 D67DA234F46097F7EE3B230456E7C895BCA86395DF43D60D9D587C64EA4525FBCAD22442143068578CE8ECC8280B2D81F747B484AA668FFCDBEB067EB824B42E5FA1A40BC08EE8CC4A064298CB31C36340951EC7A006878C79C80068196180DA31E1DEF79A72B2D059203DDE461485D1B9783AF79E981CDAEF88589D8343E5B52D96FE90EA13194AFAF7459B17B80971720357ABD09CFE992966FFC1C239821C910F55D69E44277E5DE9841F4E5B2D25D6A265D321059B762F7D6AC5F0E260DEEB628D32940002B219B354486CC5BBF6390F19899EA5E145A28487029DF0517564A81FA10FA60AFA04CE77794775392829DB636E7F5EE00868D5027A6BA75CA922CEF3CA78683D14AB2E58439789033ACF441236F5E3C7849E3662B5123304F82D0061EA9C18EA1676A736FFD628AE982CCEAB8979568C43FB34207E0DEC7D8A6AA391846C910F77771ECF2D0531A234D3798BC1B1433091A895E23A77792F4BE403D526F1D260A3627F2E80E863A204A774F58D7DE2C5C4A7E463A46BC436F0B7AF07179EC334D31073BF035FD94454ECD54146473F786EA15A1CEBB3B9C0D282195AD612D33B31F5528DAB5231CB17A3DE9AB5C8BD7BF8F773C255845BC9B70A1E53A50E5AEA801FFE604A2B2C1FBE86A2A883632E7AE75ADA007FB6AB1AA529DE3151CAA8D1D07FA19EFF5679398340E720CF2CFC4E1AEDD73C44983CC8E610DD419AE2E88206573837D6E44018D9498B62F9C0B8EA7741450FC7DBFF7C546D3CBCBA5B9123577FD5531880A18F1275F9181A922803D8F03512C58B5FBBC41CE8095EDD920A3E36CEB6EDB56900E6CEC2928288909D61B3B426EBC54F0A69C261A848B358C3A8E332567B9FFC1A7A07E9414BB1F75DE0795CF87632F5D6A87A246FD4E98E70489F779FE99C5BC4DB24BFA860C3551888FC721CDBC6AB5783B02BEF893E0984B6FDB5142A1AFD3277FE8F36B87849BC00B3FB3ADAFE4EDAE4839B83894C27FEF93514D7E3FFB7A30E99C6875D96C582E81D45FB463DC37B8791FC28A759301FC2F9879960C82BC7C427382A41B9AEFAC0051A2C653E55A47B48860CDA32812A192C1508A6C012C7E4BBAB1619B7926549FD8CE27928618F035BE31D56CBC9586D88E00DA69341F6F01554E205344E49E8871CCF80F9FF5CB54479AFA66806DD02FAFEE7D43572B3AA22742635FE65BFC8004960DC679FC7F8C0E5B50B3CE1E446B7A5E189BB9AAFA06FEC472D6E67EA4905373A01A2B662F534131405FBAB9BBAE892F0C265439EA1ABC91B186B5AC1E53A0C786607B1069BC026359955CFD614D7F80DF416A08AB18991A0398A83DF3CF2D65D7C27790087
+20150521060604 2 6 100 7679 2 D67DA234F46097F7EE3B230456E7C895BCA86395DF43D60D9D587C64EA4525FBCAD22442143068578CE8ECC8280B2D81F747B484AA668FFCDBEB067EB824B42E5FA1A40BC08EE8CC4A064298CB31C36340951EC7A006878C79C80068196180DA31E1DEF79A72B2D059203DDE461485D1B9783AF79E981CDAEF88589D8343E5B52D96FE90EA13194AFAF7459B17B80971720357ABD09CFE992966FFC1C239821C910F55D69E44277E5DE9841F4E5B2D25D6A265D321059B762F7D6AC5F0E260DEEB628D32940002B219B354486CC5BBF6390F19899EA5E145A28487029DF0517564A81FA10FA60AFA04CE77794775392829DB636E7F5EE00868D5027A6BA75CA922CEF3CA78683D14AB2E58439789033ACF441236F5E3C7849E3662B5123304F82D0061EA9C18EA1676A736FFD628AE982CCEAB8979568C43FB34207E0DEC7D8A6AA391846C910F77771ECF2D0531A234D3798BC1B1433091A895E23A77792F4BE403D526F1D260A3627F2E80E863A204A774F58D7DE2C5C4A7E463A46BC436F0B7AF07179EC334D31073BF035FD94454ECD54146473F786EA15A1CEBB3B9C0D282195AD612D33B31F5528DAB5231CB17A3DE9AB5C8BD7BF8F773C255845BC9B70A1E53A50E5AEA801FFE604A2B2C1FBE86A2A883632E7AE75ADA007FB6AB1AA529DE3151CAA8D1D07FA19EFF5679398340E720CF2CFC4E1AEDD73C44983CC8E610DD419AE2E88206573837D6E44018D9498B62F9C0B8EA7741450FC7DBFF7C546D3CBCBA5B9123577FD5531880A18F1275F9181A922803D8F03512C58B5FBBC41CE8095EDD920A3E36CEB6EDB56900E6CEC2928288909D61B3B426EBC54F0A69C261A848B358C3A8E332567B9FFC1A7A07E9414BB1F75DE0795CF87632F5D6A87A246FD4E98E70489F779FE99C5BC4DB24BFA860C3551888FC721CDBC6AB5783B02BEF893E0984B6FDB5142A1AFD3277FE8F36B87849BC00B3FB3ADAFE4EDAE4839B83894C27FEF93514D7E3FFB7A30E99C6875D96C582E81D45FB463DC37B8791FC28A759301FC2F9879960C82BC7C427382A41B9AEFAC0051A2C653E55A47B48860CDA32812A192C1508A6C012C7E4BBAB1619B7926549FD8CE27928618F035BE31D56CBC9586D88E00DA69341F6F01554E205344E49E8871CCF80F9FF5CB54479AFA66806DD02FAFEE7D43572B3AA22742635FE65BFC8004960DC679FC7F8C0E5B50B3CE1E446B7A5E189BB9AAFA06FEC472D6E67EA4905373A01A2B662F534131405FBAB9BBAE892F0C265439EA1ABC91B186B5AC1E53A0C786607B1069BC026359955CFD614D7F80DF416A08AB18991A0398A83DF3CF2D65D7C2F9DF583
+20150521062143 2 6 100 7679 2 D67DA234F46097F7EE3B230456E7C895BCA86395DF43D60D9D587C64EA4525FBCAD22442143068578CE8ECC8280B2D81F747B484AA668FFCDBEB067EB824B42E5FA1A40BC08EE8CC4A064298CB31C36340951EC7A006878C79C80068196180DA31E1DEF79A72B2D059203DDE461485D1B9783AF79E981CDAEF88589D8343E5B52D96FE90EA13194AFAF7459B17B80971720357ABD09CFE992966FFC1C239821C910F55D69E44277E5DE9841F4E5B2D25D6A265D321059B762F7D6AC5F0E260DEEB628D32940002B219B354486CC5BBF6390F19899EA5E145A28487029DF0517564A81FA10FA60AFA04CE77794775392829DB636E7F5EE00868D5027A6BA75CA922CEF3CA78683D14AB2E58439789033ACF441236F5E3C7849E3662B5123304F82D0061EA9C18EA1676A736FFD628AE982CCEAB8979568C43FB34207E0DEC7D8A6AA391846C910F77771ECF2D0531A234D3798BC1B1433091A895E23A77792F4BE403D526F1D260A3627F2E80E863A204A774F58D7DE2C5C4A7E463A46BC436F0B7AF07179EC334D31073BF035FD94454ECD54146473F786EA15A1CEBB3B9C0D282195AD612D33B31F5528DAB5231CB17A3DE9AB5C8BD7BF8F773C255845BC9B70A1E53A50E5AEA801FFE604A2B2C1FBE86A2A883632E7AE75ADA007FB6AB1AA529DE3151CAA8D1D07FA19EFF5679398340E720CF2CFC4E1AEDD73C44983CC8E610DD419AE2E88206573837D6E44018D9498B62F9C0B8EA7741450FC7DBFF7C546D3CBCBA5B9123577FD5531880A18F1275F9181A922803D8F03512C58B5FBBC41CE8095EDD920A3E36CEB6EDB56900E6CEC2928288909D61B3B426EBC54F0A69C261A848B358C3A8E332567B9FFC1A7A07E9414BB1F75DE0795CF87632F5D6A87A246FD4E98E70489F779FE99C5BC4DB24BFA860C3551888FC721CDBC6AB5783B02BEF893E0984B6FDB5142A1AFD3277FE8F36B87849BC00B3FB3ADAFE4EDAE4839B83894C27FEF93514D7E3FFB7A30E99C6875D96C582E81D45FB463DC37B8791FC28A759301FC2F9879960C82BC7C427382A41B9AEFAC0051A2C653E55A47B48860CDA32812A192C1508A6C012C7E4BBAB1619B7926549FD8CE27928618F035BE31D56CBC9586D88E00DA69341F6F01554E205344E49E8871CCF80F9FF5CB54479AFA66806DD02FAFEE7D43572B3AA22742635FE65BFC8004960DC679FC7F8C0E5B50B3CE1E446B7A5E189BB9AAFA06FEC472D6E67EA4905373A01A2B662F534131405FBAB9BBAE892F0C265439EA1ABC91B186B5AC1E53A0C786607B1069BC026359955CFD614D7F80DF416A08AB18991A0398A83DF3CF2D65D7C3003EEAB
+20150521044311 2 6 100 7679 5 D67DA234F46097F7EE3B230456E7C895BCA86395DF43D60D9D587C64EA4525FBCAD22442143068578CE8ECC8280B2D81F747B484AA668FFCDBEB067EB824B42E5FA1A40BC08EE8CC4A064298CB31C36340951EC7A006878C79C80068196180DA31E1DEF79A72B2D059203DDE461485D1B9783AF79E981CDAEF88589D8343E5B52D96FE90EA13194AFAF7459B17B80971720357ABD09CFE992966FFC1C239821C910F55D69E44277E5DE9841F4E5B2D25D6A265D321059B762F7D6AC5F0E260DEEB628D32940002B219B354486CC5BBF6390F19899EA5E145A28487029DF0517564A81FA10FA60AFA04CE77794775392829DB636E7F5EE00868D5027A6BA75CA922CEF3CA78683D14AB2E58439789033ACF441236F5E3C7849E3662B5123304F82D0061EA9C18EA1676A736FFD628AE982CCEAB8979568C43FB34207E0DEC7D8A6AA391846C910F77771ECF2D0531A234D3798BC1B1433091A895E23A77792F4BE403D526F1D260A3627F2E80E863A204A774F58D7DE2C5C4A7E463A46BC436F0B7AF07179EC334D31073BF035FD94454ECD54146473F786EA15A1CEBB3B9C0D282195AD612D33B31F5528DAB5231CB17A3DE9AB5C8BD7BF8F773C255845BC9B70A1E53A50E5AEA801FFE604A2B2C1FBE86A2A883632E7AE75ADA007FB6AB1AA529DE3151CAA8D1D07FA19EFF5679398340E720CF2CFC4E1AEDD73C44983CC8E610DD419AE2E88206573837D6E44018D9498B62F9C0B8EA7741450FC7DBFF7C546D3CBCBA5B9123577FD5531880A18F1275F9181A922803D8F03512C58B5FBBC41CE8095EDD920A3E36CEB6EDB56900E6CEC2928288909D61B3B426EBC54F0A69C261A848B358C3A8E332567B9FFC1A7A07E9414BB1F75DE0795CF87632F5D6A87A246FD4E98E70489F779FE99C5BC4DB24BFA860C3551888FC721CDBC6AB5783B02BEF893E0984B6FDB5142A1AFD3277FE8F36B87849BC00B3FB3ADAFE4EDAE4839B83894C27FEF93514D7E3FFB7A30E99C6875D96C582E81D45FB463DC37B8791FC28A759301FC2F9879960C82BC7C427382A41B9AEFAC0051A2C653E55A47B48860CDA32812A192C1508A6C012C7E4BBAB1619B7926549FD8CE27928618F035BE31D56CBC9586D88E00DA69341F6F01554E205344E49E8871CCF80F9FF5CB54479AFA66806DD02FAFEE7D43572B3AA22742635FE65BFC8004960DC679FC7F8C0E5B50B3CE1E446B7A5E189BB9AAFA06FEC472D6E67EA4905373A01A2B662F534131405FBAB9BBAE892F0C265439EA1ABC91B186B5AC1E53A0C786607B1069BC026359955CFD614D7F80DF416A08AB18991A0398A83DF3CF2D65D7C363D0A77
+20150521053731 2 6 100 7679 5 D67DA234F46097F7EE3B230456E7C895BCA86395DF43D60D9D587C64EA4525FBCAD22442143068578CE8ECC8280B2D81F747B484AA668FFCDBEB067EB824B42E5FA1A40BC08EE8CC4A064298CB31C36340951EC7A006878C79C80068196180DA31E1DEF79A72B2D059203DDE461485D1B9783AF79E981CDAEF88589D8343E5B52D96FE90EA13194AFAF7459B17B80971720357ABD09CFE992966FFC1C239821C910F55D69E44277E5DE9841F4E5B2D25D6A265D321059B762F7D6AC5F0E260DEEB628D32940002B219B354486CC5BBF6390F19899EA5E145A28487029DF0517564A81FA10FA60AFA04CE77794775392829DB636E7F5EE00868D5027A6BA75CA922CEF3CA78683D14AB2E58439789033ACF441236F5E3C7849E3662B5123304F82D0061EA9C18EA1676A736FFD628AE982CCEAB8979568C43FB34207E0DEC7D8A6AA391846C910F77771ECF2D0531A234D3798BC1B1433091A895E23A77792F4BE403D526F1D260A3627F2E80E863A204A774F58D7DE2C5C4A7E463A46BC436F0B7AF07179EC334D31073BF035FD94454ECD54146473F786EA15A1CEBB3B9C0D282195AD612D33B31F5528DAB5231CB17A3DE9AB5C8BD7BF8F773C255845BC9B70A1E53A50E5AEA801FFE604A2B2C1FBE86A2A883632E7AE75ADA007FB6AB1AA529DE3151CAA8D1D07FA19EFF5679398340E720CF2CFC4E1AEDD73C44983CC8E610DD419AE2E88206573837D6E44018D9498B62F9C0B8EA7741450FC7DBFF7C546D3CBCBA5B9123577FD5531880A18F1275F9181A922803D8F03512C58B5FBBC41CE8095EDD920A3E36CEB6EDB56900E6CEC2928288909D61B3B426EBC54F0A69C261A848B358C3A8E332567B9FFC1A7A07E9414BB1F75DE0795CF87632F5D6A87A246FD4E98E70489F779FE99C5BC4DB24BFA860C3551888FC721CDBC6AB5783B02BEF893E0984B6FDB5142A1AFD3277FE8F36B87849BC00B3FB3ADAFE4EDAE4839B83894C27FEF93514D7E3FFB7A30E99C6875D96C582E81D45FB463DC37B8791FC28A759301FC2F9879960C82BC7C427382A41B9AEFAC0051A2C653E55A47B48860CDA32812A192C1508A6C012C7E4BBAB1619B7926549FD8CE27928618F035BE31D56CBC9586D88E00DA69341F6F01554E205344E49E8871CCF80F9FF5CB54479AFA66806DD02FAFEE7D43572B3AA22742635FE65BFC8004960DC679FC7F8C0E5B50B3CE1E446B7A5E189BB9AAFA06FEC472D6E67EA4905373A01A2B662F534131405FBAB9BBAE892F0C265439EA1ABC91B186B5AC1E53A0C786607B1069BC026359955CFD614D7F80DF416A08AB18991A0398A83DF3CF2D65D7C37D6EFCF
+20150521065640 2 6 100 7679 5 D67DA234F46097F7EE3B230456E7C895BCA86395DF43D60D9D587C64EA4525FBCAD22442143068578CE8ECC8280B2D81F747B484AA668FFCDBEB067EB824B42E5FA1A40BC08EE8CC4A064298CB31C36340951EC7A006878C79C80068196180DA31E1DEF79A72B2D059203DDE461485D1B9783AF79E981CDAEF88589D8343E5B52D96FE90EA13194AFAF7459B17B80971720357ABD09CFE992966FFC1C239821C910F55D69E44277E5DE9841F4E5B2D25D6A265D321059B762F7D6AC5F0E260DEEB628D32940002B219B354486CC5BBF6390F19899EA5E145A28487029DF0517564A81FA10FA60AFA04CE77794775392829DB636E7F5EE00868D5027A6BA75CA922CEF3CA78683D14AB2E58439789033ACF441236F5E3C7849E3662B5123304F82D0061EA9C18EA1676A736FFD628AE982CCEAB8979568C43FB34207E0DEC7D8A6AA391846C910F77771ECF2D0531A234D3798BC1B1433091A895E23A77792F4BE403D526F1D260A3627F2E80E863A204A774F58D7DE2C5C4A7E463A46BC436F0B7AF07179EC334D31073BF035FD94454ECD54146473F786EA15A1CEBB3B9C0D282195AD612D33B31F5528DAB5231CB17A3DE9AB5C8BD7BF8F773C255845BC9B70A1E53A50E5AEA801FFE604A2B2C1FBE86A2A883632E7AE75ADA007FB6AB1AA529DE3151CAA8D1D07FA19EFF5679398340E720CF2CFC4E1AEDD73C44983CC8E610DD419AE2E88206573837D6E44018D9498B62F9C0B8EA7741450FC7DBFF7C546D3CBCBA5B9123577FD5531880A18F1275F9181A922803D8F03512C58B5FBBC41CE8095EDD920A3E36CEB6EDB56900E6CEC2928288909D61B3B426EBC54F0A69C261A848B358C3A8E332567B9FFC1A7A07E9414BB1F75DE0795CF87632F5D6A87A246FD4E98E70489F779FE99C5BC4DB24BFA860C3551888FC721CDBC6AB5783B02BEF893E0984B6FDB5142A1AFD3277FE8F36B87849BC00B3FB3ADAFE4EDAE4839B83894C27FEF93514D7E3FFB7A30E99C6875D96C582E81D45FB463DC37B8791FC28A759301FC2F9879960C82BC7C427382A41B9AEFAC0051A2C653E55A47B48860CDA32812A192C1508A6C012C7E4BBAB1619B7926549FD8CE27928618F035BE31D56CBC9586D88E00DA69341F6F01554E205344E49E8871CCF80F9FF5CB54479AFA66806DD02FAFEE7D43572B3AA22742635FE65BFC8004960DC679FC7F8C0E5B50B3CE1E446B7A5E189BB9AAFA06FEC472D6E67EA4905373A01A2B662F534131405FBAB9BBAE892F0C265439EA1ABC91B186B5AC1E53A0C786607B1069BC026359955CFD614D7F80DF416A08AB18991A0398A83DF3CF2D65D7C3A20A2DF
+20150521044717 2 6 100 7679 2 D67DA234F46097F7EE3B230456E7C895BCA86395DF43D60D9D587C64EA4525FBCAD22442143068578CE8ECC8280B2D81F747B484AA668FFCDBEB067EB824B42E5FA1A40BC08EE8CC4A064298CB31C36340951EC7A006878C79C80068196180DA31E1DEF79A72B2D059203DDE461485D1B9783AF79E981CDAEF88589D8343E5B52D96FE90EA13194AFAF7459B17B80971720357ABD09CFE992966FFC1C239821C910F55D69E44277E5DE9841F4E5B2D25D6A265D321059B762F7D6AC5F0E260DEEB628D32940002B219B354486CC5BBF6390F19899EA5E145A28487029DF0517564A81FA10FA60AFA04CE77794775392829DB636E7F5EE00868D5027A6BA75CA922CEF3CA78683D14AB2E58439789033ACF441236F5E3C7849E3662B5123304F82D0061EA9C18EA1676A736FFD628AE982CCEAB8979568C43FB34207E0DEC7D8A6AA391846C910F77771ECF2D0531A234D3798BC1B1433091A895E23A77792F4BE403D526F1D260A3627F2E80E863A204A774F58D7DE2C5C4A7E463A46BC436F0B7AF07179EC334D31073BF035FD94454ECD54146473F786EA15A1CEBB3B9C0D282195AD612D33B31F5528DAB5231CB17A3DE9AB5C8BD7BF8F773C255845BC9B70A1E53A50E5AEA801FFE604A2B2C1FBE86A2A883632E7AE75ADA007FB6AB1AA529DE3151CAA8D1D07FA19EFF5679398340E720CF2CFC4E1AEDD73C44983CC8E610DD419AE2E88206573837D6E44018D9498B62F9C0B8EA7741450FC7DBFF7C546D3CBCBA5B9123577FD5531880A18F1275F9181A922803D8F03512C58B5FBBC41CE8095EDD920A3E36CEB6EDB56900E6CEC2928288909D61B3B426EBC54F0A69C261A848B358C3A8E332567B9FFC1A7A07E9414BB1F75DE0795CF87632F5D6A87A246FD4E98E70489F779FE99C5BC4DB24BFA860C3551888FC721CDBC6AB5783B02BEF893E0984B6FDB5142A1AFD3277FE8F36B87849BC00B3FB3ADAFE4EDAE4839B83894C27FEF93514D7E3FFB7A30E99C6875D96C582E81D45FB463DC37B8791FC28A759301FC2F9879960C82BC7C427382A41B9AEFAC0051A2C653E55A47B48860CDA32812A192C1508A6C012C7E4BBAB1619B7926549FD8CE27928618F035BE31D56CBC9586D88E00DA69341F6F01554E205344E49E8871CCF80F9FF5CB54479AFA66806DD02FAFEE7D43572B3AA22742635FE65BFC8004960DC679FC7F8C0E5B50B3CE1E446B7A5E189BB9AAFA06FEC472D6E67EA4905373A01A2B662F534131405FBAB9BBAE892F0C265439EA1ABC91B186B5AC1E53A0C786607B1069BC026359955CFD614D7F80DF416A08AB18991A0398A83DF3CF2D65D7C3F622E8B
+20150521065426 2 6 100 7679 2 D67DA234F46097F7EE3B230456E7C895BCA86395DF43D60D9D587C64EA4525FBCAD22442143068578CE8ECC8280B2D81F747B484AA668FFCDBEB067EB824B42E5FA1A40BC08EE8CC4A064298CB31C36340951EC7A006878C79C80068196180DA31E1DEF79A72B2D059203DDE461485D1B9783AF79E981CDAEF88589D8343E5B52D96FE90EA13194AFAF7459B17B80971720357ABD09CFE992966FFC1C239821C910F55D69E44277E5DE9841F4E5B2D25D6A265D321059B762F7D6AC5F0E260DEEB628D32940002B219B354486CC5BBF6390F19899EA5E145A28487029DF0517564A81FA10FA60AFA04CE77794775392829DB636E7F5EE00868D5027A6BA75CA922CEF3CA78683D14AB2E58439789033ACF441236F5E3C7849E3662B5123304F82D0061EA9C18EA1676A736FFD628AE982CCEAB8979568C43FB34207E0DEC7D8A6AA391846C910F77771ECF2D0531A234D3798BC1B1433091A895E23A77792F4BE403D526F1D260A3627F2E80E863A204A774F58D7DE2C5C4A7E463A46BC436F0B7AF07179EC334D31073BF035FD94454ECD54146473F786EA15A1CEBB3B9C0D282195AD612D33B31F5528DAB5231CB17A3DE9AB5C8BD7BF8F773C255845BC9B70A1E53A50E5AEA801FFE604A2B2C1FBE86A2A883632E7AE75ADA007FB6AB1AA529DE3151CAA8D1D07FA19EFF5679398340E720CF2CFC4E1AEDD73C44983CC8E610DD419AE2E88206573837D6E44018D9498B62F9C0B8EA7741450FC7DBFF7C546D3CBCBA5B9123577FD5531880A18F1275F9181A922803D8F03512C58B5FBBC41CE8095EDD920A3E36CEB6EDB56900E6CEC2928288909D61B3B426EBC54F0A69C261A848B358C3A8E332567B9FFC1A7A07E9414BB1F75DE0795CF87632F5D6A87A246FD4E98E70489F779FE99C5BC4DB24BFA860C3551888FC721CDBC6AB5783B02BEF893E0984B6FDB5142A1AFD3277FE8F36B87849BC00B3FB3ADAFE4EDAE4839B83894C27FEF93514D7E3FFB7A30E99C6875D96C582E81D45FB463DC37B8791FC28A759301FC2F9879960C82BC7C427382A41B9AEFAC0051A2C653E55A47B48860CDA32812A192C1508A6C012C7E4BBAB1619B7926549FD8CE27928618F035BE31D56CBC9586D88E00DA69341F6F01554E205344E49E8871CCF80F9FF5CB54479AFA66806DD02FAFEE7D43572B3AA22742635FE65BFC8004960DC679FC7F8C0E5B50B3CE1E446B7A5E189BB9AAFA06FEC472D6E67EA4905373A01A2B662F534131405FBAB9BBAE892F0C265439EA1ABC91B186B5AC1E53A0C786607B1069BC026359955CFD614D7F80DF416A08AB18991A0398A83DF3CF2D65D7C430ED7CB
+20150521023632 2 6 100 7679 2 D67DA234F46097F7EE3B230456E7C895BCA86395DF43D60D9D587C64EA4525FBCAD22442143068578CE8ECC8280B2D81F747B484AA668FFCDBEB067EB824B42E5FA1A40BC08EE8CC4A064298CB31C36340951EC7A006878C79C80068196180DA31E1DEF79A72B2D059203DDE461485D1B9783AF79E981CDAEF88589D8343E5B52D96FE90EA13194AFAF7459B17B80971720357ABD09CFE992966FFC1C239821C910F55D69E44277E5DE9841F4E5B2D25D6A265D321059B762F7D6AC5F0E260DEEB628D32940002B219B354486CC5BBF6390F19899EA5E145A28487029DF0517564A81FA10FA60AFA04CE77794775392829DB636E7F5EE00868D5027A6BA75CA922CEF3CA78683D14AB2E58439789033ACF441236F5E3C7849E3662B5123304F82D0061EA9C18EA1676A736FFD628AE982CCEAB8979568C43FB34207E0DEC7D8A6AA391846C910F77771ECF2D0531A234D3798BC1B1433091A895E23A77792F4BE403D526F1D260A3627F2E80E863A204A774F58D7DE2C5C4A7E463A46BC436F0B7AF07179EC334D31073BF035FD94454ECD54146473F786EA15A1CEBB3B9C0D282195AD612D33B31F5528DAB5231CB17A3DE9AB5C8BD7BF8F773C255845BC9B70A1E53A50E5AEA801FFE604A2B2C1FBE86A2A883632E7AE75ADA007FB6AB1AA529DE3151CAA8D1D07FA19EFF5679398340E720CF2CFC4E1AEDD73C44983CC8E610DD419AE2E88206573837D6E44018D9498B62F9C0B8EA7741450FC7DBFF7C546D3CBCBA5B9123577FD5531880A18F1275F9181A922803D8F03512C58B5FBBC41CE8095EDD920A3E36CEB6EDB56900E6CEC2928288909D61B3B426EBC54F0A69C261A848B358C3A8E332567B9FFC1A7A07E9414BB1F75DE0795CF87632F5D6A87A246FD4E98E70489F779FE99C5BC4DB24BFA860C3551888FC721CDBC6AB5783B02BEF893E0984B6FDB5142A1AFD3277FE8F36B87849BC00B3FB3ADAFE4EDAE4839B83894C27FEF93514D7E3FFB7A30E99C6875D96C582E81D45FB463DC37B8791FC28A759301FC2F9879960C82BC7C427382A41B9AEFAC0051A2C653E55A47B48860CDA32812A192C1508A6C012C7E4BBAB1619B7926549FD8CE27928618F035BE31D56CBC9586D88E00DA69341F6F01554E205344E49E8871CCF80F9FF5CB54479AFA66806DD02FAFEE7D43572B3AA22742635FE65BFC8004960DC679FC7F8C0E5B50B3CE1E446B7A5E189BB9AAFA06FEC472D6E67EA4905373A01A2B662F534131405FBAB9BBAE892F0C265439EA1ABC91B186B5AC1E53A0C786607B1069BC026359955CFD614D7F80DF416A08AB18991A0398A83DF3CF2D65D7C445E575B
+20150521032945 2 6 100 7679 2 D67DA234F46097F7EE3B230456E7C895BCA86395DF43D60D9D587C64EA4525FBCAD22442143068578CE8ECC8280B2D81F747B484AA668FFCDBEB067EB824B42E5FA1A40BC08EE8CC4A064298CB31C36340951EC7A006878C79C80068196180DA31E1DEF79A72B2D059203DDE461485D1B9783AF79E981CDAEF88589D8343E5B52D96FE90EA13194AFAF7459B17B80971720357ABD09CFE992966FFC1C239821C910F55D69E44277E5DE9841F4E5B2D25D6A265D321059B762F7D6AC5F0E260DEEB628D32940002B219B354486CC5BBF6390F19899EA5E145A28487029DF0517564A81FA10FA60AFA04CE77794775392829DB636E7F5EE00868D5027A6BA75CA922CEF3CA78683D14AB2E58439789033ACF441236F5E3C7849E3662B5123304F82D0061EA9C18EA1676A736FFD628AE982CCEAB8979568C43FB34207E0DEC7D8A6AA391846C910F77771ECF2D0531A234D3798BC1B1433091A895E23A77792F4BE403D526F1D260A3627F2E80E863A204A774F58D7DE2C5C4A7E463A46BC436F0B7AF07179EC334D31073BF035FD94454ECD54146473F786EA15A1CEBB3B9C0D282195AD612D33B31F5528DAB5231CB17A3DE9AB5C8BD7BF8F773C255845BC9B70A1E53A50E5AEA801FFE604A2B2C1FBE86A2A883632E7AE75ADA007FB6AB1AA529DE3151CAA8D1D07FA19EFF5679398340E720CF2CFC4E1AEDD73C44983CC8E610DD419AE2E88206573837D6E44018D9498B62F9C0B8EA7741450FC7DBFF7C546D3CBCBA5B9123577FD5531880A18F1275F9181A922803D8F03512C58B5FBBC41CE8095EDD920A3E36CEB6EDB56900E6CEC2928288909D61B3B426EBC54F0A69C261A848B358C3A8E332567B9FFC1A7A07E9414BB1F75DE0795CF87632F5D6A87A246FD4E98E70489F779FE99C5BC4DB24BFA860C3551888FC721CDBC6AB5783B02BEF893E0984B6FDB5142A1AFD3277FE8F36B87849BC00B3FB3ADAFE4EDAE4839B83894C27FEF93514D7E3FFB7A30E99C6875D96C582E81D45FB463DC37B8791FC28A759301FC2F9879960C82BC7C427382A41B9AEFAC0051A2C653E55A47B48860CDA32812A192C1508A6C012C7E4BBAB1619B7926549FD8CE27928618F035BE31D56CBC9586D88E00DA69341F6F01554E205344E49E8871CCF80F9FF5CB54479AFA66806DD02FAFEE7D43572B3AA22742635FE65BFC8004960DC679FC7F8C0E5B50B3CE1E446B7A5E189BB9AAFA06FEC472D6E67EA4905373A01A2B662F534131405FBAB9BBAE892F0C265439EA1ABC91B186B5AC1E53A0C786607B1069BC026359955CFD614D7F80DF416A08AB18991A0398A83DF3CF2D65D7C45EEE643
+20150521054538 2 6 100 7679 2 D67DA234F46097F7EE3B230456E7C895BCA86395DF43D60D9D587C64EA4525FBCAD22442143068578CE8ECC8280B2D81F747B484AA668FFCDBEB067EB824B42E5FA1A40BC08EE8CC4A064298CB31C36340951EC7A006878C79C80068196180DA31E1DEF79A72B2D059203DDE461485D1B9783AF79E981CDAEF88589D8343E5B52D96FE90EA13194AFAF7459B17B80971720357ABD09CFE992966FFC1C239821C910F55D69E44277E5DE9841F4E5B2D25D6A265D321059B762F7D6AC5F0E260DEEB628D32940002B219B354486CC5BBF6390F19899EA5E145A28487029DF0517564A81FA10FA60AFA04CE77794775392829DB636E7F5EE00868D5027A6BA75CA922CEF3CA78683D14AB2E58439789033ACF441236F5E3C7849E3662B5123304F82D0061EA9C18EA1676A736FFD628AE982CCEAB8979568C43FB34207E0DEC7D8A6AA391846C910F77771ECF2D0531A234D3798BC1B1433091A895E23A77792F4BE403D526F1D260A3627F2E80E863A204A774F58D7DE2C5C4A7E463A46BC436F0B7AF07179EC334D31073BF035FD94454ECD54146473F786EA15A1CEBB3B9C0D282195AD612D33B31F5528DAB5231CB17A3DE9AB5C8BD7BF8F773C255845BC9B70A1E53A50E5AEA801FFE604A2B2C1FBE86A2A883632E7AE75ADA007FB6AB1AA529DE3151CAA8D1D07FA19EFF5679398340E720CF2CFC4E1AEDD73C44983CC8E610DD419AE2E88206573837D6E44018D9498B62F9C0B8EA7741450FC7DBFF7C546D3CBCBA5B9123577FD5531880A18F1275F9181A922803D8F03512C58B5FBBC41CE8095EDD920A3E36CEB6EDB56900E6CEC2928288909D61B3B426EBC54F0A69C261A848B358C3A8E332567B9FFC1A7A07E9414BB1F75DE0795CF87632F5D6A87A246FD4E98E70489F779FE99C5BC4DB24BFA860C3551888FC721CDBC6AB5783B02BEF893E0984B6FDB5142A1AFD3277FE8F36B87849BC00B3FB3ADAFE4EDAE4839B83894C27FEF93514D7E3FFB7A30E99C6875D96C582E81D45FB463DC37B8791FC28A759301FC2F9879960C82BC7C427382A41B9AEFAC0051A2C653E55A47B48860CDA32812A192C1508A6C012C7E4BBAB1619B7926549FD8CE27928618F035BE31D56CBC9586D88E00DA69341F6F01554E205344E49E8871CCF80F9FF5CB54479AFA66806DD02FAFEE7D43572B3AA22742635FE65BFC8004960DC679FC7F8C0E5B50B3CE1E446B7A5E189BB9AAFA06FEC472D6E67EA4905373A01A2B662F534131405FBAB9BBAE892F0C265439EA1ABC91B186B5AC1E53A0C786607B1069BC026359955CFD614D7F80DF416A08AB18991A0398A83DF3CF2D65D7C49FB77CB
+20150521024620 2 6 100 7679 2 D67DA234F46097F7EE3B230456E7C895BCA86395DF43D60D9D587C64EA4525FBCAD22442143068578CE8ECC8280B2D81F747B484AA668FFCDBEB067EB824B42E5FA1A40BC08EE8CC4A064298CB31C36340951EC7A006878C79C80068196180DA31E1DEF79A72B2D059203DDE461485D1B9783AF79E981CDAEF88589D8343E5B52D96FE90EA13194AFAF7459B17B80971720357ABD09CFE992966FFC1C239821C910F55D69E44277E5DE9841F4E5B2D25D6A265D321059B762F7D6AC5F0E260DEEB628D32940002B219B354486CC5BBF6390F19899EA5E145A28487029DF0517564A81FA10FA60AFA04CE77794775392829DB636E7F5EE00868D5027A6BA75CA922CEF3CA78683D14AB2E58439789033ACF441236F5E3C7849E3662B5123304F82D0061EA9C18EA1676A736FFD628AE982CCEAB8979568C43FB34207E0DEC7D8A6AA391846C910F77771ECF2D0531A234D3798BC1B1433091A895E23A77792F4BE403D526F1D260A3627F2E80E863A204A774F58D7DE2C5C4A7E463A46BC436F0B7AF07179EC334D31073BF035FD94454ECD54146473F786EA15A1CEBB3B9C0D282195AD612D33B31F5528DAB5231CB17A3DE9AB5C8BD7BF8F773C255845BC9B70A1E53A50E5AEA801FFE604A2B2C1FBE86A2A883632E7AE75ADA007FB6AB1AA529DE3151CAA8D1D07FA19EFF5679398340E720CF2CFC4E1AEDD73C44983CC8E610DD419AE2E88206573837D6E44018D9498B62F9C0B8EA7741450FC7DBFF7C546D3CBCBA5B9123577FD5531880A18F1275F9181A922803D8F03512C58B5FBBC41CE8095EDD920A3E36CEB6EDB56900E6CEC2928288909D61B3B426EBC54F0A69C261A848B358C3A8E332567B9FFC1A7A07E9414BB1F75DE0795CF87632F5D6A87A246FD4E98E70489F779FE99C5BC4DB24BFA860C3551888FC721CDBC6AB5783B02BEF893E0984B6FDB5142A1AFD3277FE8F36B87849BC00B3FB3ADAFE4EDAE4839B83894C27FEF93514D7E3FFB7A30E99C6875D96C582E81D45FB463DC37B8791FC28A759301FC2F9879960C82BC7C427382A41B9AEFAC0051A2C653E55A47B48860CDA32812A192C1508A6C012C7E4BBAB1619B7926549FD8CE27928618F035BE31D56CBC9586D88E00DA69341F6F01554E205344E49E8871CCF80F9FF5CB54479AFA66806DD02FAFEE7D43572B3AA22742635FE65BFC8004960DC679FC7F8C0E5B50B3CE1E446B7A5E189BB9AAFA06FEC472D6E67EA4905373A01A2B662F534131405FBAB9BBAE892F0C265439EA1ABC91B186B5AC1E53A0C786607B1069BC026359955CFD614D7F80DF416A08AB18991A0398A83DF3CF2D65D7C4D86D0FB
+20150521042108 2 6 100 7679 2 D67DA234F46097F7EE3B230456E7C895BCA86395DF43D60D9D587C64EA4525FBCAD22442143068578CE8ECC8280B2D81F747B484AA668FFCDBEB067EB824B42E5FA1A40BC08EE8CC4A064298CB31C36340951EC7A006878C79C80068196180DA31E1DEF79A72B2D059203DDE461485D1B9783AF79E981CDAEF88589D8343E5B52D96FE90EA13194AFAF7459B17B80971720357ABD09CFE992966FFC1C239821C910F55D69E44277E5DE9841F4E5B2D25D6A265D321059B762F7D6AC5F0E260DEEB628D32940002B219B354486CC5BBF6390F19899EA5E145A28487029DF0517564A81FA10FA60AFA04CE77794775392829DB636E7F5EE00868D5027A6BA75CA922CEF3CA78683D14AB2E58439789033ACF441236F5E3C7849E3662B5123304F82D0061EA9C18EA1676A736FFD628AE982CCEAB8979568C43FB34207E0DEC7D8A6AA391846C910F77771ECF2D0531A234D3798BC1B1433091A895E23A77792F4BE403D526F1D260A3627F2E80E863A204A774F58D7DE2C5C4A7E463A46BC436F0B7AF07179EC334D31073BF035FD94454ECD54146473F786EA15A1CEBB3B9C0D282195AD612D33B31F5528DAB5231CB17A3DE9AB5C8BD7BF8F773C255845BC9B70A1E53A50E5AEA801FFE604A2B2C1FBE86A2A883632E7AE75ADA007FB6AB1AA529DE3151CAA8D1D07FA19EFF5679398340E720CF2CFC4E1AEDD73C44983CC8E610DD419AE2E88206573837D6E44018D9498B62F9C0B8EA7741450FC7DBFF7C546D3CBCBA5B9123577FD5531880A18F1275F9181A922803D8F03512C58B5FBBC41CE8095EDD920A3E36CEB6EDB56900E6CEC2928288909D61B3B426EBC54F0A69C261A848B358C3A8E332567B9FFC1A7A07E9414BB1F75DE0795CF87632F5D6A87A246FD4E98E70489F779FE99C5BC4DB24BFA860C3551888FC721CDBC6AB5783B02BEF893E0984B6FDB5142A1AFD3277FE8F36B87849BC00B3FB3ADAFE4EDAE4839B83894C27FEF93514D7E3FFB7A30E99C6875D96C582E81D45FB463DC37B8791FC28A759301FC2F9879960C82BC7C427382A41B9AEFAC0051A2C653E55A47B48860CDA32812A192C1508A6C012C7E4BBAB1619B7926549FD8CE27928618F035BE31D56CBC9586D88E00DA69341F6F01554E205344E49E8871CCF80F9FF5CB54479AFA66806DD02FAFEE7D43572B3AA22742635FE65BFC8004960DC679FC7F8C0E5B50B3CE1E446B7A5E189BB9AAFA06FEC472D6E67EA4905373A01A2B662F534131405FBAB9BBAE892F0C265439EA1ABC91B186B5AC1E53A0C786607B1069BC026359955CFD614D7F80DF416A08AB18991A0398A83DF3CF2D65D7C505E524B
+20150521041835 2 6 100 8191 5 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354CD3703FA7
+20150521051726 2 6 100 8191 5 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354CD4CEF96F
+20150521074626 2 6 100 8191 2 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354CD86439C3
+20150521082439 2 6 100 8191 2 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354CD947F7F3
+20150521012012 2 6 100 8191 2 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354CE0694343
+20150521073153 2 6 100 8191 5 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354CE93D436F
+20150521094433 2 6 100 8191 2 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354CEC4EE993
+20150521074128 2 6 100 8191 2 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354CFA190CE3
+20150521014004 2 6 100 8191 5 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354D0235296F
+20150521014736 2 6 100 8191 2 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354D025961EB
+20150521065737 2 6 100 8191 5 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354D0961218F
+20150521043653 2 6 100 8191 5 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354D163706C7
+20150521085322 2 6 100 8191 5 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354D1BC6858F
+20150521093922 2 6 100 8191 2 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354D1CC27FE3
+20150521120407 2 6 100 8191 5 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354D1FE2874F
+20150521124157 2 6 100 8191 2 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354D20A8A19B
+20150521035417 2 6 100 8191 2 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354D24E0665B
+20150521062806 2 6 100 8191 2 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354D2828F7AB
+20150521074218 2 6 100 8191 5 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354D29B42017
+20150521114937 2 6 100 8191 5 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354D2F027D3F
+20150521073847 2 6 100 8191 5 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354D3905A9FF
+20150521024512 2 6 100 8191 2 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354D41DB2FFB
+20150521024827 2 6 100 8191 5 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354D41E2852F
+20150521042402 2 6 100 8191 2 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354D43D9B0E3
+20150521083756 2 6 100 8191 5 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354D491D852F
+20150521113241 2 6 100 8191 2 D7182545CB6AFDA1CCF5BB87F606DDD1CD25D4BAF110D7CCCC0BC78929189C09DC69308FBF76A16338AB8351B974081AEFE6F68B9DD0B3F661ED84DAF8736BF328122D00A803AD05DDB334CF5C98B2670F0B2ED0E2FA602CE2F6157A2A8E649A546957CE4F723C84B6AC46D64C5B329304181F2B70F48D15181C38777F4E18BB0344F5DAE703CC3A46B670713A7B99E536D30F92D1E5E683F2C5540105F425E01234968D1A63E0220A02721183E30302F029E4D0E0664E30329B730D99D03E53D67793F31BBA6C4274FB2ACA9181655B766246C598E4CD402737B682232B8534BE43A790ED6C04EF8047E1796048099B65EF415375D87BC7A01CB6086C9E23B667D22F52F5F44D6960601C15515D14F7D6A6BF6D7F6B1D834866ADF9FCFA1CDE00EF04C05591B05D4752471F124406D034BC8E6D71E03880BD3E7A77FD22E7D90B90A491E528EDE2E4B6FCF7C638883A4CDE80AF2C839569A4FB641C7B8948200DB0F51CA9B2613966C51F026A007D0696D14A4E4897556C7BB0E60A407B7B8C57643F278A47CC8089E24D38BAC1350A0E6D19FE540A773B8E90A6312D4B038C643B03ADDC741BDD3012F7714863BB63688E6145D47A6F40D15D6485E5AC278E229EA800FE705FEBEB2183CEF7C55DB952B627D4890B45441B3D4CF03BF0D132A7042C24447518B14956C11703131981CD69D7B6BA2A9F8C62057FE3A4319D17739DE0BBDAC9600E4809CD856E5F41C580863D93C251F0A31BA1CBCCAA499FEB79184E165C436A3B2FA9791C4526B47B0D1F6FE3BDE2730421E5DCA10483D91AA873ABD1236674EBE3A0D134C685CCE9D632280AE11C0D9CF7275517C1F14BCB81F2B23860D86F5028B21DF85868972EDF70A0704B3853EB1B16970834C661BC65693D38368DDB0D6E781DD2F52AE279913304601F5709E1C4B1A12B0FFDA93369001186FE8716027667F4B816E927A9977D3030CE211F4BE8B6F48836EABF4D8457FC5CFE39DF5BE96146D3B8C5BA11C3D75D252B0C190DEA5757049DE6BA89249166D60163ADDD38EAE171B53D44E135973AA05293AA7407693AE5478F480A3BE97BACBD8C7DE6EDF39EFB8BDDF8B0A2169228FD98A863C450129C8BA561A1D0F29C4EC75060A27E028E1321BCF7ADCB34B2C2B037E2C6B705F74002E0C844092025A630CFB2105F04D40135794DDF30C7E19187AE2AB8E6296C9EACFF43279F0ABE6E1150ABC2C3C8A6C4B95A7AA18CFBF953BF7662C16A0FE26D9EE7CF62BA16AA87B06373082E7551F42B8BE57BE19A50B059DC652BA46157FB7CC29AC1BF2834E668443637F87B2B12FD338706D69935D2C6348CF72F568B89B66345BF42209AA6D898F4388A54B4CFFD735EAF987CD6B738B401A14FACDAC97F63529118ED56DFB7DAC4967FFA252D185DBC29652E3F62A45D6BF990FB354D4CAD7D8B
diff --git a/crypto/openssl/CHANGES b/crypto/openssl/CHANGES
index 74179ab..759b2a7 100644
--- a/crypto/openssl/CHANGES
+++ b/crypto/openssl/CHANGES
@@ -2,6 +2,83 @@
OpenSSL CHANGES
_______________
+ Changes between 1.0.1n and 1.0.1o [12 Jun 2015]
+
+ *) Fix HMAC ABI incompatibility. The previous version introduced an ABI
+ incompatibility in the handling of HMAC. The previous ABI has now been
+ restored.
+
+ Changes between 1.0.1m and 1.0.1n [11 Jun 2015]
+
+ *) Malformed ECParameters causes infinite loop
+
+ When processing an ECParameters structure OpenSSL enters an infinite loop
+ if the curve specified is over a specially malformed binary polynomial
+ field.
+
+ This can be used to perform denial of service against any
+ system which processes public keys, certificate requests or
+ certificates. This includes TLS clients and TLS servers with
+ client authentication enabled.
+
+ This issue was reported to OpenSSL by Joseph Barr-Pixton.
+ (CVE-2015-1788)
+ [Andy Polyakov]
+
+ *) Exploitable out-of-bounds read in X509_cmp_time
+
+ X509_cmp_time does not properly check the length of the ASN1_TIME
+ string and can read a few bytes out of bounds. In addition,
+ X509_cmp_time accepts an arbitrary number of fractional seconds in the
+ time string.
+
+ An attacker can use this to craft malformed certificates and CRLs of
+ various sizes and potentially cause a segmentation fault, resulting in
+ a DoS on applications that verify certificates or CRLs. TLS clients
+ that verify CRLs are affected. TLS clients and servers with client
+ authentication enabled may be affected if they use custom verification
+ callbacks.
+
+ This issue was reported to OpenSSL by Robert Swiecki (Google), and
+ independently by Hanno Böck.
+ (CVE-2015-1789)
+ [Emilia Käsper]
+
+ *) PKCS7 crash with missing EnvelopedContent
+
+ The PKCS#7 parsing code does not handle missing inner EncryptedContent
+ correctly. An attacker can craft malformed ASN.1-encoded PKCS#7 blobs
+ with missing content and trigger a NULL pointer dereference on parsing.
+
+ Applications that decrypt PKCS#7 data or otherwise parse PKCS#7
+ structures from untrusted sources are affected. OpenSSL clients and
+ servers are not affected.
+
+ This issue was reported to OpenSSL by Michal Zalewski (Google).
+ (CVE-2015-1790)
+ [Emilia Käsper]
+
+ *) CMS verify infinite loop with unknown hash function
+
+ When verifying a signedData message the CMS code can enter an infinite loop
+ if presented with an unknown hash function OID. This can be used to perform
+ denial of service against any system which verifies signedData messages using
+ the CMS code.
+ This issue was reported to OpenSSL by Johannes Bauer.
+ (CVE-2015-1792)
+ [Stephen Henson]
+
+ *) Race condition handling NewSessionTicket
+
+ If a NewSessionTicket is received by a multi-threaded client when attempting to
+ reuse a previous ticket then a race condition can occur potentially leading to
+ a double free of the ticket data.
+ (CVE-2015-1791)
+ [Matt Caswell]
+
+ *) Reject DH handshakes with parameters shorter than 768 bits.
+ [Kurt Roeckx and Emilia Kasper]
+
Changes between 1.0.1l and 1.0.1m [19 Mar 2015]
*) Segmentation fault in ASN1_TYPE_cmp fix
diff --git a/crypto/openssl/Configure b/crypto/openssl/Configure
index d7ecf97..60ec378 100755
--- a/crypto/openssl/Configure
+++ b/crypto/openssl/Configure
@@ -230,12 +230,12 @@ my %table=(
#### SPARC Solaris with GNU C setups
"solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-"solaris-sparcv8-gcc","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"solaris-sparcv8-gcc","gcc:-mcpu=v8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# -m32 should be safe to add as long as driver recognizes -mcpu=ultrasparc
"solaris-sparcv9-gcc","gcc:-m32 -mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris64-sparcv9-gcc","gcc:-m64 -mcpu=ultrasparc -O3 -Wall -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-fPIC:-m64 -shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64",
####
-"debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mcpu=v8 -Wall -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -O -g -mcpu=ultrasparc -pedantic -ansi -Wall -Wshadow -Wno-long-long -D__EXTENSIONS__ -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
#### SPARC Solaris with Sun C setups
@@ -252,7 +252,7 @@ my %table=(
#### SunOS configs, assuming sparc for the gcc one.
#"sunos-cc", "cc:-O4 -DNOPROTO -DNOCONST::(unknown):SUNOS::DES_UNROLL:${no_asm}::",
-"sunos-gcc","gcc:-O3 -mv8 -Dssize_t=int::(unknown):SUNOS::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL DES_PTR DES_RISC1:${no_asm}::",
+"sunos-gcc","gcc:-O3 -mcpu=v8 -Dssize_t=int::(unknown):SUNOS::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL DES_PTR DES_RISC1:${no_asm}::",
#### IRIX 5.x configs
# -mips2 flag is added by ./config when appropriate.
@@ -379,7 +379,7 @@ my %table=(
#### SPARC Linux setups
# Ray Miller <ray.miller@computing-services.oxford.ac.uk> has patiently
# assisted with debugging of following two configs.
-"linux-sparcv8","gcc:-mv8 -DB_ENDIAN -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"linux-sparcv8","gcc:-mcpu=v8 -DB_ENDIAN -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# it's a real mess with -mcpu=ultrasparc option under Linux, but
# -Wa,-Av8plus should do the trick no matter what.
"linux-sparcv9","gcc:-m32 -mcpu=ultrasparc -DB_ENDIAN -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
@@ -413,7 +413,7 @@ my %table=(
"BSD-x86", "gcc:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"BSD-x86-elf", "gcc:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-BSD-x86-elf", "gcc:-DL_ENDIAN -O3 -Wall -g::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-"BSD-sparcv8", "gcc:-DB_ENDIAN -O3 -mv8 -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${sparcv8_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"BSD-sparcv8", "gcc:-DB_ENDIAN -O3 -mcpu=v8 -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${sparcv8_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"BSD-generic64","gcc:-O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
diff --git a/crypto/openssl/Makefile b/crypto/openssl/Makefile
index d3f31f0..0b3badb 100644
--- a/crypto/openssl/Makefile
+++ b/crypto/openssl/Makefile
@@ -4,7 +4,7 @@
## Makefile for OpenSSL
##
-VERSION=1.0.1m
+VERSION=1.0.1o
MAJOR=1
MINOR=0.1
SHLIB_VERSION_NUMBER=1.0.0
@@ -186,7 +186,7 @@ WTARFILE= $(NAME)-win.tar
EXHEADER= e_os2.h
HEADER= e_os.h
-all: Makefile build_all openssl.pc libssl.pc libcrypto.pc
+all: Makefile build_all
# as we stick to -e, CLEARENV ensures that local variables in lower
# Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn
@@ -272,7 +272,10 @@ reflect:
sub_all: build_all
build_all: build_libs build_apps build_tests build_tools
-build_libs: build_crypto build_ssl build_engines
+build_libs: build_libcrypto build_libssl openssl.pc
+
+build_libcrypto: build_crypto build_engines libcrypto.pc
+build_libssl: build_ssl libssl.pc
build_crypto:
@dir=crypto; target=all; $(BUILD_ONE_CMD)
@@ -461,6 +464,9 @@ tests: rehash
report:
@$(PERL) util/selftest.pl
+update: errors stacks util/libeay.num util/ssleay.num TABLE
+ @set -e; target=update; $(RECURSIVE_BUILD_CMD)
+
depend:
@set -e; target=depend; $(RECURSIVE_BUILD_CMD)
@@ -485,26 +491,10 @@ util/libeay.num::
util/ssleay.num::
$(PERL) util/mkdef.pl ssl update
-crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl crypto/objects/obj_mac.h
- $(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
-crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num
- $(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
-crypto/objects/obj_xref.h: crypto/objects/objxref.pl crypto/objects/obj_xref.txt crypto/objects/obj_mac.num
- $(PERL) crypto/objects/objxref.pl crypto/objects/obj_mac.num crypto/objects/obj_xref.txt >crypto/objects/obj_xref.h
-
-apps/openssl-vms.cnf: apps/openssl.cnf
- $(PERL) VMS/VMSify-conf.pl < apps/openssl.cnf > apps/openssl-vms.cnf
-
-crypto/bn/bn_prime.h: crypto/bn/bn_prime.pl
- $(PERL) crypto/bn/bn_prime.pl >crypto/bn/bn_prime.h
-
-
TABLE: Configure
(echo 'Output of `Configure TABLE'"':"; \
$(PERL) Configure TABLE) > TABLE
-update: errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h crypto/objects/obj_xref.h apps/openssl-vms.cnf crypto/bn/bn_prime.h TABLE depend
-
# Build distribution tar-file. As the list of files returned by "find" is
# pretty long, on several platforms a "too many arguments" error or similar
# would occur. Therefore the list of files is temporarily stored into a file
diff --git a/crypto/openssl/Makefile.org b/crypto/openssl/Makefile.org
index c0e16bb..89e8062 100644
--- a/crypto/openssl/Makefile.org
+++ b/crypto/openssl/Makefile.org
@@ -184,7 +184,7 @@ WTARFILE= $(NAME)-win.tar
EXHEADER= e_os2.h
HEADER= e_os.h
-all: Makefile build_all openssl.pc libssl.pc libcrypto.pc
+all: Makefile build_all
# as we stick to -e, CLEARENV ensures that local variables in lower
# Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn
@@ -270,7 +270,10 @@ reflect:
sub_all: build_all
build_all: build_libs build_apps build_tests build_tools
-build_libs: build_crypto build_ssl build_engines
+build_libs: build_libcrypto build_libssl openssl.pc
+
+build_libcrypto: build_crypto build_engines libcrypto.pc
+build_libssl: build_ssl libssl.pc
build_crypto:
@dir=crypto; target=all; $(BUILD_ONE_CMD)
@@ -459,6 +462,9 @@ tests: rehash
report:
@$(PERL) util/selftest.pl
+update: errors stacks util/libeay.num util/ssleay.num TABLE
+ @set -e; target=update; $(RECURSIVE_BUILD_CMD)
+
depend:
@set -e; target=depend; $(RECURSIVE_BUILD_CMD)
@@ -483,26 +489,10 @@ util/libeay.num::
util/ssleay.num::
$(PERL) util/mkdef.pl ssl update
-crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl crypto/objects/obj_mac.h
- $(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
-crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num
- $(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
-crypto/objects/obj_xref.h: crypto/objects/objxref.pl crypto/objects/obj_xref.txt crypto/objects/obj_mac.num
- $(PERL) crypto/objects/objxref.pl crypto/objects/obj_mac.num crypto/objects/obj_xref.txt >crypto/objects/obj_xref.h
-
-apps/openssl-vms.cnf: apps/openssl.cnf
- $(PERL) VMS/VMSify-conf.pl < apps/openssl.cnf > apps/openssl-vms.cnf
-
-crypto/bn/bn_prime.h: crypto/bn/bn_prime.pl
- $(PERL) crypto/bn/bn_prime.pl >crypto/bn/bn_prime.h
-
-
TABLE: Configure
(echo 'Output of `Configure TABLE'"':"; \
$(PERL) Configure TABLE) > TABLE
-update: errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h crypto/objects/obj_xref.h apps/openssl-vms.cnf crypto/bn/bn_prime.h TABLE depend
-
# Build distribution tar-file. As the list of files returned by "find" is
# pretty long, on several platforms a "too many arguments" error or similar
# would occur. Therefore the list of files is temporarily stored into a file
diff --git a/crypto/openssl/NEWS b/crypto/openssl/NEWS
index 12616d2..fb69ad3 100644
--- a/crypto/openssl/NEWS
+++ b/crypto/openssl/NEWS
@@ -5,6 +5,18 @@
This file gives a brief overview of the major changes between each OpenSSL
release. For more details please read the CHANGES file.
+ Major changes between OpenSSL 1.0.1n and OpenSSL 1.0.1o [12 Jun 2015]
+
+ o Fix HMAC ABI incompatibility
+
+ Major changes between OpenSSL 1.0.1m and OpenSSL 1.0.1n [11 Jun 2015]
+
+ o Malformed ECParameters causes infinite loop (CVE-2015-1788)
+ o Exploitable out-of-bounds read in X509_cmp_time (CVE-2015-1789)
+ o PKCS7 crash with missing EnvelopedContent (CVE-2015-1790)
+ o CMS verify infinite loop with unknown hash function (CVE-2015-1792)
+ o Race condition handling NewSessionTicket (CVE-2015-1791)
+
Major changes between OpenSSL 1.0.1l and OpenSSL 1.0.1m [19 Mar 2015]
o Segmentation fault in ASN1_TYPE_cmp fix (CVE-2015-0286)
diff --git a/crypto/openssl/README b/crypto/openssl/README
index ecdcfb2..bf3b715 100644
--- a/crypto/openssl/README
+++ b/crypto/openssl/README
@@ -1,5 +1,5 @@
- OpenSSL 1.0.1m 19 Mar 2015
+ OpenSSL 1.0.1o 12 Jun 2015
Copyright (c) 1998-2011 The OpenSSL Project
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
diff --git a/crypto/openssl/apps/Makefile b/crypto/openssl/apps/Makefile
index 72657ea..cafe554 100644
--- a/crypto/openssl/apps/Makefile
+++ b/crypto/openssl/apps/Makefile
@@ -94,6 +94,9 @@ req: sreq.o $(A_OBJ) $(DLIBCRYPTO)
sreq.o: req.c
$(CC) -c $(INCLUDES) $(CFLAG) -o sreq.o req.c
+openssl-vms.cnf: openssl.cnf
+ $(PERL) $(TOP)/VMS/VMSify-conf.pl < openssl.cnf > openssl-vms.cnf
+
files:
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
@@ -127,12 +130,12 @@ links:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
-depend:
- @if [ -z "$(THIS)" ]; then \
- $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; \
- else \
- $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC); \
- fi
+update: openssl-vms.cnf local_depend
+
+depend: local_depend
+ @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
+local_depend:
+ @[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC); \
dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
@@ -144,10 +147,10 @@ clean:
rm -f req
$(DLIBSSL):
- (cd ..; $(MAKE) DIRS=ssl all)
+ (cd ..; $(MAKE) build_libssl)
$(DLIBCRYPTO):
- (cd ..; $(MAKE) DIRS=crypto all)
+ (cd ..; $(MAKE) build_libcrypto)
$(EXE): progs.h $(E_OBJ) $(PROGRAM).o $(DLIBCRYPTO) $(DLIBSSL)
$(RM) $(EXE)
diff --git a/crypto/openssl/apps/apps.c b/crypto/openssl/apps/apps.c
index 9862afd..6801238 100644
--- a/crypto/openssl/apps/apps.c
+++ b/crypto/openssl/apps/apps.c
@@ -572,7 +572,7 @@ int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_tmp)
char *prompt = NULL;
prompt = UI_construct_prompt(ui, "pass phrase", prompt_info);
- if(!prompt) {
+ if (!prompt) {
BIO_printf(bio_err, "Out of memory\n");
UI_free(ui);
return 0;
@@ -586,7 +586,7 @@ int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_tmp)
PW_MIN_LENGTH, bufsiz - 1);
if (ok >= 0 && verify) {
buff = (char *)OPENSSL_malloc(bufsiz);
- if(!buff) {
+ if (!buff) {
BIO_printf(bio_err, "Out of memory\n");
UI_free(ui);
OPENSSL_free(prompt);
@@ -2238,6 +2238,8 @@ int args_verify(char ***pargs, int *pargc,
flags |= X509_V_FLAG_NOTIFY_POLICY;
else if (!strcmp(arg, "-check_ss_sig"))
flags |= X509_V_FLAG_CHECK_SS_SIGNATURE;
+ else if (!strcmp(arg, "-no_alt_chains"))
+ flags |= X509_V_FLAG_NO_ALT_CHAINS;
else
return 0;
diff --git a/crypto/openssl/apps/asn1pars.c b/crypto/openssl/apps/asn1pars.c
index 7a0f169..11b0787 100644
--- a/crypto/openssl/apps/asn1pars.c
+++ b/crypto/openssl/apps/asn1pars.c
@@ -375,7 +375,7 @@ static int do_generate(BIO *bio, char *genstr, char *genconf, BUF_MEM *buf)
{
CONF *cnf = NULL;
int len;
- long errline;
+ long errline = 0;
unsigned char *p;
ASN1_TYPE *atyp = NULL;
diff --git a/crypto/openssl/apps/ca.c b/crypto/openssl/apps/ca.c
index 5d29a64..97ad0c1 100644
--- a/crypto/openssl/apps/ca.c
+++ b/crypto/openssl/apps/ca.c
@@ -558,7 +558,7 @@ int MAIN(int argc, char **argv)
#ifdef OPENSSL_SYS_VMS
len = strlen(s) + sizeof(CONFIG_FILE);
tofree = OPENSSL_malloc(len);
- if(!tofree) {
+ if (!tofree) {
BIO_printf(bio_err, "Out of memory\n");
goto err;
}
@@ -566,7 +566,7 @@ int MAIN(int argc, char **argv)
#else
len = strlen(s) + sizeof(CONFIG_FILE) + 1;
tofree = OPENSSL_malloc(len);
- if(!tofree) {
+ if (!tofree) {
BIO_printf(bio_err, "Out of memory\n");
goto err;
}
@@ -2803,7 +2803,7 @@ int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
ASN1_GENERALIZEDTIME *comp_time = NULL;
tmp = BUF_strdup(str);
- if(!tmp) {
+ if (!tmp) {
BIO_printf(bio_err, "memory allocation failure\n");
goto err;
}
@@ -2825,7 +2825,7 @@ int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
if (prevtm) {
*prevtm = ASN1_UTCTIME_new();
- if(!*prevtm) {
+ if (!*prevtm) {
BIO_printf(bio_err, "memory allocation failure\n");
goto err;
}
@@ -2869,7 +2869,7 @@ int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
goto err;
}
comp_time = ASN1_GENERALIZEDTIME_new();
- if(!comp_time) {
+ if (!comp_time) {
BIO_printf(bio_err, "memory allocation failure\n");
goto err;
}
diff --git a/crypto/openssl/apps/cms.c b/crypto/openssl/apps/cms.c
index 0cc4b46..d7645c0 100644
--- a/crypto/openssl/apps/cms.c
+++ b/crypto/openssl/apps/cms.c
@@ -581,6 +581,8 @@ int MAIN(int argc, char **argv)
"-CApath dir trusted certificates directory\n");
BIO_printf(bio_err, "-CAfile file trusted certificates file\n");
BIO_printf(bio_err,
+ "-no_alt_chains only ever use the first certificate chain found\n");
+ BIO_printf(bio_err,
"-crl_check check revocation status of signer's certificate using CRLs\n");
BIO_printf(bio_err,
"-crl_check_all check revocation status of signer's certificate chain using CRLs\n");
diff --git a/crypto/openssl/apps/dhparam.c b/crypto/openssl/apps/dhparam.c
index f86311c..d3b6d58 100644
--- a/crypto/openssl/apps/dhparam.c
+++ b/crypto/openssl/apps/dhparam.c
@@ -130,7 +130,7 @@
# undef PROG
# define PROG dhparam_main
-# define DEFBITS 512
+# define DEFBITS 2048
/*-
* -inform arg - input format - default PEM (DER or PEM)
@@ -254,7 +254,7 @@ int MAIN(int argc, char **argv)
BIO_printf(bio_err,
" -5 generate parameters using 5 as the generator value\n");
BIO_printf(bio_err,
- " numbits number of bits in to generate (default 512)\n");
+ " numbits number of bits in to generate (default 2048)\n");
# ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err,
" -engine e use engine e, possibly a hardware device.\n");
diff --git a/crypto/openssl/apps/enc.c b/crypto/openssl/apps/enc.c
index 5c2cf7a..7b7c70b 100644
--- a/crypto/openssl/apps/enc.c
+++ b/crypto/openssl/apps/enc.c
@@ -548,9 +548,14 @@ int MAIN(int argc, char **argv)
else
OPENSSL_cleanse(str, strlen(str));
}
- if ((hiv != NULL) && !set_hex(hiv, iv, sizeof iv)) {
- BIO_printf(bio_err, "invalid hex iv value\n");
- goto end;
+ if (hiv != NULL) {
+ int siz = EVP_CIPHER_iv_length(cipher);
+ if (siz == 0) {
+ BIO_printf(bio_err, "warning: iv not use by this cipher\n");
+ } else if (!set_hex(hiv, iv, sizeof iv)) {
+ BIO_printf(bio_err, "invalid hex iv value\n");
+ goto end;
+ }
}
if ((hiv == NULL) && (str == NULL)
&& EVP_CIPHER_iv_length(cipher) != 0) {
@@ -562,7 +567,7 @@ int MAIN(int argc, char **argv)
BIO_printf(bio_err, "iv undefined\n");
goto end;
}
- if ((hkey != NULL) && !set_hex(hkey, key, sizeof key)) {
+ if ((hkey != NULL) && !set_hex(hkey, key, EVP_CIPHER_key_length(cipher))) {
BIO_printf(bio_err, "invalid hex key value\n");
goto end;
}
diff --git a/crypto/openssl/apps/gendh.c b/crypto/openssl/apps/gendh.c
index adaa101..fef6f1b 100644
--- a/crypto/openssl/apps/gendh.c
+++ b/crypto/openssl/apps/gendh.c
@@ -80,7 +80,7 @@
# include <openssl/x509.h>
# include <openssl/pem.h>
-# define DEFBITS 512
+# define DEFBITS 2048
# undef PROG
# define PROG gendh_main
diff --git a/crypto/openssl/apps/ocsp.c b/crypto/openssl/apps/ocsp.c
index 71def26..572f064 100644
--- a/crypto/openssl/apps/ocsp.c
+++ b/crypto/openssl/apps/ocsp.c
@@ -519,6 +519,8 @@ int MAIN(int argc, char **argv)
BIO_printf(bio_err,
"-CAfile file trusted certificates file\n");
BIO_printf(bio_err,
+ "-no_alt_chains only ever use the first certificate chain found\n");
+ BIO_printf(bio_err,
"-VAfile file validator certificates file\n");
BIO_printf(bio_err,
"-validity_period n maximum validity discrepancy in seconds\n");
diff --git a/crypto/openssl/apps/s_cb.c b/crypto/openssl/apps/s_cb.c
index 7918500..fabf9cf 100644
--- a/crypto/openssl/apps/s_cb.c
+++ b/crypto/openssl/apps/s_cb.c
@@ -111,6 +111,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h> /* for memcpy() */
#define USE_SOCKETS
#define NON_MAIN
#include "apps.h"
@@ -747,7 +748,7 @@ int MS_CALLBACK generate_cookie_callback(SSL *ssl, unsigned char *cookie,
/* Initialize a random secret */
if (!cookie_initialized) {
- if (!RAND_bytes(cookie_secret, COOKIE_SECRET_LENGTH)) {
+ if (RAND_bytes(cookie_secret, COOKIE_SECRET_LENGTH) <= 0) {
BIO_printf(bio_err, "error setting random cookie secret\n");
return 0;
}
diff --git a/crypto/openssl/apps/s_client.c b/crypto/openssl/apps/s_client.c
index ef41cec..28737b6 100644
--- a/crypto/openssl/apps/s_client.c
+++ b/crypto/openssl/apps/s_client.c
@@ -323,6 +323,8 @@ static void sc_usage(void)
BIO_printf(bio_err, " -CApath arg - PEM format directory of CA's\n");
BIO_printf(bio_err, " -CAfile arg - PEM format file of CA's\n");
BIO_printf(bio_err,
+ " -no_alt_chains - only ever use the first certificate chain found\n");
+ BIO_printf(bio_err,
" -reconnect - Drop and re-make the connection with the same Session-ID\n");
BIO_printf(bio_err,
" -pause - sleep(1) after each read(2) and write(2) system call\n");
@@ -547,7 +549,7 @@ static char *MS_CALLBACK ssl_give_srp_client_pwd_cb(SSL *s, void *arg)
PW_CB_DATA cb_tmp;
int l;
- if(!pass) {
+ if (!pass) {
BIO_printf(bio_err, "Malloc failure\n");
return NULL;
}
@@ -1177,13 +1179,12 @@ int MAIN(int argc, char **argv)
if (!set_cert_key_stuff(ctx, cert, key))
goto end;
- if ((!SSL_CTX_load_verify_locations(ctx, CAfile, CApath)) ||
- (!SSL_CTX_set_default_verify_paths(ctx))) {
- /*
- * BIO_printf(bio_err,"error setting default verify locations\n");
- */
+ if ((CAfile || CApath)
+ && !SSL_CTX_load_verify_locations(ctx, CAfile, CApath)) {
+ ERR_print_errors(bio_err);
+ }
+ if (!SSL_CTX_set_default_verify_paths(ctx)) {
ERR_print_errors(bio_err);
- /* goto end; */
}
#ifndef OPENSSL_NO_TLSEXT
if (servername != NULL) {
diff --git a/crypto/openssl/apps/s_server.c b/crypto/openssl/apps/s_server.c
index bcf5c33..b58e5e0 100644
--- a/crypto/openssl/apps/s_server.c
+++ b/crypto/openssl/apps/s_server.c
@@ -219,7 +219,7 @@ static int generate_session_id(const SSL *ssl, unsigned char *id,
unsigned int *id_len);
#ifndef OPENSSL_NO_DH
static DH *load_dh_param(const char *dhfile);
-static DH *get_dh512(void);
+static DH *get_dh2048(void);
#endif
#ifdef MONOLITH
@@ -227,30 +227,48 @@ static void s_server_init(void);
#endif
#ifndef OPENSSL_NO_DH
-static unsigned char dh512_p[] = {
- 0xDA, 0x58, 0x3C, 0x16, 0xD9, 0x85, 0x22, 0x89, 0xD0, 0xE4, 0xAF, 0x75,
- 0x6F, 0x4C, 0xCA, 0x92, 0xDD, 0x4B, 0xE5, 0x33, 0xB8, 0x04, 0xFB, 0x0F,
- 0xED, 0x94, 0xEF, 0x9C, 0x8A, 0x44, 0x03, 0xED, 0x57, 0x46, 0x50, 0xD3,
- 0x69, 0x99, 0xDB, 0x29, 0xD7, 0x76, 0x27, 0x6B, 0xA2, 0xD3, 0xD4, 0x12,
- 0xE2, 0x18, 0xF4, 0xDD, 0x1E, 0x08, 0x4C, 0xF6, 0xD8, 0x00, 0x3E, 0x7C,
- 0x47, 0x74, 0xE8, 0x33,
+static unsigned char dh2048_p[] = {
+ 0xF6,0x42,0x57,0xB7,0x08,0x7F,0x08,0x17,0x72,0xA2,0xBA,0xD6,
+ 0xA9,0x42,0xF3,0x05,0xE8,0xF9,0x53,0x11,0x39,0x4F,0xB6,0xF1,
+ 0x6E,0xB9,0x4B,0x38,0x20,0xDA,0x01,0xA7,0x56,0xA3,0x14,0xE9,
+ 0x8F,0x40,0x55,0xF3,0xD0,0x07,0xC6,0xCB,0x43,0xA9,0x94,0xAD,
+ 0xF7,0x4C,0x64,0x86,0x49,0xF8,0x0C,0x83,0xBD,0x65,0xE9,0x17,
+ 0xD4,0xA1,0xD3,0x50,0xF8,0xF5,0x59,0x5F,0xDC,0x76,0x52,0x4F,
+ 0x3D,0x3D,0x8D,0xDB,0xCE,0x99,0xE1,0x57,0x92,0x59,0xCD,0xFD,
+ 0xB8,0xAE,0x74,0x4F,0xC5,0xFC,0x76,0xBC,0x83,0xC5,0x47,0x30,
+ 0x61,0xCE,0x7C,0xC9,0x66,0xFF,0x15,0xF9,0xBB,0xFD,0x91,0x5E,
+ 0xC7,0x01,0xAA,0xD3,0x5B,0x9E,0x8D,0xA0,0xA5,0x72,0x3A,0xD4,
+ 0x1A,0xF0,0xBF,0x46,0x00,0x58,0x2B,0xE5,0xF4,0x88,0xFD,0x58,
+ 0x4E,0x49,0xDB,0xCD,0x20,0xB4,0x9D,0xE4,0x91,0x07,0x36,0x6B,
+ 0x33,0x6C,0x38,0x0D,0x45,0x1D,0x0F,0x7C,0x88,0xB3,0x1C,0x7C,
+ 0x5B,0x2D,0x8E,0xF6,0xF3,0xC9,0x23,0xC0,0x43,0xF0,0xA5,0x5B,
+ 0x18,0x8D,0x8E,0xBB,0x55,0x8C,0xB8,0x5D,0x38,0xD3,0x34,0xFD,
+ 0x7C,0x17,0x57,0x43,0xA3,0x1D,0x18,0x6C,0xDE,0x33,0x21,0x2C,
+ 0xB5,0x2A,0xFF,0x3C,0xE1,0xB1,0x29,0x40,0x18,0x11,0x8D,0x7C,
+ 0x84,0xA7,0x0A,0x72,0xD6,0x86,0xC4,0x03,0x19,0xC8,0x07,0x29,
+ 0x7A,0xCA,0x95,0x0C,0xD9,0x96,0x9F,0xAB,0xD0,0x0A,0x50,0x9B,
+ 0x02,0x46,0xD3,0x08,0x3D,0x66,0xA4,0x5D,0x41,0x9F,0x9C,0x7C,
+ 0xBD,0x89,0x4B,0x22,0x19,0x26,0xBA,0xAB,0xA2,0x5E,0xC3,0x55,
+ 0xE9,0x32,0x0B,0x3B,
};
-static unsigned char dh512_g[] = {
+static unsigned char dh2048_g[] = {
0x02,
};
-static DH *get_dh512(void)
+DH *get_dh2048()
{
- DH *dh = NULL;
+ DH *dh;
if ((dh = DH_new()) == NULL)
- return (NULL);
- dh->p = BN_bin2bn(dh512_p, sizeof(dh512_p), NULL);
- dh->g = BN_bin2bn(dh512_g, sizeof(dh512_g), NULL);
- if ((dh->p == NULL) || (dh->g == NULL))
- return (NULL);
- return (dh);
+ return NULL;
+ dh->p=BN_bin2bn(dh2048_p, sizeof(dh2048_p), NULL);
+ dh->g=BN_bin2bn(dh2048_g, sizeof(dh2048_g), NULL);
+ if (dh->p == NULL || dh->g == NULL) {
+ DH_free(dh);
+ return NULL;
+ }
+ return dh;
}
#endif
@@ -523,6 +541,8 @@ static void sv_usage(void)
BIO_printf(bio_err, " -CApath arg - PEM format directory of CA's\n");
BIO_printf(bio_err, " -CAfile arg - PEM format file of CA's\n");
BIO_printf(bio_err,
+ " -no_alt_chains - only ever use the first certificate chain found\n");
+ BIO_printf(bio_err,
" -nocert - Don't use any certificates (Anon-DH)\n");
BIO_printf(bio_err,
" -cipher arg - play with 'openssl ciphers' to see what goes here\n");
@@ -720,7 +740,7 @@ static int ebcdic_write(BIO *b, const char *in, int inl)
num = inl;
wbuf =
(EBCDIC_OUTBUFF *) OPENSSL_malloc(sizeof(EBCDIC_OUTBUFF) + num);
- if(!wbuf)
+ if (!wbuf)
return 0;
OPENSSL_free(b->ptr);
@@ -998,7 +1018,7 @@ int MAIN(int argc, char *argv[])
int off = 0;
int no_tmp_rsa = 0, no_dhe = 0, nocert = 0;
#ifndef OPENSSL_NO_ECDH
- int no_ecdhe;
+ int no_ecdhe = 0;
#endif
int state = 0;
const SSL_METHOD *meth = NULL;
@@ -1654,7 +1674,11 @@ int MAIN(int argc, char *argv[])
BIO_printf(bio_s_out, "Setting temp DH parameters\n");
} else {
BIO_printf(bio_s_out, "Using default temp DH parameters\n");
- dh = get_dh512();
+ dh = get_dh2048();
+ if (dh == NULL) {
+ ERR_print_errors(bio_err);
+ goto end;
+ }
}
(void)BIO_flush(bio_s_out);
@@ -2251,8 +2275,10 @@ static int sv_body(char *hostname, int s, unsigned char *context)
ret = 1;
goto err;
}
- l += k;
- i -= k;
+ if (k > 0) {
+ l += k;
+ i -= k;
+ }
if (i <= 0)
break;
}
@@ -2916,7 +2942,8 @@ static int generate_session_id(const SSL *ssl, unsigned char *id,
{
unsigned int count = 0;
do {
- RAND_pseudo_bytes(id, *id_len);
+ if (RAND_pseudo_bytes(id, *id_len) < 0)
+ return 0;
/*
* Prefix the session_id with the required prefix. NB: If our prefix
* is too long, clip it - but there will be worse effects anyway, eg.
diff --git a/crypto/openssl/apps/s_time.c b/crypto/openssl/apps/s_time.c
index a40997a..38788f7 100644
--- a/crypto/openssl/apps/s_time.c
+++ b/crypto/openssl/apps/s_time.c
@@ -302,7 +302,7 @@ static int parseArgs(int argc, char **argv)
if (--argc < 1)
goto bad;
maxTime = atoi(*(++argv));
- if(maxTime <= 0) {
+ if (maxTime <= 0) {
BIO_printf(bio_err, "time must be > 0\n");
badop = 1;
}
diff --git a/crypto/openssl/apps/smime.c b/crypto/openssl/apps/smime.c
index 7b351f6..53e43c5 100644
--- a/crypto/openssl/apps/smime.c
+++ b/crypto/openssl/apps/smime.c
@@ -442,6 +442,8 @@ int MAIN(int argc, char **argv)
"-CApath dir trusted certificates directory\n");
BIO_printf(bio_err, "-CAfile file trusted certificates file\n");
BIO_printf(bio_err,
+ "-no_alt_chains only ever use the first certificate chain found\n");
+ BIO_printf(bio_err,
"-crl_check check revocation status of signer's certificate using CRLs\n");
BIO_printf(bio_err,
"-crl_check_all check revocation status of signer's certificate chain using CRLs\n");
diff --git a/crypto/openssl/apps/srp.c b/crypto/openssl/apps/srp.c
index c679448..c0ff417 100644
--- a/crypto/openssl/apps/srp.c
+++ b/crypto/openssl/apps/srp.c
@@ -435,7 +435,7 @@ int MAIN(int argc, char **argv)
# ifdef OPENSSL_SYS_VMS
len = strlen(s) + sizeof(CONFIG_FILE);
tofree = OPENSSL_malloc(len);
- if(!tofree) {
+ if (!tofree) {
BIO_printf(bio_err, "Out of memory\n");
goto err;
}
@@ -443,7 +443,7 @@ int MAIN(int argc, char **argv)
# else
len = strlen(s) + sizeof(CONFIG_FILE) + 1;
tofree = OPENSSL_malloc(len);
- if(!tofree) {
+ if (!tofree) {
BIO_printf(bio_err, "Out of memory\n");
goto err;
}
diff --git a/crypto/openssl/apps/verify.c b/crypto/openssl/apps/verify.c
index 7295c76..e29f9bb 100644
--- a/crypto/openssl/apps/verify.c
+++ b/crypto/openssl/apps/verify.c
@@ -227,7 +227,7 @@ int MAIN(int argc, char **argv)
if (ret == 1) {
BIO_printf(bio_err,
"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check]");
- BIO_printf(bio_err, " [-attime timestamp]");
+ BIO_printf(bio_err, " [-no_alt_chains] [-attime timestamp]");
#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err, " [-engine e]");
#endif
diff --git a/crypto/openssl/crypto/Makefile b/crypto/openssl/crypto/Makefile
index b839b55..11f517a 100644
--- a/crypto/openssl/crypto/Makefile
+++ b/crypto/openssl/crypto/Makefile
@@ -126,12 +126,17 @@ install:
lint:
@target=lint; $(RECURSIVE_MAKE)
-depend:
+update: local_depend
+ @[ -z "$(THIS)" ] || (set -e; target=update; $(RECURSIVE_MAKE) )
+ @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
+
+depend: local_depend
+ @[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) )
+ @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
+local_depend:
@[ -z "$(THIS)" -o -f buildinf.h ] || touch buildinf.h # fake buildinf.h if it does not exist
@[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDE) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
@[ -z "$(THIS)" -o -s buildinf.h ] || rm buildinf.h
- @[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) )
- @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
clean:
rm -f buildinf.h *.s *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
diff --git a/crypto/openssl/crypto/aes/Makefile b/crypto/openssl/crypto/aes/Makefile
index 45ede0a..b3a9581 100644
--- a/crypto/openssl/crypto/aes/Makefile
+++ b/crypto/openssl/crypto/aes/Makefile
@@ -106,6 +106,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/asn1/Makefile b/crypto/openssl/crypto/asn1/Makefile
index f778700..d774f78 100644
--- a/crypto/openssl/crypto/asn1/Makefile
+++ b/crypto/openssl/crypto/asn1/Makefile
@@ -93,6 +93,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by top Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/asn1/a_int.c b/crypto/openssl/crypto/asn1/a_int.c
index 70c2b8e..7e26704 100644
--- a/crypto/openssl/crypto/asn1/a_int.c
+++ b/crypto/openssl/crypto/asn1/a_int.c
@@ -124,6 +124,8 @@ int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
else {
ret = a->length;
i = a->data[0];
+ if (ret == 1 && i == 0)
+ neg = 0;
if (!neg && (i > 127)) {
pad = 1;
pb = 0;
@@ -162,7 +164,7 @@ int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
p += a->length - 1;
i = a->length;
/* Copy zeros to destination as long as source is zero */
- while (!*n) {
+ while (!*n && i > 1) {
*(p--) = 0;
n--;
i--;
@@ -419,7 +421,7 @@ ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai)
ASN1err(ASN1_F_BN_TO_ASN1_INTEGER, ERR_R_NESTED_ASN1_ERROR);
goto err;
}
- if (BN_is_negative(bn))
+ if (BN_is_negative(bn) && !BN_is_zero(bn))
ret->type = V_ASN1_NEG_INTEGER;
else
ret->type = V_ASN1_INTEGER;
diff --git a/crypto/openssl/crypto/asn1/asn1_gen.c b/crypto/openssl/crypto/asn1/asn1_gen.c
index 11b582d..6574923 100644
--- a/crypto/openssl/crypto/asn1/asn1_gen.c
+++ b/crypto/openssl/crypto/asn1/asn1_gen.c
@@ -74,6 +74,8 @@
#define ASN1_GEN_STR(str,val) {str, sizeof(str) - 1, val}
#define ASN1_FLAG_EXP_MAX 20
+/* Maximum number of nested sequences */
+#define ASN1_GEN_SEQ_MAX_DEPTH 50
/* Input formats */
@@ -110,13 +112,16 @@ typedef struct {
int exp_count;
} tag_exp_arg;
+static ASN1_TYPE *generate_v3(char *str, X509V3_CTX *cnf, int depth,
+ int *perr);
static int bitstr_cb(const char *elem, int len, void *bitstr);
static int asn1_cb(const char *elem, int len, void *bitstr);
static int append_exp(tag_exp_arg *arg, int exp_tag, int exp_class,
int exp_constructed, int exp_pad, int imp_ok);
static int parse_tagging(const char *vstart, int vlen, int *ptag,
int *pclass);
-static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf);
+static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf,
+ int depth, int *perr);
static ASN1_TYPE *asn1_str2type(const char *str, int format, int utype);
static int asn1_str2tag(const char *tagstr, int len);
@@ -133,6 +138,16 @@ ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf)
ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf)
{
+ int err = 0;
+ ASN1_TYPE *ret = generate_v3(str, cnf, 0, &err);
+ if (err)
+ ASN1err(ASN1_F_ASN1_GENERATE_V3, err);
+ return ret;
+}
+
+static ASN1_TYPE *generate_v3(char *str, X509V3_CTX *cnf, int depth,
+ int *perr)
+{
ASN1_TYPE *ret;
tag_exp_arg asn1_tags;
tag_exp_type *etmp;
@@ -152,17 +167,22 @@ ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf)
asn1_tags.imp_class = -1;
asn1_tags.format = ASN1_GEN_FORMAT_ASCII;
asn1_tags.exp_count = 0;
- if (CONF_parse_list(str, ',', 1, asn1_cb, &asn1_tags) != 0)
+ if (CONF_parse_list(str, ',', 1, asn1_cb, &asn1_tags) != 0) {
+ *perr = ASN1_R_UNKNOWN_TAG;
return NULL;
+ }
if ((asn1_tags.utype == V_ASN1_SEQUENCE)
|| (asn1_tags.utype == V_ASN1_SET)) {
if (!cnf) {
- ASN1err(ASN1_F_ASN1_GENERATE_V3,
- ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG);
+ *perr = ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG;
return NULL;
}
- ret = asn1_multi(asn1_tags.utype, asn1_tags.str, cnf);
+ if (depth >= ASN1_GEN_SEQ_MAX_DEPTH) {
+ *perr = ASN1_R_ILLEGAL_NESTED_TAGGING;
+ return NULL;
+ }
+ ret = asn1_multi(asn1_tags.utype, asn1_tags.str, cnf, depth, perr);
} else
ret = asn1_str2type(asn1_tags.str, asn1_tags.format, asn1_tags.utype);
@@ -280,7 +300,7 @@ static int asn1_cb(const char *elem, int len, void *bitstr)
int tmp_tag, tmp_class;
if (elem == NULL)
- return 0;
+ return -1;
for (i = 0, p = elem; i < len; p++, i++) {
/* Look for the ':' in name value pairs */
@@ -353,7 +373,7 @@ static int asn1_cb(const char *elem, int len, void *bitstr)
break;
case ASN1_GEN_FLAG_FORMAT:
- if(!vstart) {
+ if (!vstart) {
ASN1err(ASN1_F_ASN1_CB, ASN1_R_UNKNOWN_FORMAT);
return -1;
}
@@ -435,7 +455,8 @@ static int parse_tagging(const char *vstart, int vlen, int *ptag, int *pclass)
/* Handle multiple types: SET and SEQUENCE */
-static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf)
+static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf,
+ int depth, int *perr)
{
ASN1_TYPE *ret = NULL;
STACK_OF(ASN1_TYPE) *sk = NULL;
@@ -454,7 +475,8 @@ static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf)
goto bad;
for (i = 0; i < sk_CONF_VALUE_num(sect); i++) {
ASN1_TYPE *typ =
- ASN1_generate_v3(sk_CONF_VALUE_value(sect, i)->value, cnf);
+ generate_v3(sk_CONF_VALUE_value(sect, i)->value, cnf,
+ depth + 1, perr);
if (!typ)
goto bad;
if (!sk_ASN1_TYPE_push(sk, typ))
diff --git a/crypto/openssl/crypto/asn1/asn_mime.c b/crypto/openssl/crypto/asn1/asn_mime.c
index 7e2f28e..96110c5 100644
--- a/crypto/openssl/crypto/asn1/asn_mime.c
+++ b/crypto/openssl/crypto/asn1/asn_mime.c
@@ -289,7 +289,8 @@ int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
if ((flags & SMIME_DETACHED) && data) {
/* We want multipart/signed */
/* Generate a random boundary */
- RAND_pseudo_bytes((unsigned char *)bound, 32);
+ if (RAND_pseudo_bytes((unsigned char *)bound, 32) < 0)
+ return 0;
for (i = 0; i < 32; i++) {
c = bound[i] & 0xf;
if (c < 10)
diff --git a/crypto/openssl/crypto/asn1/bio_ndef.c b/crypto/openssl/crypto/asn1/bio_ndef.c
index 4a73ca9..31949b8 100644
--- a/crypto/openssl/crypto/asn1/bio_ndef.c
+++ b/crypto/openssl/crypto/asn1/bio_ndef.c
@@ -162,7 +162,7 @@ static int ndef_prefix(BIO *b, unsigned char **pbuf, int *plen, void *parg)
derlen = ASN1_item_ndef_i2d(ndef_aux->val, NULL, ndef_aux->it);
p = OPENSSL_malloc(derlen);
- if(!p)
+ if (!p)
return 0;
ndef_aux->derbuf = p;
@@ -232,7 +232,7 @@ static int ndef_suffix(BIO *b, unsigned char **pbuf, int *plen, void *parg)
derlen = ASN1_item_ndef_i2d(ndef_aux->val, NULL, ndef_aux->it);
p = OPENSSL_malloc(derlen);
- if(!p)
+ if (!p)
return 0;
ndef_aux->derbuf = p;
diff --git a/crypto/openssl/crypto/asn1/tasn_new.c b/crypto/openssl/crypto/asn1/tasn_new.c
index 7d2964f..b0c73be 100644
--- a/crypto/openssl/crypto/asn1/tasn_new.c
+++ b/crypto/openssl/crypto/asn1/tasn_new.c
@@ -100,9 +100,6 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
else
asn1_cb = 0;
- if (!combine)
- *pval = NULL;
-
#ifdef CRYPTO_MDEBUG
if (it->sname)
CRYPTO_push_info(it->sname);
diff --git a/crypto/openssl/crypto/asn1/tasn_prn.c b/crypto/openssl/crypto/asn1/tasn_prn.c
index 7c54f9d..5e7d53e 100644
--- a/crypto/openssl/crypto/asn1/tasn_prn.c
+++ b/crypto/openssl/crypto/asn1/tasn_prn.c
@@ -290,7 +290,7 @@ static int asn1_item_print_ctx(BIO *out, ASN1_VALUE **fld, int indent,
for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
const ASN1_TEMPLATE *seqtt;
seqtt = asn1_do_adb(fld, tt, 1);
- if(!seqtt)
+ if (!seqtt)
return 0;
tmpfld = asn1_get_field_ptr(fld, seqtt);
if (!asn1_template_print_ctx(out, tmpfld,
diff --git a/crypto/openssl/crypto/asn1/x_x509.c b/crypto/openssl/crypto/asn1/x_x509.c
index d51b76e..f56e837 100644
--- a/crypto/openssl/crypto/asn1/x_x509.c
+++ b/crypto/openssl/crypto/asn1/x_x509.c
@@ -177,7 +177,7 @@ X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length)
/* Save start position */
q = *pp;
- if(!a || *a == NULL) {
+ if (!a || *a == NULL) {
freeret = 1;
}
ret = d2i_X509(a, pp, length);
@@ -192,7 +192,7 @@ X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length)
goto err;
return ret;
err:
- if(freeret) {
+ if (freeret) {
X509_free(ret);
if (a)
*a = NULL;
diff --git a/crypto/openssl/crypto/bf/Makefile b/crypto/openssl/crypto/bf/Makefile
index d01bfaa..6dd2015 100644
--- a/crypto/openssl/crypto/bf/Makefile
+++ b/crypto/openssl/crypto/bf/Makefile
@@ -72,6 +72,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/bio/Makefile b/crypto/openssl/crypto/bio/Makefile
index c395d80..ef526f6 100644
--- a/crypto/openssl/crypto/bio/Makefile
+++ b/crypto/openssl/crypto/bio/Makefile
@@ -73,6 +73,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/bio/b_print.c b/crypto/openssl/crypto/bio/b_print.c
index c2cf6e6..7c81e25 100644
--- a/crypto/openssl/crypto/bio/b_print.c
+++ b/crypto/openssl/crypto/bio/b_print.c
@@ -704,32 +704,29 @@ doapr_outch(char **sbuffer,
/* If we haven't at least one buffer, someone has doe a big booboo */
assert(*sbuffer != NULL || buffer != NULL);
- if (buffer) {
- while (*currlen >= *maxlen) {
- if (*buffer == NULL) {
- if (*maxlen == 0)
- *maxlen = 1024;
- *buffer = OPENSSL_malloc(*maxlen);
- if(!*buffer) {
- /* Panic! Can't really do anything sensible. Just return */
- return;
- }
- if (*currlen > 0) {
- assert(*sbuffer != NULL);
- memcpy(*buffer, *sbuffer, *currlen);
- }
- *sbuffer = NULL;
- } else {
- *maxlen += 1024;
- *buffer = OPENSSL_realloc(*buffer, *maxlen);
- if(!*buffer) {
- /* Panic! Can't really do anything sensible. Just return */
- return;
- }
+ /* |currlen| must always be <= |*maxlen| */
+ assert(*currlen <= *maxlen);
+
+ if (buffer && *currlen == *maxlen) {
+ *maxlen += 1024;
+ if (*buffer == NULL) {
+ *buffer = OPENSSL_malloc(*maxlen);
+ if (!*buffer) {
+ /* Panic! Can't really do anything sensible. Just return */
+ return;
+ }
+ if (*currlen > 0) {
+ assert(*sbuffer != NULL);
+ memcpy(*buffer, *sbuffer, *currlen);
+ }
+ *sbuffer = NULL;
+ } else {
+ *buffer = OPENSSL_realloc(*buffer, *maxlen);
+ if (!*buffer) {
+ /* Panic! Can't really do anything sensible. Just return */
+ return;
}
}
- /* What to do if *buffer is NULL? */
- assert(*sbuffer != NULL || *buffer != NULL);
}
if (*currlen < *maxlen) {
diff --git a/crypto/openssl/crypto/bio/bf_nbio.c b/crypto/openssl/crypto/bio/bf_nbio.c
index da88a8a..a04f32a 100644
--- a/crypto/openssl/crypto/bio/bf_nbio.c
+++ b/crypto/openssl/crypto/bio/bf_nbio.c
@@ -139,7 +139,8 @@ static int nbiof_read(BIO *b, char *out, int outl)
BIO_clear_retry_flags(b);
#if 1
- RAND_pseudo_bytes(&n, 1);
+ if (RAND_pseudo_bytes(&n, 1) < 0)
+ return -1;
num = (n & 0x07);
if (outl > num)
@@ -178,7 +179,8 @@ static int nbiof_write(BIO *b, const char *in, int inl)
num = nt->lwn;
nt->lwn = 0;
} else {
- RAND_pseudo_bytes(&n, 1);
+ if (RAND_pseudo_bytes(&n, 1) < 0)
+ return -1;
num = (n & 7);
}
diff --git a/crypto/openssl/crypto/bio/bio_lib.c b/crypto/openssl/crypto/bio/bio_lib.c
index 5267010..07934f8 100644
--- a/crypto/openssl/crypto/bio/bio_lib.c
+++ b/crypto/openssl/crypto/bio/bio_lib.c
@@ -536,8 +536,10 @@ BIO *BIO_dup_chain(BIO *in)
/* copy app data */
if (!CRYPTO_dup_ex_data(CRYPTO_EX_INDEX_BIO, &new_bio->ex_data,
- &bio->ex_data))
+ &bio->ex_data)) {
+ BIO_free(new_bio);
goto err;
+ }
if (ret == NULL) {
eoc = new_bio;
@@ -549,8 +551,8 @@ BIO *BIO_dup_chain(BIO *in)
}
return (ret);
err:
- if (ret != NULL)
- BIO_free(ret);
+ BIO_free_all(ret);
+
return (NULL);
}
diff --git a/crypto/openssl/crypto/bio/bss_dgram.c b/crypto/openssl/crypto/bio/bss_dgram.c
index b495db2..e3e3dd0 100644
--- a/crypto/openssl/crypto/bio/bss_dgram.c
+++ b/crypto/openssl/crypto/bio/bss_dgram.c
@@ -299,16 +299,17 @@ static void dgram_adjust_rcv_timeout(BIO *b)
/* Calculate time left until timer expires */
memcpy(&timeleft, &(data->next_timeout), sizeof(struct timeval));
- timeleft.tv_sec -= timenow.tv_sec;
- timeleft.tv_usec -= timenow.tv_usec;
- if (timeleft.tv_usec < 0) {
+ if (timeleft.tv_usec < timenow.tv_usec) {
+ timeleft.tv_usec = 1000000 - timenow.tv_usec + timeleft.tv_usec;
timeleft.tv_sec--;
- timeleft.tv_usec += 1000000;
+ } else {
+ timeleft.tv_usec -= timenow.tv_usec;
}
-
- if (timeleft.tv_sec < 0) {
+ if (timeleft.tv_sec < timenow.tv_sec) {
timeleft.tv_sec = 0;
timeleft.tv_usec = 1;
+ } else {
+ timeleft.tv_sec -= timenow.tv_sec;
}
/*
@@ -953,7 +954,7 @@ BIO *BIO_new_dgram_sctp(int fd, int close_flag)
*/
sockopt_len = (socklen_t) (sizeof(sctp_assoc_t) + 256 * sizeof(uint8_t));
authchunks = OPENSSL_malloc(sockopt_len);
- if(!authchunks) {
+ if (!authchunks) {
BIO_vfree(bio);
return (NULL);
}
@@ -1293,7 +1294,7 @@ static int dgram_sctp_read(BIO *b, char *out, int outl)
(socklen_t) (sizeof(sctp_assoc_t) + 256 * sizeof(uint8_t));
authchunks = OPENSSL_malloc(optlen);
if (!authchunks) {
- BIOerr(BIO_F_DGRAM_SCTP_READ, ERR_R_MALLOC_ERROR);
+ BIOerr(BIO_F_DGRAM_SCTP_READ, ERR_R_MALLOC_FAILURE);
return -1;
}
memset(authchunks, 0, sizeof(optlen));
@@ -1364,8 +1365,8 @@ static int dgram_sctp_write(BIO *b, const char *in, int inl)
if (data->save_shutdown && !BIO_dgram_sctp_wait_for_dry(b)) {
char *tmp;
data->saved_message.bio = b;
- if(!(tmp = OPENSSL_malloc(inl))) {
- BIOerr(BIO_F_DGRAM_SCTP_WRITE, ERR_R_MALLOC_ERROR);
+ if (!(tmp = OPENSSL_malloc(inl))) {
+ BIOerr(BIO_F_DGRAM_SCTP_WRITE, ERR_R_MALLOC_FAILURE);
return -1;
}
if (data->saved_message.data)
diff --git a/crypto/openssl/crypto/bn/Makefile b/crypto/openssl/crypto/bn/Makefile
index 6dd136b..3d0158c 100644
--- a/crypto/openssl/crypto/bn/Makefile
+++ b/crypto/openssl/crypto/bn/Makefile
@@ -167,6 +167,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: bn_prime.h depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/bn/bn.h b/crypto/openssl/crypto/bn/bn.h
index 7d57e98..47d8c71 100644
--- a/crypto/openssl/crypto/bn/bn.h
+++ b/crypto/openssl/crypto/bn/bn.h
@@ -797,6 +797,7 @@ int RAND_pseudo_bytes(unsigned char *buf, int num);
* wouldn't be constructed with top!=dmax. */ \
BN_ULONG *_not_const; \
memcpy(&_not_const, &_bnum1->d, sizeof(BN_ULONG*)); \
+ /* Debug only - safe to ignore error return */ \
RAND_pseudo_bytes(&_tmp_char, 1); \
memset((unsigned char *)(_not_const + _bnum1->top), _tmp_char, \
(_bnum1->dmax - _bnum1->top) * sizeof(BN_ULONG)); \
@@ -910,6 +911,7 @@ void ERR_load_BN_strings(void);
# define BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR 135
# define BN_F_BN_GF2M_MOD_SQR 136
# define BN_F_BN_GF2M_MOD_SQRT 137
+# define BN_F_BN_LSHIFT 145
# define BN_F_BN_MOD_EXP2_MONT 118
# define BN_F_BN_MOD_EXP_MONT 109
# define BN_F_BN_MOD_EXP_MONT_CONSTTIME 124
@@ -925,12 +927,14 @@ void ERR_load_BN_strings(void);
# define BN_F_BN_NEW 113
# define BN_F_BN_RAND 114
# define BN_F_BN_RAND_RANGE 122
+# define BN_F_BN_RSHIFT 146
# define BN_F_BN_USUB 115
/* Reason codes. */
# define BN_R_ARG2_LT_ARG3 100
# define BN_R_BAD_RECIPROCAL 101
# define BN_R_BIGNUM_TOO_LONG 114
+# define BN_R_BITS_TOO_SMALL 118
# define BN_R_CALLED_WITH_EVEN_MODULUS 102
# define BN_R_DIV_BY_ZERO 103
# define BN_R_ENCODING_ERROR 104
@@ -938,6 +942,7 @@ void ERR_load_BN_strings(void);
# define BN_R_INPUT_NOT_REDUCED 110
# define BN_R_INVALID_LENGTH 106
# define BN_R_INVALID_RANGE 115
+# define BN_R_INVALID_SHIFT 119
# define BN_R_NOT_A_SQUARE 111
# define BN_R_NOT_INITIALIZED 107
# define BN_R_NO_INVERSE 108
diff --git a/crypto/openssl/crypto/bn/bn_err.c b/crypto/openssl/crypto/bn/bn_err.c
index faa7e22..e7a7038 100644
--- a/crypto/openssl/crypto/bn/bn_err.c
+++ b/crypto/openssl/crypto/bn/bn_err.c
@@ -1,6 +1,6 @@
/* crypto/bn/bn_err.c */
/* ====================================================================
- * Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved.
+ * Copyright (c) 1999-2015 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -94,6 +94,7 @@ static ERR_STRING_DATA BN_str_functs[] = {
{ERR_FUNC(BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR), "BN_GF2m_mod_solve_quad_arr"},
{ERR_FUNC(BN_F_BN_GF2M_MOD_SQR), "BN_GF2m_mod_sqr"},
{ERR_FUNC(BN_F_BN_GF2M_MOD_SQRT), "BN_GF2m_mod_sqrt"},
+ {ERR_FUNC(BN_F_BN_LSHIFT), "BN_lshift"},
{ERR_FUNC(BN_F_BN_MOD_EXP2_MONT), "BN_mod_exp2_mont"},
{ERR_FUNC(BN_F_BN_MOD_EXP_MONT), "BN_mod_exp_mont"},
{ERR_FUNC(BN_F_BN_MOD_EXP_MONT_CONSTTIME), "BN_mod_exp_mont_consttime"},
@@ -109,6 +110,7 @@ static ERR_STRING_DATA BN_str_functs[] = {
{ERR_FUNC(BN_F_BN_NEW), "BN_new"},
{ERR_FUNC(BN_F_BN_RAND), "BN_rand"},
{ERR_FUNC(BN_F_BN_RAND_RANGE), "BN_rand_range"},
+ {ERR_FUNC(BN_F_BN_RSHIFT), "BN_rshift"},
{ERR_FUNC(BN_F_BN_USUB), "BN_usub"},
{0, NULL}
};
@@ -117,6 +119,7 @@ static ERR_STRING_DATA BN_str_reasons[] = {
{ERR_REASON(BN_R_ARG2_LT_ARG3), "arg2 lt arg3"},
{ERR_REASON(BN_R_BAD_RECIPROCAL), "bad reciprocal"},
{ERR_REASON(BN_R_BIGNUM_TOO_LONG), "bignum too long"},
+ {ERR_REASON(BN_R_BITS_TOO_SMALL), "bits too small"},
{ERR_REASON(BN_R_CALLED_WITH_EVEN_MODULUS), "called with even modulus"},
{ERR_REASON(BN_R_DIV_BY_ZERO), "div by zero"},
{ERR_REASON(BN_R_ENCODING_ERROR), "encoding error"},
@@ -125,6 +128,7 @@ static ERR_STRING_DATA BN_str_reasons[] = {
{ERR_REASON(BN_R_INPUT_NOT_REDUCED), "input not reduced"},
{ERR_REASON(BN_R_INVALID_LENGTH), "invalid length"},
{ERR_REASON(BN_R_INVALID_RANGE), "invalid range"},
+ {ERR_REASON(BN_R_INVALID_SHIFT), "invalid shift"},
{ERR_REASON(BN_R_NOT_A_SQUARE), "not a square"},
{ERR_REASON(BN_R_NOT_INITIALIZED), "not initialized"},
{ERR_REASON(BN_R_NO_INVERSE), "no inverse"},
diff --git a/crypto/openssl/crypto/bn/bn_gf2m.c b/crypto/openssl/crypto/bn/bn_gf2m.c
index aeee49a..a0ba8de 100644
--- a/crypto/openssl/crypto/bn/bn_gf2m.c
+++ b/crypto/openssl/crypto/bn/bn_gf2m.c
@@ -694,9 +694,10 @@ int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
}
# else
{
- int i, ubits = BN_num_bits(u), vbits = BN_num_bits(v), /* v is copy
- * of p */
- top = p->top;
+ int i;
+ int ubits = BN_num_bits(u);
+ int vbits = BN_num_bits(v); /* v is copy of p */
+ int top = p->top;
BN_ULONG *udp, *bdp, *vdp, *cdp;
bn_wexpand(u, top);
@@ -740,8 +741,12 @@ int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
ubits--;
}
- if (ubits <= BN_BITS2 && udp[0] == 1)
- break;
+ if (ubits <= BN_BITS2) {
+ if (udp[0] == 0) /* poly was reducible */
+ goto err;
+ if (udp[0] == 1)
+ break;
+ }
if (ubits < vbits) {
i = ubits;
diff --git a/crypto/openssl/crypto/bn/bn_lcl.h b/crypto/openssl/crypto/bn/bn_lcl.h
index 1059d1d..904a723 100644
--- a/crypto/openssl/crypto/bn/bn_lcl.h
+++ b/crypto/openssl/crypto/bn/bn_lcl.h
@@ -276,7 +276,7 @@ unsigned __int64 _umul128(unsigned __int64 a, unsigned __int64 b,
# endif
# elif defined(__mips) && (defined(SIXTY_FOUR_BIT) || defined(SIXTY_FOUR_BIT_LONG))
# if defined(__GNUC__) && __GNUC__>=2
-# if __GNUC__>=4 && __GNUC_MINOR__>=4
+# if __GNUC__>4 || (__GNUC__>=4 && __GNUC_MINOR__>=4)
/* "h" constraint is no more since 4.4 */
# define BN_UMULT_HIGH(a,b) (((__uint128_t)(a)*(b))>>64)
# define BN_UMULT_LOHI(low,high,a,b) ({ \
diff --git a/crypto/openssl/crypto/bn/bn_print.c b/crypto/openssl/crypto/bn/bn_print.c
index 4dcaae3..ab10b95 100644
--- a/crypto/openssl/crypto/bn/bn_print.c
+++ b/crypto/openssl/crypto/bn/bn_print.c
@@ -71,7 +71,12 @@ char *BN_bn2hex(const BIGNUM *a)
char *buf;
char *p;
- buf = (char *)OPENSSL_malloc(a->top * BN_BYTES * 2 + 2);
+ if (a->neg && BN_is_zero(a)) {
+ /* "-0" == 3 bytes including NULL terminator */
+ buf = OPENSSL_malloc(3);
+ } else {
+ buf = OPENSSL_malloc(a->top * BN_BYTES * 2 + 2);
+ }
if (buf == NULL) {
BNerr(BN_F_BN_BN2HEX, ERR_R_MALLOC_FAILURE);
goto err;
diff --git a/crypto/openssl/crypto/bn/bn_rand.c b/crypto/openssl/crypto/bn/bn_rand.c
index 7ac71ec..f9fb2e9 100644
--- a/crypto/openssl/crypto/bn/bn_rand.c
+++ b/crypto/openssl/crypto/bn/bn_rand.c
@@ -121,6 +121,11 @@ static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
int ret = 0, bit, bytes, mask;
time_t tim;
+ if (bits < 0 || (bits == 1 && top > 0)) {
+ BNerr(BN_F_BNRAND, BN_R_BITS_TOO_SMALL);
+ return 0;
+ }
+
if (bits == 0) {
BN_zero(rnd);
return 1;
@@ -157,7 +162,8 @@ static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
unsigned char c;
for (i = 0; i < bytes; i++) {
- RAND_pseudo_bytes(&c, 1);
+ if (RAND_pseudo_bytes(&c, 1) < 0)
+ goto err;
if (c >= 128 && i > 0)
buf[i] = buf[i - 1];
else if (c < 42)
@@ -168,7 +174,7 @@ static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
}
#endif
- if (top != -1) {
+ if (top >= 0) {
if (top) {
if (bit == 0) {
buf[0] = 1;
diff --git a/crypto/openssl/crypto/bn/bn_shift.c b/crypto/openssl/crypto/bn/bn_shift.c
index 4f3e8ff..9673d9a 100644
--- a/crypto/openssl/crypto/bn/bn_shift.c
+++ b/crypto/openssl/crypto/bn/bn_shift.c
@@ -137,6 +137,11 @@ int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
bn_check_top(r);
bn_check_top(a);
+ if (n < 0) {
+ BNerr(BN_F_BN_LSHIFT, BN_R_INVALID_SHIFT);
+ return 0;
+ }
+
r->neg = a->neg;
nw = n / BN_BITS2;
if (bn_wexpand(r, a->top + nw + 1) == NULL)
@@ -174,6 +179,11 @@ int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
bn_check_top(r);
bn_check_top(a);
+ if (n < 0) {
+ BNerr(BN_F_BN_RSHIFT, BN_R_INVALID_SHIFT);
+ return 0;
+ }
+
nw = n / BN_BITS2;
rb = n % BN_BITS2;
lb = BN_BITS2 - rb;
diff --git a/crypto/openssl/crypto/buffer/Makefile b/crypto/openssl/crypto/buffer/Makefile
index 2efba47..352efb8 100644
--- a/crypto/openssl/crypto/buffer/Makefile
+++ b/crypto/openssl/crypto/buffer/Makefile
@@ -61,6 +61,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/buffer/buffer.c b/crypto/openssl/crypto/buffer/buffer.c
index d287e34..eff3e08 100644
--- a/crypto/openssl/crypto/buffer/buffer.c
+++ b/crypto/openssl/crypto/buffer/buffer.c
@@ -88,7 +88,7 @@ void BUF_MEM_free(BUF_MEM *a)
return;
if (a->data != NULL) {
- memset(a->data, 0, (unsigned int)a->max);
+ OPENSSL_cleanse(a->data, a->max);
OPENSSL_free(a->data);
}
OPENSSL_free(a);
diff --git a/crypto/openssl/crypto/camellia/Makefile b/crypto/openssl/crypto/camellia/Makefile
index 6ce6fc9..228f1dc 100644
--- a/crypto/openssl/crypto/camellia/Makefile
+++ b/crypto/openssl/crypto/camellia/Makefile
@@ -73,6 +73,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/cast/Makefile b/crypto/openssl/crypto/cast/Makefile
index f3f4859..4c4b5e9 100644
--- a/crypto/openssl/crypto/cast/Makefile
+++ b/crypto/openssl/crypto/cast/Makefile
@@ -69,6 +69,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/cmac/Makefile b/crypto/openssl/crypto/cmac/Makefile
index 54e7cc3..6a28408 100644
--- a/crypto/openssl/crypto/cmac/Makefile
+++ b/crypto/openssl/crypto/cmac/Makefile
@@ -61,6 +61,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/cmac/cmac.c b/crypto/openssl/crypto/cmac/cmac.c
index c5597a3..774e6dc 100644
--- a/crypto/openssl/crypto/cmac/cmac.c
+++ b/crypto/openssl/crypto/cmac/cmac.c
@@ -126,6 +126,8 @@ EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx)
void CMAC_CTX_free(CMAC_CTX *ctx)
{
+ if (!ctx)
+ return;
CMAC_CTX_cleanup(ctx);
OPENSSL_free(ctx);
}
diff --git a/crypto/openssl/crypto/cms/Makefile b/crypto/openssl/crypto/cms/Makefile
index 9820adb..b124b5d 100644
--- a/crypto/openssl/crypto/cms/Makefile
+++ b/crypto/openssl/crypto/cms/Makefile
@@ -67,6 +67,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/cms/cms_pwri.c b/crypto/openssl/crypto/cms/cms_pwri.c
index 076b545..a8322dc 100644
--- a/crypto/openssl/crypto/cms/cms_pwri.c
+++ b/crypto/openssl/crypto/cms/cms_pwri.c
@@ -231,7 +231,7 @@ static int kek_unwrap_key(unsigned char *out, size_t *outlen,
return 0;
}
tmp = OPENSSL_malloc(inlen);
- if(!tmp)
+ if (!tmp)
return 0;
/* setup IV by decrypting last two blocks */
EVP_DecryptUpdate(ctx, tmp + inlen - 2 * blocklen, &outl,
@@ -297,8 +297,9 @@ static int kek_wrap_key(unsigned char *out, size_t *outlen,
out[3] = in[2] ^ 0xFF;
memcpy(out + 4, in, inlen);
/* Add random padding to end */
- if (olen > inlen + 4)
- RAND_pseudo_bytes(out + 4 + inlen, olen - 4 - inlen);
+ if (olen > inlen + 4
+ && RAND_pseudo_bytes(out + 4 + inlen, olen - 4 - inlen) < 0)
+ return 0;
/* Encrypt twice */
EVP_EncryptUpdate(ctx, out, &dummy, out, olen);
EVP_EncryptUpdate(ctx, out, &dummy, out, olen);
diff --git a/crypto/openssl/crypto/cms/cms_smime.c b/crypto/openssl/crypto/cms/cms_smime.c
index 8851603..8b37560 100644
--- a/crypto/openssl/crypto/cms/cms_smime.c
+++ b/crypto/openssl/crypto/cms/cms_smime.c
@@ -131,7 +131,7 @@ static void do_free_upto(BIO *f, BIO *upto)
BIO_free(f);
f = tbio;
}
- while (f != upto);
+ while (f && f != upto);
} else
BIO_free_all(f);
}
diff --git a/crypto/openssl/crypto/comp/Makefile b/crypto/openssl/crypto/comp/Makefile
index efda832..a1e9464 100644
--- a/crypto/openssl/crypto/comp/Makefile
+++ b/crypto/openssl/crypto/comp/Makefile
@@ -64,6 +64,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(LIBSRC)
diff --git a/crypto/openssl/crypto/conf/Makefile b/crypto/openssl/crypto/conf/Makefile
index 78bb324..d5f5c58 100644
--- a/crypto/openssl/crypto/conf/Makefile
+++ b/crypto/openssl/crypto/conf/Makefile
@@ -64,6 +64,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(LIBSRC)
diff --git a/crypto/openssl/crypto/cryptlib.c b/crypto/openssl/crypto/cryptlib.c
index 6353bbe..c654a5c 100644
--- a/crypto/openssl/crypto/cryptlib.c
+++ b/crypto/openssl/crypto/cryptlib.c
@@ -806,8 +806,6 @@ int OPENSSL_isservice(void)
if (_OPENSSL_isservice.p != (void *)-1)
return (*_OPENSSL_isservice.f) ();
- (void)GetDesktopWindow(); /* return value is ignored */
-
h = GetProcessWindowStation();
if (h == NULL)
return -1;
diff --git a/crypto/openssl/crypto/des/Makefile b/crypto/openssl/crypto/des/Makefile
index a6e1001..fbc77c1 100644
--- a/crypto/openssl/crypto/des/Makefile
+++ b/crypto/openssl/crypto/des/Makefile
@@ -94,6 +94,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/des/des.c b/crypto/openssl/crypto/des/des.c
index 2bff281..586aed7 100644
--- a/crypto/openssl/crypto/des/des.c
+++ b/crypto/openssl/crypto/des/des.c
@@ -455,8 +455,10 @@ void doencryption(void)
rem = l % 8;
len = l - rem;
if (feof(DES_IN)) {
- for (i = 7 - rem; i > 0; i--)
- RAND_pseudo_bytes(buf + l++, 1);
+ for (i = 7 - rem; i > 0; i--) {
+ if (RAND_pseudo_bytes(buf + l++, 1) < 0)
+ goto problems;
+ }
buf[l++] = rem;
ex = 1;
len += rem;
diff --git a/crypto/openssl/crypto/des/enc_writ.c b/crypto/openssl/crypto/des/enc_writ.c
index b4eecc3..bfaabde 100644
--- a/crypto/openssl/crypto/des/enc_writ.c
+++ b/crypto/openssl/crypto/des/enc_writ.c
@@ -96,6 +96,9 @@ int DES_enc_write(int fd, const void *_buf, int len,
const unsigned char *cp;
static int start = 1;
+ if (len < 0)
+ return -1;
+
if (outbuf == NULL) {
outbuf = OPENSSL_malloc(BSIZE + HDRSIZE);
if (outbuf == NULL)
@@ -132,7 +135,9 @@ int DES_enc_write(int fd, const void *_buf, int len,
if (len < 8) {
cp = shortbuf;
memcpy(shortbuf, buf, len);
- RAND_pseudo_bytes(shortbuf + len, 8 - len);
+ if (RAND_pseudo_bytes(shortbuf + len, 8 - len) < 0) {
+ return -1;
+ }
rnum = 8;
} else {
cp = buf;
diff --git a/crypto/openssl/crypto/dh/Makefile b/crypto/openssl/crypto/dh/Makefile
index f23b4f7..6d574f4 100644
--- a/crypto/openssl/crypto/dh/Makefile
+++ b/crypto/openssl/crypto/dh/Makefile
@@ -63,6 +63,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/dh/dh_ameth.c b/crypto/openssl/crypto/dh/dh_ameth.c
index 1dec109..873eb2e 100644
--- a/crypto/openssl/crypto/dh/dh_ameth.c
+++ b/crypto/openssl/crypto/dh/dh_ameth.c
@@ -135,7 +135,7 @@ static int dh_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey)
dh = pkey->pkey.dh;
str = ASN1_STRING_new();
- if(!str) {
+ if (!str) {
DHerr(DH_F_DH_PUB_ENCODE, ERR_R_MALLOC_FAILURE);
goto err;
}
diff --git a/crypto/openssl/crypto/dsa/Makefile b/crypto/openssl/crypto/dsa/Makefile
index 5fef4ca..8109201 100644
--- a/crypto/openssl/crypto/dsa/Makefile
+++ b/crypto/openssl/crypto/dsa/Makefile
@@ -63,6 +63,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/dsa/dsa_gen.c b/crypto/openssl/crypto/dsa/dsa_gen.c
index c808ab6..d686ab0 100644
--- a/crypto/openssl/crypto/dsa/dsa_gen.c
+++ b/crypto/openssl/crypto/dsa/dsa_gen.c
@@ -202,7 +202,8 @@ int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits,
goto err;
if (!seed_len) {
- RAND_pseudo_bytes(seed, qsize);
+ if (RAND_pseudo_bytes(seed, qsize) < 0)
+ goto err;
seed_is_random = 1;
} else {
seed_is_random = 0;
diff --git a/crypto/openssl/crypto/dsa/dsa_ossl.c b/crypto/openssl/crypto/dsa/dsa_ossl.c
index b30eab0..6edb26d 100644
--- a/crypto/openssl/crypto/dsa/dsa_ossl.c
+++ b/crypto/openssl/crypto/dsa/dsa_ossl.c
@@ -106,23 +106,23 @@ static DSA_METHOD openssl_dsa_meth = {
#define DSA_MOD_EXP(err_instr,dsa,rr,a1,p1,a2,p2,m,ctx,in_mont) \
do { \
int _tmp_res53; \
- if((dsa)->meth->dsa_mod_exp) \
+ if ((dsa)->meth->dsa_mod_exp) \
_tmp_res53 = (dsa)->meth->dsa_mod_exp((dsa), (rr), (a1), (p1), \
(a2), (p2), (m), (ctx), (in_mont)); \
else \
_tmp_res53 = BN_mod_exp2_mont((rr), (a1), (p1), (a2), (p2), \
(m), (ctx), (in_mont)); \
- if(!_tmp_res53) err_instr; \
+ if (!_tmp_res53) err_instr; \
} while(0)
#define DSA_BN_MOD_EXP(err_instr,dsa,r,a,p,m,ctx,m_ctx) \
do { \
int _tmp_res53; \
- if((dsa)->meth->bn_mod_exp) \
+ if ((dsa)->meth->bn_mod_exp) \
_tmp_res53 = (dsa)->meth->bn_mod_exp((dsa), (r), (a), (p), \
(m), (ctx), (m_ctx)); \
else \
_tmp_res53 = BN_mod_exp_mont((r), (a), (p), (m), (ctx), (m_ctx)); \
- if(!_tmp_res53) err_instr; \
+ if (!_tmp_res53) err_instr; \
} while(0)
const DSA_METHOD *DSA_OpenSSL(void)
diff --git a/crypto/openssl/crypto/dso/Makefile b/crypto/openssl/crypto/dso/Makefile
index fb2709e..36b8ead 100644
--- a/crypto/openssl/crypto/dso/Makefile
+++ b/crypto/openssl/crypto/dso/Makefile
@@ -63,6 +63,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/dso/dso_lib.c b/crypto/openssl/crypto/dso/dso_lib.c
index d2a48bb..09b8eaf 100644
--- a/crypto/openssl/crypto/dso/dso_lib.c
+++ b/crypto/openssl/crypto/dso/dso_lib.c
@@ -285,7 +285,7 @@ DSO_FUNC_TYPE DSO_bind_func(DSO *dso, const char *symname)
* honest. For one thing, I think I have to return a negative value for any
* error because possible DSO_ctrl() commands may return values such as
* "size"s that can legitimately be zero (making the standard
- * "if(DSO_cmd(...))" form that works almost everywhere else fail at odd
+ * "if (DSO_cmd(...))" form that works almost everywhere else fail at odd
* times. I'd prefer "output" values to be passed by reference and the return
* value as success/failure like usual ... but we conform when we must... :-)
*/
diff --git a/crypto/openssl/crypto/ec/Makefile b/crypto/openssl/crypto/ec/Makefile
index f85fc84..2753b28 100644
--- a/crypto/openssl/crypto/ec/Makefile
+++ b/crypto/openssl/crypto/ec/Makefile
@@ -70,6 +70,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/ec/ec2_oct.c b/crypto/openssl/crypto/ec/ec2_oct.c
index c245d88..0d04cc6 100644
--- a/crypto/openssl/crypto/ec/ec2_oct.c
+++ b/crypto/openssl/crypto/ec/ec2_oct.c
@@ -387,7 +387,7 @@ int ec_GF2m_simple_oct2point(const EC_GROUP *group, EC_POINT *point,
}
/* test required by X9.62 */
- if (!EC_POINT_is_on_curve(group, point, ctx)) {
+ if (EC_POINT_is_on_curve(group, point, ctx) <= 0) {
ECerr(EC_F_EC_GF2M_SIMPLE_OCT2POINT, EC_R_POINT_IS_NOT_ON_CURVE);
goto err;
}
diff --git a/crypto/openssl/crypto/ec/ec_asn1.c b/crypto/openssl/crypto/ec/ec_asn1.c
index b4b0e9f..4ad8494 100644
--- a/crypto/openssl/crypto/ec/ec_asn1.c
+++ b/crypto/openssl/crypto/ec/ec_asn1.c
@@ -1114,7 +1114,7 @@ int i2d_ECPrivateKey(EC_KEY *a, unsigned char **out)
{
int ret = 0, ok = 0;
unsigned char *buffer = NULL;
- size_t buf_len = 0, tmp_len;
+ size_t buf_len = 0, tmp_len, bn_len;
EC_PRIVATEKEY *priv_key = NULL;
if (a == NULL || a->group == NULL || a->priv_key == NULL ||
@@ -1130,18 +1130,32 @@ int i2d_ECPrivateKey(EC_KEY *a, unsigned char **out)
priv_key->version = a->version;
- buf_len = (size_t)BN_num_bytes(a->priv_key);
+ bn_len = (size_t)BN_num_bytes(a->priv_key);
+
+ /* Octetstring may need leading zeros if BN is to short */
+
+ buf_len = (EC_GROUP_get_degree(a->group) + 7) / 8;
+
+ if (bn_len > buf_len) {
+ ECerr(EC_F_I2D_ECPRIVATEKEY, EC_R_BUFFER_TOO_SMALL);
+ goto err;
+ }
+
buffer = OPENSSL_malloc(buf_len);
if (buffer == NULL) {
ECerr(EC_F_I2D_ECPRIVATEKEY, ERR_R_MALLOC_FAILURE);
goto err;
}
- if (!BN_bn2bin(a->priv_key, buffer)) {
+ if (!BN_bn2bin(a->priv_key, buffer + buf_len - bn_len)) {
ECerr(EC_F_I2D_ECPRIVATEKEY, ERR_R_BN_LIB);
goto err;
}
+ if (buf_len - bn_len > 0) {
+ memset(buffer, 0, buf_len - bn_len);
+ }
+
if (!M_ASN1_OCTET_STRING_set(priv_key->privateKey, buffer, buf_len)) {
ECerr(EC_F_I2D_ECPRIVATEKEY, ERR_R_ASN1_LIB);
goto err;
diff --git a/crypto/openssl/crypto/ec/ec_check.c b/crypto/openssl/crypto/ec/ec_check.c
index d3f5349..dd6f0ac 100644
--- a/crypto/openssl/crypto/ec/ec_check.c
+++ b/crypto/openssl/crypto/ec/ec_check.c
@@ -85,7 +85,7 @@ int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx)
ECerr(EC_F_EC_GROUP_CHECK, EC_R_UNDEFINED_GENERATOR);
goto err;
}
- if (!EC_POINT_is_on_curve(group, group->generator, ctx)) {
+ if (EC_POINT_is_on_curve(group, group->generator, ctx) <= 0) {
ECerr(EC_F_EC_GROUP_CHECK, EC_R_POINT_IS_NOT_ON_CURVE);
goto err;
}
diff --git a/crypto/openssl/crypto/ec/ec_key.c b/crypto/openssl/crypto/ec/ec_key.c
index ebdffc8..55ce3fe 100644
--- a/crypto/openssl/crypto/ec/ec_key.c
+++ b/crypto/openssl/crypto/ec/ec_key.c
@@ -314,7 +314,7 @@ int EC_KEY_check_key(const EC_KEY *eckey)
goto err;
/* testing whether the pub_key is on the elliptic curve */
- if (!EC_POINT_is_on_curve(eckey->group, eckey->pub_key, ctx)) {
+ if (EC_POINT_is_on_curve(eckey->group, eckey->pub_key, ctx) <= 0) {
ECerr(EC_F_EC_KEY_CHECK_KEY, EC_R_POINT_IS_NOT_ON_CURVE);
goto err;
}
diff --git a/crypto/openssl/crypto/ec/ec_lcl.h b/crypto/openssl/crypto/ec/ec_lcl.h
index 319e651..d79ed1e 100644
--- a/crypto/openssl/crypto/ec/ec_lcl.h
+++ b/crypto/openssl/crypto/ec/ec_lcl.h
@@ -451,14 +451,6 @@ int ec_GF2m_simple_mul(const EC_GROUP *group, EC_POINT *r,
int ec_GF2m_precompute_mult(EC_GROUP *group, BN_CTX *ctx);
int ec_GF2m_have_precompute_mult(const EC_GROUP *group);
-/* method functions in ec2_mult.c */
-int ec_GF2m_simple_mul(const EC_GROUP *group, EC_POINT *r,
- const BIGNUM *scalar, size_t num,
- const EC_POINT *points[], const BIGNUM *scalars[],
- BN_CTX *);
-int ec_GF2m_precompute_mult(EC_GROUP *group, BN_CTX *ctx);
-int ec_GF2m_have_precompute_mult(const EC_GROUP *group);
-
#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
/* method functions in ecp_nistp224.c */
int ec_GFp_nistp224_group_init(EC_GROUP *group);
diff --git a/crypto/openssl/crypto/ec/ec_lib.c b/crypto/openssl/crypto/ec/ec_lib.c
index 9a54f41..e227520 100644
--- a/crypto/openssl/crypto/ec/ec_lib.c
+++ b/crypto/openssl/crypto/ec/ec_lib.c
@@ -934,6 +934,13 @@ int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *point)
return group->meth->is_at_infinity(group, point);
}
+/*
+ * Check whether an EC_POINT is on the curve or not. Note that the return
+ * value for this function should NOT be treated as a boolean. Return values:
+ * 1: The point is on the curve
+ * 0: The point is not on the curve
+ * -1: An error occurred
+ */
int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point,
BN_CTX *ctx)
{
diff --git a/crypto/openssl/crypto/ec/eck_prn.c b/crypto/openssl/crypto/ec/eck_prn.c
index a911a0a..5ef12ec 100644
--- a/crypto/openssl/crypto/ec/eck_prn.c
+++ b/crypto/openssl/crypto/ec/eck_prn.c
@@ -338,12 +338,14 @@ static int print_bin(BIO *fp, const char *name, const unsigned char *buf,
if (buf == NULL)
return 1;
- if (off) {
+ if (off > 0) {
if (off > 128)
off = 128;
memset(str, ' ', off);
if (BIO_write(fp, str, off) <= 0)
return 0;
+ } else {
+ off = 0;
}
if (BIO_printf(fp, "%s", name) <= 0)
diff --git a/crypto/openssl/crypto/ec/ecp_oct.c b/crypto/openssl/crypto/ec/ecp_oct.c
index e5cec8b..1bc3f39 100644
--- a/crypto/openssl/crypto/ec/ecp_oct.c
+++ b/crypto/openssl/crypto/ec/ecp_oct.c
@@ -413,7 +413,7 @@ int ec_GFp_simple_oct2point(const EC_GROUP *group, EC_POINT *point,
}
/* test required by X9.62 */
- if (!EC_POINT_is_on_curve(group, point, ctx)) {
+ if (EC_POINT_is_on_curve(group, point, ctx) <= 0) {
ECerr(EC_F_EC_GFP_SIMPLE_OCT2POINT, EC_R_POINT_IS_NOT_ON_CURVE);
goto err;
}
diff --git a/crypto/openssl/crypto/ec/ectest.c b/crypto/openssl/crypto/ec/ectest.c
index a18b327..fede530 100644
--- a/crypto/openssl/crypto/ec/ectest.c
+++ b/crypto/openssl/crypto/ec/ectest.c
@@ -412,7 +412,7 @@ static void prime_field_tests(void)
ABORT;
if (!EC_POINT_set_compressed_coordinates_GFp(group, Q, x, 1, ctx))
ABORT;
- if (!EC_POINT_is_on_curve(group, Q, ctx)) {
+ if (EC_POINT_is_on_curve(group, Q, ctx) <= 0) {
if (!EC_POINT_get_affine_coordinates_GFp(group, Q, x, y, ctx))
ABORT;
fprintf(stderr, "Point is not on curve: x = 0x");
@@ -544,7 +544,7 @@ static void prime_field_tests(void)
ABORT;
if (!EC_POINT_set_affine_coordinates_GFp(group, P, x, y, ctx))
ABORT;
- if (!EC_POINT_is_on_curve(group, P, ctx))
+ if (EC_POINT_is_on_curve(group, P, ctx) <= 0)
ABORT;
if (!BN_hex2bn(&z, "0100000000000000000001F4C8F927AED3CA752257"))
ABORT;
@@ -593,7 +593,7 @@ static void prime_field_tests(void)
ABORT;
if (!EC_POINT_set_compressed_coordinates_GFp(group, P, x, 1, ctx))
ABORT;
- if (!EC_POINT_is_on_curve(group, P, ctx))
+ if (EC_POINT_is_on_curve(group, P, ctx) <= 0)
ABORT;
if (!BN_hex2bn(&z, "FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"))
ABORT;
@@ -646,7 +646,7 @@ static void prime_field_tests(void)
ABORT;
if (!EC_POINT_set_compressed_coordinates_GFp(group, P, x, 0, ctx))
ABORT;
- if (!EC_POINT_is_on_curve(group, P, ctx))
+ if (EC_POINT_is_on_curve(group, P, ctx) <= 0)
ABORT;
if (!BN_hex2bn
(&z, "FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"))
@@ -705,7 +705,7 @@ static void prime_field_tests(void)
ABORT;
if (!EC_POINT_set_compressed_coordinates_GFp(group, P, x, 1, ctx))
ABORT;
- if (!EC_POINT_is_on_curve(group, P, ctx))
+ if (EC_POINT_is_on_curve(group, P, ctx) <= 0)
ABORT;
if (!BN_hex2bn(&z, "FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E"
"84F3B9CAC2FC632551"))
@@ -761,7 +761,7 @@ static void prime_field_tests(void)
ABORT;
if (!EC_POINT_set_compressed_coordinates_GFp(group, P, x, 1, ctx))
ABORT;
- if (!EC_POINT_is_on_curve(group, P, ctx))
+ if (EC_POINT_is_on_curve(group, P, ctx) <= 0)
ABORT;
if (!BN_hex2bn(&z, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
"FFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973"))
@@ -820,7 +820,7 @@ static void prime_field_tests(void)
ABORT;
if (!EC_POINT_set_compressed_coordinates_GFp(group, P, x, 0, ctx))
ABORT;
- if (!EC_POINT_is_on_curve(group, P, ctx))
+ if (EC_POINT_is_on_curve(group, P, ctx) <= 0)
ABORT;
if (!BN_hex2bn(&z, "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
"FFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5"
@@ -864,7 +864,7 @@ static void prime_field_tests(void)
ABORT;
if (!EC_POINT_dbl(group, P, P, ctx))
ABORT;
- if (!EC_POINT_is_on_curve(group, P, ctx))
+ if (EC_POINT_is_on_curve(group, P, ctx) <= 0)
ABORT;
if (!EC_POINT_invert(group, Q, ctx))
ABORT; /* P = -2Q */
@@ -1008,7 +1008,7 @@ static void prime_field_tests(void)
# define CHAR2_CURVE_TEST_INTERNAL(_name, _p, _a, _b, _x, _y, _y_bit, _order, _cof, _degree, _variable) \
if (!BN_hex2bn(&x, _x)) ABORT; \
if (!EC_POINT_set_compressed_coordinates_GF2m(group, P, x, _y_bit, ctx)) ABORT; \
- if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT; \
+ if (EC_POINT_is_on_curve(group, P, ctx) <= 0) ABORT; \
if (!BN_hex2bn(&z, _order)) ABORT; \
if (!BN_hex2bn(&cof, _cof)) ABORT; \
if (!EC_GROUP_set_generator(group, P, z, cof)) ABORT; \
@@ -1026,7 +1026,7 @@ static void prime_field_tests(void)
if (!BN_hex2bn(&x, _x)) ABORT; \
if (!BN_hex2bn(&y, _y)) ABORT; \
if (!EC_POINT_set_affine_coordinates_GF2m(group, P, x, y, ctx)) ABORT; \
- if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT; \
+ if (EC_POINT_is_on_curve(group, P, ctx) <= 0) ABORT; \
if (!BN_hex2bn(&z, _order)) ABORT; \
if (!BN_hex2bn(&cof, _cof)) ABORT; \
if (!EC_GROUP_set_generator(group, P, z, cof)) ABORT; \
@@ -1157,7 +1157,7 @@ static void char2_field_tests(void)
if (!EC_POINT_set_affine_coordinates_GF2m(group, Q, x, y, ctx))
ABORT;
# endif
- if (!EC_POINT_is_on_curve(group, Q, ctx)) {
+ if (EC_POINT_is_on_curve(group, Q, ctx) <= 0) {
/* Change test based on whether binary point compression is enabled or not. */
# ifdef OPENSSL_EC_BIN_PT_COMP
if (!EC_POINT_get_affine_coordinates_GF2m(group, Q, x, y, ctx))
@@ -1378,7 +1378,7 @@ static void char2_field_tests(void)
ABORT;
if (!EC_POINT_dbl(group, P, P, ctx))
ABORT;
- if (!EC_POINT_is_on_curve(group, P, ctx))
+ if (EC_POINT_is_on_curve(group, P, ctx) <= 0)
ABORT;
if (!EC_POINT_invert(group, Q, ctx))
ABORT; /* P = -2Q */
diff --git a/crypto/openssl/crypto/ecdh/Makefile b/crypto/openssl/crypto/ecdh/Makefile
index ba05fea..f076635 100644
--- a/crypto/openssl/crypto/ecdh/Makefile
+++ b/crypto/openssl/crypto/ecdh/Makefile
@@ -62,6 +62,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/ecdsa/Makefile b/crypto/openssl/crypto/ecdsa/Makefile
index e89e0c0..4ce00e8 100644
--- a/crypto/openssl/crypto/ecdsa/Makefile
+++ b/crypto/openssl/crypto/ecdsa/Makefile
@@ -62,6 +62,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/ecdsa/ecdsatest.c b/crypto/openssl/crypto/ecdsa/ecdsatest.c
index b2d78f3..0f301f8 100644
--- a/crypto/openssl/crypto/ecdsa/ecdsatest.c
+++ b/crypto/openssl/crypto/ecdsa/ecdsatest.c
@@ -296,8 +296,8 @@ int test_builtin(BIO *out)
int nid, ret = 0;
/* fill digest values with some random data */
- if (!RAND_pseudo_bytes(digest, 20) ||
- !RAND_pseudo_bytes(wrong_digest, 20)) {
+ if (RAND_pseudo_bytes(digest, 20) <= 0 ||
+ RAND_pseudo_bytes(wrong_digest, 20) <= 0) {
BIO_printf(out, "ERROR: unable to get random data\n");
goto builtin_err;
}
diff --git a/crypto/openssl/crypto/engine/Makefile b/crypto/openssl/crypto/engine/Makefile
index d29bdd0..8ceb747 100644
--- a/crypto/openssl/crypto/engine/Makefile
+++ b/crypto/openssl/crypto/engine/Makefile
@@ -71,6 +71,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/engine/eng_table.c b/crypto/openssl/crypto/engine/eng_table.c
index 2e1a7e8..27d31f7 100644
--- a/crypto/openssl/crypto/engine/eng_table.c
+++ b/crypto/openssl/crypto/engine/eng_table.c
@@ -351,6 +351,8 @@ void engine_table_doall(ENGINE_TABLE *table, engine_table_doall_cb *cb,
ENGINE_PILE_DOALL dall;
dall.cb = cb;
dall.arg = arg;
- lh_ENGINE_PILE_doall_arg(&table->piles, LHASH_DOALL_ARG_FN(int_cb),
- ENGINE_PILE_DOALL, &dall);
+ if (table)
+ lh_ENGINE_PILE_doall_arg(&table->piles,
+ LHASH_DOALL_ARG_FN(int_cb),
+ ENGINE_PILE_DOALL, &dall);
}
diff --git a/crypto/openssl/crypto/err/Makefile b/crypto/openssl/crypto/err/Makefile
index 862b23b..b6f3ef1 100644
--- a/crypto/openssl/crypto/err/Makefile
+++ b/crypto/openssl/crypto/err/Makefile
@@ -61,6 +61,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/evp/Makefile b/crypto/openssl/crypto/evp/Makefile
index ef75678..ed1502d 100644
--- a/crypto/openssl/crypto/evp/Makefile
+++ b/crypto/openssl/crypto/evp/Makefile
@@ -86,6 +86,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(LIBSRC)
diff --git a/crypto/openssl/crypto/evp/bio_ok.c b/crypto/openssl/crypto/evp/bio_ok.c
index a455034..5c32e35 100644
--- a/crypto/openssl/crypto/evp/bio_ok.c
+++ b/crypto/openssl/crypto/evp/bio_ok.c
@@ -491,7 +491,8 @@ static int sig_out(BIO *b)
* FIXME: there's absolutely no guarantee this makes any sense at all,
* particularly now EVP_MD_CTX has been restructured.
*/
- RAND_pseudo_bytes(md->md_data, md->digest->md_size);
+ if (RAND_pseudo_bytes(md->md_data, md->digest->md_size) < 0)
+ goto berr;
memcpy(&(ctx->buf[ctx->buf_len]), md->md_data, md->digest->md_size);
longswap(&(ctx->buf[ctx->buf_len]), md->digest->md_size);
ctx->buf_len += md->digest->md_size;
diff --git a/crypto/openssl/crypto/evp/e_aes.c b/crypto/openssl/crypto/evp/e_aes.c
index 245c18a..1ede7bd 100644
--- a/crypto/openssl/crypto/evp/e_aes.c
+++ b/crypto/openssl/crypto/evp/e_aes.c
@@ -50,6 +50,7 @@
#include <openssl/opensslconf.h>
#ifndef OPENSSL_NO_AES
+#include <openssl/crypto.h>
# include <openssl/evp.h>
# include <openssl/err.h>
# include <string.h>
@@ -753,7 +754,7 @@ static int aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
case EVP_CTRL_AEAD_TLS1_AAD:
/* Save the AAD for later use */
- if (arg != 13)
+ if (arg != EVP_AEAD_TLS1_AAD_LEN)
return 0;
memcpy(c->buf, ptr, arg);
gctx->tls_aad_len = arg;
@@ -914,7 +915,7 @@ static int aes_gcm_tls_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
/* Retrieve tag */
CRYPTO_gcm128_tag(&gctx->gcm, ctx->buf, EVP_GCM_TLS_TAG_LEN);
/* If tag mismatch wipe buffer */
- if (memcmp(ctx->buf, in + len, EVP_GCM_TLS_TAG_LEN)) {
+ if (CRYPTO_memcmp(ctx->buf, in + len, EVP_GCM_TLS_TAG_LEN)) {
OPENSSL_cleanse(out, len);
goto err;
}
@@ -1259,7 +1260,7 @@ static int aes_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
!CRYPTO_ccm128_decrypt(ccm, in, out, len)) {
unsigned char tag[16];
if (CRYPTO_ccm128_tag(ccm, tag, cctx->M)) {
- if (!memcmp(tag, ctx->buf, cctx->M))
+ if (!CRYPTO_memcmp(tag, ctx->buf, cctx->M))
rv = len;
}
}
diff --git a/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c b/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c
index 3f8a5ae..d1f5928 100644
--- a/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c
+++ b/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c
@@ -503,7 +503,12 @@ static int aesni_cbc_hmac_sha1_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
case EVP_CTRL_AEAD_TLS1_AAD:
{
unsigned char *p = ptr;
- unsigned int len = p[arg - 2] << 8 | p[arg - 1];
+ unsigned int len;
+
+ if (arg != EVP_AEAD_TLS1_AAD_LEN)
+ return -1;
+
+ len = p[arg - 2] << 8 | p[arg - 1];
if (ctx->encrypt) {
key->payload_length = len;
@@ -520,8 +525,6 @@ static int aesni_cbc_hmac_sha1_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
AES_BLOCK_SIZE) & -AES_BLOCK_SIZE)
- len);
} else {
- if (arg > 13)
- arg = 13;
memcpy(key->aux.tls_aad, ptr, arg);
key->payload_length = arg;
diff --git a/crypto/openssl/crypto/evp/e_rc4_hmac_md5.c b/crypto/openssl/crypto/evp/e_rc4_hmac_md5.c
index 80735d3..2da1117 100644
--- a/crypto/openssl/crypto/evp/e_rc4_hmac_md5.c
+++ b/crypto/openssl/crypto/evp/e_rc4_hmac_md5.c
@@ -54,6 +54,7 @@
#if !defined(OPENSSL_NO_RC4) && !defined(OPENSSL_NO_MD5)
+# include <openssl/crypto.h>
# include <openssl/evp.h>
# include <openssl/objects.h>
# include <openssl/rc4.h>
@@ -210,7 +211,7 @@ static int rc4_hmac_md5_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
MD5_Update(&key->md, mac, MD5_DIGEST_LENGTH);
MD5_Final(mac, &key->md);
- if (memcmp(out + plen, mac, MD5_DIGEST_LENGTH))
+ if (CRYPTO_memcmp(out + plen, mac, MD5_DIGEST_LENGTH))
return 0;
} else {
MD5_Update(&key->md, out + md5_off, len - md5_off);
@@ -258,7 +259,12 @@ static int rc4_hmac_md5_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
case EVP_CTRL_AEAD_TLS1_AAD:
{
unsigned char *p = ptr;
- unsigned int len = p[arg - 2] << 8 | p[arg - 1];
+ unsigned int len;
+
+ if (arg != EVP_AEAD_TLS1_AAD_LEN)
+ return -1;
+
+ len = p[arg - 2] << 8 | p[arg - 1];
if (!ctx->encrypt) {
len -= MD5_DIGEST_LENGTH;
diff --git a/crypto/openssl/crypto/evp/encode.c b/crypto/openssl/crypto/evp/encode.c
index d1d8a07..5c5988f 100644
--- a/crypto/openssl/crypto/evp/encode.c
+++ b/crypto/openssl/crypto/evp/encode.c
@@ -137,7 +137,7 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
unsigned int total = 0;
*outl = 0;
- if (inl == 0)
+ if (inl <= 0)
return;
OPENSSL_assert(ctx->length <= (int)sizeof(ctx->enc_data));
if ((ctx->num + inl) < ctx->length) {
diff --git a/crypto/openssl/crypto/evp/evp.h b/crypto/openssl/crypto/evp/evp.h
index b00997b..6cf98ac 100644
--- a/crypto/openssl/crypto/evp/evp.h
+++ b/crypto/openssl/crypto/evp/evp.h
@@ -103,7 +103,6 @@
# define EVP_PKS_RSA 0x0100
# define EVP_PKS_DSA 0x0200
# define EVP_PKS_EC 0x0400
-# define EVP_PKT_EXP 0x1000 /* <= 512 bit key */
# define EVP_PKEY_NONE NID_undef
# define EVP_PKEY_RSA NID_rsaEncryption
@@ -409,6 +408,9 @@ struct evp_cipher_st {
/* Set the GCM invocation field, decrypt only */
# define EVP_CTRL_GCM_SET_IV_INV 0x18
+/* RFC 5246 defines additional data to be 13 bytes in length */
+# define EVP_AEAD_TLS1_AAD_LEN 13
+
/* GCM TLS constants */
/* Length of fixed part of IV derived from PRF */
# define EVP_GCM_TLS_FIXED_IV_LEN 4
diff --git a/crypto/openssl/crypto/evp/p_seal.c b/crypto/openssl/crypto/evp/p_seal.c
index caabbf4..ba9dfff 100644
--- a/crypto/openssl/crypto/evp/p_seal.c
+++ b/crypto/openssl/crypto/evp/p_seal.c
@@ -82,8 +82,9 @@ int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
return 1;
if (EVP_CIPHER_CTX_rand_key(ctx, key) <= 0)
return 0;
- if (EVP_CIPHER_CTX_iv_length(ctx))
- RAND_pseudo_bytes(iv, EVP_CIPHER_CTX_iv_length(ctx));
+ if (EVP_CIPHER_CTX_iv_length(ctx)
+ && RAND_bytes(iv, EVP_CIPHER_CTX_iv_length(ctx)) <= 0)
+ return 0;
if (!EVP_EncryptInit_ex(ctx, NULL, NULL, key, iv))
return 0;
diff --git a/crypto/openssl/crypto/hmac/Makefile b/crypto/openssl/crypto/hmac/Makefile
index 0e91709..52e39e5 100644
--- a/crypto/openssl/crypto/hmac/Makefile
+++ b/crypto/openssl/crypto/hmac/Makefile
@@ -61,6 +61,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/hmac/hmac.c b/crypto/openssl/crypto/hmac/hmac.c
index 5477816..33d88be 100644
--- a/crypto/openssl/crypto/hmac/hmac.c
+++ b/crypto/openssl/crypto/hmac/hmac.c
@@ -87,12 +87,18 @@ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
return FIPS_hmac_init_ex(ctx, key, len, md, NULL);
}
#endif
+ /* If we are changing MD then we must have a key */
+ if (md != NULL && md != ctx->md && (key == NULL || len < 0))
+ return 0;
if (md != NULL) {
reset = 1;
ctx->md = md;
- } else
+ } else if (ctx->md) {
md = ctx->md;
+ } else {
+ return 0;
+ }
if (key != NULL) {
reset = 1;
@@ -107,7 +113,8 @@ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
&ctx->key_length))
goto err;
} else {
- OPENSSL_assert(len >= 0 && len <= (int)sizeof(ctx->key));
+ if (len < 0 || len > (int)sizeof(ctx->key))
+ return 0;
memcpy(ctx->key, key, len);
ctx->key_length = len;
}
@@ -151,6 +158,9 @@ int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len)
if (FIPS_mode() && !ctx->i_ctx.engine)
return FIPS_hmac_update(ctx, data, len);
#endif
+ if (!ctx->md)
+ return 0;
+
return EVP_DigestUpdate(&ctx->md_ctx, data, len);
}
@@ -163,6 +173,9 @@ int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len)
return FIPS_hmac_final(ctx, md, len);
#endif
+ if (!ctx->md)
+ goto err;
+
if (!EVP_DigestFinal_ex(&ctx->md_ctx, buf, &i))
goto err;
if (!EVP_MD_CTX_copy_ex(&ctx->md_ctx, &ctx->o_ctx))
@@ -181,6 +194,7 @@ void HMAC_CTX_init(HMAC_CTX *ctx)
EVP_MD_CTX_init(&ctx->i_ctx);
EVP_MD_CTX_init(&ctx->o_ctx);
EVP_MD_CTX_init(&ctx->md_ctx);
+ ctx->md = NULL;
}
int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx)
@@ -232,6 +246,7 @@ unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
HMAC_CTX_cleanup(&c);
return md;
err:
+ HMAC_CTX_cleanup(&c);
return NULL;
}
diff --git a/crypto/openssl/crypto/hmac/hmactest.c b/crypto/openssl/crypto/hmac/hmactest.c
index 3d130a0..271d0eb 100644
--- a/crypto/openssl/crypto/hmac/hmactest.c
+++ b/crypto/openssl/crypto/hmac/hmactest.c
@@ -85,7 +85,7 @@ static struct test_st {
unsigned char data[64];
int data_len;
unsigned char *digest;
-} test[4] = {
+} test[8] = {
{
"", 0, "More text test vectors to stuff up EBCDIC machines :-)", 54,
(unsigned char *)"e9139d1e6ee064ef8cf514fc7dc83e86",
@@ -113,10 +113,27 @@ static struct test_st {
0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd
}, 50, (unsigned char *)"56be34521d144c88dbb8c733f0e8b3f6",
},
+ {
+ "", 0, "My test data", 12,
+ (unsigned char *)"61afdecb95429ef494d61fdee15990cabf0826fc"
+ },
+ {
+ "", 0, "My test data", 12,
+ (unsigned char *)"2274b195d90ce8e03406f4b526a47e0787a88a65479938f1a5baa3ce0f079776"
+ },
+ {
+ "123456", 6, "My test data", 12,
+ (unsigned char *)"bab53058ae861a7f191abe2d0145cbb123776a6369ee3f9d79ce455667e411dd"
+ },
+ {
+ "12345", 5, "My test data again", 12,
+ (unsigned char *)"7dbe8c764c068e3bcd6e6b0fbcd5e6fc197b15bb"
+ }
};
# endif
-static char *pt(unsigned char *md);
+static char *pt(unsigned char *md, unsigned int len);
+
int main(int argc, char *argv[])
{
# ifndef OPENSSL_NO_MD5
@@ -124,6 +141,9 @@ int main(int argc, char *argv[])
char *p;
# endif
int err = 0;
+ HMAC_CTX ctx, ctx2;
+ unsigned char buf[EVP_MAX_MD_SIZE];
+ unsigned int len;
# ifdef OPENSSL_NO_MD5
printf("test skipped: MD5 disabled\n");
@@ -139,27 +159,172 @@ int main(int argc, char *argv[])
for (i = 0; i < 4; i++) {
p = pt(HMAC(EVP_md5(),
test[i].key, test[i].key_len,
- test[i].data, test[i].data_len, NULL, NULL));
+ test[i].data, test[i].data_len, NULL, NULL),
+ MD5_DIGEST_LENGTH);
if (strcmp(p, (char *)test[i].digest) != 0) {
- printf("error calculating HMAC on %d entry'\n", i);
+ printf("Error calculating HMAC on %d entry'\n", i);
printf("got %s instead of %s\n", p, test[i].digest);
err++;
} else
printf("test %d ok\n", i);
}
# endif /* OPENSSL_NO_MD5 */
+
+/* test4 */
+ HMAC_CTX_init(&ctx);
+ if (HMAC_Init_ex(&ctx, NULL, 0, NULL, NULL)) {
+ printf("Should fail to initialise HMAC with empty MD and key (test 4)\n");
+ err++;
+ goto test5;
+ }
+ if (HMAC_Update(&ctx, test[4].data, test[4].data_len)) {
+ printf("Should fail HMAC_Update with ctx not set up (test 4)\n");
+ err++;
+ goto test5;
+ }
+ if (HMAC_Init_ex(&ctx, NULL, 0, EVP_sha1(), NULL)) {
+ printf("Should fail to initialise HMAC with empty key (test 4)\n");
+ err++;
+ goto test5;
+ }
+ if (HMAC_Update(&ctx, test[4].data, test[4].data_len)) {
+ printf("Should fail HMAC_Update with ctx not set up (test 4)\n");
+ err++;
+ goto test5;
+ }
+ printf("test 4 ok\n");
+test5:
+ HMAC_CTX_init(&ctx);
+ if (HMAC_Init_ex(&ctx, test[4].key, test[4].key_len, NULL, NULL)) {
+ printf("Should fail to initialise HMAC with empty MD (test 5)\n");
+ err++;
+ goto test6;
+ }
+ if (HMAC_Update(&ctx, test[4].data, test[4].data_len)) {
+ printf("Should fail HMAC_Update with ctx not set up (test 5)\n");
+ err++;
+ goto test6;
+ }
+ if (HMAC_Init_ex(&ctx, test[4].key, -1, EVP_sha1(), NULL)) {
+ printf("Should fail to initialise HMAC with invalid key len(test 5)\n");
+ err++;
+ goto test6;
+ }
+ if (!HMAC_Init_ex(&ctx, test[4].key, test[4].key_len, EVP_sha1(), NULL)) {
+ printf("Failed to initialise HMAC (test 5)\n");
+ err++;
+ goto test6;
+ }
+ if (!HMAC_Update(&ctx, test[4].data, test[4].data_len)) {
+ printf("Error updating HMAC with data (test 5)\n");
+ err++;
+ goto test6;
+ }
+ if (!HMAC_Final(&ctx, buf, &len)) {
+ printf("Error finalising data (test 5)\n");
+ err++;
+ goto test6;
+ }
+ p = pt(buf, len);
+ if (strcmp(p, (char *)test[4].digest) != 0) {
+ printf("Error calculating interim HMAC on test 5\n");
+ printf("got %s instead of %s\n", p, test[4].digest);
+ err++;
+ goto test6;
+ }
+ if (HMAC_Init_ex(&ctx, NULL, 0, EVP_sha256(), NULL)) {
+ printf("Should disallow changing MD without a new key (test 5)\n");
+ err++;
+ goto test6;
+ }
+ if (!HMAC_Init_ex(&ctx, test[4].key, test[4].key_len, EVP_sha256(), NULL)) {
+ printf("Failed to reinitialise HMAC (test 5)\n");
+ err++;
+ goto test6;
+ }
+ if (!HMAC_Update(&ctx, test[5].data, test[5].data_len)) {
+ printf("Error updating HMAC with data (sha256) (test 5)\n");
+ err++;
+ goto test6;
+ }
+ if (!HMAC_Final(&ctx, buf, &len)) {
+ printf("Error finalising data (sha256) (test 5)\n");
+ err++;
+ goto test6;
+ }
+ p = pt(buf, len);
+ if (strcmp(p, (char *)test[5].digest) != 0) {
+ printf("Error calculating 2nd interim HMAC on test 5\n");
+ printf("got %s instead of %s\n", p, test[5].digest);
+ err++;
+ goto test6;
+ }
+ if (!HMAC_Init_ex(&ctx, test[6].key, test[6].key_len, NULL, NULL)) {
+ printf("Failed to reinitialise HMAC with key (test 5)\n");
+ err++;
+ goto test6;
+ }
+ if (!HMAC_Update(&ctx, test[6].data, test[6].data_len)) {
+ printf("Error updating HMAC with data (new key) (test 5)\n");
+ err++;
+ goto test6;
+ }
+ if (!HMAC_Final(&ctx, buf, &len)) {
+ printf("Error finalising data (new key) (test 5)\n");
+ err++;
+ goto test6;
+ }
+ p = pt(buf, len);
+ if (strcmp(p, (char *)test[6].digest) != 0) {
+ printf("error calculating HMAC on test 5\n");
+ printf("got %s instead of %s\n", p, test[6].digest);
+ err++;
+ } else {
+ printf("test 5 ok\n");
+ }
+test6:
+ HMAC_CTX_init(&ctx);
+ if (!HMAC_Init_ex(&ctx, test[7].key, test[7].key_len, EVP_sha1(), NULL)) {
+ printf("Failed to initialise HMAC (test 6)\n");
+ err++;
+ goto end;
+ }
+ if (!HMAC_Update(&ctx, test[7].data, test[7].data_len)) {
+ printf("Error updating HMAC with data (test 6)\n");
+ err++;
+ goto end;
+ }
+ if (!HMAC_CTX_copy(&ctx2, &ctx)) {
+ printf("Failed to copy HMAC_CTX (test 6)\n");
+ err++;
+ goto end;
+ }
+ if (!HMAC_Final(&ctx2, buf, &len)) {
+ printf("Error finalising data (test 6)\n");
+ err++;
+ goto end;
+ }
+ p = pt(buf, len);
+ if (strcmp(p, (char *)test[7].digest) != 0) {
+ printf("Error calculating HMAC on test 6\n");
+ printf("got %s instead of %s\n", p, test[7].digest);
+ err++;
+ } else {
+ printf("test 6 ok\n");
+ }
+end:
EXIT(err);
return (0);
}
# ifndef OPENSSL_NO_MD5
-static char *pt(unsigned char *md)
+static char *pt(unsigned char *md, unsigned int len)
{
- int i;
+ unsigned int i;
static char buf[80];
- for (i = 0; i < MD5_DIGEST_LENGTH; i++)
+ for (i = 0; i < len; i++)
sprintf(&(buf[i * 2]), "%02x", md[i]);
return (buf);
}
diff --git a/crypto/openssl/crypto/idea/Makefile b/crypto/openssl/crypto/idea/Makefile
index 8af0acd..3dc23e4 100644
--- a/crypto/openssl/crypto/idea/Makefile
+++ b/crypto/openssl/crypto/idea/Makefile
@@ -61,6 +61,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/jpake/Makefile b/crypto/openssl/crypto/jpake/Makefile
index 110c49c..5193fd9 100644
--- a/crypto/openssl/crypto/jpake/Makefile
+++ b/crypto/openssl/crypto/jpake/Makefile
@@ -32,6 +32,8 @@ install:
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
done;
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/krb5/Makefile b/crypto/openssl/crypto/krb5/Makefile
index 1407739..8b9a01a 100644
--- a/crypto/openssl/crypto/krb5/Makefile
+++ b/crypto/openssl/crypto/krb5/Makefile
@@ -62,6 +62,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(LIBSRC)
diff --git a/crypto/openssl/crypto/lhash/Makefile b/crypto/openssl/crypto/lhash/Makefile
index 82bddac..c7f4365 100644
--- a/crypto/openssl/crypto/lhash/Makefile
+++ b/crypto/openssl/crypto/lhash/Makefile
@@ -61,6 +61,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/md2/Makefile b/crypto/openssl/crypto/md2/Makefile
index 17f878a..b630110 100644
--- a/crypto/openssl/crypto/md2/Makefile
+++ b/crypto/openssl/crypto/md2/Makefile
@@ -61,6 +61,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/md32_common.h b/crypto/openssl/crypto/md32_common.h
index c1efb45..1823833 100644
--- a/crypto/openssl/crypto/md32_common.h
+++ b/crypto/openssl/crypto/md32_common.h
@@ -142,8 +142,10 @@
*/
#undef ROTATE
#ifndef PEDANTIC
-# if defined(_MSC_VER) || defined(__ICC)
+# if defined(_MSC_VER)
# define ROTATE(a,n) _lrotl(a,n)
+# elif defined(__ICC)
+# define ROTATE(a,n) _rotl(a,n)
# elif defined(__MWERKS__)
# if defined(__POWERPC__)
# define ROTATE(a,n) __rlwinm(a,n,0,31)
diff --git a/crypto/openssl/crypto/md4/Makefile b/crypto/openssl/crypto/md4/Makefile
index e6f1e44..3ee4361 100644
--- a/crypto/openssl/crypto/md4/Makefile
+++ b/crypto/openssl/crypto/md4/Makefile
@@ -62,6 +62,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/md5/Makefile b/crypto/openssl/crypto/md5/Makefile
index b9e2ce9..0f87dbd 100644
--- a/crypto/openssl/crypto/md5/Makefile
+++ b/crypto/openssl/crypto/md5/Makefile
@@ -76,6 +76,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/mdc2/Makefile b/crypto/openssl/crypto/mdc2/Makefile
index 1415531..c2d0c5b 100644
--- a/crypto/openssl/crypto/mdc2/Makefile
+++ b/crypto/openssl/crypto/mdc2/Makefile
@@ -61,6 +61,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/mem.c b/crypto/openssl/crypto/mem.c
index 2ce3e89..fdad49b 100644
--- a/crypto/openssl/crypto/mem.c
+++ b/crypto/openssl/crypto/mem.c
@@ -365,6 +365,9 @@ char *CRYPTO_strdup(const char *str, const char *file, int line)
{
char *ret = CRYPTO_malloc(strlen(str) + 1, file, line);
+ if (ret == NULL)
+ return NULL;
+
strcpy(ret, str);
return ret;
}
diff --git a/crypto/openssl/crypto/modes/Makefile b/crypto/openssl/crypto/modes/Makefile
index 3d8bafd..e278fa6 100644
--- a/crypto/openssl/crypto/modes/Makefile
+++ b/crypto/openssl/crypto/modes/Makefile
@@ -89,6 +89,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/modes/gcm128.c b/crypto/openssl/crypto/modes/gcm128.c
index f69f2c9..0ee569f 100644
--- a/crypto/openssl/crypto/modes/gcm128.c
+++ b/crypto/openssl/crypto/modes/gcm128.c
@@ -1622,7 +1622,7 @@ int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const unsigned char *tag,
ctx->Xi.u[1] ^= ctx->EK0.u[1];
if (tag && len <= sizeof(ctx->Xi))
- return memcmp(ctx->Xi.c, tag, len);
+ return CRYPTO_memcmp(ctx->Xi.c, tag, len);
else
return -1;
}
diff --git a/crypto/openssl/crypto/objects/Makefile b/crypto/openssl/crypto/objects/Makefile
index a8aedbd..f93d2f9 100644
--- a/crypto/openssl/crypto/objects/Makefile
+++ b/crypto/openssl/crypto/objects/Makefile
@@ -74,6 +74,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: obj_dat.h obj_mac.h obj_xref.h depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/objects/o_names.c b/crypto/openssl/crypto/objects/o_names.c
index c6774f4..2485992 100644
--- a/crypto/openssl/crypto/objects/o_names.c
+++ b/crypto/openssl/crypto/objects/o_names.c
@@ -313,7 +313,7 @@ void OBJ_NAME_do_all_sorted(int type,
d.names =
OPENSSL_malloc(lh_OBJ_NAME_num_items(names_lh) * sizeof *d.names);
/* Really should return an error if !d.names...but its a void function! */
- if(d.names) {
+ if (d.names) {
d.n = 0;
OBJ_NAME_do_all(type, do_all_sorted_fn, &d);
diff --git a/crypto/openssl/crypto/objects/obj_dat.c b/crypto/openssl/crypto/objects/obj_dat.c
index e42a1c1..aca382a 100644
--- a/crypto/openssl/crypto/objects/obj_dat.c
+++ b/crypto/openssl/crypto/objects/obj_dat.c
@@ -142,7 +142,7 @@ static unsigned long added_obj_hash(const ADDED_OBJ *ca)
return 0;
}
ret &= 0x3fffffffL;
- ret |= ca->type << 30L;
+ ret |= ((unsigned long)ca->type) << 30L;
return (ret);
}
@@ -400,6 +400,8 @@ static int obj_cmp(const ASN1_OBJECT *const *ap, const unsigned int *bp)
j = (a->length - b->length);
if (j)
return (j);
+ if (a->length == 0)
+ return 0;
return (memcmp(a->data, b->data, a->length));
}
@@ -415,6 +417,9 @@ int OBJ_obj2nid(const ASN1_OBJECT *a)
if (a->nid != 0)
return (a->nid);
+ if (a->length == 0)
+ return NID_undef;
+
if (added != NULL) {
ad.type = ADDED_DATA;
ad.obj = (ASN1_OBJECT *)a; /* XXX: ugly but harmless */
diff --git a/crypto/openssl/crypto/objects/objects.README b/crypto/openssl/crypto/objects/objects.README
index 4d74550..cb1d216 100644
--- a/crypto/openssl/crypto/objects/objects.README
+++ b/crypto/openssl/crypto/objects/objects.README
@@ -8,9 +8,9 @@ The basic syntax for adding an object is as follows:
1 2 3 4 : shortName : Long Name
- If the long name doesn't contain spaces, or no short name
- exists, the long name is used as basis for the base name
- in C. Otherwise, the short name is used.
+ If Long Name contains only word characters and hyphen-minus
+ (0x2D) or full stop (0x2E) then Long Name is used as basis
+ for the base name in C. Otherwise, the shortName is used.
The base name (let's call it 'base') will then be used to
create the C macros SN_base, LN_base, NID_base and OBJ_base.
@@ -22,7 +22,7 @@ Then there are some extra commands:
!Alias foo 1 2 3 4
- This juts makes a name foo for an OID. The C macro
+ This just makes a name foo for an OID. The C macro
OBJ_foo will be created as a result.
!Cname foo
diff --git a/crypto/openssl/crypto/objects/objects.pl b/crypto/openssl/crypto/objects/objects.pl
index d0ed459..389dc34 100644
--- a/crypto/openssl/crypto/objects/objects.pl
+++ b/crypto/openssl/crypto/objects/objects.pl
@@ -67,7 +67,7 @@ while (<IN>)
$myoid = &process_oid($myoid);
}
- if ($Cname eq "" && !($myln =~ / /))
+ if ($Cname eq "" && ($myln =~ /^[_A-Za-z][\w.-]*$/ ))
{
$Cname = $myln;
$Cname =~ s/\./_/g;
diff --git a/crypto/openssl/crypto/ocsp/Makefile b/crypto/openssl/crypto/ocsp/Makefile
index 60c414c..96a1b15 100644
--- a/crypto/openssl/crypto/ocsp/Makefile
+++ b/crypto/openssl/crypto/ocsp/Makefile
@@ -64,6 +64,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(LIBSRC)
diff --git a/crypto/openssl/crypto/ocsp/ocsp_ext.c b/crypto/openssl/crypto/ocsp/ocsp_ext.c
index 849cb2f..c19648c 100644
--- a/crypto/openssl/crypto/ocsp/ocsp_ext.c
+++ b/crypto/openssl/crypto/ocsp/ocsp_ext.c
@@ -361,8 +361,8 @@ static int ocsp_add1_nonce(STACK_OF(X509_EXTENSION) **exts,
ASN1_put_object(&tmpval, 0, len, V_ASN1_OCTET_STRING, V_ASN1_UNIVERSAL);
if (val)
memcpy(tmpval, val, len);
- else
- RAND_pseudo_bytes(tmpval, len);
+ else if (RAND_pseudo_bytes(tmpval, len) < 0)
+ goto err;
if (!X509V3_add1_i2d(exts, NID_id_pkix_OCSP_Nonce,
&os, 0, X509V3_ADD_REPLACE))
goto err;
diff --git a/crypto/openssl/crypto/ocsp/ocsp_vfy.c b/crypto/openssl/crypto/ocsp/ocsp_vfy.c
index 6c0ccb5..d4a257c 100644
--- a/crypto/openssl/crypto/ocsp/ocsp_vfy.c
+++ b/crypto/openssl/crypto/ocsp/ocsp_vfy.c
@@ -83,6 +83,7 @@ int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs,
{
X509 *signer, *x;
STACK_OF(X509) *chain = NULL;
+ STACK_OF(X509) *untrusted = NULL;
X509_STORE_CTX ctx;
int i, ret = 0;
ret = ocsp_find_signer(&signer, bs, certs, st, flags);
@@ -107,10 +108,20 @@ int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs,
}
if (!(flags & OCSP_NOVERIFY)) {
int init_res;
- if (flags & OCSP_NOCHAIN)
- init_res = X509_STORE_CTX_init(&ctx, st, signer, NULL);
- else
- init_res = X509_STORE_CTX_init(&ctx, st, signer, bs->certs);
+ if (flags & OCSP_NOCHAIN) {
+ untrusted = NULL;
+ } else if (bs->certs && certs) {
+ untrusted = sk_X509_dup(bs->certs);
+ for (i = 0; i < sk_X509_num(certs); i++) {
+ if (!sk_X509_push(untrusted, sk_X509_value(certs, i))) {
+ OCSPerr(OCSP_F_OCSP_BASIC_VERIFY, ERR_R_MALLOC_FAILURE);
+ goto end;
+ }
+ }
+ } else {
+ untrusted = bs->certs;
+ }
+ init_res = X509_STORE_CTX_init(&ctx, st, signer, untrusted);
if (!init_res) {
ret = -1;
OCSPerr(OCSP_F_OCSP_BASIC_VERIFY, ERR_R_X509_LIB);
@@ -161,6 +172,8 @@ int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs,
end:
if (chain)
sk_X509_pop_free(chain, X509_free);
+ if (bs->certs && certs)
+ sk_X509_free(untrusted);
return ret;
}
diff --git a/crypto/openssl/crypto/opensslv.h b/crypto/openssl/crypto/opensslv.h
index 5ecd215..bc91a6c 100644
--- a/crypto/openssl/crypto/opensslv.h
+++ b/crypto/openssl/crypto/opensslv.h
@@ -30,11 +30,11 @@ extern "C" {
* (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
* major minor fix final patch/beta)
*/
-# define OPENSSL_VERSION_NUMBER 0x100010dfL
+# define OPENSSL_VERSION_NUMBER 0x100010ffL
# ifdef OPENSSL_FIPS
-# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1m-fips 19 Mar 2015"
+# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1o-fips 12 Jun 2015"
# else
-# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1m-freebsd 19 Mar 2015"
+# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1o-freebsd 12 Jun 2015"
# endif
# define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
diff --git a/crypto/openssl/crypto/pem/Makefile b/crypto/openssl/crypto/pem/Makefile
index 2cc7801..7a930ee 100644
--- a/crypto/openssl/crypto/pem/Makefile
+++ b/crypto/openssl/crypto/pem/Makefile
@@ -64,6 +64,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(LIBSRC)
diff --git a/crypto/openssl/crypto/pem/pem_lib.c b/crypto/openssl/crypto/pem/pem_lib.c
index febb53e..5507161 100644
--- a/crypto/openssl/crypto/pem/pem_lib.c
+++ b/crypto/openssl/crypto/pem/pem_lib.c
@@ -435,7 +435,7 @@ int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp,
int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *plen,
pem_password_cb *callback, void *u)
{
- int i, j, o, klen;
+ int i = 0, j, o, klen;
long len;
EVP_CIPHER_CTX ctx;
unsigned char key[EVP_MAX_KEY_LENGTH];
diff --git a/crypto/openssl/crypto/pem/pem_pk8.c b/crypto/openssl/crypto/pem/pem_pk8.c
index b98c76c..5747c73 100644
--- a/crypto/openssl/crypto/pem/pem_pk8.c
+++ b/crypto/openssl/crypto/pem/pem_pk8.c
@@ -138,6 +138,8 @@ static int do_pk8pkey(BIO *bp, EVP_PKEY *x, int isder, int nid,
if (kstr == buf)
OPENSSL_cleanse(buf, klen);
PKCS8_PRIV_KEY_INFO_free(p8inf);
+ if (p8 == NULL)
+ return 0;
if (isder)
ret = i2d_PKCS8_bio(bp, p8);
else
diff --git a/crypto/openssl/crypto/pkcs12/Makefile b/crypto/openssl/crypto/pkcs12/Makefile
index 3a7498f..be5f8c5 100644
--- a/crypto/openssl/crypto/pkcs12/Makefile
+++ b/crypto/openssl/crypto/pkcs12/Makefile
@@ -67,6 +67,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/pkcs12/p12_mutl.c b/crypto/openssl/crypto/pkcs12/p12_mutl.c
index 256b210..5ab4bf2 100644
--- a/crypto/openssl/crypto/pkcs12/p12_mutl.c
+++ b/crypto/openssl/crypto/pkcs12/p12_mutl.c
@@ -60,6 +60,7 @@
#ifndef OPENSSL_NO_HMAC
# include <stdio.h>
# include "cryptlib.h"
+# include <openssl/crypto.h>
# include <openssl/hmac.h>
# include <openssl/rand.h>
# include <openssl/pkcs12.h>
@@ -123,7 +124,7 @@ int PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen)
return 0;
}
if ((maclen != (unsigned int)p12->mac->dinfo->digest->length)
- || memcmp(mac, p12->mac->dinfo->digest->data, maclen))
+ || CRYPTO_memcmp(mac, p12->mac->dinfo->digest->data, maclen))
return 0;
return 1;
}
diff --git a/crypto/openssl/crypto/pkcs7/Makefile b/crypto/openssl/crypto/pkcs7/Makefile
index effe05f..decf5e0 100644
--- a/crypto/openssl/crypto/pkcs7/Makefile
+++ b/crypto/openssl/crypto/pkcs7/Makefile
@@ -68,6 +68,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/pkcs7/pk7_doit.c b/crypto/openssl/crypto/pkcs7/pk7_doit.c
index 31a1b98..c8d7db0 100644
--- a/crypto/openssl/crypto/pkcs7/pk7_doit.c
+++ b/crypto/openssl/crypto/pkcs7/pk7_doit.c
@@ -445,6 +445,12 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
switch (i) {
case NID_pkcs7_signed:
+ /*
+ * p7->d.sign->contents is a PKCS7 structure consisting of a contentType
+ * field and optional content.
+ * data_body is NULL if that structure has no (=detached) content
+ * or if the contentType is wrong (i.e., not "data").
+ */
data_body = PKCS7_get_octet_string(p7->d.sign->contents);
if (!PKCS7_is_detached(p7) && data_body == NULL) {
PKCS7err(PKCS7_F_PKCS7_DATADECODE,
@@ -456,6 +462,7 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
case NID_pkcs7_signedAndEnveloped:
rsk = p7->d.signed_and_enveloped->recipientinfo;
md_sk = p7->d.signed_and_enveloped->md_algs;
+ /* data_body is NULL if the optional EncryptedContent is missing. */
data_body = p7->d.signed_and_enveloped->enc_data->enc_data;
enc_alg = p7->d.signed_and_enveloped->enc_data->algorithm;
evp_cipher = EVP_get_cipherbyobj(enc_alg->algorithm);
@@ -468,6 +475,7 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
case NID_pkcs7_enveloped:
rsk = p7->d.enveloped->recipientinfo;
enc_alg = p7->d.enveloped->enc_data->algorithm;
+ /* data_body is NULL if the optional EncryptedContent is missing. */
data_body = p7->d.enveloped->enc_data->enc_data;
evp_cipher = EVP_get_cipherbyobj(enc_alg->algorithm);
if (evp_cipher == NULL) {
@@ -481,6 +489,12 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
goto err;
}
+ /* Detached content must be supplied via in_bio instead. */
+ if (data_body == NULL && in_bio == NULL) {
+ PKCS7err(PKCS7_F_PKCS7_DATADECODE, PKCS7_R_NO_CONTENT);
+ goto err;
+ }
+
/* We will be checking the signature */
if (md_sk != NULL) {
for (i = 0; i < sk_X509_ALGOR_num(md_sk); i++) {
@@ -623,7 +637,7 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
etmp = NULL;
}
#if 1
- if (PKCS7_is_detached(p7) || (in_bio != NULL)) {
+ if (in_bio != NULL) {
bio = in_bio;
} else {
# if 0
diff --git a/crypto/openssl/crypto/pqueue/Makefile b/crypto/openssl/crypto/pqueue/Makefile
index fb36a0c..a59b5a9 100644
--- a/crypto/openssl/crypto/pqueue/Makefile
+++ b/crypto/openssl/crypto/pqueue/Makefile
@@ -61,6 +61,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/rand/Makefile b/crypto/openssl/crypto/rand/Makefile
index 27694aa..df44369 100644
--- a/crypto/openssl/crypto/rand/Makefile
+++ b/crypto/openssl/crypto/rand/Makefile
@@ -63,6 +63,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/rc2/Makefile b/crypto/openssl/crypto/rc2/Makefile
index 8a9d49a..b3727a4 100644
--- a/crypto/openssl/crypto/rc2/Makefile
+++ b/crypto/openssl/crypto/rc2/Makefile
@@ -61,6 +61,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/rc4/Makefile b/crypto/openssl/crypto/rc4/Makefile
index 1614d47..f3d6e0d 100644
--- a/crypto/openssl/crypto/rc4/Makefile
+++ b/crypto/openssl/crypto/rc4/Makefile
@@ -89,6 +89,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/rc5/Makefile b/crypto/openssl/crypto/rc5/Makefile
index 8a8b00e..6ca0037 100644
--- a/crypto/openssl/crypto/rc5/Makefile
+++ b/crypto/openssl/crypto/rc5/Makefile
@@ -69,6 +69,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/ripemd/Makefile b/crypto/openssl/crypto/ripemd/Makefile
index 25140b2..1c3f094 100644
--- a/crypto/openssl/crypto/ripemd/Makefile
+++ b/crypto/openssl/crypto/ripemd/Makefile
@@ -69,6 +69,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/rsa/Makefile b/crypto/openssl/crypto/rsa/Makefile
index e8121a4..79c7c42 100644
--- a/crypto/openssl/crypto/rsa/Makefile
+++ b/crypto/openssl/crypto/rsa/Makefile
@@ -67,6 +67,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/rsa/rsa_pmeth.c b/crypto/openssl/crypto/rsa/rsa_pmeth.c
index d61d6e8..6a7c67c 100644
--- a/crypto/openssl/crypto/rsa/rsa_pmeth.c
+++ b/crypto/openssl/crypto/rsa/rsa_pmeth.c
@@ -228,8 +228,14 @@ static int pkey_rsa_sign(EVP_PKEY_CTX *ctx, unsigned char *sig,
return ret;
ret = sltmp;
} else if (rctx->pad_mode == RSA_X931_PADDING) {
- if (!setup_tbuf(rctx, ctx))
+ if ((size_t)EVP_PKEY_size(ctx->pkey) < tbslen + 1) {
+ RSAerr(RSA_F_PKEY_RSA_SIGN, RSA_R_KEY_SIZE_TOO_SMALL);
+ return -1;
+ }
+ if (!setup_tbuf(rctx, ctx)) {
+ RSAerr(RSA_F_PKEY_RSA_SIGN, ERR_R_MALLOC_FAILURE);
return -1;
+ }
memcpy(rctx->tbuf, tbs, tbslen);
rctx->tbuf[tbslen] = RSA_X931_hash_id(EVP_MD_type(rctx->md));
ret = RSA_private_encrypt(tbslen + 1, rctx->tbuf,
diff --git a/crypto/openssl/crypto/seed/Makefile b/crypto/openssl/crypto/seed/Makefile
index 4bc55e4..70d3d45 100644
--- a/crypto/openssl/crypto/seed/Makefile
+++ b/crypto/openssl/crypto/seed/Makefile
@@ -62,6 +62,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/sha/Makefile b/crypto/openssl/crypto/sha/Makefile
index 2eb2b7a..ceb8094 100644
--- a/crypto/openssl/crypto/sha/Makefile
+++ b/crypto/openssl/crypto/sha/Makefile
@@ -117,6 +117,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/srp/Makefile b/crypto/openssl/crypto/srp/Makefile
index 41859d4..7639533 100644
--- a/crypto/openssl/crypto/srp/Makefile
+++ b/crypto/openssl/crypto/srp/Makefile
@@ -61,6 +61,8 @@ srptest: top srptest.c $(LIB)
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/srp/srp_vfy.c b/crypto/openssl/crypto/srp/srp_vfy.c
index 701b5cd..50f75d7 100644
--- a/crypto/openssl/crypto/srp/srp_vfy.c
+++ b/crypto/openssl/crypto/srp/srp_vfy.c
@@ -497,7 +497,8 @@ SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username)
if (!SRP_user_pwd_set_ids(user, username, NULL))
goto err;
- RAND_pseudo_bytes(digv, SHA_DIGEST_LENGTH);
+ if (RAND_pseudo_bytes(digv, SHA_DIGEST_LENGTH) < 0)
+ goto err;
EVP_MD_CTX_init(&ctxt);
EVP_DigestInit_ex(&ctxt, EVP_sha1(), NULL);
EVP_DigestUpdate(&ctxt, vb->seed_key, strlen(vb->seed_key));
@@ -549,7 +550,8 @@ char *SRP_create_verifier(const char *user, const char *pass, char **salt,
}
if (*salt == NULL) {
- RAND_pseudo_bytes(tmp2, SRP_RANDOM_SALT_LEN);
+ if (RAND_pseudo_bytes(tmp2, SRP_RANDOM_SALT_LEN) < 0)
+ goto err;
s = BN_bin2bn(tmp2, SRP_RANDOM_SALT_LEN, NULL);
} else {
@@ -609,7 +611,8 @@ int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt,
srp_bn_print(g);
if (*salt == NULL) {
- RAND_pseudo_bytes(tmp2, SRP_RANDOM_SALT_LEN);
+ if (RAND_pseudo_bytes(tmp2, SRP_RANDOM_SALT_LEN) < 0)
+ goto err;
*salt = BN_bin2bn(tmp2, SRP_RANDOM_SALT_LEN, NULL);
}
diff --git a/crypto/openssl/crypto/stack/Makefile b/crypto/openssl/crypto/stack/Makefile
index 5327692..b069c93 100644
--- a/crypto/openssl/crypto/stack/Makefile
+++ b/crypto/openssl/crypto/stack/Makefile
@@ -61,6 +61,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/store/Makefile b/crypto/openssl/crypto/store/Makefile
index 0dcfd78..5bc7ca7 100644
--- a/crypto/openssl/crypto/store/Makefile
+++ b/crypto/openssl/crypto/store/Makefile
@@ -63,6 +63,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/threads/th-lock.c b/crypto/openssl/crypto/threads/th-lock.c
index 28884c2..cc8cf25 100644
--- a/crypto/openssl/crypto/threads/th-lock.c
+++ b/crypto/openssl/crypto/threads/th-lock.c
@@ -117,7 +117,7 @@ void CRYPTO_thread_setup(void)
int i;
lock_cs = OPENSSL_malloc(CRYPTO_num_locks() * sizeof(HANDLE));
- if(!lock_cs) {
+ if (!lock_cs) {
/* Nothing we can do about this...void function! */
return;
}
@@ -172,7 +172,7 @@ void CRYPTO_thread_setup(void)
# else
lock_cs = OPENSSL_malloc(CRYPTO_num_locks() * sizeof(rwlock_t));
# endif
- if(!lock_cs) {
+ if (!lock_cs) {
/* Nothing we can do about this...void function! */
return;
}
@@ -260,7 +260,7 @@ void CRYPTO_thread_setup(void)
char filename[20];
lock_cs = OPENSSL_malloc(CRYPTO_num_locks() * sizeof(usema_t *));
- if(!lock_cs) {
+ if (!lock_cs) {
/* Nothing we can do about this...void function! */
return;
}
@@ -328,11 +328,11 @@ void CRYPTO_thread_setup(void)
lock_cs = OPENSSL_malloc(CRYPTO_num_locks() * sizeof(pthread_mutex_t));
lock_count = OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long));
- if(!lock_cs || !lock_count) {
+ if (!lock_cs || !lock_count) {
/* Nothing we can do about this...void function! */
- if(lock_cs)
+ if (lock_cs)
OPENSSL_free(lock_cs);
- if(lock_count)
+ if (lock_count)
OPENSSL_free(lock_count);
return;
}
diff --git a/crypto/openssl/crypto/ts/Makefile b/crypto/openssl/crypto/ts/Makefile
index c182345..cf991ef 100644
--- a/crypto/openssl/crypto/ts/Makefile
+++ b/crypto/openssl/crypto/ts/Makefile
@@ -73,6 +73,8 @@ tags:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(LIBSRC)
diff --git a/crypto/openssl/crypto/txt_db/Makefile b/crypto/openssl/crypto/txt_db/Makefile
index e6f3033..4f70b19 100644
--- a/crypto/openssl/crypto/txt_db/Makefile
+++ b/crypto/openssl/crypto/txt_db/Makefile
@@ -61,6 +61,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by top Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/ui/Makefile b/crypto/openssl/crypto/ui/Makefile
index a685659..b28fcca 100644
--- a/crypto/openssl/crypto/ui/Makefile
+++ b/crypto/openssl/crypto/ui/Makefile
@@ -65,6 +65,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/whrlpool/Makefile b/crypto/openssl/crypto/whrlpool/Makefile
index f4d46e4..befd6d6 100644
--- a/crypto/openssl/crypto/whrlpool/Makefile
+++ b/crypto/openssl/crypto/whrlpool/Makefile
@@ -74,6 +74,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/x509/Makefile b/crypto/openssl/crypto/x509/Makefile
index 72c8227..af3c255 100644
--- a/crypto/openssl/crypto/x509/Makefile
+++ b/crypto/openssl/crypto/x509/Makefile
@@ -71,6 +71,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/x509/x509_lu.c b/crypto/openssl/crypto/x509/x509_lu.c
index a910636..8415d1d 100644
--- a/crypto/openssl/crypto/x509/x509_lu.c
+++ b/crypto/openssl/crypto/x509/x509_lu.c
@@ -216,6 +216,8 @@ X509_STORE *X509_STORE_new(void)
static void cleanup(X509_OBJECT *a)
{
+ if (!a)
+ return;
if (a->type == X509_LU_X509) {
X509_free(a->data.x509);
} else if (a->type == X509_LU_CRL) {
diff --git a/crypto/openssl/crypto/x509/x509_vfy.c b/crypto/openssl/crypto/x509/x509_vfy.c
index 136bfbd..16db4c0 100644
--- a/crypto/openssl/crypto/x509/x509_vfy.c
+++ b/crypto/openssl/crypto/x509/x509_vfy.c
@@ -151,11 +151,11 @@ static int x509_subject_cmp(X509 **a, X509 **b)
int X509_verify_cert(X509_STORE_CTX *ctx)
{
- X509 *x, *xtmp, *chain_ss = NULL;
+ X509 *x, *xtmp, *xtmp2, *chain_ss = NULL;
int bad_chain = 0;
X509_VERIFY_PARAM *param = ctx->param;
int depth, i, ok = 0;
- int num;
+ int num, j, retry;
int (*cb) (int xok, X509_STORE_CTX *xctx);
STACK_OF(X509) *sktmp = NULL;
if (ctx->cert == NULL) {
@@ -224,85 +224,118 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
break;
}
+ /* Remember how many untrusted certs we have */
+ j = num;
/*
* at this point, chain should contain a list of untrusted certificates.
* We now need to add at least one trusted one, if possible, otherwise we
* complain.
*/
- /*
- * Examine last certificate in chain and see if it is self signed.
- */
-
- i = sk_X509_num(ctx->chain);
- x = sk_X509_value(ctx->chain, i - 1);
- if (ctx->check_issued(ctx, x, x)) {
- /* we have a self signed certificate */
- if (sk_X509_num(ctx->chain) == 1) {
- /*
- * We have a single self signed certificate: see if we can find
- * it in the store. We must have an exact match to avoid possible
- * impersonation.
- */
- ok = ctx->get_issuer(&xtmp, ctx, x);
- if ((ok <= 0) || X509_cmp(x, xtmp)) {
- ctx->error = X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT;
- ctx->current_cert = x;
- ctx->error_depth = i - 1;
- if (ok == 1)
- X509_free(xtmp);
- bad_chain = 1;
- ok = cb(0, ctx);
- if (!ok)
- goto end;
+ do {
+ /*
+ * Examine last certificate in chain and see if it is self signed.
+ */
+ i = sk_X509_num(ctx->chain);
+ x = sk_X509_value(ctx->chain, i - 1);
+ if (ctx->check_issued(ctx, x, x)) {
+ /* we have a self signed certificate */
+ if (sk_X509_num(ctx->chain) == 1) {
+ /*
+ * We have a single self signed certificate: see if we can
+ * find it in the store. We must have an exact match to avoid
+ * possible impersonation.
+ */
+ ok = ctx->get_issuer(&xtmp, ctx, x);
+ if ((ok <= 0) || X509_cmp(x, xtmp)) {
+ ctx->error = X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT;
+ ctx->current_cert = x;
+ ctx->error_depth = i - 1;
+ if (ok == 1)
+ X509_free(xtmp);
+ bad_chain = 1;
+ ok = cb(0, ctx);
+ if (!ok)
+ goto end;
+ } else {
+ /*
+ * We have a match: replace certificate with store
+ * version so we get any trust settings.
+ */
+ X509_free(x);
+ x = xtmp;
+ (void)sk_X509_set(ctx->chain, i - 1, x);
+ ctx->last_untrusted = 0;
+ }
} else {
/*
- * We have a match: replace certificate with store version so
- * we get any trust settings.
+ * extract and save self signed certificate for later use
*/
- X509_free(x);
- x = xtmp;
- (void)sk_X509_set(ctx->chain, i - 1, x);
- ctx->last_untrusted = 0;
+ chain_ss = sk_X509_pop(ctx->chain);
+ ctx->last_untrusted--;
+ num--;
+ j--;
+ x = sk_X509_value(ctx->chain, num - 1);
}
- } else {
- /*
- * extract and save self signed certificate for later use
- */
- chain_ss = sk_X509_pop(ctx->chain);
- ctx->last_untrusted--;
- num--;
- x = sk_X509_value(ctx->chain, num - 1);
}
- }
-
- /* We now lookup certs from the certificate store */
- for (;;) {
- /* If we have enough, we break */
- if (depth < num)
- break;
-
- /* If we are self signed, we break */
- if (ctx->check_issued(ctx, x, x))
- break;
-
- ok = ctx->get_issuer(&xtmp, ctx, x);
+ /* We now lookup certs from the certificate store */
+ for (;;) {
+ /* If we have enough, we break */
+ if (depth < num)
+ break;
+ /* If we are self signed, we break */
+ if (ctx->check_issued(ctx, x, x))
+ break;
+ ok = ctx->get_issuer(&xtmp, ctx, x);
+ if (ok < 0)
+ return ok;
+ if (ok == 0)
+ break;
+ x = xtmp;
+ if (!sk_X509_push(ctx->chain, x)) {
+ X509_free(xtmp);
+ X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE);
+ return 0;
+ }
+ num++;
+ }
- if (ok < 0)
- return ok;
- if (ok == 0)
- break;
+ /*
+ * If we haven't got a least one certificate from our store then check
+ * if there is an alternative chain that could be used. We only do this
+ * if the user hasn't switched off alternate chain checking
+ */
+ retry = 0;
+ if (j == ctx->last_untrusted &&
+ !(ctx->param->flags & X509_V_FLAG_NO_ALT_CHAINS)) {
+ while (j-- > 1) {
+ xtmp2 = sk_X509_value(ctx->chain, j - 1);
+ ok = ctx->get_issuer(&xtmp, ctx, xtmp2);
+ if (ok < 0)
+ goto end;
+ /* Check if we found an alternate chain */
+ if (ok > 0) {
+ /*
+ * Free up the found cert we'll add it again later
+ */
+ X509_free(xtmp);
- x = xtmp;
- if (!sk_X509_push(ctx->chain, x)) {
- X509_free(xtmp);
- X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE);
- return 0;
+ /*
+ * Dump all the certs above this point - we've found an
+ * alternate chain
+ */
+ while (num > j) {
+ xtmp = sk_X509_pop(ctx->chain);
+ X509_free(xtmp);
+ num--;
+ ctx->last_untrusted--;
+ }
+ retry = 1;
+ break;
+ }
+ }
}
- num++;
- }
-
- /* we now have our chain, lets check it... */
+ } while (retry);
/* Is last certificate looked up self signed? */
if (!ctx->check_issued(ctx, x, x)) {
@@ -1604,47 +1637,84 @@ int X509_cmp_time(const ASN1_TIME *ctm, time_t *cmp_time)
ASN1_TIME atm;
long offset;
char buff1[24], buff2[24], *p;
- int i, j;
+ int i, j, remaining;
p = buff1;
- i = ctm->length;
+ remaining = ctm->length;
str = (char *)ctm->data;
+ /*
+ * Note that the following (historical) code allows much more slack in the
+ * time format than RFC5280. In RFC5280, the representation is fixed:
+ * UTCTime: YYMMDDHHMMSSZ
+ * GeneralizedTime: YYYYMMDDHHMMSSZ
+ */
if (ctm->type == V_ASN1_UTCTIME) {
- if ((i < 11) || (i > 17))
+ /* YYMMDDHHMM[SS]Z or YYMMDDHHMM[SS](+-)hhmm */
+ int min_length = sizeof("YYMMDDHHMMZ") - 1;
+ int max_length = sizeof("YYMMDDHHMMSS+hhmm") - 1;
+ if (remaining < min_length || remaining > max_length)
return 0;
memcpy(p, str, 10);
p += 10;
str += 10;
+ remaining -= 10;
} else {
- if (i < 13)
+ /* YYYYMMDDHHMM[SS[.fff]]Z or YYYYMMDDHHMM[SS[.f[f[f]]]](+-)hhmm */
+ int min_length = sizeof("YYYYMMDDHHMMZ") - 1;
+ int max_length = sizeof("YYYYMMDDHHMMSS.fff+hhmm") - 1;
+ if (remaining < min_length || remaining > max_length)
return 0;
memcpy(p, str, 12);
p += 12;
str += 12;
+ remaining -= 12;
}
if ((*str == 'Z') || (*str == '-') || (*str == '+')) {
*(p++) = '0';
*(p++) = '0';
} else {
+ /* SS (seconds) */
+ if (remaining < 2)
+ return 0;
*(p++) = *(str++);
*(p++) = *(str++);
- /* Skip any fractional seconds... */
- if (*str == '.') {
+ remaining -= 2;
+ /*
+ * Skip any (up to three) fractional seconds...
+ * TODO(emilia): in RFC5280, fractional seconds are forbidden.
+ * Can we just kill them altogether?
+ */
+ if (remaining && *str == '.') {
str++;
- while ((*str >= '0') && (*str <= '9'))
- str++;
+ remaining--;
+ for (i = 0; i < 3 && remaining; i++, str++, remaining--) {
+ if (*str < '0' || *str > '9')
+ break;
+ }
}
}
*(p++) = 'Z';
*(p++) = '\0';
- if (*str == 'Z')
+ /* We now need either a terminating 'Z' or an offset. */
+ if (!remaining)
+ return 0;
+ if (*str == 'Z') {
+ if (remaining != 1)
+ return 0;
offset = 0;
- else {
+ } else {
+ /* (+-)HHMM */
if ((*str != '+') && (*str != '-'))
return 0;
+ /* Historical behaviour: the (+-)hhmm offset is forbidden in RFC5280. */
+ if (remaining != 5)
+ return 0;
+ if (str[1] < '0' || str[1] > '9' || str[2] < '0' || str[2] > '9' ||
+ str[3] < '0' || str[3] > '9' || str[4] < '0' || str[4] > '9')
+ return 0;
offset = ((str[1] - '0') * 10 + (str[2] - '0')) * 60;
offset += (str[3] - '0') * 10 + (str[4] - '0');
if (*str == '-')
@@ -1921,6 +1991,8 @@ X509_STORE_CTX *X509_STORE_CTX_new(void)
void X509_STORE_CTX_free(X509_STORE_CTX *ctx)
{
+ if (!ctx)
+ return;
X509_STORE_CTX_cleanup(ctx);
OPENSSL_free(ctx);
}
diff --git a/crypto/openssl/crypto/x509/x509_vfy.h b/crypto/openssl/crypto/x509/x509_vfy.h
index 1f8c0ec..aacdf55 100644
--- a/crypto/openssl/crypto/x509/x509_vfy.h
+++ b/crypto/openssl/crypto/x509/x509_vfy.h
@@ -405,6 +405,12 @@ void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth);
# define X509_V_FLAG_USE_DELTAS 0x2000
/* Check selfsigned CA signature */
# define X509_V_FLAG_CHECK_SS_SIGNATURE 0x4000
+/*
+ * If the initial chain is not trusted, do not attempt to build an alternative
+ * chain. Alternate chain checking was introduced in 1.0.1n/1.0.2b. Setting
+ * this flag will force the behaviour to match that of previous versions.
+ */
+# define X509_V_FLAG_NO_ALT_CHAINS 0x100000
# define X509_VP_FLAG_DEFAULT 0x1
# define X509_VP_FLAG_OVERWRITE 0x2
diff --git a/crypto/openssl/crypto/x509/x509_vpm.c b/crypto/openssl/crypto/x509/x509_vpm.c
index d054366..6b0bf8a 100644
--- a/crypto/openssl/crypto/x509/x509_vpm.c
+++ b/crypto/openssl/crypto/x509/x509_vpm.c
@@ -100,6 +100,8 @@ X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void)
void X509_VERIFY_PARAM_free(X509_VERIFY_PARAM *param)
{
+ if (param == NULL)
+ return;
x509_verify_param_zero(param);
OPENSSL_free(param);
}
diff --git a/crypto/openssl/crypto/x509/x509type.c b/crypto/openssl/crypto/x509/x509type.c
index 0331752..9219f75 100644
--- a/crypto/openssl/crypto/x509/x509type.c
+++ b/crypto/openssl/crypto/x509/x509type.c
@@ -121,9 +121,6 @@ int X509_certificate_type(X509 *x, EVP_PKEY *pkey)
}
}
- /* /8 because it's 1024 bits we look for, not bytes */
- if (EVP_PKEY_size(pk) <= 1024 / 8)
- ret |= EVP_PKT_EXP;
if (pkey == NULL)
EVP_PKEY_free(pk);
return (ret);
diff --git a/crypto/openssl/crypto/x509v3/Makefile b/crypto/openssl/crypto/x509v3/Makefile
index 556ef35..05125ab 100644
--- a/crypto/openssl/crypto/x509v3/Makefile
+++ b/crypto/openssl/crypto/x509v3/Makefile
@@ -71,6 +71,8 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
+update: depend
+
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
diff --git a/crypto/openssl/crypto/x509v3/v3_alt.c b/crypto/openssl/crypto/x509v3/v3_alt.c
index 807867b..22ec202 100644
--- a/crypto/openssl/crypto/x509v3/v3_alt.c
+++ b/crypto/openssl/crypto/x509v3/v3_alt.c
@@ -584,24 +584,26 @@ static int do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx)
static int do_dirname(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx)
{
- int ret;
- STACK_OF(CONF_VALUE) *sk;
- X509_NAME *nm;
+ int ret = 0;
+ STACK_OF(CONF_VALUE) *sk = NULL;
+ X509_NAME *nm = NULL;
if (!(nm = X509_NAME_new()))
- return 0;
+ goto err;
sk = X509V3_get_section(ctx, value);
if (!sk) {
X509V3err(X509V3_F_DO_DIRNAME, X509V3_R_SECTION_NOT_FOUND);
ERR_add_error_data(2, "section=", value);
- X509_NAME_free(nm);
- return 0;
+ goto err;
}
/* FIXME: should allow other character types... */
ret = X509V3_NAME_from_section(nm, sk, MBSTRING_ASC);
if (!ret)
- X509_NAME_free(nm);
+ goto err;
gen->d.dirn = nm;
- X509V3_section_free(ctx, sk);
+err:
+ if (ret == 0)
+ X509_NAME_free(nm);
+ X509V3_section_free(ctx, sk);
return ret;
}
diff --git a/crypto/openssl/crypto/x509v3/v3_cpols.c b/crypto/openssl/crypto/x509v3/v3_cpols.c
index dca6ab2..0febc1b 100644
--- a/crypto/openssl/crypto/x509v3/v3_cpols.c
+++ b/crypto/openssl/crypto/x509v3/v3_cpols.c
@@ -230,11 +230,11 @@ static POLICYINFO *policy_section(X509V3_CTX *ctx,
goto merr;
if (!sk_POLICYQUALINFO_push(pol->qualifiers, qual))
goto merr;
- if(!(qual->pqualid = OBJ_nid2obj(NID_id_qt_cps))) {
+ if (!(qual->pqualid = OBJ_nid2obj(NID_id_qt_cps))) {
X509V3err(X509V3_F_POLICY_SECTION, ERR_R_INTERNAL_ERROR);
goto err;
}
- if(!(qual->d.cpsuri = M_ASN1_IA5STRING_new()))
+ if (!(qual->d.cpsuri = M_ASN1_IA5STRING_new()))
goto merr;
if (!ASN1_STRING_set(qual->d.cpsuri, cnf->value,
strlen(cnf->value)))
@@ -294,7 +294,7 @@ static POLICYQUALINFO *notice_section(X509V3_CTX *ctx,
POLICYQUALINFO *qual;
if (!(qual = POLICYQUALINFO_new()))
goto merr;
- if(!(qual->pqualid = OBJ_nid2obj(NID_id_qt_unotice))) {
+ if (!(qual->pqualid = OBJ_nid2obj(NID_id_qt_unotice))) {
X509V3err(X509V3_F_NOTICE_SECTION, ERR_R_INTERNAL_ERROR);
goto err;
}
@@ -304,7 +304,7 @@ static POLICYQUALINFO *notice_section(X509V3_CTX *ctx,
for (i = 0; i < sk_CONF_VALUE_num(unot); i++) {
cnf = sk_CONF_VALUE_value(unot, i);
if (!strcmp(cnf->name, "explicitText")) {
- if(!(not->exptext = M_ASN1_VISIBLESTRING_new()))
+ if (!(not->exptext = M_ASN1_VISIBLESTRING_new()))
goto merr;
if (!ASN1_STRING_set(not->exptext, cnf->value,
strlen(cnf->value)))
diff --git a/crypto/openssl/crypto/x509v3/v3_utl.c b/crypto/openssl/crypto/x509v3/v3_utl.c
index 65dd1e2..94aaebb 100644
--- a/crypto/openssl/crypto/x509v3/v3_utl.c
+++ b/crypto/openssl/crypto/x509v3/v3_utl.c
@@ -285,6 +285,10 @@ STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line)
int state;
/* We are going to modify the line so copy it first */
linebuf = BUF_strdup(line);
+ if (linebuf == NULL) {
+ X509V3err(X509V3_F_X509V3_PARSE_LIST, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
state = HDR_NAME;
ntmp = NULL;
/* Go through all characters */
diff --git a/crypto/openssl/doc/apps/cms.pod b/crypto/openssl/doc/apps/cms.pod
index 75b6988..9a24082 100644
--- a/crypto/openssl/doc/apps/cms.pod
+++ b/crypto/openssl/doc/apps/cms.pod
@@ -35,6 +35,7 @@ B<openssl> B<cms>
[B<-print>]
[B<-CAfile file>]
[B<-CApath dir>]
+[B<-no_alt_chains>]
[B<-md digest>]
[B<-[cipher]>]
[B<-nointern>]
@@ -406,7 +407,7 @@ portion of a message so they may be included manually. If signing
then many S/MIME mail clients check the signers certificate's email
address matches that specified in the From: address.
-=item B<-purpose, -ignore_critical, -issuer_checks, -crl_check, -crl_check_all, -policy_check, -extended_crl, -x509_strict, -policy -check_ss_sig>
+=item B<-purpose, -ignore_critical, -issuer_checks, -crl_check, -crl_check_all, -policy_check, -extended_crl, -x509_strict, -policy -check_ss_sig -no_alt_chains>
Set various certificate chain valiadition option. See the
L<B<verify>|verify(1)> manual page for details.
@@ -614,4 +615,6 @@ The use of multiple B<-signer> options and the B<-resign> command were first
added in OpenSSL 1.0.0
+The -no_alt_chains options was first added to OpenSSL 1.0.1n and 1.0.2b.
+
=cut
diff --git a/crypto/openssl/doc/apps/config.pod b/crypto/openssl/doc/apps/config.pod
index 51fff37..bdc9b46 100644
--- a/crypto/openssl/doc/apps/config.pod
+++ b/crypto/openssl/doc/apps/config.pod
@@ -277,6 +277,59 @@ priority and B</tmp> used if neither is defined:
# The above value is used if TEMP isn't in the environment
tmpfile=${ENV::TEMP}/tmp.filename
+Simple OpenSSL library configuration example to enter FIPS mode:
+
+ # Default appname: should match "appname" parameter (if any)
+ # supplied to CONF_modules_load_file et al.
+ openssl_conf = openssl_conf_section
+
+ [openssl_conf_section]
+ # Configuration module list
+ alg_section = evp_sect
+
+ [evp_sect]
+ # Set to "yes" to enter FIPS mode if supported
+ fips_mode = yes
+
+Note: in the above example you will get an error in non FIPS capable versions
+of OpenSSL.
+
+More complex OpenSSL library configuration. Add OID and don't enter FIPS mode:
+
+ # Default appname: should match "appname" parameter (if any)
+ # supplied to CONF_modules_load_file et al.
+ openssl_conf = openssl_conf_section
+
+ [openssl_conf_section]
+ # Configuration module list
+ alg_section = evp_sect
+ oid_section = new_oids
+
+ [evp_sect]
+ # This will have no effect as FIPS mode is off by default.
+ # Set to "yes" to enter FIPS mode, if supported
+ fips_mode = no
+
+ [new_oids]
+ # New OID, just short name
+ newoid1 = 1.2.3.4.1
+ # New OID shortname and long name
+ newoid2 = New OID 2 long name, 1.2.3.4.2
+
+The above examples can be used with with any application supporting library
+configuration if "openssl_conf" is modified to match the appropriate "appname".
+
+For example if the second sample file above is saved to "example.cnf" then
+the command line:
+
+ OPENSSL_CONF=example.cnf openssl asn1parse -genstr OID:1.2.3.4.1
+
+will output:
+
+ 0:d=0 hl=2 l= 4 prim: OBJECT :newoid1
+
+showing that the OID "newoid1" has been added as "1.2.3.4.1".
+
=head1 BUGS
Currently there is no way to include characters using the octal B<\nnn>
diff --git a/crypto/openssl/doc/apps/dhparam.pod b/crypto/openssl/doc/apps/dhparam.pod
index 6e27cf5..1cd4c76 100644
--- a/crypto/openssl/doc/apps/dhparam.pod
+++ b/crypto/openssl/doc/apps/dhparam.pod
@@ -71,8 +71,10 @@ check if the parameters are valid primes and generator.
=item B<-2>, B<-5>
-The generator to use, either 2 or 5. 2 is the default. If present then the
-input file is ignored and parameters are generated instead.
+The generator to use, either 2 or 5. If present then the
+input file is ignored and parameters are generated instead. If not
+present but B<numbits> is present, parameters are generated with the
+default generator 2.
=item B<-rand> I<file(s)>
@@ -85,9 +87,10 @@ all others.
=item I<numbits>
this option specifies that a parameter set should be generated of size
-I<numbits>. It must be the last option. If not present then a value of 512
-is used. If this option is present then the input file is ignored and
-parameters are generated instead.
+I<numbits>. It must be the last option. If this option is present then
+the input file is ignored and parameters are generated instead. If
+this option is not present but a generator (B<-2> or B<-5>) is
+present, parameters are generated with a default length of 2048 bits.
=item B<-noout>
diff --git a/crypto/openssl/doc/apps/ocsp.pod b/crypto/openssl/doc/apps/ocsp.pod
index 2372b37..fdb900c 100644
--- a/crypto/openssl/doc/apps/ocsp.pod
+++ b/crypto/openssl/doc/apps/ocsp.pod
@@ -29,6 +29,7 @@ B<openssl> B<ocsp>
[B<-path>]
[B<-CApath dir>]
[B<-CAfile file>]
+[B<-no_alt_chains>]]
[B<-VAfile file>]
[B<-validity_period n>]
[B<-status_age n>]
@@ -143,6 +144,10 @@ connection timeout to the OCSP responder in seconds
file or pathname containing trusted CA certificates. These are used to verify
the signature on the OCSP response.
+=item B<-no_alt_chains>
+
+See L<B<verify>|verify(1)> manual page for details.
+
=item B<-verify_other file>
file containing additional certificates to search when attempting to locate
@@ -379,3 +384,9 @@ second file.
openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA demoCA/cacert.pem
-reqin req.der -respout resp.der
+
+=head1 HISTORY
+
+The -no_alt_chains options was first added to OpenSSL 1.0.1n and 1.0.2b.
+
+=cut
diff --git a/crypto/openssl/doc/apps/s_client.pod b/crypto/openssl/doc/apps/s_client.pod
index b021c73..d92ec93 100644
--- a/crypto/openssl/doc/apps/s_client.pod
+++ b/crypto/openssl/doc/apps/s_client.pod
@@ -19,6 +19,7 @@ B<openssl> B<s_client>
[B<-pass arg>]
[B<-CApath directory>]
[B<-CAfile filename>]
+[B<-no_alt_chains>]
[B<-reconnect>]
[B<-pause>]
[B<-showcerts>]
@@ -116,7 +117,7 @@ also used when building the client certificate chain.
A file containing trusted certificates to use during server authentication
and to use when attempting to build the client certificate chain.
-=item B<-purpose, -ignore_critical, -issuer_checks, -crl_check, -crl_check_all, -policy_check, -extended_crl, -x509_strict, -policy -check_ss_sig>
+=item B<-purpose, -ignore_critical, -issuer_checks, -crl_check, -crl_check_all, -policy_check, -extended_crl, -x509_strict, -policy -check_ss_sig -no_alt_chains>
Set various certificate chain valiadition option. See the
L<B<verify>|verify(1)> manual page for details.
@@ -347,4 +348,8 @@ information whenever a session is renegotiated.
L<sess_id(1)|sess_id(1)>, L<s_server(1)|s_server(1)>, L<ciphers(1)|ciphers(1)>
+=head1 HISTORY
+
+The -no_alt_chains options was first added to OpenSSL 1.0.1n and 1.0.2b.
+
=cut
diff --git a/crypto/openssl/doc/apps/s_server.pod b/crypto/openssl/doc/apps/s_server.pod
index 2105b60..491038e 100644
--- a/crypto/openssl/doc/apps/s_server.pod
+++ b/crypto/openssl/doc/apps/s_server.pod
@@ -33,6 +33,7 @@ B<openssl> B<s_server>
[B<-state>]
[B<-CApath directory>]
[B<-CAfile filename>]
+[B<-no_alt_chains>]
[B<-nocert>]
[B<-cipher cipherlist>]
[B<-serverpref>]
@@ -178,6 +179,10 @@ and to use when attempting to build the server certificate chain. The list
is also used in the list of acceptable client CAs passed to the client when
a certificate is requested.
+=item B<-no_alt_chains>
+
+See the L<B<verify>|verify(1)> manual page for details.
+
=item B<-state>
prints out the SSL session states.
@@ -398,4 +403,8 @@ unknown cipher suites a client says it supports.
L<sess_id(1)|sess_id(1)>, L<s_client(1)|s_client(1)>, L<ciphers(1)|ciphers(1)>
+=head1 HISTORY
+
+The -no_alt_chains options was first added to OpenSSL 1.0.1n and 1.0.2b.
+
=cut
diff --git a/crypto/openssl/doc/apps/smime.pod b/crypto/openssl/doc/apps/smime.pod
index d39a59a..94a8823 100644
--- a/crypto/openssl/doc/apps/smime.pod
+++ b/crypto/openssl/doc/apps/smime.pod
@@ -15,6 +15,7 @@ B<openssl> B<smime>
[B<-pk7out>]
[B<-[cipher]>]
[B<-in file>]
+[B<-no_alt_chains>]
[B<-certfile file>]
[B<-signer file>]
[B<-recip file>]
@@ -259,7 +260,7 @@ portion of a message so they may be included manually. If signing
then many S/MIME mail clients check the signers certificate's email
address matches that specified in the From: address.
-=item B<-purpose, -ignore_critical, -issuer_checks, -crl_check, -crl_check_all, -policy_check, -extended_crl, -x509_strict, -policy -check_ss_sig>
+=item B<-purpose, -ignore_critical, -issuer_checks, -crl_check, -crl_check_all, -policy_check, -extended_crl, -x509_strict, -policy -check_ss_sig -no_alt_chains>
Set various options of certificate chain verification. See
L<B<verify>|verify(1)> manual page for details.
@@ -441,5 +442,6 @@ structures may cause parsing errors.
The use of multiple B<-signer> options and the B<-resign> command were first
added in OpenSSL 1.0.0
+The -no_alt_chains options was first added to OpenSSL 1.0.1n and 1.0.2b.
=cut
diff --git a/crypto/openssl/doc/apps/verify.pod b/crypto/openssl/doc/apps/verify.pod
index 0c8e492..18eeee0 100644
--- a/crypto/openssl/doc/apps/verify.pod
+++ b/crypto/openssl/doc/apps/verify.pod
@@ -22,6 +22,7 @@ B<openssl> B<verify>
[B<-extended_crl>]
[B<-use_deltas>]
[B<-policy_print>]
+[B<-no_alt_chains>]
[B<-untrusted file>]
[B<-help>]
[B<-issuer_checks>]
@@ -108,6 +109,14 @@ Set policy variable inhibit-any-policy (see RFC5280).
Set policy variable inhibit-policy-mapping (see RFC5280).
+=item B<-no_alt_chains>
+
+When building a certificate chain, if the first certificate chain found is not
+trusted, then OpenSSL will continue to check to see if an alternative chain can
+be found that is trusted. With this option that behaviour is suppressed so that
+only the first chain found is ever used. Using this option will force the
+behaviour to match that of previous OpenSSL versions.
+
=item B<-policy_print>
Print out diagnostics related to policy processing.
@@ -409,4 +418,8 @@ B<20 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY> error codes.
L<x509(1)|x509(1)>
+=head1 HISTORY
+
+The -no_alt_chains options was first added to OpenSSL 1.0.1n and 1.0.2b.
+
=cut
diff --git a/crypto/openssl/doc/crypto/BN_rand.pod b/crypto/openssl/doc/crypto/BN_rand.pod
index 81f93c2..3b2796c 100644
--- a/crypto/openssl/doc/crypto/BN_rand.pod
+++ b/crypto/openssl/doc/crypto/BN_rand.pod
@@ -24,7 +24,8 @@ most significant bit of the random number can be zero. If B<top> is 0,
it is set to 1, and if B<top> is 1, the two most significant bits of
the number will be set to 1, so that the product of two such random
numbers will always have 2*B<bits> length. If B<bottom> is true, the
-number will be odd.
+number will be odd. The value of B<bits> must be zero or greater. If B<bits> is
+1 then B<top> cannot also be 1.
BN_pseudo_rand() does the same, but pseudo-random numbers generated by
this function are not necessarily unpredictable. They can be used for
diff --git a/crypto/openssl/doc/crypto/BN_set_bit.pod b/crypto/openssl/doc/crypto/BN_set_bit.pod
index b7c47b9..a32cca2 100644
--- a/crypto/openssl/doc/crypto/BN_set_bit.pod
+++ b/crypto/openssl/doc/crypto/BN_set_bit.pod
@@ -37,12 +37,12 @@ BN_mask_bits() truncates B<a> to an B<n> bit number
shorter than B<n> bits.
BN_lshift() shifts B<a> left by B<n> bits and places the result in
-B<r> (C<r=a*2^n>). BN_lshift1() shifts B<a> left by one and places
-the result in B<r> (C<r=2*a>).
+B<r> (C<r=a*2^n>). Note that B<n> must be non-negative. BN_lshift1() shifts
+B<a> left by one and places the result in B<r> (C<r=2*a>).
BN_rshift() shifts B<a> right by B<n> bits and places the result in
-B<r> (C<r=a/2^n>). BN_rshift1() shifts B<a> right by one and places
-the result in B<r> (C<r=a/2>).
+B<r> (C<r=a/2^n>). Note that B<n> must be non-negative. BN_rshift1() shifts
+B<a> right by one and places the result in B<r> (C<r=a/2>).
For the shift functions, B<r> and B<a> may be the same variable.
diff --git a/crypto/openssl/doc/crypto/X509_VERIFY_PARAM_set_flags.pod b/crypto/openssl/doc/crypto/X509_VERIFY_PARAM_set_flags.pod
index 46cac2b..9d86d46 100644
--- a/crypto/openssl/doc/crypto/X509_VERIFY_PARAM_set_flags.pod
+++ b/crypto/openssl/doc/crypto/X509_VERIFY_PARAM_set_flags.pod
@@ -133,6 +133,12 @@ verification. If this flag is set then additional status codes will be sent
to the verification callback and it B<must> be prepared to handle such cases
without assuming they are hard errors.
+The B<X509_V_FLAG_NO_ALT_CHAINS> flag suppresses checking for alternative
+chains. By default, when building a certificate chain, if the first certificate
+chain found is not trusted, then OpenSSL will continue to check to see if an
+alternative chain can be found that is trusted. With this flag set the behaviour
+will match that of OpenSSL versions prior to 1.0.1n and 1.0.2b.
+
=head1 NOTES
The above functions should be used to manipulate verification parameters
@@ -166,6 +172,6 @@ L<X509_verify_cert(3)|X509_verify_cert(3)>
=head1 HISTORY
-TBA
+The B<X509_V_FLAG_NO_ALT_CHAINS> flag was added in OpenSSL 1.0.1n and 1.0.2b
=cut
diff --git a/crypto/openssl/doc/crypto/pem.pod b/crypto/openssl/doc/crypto/pem.pod
index 21e9fe3..763eb6f 100644
--- a/crypto/openssl/doc/crypto/pem.pod
+++ b/crypto/openssl/doc/crypto/pem.pod
@@ -2,7 +2,29 @@
=head1 NAME
-PEM, PEM_read_bio_PrivateKey, PEM_read_PrivateKey, PEM_write_bio_PrivateKey, PEM_write_PrivateKey, PEM_write_bio_PKCS8PrivateKey, PEM_write_PKCS8PrivateKey, PEM_write_bio_PKCS8PrivateKey_nid, PEM_write_PKCS8PrivateKey_nid, PEM_read_bio_PUBKEY, PEM_read_PUBKEY, PEM_write_bio_PUBKEY, PEM_write_PUBKEY, PEM_read_bio_RSAPrivateKey, PEM_read_RSAPrivateKey, PEM_write_bio_RSAPrivateKey, PEM_write_RSAPrivateKey, PEM_read_bio_RSAPublicKey, PEM_read_RSAPublicKey, PEM_write_bio_RSAPublicKey, PEM_write_RSAPublicKey, PEM_read_bio_RSA_PUBKEY, PEM_read_RSA_PUBKEY, PEM_write_bio_RSA_PUBKEY, PEM_write_RSA_PUBKEY, PEM_read_bio_DSAPrivateKey, PEM_read_DSAPrivateKey, PEM_write_bio_DSAPrivateKey, PEM_write_DSAPrivateKey, PEM_read_bio_DSA_PUBKEY, PEM_read_DSA_PUBKEY, PEM_write_bio_DSA_PUBKEY, PEM_write_DSA_PUBKEY, PEM_read_bio_DSAparams, PEM_read_DSAparams, PEM_write_bio_DSAparams, PEM_write_DSAparams, PEM_read_bio_DHparams, PEM_read_DHparams, PEM_write_bio_DHparams, PEM_write_DHparams, PEM_read_bio_X509, PEM_read_X509, PEM_write_bio_X509, PEM_write_X509, PEM_read_bio_X509_AUX, PEM_read_X509_AUX, PEM_write_bio_X509_AUX, PEM_write_X509_AUX, PEM_read_bio_X509_REQ, PEM_read_X509_REQ, PEM_write_bio_X509_REQ, PEM_write_X509_REQ, PEM_write_bio_X509_REQ_NEW, PEM_write_X509_REQ_NEW, PEM_read_bio_X509_CRL, PEM_read_X509_CRL, PEM_write_bio_X509_CRL, PEM_write_X509_CRL, PEM_read_bio_PKCS7, PEM_read_PKCS7, PEM_write_bio_PKCS7, PEM_write_PKCS7, PEM_read_bio_NETSCAPE_CERT_SEQUENCE, PEM_read_NETSCAPE_CERT_SEQUENCE, PEM_write_bio_NETSCAPE_CERT_SEQUENCE, PEM_write_NETSCAPE_CERT_SEQUENCE - PEM routines
+PEM, PEM_read_bio_PrivateKey, PEM_read_PrivateKey, PEM_write_bio_PrivateKey,
+PEM_write_PrivateKey, PEM_write_bio_PKCS8PrivateKey, PEM_write_PKCS8PrivateKey,
+PEM_write_bio_PKCS8PrivateKey_nid, PEM_write_PKCS8PrivateKey_nid,
+PEM_read_bio_PUBKEY, PEM_read_PUBKEY, PEM_write_bio_PUBKEY, PEM_write_PUBKEY,
+PEM_read_bio_RSAPrivateKey, PEM_read_RSAPrivateKey,
+PEM_write_bio_RSAPrivateKey, PEM_write_RSAPrivateKey,
+PEM_read_bio_RSAPublicKey, PEM_read_RSAPublicKey, PEM_write_bio_RSAPublicKey,
+PEM_write_RSAPublicKey, PEM_read_bio_RSA_PUBKEY, PEM_read_RSA_PUBKEY,
+PEM_write_bio_RSA_PUBKEY, PEM_write_RSA_PUBKEY, PEM_read_bio_DSAPrivateKey,
+PEM_read_DSAPrivateKey, PEM_write_bio_DSAPrivateKey, PEM_write_DSAPrivateKey,
+PEM_read_bio_DSA_PUBKEY, PEM_read_DSA_PUBKEY, PEM_write_bio_DSA_PUBKEY,
+PEM_write_DSA_PUBKEY, PEM_read_bio_DSAparams, PEM_read_DSAparams,
+PEM_write_bio_DSAparams, PEM_write_DSAparams, PEM_read_bio_DHparams,
+PEM_read_DHparams, PEM_write_bio_DHparams, PEM_write_DHparams,
+PEM_read_bio_X509, PEM_read_X509, PEM_write_bio_X509, PEM_write_X509,
+PEM_read_bio_X509_AUX, PEM_read_X509_AUX, PEM_write_bio_X509_AUX,
+PEM_write_X509_AUX, PEM_read_bio_X509_REQ, PEM_read_X509_REQ,
+PEM_write_bio_X509_REQ, PEM_write_X509_REQ, PEM_write_bio_X509_REQ_NEW,
+PEM_write_X509_REQ_NEW, PEM_read_bio_X509_CRL, PEM_read_X509_CRL,
+PEM_write_bio_X509_CRL, PEM_write_X509_CRL, PEM_read_bio_PKCS7, PEM_read_PKCS7,
+PEM_write_bio_PKCS7, PEM_write_PKCS7, PEM_read_bio_NETSCAPE_CERT_SEQUENCE,
+PEM_read_NETSCAPE_CERT_SEQUENCE, PEM_write_bio_NETSCAPE_CERT_SEQUENCE,
+PEM_write_NETSCAPE_CERT_SEQUENCE - PEM routines
=head1 SYNOPSIS
@@ -239,7 +261,8 @@ SubjectPublicKeyInfo structure and an error occurs if the public
key is not DSA.
The B<DSAparams> functions process DSA parameters using a DSA
-structure. The parameters are encoded using a foobar structure.
+structure. The parameters are encoded using a Dss-Parms structure
+as defined in RFC2459.
The B<DHparams> functions process DH parameters using a DH
structure. The parameters are encoded using a PKCS#3 DHparameter
diff --git a/crypto/openssl/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod b/crypto/openssl/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod
index 7a27eef..b754c16 100644
--- a/crypto/openssl/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod
+++ b/crypto/openssl/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod
@@ -61,12 +61,12 @@ negotiation is being saved.
If "strong" primes were used to generate the DH parameters, it is not strictly
necessary to generate a new key for each handshake but it does improve forward
-secrecy. If it is not assured, that "strong" primes were used (see especially
-the section about DSA parameters below), SSL_OP_SINGLE_DH_USE must be used
-in order to prevent small subgroup attacks. Always using SSL_OP_SINGLE_DH_USE
-has an impact on the computer time needed during negotiation, but it is not
-very large, so application authors/users should consider to always enable
-this option.
+secrecy. If it is not assured that "strong" primes were used,
+SSL_OP_SINGLE_DH_USE must be used in order to prevent small subgroup
+attacks. Always using SSL_OP_SINGLE_DH_USE has an impact on the
+computer time needed during negotiation, but it is not very large, so
+application authors/users should consider always enabling this option.
+The option is required to implement perfect forward secrecy (PFS).
As generating DH parameters is extremely time consuming, an application
should not generate the parameters on the fly but supply the parameters.
@@ -74,82 +74,62 @@ DH parameters can be reused, as the actual key is newly generated during
the negotiation. The risk in reusing DH parameters is that an attacker
may specialize on a very often used DH group. Applications should therefore
generate their own DH parameters during the installation process using the
-openssl L<dhparam(1)|dhparam(1)> application. In order to reduce the computer
-time needed for this generation, it is possible to use DSA parameters
-instead (see L<dhparam(1)|dhparam(1)>), but in this case SSL_OP_SINGLE_DH_USE
-is mandatory.
+openssl L<dhparam(1)|dhparam(1)> application. This application
+guarantees that "strong" primes are used.
-Application authors may compile in DH parameters. Files dh512.pem,
-dh1024.pem, dh2048.pem, and dh4096.pem in the 'apps' directory of current
+Files dh2048.pem, and dh4096.pem in the 'apps' directory of the current
version of the OpenSSL distribution contain the 'SKIP' DH parameters,
which use safe primes and were generated verifiably pseudo-randomly.
These files can be converted into C code using the B<-C> option of the
-L<dhparam(1)|dhparam(1)> application.
-Authors may also generate their own set of parameters using
-L<dhparam(1)|dhparam(1)>, but a user may not be sure how the parameters were
-generated. The generation of DH parameters during installation is therefore
-recommended.
+L<dhparam(1)|dhparam(1)> application. Generation of custom DH
+parameters during installation should still be preferred to stop an
+attacker from specializing on a commonly used group. Files dh1024.pem
+and dh512.pem contain old parameters that must not be used by
+applications.
An application may either directly specify the DH parameters or
-can supply the DH parameters via a callback function. The callback approach
-has the advantage, that the callback may supply DH parameters for different
-key lengths.
+can supply the DH parameters via a callback function.
-The B<tmp_dh_callback> is called with the B<keylength> needed and
-the B<is_export> information. The B<is_export> flag is set, when the
-ephemeral DH key exchange is performed with an export cipher.
+Previous versions of the callback used B<is_export> and B<keylength>
+parameters to control parameter generation for export and non-export
+cipher suites. Modern servers that do not support export ciphersuites
+are advised to either use SSL_CTX_set_tmp_dh() in combination with
+SSL_OP_SINGLE_DH_USE, or alternatively, use the callback but ignore
+B<keylength> and B<is_export> and simply supply at least 2048-bit
+parameters in the callback.
=head1 EXAMPLES
-Handle DH parameters for key lengths of 512 and 1024 bits. (Error handling
+Setup DH parameters with a key length of 2048 bits. (Error handling
partly left out.)
- ...
- /* Set up ephemeral DH stuff */
- DH *dh_512 = NULL;
- DH *dh_1024 = NULL;
- FILE *paramfile;
+ Command-line parameter generation:
+ $ openssl dhparam -out dh_param_2048.pem 2048
+
+ Code for setting up parameters during server initialization:
...
- /* "openssl dhparam -out dh_param_512.pem -2 512" */
- paramfile = fopen("dh_param_512.pem", "r");
+ SSL_CTX ctx = SSL_CTX_new();
+ ...
+
+ /* Set up ephemeral DH parameters. */
+ DH *dh_2048 = NULL;
+ FILE *paramfile;
+ paramfile = fopen("dh_param_2048.pem", "r");
if (paramfile) {
- dh_512 = PEM_read_DHparams(paramfile, NULL, NULL, NULL);
+ dh_2048 = PEM_read_DHparams(paramfile, NULL, NULL, NULL);
fclose(paramfile);
+ } else {
+ /* Error. */
}
- /* "openssl dhparam -out dh_param_1024.pem -2 1024" */
- paramfile = fopen("dh_param_1024.pem", "r");
- if (paramfile) {
- dh_1024 = PEM_read_DHparams(paramfile, NULL, NULL, NULL);
- fclose(paramfile);
+ if (dh_2048 == NULL) {
+ /* Error. */
}
- ...
-
- /* "openssl dhparam -C -2 512" etc... */
- DH *get_dh512() { ... }
- DH *get_dh1024() { ... }
-
- DH *tmp_dh_callback(SSL *s, int is_export, int keylength)
- {
- DH *dh_tmp=NULL;
-
- switch (keylength) {
- case 512:
- if (!dh_512)
- dh_512 = get_dh512();
- dh_tmp = dh_512;
- break;
- case 1024:
- if (!dh_1024)
- dh_1024 = get_dh1024();
- dh_tmp = dh_1024;
- break;
- default:
- /* Generating a key on the fly is very costly, so use what is there */
- setup_dh_parameters_like_above();
- }
- return(dh_tmp);
+ if (SSL_CTX_set_tmp_dh(ctx, dh_2048) != 1) {
+ /* Error. */
}
+ SSL_CTX_set_options(ctx, SSL_OP_SINGLE_DH_USE);
+ ...
=head1 RETURN VALUES
diff --git a/crypto/openssl/e_os2.h b/crypto/openssl/e_os2.h
index d400ac7..2b1b78f 100644
--- a/crypto/openssl/e_os2.h
+++ b/crypto/openssl/e_os2.h
@@ -109,6 +109,12 @@ extern "C" {
# undef OPENSSL_SYS_UNIX
# define OPENSSL_SYS_WIN32
# endif
+# if defined(_WIN64) || defined(OPENSSL_SYSNAME_WIN64)
+# undef OPENSSL_SYS_UNIX
+# if !defined(OPENSSL_SYS_WIN64)
+# define OPENSSL_SYS_WIN64
+# endif
+# endif
# if defined(OPENSSL_SYSNAME_WINNT)
# undef OPENSSL_SYS_UNIX
# define OPENSSL_SYS_WINNT
@@ -121,7 +127,7 @@ extern "C" {
# endif
/* Anything that tries to look like Microsoft is "Windows" */
-# if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WINNT) || defined(OPENSSL_SYS_WINCE)
+# if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN64) || defined(OPENSSL_SYS_WINNT) || defined(OPENSSL_SYS_WINCE)
# undef OPENSSL_SYS_UNIX
# define OPENSSL_SYS_WINDOWS
# ifndef OPENSSL_SYS_MSDOS
diff --git a/crypto/openssl/engines/Makefile b/crypto/openssl/engines/Makefile
index 2fa9534..23bd2f3 100644
--- a/crypto/openssl/engines/Makefile
+++ b/crypto/openssl/engines/Makefile
@@ -146,12 +146,15 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
@target=lint; $(RECURSIVE_MAKE)
-depend:
- @if [ -z "$(THIS)" ]; then \
- $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; \
- fi
- @[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
+update: local_depend
+ @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
+ @[ -z "$(THIS)" ] || (set -e; target=update; $(RECURSIVE_MAKE) )
+
+depend: local_depend
+ @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
@[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) )
+local_depend:
+ @[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
diff --git a/crypto/openssl/engines/ccgost/Makefile b/crypto/openssl/engines/ccgost/Makefile
index d661c10..4e183a4 100644
--- a/crypto/openssl/engines/ccgost/Makefile
+++ b/crypto/openssl/engines/ccgost/Makefile
@@ -66,12 +66,13 @@ links:
tests:
-depend:
- @if [ -z "$(THIS)" ]; then \
- $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; \
- else \
- $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC); \
- fi
+update: local_depend
+ @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
+
+depend: local_depend
+ @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
+local_depend:
+ @[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
files:
@@ -262,8 +263,9 @@ gost_sign.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
gost_sign.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
gost_sign.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
gost_sign.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
-gost_sign.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
-gost_sign.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
+gost_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h
+gost_sign.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
+gost_sign.o: ../../include/openssl/objects.h
gost_sign.o: ../../include/openssl/opensslconf.h
gost_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
gost_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
diff --git a/crypto/openssl/engines/ccgost/e_gost_err.c b/crypto/openssl/engines/ccgost/e_gost_err.c
index 3201b64..80ef58f 100644
--- a/crypto/openssl/engines/ccgost/e_gost_err.c
+++ b/crypto/openssl/engines/ccgost/e_gost_err.c
@@ -1,6 +1,6 @@
/* e_gost_err.c */
/* ====================================================================
- * Copyright (c) 1999-2009 The OpenSSL Project. All rights reserved.
+ * Copyright (c) 1999-2015 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -90,6 +90,7 @@ static ERR_STRING_DATA GOST_str_functs[] = {
{ERR_FUNC(GOST_F_GOST_IMIT_CTRL), "GOST_IMIT_CTRL"},
{ERR_FUNC(GOST_F_GOST_IMIT_FINAL), "GOST_IMIT_FINAL"},
{ERR_FUNC(GOST_F_GOST_IMIT_UPDATE), "GOST_IMIT_UPDATE"},
+ {ERR_FUNC(GOST_F_GOST_SIGN_KEYGEN), "GOST_SIGN_KEYGEN"},
{ERR_FUNC(GOST_F_PARAM_COPY_GOST01), "PARAM_COPY_GOST01"},
{ERR_FUNC(GOST_F_PARAM_COPY_GOST94), "PARAM_COPY_GOST94"},
{ERR_FUNC(GOST_F_PKEY_GOST01CP_DECRYPT), "PKEY_GOST01CP_DECRYPT"},
diff --git a/crypto/openssl/engines/ccgost/e_gost_err.h b/crypto/openssl/engines/ccgost/e_gost_err.h
index 92be558..a2018ec 100644
--- a/crypto/openssl/engines/ccgost/e_gost_err.h
+++ b/crypto/openssl/engines/ccgost/e_gost_err.h
@@ -90,6 +90,7 @@ void ERR_GOST_error(int function, int reason, char *file, int line);
# define GOST_F_GOST_IMIT_CTRL 114
# define GOST_F_GOST_IMIT_FINAL 140
# define GOST_F_GOST_IMIT_UPDATE 115
+# define GOST_F_GOST_SIGN_KEYGEN 142
# define GOST_F_PARAM_COPY_GOST01 116
# define GOST_F_PARAM_COPY_GOST94 117
# define GOST_F_PKEY_GOST01CP_DECRYPT 118
diff --git a/crypto/openssl/engines/ccgost/gost2001.c b/crypto/openssl/engines/ccgost/gost2001.c
index 2b96694..9536295 100644
--- a/crypto/openssl/engines/ccgost/gost2001.c
+++ b/crypto/openssl/engines/ccgost/gost2001.c
@@ -41,6 +41,11 @@ int fill_GOST2001_params(EC_KEY *eckey, int nid)
BN_CTX *ctx = BN_CTX_new();
int ok = 0;
+ if(!ctx) {
+ GOSTerr(GOST_F_FILL_GOST2001_PARAMS, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
+
BN_CTX_start(ctx);
p = BN_CTX_get(ctx);
a = BN_CTX_get(ctx);
@@ -48,6 +53,10 @@ int fill_GOST2001_params(EC_KEY *eckey, int nid)
x = BN_CTX_get(ctx);
y = BN_CTX_get(ctx);
q = BN_CTX_get(ctx);
+ if(!p || !a || !b || !x || !y || !q) {
+ GOSTerr(GOST_F_FILL_GOST2001_PARAMS, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
while (params->nid != NID_undef && params->nid != nid)
params++;
if (params->nid == NID_undef) {
@@ -55,18 +64,33 @@ int fill_GOST2001_params(EC_KEY *eckey, int nid)
GOST_R_UNSUPPORTED_PARAMETER_SET);
goto err;
}
- BN_hex2bn(&p, params->p);
- BN_hex2bn(&a, params->a);
- BN_hex2bn(&b, params->b);
+ if(!BN_hex2bn(&p, params->p)
+ || !BN_hex2bn(&a, params->a)
+ || !BN_hex2bn(&b, params->b)) {
+ GOSTerr(GOST_F_FILL_GOST2001_PARAMS,
+ ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
grp = EC_GROUP_new_curve_GFp(p, a, b, ctx);
+ if(!grp) {
+ GOSTerr(GOST_F_FILL_GOST2001_PARAMS, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
P = EC_POINT_new(grp);
+ if(!P) {
+ GOSTerr(GOST_F_FILL_GOST2001_PARAMS, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
- BN_hex2bn(&x, params->x);
- BN_hex2bn(&y, params->y);
- EC_POINT_set_affine_coordinates_GFp(grp, P, x, y, ctx);
- BN_hex2bn(&q, params->q);
+ if(!BN_hex2bn(&x, params->x)
+ || !BN_hex2bn(&y, params->y)
+ || !EC_POINT_set_affine_coordinates_GFp(grp, P, x, y, ctx)
+ || !BN_hex2bn(&q, params->q)) {
+ GOSTerr(GOST_F_FILL_GOST2001_PARAMS, ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
#ifdef DEBUG_KEYS
fprintf(stderr, "Set params index %d oid %s\nq=",
(params - R3410_2001_paramset), OBJ_nid2sn(params->nid));
@@ -74,16 +98,23 @@ int fill_GOST2001_params(EC_KEY *eckey, int nid)
fprintf(stderr, "\n");
#endif
- EC_GROUP_set_generator(grp, P, q, NULL);
+ if(!EC_GROUP_set_generator(grp, P, q, NULL)) {
+ GOSTerr(GOST_F_FILL_GOST2001_PARAMS, ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
EC_GROUP_set_curve_name(grp, params->nid);
-
- EC_KEY_set_group(eckey, grp);
+ if(!EC_KEY_set_group(eckey, grp)) {
+ GOSTerr(GOST_F_FILL_GOST2001_PARAMS, ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
ok = 1;
err:
- EC_POINT_free(P);
- EC_GROUP_free(grp);
- BN_CTX_end(ctx);
- BN_CTX_free(ctx);
+ if (P) EC_POINT_free(P);
+ if (grp) EC_GROUP_free(grp);
+ if (ctx) {
+ BN_CTX_end(ctx);
+ BN_CTX_free(ctx);
+ }
return ok;
}
@@ -94,7 +125,7 @@ int fill_GOST2001_params(EC_KEY *eckey, int nid)
*/
DSA_SIG *gost2001_do_sign(const unsigned char *dgst, int dlen, EC_KEY *eckey)
{
- DSA_SIG *newsig = NULL;
+ DSA_SIG *newsig = NULL, *ret = NULL;
BIGNUM *md = hashsum2bn(dgst);
BIGNUM *order = NULL;
const EC_GROUP *group;
@@ -103,6 +134,10 @@ DSA_SIG *gost2001_do_sign(const unsigned char *dgst, int dlen, EC_KEY *eckey)
NULL, *e = NULL;
EC_POINT *C = NULL;
BN_CTX *ctx = BN_CTX_new();
+ if(!ctx || !md) {
+ GOSTerr(GOST_F_GOST2001_DO_SIGN, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
BN_CTX_start(ctx);
OPENSSL_assert(dlen == 32);
newsig = DSA_SIG_new();
@@ -111,11 +146,25 @@ DSA_SIG *gost2001_do_sign(const unsigned char *dgst, int dlen, EC_KEY *eckey)
goto err;
}
group = EC_KEY_get0_group(eckey);
+ if(!group) {
+ GOSTerr(GOST_F_GOST2001_DO_SIGN, ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
order = BN_CTX_get(ctx);
- EC_GROUP_get_order(group, order, ctx);
+ if(!order || !EC_GROUP_get_order(group, order, ctx)) {
+ GOSTerr(GOST_F_GOST2001_DO_SIGN, ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
priv_key = EC_KEY_get0_private_key(eckey);
+ if(!priv_key) {
+ GOSTerr(GOST_F_GOST2001_DO_SIGN, ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
e = BN_CTX_get(ctx);
- BN_mod(e, md, order, ctx);
+ if(!e || !BN_mod(e, md, order, ctx)) {
+ GOSTerr(GOST_F_GOST2001_DO_SIGN, ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
#ifdef DEBUG_SIGN
fprintf(stderr, "digest as bignum=");
BN_print_fp(stderr, md);
@@ -128,55 +177,80 @@ DSA_SIG *gost2001_do_sign(const unsigned char *dgst, int dlen, EC_KEY *eckey)
}
k = BN_CTX_get(ctx);
C = EC_POINT_new(group);
+ if(!k || !C) {
+ GOSTerr(GOST_F_GOST2001_DO_SIGN, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
do {
do {
if (!BN_rand_range(k, order)) {
GOSTerr(GOST_F_GOST2001_DO_SIGN,
GOST_R_RANDOM_NUMBER_GENERATOR_FAILED);
- DSA_SIG_free(newsig);
- newsig = NULL;
goto err;
}
if (!EC_POINT_mul(group, C, k, NULL, NULL, ctx)) {
GOSTerr(GOST_F_GOST2001_DO_SIGN, ERR_R_EC_LIB);
- DSA_SIG_free(newsig);
- newsig = NULL;
goto err;
}
if (!X)
X = BN_CTX_get(ctx);
+ if (!r)
+ r = BN_CTX_get(ctx);
+ if (!X || !r) {
+ GOSTerr(GOST_F_GOST2001_DO_SIGN, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
if (!EC_POINT_get_affine_coordinates_GFp(group, C, X, NULL, ctx)) {
GOSTerr(GOST_F_GOST2001_DO_SIGN, ERR_R_EC_LIB);
- DSA_SIG_free(newsig);
- newsig = NULL;
goto err;
}
- if (!r)
- r = BN_CTX_get(ctx);
- BN_nnmod(r, X, order, ctx);
+
+ if(!BN_nnmod(r, X, order, ctx)) {
+ GOSTerr(GOST_F_GOST2001_DO_SIGN, ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
}
while (BN_is_zero(r));
/* s = (r*priv_key+k*e) mod order */
if (!tmp)
tmp = BN_CTX_get(ctx);
- BN_mod_mul(tmp, priv_key, r, order, ctx);
if (!tmp2)
tmp2 = BN_CTX_get(ctx);
- BN_mod_mul(tmp2, k, e, order, ctx);
if (!s)
s = BN_CTX_get(ctx);
- BN_mod_add(s, tmp, tmp2, order, ctx);
+ if (!tmp || !tmp2 || !s) {
+ GOSTerr(GOST_F_GOST2001_DO_SIGN, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
+
+ if(!BN_mod_mul(tmp, priv_key, r, order, ctx)
+ || !BN_mod_mul(tmp2, k, e, order, ctx)
+ || !BN_mod_add(s, tmp, tmp2, order, ctx)) {
+ GOSTerr(GOST_F_GOST2001_DO_SIGN, ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
}
while (BN_is_zero(s));
newsig->s = BN_dup(s);
newsig->r = BN_dup(r);
+ if(!newsig->s || !newsig->r) {
+ GOSTerr(GOST_F_GOST2001_DO_SIGN, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
+
+ ret = newsig;
err:
- BN_CTX_end(ctx);
- BN_CTX_free(ctx);
- EC_POINT_free(C);
- BN_free(md);
- return newsig;
+ if(ctx) {
+ BN_CTX_end(ctx);
+ BN_CTX_free(ctx);
+ }
+ if (C) EC_POINT_free(C);
+ if (md) BN_free(md);
+ if (!ret && newsig) {
+ DSA_SIG_free(newsig);
+ }
+ return ret;
}
/*
@@ -196,6 +270,11 @@ int gost2001_do_verify(const unsigned char *dgst, int dgst_len,
const EC_POINT *pub_key = NULL;
int ok = 0;
+ if(!ctx || !group) {
+ GOSTerr(GOST_F_GOST2001_DO_VERIFY, ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
+
BN_CTX_start(ctx);
order = BN_CTX_get(ctx);
e = BN_CTX_get(ctx);
@@ -205,9 +284,17 @@ int gost2001_do_verify(const unsigned char *dgst, int dgst_len,
X = BN_CTX_get(ctx);
R = BN_CTX_get(ctx);
v = BN_CTX_get(ctx);
+ if(!order || !e || !z1 || !z2 || !tmp || !X || !R || !v) {
+ GOSTerr(GOST_F_GOST2001_DO_VERIFY, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
- EC_GROUP_get_order(group, order, ctx);
pub_key = EC_KEY_get0_public_key(ec);
+ if(!pub_key || !EC_GROUP_get_order(group, order, ctx)) {
+ GOSTerr(GOST_F_GOST2001_DO_VERIFY, ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
+
if (BN_is_zero(sig->s) || BN_is_zero(sig->r) ||
(BN_cmp(sig->s, order) >= 1) || (BN_cmp(sig->r, order) >= 1)) {
GOSTerr(GOST_F_GOST2001_DO_VERIFY,
@@ -217,19 +304,28 @@ int gost2001_do_verify(const unsigned char *dgst, int dgst_len,
}
md = hashsum2bn(dgst);
- BN_mod(e, md, order, ctx);
+ if(!md || !BN_mod(e, md, order, ctx)) {
+ GOSTerr(GOST_F_GOST2001_DO_VERIFY, ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
#ifdef DEBUG_SIGN
fprintf(stderr, "digest as bignum: ");
BN_print_fp(stderr, md);
fprintf(stderr, "\ndigest mod q: ");
BN_print_fp(stderr, e);
#endif
- if (BN_is_zero(e))
- BN_one(e);
+ if (BN_is_zero(e) && !BN_one(e)) {
+ GOSTerr(GOST_F_GOST2001_DO_VERIFY, ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
v = BN_mod_inverse(v, e, order, ctx);
- BN_mod_mul(z1, sig->s, v, order, ctx);
- BN_sub(tmp, order, sig->r);
- BN_mod_mul(z2, tmp, v, order, ctx);
+ if(!v
+ || !BN_mod_mul(z1, sig->s, v, order, ctx)
+ || !BN_sub(tmp, order, sig->r)
+ || !BN_mod_mul(z2, tmp, v, order, ctx)) {
+ GOSTerr(GOST_F_GOST2001_DO_VERIFY, ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
#ifdef DEBUG_SIGN
fprintf(stderr, "\nInverted digest value: ");
BN_print_fp(stderr, v);
@@ -239,6 +335,10 @@ int gost2001_do_verify(const unsigned char *dgst, int dgst_len,
BN_print_fp(stderr, z2);
#endif
C = EC_POINT_new(group);
+ if (!C) {
+ GOSTerr(GOST_F_GOST2001_DO_VERIFY, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
if (!EC_POINT_mul(group, C, z1, pub_key, z2, ctx)) {
GOSTerr(GOST_F_GOST2001_DO_VERIFY, ERR_R_EC_LIB);
goto err;
@@ -247,7 +347,10 @@ int gost2001_do_verify(const unsigned char *dgst, int dgst_len,
GOSTerr(GOST_F_GOST2001_DO_VERIFY, ERR_R_EC_LIB);
goto err;
}
- BN_mod(R, X, order, ctx);
+ if(!BN_mod(R, X, order, ctx)) {
+ GOSTerr(GOST_F_GOST2001_DO_VERIFY, ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
#ifdef DEBUG_SIGN
fprintf(stderr, "\nX=");
BN_print_fp(stderr, X);
@@ -261,10 +364,12 @@ int gost2001_do_verify(const unsigned char *dgst, int dgst_len,
ok = 1;
}
err:
- EC_POINT_free(C);
- BN_CTX_end(ctx);
- BN_CTX_free(ctx);
- BN_free(md);
+ if (C) EC_POINT_free(C);
+ if (ctx) {
+ BN_CTX_end(ctx);
+ BN_CTX_free(ctx);
+ }
+ if (md) BN_free(md);
return ok;
}
@@ -287,6 +392,10 @@ int gost2001_compute_public(EC_KEY *ec)
return 0;
}
ctx = BN_CTX_new();
+ if(!ctx) {
+ GOSTerr(GOST_F_GOST2001_COMPUTE_PUBLIC, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
BN_CTX_start(ctx);
if (!(priv_key = EC_KEY_get0_private_key(ec))) {
GOSTerr(GOST_F_GOST2001_COMPUTE_PUBLIC, ERR_R_EC_LIB);
@@ -294,6 +403,10 @@ int gost2001_compute_public(EC_KEY *ec)
}
pub_key = EC_POINT_new(group);
+ if(!pub_key) {
+ GOSTerr(GOST_F_GOST2001_COMPUTE_PUBLIC, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
if (!EC_POINT_mul(group, pub_key, priv_key, NULL, NULL, ctx)) {
GOSTerr(GOST_F_GOST2001_COMPUTE_PUBLIC, ERR_R_EC_LIB);
goto err;
@@ -304,9 +417,11 @@ int gost2001_compute_public(EC_KEY *ec)
}
ok = 256;
err:
- BN_CTX_end(ctx);
- EC_POINT_free(pub_key);
- BN_CTX_free(ctx);
+ if (pub_key) EC_POINT_free(pub_key);
+ if (ctx) {
+ BN_CTX_end(ctx);
+ BN_CTX_free(ctx);
+ }
return ok;
}
@@ -320,7 +435,13 @@ int gost2001_keygen(EC_KEY *ec)
{
BIGNUM *order = BN_new(), *d = BN_new();
const EC_GROUP *group = EC_KEY_get0_group(ec);
- EC_GROUP_get_order(group, order, NULL);
+
+ if(!group || !EC_GROUP_get_order(group, order, NULL)) {
+ GOSTerr(GOST_F_GOST2001_KEYGEN, ERR_R_INTERNAL_ERROR);
+ BN_free(d);
+ BN_free(order);
+ return 0;
+ }
do {
if (!BN_rand_range(d, order)) {
@@ -332,7 +453,13 @@ int gost2001_keygen(EC_KEY *ec)
}
}
while (BN_is_zero(d));
- EC_KEY_set_private_key(ec, d);
+
+ if(!EC_KEY_set_private_key(ec, d)) {
+ GOSTerr(GOST_F_GOST2001_KEYGEN, ERR_R_INTERNAL_ERROR);
+ BN_free(d);
+ BN_free(order);
+ return 0;
+ }
BN_free(d);
BN_free(order);
return gost2001_compute_public(ec);
diff --git a/crypto/openssl/engines/ccgost/gost94_keyx.c b/crypto/openssl/engines/ccgost/gost94_keyx.c
index 85f4bc8..ce57f17 100644
--- a/crypto/openssl/engines/ccgost/gost94_keyx.c
+++ b/crypto/openssl/engines/ccgost/gost94_keyx.c
@@ -104,6 +104,7 @@ int pkey_GOST94cp_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out,
struct gost_pmeth_data *data = EVP_PKEY_CTX_get_data(ctx);
gost_ctx cctx;
int key_is_ephemeral = 1;
+ int tmp_outlen;
EVP_PKEY *mykey = EVP_PKEY_CTX_get0_peerkey(ctx);
/* Do not use vizir cipher parameters with cryptopro */
@@ -174,12 +175,13 @@ int pkey_GOST94cp_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out,
}
ASN1_OBJECT_free(gkt->key_agreement_info->cipher);
gkt->key_agreement_info->cipher = OBJ_nid2obj(param->nid);
- *outlen = i2d_GOST_KEY_TRANSPORT(gkt, out ? &out : NULL);
- if (*outlen <= 0) {
+ tmp_outlen = i2d_GOST_KEY_TRANSPORT(gkt, out ? &out : NULL);
+ if (tmp_outlen <= 0) {
GOSTerr(GOST_F_PKEY_GOST94CP_ENCRYPT,
GOST_R_ERROR_PACKING_KEY_TRANSPORT_INFO);
goto err;
}
+ *outlen = tmp_outlen;
if (!key_is_ephemeral) {
/* Set control "public key from client certificate used" */
if (EVP_PKEY_CTX_ctrl(ctx, -1, -1, EVP_PKEY_CTRL_PEER_KEY, 3, NULL) <=
diff --git a/crypto/openssl/engines/ccgost/gost_ameth.c b/crypto/openssl/engines/ccgost/gost_ameth.c
index 713a0fa..b7c5354 100644
--- a/crypto/openssl/engines/ccgost/gost_ameth.c
+++ b/crypto/openssl/engines/ccgost/gost_ameth.c
@@ -115,7 +115,10 @@ static int decode_gost_algor_params(EVP_PKEY *pkey, X509_ALGOR *palg)
}
param_nid = OBJ_obj2nid(gkp->key_params);
GOST_KEY_PARAMS_free(gkp);
- EVP_PKEY_set_type(pkey, pkey_nid);
+ if(!EVP_PKEY_set_type(pkey, pkey_nid)) {
+ GOSTerr(GOST_F_DECODE_GOST_ALGOR_PARAMS, ERR_R_INTERNAL_ERROR);
+ return 0;
+ }
switch (pkey_nid) {
case NID_id_GostR3410_94:
{
@@ -552,9 +555,19 @@ static int param_copy_gost01(EVP_PKEY *to, const EVP_PKEY *from)
}
if (!eto) {
eto = EC_KEY_new();
- EVP_PKEY_assign(to, EVP_PKEY_base_id(from), eto);
+ if(!eto) {
+ GOSTerr(GOST_F_PARAM_COPY_GOST01, ERR_R_MALLOC_FAILURE);
+ return 0;
+ }
+ if(!EVP_PKEY_assign(to, EVP_PKEY_base_id(from), eto)) {
+ GOSTerr(GOST_F_PARAM_COPY_GOST01, ERR_R_INTERNAL_ERROR);
+ return 0;
+ }
+ }
+ if(!EC_KEY_set_group(eto, EC_KEY_get0_group(efrom))) {
+ GOSTerr(GOST_F_PARAM_COPY_GOST01, ERR_R_INTERNAL_ERROR);
+ return 0;
}
- EC_KEY_set_group(eto, EC_KEY_get0_group(efrom));
if (EC_KEY_get0_private_key(eto)) {
gost2001_compute_public(eto);
}
@@ -729,8 +742,21 @@ static int pub_encode_gost01(X509_PUBKEY *pub, const EVP_PKEY *pk)
}
X = BN_new();
Y = BN_new();
- EC_POINT_get_affine_coordinates_GFp(EC_KEY_get0_group(ec),
- pub_key, X, Y, NULL);
+ if(!X || !Y) {
+ GOSTerr(GOST_F_PUB_ENCODE_GOST01, ERR_R_MALLOC_FAILURE);
+ if(X) BN_free(X);
+ if(Y) BN_free(Y);
+ BN_free(order);
+ return 0;
+ }
+ if(!EC_POINT_get_affine_coordinates_GFp(EC_KEY_get0_group(ec),
+ pub_key, X, Y, NULL)) {
+ GOSTerr(GOST_F_PUB_ENCODE_GOST01, ERR_R_INTERNAL_ERROR);
+ BN_free(X);
+ BN_free(Y);
+ BN_free(order);
+ return 0;
+ }
data_len = 2 * BN_num_bytes(order);
BN_free(order);
databuf = OPENSSL_malloc(data_len);
diff --git a/crypto/openssl/engines/ccgost/gost_pmeth.c b/crypto/openssl/engines/ccgost/gost_pmeth.c
index 9af7b06..b6275b2 100644
--- a/crypto/openssl/engines/ccgost/gost_pmeth.c
+++ b/crypto/openssl/engines/ccgost/gost_pmeth.c
@@ -502,7 +502,7 @@ static int pkey_gost_mac_ctrl_str(EVP_PKEY_CTX *ctx,
long keylen;
int ret;
unsigned char *keybuf = string_to_hex(value, &keylen);
- if (keylen != 32) {
+ if (!keybuf || keylen != 32) {
GOSTerr(GOST_F_PKEY_GOST_MAC_CTRL_STR,
GOST_R_INVALID_MAC_KEY_LENGTH);
OPENSSL_free(keybuf);
diff --git a/crypto/openssl/engines/ccgost/gost_sign.c b/crypto/openssl/engines/ccgost/gost_sign.c
index 0116e47..07ad921 100644
--- a/crypto/openssl/engines/ccgost/gost_sign.c
+++ b/crypto/openssl/engines/ccgost/gost_sign.c
@@ -12,6 +12,7 @@
#include <openssl/bn.h>
#include <openssl/dsa.h>
#include <openssl/evp.h>
+#include <openssl/err.h>
#include "gost_params.h"
#include "gost_lcl.h"
@@ -52,11 +53,16 @@ void dump_dsa_sig(const char *message, DSA_SIG *sig)
DSA_SIG *gost_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
{
BIGNUM *k = NULL, *tmp = NULL, *tmp2 = NULL;
- DSA_SIG *newsig = DSA_SIG_new();
+ DSA_SIG *newsig = NULL, *ret = NULL;
BIGNUM *md = hashsum2bn(dgst);
/* check if H(M) mod q is zero */
BN_CTX *ctx = BN_CTX_new();
+ if(!ctx) {
+ GOSTerr(GOST_F_GOST_DO_SIGN, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
BN_CTX_start(ctx);
+ newsig = DSA_SIG_new();
if (!newsig) {
GOSTerr(GOST_F_GOST_DO_SIGN, GOST_R_NO_MEMORY);
goto err;
@@ -64,6 +70,10 @@ DSA_SIG *gost_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
tmp = BN_CTX_get(ctx);
k = BN_CTX_get(ctx);
tmp2 = BN_CTX_get(ctx);
+ if(!tmp || !k || !tmp2) {
+ GOSTerr(GOST_F_GOST_DO_SIGN, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
BN_mod(tmp, md, dsa->q, ctx);
if (BN_is_zero(tmp)) {
BN_one(md);
@@ -76,24 +86,41 @@ DSA_SIG *gost_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
BN_rand_range(k, dsa->q);
/* generate r = (a^x mod p) mod q */
BN_mod_exp(tmp, dsa->g, k, dsa->p, ctx);
- if (!(newsig->r))
+ if (!(newsig->r)) {
newsig->r = BN_new();
+ if(!newsig->r) {
+ GOSTerr(GOST_F_GOST_DO_SIGN, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
+ }
BN_mod(newsig->r, tmp, dsa->q, ctx);
}
while (BN_is_zero(newsig->r));
/* generate s = (xr + k(Hm)) mod q */
BN_mod_mul(tmp, dsa->priv_key, newsig->r, dsa->q, ctx);
BN_mod_mul(tmp2, k, md, dsa->q, ctx);
- if (!newsig->s)
+ if (!newsig->s) {
newsig->s = BN_new();
+ if(!newsig->s) {
+ GOSTerr(GOST_F_GOST_DO_SIGN, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
+ }
BN_mod_add(newsig->s, tmp, tmp2, dsa->q, ctx);
}
while (BN_is_zero(newsig->s));
+
+ ret = newsig;
err:
BN_free(md);
- BN_CTX_end(ctx);
- BN_CTX_free(ctx);
- return newsig;
+ if(ctx) {
+ BN_CTX_end(ctx);
+ BN_CTX_free(ctx);
+ }
+ if(!ret && newsig) {
+ DSA_SIG_free(newsig);
+ }
+ return ret;
}
/*
@@ -135,17 +162,21 @@ int pack_sign_cp(DSA_SIG *s, int order, unsigned char *sig, size_t *siglen)
int gost_do_verify(const unsigned char *dgst, int dgst_len,
DSA_SIG *sig, DSA *dsa)
{
- BIGNUM *md, *tmp = NULL;
+ BIGNUM *md = NULL, *tmp = NULL;
BIGNUM *q2 = NULL;
BIGNUM *u = NULL, *v = NULL, *z1 = NULL, *z2 = NULL;
BIGNUM *tmp2 = NULL, *tmp3 = NULL;
- int ok;
+ int ok = 0;
BN_CTX *ctx = BN_CTX_new();
+ if(!ctx) {
+ GOSTerr(GOST_F_GOST_DO_VERIFY, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
BN_CTX_start(ctx);
if (BN_cmp(sig->s, dsa->q) >= 1 || BN_cmp(sig->r, dsa->q) >= 1) {
GOSTerr(GOST_F_GOST_DO_VERIFY, GOST_R_SIGNATURE_PARTS_GREATER_THAN_Q);
- return 0;
+ goto err;
}
md = hashsum2bn(dgst);
@@ -157,6 +188,10 @@ int gost_do_verify(const unsigned char *dgst, int dgst_len,
tmp2 = BN_CTX_get(ctx);
tmp3 = BN_CTX_get(ctx);
u = BN_CTX_get(ctx);
+ if(!tmp || !v || !q2 || !z1 || !z2 || !tmp2 || !tmp3 || !u) {
+ GOSTerr(GOST_F_GOST_DO_VERIFY, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
BN_mod(tmp, md, dsa->q, ctx);
if (BN_is_zero(tmp)) {
@@ -172,15 +207,18 @@ int gost_do_verify(const unsigned char *dgst, int dgst_len,
BN_mod_exp(tmp2, dsa->pub_key, z2, dsa->p, ctx);
BN_mod_mul(tmp3, tmp, tmp2, dsa->p, ctx);
BN_mod(u, tmp3, dsa->q, ctx);
- ok = BN_cmp(u, sig->r);
+ ok = (BN_cmp(u, sig->r) == 0);
- BN_free(md);
- BN_CTX_end(ctx);
- BN_CTX_free(ctx);
- if (ok != 0) {
+ if (!ok) {
GOSTerr(GOST_F_GOST_DO_VERIFY, GOST_R_SIGNATURE_MISMATCH);
}
- return (ok == 0);
+err:
+ if(md) BN_free(md);
+ if(ctx) {
+ BN_CTX_end(ctx);
+ BN_CTX_free(ctx);
+ }
+ return ok;
}
/*
@@ -190,13 +228,24 @@ int gost_do_verify(const unsigned char *dgst, int dgst_len,
int gost94_compute_public(DSA *dsa)
{
/* Now fill algorithm parameters with correct values */
- BN_CTX *ctx = BN_CTX_new();
+ BN_CTX *ctx;
if (!dsa->g) {
GOSTerr(GOST_F_GOST94_COMPUTE_PUBLIC, GOST_R_KEY_IS_NOT_INITALIZED);
return 0;
}
- /* Compute public key y = a^x mod p */
+ ctx = BN_CTX_new();
+ if(!ctx) {
+ GOSTerr(GOST_F_GOST94_COMPUTE_PUBLIC, ERR_R_MALLOC_FAILURE);
+ return 0;
+ }
+
dsa->pub_key = BN_new();
+ if(!dsa->pub_key) {
+ GOSTerr(GOST_F_GOST94_COMPUTE_PUBLIC, ERR_R_MALLOC_FAILURE);
+ BN_CTX_free(ctx);
+ return 0;
+ }
+ /* Compute public key y = a^x mod p */
BN_mod_exp(dsa->pub_key, dsa->g, dsa->priv_key, dsa->p, ctx);
BN_CTX_free(ctx);
return 1;
@@ -243,6 +292,10 @@ int fill_GOST94_params(DSA *dsa, int nid)
int gost_sign_keygen(DSA *dsa)
{
dsa->priv_key = BN_new();
+ if(!dsa->priv_key) {
+ GOSTerr(GOST_F_GOST_SIGN_KEYGEN, ERR_R_MALLOC_FAILURE);
+ return 0;
+ }
BN_rand_range(dsa->priv_key, dsa->q);
return gost94_compute_public(dsa);
}
diff --git a/crypto/openssl/engines/e_sureware.c b/crypto/openssl/engines/e_sureware.c
index 1005dfc..8a23763 100644
--- a/crypto/openssl/engines/e_sureware.c
+++ b/crypto/openssl/engines/e_sureware.c
@@ -712,10 +712,12 @@ static EVP_PKEY *sureware_load_public(ENGINE *e, const char *key_id,
/* set public big nums */
rsatmp->e = BN_new();
rsatmp->n = BN_new();
+ if(!rsatmp->e || !rsatmp->n)
+ goto err;
bn_expand2(rsatmp->e, el / sizeof(BN_ULONG));
bn_expand2(rsatmp->n, el / sizeof(BN_ULONG));
- if (!rsatmp->e || rsatmp->e->dmax != (int)(el / sizeof(BN_ULONG)) ||
- !rsatmp->n || rsatmp->n->dmax != (int)(el / sizeof(BN_ULONG)))
+ if (rsatmp->e->dmax != (int)(el / sizeof(BN_ULONG)) ||
+ rsatmp->n->dmax != (int)(el / sizeof(BN_ULONG)))
goto err;
ret = p_surewarehk_Load_Rsa_Pubkey(msg, key_id, el,
(unsigned long *)rsatmp->n->d,
@@ -752,15 +754,16 @@ static EVP_PKEY *sureware_load_public(ENGINE *e, const char *key_id,
dsatmp->p = BN_new();
dsatmp->q = BN_new();
dsatmp->g = BN_new();
+ if(!dsatmp->pub_key || !dsatmp->p || !dsatmp->q || !dsatmp->g)
+ goto err;
bn_expand2(dsatmp->pub_key, el / sizeof(BN_ULONG));
bn_expand2(dsatmp->p, el / sizeof(BN_ULONG));
bn_expand2(dsatmp->q, 20 / sizeof(BN_ULONG));
bn_expand2(dsatmp->g, el / sizeof(BN_ULONG));
- if (!dsatmp->pub_key
- || dsatmp->pub_key->dmax != (int)(el / sizeof(BN_ULONG))
- || !dsatmp->p || dsatmp->p->dmax != (int)(el / sizeof(BN_ULONG))
- || !dsatmp->q || dsatmp->q->dmax != 20 / sizeof(BN_ULONG)
- || !dsatmp->g || dsatmp->g->dmax != (int)(el / sizeof(BN_ULONG)))
+ if (dsatmp->pub_key->dmax != (int)(el / sizeof(BN_ULONG))
+ || dsatmp->p->dmax != (int)(el / sizeof(BN_ULONG))
+ || dsatmp->q->dmax != 20 / sizeof(BN_ULONG)
+ || dsatmp->g->dmax != (int)(el / sizeof(BN_ULONG)))
goto err;
ret = p_surewarehk_Load_Dsa_Pubkey(msg, key_id, el,
@@ -1038,10 +1041,12 @@ static DSA_SIG *surewarehk_dsa_do_sign(const unsigned char *from, int flen,
}
psign->r = BN_new();
psign->s = BN_new();
+ if(!psign->r || !psign->s)
+ goto err;
bn_expand2(psign->r, 20 / sizeof(BN_ULONG));
bn_expand2(psign->s, 20 / sizeof(BN_ULONG));
- if (!psign->r || psign->r->dmax != 20 / sizeof(BN_ULONG) ||
- !psign->s || psign->s->dmax != 20 / sizeof(BN_ULONG))
+ if (psign->r->dmax != 20 / sizeof(BN_ULONG) ||
+ psign->s->dmax != 20 / sizeof(BN_ULONG))
goto err;
ret = p_surewarehk_Dsa_Sign(msg, flen, from,
(unsigned long *)psign->r->d,
@@ -1070,9 +1075,9 @@ static int surewarehk_modexp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
char msg[64] = "ENGINE_modexp";
if (!p_surewarehk_Mod_Exp) {
SUREWAREerr(SUREWARE_F_SUREWAREHK_MODEXP, ENGINE_R_NOT_INITIALISED);
- } else {
+ } else if (r) {
bn_expand2(r, m->top);
- if (r && r->dmax == m->top) {
+ if (r->dmax == m->top) {
/* do it */
ret = p_surewarehk_Mod_Exp(msg,
m->top * sizeof(BN_ULONG),
diff --git a/crypto/openssl/ssl/Makefile b/crypto/openssl/ssl/Makefile
index 8dd390e..29d9e45 100644
--- a/crypto/openssl/ssl/Makefile
+++ b/crypto/openssl/ssl/Makefile
@@ -89,12 +89,13 @@ tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
-depend:
- @if [ -z "$(THIS)" ]; then \
- $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; \
- else \
- $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC); \
- fi
+update: local_depend
+ @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
+
+depend: local_depend
+ @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
+local_depend:
+ @[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
@@ -507,26 +508,27 @@ s2_pkt.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
s2_pkt.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
s2_pkt.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h s2_pkt.c
s2_pkt.o: ssl_locl.h
-s2_srvr.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
-s2_srvr.o: ../include/openssl/buffer.h ../include/openssl/comp.h
-s2_srvr.o: ../include/openssl/crypto.h ../include/openssl/dsa.h
-s2_srvr.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h
-s2_srvr.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
-s2_srvr.o: ../include/openssl/ecdsa.h ../include/openssl/err.h
-s2_srvr.o: ../include/openssl/evp.h ../include/openssl/hmac.h
-s2_srvr.o: ../include/openssl/kssl.h ../include/openssl/lhash.h
-s2_srvr.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
-s2_srvr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
-s2_srvr.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
-s2_srvr.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
-s2_srvr.o: ../include/openssl/pqueue.h ../include/openssl/rand.h
-s2_srvr.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
-s2_srvr.o: ../include/openssl/sha.h ../include/openssl/srtp.h
-s2_srvr.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
-s2_srvr.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
-s2_srvr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
-s2_srvr.o: ../include/openssl/tls1.h ../include/openssl/x509.h
-s2_srvr.o: ../include/openssl/x509_vfy.h s2_srvr.c ssl_locl.h
+s2_srvr.o: ../crypto/constant_time_locl.h ../e_os.h ../include/openssl/asn1.h
+s2_srvr.o: ../include/openssl/bio.h ../include/openssl/buffer.h
+s2_srvr.o: ../include/openssl/comp.h ../include/openssl/crypto.h
+s2_srvr.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h
+s2_srvr.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
+s2_srvr.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
+s2_srvr.o: ../include/openssl/err.h ../include/openssl/evp.h
+s2_srvr.o: ../include/openssl/hmac.h ../include/openssl/kssl.h
+s2_srvr.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
+s2_srvr.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
+s2_srvr.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
+s2_srvr.o: ../include/openssl/pem.h ../include/openssl/pem2.h
+s2_srvr.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h
+s2_srvr.o: ../include/openssl/rand.h ../include/openssl/rsa.h
+s2_srvr.o: ../include/openssl/safestack.h ../include/openssl/sha.h
+s2_srvr.o: ../include/openssl/srtp.h ../include/openssl/ssl.h
+s2_srvr.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
+s2_srvr.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
+s2_srvr.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
+s2_srvr.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h s2_srvr.c
+s2_srvr.o: ssl_locl.h
s3_both.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
s3_both.o: ../include/openssl/buffer.h ../include/openssl/comp.h
s3_both.o: ../include/openssl/crypto.h ../include/openssl/dsa.h
diff --git a/crypto/openssl/ssl/d1_both.c b/crypto/openssl/ssl/d1_both.c
index c18ec03..8dd8ea3 100644
--- a/crypto/openssl/ssl/d1_both.c
+++ b/crypto/openssl/ssl/d1_both.c
@@ -485,6 +485,12 @@ long dtls1_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok)
return i;
}
+ if (mt >= 0 && s->s3->tmp.message_type != mt) {
+ al = SSL_AD_UNEXPECTED_MESSAGE;
+ SSLerr(SSL_F_DTLS1_GET_MESSAGE, SSL_R_UNEXPECTED_MESSAGE);
+ goto f_err;
+ }
+
p = (unsigned char *)s->init_buf->data;
msg_len = msg_hdr->msg_len;
@@ -869,6 +875,20 @@ dtls1_get_message_fragment(SSL *s, int st1, int stn, long max, int *ok)
/* parse the message fragment header */
dtls1_get_message_header(wire, &msg_hdr);
+ len = msg_hdr.msg_len;
+ frag_off = msg_hdr.frag_off;
+ frag_len = msg_hdr.frag_len;
+
+ /*
+ * We must have at least frag_len bytes left in the record to be read.
+ * Fragments must not span records.
+ */
+ if (frag_len > s->s3->rrec.length) {
+ al = SSL3_AD_ILLEGAL_PARAMETER;
+ SSLerr(SSL_F_DTLS1_GET_MESSAGE_FRAGMENT, SSL_R_BAD_LENGTH);
+ goto f_err;
+ }
+
/*
* if this is a future (or stale) message it gets buffered
* (or dropped)--no further processing at this time
@@ -879,10 +899,6 @@ dtls1_get_message_fragment(SSL *s, int st1, int stn, long max, int *ok)
&& !(s->d1->listen && msg_hdr.seq == 1))
return dtls1_process_out_of_seq_message(s, &msg_hdr, ok);
- len = msg_hdr.msg_len;
- frag_off = msg_hdr.frag_off;
- frag_len = msg_hdr.frag_len;
-
if (frag_len && frag_len < len)
return dtls1_reassemble_fragment(s, &msg_hdr, ok);
@@ -913,17 +929,16 @@ dtls1_get_message_fragment(SSL *s, int st1, int stn, long max, int *ok)
if ((al = dtls1_preprocess_fragment(s, &msg_hdr, max)))
goto f_err;
- /* XDTLS: ressurect this when restart is in place */
- s->state = stn;
-
if (frag_len > 0) {
unsigned char *p =
(unsigned char *)s->init_buf->data + DTLS1_HM_HEADER_LENGTH;
i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE,
&p[frag_off], frag_len, 0);
+
/*
- * XDTLS: fix this--message fragments cannot span multiple packets
+ * This shouldn't ever fail due to NBIO because we already checked
+ * that we have enough data in the record
*/
if (i <= 0) {
s->rwstate = SSL_READING;
@@ -944,6 +959,7 @@ dtls1_get_message_fragment(SSL *s, int st1, int stn, long max, int *ok)
}
*ok = 1;
+ s->state = stn;
/*
* Note that s->init_num is *not* used as current offset in
@@ -1540,7 +1556,10 @@ int dtls1_process_heartbeat(SSL *s)
memcpy(bp, pl, payload);
bp += payload;
/* Random padding */
- RAND_pseudo_bytes(bp, padding);
+ if (RAND_pseudo_bytes(bp, padding) < 0) {
+ OPENSSL_free(buffer);
+ return -1;
+ }
r = dtls1_write_bytes(s, TLS1_RT_HEARTBEAT, buffer, write_length);
@@ -1574,7 +1593,7 @@ int dtls1_process_heartbeat(SSL *s)
int dtls1_heartbeat(SSL *s)
{
unsigned char *buf, *p;
- int ret;
+ int ret = -1;
unsigned int payload = 18; /* Sequence number + random bytes */
unsigned int padding = 16; /* Use minimum padding */
@@ -1622,10 +1641,12 @@ int dtls1_heartbeat(SSL *s)
/* Sequence number */
s2n(s->tlsext_hb_seq, p);
/* 16 random bytes */
- RAND_pseudo_bytes(p, 16);
+ if (RAND_pseudo_bytes(p, 16) < 0)
+ goto err;
p += 16;
/* Random padding */
- RAND_pseudo_bytes(p, padding);
+ if (RAND_pseudo_bytes(p, padding) < 0)
+ goto err;
ret = dtls1_write_bytes(s, TLS1_RT_HEARTBEAT, buf, 3 + payload + padding);
if (ret >= 0) {
@@ -1638,6 +1659,7 @@ int dtls1_heartbeat(SSL *s)
s->tlsext_hb_pending = 1;
}
+err:
OPENSSL_free(buf);
return ret;
diff --git a/crypto/openssl/ssl/d1_clnt.c b/crypto/openssl/ssl/d1_clnt.c
index 1394781..377c1e6 100644
--- a/crypto/openssl/ssl/d1_clnt.c
+++ b/crypto/openssl/ssl/d1_clnt.c
@@ -212,6 +212,7 @@ int dtls1_connect(SSL *s)
(s->version & 0xff00) != (DTLS1_BAD_VER & 0xff00)) {
SSLerr(SSL_F_DTLS1_CONNECT, ERR_R_INTERNAL_ERROR);
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
@@ -221,10 +222,12 @@ int dtls1_connect(SSL *s)
if (s->init_buf == NULL) {
if ((buf = BUF_MEM_new()) == NULL) {
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
if (!BUF_MEM_grow(buf, SSL3_RT_MAX_PLAIN_LENGTH)) {
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
s->init_buf = buf;
@@ -233,12 +236,14 @@ int dtls1_connect(SSL *s)
if (!ssl3_setup_buffers(s)) {
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
/* setup buffing BIO */
if (!ssl_init_wbio_buffer(s, 0)) {
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
@@ -417,6 +422,7 @@ int dtls1_connect(SSL *s)
*/
if (!ssl3_check_cert_and_algorithm(s)) {
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
break;
@@ -548,6 +554,7 @@ int dtls1_connect(SSL *s)
#endif
if (!s->method->ssl3_enc->setup_key_block(s)) {
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
@@ -555,6 +562,7 @@ int dtls1_connect(SSL *s)
SSL3_CHANGE_CIPHER_CLIENT_WRITE))
{
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
#ifndef OPENSSL_NO_SCTP
@@ -735,6 +743,7 @@ int dtls1_connect(SSL *s)
goto end;
/* break; */
+ case SSL_ST_ERR:
default:
SSLerr(SSL_F_DTLS1_CONNECT, SSL_R_UNKNOWN_STATE);
ret = -1;
@@ -945,6 +954,7 @@ static int dtls1_get_hello_verify(SSL *s)
f_err:
ssl3_send_alert(s, SSL3_AL_FATAL, al);
+ s->state = SSL_ST_ERR;
return -1;
}
diff --git a/crypto/openssl/ssl/d1_lib.c b/crypto/openssl/ssl/d1_lib.c
index 94acb15..011d7b7 100644
--- a/crypto/openssl/ssl/d1_lib.c
+++ b/crypto/openssl/ssl/d1_lib.c
@@ -496,6 +496,9 @@ int dtls1_listen(SSL *s, struct sockaddr *client)
{
int ret;
+ /* Ensure there is no state left over from a previous invocation */
+ SSL_clear(s);
+
SSL_set_options(s, SSL_OP_COOKIE_EXCHANGE);
s->d1->listen = 1;
diff --git a/crypto/openssl/ssl/d1_pkt.c b/crypto/openssl/ssl/d1_pkt.c
index 7b49a7d..d659ed4 100644
--- a/crypto/openssl/ssl/d1_pkt.c
+++ b/crypto/openssl/ssl/d1_pkt.c
@@ -1065,7 +1065,7 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
(s->d1->handshake_fragment[3] != 0)) {
al = SSL_AD_DECODE_ERROR;
SSLerr(SSL_F_DTLS1_READ_BYTES, SSL_R_BAD_HELLO_REQUEST);
- goto err;
+ goto f_err;
}
/*
diff --git a/crypto/openssl/ssl/d1_srvr.c b/crypto/openssl/ssl/d1_srvr.c
index c4ec9fe..41c7dc5 100644
--- a/crypto/openssl/ssl/d1_srvr.c
+++ b/crypto/openssl/ssl/d1_srvr.c
@@ -224,11 +224,13 @@ int dtls1_accept(SSL *s)
if (s->init_buf == NULL) {
if ((buf = BUF_MEM_new()) == NULL) {
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
if (!BUF_MEM_grow(buf, SSL3_RT_MAX_PLAIN_LENGTH)) {
BUF_MEM_free(buf);
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
s->init_buf = buf;
@@ -236,6 +238,7 @@ int dtls1_accept(SSL *s)
if (!ssl3_setup_buffers(s)) {
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
@@ -257,6 +260,7 @@ int dtls1_accept(SSL *s)
#endif
if (!ssl_init_wbio_buffer(s, 1)) {
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
@@ -470,7 +474,7 @@ int dtls1_accept(SSL *s)
#ifndef OPENSSL_NO_PSK
|| ((alg_k & SSL_kPSK) && s->ctx->psk_identity_hint)
#endif
- || (alg_k & (SSL_kEDH | SSL_kDHr | SSL_kDHd))
+ || (alg_k & SSL_kEDH)
|| (alg_k & SSL_kEECDH)
|| ((alg_k & SSL_kRSA)
&& (s->cert->pkeys[SSL_PKEY_RSA_ENC].privatekey == NULL
@@ -665,15 +669,6 @@ int dtls1_accept(SSL *s)
case SSL3_ST_SR_CERT_VRFY_A:
case SSL3_ST_SR_CERT_VRFY_B:
- /*
- * This *should* be the first time we enable CCS, but be
- * extra careful about surrounding code changes. We need
- * to set this here because we don't know if we're
- * expecting a CertificateVerify or not.
- */
- if (!s->s3->change_cipher_spec)
- s->d1->change_cipher_spec_ok = 1;
- /* we should decide if we expected this one */
ret = ssl3_get_cert_verify(s);
if (ret <= 0)
goto end;
@@ -690,11 +685,10 @@ int dtls1_accept(SSL *s)
case SSL3_ST_SR_FINISHED_A:
case SSL3_ST_SR_FINISHED_B:
/*
- * Enable CCS for resumed handshakes.
- * In a full handshake, we end up here through
- * SSL3_ST_SR_CERT_VRFY_B, so change_cipher_spec_ok was
- * already set. Receiving a CCS clears the flag, so make
- * sure not to re-enable it to ban duplicates.
+ * Enable CCS. Receiving a CCS clears the flag, so make
+ * sure not to re-enable it to ban duplicates. This *should* be the
+ * first time we have received one - but we check anyway to be
+ * cautious.
* s->s3->change_cipher_spec is set when a CCS is
* processed in d1_pkt.c, and remains set until
* the client's Finished message is read.
@@ -744,6 +738,7 @@ int dtls1_accept(SSL *s)
s->session->cipher = s->s3->tmp.new_cipher;
if (!s->method->ssl3_enc->setup_key_block(s)) {
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
@@ -772,6 +767,7 @@ int dtls1_accept(SSL *s)
SSL3_CHANGE_CIPHER_SERVER_WRITE))
{
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
@@ -852,6 +848,7 @@ int dtls1_accept(SSL *s)
goto end;
/* break; */
+ case SSL_ST_ERR:
default:
SSLerr(SSL_F_DTLS1_ACCEPT, SSL_R_UNKNOWN_STATE);
ret = -1;
@@ -932,6 +929,7 @@ int dtls1_send_hello_verify_request(SSL *s)
&(s->d1->cookie_len)) == 0) {
SSLerr(SSL_F_DTLS1_SEND_HELLO_VERIFY_REQUEST,
ERR_R_INTERNAL_ERROR);
+ s->state = SSL_ST_ERR;
return 0;
}
diff --git a/crypto/openssl/ssl/s2_pkt.c b/crypto/openssl/ssl/s2_pkt.c
index 614b9a3..7a61888 100644
--- a/crypto/openssl/ssl/s2_pkt.c
+++ b/crypto/openssl/ssl/s2_pkt.c
@@ -576,6 +576,20 @@ static int n_do_ssl_write(SSL *s, const unsigned char *buf, unsigned int len)
s->s2->padding = p;
s->s2->mac_data = &(s->s2->wbuf[3]);
s->s2->wact_data = &(s->s2->wbuf[3 + mac_size]);
+
+ /*
+ * It would be clearer to write this as follows:
+ * if (mac_size + len + p > SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER)
+ * However |len| is user input that could in theory be very large. We
+ * know |mac_size| and |p| are small, so to avoid any possibility of
+ * overflow we write it like this.
+ *
+ * In theory this should never fail because the logic above should have
+ * modified |len| if it is too big. But we are being cautious.
+ */
+ if (len > (SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER - (mac_size + p))) {
+ return -1;
+ }
/* we copy the data into s->s2->wbuf */
memcpy(s->s2->wact_data, buf, len);
if (p)
diff --git a/crypto/openssl/ssl/s2_srvr.c b/crypto/openssl/ssl/s2_srvr.c
index 19bb48c..4289272 100644
--- a/crypto/openssl/ssl/s2_srvr.c
+++ b/crypto/openssl/ssl/s2_srvr.c
@@ -111,6 +111,7 @@
#include "ssl_locl.h"
#ifndef OPENSSL_NO_SSL2
+#include "../crypto/constant_time_locl.h"
# include <stdio.h>
# include <openssl/bio.h>
# include <openssl/rand.h>
@@ -372,12 +373,15 @@ int ssl2_accept(SSL *s)
static int get_client_master_key(SSL *s)
{
int is_export, i, n, keya;
- unsigned int ek;
+ unsigned int num_encrypted_key_bytes, key_length;
unsigned long len;
unsigned char *p;
const SSL_CIPHER *cp;
const EVP_CIPHER *c;
const EVP_MD *md;
+ unsigned char rand_premaster_secret[SSL_MAX_MASTER_KEY_LENGTH];
+ unsigned char decrypt_good;
+ size_t j;
p = (unsigned char *)s->init_buf->data;
if (s->state == SSL2_ST_GET_CLIENT_MASTER_KEY_A) {
@@ -465,12 +469,6 @@ static int get_client_master_key(SSL *s)
return (0);
}
- if (s->session->cipher->algorithm2 & SSL2_CF_8_BYTE_ENC) {
- is_export = 1;
- ek = 8;
- } else
- ek = 5;
-
/*
* The format of the CLIENT-MASTER-KEY message is
* 1 byte message type
@@ -484,12 +482,27 @@ static int get_client_master_key(SSL *s)
*
* If the cipher is an export cipher, then the encrypted key bytes
* are a fixed portion of the total key (5 or 8 bytes). The size of
- * this portion is in |ek|. If the cipher is not an export cipher,
- * then the entire key material is encrypted (i.e., clear key length
- * must be zero).
+ * this portion is in |num_encrypted_key_bytes|. If the cipher is not an
+ * export cipher, then the entire key material is encrypted (i.e., clear
+ * key length must be zero).
*/
- if ((!is_export && s->s2->tmp.clear != 0) ||
- (is_export && s->s2->tmp.clear + ek != (unsigned int)EVP_CIPHER_key_length(c))) {
+ key_length = (unsigned int)EVP_CIPHER_key_length(c);
+ if (key_length > SSL_MAX_MASTER_KEY_LENGTH) {
+ ssl2_return_error(s, SSL2_PE_UNDEFINED_ERROR);
+ SSLerr(SSL_F_GET_CLIENT_MASTER_KEY, ERR_R_INTERNAL_ERROR);
+ return -1;
+ }
+
+ if (s->session->cipher->algorithm2 & SSL2_CF_8_BYTE_ENC) {
+ is_export = 1;
+ num_encrypted_key_bytes = 8;
+ } else if (is_export) {
+ num_encrypted_key_bytes = 5;
+ } else {
+ num_encrypted_key_bytes = key_length;
+ }
+
+ if (s->s2->tmp.clear + num_encrypted_key_bytes != key_length) {
ssl2_return_error(s, SSL2_PE_UNDEFINED_ERROR);
SSLerr(SSL_F_GET_CLIENT_MASTER_KEY,SSL_R_BAD_LENGTH);
return -1;
@@ -499,64 +512,49 @@ static int get_client_master_key(SSL *s)
* Decryption can't be expanding, so if we don't have enough encrypted
* bytes to fit the key in the buffer, stop now.
*/
- if ((is_export && s->s2->tmp.enc < ek) ||
- (!is_export && s->s2->tmp.enc < (unsigned int)EVP_CIPHER_key_length(c))) {
+ if (s->s2->tmp.enc < num_encrypted_key_bytes) {
ssl2_return_error(s,SSL2_PE_UNDEFINED_ERROR);
SSLerr(SSL_F_GET_CLIENT_MASTER_KEY,SSL_R_LENGTH_TOO_SHORT);
return -1;
}
+ /*
+ * We must not leak whether a decryption failure occurs because of
+ * Bleichenbacher's attack on PKCS #1 v1.5 RSA padding (see RFC 2246,
+ * section 7.4.7.1). The code follows that advice of the TLS RFC and
+ * generates a random premaster secret for the case that the decrypt
+ * fails. See https://tools.ietf.org/html/rfc5246#section-7.4.7.1
+ */
+
+ /*
+ * should be RAND_bytes, but we cannot work around a failure.
+ */
+ if (RAND_pseudo_bytes(rand_premaster_secret,
+ (int)num_encrypted_key_bytes) <= 0)
+ return 0;
+
i = ssl_rsa_private_decrypt(s->cert, s->s2->tmp.enc,
&(p[s->s2->tmp.clear]),
&(p[s->s2->tmp.clear]),
(s->s2->ssl2_rollback) ? RSA_SSLV23_PADDING :
RSA_PKCS1_PADDING);
-
- /* bad decrypt */
-# if 1
+ ERR_clear_error();
/*
* If a bad decrypt, continue with protocol but with a random master
* secret (Bleichenbacher attack)
*/
- if ((i < 0) || ((!is_export && i != EVP_CIPHER_key_length(c))
- || (is_export && i != (int)ek))) {
- ERR_clear_error();
- if (is_export)
- i = ek;
- else
- i = EVP_CIPHER_key_length(c);
- if (RAND_pseudo_bytes(&p[s->s2->tmp.clear], i) <= 0)
- return 0;
- }
-# else
- if (i < 0) {
- error = 1;
- SSLerr(SSL_F_GET_CLIENT_MASTER_KEY, SSL_R_BAD_RSA_DECRYPT);
- }
- /* incorrect number of key bytes for non export cipher */
- else if ((!is_export && (i != EVP_CIPHER_key_length(c)))
- || (is_export && ((i != ek) || (s->s2->tmp.clear + i !=
- EVP_CIPHER_key_length(c))))) {
- error = 1;
- SSLerr(SSL_F_GET_CLIENT_MASTER_KEY, SSL_R_WRONG_NUMBER_OF_KEY_BITS);
- }
- if (error) {
- ssl2_return_error(s, SSL2_PE_UNDEFINED_ERROR);
- return (-1);
+ decrypt_good = constant_time_eq_int_8(i, (int)num_encrypted_key_bytes);
+ for (j = 0; j < num_encrypted_key_bytes; j++) {
+ p[s->s2->tmp.clear + j] =
+ constant_time_select_8(decrypt_good, p[s->s2->tmp.clear + j],
+ rand_premaster_secret[j]);
}
-# endif
- if (is_export)
- i = EVP_CIPHER_key_length(c);
+ s->session->master_key_length = (int)key_length;
+ memcpy(s->session->master_key, p, key_length);
+ OPENSSL_cleanse(p, key_length);
- if (i > SSL_MAX_MASTER_KEY_LENGTH) {
- ssl2_return_error(s, SSL2_PE_UNDEFINED_ERROR);
- SSLerr(SSL_F_GET_CLIENT_MASTER_KEY, ERR_R_INTERNAL_ERROR);
- return -1;
- }
- s->session->master_key_length = i;
- memcpy(s->session->master_key, p, (unsigned int)i);
- return (1);
+ return 1;
}
static int get_client_hello(SSL *s)
diff --git a/crypto/openssl/ssl/s3_both.c b/crypto/openssl/ssl/s3_both.c
index 77374f4..107b460 100644
--- a/crypto/openssl/ssl/s3_both.c
+++ b/crypto/openssl/ssl/s3_both.c
@@ -169,7 +169,7 @@ int ssl3_send_finished(SSL *s, int a, int b, const char *sender, int slen)
i = s->method->ssl3_enc->final_finish_mac(s,
sender, slen,
s->s3->tmp.finish_md);
- if (i == 0)
+ if (i <= 0)
return 0;
s->s3->tmp.finish_md_len = i;
memcpy(p, s->s3->tmp.finish_md, i);
diff --git a/crypto/openssl/ssl/s3_cbc.c b/crypto/openssl/ssl/s3_cbc.c
index 598d27e..2fb71f2 100644
--- a/crypto/openssl/ssl/s3_cbc.c
+++ b/crypto/openssl/ssl/s3_cbc.c
@@ -149,7 +149,7 @@ int tls1_cbc_remove_padding(const SSL *s,
*/
if ((s->options & SSL_OP_TLS_BLOCK_PADDING_BUG) && !s->expand) {
/* First packet is even in size, so check */
- if ((memcmp(s->s3->read_sequence, "\0\0\0\0\0\0\0\0", 8) == 0) &&
+ if ((CRYPTO_memcmp(s->s3->read_sequence, "\0\0\0\0\0\0\0\0", 8) == 0) &&
!(padding_length & 1)) {
s->s3->flags |= TLS1_FLAGS_TLS_PADDING_BUG;
}
@@ -639,12 +639,22 @@ void ssl3_cbc_digest_record(const EVP_MD_CTX *ctx,
if (k > 0) {
if (is_sslv3) {
+ unsigned overhang;
+
/*
* The SSLv3 header is larger than a single block. overhang is
* the number of bytes beyond a single block that the header
- * consumes: either 7 bytes (SHA1) or 11 bytes (MD5).
+ * consumes: either 7 bytes (SHA1) or 11 bytes (MD5). There are no
+ * ciphersuites in SSLv3 that are not SHA1 or MD5 based and
+ * therefore we can be confident that the header_length will be
+ * greater than |md_block_size|. However we add a sanity check just
+ * in case
*/
- unsigned overhang = header_length - md_block_size;
+ if (header_length <= md_block_size) {
+ /* Should never happen */
+ return;
+ }
+ overhang = header_length - md_block_size;
md_transform(md_state.c, header);
memcpy(first_block, header + md_block_size, overhang);
memcpy(first_block + overhang, data, md_block_size - overhang);
diff --git a/crypto/openssl/ssl/s3_clnt.c b/crypto/openssl/ssl/s3_clnt.c
index 0e5acec..0879a0f 100644
--- a/crypto/openssl/ssl/s3_clnt.c
+++ b/crypto/openssl/ssl/s3_clnt.c
@@ -168,6 +168,9 @@
#endif
static int ca_dn_cmp(const X509_NAME *const *a, const X509_NAME *const *b);
+#ifndef OPENSSL_NO_TLSEXT
+static int ssl3_check_finished(SSL *s);
+#endif
#ifndef OPENSSL_NO_SSL3_METHOD
static const SSL_METHOD *ssl3_get_client_method(int ver)
@@ -235,6 +238,7 @@ int ssl3_connect(SSL *s)
if ((s->version & 0xff00) != 0x0300) {
SSLerr(SSL_F_SSL3_CONNECT, ERR_R_INTERNAL_ERROR);
+ s->state = SSL_ST_ERR;
ret = -1;
goto end;
}
@@ -245,10 +249,12 @@ int ssl3_connect(SSL *s)
if (s->init_buf == NULL) {
if ((buf = BUF_MEM_new()) == NULL) {
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
if (!BUF_MEM_grow(buf, SSL3_RT_MAX_PLAIN_LENGTH)) {
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
s->init_buf = buf;
@@ -263,6 +269,7 @@ int ssl3_connect(SSL *s)
/* setup buffing BIO */
if (!ssl_init_wbio_buffer(s, 0)) {
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
@@ -317,12 +324,24 @@ int ssl3_connect(SSL *s)
case SSL3_ST_CR_CERT_A:
case SSL3_ST_CR_CERT_B:
+#ifndef OPENSSL_NO_TLSEXT
+ /* Noop (ret = 0) for everything but EAP-FAST. */
+ ret = ssl3_check_finished(s);
+ if (ret < 0)
+ goto end;
+ if (ret == 1) {
+ s->hit = 1;
+ s->state = SSL3_ST_CR_FINISHED_A;
+ s->init_num = 0;
+ break;
+ }
+#endif
/* Check if it is anon DH/ECDH, SRP auth */
/* or PSK */
if (!
(s->s3->tmp.
new_cipher->algorithm_auth & (SSL_aNULL | SSL_aSRP))
-&& !(s->s3->tmp.new_cipher->algorithm_mkey & SSL_kPSK)) {
+ && !(s->s3->tmp.new_cipher->algorithm_mkey & SSL_kPSK)) {
ret = ssl3_get_server_certificate(s);
if (ret <= 0)
goto end;
@@ -358,6 +377,7 @@ int ssl3_connect(SSL *s)
*/
if (!ssl3_check_cert_and_algorithm(s)) {
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
break;
@@ -381,6 +401,7 @@ int ssl3_connect(SSL *s)
if ((ret = SRP_Calc_A_param(s)) <= 0) {
SSLerr(SSL_F_SSL3_CONNECT, SSL_R_SRP_A_CALC);
ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR);
+ s->state = SSL_ST_ERR;
goto end;
}
}
@@ -472,6 +493,7 @@ int ssl3_connect(SSL *s)
#endif
if (!s->method->ssl3_enc->setup_key_block(s)) {
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
@@ -479,6 +501,7 @@ int ssl3_connect(SSL *s)
SSL3_CHANGE_CIPHER_CLIENT_WRITE))
{
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
@@ -553,7 +576,8 @@ int ssl3_connect(SSL *s)
case SSL3_ST_CR_FINISHED_A:
case SSL3_ST_CR_FINISHED_B:
- s->s3->flags |= SSL3_FLAGS_CCS_OK;
+ if (!s->s3->change_cipher_spec)
+ s->s3->flags |= SSL3_FLAGS_CCS_OK;
ret = ssl3_get_finished(s, SSL3_ST_CR_FINISHED_A,
SSL3_ST_CR_FINISHED_B);
if (ret <= 0)
@@ -612,6 +636,7 @@ int ssl3_connect(SSL *s)
goto end;
/* break; */
+ case SSL_ST_ERR:
default:
SSLerr(SSL_F_SSL3_CONNECT, SSL_R_UNKNOWN_STATE);
ret = -1;
@@ -658,9 +683,17 @@ int ssl3_client_hello(SSL *s)
buf = (unsigned char *)s->init_buf->data;
if (s->state == SSL3_ST_CW_CLNT_HELLO_A) {
SSL_SESSION *sess = s->session;
- if ((sess == NULL) ||
- (sess->ssl_version != s->version) ||
- !sess->session_id_length || (sess->not_resumable)) {
+ if ((sess == NULL) || (sess->ssl_version != s->version) ||
+#ifdef OPENSSL_NO_TLSEXT
+ !sess->session_id_length ||
+#else
+ /*
+ * In the case of EAP-FAST, we can have a pre-shared
+ * "ticket" without a session ID.
+ */
+ (!sess->session_id_length && !sess->tlsext_tick) ||
+#endif
+ (sess->not_resumable)) {
if (!ssl_get_new_session(s, 0))
goto err;
}
@@ -798,6 +831,7 @@ int ssl3_client_hello(SSL *s)
/* SSL3_ST_CW_CLNT_HELLO_B */
return (ssl3_do_write(s, SSL3_RT_HANDSHAKE));
err:
+ s->state = SSL_ST_ERR;
return (-1);
}
@@ -867,10 +901,19 @@ int ssl3_get_server_hello(SSL *s)
}
#ifndef OPENSSL_NO_TLSEXT
/*
- * check if we want to resume the session based on external pre-shared
- * secret
+ * Check if we can resume the session based on external pre-shared secret.
+ * EAP-FAST (RFC 4851) supports two types of session resumption.
+ * Resumption based on server-side state works with session IDs.
+ * Resumption based on pre-shared Protected Access Credentials (PACs)
+ * works by overriding the SessionTicket extension at the application
+ * layer, and does not send a session ID. (We do not know whether EAP-FAST
+ * servers would honour the session ID.) Therefore, the session ID alone
+ * is not a reliable indicator of session resumption, so we first check if
+ * we can resume, and later peek at the next handshake message to see if the
+ * server wants to resume.
*/
- if (s->version >= TLS1_VERSION && s->tls_session_secret_cb) {
+ if (s->version >= TLS1_VERSION && s->tls_session_secret_cb &&
+ s->session->tlsext_tick) {
SSL_CIPHER *pref_cipher = NULL;
s->session->master_key_length = sizeof(s->session->master_key);
if (s->tls_session_secret_cb(s, s->session->master_key,
@@ -879,12 +922,15 @@ int ssl3_get_server_hello(SSL *s)
s->tls_session_secret_cb_arg)) {
s->session->cipher = pref_cipher ?
pref_cipher : ssl_get_cipher_by_char(s, p + j);
- s->hit = 1;
+ } else {
+ SSLerr(SSL_F_SSL3_GET_SERVER_HELLO, ERR_R_INTERNAL_ERROR);
+ al = SSL_AD_INTERNAL_ERROR;
+ goto f_err;
}
}
#endif /* OPENSSL_NO_TLSEXT */
- if (!s->hit && j != 0 && j == s->session->session_id_length
+ if (j != 0 && j == s->session->session_id_length
&& memcmp(p, s->session->session_id, j) == 0) {
if (s->sid_ctx_length != s->session->sid_ctx_length
|| memcmp(s->session->sid_ctx, s->sid_ctx, s->sid_ctx_length)) {
@@ -895,12 +941,13 @@ int ssl3_get_server_hello(SSL *s)
goto f_err;
}
s->hit = 1;
- }
- /* a miss or crap from the other end */
- if (!s->hit) {
+ } else {
/*
- * If we were trying for session-id reuse, make a new SSL_SESSION so
- * we don't stuff up other people
+ * If we were trying for session-id reuse but the server
+ * didn't echo the ID, make a new SSL_SESSION.
+ * In the case of EAP-FAST and PAC, we do not send a session ID,
+ * so the PAC-based session secret is always preserved. It'll be
+ * overwritten if the server refuses resumption.
*/
if (s->session->session_id_length > 0) {
if (!ssl_get_new_session(s, 0)) {
@@ -1045,6 +1092,7 @@ int ssl3_get_server_hello(SSL *s)
f_err:
ssl3_send_alert(s, SSL3_AL_FATAL, al);
err:
+ s->state = SSL_ST_ERR;
return (-1);
}
@@ -1223,8 +1271,10 @@ int ssl3_get_server_certificate(SSL *s)
if (0) {
f_err:
ssl3_send_alert(s, SSL3_AL_FATAL, al);
- }
err:
+ s->state = SSL_ST_ERR;
+ }
+
EVP_PKEY_free(pkey);
X509_free(x);
sk_X509_pop_free(sk, X509_free);
@@ -1546,6 +1596,13 @@ int ssl3_get_key_exchange(SSL *s)
SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR);
goto err;
}
+
+ if (EVP_PKEY_bits(pkey) <= SSL_C_EXPORT_PKEYLENGTH(s->s3->tmp.new_cipher)) {
+ al = SSL_AD_UNEXPECTED_MESSAGE;
+ SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_UNEXPECTED_MESSAGE);
+ goto f_err;
+ }
+
s->session->sess_cert->peer_rsa_tmp = rsa;
rsa = NULL;
}
@@ -1894,6 +1951,7 @@ int ssl3_get_key_exchange(SSL *s)
EC_KEY_free(ecdh);
#endif
EVP_MD_CTX_cleanup(&md_ctx);
+ s->state = SSL_ST_ERR;
return (-1);
}
@@ -2050,7 +2108,10 @@ int ssl3_get_certificate_request(SSL *s)
ca_sk = NULL;
ret = 1;
+ goto done;
err:
+ s->state = SSL_ST_ERR;
+ done:
if (ca_sk != NULL)
sk_X509_NAME_pop_free(ca_sk, X509_NAME_free);
return (ret);
@@ -2085,6 +2146,38 @@ int ssl3_get_new_session_ticket(SSL *s)
}
p = d = (unsigned char *)s->init_msg;
+
+ if (s->session->session_id_length > 0) {
+ int i = s->session_ctx->session_cache_mode;
+ SSL_SESSION *new_sess;
+ /*
+ * We reused an existing session, so we need to replace it with a new
+ * one
+ */
+ if (i & SSL_SESS_CACHE_CLIENT) {
+ /*
+ * Remove the old session from the cache
+ */
+ if (i & SSL_SESS_CACHE_NO_INTERNAL_STORE) {
+ if (s->session_ctx->remove_session_cb != NULL)
+ s->session_ctx->remove_session_cb(s->session_ctx,
+ s->session);
+ } else {
+ /* We carry on if this fails */
+ SSL_CTX_remove_session(s->session_ctx, s->session);
+ }
+ }
+
+ if ((new_sess = ssl_session_dup(s->session, 0)) == 0) {
+ al = SSL_AD_INTERNAL_ERROR;
+ SSLerr(SSL_F_SSL3_GET_NEW_SESSION_TICKET, ERR_R_MALLOC_FAILURE);
+ goto f_err;
+ }
+
+ SSL_SESSION_free(s->session);
+ s->session = new_sess;
+ }
+
n2l(p, s->session->tlsext_tick_lifetime_hint);
n2s(p, ticklen);
/* ticket_lifetime_hint + ticket_length + ticket */
@@ -2127,6 +2220,7 @@ int ssl3_get_new_session_ticket(SSL *s)
f_err:
ssl3_send_alert(s, SSL3_AL_FATAL, al);
err:
+ s->state = SSL_ST_ERR;
return (-1);
}
@@ -2187,6 +2281,7 @@ int ssl3_get_cert_status(SSL *s)
return 1;
f_err:
ssl3_send_alert(s, SSL3_AL_FATAL, al);
+ s->state = SSL_ST_ERR;
return (-1);
}
#endif
@@ -2208,6 +2303,7 @@ int ssl3_get_server_done(SSL *s)
/* should contain no data */
ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR);
SSLerr(SSL_F_SSL3_GET_SERVER_DONE, SSL_R_LENGTH_MISMATCH);
+ s->state = SSL_ST_ERR;
return -1;
}
ret = 1;
@@ -2506,8 +2602,6 @@ int ssl3_send_client_key_exchange(SSL *s)
n += 2;
DH_free(dh_clnt);
-
- /* perhaps clean things up a bit EAY EAY EAY EAY */
}
#endif
@@ -2729,7 +2823,10 @@ int ssl3_send_client_key_exchange(SSL *s)
EVP_PKEY_encrypt_init(pkey_ctx);
/* Generate session key */
- RAND_bytes(premaster_secret, 32);
+ if (RAND_bytes(premaster_secret, 32) <= 0) {
+ EVP_PKEY_CTX_free(pkey_ctx);
+ goto err;
+ }
/*
* If we have client certificate, use its secret as peer key
*/
@@ -2948,6 +3045,7 @@ int ssl3_send_client_key_exchange(SSL *s)
EC_KEY_free(clnt_ecdh);
EVP_PKEY_free(srvr_pub_pkey);
#endif
+ s->state = SSL_ST_ERR;
return (-1);
}
@@ -3081,6 +3179,7 @@ int ssl3_send_client_verify(SSL *s)
err:
EVP_MD_CTX_cleanup(&mctx);
EVP_PKEY_CTX_free(pctx);
+ s->state = SSL_ST_ERR;
return (-1);
}
@@ -3149,6 +3248,7 @@ int ssl3_send_client_certificate(SSL *s)
if (!l) {
SSLerr(SSL_F_SSL3_SEND_CLIENT_CERTIFICATE, ERR_R_INTERNAL_ERROR);
ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR);
+ s->state = SSL_ST_ERR;
return 0;
}
s->init_num = (int)l;
@@ -3165,6 +3265,7 @@ int ssl3_check_cert_and_algorithm(SSL *s)
int i, idx;
long alg_k, alg_a;
EVP_PKEY *pkey = NULL;
+ int pkey_bits;
SESS_CERT *sc;
#ifndef OPENSSL_NO_RSA
RSA *rsa;
@@ -3172,6 +3273,7 @@ int ssl3_check_cert_and_algorithm(SSL *s)
#ifndef OPENSSL_NO_DH
DH *dh;
#endif
+ int al = SSL_AD_HANDSHAKE_FAILURE;
alg_k = s->s3->tmp.new_cipher->algorithm_mkey;
alg_a = s->s3->tmp.new_cipher->algorithm_auth;
@@ -3207,6 +3309,7 @@ int ssl3_check_cert_and_algorithm(SSL *s)
}
#endif
pkey = X509_get_pubkey(sc->peer_pkeys[idx].x509);
+ pkey_bits = EVP_PKEY_bits(pkey);
i = X509_certificate_type(sc->peer_pkeys[idx].x509, pkey);
EVP_PKEY_free(pkey);
@@ -3224,38 +3327,71 @@ int ssl3_check_cert_and_algorithm(SSL *s)
}
#endif
#ifndef OPENSSL_NO_RSA
- if ((alg_k & SSL_kRSA) &&
- !(has_bits(i, EVP_PK_RSA | EVP_PKT_ENC) || (rsa != NULL))) {
- SSLerr(SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM,
- SSL_R_MISSING_RSA_ENCRYPTING_CERT);
- goto f_err;
+ if (alg_k & SSL_kRSA) {
+ if (!SSL_C_IS_EXPORT(s->s3->tmp.new_cipher) &&
+ !has_bits(i, EVP_PK_RSA | EVP_PKT_ENC)) {
+ SSLerr(SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM,
+ SSL_R_MISSING_RSA_ENCRYPTING_CERT);
+ goto f_err;
+ } else if (SSL_C_IS_EXPORT(s->s3->tmp.new_cipher)) {
+ if (pkey_bits <= SSL_C_EXPORT_PKEYLENGTH(s->s3->tmp.new_cipher)) {
+ if (!has_bits(i, EVP_PK_RSA | EVP_PKT_ENC)) {
+ SSLerr(SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM,
+ SSL_R_MISSING_RSA_ENCRYPTING_CERT);
+ goto f_err;
+ }
+ if (rsa != NULL) {
+ /* server key exchange is not allowed. */
+ al = SSL_AD_INTERNAL_ERROR;
+ SSLerr(SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM, ERR_R_INTERNAL_ERROR);
+ goto f_err;
+ }
+ }
+ }
}
#endif
#ifndef OPENSSL_NO_DH
- if ((alg_k & SSL_kEDH) &&
- !(has_bits(i, EVP_PK_DH | EVP_PKT_EXCH) || (dh != NULL))) {
- SSLerr(SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM, SSL_R_MISSING_DH_KEY);
+ if ((alg_k & SSL_kEDH) && dh == NULL) {
+ al = SSL_AD_INTERNAL_ERROR;
+ SSLerr(SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM, ERR_R_INTERNAL_ERROR);
goto f_err;
- } else if ((alg_k & SSL_kDHr) && !has_bits(i, EVP_PK_DH | EVP_PKS_RSA)) {
+ }
+ if ((alg_k & SSL_kDHr) && !has_bits(i, EVP_PK_DH | EVP_PKS_RSA)) {
SSLerr(SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM,
SSL_R_MISSING_DH_RSA_CERT);
goto f_err;
}
# ifndef OPENSSL_NO_DSA
- else if ((alg_k & SSL_kDHd) && !has_bits(i, EVP_PK_DH | EVP_PKS_DSA)) {
+ if ((alg_k & SSL_kDHd) && !has_bits(i, EVP_PK_DH | EVP_PKS_DSA)) {
SSLerr(SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM,
SSL_R_MISSING_DH_DSA_CERT);
goto f_err;
}
# endif
-#endif
- if (SSL_C_IS_EXPORT(s->s3->tmp.new_cipher) && !has_bits(i, EVP_PKT_EXP)) {
+ /* Check DHE only: static DH not implemented. */
+ if (alg_k & SSL_kEDH) {
+ int dh_size = BN_num_bits(dh->p);
+ if ((!SSL_C_IS_EXPORT(s->s3->tmp.new_cipher) && dh_size < 768)
+ || (SSL_C_IS_EXPORT(s->s3->tmp.new_cipher) && dh_size < 512)) {
+ SSLerr(SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM, SSL_R_DH_KEY_TOO_SMALL);
+ goto f_err;
+ }
+ }
+#endif /* !OPENSSL_NO_DH */
+
+ if (SSL_C_IS_EXPORT(s->s3->tmp.new_cipher) &&
+ pkey_bits > SSL_C_EXPORT_PKEYLENGTH(s->s3->tmp.new_cipher)) {
#ifndef OPENSSL_NO_RSA
if (alg_k & SSL_kRSA) {
- if (rsa == NULL
- || RSA_size(rsa) * 8 >
+ if (rsa == NULL) {
+ SSLerr(SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM,
+ SSL_R_MISSING_EXPORT_TMP_RSA_KEY);
+ goto f_err;
+ } else if (BN_num_bits(rsa->n) >
SSL_C_EXPORT_PKEYLENGTH(s->s3->tmp.new_cipher)) {
+ /* We have a temporary RSA key but it's too large. */
+ al = SSL_AD_EXPORT_RESTRICTION;
SSLerr(SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM,
SSL_R_MISSING_EXPORT_TMP_RSA_KEY);
goto f_err;
@@ -3263,14 +3399,21 @@ int ssl3_check_cert_and_algorithm(SSL *s)
} else
#endif
#ifndef OPENSSL_NO_DH
- if (alg_k & (SSL_kEDH | SSL_kDHr | SSL_kDHd)) {
- if (dh == NULL
- || DH_size(dh) * 8 >
+ if (alg_k & SSL_kEDH) {
+ if (BN_num_bits(dh->p) >
SSL_C_EXPORT_PKEYLENGTH(s->s3->tmp.new_cipher)) {
+ /* We have a temporary DH key but it's too large. */
+ al = SSL_AD_EXPORT_RESTRICTION;
SSLerr(SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM,
SSL_R_MISSING_EXPORT_TMP_DH_KEY);
goto f_err;
}
+ } else if (alg_k & (SSL_kDHr | SSL_kDHd)) {
+ /* The cert should have had an export DH key. */
+ al = SSL_AD_EXPORT_RESTRICTION;
+ SSLerr(SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM,
+ SSL_R_MISSING_EXPORT_TMP_DH_KEY);
+ goto f_err;
} else
#endif
{
@@ -3281,12 +3424,62 @@ int ssl3_check_cert_and_algorithm(SSL *s)
}
return (1);
f_err:
- ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE);
+ ssl3_send_alert(s, SSL3_AL_FATAL, al);
err:
return (0);
}
-#if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG)
+#ifndef OPENSSL_NO_TLSEXT
+/*
+ * Normally, we can tell if the server is resuming the session from
+ * the session ID. EAP-FAST (RFC 4851), however, relies on the next server
+ * message after the ServerHello to determine if the server is resuming.
+ * Therefore, we allow EAP-FAST to peek ahead.
+ * ssl3_check_finished returns 1 if we are resuming from an external
+ * pre-shared secret, we have a "ticket" and the next server handshake message
+ * is Finished; and 0 otherwise. It returns -1 upon an error.
+ */
+static int ssl3_check_finished(SSL *s)
+{
+ int ok = 0;
+
+ if (s->version < TLS1_VERSION || !s->tls_session_secret_cb ||
+ !s->session->tlsext_tick)
+ return 0;
+
+ /* Need to permit this temporarily, in case the next message is Finished. */
+ s->s3->flags |= SSL3_FLAGS_CCS_OK;
+ /*
+ * This function is called when we might get a Certificate message instead,
+ * so permit appropriate message length.
+ * We ignore the return value as we're only interested in the message type
+ * and not its length.
+ */
+ s->method->ssl_get_message(s,
+ SSL3_ST_CR_CERT_A,
+ SSL3_ST_CR_CERT_B,
+ -1, s->max_cert_list, &ok);
+ s->s3->flags &= ~SSL3_FLAGS_CCS_OK;
+
+ if (!ok)
+ return -1;
+
+ s->s3->tmp.reuse_message = 1;
+
+ if (s->s3->tmp.message_type == SSL3_MT_FINISHED)
+ return 1;
+
+ /* If we're not done, then the CCS arrived early and we should bail. */
+ if (s->s3->change_cipher_spec) {
+ SSLerr(SSL_F_SSL3_CHECK_FINISHED, SSL_R_CCS_RECEIVED_EARLY);
+ ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE);
+ return -1;
+ }
+
+ return 0;
+}
+
+# ifndef OPENSSL_NO_NEXTPROTONEG
int ssl3_send_next_proto(SSL *s)
{
unsigned int len, padding_len;
@@ -3309,8 +3502,8 @@ int ssl3_send_next_proto(SSL *s)
return ssl3_do_write(s, SSL3_RT_HANDSHAKE);
}
-#endif /* !OPENSSL_NO_TLSEXT &&
- * !OPENSSL_NO_NEXTPROTONEG */
+#endif /* !OPENSSL_NO_NEXTPROTONEG */
+#endif /* !OPENSSL_NO_TLSEXT */
int ssl_do_client_cert_cb(SSL *s, X509 **px509, EVP_PKEY **ppkey)
{
diff --git a/crypto/openssl/ssl/s3_pkt.c b/crypto/openssl/ssl/s3_pkt.c
index 7c9f20c..25cf929 100644
--- a/crypto/openssl/ssl/s3_pkt.c
+++ b/crypto/openssl/ssl/s3_pkt.c
@@ -347,11 +347,22 @@ static int ssl3_get_record(SSL *s)
if (version != s->version) {
SSLerr(SSL_F_SSL3_GET_RECORD, SSL_R_WRONG_VERSION_NUMBER);
if ((s->version & 0xFF00) == (version & 0xFF00)
- && !s->enc_write_ctx && !s->write_hash)
+ && !s->enc_write_ctx && !s->write_hash) {
+ if (rr->type == SSL3_RT_ALERT) {
+ /*
+ * The record is using an incorrect version number, but
+ * what we've got appears to be an alert. We haven't
+ * read the body yet to check whether its a fatal or
+ * not - but chances are it is. We probably shouldn't
+ * send a fatal alert back. We'll just end.
+ */
+ goto err;
+ }
/*
* Send back error using their minor version number :-)
*/
s->version = (unsigned short)version;
+ }
al = SSL_AD_PROTOCOL_VERSION;
goto f_err;
}
diff --git a/crypto/openssl/ssl/s3_srvr.c b/crypto/openssl/ssl/s3_srvr.c
index b8f91bc..9aa3292 100644
--- a/crypto/openssl/ssl/s3_srvr.c
+++ b/crypto/openssl/ssl/s3_srvr.c
@@ -266,6 +266,7 @@ int ssl3_accept(SSL *s)
if ((s->version >> 8) != 3) {
SSLerr(SSL_F_SSL3_ACCEPT, ERR_R_INTERNAL_ERROR);
+ s->state = SSL_ST_ERR;
return -1;
}
s->type = SSL_ST_ACCEPT;
@@ -273,11 +274,13 @@ int ssl3_accept(SSL *s)
if (s->init_buf == NULL) {
if ((buf = BUF_MEM_new()) == NULL) {
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
if (!BUF_MEM_grow(buf, SSL3_RT_MAX_PLAIN_LENGTH)) {
BUF_MEM_free(buf);
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
s->init_buf = buf;
@@ -285,6 +288,7 @@ int ssl3_accept(SSL *s)
if (!ssl3_setup_buffers(s)) {
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
@@ -303,6 +307,7 @@ int ssl3_accept(SSL *s)
*/
if (!ssl_init_wbio_buffer(s, 1)) {
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
@@ -320,6 +325,7 @@ int ssl3_accept(SSL *s)
SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED);
ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE);
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
} else {
/*
@@ -379,6 +385,7 @@ int ssl3_accept(SSL *s)
SSLerr(SSL_F_SSL3_ACCEPT, SSL_R_CLIENTHELLO_TLSEXT);
ret = SSL_TLSEXT_ERR_ALERT_FATAL;
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
}
@@ -529,9 +536,12 @@ int ssl3_accept(SSL *s)
skip = 1;
s->s3->tmp.cert_request = 0;
s->state = SSL3_ST_SW_SRVR_DONE_A;
- if (s->s3->handshake_buffer)
- if (!ssl3_digest_cached_records(s))
+ if (s->s3->handshake_buffer) {
+ if (!ssl3_digest_cached_records(s)) {
+ s->state = SSL_ST_ERR;
return -1;
+ }
+ }
} else {
s->s3->tmp.cert_request = 1;
ret = ssl3_send_certificate_request(s);
@@ -629,11 +639,14 @@ int ssl3_accept(SSL *s)
*/
if (!s->s3->handshake_buffer) {
SSLerr(SSL_F_SSL3_ACCEPT, ERR_R_INTERNAL_ERROR);
+ s->state = SSL_ST_ERR;
return -1;
}
s->s3->flags |= TLS1_FLAGS_KEEP_HANDSHAKE;
- if (!ssl3_digest_cached_records(s))
+ if (!ssl3_digest_cached_records(s)) {
+ s->state = SSL_ST_ERR;
return -1;
+ }
} else {
int offset = 0;
int dgst_num;
@@ -647,9 +660,12 @@ int ssl3_accept(SSL *s)
* CertificateVerify should be generalized. But it is next
* step
*/
- if (s->s3->handshake_buffer)
- if (!ssl3_digest_cached_records(s))
+ if (s->s3->handshake_buffer) {
+ if (!ssl3_digest_cached_records(s)) {
+ s->state = SSL_ST_ERR;
return -1;
+ }
+ }
for (dgst_num = 0; dgst_num < SSL_MAX_DIGEST; dgst_num++)
if (s->s3->handshake_dgst[dgst_num]) {
int dgst_size;
@@ -665,6 +681,7 @@ int ssl3_accept(SSL *s)
dgst_size =
EVP_MD_CTX_size(s->s3->handshake_dgst[dgst_num]);
if (dgst_size < 0) {
+ s->state = SSL_ST_ERR;
ret = -1;
goto end;
}
@@ -675,15 +692,6 @@ int ssl3_accept(SSL *s)
case SSL3_ST_SR_CERT_VRFY_A:
case SSL3_ST_SR_CERT_VRFY_B:
- /*
- * This *should* be the first time we enable CCS, but be
- * extra careful about surrounding code changes. We need
- * to set this here because we don't know if we're
- * expecting a CertificateVerify or not.
- */
- if (!s->s3->change_cipher_spec)
- s->s3->flags |= SSL3_FLAGS_CCS_OK;
- /* we should decide if we expected this one */
ret = ssl3_get_cert_verify(s);
if (ret <= 0)
goto end;
@@ -703,11 +711,10 @@ int ssl3_accept(SSL *s)
case SSL3_ST_SR_NEXT_PROTO_A:
case SSL3_ST_SR_NEXT_PROTO_B:
/*
- * Enable CCS for resumed handshakes with NPN.
- * In a full handshake with NPN, we end up here through
- * SSL3_ST_SR_CERT_VRFY_B, where SSL3_FLAGS_CCS_OK was
- * already set. Receiving a CCS clears the flag, so make
- * sure not to re-enable it to ban duplicates.
+ * Enable CCS for NPN. Receiving a CCS clears the flag, so make
+ * sure not to re-enable it to ban duplicates. This *should* be the
+ * first time we have received one - but we check anyway to be
+ * cautious.
* s->s3->change_cipher_spec is set when a CCS is
* processed in s3_pkt.c, and remains set until
* the client's Finished message is read.
@@ -726,10 +733,8 @@ int ssl3_accept(SSL *s)
case SSL3_ST_SR_FINISHED_A:
case SSL3_ST_SR_FINISHED_B:
/*
- * Enable CCS for resumed handshakes without NPN.
- * In a full handshake, we end up here through
- * SSL3_ST_SR_CERT_VRFY_B, where SSL3_FLAGS_CCS_OK was
- * already set. Receiving a CCS clears the flag, so make
+ * Enable CCS for handshakes without NPN. In NPN the CCS flag has
+ * already been set. Receiving a CCS clears the flag, so make
* sure not to re-enable it to ban duplicates.
* s->s3->change_cipher_spec is set when a CCS is
* processed in s3_pkt.c, and remains set until
@@ -779,6 +784,7 @@ int ssl3_accept(SSL *s)
s->session->cipher = s->s3->tmp.new_cipher;
if (!s->method->ssl3_enc->setup_key_block(s)) {
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
@@ -795,6 +801,7 @@ int ssl3_accept(SSL *s)
SSL3_CHANGE_CIPHER_SERVER_WRITE))
{
ret = -1;
+ s->state = SSL_ST_ERR;
goto end;
}
@@ -857,6 +864,7 @@ int ssl3_accept(SSL *s)
goto end;
/* break; */
+ case SSL_ST_ERR:
default:
SSLerr(SSL_F_SSL3_ACCEPT, SSL_R_UNKNOWN_STATE);
ret = -1;
@@ -992,6 +1000,16 @@ int ssl3_get_client_hello(SSL *s)
d = p = (unsigned char *)s->init_msg;
/*
+ * 2 bytes for client version, SSL3_RANDOM_SIZE bytes for random, 1 byte
+ * for session id length
+ */
+ if (n < 2 + SSL3_RANDOM_SIZE + 1) {
+ al = SSL_AD_DECODE_ERROR;
+ SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT);
+ goto f_err;
+ }
+
+ /*
* use version from inside client hello, not from record header (may
* differ: see RFC 2246, Appendix E, second paragraph)
*/
@@ -1022,6 +1040,12 @@ int ssl3_get_client_hello(SSL *s)
unsigned int session_length, cookie_length;
session_length = *(p + SSL3_RANDOM_SIZE);
+
+ if (p + SSL3_RANDOM_SIZE + session_length + 1 >= d + n) {
+ al = SSL_AD_DECODE_ERROR;
+ SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT);
+ goto f_err;
+ }
cookie_length = *(p + SSL3_RANDOM_SIZE + session_length + 1);
if (cookie_length == 0)
@@ -1035,6 +1059,12 @@ int ssl3_get_client_hello(SSL *s)
/* get the session-id */
j = *(p++);
+ if (p + j > d + n) {
+ al = SSL_AD_DECODE_ERROR;
+ SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT);
+ goto f_err;
+ }
+
s->hit = 0;
/*
* Versions before 0.9.7 always allow clients to resume sessions in
@@ -1079,8 +1109,19 @@ int ssl3_get_client_hello(SSL *s)
if (s->version == DTLS1_VERSION || s->version == DTLS1_BAD_VER) {
/* cookie stuff */
+ if (p + 1 > d + n) {
+ al = SSL_AD_DECODE_ERROR;
+ SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT);
+ goto f_err;
+ }
cookie_len = *(p++);
+ if (p + cookie_len > d + n) {
+ al = SSL_AD_DECODE_ERROR;
+ SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT);
+ goto f_err;
+ }
+
/*
* The ClientHello may contain a cookie even if the
* HelloVerify message has not been sent--make sure that it
@@ -1121,27 +1162,33 @@ int ssl3_get_client_hello(SSL *s)
p += cookie_len;
}
+ if (p + 2 > d + n) {
+ al = SSL_AD_DECODE_ERROR;
+ SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT);
+ goto f_err;
+ }
n2s(p, i);
- if ((i == 0) && (j != 0)) {
- /* we need a cipher if we are not resuming a session */
+
+ if (i == 0) {
al = SSL_AD_ILLEGAL_PARAMETER;
SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_NO_CIPHERS_SPECIFIED);
goto f_err;
}
- if ((p + i) >= (d + n)) {
+
+ /* i bytes of cipher data + 1 byte for compression length later */
+ if ((p + i + 1) > (d + n)) {
/* not enough data */
al = SSL_AD_DECODE_ERROR;
SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_MISMATCH);
goto f_err;
}
- if ((i > 0) && (ssl_bytes_to_cipher_list(s, p, i, &(ciphers))
- == NULL)) {
+ if (ssl_bytes_to_cipher_list(s, p, i, &(ciphers)) == NULL) {
goto err;
}
p += i;
/* If it is a hit, check that the cipher is in the list */
- if ((s->hit) && (i > 0)) {
+ if (s->hit) {
j = 0;
id = s->session->cipher->id;
@@ -1377,8 +1424,8 @@ int ssl3_get_client_hello(SSL *s)
sk_SSL_CIPHER_free(s->session->ciphers);
s->session->ciphers = ciphers;
if (ciphers == NULL) {
- al = SSL_AD_ILLEGAL_PARAMETER;
- SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_NO_CIPHERS_PASSED);
+ al = SSL_AD_INTERNAL_ERROR;
+ SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, ERR_R_INTERNAL_ERROR);
goto f_err;
}
ciphers = NULL;
@@ -1450,8 +1497,10 @@ int ssl3_get_client_hello(SSL *s)
if (0) {
f_err:
ssl3_send_alert(s, SSL3_AL_FATAL, al);
- }
err:
+ s->state = SSL_ST_ERR;
+ }
+
if (ciphers != NULL)
sk_SSL_CIPHER_free(ciphers);
return (ret);
@@ -1468,8 +1517,10 @@ int ssl3_send_server_hello(SSL *s)
buf = (unsigned char *)s->init_buf->data;
#ifdef OPENSSL_NO_TLSEXT
p = s->s3->server_random;
- if (ssl_fill_hello_random(s, 1, p, SSL3_RANDOM_SIZE) <= 0)
+ if (ssl_fill_hello_random(s, 1, p, SSL3_RANDOM_SIZE) <= 0) {
+ s->state = SSL_ST_ERR;
return -1;
+ }
#endif
/* Do the message type and length last */
d = p = &(buf[4]);
@@ -1504,6 +1555,7 @@ int ssl3_send_server_hello(SSL *s)
sl = s->session->session_id_length;
if (sl > (int)sizeof(s->session->session_id)) {
SSLerr(SSL_F_SSL3_SEND_SERVER_HELLO, ERR_R_INTERNAL_ERROR);
+ s->state = SSL_ST_ERR;
return -1;
}
*(p++) = sl;
@@ -1526,6 +1578,7 @@ int ssl3_send_server_hello(SSL *s)
#ifndef OPENSSL_NO_TLSEXT
if (ssl_prepare_serverhello_tlsext(s) <= 0) {
SSLerr(SSL_F_SSL3_SEND_SERVER_HELLO, SSL_R_SERVERHELLO_TLSEXT);
+ s->state = SSL_ST_ERR;
return -1;
}
if ((p =
@@ -1533,6 +1586,7 @@ int ssl3_send_server_hello(SSL *s)
buf + SSL3_RT_MAX_PLAIN_LENGTH)) ==
NULL) {
SSLerr(SSL_F_SSL3_SEND_SERVER_HELLO, ERR_R_INTERNAL_ERROR);
+ s->state = SSL_ST_ERR;
return -1;
}
#endif
@@ -2016,6 +2070,7 @@ int ssl3_send_server_key_exchange(SSL *s)
BN_CTX_free(bn_ctx);
#endif
EVP_MD_CTX_cleanup(&md_ctx);
+ s->state = SSL_ST_ERR;
return (-1);
}
@@ -2113,6 +2168,7 @@ int ssl3_send_certificate_request(SSL *s)
/* SSL3_ST_SW_CERT_REQ_B */
return (ssl3_do_write(s, SSL3_RT_HANDSHAKE));
err:
+ s->state = SSL_ST_ERR;
return (-1);
}
@@ -2367,6 +2423,7 @@ int ssl3_get_client_key_exchange(SSL *s)
int padl, outl;
krb5_timestamp authtime = 0;
krb5_ticket_times ttimes;
+ int kerr = 0;
EVP_CIPHER_CTX_init(&ciph_ctx);
@@ -2470,23 +2527,27 @@ int ssl3_get_client_key_exchange(SSL *s)
{
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,
SSL_R_DECRYPTION_FAILED);
- goto err;
+ kerr = 1;
+ goto kclean;
}
if (outl > SSL_MAX_MASTER_KEY_LENGTH) {
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,
SSL_R_DATA_LENGTH_TOO_LONG);
- goto err;
+ kerr = 1;
+ goto kclean;
}
if (!EVP_DecryptFinal_ex(&ciph_ctx, &(pms[outl]), &padl)) {
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,
SSL_R_DECRYPTION_FAILED);
- goto err;
+ kerr = 1;
+ goto kclean;
}
outl += padl;
if (outl > SSL_MAX_MASTER_KEY_LENGTH) {
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,
SSL_R_DATA_LENGTH_TOO_LONG);
- goto err;
+ kerr = 1;
+ goto kclean;
}
if (!((pms[0] == (s->client_version >> 8))
&& (pms[1] == (s->client_version & 0xff)))) {
@@ -2503,7 +2564,8 @@ int ssl3_get_client_key_exchange(SSL *s)
if (!(s->options & SSL_OP_TLS_ROLLBACK_BUG)) {
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,
SSL_AD_DECODE_ERROR);
- goto err;
+ kerr = 1;
+ goto kclean;
}
}
@@ -2529,6 +2591,11 @@ int ssl3_get_client_key_exchange(SSL *s)
* kssl_ctx = kssl_ctx_free(kssl_ctx);
* if (s->kssl_ctx) s->kssl_ctx = NULL;
*/
+
+ kclean:
+ OPENSSL_cleanse(pms, sizeof(pms));
+ if (kerr)
+ goto err;
} else
#endif /* OPENSSL_NO_KRB5 */
@@ -2847,6 +2914,7 @@ int ssl3_get_client_key_exchange(SSL *s)
s->
session->master_key,
premaster_secret, 32);
+ OPENSSL_cleanse(premaster_secret, sizeof(premaster_secret));
/* Check if pubkey from client certificate was used */
if (EVP_PKEY_CTX_ctrl
(pkey_ctx, -1, -1, EVP_PKEY_CTRL_PEER_KEY, 2, NULL) > 0)
@@ -2879,6 +2947,7 @@ int ssl3_get_client_key_exchange(SSL *s)
EC_KEY_free(srvr_ecdh);
BN_CTX_free(bn_ctx);
#endif
+ s->state = SSL_ST_ERR;
return (-1);
}
@@ -2894,39 +2963,31 @@ int ssl3_get_cert_verify(SSL *s)
EVP_MD_CTX mctx;
EVP_MD_CTX_init(&mctx);
+ /*
+ * We should only process a CertificateVerify message if we have received
+ * a Certificate from the client. If so then |s->session->peer| will be non
+ * NULL. In some instances a CertificateVerify message is not required even
+ * if the peer has sent a Certificate (e.g. such as in the case of static
+ * DH). In that case the ClientKeyExchange processing will skip the
+ * CertificateVerify state so we should not arrive here.
+ */
+ if (s->session->peer == NULL) {
+ ret = 1;
+ goto end;
+ }
+
n = s->method->ssl_get_message(s,
SSL3_ST_SR_CERT_VRFY_A,
SSL3_ST_SR_CERT_VRFY_B,
- -1, SSL3_RT_MAX_PLAIN_LENGTH, &ok);
+ SSL3_MT_CERTIFICATE_VERIFY,
+ SSL3_RT_MAX_PLAIN_LENGTH, &ok);
if (!ok)
return ((int)n);
- if (s->session->peer != NULL) {
- peer = s->session->peer;
- pkey = X509_get_pubkey(peer);
- type = X509_certificate_type(peer, pkey);
- } else {
- peer = NULL;
- pkey = NULL;
- }
-
- if (s->s3->tmp.message_type != SSL3_MT_CERTIFICATE_VERIFY) {
- s->s3->tmp.reuse_message = 1;
- if (peer != NULL) {
- al = SSL_AD_UNEXPECTED_MESSAGE;
- SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_MISSING_VERIFY_MESSAGE);
- goto f_err;
- }
- ret = 1;
- goto end;
- }
-
- if (peer == NULL) {
- SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_NO_CLIENT_CERT_RECEIVED);
- al = SSL_AD_UNEXPECTED_MESSAGE;
- goto f_err;
- }
+ peer = s->session->peer;
+ pkey = X509_get_pubkey(peer);
+ type = X509_certificate_type(peer, pkey);
if (!(type & EVP_PKT_SIGN)) {
SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,
@@ -2935,12 +2996,6 @@ int ssl3_get_cert_verify(SSL *s)
goto f_err;
}
- if (s->s3->change_cipher_spec) {
- SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_CCS_RECEIVED_EARLY);
- al = SSL_AD_UNEXPECTED_MESSAGE;
- goto f_err;
- }
-
/* we now have a signature that we need to verify */
p = (unsigned char *)s->init_msg;
/* Check for broken implementations of GOST ciphersuites */
@@ -3093,6 +3148,7 @@ int ssl3_get_cert_verify(SSL *s)
if (0) {
f_err:
ssl3_send_alert(s, SSL3_AL_FATAL, al);
+ s->state = SSL_ST_ERR;
}
end:
if (s->s3->handshake_buffer) {
@@ -3251,8 +3307,10 @@ int ssl3_get_client_certificate(SSL *s)
if (0) {
f_err:
ssl3_send_alert(s, SSL3_AL_FATAL, al);
- }
err:
+ s->state = SSL_ST_ERR;
+ }
+
if (x != NULL)
X509_free(x);
if (sk != NULL)
@@ -3273,6 +3331,7 @@ int ssl3_send_server_certificate(SSL *s)
(s->s3->tmp.new_cipher->algorithm_mkey & SSL_kKRB5)) {
SSLerr(SSL_F_SSL3_SEND_SERVER_CERTIFICATE,
ERR_R_INTERNAL_ERROR);
+ s->state = SSL_ST_ERR;
return (0);
}
}
@@ -3280,6 +3339,7 @@ int ssl3_send_server_certificate(SSL *s)
l = ssl3_output_cert_chain(s, x);
if (!l) {
SSLerr(SSL_F_SSL3_SEND_SERVER_CERTIFICATE, ERR_R_INTERNAL_ERROR);
+ s->state = SSL_ST_ERR;
return (0);
}
s->state = SSL3_ST_SW_CERT_B;
@@ -3315,11 +3375,15 @@ int ssl3_send_newsession_ticket(SSL *s)
* Some length values are 16 bits, so forget it if session is too
* long
*/
- if (slen_full == 0 || slen_full > 0xFF00)
+ if (slen_full == 0 || slen_full > 0xFF00) {
+ s->state = SSL_ST_ERR;
return -1;
+ }
senc = OPENSSL_malloc(slen_full);
- if (!senc)
+ if (!senc) {
+ s->state = SSL_ST_ERR;
return -1;
+ }
EVP_CIPHER_CTX_init(&ctx);
HMAC_CTX_init(&hctx);
@@ -3442,6 +3506,7 @@ int ssl3_send_newsession_ticket(SSL *s)
OPENSSL_free(senc);
EVP_CIPHER_CTX_cleanup(&ctx);
HMAC_CTX_cleanup(&hctx);
+ s->state = SSL_ST_ERR;
return -1;
}
@@ -3455,8 +3520,10 @@ int ssl3_send_cert_status(SSL *s)
* 1 (ocsp response type) + 3 (ocsp response length)
* + (ocsp response)
*/
- if (!BUF_MEM_grow(s->init_buf, 8 + s->tlsext_ocsp_resplen))
+ if (!BUF_MEM_grow(s->init_buf, 8 + s->tlsext_ocsp_resplen)) {
+ s->state = SSL_ST_ERR;
return -1;
+ }
p = (unsigned char *)s->init_buf->data;
@@ -3499,6 +3566,7 @@ int ssl3_get_next_proto(SSL *s)
if (!s->s3->next_proto_neg_seen) {
SSLerr(SSL_F_SSL3_GET_NEXT_PROTO,
SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION);
+ s->state = SSL_ST_ERR;
return -1;
}
@@ -3518,11 +3586,14 @@ int ssl3_get_next_proto(SSL *s)
*/
if (!s->s3->change_cipher_spec) {
SSLerr(SSL_F_SSL3_GET_NEXT_PROTO, SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS);
+ s->state = SSL_ST_ERR;
return -1;
}
- if (n < 2)
+ if (n < 2) {
+ s->state = SSL_ST_ERR;
return 0; /* The body must be > 1 bytes long */
+ }
p = (unsigned char *)s->init_msg;
@@ -3534,15 +3605,20 @@ int ssl3_get_next_proto(SSL *s)
* uint8 padding[padding_len];
*/
proto_len = p[0];
- if (proto_len + 2 > s->init_num)
+ if (proto_len + 2 > s->init_num) {
+ s->state = SSL_ST_ERR;
return 0;
+ }
padding_len = p[proto_len + 1];
- if (proto_len + padding_len + 2 != s->init_num)
+ if (proto_len + padding_len + 2 != s->init_num) {
+ s->state = SSL_ST_ERR;
return 0;
+ }
s->next_proto_negotiated = OPENSSL_malloc(proto_len);
if (!s->next_proto_negotiated) {
SSLerr(SSL_F_SSL3_GET_NEXT_PROTO, ERR_R_MALLOC_FAILURE);
+ s->state = SSL_ST_ERR;
return 0;
}
memcpy(s->next_proto_negotiated, p + 1, proto_len);
diff --git a/crypto/openssl/ssl/ssl.h b/crypto/openssl/ssl/ssl.h
index b93b67b..d2ab0c0 100644
--- a/crypto/openssl/ssl/ssl.h
+++ b/crypto/openssl/ssl/ssl.h
@@ -1544,6 +1544,7 @@ extern "C" {
# define SSL_ST_BEFORE 0x4000
# define SSL_ST_OK 0x03
# define SSL_ST_RENEGOTIATE (0x04|SSL_ST_INIT)
+# define SSL_ST_ERR 0x05
# define SSL_CB_LOOP 0x01
# define SSL_CB_EXIT 0x02
@@ -2303,6 +2304,7 @@ void ERR_load_SSL_strings(void);
# define SSL_F_SSL3_CHANGE_CIPHER_STATE 129
# define SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM 130
# define SSL_F_SSL3_CHECK_CLIENT_HELLO 304
+# define SSL_F_SSL3_CHECK_FINISHED 339
# define SSL_F_SSL3_CLIENT_HELLO 131
# define SSL_F_SSL3_CONNECT 132
# define SSL_F_SSL3_CTRL 213
@@ -2408,6 +2410,7 @@ void ERR_load_SSL_strings(void);
# define SSL_F_SSL_READ 223
# define SSL_F_SSL_RSA_PRIVATE_DECRYPT 187
# define SSL_F_SSL_RSA_PUBLIC_ENCRYPT 188
+# define SSL_F_SSL_SESSION_DUP 348
# define SSL_F_SSL_SESSION_NEW 189
# define SSL_F_SSL_SESSION_PRINT_FP 190
# define SSL_F_SSL_SESSION_SET1_ID_CONTEXT 312
@@ -2522,6 +2525,7 @@ void ERR_load_SSL_strings(void);
# define SSL_R_DATA_LENGTH_TOO_LONG 146
# define SSL_R_DECRYPTION_FAILED 147
# define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC 281
+# define SSL_R_DH_KEY_TOO_SMALL 372
# define SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG 148
# define SSL_R_DIGEST_CHECK_FAILED 149
# define SSL_R_DTLS_MESSAGE_TOO_BIG 334
diff --git a/crypto/openssl/ssl/ssl_err.c b/crypto/openssl/ssl/ssl_err.c
index ac7312e..88621b7 100644
--- a/crypto/openssl/ssl/ssl_err.c
+++ b/crypto/openssl/ssl/ssl_err.c
@@ -160,6 +160,7 @@ static ERR_STRING_DATA SSL_str_functs[] = {
{ERR_FUNC(SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC),
"SSL3_DO_CHANGE_CIPHER_SPEC"},
{ERR_FUNC(SSL_F_SSL3_ENC), "SSL3_ENC"},
+ {ERR_FUNC(SSL_F_SSL3_CHECK_FINISHED), "SSL3_CHECK_FINISHED"},
{ERR_FUNC(SSL_F_SSL3_GENERATE_KEY_BLOCK), "SSL3_GENERATE_KEY_BLOCK"},
{ERR_FUNC(SSL_F_SSL3_GET_CERTIFICATE_REQUEST),
"SSL3_GET_CERTIFICATE_REQUEST"},
@@ -298,6 +299,7 @@ static ERR_STRING_DATA SSL_str_functs[] = {
{ERR_FUNC(SSL_F_SSL_READ), "SSL_read"},
{ERR_FUNC(SSL_F_SSL_RSA_PRIVATE_DECRYPT), "SSL_RSA_PRIVATE_DECRYPT"},
{ERR_FUNC(SSL_F_SSL_RSA_PUBLIC_ENCRYPT), "SSL_RSA_PUBLIC_ENCRYPT"},
+ {ERR_FUNC(SSL_F_SSL_SESSION_DUP), "ssl_session_dup"},
{ERR_FUNC(SSL_F_SSL_SESSION_NEW), "SSL_SESSION_new"},
{ERR_FUNC(SSL_F_SSL_SESSION_PRINT_FP), "SSL_SESSION_print_fp"},
{ERR_FUNC(SSL_F_SSL_SESSION_SET1_ID_CONTEXT),
@@ -440,6 +442,7 @@ static ERR_STRING_DATA SSL_str_reasons[] = {
{ERR_REASON(SSL_R_DECRYPTION_FAILED), "decryption failed"},
{ERR_REASON(SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC),
"decryption failed or bad record mac"},
+ {ERR_REASON(SSL_R_DH_KEY_TOO_SMALL), "dh key too small"},
{ERR_REASON(SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG),
"dh public value length is wrong"},
{ERR_REASON(SSL_R_DIGEST_CHECK_FAILED), "digest check failed"},
diff --git a/crypto/openssl/ssl/ssl_lib.c b/crypto/openssl/ssl/ssl_lib.c
index dead126..e11746a 100644
--- a/crypto/openssl/ssl/ssl_lib.c
+++ b/crypto/openssl/ssl/ssl_lib.c
@@ -1440,9 +1440,13 @@ STACK_OF(SSL_CIPHER) *ssl_bytes_to_cipher_list(SSL *s, unsigned char *p,
SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST);
return (NULL);
}
- if ((skp == NULL) || (*skp == NULL))
+ if ((skp == NULL) || (*skp == NULL)) {
sk = sk_SSL_CIPHER_new_null(); /* change perhaps later */
- else {
+ if(sk == NULL) {
+ SSLerr(SSL_F_SSL_BYTES_TO_CIPHER_LIST, ERR_R_MALLOC_FAILURE);
+ return NULL;
+ }
+ } else {
sk = *skp;
sk_SSL_CIPHER_zero(sk);
}
diff --git a/crypto/openssl/ssl/ssl_locl.h b/crypto/openssl/ssl/ssl_locl.h
index aff3b65..a7f3f8d 100644
--- a/crypto/openssl/ssl/ssl_locl.h
+++ b/crypto/openssl/ssl/ssl_locl.h
@@ -865,6 +865,7 @@ int ssl_set_peer_cert_type(SESS_CERT *c, int type);
int ssl_get_new_session(SSL *s, int session);
int ssl_get_prev_session(SSL *s, unsigned char *session, int len,
const unsigned char *limit);
+SSL_SESSION *ssl_session_dup(SSL_SESSION *src, int ticket);
int ssl_cipher_id_cmp(const SSL_CIPHER *a, const SSL_CIPHER *b);
DECLARE_OBJ_BSEARCH_GLOBAL_CMP_FN(SSL_CIPHER, SSL_CIPHER, ssl_cipher_id);
int ssl_cipher_ptr_id_cmp(const SSL_CIPHER *const *ap,
diff --git a/crypto/openssl/ssl/ssl_sess.c b/crypto/openssl/ssl/ssl_sess.c
index fb4e8c5..1ad9dc7 100644
--- a/crypto/openssl/ssl/ssl_sess.c
+++ b/crypto/openssl/ssl/ssl_sess.c
@@ -227,6 +227,130 @@ SSL_SESSION *SSL_SESSION_new(void)
return (ss);
}
+/*
+ * Create a new SSL_SESSION and duplicate the contents of |src| into it. If
+ * ticket == 0 then no ticket information is duplicated, otherwise it is.
+ */
+SSL_SESSION *ssl_session_dup(SSL_SESSION *src, int ticket)
+{
+ SSL_SESSION *dest;
+
+ dest = OPENSSL_malloc(sizeof(*src));
+ if (dest == NULL) {
+ goto err;
+ }
+ memcpy(dest, src, sizeof(*dest));
+
+ /*
+ * Set the various pointers to NULL so that we can call SSL_SESSION_free in
+ * the case of an error whilst halfway through constructing dest
+ */
+#ifndef OPENSSL_NO_PSK
+ dest->psk_identity_hint = NULL;
+ dest->psk_identity = NULL;
+#endif
+ dest->ciphers = NULL;
+#ifndef OPENSSL_NO_TLSEXT
+ dest->tlsext_hostname = NULL;
+# ifndef OPENSSL_NO_EC
+ dest->tlsext_ecpointformatlist = NULL;
+ dest->tlsext_ellipticcurvelist = NULL;
+# endif
+#endif
+ dest->tlsext_tick = NULL;
+#ifndef OPENSSL_NO_SRP
+ dest->srp_username = NULL;
+#endif
+ memset(&dest->ex_data, 0, sizeof(dest->ex_data));
+
+ /* We deliberately don't copy the prev and next pointers */
+ dest->prev = NULL;
+ dest->next = NULL;
+
+ dest->references = 1;
+
+ if (src->sess_cert != NULL)
+ CRYPTO_add(&src->sess_cert->references, 1, CRYPTO_LOCK_SSL_SESS_CERT);
+
+ if (src->peer != NULL)
+ CRYPTO_add(&src->peer->references, 1, CRYPTO_LOCK_X509);
+
+#ifndef OPENSSL_NO_PSK
+ if (src->psk_identity_hint) {
+ dest->psk_identity_hint = BUF_strdup(src->psk_identity_hint);
+ if (dest->psk_identity_hint == NULL) {
+ goto err;
+ }
+ }
+ if (src->psk_identity) {
+ dest->psk_identity = BUF_strdup(src->psk_identity);
+ if (dest->psk_identity == NULL) {
+ goto err;
+ }
+ }
+#endif
+
+ if(src->ciphers != NULL) {
+ dest->ciphers = sk_SSL_CIPHER_dup(src->ciphers);
+ if (dest->ciphers == NULL)
+ goto err;
+ }
+
+ if (!CRYPTO_dup_ex_data(CRYPTO_EX_INDEX_SSL_SESSION,
+ &dest->ex_data, &src->ex_data)) {
+ goto err;
+ }
+
+#ifndef OPENSSL_NO_TLSEXT
+ if (src->tlsext_hostname) {
+ dest->tlsext_hostname = BUF_strdup(src->tlsext_hostname);
+ if (dest->tlsext_hostname == NULL) {
+ goto err;
+ }
+ }
+# ifndef OPENSSL_NO_EC
+ if (src->tlsext_ecpointformatlist) {
+ dest->tlsext_ecpointformatlist =
+ BUF_memdup(src->tlsext_ecpointformatlist,
+ src->tlsext_ecpointformatlist_length);
+ if (dest->tlsext_ecpointformatlist == NULL)
+ goto err;
+ }
+ if (src->tlsext_ellipticcurvelist) {
+ dest->tlsext_ellipticcurvelist =
+ BUF_memdup(src->tlsext_ellipticcurvelist,
+ src->tlsext_ellipticcurvelist_length);
+ if (dest->tlsext_ellipticcurvelist == NULL)
+ goto err;
+ }
+# endif
+#endif
+
+ if (ticket != 0) {
+ dest->tlsext_tick = BUF_memdup(src->tlsext_tick, src->tlsext_ticklen);
+ if(dest->tlsext_tick == NULL)
+ goto err;
+ } else {
+ dest->tlsext_tick_lifetime_hint = 0;
+ dest->tlsext_ticklen = 0;
+ }
+
+#ifndef OPENSSL_NO_SRP
+ if (src->srp_username) {
+ dest->srp_username = BUF_strdup(src->srp_username);
+ if (dest->srp_username == NULL) {
+ goto err;
+ }
+ }
+#endif
+
+ return dest;
+err:
+ SSLerr(SSL_F_SSL_SESSION_DUP, ERR_R_MALLOC_FAILURE);
+ SSL_SESSION_free(dest);
+ return NULL;
+}
+
const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s,
unsigned int *len)
{
@@ -478,9 +602,14 @@ int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len,
int r;
#endif
- if (len > SSL_MAX_SSL_SESSION_ID_LENGTH)
+ if (len < 0 || len > SSL_MAX_SSL_SESSION_ID_LENGTH)
goto err;
+ if (session_id + len > limit) {
+ fatal = 1;
+ goto err;
+ }
+
if (len == 0)
try_session_cache = 0;
diff --git a/crypto/openssl/ssl/ssl_stat.c b/crypto/openssl/ssl/ssl_stat.c
index d725d78..1b9069f 100644
--- a/crypto/openssl/ssl/ssl_stat.c
+++ b/crypto/openssl/ssl/ssl_stat.c
@@ -117,6 +117,9 @@ const char *SSL_state_string_long(const SSL *s)
case SSL_ST_OK | SSL_ST_ACCEPT:
str = "ok/accept SSL initialization";
break;
+ case SSL_ST_ERR:
+ str = "error";
+ break;
#ifndef OPENSSL_NO_SSL2
case SSL2_ST_CLIENT_START_ENCRYPTION:
str = "SSLv2 client start encryption";
@@ -496,6 +499,9 @@ const char *SSL_state_string(const SSL *s)
case SSL_ST_OK:
str = "SSLOK ";
break;
+ case SSL_ST_ERR:
+ str = "SSLERR";
+ break;
#ifndef OPENSSL_NO_SSL2
case SSL2_ST_CLIENT_START_ENCRYPTION:
str = "2CSENC";
diff --git a/crypto/openssl/ssl/ssltest.c b/crypto/openssl/ssl/ssltest.c
index 8efbff7..6a0c293 100644
--- a/crypto/openssl/ssl/ssltest.c
+++ b/crypto/openssl/ssl/ssltest.c
@@ -336,7 +336,9 @@ static void sv_usage(void)
" -bytes <val> - number of bytes to swap between client/server\n");
#ifndef OPENSSL_NO_DH
fprintf(stderr,
- " -dhe1024 - use 1024 bit key (safe prime) for DHE\n");
+ " -dhe512 - use 512 bit key for DHE (to test failure)\n");
+ fprintf(stderr,
+ " -dhe1024 - use 1024 bit key (safe prime) for DHE (default, no-op)\n");
fprintf(stderr,
" -dhe1024dsa - use 1024 bit key (with 160-bit subprime) for DHE\n");
fprintf(stderr, " -no_dhe - disable DHE\n");
@@ -531,7 +533,7 @@ int main(int argc, char *argv[])
long bytes = 256L;
#ifndef OPENSSL_NO_DH
DH *dh;
- int dhe1024 = 0, dhe1024dsa = 0;
+ int dhe512 = 0, dhe1024dsa = 0;
#endif
#ifndef OPENSSL_NO_ECDH
EC_KEY *ecdh = NULL;
@@ -611,19 +613,19 @@ int main(int argc, char *argv[])
debug = 1;
else if (strcmp(*argv, "-reuse") == 0)
reuse = 1;
- else if (strcmp(*argv, "-dhe1024") == 0) {
+ else if (strcmp(*argv, "-dhe512") == 0) {
#ifndef OPENSSL_NO_DH
- dhe1024 = 1;
+ dhe512 = 1;
#else
fprintf(stderr,
- "ignoring -dhe1024, since I'm compiled without DH\n");
+ "ignoring -dhe512, since I'm compiled without DH\n");
#endif
} else if (strcmp(*argv, "-dhe1024dsa") == 0) {
#ifndef OPENSSL_NO_DH
dhe1024dsa = 1;
#else
fprintf(stderr,
- "ignoring -dhe1024, since I'm compiled without DH\n");
+ "ignoring -dhe1024dsa, since I'm compiled without DH\n");
#endif
} else if (strcmp(*argv, "-no_dhe") == 0)
no_dhe = 1;
@@ -905,10 +907,10 @@ int main(int argc, char *argv[])
*/
SSL_CTX_set_options(s_ctx, SSL_OP_SINGLE_DH_USE);
dh = get_dh1024dsa();
- } else if (dhe1024)
- dh = get_dh1024();
- else
+ } else if (dhe512)
dh = get_dh512();
+ else
+ dh = get_dh1024();
SSL_CTX_set_tmp_dh(s_ctx, dh);
DH_free(dh);
}
diff --git a/crypto/openssl/ssl/t1_enc.c b/crypto/openssl/ssl/t1_enc.c
index 4e2845f..8f45294 100644
--- a/crypto/openssl/ssl/t1_enc.c
+++ b/crypto/openssl/ssl/t1_enc.c
@@ -261,7 +261,7 @@ static int tls1_PRF(long digest_mask,
if ((m << TLS1_PRF_DGST_SHIFT) & digest_mask)
count++;
}
- if(!count) {
+ if (!count) {
/* Should never happen */
SSLerr(SSL_F_TLS1_PRF, ERR_R_INTERNAL_ERROR);
goto err;
@@ -785,7 +785,7 @@ int tls1_enc(SSL *s, int send)
bs = EVP_CIPHER_block_size(ds->cipher);
if (EVP_CIPHER_flags(ds->cipher) & EVP_CIPH_FLAG_AEAD_CIPHER) {
- unsigned char buf[13], *seq;
+ unsigned char buf[EVP_AEAD_TLS1_AAD_LEN], *seq;
seq = send ? s->s3->write_sequence : s->s3->read_sequence;
@@ -809,7 +809,10 @@ int tls1_enc(SSL *s, int send)
buf[10] = (unsigned char)(s->version);
buf[11] = rec->length >> 8;
buf[12] = rec->length & 0xff;
- pad = EVP_CIPHER_CTX_ctrl(ds, EVP_CTRL_AEAD_TLS1_AAD, 13, buf);
+ pad = EVP_CIPHER_CTX_ctrl(ds, EVP_CTRL_AEAD_TLS1_AAD,
+ EVP_AEAD_TLS1_AAD_LEN, buf);
+ if (pad <= 0)
+ return -1;
if (send) {
l += pad;
rec->length += pad;
diff --git a/crypto/openssl/ssl/t1_lib.c b/crypto/openssl/ssl/t1_lib.c
index 243a70f..d70b93f 100644
--- a/crypto/openssl/ssl/t1_lib.c
+++ b/crypto/openssl/ssl/t1_lib.c
@@ -1016,19 +1016,23 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d,
s->srtp_profile = NULL;
- if (data >= (d + n - 2))
+ if (data == d + n)
goto ri_check;
+
+ if (data > (d + n - 2))
+ goto err;
+
n2s(data, len);
if (data > (d + n - len))
- goto ri_check;
+ goto err;
while (data <= (d + n - 4)) {
n2s(data, type);
n2s(data, size);
if (data + size > (d + n))
- goto ri_check;
+ goto err;
# if 0
fprintf(stderr, "Received extension type %d size %d\n", type, size);
# endif
@@ -1064,16 +1068,12 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d,
int servname_type;
int dsize;
- if (size < 2) {
- *al = SSL_AD_DECODE_ERROR;
- return 0;
- }
+ if (size < 2)
+ goto err;
n2s(data, dsize);
size -= 2;
- if (dsize > size) {
- *al = SSL_AD_DECODE_ERROR;
- return 0;
- }
+ if (dsize > size)
+ goto err;
sdata = data;
while (dsize > 3) {
@@ -1081,18 +1081,16 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d,
n2s(sdata, len);
dsize -= 3;
- if (len > dsize) {
- *al = SSL_AD_DECODE_ERROR;
- return 0;
- }
+ if (len > dsize)
+ goto err;
+
if (s->servername_done == 0)
switch (servname_type) {
case TLSEXT_NAMETYPE_host_name:
if (!s->hit) {
- if (s->session->tlsext_hostname) {
- *al = SSL_AD_DECODE_ERROR;
- return 0;
- }
+ if (s->session->tlsext_hostname)
+ goto err;
+
if (len > TLSEXT_MAXLEN_host_name) {
*al = TLS1_AD_UNRECOGNIZED_NAME;
return 0;
@@ -1126,31 +1124,23 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d,
dsize -= len;
}
- if (dsize != 0) {
- *al = SSL_AD_DECODE_ERROR;
- return 0;
- }
+ if (dsize != 0)
+ goto err;
}
# ifndef OPENSSL_NO_SRP
else if (type == TLSEXT_TYPE_srp) {
- if (size <= 0 || ((len = data[0])) != (size - 1)) {
- *al = SSL_AD_DECODE_ERROR;
- return 0;
- }
- if (s->srp_ctx.login != NULL) {
- *al = SSL_AD_DECODE_ERROR;
- return 0;
- }
+ if (size == 0 || ((len = data[0])) != (size - 1))
+ goto err;
+ if (s->srp_ctx.login != NULL)
+ goto err;
if ((s->srp_ctx.login = OPENSSL_malloc(len + 1)) == NULL)
return -1;
memcpy(s->srp_ctx.login, &data[1], len);
s->srp_ctx.login[len] = '\0';
- if (strlen(s->srp_ctx.login) != len) {
- *al = SSL_AD_DECODE_ERROR;
- return 0;
- }
+ if (strlen(s->srp_ctx.login) != len)
+ goto err;
}
# endif
@@ -1159,10 +1149,8 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d,
unsigned char *sdata = data;
int ecpointformatlist_length = *(sdata++);
- if (ecpointformatlist_length != size - 1) {
- *al = TLS1_AD_DECODE_ERROR;
- return 0;
- }
+ if (ecpointformatlist_length != size - 1)
+ goto err;
if (!s->hit) {
if (s->session->tlsext_ecpointformatlist) {
OPENSSL_free(s->session->tlsext_ecpointformatlist);
@@ -1196,15 +1184,13 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d,
if (ellipticcurvelist_length != size - 2 ||
ellipticcurvelist_length < 1 ||
/* Each NamedCurve is 2 bytes. */
- ellipticcurvelist_length & 1) {
- *al = TLS1_AD_DECODE_ERROR;
- return 0;
- }
+ ellipticcurvelist_length & 1)
+ goto err;
+
if (!s->hit) {
- if (s->session->tlsext_ellipticcurvelist) {
- *al = TLS1_AD_DECODE_ERROR;
- return 0;
- }
+ if (s->session->tlsext_ellipticcurvelist)
+ goto err;
+
s->session->tlsext_ellipticcurvelist_length = 0;
if ((s->session->tlsext_ellipticcurvelist =
OPENSSL_malloc(ellipticcurvelist_length)) == NULL) {
@@ -1273,28 +1259,20 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d,
renegotiate_seen = 1;
} else if (type == TLSEXT_TYPE_signature_algorithms) {
int dsize;
- if (sigalg_seen || size < 2) {
- *al = SSL_AD_DECODE_ERROR;
- return 0;
- }
+ if (sigalg_seen || size < 2)
+ goto err;
sigalg_seen = 1;
n2s(data, dsize);
size -= 2;
- if (dsize != size || dsize & 1) {
- *al = SSL_AD_DECODE_ERROR;
- return 0;
- }
- if (!tls1_process_sigalgs(s, data, dsize)) {
- *al = SSL_AD_DECODE_ERROR;
- return 0;
- }
+ if (dsize != size || dsize & 1)
+ goto err;
+ if (!tls1_process_sigalgs(s, data, dsize))
+ goto err;
} else if (type == TLSEXT_TYPE_status_request &&
s->version != DTLS1_VERSION) {
- if (size < 5) {
- *al = SSL_AD_DECODE_ERROR;
- return 0;
- }
+ if (size < 5)
+ goto err;
s->tlsext_status_type = *data++;
size--;
@@ -1304,35 +1282,26 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d,
/* Read in responder_id_list */
n2s(data, dsize);
size -= 2;
- if (dsize > size) {
- *al = SSL_AD_DECODE_ERROR;
- return 0;
- }
+ if (dsize > size)
+ goto err;
while (dsize > 0) {
OCSP_RESPID *id;
int idsize;
- if (dsize < 4) {
- *al = SSL_AD_DECODE_ERROR;
- return 0;
- }
+ if (dsize < 4)
+ goto err;
n2s(data, idsize);
dsize -= 2 + idsize;
size -= 2 + idsize;
- if (dsize < 0) {
- *al = SSL_AD_DECODE_ERROR;
- return 0;
- }
+ if (dsize < 0)
+ goto err;
sdata = data;
data += idsize;
id = d2i_OCSP_RESPID(NULL, &sdata, idsize);
- if (!id) {
- *al = SSL_AD_DECODE_ERROR;
- return 0;
- }
+ if (!id)
+ goto err;
if (data != sdata) {
OCSP_RESPID_free(id);
- *al = SSL_AD_DECODE_ERROR;
- return 0;
+ goto err;
}
if (!s->tlsext_ocsp_ids
&& !(s->tlsext_ocsp_ids =
@@ -1349,16 +1318,12 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d,
}
/* Read in request_extensions */
- if (size < 2) {
- *al = SSL_AD_DECODE_ERROR;
- return 0;
- }
+ if (size < 2)
+ goto err;
n2s(data, dsize);
size -= 2;
- if (dsize != size) {
- *al = SSL_AD_DECODE_ERROR;
- return 0;
- }
+ if (dsize != size)
+ goto err;
sdata = data;
if (dsize > 0) {
if (s->tlsext_ocsp_exts) {
@@ -1368,10 +1333,8 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d,
s->tlsext_ocsp_exts =
d2i_X509_EXTENSIONS(NULL, &sdata, dsize);
- if (!s->tlsext_ocsp_exts || (data + dsize != sdata)) {
- *al = SSL_AD_DECODE_ERROR;
- return 0;
- }
+ if (!s->tlsext_ocsp_exts || (data + dsize != sdata))
+ goto err;
}
}
/*
@@ -1432,6 +1395,10 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d,
data += size;
}
+ /* Spurious data on the end */
+ if (data != d + n)
+ goto err;
+
*p = data;
ri_check:
@@ -1447,6 +1414,9 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d,
}
return 1;
+err:
+ *al = SSL_AD_DECODE_ERROR;
+ return 0;
}
# ifndef OPENSSL_NO_NEXTPROTONEG
@@ -2612,7 +2582,10 @@ int tls1_process_heartbeat(SSL *s)
memcpy(bp, pl, payload);
bp += payload;
/* Random padding */
- RAND_pseudo_bytes(bp, padding);
+ if (RAND_pseudo_bytes(bp, padding) < 0) {
+ OPENSSL_free(buffer);
+ return -1;
+ }
r = ssl3_write_bytes(s, TLS1_RT_HEARTBEAT, buffer,
3 + payload + padding);
@@ -2647,7 +2620,7 @@ int tls1_process_heartbeat(SSL *s)
int tls1_heartbeat(SSL *s)
{
unsigned char *buf, *p;
- int ret;
+ int ret = -1;
unsigned int payload = 18; /* Sequence number + random bytes */
unsigned int padding = 16; /* Use minimum padding */
@@ -2695,10 +2668,16 @@ int tls1_heartbeat(SSL *s)
/* Sequence number */
s2n(s->tlsext_hb_seq, p);
/* 16 random bytes */
- RAND_pseudo_bytes(p, 16);
+ if (RAND_pseudo_bytes(p, 16) < 0) {
+ SSLerr(SSL_F_TLS1_HEARTBEAT, ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
p += 16;
/* Random padding */
- RAND_pseudo_bytes(p, padding);
+ if (RAND_pseudo_bytes(p, padding) < 0) {
+ SSLerr(SSL_F_TLS1_HEARTBEAT, ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
ret = ssl3_write_bytes(s, TLS1_RT_HEARTBEAT, buf, 3 + payload + padding);
if (ret >= 0) {
@@ -2710,6 +2689,7 @@ int tls1_heartbeat(SSL *s)
s->tlsext_hb_pending = 1;
}
+err:
OPENSSL_free(buf);
return ret;
diff --git a/crypto/openssl/ssl/tls_srp.c b/crypto/openssl/ssl/tls_srp.c
index d36cfa0..bb719ba 100644
--- a/crypto/openssl/ssl/tls_srp.c
+++ b/crypto/openssl/ssl/tls_srp.c
@@ -454,7 +454,8 @@ int SRP_Calc_A_param(SSL *s)
{
unsigned char rnd[SSL_MAX_MASTER_KEY_LENGTH];
- RAND_bytes(rnd, sizeof(rnd));
+ if (RAND_bytes(rnd, sizeof(rnd)) <= 0)
+ return -1;
s->srp_ctx.a = BN_bin2bn(rnd, sizeof(rnd), s->srp_ctx.a);
OPENSSL_cleanse(rnd, sizeof(rnd));
diff --git a/crypto/openssl/util/mk1mf.pl b/crypto/openssl/util/mk1mf.pl
index 550ef9f..1eee7aa 100755
--- a/crypto/openssl/util/mk1mf.pl
+++ b/crypto/openssl/util/mk1mf.pl
@@ -326,7 +326,7 @@ open(IN,"<$infile") || die "unable to open $infile:$!\n";
$_=<IN>;
for (;;)
{
- chop;
+ s/\s*$//; # was chop, didn't work in mixture of perls for Windows...
($key,$val)=/^([^=]+)=(.*)/;
if ($key eq "RELATIVE_DIRECTORY")
diff --git a/crypto/openssl/util/mkerr.pl b/crypto/openssl/util/mkerr.pl
index 8d2fdbc..d87c4fd 100644
--- a/crypto/openssl/util/mkerr.pl
+++ b/crypto/openssl/util/mkerr.pl
@@ -534,14 +534,21 @@ EOF
# First, read any existing reason string definitions:
my %err_reason_strings;
if (open(IN,"<$cfile")) {
+ my $line = "";
while (<IN>) {
- if (/\b(${lib}_R_\w*)\b.*\"(.*)\"/) {
- $err_reason_strings{$1} = $2;
- }
- if (/\b${lib}_F_(\w*)\b.*\"(.*)\"/) {
- if (!exists $ftrans{$1} && ($1 ne $2)) {
- print STDERR "WARNING: Mismatched function string $2\n";
- $ftrans{$1} = $2;
+ chomp;
+ $_ = $line . $_;
+ $line = "";
+ if (/{ERR_(FUNC|REASON)\(/) {
+ if (/\b(${lib}_R_\w*)\b.*\"(.*)\"/) {
+ $err_reason_strings{$1} = $2;
+ } elsif (/\b${lib}_F_(\w*)\b.*\"(.*)\"/) {
+ if (!exists $ftrans{$1} && ($1 ne $2)) {
+ print STDERR "WARNING: Mismatched function string $2\n";
+ $ftrans{$1} = $2;
+ }
+ } else {
+ $line = $_;
}
}
}
diff --git a/crypto/openssl/util/pl/BC-32.pl b/crypto/openssl/util/pl/BC-32.pl
index b41bb45..6d03664 100644
--- a/crypto/openssl/util/pl/BC-32.pl
+++ b/crypto/openssl/util/pl/BC-32.pl
@@ -130,7 +130,7 @@ sub do_link_rule
local($ret,$_);
$file =~ s/\//$o/g if $o ne '/';
- $n=&bname($targer);
+ $n=&bname($target);
$ret.="$target: $files $dep_libs\n";
$ret.="\t\$(LINK) \$(LFLAGS) $files \$(APP_EX_OBJ), $target,, $libs\n\n";
return($ret);
diff --git a/crypto/openssl/util/pl/VC-32.pl b/crypto/openssl/util/pl/VC-32.pl
index 3705fc7..b597998 100644
--- a/crypto/openssl/util/pl/VC-32.pl
+++ b/crypto/openssl/util/pl/VC-32.pl
@@ -341,7 +341,7 @@ sub do_link_rule
my($target,$files,$dep_libs,$libs,$standalone)=@_;
local($ret,$_);
$file =~ s/\//$o/g if $o ne '/';
- $n=&bname($targer);
+ $n=&bname($target);
$ret.="$target: $files $dep_libs\n";
if ($standalone == 1)
{
diff --git a/etc/Makefile b/etc/Makefile
index 80f5f63..053a407 100644
--- a/etc/Makefile
+++ b/etc/Makefile
@@ -188,13 +188,10 @@ distribute:
.include <bsd.endian.mk>
.if ${TARGET_ENDIANNESS} == "1234"
CAP_MKDB_ENDIAN?= -l
-PWD_MKDB_ENDIAN?= -L
.elif ${TARGET_ENDIANNESS} == "4321"
CAP_MKDB_ENDIAN?= -b
-PWD_MKDB_ENDIAN?= -B
.else
CAP_MKDB_ENDIAN?=
-PWD_MKDB_ENDIAN?=
.endif
.if defined(NO_ROOT)
@@ -210,6 +207,8 @@ distribution:
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
${BIN1} ${DESTDIR}/etc; \
cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
+ services_mkdb ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \
+ ${DESTDIR}/etc/services; \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
${BIN2} ${DESTDIR}/etc; \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
@@ -220,8 +219,7 @@ distribution:
.if ${MK_TCSH} == "no"
sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
.endif
- pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
- ${DESTDIR}/etc/master.passwd
+ pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
.if defined(NO_ROOT)
( \
echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
@@ -332,7 +330,7 @@ distribution:
MTREE_CMD?= mtree
-.if ${MK_INSTALL_AS_USER} != "no" && ${_uid} != 0
+.if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
-e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
-e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
diff --git a/etc/mtree/BSD.debug.dist b/etc/mtree/BSD.debug.dist
index 856a17e..7504a88 100644
--- a/etc/mtree/BSD.debug.dist
+++ b/etc/mtree/BSD.debug.dist
@@ -23,7 +23,7 @@
..
lib
clang
- 3.6.0
+ 3.6.1
lib
freebsd
..
diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist
index f0d42a2..5fad040 100644
--- a/etc/mtree/BSD.usr.dist
+++ b/etc/mtree/BSD.usr.dist
@@ -19,7 +19,7 @@
aout
..
clang
- 3.6.0
+ 3.6.1
include
..
lib
diff --git a/etc/sendmail/Makefile.depend b/etc/sendmail/Makefile.depend
index 29fda55..3af2d7f 100644
--- a/etc/sendmail/Makefile.depend
+++ b/etc/sendmail/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/games/caesar/Makefile.depend b/games/caesar/Makefile.depend
index 8a1da00..c9f9d52 100644
--- a/games/caesar/Makefile.depend
+++ b/games/caesar/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/games/factor/Makefile.depend b/games/factor/Makefile.depend
index e9b5ed1..fc0b633 100644
--- a/games/factor/Makefile.depend
+++ b/games/factor/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/games/fortune/datfiles/Makefile.depend b/games/fortune/datfiles/Makefile.depend
index 11aba52..f80275d 100644
--- a/games/fortune/datfiles/Makefile.depend
+++ b/games/fortune/datfiles/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/games/fortune/fortune/Makefile.depend b/games/fortune/fortune/Makefile.depend
index f4b5142..3646e2e 100644
--- a/games/fortune/fortune/Makefile.depend
+++ b/games/fortune/fortune/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/games/fortune/strfile/Makefile.depend b/games/fortune/strfile/Makefile.depend
index f4b5142..3646e2e 100644
--- a/games/fortune/strfile/Makefile.depend
+++ b/games/fortune/strfile/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/games/fortune/unstr/Makefile.depend b/games/fortune/unstr/Makefile.depend
index f4b5142..3646e2e 100644
--- a/games/fortune/unstr/Makefile.depend
+++ b/games/fortune/unstr/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/games/grdc/Makefile.depend b/games/grdc/Makefile.depend
index 3e23976..59bc828 100644
--- a/games/grdc/Makefile.depend
+++ b/games/grdc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/games/grdc/grdc.c b/games/grdc/grdc.c
index 4632c79..04cc00b 100644
--- a/games/grdc/grdc.c
+++ b/games/grdc/grdc.c
@@ -150,14 +150,14 @@ main(int argc, char *argv[])
set(tm->tm_min/10, 14);
if (t12) {
- if (tm->tm_hour > 12) {
- tm->tm_hour -= 12;
- mvaddstr(YBASE + 5, XBASE + 52, "PM");
- } else {
+ if (tm->tm_hour < 12) {
if (tm->tm_hour == 0)
tm->tm_hour = 12;
-
mvaddstr(YBASE + 5, XBASE + 52, "AM");
+ } else {
+ if (tm->tm_hour > 12)
+ tm->tm_hour -= 12;
+ mvaddstr(YBASE + 5, XBASE + 52, "PM");
}
}
diff --git a/games/morse/Makefile.depend b/games/morse/Makefile.depend
index f4b5142..3646e2e 100644
--- a/games/morse/Makefile.depend
+++ b/games/morse/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/games/number/Makefile.depend b/games/number/Makefile.depend
index f4b5142..3646e2e 100644
--- a/games/number/Makefile.depend
+++ b/games/number/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/games/pom/Makefile.depend b/games/pom/Makefile.depend
index 8a1da00..c9f9d52 100644
--- a/games/pom/Makefile.depend
+++ b/games/pom/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/games/primes/Makefile.depend b/games/primes/Makefile.depend
index 8a1da00..c9f9d52 100644
--- a/games/primes/Makefile.depend
+++ b/games/primes/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/games/random/Makefile.depend b/games/random/Makefile.depend
index f4b5142..3646e2e 100644
--- a/games/random/Makefile.depend
+++ b/games/random/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/lib/csu/Makefile.depend b/gnu/lib/csu/Makefile.depend
index f70069b..e5634d5 100644
--- a/gnu/lib/csu/Makefile.depend
+++ b/gnu/lib/csu/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
include \
include/xlocale \
diff --git a/gnu/lib/libdialog/Makefile.depend b/gnu/lib/libdialog/Makefile.depend
index 770632f..1c00d92 100644
--- a/gnu/lib/libdialog/Makefile.depend
+++ b/gnu/lib/libdialog/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/lib/libgcc/Makefile.depend b/gnu/lib/libgcc/Makefile.depend
index ed1cc11..ce72494 100644
--- a/gnu/lib/libgcc/Makefile.depend
+++ b/gnu/lib/libgcc/Makefile.depend
@@ -1,13 +1,12 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
include \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/gnu/lib/libgcov/Makefile.depend b/gnu/lib/libgcov/Makefile.depend
index 1b14e71..e6424fd 100644
--- a/gnu/lib/libgcov/Makefile.depend
+++ b/gnu/lib/libgcov/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
include \
include/xlocale \
diff --git a/gnu/lib/libgomp/Makefile.depend b/gnu/lib/libgomp/Makefile.depend
index 7246faa..d8c89db 100644
--- a/gnu/lib/libgomp/Makefile.depend
+++ b/gnu/lib/libgomp/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/lib/libreadline/history/Makefile b/gnu/lib/libreadline/history/Makefile
deleted file mode 100644
index 1602872..0000000
--- a/gnu/lib/libreadline/history/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# $FreeBSD$
-
-SUBDIR= doc
-
-LIB= history
-MAN= rlhistory.3
-
-SRCS= $(HISTSRC) xmalloc.c
-
-rlhistory.3: doc/history.3
- cp -f ${.ALLSRC} ${.TARGET}
-
-CLEANFILES+= rlhistory.3
-
-.include <bsd.lib.mk>
diff --git a/gnu/lib/libreadline/history/Makefile.depend b/gnu/lib/libreadline/history/Makefile.depend
deleted file mode 100644
index a839545..0000000
--- a/gnu/lib/libreadline/history/Makefile.depend
+++ /dev/null
@@ -1,19 +0,0 @@
-# Autogenerated - do NOT edit!
-
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
-DEP_MACHINE := ${.PARSEFILE:E}
-
-DIRDEPS = \
- gnu/lib/libgcc \
- include \
- include/xlocale \
- lib/${CSU_DIR} \
- lib/libc \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/gnu/lib/libreadline/history/doc/Makefile b/gnu/lib/libreadline/history/doc/Makefile
deleted file mode 100644
index 4b050e7..0000000
--- a/gnu/lib/libreadline/history/doc/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# $FreeBSD$
-
-SRCDIR= ${.CURDIR}/../../../../../contrib/libreadline/doc
-
-INFO = history
-
-INFOSECTION= "Programming & development tools."
-INFOENTRY_history= "* History: (history). The GNU History library."
-
-history.info: history.texi hstech.texi hsuser.texi version.texi fdl.texi
-
-.include <bsd.info.mk>
diff --git a/gnu/lib/libreadline/readline/Makefile b/gnu/lib/libreadline/readline/Makefile
index 22657ec..f0bfe5b 100644
--- a/gnu/lib/libreadline/readline/Makefile
+++ b/gnu/lib/libreadline/readline/Makefile
@@ -13,15 +13,18 @@ SRCS= readline.c vi_mode.c funmap.c keymaps.c parens.c search.c \
INSTALLED_HEADERS= readline.h chardefs.h keymaps.h history.h tilde.h \
rlstdc.h rlconf.h rltypedefs.h
-CFLAGS+= -DREADLINE_LIBRARY
CFLAGS+= -I${.OBJDIR}/..
SRCDIR= ${.CURDIR}/../../../../contrib/libreadline
-CLEANFILES+= ${INSTALLED_HEADERS}
+.NOPATH: ${INSTALLED_HEADERS}
+
beforebuild: ${INSTALLED_HEADERS}
-.for h in ${INSTALLED_HEADERS}
-$h: ${SRCDIR}/$h
- ln -sf ${SRCDIR}/$h $h
+CLEANFILES+= ${INSTALLED_HEADERS}
+DPSRCS+= ${INSTALLED_HEADERS}
+
+.for _h in ${INSTALLED_HEADERS}
+${_h}: ${SRCDIR}/${_h}
+ ln -sf ${.ALLSRC} ${.TARGET}
.endfor
LIBADD= ncursesw
diff --git a/gnu/lib/libreadline/readline/Makefile.depend b/gnu/lib/libreadline/readline/Makefile.depend
index f811f6d..c9f2b8c 100644
--- a/gnu/lib/libreadline/readline/Makefile.depend
+++ b/gnu/lib/libreadline/readline/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/lib/libregex/Makefile.depend b/gnu/lib/libregex/Makefile.depend
index 0d58ca4..1eb05a0 100644
--- a/gnu/lib/libregex/Makefile.depend
+++ b/gnu/lib/libregex/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/lib/libssp/Makefile.depend b/gnu/lib/libssp/Makefile.depend
index a839545..f52ca95 100644
--- a/gnu/lib/libssp/Makefile.depend
+++ b/gnu/lib/libssp/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/gnu/lib/libssp/libssp_nonshared/Makefile.depend b/gnu/lib/libssp/libssp_nonshared/Makefile.depend
index 11aba52..f80275d 100644
--- a/gnu/lib/libssp/libssp_nonshared/Makefile.depend
+++ b/gnu/lib/libssp/libssp_nonshared/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/lib/libstdc++/Makefile.depend b/gnu/lib/libstdc++/Makefile.depend
index b539d2d..760b9b8 100644
--- a/gnu/lib/libstdc++/Makefile.depend
+++ b/gnu/lib/libstdc++/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/lib/libsupc++/Makefile.depend b/gnu/lib/libsupc++/Makefile.depend
index 0885447..2ffe3c4 100644
--- a/gnu/lib/libsupc++/Makefile.depend
+++ b/gnu/lib/libsupc++/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/binutils/addr2line/Makefile.depend b/gnu/usr.bin/binutils/addr2line/Makefile.depend
index e4d96da..b58c9bd 100644
--- a/gnu/usr.bin/binutils/addr2line/Makefile.depend
+++ b/gnu/usr.bin/binutils/addr2line/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/binutils/ar/Makefile.depend b/gnu/usr.bin/binutils/ar/Makefile.depend
index 968d47f..9a5a4f9 100644
--- a/gnu/usr.bin/binutils/ar/Makefile.depend
+++ b/gnu/usr.bin/binutils/ar/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/gnu/usr.bin/binutils/as/Makefile.depend b/gnu/usr.bin/binutils/as/Makefile.depend
index 6ea0096..1480a25 100644
--- a/gnu/usr.bin/binutils/as/Makefile.depend
+++ b/gnu/usr.bin/binutils/as/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/binutils/doc/Makefile.depend b/gnu/usr.bin/binutils/doc/Makefile.depend
index 11aba52..f80275d 100644
--- a/gnu/usr.bin/binutils/doc/Makefile.depend
+++ b/gnu/usr.bin/binutils/doc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/binutils/ld/Makefile.depend.amd64 b/gnu/usr.bin/binutils/ld/Makefile.depend.amd64
index 10cfb2b..95df873 100644
--- a/gnu/usr.bin/binutils/ld/Makefile.depend.amd64
+++ b/gnu/usr.bin/binutils/ld/Makefile.depend.amd64
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/usr.bin/binutils/libbfd \
gnu/usr.bin/binutils/libiberty \
diff --git a/gnu/usr.bin/binutils/ld/Makefile.depend.host b/gnu/usr.bin/binutils/ld/Makefile.depend.host
index a59cee9..9ceb3f9 100644
--- a/gnu/usr.bin/binutils/ld/Makefile.depend.host
+++ b/gnu/usr.bin/binutils/ld/Makefile.depend.host
@@ -1,9 +1,9 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
gnu/usr.bin/binutils/libbfd \
gnu/usr.bin/binutils/libiberty \
- usr.bin/yacc \
.include <dirdeps.mk>
diff --git a/gnu/usr.bin/binutils/libbfd/Makefile.depend.amd64 b/gnu/usr.bin/binutils/libbfd/Makefile.depend.amd64
index f7e4264..7a87c5d 100644
--- a/gnu/usr.bin/binutils/libbfd/Makefile.depend.amd64
+++ b/gnu/usr.bin/binutils/libbfd/Makefile.depend.amd64
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/binutils/libbfd/Makefile.depend.host b/gnu/usr.bin/binutils/libbfd/Makefile.depend.host
index c36b893..1be848f 100644
--- a/gnu/usr.bin/binutils/libbfd/Makefile.depend.host
+++ b/gnu/usr.bin/binutils/libbfd/Makefile.depend.host
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/binutils/libbinutils/Makefile.depend b/gnu/usr.bin/binutils/libbinutils/Makefile.depend
index 3246dce..74e2b22 100644
--- a/gnu/usr.bin/binutils/libbinutils/Makefile.depend
+++ b/gnu/usr.bin/binutils/libbinutils/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/binutils/libiberty/Makefile.depend b/gnu/usr.bin/binutils/libiberty/Makefile.depend
index ecc8fe8..c210061 100644
--- a/gnu/usr.bin/binutils/libiberty/Makefile.depend
+++ b/gnu/usr.bin/binutils/libiberty/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/binutils/libopcodes/Makefile.depend b/gnu/usr.bin/binutils/libopcodes/Makefile.depend
index 15a1f9c..18be76b 100644
--- a/gnu/usr.bin/binutils/libopcodes/Makefile.depend
+++ b/gnu/usr.bin/binutils/libopcodes/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/binutils/nm/Makefile.depend b/gnu/usr.bin/binutils/nm/Makefile.depend
index e4d96da..b58c9bd 100644
--- a/gnu/usr.bin/binutils/nm/Makefile.depend
+++ b/gnu/usr.bin/binutils/nm/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/binutils/objcopy/Makefile.depend b/gnu/usr.bin/binutils/objcopy/Makefile.depend
index e4d96da..b58c9bd 100644
--- a/gnu/usr.bin/binutils/objcopy/Makefile.depend
+++ b/gnu/usr.bin/binutils/objcopy/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/binutils/objdump/Makefile.depend b/gnu/usr.bin/binutils/objdump/Makefile.depend
index 1a59231..f4eee5f 100644
--- a/gnu/usr.bin/binutils/objdump/Makefile.depend
+++ b/gnu/usr.bin/binutils/objdump/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/binutils/ranlib/Makefile.depend b/gnu/usr.bin/binutils/ranlib/Makefile.depend
index 968d47f..9a5a4f9 100644
--- a/gnu/usr.bin/binutils/ranlib/Makefile.depend
+++ b/gnu/usr.bin/binutils/ranlib/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/gnu/usr.bin/binutils/readelf/Makefile.depend b/gnu/usr.bin/binutils/readelf/Makefile.depend
index e4d96da..b58c9bd 100644
--- a/gnu/usr.bin/binutils/readelf/Makefile.depend
+++ b/gnu/usr.bin/binutils/readelf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/binutils/size/Makefile.depend b/gnu/usr.bin/binutils/size/Makefile.depend
index e4d96da..b58c9bd 100644
--- a/gnu/usr.bin/binutils/size/Makefile.depend
+++ b/gnu/usr.bin/binutils/size/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/binutils/strings/Makefile.depend b/gnu/usr.bin/binutils/strings/Makefile.depend
index e4d96da..b58c9bd 100644
--- a/gnu/usr.bin/binutils/strings/Makefile.depend
+++ b/gnu/usr.bin/binutils/strings/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/binutils/strip/Makefile.depend b/gnu/usr.bin/binutils/strip/Makefile.depend
index e4d96da..b58c9bd 100644
--- a/gnu/usr.bin/binutils/strip/Makefile.depend
+++ b/gnu/usr.bin/binutils/strip/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/cc/c++/Makefile.depend b/gnu/usr.bin/cc/c++/Makefile.depend
index 2652a14..07a2968 100644
--- a/gnu/usr.bin/cc/c++/Makefile.depend
+++ b/gnu/usr.bin/cc/c++/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/gnu/usr.bin/cc/c++filt/Makefile.depend b/gnu/usr.bin/cc/c++filt/Makefile.depend
index fa5c21c..0f7485d 100644
--- a/gnu/usr.bin/cc/c++filt/Makefile.depend
+++ b/gnu/usr.bin/cc/c++filt/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/gnu/usr.bin/cc/cc/Makefile.depend b/gnu/usr.bin/cc/cc/Makefile.depend
index 87b6d9d..49202cf 100644
--- a/gnu/usr.bin/cc/cc/Makefile.depend
+++ b/gnu/usr.bin/cc/cc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/gnu/usr.bin/cc/cc1/Makefile.depend b/gnu/usr.bin/cc/cc1/Makefile.depend
index be55de56..7638ce5 100644
--- a/gnu/usr.bin/cc/cc1/Makefile.depend
+++ b/gnu/usr.bin/cc/cc1/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/gnu/usr.bin/cc/cc1plus/Makefile.depend b/gnu/usr.bin/cc/cc1plus/Makefile.depend
index cf800a6..7d1e3c7 100644
--- a/gnu/usr.bin/cc/cc1plus/Makefile.depend
+++ b/gnu/usr.bin/cc/cc1plus/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/gnu/usr.bin/cc/cc_int/Makefile.depend b/gnu/usr.bin/cc/cc_int/Makefile.depend
index 9ec5f32..3a8633f 100644
--- a/gnu/usr.bin/cc/cc_int/Makefile.depend
+++ b/gnu/usr.bin/cc/cc_int/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/gnu/usr.bin/cc/cc_tools/Makefile b/gnu/usr.bin/cc/cc_tools/Makefile
index 0cf5070..4121f5c 100644
--- a/gnu/usr.bin/cc/cc_tools/Makefile
+++ b/gnu/usr.bin/cc/cc_tools/Makefile
@@ -207,7 +207,7 @@ GENSRCS+= bconfig.h
CLEANFILES+= cs-bconfig.h
# tconfig.h
-tconfig.h: .PHONY
+tconfig.h:
TARGET_CPU_DEFAULT="${TARGET_CPU_DEFAULT}" \
HEADERS="auto-host.h ansidecl.h" \
DEFINES="USED_FOR_TARGET" \
@@ -215,6 +215,9 @@ tconfig.h: .PHONY
GENSRCS+= tconfig.h
CLEANFILES+= cs-tconfig.h
+
+.NOPATH: ${GENSRCS} ${CLEANFILES}
+
# Options
optionlist: ${OPT_FILES}
LC_ALL=C awk -f ${GCCDIR}/opt-gather.awk ${.ALLSRC} > ${.TARGET}
@@ -543,8 +546,6 @@ OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
GENOBJS+= ${GENSRCS:N*.h:R:S/$/.o/g}
CLEANFILES+= ${GENSRCS} ${GENONLY} ${GENOBJS} ${GNTOOLS}
-.NOPATH: ${GENSRCS} ${CLEANFILES}
-
#-----------------------------------------------------------------------
# Manual dependencies.
.if !exists(${DEPENDFILE})
diff --git a/gnu/usr.bin/cc/cc_tools/Makefile.depend b/gnu/usr.bin/cc/cc_tools/Makefile.depend
index 05572c6..5558f36 100644
--- a/gnu/usr.bin/cc/cc_tools/Makefile.depend
+++ b/gnu/usr.bin/cc/cc_tools/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/gnu/usr.bin/cc/cpp/Makefile.depend b/gnu/usr.bin/cc/cpp/Makefile.depend
index 2652a14..07a2968 100644
--- a/gnu/usr.bin/cc/cpp/Makefile.depend
+++ b/gnu/usr.bin/cc/cpp/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/gnu/usr.bin/cc/gcov/Makefile.depend b/gnu/usr.bin/cc/gcov/Makefile.depend
index fa5c21c..0f7485d 100644
--- a/gnu/usr.bin/cc/gcov/Makefile.depend
+++ b/gnu/usr.bin/cc/gcov/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/gnu/usr.bin/cc/include/Makefile.depend b/gnu/usr.bin/cc/include/Makefile.depend
index 57b7e10..d14a02b 100644
--- a/gnu/usr.bin/cc/include/Makefile.depend
+++ b/gnu/usr.bin/cc/include/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/gnu/usr.bin/cc/libcpp/Makefile.depend b/gnu/usr.bin/cc/libcpp/Makefile.depend
index c1e035b..5427265 100644
--- a/gnu/usr.bin/cc/libcpp/Makefile.depend
+++ b/gnu/usr.bin/cc/libcpp/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/gnu/usr.bin/cc/libdecnumber/Makefile.depend b/gnu/usr.bin/cc/libdecnumber/Makefile.depend
index 9ec5f32..3a8633f 100644
--- a/gnu/usr.bin/cc/libdecnumber/Makefile.depend
+++ b/gnu/usr.bin/cc/libdecnumber/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/gnu/usr.bin/cc/libiberty/Makefile.depend b/gnu/usr.bin/cc/libiberty/Makefile.depend
index 639d45d..ccd19e5 100644
--- a/gnu/usr.bin/cc/libiberty/Makefile.depend
+++ b/gnu/usr.bin/cc/libiberty/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/gnu/usr.bin/dialog/Makefile.depend b/gnu/usr.bin/dialog/Makefile.depend
index bf205a7..5e97e25 100644
--- a/gnu/usr.bin/dialog/Makefile.depend
+++ b/gnu/usr.bin/dialog/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/diff/Makefile.depend b/gnu/usr.bin/diff/Makefile.depend
index 361b8e1..4eb4a14 100644
--- a/gnu/usr.bin/diff/Makefile.depend
+++ b/gnu/usr.bin/diff/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/gnu/usr.bin/diff3/Makefile.depend b/gnu/usr.bin/diff3/Makefile.depend
index 9415fc6..1931f06 100644
--- a/gnu/usr.bin/diff3/Makefile.depend
+++ b/gnu/usr.bin/diff3/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/dtc/Makefile.depend b/gnu/usr.bin/dtc/Makefile.depend
index ce49d22..50fce9a 100644
--- a/gnu/usr.bin/dtc/Makefile.depend
+++ b/gnu/usr.bin/dtc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/gnu/usr.bin/gdb/gdb/Makefile.depend b/gnu/usr.bin/gdb/gdb/Makefile.depend
index 645797f..f2e2bfa 100644
--- a/gnu/usr.bin/gdb/gdb/Makefile.depend
+++ b/gnu/usr.bin/gdb/gdb/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/gdb/gdbserver/Makefile.depend b/gnu/usr.bin/gdb/gdbserver/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/gnu/usr.bin/gdb/gdbserver/Makefile.depend
+++ b/gnu/usr.bin/gdb/gdbserver/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/gdb/gdbtui/Makefile.depend b/gnu/usr.bin/gdb/gdbtui/Makefile.depend
index a6eaebd..ad14e4c 100644
--- a/gnu/usr.bin/gdb/gdbtui/Makefile.depend
+++ b/gnu/usr.bin/gdb/gdbtui/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/gdb/kgdb/Makefile.depend.amd64 b/gnu/usr.bin/gdb/kgdb/Makefile.depend.amd64
index a5830c8..f675e83 100644
--- a/gnu/usr.bin/gdb/kgdb/Makefile.depend.amd64
+++ b/gnu/usr.bin/gdb/kgdb/Makefile.depend.amd64
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/gdb/libgdb/Makefile.depend.amd64 b/gnu/usr.bin/gdb/libgdb/Makefile.depend.amd64
index 9380a22..4c60635 100644
--- a/gnu/usr.bin/gdb/libgdb/Makefile.depend.amd64
+++ b/gnu/usr.bin/gdb/libgdb/Makefile.depend.amd64
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/gperf/Makefile.depend b/gnu/usr.bin/gperf/Makefile.depend
index 14a7272..1956799 100644
--- a/gnu/usr.bin/gperf/Makefile.depend
+++ b/gnu/usr.bin/gperf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/gnu/usr.bin/grep/Makefile.depend b/gnu/usr.bin/grep/Makefile.depend
index 3f9e676..435d267 100644
--- a/gnu/usr.bin/grep/Makefile.depend
+++ b/gnu/usr.bin/grep/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/gnu/usr.bin/groff/contrib/mm/Makefile.depend b/gnu/usr.bin/groff/contrib/mm/Makefile.depend
index 11aba52..f80275d 100644
--- a/gnu/usr.bin/groff/contrib/mm/Makefile.depend
+++ b/gnu/usr.bin/groff/contrib/mm/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/groff/font/devX100-12/Makefile.depend b/gnu/usr.bin/groff/font/devX100-12/Makefile.depend
index 11aba52..f80275d 100644
--- a/gnu/usr.bin/groff/font/devX100-12/Makefile.depend
+++ b/gnu/usr.bin/groff/font/devX100-12/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/groff/font/devX100/Makefile.depend b/gnu/usr.bin/groff/font/devX100/Makefile.depend
index 11aba52..f80275d 100644
--- a/gnu/usr.bin/groff/font/devX100/Makefile.depend
+++ b/gnu/usr.bin/groff/font/devX100/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/groff/font/devX75-12/Makefile.depend b/gnu/usr.bin/groff/font/devX75-12/Makefile.depend
index 11aba52..f80275d 100644
--- a/gnu/usr.bin/groff/font/devX75-12/Makefile.depend
+++ b/gnu/usr.bin/groff/font/devX75-12/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/groff/font/devX75/Makefile.depend b/gnu/usr.bin/groff/font/devX75/Makefile.depend
index 11aba52..f80275d 100644
--- a/gnu/usr.bin/groff/font/devX75/Makefile.depend
+++ b/gnu/usr.bin/groff/font/devX75/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/groff/font/devascii/Makefile.depend b/gnu/usr.bin/groff/font/devascii/Makefile.depend
index 11aba52..f80275d 100644
--- a/gnu/usr.bin/groff/font/devascii/Makefile.depend
+++ b/gnu/usr.bin/groff/font/devascii/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/groff/font/devcp1047/Makefile.depend b/gnu/usr.bin/groff/font/devcp1047/Makefile.depend
index 11aba52..f80275d 100644
--- a/gnu/usr.bin/groff/font/devcp1047/Makefile.depend
+++ b/gnu/usr.bin/groff/font/devcp1047/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/groff/font/devdvi/Makefile.depend b/gnu/usr.bin/groff/font/devdvi/Makefile.depend
index 11aba52..f80275d 100644
--- a/gnu/usr.bin/groff/font/devdvi/Makefile.depend
+++ b/gnu/usr.bin/groff/font/devdvi/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/groff/font/devhtml/Makefile.depend b/gnu/usr.bin/groff/font/devhtml/Makefile.depend
index 11aba52..f80275d 100644
--- a/gnu/usr.bin/groff/font/devhtml/Makefile.depend
+++ b/gnu/usr.bin/groff/font/devhtml/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/groff/font/devkoi8-r/Makefile.depend b/gnu/usr.bin/groff/font/devkoi8-r/Makefile.depend
index 11aba52..f80275d 100644
--- a/gnu/usr.bin/groff/font/devkoi8-r/Makefile.depend
+++ b/gnu/usr.bin/groff/font/devkoi8-r/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/groff/font/devlatin1/Makefile.depend b/gnu/usr.bin/groff/font/devlatin1/Makefile.depend
index 11aba52..f80275d 100644
--- a/gnu/usr.bin/groff/font/devlatin1/Makefile.depend
+++ b/gnu/usr.bin/groff/font/devlatin1/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/groff/font/devlbp/Makefile.depend b/gnu/usr.bin/groff/font/devlbp/Makefile.depend
index 11aba52..f80275d 100644
--- a/gnu/usr.bin/groff/font/devlbp/Makefile.depend
+++ b/gnu/usr.bin/groff/font/devlbp/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/groff/font/devlj4/Makefile.depend b/gnu/usr.bin/groff/font/devlj4/Makefile.depend
index 11aba52..f80275d 100644
--- a/gnu/usr.bin/groff/font/devlj4/Makefile.depend
+++ b/gnu/usr.bin/groff/font/devlj4/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/groff/font/devps/Makefile.depend b/gnu/usr.bin/groff/font/devps/Makefile.depend
index 11aba52..f80275d 100644
--- a/gnu/usr.bin/groff/font/devps/Makefile.depend
+++ b/gnu/usr.bin/groff/font/devps/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/groff/font/devutf8/Makefile.depend b/gnu/usr.bin/groff/font/devutf8/Makefile.depend
index 11aba52..f80275d 100644
--- a/gnu/usr.bin/groff/font/devutf8/Makefile.depend
+++ b/gnu/usr.bin/groff/font/devutf8/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/groff/man/Makefile.depend b/gnu/usr.bin/groff/man/Makefile.depend
index 11aba52..f80275d 100644
--- a/gnu/usr.bin/groff/man/Makefile.depend
+++ b/gnu/usr.bin/groff/man/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/groff/src/devices/grodvi/Makefile.depend b/gnu/usr.bin/groff/src/devices/grodvi/Makefile.depend
index 9da4713..273f2d4 100644
--- a/gnu/usr.bin/groff/src/devices/grodvi/Makefile.depend
+++ b/gnu/usr.bin/groff/src/devices/grodvi/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
gnu/usr.bin/groff/src/libs/libdriver \
diff --git a/gnu/usr.bin/groff/src/devices/grohtml/Makefile.depend b/gnu/usr.bin/groff/src/devices/grohtml/Makefile.depend
index 5f37b45..273f2d4 100644
--- a/gnu/usr.bin/groff/src/devices/grohtml/Makefile.depend
+++ b/gnu/usr.bin/groff/src/devices/grohtml/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/groff/src/devices/grolbp/Makefile.depend b/gnu/usr.bin/groff/src/devices/grolbp/Makefile.depend
index 9da4713..273f2d4 100644
--- a/gnu/usr.bin/groff/src/devices/grolbp/Makefile.depend
+++ b/gnu/usr.bin/groff/src/devices/grolbp/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
gnu/usr.bin/groff/src/libs/libdriver \
diff --git a/gnu/usr.bin/groff/src/devices/grolj4/Makefile.depend b/gnu/usr.bin/groff/src/devices/grolj4/Makefile.depend
index 9da4713..273f2d4 100644
--- a/gnu/usr.bin/groff/src/devices/grolj4/Makefile.depend
+++ b/gnu/usr.bin/groff/src/devices/grolj4/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
gnu/usr.bin/groff/src/libs/libdriver \
diff --git a/gnu/usr.bin/groff/src/devices/grops/Makefile.depend b/gnu/usr.bin/groff/src/devices/grops/Makefile.depend
index 9da4713..273f2d4 100644
--- a/gnu/usr.bin/groff/src/devices/grops/Makefile.depend
+++ b/gnu/usr.bin/groff/src/devices/grops/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
gnu/usr.bin/groff/src/libs/libdriver \
diff --git a/gnu/usr.bin/groff/src/devices/grotty/Makefile.depend b/gnu/usr.bin/groff/src/devices/grotty/Makefile.depend
index 9da4713..273f2d4 100644
--- a/gnu/usr.bin/groff/src/devices/grotty/Makefile.depend
+++ b/gnu/usr.bin/groff/src/devices/grotty/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
gnu/usr.bin/groff/src/libs/libdriver \
diff --git a/gnu/usr.bin/groff/src/libs/libbib/Makefile.depend b/gnu/usr.bin/groff/src/libs/libbib/Makefile.depend
index 15a1f9c..18be76b 100644
--- a/gnu/usr.bin/groff/src/libs/libbib/Makefile.depend
+++ b/gnu/usr.bin/groff/src/libs/libbib/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/groff/src/libs/libdriver/Makefile.depend b/gnu/usr.bin/groff/src/libs/libdriver/Makefile.depend
index ecc8fe8..c210061 100644
--- a/gnu/usr.bin/groff/src/libs/libdriver/Makefile.depend
+++ b/gnu/usr.bin/groff/src/libs/libdriver/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/groff/src/libs/libgroff/Makefile.depend b/gnu/usr.bin/groff/src/libs/libgroff/Makefile.depend
index 97dcd6f..b01cf38 100644
--- a/gnu/usr.bin/groff/src/libs/libgroff/Makefile.depend
+++ b/gnu/usr.bin/groff/src/libs/libgroff/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
include \
include/xlocale \
lib/msun \
diff --git a/gnu/usr.bin/groff/src/preproc/eqn/Makefile.depend b/gnu/usr.bin/groff/src/preproc/eqn/Makefile.depend
index cba339a..f3ae4bf 100644
--- a/gnu/usr.bin/groff/src/preproc/eqn/Makefile.depend
+++ b/gnu/usr.bin/groff/src/preproc/eqn/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
gnu/usr.bin/groff/src/libs/libgroff \
diff --git a/gnu/usr.bin/groff/src/preproc/grn/Makefile.depend b/gnu/usr.bin/groff/src/preproc/grn/Makefile.depend
index 319a92f..7ca2c25 100644
--- a/gnu/usr.bin/groff/src/preproc/grn/Makefile.depend
+++ b/gnu/usr.bin/groff/src/preproc/grn/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
gnu/usr.bin/groff/src/libs/libgroff \
diff --git a/gnu/usr.bin/groff/src/preproc/html/Makefile.depend b/gnu/usr.bin/groff/src/preproc/html/Makefile.depend
index e4a162b..7ca2c25 100644
--- a/gnu/usr.bin/groff/src/preproc/html/Makefile.depend
+++ b/gnu/usr.bin/groff/src/preproc/html/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/groff/src/preproc/pic/Makefile.depend b/gnu/usr.bin/groff/src/preproc/pic/Makefile.depend
index 270f0018..e78d5c4 100644
--- a/gnu/usr.bin/groff/src/preproc/pic/Makefile.depend
+++ b/gnu/usr.bin/groff/src/preproc/pic/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
gnu/usr.bin/groff/src/libs/libgroff \
diff --git a/gnu/usr.bin/groff/src/preproc/refer/Makefile.depend b/gnu/usr.bin/groff/src/preproc/refer/Makefile.depend
index a5f47cf..f68ef58 100644
--- a/gnu/usr.bin/groff/src/preproc/refer/Makefile.depend
+++ b/gnu/usr.bin/groff/src/preproc/refer/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
gnu/usr.bin/groff/src/libs/libbib \
diff --git a/gnu/usr.bin/groff/src/preproc/tbl/Makefile.depend b/gnu/usr.bin/groff/src/preproc/tbl/Makefile.depend
index 319a92f..7ca2c25 100644
--- a/gnu/usr.bin/groff/src/preproc/tbl/Makefile.depend
+++ b/gnu/usr.bin/groff/src/preproc/tbl/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
gnu/usr.bin/groff/src/libs/libgroff \
diff --git a/gnu/usr.bin/groff/src/roff/groff/Makefile.depend b/gnu/usr.bin/groff/src/roff/groff/Makefile.depend
index 319a92f..7ca2c25 100644
--- a/gnu/usr.bin/groff/src/roff/groff/Makefile.depend
+++ b/gnu/usr.bin/groff/src/roff/groff/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
gnu/usr.bin/groff/src/libs/libgroff \
diff --git a/gnu/usr.bin/groff/src/roff/grog/Makefile.depend b/gnu/usr.bin/groff/src/roff/grog/Makefile.depend
index 11aba52..f80275d 100644
--- a/gnu/usr.bin/groff/src/roff/grog/Makefile.depend
+++ b/gnu/usr.bin/groff/src/roff/grog/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/groff/src/roff/nroff/Makefile.depend b/gnu/usr.bin/groff/src/roff/nroff/Makefile.depend
index 11aba52..f80275d 100644
--- a/gnu/usr.bin/groff/src/roff/nroff/Makefile.depend
+++ b/gnu/usr.bin/groff/src/roff/nroff/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/groff/src/roff/psroff/Makefile.depend b/gnu/usr.bin/groff/src/roff/psroff/Makefile.depend
index 11aba52..f80275d 100644
--- a/gnu/usr.bin/groff/src/roff/psroff/Makefile.depend
+++ b/gnu/usr.bin/groff/src/roff/psroff/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/groff/src/roff/troff/Makefile.depend b/gnu/usr.bin/groff/src/roff/troff/Makefile.depend
index 258b3e8..974b022 100644
--- a/gnu/usr.bin/groff/src/roff/troff/Makefile.depend
+++ b/gnu/usr.bin/groff/src/roff/troff/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
gnu/usr.bin/groff/src/libs/libgroff \
diff --git a/gnu/usr.bin/groff/src/utils/addftinfo/Makefile.depend b/gnu/usr.bin/groff/src/utils/addftinfo/Makefile.depend
index 319a92f..7ca2c25 100644
--- a/gnu/usr.bin/groff/src/utils/addftinfo/Makefile.depend
+++ b/gnu/usr.bin/groff/src/utils/addftinfo/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
gnu/usr.bin/groff/src/libs/libgroff \
diff --git a/gnu/usr.bin/groff/src/utils/afmtodit/Makefile.depend b/gnu/usr.bin/groff/src/utils/afmtodit/Makefile.depend
index 11aba52..f80275d 100644
--- a/gnu/usr.bin/groff/src/utils/afmtodit/Makefile.depend
+++ b/gnu/usr.bin/groff/src/utils/afmtodit/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/groff/src/utils/hpftodit/Makefile.depend b/gnu/usr.bin/groff/src/utils/hpftodit/Makefile.depend
index 319a92f..7ca2c25 100644
--- a/gnu/usr.bin/groff/src/utils/hpftodit/Makefile.depend
+++ b/gnu/usr.bin/groff/src/utils/hpftodit/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
gnu/usr.bin/groff/src/libs/libgroff \
diff --git a/gnu/usr.bin/groff/src/utils/indxbib/Makefile.depend b/gnu/usr.bin/groff/src/utils/indxbib/Makefile.depend
index 90c204e..19d4feb 100644
--- a/gnu/usr.bin/groff/src/utils/indxbib/Makefile.depend
+++ b/gnu/usr.bin/groff/src/utils/indxbib/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
gnu/usr.bin/groff/src/libs/libbib \
diff --git a/gnu/usr.bin/groff/src/utils/lkbib/Makefile.depend b/gnu/usr.bin/groff/src/utils/lkbib/Makefile.depend
index 90c204e..19d4feb 100644
--- a/gnu/usr.bin/groff/src/utils/lkbib/Makefile.depend
+++ b/gnu/usr.bin/groff/src/utils/lkbib/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
gnu/usr.bin/groff/src/libs/libbib \
diff --git a/gnu/usr.bin/groff/src/utils/lookbib/Makefile.depend b/gnu/usr.bin/groff/src/utils/lookbib/Makefile.depend
index 90c204e..19d4feb 100644
--- a/gnu/usr.bin/groff/src/utils/lookbib/Makefile.depend
+++ b/gnu/usr.bin/groff/src/utils/lookbib/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
gnu/usr.bin/groff/src/libs/libbib \
diff --git a/gnu/usr.bin/groff/src/utils/pfbtops/Makefile.depend b/gnu/usr.bin/groff/src/utils/pfbtops/Makefile.depend
index ed1ce1e..770e2eb 100644
--- a/gnu/usr.bin/groff/src/utils/pfbtops/Makefile.depend
+++ b/gnu/usr.bin/groff/src/utils/pfbtops/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
gnu/usr.bin/groff/src/libs/libgroff \
diff --git a/gnu/usr.bin/groff/src/utils/tfmtodit/Makefile.depend b/gnu/usr.bin/groff/src/utils/tfmtodit/Makefile.depend
index 319a92f..7ca2c25 100644
--- a/gnu/usr.bin/groff/src/utils/tfmtodit/Makefile.depend
+++ b/gnu/usr.bin/groff/src/utils/tfmtodit/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
gnu/usr.bin/groff/src/libs/libgroff \
diff --git a/gnu/usr.bin/groff/tmac/Makefile.depend b/gnu/usr.bin/groff/tmac/Makefile.depend
index 11aba52..f80275d 100644
--- a/gnu/usr.bin/groff/tmac/Makefile.depend
+++ b/gnu/usr.bin/groff/tmac/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/rcs/ci/Makefile.depend b/gnu/usr.bin/rcs/ci/Makefile.depend
index 7549f52..cab8f8fe 100644
--- a/gnu/usr.bin/rcs/ci/Makefile.depend
+++ b/gnu/usr.bin/rcs/ci/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/rcs/co/Makefile.depend b/gnu/usr.bin/rcs/co/Makefile.depend
index 7549f52..cab8f8fe 100644
--- a/gnu/usr.bin/rcs/co/Makefile.depend
+++ b/gnu/usr.bin/rcs/co/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/rcs/ident/Makefile.depend b/gnu/usr.bin/rcs/ident/Makefile.depend
index 7549f52..cab8f8fe 100644
--- a/gnu/usr.bin/rcs/ident/Makefile.depend
+++ b/gnu/usr.bin/rcs/ident/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/rcs/lib/Makefile.depend b/gnu/usr.bin/rcs/lib/Makefile.depend
index 15a1f9c..18be76b 100644
--- a/gnu/usr.bin/rcs/lib/Makefile.depend
+++ b/gnu/usr.bin/rcs/lib/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/rcs/merge/Makefile.depend b/gnu/usr.bin/rcs/merge/Makefile.depend
index 7549f52..cab8f8fe 100644
--- a/gnu/usr.bin/rcs/merge/Makefile.depend
+++ b/gnu/usr.bin/rcs/merge/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/rcs/rcs/Makefile.depend b/gnu/usr.bin/rcs/rcs/Makefile.depend
index 7549f52..cab8f8fe 100644
--- a/gnu/usr.bin/rcs/rcs/Makefile.depend
+++ b/gnu/usr.bin/rcs/rcs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/rcs/rcsclean/Makefile.depend b/gnu/usr.bin/rcs/rcsclean/Makefile.depend
index 7549f52..cab8f8fe 100644
--- a/gnu/usr.bin/rcs/rcsclean/Makefile.depend
+++ b/gnu/usr.bin/rcs/rcsclean/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/rcs/rcsdiff/Makefile.depend b/gnu/usr.bin/rcs/rcsdiff/Makefile.depend
index 7549f52..cab8f8fe 100644
--- a/gnu/usr.bin/rcs/rcsdiff/Makefile.depend
+++ b/gnu/usr.bin/rcs/rcsdiff/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/rcs/rcsfreeze/Makefile.depend b/gnu/usr.bin/rcs/rcsfreeze/Makefile.depend
index 11aba52..f80275d 100644
--- a/gnu/usr.bin/rcs/rcsfreeze/Makefile.depend
+++ b/gnu/usr.bin/rcs/rcsfreeze/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/rcs/rcsmerge/Makefile.depend b/gnu/usr.bin/rcs/rcsmerge/Makefile.depend
index 7549f52..cab8f8fe 100644
--- a/gnu/usr.bin/rcs/rcsmerge/Makefile.depend
+++ b/gnu/usr.bin/rcs/rcsmerge/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/rcs/rlog/Makefile.depend b/gnu/usr.bin/rcs/rlog/Makefile.depend
index 7549f52..cab8f8fe 100644
--- a/gnu/usr.bin/rcs/rlog/Makefile.depend
+++ b/gnu/usr.bin/rcs/rlog/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/sdiff/Makefile.depend b/gnu/usr.bin/sdiff/Makefile.depend
index e7f6e73..4ba3ae9 100644
--- a/gnu/usr.bin/sdiff/Makefile.depend
+++ b/gnu/usr.bin/sdiff/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/gnu/usr.bin/send-pr/COPYING b/gnu/usr.bin/send-pr/COPYING
deleted file mode 100644
index 515b6d3..0000000
--- a/gnu/usr.bin/send-pr/COPYING
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 675 Mass Ave, Cambridge, MA 02139, USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-he GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- Appendix: How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) 19yy name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/gnu/usr.bin/send-pr/Makefile b/gnu/usr.bin/send-pr/Makefile
deleted file mode 100644
index f17db49..0000000
--- a/gnu/usr.bin/send-pr/Makefile
+++ /dev/null
@@ -1,35 +0,0 @@
-# $FreeBSD$
-#
-# Makefile for building a standalone send-pr.
-#
-
-SCRIPTS= send-pr
-MAN= send-pr.1
-SUBMITTERS= current-users
-RELEASE= `uname -rsm`
-CLEANFILES+= send-pr send-pr.el
-
-SUBDIR+= doc
-
-LINKS= ${BINDIR}/send-pr ${BINDIR}/sendbug
-MLINKS= send-pr.1 sendbug.1
-
-send-pr: send-pr.sh Makefile
- sed -e 's,@DATADIR@,/etc,g' \
- -e 's/@DEFAULT_RELEASE@/$(RELEASE)/g' \
- -e 's/^SUBMITTER=.*/SUBMITTER=$(SUBMITTERS)/' \
- ${.ALLSRC:N*Makefile} > ${.TARGET}
-
-send-pr.el: send-pr-el.in Makefile
- default_release=`uname -rsm`; \
- sed -e 's,@DATADIR@,/etc,g' \
- -e "s/@DEFAULT_RELEASE@/$${default_release}/g" \
- -e 's/"unknown"/"$(SUBMITTERS)"/g' \
- ${.ALLSRC:N*Makefile} > ${.TARGET}
-
-# called from /usr/src/etc/Makefile
-etc-gnats-freefall:
- ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0644 \
- ${.CURDIR}/categories ${DESTDIR}/etc/gnats/freefall
-
-.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/send-pr/Makefile.depend b/gnu/usr.bin/send-pr/Makefile.depend
deleted file mode 100644
index 29fda55..0000000
--- a/gnu/usr.bin/send-pr/Makefile.depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# Autogenerated - do NOT edit!
-
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
-DEP_MACHINE := ${.PARSEFILE:E}
-
-DIRDEPS = \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/gnu/usr.bin/send-pr/README b/gnu/usr.bin/send-pr/README
deleted file mode 100644
index b479179..0000000
--- a/gnu/usr.bin/send-pr/README
+++ /dev/null
@@ -1,43 +0,0 @@
- send-pr - sends bug reports to a central support site
-
-`send-pr' uses electronic mail to submit support questions and
-software bugs to a central site. No piece of software is perfect, and
-software organizations understand this `send-pr' is designed to allow
-users who have problems to submit reports of these problems to sites
-responsible for supporting the software in question, in a defined form
-which can be read by an electronically managed database.
-
-`send-pr' is part of a suite of programs known collectively as GNATS,
-an acronym for Problem Report Management System. GNATS consists of
-several programs which, used in concert, formulate and partially
-administer a database of Problem Reports, or PRs, at a central support
-site. A PR goes through several states in its lifetime; GNATS tracks
-the PR and all information associated with it through each state and
-finally acts as an archive for PRs which have been resolved.
-
-The same engine can be used to submit bugs to any number of support
-sites by setting up aliases for each of them; `send-pr' error-checks
-each PR as it is sent to be sure that the category specified matches a
-category supported by the site in question.
-
-`send-pr' invokes an editor on a problem report template (after trying
-to fill in some fields with reasonable default values). When you exit
-the editor, `send-pr' sends the completed form to the support site.
-At the support site, the PR is assigned a unique number and is stored
-in the GNATS database according to its category and customer-id. GNATS
-automatically replies with an acknowledgement, citing the category and
-the PR number.
-
-See the Texinfo file `send-pr.texi' or the Info file `send-pr.info'
-for detailed installation and usage information.
-
-See the file MANIFEST for a list of the files which should have
-accompanied this distribution.
-
-See `send-pr.texi', `send-pr.info', or the file INSTALL for the
-installation procedure for `send-pr'.
-
-
-Copyright (c) 1993, Free Software Foundation, Inc.
-See the file COPYING for copyright information concerning this
-distribution and all its components.
diff --git a/gnu/usr.bin/send-pr/categories b/gnu/usr.bin/send-pr/categories
deleted file mode 100644
index da511e7..0000000
--- a/gnu/usr.bin/send-pr/categories
+++ /dev/null
@@ -1,21 +0,0 @@
-# $FreeBSD$
-advocacy
-alpha
-amd64
-arm
-bin
-conf
-docs
-gnu
-i386
-ia64
-java
-kern
-misc
-ports
-powerpc
-sparc64
-standards
-threads
-usb
-www
diff --git a/gnu/usr.bin/send-pr/doc/Makefile b/gnu/usr.bin/send-pr/doc/Makefile
deleted file mode 100644
index 1de7064..0000000
--- a/gnu/usr.bin/send-pr/doc/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-INFO = send-pr
-INFOSECTION="System Utilities"
-
-.include <bsd.info.mk>
diff --git a/gnu/usr.bin/send-pr/doc/categ.texi b/gnu/usr.bin/send-pr/doc/categ.texi
deleted file mode 100644
index fe84918..0000000
--- a/gnu/usr.bin/send-pr/doc/categ.texi
+++ /dev/null
@@ -1,125 +0,0 @@
-@c $FreeBSD$
-
-@node Valid Categories
-@unnumberedsec Valid Categories
-@cindex valid categories
-@cindex example of a list of valid categories
-
-@table @code
-@item bfd
-@sc{gnu} binary file descriptor library.
-
-@item bifrabulator
-This one doesn't actually exist.
-
-@item binutils
-@sc{gnu} utilities for binary files (@code{ar}, @code{nm}, @code{size}@dots{}).
-
-@item bison
-@sc{gnu} parser generator.
-
-@item byacc
-Free parser generator.
-
-@item config
-Cygnus Solutions Software configuration and installation.
-
-@item cvs
-Concurrent Version System.
-
-@item diff
-@sc{gnu} @code{diff} program.
-
-@item doc
-Documentation and manuals.
-
-@item emacs
-@sc{gnu} Emacs editor and related functions.
-
-@item flex
-@sc{gnu} lexical analyzer.
-
-@item g++
-@sc{gnu} C++ compiler.
-
-@item gas
-@sc{gnu} assembler.
-
-@item gcc
-@sc{gnu} C compiler.
-
-@item gdb
-@sc{gnu} source code debugger.
-
-@item glob
-The filename globbing functions.
-
-@item gprof
-@sc{gnu} profiler.
-
-@item grep
-@sc{gnu} @code{grep} program.
-
-@item info
-@sc{gnu} @code{info} hypertext reader.
-
-@item ispell
-@sc{gnu} spelling checker.
-
-@item kerberos
-Kerberos authentication system.
-
-@item ld
-@sc{gnu} linker.
-
-@item libc
-Cygnus Solutions C Support Library.
-
-@item libg++
-@sc{gnu} C++ class library.
-
-@item libiberty
-@sc{gnu} @samp{libiberty} library.
-
-@item libm
-Cygnus Solutions C Math Library.
-
-@item make
-@sc{gnu} @code{make} program.
-
-@item makeinfo
-@sc{gnu} utility to build Info files from Texinfo documents.
-
-@item mas
-@sc{gnu} Motorola syntax assembler.
-
-@item newlib
-Cygnus Solutions C Support and Math Libraries.
-
-@item patch
-@sc{gnu} bug patch program.
-
-@item gnats
-@sc{gnu} Problem Report Management System.
-
-@item rcs
-Revision Control System.
-
-@item readline
-@sc{gnu} @code{readline} library.
-
-@item send-pr
-@sc{gnu} Problem Report submitting program.
-
-@item test
-Category to use when testing @code{send-pr}.
-
-@item texindex
-@sc{gnu} documentation indexing utility.
-
-@item texinfo
-@sc{gnu} documentation macros.
-
-@item other
-Anything which is not covered by the above categories.
-@end table
diff --git a/gnu/usr.bin/send-pr/doc/fields.texi b/gnu/usr.bin/send-pr/doc/fields.texi
deleted file mode 100644
index 0cce642..0000000
--- a/gnu/usr.bin/send-pr/doc/fields.texi
+++ /dev/null
@@ -1,522 +0,0 @@
-@c $FreeBSD$
-
-@node Fields
-@section Problem Report format
-@cindex Problem Report format
-@cindex format
-@cindex database similarities
-@cindex fields
-
-The format of a PR is designed to reflect the nature of @sc{gnats} as a
-database. Information is arranged into @dfn{fields}, and kept in
-individual records (Problem Reports).
-
-A Problem Report contains two different types of fields: @dfn{Mail
-Header} fields, which are used by the mail handler for delivery, and
-@dfn{Problem Report} fields, which contain information relevant to the
-Problem Report and its submitter. A Problem Report is essentially a
-specially formatted electronic mail message.
-
-Problem Report fields are denoted by a keyword which begins with
-@samp{>} and ends with @samp{:}, as in @samp{>Confidential:}. Fields
-belong to one of three data types:
-
-@table @asis
-@cindex Problem Report data types
-@cindex @emph{Enumerated} data types
-@item @sc{Enumerated}
-One of a specific set of values, which vary according to the field. The
-value for each keyword must be on the same line as the keyword. These
-values are not configurable (yet).
-
-@ifset SENDPR
-For each @sc{Enumerated} keyword, the possible choices are listed in the
-@code{send-pr} template as a comment.
-@end ifset
-The following fields are @sc{Enumerated} format; see the descriptions of
-fields below for explanations of each field in detail:
-
-@smallexample
-@group
->Confidential: >Severity: >Priority:
->Class: >State: >Number:
-@end group
-@end smallexample
-
-@cindex @emph{Text} data types
-@item @sc{Text}
-One single line of text which must begin and end on the same line (i.e.,
-before a newline) as the keyword. See the descriptions of fields below
-for explanations of each field in detail. The following fields are
-@sc{Text} format:
-
-@smallexample
-@group
->Submitter-Id: >Originator: >Synopsis:
->Category: >Release: >Responsible:
->Arrival-Date:
-@end group
-@end smallexample
-
-@cindex @emph{MultiText} data types
-@item @sc{MultiText}
-Text of any length may occur in this field. @sc{MultiText} may span
-multiple lines and may also include blank lines. A @sc{MultiText} field
-ends only when another keyword appears. See the descriptions of fields
-below for explanations of each field in detail.
-
-The following fields are @sc{MultiText} format:
-
-@smallexample
-@group
->Organization: >Environment: >Description:
->How-To-Repeat: >Fix: >Audit-Trail:
->Unformatted:
-@end group
-@end smallexample
-
-@end table
-
-@ifclear SENDPR
-@subheading Example Problem Report
-@end ifclear
-
-The following is an example Problem Report. Mail headers are at the
-top, followed by @sc{gnats} fields, which begin with @samp{>} and end
-with @samp{:}. The @samp{Subject:} line in the mail header and the
-@samp{>Synopsis:} field are usually duplicates of each other.
-
-@cindex sample Problem Report
-@cindex example Problem Report
-@cindex Problem Report template
-@cartouche
-@smallexample
-@group
-Message-Id: @var{message-id}
-Date: @var{date}
-From: @var{address}
-Reply-To: @var{address}
-To: @var{bug-address}
-Subject: @var{subject}
-
->Number: @var{gnats-id}
->Category: @var{category}
->Synopsis: @var{synopsis}
->Confidential: yes @emph{or} no
->Severity: critical, serious, @emph{or} non-critical
->Priority: high, medium @emph{or} low
->Responsible: @var{responsible}
->State: open, analyzed, suspended, feedback, @emph{or} closed
->Class: sw-bug, doc-bug, change-request, support,
-@ifset SENDPR
-@emph{or} duplicate
-@end ifset
-@ifclear SENDPR
-duplicate, @emph{or} mistaken
-@end ifclear
->Submitter-Id: @var{submitter-id}
->Arrival-Date: @var{date}
->Originator: @var{name}
->Organization: @var{organization}
->Release: @var{release}
->Environment:
- @var{environment}
->Description:
- @var{description}
->How-To-Repeat:
- @var{how-to-repeat}
->Fix:
- @var{fix}
->Audit-Trail:
-@var{appended-messages@dots{}}
-State-Changed-From-To: @var{from}-@var{to}
-State-Changed-When: @var{date}
-State-Changed-Why:
- @var{reason}
-Responsible-Changed-From-To: @var{from}-@var{to}
-Responsible-Changed-When: @var{date}
-Responsible-Changed-Why:
- @var{reason}
->Unformatted:
- @var{miscellaneous}
-@end group
-@end smallexample
-@end cartouche
-
-@menu
-* Mail header fields::
-* Problem Report fields::
-@end menu
-
-@c ----------------------
-@node Mail header fields
-@subsection Mail header fields
-@cindex mail header fields
-@cindex Internet standard RFC-822
-
-A Problem Report may contain any mail header field described in the
-Internet standard RFC-822. However, only the fields which identify the
-sender and the subject are required by @code{send-pr}:
-
-@table @code
-@cindex @code{To:} header
-@item To:
-The preconfigured mail address for the Support Site where the PR is to
-be sent, automatically supplied by @code{send-pr}.
-
-@cindex @code{Subject:} header
-@item Subject:
-A terse description of the problem. This field normally contains the
-same information as the @samp{>Synopsis:} field.
-
-@cindex @code{From:} header
-@item From:
-Usually supplied automatically by the originator's mailer; should
-contain the originator's electronic mail address.
-
-@cindex @code{Reply-To:} header
-@item Reply-To:
-A return address to which electronic replies can be sent; in most cases,
-the same address as the @code{From:} field.
-@end table
-
-@ifclear SENDPR
-@cindex @code{Received-By:} headers
-One of the configurable options for @sc{gnats} is whether or not to
-retain @w{@samp{Received-By:}} headers, which often consume a lot of
-space and are not often used. @xref{Local configuration,,Changing your
-local configuration}.
-@end ifclear
-
-@c ----------------------
-@node Problem Report fields
-@subsection Problem Report fields
-@cindex GNATS database fields
-@cindex field format
-
-@c FIXME - this node is loooooooooooooooong...
-
-@subheading Field descriptions
-
-The following fields are present whenever a PR is submitted via the
-program @code{send-pr}. @sc{gnats} adds additional fields when the PR
-arrives at the Support Site; explanations of them follow this list.
-
-@cindex fields - list
-@cindex GNATS fields - list
-@table @code
-@cindex @code{Submitter-Id} field
-@cindex @code{>Submitter-Id:}
-@item >Submitter-Id:
-(@sc{Text}) A unique identification code assigned by the Support Site.
-It is used to identify all Problem Reports coming from a particular
-site. (Submitters without a value for this field can invoke
-@code{send-pr} with the @samp{--request-id} option to apply for one from
-the support organization. Problem Reports from those not affiliated
-with the support organization should use the default value of @samp{net}
-for this field.)
-
-@cindex @code{Originator} field
-@cindex @code{>Originator:}
-@item >Originator:
-(@sc{Text}) Originator's real name. The default is the value of the
-originator's environment variable @code{NAME}.
-
-@cindex @code{>Organization:}
-@cindex @code{Organization} field
-@item >Organization:
-(@sc{MultiText}) The originator's organization. The default value is
-set with the variable @w{@code{DEFAULT_ORGANIZATION}} in the
-@ifclear SENDPR
-@file{config} file (@pxref{config file,,The @code{config} file}).
-@end ifclear
-@ifset SENDPR
-@code{send-pr} shell script.
-@end ifset
-
-@cindex @code{Confidential} field
-@cindex @code{>Confidential:}
-@cindex confidentiality in PRs
-@cindex PR confidentiality
-@item >Confidential:
-(@sc{Enumerated}) Use of this field depends on the originator's
-relationship with the support organization; contractual agreements often
-have provisions for preserving confidentiality. Conversely, a lack of a
-contract often means that any data provided will not be considered
-confidential. Submitters should be advised to contact the support
-organization directly if this is an issue.
-
-If the originator's relationship to the support organization provides
-for confidentiality, then if the value of this field is @samp{yes} the
-support organization treats the PR as confidential; any code samples
-provided are not made publicly available (e.g., in regression test
-suites). The default value is @samp{no}.
-
-@cindex @code{Synopsis} field
-@cindex @code{>Synopsis:}
-@item >Synopsis:
-(@sc{Text}) One-line summary of the problem. @w{@code{send-pr}} copies
-this information to the @samp{Subject:} line when you submit a Problem
-Report.
-
-@cindex @code{Severity} field
-@cindex @code{>Severity:}
-@item >Severity:
-(@sc{Enumerated}) The severity of the problem. Accepted values include:
-
-@table @code
-@cindex @emph{critical} severity problems
-@item critical
-The product, component or concept is completely non-operational or some
-essential functionality is missing. No workaround is known.
-
-@cindex @emph{serious} severity problems
-@item serious
-The product, component or concept is not working properly or significant
-functionality is missing. Problems that would otherwise be considered
-@samp{critical} are rated @samp{serious} when a workaround is known.
-
-@cindex @emph{non-critical} severity problems
-@item non-critical
-The product, component or concept is working in general, but lacks
-features, has irritating behavior, does something wrong, or doesn't
-match its documentation.
-@end table
-@noindent
-The default value is @samp{serious}.
-@sp 1
-
-@cindex @code{Priority} field
-@cindex @code{>Priority:}
-@item >Priority:
-(@sc{Enumerated}) How soon the originator requires a solution. Accepted
-values include:
-
-@table @code
-@cindex @emph{high} priority problems
-@item high
-A solution is needed as soon as possible.
-
-@cindex @emph{medium} priority problems
-@item medium
-The problem should be solved in the next release.
-
-@cindex @emph{low} priority problems
-@item low
-The problem should be solved in a future release.
-@end table
-@noindent
-The default value is @samp{medium}.
-@sp 1
-
-@cindex @code{Category} field
-@cindex @code{>Category:}
-@item >Category:
-(@sc{Text}) The name of the product, component or concept where
-the problem lies. The values for this field are defined by the Support
-Site.
-@ifclear SENDPR
-@xref{categories file,,The @code{categories} file}, for details.
-@end ifclear
-
-@cindex @code{Class} field
-@cindex @code{>Class:}
-@item >Class:
-(@sc{Enumerated}) The class of a problem can be one of the following:
-
-@table @code
-@cindex @emph{sw-bug} class
-@item sw-bug
-A general product problem. (@samp{sw} stands for ``software''.)
-
-@cindex @emph{doc-bug} class
-@item doc-bug
-A problem with the documentation.
-
-@cindex @emph{change-request} class
-@item change-request
-A request for a change in behavior, etc.
-
-@cindex @emph{support} class
-@item support
-A support problem or question.
-
-@cindex @emph{duplicate} class
-@item duplicate (@var{pr-number})
-Duplicate PR. @var{pr-number} should be the number of the original PR.
-
-@ifclear SENDPR
-@cindex @emph{mistaken} class
-@item mistaken
-No problem, user error or misunderstanding. This value is valid only at
-the Support Site.
-@end ifclear
-@end table
-
-@noindent
-The default is @samp{sw-bug}.
-@sp 1
-
-@cindex @code{Release} field
-@cindex @code{>Release:}
-@item >Release:
-(@sc{Text}) Release or version number of the product, component or
-concept.
-
-@cindex @code{Environment} field
-@cindex @code{>Environment:}
-@item >Environment:
-(@sc{MultiText}) Description of the environment where the problem occured:
-machine architecture, operating system, host and target types,
-libraries, pathnames, etc.
-
-@cindex @code{Description} field
-@cindex @code{>Description:}
-@item >Description:
-(@sc{MultiText}) Precise description of the problem.
-
-@cindex @code{How-To-Repeat} field
-@cindex @code{>How-To-Repeat:}
-@item >How-To-Repeat:
-(@sc{MultiText}) Example code, input, or activities to reproduce the
-problem. The support organization uses example code both to reproduce
-the problem and to test whether the problem is fixed. Include all
-preconditions, inputs, outputs, conditions after the problem, and
-symptoms. Any additional important information should be included.
-Include all the details that would be necessary for someone else to
-recreate the problem reported, however obvious. Sometimes seemingly
-arbitrary or obvious information can point the way toward a solution.
-See also @ref{Helpful hints,,Helpful hints}.
-
-@cindex @code{Fix} field
-@cindex @code{>Fix:}
-@item >Fix:
-(@sc{MultiText}) A description of a solution to the problem, or a patch
-which solves the problem. (This field is most often filled in at the
-Support Site; we provide it to the submitter in case she has solved the
-problem.)
-
-@end table
-
-@noindent
-@sc{gnats} adds the following fields when the PR arrives at the Support
-Site:
-
-@table @code
-@cindex @code{Number} field
-@cindex @code{>Number:}
-@item >Number:
-(@sc{Enumerated}) The incremental identification number for this PR.
-@ifclear SENDPR
-This is included in the automated reply to the submitter (if that
-feature of @sc{gnats} is activated; @pxref{Local configuration,,Changing
-your local configuration}). It is also included in the copy of the PR
-that is sent to the maintainer.
-@end ifclear
-
-The @samp{>Number:} field is often paired with the @samp{>Category:}
-field as
-
-@smallexample
-@var{category}/@var{number}
-@end smallexample
-
-@noindent
-in subsequent email messages. This is for historical reasons, as well
-as because Problem Reports are stored in subdirectories which are named
-by category.
-
-@cindex @code{State} field
-@cindex @code{>State:}
-@item >State:
-(@sc{Enumerated}) The current state of the PR. Accepted values are:
-
-@table @code
-@item open
-The PR has been filed and the responsible person notified.
-
-@item analyzed
-The responsible person has analyzed the problem.
-
-@item feedback
-The problem has been solved, and the originator has been given a patch
-or other fix.
-
-@item closed
-The changes have been integrated, documented, and tested, and the
-originator has confirmed that the solution works.
-
-@item suspended
-Work on the problem has been postponed.
-@end table
-
-@noindent
-The initial state of a PR is @samp{open}. @xref{States,,States of
-Problem Reports}.
-
-@cindex @code{Responsible} field
-@cindex @code{>Responsible:}
-@item >Responsible:
-(@sc{Text}) The person responsible for this category.
-@ifclear SENDPR
-@sc{gnats} retrieves this information from the @file{categories} file
-(@pxref{categories file,,The @code{categories} file}).
-@end ifclear
-
-@cindex @code{>Arrival-Date:}
-@cindex @code{Arrival-Date} field
-@item >Arrival-Date:
-(@sc{Text}) The time that this PR was received by @sc{gnats}. The date
-is provided automatically by @sc{gnats}.
-
-@cindex @code{>Audit-Trail:}
-@cindex @code{Audit-Trail} field
-@item >Audit-Trail:
-(@sc{MultiText}) Tracks related electronic mail as well as changes in
-the @samp{>State:} and @samp{>Responsible:} fields with the sub-fields:
-
-@table @code
-@cindex @code{State-Changed-<From>-<To>:} in @code{>Audit-Trail:}
-@item @w{State-Changed-<From>-<To>: @var{oldstate}>-<@var{newstate}}
-The old and new @samp{>State:} field values.
-
-@cindex @code{Responsible-Changed-<From>-<To>:} in @code{>Audit-Trail:}
-@item @w{Responsible-Changed-<From>-<To>: @var{oldresp}>-<@var{newresp}}
-The old and new @samp{>Responsible:} field values.
-
-@cindex @code{State-Changed-By:} in @code{>Audit-Trail:}
-@cindex @code{Responsible-Changed-By:} in @code{>Audit-Trail:}
-@item State-Changed-By: @var{name}
-@itemx Responsible-Changed-By: @var{name}
-The name of the maintainer who effected the change.
-
-@cindex @code{State-Changed-When:} in @code{>Audit-Trail:}
-@cindex @code{Responsible-Changed-When:} in @code{>Audit-Trail:}
-@item State-Changed-When: @var{timestamp}
-@itemx Responsible-Changed-When: @var{timestamp}
-The time the change was made.
-
-@cindex @code{State-Changed-Why:} in @code{>Audit-Trail:}
-@cindex @code{Responsible-Changed-Why:} in @code{>Audit-Trail:}
-@item State-Changed-Why: @var{reason@dots{}}
-@itemx Responsible-Changed-Why: @var{reason@dots{}}
-The reason for the change.
-@end table
-
-@cindex subsequent mail
-@cindex other mail
-@cindex appending PRs
-@cindex saving related mail
-@cindex related mail
-@noindent
-The @samp{>Audit-Trail:} field also contains any mail messages received
-by @sc{gnats} related to this PR, in the order received.
-
-@cindex @code{>Unformatted:}
-@cindex @code{Unformatted} field
-@item
- >Unformatted:
-(@sc{MultiText}) Any random text found outside the fields in the
-original Problem Report.
-@end table
-
diff --git a/gnu/usr.bin/send-pr/doc/s-usage.texi b/gnu/usr.bin/send-pr/doc/s-usage.texi
deleted file mode 100644
index 5c9006b..0000000
--- a/gnu/usr.bin/send-pr/doc/s-usage.texi
+++ /dev/null
@@ -1,570 +0,0 @@
-@c $FreeBSD$
-
-@c This is the usage section for send-pr. It is called as
-@c chapter (Invoking send-pr) by send-pr.texi, and also as
-@c section (Submitting Problem Reports) by gnats.texi (chapter/section
-@c identifiers are adjusted accordingly)
-
-@c FIXME! This still seems jumbled...
-
-You can invoke @code{send-pr} from a shell prompt, or from within
-@sc{gnu} Emacs using @w{@samp{M-x send-pr}}.
-
-@menu
-* using send-pr:: Creating new Problem Reports
-* send-pr in Emacs:: Using send-pr from within Emacs
-* send-pr from the shell:: Invoking send-pr from the shell
-* Submitting via e-mail:: Submitting a Problem Report via direct e-mail
-* Helpful hints::
-@end menu
-
-@node using send-pr
-@section Creating new Problem Reports
-
-@c FIXME - this is a long node
-Invoking @code{send-pr} presents a PR @dfn{template} with a number of
-fields already filled in. Complete the template as thoroughly as
-possible to make a useful bug report. Submit only one bug with each PR.
-
-@cindex template
-A template consists of three sections:
-
-@table @dfn
-@item Comments
-The top several lines of a blank template consist of a series of
-comments that provide some basic instructions for completing the Problem
-Report, as well as a list of valid entries for the @samp{>Category:}
-field. These comments are all preceded by the string @samp{SEND-PR:}
-and are erased automatically when the PR is submitted. The
-instructional comments within @samp{<} and @samp{>} are also removed.
-(Only these comments are removed; lines you provide that happen to have
-those characters in them, such as examples of shell-level redirection,
-are not affected.)
-
-@item Mail Header
-@code{send-pr} creates a standard mail header. @code{send-pr} completes
-all fields except the @samp{Subject:} line with default values.
-(@xref{Fields,,Problem Report format}.)
-
-@item @sc{gnats} fields
-These are the informational fields that @sc{gnats} uses to route your
-Problem Report to the responsible party for further action. They should
-be filled out as completely as possible. (@xref{Fields,,Problem Report
-format}. Also see @ref{Helpful hints,,Helpful hints}.)
-@end table
-
-@ifset SENDPR
-@noindent
-For examples of a Problem Report template and complete Problem Report,
-see @ref{An Example}.
-@end ifset
-
-The default template contains your preconfigured @samp{>Submitter-Id:}.
-@code{send-pr} attempts to determine values for the @samp{>Originator:}
-and @samp{>Organization:} fields (@pxref{Fields,,Problem Report
-format}). @code{send-pr} will set the @samp{>Originator:} field to
-the value of the @code{NAME} environment variable if it has been set;
-similarly, @samp{>Organization:} will be set to the value of @code{ORGANIZATION}.
-@code{send-pr} also attempts to find out some information
-about your system and architecture, and places this information in the
-@samp{>Environment:} field if it finds any.
-
-You may submit problem reports to different Support Sites from the
-default site by specifying the alternate site when you invoke
-@code{send-pr}. @xref{send-pr from the shell}.
-Each @code{site} has its own list of categories for
-which it accepts Problem Reports.
-@c FIXME! This should go in..
-@c For a list of sites to whom @code{send-pr} is configured to send
-@c Problem Reports, type @w{@samp{send-pr -S}}.
-@ifset SENDPR
-(@xref{default site,,Setting a default @var{site}}.)
-@end ifset
-
-@code{send-pr} also provides the mail header section of the template
-with default values in the @samp{To:}, @samp{From:}, and
-@samp{Reply-To:} fields. The @samp{Subject:} field is empty.
-
-The template begins with a comment section:
-
-@cindex template comment section
-@cindex comment section in the PR template
-@smallexample
-@group
-SEND-PR: -*- send-pr -*-
-SEND-PR: Lines starting with `SEND-PR' will be removed
-SEND-PR: automatically as well as all comments (the text
-SEND-PR: below enclosed in `<' and `>').
-SEND-PR:
-SEND-PR: Please consult the document `Reporting Problems
-SEND-PR: Using send-pr' if you are not sure how to fill out
-SEND-PR: a problem report.
-SEND-PR:
-SEND-PR: Choose from the following categories:
-@end group
-@end smallexample
-
-@noindent
-and also contains a list of valid @code{>Category:} values for the
-Support Site to whom you are submitting this Problem Report. One (and
-only one) of these values should be placed in the @code{>Category:}
-field.
-@ifset SENDPR
-A complete sample bug report, from template to completed PR, is shown in
-@ref{An Example}. For a complete list of valid categories, type
-@w{@samp{send-pr -L}} at your prompt. @xref{Valid Categories,,Valid
-Categories}, for a sample list of categories, .
-@end ifset
-
-@c FIXME.. this sounds awkward
-The mail header is just below the comment section. Fill out the
-@samp{Subject:} field, if it is not already completed using the value of
-@samp{>Synopsis:}. The other mail header fields contain default values.
-
-@cindex mail header section
-@smallexample
-@group
-To: @var{support-site}
-Subject: @emph{complete this field}
-From: @var{your-login}@@@var{your-site}
-Reply-To: @var{your-login}@@@var{your-site}
-X-send-pr-version: send-pr @value{VERSION}
-@end group
-@end smallexample
-
-@noindent
-where @var{support-site} is an alias on your local machine for the
-Support Site you wish to submit this PR to.
-
-The rest of the template contains @sc{gnats} fields. Each field is
-either automatically completed with valid information (such as your
-@samp{>Submitter-Id:}) or contains a one-line instruction specifying the
-information that field requires in order to be correct. For example,
-the @samp{>Confidential:} field expects a value of @samp{yes} or
-@samp{no}, and the answer must fit on one line; similarly, the
-@samp{>Synopsis:} field expects a short synopsis of the problem, which
-must also fit on one line. Fill out the fields as completely as
-possible. @xref{Helpful hints,,Helpful hints}, for suggestions as to
-what kinds of information to include.
-
-In this example, words in @emph{italics} are filled in with
-pre-configured information:
-
-@cindex @code{send-pr} fields
-@smallexample
-@group
->Submitter-Id: @emph{your submitter-id}
->Originator: @emph{your name here}
->Organization:
- @emph{your organization}
->Confidential:<[ yes | no ] (one line)>
->Synopsis: <synopsis of the problem (one line)>
->Severity: <[non-critical | serious | critical](one line)>
->Priority: <[ low | medium | high ] (one line)>
->Category: <name of the product (one line)>
->Class: <[sw-bug | doc-bug | change-request | support]>
->Release: <release number (one line)>
->Environment:
- <machine, os, target, libraries (multiple lines)>
-
->Description:
- <precise description of the problem (multiple lines)>
->How-To-Repeat:
- <code/input/activities to reproduce (multiple lines)>
->Fix:
- <how to correct or work around the problem, if known
- (multiple lines)>
-@end group
-@end smallexample
-
-@cindex @code{Submitter-Id} field
-@cindex @code{>Submitter-Id:}
-When you finish editing the Problem Report, @code{send-pr} mails it to
-the address named in the @samp{To:} field in the mail header.
-@code{send-pr} checks that the complete form contains a valid
-@samp{>Category:}.
-
-@ifset SENDPR
-Your copy of @code{send-pr} should have already been customized on
-installation to reflect your @samp{>Submitter-Id:}. (@xref{Installing
-send-pr, , Installing @code{send-pr} on your system}.) If you don't
-know your @samp{>Submitter-Id:}, you can request it using
-@w{@samp{send-pr --request-id}}. If your organization is not affiliated
-with the site you send Problem Reports to, a good generic
-@samp{>Submitter-Id:} to use is @samp{net}. @emph{NOTE:} If you are using
-send-pr to send problem reports to the FreeBSD Project, this version of
-send-pr already has a customer ID in it and you do not need to request a
-new one.
-@end ifset
-
-@cindex bad Problem Reports
-@cindex errors
-@cindex invalid Problem Reports
-If your PR has an invalid value in one of the @sc{Enumerated} fields
-(@pxref{Fields,,Problem Report format}), @code{send-pr} places the PR in
-a temporary file named @samp{/tmp/pbad@var{nnnn}} on your machine.
-@var{nnnn} is the process identification number given to your current
-@code{send-pr} session. If you are running @code{send-pr} from the
-shell, you are prompted as to whether or not you wish to try editing the
-same Problem Report again. If you are running @code{send-pr} from
-Emacs, the Problem Report is placed in the buffer
-@w{@samp{*send-pr-error*}}; you can edit this file and then submit it
-with
-
-@smallexample
-M-x gnats-submit-pr
-@end smallexample
-
-@cindex subsequent mail
-@cindex other mail
-@cindex appending PRs
-@cindex saving related mail
-@cindex related mail
-Any further mail concerning this Problem Report should be carbon-copied
-to the @sc{gnats} mailing address as well, with the category and
-identification number in the @samp{Subject:} line of the message.
-
-@smallexample
-Subject: Re: PR @var{category}/@var{gnats-id}: @var{original message subject}
-@end smallexample
-
-@noindent
-Messages which arrive with @samp{Subject:} lines of this form are
-automatically appended to the Problem Report in the @samp{>Audit-Trail:}
-field in the order received.
-
-@c ---------------------------------------------------------------
-@node send-pr in Emacs
-@section Using @code{send-pr} from within Emacs
-@cindex using @code{send-pr} from within Emacs
-@cindex @code{send-pr} within Emacs
-@cindex invoking @code{send-pr} from Emacs
-@cindex interactive interface
-
-You can use an interactive @code{send-pr} interface from within @sc{gnu}
-Emacs to fill out your Problem Report. We recommend that you
-familiarize yourself with Emacs before using this feature
-(@pxref{Introduction,,Introduction,emacs,GNU Emacs}).
-
-Call @code{send-pr} with @w{@samp{M-x send-pr}}.@footnote{If typing
-@w{@samp{M-x send-pr}} doesn't work, see your system administrator for
-help loading @code{send-pr} into Emacs.} @code{send-pr} responds with a
-Problem Report template preconfigured for the Support Site from which
-you received @code{send-pr}. (If you use @code{send-pr} locally, the
-default Support Site is probably your local site.)
-
-You may also submit problem reports to different Support Sites from the
-default site. To use this feature, invoke @code{send-pr} with
-
-@smallexample
-C-u M-x send-pr
-@end smallexample
-
-@code{send-pr} prompts you for the name of a @var{site}. @var{site} is
-an alias on your local machine which points to an alternate Support
-Site.
-
-@cindex Emacs
-@code{send-pr} displays the template and prompts you in the minibuffer
-with the line:
-@smallexample
->Category: other
-@end smallexample
-
-@noindent
-Delete the default value @samp{other} @emph{in the minibuffer} and
-replace it with the keyword corresponding to your problem (the list of
-valid categories is in the topmost section of the PR template). For
-example, if the problem you wish to report has to do with the @sc{gnu} C
-compiler, and your support organization accepts bugs submitted for this
-program under the category @samp{gcc}, delete @samp{other} and then type
-@w{@samp{gcc[@key{RET}]}}. @code{send-pr} replaces the line
-
-@smallexample
->Category: <name of the product (one line)>
-@end smallexample
-
-@noindent
-in the template with
-
-@smallexample
->Category: gcc
-@end smallexample
-
-@noindent
-and moves on to another field.
-
-@cindex completion in Emacs
-@cindex name completion in Emacs
-@w{@code{send-pr}} provides name completion in the minibuffer. For
-instance, you can also type @w{@samp{gc[@key{TAB}]}}, and @code{send-pr}
-attempts to complete the entry for you. Typing @w{@samp{g[@key{TAB}]}}
-may not have the same effect if several possible entries begin with
-@samp{g}. In that case @code{send-pr} cannot complete the entry because
-it cannot determine whether you mean @samp{gcc} or, for example,
-@samp{gdb}, if both of those are possible categories.
-@w{@code{send-pr}} continues to prompt you for a valid entry until you
-enter one.
-
-@w{@code{send-pr}} prompts you interactively to enter each field for
-which there is a range of specific choices. If you attempt to enter a
-value which is not in the range of acceptable entries, @code{send-pr}
-responds with @w{@samp{[No match]}} and allows you to change the entry
-until it contains an acceptable value. This avoids unusable information
-(at least in these fields) and also avoids typographical errors which
-could cause problems later.
-
-@code{send-pr} prompts you for the following fields:
-
-@c FIXME - should these go before the discussion on completion?
-@example
-@group
->Category:
->Confidential: (@emph{default}: no)
->Severity: (@emph{default}: serious)
->Priority: (@emph{default}: medium)
->Class: (@emph{default}: sw-bug)
->Release:
->Synopsis: (@emph{this value is copied to @code{Subject:}})
-@end group
-@end example
-
-@noindent
-After you complete these fields, @w{@code{send-pr}} places the cursor in
-the @samp{>Description:} field and displays the message
-
-@smallexample
-To send the problem report use: C-c C-c
-@end smallexample
-
-@noindent
-in the minibuffer. At this point, edit the file in the main buffer to
-reflect your specific problem, putting relevant information in the
-proper fields.
-@ifset SENDPR
-@xref{An Example}, for a sample Problem Report.
-@end ifset
-
-@w{@samp{send-pr}} provides a few key bindings to make moving
-around in a template buffer more simple:
-
-@table @code
-@item C-c C-f
-@itemx M-x change-field
-Changes the field under the cursor. @code{edit-pr} prompts you for a
-new value.
-
-@item M-C-b
-@itemx M-x gnats-backward-field
-Moves the cursor to the beginning of the value of the current field.
-
-@item M-C-f
-@itemx M-x gnats-forward-field
-Moves the cursor to the end of the value of the current field.
-
-@item M-p
-@itemx M-x gnats-previous-field
-Moves the cursor back one field to the beginning of the value of the
-previous field.
-
-@item M-n
-@itemx M-x gnats-next-field
-Moves the cursor forward one field to the beginning of the value of the
-next field.
-@end table
-
-@code{send-pr} takes over again when you type @samp{C-c C-c} to send the
-message. @code{send-pr} reports any errors in a separate buffer, which
-remains in existence until you send the PR properly (or, of course,
-until you explicitly kill the buffer).
-
-For detailed instructions on using Emacs, see
-@ref{Introduction,,,emacs,GNU Emacs}.
-
-@node send-pr from the shell
-@section Invoking @code{send-pr} from the shell
-@cindex command line options
-@cindex invoking @code{send-pr} from the shell
-@cindex shell invocation
-
-@c FIXME! Add [ -S ] right after [ -L ]...
-@smallexample
-send-pr [ @var{site} ]
- [ -f @var{problem-report} | --file @var{problem-report} ]
- [ -t @var{mail-address} | --to @var{mail-address} ]
- [ --request-id ]
- [ -L | --list ] [ -P | --print ]
- [ -V | --version] [ -h | --help ]
-@end smallexample
-
-@var{site} is an alias on your local machine which points to an address
-used by a Support Site. If this argument is not present, the default
-@var{site} is usually the site which you received @code{send-pr} from,
-or your local site if you use @sc{gnats} locally.
-@ifset SENDPR
-(@xref{default site,,Setting a default @var{site}}.)
-@end ifset
-
-Invoking @code{send-pr} with no options calls the editor named in your
-environment variable @code{EDITOR} on a default PR template. If the
-environment variable @code{PR_FORM} is set, its value is used as a file
-name which contains a valid template. If @code{PR_FORM} points to a
-missing or unreadable file, or if the file is empty, @code{send-pr}
-generates an error message and opens the editor on a default template.
-
-@table @code
-@item -f @var{problem-report}
-@itemx --file @var{problem-report}
-Specifies a file, @var{problem-report}, where a completed Problem Report
-already exists. @code{send-pr} sends the contents of the file without
-invoking an editor. If @var{problem-report} is @samp{-},
-@w{@code{send-pr}} reads from standard input.
-
-@item -t @var{mail-address}
-@itemx --to @var{mail-address}
-Sends the PR to @var{mail-address}. The default is preset when
-@code{send-pr} is configured. @emph{This option is not recommended};
-instead, use the argument @var{site} on the command line.
-
-@item -c @var{mail-address}
-@itemx --cc @var{mail-address}
-Places @var{mail-address} in the @code{Cc:} header field of the message
-to be sent.
-
-@item --request-id
-Sends a request for a @code{>Submitter-Id:} to the Support Site.
-
-@cindex listing valid categories
-@item -L
-@itemx --list
-Prints the list of valid @code{>Category:} values on standard output.
-No mail is sent.
-
-@item -s @var{severity}
-@itemx --severity @var{severity}
-@cindex @code{send-pr} fields
-Sets the initial value of the @code{>Severity:} field to @var{severity}.
-
-@ignore
-@item -S
-@itemx --sites
-Displays a list of valid @var{site} values on standard output. No mail
-is sent.
-@end ignore
-
-@item -P
-@itemx --print
-Displays the PR template. If the variable @code{PR_FORM} is set in your
-environment, the file it specifies is printed. If @code{PR_FORM} is not
-set, @code{send-pr} prints the standard blank form. If the file
-specified by @code{PR_FORM} doesn't exist, @code{send-pr} displays an
-error message. No mail is sent.
-
-@item -V
-@itemx --version
-Displays the @code{send-pr} version number and a usage summary. No mail
-is sent.
-
-@item -h
-@itemx --help
-Displays a usage summary for @code{send-pr}. No mail is sent.
-@end table
-
-@c -------------------------------------------------------------------------
-@node Submitting via e-mail
-@section Submitting a Problem Report via direct e-mail
-@cindex Direct e-mail
-@cindex Submitting a PR via e-mail
-In addition to using @code{send-pr}, there is another way to submit a problem
-report. You can simply send an e-mail message to the support site.
-
-To do this, look at the address in the @samp{To:} field of the @code{send-pr}
-template. When you send unformatted e-mail to this address, @sc{gnats}
-processes the message as a new problem report, filling in as many fields from
-defaults as it can:
-
-@table @code
-@item Synopsis
-The @samp{>Synopsis} field is filled in by the @samp{Subject:} header.
-
-@item Submitter ID
-@sc{gnats} will try to derive the @samp{>Submitter} field from the address
-in the @samp{From:} header.
-
-@item Description
-All of the text in the body of the e-mail message is put into the
-@samp{>Description} field. Each line of the text is indented by one space,
-indicating that it is "quoted text" from the sender.
-@end table
-
-Other fields, such as category, version, severity, etc. are set to default
-values (if the @sc{gnats} administrator has set them).
-
-@c --------------------------------------------------------------------------
-@node Helpful hints
-@section Helpful hints
-@cindex helpful hints
-@cindex Using and Porting @sc{gnu} CC
-@cindex effective problem reporting
-@cindex kinds of helpful information
-@cindex information to submit
-@cindex Report all the facts!
-
-There is no orthodox standard for submitting effective bug reports,
-though you might do well to consult the section on submitting bugs for
-@sc{gnu} @code{gcc} in @ref{Bugs, , Reporting Bugs, gcc, Using and
-Porting GNU CC}, by Richard Stallman. This section contains
-instructions on what kinds of information to include and what kinds of
-mistakes to avoid.
-
-In general, common sense (assuming such an animal exists) dictates the
-kind of information that would be most helpful in tracking down and
-resolving problems in software.
-@itemize @bullet
-@item
-Include anything @emph{you} would want to know if you were looking at
-the report from the other end. There's no need to include every minute
-detail about your environment, although anything that might be different
-from someone else's environment should be included (your path, for
-instance).
-
-@item
-Narratives are often useful, given a certain degree of restraint. If a
-person responsible for a bug can see that A was executed, and then B and
-then C, knowing that sequence of events might trigger the realization of
-an intermediate step that was missing, or an extra step that might have
-changed the environment enough to cause a visible problem. Again,
-restraint is always in order (``I set the build running, went to get a
-cup of coffee (Columbian, cream but no sugar), talked to Sheila on the
-phone, and then THIS happened@dots{}'') but be sure to include anything
-relevant.
-
-@item
-Richard Stallman writes, ``The fundamental principle of reporting bugs
-usefully is this: @strong{report all the facts}. If you are not sure
-whether to state a fact or leave it out, state it!'' This holds true
-across all problem reporting systems, for computer software or social
-injustice or motorcycle maintenance. It is especially important in the
-software field due to the major differences seemingly insignificant
-changes can make (a changed variable, a missing semicolon, etc.).
-
-@item
-Submit only @emph{one} problem with each Problem Report. If you have
-multiple problems, use multiple PRs. This aids in tracking each problem
-and also in analyzing the problems associated with a given program.
-
-@item
-It never hurts to do a little research to find out if the bug you've
-found has already been reported. Most software releases contain lists
-of known bugs in the Release Notes which come with the software; see
-your system administrator if you don't have a copy of these.
-
-@item
-The more closely a PR adheres to the standard format, the less
-interaction is required by a database administrator to route the
-information to the proper place. Keep in mind that anything that
-requires human interaction also requires time that might be better spent
-in actually fixing the problem. It is therefore in everyone's best
-interest that the information contained in a PR be as correct as
-possible (in both format and content) at the time of submission.
-@end itemize
diff --git a/gnu/usr.bin/send-pr/doc/send-pr.texi b/gnu/usr.bin/send-pr/doc/send-pr.texi
deleted file mode 100644
index 1abb296..0000000
--- a/gnu/usr.bin/send-pr/doc/send-pr.texi
+++ /dev/null
@@ -1,658 +0,0 @@
-@c $FreeBSD$
-
-\input texinfo @c -*-texinfo-*-
-@setfilename send-pr.info
-@settitle Reporting Problems Using send-pr
-
-@setchapternewpage odd
-
-@include version.texi
-@set SENDPR
-
-@ifinfo
-@format
-START-INFO-DIR-ENTRY
-* send-pr: (send-pr). Reporting problems--using send-pr
-END-INFO-DIR-ENTRY
-@end format
-@end ifinfo
-
-@ifinfo
-Copyright @copyright{} 1993, 1994, 1995 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through TeX and print the
-results, provided the printed document carries a copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-
-@end ignore
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions.
-@end ifinfo
-
-@titlepage
-@finalout
-@title Reporting Problems
-@subtitle Using @code{send-pr}, version @value{VERSION}
-@subtitle October 1993
-@author Jeffrey M. Osier
-@author Cygnus Support
-@page
-
-@vskip 0pt plus 1filll
-
-Copyright @copyright{} 1993, 1994, 1995 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions.
-
-@end titlepage
-
-@c ---------------------------------------------------------------
-@node Top
-@top Overview
-@cindex foreword to @code{send-pr}
-@cindex overview to @code{send-pr}
-@cindex introduction to @code{send-pr}
-
-This manual documents @code{send-pr},
-@ifinfo
-version @value{VERSION},
-@end ifinfo
-which uses electronic mail to submit support questions and problem
-reports to a central Support Site. No body of work is perfect, and
-support organizations understand this; @code{send-pr} is designed to
-allow users who have problems to submit reports of these problems to
-sites responsible for supporting the products in question, in a defined
-form which can be read by an electronically managed database.
-
-@cindex GNATS
-@code{send-pr} is part of a suite of programs known collectively as
-@sc{gnats}, the @sc{gnu} Problem Report Management System. @sc{gnats}
-consists of several programs which, used in concert, formulate and
-partially administer a database of @dfn{Problem Reports}, or @dfn{PRs},
-at a central Support Site. A PR goes through several states in its
-lifetime; @sc{gnats} tracks the PR and all information associated with it
-through each state and finally acts as an archive for PRs which have
-been @dfn{closed}.
-
-Because @code{send-pr} exists as a shell (@file{/bin/sh}) script and as
-an Elisp file for use with @sc{gnu} Emacs, it can be used from any
-machine on your network which can run a shell script and/or Emacs.
-
-In general, you can use any editor and mailer to submit valid Problem
-Reports, as long as the format required by @sc{gnats} is preserved.
-@code{send-pr} automates the process, however, and ensures that certain
-fields necessary for automatic processing are present. @code{send-pr}
-is strongly recommended for all initial problem-oriented correspondence
-with your Support Site. The organization you submit Problem Reports to
-supplies an address to which further information can be sent; the person
-responsible for the category of the problem you report contacts you
-directly.
-
-@menu
-* send-pr in detail:: Details about send-pr and GNATS
-* Invoking send-pr:: Editing and sending PRs
-* An Example:: A working example
-* Installing send-pr:: Installing send-pr on your system
-* Index::
-@end menu
-
-@node send-pr in detail
-@chapter Details about send-pr and GNATS
-
-@cindex details about @code{send-pr}
-@cindex Problem Reports
-A @dfn{Problem Report} is a message that describes a problem you are
-having with a body of work. @code{send-pr} organizes this message into
-a form which can be understood and automatically processed by @sc{gnats},
-the @sc{gnu} Problem Report Management System. A Problem Report is
-organized into @dfn{fields} which contain data describing you, your
-organization, and the problem you are announcing (@pxref{Fields,,Problem
-Report format}). Problem Reports go through several defined states in
-their lifetimes, from @dfn{open} to @dfn{closed} (@pxref{States,,States
-of Problem Reports}).
-
-@menu
-* States:: States of Problem Reports
-* Fields:: Problem Report format
-@end menu
-
-@include states.texi
-
-@include fields.texi
-
-@node Invoking send-pr
-@chapter Editing and sending PRs
-@cindex editing and sending PRs
-@cindex sending PRs
-@cindex invoking send-pr
-@cindex using send-pr
-@cindex generating new PRs
-
-@include s-usage.texi
-
-@node An Example
-@chapter An Example
-@cindex an example
-@cindex example PR
-@cindex Cygnus Solutions
-@cindex @sc{gnu} software support
-Cygnus Solutions in Sunnyvale, CA, uses @sc{gnats} and @code{send-pr}
-extensively for their support activities. As a support company, Cygnus
-finds problem tracking to be a crucial part of everyday business.
-Cygnus supports the @sc{gnu} compiling tools (including @sc{gnats} and
-@code{send-pr}) over several many platforms
-
-With each shipment of the Cygnus Solutions Developer's Kit, customers
-receive the latest version of @code{send-pr}, which contains an
-up-to-date listing of valid categories (values for the @code{>Category:}
-field). Using these tools, Cygnus' customers can communicate their
-problems to Cygnus effectively and receive automatic confirmation of
-receipt as well as notification of changes in the status of their
-reported problems. Much of Cygnus' support mechanism relies on
-electronic mail.
-
-As an example, let's pretend we're a customer of Cygnus Solutions, and
-that we're having a problem compiling some of our software using the
-@sc{gnu} C compiler, which Cygnus supports.
-
-Assume that we're getting an error in our @code{bifrabulator} program
-wherein the @samp{prestidigitation} routines don't match with the
-@samp{whatsitsname}. We've made sure we're following the rules of the
-program and checked the Release Notes from Cygnus and found that the bug
-isn't already known. In other words, we're pretty sure we've found a
-bug.
-
-@cindex Imaginary Software, Ltd.
-Our first step is to call @code{send-pr}. It really doesn't matter
-whether we use @code{send-pr} from the shell or from within Emacs.
-Indeed, if we use Emacs as a primary editor, calling @code{send-pr} from
-the shell is likely to start @code{send-pr} in an Emacs buffer anyway.
-So, since our company, @emph{Imaginary Software, Ltd.}, uses @sc{gnu}
-software extensively, we're pretty familiar with Emacs, so from within
-Emacs we type
-@smallexample
-M-x send-pr
-@end smallexample
-@noindent
-and we're greeted with the following screen:
-
-@cindex default PR template
-@cindex example of a default template
-@cindex blank PR template
-@cindex @code{bifrabulator}
-@cartouche
-@smallexample
-SEND-PR: -*- text -*-
-SEND-PR: Lines starting with `SEND-PR' will be removed
-SEND-PR: automatically as well as all comments (the text
-SEND-PR: below enclosed in `<' and `>').
-SEND-PR: Please consult the manual if you are not sure
-SEND-PR: how to fill out a problem report.
-SEND-PR:
-SEND-PR: Choose from the following categories:
-SEND-PR:
-SEND-PR: bfd binutils bison
-SEND-PR: byacc clib config cvs diff
-SEND-PR: doc emacs flex g++ gas
-SEND-PR: gcc gdb glob gprof grep
-SEND-PR: info ispell kerberos ld libg++
-SEND-PR: libiberty make makeinfo mas newlib
-SEND-PR: other patch rcs readline send-pr
-SEND-PR: test texindex texinfo texinfo.tex
-SEND-PR: bifrabulator <---@emph{note: this one is fake}
-SEND-PR:
-To: cygnus-bugs@@cygnus.com
-Subject:
-From: jeffrey@@imaginary.com
-Reply-To: jeffrey@@imaginary.com
-X-send-pr-version: send-pr @value{VERSION}
-
->Submitter-Id: imaginary
->Originator: Jeffrey Osier
->Organization:
-Imaginary Software, Ltd.
->Confidential: <[ yes | no ] (one line)>
->Synopsis: <synopsis of the problem (one line)>
->Severity: <[ non-critical | serious | critical ] (one line)>
->Priority: <[ low | medium | high ] (one line)>
->Category: <name of the product (one line)>
->Class: <[sw-bug|doc-bug|change-request|support](oneline)>
->Release: <release number or tag (one line)>
->Environment:
- <machine, os, target, libraries (multiple lines)>
-System: SunOS imaginary.com 4.1.1 1 sun4
-Architecture: sun4
-
->Description:
- <precise description of the problem (multiple lines)>
->How-To-Repeat:
- <code/input/activities to reproduce (multiple lines)>
->Fix:
-@iftex
-@hrule
-@end iftex
------Emacs: *send-pr* (send-pr Fill)----All------------------
-@iftex
-@hrule
-@end iftex
->Category: other[]
-@end smallexample
-@end cartouche
-@page
-We know from past experience that we need to set certain information into
-each field, so we compile all the information we know about our problem.
-We have some sample code which we know should work, even though it
-doesn't, so we'll include that. Below is the completed PR; we send this
-using @kbd{C-c C-c}. (The comments have been truncated).
-
-@cindex completed Problem Report
-@cindex example of a completed PR
-@cartouche
-@smallexample
-SEND-PR: Lines starting with `SEND-PR' will be removed
-SEND-PR: automatically as well as all comments (the text
-SEND-PR: @dots{}
-SEND-PR:
-To: cygnus-bugs@@cygnus.com
-Subject: bifrabulator routines don't match
-From: jeffrey@@imaginary.com
-Reply-To: jeffrey@@imaginary.com
-X-send-pr-version: send-pr @value{VERSION}
-
->Submitter-Id: imaginary
->Originator: Jeffrey Osier
->Organization:
-Imaginary Software, Ltd.
->Confidential: no
->Synopsis: bifrabulator routines don't match
->Severity: serious
->Priority: medium
->Category: bifrabulator
->Class: sw-bug
->Release: progressive-930101
->Environment:
-System: SunOS imaginary.com 4.1.1 1 sun4
-Architecture: sun4 (SPARC)
-
->Description:
- the following code I fed into the bifrabulator came back
- with a strange error. apparently, the prestidigitation
- routine doesn't match with the whatsitsname in all cases.
-
->How-To-Repeat:
- call the bifrabulator on the following code.
- @emph{code sample@dots{}}
-
->Fix:
-@iftex
-@hrule
-@end iftex
------Emacs: *send-pr* (send-pr Fill)----All------------------
-@iftex
-@hrule
-@end iftex
-To send the problem report use: C-c C-c
-@end smallexample
-@end cartouche
-
-We type @kbd{C-c C-c}, and off it goes. Now, we depend on Cygnus
-Support to figure out the answer to our problem.
-
-Soon afterward, we get the following message from Cygnus:
-
-@smallexample
-@group
-From: gnats (GNATS management)
-Sender: gnats-admin
-Reply-To: hacker@@cygnus.com
-To: jeffrey@@imaginary.com
-Subject: Re: bifrabulator/1425: routines don't match
-
-Thank you very much for your problem report.
-It has the internal identification: g++/1425.
-The individual assigned to look at your bug is: hacker
-(F.B. Hacker)
-
-Category: bifrabulator
-Responsible: hacker
-Synopsis: bifrabulator routines don't match
-Arrival-Date: Sat Feb 30 03:12:55 1993
-@end group
-@end smallexample
-
-@noindent
-This is our receipt that the bug has been accepted and forwarded to the
-responsible party.
-
-@noindent
-A while later, we get the analysis:
-
-@smallexample
-@group
-To: jeffrey@@imaginary.com
-From: hacker@@cygnus.com
-Subject: Re: bifrabulator/1425: routines don't match
-Reply-To: hacker@@cygnus.com
-
-Got your message, Jeff. It seems that the bifrabulator was
-confusing the prestidigitation routines with the realitychecker
-when lexically parsing the whatsitsname.
-
-I'm working on robustisizing the bifrabulator now.
-
-How about lunch next week?
---
-F.B. Hacker
-Cygnus Solutions, Sunnyvale, CA 408 542 9600
-#include <std-disclaimer.h>
-@end group
-@end smallexample
-
-@noindent
-About the same time, we get another message from Cygnus.
-
-@cindex state change example
-@cindex example of a state change
-@smallexample
-@group
-From: hacker@@cygnus.com
-To: jeffrey@@imaginary.com
-Subject: Re: bifrabulator/1425: doesn't match prestidig
-Reply-To: hacker@@cygnus.com
-
-
- `F.B. Hacker' changed the state to `analyzed'.
-
-State-Changed-From-To: open-analyzed
-State-Changed-By: hacker
-State-Changed-When: Fri Feb 31 1993 08:59:16 1993
-State-Changed-Why:
- figured out the problem, working on a patch this afternoon
---
-F.B. Hacker
-Cygnus Solutions, Sunnyvale, CA 408 542 9600
-#include <std-disclaimer.h>
-@end group
-@end smallexample
-
-@noindent
-The bug has now been analyzed, and Cygnus is working on a solution.
-
-@noindent
-Sometime later, we get more mail from F.B.:
-
-@smallexample
-@group
-To: jeffrey@@imaginary.com
-From: hacker@@cygnus.com
-Subject: Re: bifrabulator/1425: routines don't match
-Reply-To: hacker@@cygnus.com
-
-There's a patch now that you can ftp over and check out.
-
-Hey, that joke you sent me was great! The one about the
-strings walking into a bar... my boss laughed for an hour!
---
-F.B. Hacker
-Cygnus Solutions, Sunnyvale, CA 408 542 9600
-#include <std-disclaimer.h>
-@end group
-@end smallexample
-@sp 2
-@smallexample
-@group
-From: hacker@@cygnus.com
-To: jeffrey@@imaginary.com
-Subject: Re: bifrabulator/1425: doesn't match prestidig
-Reply-To: hacker@@cygnus.com
-
-
- `F.B. Hacker' changed the state to `feedback'.
-
-State-Changed-From-To: analyzed-feedback
-State-Changed-By: hacker
-State-Changed-When: Fri Feb 31 1993 23:43:16 1993
-State-Changed-Why:
- got the patch finished, notified Jeff at Imaginary Software
---
-F.B. Hacker
-Cygnus Solutions, Sunnyvale, CA 408 542 9600
-#include <std-disclaimer.h>
-@end group
-@end smallexample
-
-@noindent
-The bug has gone into @dfn{feedback} status now, until we get the patch,
-install it and test it. When everything tests well, we can mail F.B.
-back and tell him the bug's been fixed, and he can change the state of
-the PR from @dfn{feedback} to @dfn{closed}.
-
-Following is a list of valid @samp{>Category:} entries that are
-supported by Cygnus.
-
-@menu
-* Valid Categories::
-@end menu
-
-@c FIXME - is this list up to date?
-@include categ.texi
-
-@node Installing send-pr
-@appendix Installing @code{send-pr} on your system
-@cindex installation
-
-If you receive @code{send-pr} as part of a larger software distribution,
-it probably gets installed when the full distribution is installed. If
-you are using @sc{gnats} at your site as well, you must decide where
-@code{send-pr} sends Problem Reports by default; see @ref{default site,,
-Setting a default @var{site}}.
-
-@menu
-* installation:: installing `send-pr' by itself
-* default site:: setting a default site
-@end menu
-
-@node installation
-@section Installing @code{send-pr} by itself
-@cindex installation procedure
-
-Install @code{send-pr} by following these steps (you may need
-@code{root} access in order to change the @file{aliases} file and to
-install @code{send-pr}):
-
-@itemize @bullet
-@item
-Unpack the distribution into a directory which we refer to as
-@var{srcdir}.
-
-@item
-Edit the file @file{Makefile} to reflect local conventions.
-Specifically, you should edit the variable @samp{prefix} to alter the
-installation location. The default is @file{/usr/local}. All files are
-installed under @samp{prefix} (see below).
-
-@item @emph{Run}
-@smallexample
-make all install [ info ] [ install-info ] [ clean ]
-@end smallexample
-
-@noindent
-The targets mean the following:
-
-@table @code
-@item all
-Builds @code{send-pr} and @code{install-sid}
-
-@item install
-Installs the following:
-
-@table @code
-@item install-sid
-@itemx send-pr
-into @file{@var{prefix}/bin}
-
-@item send-pr.1
-into @file{@var{prefix}/man/man1}
-
-@item @var{site}
-the list of valid @var{categories} for the Support Site from which you
-received @code{send-pr}, installed as
-@w{@file{@var{prefix}/share/gnats/@var{site}}}
-
-@item send-pr.el
-into @w{@file{@var{prefix}/share/emacs/lisp}}@footnote{If your main Emacs
-lisp repository is in a different directory from this, substitute that
-directory for @w{@file{@var{prefix}/share/emacs/lisp}}.}
-@end table
-
-@item info (@emph{optional})
-Builds @file{send-pr.info} from @file{send-pr.texi}@*
-@c FIXME - is this still true?
-(@file{send-pr.info} is included with this distribution)
-
-@item install-info (@emph{optional})
-Installs @file{send-pr.info} into @w{@file{@var{prefix}/info}}
-
-@item clean (@emph{optional})
-Removes all intermediary build files that can be rebuilt from source
-code
-@end table
-
-@item
-Run
-
-@smallexample
-install-sid @var{your-sid}
-@end smallexample
-
-@noindent
-where @var{your-sid} is the identification code you received with
-@w{@code{send-pr}}. @code{send-pr} automatically inserts this value
-into the template field @samp{>Submitter-Id:}. If you've downloaded
-@code{send-pr} from the Net, use @samp{net} for this value.
-
-@item
-Place the following line in
-@w{@file{@var{prefix}/share/emacs/lisp/default.el}}, or instruct your
-users to place the following line in their @file{.emacs} files:
-
-@smallexample
-(autoload 'send-pr "send-pr" "Submit a Problem Report." t)
-@end smallexample
-
-@item
-Create a mail alias for the Support Site from which you received
-@code{send-pr}, and for every site with which you wish to use
-@code{send-pr} to communicate. Each alias must have a suffix of
-@samp{-gnats}. The Support Site(s) will provide the correct addresses
-where these aliases should point. For instance, edit your mail aliases
-file to contain something like:
-
-@smallexample
-# support sites; for use with send-pr
-cygnus-gnats: bugs@@cygnus.com # Cygnus Solutions
-bumblebee-gnats: bumblebugs@@bumblebee.com # Bumblebee Inc.
-mycompany-gnats: bugs@@my.company.com (@emph{if you use @sc{gnats} locally})
-@end smallexample
-
-@code{send-pr} automatically searches for these aliases when you type
-
-@smallexample
-send-pr cygnus
-send-pr bumblebee
-send-pr @var{site}@dots{}
-@end smallexample
-
-@noindent
-@code{send-pr} also uses @var{site} to determine the categories of
-problems accepted by the site in question by looking in
-
-@smallexample
-@var{prefix}/share/gnats/@var{site}
-@end smallexample
-
-@end itemize
-
-@node default site
-@section Setting a default @var{site}
-@cindex default @var{site}
-@cindex setting a default @var{site}
-
-@code{send-pr} is capable of sending Problem Reports to any number of
-Support Sites, using mail aliases which have @samp{-gnats} appended them.
-@code{send-pr} automatically appends the suffix, so that when you type
-
-@smallexample
-send-pr @var{site}
-@end smallexample
-
-@noindent
-the Problem Report goes to the address noted in the @file{aliases} file
-as @w{@samp{@var{site}-gnats}}. You can do this in the Emacs version of
-@code{send-pr} by invoking the program with
-
-@smallexample
-C-u M-x send-pr
-@end smallexample
-
-@noindent
-You are prompted for @var{site}.
-
-@var{site} is also used to error-check the @samp{>Category:} field, as a
-precaution against sending mistaken information (and against sending
-information to the wrong site).
-
-You may also simply type
-
-@smallexample
-send-pr
-@end smallexample
-
-@noindent
-from the shell (or @w{@samp{M-x send-pr}} in Emacs), and the Problem
-Report you generate will be sent to the @var{site}, which is usually the
-site from which you received your distribution of @w{@code{send-pr}}.
-If you use @sc{gnats} at your own organization, the default is usually
-your local address for reporting problems.
-
-To change this, simply edit the file @file{Makefile} before installing
-and change the line
-
-@smallexample
-GNATS_SITE = @var{site}
-@end smallexample
-
-@noindent
-to reflect the site where you wish to send PRs by default.
-
-@c ---------------------------------------------------------------
-@node Index
-@unnumbered Index
-
-@printindex cp
-
-@c ---------------------------------------------------------------
-@contents
-@bye
diff --git a/gnu/usr.bin/send-pr/doc/states.texi b/gnu/usr.bin/send-pr/doc/states.texi
deleted file mode 100644
index f38405c..0000000
--- a/gnu/usr.bin/send-pr/doc/states.texi
+++ /dev/null
@@ -1,58 +0,0 @@
-@c $FreeBSD$
-
-@node States
-@section States of Problem Reports
-
-@cindex life-cycle of a Problem Report
-@cindex states of Problem Reports
-@cindex Problem Report states
-@cindex automatic notification
-
-Each PR goes through a defined series of states between origination and
-closure. The originator of a PR receives notification automatically of
-any state changes.
-
-Unless your site has customized states (see @pxref{states
-file,,,gnats}), @sc{gnats} uses these states:
-
-@table @dfn
-@cindex @emph{open} state
-@cindex initial state (@dfn{open})
-@cindex state---@dfn{open}
-@item open
-The initial state of a Problem Report. This means the PR has been filed
-and the responsible person(s) notified.
-
-@cindex @emph{analyzed} state
-@cindex state---@dfn{analyzed}
-@item analyzed
-The responsible person has analyzed the problem. The analysis should
-contain a preliminary evaluation of the problem and an estimate of the
-amount of time and resources necessary to solve the problem. It should
-also suggest possible workarounds.
-
-@cindex @emph{feedback} state
-@cindex state---@dfn{feedback}
-@item feedback
-The problem has been solved, and the originator has been given a patch
-or other fix. The PR remains in this state until the originator
-acknowledges that the solution works.
-
-@cindex @emph{closed} state
-@cindex state---@dfn{closed}
-@cindex final state (@dfn{closed})
-@item closed
-A Problem Report is closed (``the bug stops here'') only when any
-changes have been integrated, documented, and tested, and the submitter
-has confirmed the solution.
-
-@cindex @emph{suspended} state
-@cindex state---@dfn{suspended}
-@item suspended
-Work on the problem has been postponed. This happens if a timely
-solution is not possible or is not cost-effective at the present time.
-The PR continues to exist, though a solution is not being actively
-sought. If the problem cannot be solved at all, it should be closed
-rather than suspended.
-@end table
-
diff --git a/gnu/usr.bin/send-pr/doc/version.texi b/gnu/usr.bin/send-pr/doc/version.texi
deleted file mode 100644
index bffedc2..0000000
--- a/gnu/usr.bin/send-pr/doc/version.texi
+++ /dev/null
@@ -1,3 +0,0 @@
-@c $FreeBSD$
-
-@set VERSION 3.113
diff --git a/gnu/usr.bin/send-pr/install-sid.sh b/gnu/usr.bin/send-pr/install-sid.sh
deleted file mode 100755
index f7f24e5..0000000
--- a/gnu/usr.bin/send-pr/install-sid.sh
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/bin/sh
-# Drop in the SUBMITTER id into a site's installed send-pr script.
-# Copyright (C) 1993 Free Software Foundation, Inc.
-# Contributed by Brendan Kehoe (brendan@cygnus.com), based on a
-# version written by Heinz G. Seidl (hgs@ide.com).
-#
-# This file is part of GNU GNATS.
-#
-# GNU GNATS is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# GNU GNATS is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU GNATS; see the file COPYING. If not, write to
-# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-
-COMMAND=`echo $0 | sed -e 's,.*/,,g'`
-USAGE="Usage: $COMMAND [--install-dir=prefix] [--help] [--version] submitter-id"
-
-VERSION=3.2
-
-BINDIR=@BINDIR@
-
-SUBMITTER=
-TEMP=/tmp/sp$$
-
-if [ $# -eq 0 ]; then
- echo "$USAGE"
- exit 1
-fi
-
-while [ $# -gt 0 ]; do
- case "$1" in
- -install-dir=*|--install-dir=*|--install-di=*|--install-d=*|--install-=*|--install=*|--instal=*|--insta=*|--inst=*|--ins=*|--in=*|--i=*)
- I=`echo "$1" | sed 's/-*i[a-z\-]*=//'`
- BINDIR=$I/bin ;;
- --version) echo $COMMAND version $VERSION ; exit 1 ;;
- -*) echo "$USAGE" ; exit 1 ;;
- *) SUBMITTER=$1 ;;
- esac
- shift
-done
-
-path=`echo $0 | sed -e "s;${COMMAND};;"`
-
-[ -z "$path" ] && path=.
-
-if [ -f $BINDIR/send-pr ]; then
- SPPATH=$BINDIR/send-pr
-elif [ -f $path/send-pr ]; then
- SPPATH=$path/send-pr
-else
- echo "$COMMAND: cannot find \`$BINDIR/send-pr' or \`$path/send-pr'" >&2
- exit 1
-fi
-
-trap 'rm -f $TEMP ; exit 0' 0
-trap 'echo "$COM: Aborting ..."; rm -f $TEMP ; exit 1' 1 2 3 13 15
-
-sed -e "s/^SUBMITTER=.*/SUBMITTER=${SUBMITTER}/" $SPPATH > $TEMP
-
-if grep $SUBMITTER $TEMP > /dev/null; then
- cp $SPPATH $SPPATH.orig &&
- rm -f $SPPATH &&
- cp $TEMP $SPPATH &&
- chmod a+rx $SPPATH &&
- rm -f $TEMP $SPPATH.orig ||
- { echo "$COMMAND: unable to replace send-pr" >&2 ; exit 1; }
-else
- echo "$COMMAND: something went wrong when sed-ing the submitter into send-pr" >&2
- exit 1
-fi
-
-echo "$COMMAND: \`$SUBMITTER' is now the default submitter ID for send-pr"
-
-exit 0
diff --git a/gnu/usr.bin/send-pr/send-pr-el.in b/gnu/usr.bin/send-pr/send-pr-el.in
deleted file mode 100644
index 8195ecb..0000000
--- a/gnu/usr.bin/send-pr/send-pr-el.in
+++ /dev/null
@@ -1,813 +0,0 @@
-;;;; -*-emacs-lisp-*-
-;;;;---------------------------------------------------------------------------
-;;;; EMACS interface for send-pr (by Heinz G. Seidl)
-;;;; Slightly hacked by Brendan Kehoe (brendan@cygnus.com).
-;;;;
-;;;; This file is part of the Problem Report Management System (GNATS)
-;;;; Copyright 1992, 1993, 1997 Cygnus Support
-;;;;
-;;;; This program is free software; you can redistribute it and/or
-;;;; modify it under the terms of the GNU General Public
-;;;; License as published by the Free Software Foundation; either
-;;;; version 2 of the License, or (at your option) any later version.
-;;;;
-;;;; This program is distributed in the hope that it will be useful,
-;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-;;;; General Public License for more details.
-;;;;
-;;;; You should have received a copy of the GNU Library General Public
-;;;; License along with this program; if not, write to the Free
-;;;; Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-;;;;
-;;;;---------------------------------------------------------------------------
-;;;;
-;;;; This file contains the EMACS interface to the Problem Report Management
-;;;; System (GNATS):
-;;;;
-;;;; - The `send-pr' command and the `send-pr-mode' for sending
-;;;; Problem Reports (PRs).
-;;;;
-;;;; For more information about how to send a PR see send-pr(1).
-;;;;
-;;;;---------------------------------------------------------------------------
-;;;;
-;;;; Configuration: the symbol `DEFAULT-RELEASE' can be replaced by
-;;;; site/release specific strings during the configuration/installation
-;;;; process.
-;;;;
-;;;; Install this file in your EMACS library directory.
-;;;;
-;;;;---------------------------------------------------------------------------
-;;;;
-;;;; $FreeBSD$
-
-(provide 'send-pr)
-
-;;;;---------------------------------------------------------------------------
-;;;; Customization: put the following forms into your default.el file
-;;;; (or into your .emacs)
-;;;;---------------------------------------------------------------------------
-
-;(autoload 'send-pr-mode "send-pr"
-; "Major mode for sending problem reports." t)
-
-;(autoload 'send-pr "send-pr"
-; "Command to create and send a problem report." t)
-
-;;;;---------------------------------------------------------------------------
-;;;; End of Customization Section
-;;;;---------------------------------------------------------------------------
-
-(autoload 'server-buffer-done "server")
-(defvar server-buffer-clients nil)
-(defvar mail-self-blind nil)
-(defvar mail-default-reply-to nil)
-
-(defconst send-pr::version "3.113")
-
-(defvar gnats:root "/home/gnats"
- "*The top of the tree containing the GNATS database.")
-
-;;;;---------------------------------------------------------------------------
-;;;; hooks
-;;;;---------------------------------------------------------------------------
-
-(defvar text-mode-hook nil) ; we define it here in case it's not defined
-(defvar send-pr-mode-hook text-mode-hook "Called when send-pr is invoked.")
-
-;;;;---------------------------------------------------------------------------
-;;;; Domains and default values for (some of) the Problem Report fields;
-;;;; constants and definitions.
-;;;;---------------------------------------------------------------------------
-
-(defconst gnats::emacs-19p
- (not (or (and (boundp 'epoch::version) epoch::version)
- (string-lessp emacs-version "19")))
- "Is this emacs v19?")
-
-;;; This has to be here rather than at the bottom of this file with
-;;; the other utility functions because it is used by
-;;; gnats::get-config, which is called when send-pr.el is being
-;;; loaded (see the "defconst" below), before the whole file has been
-;;; loaded.
-
-(defun gnats::find-safe-default-directory (&optional buffer)
-"If the directory referred to by `default-directory' for the current
-buffer (or for optional argument BUFFER) does not exist, set it to the home
-directory of the current user if that exists, or to `/'.
-
-Returns the final value of default-directory in the buffer."
- (let ((homedir (expand-file-name "~/")))
- (save-excursion
- (if buffer (set-buffer buffer))
- (if (not (file-exists-p default-directory))
- (if (file-exists-p homedir)
- (setq default-directory homedir)
- (setq default-directory "/")))
- default-directory)))
-
-;;; These may be changed during configuration/installation or by the individual
-;;; user in his/her .emacs file.
-;;;
-(defun gnats::get-config (var)
- (let ((shell-file-name "/bin/sh")
- (buf (generate-new-buffer " *GNATS config*"))
- ret)
- (save-excursion
- (set-buffer buf)
- (shell-command-on-region
- (point-min) (point-max)
- (concat ". " gnats:root "/gnats-adm/config; echo $" var ) t)
- (goto-char (point-min))
- ; We have to use get-buffer, since shell-command-on-region will wipe
- ; out the buffer if there's no output from the command.
- (if (or (not (get-buffer "*Shell Command Output*"))
- (looking-at "^\\.:\\|/bin/sh:\\|\n"))
- (setq ret nil)
- (setq ret (buffer-substring (point-min) (- (point-max) 1)))))
- (if (and ret (string-equal ret "")) (setq ret nil))
- (kill-buffer buf)
- ret))
-
-;; const because it must match the script's value
-(defconst send-pr:datadir (or (gnats::get-config "DATADIR") "@DATADIR@")
- "*Where the `gnats' subdirectory containing category lists lives.")
-
-(defvar send-pr::sites nil
- "List of GNATS support sites; computed at runtime.")
-(defvar send-pr:default-site
- (or (gnats::get-config "GNATS_SITE") "freefall")
- "Default site to send bugs to.")
-(defvar send-pr:::site send-pr:default-site
- "The site to which a problem report is currently being submitted, or NIL
-if using the default site (buffer local).")
-
-(defvar send-pr:::categories nil
- "Buffer local list of available categories, derived at runtime from
-send-pr:::site and send-pr::category-alist.")
-(defvar send-pr::category-alist nil
- "Alist of GNATS support sites and the categories supported at each; computed
-at runtime.")
-
-;;; Ideally we would get all the following values from a central database
-;;; during runtime instead of having them here in the code.
-;;;
-(defconst send-pr::fields
- (` (("Category" send-pr::set-categories
- (, (or (gnats::get-config "DEFAULT_CATEGORY") nil)) enum)
- ("Class" (("sw-bug") ("doc-bug") ("change-request") ("update") ("maintainer-update"))
- (, (or (gnats::get-config "DEFAULT_CLASS") 0)) enum)
- ("Confidential" (("yes") ("no"))
- (, (or (gnats::get-config "DEFAULT_CONFIDENTIAL") 1)) enum)
- ("Severity" (("non-critical") ("serious") ("critical"))
- (, (or (gnats::get-config "DEFAULT_SEVERITY") 1)) enum)
- ("Priority" (("low") ("medium") ("high"))
- (, (or (gnats::get-config "DEFAULT_PRIORITY") 1)) enum)
- ("Release" nil
- (, (or (gnats::get-config "DEFAULT_RELEASE") "@DEFAULT_RELEASE@"))
- text)
- ("Submitter-Id" nil
- (, (or (gnats::get-config "DEFAULT_SUBMITTER") "unknown")) text)
- ("Synopsis" nil nil text
- (lambda (a b c) (gnats::set-mail-field "Subject" c)))))
- "AList, keyed on the name of the field, of:
-1) The field name.
-2) The list of completions. This can be a list, a function to call, or nil.
-3) The default value.
-4) The type of the field.
-5) A sub-function to call when changed.")
-
-(defvar gnats::fields nil)
-
-(defmacro gnats::push (i l)
- (` (setq (, l) (cons (,@ (list i l))))))
-
-(defun send-pr::set-categories (&optional arg)
- "Get the list of categories for the current site out of
-send-pr::category-alist if there or from send-pr if not. With arg, force
-update."
- ;;
- (let ((entry (assoc send-pr:::site send-pr::category-alist)))
- (or (and entry (null arg))
- (let ((oldpr (getenv "GNATS_ROOT")) cats)
- (send-pr::set-sites arg)
- (setenv "GNATS_ROOT" gnats:root)
- (setq cats (gnats::get-value-from-shell
- "send-pr" "-CL" send-pr:::site))
- (setenv "GNATS_ROOT" oldpr)
- (if entry (setcdr entry cats)
- (setq entry (cons send-pr:::site cats))
- (gnats::push entry send-pr::category-alist))))
- (setq send-pr:::categories (cdr entry))))
-
-(defun send-pr::set-sites (&optional arg)
- "Get the list of sites (by listing the contents of DATADIR/gnats) and assign
-it to send-pr::sites. With arg, force update."
- (or (and (null arg) send-pr::sites)
- (progn
- (setq send-pr::sites nil)
- (mapcar
- (function
- (lambda (file)
- (or (memq t (mapcar (function (lambda (x) (string= x file)))
- '("." ".." "pr-edit" "pr-addr")))
- (not (file-readable-p file))
- (gnats::push (list (file-name-nondirectory file))
- send-pr::sites))))
- (directory-files (format "%s/gnats" send-pr:datadir) t))
- (setq send-pr::sites (reverse send-pr::sites)))))
-
-(defconst send-pr::pr-buffer-name "*send-pr*"
- "Name of the temporary buffer, where the problem report gets composed.")
-
-(defconst send-pr::err-buffer-name "*send-pr-error*"
- "Name of the temporary buffer, where send-pr error messages appear.")
-
-(defvar send-pr:::err-buffer nil
- "The error buffer used by the current PR buffer.")
-
-(defvar send-pr:::spawn-to-send nil
- "Whether or not send-pr-mode should spawn a send-pr process to send the PR.")
-
-(defconst gnats::indent 17 "Indent for formatting the value.")
-
-;;;;---------------------------------------------------------------------------
-;;;; `send-pr' - command for creating and sending of problem reports
-;;;;---------------------------------------------------------------------------
-
-(fset 'send-pr 'send-pr:send-pr)
-(defun send-pr:send-pr (&optional site)
- "Create a buffer and read in the result of `send-pr -P'.
-When finished with editing the problem report use \\[send-pr:submit-pr]
-to send the PR with `send-pr -b -f -'."
- ;;
- (interactive
- (if current-prefix-arg
- (list (completing-read "Site: " (send-pr::set-sites 'recheck) nil t
- send-pr:default-site))))
- (or site (setq site send-pr:default-site))
- (let ((buf (get-buffer send-pr::pr-buffer-name)))
- (if (or (not buf)
- (progn (switch-to-buffer buf)
- (cond ((or (not (buffer-modified-p buf))
- (y-or-n-p "Erase previous problem report? "))
- (erase-buffer) t)
- (t nil))))
- (send-pr::start-up site))))
-
-(defun send-pr::start-up (site)
- (switch-to-buffer (get-buffer-create send-pr::pr-buffer-name))
- (setq default-directory (expand-file-name "~/"))
- (auto-save-mode auto-save-default)
- (let ((oldpr (getenv "GNATS_ROOT"))
- (case-fold-search nil))
- (setenv "GNATS_ROOT" gnats:root)
- (send-pr::insert-template site)
- (setenv "GNATS_ROOT" oldpr)
- (goto-char (point-min))
- (if (looking-at "send-pr:")
- (cond ((looking-at "send-pr: .* does not have a categories list")
- (setq send-pr::sites nil)
- (error "send-pr: the GNATS site %s does not have a categories list" site))
- (t (error (buffer-substring (point-min) (point-max)))))
- (save-excursion
- ;; Clear cruft inserted by bdamaged .cshrcs
- (goto-char 1)
- (re-search-forward "^SEND-PR:")
- (delete-region 1 (match-beginning 0)))))
- (set-buffer-modified-p nil)
- (send-pr:send-pr-mode)
- (setq send-pr:::site site)
- (setq send-pr:::spawn-to-send t)
- (send-pr::set-categories)
- (if (null send-pr:::categories)
- (progn
- (and send-pr:::err-buffer (kill-buffer send-pr:::err-buffer))
- (kill-buffer nil)
- (message "send-pr: no categories found"))
- (or (stringp mail-default-reply-to)
- (setq mail-default-reply-to (getenv "REPLYTO")))
- (and mail-default-reply-to
- (gnats::set-mail-field "Reply-To" mail-default-reply-to))
- (and mail-self-blind
- (gnats::set-mail-field "BCC" (user-login-name)))
- (mapcar 'send-pr::maybe-change-field send-pr::fields)
- (gnats::position-on-field "Description")
- (message (substitute-command-keys
- "To send the problem report use: \\[send-pr:submit-pr]"))))
-
-(defvar send-pr::template-alist nil
- "An alist containing the output of send-pr -P <sitename> for various sites.")
-
-(defun send-pr::insert-template (site)
- (let ((elt (assoc site send-pr::template-alist)))
- (if elt
- (save-excursion (insert (cdr elt)))
- (call-process "send-pr" nil t nil "-P" site)
- (save-excursion
- (setq send-pr::template-alist
- (cons (cons site (buffer-substring (point-min) (point-max)))
- send-pr::template-alist))))))
-
-(fset 'do-send-pr 'send-pr:submit-pr) ;backward compat
-(defun send-pr:submit-pr ()
- "Pipe the contents of the buffer *send-pr* to `send-pr -f -.' unless this
-buffer was loaded with emacsclient, in which case save the buffer and exit."
- ;;
- (interactive)
- (cond
- ((and (boundp 'server-buffer-clients)
- server-buffer-clients)
- (let ((buffer (current-buffer))
- (version-control nil) (buffer-backed-up nil))
- (save-buffer buffer)
- (kill-buffer buffer)
- (server-buffer-done buffer)))
- (send-pr:::spawn-to-send
- (if (or (buffer-modified-p)
- (not send-pr:::sent)
- (y-or-n-p "PR already sent; resend? "))
- (progn
- (or (and send-pr:::err-buffer
- (buffer-name send-pr:::err-buffer))
- (setq send-pr:::err-buffer
- (get-buffer-create send-pr::err-buffer-name)))
- (let ((err-buffer send-pr:::err-buffer) mesg ok)
- (save-excursion (set-buffer err-buffer) (erase-buffer))
- (message "running send-pr...")
- (let ((oldpr (getenv "GNATS_ROOT")))
- (setenv "GNATS_ROOT" gnats:root)
- ;; ensure that a final newline is present:
- (if (not (equal (char-after (1- (point-max))) ?\n))
- (save-excursion (goto-char (point-max))
- (insert ?\n)))
- (call-process-region (point-min) (point-max) "send-pr"
- nil err-buffer nil send-pr:::site
- "-b" "-f" "-")
- (setenv "GNATS_ROOT" oldpr))
- (message "running send-pr...done")
- ;; stupidly we cannot check the return value in EMACS 18.57,
- ;; thus we need this kluge to find out whether send-pr succeeded.
- (if (save-excursion
- (set-buffer err-buffer)
- (goto-char (point-min))
- (setq mesg (buffer-substring (point-min) (- (point-max) 1)))
- (search-forward "problem report sent" nil t))
- (progn (message mesg)
- (kill-buffer err-buffer)
- (delete-auto-save-file-if-necessary)
- (set-buffer-modified-p nil)
- (setq send-pr:::sent t)
- (bury-buffer))
- (pop-to-buffer err-buffer))
- ))))
- (t
- (save-buffer)
- (message "Exit emacs to send the PR."))))
-
-;;;;---------------------------------------------------------------------------
-;;;; send-pr:send-pr-mode mode
-;;;;---------------------------------------------------------------------------
-
-(defvar send-pr-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "\C-c\C-c" 'send-pr:submit-pr)
- (define-key map "\C-c\C-f" 'gnats:change-field)
- (define-key map "\M-n" 'gnats:next-field)
- (define-key map "\M-p" 'gnats:previous-field)
- (define-key map "\C-\M-f" 'gnats:forward-field)
- (define-key map "\C-\M-b" 'gnats:backward-field)
- map)
- "Keymap for send-pr mode.")
-
-(defconst gnats::keyword "^>\\([-a-zA-Z]+\\):")
-(defconst gnats::before-keyword "[ \t\n\f]*[\n\f]+>\\([-a-zA-Z]+\\):")
-(defconst gnats::after-keyword "^>\\([-a-zA-Z]+\\):[ \t\n\f]+")
-
-(fset 'send-pr-mode 'send-pr:send-pr-mode)
-(defun send-pr:send-pr-mode ()
- "Major mode for submitting problem reports.
-For information about the form see gnats(1) and send-pr(1).
-Special commands: \\{send-pr-mode-map}
-Turning on send-pr-mode calls the value of the variable send-pr-mode-hook,
-if it is not nil."
- (interactive)
- (gnats::patch-exec-path)
- (put 'send-pr:send-pr-mode 'mode-class 'special)
- (kill-all-local-variables)
- (setq major-mode 'send-pr:send-pr-mode)
- (setq mode-name "send-pr")
- (use-local-map send-pr-mode-map)
- (set-syntax-table text-mode-syntax-table)
- (setq local-abbrev-table text-mode-abbrev-table)
- (setq buffer-offer-save t)
- (make-local-variable 'send-pr:::site)
- (make-local-variable 'send-pr:::categories)
- (make-local-variable 'send-pr:::err-buffer)
- (make-local-variable 'send-pr:::spawn-to-send)
- (make-local-variable 'send-pr:::sent)
- (setq send-pr:::sent nil)
- (make-local-variable 'paragraph-separate)
- (setq paragraph-separate (concat (default-value 'paragraph-separate)
- "\\|" gnats::keyword "[ \t\n\f]*$"))
- (make-local-variable 'paragraph-start)
- (setq paragraph-start (concat (default-value 'paragraph-start)
- "\\|" gnats::keyword))
- (run-hooks 'send-pr-mode-hook)
- t)
-
-;;;;---------------------------------------------------------------------------
-;;;; Functions to read and replace field values.
-;;;;---------------------------------------------------------------------------
-
-(defun gnats::position-on-field (field &optional quiet)
- (goto-char (point-min))
- (if (not (re-search-forward (concat "^>" field ":") nil t))
- (if quiet
- nil
- (error "Field `>%s:' not found." field))
- (re-search-forward "[ \t\n\f]*")
- (if (looking-at gnats::keyword)
- (backward-char 1))
- t))
-
-(defun gnats::mail-position-on-field (field)
- (let (end
- (case-fold-search t))
- (goto-char (point-min))
- (re-search-forward "^$")
- (setq end (match-beginning 0))
- (goto-char (point-min))
- (if (not (re-search-forward (concat "^" field ":") end 'go-to-end))
- (insert field ": \n")
- (re-search-forward "[ \t\n\f]*"))
- (skip-chars-backward "\n")
- t))
-
-(defun gnats::field-contents (field &optional elem move)
- (let (pos)
- (unwind-protect
- (save-excursion
- (if (not (gnats::position-on-field field t))
- nil
- (setq pos (point-marker))
- (if (or (looking-at "<.*>$") (eolp))
- t
- (looking-at ".*$") ; to set match-{beginning,end}
- (gnats::nth-word
- (buffer-substring (match-beginning 0) (match-end 0))
- elem))))
- (and move pos (goto-char pos)))))
-
-(defun gnats::functionp (thing)
- (or (and (symbolp thing) (fboundp thing))
- (and (listp thing) (eq (car thing) 'lambda))))
-
-(defun gnats::field-values (field)
- "Return the possible (known) values for field FIELD."
- (let* ((fields (if (eq major-mode 'gnats:gnats-mode) gnats::fields
- send-pr::fields))
- (thing (elt (assoc field fields) 1)))
- (cond ((gnats::functionp thing) (funcall thing))
- ((listp thing) thing)
- (t (error "ACK")))))
-
-(defun gnats::field-default (field)
- "Return the default value for field FIELD."
- (let* ((fields (if (eq major-mode 'gnats:gnats-mode) gnats::fields
- send-pr::fields))
- (thing (elt (assoc field fields) 2)))
- (cond ((stringp thing) thing)
- ((null thing) "")
- ((numberp thing) (car (elt (gnats::field-values field) thing)))
- ((gnats::functionp thing)
- (funcall thing (gnats::field-contents field)))
- ((eq thing t) (gnats::field-contents field))
- (t (error "ACK")))))
-
-(defun gnats::field-type (field)
- "Return the type of field FIELD."
- (let* ((fields (if (eq major-mode 'gnats:gnats-mode) gnats::fields
- send-pr::fields))
- (thing (elt (assoc field fields) 3)))
- thing))
-
-(defun gnats::field-action (field)
- "Return the extra handling function for field FIELD."
- (let* ((fields (if (eq major-mode 'gnats:gnats-mode) gnats::fields
- send-pr::fields))
- (thing (elt (assoc field fields) 4)))
- (cond ((null thing) 'ignore)
- ((gnats::functionp thing) thing)
- (t (error "ACK")))))
-
-;;;;---------------------------------------------------------------------------
-;;;; Point movement functions
-;;;;---------------------------------------------------------------------------
-
-(or (fboundp 'defsubst) (fset 'defsubst 'defun))
-
-(defun send-pr::maybe-change-field (field)
- (setq field (car field))
- (let ((thing (gnats::field-contents field)))
- (and thing (eq t thing)
- (not (eq 'multi-text (gnats::field-type field)))
- (gnats:change-field field))))
-
-(defun gnats:change-field (&optional field default)
- "Change the value of the field containing the cursor. With arg, ask the
-user for the field to change. From a program, the function takes optional
-arguments of the field to change and the default value to use."
- (interactive)
- (or field current-prefix-arg (setq field (gnats::current-field)))
- (or field
- (setq field
- (completing-read "Field: "
- (if (eq major-mode 'gnats:gnats-mode)
- gnats::fields
- send-pr::fields)
- nil t)))
- (gnats::position-on-field field)
- (sit-for 0)
- (let* ((old (gnats::field-contents field))
- new)
- (if (null old)
- (error "ACK")
- (if (or (interactive-p) t)
- (let ((prompt (concat ">" field ": "))
- (domain (gnats::field-values field))
- (type (gnats::field-type field)))
- (or default (setq default (gnats::field-default field)))
- (setq new
- (if (eq type 'enum)
- (completing-read prompt domain nil t
- (if gnats::emacs-19p (cons default 0)
- default))
- (read-string prompt (if gnats::emacs-19p (cons default 1)
- default)))))
- (setq new default))
- (gnats::set-field field new)
- (funcall (gnats::field-action field) field old new)
- new)))
-
-(defun gnats::set-field (field value)
- (save-excursion
- (gnats::position-on-field field)
- (delete-horizontal-space)
- (looking-at ".*$")
- (replace-match
- (concat (make-string (- gnats::indent (length field) 2) ?\40 ) value) t)))
-
-(defun gnats::set-mail-field (field value)
- (save-excursion
- (gnats::mail-position-on-field field)
- (delete-horizontal-space)
- (looking-at ".*$")
- (replace-match (concat " " value) t)))
-
-(defun gnats::before-keyword (&optional where)
- "Returns t if point is in some white space before a keyword.
-If where is nil, then point is not changed; if where is t then point is moved
-to the beginning of the keyword, otherwise it is moved to the beginning
-of the white space it was in."
- ;;
- (if (looking-at gnats::before-keyword)
- (prog1 t
- (cond ((eq where t)
- (re-search-forward "^>") (backward-char))
- ((not (eq where nil))
- (re-search-backward "[^ \t\n\f]") (forward-char))))
- nil))
-
-(defun gnats::after-keyword (&optional where)
- "Returns t if point is in some white space after a keyword.
-If where is nil, then point is not changed; if where is t then point is moved
-to the beginning of the keyword, otherwise it is moved to the end of the white
-space it was in."
- ;;
- (if (gnats::looking-after gnats::after-keyword)
- (prog1 t
- (cond ((eq where t)
- (re-search-backward "^>"))
- ((not (eq where nil))
- (re-search-forward "[^ \t\n\f]") (backward-char))))
- nil))
-
-(defun gnats::in-keyword (&optional where)
- "Returns t if point is within a keyword.
-If where is nil, then point is not changed; if where is t then point is moved
-to the beginning of the keyword."
- ;;
- (let ((old-point (point-marker)))
- (beginning-of-line)
- (cond ((and (looking-at gnats::keyword)
- (< old-point (match-end 0)))
- (prog1 t
- (if (eq where t)
- t
- (goto-char old-point))))
- (t (goto-char old-point)
- nil))))
-
-(defun gnats::forward-bofield ()
- "Moves point to the beginning of a field. Assumes that point is in the
-keyword."
- ;;
- (if (re-search-forward "[ \t\n\f]+[^ \t\n\f]" (point-max) '-)
- (backward-char)
- t))
-
-(defun gnats::backward-eofield ()
- "Moves point to the end of a field. Assumes point is in the keyword."
- ;;
- (if (re-search-backward "[^ \t\n\f][ \t\n\f]+" (point-min) '-)
- (forward-char)
- t))
-
-(defun gnats::forward-eofield ()
- "Moves point to the end of a field. Assumes that point is in the field."
- ;;
- ;; look for the next field
- (if (re-search-forward gnats::keyword (point-max) '-)
- (progn (beginning-of-line) (gnats::backward-eofield))
- (re-search-backward "[^ \t\n\f][ \t\n\f]*" (point-min) '-)
- (forward-char)))
-
-(defun gnats::backward-bofield ()
- "Moves point to the beginning of a field. Assumes that point is in the
-field."
- ;;
- ;;look for previous field
- (if (re-search-backward gnats::keyword (point-min) '-)
- (gnats::forward-bofield)
- t))
-
-
-(defun gnats:forward-field ()
- "Move point forward to the end of the field or to the beginning of the next
-field."
- ;;
- (interactive)
- (if (or (gnats::before-keyword t) (gnats::in-keyword t)
- (gnats::after-keyword t))
- (gnats::forward-bofield)
- (gnats::forward-eofield)))
-
-(defun gnats:backward-field ()
- "Move point backward to the beginning/end of a field."
- ;;
- (interactive)
- (backward-char)
- (if (or (gnats::before-keyword t) (gnats::in-keyword t)
- (gnats::after-keyword t))
- (gnats::backward-eofield)
- (gnats::backward-bofield)))
-
-(defun gnats:next-field ()
- "Move point to the beginning of the next field."
- ;;
- (interactive)
- (if (or (gnats::before-keyword t) (gnats::in-keyword t)
- (gnats::after-keyword t))
- (gnats::forward-bofield)
- (if (re-search-forward gnats::keyword (point-max) '-)
- (gnats::forward-bofield)
- t)))
-
-(defun gnats:previous-field ()
- "Move point to the beginning of the previous field."
- ;;
- (interactive)
- (backward-char)
- (if (or (gnats::after-keyword t) (gnats::in-keyword t)
- (gnats::before-keyword t))
- (progn (re-search-backward gnats::keyword (point-min) '-)
- (gnats::forward-bofield))
- (gnats::backward-bofield)))
-
-(defun gnats:beginning-of-field ()
- "Move point to the beginning of the current field."
- (interactive)
- (cond ((gnats::in-keyword t)
- (gnats::forward-bofield))
- ((gnats::after-keyword 0))
- (t
- (gnats::backward-bofield))))
-
-(defun gnats::current-field ()
- (save-excursion
- (if (cond ((or (gnats::in-keyword t) (gnats::after-keyword t))
- (looking-at gnats::keyword))
- ((re-search-backward gnats::keyword nil t)))
- (buffer-substring (match-beginning 1) (match-end 1))
- nil)))
-
-;;;;---------------------------------------------------------------------------
-;;;; Support functions
-;;;;---------------------------------------------------------------------------
-
-(defun gnats::looking-after (regex)
- "Returns t if point is after regex."
- ;;
- (let* ((old-point (point))
- (start (if (eobp)
- old-point
- (forward-char) (point))))
- (cond ((re-search-backward regex (point-min) t)
- (goto-char old-point)
- (cond ((eq (match-end 0) start)
- t))))))
-
-(defun gnats::nth-word (string &optional elem)
- "Returns the elem-th word of the string.
-If elem is nil, then the first wort is returned, if elem is 0 then
-the whole string is returned."
- ;;
- (if (integerp elem)
- (cond ((eq elem 0) string)
- ((eq elem 1) (gnats::first-word string))
- ((equal string "") "")
- ((>= elem 2)
- (let ((i 0) (value ""))
- (setq string ; strip leading blanks
- (substring string (or (string-match "[^ \t]" string) 0)))
- (while (< i elem)
- (setq value
- (substring string 0
- (string-match "[ \t]*$\\|[ \t]+" string)))
- (setq string
- (substring string (match-end 0)))
- (setq i (+ i 1)))
- value)))
- (gnats::first-word string)))
-
-(defun gnats::first-word (string)
- (setq string
- (substring string (or (string-match "[^ \t]" string) 0)))
- (substring string 0 (string-match "[ \t]*$\\|[ \t]+" string)))
-
-;;;;---------------------------------------------------------------------------
-
-(defun gnats::patch-exec-path ()
- ;;
- "Replaces `//' by `/' in `exec-path'."
- ;;
- ;(make-local-variable 'exec-path)
- (let ((err-buffer (get-buffer-create " *gnats::patch-exec-path*"))
- (ret))
- (setq exec-path (save-excursion (set-buffer err-buffer)
- (prin1 exec-path err-buffer)
- (goto-char (point-min))
- (while (search-forward "//" nil t)
- (replace-match "/" nil t))
- (goto-char (point-min))
- (setq ret (read err-buffer))
- (kill-buffer err-buffer)
- ret
- ))))
-
-(defun gnats::get-value-from-shell (&rest command)
- "Execute shell command to get a list of valid values for `variable'."
- ;;
- (let ((err-buffer (get-buffer-create " *gnats::get-value-from-shell*")))
- (save-excursion
- (set-buffer err-buffer)
- (unwind-protect
- (condition-case var
- (progn
- (apply 'call-process
- (car command) nil err-buffer nil (cdr command))
- (goto-char (point-min))
- (if (looking-at "[-a-z]+: ")
- (error (buffer-substring (point-min) (point-max))))
- (read err-buffer))
- (error nil))
- (kill-buffer err-buffer)))))
-
-(or (fboundp 'setenv)
- (defun setenv (variable &optional value)
- "Set the value of the environment variable named VARIABLE to VALUE.
-VARIABLE should be a string. VALUE is optional; if not provided or is
-`nil', the environment variable VARIABLE will be removed.
-This function works by modifying `process-environment'."
- (interactive "sSet environment variable: \nsSet %s to value: ")
- (if (string-match "=" variable)
- (error "Environment variable name `%s' contains `='" variable)
- (let ((pattern (concat "\\`" (regexp-quote (concat variable "="))))
- (case-fold-search nil)
- (scan process-environment))
- (while scan
- (cond
- ((string-match pattern (car scan))
- (if (eq nil value)
- (setq process-environment (delq (car scan)
- process-environment))
- (setcar scan (concat variable "=" value)))
- (setq scan nil))
- ((null (setq scan (cdr scan)))
- (setq process-environment
- (cons (concat variable "=" value)
- process-environment)))))))))
-
-;;;; end of send-pr.el
diff --git a/gnu/usr.bin/send-pr/send-pr.1 b/gnu/usr.bin/send-pr/send-pr.1
deleted file mode 100644
index 49fd42b..0000000
--- a/gnu/usr.bin/send-pr/send-pr.1
+++ /dev/null
@@ -1,355 +0,0 @@
-.\" -*- nroff -*-
-.\" ---------------------------------------------------------------------------
-.\" man page for send-pr (by Heinz G. Seidl, hgs@cygnus.com)
-.\" updated Feb 1993 for GNATS 3.00 by Jeffrey Osier, jeffrey@cygnus.com
-.\"
-.\" This file is part of the Problem Report Management System (GNATS)
-.\" Copyright 1992 Cygnus Support
-.\"
-.\" This program is free software; you can redistribute it and/or
-.\" modify it under the terms of the GNU General Public
-.\" License as published by the Free Software Foundation; either
-.\" version 2 of the License, or (at your option) any later version.
-.\"
-.\" This program is distributed in the hope that it will be useful,
-.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
-.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-.\" General Public License for more details.
-.\"
-.\" You should have received a copy of the GNU Library General Public
-.\" License along with this program; if not, write to the Free
-.\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-.\"
-.\" ---------------------------------------------------------------------------
-.\"
-.\" $FreeBSD$
-.nh
-.TH SEND-PR 1 3.113 "October 2006"
-.SH NAME
-send-pr \- send problem report (PR) to a central support site
-.SH SYNOPSIS
-.B send-pr
-[
-.I site
-]
-[
-.B \-f
-.I problem-report
-]
-[
-.B \-t
-.I mail-address
-]
-.br
-.in +0.8i
-[
-.B \-P
-]
-[
-.B \-L
-]
-[
-.B \-s
-.I severity
-]
-[
-.B \-V
-]
-.br
-[
-.B \-\-version
-]
-[
-.B \-c
-.I address
-]
-[
-.B \-a
-.I file
-]
-.SH DESCRIPTION
-.B send-pr
-is a tool used to submit
-.I problem reports
-.\" SITE ADMINISTRATORS - change this if you use a local default
-(PRs) to a central support site. In most cases the correct
-.I site
-will be the default. This argument indicates the support site which
-is responsible for the category of problem involved. Some sites may
-use a local address as a default.
-.I site
-values are defined by using the
-.BR aliases (5).
-.LP
-.B send-pr
-invokes an editor on a problem report template (after trying to fill
-in some fields with reasonable default values). When you exit the
-editor,
-.B send-pr
-sends the completed form to the
-.I Problem Report Management System
-(\fBGNATS\fR) at a central support site. At the support site, the PR
-is assigned a unique number and is stored in the \fBGNATS\fR database
-according to its category and submitter-id. \fBGNATS\fR automatically
-replies with an acknowledgement, citing the category and the PR
-number.
-.LP
-To ensure that a PR is handled promptly, it should contain
-one of the available \fIcategories\fR to identify the
-problem area. (Use
-.B `send-pr -L'
-to see a list of categories.)
-.LP
-The more precise your problem description and the more complete your
-information, the faster your support team can solve your problems.
-.LP
-.B send-pr
-depends on a correctly configured mail submission system to work correctly.
-If, for any reason, sending mail is not working, problem reports can be
-submitted over the web, through:
-.IP
-.I http://www.freebsd.org/send-pr.html
-.SH OPTIONS
-.TP
-.BI \-f " problem-report"
-specify a file (\fIproblem-report\fR) which already contains a
-complete problem report.
-.B send-pr
-sends the contents of the file without invoking the editor. If
-the value for
-.I problem-report
-is
-.BR `\|\-\|' ,
-then
-.B send-pr
-reads from standard input.
-.TP
-.BI \-s " severity"
-Give the problem report the severity
-.IR severity .
-.TP
-.BI \-t " mail-address"
-Change mail address at the support site for problem reports. The
-default
-.I mail-address
-is the address used for the default
-.IR site .
-Use the
-.I site
-argument rather than this option in nearly all cases.
-.TP
-.BI \-c " address"
-Put
-.I address
-in the
-.B Cc:
-header of the message.
-.TP
-.BI \-a " file"
-Copy the specified
-.I file
-into the
-.B Fix:
-section.
-Binary files are uuencoded.
-.TP
-.B \-P
-print the form specified by the environment variable
-.B PR_FORM
-on standard output. If
-.B PR_FORM
-is not set, print the standard blank PR template. No mail is sent.
-.TP
-.B \-L
-print the list of available categories. No mail is sent.
-.TP
-.B \-V
-Display the
-.B send-pr
-version number.
-This may also be specified as
-.B \-\-version.
-.LP
-Note: use
-.B send-pr
-to submit problem reports rather than mailing them directly. Using
-both the template and
-.B send-pr
-itself will help ensure all necessary information will reach the
-support site.
-.SH FREEBSD CATEGORIES
-.TP
-.B advocacy
-This used to be for the advocacy WWW pages.
-Now deprecated in favour of the
-.B www
-category, relevant alternative use of this category is encouraged.
-.TP
-.B alpha
-Alpha processor specific problems.
-.TP
-.B amd64
-AMD64 processor specific problems.
-.TP
-.B arm
-ARM processor specific problems.
-.TP
-.B bin
-Corrections or enhancements to system executables.
-.TP
-.B conf
-Corrections or enhancements to the system configuration files.
-.TP
-.B docs
-Corrections or enhancements to the manpages or other documentation.
-.TP
-.B gnu
-Corrections or enhancements to the GNU contributed software.
-.TP
-.B i386
-Intel x86 processor specific problems.
-.TP
-.B ia64
-Intel ia64 processor specific problems.
-.TP
-.B java
-Problems related to Java.
-.TP
-.B kern
-Changes or enhancements to the architecture independent kernel sources.
-.TP
-.B misc
-Problems that do not fit into any of the other categories.
-.TP
-.B ports
-Corrections or enhancements (including new ports) to the ports collection.
-.TP
-.B powerpc
-PowerPC processor specific problems.
-.TP
-.B sparc64
-SPARC processor specific problems.
-.TP
-.B standards
-Standards conformance issues.
-.TP
-.B threads
-Problems related to threading on FreeBSD.
-.TP
-.B usb
-Problems related to the USB subsystem.
-.TP
-.B www
-Changes or enhancements to the FreeBSD website.
-.SH ENVIRONMENT
-The environment variable
-.B EDITOR
-specifies the editor to invoke on the template.
-.br
-default:
-.B vi
-.sp
-If the environment variable
-.B MAIL_AGENT
-is set, its value is used as the path + command line arguments of the
-executable to be invoked for sending the problem report (which will be
-provided via standard input).
-.br
-This can be useful if you either use a MTA other than sendmail or need
-to provide additional parameters, such as the envelope sender on
-machines without a valid FQDN.
-.br
-Default value:
-.B /usr/sbin/sendmail -oi -t
-.sp
-If the environment variable
-.B PR_FORM
-is set, then its value is used as the file name of the template for
-your problem-report editing session. You can use this to start with a
-partially completed form (for example, a form with the identification
-fields already completed).
-.SH "HOW TO FILL OUT A PROBLEM REPORT"
-Problem reports have to be in a particular form so that a program can
-easily manage them. Please remember the following guidelines:
-.IP \(bu 3m
-describe only
-.B one problem
-with each problem report.
-.IP \(bu 3m
-For follow-up mail, use the same subject line as the one in the automatic
-acknowledgement. It consists of category, PR number and the original synopsis
-line. This allows the support site to relate several mail messages to a
-particular PR and to record them automatically.
-.IP \(bu 3m
-Please try to be as accurate as possible in the subject and/or synopsis line.
-.IP \(bu 3m
-The subject and the synopsis line are not confidential. This is
-because open-bugs lists are compiled from them. Avoid confidential
-information there.
-.LP
-See the GNU
-.B Info
-file
-.B send-pr.info
-or the document \fIReporting Problems With send-pr\fR\ for detailed
-information on reporting problems
-.SH "HOW TO SUBMIT TEST CASES, CODE, ETC."
-Submit small code samples with the PR. Contact the support site for
-instructions on submitting larger test cases and problematic source
-code.
-.SH FILES
-.ta \w'/tmp/pbad.XXXXXXXX 'u
-/tmp/pf.XXXXXXXX copy of PR used in editing session
-.br
-/tmp/pf.XXXXXXXX copy of empty PR form, for testing purposes
-.br
-/tmp/pr.XXXXXXXX copy of filled PR form, created on interrupt
-.br
-/tmp/pbad.XXXXXXXX file for rejected PRs
-.SH EMACS USER INTERFACE
-An Emacs user interface for
-.B send-pr
-with completion of field values is part of the
-.B send-pr
-distribution (invoked with
-.BR "M-x send-pr" ).
-See the file
-.B send-pr.info
-or the ASCII file
-.B INSTALL
-in the top level directory of the distribution for configuration and
-installation information. The Emacs LISP template file is
-.B send-pr-el.in
-and is installed as
-.BR send-pr.el .
-.SH INSTALLATION AND CONFIGURATION
-See
-.B send-pr.info
-or
-.B INSTALL
-for installation instructions.
-.SH SEE ALSO
-.I Reporting Problems Using send-pr
-(also installed as the GNU Info file
-.BR send-pr.info ).
-.SH AUTHORS
-Jeffrey Osier, Brendan Kehoe, Jason Merrill, Heinz G. Seidl (Cygnus
-Support)
-.SH COPYING
-Copyright (c) 1992, 1993 Free Software Foundation, Inc.
-.PP
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-.PP
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-.PP
-Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be included in
-translations approved by the Free Software Foundation instead of in
-the original English.
-
diff --git a/gnu/usr.bin/send-pr/send-pr.sh b/gnu/usr.bin/send-pr/send-pr.sh
deleted file mode 100644
index dee0f48..0000000
--- a/gnu/usr.bin/send-pr/send-pr.sh
+++ /dev/null
@@ -1,591 +0,0 @@
-#!/bin/sh
-# Submit a problem report to a GNATS site.
-# Copyright (C) 1993 Free Software Foundation, Inc.
-# Contributed by Brendan Kehoe (brendan@cygnus.com), based on a
-# version written by Heinz G. Seidl (hgs@cygnus.com).
-#
-# This file is part of GNU GNATS.
-#
-# GNU GNATS is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# GNU GNATS is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU GNATS; see the file COPYING. If not, write to
-# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-#
-# $FreeBSD$
-
-# The version of this send-pr.
-VERSION=3.114
-
-# The submitter-id for your site.
-# "current-users" is the only allowable value for FreeBSD.
-SUBMITTER="current-users"
-
-# Where the GNATS directory lives, if at all.
-[ -z "$GNATS_ROOT" ] &&
-GNATS_ROOT=
-
-# The default mail address for PR submissions.
-GNATS_ADDR=FreeBSD-gnats-submit@freebsd.org
-
-# Where the gnats category tree lives.
-DATADIR=@DATADIR@
-
-# If we've been moved around, try using GCC_EXEC_PREFIX.
-[ ! -d $DATADIR/gnats -a -d "$GCC_EXEC_PREFIX" ] && DATADIR="$GCC_EXEC_PREFIX"
-
-# The default release for this host.
-DEFAULT_RELEASE="@DEFAULT_RELEASE@"
-
-# The default organization.
-DEFAULT_ORGANIZATION=
-
-# The default site to look for.
-GNATS_SITE=freefall
-
-# Newer config information?
-[ -f ${GNATS_ROOT}/gnats-adm/config ] && . ${GNATS_ROOT}/gnats-adm/config
-
-# What mailer to use. This must come after the config file, since it is
-# host-dependent.
-MAIL_AGENT="${MAIL_AGENT:-/usr/sbin/sendmail -oi -t}"
-
-# Path to pw(8)
-PW="/usr/sbin/pw"
-
-ECHON=bsd
-
-if [ $ECHON = bsd ] ; then
- ECHON1="echo -n"
- ECHON2=
-elif [ $ECHON = sysv ] ; then
- ECHON1=echo
- ECHON2='\c'
-else
- ECHON1=echo
- ECHON2=
-fi
-
-#
-
-# find a user name
-if [ "$LOGNAME" = "" ]; then
- if [ "$USER" != "" ]; then
- LOGNAME="$USER"
- else
- LOGNAME="UNKNOWN"
- fi
-fi
-
-# Find out the name of the originator of this PR.
-if [ -n "$NAME" ]; then
- ORIGINATOR="$NAME"
-elif [ -f $HOME/.fullname ]; then
- ORIGINATOR="`sed -e '1q' $HOME/.fullname`"
-else
- PTEMP=`mktemp -t p` || exit 1
- PTEMP2=`mktemp -t p` || exit 1
- # Must use temp file due to incompatibilities in quoting behavior
- # and to protect shell metacharacters in the expansion of $LOGNAME
- $ECHON1 $LOGNAME | awk '{print toupper(substr($1,1,1))substr($1,2)}' > $PTEMP2
- ICLOGNAME="`cat $PTEMP2`"
- $PW usershow $LOGNAME | awk -F: '{ print $8 }' \
- | sed -e "s/\&/$ICLOGNAME/" \
- | sed -e 's/,.*//' > $PTEMP
- ORIGINATOR="`cat $PTEMP`"
- rm -f "$PTEMP" "$PTEMP2"
-fi
-
-FROM="$ORIGINATOR <$LOGNAME>"
-REPLY_TO="$ORIGINATOR <${REPLY_TO:-${REPLYTO:-$LOGNAME}}>"
-
-if [ -n "$ORGANIZATION" ]; then
- if [ -f "$ORGANIZATION" ]; then
- ORGANIZATION="`cat $ORGANIZATION`"
- fi
-else
- if [ -n "$DEFAULT_ORGANIZATION" ]; then
- ORGANIZATION="$DEFAULT_ORGANIZATION"
- elif [ -f $HOME/.organization ]; then
- ORGANIZATION="`cat $HOME/.organization`"
- fi
-fi
-
-# If they don't have a preferred editor set, then use
-if [ -z "$VISUAL" ]; then
- if [ -z "$EDITOR" ]; then
- EDIT=vi
- else
- EDIT="$EDITOR"
- fi
-else
- EDIT="$VISUAL"
-fi
-
-# Find out some information.
-SYSTEM=`( [ -f /bin/uname ] && /bin/uname -a ) || \
- ( [ -f /usr/bin/uname ] && /usr/bin/uname -a ) || echo ""`
-ARCH=`[ -f /bin/arch ] && /bin/arch`
-MACHINE=`[ -f /bin/machine ] && /bin/machine`
-
-COMMAND=`echo $0 | sed -e 's,.*/,,'`
-USAGE="Usage: $COMMAND [-PVL] [-t address] [-f filename] [-s severity]
- [-c address] [-a file] [--version]"
-REMOVE=
-BATCH=
-CC=
-SEVERITY_C=
-
-while [ $# -gt 0 ]; do
- case "$1" in
- -r) ;; # Ignore for backward compat.
- -t | --to) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
- shift ; GNATS_ADDR="$1"
- EXPLICIT_GNATS_ADDR=true
- ;;
- -f | --file) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
- shift ; IN_FILE="$1"
- if [ "$IN_FILE" != "-" -a ! -r "$IN_FILE" ]; then
- echo "$COMMAND: cannot read $IN_FILE"
- exit 1
- fi
- ;;
- -b | --batch) BATCH=true ;;
- -c | --cc) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
- shift ; CC="$1"
- ;;
- -s | --severity) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
- shift ; SEVERITY_C="$1"
- ;;
- -p | -P | --print) PRINT=true ;;
- -L | --list) FORMAT=norm ;;
- -l | -CL | --lisp) FORMAT=lisp ;;
- -h | --help) echo "$USAGE"; exit 0 ;;
- -V | --version) echo "$VERSION"; exit 0 ;;
- -a | --attach) if [ -z "$2" ]; then
- echo "$USAGE" ; exit 1;
- fi
- if [ -e "$2" -a ! -d "$2" ]; then
- PRETTY_NAME=`basename $2`
- if file $2 | grep "text" >/dev/null 2>/dev/null ; then
- ATTACHED_FILES="$ATTACHED_FILES
---- $PRETTY_NAME begins here ---
-`cat \"$2\"`
---- $PRETTY_NAME ends here ---
-"
- else
- ATTACHED_FILES="$ATTACHED_FILES
-`uuencode \"$PRETTY_NAME\" < \"$2\"`
-"
- fi
- shift;
- fi;
- ;;
- -*) echo "$USAGE" ; exit 1 ;;
- *) if [ -z "$USER_GNATS_SITE" ]; then
- if [ ! -r "$DATADIR/gnats/$1" ]; then
- echo "$COMMAND: the GNATS site $1 does not have a categories list."
- exit 1
- else
- # The site name is the alias they'll have to have created.
- USER_GNATS_SITE=$1
- fi
- else
- echo "$USAGE" ; exit 1
- fi
- ;;
- esac
- shift
-done
-
-if [ -n "$USER_GNATS_SITE" ] && [ "$USER_GNATS_SITE" != "$GNATS_SITE" ]; then
- GNATS_SITE=$USER_GNATS_SITE
- GNATS_ADDR=$USER_GNATS_SITE-gnats
-fi
-
-if [ "$SUBMITTER" = "unknown" -a -z "$IN_FILE" ]; then
- SUBMITTER="current-users"
-fi
-
-if [ -r "$DATADIR/gnats/$GNATS_SITE" ]; then
- CATEGORIES=`grep -v '^#' $DATADIR/gnats/$GNATS_SITE | sort`
-else
- echo "$COMMAND: could not read $DATADIR/gnats/$GNATS_SITE for categories list."
- exit 1
-fi
-
-if [ -z "$CATEGORIES" ]; then
- echo "$COMMAND: the categories list for $GNATS_SITE was empty!"
- exit 1
-fi
-
-case "$FORMAT" in
- lisp) echo "$CATEGORIES" | \
- awk 'BEGIN {printf "( "} {printf "(\"%s\") ",$0} END {printf ")\n"}'
- exit 0
- ;;
- norm) l=`echo "$CATEGORIES" | \
- awk 'BEGIN {max = 0; } { if (length($0) > max) { max = length($0); } }
- END {print max + 1;}'`
- c=`expr 70 / $l`
- if [ $c -eq 0 ]; then c=1; fi
- echo "$CATEGORIES" | \
- awk 'BEGIN {print "Known categories:"; i = 0 }
- { printf ("%-'$l'.'$l's", $0); if ((++i % '$c') == 0) { print "" } }
- END { print ""; }'
- exit 0
- ;;
-esac
-
-ORIGINATOR_C='<name of the PR author (one line)>'
-ORGANIZATION_C='<organization of PR author (multiple lines)>'
-CONFIDENTIAL_C='no <FreeBSD PRs are public data>'
-SYNOPSIS_C='<synopsis of the problem (one line)>'
-if [ -z "$SEVERITY_C" ]; then
- SEVERITY_C='<[ non-critical | serious | critical ] (one line)>'
-fi
-PRIORITY_C='<[ low | medium | high ] (one line)>'
-CATEGORY_C='<choose from the list of categories above (one line)>'
-CLASS_C='<[ sw-bug | doc-bug | change-request | update | maintainer-update ] (one line)>'
-RELEASE_C='<release number or tag (one line)>'
-ENVIRONMENT_C='<machine, os, target, libraries (multiple lines)>'
-DESCRIPTION_C='<precise description of the problem (multiple lines)>'
-HOW_TO_REPEAT_C='<code/input/activities to reproduce the problem (multiple lines)>'
-FIX_C='<how to correct or work around the problem, if known (multiple lines)>'
-
-# Create temporary files, safely
-REF=`mktemp -t pf` || exit 1
-TEMP=`mktemp -t pf` || exit 1
-# Catch some signals. ($xs kludge needed by Sun /bin/sh)
-xs=0
-trap 'rm -f $REF $TEMP; exit $xs' 0
-trap 'SAV=`mktemp -t pr`;echo "$COMMAND: Aborting ... saving unfinished PR into $SAV"; rm -f $REF ; mv $TEMP $SAV; xs=1; exit' 1 2 3 13 15
-
-# If they told us to use a specific file, then do so.
-if [ -n "$IN_FILE" ]; then
- if [ "$IN_FILE" = "-" ]; then
- # The PR is coming from the standard input.
- if [ -n "$EXPLICIT_GNATS_ADDR" ]; then
- sed -e "s;^[Tt][Oo]:.*;To: $GNATS_ADDR;" > $TEMP
- else
- cat > $TEMP
- fi
- else
- # Use the file they named.
- if [ -n "$EXPLICIT_GNATS_ADDR" ]; then
- sed -e "s;^[Tt][Oo]:.*;To: $GNATS_ADDR;" $IN_FILE > $TEMP
- else
- cat $IN_FILE > $TEMP
- fi
- fi
-else
-
- if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then
- # If their PR_FORM points to a bogus entry, then bail.
- if [ ! -f "$PR_FORM" -o ! -r "$PR_FORM" -o ! -s "$PR_FORM" ]; then
- echo "$COMMAND: can't seem to read your template file (\`$PR_FORM'), ignoring PR_FORM"
- sleep 1
- PRINT_INTERN=bad_prform
- fi
- fi
-
- if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then
- cp $PR_FORM $TEMP ||
- ( echo "$COMMAND: could not copy $PR_FORM" ; xs=1; exit )
- [ -n "$ATTACHED_FILES" ] && echo "$ATTACHED_FILES" >> $TEMP
- else
- for file in $TEMP $REF ; do
- cat > $file << '__EOF__'
-SEND-PR: -*- send-pr -*-
-SEND-PR: vim: syntax=sendpr
-SEND-PR:
-SEND-PR: Lines starting with `SEND-PR' will be removed automatically, as
-SEND-PR: will all comments (text enclosed in `<' and `>').
-SEND-PR:
-SEND-PR: Please consult the following URL if you are not sure how to
-SEND-PR: fill out a problem report:
-SEND-PR: http://www.freebsd.org/doc/en/articles/problem-reports/
-SEND-PR:
-SEND-PR: Note that the Synopsis field is mandatory.
-SEND-PR:
-SEND-PR: Please note that (unless you state otherwise) if your report
-SEND-PR: includes a patch then it will be taken under the same license as
-SEND-PR: the one on the file(s) you want to change.
-SEND-PR:
-SEND-PR: BE ADVISED THAT FREEBSD PROBLEM REPORTS ARE PUBLIC INFORMATION AND
-SEND-PR: WILL BE PUBLISHED AS-IS ON THE PROJECT'S MAILING LISTS AND WEB SITES.
-SEND-PR: DO NOT SUBMIT ANY INFORMATION YOU DO NOT WANT MADE PUBLIC.
-SEND-PR:
-SEND-PR: If you wish to submit a problem report confidentially, then contact
-SEND-PR: the FreeBSD bugmaster (bugmaster@FreeBSD.org) to arrange for a
-SEND-PR: relevant developer to be contacted.
-SEND-PR:
-SEND-PR: For sensitive security issues, consider contacting the FreeBSD
-SEND-PR: security officer team (security-officer@freebsd.org) directly.
-SEND-PR:
-SEND-PR: Choose from the following categories:
-SEND-PR:
-__EOF__
-
- # Format the categories so they fit onto lines.
- l=`echo "$CATEGORIES" | \
- awk 'BEGIN {max = 0; } { if (length($0) > max) { max = length($0); } }
- END {print max + 1;}'`
- c=`expr 61 / $l`
- if [ $c -eq 0 ]; then c=1; fi
- echo "$CATEGORIES" | \
- awk 'BEGIN {printf "SEND-PR: "; i = 0 }
- { printf ("%-'$l'.'$l's", $0);
- if ((++i % '$c') == 0) { printf "\nSEND-PR: " } }
- END { printf "\nSEND-PR:\n"; }' >> $file
-
- cat >> $file << __EOF__
-To: $GNATS_ADDR
-From: $FROM
-Reply-To: $REPLY_TO
-Cc: $CC
-X-send-pr-version: $VERSION
-X-GNATS-Notify:
-
-
->Submitter-Id: $SUBMITTER
->Originator: $ORIGINATOR
->Organization: ${ORGANIZATION-$ORGANIZATION_C}
->Confidential: $CONFIDENTIAL_C
->Synopsis: $SYNOPSIS_C
->Severity: $SEVERITY_C
->Priority: $PRIORITY_C
->Category: $CATEGORY_C
->Class: $CLASS_C
->Release: ${DEFAULT_RELEASE-$RELEASE_C}
->Environment:
-`[ -n "$SYSTEM" ] && echo System: $SYSTEM`
-`[ -n "$ARCH" ] && echo Architecture: $ARCH`
-`[ -n "$MACHINE" ] && echo Machine: $MACHINE`
- $ENVIRONMENT_C
->Description:
- $DESCRIPTION_C
->How-To-Repeat:
- $HOW_TO_REPEAT_C
->Fix:
-
- $FIX_C
-$ATTACHED_FILES
-
-__EOF__
-
- done
- fi
-
- if [ "$PRINT" = true -o "$PRINT_INTERN" = true ]; then
- cat $TEMP
- xs=0; exit
- fi
-
- chmod u+w $TEMP
- eval $EDIT $TEMP
-
- if cmp -s $REF $TEMP ; then
- echo "$COMMAND: problem report not filled out, therefore not sent"
- xs=1; exit
- fi
-fi
-
-#
-# Check the enumeration fields
-
-# This is a "sed-subroutine" with one keyword parameter
-# (with workaround for Sun sed bug)
-#
-SED_CMD='{
-s|||
-s|<.*>||
-s|^[ ]*||
-s|[ ]*$||
-p
-q
-}'
-
-
-while true; do
- CNT=0
-
- # 1) Confidential
- #
- PATTERN=">Confidential:"
- CONFIDENTIAL=`eval sed -n -e "\"/$PATTERN/$SED_CMD\"" $TEMP`
- case "$CONFIDENTIAL" in
- ""|no) CNT=`expr $CNT + 1` ;;
- *) echo "$COMMAND: \`$CONFIDENTIAL' is not a valid value for \`Confidential'." ;;
- esac
- #
- # 2) Severity
- #
- PATTERN=">Severity:"
- SEVERITY=`eval sed -n -e "\"/$PATTERN/$SED_CMD\"" $TEMP`
- case "$SEVERITY" in
- ""|non-critical|serious|critical) CNT=`expr $CNT + 1` ;;
- *) echo "$COMMAND: \`$SEVERITY' is not a valid value for \`Severity'."
- esac
- #
- # 3) Priority
- #
- PATTERN=">Priority:"
- PRIORITY=`eval sed -n -e "\"/$PATTERN/$SED_CMD\"" $TEMP`
- case "$PRIORITY" in
- ""|low|medium|high) CNT=`expr $CNT + 1` ;;
- *) echo "$COMMAND: \`$PRIORITY' is not a valid value for \`Priority'."
- esac
- #
- # 4) Category
- #
- PATTERN=">Category:"
- CATEGORY=`eval sed -n -e "\"/$PATTERN/$SED_CMD\"" $TEMP`
- FOUND=
- for C in $CATEGORIES
- do
- if [ "$C" = "$CATEGORY" ]; then FOUND=true ; break ; fi
- done
- if [ -n "$FOUND" ]; then
- CNT=`expr $CNT + 1`
- else
- if [ -z "$CATEGORY" ]; then
- echo "$COMMAND: you must include a Category: field in your report."
- else
- echo "$COMMAND: \`$CATEGORY' is not a known category."
- fi
- fi
- #
- # 5) Class
- #
- PATTERN=">Class:"
- CLASS=`eval sed -n -e "\"/$PATTERN/$SED_CMD\"" $TEMP`
- case "$CLASS" in
- ""|sw-bug|doc-bug|change-request|update|maintainer-update) CNT=`expr $CNT + 1` ;;
- *) echo "$COMMAND: \`$CLASS' is not a valid value for \`Class'."
- esac
- #
- # 6) Check that synopsis is not empty
- #
- if grep "^>Synopsis:[ ]*${SYNOPSIS_C}\$" $TEMP > /dev/null
- then
- echo "$COMMAND: Synopsis must not be empty."
- else
- CNT=`expr $CNT + 1`
- fi
-
- [ $CNT -lt 6 -a -z "$BATCH" ] &&
- echo "Errors were found with the problem report."
-
- while true; do
- if [ -z "$BATCH" ]; then
- $ECHON1 "s)end, e)dit or a)bort? $ECHON2"
- read input
- else
- if [ $CNT -eq 6 ]; then
- input=s
- else
- input=a
- fi
- fi
- case "$input" in
- a*)
- if [ -z "$BATCH" ]; then
- BAD=`mktemp -t pbad`
- echo "$COMMAND: the problem report remains in $BAD and is not sent."
- mv $TEMP $BAD
- else
- echo "$COMMAND: the problem report is not sent."
- fi
- xs=1; exit
- ;;
- e*)
- eval $EDIT $TEMP
- continue 2
- ;;
- s*)
- if [ $CNT -lt 6 ]; then
- if [ -z "$BATCH" ]; then
- echo "But there are still errors in the problem report!"
- continue 2
- else
- echo "Errors found in PR"
- exit 1
- fi
- fi
- break 2
- ;;
- esac
- done
-done
-
-#
-# Remove the subject field if one is already there. There's no reason
-# for it to be any different than the synopsis.
-#
-if grep '^Subject:' $TEMP > /dev/null
-then
- ed -s $TEMP << __EOF__
-/^Subject:/d
-w
-q
-__EOF__
-fi
-
-#
-# Add the subject field with the value of $SYNOPSIS. We use the To:
-# field as an anchor, which had better be there.
-#
-SYNOPSIS=`grep '^>Synopsis:' $TEMP | sed -e 's/^>Synopsis:[ ]*//' |
- sed -e "s;$SYNOPSIS_C;;"`
-ed -s $TEMP << __EOF__
-/^To:/a
-Subject: $SYNOPSIS
-.
-w
-q
-__EOF__
-
-#
-# Remove comments and send the problem report
-# (we have to use patterns, where the comment contains regex chars)
-#
-# /^>Originator:/s;$ORIGINATOR;;
-sed -e "
-/^SEND-PR:/d
-/^>Organization:/,/^>[A-Za-z-]*:/s;$ORGANIZATION_C;;
-/^>Confidential:/s;<.*>;;
-/^>Synopsis:/s;$SYNOPSIS_C;;
-/^>Severity:/s;<.*>;;
-/^>Priority:/s;<.*>;;
-/^>Category:/s;$CATEGORY_C;;
-/^>Class:/s;<.*>;;
-/^>Release:/,/^>[A-Za-z-]*:/s;$RELEASE_C;;
-/^>Environment:/,/^>[A-Za-z-]*:/s;$ENVIRONMENT_C;;
-/^>Description:/,/^>[A-Za-z-]*:/s;$DESCRIPTION_C;;
-/^>How-To-Repeat:/,/^>[A-Za-z-]*:/s;$HOW_TO_REPEAT_C;;
-/^>Fix:/,/^>[A-Za-z-]*:/s;$FIX_C;;
-" $TEMP > $REF
-
-if $MAIL_AGENT < $REF; then
- echo "$COMMAND: problem report sent"
- xs=0; exit
-else
- echo "$COMMAND: mysterious mail failure."
- if [ -z "$BATCH" ]; then
- BAD=`mktemp -t pbad`
- echo "$COMMAND: the problem report remains in $BAD and is not sent."
- mv $TEMP $BAD
- else
- echo "$COMMAND: the problem report is not sent."
- fi
- xs=1; exit
-fi
diff --git a/include/Makefile b/include/Makefile
index 756c8e1..ccdc8aa 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -128,7 +128,7 @@ _MARCHS= ${MACHINE_CPUARCH}
_MARCHS+= x86
.endif
-.if ${MK_STAGING} != "no"
+.if ${MK_STAGING} == "yes"
# tell bsd.incs.mk that we have it covered
NO_STAGE_INCLUDES=
.endif
diff --git a/include/Makefile.depend b/include/Makefile.depend
index 5e924d5..f80275d 100644
--- a/include/Makefile.depend
+++ b/include/Makefile.depend
@@ -1,8 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/include/arpa/Makefile b/include/arpa/Makefile
index 2f1c249..77ac03c 100644
--- a/include/arpa/Makefile
+++ b/include/arpa/Makefile
@@ -2,8 +2,8 @@
.include <src.opts.mk>
-INCS= ftp.h inet.h nameser.h nameser_compat.h telnet.h tftp.h
-
+INCS= ftp.h inet.h nameser.h nameser_compat.h tftp.h
+INCS+= telnet.h
INCSDIR=${INCLUDEDIR}/arpa
.include <bsd.prog.mk>
diff --git a/include/arpa/Makefile.depend b/include/arpa/Makefile.depend
index 11aba52..f80275d 100644
--- a/include/arpa/Makefile.depend
+++ b/include/arpa/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/include/gssapi/Makefile.depend b/include/gssapi/Makefile.depend
index 11aba52..f80275d 100644
--- a/include/gssapi/Makefile.depend
+++ b/include/gssapi/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/include/protocols/Makefile.depend b/include/protocols/Makefile.depend
index 11aba52..f80275d 100644
--- a/include/protocols/Makefile.depend
+++ b/include/protocols/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/include/rpc/Makefile.depend b/include/rpc/Makefile.depend
index 11aba52..f80275d 100644
--- a/include/rpc/Makefile.depend
+++ b/include/rpc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/include/rpcsvc/Makefile.depend b/include/rpcsvc/Makefile.depend
index 11aba52..f80275d 100644
--- a/include/rpcsvc/Makefile.depend
+++ b/include/rpcsvc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/include/xlocale/Makefile.depend b/include/xlocale/Makefile.depend
index 11aba52..f80275d 100644
--- a/include/xlocale/Makefile.depend
+++ b/include/xlocale/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/lib/libasn1/Makefile.depend b/kerberos5/lib/libasn1/Makefile.depend
index 273c072..b944759 100644
--- a/kerberos5/lib/libasn1/Makefile.depend
+++ b/kerberos5/lib/libasn1/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
@@ -11,7 +12,6 @@ DIRDEPS = \
lib/libc \
lib/libcom_err \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/kerberos5/lib/libgssapi_krb5/Makefile.depend b/kerberos5/lib/libgssapi_krb5/Makefile.depend
index b58366d..f265a8d 100644
--- a/kerberos5/lib/libgssapi_krb5/Makefile.depend
+++ b/kerberos5/lib/libgssapi_krb5/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/lib/libgssapi_ntlm/Makefile.depend b/kerberos5/lib/libgssapi_ntlm/Makefile.depend
index f450d48..ded534a 100644
--- a/kerberos5/lib/libgssapi_ntlm/Makefile.depend
+++ b/kerberos5/lib/libgssapi_ntlm/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/lib/libgssapi_spnego/Makefile.depend b/kerberos5/lib/libgssapi_spnego/Makefile.depend
index cbf227f..ba78e76 100644
--- a/kerberos5/lib/libgssapi_spnego/Makefile.depend
+++ b/kerberos5/lib/libgssapi_spnego/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/lib/libhdb/Makefile.depend b/kerberos5/lib/libhdb/Makefile.depend
index 293a679..04a35d3 100644
--- a/kerberos5/lib/libhdb/Makefile.depend
+++ b/kerberos5/lib/libhdb/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/lib/libheimbase/Makefile.depend b/kerberos5/lib/libheimbase/Makefile.depend
index fd5a535..7b92dbd 100644
--- a/kerberos5/lib/libheimbase/Makefile.depend
+++ b/kerberos5/lib/libheimbase/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
@@ -9,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libthr \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/kerberos5/lib/libheimipcc/Makefile.depend b/kerberos5/lib/libheimipcc/Makefile.depend
index 51d46e5..78a2d56 100644
--- a/kerberos5/lib/libheimipcc/Makefile.depend
+++ b/kerberos5/lib/libheimipcc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
@@ -13,7 +14,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libthr \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/kerberos5/lib/libheimipcs/Makefile.depend b/kerberos5/lib/libheimipcs/Makefile.depend
index b9fdb01..a9a0d8d 100644
--- a/kerberos5/lib/libheimipcs/Makefile.depend
+++ b/kerberos5/lib/libheimipcs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/lib/libheimntlm/Makefile.depend b/kerberos5/lib/libheimntlm/Makefile.depend
index 15c8afd..7959ad5 100644
--- a/kerberos5/lib/libheimntlm/Makefile.depend
+++ b/kerberos5/lib/libheimntlm/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/lib/libhx509/Makefile b/kerberos5/lib/libhx509/Makefile
index 0913e77..091fe8f 100644
--- a/kerberos5/lib/libhx509/Makefile
+++ b/kerberos5/lib/libhx509/Makefile
@@ -300,4 +300,3 @@ NO_BEFOREBUILD_INCLUDES=
.SUFFIXES: .h .c .x .hx
.PATH: ${KRB5DIR}/lib/hx509 ${KRB5DIR}/lib/asn1 ${KRB5DIR}/doc/doxyout/hx509/man/man3
-
diff --git a/kerberos5/lib/libhx509/Makefile.depend b/kerberos5/lib/libhx509/Makefile.depend
index c71f667..98eb044 100644
--- a/kerberos5/lib/libhx509/Makefile.depend
+++ b/kerberos5/lib/libhx509/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
@@ -14,8 +15,6 @@ DIRDEPS = \
lib/libcom_err \
lib/libcompiler_rt \
secure/lib/libcrypto \
- usr.bin/xinstall.host \
- usr.bin/yacc.host \
.include <dirdeps.mk>
diff --git a/kerberos5/lib/libkadm5clnt/Makefile.depend b/kerberos5/lib/libkadm5clnt/Makefile.depend
index 750b747..2988689 100644
--- a/kerberos5/lib/libkadm5clnt/Makefile.depend
+++ b/kerberos5/lib/libkadm5clnt/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/lib/libkadm5srv/Makefile.depend b/kerberos5/lib/libkadm5srv/Makefile.depend
index bb2204b..15a0788 100644
--- a/kerberos5/lib/libkadm5srv/Makefile.depend
+++ b/kerberos5/lib/libkadm5srv/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/lib/libkafs5/Makefile.depend b/kerberos5/lib/libkafs5/Makefile.depend
index c8d2c66..8f9723c 100644
--- a/kerberos5/lib/libkafs5/Makefile.depend
+++ b/kerberos5/lib/libkafs5/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/lib/libkdc/Makefile.depend b/kerberos5/lib/libkdc/Makefile.depend
index 30f2e46..0f4b829 100644
--- a/kerberos5/lib/libkdc/Makefile.depend
+++ b/kerberos5/lib/libkdc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/lib/libkrb5/Makefile.depend b/kerberos5/lib/libkrb5/Makefile.depend
index 3b36cdd..0adc7b6 100644
--- a/kerberos5/lib/libkrb5/Makefile.depend
+++ b/kerberos5/lib/libkrb5/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
@@ -18,7 +19,6 @@ DIRDEPS = \
lib/libcompiler_rt \
lib/libcrypt \
secure/lib/libcrypto \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/kerberos5/lib/libroken/Makefile.depend b/kerberos5/lib/libroken/Makefile.depend
index 296a59c..e280c94 100644
--- a/kerberos5/lib/libroken/Makefile.depend
+++ b/kerberos5/lib/libroken/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
@@ -10,7 +11,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libcrypt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/kerberos5/lib/libsl/Makefile.depend b/kerberos5/lib/libsl/Makefile.depend
index 57d8064..bf55d61 100644
--- a/kerberos5/lib/libsl/Makefile.depend
+++ b/kerberos5/lib/libsl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/lib/libvers/Makefile.depend b/kerberos5/lib/libvers/Makefile.depend
index 9708811..ae841b8 100644
--- a/kerberos5/lib/libvers/Makefile.depend
+++ b/kerberos5/lib/libvers/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/lib/libwind/Makefile.depend b/kerberos5/lib/libwind/Makefile.depend
index c6fa429..87bc4c1 100644
--- a/kerberos5/lib/libwind/Makefile.depend
+++ b/kerberos5/lib/libwind/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
@@ -11,7 +12,6 @@ DIRDEPS = \
lib/libc \
lib/libcom_err \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/kerberos5/libexec/digest-service/Makefile.depend b/kerberos5/libexec/digest-service/Makefile.depend
index c6fa21c..65f84a9 100644
--- a/kerberos5/libexec/digest-service/Makefile.depend
+++ b/kerberos5/libexec/digest-service/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/libexec/hprop/Makefile.depend b/kerberos5/libexec/hprop/Makefile.depend
index 224629d..df6a5f7 100644
--- a/kerberos5/libexec/hprop/Makefile.depend
+++ b/kerberos5/libexec/hprop/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/libexec/hpropd/Makefile.depend b/kerberos5/libexec/hpropd/Makefile.depend
index c1e0a30..fc78d6c 100644
--- a/kerberos5/libexec/hpropd/Makefile.depend
+++ b/kerberos5/libexec/hpropd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/libexec/ipropd-master/Makefile.depend b/kerberos5/libexec/ipropd-master/Makefile.depend
index d47b2d2..35482e2 100644
--- a/kerberos5/libexec/ipropd-master/Makefile.depend
+++ b/kerberos5/libexec/ipropd-master/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/libexec/ipropd-slave/Makefile.depend b/kerberos5/libexec/ipropd-slave/Makefile.depend
index 7aaaeee..bbde923 100644
--- a/kerberos5/libexec/ipropd-slave/Makefile.depend
+++ b/kerberos5/libexec/ipropd-slave/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/libexec/kadmind/Makefile.depend b/kerberos5/libexec/kadmind/Makefile.depend
index c9deae8..0fd8ac8 100644
--- a/kerberos5/libexec/kadmind/Makefile.depend
+++ b/kerberos5/libexec/kadmind/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/libexec/kcm/Makefile.depend b/kerberos5/libexec/kcm/Makefile.depend
index e405f6e..aa443c3 100644
--- a/kerberos5/libexec/kcm/Makefile.depend
+++ b/kerberos5/libexec/kcm/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/libexec/kdc/Makefile.depend b/kerberos5/libexec/kdc/Makefile.depend
index fb98c59..eb56231 100644
--- a/kerberos5/libexec/kdc/Makefile.depend
+++ b/kerberos5/libexec/kdc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/libexec/kdigest/Makefile.depend b/kerberos5/libexec/kdigest/Makefile.depend
index 4f5855d..a87c8e0 100644
--- a/kerberos5/libexec/kdigest/Makefile.depend
+++ b/kerberos5/libexec/kdigest/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/libexec/kfd/Makefile.depend b/kerberos5/libexec/kfd/Makefile.depend
index d2c2aa5..b434af8 100644
--- a/kerberos5/libexec/kfd/Makefile.depend
+++ b/kerberos5/libexec/kfd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/libexec/kimpersonate/Makefile.depend b/kerberos5/libexec/kimpersonate/Makefile.depend
index b377d80..9e85d37 100644
--- a/kerberos5/libexec/kimpersonate/Makefile.depend
+++ b/kerberos5/libexec/kimpersonate/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/libexec/kpasswdd/Makefile.depend b/kerberos5/libexec/kpasswdd/Makefile.depend
index 10ac011..1c794c4 100644
--- a/kerberos5/libexec/kpasswdd/Makefile.depend
+++ b/kerberos5/libexec/kpasswdd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/tools/asn1_compile/Makefile.depend b/kerberos5/tools/asn1_compile/Makefile.depend
index b1281ab..cdec769 100644
--- a/kerberos5/tools/asn1_compile/Makefile.depend
+++ b/kerberos5/tools/asn1_compile/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/tools/make-roken/Makefile.depend b/kerberos5/tools/make-roken/Makefile.depend
index 6cac556..ef25e5c 100644
--- a/kerberos5/tools/make-roken/Makefile.depend
+++ b/kerberos5/tools/make-roken/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/tools/slc/Makefile.depend b/kerberos5/tools/slc/Makefile.depend
index 6bf0c8f..f585953 100644
--- a/kerberos5/tools/slc/Makefile.depend
+++ b/kerberos5/tools/slc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/usr.bin/hxtool/Makefile.depend b/kerberos5/usr.bin/hxtool/Makefile.depend
index 0049035..b39235f 100644
--- a/kerberos5/usr.bin/hxtool/Makefile.depend
+++ b/kerberos5/usr.bin/hxtool/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/usr.bin/kadmin/Makefile.depend b/kerberos5/usr.bin/kadmin/Makefile.depend
index bcbf24b..ba39879 100644
--- a/kerberos5/usr.bin/kadmin/Makefile.depend
+++ b/kerberos5/usr.bin/kadmin/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/usr.bin/kcc/Makefile.depend b/kerberos5/usr.bin/kcc/Makefile.depend
index 973681b..385f604 100644
--- a/kerberos5/usr.bin/kcc/Makefile.depend
+++ b/kerberos5/usr.bin/kcc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/usr.bin/kdestroy/Makefile.depend b/kerberos5/usr.bin/kdestroy/Makefile.depend
index b377d80..9e85d37 100644
--- a/kerberos5/usr.bin/kdestroy/Makefile.depend
+++ b/kerberos5/usr.bin/kdestroy/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/usr.bin/kf/Makefile.depend b/kerberos5/usr.bin/kf/Makefile.depend
index d2c2aa5..b434af8 100644
--- a/kerberos5/usr.bin/kf/Makefile.depend
+++ b/kerberos5/usr.bin/kf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/usr.bin/kgetcred/Makefile.depend b/kerberos5/usr.bin/kgetcred/Makefile.depend
index b377d80..9e85d37 100644
--- a/kerberos5/usr.bin/kgetcred/Makefile.depend
+++ b/kerberos5/usr.bin/kgetcred/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/usr.bin/kinit/Makefile.depend b/kerberos5/usr.bin/kinit/Makefile.depend
index df0ac2a..dcd0d64 100644
--- a/kerberos5/usr.bin/kinit/Makefile.depend
+++ b/kerberos5/usr.bin/kinit/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/usr.bin/kpasswd/Makefile.depend b/kerberos5/usr.bin/kpasswd/Makefile.depend
index fb4a7d6..1f4d460 100644
--- a/kerberos5/usr.bin/kpasswd/Makefile.depend
+++ b/kerberos5/usr.bin/kpasswd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/usr.bin/krb5-config/Makefile.depend b/kerberos5/usr.bin/krb5-config/Makefile.depend
index 11aba52..f80275d 100644
--- a/kerberos5/usr.bin/krb5-config/Makefile.depend
+++ b/kerberos5/usr.bin/krb5-config/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/usr.bin/ksu/Makefile.depend b/kerberos5/usr.bin/ksu/Makefile.depend
index b377d80..9e85d37 100644
--- a/kerberos5/usr.bin/ksu/Makefile.depend
+++ b/kerberos5/usr.bin/ksu/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/usr.bin/string2key/Makefile.depend b/kerberos5/usr.bin/string2key/Makefile.depend
index a246c9e..517300f 100644
--- a/kerberos5/usr.bin/string2key/Makefile.depend
+++ b/kerberos5/usr.bin/string2key/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/usr.bin/verify_krb5_conf/Makefile.depend b/kerberos5/usr.bin/verify_krb5_conf/Makefile.depend
index d2c2aa5..b434af8 100644
--- a/kerberos5/usr.bin/verify_krb5_conf/Makefile.depend
+++ b/kerberos5/usr.bin/verify_krb5_conf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/usr.sbin/iprop-log/Makefile.depend b/kerberos5/usr.sbin/iprop-log/Makefile.depend
index 84c3a4d..5d0a242 100644
--- a/kerberos5/usr.sbin/iprop-log/Makefile.depend
+++ b/kerberos5/usr.sbin/iprop-log/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/usr.sbin/kstash/Makefile.depend b/kerberos5/usr.sbin/kstash/Makefile.depend
index c1e0a30..fc78d6c 100644
--- a/kerberos5/usr.sbin/kstash/Makefile.depend
+++ b/kerberos5/usr.sbin/kstash/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/kerberos5/usr.sbin/ktutil/Makefile.depend b/kerberos5/usr.sbin/ktutil/Makefile.depend
index 860f453..4d47a99 100644
--- a/kerberos5/usr.sbin/ktutil/Makefile.depend
+++ b/kerberos5/usr.sbin/ktutil/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/Makefile b/lib/Makefile
index bee05ab..b8b3a52 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -147,7 +147,6 @@ SUBDIR_DEPEND_libpam= libcrypt libopie ${_libradius} librpcsvc libtacplus libuti
SUBDIR_DEPEND_libpjdlog= libutil
SUBDIR_DEPEND_libprocstat= libkvm libutil
SUBDIR_DEPEND_libradius= libmd
-SUBDIR_DEPEND_libreadline= ncurses
SUBDIR_DEPEND_libsmb= libkiconv
SUBDIR_DEPEND_libstdc++= msun
SUBDIR_DEPEND_libtacplus= libmd
diff --git a/lib/atf/libatf-c++/Makefile.depend b/lib/atf/libatf-c++/Makefile.depend
index 4920fa8..5de4727 100644
--- a/lib/atf/libatf-c++/Makefile.depend
+++ b/lib/atf/libatf-c++/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/atf/libatf-c/Makefile.depend b/lib/atf/libatf-c/Makefile.depend
index 593d407..dde2d60 100644
--- a/lib/atf/libatf-c/Makefile.depend
+++ b/lib/atf/libatf-c/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/clang.build.mk b/lib/clang/clang.build.mk
index c4ce724..5cb0dd0 100644
--- a/lib/clang/clang.build.mk
+++ b/lib/clang/clang.build.mk
@@ -39,7 +39,6 @@ CXXFLAGS.clang+= -stdlib=libc++
.PATH: ${LLVM_SRCS}/${SRCDIR}
-#.info ${MACHINE BOOTSTRAPPING_TOOLS LEGACY_TOOLS:L:@v@$v=${$v}@}
.if empty(TOOLSDIR) || !exists(${TOOLSDIR}/usr/bin/clang-tblgen)
.if ${MACHINE} == "host" && defined(BOOTSTRAPPING_TOOLS)
.if !empty(LEGACY_TOOLS) && exists(${LEGACY_TOOLS}/usr/bin/tblgen)
@@ -60,7 +59,6 @@ CLANG_TBLGEN= ${TOOLSDIR}/usr/bin/clang-tblgen
.endif
TBLGEN?= tblgen
CLANG_TBLGEN?= clang-tblgen
-#.info ${TOOLSDIR TBLGEN CLANG_TBLGEN:L:@v@$v=${$v}@}
Intrinsics.inc.h: ${LLVM_SRCS}/include/llvm/IR/Intrinsics.td
${TBLGEN} -gen-intrinsic \
diff --git a/lib/clang/include/Makefile b/lib/clang/include/Makefile
index 0e6ac6e..d78b20d 100644
--- a/lib/clang/include/Makefile
+++ b/lib/clang/include/Makefile
@@ -8,7 +8,7 @@ LLVM_SRCS= ${.CURDIR}/../../../contrib/llvm
.PATH: ${LLVM_SRCS}/tools/clang/lib/Headers
-INCSDIR=${LIBDIR}/clang/3.6.0/include
+INCSDIR=${LIBDIR}/clang/3.6.1/include
INCS= __stddef_max_align_t.h \
__wmmintrin_aes.h \
diff --git a/lib/clang/include/Makefile.depend b/lib/clang/include/Makefile.depend
index 11aba52..f80275d 100644
--- a/lib/clang/include/Makefile.depend
+++ b/lib/clang/include/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/include/clang/Basic/Version.inc b/lib/clang/include/clang/Basic/Version.inc
index c6d4a8e..e13af79 100644
--- a/lib/clang/include/clang/Basic/Version.inc
+++ b/lib/clang/include/clang/Basic/Version.inc
@@ -1,11 +1,11 @@
/* $FreeBSD$ */
-#define CLANG_VERSION 3.6.0
+#define CLANG_VERSION 3.6.1
#define CLANG_VERSION_MAJOR 3
#define CLANG_VERSION_MINOR 6
-#define CLANG_VERSION_PATCHLEVEL 0
+#define CLANG_VERSION_PATCHLEVEL 1
#define CLANG_VENDOR "FreeBSD "
-#define CLANG_VENDOR_SUFFIX " 20150225"
+#define CLANG_VENDOR_SUFFIX " 20150525"
-#define SVN_REVISION "230434"
+#define SVN_REVISION "237755"
diff --git a/lib/clang/include/clang/Config/config.h b/lib/clang/include/clang/Config/config.h
index 9c4512d..bb435f9 100644
--- a/lib/clang/include/clang/Config/config.h
+++ b/lib/clang/include/clang/Config/config.h
@@ -28,7 +28,7 @@
/* Define if we have libxml2 */
/* #undef CLANG_HAVE_LIBXML */
-#define PACKAGE_STRING "LLVM 3.6.0"
+#define PACKAGE_STRING "LLVM 3.6.1"
/* The LLVM product name and version */
#define BACKEND_PACKAGE_STRING PACKAGE_STRING
diff --git a/lib/clang/include/llvm/Config/config.h b/lib/clang/include/llvm/Config/config.h
index 3fc38be..7a4e7ea 100644
--- a/lib/clang/include/llvm/Config/config.h
+++ b/lib/clang/include/llvm/Config/config.h
@@ -431,6 +431,9 @@
/* Have host's __chkstk */
/* #undef HAVE___CHKSTK */
+/* Have host's __chkstk_ms */
+/* #undef HAVE___CHKSTK_MS */
+
/* Have host's __cmpdi2 */
/* #undef HAVE___CMPDI2 */
@@ -555,10 +558,10 @@
#define LLVM_VERSION_MINOR 6
/* Patch version of the LLVM API */
-#define LLVM_VERSION_PATCH 0
+#define LLVM_VERSION_PATCH 1
/* LLVM version string */
-#define LLVM_VERSION_STRING "3.6.0"
+#define LLVM_VERSION_STRING "3.6.1"
/* The shared library extension */
#define LTDL_SHLIB_EXT ".so"
@@ -574,13 +577,13 @@
#define PACKAGE_NAME "LLVM"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "LLVM 3.6.0"
+#define PACKAGE_STRING "LLVM 3.6.1"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "llvm"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "3.6.0"
+#define PACKAGE_VERSION "3.6.1"
/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void
diff --git a/lib/clang/include/llvm/Config/llvm-config.h b/lib/clang/include/llvm/Config/llvm-config.h
index ba95263..a44de59 100644
--- a/lib/clang/include/llvm/Config/llvm-config.h
+++ b/lib/clang/include/llvm/Config/llvm-config.h
@@ -95,9 +95,9 @@
#define LLVM_VERSION_MINOR 6
/* Patch version of the LLVM API */
-#define LLVM_VERSION_PATCH 0
+#define LLVM_VERSION_PATCH 1
/* LLVM version string */
-#define LLVM_VERSION_STRING "3.6.0"
+#define LLVM_VERSION_STRING "3.6.1"
#endif
diff --git a/lib/clang/libclanganalysis/Makefile.depend b/lib/clang/libclanganalysis/Makefile.depend
index 116d55c..5c5da718 100644
--- a/lib/clang/libclanganalysis/Makefile.depend
+++ b/lib/clang/libclanganalysis/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libclangarcmigrate/Makefile.depend b/lib/clang/libclangarcmigrate/Makefile.depend
index 9a1733e..70e0854 100644
--- a/lib/clang/libclangarcmigrate/Makefile.depend
+++ b/lib/clang/libclangarcmigrate/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libclangast/Makefile.depend b/lib/clang/libclangast/Makefile.depend
index 9a49e74..89d2a29 100644
--- a/lib/clang/libclangast/Makefile.depend
+++ b/lib/clang/libclangast/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libclangbasic/Makefile.depend b/lib/clang/libclangbasic/Makefile.depend
index 29d9bc9..ea23a70 100644
--- a/lib/clang/libclangbasic/Makefile.depend
+++ b/lib/clang/libclangbasic/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libclangcodegen/Makefile.depend b/lib/clang/libclangcodegen/Makefile.depend
index 3573fe7..bb7fc0e 100644
--- a/lib/clang/libclangcodegen/Makefile.depend
+++ b/lib/clang/libclangcodegen/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libclangdriver/Makefile.depend b/lib/clang/libclangdriver/Makefile.depend
index 9c27455..24c1e09 100644
--- a/lib/clang/libclangdriver/Makefile.depend
+++ b/lib/clang/libclangdriver/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libclangedit/Makefile.depend b/lib/clang/libclangedit/Makefile.depend
index e3ab3a6..778a945 100644
--- a/lib/clang/libclangedit/Makefile.depend
+++ b/lib/clang/libclangedit/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libclangfrontend/Makefile.depend b/lib/clang/libclangfrontend/Makefile.depend
index a0f6b20..8605e39 100644
--- a/lib/clang/libclangfrontend/Makefile.depend
+++ b/lib/clang/libclangfrontend/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libclangfrontendtool/Makefile.depend b/lib/clang/libclangfrontendtool/Makefile.depend
index a775732..78a5190 100644
--- a/lib/clang/libclangfrontendtool/Makefile.depend
+++ b/lib/clang/libclangfrontendtool/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libclanglex/Makefile.depend b/lib/clang/libclanglex/Makefile.depend
index 58c03db..ae88032 100644
--- a/lib/clang/libclanglex/Makefile.depend
+++ b/lib/clang/libclanglex/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libclangparse/Makefile.depend b/lib/clang/libclangparse/Makefile.depend
index 4672353..52a5e4e 100644
--- a/lib/clang/libclangparse/Makefile.depend
+++ b/lib/clang/libclangparse/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libclangrewrite/Makefile.depend b/lib/clang/libclangrewrite/Makefile.depend
index 099fc62..a6f8e9c 100644
--- a/lib/clang/libclangrewrite/Makefile.depend
+++ b/lib/clang/libclangrewrite/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libclangrewritefrontend/Makefile.depend b/lib/clang/libclangrewritefrontend/Makefile.depend
index f4dda4d..6bb290f 100644
--- a/lib/clang/libclangrewritefrontend/Makefile.depend
+++ b/lib/clang/libclangrewritefrontend/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libclangsema/Makefile.depend b/lib/clang/libclangsema/Makefile.depend
index 3d2730b..158b16d 100644
--- a/lib/clang/libclangsema/Makefile.depend
+++ b/lib/clang/libclangsema/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libclangserialization/Makefile.depend b/lib/clang/libclangserialization/Makefile.depend
index 1c2cb9f..6ee9d58 100644
--- a/lib/clang/libclangserialization/Makefile.depend
+++ b/lib/clang/libclangserialization/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libclangstaticanalyzercheckers/Makefile.depend b/lib/clang/libclangstaticanalyzercheckers/Makefile.depend
index 4b797b8..6d91abe 100644
--- a/lib/clang/libclangstaticanalyzercheckers/Makefile.depend
+++ b/lib/clang/libclangstaticanalyzercheckers/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libclangstaticanalyzercore/Makefile.depend b/lib/clang/libclangstaticanalyzercore/Makefile.depend
index d018547..7a1f856 100644
--- a/lib/clang/libclangstaticanalyzercore/Makefile.depend
+++ b/lib/clang/libclangstaticanalyzercore/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libclangstaticanalyzerfrontend/Makefile.depend b/lib/clang/libclangstaticanalyzerfrontend/Makefile.depend
index eaac03f..77ea2dd 100644
--- a/lib/clang/libclangstaticanalyzerfrontend/Makefile.depend
+++ b/lib/clang/libclangstaticanalyzerfrontend/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmaarch64asmparser/Makefile.depend b/lib/clang/libllvmaarch64asmparser/Makefile.depend
index 9c80e95..745dfbc 100644
--- a/lib/clang/libllvmaarch64asmparser/Makefile.depend
+++ b/lib/clang/libllvmaarch64asmparser/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmaarch64codegen/Makefile.depend b/lib/clang/libllvmaarch64codegen/Makefile.depend
new file mode 100644
index 0000000..e6dc7bf
--- /dev/null
+++ b/lib/clang/libllvmaarch64codegen/Makefile.depend
@@ -0,0 +1,204 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+AArch64A53Fix835769.o: AArch64GenInstrInfo.inc.h
+AArch64A53Fix835769.o: AArch64GenRegisterInfo.inc.h
+AArch64A53Fix835769.o: AArch64GenSubtargetInfo.inc.h
+AArch64A53Fix835769.po: AArch64GenInstrInfo.inc.h
+AArch64A53Fix835769.po: AArch64GenRegisterInfo.inc.h
+AArch64A53Fix835769.po: AArch64GenSubtargetInfo.inc.h
+AArch64A57FPLoadBalancing.o: AArch64GenInstrInfo.inc.h
+AArch64A57FPLoadBalancing.o: AArch64GenRegisterInfo.inc.h
+AArch64A57FPLoadBalancing.o: AArch64GenSubtargetInfo.inc.h
+AArch64A57FPLoadBalancing.po: AArch64GenInstrInfo.inc.h
+AArch64A57FPLoadBalancing.po: AArch64GenRegisterInfo.inc.h
+AArch64A57FPLoadBalancing.po: AArch64GenSubtargetInfo.inc.h
+AArch64AddressTypePromotion.o: AArch64GenInstrInfo.inc.h
+AArch64AddressTypePromotion.o: AArch64GenRegisterInfo.inc.h
+AArch64AddressTypePromotion.o: AArch64GenSubtargetInfo.inc.h
+AArch64AddressTypePromotion.po: AArch64GenInstrInfo.inc.h
+AArch64AddressTypePromotion.po: AArch64GenRegisterInfo.inc.h
+AArch64AddressTypePromotion.po: AArch64GenSubtargetInfo.inc.h
+AArch64AdvSIMDScalarPass.o: AArch64GenInstrInfo.inc.h
+AArch64AdvSIMDScalarPass.o: AArch64GenRegisterInfo.inc.h
+AArch64AdvSIMDScalarPass.o: AArch64GenSubtargetInfo.inc.h
+AArch64AdvSIMDScalarPass.po: AArch64GenInstrInfo.inc.h
+AArch64AdvSIMDScalarPass.po: AArch64GenRegisterInfo.inc.h
+AArch64AdvSIMDScalarPass.po: AArch64GenSubtargetInfo.inc.h
+AArch64AsmPrinter.o: AArch64GenInstrInfo.inc.h
+AArch64AsmPrinter.o: AArch64GenMCPseudoLowering.inc.h
+AArch64AsmPrinter.o: AArch64GenRegisterInfo.inc.h
+AArch64AsmPrinter.o: AArch64GenSubtargetInfo.inc.h
+AArch64AsmPrinter.po: AArch64GenInstrInfo.inc.h
+AArch64AsmPrinter.po: AArch64GenMCPseudoLowering.inc.h
+AArch64AsmPrinter.po: AArch64GenRegisterInfo.inc.h
+AArch64AsmPrinter.po: AArch64GenSubtargetInfo.inc.h
+AArch64BranchRelaxation.o: AArch64GenInstrInfo.inc.h
+AArch64BranchRelaxation.o: AArch64GenRegisterInfo.inc.h
+AArch64BranchRelaxation.o: AArch64GenSubtargetInfo.inc.h
+AArch64BranchRelaxation.po: AArch64GenInstrInfo.inc.h
+AArch64BranchRelaxation.po: AArch64GenRegisterInfo.inc.h
+AArch64BranchRelaxation.po: AArch64GenSubtargetInfo.inc.h
+AArch64CleanupLocalDynamicTLSPass.o: AArch64GenInstrInfo.inc.h
+AArch64CleanupLocalDynamicTLSPass.o: AArch64GenRegisterInfo.inc.h
+AArch64CleanupLocalDynamicTLSPass.o: AArch64GenSubtargetInfo.inc.h
+AArch64CleanupLocalDynamicTLSPass.po: AArch64GenInstrInfo.inc.h
+AArch64CleanupLocalDynamicTLSPass.po: AArch64GenRegisterInfo.inc.h
+AArch64CleanupLocalDynamicTLSPass.po: AArch64GenSubtargetInfo.inc.h
+AArch64CollectLOH.o: AArch64GenInstrInfo.inc.h
+AArch64CollectLOH.o: AArch64GenRegisterInfo.inc.h
+AArch64CollectLOH.o: AArch64GenSubtargetInfo.inc.h
+AArch64CollectLOH.po: AArch64GenInstrInfo.inc.h
+AArch64CollectLOH.po: AArch64GenRegisterInfo.inc.h
+AArch64CollectLOH.po: AArch64GenSubtargetInfo.inc.h
+AArch64ConditionOptimizer.o: AArch64GenInstrInfo.inc.h
+AArch64ConditionOptimizer.o: AArch64GenRegisterInfo.inc.h
+AArch64ConditionOptimizer.o: AArch64GenSubtargetInfo.inc.h
+AArch64ConditionOptimizer.po: AArch64GenInstrInfo.inc.h
+AArch64ConditionOptimizer.po: AArch64GenRegisterInfo.inc.h
+AArch64ConditionOptimizer.po: AArch64GenSubtargetInfo.inc.h
+AArch64ConditionalCompares.o: AArch64GenInstrInfo.inc.h
+AArch64ConditionalCompares.o: AArch64GenRegisterInfo.inc.h
+AArch64ConditionalCompares.o: AArch64GenSubtargetInfo.inc.h
+AArch64ConditionalCompares.po: AArch64GenInstrInfo.inc.h
+AArch64ConditionalCompares.po: AArch64GenRegisterInfo.inc.h
+AArch64ConditionalCompares.po: AArch64GenSubtargetInfo.inc.h
+AArch64DeadRegisterDefinitionsPass.o: AArch64GenInstrInfo.inc.h
+AArch64DeadRegisterDefinitionsPass.o: AArch64GenRegisterInfo.inc.h
+AArch64DeadRegisterDefinitionsPass.o: AArch64GenSubtargetInfo.inc.h
+AArch64DeadRegisterDefinitionsPass.po: AArch64GenInstrInfo.inc.h
+AArch64DeadRegisterDefinitionsPass.po: AArch64GenRegisterInfo.inc.h
+AArch64DeadRegisterDefinitionsPass.po: AArch64GenSubtargetInfo.inc.h
+AArch64ExpandPseudoInsts.o: AArch64GenInstrInfo.inc.h
+AArch64ExpandPseudoInsts.o: AArch64GenRegisterInfo.inc.h
+AArch64ExpandPseudoInsts.o: AArch64GenSubtargetInfo.inc.h
+AArch64ExpandPseudoInsts.po: AArch64GenInstrInfo.inc.h
+AArch64ExpandPseudoInsts.po: AArch64GenRegisterInfo.inc.h
+AArch64ExpandPseudoInsts.po: AArch64GenSubtargetInfo.inc.h
+AArch64FastISel.o: AArch64GenCallingConv.inc.h
+AArch64FastISel.o: AArch64GenFastISel.inc.h
+AArch64FastISel.o: AArch64GenInstrInfo.inc.h
+AArch64FastISel.o: AArch64GenRegisterInfo.inc.h
+AArch64FastISel.o: AArch64GenSubtargetInfo.inc.h
+AArch64FastISel.o: Intrinsics.inc.h
+AArch64FastISel.po: AArch64GenCallingConv.inc.h
+AArch64FastISel.po: AArch64GenFastISel.inc.h
+AArch64FastISel.po: AArch64GenInstrInfo.inc.h
+AArch64FastISel.po: AArch64GenRegisterInfo.inc.h
+AArch64FastISel.po: AArch64GenSubtargetInfo.inc.h
+AArch64FastISel.po: Intrinsics.inc.h
+AArch64FrameLowering.o: AArch64GenInstrInfo.inc.h
+AArch64FrameLowering.o: AArch64GenRegisterInfo.inc.h
+AArch64FrameLowering.o: AArch64GenSubtargetInfo.inc.h
+AArch64FrameLowering.po: AArch64GenInstrInfo.inc.h
+AArch64FrameLowering.po: AArch64GenRegisterInfo.inc.h
+AArch64FrameLowering.po: AArch64GenSubtargetInfo.inc.h
+AArch64ISelDAGToDAG.o: AArch64GenDAGISel.inc.h
+AArch64ISelDAGToDAG.o: AArch64GenInstrInfo.inc.h
+AArch64ISelDAGToDAG.o: AArch64GenRegisterInfo.inc.h
+AArch64ISelDAGToDAG.o: AArch64GenSubtargetInfo.inc.h
+AArch64ISelDAGToDAG.o: Intrinsics.inc.h
+AArch64ISelDAGToDAG.po: AArch64GenDAGISel.inc.h
+AArch64ISelDAGToDAG.po: AArch64GenInstrInfo.inc.h
+AArch64ISelDAGToDAG.po: AArch64GenRegisterInfo.inc.h
+AArch64ISelDAGToDAG.po: AArch64GenSubtargetInfo.inc.h
+AArch64ISelDAGToDAG.po: Intrinsics.inc.h
+AArch64ISelLowering.o: AArch64GenCallingConv.inc.h
+AArch64ISelLowering.o: AArch64GenInstrInfo.inc.h
+AArch64ISelLowering.o: AArch64GenRegisterInfo.inc.h
+AArch64ISelLowering.o: AArch64GenSubtargetInfo.inc.h
+AArch64ISelLowering.o: Intrinsics.inc.h
+AArch64ISelLowering.po: AArch64GenCallingConv.inc.h
+AArch64ISelLowering.po: AArch64GenInstrInfo.inc.h
+AArch64ISelLowering.po: AArch64GenRegisterInfo.inc.h
+AArch64ISelLowering.po: AArch64GenSubtargetInfo.inc.h
+AArch64ISelLowering.po: Intrinsics.inc.h
+AArch64InstrInfo.o: AArch64GenInstrInfo.inc.h
+AArch64InstrInfo.o: AArch64GenRegisterInfo.inc.h
+AArch64InstrInfo.o: AArch64GenSubtargetInfo.inc.h
+AArch64InstrInfo.po: AArch64GenInstrInfo.inc.h
+AArch64InstrInfo.po: AArch64GenRegisterInfo.inc.h
+AArch64InstrInfo.po: AArch64GenSubtargetInfo.inc.h
+AArch64LoadStoreOptimizer.o: AArch64GenInstrInfo.inc.h
+AArch64LoadStoreOptimizer.o: AArch64GenRegisterInfo.inc.h
+AArch64LoadStoreOptimizer.o: AArch64GenSubtargetInfo.inc.h
+AArch64LoadStoreOptimizer.po: AArch64GenInstrInfo.inc.h
+AArch64LoadStoreOptimizer.po: AArch64GenRegisterInfo.inc.h
+AArch64LoadStoreOptimizer.po: AArch64GenSubtargetInfo.inc.h
+AArch64MCInstLower.o: AArch64GenInstrInfo.inc.h
+AArch64MCInstLower.o: AArch64GenRegisterInfo.inc.h
+AArch64MCInstLower.o: AArch64GenSubtargetInfo.inc.h
+AArch64MCInstLower.po: AArch64GenInstrInfo.inc.h
+AArch64MCInstLower.po: AArch64GenRegisterInfo.inc.h
+AArch64MCInstLower.po: AArch64GenSubtargetInfo.inc.h
+AArch64PBQPRegAlloc.o: AArch64GenInstrInfo.inc.h
+AArch64PBQPRegAlloc.o: AArch64GenRegisterInfo.inc.h
+AArch64PBQPRegAlloc.o: AArch64GenSubtargetInfo.inc.h
+AArch64PBQPRegAlloc.po: AArch64GenInstrInfo.inc.h
+AArch64PBQPRegAlloc.po: AArch64GenRegisterInfo.inc.h
+AArch64PBQPRegAlloc.po: AArch64GenSubtargetInfo.inc.h
+AArch64PromoteConstant.o: AArch64GenInstrInfo.inc.h
+AArch64PromoteConstant.o: AArch64GenRegisterInfo.inc.h
+AArch64PromoteConstant.o: AArch64GenSubtargetInfo.inc.h
+AArch64PromoteConstant.o: Intrinsics.inc.h
+AArch64PromoteConstant.po: AArch64GenInstrInfo.inc.h
+AArch64PromoteConstant.po: AArch64GenRegisterInfo.inc.h
+AArch64PromoteConstant.po: AArch64GenSubtargetInfo.inc.h
+AArch64PromoteConstant.po: Intrinsics.inc.h
+AArch64RegisterInfo.o: AArch64GenInstrInfo.inc.h
+AArch64RegisterInfo.o: AArch64GenRegisterInfo.inc.h
+AArch64RegisterInfo.o: AArch64GenSubtargetInfo.inc.h
+AArch64RegisterInfo.po: AArch64GenInstrInfo.inc.h
+AArch64RegisterInfo.po: AArch64GenRegisterInfo.inc.h
+AArch64RegisterInfo.po: AArch64GenSubtargetInfo.inc.h
+AArch64SelectionDAGInfo.o: AArch64GenInstrInfo.inc.h
+AArch64SelectionDAGInfo.o: AArch64GenRegisterInfo.inc.h
+AArch64SelectionDAGInfo.o: AArch64GenSubtargetInfo.inc.h
+AArch64SelectionDAGInfo.po: AArch64GenInstrInfo.inc.h
+AArch64SelectionDAGInfo.po: AArch64GenRegisterInfo.inc.h
+AArch64SelectionDAGInfo.po: AArch64GenSubtargetInfo.inc.h
+AArch64StorePairSuppress.o: AArch64GenInstrInfo.inc.h
+AArch64StorePairSuppress.o: AArch64GenRegisterInfo.inc.h
+AArch64StorePairSuppress.o: AArch64GenSubtargetInfo.inc.h
+AArch64StorePairSuppress.po: AArch64GenInstrInfo.inc.h
+AArch64StorePairSuppress.po: AArch64GenRegisterInfo.inc.h
+AArch64StorePairSuppress.po: AArch64GenSubtargetInfo.inc.h
+AArch64Subtarget.o: AArch64GenInstrInfo.inc.h
+AArch64Subtarget.o: AArch64GenRegisterInfo.inc.h
+AArch64Subtarget.o: AArch64GenSubtargetInfo.inc.h
+AArch64Subtarget.po: AArch64GenInstrInfo.inc.h
+AArch64Subtarget.po: AArch64GenRegisterInfo.inc.h
+AArch64Subtarget.po: AArch64GenSubtargetInfo.inc.h
+AArch64TargetMachine.o: AArch64GenInstrInfo.inc.h
+AArch64TargetMachine.o: AArch64GenRegisterInfo.inc.h
+AArch64TargetMachine.o: AArch64GenSubtargetInfo.inc.h
+AArch64TargetMachine.po: AArch64GenInstrInfo.inc.h
+AArch64TargetMachine.po: AArch64GenRegisterInfo.inc.h
+AArch64TargetMachine.po: AArch64GenSubtargetInfo.inc.h
+AArch64TargetObjectFile.o: AArch64GenInstrInfo.inc.h
+AArch64TargetObjectFile.o: AArch64GenRegisterInfo.inc.h
+AArch64TargetObjectFile.o: AArch64GenSubtargetInfo.inc.h
+AArch64TargetObjectFile.po: AArch64GenInstrInfo.inc.h
+AArch64TargetObjectFile.po: AArch64GenRegisterInfo.inc.h
+AArch64TargetObjectFile.po: AArch64GenSubtargetInfo.inc.h
+AArch64TargetTransformInfo.o: AArch64GenInstrInfo.inc.h
+AArch64TargetTransformInfo.o: AArch64GenRegisterInfo.inc.h
+AArch64TargetTransformInfo.o: AArch64GenSubtargetInfo.inc.h
+AArch64TargetTransformInfo.o: Intrinsics.inc.h
+AArch64TargetTransformInfo.po: AArch64GenInstrInfo.inc.h
+AArch64TargetTransformInfo.po: AArch64GenRegisterInfo.inc.h
+AArch64TargetTransformInfo.po: AArch64GenSubtargetInfo.inc.h
+AArch64TargetTransformInfo.po: Intrinsics.inc.h
+.endif
diff --git a/lib/clang/libllvmaarch64desc/Makefile.depend b/lib/clang/libllvmaarch64desc/Makefile.depend
index 790d0e3..b21faa8 100644
--- a/lib/clang/libllvmaarch64desc/Makefile.depend
+++ b/lib/clang/libllvmaarch64desc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmaarch64disassembler/Makefile.depend b/lib/clang/libllvmaarch64disassembler/Makefile.depend
index ea61fad..7c5f0d9 100644
--- a/lib/clang/libllvmaarch64disassembler/Makefile.depend
+++ b/lib/clang/libllvmaarch64disassembler/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmaarch64info/Makefile.depend b/lib/clang/libllvmaarch64info/Makefile.depend
index 18d28d6..385072f 100644
--- a/lib/clang/libllvmaarch64info/Makefile.depend
+++ b/lib/clang/libllvmaarch64info/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmaarch64instprinter/Makefile.depend b/lib/clang/libllvmaarch64instprinter/Makefile.depend
index ae51163..56c8d39 100644
--- a/lib/clang/libllvmaarch64instprinter/Makefile.depend
+++ b/lib/clang/libllvmaarch64instprinter/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmaarch64utils/Makefile.depend b/lib/clang/libllvmaarch64utils/Makefile.depend
index 93a05f4..c7f43d4 100644
--- a/lib/clang/libllvmaarch64utils/Makefile.depend
+++ b/lib/clang/libllvmaarch64utils/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmanalysis/Makefile.depend b/lib/clang/libllvmanalysis/Makefile.depend
index d7ef225..274e6ed 100644
--- a/lib/clang/libllvmanalysis/Makefile.depend
+++ b/lib/clang/libllvmanalysis/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmarmasmparser/Makefile.depend b/lib/clang/libllvmarmasmparser/Makefile.depend
index 6efd01d..6fa25b5 100644
--- a/lib/clang/libllvmarmasmparser/Makefile.depend
+++ b/lib/clang/libllvmarmasmparser/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmarmcodegen/Makefile.depend b/lib/clang/libllvmarmcodegen/Makefile.depend
index e287534..deda9fb 100644
--- a/lib/clang/libllvmarmcodegen/Makefile.depend
+++ b/lib/clang/libllvmarmcodegen/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmarmdesc/Makefile.depend b/lib/clang/libllvmarmdesc/Makefile.depend
index 72650d0..1d70a65 100644
--- a/lib/clang/libllvmarmdesc/Makefile.depend
+++ b/lib/clang/libllvmarmdesc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmarmdisassembler/Makefile.depend b/lib/clang/libllvmarmdisassembler/Makefile.depend
index 1185dc6..59787f1 100644
--- a/lib/clang/libllvmarmdisassembler/Makefile.depend
+++ b/lib/clang/libllvmarmdisassembler/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmarminfo/Makefile.depend b/lib/clang/libllvmarminfo/Makefile.depend
index 7bd1454..eb09777 100644
--- a/lib/clang/libllvmarminfo/Makefile.depend
+++ b/lib/clang/libllvmarminfo/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmarminstprinter/Makefile.depend b/lib/clang/libllvmarminstprinter/Makefile.depend
index 679c240..ba60d06 100644
--- a/lib/clang/libllvmarminstprinter/Makefile.depend
+++ b/lib/clang/libllvmarminstprinter/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmasmparser/Makefile.depend b/lib/clang/libllvmasmparser/Makefile.depend
index 1cb182e..3e7f3f5 100644
--- a/lib/clang/libllvmasmparser/Makefile.depend
+++ b/lib/clang/libllvmasmparser/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmasmprinter/Makefile.depend b/lib/clang/libllvmasmprinter/Makefile.depend
index 4c488fb..ed98ab4 100644
--- a/lib/clang/libllvmasmprinter/Makefile.depend
+++ b/lib/clang/libllvmasmprinter/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmbitreader/Makefile.depend b/lib/clang/libllvmbitreader/Makefile.depend
index 3ebccd2..387067c 100644
--- a/lib/clang/libllvmbitreader/Makefile.depend
+++ b/lib/clang/libllvmbitreader/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmbitwriter/Makefile.depend b/lib/clang/libllvmbitwriter/Makefile.depend
index 1cb182e..3e7f3f5 100644
--- a/lib/clang/libllvmbitwriter/Makefile.depend
+++ b/lib/clang/libllvmbitwriter/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmcodegen/Makefile.depend b/lib/clang/libllvmcodegen/Makefile.depend
index d4f1f49..98484cb 100644
--- a/lib/clang/libllvmcodegen/Makefile.depend
+++ b/lib/clang/libllvmcodegen/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmcore/Makefile.depend b/lib/clang/libllvmcore/Makefile.depend
index a3ed923..212908d 100644
--- a/lib/clang/libllvmcore/Makefile.depend
+++ b/lib/clang/libllvmcore/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmdebuginfo/Makefile.depend b/lib/clang/libllvmdebuginfo/Makefile.depend
index 4d8f064..c9899bc 100644
--- a/lib/clang/libllvmdebuginfo/Makefile.depend
+++ b/lib/clang/libllvmdebuginfo/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/clang/libllvmexecutionengine/Makefile.depend b/lib/clang/libllvmexecutionengine/Makefile.depend
index 4d8f064..c9899bc 100644
--- a/lib/clang/libllvmexecutionengine/Makefile.depend
+++ b/lib/clang/libllvmexecutionengine/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/clang/libllvminstcombine/Makefile.depend b/lib/clang/libllvminstcombine/Makefile.depend
index d128463..d2df3e5 100644
--- a/lib/clang/libllvminstcombine/Makefile.depend
+++ b/lib/clang/libllvminstcombine/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvminstrumentation/Makefile.depend b/lib/clang/libllvminstrumentation/Makefile.depend
index 60f060f..625288d 100644
--- a/lib/clang/libllvminstrumentation/Makefile.depend
+++ b/lib/clang/libllvminstrumentation/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvminterpreter/Makefile.depend b/lib/clang/libllvminterpreter/Makefile.depend
index 6f6ff77..4fc7d45 100644
--- a/lib/clang/libllvminterpreter/Makefile.depend
+++ b/lib/clang/libllvminterpreter/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/clang/libllvmipa/Makefile.depend b/lib/clang/libllvmipa/Makefile.depend
index e1b83e0..cc9dba5 100644
--- a/lib/clang/libllvmipa/Makefile.depend
+++ b/lib/clang/libllvmipa/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmipo/Makefile.depend b/lib/clang/libllvmipo/Makefile.depend
index d549f14..39715a7 100644
--- a/lib/clang/libllvmipo/Makefile.depend
+++ b/lib/clang/libllvmipo/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmirreader/Makefile.depend b/lib/clang/libllvmirreader/Makefile.depend
index 1cb182e..3e7f3f5 100644
--- a/lib/clang/libllvmirreader/Makefile.depend
+++ b/lib/clang/libllvmirreader/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmlinker/Makefile.depend b/lib/clang/libllvmlinker/Makefile.depend
index 1cb182e..3e7f3f5 100644
--- a/lib/clang/libllvmlinker/Makefile.depend
+++ b/lib/clang/libllvmlinker/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmmc/Makefile.depend b/lib/clang/libllvmmc/Makefile.depend
index 1cb182e..3e7f3f5 100644
--- a/lib/clang/libllvmmc/Makefile.depend
+++ b/lib/clang/libllvmmc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmmcdisassembler/Makefile.depend b/lib/clang/libllvmmcdisassembler/Makefile.depend
index 4d8f064..c9899bc 100644
--- a/lib/clang/libllvmmcdisassembler/Makefile.depend
+++ b/lib/clang/libllvmmcdisassembler/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/clang/libllvmmcjit/Makefile.depend b/lib/clang/libllvmmcjit/Makefile.depend
index 4d8f064..c9899bc 100644
--- a/lib/clang/libllvmmcjit/Makefile.depend
+++ b/lib/clang/libllvmmcjit/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/clang/libllvmmcparser/Makefile.depend b/lib/clang/libllvmmcparser/Makefile.depend
index 1cb182e..3e7f3f5 100644
--- a/lib/clang/libllvmmcparser/Makefile.depend
+++ b/lib/clang/libllvmmcparser/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmmipsasmparser/Makefile.depend b/lib/clang/libllvmmipsasmparser/Makefile.depend
index 7b56cd3..541f726 100644
--- a/lib/clang/libllvmmipsasmparser/Makefile.depend
+++ b/lib/clang/libllvmmipsasmparser/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmmipscodegen/Makefile.depend b/lib/clang/libllvmmipscodegen/Makefile.depend
index a145f9a..a4cd81a 100644
--- a/lib/clang/libllvmmipscodegen/Makefile.depend
+++ b/lib/clang/libllvmmipscodegen/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmmipsdesc/Makefile.depend b/lib/clang/libllvmmipsdesc/Makefile.depend
index f27206a..ccc26d1 100644
--- a/lib/clang/libllvmmipsdesc/Makefile.depend
+++ b/lib/clang/libllvmmipsdesc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmmipsdisassembler/Makefile.depend b/lib/clang/libllvmmipsdisassembler/Makefile.depend
index 0e59343..5e10f87 100644
--- a/lib/clang/libllvmmipsdisassembler/Makefile.depend
+++ b/lib/clang/libllvmmipsdisassembler/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmmipsinfo/Makefile.depend b/lib/clang/libllvmmipsinfo/Makefile.depend
index 7d75918..04d7394 100644
--- a/lib/clang/libllvmmipsinfo/Makefile.depend
+++ b/lib/clang/libllvmmipsinfo/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmmipsinstprinter/Makefile.depend b/lib/clang/libllvmmipsinstprinter/Makefile.depend
index 8cfc680..2426018 100644
--- a/lib/clang/libllvmmipsinstprinter/Makefile.depend
+++ b/lib/clang/libllvmmipsinstprinter/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmobjcarcopts/Makefile.depend b/lib/clang/libllvmobjcarcopts/Makefile.depend
index 553854e..dc5c465 100644
--- a/lib/clang/libllvmobjcarcopts/Makefile.depend
+++ b/lib/clang/libllvmobjcarcopts/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmobject/Makefile.depend b/lib/clang/libllvmobject/Makefile.depend
index 1cb182e..3e7f3f5 100644
--- a/lib/clang/libllvmobject/Makefile.depend
+++ b/lib/clang/libllvmobject/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmoption/Makefile.depend b/lib/clang/libllvmoption/Makefile.depend
index 1cb182e..3e7f3f5 100644
--- a/lib/clang/libllvmoption/Makefile.depend
+++ b/lib/clang/libllvmoption/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmpowerpcasmparser/Makefile.depend b/lib/clang/libllvmpowerpcasmparser/Makefile.depend
index 2245911..6a84c65 100644
--- a/lib/clang/libllvmpowerpcasmparser/Makefile.depend
+++ b/lib/clang/libllvmpowerpcasmparser/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmpowerpccodegen/Makefile.depend b/lib/clang/libllvmpowerpccodegen/Makefile.depend
index bbdeedc..d7ad295 100644
--- a/lib/clang/libllvmpowerpccodegen/Makefile.depend
+++ b/lib/clang/libllvmpowerpccodegen/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmpowerpcdesc/Makefile.depend b/lib/clang/libllvmpowerpcdesc/Makefile.depend
index d694c9d..cb4da9d 100644
--- a/lib/clang/libllvmpowerpcdesc/Makefile.depend
+++ b/lib/clang/libllvmpowerpcdesc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmpowerpcdisassembler/Makefile.depend b/lib/clang/libllvmpowerpcdisassembler/Makefile.depend
index 798d1555..ae1219e 100644
--- a/lib/clang/libllvmpowerpcdisassembler/Makefile.depend
+++ b/lib/clang/libllvmpowerpcdisassembler/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmpowerpcinfo/Makefile.depend b/lib/clang/libllvmpowerpcinfo/Makefile.depend
index d465551..2b87d9d 100644
--- a/lib/clang/libllvmpowerpcinfo/Makefile.depend
+++ b/lib/clang/libllvmpowerpcinfo/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmpowerpcinstprinter/Makefile.depend b/lib/clang/libllvmpowerpcinstprinter/Makefile.depend
index e679c82..9ddadfa 100644
--- a/lib/clang/libllvmpowerpcinstprinter/Makefile.depend
+++ b/lib/clang/libllvmpowerpcinstprinter/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmprofiledata/Makefile.depend b/lib/clang/libllvmprofiledata/Makefile.depend
index 1cb182e..3e7f3f5 100644
--- a/lib/clang/libllvmprofiledata/Makefile.depend
+++ b/lib/clang/libllvmprofiledata/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmruntimedyld/Makefile.depend b/lib/clang/libllvmruntimedyld/Makefile.depend
index 4d8f064..c9899bc 100644
--- a/lib/clang/libllvmruntimedyld/Makefile.depend
+++ b/lib/clang/libllvmruntimedyld/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/clang/libllvmscalaropts/Makefile.depend b/lib/clang/libllvmscalaropts/Makefile.depend
index fb802c9..c33d392 100644
--- a/lib/clang/libllvmscalaropts/Makefile.depend
+++ b/lib/clang/libllvmscalaropts/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmselectiondag/Makefile.depend b/lib/clang/libllvmselectiondag/Makefile.depend
index 9e219b9..9dbab9a 100644
--- a/lib/clang/libllvmselectiondag/Makefile.depend
+++ b/lib/clang/libllvmselectiondag/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmsparcasmparser/Makefile.depend b/lib/clang/libllvmsparcasmparser/Makefile.depend
index 7082fc0..256ccd8 100644
--- a/lib/clang/libllvmsparcasmparser/Makefile.depend
+++ b/lib/clang/libllvmsparcasmparser/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmsparccodegen/Makefile.depend b/lib/clang/libllvmsparccodegen/Makefile.depend
index 3309d0f..64226f6 100644
--- a/lib/clang/libllvmsparccodegen/Makefile.depend
+++ b/lib/clang/libllvmsparccodegen/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmsparcdesc/Makefile.depend b/lib/clang/libllvmsparcdesc/Makefile.depend
index 38f81e8..5b5db5f 100644
--- a/lib/clang/libllvmsparcdesc/Makefile.depend
+++ b/lib/clang/libllvmsparcdesc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmsparcdisassembler/Makefile.depend b/lib/clang/libllvmsparcdisassembler/Makefile.depend
index 46bcee8..213789e 100644
--- a/lib/clang/libllvmsparcdisassembler/Makefile.depend
+++ b/lib/clang/libllvmsparcdisassembler/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmsparcinfo/Makefile.depend b/lib/clang/libllvmsparcinfo/Makefile.depend
index 5b70773..ac56ca5 100644
--- a/lib/clang/libllvmsparcinfo/Makefile.depend
+++ b/lib/clang/libllvmsparcinfo/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmsparcinstprinter/Makefile.depend b/lib/clang/libllvmsparcinstprinter/Makefile.depend
index deb858d..6571fb4 100644
--- a/lib/clang/libllvmsparcinstprinter/Makefile.depend
+++ b/lib/clang/libllvmsparcinstprinter/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmsupport/Makefile.depend b/lib/clang/libllvmsupport/Makefile.depend
index ef8fa43..424f5a8 100644
--- a/lib/clang/libllvmsupport/Makefile.depend
+++ b/lib/clang/libllvmsupport/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmtablegen/Makefile.depend b/lib/clang/libllvmtablegen/Makefile.depend
index 1cb182e..3e7f3f5 100644
--- a/lib/clang/libllvmtablegen/Makefile.depend
+++ b/lib/clang/libllvmtablegen/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmtarget/Makefile.depend b/lib/clang/libllvmtarget/Makefile.depend
index 1cb182e..3e7f3f5 100644
--- a/lib/clang/libllvmtarget/Makefile.depend
+++ b/lib/clang/libllvmtarget/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmtransformutils/Makefile.depend b/lib/clang/libllvmtransformutils/Makefile.depend
index b11adc7..f3a7d48 100644
--- a/lib/clang/libllvmtransformutils/Makefile.depend
+++ b/lib/clang/libllvmtransformutils/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmvectorize/Makefile.depend b/lib/clang/libllvmvectorize/Makefile.depend
index 1aaac6e..daeb031 100644
--- a/lib/clang/libllvmvectorize/Makefile.depend
+++ b/lib/clang/libllvmvectorize/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmx86asmparser/Makefile.depend b/lib/clang/libllvmx86asmparser/Makefile.depend
index 96ece14..d4b04c6 100644
--- a/lib/clang/libllvmx86asmparser/Makefile.depend
+++ b/lib/clang/libllvmx86asmparser/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmx86codegen/Makefile.depend b/lib/clang/libllvmx86codegen/Makefile.depend
index a0b95c8..889d747 100644
--- a/lib/clang/libllvmx86codegen/Makefile.depend
+++ b/lib/clang/libllvmx86codegen/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmx86desc/Makefile.depend b/lib/clang/libllvmx86desc/Makefile.depend
index a682e28..b68230d 100644
--- a/lib/clang/libllvmx86desc/Makefile.depend
+++ b/lib/clang/libllvmx86desc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmx86disassembler/Makefile.depend b/lib/clang/libllvmx86disassembler/Makefile.depend
index b4f5943..e463379 100644
--- a/lib/clang/libllvmx86disassembler/Makefile.depend
+++ b/lib/clang/libllvmx86disassembler/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmx86info/Makefile.depend b/lib/clang/libllvmx86info/Makefile.depend
index b62bf66..511a4d1 100644
--- a/lib/clang/libllvmx86info/Makefile.depend
+++ b/lib/clang/libllvmx86info/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmx86instprinter/Makefile.depend b/lib/clang/libllvmx86instprinter/Makefile.depend
index 17a02b4..dfc7c0f 100644
--- a/lib/clang/libllvmx86instprinter/Makefile.depend
+++ b/lib/clang/libllvmx86instprinter/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/clang/libllvmx86utils/Makefile.depend b/lib/clang/libllvmx86utils/Makefile.depend
index 1cb182e..3e7f3f5 100644
--- a/lib/clang/libllvmx86utils/Makefile.depend
+++ b/lib/clang/libllvmx86utils/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/csu/amd64/Makefile.depend b/lib/csu/amd64/Makefile.depend
index 993ab06..79506ce 100644
--- a/lib/csu/amd64/Makefile.depend
+++ b/lib/csu/amd64/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/csu/arm/Makefile.depend b/lib/csu/arm/Makefile.depend
index ff699f7..e8d7c61 100644
--- a/lib/csu/arm/Makefile.depend
+++ b/lib/csu/arm/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/csu/i386/Makefile.depend b/lib/csu/i386/Makefile.depend
index 7d982eb..76d719e 100644
--- a/lib/csu/i386/Makefile.depend
+++ b/lib/csu/i386/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/csu/mips/Makefile.depend b/lib/csu/mips/Makefile.depend
index ff699f7..e8d7c61 100644
--- a/lib/csu/mips/Makefile.depend
+++ b/lib/csu/mips/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/csu/powerpc/Makefile.depend b/lib/csu/powerpc/Makefile.depend
index ff699f7..e8d7c61 100644
--- a/lib/csu/powerpc/Makefile.depend
+++ b/lib/csu/powerpc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/csu/powerpc64/Makefile.depend b/lib/csu/powerpc64/Makefile.depend
index ff699f7..e8d7c61 100644
--- a/lib/csu/powerpc64/Makefile.depend
+++ b/lib/csu/powerpc64/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/csu/sparc64/Makefile.depend b/lib/csu/sparc64/Makefile.depend
index ff699f7..e8d7c61 100644
--- a/lib/csu/sparc64/Makefile.depend
+++ b/lib/csu/sparc64/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libalias/libalias/Makefile.depend b/lib/libalias/libalias/Makefile.depend
index bd8ae02..69d1724 100644
--- a/lib/libalias/libalias/Makefile.depend
+++ b/lib/libalias/libalias/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libalias/modules/cuseeme/Makefile.depend b/lib/libalias/modules/cuseeme/Makefile.depend
index 96aa2a2..3646e2e 100644
--- a/lib/libalias/modules/cuseeme/Makefile.depend
+++ b/lib/libalias/modules/cuseeme/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libalias/modules/dummy/Makefile.depend b/lib/libalias/modules/dummy/Makefile.depend
index 96aa2a2..3646e2e 100644
--- a/lib/libalias/modules/dummy/Makefile.depend
+++ b/lib/libalias/modules/dummy/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libalias/modules/ftp/Makefile.depend b/lib/libalias/modules/ftp/Makefile.depend
index 96aa2a2..3646e2e 100644
--- a/lib/libalias/modules/ftp/Makefile.depend
+++ b/lib/libalias/modules/ftp/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libalias/modules/irc/Makefile.depend b/lib/libalias/modules/irc/Makefile.depend
index 96aa2a2..3646e2e 100644
--- a/lib/libalias/modules/irc/Makefile.depend
+++ b/lib/libalias/modules/irc/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libalias/modules/nbt/Makefile.depend b/lib/libalias/modules/nbt/Makefile.depend
index 96aa2a2..3646e2e 100644
--- a/lib/libalias/modules/nbt/Makefile.depend
+++ b/lib/libalias/modules/nbt/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libalias/modules/pptp/Makefile.depend b/lib/libalias/modules/pptp/Makefile.depend
index 96aa2a2..3646e2e 100644
--- a/lib/libalias/modules/pptp/Makefile.depend
+++ b/lib/libalias/modules/pptp/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libalias/modules/skinny/Makefile.depend b/lib/libalias/modules/skinny/Makefile.depend
index 96aa2a2..3646e2e 100644
--- a/lib/libalias/modules/skinny/Makefile.depend
+++ b/lib/libalias/modules/skinny/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libalias/modules/smedia/Makefile.depend b/lib/libalias/modules/smedia/Makefile.depend
index 96aa2a2..3646e2e 100644
--- a/lib/libalias/modules/smedia/Makefile.depend
+++ b/lib/libalias/modules/smedia/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
diff --git a/lib/libarchive/Makefile.depend b/lib/libarchive/Makefile.depend
index a4f9ef4..b254993 100644
--- a/lib/libarchive/Makefile.depend
+++ b/lib/libarchive/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libauditd/Makefile.depend b/lib/libauditd/Makefile.depend
index 593d407..dde2d60 100644
--- a/lib/libauditd/Makefile.depend
+++ b/lib/libauditd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libbegemot/Makefile.depend b/lib/libbegemot/Makefile.depend
index 8bbd7a2..9e2283a 100644
--- a/lib/libbegemot/Makefile.depend
+++ b/lib/libbegemot/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libblocksruntime/Makefile.depend b/lib/libblocksruntime/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libblocksruntime/Makefile.depend
+++ b/lib/libblocksruntime/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libbluetooth/Makefile.depend b/lib/libbluetooth/Makefile.depend
index 593d407..dde2d60 100644
--- a/lib/libbluetooth/Makefile.depend
+++ b/lib/libbluetooth/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libbsm/Makefile.depend b/lib/libbsm/Makefile.depend
index bd8ae02..69d1724 100644
--- a/lib/libbsm/Makefile.depend
+++ b/lib/libbsm/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libbsnmp/libbsnmp/Makefile.depend b/lib/libbsnmp/libbsnmp/Makefile.depend
index 004583e..5781764 100644
--- a/lib/libbsnmp/libbsnmp/Makefile.depend
+++ b/lib/libbsnmp/libbsnmp/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libbz2/Makefile.depend b/lib/libbz2/Makefile.depend
index 593d407..dde2d60 100644
--- a/lib/libbz2/Makefile.depend
+++ b/lib/libbz2/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libc++/Makefile.depend b/lib/libc++/Makefile.depend
index 12e148a..cb81639 100644
--- a/lib/libc++/Makefile.depend
+++ b/lib/libc++/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libc/Makefile.depend b/lib/libc/Makefile.depend
index 2058aff..9e7bf04 100644
--- a/lib/libc/Makefile.depend
+++ b/lib/libc/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
include \
include/rpc \
diff --git a/lib/libc/aarch64/gen/setjmp.S b/lib/libc/aarch64/gen/setjmp.S
index 80a9484..790ed73 100644
--- a/lib/libc/aarch64/gen/setjmp.S
+++ b/lib/libc/aarch64/gen/setjmp.S
@@ -80,7 +80,7 @@ ENTRY(longjmp)
str x1, [sp, #16]
/* Restore the signal mask */
- mov x1, #0 /* oset */
+ mov x2, #0 /* oset */
add x1, x0, #(_JB_SIGMASK * 8) /* set */
mov x0, #3 /* SIG_BLOCK */
bl sigprocmask
diff --git a/lib/libc/arm/SYS.h b/lib/libc/arm/SYS.h
index 3254c45..1173087 100644
--- a/lib/libc/arm/SYS.h
+++ b/lib/libc/arm/SYS.h
@@ -39,15 +39,11 @@
#include <sys/syscall.h>
#include <machine/swi.h>
-#ifdef __ARM_EABI__
#define SYSTRAP(x) \
mov ip, r7; \
ldr r7, =SYS_ ## x; \
swi 0; \
mov r7, ip
-#else
-#define SYSTRAP(x) swi 0 | SYS_ ## x
-#endif
#define CERROR _C_LABEL(cerror)
#define CURBRK _C_LABEL(curbrk)
diff --git a/lib/libc/arm/aeabi/aeabi_asm_double.S b/lib/libc/arm/aeabi/aeabi_asm_double.S
index ab44362..7a5af82 100644
--- a/lib/libc/arm/aeabi/aeabi_asm_double.S
+++ b/lib/libc/arm/aeabi/aeabi_asm_double.S
@@ -56,7 +56,7 @@ ENTRY(__aeabi_cdcmple)
cmp r0, #1
bne 1f
/* Yes, clear Z and C */
- msr cpsr_c, #(0)
+ mov ip, #(0)
b 99f
1:
@@ -70,14 +70,15 @@ ENTRY(__aeabi_cdcmple)
cmp r0, #1
bne 2f
/* Yes, set Z and C */
- msr cpsr_c, #(PCR_Z | PCR_C)
+ mov ip, #(PCR_Z | PCR_C)
b 99f
2:
/* Not less than or equal, set C and clear Z */
- msr cpsr_c, #(PCR_C)
+ mov ip, #(PCR_C)
99:
+ msr cpsr_c, ip
pop {r4, r5, r6, r7, ip, pc}
END(__aeabi_cdcmple)
@@ -112,6 +113,7 @@ ENTRY(__aeabi_cdcmpeq)
RET
1:
- msr cpsr_c, #(PCR_C)
+ mov ip, #(PCR_C)
+ msr cpsr_c, ip
RET
END(__aeabi_cdcmpeq)
diff --git a/lib/libc/arm/aeabi/aeabi_asm_float.S b/lib/libc/arm/aeabi/aeabi_asm_float.S
index bf32af7..e05daa5 100644
--- a/lib/libc/arm/aeabi/aeabi_asm_float.S
+++ b/lib/libc/arm/aeabi/aeabi_asm_float.S
@@ -54,7 +54,7 @@ ENTRY(__aeabi_cfcmple)
cmp r0, #1
bne 1f
/* Yes, clear Z and C */
- msr cpsr_c, #(0)
+ mov ip, #(0)
b 99f
1:
@@ -66,14 +66,15 @@ ENTRY(__aeabi_cfcmple)
cmp r0, #1
bne 2f
/* Yes, set Z and C */
- msr cpsr_c, #(PCR_Z | PCR_C)
+ mov ip, #(PCR_Z | PCR_C)
b 99f
2:
/* Not less than or equal, set C and clear Z */
- msr cpsr_c, #(PCR_C)
+ mov ip, #(PCR_C)
99:
+ msr cpsr_c, ip
pop {r4, r5, ip, pc}
END(__aeabi_cfcmple)
@@ -103,6 +104,7 @@ ENTRY(__aeabi_cfcmpeq)
RET
1:
- msreq cpsr_c, #(PCR_C)
+ mov ip, #(PCR_C)
+ msr cpsr_c, ip
RET
END(__aeabi_cfcmpeq)
diff --git a/lib/libc/arm/gen/_setjmp.S b/lib/libc/arm/gen/_setjmp.S
index 3de9d99..853f61c 100644
--- a/lib/libc/arm/gen/_setjmp.S
+++ b/lib/libc/arm/gen/_setjmp.S
@@ -36,7 +36,7 @@
#error FPA is not supported anymore
#endif
-#if defined(__ARM_EABI__) && !defined(_STANDALONE)
+#if !defined(_STANDALONE)
.fpu vfp
#endif
@@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$");
ENTRY(_setjmp)
ldr r1, .L_setjmp_magic
-#if defined(__ARM_EABI__) && !defined(_STANDALONE)
+#if !defined(_STANDALONE)
ldr r2, .Lfpu_present
#ifdef PIC
GOT_INIT(r3, .L_setjmp_got, .L_setjmp_gotinit)
@@ -79,7 +79,7 @@ ENTRY(_setjmp)
vmrs r2, fpscr
str r2, [r0, #(_JB_REG_FPSCR * 4)]
1:
-#endif /* __ARM_EABI__ */
+#endif /* !_STANDALONE */
str r1, [r0]
@@ -99,11 +99,11 @@ END(_setjmp)
.L_setjmp_magic:
.word _JB_MAGIC__SETJMP
-#if defined(__ARM_EABI__) && !defined(_STANDALONE)
+#if !defined(_STANDALONE)
GOT_INITSYM(.L_setjmp_got, .L_setjmp_gotinit)
.Lfpu_present:
.word PIC_SYM(_libc_arm_fpu_present, GOTOFF)
-#endif /* __ARM_EABI__ */
+#endif /* !_STANDALONE */
WEAK_ALIAS(___longjmp, _longjmp)
ENTRY(_longjmp)
@@ -114,7 +114,7 @@ ENTRY(_longjmp)
teq ip, r3 /* magic correct? */
bne botch /* no, botch */
-#if defined(__ARM_EABI__) && !defined(_STANDALONE)
+#if !defined(_STANDALONE)
teq r3, r2 /* did magic change? */
beq 1f /* no, don't restore VFP */
add ip, r0, #(_JB_REG_D8 * 4)
@@ -122,7 +122,7 @@ ENTRY(_longjmp)
ldr ip, [r0, #(_JB_REG_FPSCR * 4)]
vmsr fpscr, ip
1:
-#endif /* __ARM_EABI__ */
+#endif /* !_STANDALONE */
add r0, r0, #(_JB_REG_R4 * 4)
/* Restore integer registers */
diff --git a/lib/libc/arm/gen/setjmp.S b/lib/libc/arm/gen/setjmp.S
index 6269563..c9ae329 100644
--- a/lib/libc/arm/gen/setjmp.S
+++ b/lib/libc/arm/gen/setjmp.S
@@ -36,9 +36,7 @@
#error FPA is not supported anymore
#endif
-#ifdef __ARM_EABI__
.fpu vfp
-#endif
#include <machine/asm.h>
#include <machine/setjmp.h>
@@ -66,7 +64,6 @@ ENTRY(setjmp)
ldr r1, .Lsetjmp_magic
-#ifdef __ARM_EABI__
ldr r2, .Lfpu_present
#ifdef PIC
GOT_INIT(r3, .Lsetjmp_got, .Lsetjmp_gotinit)
@@ -84,7 +81,6 @@ ENTRY(setjmp)
vmrs r2, fpscr
str r2, [r0, #(_JB_REG_FPSCR * 4)]
1:
-#endif /* __ARM_EABI__ */
str r1, [r0] /* store magic */
@@ -102,11 +98,9 @@ ENTRY(setjmp)
.Lsetjmp_magic:
.word _JB_MAGIC_SETJMP
-#ifdef __ARM_EABI__
GOT_INITSYM(.Lsetjmp_got, .Lsetjmp_gotinit)
.Lfpu_present:
.word PIC_SYM(_libc_arm_fpu_present, GOTOFF)
-#endif /* __ARM_EABI__ */
END(setjmp)
.weak _C_LABEL(longjmp)
@@ -126,7 +120,6 @@ ENTRY(__longjmp)
bl PIC_SYM(_C_LABEL(sigprocmask), PLT)
ldmfd sp!, {r0-r2, r14}
-#ifdef __ARM_EABI__
tst r2, #(_JB_MAGIC_SETJMP ^ _JB_MAGIC_SETJMP_VFP)
/* is this a VFP magic? */
beq 1f /* no, don't restore VFP */
@@ -135,7 +128,6 @@ ENTRY(__longjmp)
ldr ip, [r0, #(_JB_REG_FPSCR * 4)]
vmsr fpscr, ip
1:
-#endif /* __ARM_EABI__ */
add r0, r0, #(_JB_REG_R4 * 4)
/* Restore integer registers */
diff --git a/lib/libc/arm/string/ffs.S b/lib/libc/arm/string/ffs.S
index 4567f6c..cc7f396 100644
--- a/lib/libc/arm/string/ffs.S
+++ b/lib/libc/arm/string/ffs.S
@@ -78,6 +78,7 @@ ENTRY(ffs)
.byte 31, 0, 0, 0, 0, 24, 0, 20 /* 48-55 */
.byte 30, 0, 23, 19, 29, 18, 17, 0 /* 56-63 */
#else
+ itt ne
clzne r0, r0
rsbne r0, r0, #32
RET
diff --git a/lib/libc/arm/string/memmove.S b/lib/libc/arm/string/memmove.S
index 94e5474..2cd5a5e 100644
--- a/lib/libc/arm/string/memmove.S
+++ b/lib/libc/arm/string/memmove.S
@@ -48,7 +48,9 @@ ENTRY(bcopy)
#endif
/* Do the buffers overlap? */
cmp r0, r1
+ it eq
RETeq /* Bail now if src/dst are the same */
+ ite cc
subcc r3, r0, r1 /* if (dst > src) r3 = dst - src */
subcs r3, r1, r0 /* if (src > dsr) r3 = src - dst */
cmp r3, r2 /* if (r3 < len) we have an overlap */
@@ -56,8 +58,10 @@ ENTRY(bcopy)
/* Determine copy direction */
cmp r1, r0
+ it cc
bcc .Lmemmove_backwards
+ itt eq
moveq r0, #0 /* Quick abort for len=0 */
RETeq
@@ -88,6 +92,7 @@ ENTRY(bcopy)
bge .Lmemmove_floop32
cmn r2, #0x10
+ ittt ge
ldmiage r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */
stmiage r0!, {r3, r4, r12, lr}
subge r2, r2, #0x10
@@ -98,6 +103,7 @@ ENTRY(bcopy)
/* blat 12 bytes at a time */
.Lmemmove_floop12:
+ ittt ge
ldmiage r1!, {r3, r12, lr}
stmiage r0!, {r3, r12, lr}
subsge r2, r2, #0x0c
@@ -108,8 +114,10 @@ ENTRY(bcopy)
blt .Lmemmove_fl4
subs r2, r2, #4
+ itt lt
ldrlt r3, [r1], #4
strlt r3, [r0], #4
+ ittt ge
ldmiage r1!, {r3, r12}
stmiage r0!, {r3, r12}
subge r2, r2, #4
@@ -117,14 +125,17 @@ ENTRY(bcopy)
.Lmemmove_fl4:
/* less than 4 bytes to go */
adds r2, r2, #4
+ it eq
ldmiaeq sp!, {r0, pc} /* done */
/* copy the crud byte at a time */
cmp r2, #2
ldrb r3, [r1], #1
strb r3, [r0], #1
+ itt ge
ldrbge r3, [r1], #1
strbge r3, [r0], #1
+ itt gt
ldrbgt r3, [r1], #1
strbgt r3, [r0], #1
ldmia sp!, {r0, pc}
@@ -137,8 +148,10 @@ ENTRY(bcopy)
/* align destination with byte copies */
ldrb r3, [r1], #1
strb r3, [r0], #1
+ itt ge
ldrbge r3, [r1], #1
strbge r3, [r0], #1
+ itt gt
ldrbgt r3, [r1], #1
strbgt r3, [r0], #1
subs r2, r2, r12
@@ -355,10 +368,12 @@ ENTRY(bcopy)
.Lmemmove_bl32:
cmn r2, #0x10
+ ittt ge
ldmdbge r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */
stmdbge r0!, {r3, r4, r12, lr}
subge r2, r2, #0x10
adds r2, r2, #0x14
+ ittt ge
ldmdbge r1!, {r3, r12, lr} /* blat a remaining 12 bytes */
stmdbge r0!, {r3, r12, lr}
subge r2, r2, #0x0c
@@ -368,8 +383,10 @@ ENTRY(bcopy)
adds r2, r2, #8
blt .Lmemmove_bl4
subs r2, r2, #4
+ itt lt
ldrlt r3, [r1, #-4]!
strlt r3, [r0, #-4]!
+ ittt ge
ldmdbge r1!, {r3, r12}
stmdbge r0!, {r3, r12}
subge r2, r2, #4
@@ -377,14 +394,17 @@ ENTRY(bcopy)
.Lmemmove_bl4:
/* less than 4 bytes to go */
adds r2, r2, #4
+ it eq
RETeq /* done */
/* copy the crud byte at a time */
cmp r2, #2
ldrb r3, [r1, #-1]!
strb r3, [r0, #-1]!
+ itt ge
ldrbge r3, [r1, #-1]!
strbge r3, [r0, #-1]!
+ itt gt
ldrbgt r3, [r1, #-1]!
strbgt r3, [r0, #-1]!
RET
@@ -396,8 +416,10 @@ ENTRY(bcopy)
/* align destination with byte copies */
ldrb r3, [r1, #-1]!
strb r3, [r0, #-1]!
+ itt ge
ldrbge r3, [r1, #-1]!
strbge r3, [r0, #-1]!
+ itt gt
ldrbgt r3, [r1, #-1]!
strbgt r3, [r0, #-1]!
subs r2, r2, r12
diff --git a/lib/libc/arm/string/memset.S b/lib/libc/arm/string/memset.S
index 66af33e..6d76901 100644
--- a/lib/libc/arm/string/memset.S
+++ b/lib/libc/arm/string/memset.S
@@ -114,6 +114,7 @@ ENTRY(memset)
orr r3, r3, r3, lsl #16 /* Extend value to 32-bits */
#endif
#ifdef _ARM_ARCH_5E
+ itt ne
subne r1, r1, #0x04 /* Quad-align if necessary */
strne r3, [ip], #0x04
cmp r1, #0x10
@@ -127,18 +128,22 @@ ENTRY(memset)
.Lmemset_loop128:
subs r1, r1, #0x80
#ifdef _ARM_ARCH_5E
+ itttt ge
strdge r2, [ip], #0x08
strdge r2, [ip], #0x08
strdge r2, [ip], #0x08
strdge r2, [ip], #0x08
+ itttt ge
strdge r2, [ip], #0x08
strdge r2, [ip], #0x08
strdge r2, [ip], #0x08
strdge r2, [ip], #0x08
+ itttt ge
strdge r2, [ip], #0x08
strdge r2, [ip], #0x08
strdge r2, [ip], #0x08
strdge r2, [ip], #0x08
+ itttt ge
strdge r2, [ip], #0x08
strdge r2, [ip], #0x08
strdge r2, [ip], #0x08
@@ -162,6 +167,7 @@ ENTRY(memset)
stmiage ip!, {r2-r3}
#endif
bgt .Lmemset_loop128
+ it eq
RETeq /* Zero length so just exit */
add r1, r1, #0x80 /* Adjust for extra sub */
@@ -169,6 +175,7 @@ ENTRY(memset)
/* Do 32 bytes at a time */
.Lmemset_loop32:
subs r1, r1, #0x20
+ itttt ge
#ifdef _ARM_ARCH_5E
strdge r2, [ip], #0x08
strdge r2, [ip], #0x08
@@ -181,11 +188,13 @@ ENTRY(memset)
stmiage ip!, {r2-r3}
#endif
bgt .Lmemset_loop32
+ it eq
RETeq /* Zero length so just exit */
adds r1, r1, #0x10 /* Partially adjust for extra sub */
/* Deal with 16 bytes or more */
+ itt ge
#ifdef _ARM_ARCH_5E
strdge r2, [ip], #0x08
strdge r2, [ip], #0x08
@@ -193,20 +202,25 @@ ENTRY(memset)
stmiage ip!, {r2-r3}
stmiage ip!, {r2-r3}
#endif
+ it eq
RETeq /* Zero length so just exit */
+ it lt
addlt r1, r1, #0x10 /* Possibly adjust for extra sub */
/* We have at least 4 bytes so copy as words */
.Lmemset_loop4:
subs r1, r1, #0x04
+ it ge
strge r3, [ip], #0x04
bgt .Lmemset_loop4
+ it eq
RETeq /* Zero length so just exit */
#ifdef _ARM_ARCH_5E
/* Compensate for 64-bit alignment check */
adds r1, r1, #0x04
+ it eq
RETeq
cmp r1, #2
#else
@@ -214,7 +228,9 @@ ENTRY(memset)
#endif
strb r3, [ip], #0x01 /* Set 1 byte */
+ it ge
strbge r3, [ip], #0x01 /* Set another byte */
+ it gt
strbgt r3, [ip] /* and a third */
RET /* Exit */
@@ -222,18 +238,24 @@ ENTRY(memset)
rsb r2, r2, #0x004
strb r3, [ip], #0x01 /* Set 1 byte */
cmp r2, #0x02
+ it ge
strbge r3, [ip], #0x01 /* Set another byte */
sub r1, r1, r2
+ it gt
strbgt r3, [ip], #0x01 /* and a third */
cmp r1, #0x04 /* More than 4 bytes left? */
+ it ge
bge .Lmemset_wordaligned /* Yup */
.Lmemset_lessthanfour:
cmp r1, #0x00
+ it eq
RETeq /* Zero length so exit */
strb r3, [ip], #0x01 /* Set 1 byte */
cmp r1, #0x02
+ it ge
strbge r3, [ip], #0x01 /* Set another byte */
+ it gt
strbgt r3, [ip] /* and a third */
RET /* Exit */
#ifdef _BZERO
diff --git a/lib/libc/arm/string/strcmp.S b/lib/libc/arm/string/strcmp.S
index 3dd7453..d610fea 100644
--- a/lib/libc/arm/string/strcmp.S
+++ b/lib/libc/arm/string/strcmp.S
@@ -37,6 +37,7 @@ ENTRY(strcmp)
ldrb r2, [r0], #1
ldrb r3, [r1], #1
cmp r2, #1
+ it cs
cmpcs r2, r3
beq 1b
sub r0, r2, r3
diff --git a/lib/libc/arm/string/strlen.S b/lib/libc/arm/string/strlen.S
index 7447710..c9334f9 100644
--- a/lib/libc/arm/string/strlen.S
+++ b/lib/libc/arm/string/strlen.S
@@ -52,8 +52,10 @@ ENTRY(strlen)
#else
ands r3, r2, #0xff000000
#endif
+ it ne
addne r1, r1, #1
.Ldo_3:
+ itt ne
#ifndef __ARMEB__
andsne r3, r2, #0x0000ff00
#else
@@ -61,6 +63,7 @@ ENTRY(strlen)
#endif
addne r1, r1, #1
.Ldo_2:
+ itt ne
#ifndef __ARMEB__
andsne r3, r2, #0x00ff0000
#else
@@ -68,6 +71,7 @@ ENTRY(strlen)
#endif
addne r1, r1, #1
.Ldo_1:
+ ittt ne
#ifndef __ARMEB__
andsne r3, r2, #0xff000000
#else
diff --git a/lib/libc/arm/string/strncmp.S b/lib/libc/arm/string/strncmp.S
index ac59deb..a5c0320 100644
--- a/lib/libc/arm/string/strncmp.S
+++ b/lib/libc/arm/string/strncmp.S
@@ -35,18 +35,21 @@ __FBSDID("$FreeBSD$");
ENTRY(strncmp)
/* if (len == 0) return 0 */
cmp r2, #0
+ itt eq
moveq r0, #0
moveq pc, lr
/* ip == last src address to compare */
adds ip, r0, r2
/* Use last possible address on overflow. */
+ it cs
movcs ip, #0
sub ip, ip, #1
1:
ldrb r2, [r0], #1
ldrb r3, [r1], #1
cmp ip, r0
+ itt cs
cmpcs r2, #1
cmpcs r2, r3
beq 1b
diff --git a/lib/libc/arm/sys/fork.S b/lib/libc/arm/sys/fork.S
deleted file mode 100644
index a5ae1f0..0000000
--- a/lib/libc/arm/sys/fork.S
+++ /dev/null
@@ -1,49 +0,0 @@
-/* $NetBSD: fork.S,v 1.5 2003/08/07 16:42:04 agc Exp $ */
-
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)fork.s 5.1 (Berkeley) 4/23/90
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-#include "SYS.h"
-
-/*
- * pid = fork();
- *
- * On return from the SWI:
- * r1 == 0 in parent process, r1 == 1 in child process.
- * r0 == pid of child in parent, r0 == pid of parent in child.
- */
-
-_SYSCALL(fork)
- sub r1, r1, #1 /* r1 == 0xffffffff if parent, 0 if child */
- and r0, r0, r1 /* r0 == 0 if child, else unchanged */
- RET
diff --git a/lib/libc/gen/fpclassify.c b/lib/libc/gen/fpclassify.c
index 754a1df..444b551 100644
--- a/lib/libc/gen/fpclassify.c
+++ b/lib/libc/gen/fpclassify.c
@@ -29,6 +29,8 @@
#include <sys/endian.h>
+#include <machine/float.h>
+
#include <math.h>
#include <stdint.h>
@@ -84,10 +86,18 @@ __fpclassifyl(long double e)
return (FP_SUBNORMAL);
}
mask_nbit_l(u); /* Mask normalization bit if applicable. */
+#if LDBL_MANT_DIG == 53
+ if (u.bits.exp == 2047) {
+ if ((u.bits.manl | u.bits.manh) == 0)
+ return (FP_INFINITE);
+ return (FP_NAN);
+ }
+#else
if (u.bits.exp == 32767) {
if ((u.bits.manl | u.bits.manh) == 0)
return (FP_INFINITE);
return (FP_NAN);
}
+#endif
return (FP_NORMAL);
}
diff --git a/lib/libc/gen/isinf.c b/lib/libc/gen/isinf.c
index 4a4152a..0eb8b9f 100644
--- a/lib/libc/gen/isinf.c
+++ b/lib/libc/gen/isinf.c
@@ -26,6 +26,8 @@
* $FreeBSD$
*/
+#include <machine/float.h>
+
#include <math.h>
#include "fpmath.h"
@@ -62,9 +64,9 @@ __isinfl(long double e)
u.e = e;
mask_nbit_l(u);
-#ifndef __alpha__
- return (u.bits.exp == 32767 && u.bits.manl == 0 && u.bits.manh == 0);
-#else
+#if LDBL_MANT_DIG == 53
return (u.bits.exp == 2047 && u.bits.manl == 0 && u.bits.manh == 0);
+#else
+ return (u.bits.exp == 32767 && u.bits.manl == 0 && u.bits.manh == 0);
#endif
}
diff --git a/lib/libc/mips/sys/Makefile.inc b/lib/libc/mips/sys/Makefile.inc
index 460e69b..c0bd5ad9 100644
--- a/lib/libc/mips/sys/Makefile.inc
+++ b/lib/libc/mips/sys/Makefile.inc
@@ -3,7 +3,7 @@
SRCS+= trivial-vdso_tc.c
MDASM= Ovfork.S brk.S cerror.S exect.S \
- fork.S pipe.S ptrace.S sbrk.S syscall.S
+ pipe.S ptrace.S sbrk.S syscall.S
# Don't generate default code for these syscalls:
NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o
diff --git a/lib/libc/mips/sys/fork.S b/lib/libc/mips/sys/fork.S
deleted file mode 100644
index 7636bd3..0000000
--- a/lib/libc/mips/sys/fork.S
+++ /dev/null
@@ -1,57 +0,0 @@
-/* $NetBSD: fork.S,v 1.11 2003/08/07 16:42:17 agc Exp $ */
-
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-#include "SYS.h"
-
-#if defined(LIBC_SCCS) && !defined(lint)
- ASMSTR("from: @(#)fork.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$NetBSD: fork.S,v 1.11 2003/08/07 16:42:17 agc Exp $")
-#endif /* LIBC_SCCS and not lint */
-
-LEAF(__sys_fork)
- WEAK_ALIAS(fork, __sys_fork)
- WEAK_ALIAS(_fork, __sys_fork)
- PIC_PROLOGUE(__sys_fork)
- li v0, SYS_fork # pid = fork()
- syscall
- bne a3, zero, 2f
- beq v1, zero, 1f # v1 == 0 in parent, 1 in child
- move v0, zero
-1:
- PIC_RETURN()
-2:
- PIC_TAILCALL(__cerror)
-END(__sys_fork)
diff --git a/lib/libc/resolv/res_comp.c b/lib/libc/resolv/res_comp.c
index 539d974..279ea23 100644
--- a/lib/libc/resolv/res_comp.c
+++ b/lib/libc/resolv/res_comp.c
@@ -147,12 +147,12 @@ dn_skipname(const u_char *ptr, const u_char *eom) {
|| ((c) >= 0x61 && (c) <= 0x7a))
#define digitchar(c) ((c) >= 0x30 && (c) <= 0x39)
-#define borderchar(c) (alphachar(c) || digitchar(c))
#ifdef RES_ENFORCE_RFC1034
-#define middlechar(c) (borderchar(c) || hyphenchar(c))
+#define borderchar(c) (alphachar(c) || digitchar(c))
#else
-#define middlechar(c) (borderchar(c) || hyphenchar(c) || underscorechar(c))
+#define borderchar(c) (alphachar(c) || digitchar(c) || underscorechar(c))
#endif
+#define middlechar(c) (borderchar(c) || hyphenchar(c))
#define domainchar(c) ((c) > 0x20 && (c) < 0x7f)
int
diff --git a/lib/libc/string/memmem.3 b/lib/libc/string/memmem.3
index 31cdf77..a0db94f 100644
--- a/lib/libc/string/memmem.3
+++ b/lib/libc/string/memmem.3
@@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd August 24, 2005
+.Dd May 26, 2015
.Dt MEMMEM 3
.Os
.Sh NAME
@@ -51,14 +51,12 @@ in the byte string
.Fa big .
.Sh RETURN VALUES
If
-.Fa big_len
-is smaller than
-.Fa little_len ,
-if
.Fa little_len
-is 0, if
-.Fa big_len
-is 0 or if
+is zero
+.Fa big
+is returned (that is, an empty little is deemed to match at the beginning of
+big);
+if
.Fa little
occurs nowhere in
.Fa big ,
@@ -84,3 +82,11 @@ function first appeared in
.Sh BUGS
This function was broken in Linux libc up to and including version 5.0.9
and in GNU libc prior to version 2.1.
+Prior to
+.Fx 11.0
+.Nm
+returned
+.Dv NULL
+when
+.Fa little_len
+equals 0.
diff --git a/lib/libc/string/memmem.c b/lib/libc/string/memmem.c
index 72e6517..3fd05df 100644
--- a/lib/libc/string/memmem.c
+++ b/lib/libc/string/memmem.c
@@ -42,9 +42,9 @@ memmem(const void *l, size_t l_len, const void *s, size_t s_len)
const char *cl = (const char *)l;
const char *cs = (const char *)s;
- /* we need something to compare */
- if (l_len == 0 || s_len == 0)
- return NULL;
+ /* empty "s" matches the beginning of "l" */
+ if (s_len == 0)
+ return (void *)cl;
/* "s" must be smaller or equal to "l" */
if (l_len < s_len)
diff --git a/lib/libc/string/strchr.3 b/lib/libc/string/strchr.3
index 6117831..a39ea3e 100644
--- a/lib/libc/string/strchr.3
+++ b/lib/libc/string/strchr.3
@@ -113,10 +113,12 @@ and
.Fn strrchr
conform to
.St -isoC .
-The
+The function
.Fn strchrnul
-is a GNU extension .
-.Sh History
+is a
+.Tn GNU
+extension.
+.Sh HISTORY
The
.Fn strchrnul
function first appeared in glibc 2.1.1 and was added in
diff --git a/lib/libc/xdr/xdr.c b/lib/libc/xdr/xdr.c
index 4435119..4138171 100644
--- a/lib/libc/xdr/xdr.c
+++ b/lib/libc/xdr/xdr.c
@@ -76,9 +76,7 @@ static const char xdr_zero[BYTES_PER_XDR_UNIT] = { 0, 0, 0, 0 };
* Not a filter, but a convenient utility nonetheless
*/
void
-xdr_free(proc, objp)
- xdrproc_t proc;
- void *objp;
+xdr_free(xdrproc_t proc, void *objp)
{
XDR x;
@@ -101,9 +99,7 @@ xdr_void(void)
* XDR integers
*/
bool_t
-xdr_int(xdrs, ip)
- XDR *xdrs;
- int *ip;
+xdr_int(XDR *xdrs, int *ip)
{
long l;
@@ -131,9 +127,7 @@ xdr_int(xdrs, ip)
* XDR unsigned integers
*/
bool_t
-xdr_u_int(xdrs, up)
- XDR *xdrs;
- u_int *up;
+xdr_u_int(XDR *xdrs, u_int *up)
{
u_long l;
@@ -163,9 +157,7 @@ xdr_u_int(xdrs, up)
* same as xdr_u_long - open coded to save a proc call!
*/
bool_t
-xdr_long(xdrs, lp)
- XDR *xdrs;
- long *lp;
+xdr_long(XDR *xdrs, long *lp)
{
switch (xdrs->x_op) {
case XDR_ENCODE:
@@ -184,9 +176,7 @@ xdr_long(xdrs, lp)
* same as xdr_long - open coded to save a proc call!
*/
bool_t
-xdr_u_long(xdrs, ulp)
- XDR *xdrs;
- u_long *ulp;
+xdr_u_long(XDR *xdrs, u_long *ulp)
{
switch (xdrs->x_op) {
case XDR_ENCODE:
@@ -206,9 +196,7 @@ xdr_u_long(xdrs, ulp)
* same as xdr_u_int32_t - open coded to save a proc call!
*/
bool_t
-xdr_int32_t(xdrs, int32_p)
- XDR *xdrs;
- int32_t *int32_p;
+xdr_int32_t(XDR *xdrs, int32_t *int32_p)
{
long l;
@@ -237,9 +225,7 @@ xdr_int32_t(xdrs, int32_p)
* same as xdr_int32_t - open coded to save a proc call!
*/
bool_t
-xdr_u_int32_t(xdrs, u_int32_p)
- XDR *xdrs;
- u_int32_t *u_int32_p;
+xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
{
u_long l;
@@ -268,9 +254,7 @@ xdr_u_int32_t(xdrs, u_int32_p)
* same as xdr_int32_t - open coded to save a proc call!
*/
bool_t
-xdr_uint32_t(xdrs, u_int32_p)
- XDR *xdrs;
- uint32_t *u_int32_p;
+xdr_uint32_t(XDR *xdrs, uint32_t *u_int32_p)
{
u_long l;
@@ -298,9 +282,7 @@ xdr_uint32_t(xdrs, u_int32_p)
* XDR short integers
*/
bool_t
-xdr_short(xdrs, sp)
- XDR *xdrs;
- short *sp;
+xdr_short(XDR *xdrs, short *sp)
{
long l;
@@ -328,9 +310,7 @@ xdr_short(xdrs, sp)
* XDR unsigned short integers
*/
bool_t
-xdr_u_short(xdrs, usp)
- XDR *xdrs;
- u_short *usp;
+xdr_u_short(XDR *xdrs, u_short *usp)
{
u_long l;
@@ -359,9 +339,7 @@ xdr_u_short(xdrs, usp)
* XDR 16-bit integers
*/
bool_t
-xdr_int16_t(xdrs, int16_p)
- XDR *xdrs;
- int16_t *int16_p;
+xdr_int16_t(XDR *xdrs, int16_t *int16_p)
{
long l;
@@ -389,9 +367,7 @@ xdr_int16_t(xdrs, int16_p)
* XDR unsigned 16-bit integers
*/
bool_t
-xdr_u_int16_t(xdrs, u_int16_p)
- XDR *xdrs;
- u_int16_t *u_int16_p;
+xdr_u_int16_t(XDR *xdrs, u_int16_t *u_int16_p)
{
u_long l;
@@ -419,9 +395,7 @@ xdr_u_int16_t(xdrs, u_int16_p)
* XDR unsigned 16-bit integers
*/
bool_t
-xdr_uint16_t(xdrs, u_int16_p)
- XDR *xdrs;
- uint16_t *u_int16_p;
+xdr_uint16_t(XDR *xdrs, uint16_t *u_int16_p)
{
u_long l;
@@ -450,9 +424,7 @@ xdr_uint16_t(xdrs, u_int16_p)
* XDR a char
*/
bool_t
-xdr_char(xdrs, cp)
- XDR *xdrs;
- char *cp;
+xdr_char(XDR *xdrs, char *cp)
{
int i;
@@ -468,9 +440,7 @@ xdr_char(xdrs, cp)
* XDR an unsigned char
*/
bool_t
-xdr_u_char(xdrs, cp)
- XDR *xdrs;
- u_char *cp;
+xdr_u_char(XDR *xdrs, u_char *cp)
{
u_int u;
@@ -486,9 +456,7 @@ xdr_u_char(xdrs, cp)
* XDR booleans
*/
bool_t
-xdr_bool(xdrs, bp)
- XDR *xdrs;
- bool_t *bp;
+xdr_bool(XDR *xdrs, bool_t *bp)
{
long lb;
@@ -516,9 +484,7 @@ xdr_bool(xdrs, bp)
* XDR enumerations
*/
bool_t
-xdr_enum(xdrs, ep)
- XDR *xdrs;
- enum_t *ep;
+xdr_enum(XDR *xdrs, enum_t *ep)
{
enum sizecheck { SIZEVAL }; /* used to find the size of an enum */
@@ -542,10 +508,7 @@ xdr_enum(xdrs, ep)
* cp points to the opaque object and cnt gives the byte length.
*/
bool_t
-xdr_opaque(xdrs, cp, cnt)
- XDR *xdrs;
- caddr_t cp;
- u_int cnt;
+xdr_opaque(XDR *xdrs, caddr_t cp, u_int cnt)
{
u_int rndup;
static int crud[BYTES_PER_XDR_UNIT];
@@ -594,11 +557,7 @@ xdr_opaque(xdrs, cp, cnt)
* If *cpp is NULL maxsize bytes are allocated
*/
bool_t
-xdr_bytes(xdrs, cpp, sizep, maxsize)
- XDR *xdrs;
- char **cpp;
- u_int *sizep;
- u_int maxsize;
+xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
{
char *sp = *cpp; /* sp is the actual string pointer */
u_int nodesize;
@@ -650,9 +609,7 @@ xdr_bytes(xdrs, cpp, sizep, maxsize)
* Implemented here due to commonality of the object.
*/
bool_t
-xdr_netobj(xdrs, np)
- XDR *xdrs;
- struct netobj *np;
+xdr_netobj(XDR *xdrs, struct netobj *np)
{
return (xdr_bytes(xdrs, &np->n_bytes, &np->n_len, MAX_NETOBJ_SZ));
@@ -670,12 +627,14 @@ xdr_netobj(xdrs, np)
* If there is no specific or default routine an error is returned.
*/
bool_t
-xdr_union(xdrs, dscmp, unp, choices, dfault)
- XDR *xdrs;
- enum_t *dscmp; /* enum to decide which arm to work on */
- char *unp; /* the union itself */
- const struct xdr_discrim *choices; /* [value, xdr proc] for each arm */
- xdrproc_t dfault; /* default xdr routine */
+xdr_union(XDR *xdrs, enum_t *dscmp, char *unp, const struct xdr_discrim *choices, xdrproc_t dfault)
+/*
+ * XDR *xdrs;
+ * enum_t *dscmp; // enum to decide which arm to work on
+ * char *unp; // the union itself
+ * const struct xdr_discrim *choices; // [value, xdr proc] for each arm
+ * xdrproc_t dfault; // default xdr routine
+ */
{
enum_t dscm;
@@ -719,10 +678,7 @@ xdr_union(xdrs, dscmp, unp, choices, dfault)
* of the string as specified by a protocol.
*/
bool_t
-xdr_string(xdrs, cpp, maxsize)
- XDR *xdrs;
- char **cpp;
- u_int maxsize;
+xdr_string(XDR *xdrs, char **cpp, u_int maxsize)
{
char *sp = *cpp; /* sp is the actual string pointer */
u_int size;
@@ -786,9 +742,7 @@ xdr_string(xdrs, cpp, maxsize)
* routines like clnt_call
*/
bool_t
-xdr_wrapstring(xdrs, cpp)
- XDR *xdrs;
- char **cpp;
+xdr_wrapstring(XDR *xdrs, char **cpp)
{
return xdr_string(xdrs, cpp, LASTUNSIGNED);
}
@@ -805,9 +759,7 @@ xdr_wrapstring(xdrs, cpp)
* XDR 64-bit integers
*/
bool_t
-xdr_int64_t(xdrs, llp)
- XDR *xdrs;
- int64_t *llp;
+xdr_int64_t(XDR *xdrs, int64_t *llp)
{
u_long ul[2];
@@ -838,9 +790,7 @@ xdr_int64_t(xdrs, llp)
* XDR unsigned 64-bit integers
*/
bool_t
-xdr_u_int64_t(xdrs, ullp)
- XDR *xdrs;
- u_int64_t *ullp;
+xdr_u_int64_t(XDR *xdrs, u_int64_t *ullp)
{
u_long ul[2];
@@ -870,9 +820,7 @@ xdr_u_int64_t(xdrs, ullp)
* XDR unsigned 64-bit integers
*/
bool_t
-xdr_uint64_t(xdrs, ullp)
- XDR *xdrs;
- uint64_t *ullp;
+xdr_uint64_t(XDR *xdrs, uint64_t *ullp)
{
u_long ul[2];
@@ -903,9 +851,7 @@ xdr_uint64_t(xdrs, ullp)
* XDR hypers
*/
bool_t
-xdr_hyper(xdrs, llp)
- XDR *xdrs;
- longlong_t *llp;
+xdr_hyper(XDR *xdrs, longlong_t *llp)
{
/*
@@ -920,9 +866,7 @@ xdr_hyper(xdrs, llp)
* XDR unsigned hypers
*/
bool_t
-xdr_u_hyper(xdrs, ullp)
- XDR *xdrs;
- u_longlong_t *ullp;
+xdr_u_hyper(XDR *xdrs, u_longlong_t *ullp)
{
/*
@@ -937,9 +881,7 @@ xdr_u_hyper(xdrs, ullp)
* XDR longlong_t's
*/
bool_t
-xdr_longlong_t(xdrs, llp)
- XDR *xdrs;
- longlong_t *llp;
+xdr_longlong_t(XDR *xdrs, longlong_t *llp)
{
/*
@@ -954,9 +896,7 @@ xdr_longlong_t(xdrs, llp)
* XDR u_longlong_t's
*/
bool_t
-xdr_u_longlong_t(xdrs, ullp)
- XDR *xdrs;
- u_longlong_t *ullp;
+xdr_u_longlong_t(XDR *xdrs, u_longlong_t *ullp)
{
/*
diff --git a/lib/libc/xdr/xdr_array.c b/lib/libc/xdr/xdr_array.c
index 620155c..a11c7a1 100644
--- a/lib/libc/xdr/xdr_array.c
+++ b/lib/libc/xdr/xdr_array.c
@@ -64,13 +64,15 @@ __FBSDID("$FreeBSD$");
* xdr procedure to call to handle each element of the array.
*/
bool_t
-xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc)
- XDR *xdrs;
- caddr_t *addrp; /* array pointer */
- u_int *sizep; /* number of elements */
- u_int maxsize; /* max numberof elements */
- u_int elsize; /* size in bytes of each element */
- xdrproc_t elproc; /* xdr routine to handle each element */
+xdr_array(XDR *xdrs, caddr_t *addrp, u_int *sizep, u_int maxsize, u_int elsize, xdrproc_t elproc)
+/*
+ * XDR *xdrs;
+ * caddr_t *addrp; // array pointer
+ * u_int *sizep; // number of elements
+ * u_int maxsize; // max numberof elements
+ * u_int elsize; // size in bytes of each element
+ * xdrproc_t elproc; // xdr routine to handle each element
+ */
{
u_int i;
caddr_t target = *addrp;
@@ -142,12 +144,7 @@ xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc)
* > xdr_elem: routine to XDR each element
*/
bool_t
-xdr_vector(xdrs, basep, nelem, elemsize, xdr_elem)
- XDR *xdrs;
- char *basep;
- u_int nelem;
- u_int elemsize;
- xdrproc_t xdr_elem;
+xdr_vector(XDR *xdrs, char *basep, u_int nelem, u_int elemsize, xdrproc_t xdr_elem)
{
u_int i;
char *elptr;
diff --git a/lib/libc/xdr/xdr_float.c b/lib/libc/xdr/xdr_float.c
index 1d3bb61..fc024fc 100644
--- a/lib/libc/xdr/xdr_float.c
+++ b/lib/libc/xdr/xdr_float.c
@@ -204,9 +204,7 @@ static struct dbl_limits {
bool_t
-xdr_double(xdrs, dp)
- XDR *xdrs;
- double *dp;
+xdr_double(XDR *xdrs, double *dp)
{
#ifdef IEEEFP
int32_t *i32p;
diff --git a/lib/libc/xdr/xdr_mem.c b/lib/libc/xdr/xdr_mem.c
index 70f79c6..0455a5a 100644
--- a/lib/libc/xdr/xdr_mem.c
+++ b/lib/libc/xdr/xdr_mem.c
@@ -98,11 +98,7 @@ static const struct xdr_ops xdrmem_ops_unaligned = {
* memory buffer.
*/
void
-xdrmem_create(xdrs, addr, size, op)
- XDR *xdrs;
- char *addr;
- u_int size;
- enum xdr_op op;
+xdrmem_create(XDR *xdrs, char *addr, u_int size, enum xdr_op op)
{
xdrs->x_op = op;
@@ -114,16 +110,13 @@ xdrmem_create(xdrs, addr, size, op)
/*ARGSUSED*/
static void
-xdrmem_destroy(xdrs)
- XDR *xdrs;
+xdrmem_destroy(XDR *xdrs)
{
}
static bool_t
-xdrmem_getlong_aligned(xdrs, lp)
- XDR *xdrs;
- long *lp;
+xdrmem_getlong_aligned(XDR *xdrs, long *lp)
{
if (xdrs->x_handy < sizeof(int32_t))
@@ -135,9 +128,7 @@ xdrmem_getlong_aligned(xdrs, lp)
}
static bool_t
-xdrmem_putlong_aligned(xdrs, lp)
- XDR *xdrs;
- const long *lp;
+xdrmem_putlong_aligned(XDR *xdrs, const long *lp)
{
if (xdrs->x_handy < sizeof(int32_t))
@@ -149,9 +140,7 @@ xdrmem_putlong_aligned(xdrs, lp)
}
static bool_t
-xdrmem_getlong_unaligned(xdrs, lp)
- XDR *xdrs;
- long *lp;
+xdrmem_getlong_unaligned(XDR *xdrs, long *lp)
{
u_int32_t l;
@@ -165,9 +154,7 @@ xdrmem_getlong_unaligned(xdrs, lp)
}
static bool_t
-xdrmem_putlong_unaligned(xdrs, lp)
- XDR *xdrs;
- const long *lp;
+xdrmem_putlong_unaligned(XDR *xdrs, const long *lp)
{
u_int32_t l;
@@ -181,10 +168,7 @@ xdrmem_putlong_unaligned(xdrs, lp)
}
static bool_t
-xdrmem_getbytes(xdrs, addr, len)
- XDR *xdrs;
- char *addr;
- u_int len;
+xdrmem_getbytes(XDR *xdrs, char *addr, u_int len)
{
if (xdrs->x_handy < len)
@@ -196,10 +180,7 @@ xdrmem_getbytes(xdrs, addr, len)
}
static bool_t
-xdrmem_putbytes(xdrs, addr, len)
- XDR *xdrs;
- const char *addr;
- u_int len;
+xdrmem_putbytes(XDR *xdrs, const char *addr, u_int len)
{
if (xdrs->x_handy < len)
@@ -211,8 +192,7 @@ xdrmem_putbytes(xdrs, addr, len)
}
static u_int
-xdrmem_getpos(xdrs)
- XDR *xdrs;
+xdrmem_getpos(XDR *xdrs)
{
/* XXX w/64-bit pointers, u_int not enough! */
@@ -220,9 +200,7 @@ xdrmem_getpos(xdrs)
}
static bool_t
-xdrmem_setpos(xdrs, pos)
- XDR *xdrs;
- u_int pos;
+xdrmem_setpos(XDR *xdrs, u_int pos)
{
char *newaddr = xdrs->x_base + pos;
char *lastaddr = (char *)xdrs->x_private + xdrs->x_handy;
@@ -235,9 +213,7 @@ xdrmem_setpos(xdrs, pos)
}
static int32_t *
-xdrmem_inline_aligned(xdrs, len)
- XDR *xdrs;
- u_int len;
+xdrmem_inline_aligned(XDR *xdrs, u_int len)
{
int32_t *buf = 0;
@@ -251,9 +227,7 @@ xdrmem_inline_aligned(xdrs, len)
/* ARGSUSED */
static int32_t *
-xdrmem_inline_unaligned(xdrs, len)
- XDR *xdrs;
- u_int len;
+xdrmem_inline_unaligned(XDR *xdrs, u_int len)
{
return (0);
diff --git a/lib/libc/xdr/xdr_rec.c b/lib/libc/xdr/xdr_rec.c
index 3f63498..f818ed94 100644
--- a/lib/libc/xdr/xdr_rec.c
+++ b/lib/libc/xdr/xdr_rec.c
@@ -161,15 +161,18 @@ static bool_t realloc_stream(RECSTREAM *, int);
* calls expect that they take an opaque handle rather than an fd.
*/
void
-xdrrec_create(xdrs, sendsize, recvsize, tcp_handle, readit, writeit)
- XDR *xdrs;
- u_int sendsize;
- u_int recvsize;
- void *tcp_handle;
- /* like read, but pass it a tcp_handle, not sock */
- int (*readit)(void *, void *, int);
- /* like write, but pass it a tcp_handle, not sock */
- int (*writeit)(void *, void *, int);
+xdrrec_create(XDR *xdrs, u_int sendsize, u_int recvsize, void *tcp_handle,
+ int (*readit)(void *, void *, int), int (*writeit)(void *, void *, int))
+/*
+ * XDR *xdrs;
+ * u_int sendsize;
+ * u_int recvsize;
+ * void *tcp_handle;
+ * // like read, but pass it a tcp_handle, not sock
+ * int (*readit)(void *, void *, int);
+ * // like write, but pass it a tcp_handle, not sock
+ * int (*writeit)(void *, void *, int);
+ */
{
RECSTREAM *rstrm = mem_alloc(sizeof(RECSTREAM));
@@ -229,9 +232,7 @@ xdrrec_create(xdrs, sendsize, recvsize, tcp_handle, readit, writeit)
*/
static bool_t
-xdrrec_getlong(xdrs, lp)
- XDR *xdrs;
- long *lp;
+xdrrec_getlong(XDR *xdrs, long *lp)
{
RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
int32_t *buflp = (int32_t *)(void *)(rstrm->in_finger);
@@ -253,9 +254,7 @@ xdrrec_getlong(xdrs, lp)
}
static bool_t
-xdrrec_putlong(xdrs, lp)
- XDR *xdrs;
- const long *lp;
+xdrrec_putlong(XDR *xdrs, const long *lp)
{
RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
int32_t *dest_lp = ((int32_t *)(void *)(rstrm->out_finger));
@@ -277,10 +276,7 @@ xdrrec_putlong(xdrs, lp)
}
static bool_t /* must manage buffers, fragments, and records */
-xdrrec_getbytes(xdrs, addr, len)
- XDR *xdrs;
- char *addr;
- u_int len;
+xdrrec_getbytes(XDR *xdrs, char *addr, u_int len)
{
RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
int current;
@@ -305,10 +301,7 @@ xdrrec_getbytes(xdrs, addr, len)
}
static bool_t
-xdrrec_putbytes(xdrs, addr, len)
- XDR *xdrs;
- const char *addr;
- u_int len;
+xdrrec_putbytes(XDR *xdrs, const char *addr, u_int len)
{
RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
size_t current;
@@ -331,8 +324,7 @@ xdrrec_putbytes(xdrs, addr, len)
}
static u_int
-xdrrec_getpos(xdrs)
- XDR *xdrs;
+xdrrec_getpos(XDR *xdrs)
{
RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;
off_t pos;
@@ -358,9 +350,7 @@ xdrrec_getpos(xdrs)
}
static bool_t
-xdrrec_setpos(xdrs, pos)
- XDR *xdrs;
- u_int pos;
+xdrrec_setpos(XDR *xdrs, u_int pos)
{
RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;
u_int currpos = xdrrec_getpos(xdrs);
@@ -397,9 +387,7 @@ xdrrec_setpos(xdrs, pos)
}
static int32_t *
-xdrrec_inline(xdrs, len)
- XDR *xdrs;
- u_int len;
+xdrrec_inline(XDR *xdrs, u_int len)
{
RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;
int32_t *buf = NULL;
@@ -429,8 +417,7 @@ xdrrec_inline(xdrs, len)
}
static void
-xdrrec_destroy(xdrs)
- XDR *xdrs;
+xdrrec_destroy(XDR *xdrs)
{
RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;
@@ -449,8 +436,7 @@ xdrrec_destroy(xdrs)
* this procedure to guarantee proper record alignment.
*/
bool_t
-xdrrec_skiprecord(xdrs)
- XDR *xdrs;
+xdrrec_skiprecord(XDR *xdrs)
{
RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
enum xprt_stat xstat;
@@ -485,8 +471,7 @@ xdrrec_skiprecord(xdrs)
* after consuming the rest of the current record.
*/
bool_t
-xdrrec_eof(xdrs)
- XDR *xdrs;
+xdrrec_eof(XDR *xdrs)
{
RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
@@ -509,9 +494,7 @@ xdrrec_eof(xdrs)
* pipelined procedure calls.) TRUE => immmediate flush to tcp connection.
*/
bool_t
-xdrrec_endofrecord(xdrs, sendnow)
- XDR *xdrs;
- bool_t sendnow;
+xdrrec_endofrecord(XDR *xdrs, bool_t sendnow)
{
RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
u_long len; /* fragment length */
@@ -535,10 +518,7 @@ xdrrec_endofrecord(xdrs, sendnow)
* Return true if a record is available in the buffer, false if not.
*/
bool_t
-__xdrrec_getrec(xdrs, statp, expectdata)
- XDR *xdrs;
- enum xprt_stat *statp;
- bool_t expectdata;
+__xdrrec_getrec(XDR *xdrs, enum xprt_stat *statp, bool_t expectdata)
{
RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
ssize_t n;
@@ -618,9 +598,7 @@ __xdrrec_getrec(xdrs, statp, expectdata)
}
bool_t
-__xdrrec_setnonblock(xdrs, maxrec)
- XDR *xdrs;
- int maxrec;
+__xdrrec_setnonblock(XDR *xdrs, int maxrec)
{
RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);
@@ -635,9 +613,7 @@ __xdrrec_setnonblock(xdrs, maxrec)
* Internal useful routines
*/
static bool_t
-flush_out(rstrm, eor)
- RECSTREAM *rstrm;
- bool_t eor;
+flush_out(RECSTREAM *rstrm, bool_t eor)
{
u_int32_t eormask = (eor == TRUE) ? LAST_FRAG : 0;
u_int32_t len = (u_int32_t)((u_long)(rstrm->out_finger) -
@@ -655,8 +631,7 @@ flush_out(rstrm, eor)
}
static bool_t /* knows nothing about records! Only about input buffers */
-fill_input_buf(rstrm)
- RECSTREAM *rstrm;
+fill_input_buf(RECSTREAM *rstrm)
{
char *where;
u_int32_t i;
@@ -678,10 +653,7 @@ fill_input_buf(rstrm)
}
static bool_t /* knows nothing about records! Only about input buffers */
-get_input_bytes(rstrm, addr, len)
- RECSTREAM *rstrm;
- char *addr;
- int len;
+get_input_bytes(RECSTREAM *rstrm, char *addr, int len)
{
size_t current;
@@ -711,8 +683,7 @@ get_input_bytes(rstrm, addr, len)
}
static bool_t /* next two bytes of the input stream are treated as a header */
-set_input_fragment(rstrm)
- RECSTREAM *rstrm;
+set_input_fragment(RECSTREAM *rstrm)
{
u_int32_t header;
@@ -737,9 +708,7 @@ set_input_fragment(rstrm)
}
static bool_t /* consumes input bytes; knows nothing about records! */
-skip_input_bytes(rstrm, cnt)
- RECSTREAM *rstrm;
- long cnt;
+skip_input_bytes(RECSTREAM *rstrm, long cnt)
{
u_int32_t current;
@@ -759,8 +728,7 @@ skip_input_bytes(rstrm, cnt)
}
static u_int
-fix_buf_size(s)
- u_int s;
+fix_buf_size(u_int s)
{
if (s < 100)
@@ -772,9 +740,7 @@ fix_buf_size(s)
* Reallocate the input buffer for a non-block stream.
*/
static bool_t
-realloc_stream(rstrm, size)
- RECSTREAM *rstrm;
- int size;
+realloc_stream(RECSTREAM *rstrm, int size)
{
ptrdiff_t diff;
char *buf;
diff --git a/lib/libc/xdr/xdr_reference.c b/lib/libc/xdr/xdr_reference.c
index 146dcf2..9acdd96 100644
--- a/lib/libc/xdr/xdr_reference.c
+++ b/lib/libc/xdr/xdr_reference.c
@@ -65,11 +65,13 @@ __FBSDID("$FreeBSD$");
* proc is the routine to handle the referenced structure.
*/
bool_t
-xdr_reference(xdrs, pp, size, proc)
- XDR *xdrs;
- caddr_t *pp; /* the pointer to work on */
- u_int size; /* size of the object pointed to */
- xdrproc_t proc; /* xdr routine to handle the object */
+xdr_reference(XDR *xdrs, caddr_t *pp, u_int size, xdrproc_t proc)
+/*
+ * XDR *xdrs;
+ * caddr_t *pp; // the pointer to work on
+ * u_int size; // size of the object pointed to
+ * xdrproc_t proc; // xdr routine to handle the object
+ */
{
caddr_t loc = *pp;
bool_t stat;
@@ -122,11 +124,7 @@ xdr_reference(xdrs, pp, size, proc)
*
*/
bool_t
-xdr_pointer(xdrs,objpp,obj_size,xdr_obj)
- XDR *xdrs;
- char **objpp;
- u_int obj_size;
- xdrproc_t xdr_obj;
+xdr_pointer(XDR *xdrs, char **objpp, u_int obj_size, xdrproc_t xdr_obj)
{
bool_t more_data;
diff --git a/lib/libc/xdr/xdr_sizeof.c b/lib/libc/xdr/xdr_sizeof.c
index 3daaa0c..f4b2874 100644
--- a/lib/libc/xdr/xdr_sizeof.c
+++ b/lib/libc/xdr/xdr_sizeof.c
@@ -47,9 +47,7 @@ __FBSDID("$FreeBSD$");
/* ARGSUSED */
static bool_t
-x_putlong(xdrs, longp)
- XDR *xdrs;
- long *longp;
+x_putlong(XDR *xdrs, const long *longp)
{
xdrs->x_handy += BYTES_PER_XDR_UNIT;
return (TRUE);
@@ -57,36 +55,28 @@ x_putlong(xdrs, longp)
/* ARGSUSED */
static bool_t
-x_putbytes(xdrs, bp, len)
- XDR *xdrs;
- char *bp;
- u_int len;
+x_putbytes(XDR *xdrs, const char *bp, u_int len)
{
xdrs->x_handy += len;
return (TRUE);
}
static u_int
-x_getpostn(xdrs)
- XDR *xdrs;
+x_getpostn(XDR *xdrs)
{
return (xdrs->x_handy);
}
/* ARGSUSED */
static bool_t
-x_setpostn(xdrs, pos)
- XDR *xdrs;
- u_int pos;
+x_setpostn(XDR *xdrs, u_int pos)
{
/* This is not allowed */
return (FALSE);
}
static int32_t *
-x_inline(xdrs, len)
- XDR *xdrs;
- u_int len;
+x_inline(XDR *xdrs, u_int len)
{
if (len == 0) {
return (NULL);
@@ -113,15 +103,14 @@ x_inline(xdrs, len)
}
static int
-harmless()
+harmless(void)
{
/* Always return FALSE/NULL, as the case may be */
return (0);
}
static void
-x_destroy(xdrs)
- XDR *xdrs;
+x_destroy(XDR *xdrs)
{
xdrs->x_handy = 0;
xdrs->x_base = 0;
@@ -133,9 +122,7 @@ x_destroy(xdrs)
}
unsigned long
-xdr_sizeof(func, data)
- xdrproc_t func;
- void *data;
+xdr_sizeof(xdrproc_t func, void *data)
{
XDR x;
struct xdr_ops ops;
diff --git a/lib/libc/xdr/xdr_stdio.c b/lib/libc/xdr/xdr_stdio.c
index 832b308..0065154 100644
--- a/lib/libc/xdr/xdr_stdio.c
+++ b/lib/libc/xdr/xdr_stdio.c
@@ -83,10 +83,7 @@ static const struct xdr_ops xdrstdio_ops = {
* Operation flag is set to op.
*/
void
-xdrstdio_create(xdrs, file, op)
- XDR *xdrs;
- FILE *file;
- enum xdr_op op;
+xdrstdio_create(XDR *xdrs, FILE *file, enum xdr_op op)
{
xdrs->x_op = op;
@@ -101,17 +98,14 @@ xdrstdio_create(xdrs, file, op)
* Cleans up the xdr stream handle xdrs previously set up by xdrstdio_create.
*/
static void
-xdrstdio_destroy(xdrs)
- XDR *xdrs;
+xdrstdio_destroy(XDR *xdrs)
{
(void)fflush((FILE *)xdrs->x_private);
/* XXX: should we close the file ?? */
}
static bool_t
-xdrstdio_getlong(xdrs, lp)
- XDR *xdrs;
- long *lp;
+xdrstdio_getlong(XDR *xdrs, long *lp)
{
u_int32_t temp;
@@ -122,9 +116,7 @@ xdrstdio_getlong(xdrs, lp)
}
static bool_t
-xdrstdio_putlong(xdrs, lp)
- XDR *xdrs;
- const long *lp;
+xdrstdio_putlong(XDR *xdrs, const long *lp)
{
int32_t mycopy = htonl((u_int32_t)*lp);
@@ -134,10 +126,7 @@ xdrstdio_putlong(xdrs, lp)
}
static bool_t
-xdrstdio_getbytes(xdrs, addr, len)
- XDR *xdrs;
- char *addr;
- u_int len;
+xdrstdio_getbytes(XDR *xdrs, char *addr, u_int len)
{
if ((len != 0) && (fread(addr, (size_t)len, 1, (FILE *)xdrs->x_private) != 1))
@@ -146,10 +135,7 @@ xdrstdio_getbytes(xdrs, addr, len)
}
static bool_t
-xdrstdio_putbytes(xdrs, addr, len)
- XDR *xdrs;
- const char *addr;
- u_int len;
+xdrstdio_putbytes(XDR *xdrs, const char *addr, u_int len)
{
if ((len != 0) && (fwrite(addr, (size_t)len, 1,
@@ -159,17 +145,14 @@ xdrstdio_putbytes(xdrs, addr, len)
}
static u_int
-xdrstdio_getpos(xdrs)
- XDR *xdrs;
+xdrstdio_getpos(XDR *xdrs)
{
return ((u_int) ftell((FILE *)xdrs->x_private));
}
static bool_t
-xdrstdio_setpos(xdrs, pos)
- XDR *xdrs;
- u_int pos;
+xdrstdio_setpos(XDR *xdrs, u_int pos)
{
return ((fseek((FILE *)xdrs->x_private, (long)pos, 0) < 0) ?
@@ -178,9 +161,7 @@ xdrstdio_setpos(xdrs, pos)
/* ARGSUSED */
static int32_t *
-xdrstdio_inline(xdrs, len)
- XDR *xdrs;
- u_int len;
+xdrstdio_inline(XDR *xdrs, u_int len)
{
/*
diff --git a/lib/libc_nonshared/Makefile.depend b/lib/libc_nonshared/Makefile.depend
index 15a1f9c..18be76b 100644
--- a/lib/libc_nonshared/Makefile.depend
+++ b/lib/libc_nonshared/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libcalendar/Makefile.depend b/lib/libcalendar/Makefile.depend
index c9d74dc..3699b06 100644
--- a/lib/libcalendar/Makefile.depend
+++ b/lib/libcalendar/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libcam/Makefile.depend b/lib/libcam/Makefile.depend
index 2a956d8..114b842 100644
--- a/lib/libcam/Makefile.depend
+++ b/lib/libcam/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libcapsicum/Makefile.depend b/lib/libcapsicum/Makefile.depend
index bf32038..5016551 100644
--- a/lib/libcapsicum/Makefile.depend
+++ b/lib/libcapsicum/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libclang_rt/Makefile.inc b/lib/libclang_rt/Makefile.inc
index be0122e..03873f2 100644
--- a/lib/libclang_rt/Makefile.inc
+++ b/lib/libclang_rt/Makefile.inc
@@ -5,7 +5,7 @@
CRTARCH=${MACHINE_CPUARCH:C/amd64/x86_64/}
CRTSRC=${.CURDIR}/../../../contrib/compiler-rt
-LIBDIR=/usr/lib/clang/3.6.0/lib/freebsd
+LIBDIR=/usr/lib/clang/3.6.1/lib/freebsd
NO_PIC=
MK_PROFILE=no
diff --git a/lib/libcom_err/Makefile.depend b/lib/libcom_err/Makefile.depend
index 593d407..3646e2e 100644
--- a/lib/libcom_err/Makefile.depend
+++ b/lib/libcom_err/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
@@ -8,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libcompat/Makefile.depend b/lib/libcompat/Makefile.depend
index 639d45d..18be76b 100644
--- a/lib/libcompat/Makefile.depend
+++ b/lib/libcompat/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
include \
include/xlocale \
diff --git a/lib/libcompiler_rt/Makefile.depend b/lib/libcompiler_rt/Makefile.depend
index 993ab06..79506ce 100644
--- a/lib/libcompiler_rt/Makefile.depend
+++ b/lib/libcompiler_rt/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libcrypt/Makefile.depend b/lib/libcrypt/Makefile.depend
index bd8ae02..54c1f6f 100644
--- a/lib/libcrypt/Makefile.depend
+++ b/lib/libcrypt/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
@@ -9,7 +10,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libcrypt/tests/Makefile.depend b/lib/libcrypt/tests/Makefile.depend
index 42ba839..d0caca1 100644
--- a/lib/libcrypt/tests/Makefile.depend
+++ b/lib/libcrypt/tests/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libcrypt/tests/crypt_tests.c b/lib/libcrypt/tests/crypt_tests.c
index ea7cfbc..426d10e 100644
--- a/lib/libcrypt/tests/crypt_tests.c
+++ b/lib/libcrypt/tests/crypt_tests.c
@@ -2,6 +2,7 @@
__FBSDID("$FreeBSD$");
#include <sys/types.h>
+#include <crypt.h>
#include <unistd.h>
#include <atf-c.h>
diff --git a/lib/libcuse/Makefile.depend b/lib/libcuse/Makefile.depend
index 37acbe0..441e1ee 100644
--- a/lib/libcuse/Makefile.depend
+++ b/lib/libcuse/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libcxxrt/Makefile.depend b/lib/libcxxrt/Makefile.depend
index 593d407..dde2d60 100644
--- a/lib/libcxxrt/Makefile.depend
+++ b/lib/libcxxrt/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libcxxrt/Makefile.depend.host b/lib/libcxxrt/Makefile.depend.host
index 8dc8a74..9f46a2f 100644
--- a/lib/libcxxrt/Makefile.depend.host
+++ b/lib/libcxxrt/Makefile.depend.host
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libdevinfo/Makefile.depend b/lib/libdevinfo/Makefile.depend
index 593d407..dde2d60 100644
--- a/lib/libdevinfo/Makefile.depend
+++ b/lib/libdevinfo/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libdevstat/Makefile.depend b/lib/libdevstat/Makefile.depend
index a785d0c..96ad505 100644
--- a/lib/libdevstat/Makefile.depend
+++ b/lib/libdevstat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libdevstat/devstat.c b/lib/libdevstat/devstat.c
index d52332b..68b5028 100644
--- a/lib/libdevstat/devstat.c
+++ b/lib/libdevstat/devstat.c
@@ -334,7 +334,6 @@ devstat_getdevs(kvm_t *kd, struct statinfo *stats)
{
int error;
size_t dssize;
- int oldnumdevs;
long oldgeneration;
int retval = 0;
struct devinfo *dinfo;
@@ -348,7 +347,6 @@ devstat_getdevs(kvm_t *kd, struct statinfo *stats)
return(-1);
}
- oldnumdevs = dinfo->numdevs;
oldgeneration = dinfo->generation;
if (kd == NULL) {
diff --git a/lib/libdpv/Makefile.depend b/lib/libdpv/Makefile.depend
index 027da9c..6f24a33 100644
--- a/lib/libdpv/Makefile.depend
+++ b/lib/libdpv/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libdpv/dprompt.c b/lib/libdpv/dprompt.c
index 031f550..e3d636a 100644
--- a/lib/libdpv/dprompt.c
+++ b/lib/libdpv/dprompt.c
@@ -391,7 +391,6 @@ dprompt_add_files(struct dpv_file_node *file_list,
enum dprompt_state dstate;
int estext_lsize;
int estext_rsize;
- int estext_size;
int flabel_size;
int hlen;
int lsize;
@@ -559,13 +558,11 @@ dprompt_add_files(struct dpv_file_node *file_list,
bg_code = "\\Zr\\Z1"; /* Red */
estext_lsize = fail_lsize;
estext_rsize = fail_rsize;
- estext_size = fail_size;
estext = fail;
} else { /* e.g., DPV_STATUS_DONE */
bg_code = "\\Zr\\Z2"; /* Green */
estext_lsize = done_lsize;
estext_rsize = done_rsize;
- estext_size = done_size;
estext = done;
}
switch (dstate) {
diff --git a/lib/libdpv/dpv.c b/lib/libdpv/dpv.c
index fd44360..6a03922 100644
--- a/lib/libdpv/dpv.c
+++ b/lib/libdpv/dpv.c
@@ -692,7 +692,7 @@ dpv(struct dpv_config *config, struct dpv_file_node *file_list)
if (!dpv_interrupt)
printf("\n");
} else
- warnx("%s: %lli lines read", __func__, dpv_overall_read);
+ warnx("%s: %lli overall read", __func__, dpv_overall_read);
if (dpv_interrupt || dpv_abort)
return (-1);
diff --git a/lib/libdwarf/Makefile.depend b/lib/libdwarf/Makefile.depend
index 07e629e..2a416d0 100644
--- a/lib/libdwarf/Makefile.depend
+++ b/lib/libdwarf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libedit/Makefile.depend b/lib/libedit/Makefile.depend
index d4b7b5c..3c91e80 100644
--- a/lib/libedit/Makefile.depend
+++ b/lib/libedit/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
include \
diff --git a/lib/libedit/edit/readline/Makefile.depend b/lib/libedit/edit/readline/Makefile.depend
index 11aba52..f80275d 100644
--- a/lib/libedit/edit/readline/Makefile.depend
+++ b/lib/libedit/edit/readline/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libedit/edit/readline/readline.h b/lib/libedit/edit/readline/readline.h
index 4371457..e25781b 100644
--- a/lib/libedit/edit/readline/readline.h
+++ b/lib/libedit/edit/readline/readline.h
@@ -1,4 +1,4 @@
-/* $NetBSD: readline.h,v 1.34 2013/05/28 00:10:34 christos Exp $ */
+/* $NetBSD: readline.h,v 1.37 2015/06/02 15:36:45 christos Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -41,9 +41,8 @@
/* typedefs */
typedef int Function(const char *, int);
typedef void VFunction(void);
-typedef void VCPFunction(char *);
-typedef char *CPFunction(const char *, int);
-typedef char **CPPFunction(const char *, int, int);
+typedef void rl_vcpfunc_t(char *);
+typedef char **rl_completion_func_t(const char *, int, int);
typedef char *rl_compentry_func_t(const char *, int);
typedef int rl_command_func_t(int, int);
@@ -110,9 +109,9 @@ extern int max_input_history;
extern char *rl_basic_word_break_characters;
extern char *rl_completer_word_break_characters;
extern char *rl_completer_quote_characters;
-extern Function *rl_completion_entry_function;
+extern rl_compentry_func_t *rl_completion_entry_function;
extern char *(*rl_completion_word_break_hook)(void);
-extern CPPFunction *rl_attempted_completion_function;
+extern rl_completion_func_t *rl_attempted_completion_function;
extern int rl_attempted_completion_over;
extern int rl_completion_type;
extern int rl_completion_query_items;
@@ -177,7 +176,7 @@ char *filename_completion_function(const char *, int);
char *username_completion_function(const char *, int);
int rl_complete(int, int);
int rl_read_key(void);
-char **completion_matches(const char *, CPFunction *);
+char **completion_matches(const char *, rl_compentry_func_t *);
void rl_display_match_list(char **, int, int);
int rl_insert(int, int);
@@ -186,7 +185,7 @@ void rl_reset_terminal(const char *);
int rl_bind_key(int, rl_command_func_t *);
int rl_newline(int, int);
void rl_callback_read_char(void);
-void rl_callback_handler_install(const char *, VCPFunction *);
+void rl_callback_handler_install(const char *, rl_vcpfunc_t *);
void rl_callback_handler_remove(void);
void rl_redisplay(void);
int rl_get_previous_history(int, int);
@@ -196,7 +195,7 @@ int rl_read_init_file(const char *);
int rl_parse_and_bind(const char *);
int rl_variable_bind(const char *, const char *);
void rl_stuff_char(int);
-int rl_add_defun(const char *, Function *, int);
+int rl_add_defun(const char *, rl_command_func_t *, int);
HISTORY_STATE *history_get_history_state(void);
void rl_get_screen_size(int *, int *);
void rl_set_screen_size(int, int);
diff --git a/lib/libedit/readline.c b/lib/libedit/readline.c
index 2dd7f4f..caddb9f 100644
--- a/lib/libedit/readline.c
+++ b/lib/libedit/readline.c
@@ -1,4 +1,4 @@
-/* $NetBSD: readline.c,v 1.115 2015/04/01 15:23:15 christos Exp $ */
+/* $NetBSD: readline.c,v 1.117 2015/06/02 15:35:31 christos Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: readline.c,v 1.115 2015/04/01 15:23:15 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.117 2015/06/02 15:35:31 christos Exp $");
#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -80,7 +80,7 @@ FILE *rl_outstream = NULL;
int rl_point = 0;
int rl_end = 0;
char *rl_line_buffer = NULL;
-VCPFunction *rl_linefunc = NULL;
+rl_vcpfunc_t *rl_linefunc = NULL;
int rl_done = 0;
VFunction *rl_event_hook = NULL;
KEYMAP_ENTRY_ARRAY emacs_standard_keymap,
@@ -109,9 +109,9 @@ int rl_attempted_completion_over = 0;
char *rl_basic_word_break_characters = break_chars;
char *rl_completer_word_break_characters = NULL;
char *rl_completer_quote_characters = NULL;
-Function *rl_completion_entry_function = NULL;
+rl_compentry_func_t *rl_completion_entry_function = NULL;
char *(*rl_completion_word_break_hook)(void) = NULL;
-CPPFunction *rl_attempted_completion_function = NULL;
+rl_completion_func_t *rl_attempted_completion_function = NULL;
Function *rl_pre_input_hook = NULL;
Function *rl_startup1_hook = NULL;
int (*rl_getc_function)(FILE *) = NULL;
@@ -162,7 +162,7 @@ int rl_completion_append_character = ' ';
static History *h = NULL;
static EditLine *e = NULL;
-static Function *map[256];
+static rl_command_func_t *map[256];
static jmp_buf topbuf;
/* internal functions */
@@ -1829,9 +1829,11 @@ rl_complete(int ignore __attribute__((__unused__)), int invoking_key)
else
breakchars = rl_basic_word_break_characters;
+ _rl_update_pos();
+
/* Just look at how many global variables modify this operation! */
return fn_complete(e,
- (CPFunction *)rl_completion_entry_function,
+ (rl_compentry_func_t *)rl_completion_entry_function,
rl_attempted_completion_function,
ct_decode_string(rl_basic_word_break_characters, &wbreak_conv),
ct_decode_string(breakchars, &sprefix_conv),
@@ -1960,7 +1962,7 @@ rl_bind_wrapper(EditLine *el __attribute__((__unused__)), unsigned char c)
_rl_update_pos();
- (*map[c])(NULL, c);
+ (*map[c])(1, c);
/* If rl_done was set by the above call, deal with it here */
if (rl_done)
@@ -1970,7 +1972,7 @@ rl_bind_wrapper(EditLine *el __attribute__((__unused__)), unsigned char c)
}
int
-rl_add_defun(const char *name, Function *fun, int c)
+rl_add_defun(const char *name, rl_command_func_t *fun, int c)
{
char dest[8];
if ((size_t)c >= sizeof(map) / sizeof(map[0]) || c < 0)
@@ -2009,7 +2011,7 @@ rl_callback_read_char(void)
}
void
-rl_callback_handler_install(const char *prompt, VCPFunction *linefunc)
+rl_callback_handler_install(const char *prompt, rl_vcpfunc_t *linefunc)
{
if (e == NULL) {
rl_initialize();
diff --git a/lib/libelf/Makefile.depend b/lib/libelf/Makefile.depend
index 5830cc8..cc4f1d2 100644
--- a/lib/libelf/Makefile.depend
+++ b/lib/libelf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libelftc/elftc_version.c b/lib/libelftc/elftc_version.c
index fb0a731..e8a11d4 100644
--- a/lib/libelftc/elftc_version.c
+++ b/lib/libelftc/elftc_version.c
@@ -6,5 +6,5 @@
const char *
elftc_version(void)
{
- return "elftoolchain r3197M";
+ return "elftoolchain r3223M";
}
diff --git a/lib/libevent/Makefile.depend b/lib/libevent/Makefile.depend
index 639d45d..ccd19e5 100644
--- a/lib/libevent/Makefile.depend
+++ b/lib/libevent/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libexecinfo/Makefile.depend b/lib/libexecinfo/Makefile.depend
index f895c37..5bc9039 100644
--- a/lib/libexecinfo/Makefile.depend
+++ b/lib/libexecinfo/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libexpat/Makefile.depend b/lib/libexpat/Makefile.depend
index 593d407..dde2d60 100644
--- a/lib/libexpat/Makefile.depend
+++ b/lib/libexpat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libfetch/Makefile.depend b/lib/libfetch/Makefile.depend
index a9a742b..df3495b 100644
--- a/lib/libfetch/Makefile.depend
+++ b/lib/libfetch/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libfigpar/Makefile.depend b/lib/libfigpar/Makefile.depend
index 593d407..dde2d60 100644
--- a/lib/libfigpar/Makefile.depend
+++ b/lib/libfigpar/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libgeom/Makefile.depend b/lib/libgeom/Makefile.depend
index e604936..9af4728 100644
--- a/lib/libgeom/Makefile.depend
+++ b/lib/libgeom/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libgpib/Makefile.depend b/lib/libgpib/Makefile.depend
index 7cedd5f..4370d1e 100644
--- a/lib/libgpib/Makefile.depend
+++ b/lib/libgpib/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libgpio/Makefile.depend b/lib/libgpio/Makefile.depend
index 593d407..dde2d60 100644
--- a/lib/libgpio/Makefile.depend
+++ b/lib/libgpio/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libgssapi/Makefile.depend b/lib/libgssapi/Makefile.depend
index a27ab52..7602ef9 100644
--- a/lib/libgssapi/Makefile.depend
+++ b/lib/libgssapi/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
include \
diff --git a/lib/libgssapi/gss_accept_sec_context.c b/lib/libgssapi/gss_accept_sec_context.c
index b424092..930da7f 100644
--- a/lib/libgssapi/gss_accept_sec_context.c
+++ b/lib/libgssapi/gss_accept_sec_context.c
@@ -165,7 +165,6 @@ OM_uint32 gss_accept_sec_context(OM_uint32 *minor_status,
struct _gss_mechanism_cred *mc;
gss_cred_id_t acceptor_mc, delegated_mc;
gss_name_t src_mn;
- int allocated_ctx;
*minor_status = 0;
if (src_name)
@@ -206,11 +205,8 @@ OM_uint32 gss_accept_sec_context(OM_uint32 *minor_status,
free(ctx);
return (GSS_S_BAD_MECH);
}
- allocated_ctx = 1;
- } else {
+ } else
m = ctx->gc_mech;
- allocated_ctx = 0;
- }
if (cred) {
SLIST_FOREACH(mc, &cred->gc_mc, gmc_link)
diff --git a/lib/libiconv_modules/BIG5/Makefile.depend b/lib/libiconv_modules/BIG5/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libiconv_modules/BIG5/Makefile.depend
+++ b/lib/libiconv_modules/BIG5/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libiconv_modules/DECHanyu/Makefile.depend b/lib/libiconv_modules/DECHanyu/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libiconv_modules/DECHanyu/Makefile.depend
+++ b/lib/libiconv_modules/DECHanyu/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libiconv_modules/EUC/Makefile.depend b/lib/libiconv_modules/EUC/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libiconv_modules/EUC/Makefile.depend
+++ b/lib/libiconv_modules/EUC/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libiconv_modules/EUCTW/Makefile.depend b/lib/libiconv_modules/EUCTW/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libiconv_modules/EUCTW/Makefile.depend
+++ b/lib/libiconv_modules/EUCTW/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libiconv_modules/GBK2K/Makefile.depend b/lib/libiconv_modules/GBK2K/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libiconv_modules/GBK2K/Makefile.depend
+++ b/lib/libiconv_modules/GBK2K/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libiconv_modules/HZ/Makefile.depend b/lib/libiconv_modules/HZ/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libiconv_modules/HZ/Makefile.depend
+++ b/lib/libiconv_modules/HZ/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libiconv_modules/ISO2022/Makefile.depend b/lib/libiconv_modules/ISO2022/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libiconv_modules/ISO2022/Makefile.depend
+++ b/lib/libiconv_modules/ISO2022/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libiconv_modules/JOHAB/Makefile.depend b/lib/libiconv_modules/JOHAB/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libiconv_modules/JOHAB/Makefile.depend
+++ b/lib/libiconv_modules/JOHAB/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libiconv_modules/MSKanji/Makefile.depend b/lib/libiconv_modules/MSKanji/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libiconv_modules/MSKanji/Makefile.depend
+++ b/lib/libiconv_modules/MSKanji/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libiconv_modules/UES/Makefile.depend b/lib/libiconv_modules/UES/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libiconv_modules/UES/Makefile.depend
+++ b/lib/libiconv_modules/UES/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libiconv_modules/UTF1632/Makefile.depend b/lib/libiconv_modules/UTF1632/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libiconv_modules/UTF1632/Makefile.depend
+++ b/lib/libiconv_modules/UTF1632/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libiconv_modules/UTF7/Makefile.depend b/lib/libiconv_modules/UTF7/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libiconv_modules/UTF7/Makefile.depend
+++ b/lib/libiconv_modules/UTF7/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libiconv_modules/UTF7/citrus_utf7.c b/lib/libiconv_modules/UTF7/citrus_utf7.c
index ce74cfe..fa00a68 100644
--- a/lib/libiconv_modules/UTF7/citrus_utf7.c
+++ b/lib/libiconv_modules/UTF7/citrus_utf7.c
@@ -62,8 +62,7 @@ typedef struct {
unsigned int
mode: 1, /* whether base64 mode */
bits: 4, /* need to hold 0 - 15 */
- cache: 22, /* 22 = BASE64_BIT + UTF16_BIT */
- surrogate: 1; /* whether surrogate pair or not */
+ cache: 22; /* 22 = BASE64_BIT + UTF16_BIT */
int chlen;
char ch[4]; /* BASE64_IN, 3 * 6 = 18, most closed to UTF16_BIT */
} _UTF7State;
@@ -154,21 +153,17 @@ _citrus_UTF7_mbtoutf16(_UTF7EncodingInfo * __restrict ei,
uint16_t * __restrict u16, char ** __restrict s, size_t n,
_UTF7State * __restrict psenc, size_t * __restrict nresult)
{
- _UTF7State sv;
char *s0;
int done, i, len;
+ *nresult = 0;
s0 = *s;
- sv = *psenc;
for (i = 0, done = 0; done == 0; i++) {
if (i == psenc->chlen) {
if (n-- < 1) {
*nresult = (size_t)-2;
*s = s0;
- sv.chlen = psenc->chlen;
- memcpy(sv.ch, psenc->ch, sizeof(sv.ch));
- *psenc = sv;
return (0);
}
psenc->ch[psenc->chlen++] = *s0++;
@@ -257,34 +252,31 @@ _citrus_UTF7_mbrtowc_priv(_UTF7EncodingInfo * __restrict ei,
*nresult = (size_t)_ENCODING_IS_STATE_DEPENDENT;
return (0);
}
- if (psenc->surrogate) {
- hi = (psenc->cache >> psenc->bits) & UTF16_MAX;
- if (hi < HISRG_MIN || hi > HISRG_MAX)
- return (EINVAL);
- siz = 0;
- } else {
- err = _citrus_UTF7_mbtoutf16(ei, &hi, s, n, psenc, &nr);
- if (nr == (size_t)-1 || nr == (size_t)-2) {
- *nresult = nr;
- return (err);
- }
- if (err != 0)
- return (err);
- n -= nr;
- siz = nr;
- if (hi < HISRG_MIN || hi > HISRG_MAX) {
- u32 = (uint32_t)hi;
- goto done;
- }
- psenc->surrogate = 1;
+ err = _citrus_UTF7_mbtoutf16(ei, &hi, s, n, psenc, &nr);
+ if (nr == (size_t)-1 || nr == (size_t)-2) {
+ *nresult = nr;
+ return (err);
+ }
+ if (err != 0)
+ return (err);
+ n -= nr;
+ siz = nr;
+ if (hi < HISRG_MIN || hi > HISRG_MAX) {
+ u32 = (uint32_t)hi;
+ goto done;
}
err = _citrus_UTF7_mbtoutf16(ei, &lo, s, n, psenc, &nr);
if (nr == (size_t)-1 || nr == (size_t)-2) {
+ psenc->chlen = 1; /* make get_state_desc return incomplete */
*nresult = nr;
return (err);
}
if (err != 0)
return (err);
+ if (lo < LOSRG_MIN || lo > LOSRG_MAX) {
+ *nresult = (size_t)-1;
+ return (EILSEQ);
+ }
hi -= HISRG_MIN;
lo -= LOSRG_MIN;
u32 = (hi << 10 | lo) + SRG_BASE;
@@ -297,7 +289,6 @@ done:
_citrus_UTF7_init_state(ei, psenc);
} else {
*nresult = siz;
- psenc->surrogate = 0;
}
return (err);
}
@@ -396,7 +387,7 @@ _citrus_UTF7_put_state_reset(_UTF7EncodingInfo * __restrict ei __unused,
{
int bits, pos;
- if (psenc->chlen != 0 || psenc->bits > BASE64_BIT || psenc->surrogate)
+ if (psenc->chlen != 0 || psenc->bits > BASE64_BIT)
return (EINVAL);
if (psenc->mode) {
diff --git a/lib/libiconv_modules/UTF8/Makefile.depend b/lib/libiconv_modules/UTF8/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libiconv_modules/UTF8/Makefile.depend
+++ b/lib/libiconv_modules/UTF8/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libiconv_modules/VIQR/Makefile.depend b/lib/libiconv_modules/VIQR/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libiconv_modules/VIQR/Makefile.depend
+++ b/lib/libiconv_modules/VIQR/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libiconv_modules/ZW/Makefile.depend b/lib/libiconv_modules/ZW/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libiconv_modules/ZW/Makefile.depend
+++ b/lib/libiconv_modules/ZW/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libiconv_modules/iconv_none/Makefile.depend b/lib/libiconv_modules/iconv_none/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libiconv_modules/iconv_none/Makefile.depend
+++ b/lib/libiconv_modules/iconv_none/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libiconv_modules/iconv_std/Makefile.depend b/lib/libiconv_modules/iconv_std/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libiconv_modules/iconv_std/Makefile.depend
+++ b/lib/libiconv_modules/iconv_std/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libiconv_modules/mapper_646/Makefile.depend b/lib/libiconv_modules/mapper_646/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libiconv_modules/mapper_646/Makefile.depend
+++ b/lib/libiconv_modules/mapper_646/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libiconv_modules/mapper_none/Makefile.depend b/lib/libiconv_modules/mapper_none/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libiconv_modules/mapper_none/Makefile.depend
+++ b/lib/libiconv_modules/mapper_none/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libiconv_modules/mapper_parallel/Makefile.depend b/lib/libiconv_modules/mapper_parallel/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libiconv_modules/mapper_parallel/Makefile.depend
+++ b/lib/libiconv_modules/mapper_parallel/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libiconv_modules/mapper_serial/Makefile.depend b/lib/libiconv_modules/mapper_serial/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libiconv_modules/mapper_serial/Makefile.depend
+++ b/lib/libiconv_modules/mapper_serial/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libiconv_modules/mapper_std/Makefile.depend b/lib/libiconv_modules/mapper_std/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libiconv_modules/mapper_std/Makefile.depend
+++ b/lib/libiconv_modules/mapper_std/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libiconv_modules/mapper_zone/Makefile.depend b/lib/libiconv_modules/mapper_zone/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libiconv_modules/mapper_zone/Makefile.depend
+++ b/lib/libiconv_modules/mapper_zone/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libipsec/Makefile.depend b/lib/libipsec/Makefile.depend
index 60bd0fe..56cf3d8 100644
--- a/lib/libipsec/Makefile.depend
+++ b/lib/libipsec/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libjail/Makefile.depend b/lib/libjail/Makefile.depend
index bd8ae02..69d1724 100644
--- a/lib/libjail/Makefile.depend
+++ b/lib/libjail/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libkiconv/Makefile.depend b/lib/libkiconv/Makefile.depend
index 593d407..dde2d60 100644
--- a/lib/libkiconv/Makefile.depend
+++ b/lib/libkiconv/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libkvm/Makefile.depend b/lib/libkvm/Makefile.depend
index 593d407..dde2d60 100644
--- a/lib/libkvm/Makefile.depend
+++ b/lib/libkvm/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libldns/Makefile.depend b/lib/libldns/Makefile.depend
index 42849eb..b3f22d1 100644
--- a/lib/libldns/Makefile.depend
+++ b/lib/libldns/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
@@ -11,7 +12,6 @@ DIRDEPS = \
lib/libcompiler_rt \
secure/lib/libcrypto \
secure/lib/libssl \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/liblzma/Makefile.depend b/lib/liblzma/Makefile.depend
index 38b6435..21499e6 100644
--- a/lib/liblzma/Makefile.depend
+++ b/lib/liblzma/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libmagic/Makefile.depend b/lib/libmagic/Makefile.depend
index ecdbd37..002f937 100644
--- a/lib/libmagic/Makefile.depend
+++ b/lib/libmagic/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libmagic/config.h b/lib/libmagic/config.h
index 47f3347..956b040 100644
--- a/lib/libmagic/config.h
+++ b/lib/libmagic/config.h
@@ -75,6 +75,9 @@
/* Define to 1 if you have the `getpagesize' function. */
#define HAVE_GETPAGESIZE 1
+/* Define to 1 if you have the `gmtime_r' function. */
+#define HAVE_GMTIME_R 1
+
/* Define to 1 if the system has the type `intptr_t'. */
#define HAVE_INTPTR_T 1
@@ -93,6 +96,9 @@
/* Define to 1 if you have the <locale.h> header file. */
#define HAVE_LOCALE_H 1
+/* Define to 1 if you have the `localtime_r' function. */
+#define HAVE_LOCALTIME_R 1
+
/* Define to 1 if mbrtowc and mbstate_t are properly declared. */
#define HAVE_MBRTOWC 1
@@ -122,6 +128,12 @@
/* Define to 1 if you have the `setlocale' function. */
#define HAVE_SETLOCALE 1
+/* Define to 1 if you have the <signal.h> header file. */
+#define HAVE_SIGNAL_H 1
+
+/* Have sig_t type */
+#define HAVE_SIG_T 1
+
/* Define to 1 if you have the <stddef.h> header file. */
#define HAVE_STDDEF_H 1
@@ -278,7 +290,7 @@
#define PACKAGE_NAME "file"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "file 5.22"
+#define PACKAGE_STRING "file 5.23"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "file"
@@ -287,7 +299,7 @@
#define PACKAGE_URL ""
/* Define to the version of this package. */
-#define PACKAGE_VERSION "5.22"
+#define PACKAGE_VERSION "5.23"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
@@ -318,7 +330,7 @@
/* Version number of package */
-#define VERSION "5.22"
+#define VERSION "5.23"
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
diff --git a/lib/libmd/Makefile.depend b/lib/libmd/Makefile.depend
index a54cafa..00038a0 100644
--- a/lib/libmd/Makefile.depend
+++ b/lib/libmd/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
include \
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libmd/Makefile.depend.host b/lib/libmd/Makefile.depend.host
index 3f41a3f..fd7c8da 100644
--- a/lib/libmd/Makefile.depend.host
+++ b/lib/libmd/Makefile.depend.host
@@ -1,9 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat \
- gnu/usr.bin/binutils/ld \
- usr.bin/xinstall \
.include <dirdeps.mk>
diff --git a/lib/libmemstat/Makefile.depend b/lib/libmemstat/Makefile.depend
index a785d0c..96ad505 100644
--- a/lib/libmemstat/Makefile.depend
+++ b/lib/libmemstat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libmilter/Makefile.depend b/lib/libmilter/Makefile.depend
index e092bec..17c2027 100644
--- a/lib/libmilter/Makefile.depend
+++ b/lib/libmilter/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libmp/Makefile.depend b/lib/libmp/Makefile.depend
index 399ee78..6476d4c 100644
--- a/lib/libmp/Makefile.depend
+++ b/lib/libmp/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libmt/Makefile.depend b/lib/libmt/Makefile.depend
index e604936..9af4728 100644
--- a/lib/libmt/Makefile.depend
+++ b/lib/libmt/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libnetbsd/Makefile.depend b/lib/libnetbsd/Makefile.depend
index 217d6b6..cf2961c 100644
--- a/lib/libnetbsd/Makefile.depend
+++ b/lib/libnetbsd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libnetgraph/Makefile.depend b/lib/libnetgraph/Makefile.depend
index 593d407..dde2d60 100644
--- a/lib/libnetgraph/Makefile.depend
+++ b/lib/libnetgraph/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libngatm/Makefile.depend b/lib/libngatm/Makefile.depend
index bd8ae02..69d1724 100644
--- a/lib/libngatm/Makefile.depend
+++ b/lib/libngatm/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libnv/Makefile.depend b/lib/libnv/Makefile.depend
index 593d407..dde2d60 100644
--- a/lib/libnv/Makefile.depend
+++ b/lib/libnv/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libohash/Makefile.depend b/lib/libohash/Makefile.depend
index 15a1f9c..18be76b 100644
--- a/lib/libohash/Makefile.depend
+++ b/lib/libohash/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libopie/Makefile.depend b/lib/libopie/Makefile.depend
index 14d8b0f..6a2d406 100644
--- a/lib/libopie/Makefile.depend
+++ b/lib/libopie/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
@@ -10,7 +11,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libmd \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libpam/libpam/Makefile.depend b/lib/libpam/libpam/Makefile.depend
index 593d407..3646e2e 100644
--- a/lib/libpam/libpam/Makefile.depend
+++ b/lib/libpam/libpam/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
@@ -8,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libpam/modules/pam_chroot/Makefile.depend b/lib/libpam/modules/pam_chroot/Makefile.depend
index 467741f..8e09560 100644
--- a/lib/libpam/modules/pam_chroot/Makefile.depend
+++ b/lib/libpam/modules/pam_chroot/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
@@ -10,7 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
+ lib/libpam/libpam \
.include <dirdeps.mk>
diff --git a/lib/libpam/modules/pam_deny/Makefile.depend b/lib/libpam/modules/pam_deny/Makefile.depend
index 7cedd5f..1078f33 100644
--- a/lib/libpam/modules/pam_deny/Makefile.depend
+++ b/lib/libpam/modules/pam_deny/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
@@ -9,7 +8,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
+ lib/libpam/libpam \
.include <dirdeps.mk>
diff --git a/lib/libpam/modules/pam_echo/Makefile.depend b/lib/libpam/modules/pam_echo/Makefile.depend
index 467741f..8e09560 100644
--- a/lib/libpam/modules/pam_echo/Makefile.depend
+++ b/lib/libpam/modules/pam_echo/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
@@ -10,7 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
+ lib/libpam/libpam \
.include <dirdeps.mk>
diff --git a/lib/libpam/modules/pam_exec/Makefile.depend b/lib/libpam/modules/pam_exec/Makefile.depend
index 467741f..8e09560 100644
--- a/lib/libpam/modules/pam_exec/Makefile.depend
+++ b/lib/libpam/modules/pam_exec/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
@@ -10,7 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
+ lib/libpam/libpam \
.include <dirdeps.mk>
diff --git a/lib/libpam/modules/pam_ftpusers/Makefile.depend b/lib/libpam/modules/pam_ftpusers/Makefile.depend
index 467741f..8e09560 100644
--- a/lib/libpam/modules/pam_ftpusers/Makefile.depend
+++ b/lib/libpam/modules/pam_ftpusers/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
@@ -10,7 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
+ lib/libpam/libpam \
.include <dirdeps.mk>
diff --git a/lib/libpam/modules/pam_group/Makefile.depend b/lib/libpam/modules/pam_group/Makefile.depend
index 467741f..8e09560 100644
--- a/lib/libpam/modules/pam_group/Makefile.depend
+++ b/lib/libpam/modules/pam_group/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
@@ -10,7 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
+ lib/libpam/libpam \
.include <dirdeps.mk>
diff --git a/lib/libpam/modules/pam_guest/Makefile.depend b/lib/libpam/modules/pam_guest/Makefile.depend
index 467741f..8e09560 100644
--- a/lib/libpam/modules/pam_guest/Makefile.depend
+++ b/lib/libpam/modules/pam_guest/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
@@ -10,7 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
+ lib/libpam/libpam \
.include <dirdeps.mk>
diff --git a/lib/libpam/modules/pam_krb5/Makefile.depend b/lib/libpam/modules/pam_krb5/Makefile.depend
index f6e886e..2cde78f 100644
--- a/lib/libpam/modules/pam_krb5/Makefile.depend
+++ b/lib/libpam/modules/pam_krb5/Makefile.depend
@@ -1,24 +1,19 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
include \
include/xlocale \
kerberos5/lib/libasn1 \
- kerberos5/lib/libhx509 \
kerberos5/lib/libkrb5 \
- kerberos5/lib/libroken \
lib/${CSU_DIR} \
lib/libc \
lib/libcom_err \
lib/libcompiler_rt \
- lib/libcrypt \
lib/libpam/libpam \
- secure/lib/libcrypto \
- usr.bin/xinstall.host \
+ lib/libthr \
.include <dirdeps.mk>
diff --git a/lib/libpam/modules/pam_ksu/Makefile.depend b/lib/libpam/modules/pam_ksu/Makefile.depend
index f6e886e..d360572 100644
--- a/lib/libpam/modules/pam_ksu/Makefile.depend
+++ b/lib/libpam/modules/pam_ksu/Makefile.depend
@@ -1,24 +1,18 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
include \
include/xlocale \
kerberos5/lib/libasn1 \
- kerberos5/lib/libhx509 \
kerberos5/lib/libkrb5 \
- kerberos5/lib/libroken \
lib/${CSU_DIR} \
lib/libc \
- lib/libcom_err \
lib/libcompiler_rt \
- lib/libcrypt \
lib/libpam/libpam \
- secure/lib/libcrypto \
- usr.bin/xinstall.host \
+ lib/libthr \
.include <dirdeps.mk>
diff --git a/lib/libpam/modules/pam_lastlog/Makefile.depend b/lib/libpam/modules/pam_lastlog/Makefile.depend
index 467741f..8e09560 100644
--- a/lib/libpam/modules/pam_lastlog/Makefile.depend
+++ b/lib/libpam/modules/pam_lastlog/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
@@ -10,7 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
+ lib/libpam/libpam \
.include <dirdeps.mk>
diff --git a/lib/libpam/modules/pam_login_access/Makefile.depend b/lib/libpam/modules/pam_login_access/Makefile.depend
index 467741f..8e09560 100644
--- a/lib/libpam/modules/pam_login_access/Makefile.depend
+++ b/lib/libpam/modules/pam_login_access/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
@@ -10,7 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
+ lib/libpam/libpam \
.include <dirdeps.mk>
diff --git a/lib/libpam/modules/pam_nologin/Makefile.depend b/lib/libpam/modules/pam_nologin/Makefile.depend
index 0e5a167..8f9750f 100644
--- a/lib/libpam/modules/pam_nologin/Makefile.depend
+++ b/lib/libpam/modules/pam_nologin/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
@@ -12,7 +11,6 @@ DIRDEPS = \
lib/libcompiler_rt \
lib/libpam/libpam \
lib/libutil \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libpam/modules/pam_opie/Makefile.depend b/lib/libpam/modules/pam_opie/Makefile.depend
index 1e75b4a..62a9408 100644
--- a/lib/libpam/modules/pam_opie/Makefile.depend
+++ b/lib/libpam/modules/pam_opie/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
@@ -12,7 +11,6 @@ DIRDEPS = \
lib/libcompiler_rt \
lib/libopie \
lib/libpam/libpam \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libpam/modules/pam_opieaccess/Makefile.depend b/lib/libpam/modules/pam_opieaccess/Makefile.depend
index 7316349..cbfda79 100644
--- a/lib/libpam/modules/pam_opieaccess/Makefile.depend
+++ b/lib/libpam/modules/pam_opieaccess/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
@@ -11,7 +10,6 @@ DIRDEPS = \
lib/libcompiler_rt \
lib/libopie \
lib/libpam/libpam \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libpam/modules/pam_passwdqc/Makefile.depend b/lib/libpam/modules/pam_passwdqc/Makefile.depend
index 7cce822..e82ea24 100644
--- a/lib/libpam/modules/pam_passwdqc/Makefile.depend
+++ b/lib/libpam/modules/pam_passwdqc/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
@@ -12,7 +11,6 @@ DIRDEPS = \
lib/libcompiler_rt \
lib/libcrypt \
lib/libpam/libpam \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libpam/modules/pam_permit/Makefile.depend b/lib/libpam/modules/pam_permit/Makefile.depend
index 7cedd5f..1078f33 100644
--- a/lib/libpam/modules/pam_permit/Makefile.depend
+++ b/lib/libpam/modules/pam_permit/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
@@ -9,7 +8,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
+ lib/libpam/libpam \
.include <dirdeps.mk>
diff --git a/lib/libpam/modules/pam_radius/Makefile.depend b/lib/libpam/modules/pam_radius/Makefile.depend
index 8daba2c..f8940bf 100644
--- a/lib/libpam/modules/pam_radius/Makefile.depend
+++ b/lib/libpam/modules/pam_radius/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
@@ -12,7 +11,6 @@ DIRDEPS = \
lib/libcompiler_rt \
lib/libpam/libpam \
lib/libradius \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libpam/modules/pam_rhosts/Makefile.depend b/lib/libpam/modules/pam_rhosts/Makefile.depend
index 467741f..8e09560 100644
--- a/lib/libpam/modules/pam_rhosts/Makefile.depend
+++ b/lib/libpam/modules/pam_rhosts/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
@@ -10,7 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
+ lib/libpam/libpam \
.include <dirdeps.mk>
diff --git a/lib/libpam/modules/pam_rootok/Makefile.depend b/lib/libpam/modules/pam_rootok/Makefile.depend
index 7cedd5f..1078f33 100644
--- a/lib/libpam/modules/pam_rootok/Makefile.depend
+++ b/lib/libpam/modules/pam_rootok/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
@@ -9,7 +8,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
+ lib/libpam/libpam \
.include <dirdeps.mk>
diff --git a/lib/libpam/modules/pam_securetty/Makefile.depend b/lib/libpam/modules/pam_securetty/Makefile.depend
index 467741f..8e09560 100644
--- a/lib/libpam/modules/pam_securetty/Makefile.depend
+++ b/lib/libpam/modules/pam_securetty/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
@@ -10,7 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
+ lib/libpam/libpam \
.include <dirdeps.mk>
diff --git a/lib/libpam/modules/pam_self/Makefile.depend b/lib/libpam/modules/pam_self/Makefile.depend
index 7cedd5f..1078f33 100644
--- a/lib/libpam/modules/pam_self/Makefile.depend
+++ b/lib/libpam/modules/pam_self/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
@@ -9,7 +8,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
+ lib/libpam/libpam \
.include <dirdeps.mk>
diff --git a/lib/libpam/modules/pam_ssh/Makefile.depend b/lib/libpam/modules/pam_ssh/Makefile.depend
index e46aac4..08fb149 100644
--- a/lib/libpam/modules/pam_ssh/Makefile.depend
+++ b/lib/libpam/modules/pam_ssh/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
@@ -11,12 +10,10 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- lib/libcrypt \
lib/libpam/libpam \
lib/libutil \
secure/lib/libcrypto \
secure/lib/libssh \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libpam/modules/pam_tacplus/Makefile.depend b/lib/libpam/modules/pam_tacplus/Makefile.depend
index c3edc9b..98723a0 100644
--- a/lib/libpam/modules/pam_tacplus/Makefile.depend
+++ b/lib/libpam/modules/pam_tacplus/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
@@ -12,7 +11,6 @@ DIRDEPS = \
lib/libcompiler_rt \
lib/libpam/libpam \
lib/libtacplus \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libpam/modules/pam_unix/Makefile.depend b/lib/libpam/modules/pam_unix/Makefile.depend
index 47a9e7e..0876f5f 100644
--- a/lib/libpam/modules/pam_unix/Makefile.depend
+++ b/lib/libpam/modules/pam_unix/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
@@ -15,7 +14,6 @@ DIRDEPS = \
lib/libpam/libpam \
lib/libutil \
lib/libypclnt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libpam/static_modules/Makefile b/lib/libpam/static_modules/Makefile
index 07a6c69..429e660 100644
--- a/lib/libpam/static_modules/Makefile
+++ b/lib/libpam/static_modules/Makefile
@@ -1,5 +1,5 @@
#-
-# Copyright (c) 1998, 2013 Juniper Networks, Inc.
+# Copyright (c) 1998-2015 Juniper Networks, Inc.
# All rights reserved.
# Copyright (c) 2002 Networks Associates Technology, Inc.
# All rights reserved.
@@ -43,8 +43,7 @@ all:
SRCS = openpam_static.c
-NO_PROFILE=
-NO_MAN=
+MAN=
#
# Static modules
@@ -62,11 +61,11 @@ STATICOBJS+= openpam_static_modules.o
CLEANFILES+= openpam_static.o \
openpam_static_modules.o
-openpam_static_modules.o: openpam_static.o ${STATIC_MODULES}
- ${LD} -o ${.TARGET} -r --whole-archive ${.ALLSRC}
-
.include <bsd.prog.mk>
.if empty(_SKIP_BUILD)
+openpam_static_modules.o: openpam_static.o ${STATIC_MODULES}
+ ${LD} -o ${.TARGET} -r --whole-archive ${.ALLSRC}
+
all: ${STATICOBJS}
.endif
diff --git a/lib/libpam/static_modules/Makefile.depend b/lib/libpam/static_modules/Makefile.depend
index fc4eb35..373bac4 100644
--- a/lib/libpam/static_modules/Makefile.depend
+++ b/lib/libpam/static_modules/Makefile.depend
@@ -1,9 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
-DEP_MACHINE := ${.PARSEFILE:E}
-
DIRDEPS = \
include \
include/xlocale \
diff --git a/lib/libpcap/Makefile.depend b/lib/libpcap/Makefile.depend
index 54902e7..7426299 100644
--- a/lib/libpcap/Makefile.depend
+++ b/lib/libpcap/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libpmc/Makefile.depend b/lib/libpmc/Makefile.depend
index 593d407..dde2d60 100644
--- a/lib/libpmc/Makefile.depend
+++ b/lib/libpmc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libpmc/libpmc.c b/lib/libpmc/libpmc.c
index d9d7902..9305618 100644
--- a/lib/libpmc/libpmc.c
+++ b/lib/libpmc/libpmc.c
@@ -268,6 +268,16 @@ static const struct pmc_event_descr westmereuc_event_table[] =
__PMC_EV_ALIAS_WESTMEREUC()
};
+static const struct pmc_event_descr cortex_a8_event_table[] =
+{
+ __PMC_EV_ALIAS_ARMV7_CORTEX_A8()
+};
+
+static const struct pmc_event_descr cortex_a9_event_table[] =
+{
+ __PMC_EV_ALIAS_ARMV7_CORTEX_A9()
+};
+
static const struct pmc_event_descr cortex_a53_event_table[] =
{
__PMC_EV_ALIAS_ARMV8_CORTEX_A53()
@@ -308,7 +318,8 @@ PMC_MDEP_TABLE(p4, P4, PMC_CLASS_SOFT, PMC_CLASS_TSC);
PMC_MDEP_TABLE(p5, P5, PMC_CLASS_SOFT, PMC_CLASS_TSC);
PMC_MDEP_TABLE(p6, P6, PMC_CLASS_SOFT, PMC_CLASS_TSC);
PMC_MDEP_TABLE(xscale, XSCALE, PMC_CLASS_SOFT, PMC_CLASS_XSCALE);
-PMC_MDEP_TABLE(armv7, ARMV7, PMC_CLASS_SOFT, PMC_CLASS_ARMV7);
+PMC_MDEP_TABLE(cortex_a8, ARMV7, PMC_CLASS_SOFT, PMC_CLASS_ARMV7);
+PMC_MDEP_TABLE(cortex_a9, ARMV7, PMC_CLASS_SOFT, PMC_CLASS_ARMV7);
PMC_MDEP_TABLE(cortex_a53, ARMV8, PMC_CLASS_SOFT, PMC_CLASS_ARMV8);
PMC_MDEP_TABLE(cortex_a57, ARMV8, PMC_CLASS_SOFT, PMC_CLASS_ARMV8);
PMC_MDEP_TABLE(mips24k, MIPS24K, PMC_CLASS_SOFT, PMC_CLASS_MIPS24K);
@@ -377,7 +388,8 @@ PMC_CLASS_TABLE_DESC(tsc, TSC, tsc, tsc);
#if defined(__XSCALE__)
PMC_CLASS_TABLE_DESC(xscale, XSCALE, xscale, xscale);
#endif
-PMC_CLASS_TABLE_DESC(armv7, ARMV7, armv7, armv7);
+PMC_CLASS_TABLE_DESC(cortex_a8, ARMV7, cortex_a9, armv7);
+PMC_CLASS_TABLE_DESC(cortex_a9, ARMV7, cortex_a9, armv7);
#endif
#if defined(__aarch64__)
PMC_CLASS_TABLE_DESC(cortex_a53, ARMV8, cortex_a53, arm64);
@@ -2436,12 +2448,20 @@ xscale_allocate_pmc(enum pmc_event pe, char *ctrspec __unused,
}
#endif
-static struct pmc_event_alias armv7_aliases[] = {
+static struct pmc_event_alias cortex_a8_aliases[] = {
EV_ALIAS("dc-misses", "L1_DCACHE_REFILL"),
EV_ALIAS("ic-misses", "L1_ICACHE_REFILL"),
EV_ALIAS("instructions", "INSTR_EXECUTED"),
EV_ALIAS(NULL, NULL)
};
+
+static struct pmc_event_alias cortex_a9_aliases[] = {
+ EV_ALIAS("dc-misses", "L1_DCACHE_REFILL"),
+ EV_ALIAS("ic-misses", "L1_ICACHE_REFILL"),
+ EV_ALIAS("instructions", "INSTR_EXECUTED"),
+ EV_ALIAS(NULL, NULL)
+};
+
static int
armv7_allocate_pmc(enum pmc_event pe, char *ctrspec __unused,
struct pmc_op_pmcallocate *pmc_config __unused)
@@ -2981,8 +3001,17 @@ pmc_event_names_of_class(enum pmc_class cl, const char ***eventnames,
count = PMC_EVENT_TABLE_SIZE(xscale);
break;
case PMC_CLASS_ARMV7:
- ev = armv7_event_table;
- count = PMC_EVENT_TABLE_SIZE(armv7);
+ switch (cpu_info.pm_cputype) {
+ default:
+ case PMC_CPU_ARMV7_CORTEX_A8:
+ ev = cortex_a8_event_table;
+ count = PMC_EVENT_TABLE_SIZE(cortex_a8);
+ break;
+ case PMC_CPU_ARMV7_CORTEX_A9:
+ ev = cortex_a9_event_table;
+ count = PMC_EVENT_TABLE_SIZE(cortex_a9);
+ break;
+ }
break;
case PMC_CLASS_ARMV8:
switch (cpu_info.pm_cputype) {
@@ -3289,9 +3318,13 @@ pmc_init(void)
pmc_class_table[n] = &xscale_class_table_descr;
break;
#endif
- case PMC_CPU_ARMV7:
- PMC_MDEP_INIT(armv7);
- pmc_class_table[n] = &armv7_class_table_descr;
+ case PMC_CPU_ARMV7_CORTEX_A8:
+ PMC_MDEP_INIT(cortex_a8);
+ pmc_class_table[n] = &cortex_a8_class_table_descr;
+ break;
+ case PMC_CPU_ARMV7_CORTEX_A9:
+ PMC_MDEP_INIT(cortex_a9);
+ pmc_class_table[n] = &cortex_a9_class_table_descr;
break;
#endif
#if defined(__aarch64__)
@@ -3515,8 +3548,18 @@ _pmc_name_of_event(enum pmc_event pe, enum pmc_cputype cpu)
ev = xscale_event_table;
evfence = xscale_event_table + PMC_EVENT_TABLE_SIZE(xscale);
} else if (pe >= PMC_EV_ARMV7_FIRST && pe <= PMC_EV_ARMV7_LAST) {
- ev = armv7_event_table;
- evfence = armv7_event_table + PMC_EVENT_TABLE_SIZE(armv7);
+ switch (cpu) {
+ case PMC_CPU_ARMV7_CORTEX_A8:
+ ev = cortex_a8_event_table;
+ evfence = cortex_a8_event_table + PMC_EVENT_TABLE_SIZE(cortex_a8);
+ break;
+ case PMC_CPU_ARMV7_CORTEX_A9:
+ ev = cortex_a9_event_table;
+ evfence = cortex_a9_event_table + PMC_EVENT_TABLE_SIZE(cortex_a9);
+ break;
+ default: /* Unknown CPU type. */
+ break;
+ }
} else if (pe >= PMC_EV_ARMV8_FIRST && pe <= PMC_EV_ARMV8_LAST) {
switch (cpu) {
case PMC_CPU_ARMV8_CORTEX_A53:
diff --git a/lib/libproc/Makefile.depend b/lib/libproc/Makefile.depend
index f86335a..feb045f 100644
--- a/lib/libproc/Makefile.depend
+++ b/lib/libproc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libprocstat/Makefile.depend b/lib/libprocstat/Makefile.depend
index 1808010..11ffd8d 100644
--- a/lib/libprocstat/Makefile.depend
+++ b/lib/libprocstat/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
include \
diff --git a/lib/libprocstat/libprocstat.c b/lib/libprocstat/libprocstat.c
index 727419b..c292d5d 100644
--- a/lib/libprocstat/libprocstat.c
+++ b/lib/libprocstat/libprocstat.c
@@ -1235,7 +1235,7 @@ procstat_get_vnode_info_kvm(kvm_t *kd, struct filestat *fst,
struct vnode vnode;
char tagstr[12];
void *vp;
- int error, found;
+ int error;
unsigned int i;
assert(kd);
@@ -1264,7 +1264,7 @@ procstat_get_vnode_info_kvm(kvm_t *kd, struct filestat *fst,
/*
* Find appropriate handler.
*/
- for (i = 0, found = 0; i < NTYPES; i++)
+ for (i = 0; i < NTYPES; i++)
if (!strcmp(fstypes[i].tag, tagstr)) {
if (fstypes[i].handler(kd, &vnode, vn) != 0) {
goto fail;
diff --git a/lib/libprocstat/zfs/Makefile.depend b/lib/libprocstat/zfs/Makefile.depend
index d26b6e7..fd3b785 100644
--- a/lib/libprocstat/zfs/Makefile.depend
+++ b/lib/libprocstat/zfs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libradius/Makefile.depend b/lib/libradius/Makefile.depend
index 640beb9..f318cc1 100644
--- a/lib/libradius/Makefile.depend
+++ b/lib/libradius/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
@@ -10,7 +11,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
secure/lib/libcrypto \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/librpcsec_gss/Makefile.depend b/lib/librpcsec_gss/Makefile.depend
index 89fa5df..b376142 100644
--- a/lib/librpcsec_gss/Makefile.depend
+++ b/lib/librpcsec_gss/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/librpcsvc/Makefile.depend b/lib/librpcsvc/Makefile.depend
index 5d080b0..e431374 100644
--- a/lib/librpcsvc/Makefile.depend
+++ b/lib/librpcsvc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/librt/Makefile.depend b/lib/librt/Makefile.depend
index fd5a535..0a2f351 100644
--- a/lib/librt/Makefile.depend
+++ b/lib/librt/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/librtld_db/Makefile.depend b/lib/librtld_db/Makefile.depend
index 23bc80e..fad79f2 100644
--- a/lib/librtld_db/Makefile.depend
+++ b/lib/librtld_db/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libsbuf/Makefile b/lib/libsbuf/Makefile
index 79d3fe9..98ceeb6 100644
--- a/lib/libsbuf/Makefile
+++ b/lib/libsbuf/Makefile
@@ -2,7 +2,7 @@
LIB= sbuf
SHLIBDIR?= /lib
-SRCS= subr_sbuf.c
+SRCS= subr_prf.c subr_sbuf.c
SHLIB_MAJOR = 6
diff --git a/lib/libsbuf/Makefile.depend b/lib/libsbuf/Makefile.depend
index 8bbd7a2..9e2283a 100644
--- a/lib/libsbuf/Makefile.depend
+++ b/lib/libsbuf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libsbuf/Symbol.map b/lib/libsbuf/Symbol.map
index cf2508f..164b8f3 100644
--- a/lib/libsbuf/Symbol.map
+++ b/lib/libsbuf/Symbol.map
@@ -27,3 +27,7 @@ FBSD_1.3 {
sbuf_start_section;
sbuf_end_section;
};
+
+FBSD_1.4 {
+ sbuf_hexdump;
+};
diff --git a/lib/libsbuf/Version.def b/lib/libsbuf/Version.def
index fb0b3f6..fd5c6be 100644
--- a/lib/libsbuf/Version.def
+++ b/lib/libsbuf/Version.def
@@ -5,3 +5,6 @@ FBSD_1.2 {
FBSD_1.3 {
} FBSD_1.2;
+
+FBSD_1.4 {
+} FBSD_1.3;
diff --git a/lib/libsdp/Makefile.depend b/lib/libsdp/Makefile.depend
index b4cc6bf..37f8632 100644
--- a/lib/libsdp/Makefile.depend
+++ b/lib/libsdp/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libsm/Makefile.depend b/lib/libsm/Makefile.depend
index 27d4c25..2b8cf93 100644
--- a/lib/libsm/Makefile.depend
+++ b/lib/libsm/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libsmb/Makefile.depend b/lib/libsmb/Makefile.depend
index b370707..441168d 100644
--- a/lib/libsmb/Makefile.depend
+++ b/lib/libsmb/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libsmdb/Makefile.depend b/lib/libsmdb/Makefile.depend
index 5bc2c13..1ee0d0e 100644
--- a/lib/libsmdb/Makefile.depend
+++ b/lib/libsmdb/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libsmutil/Makefile.depend b/lib/libsmutil/Makefile.depend
index be80602..d534e11 100644
--- a/lib/libsmutil/Makefile.depend
+++ b/lib/libsmutil/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libsqlite3/Makefile.depend b/lib/libsqlite3/Makefile.depend
index fd5a535..0a2f351 100644
--- a/lib/libsqlite3/Makefile.depend
+++ b/lib/libsqlite3/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libstand/Makefile.depend b/lib/libstand/Makefile.depend
index 34236cb..bb85bcd 100644
--- a/lib/libstand/Makefile.depend
+++ b/lib/libstand/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libstdbuf/Makefile.depend b/lib/libstdbuf/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libstdbuf/Makefile.depend
+++ b/lib/libstdbuf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libstdthreads/Makefile.depend b/lib/libstdthreads/Makefile.depend
index 37acbe0..441e1ee 100644
--- a/lib/libstdthreads/Makefile.depend
+++ b/lib/libstdthreads/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libtacplus/Makefile.depend b/lib/libtacplus/Makefile.depend
index 9c2e453..6a2d406 100644
--- a/lib/libtacplus/Makefile.depend
+++ b/lib/libtacplus/Makefile.depend
@@ -1,7 +1,6 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
@@ -12,7 +11,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libmd \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libtelnet/Makefile.depend b/lib/libtelnet/Makefile.depend
index a055e3e..0edf350 100644
--- a/lib/libtelnet/Makefile.depend
+++ b/lib/libtelnet/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libthr/Makefile.depend b/lib/libthr/Makefile.depend
index 3e69552..9cb890b 100644
--- a/lib/libthr/Makefile.depend
+++ b/lib/libthr/Makefile.depend
@@ -1,14 +1,13 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
include \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libthread_db/Makefile.depend b/lib/libthread_db/Makefile.depend
index 8bbd7a2..9e2283a 100644
--- a/lib/libthread_db/Makefile.depend
+++ b/lib/libthread_db/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libucl/Makefile.depend b/lib/libucl/Makefile.depend
index a83fb20..3dce64a 100644
--- a/lib/libucl/Makefile.depend
+++ b/lib/libucl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libufs/Makefile.depend b/lib/libufs/Makefile.depend
index 593d407..dde2d60 100644
--- a/lib/libufs/Makefile.depend
+++ b/lib/libufs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libugidfw/Makefile.depend b/lib/libugidfw/Makefile.depend
index 593d407..dde2d60 100644
--- a/lib/libugidfw/Makefile.depend
+++ b/lib/libugidfw/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libugidfw/ugidfw.c b/lib/libugidfw/ugidfw.c
index 0dc423d..479ab46 100644
--- a/lib/libugidfw/ugidfw.c
+++ b/lib/libugidfw/ugidfw.c
@@ -64,11 +64,10 @@ bsde_rule_to_string(struct mac_bsdextended_rule *rule, char *buf, size_t buflen)
struct statfs *mntbuf;
char *cur, type[sizeof(rule->mbr_object.mbo_type) * CHAR_BIT + 1];
size_t left, len;
- int anymode, unknownmode, truncated, numfs, i, notdone;
+ int anymode, unknownmode, numfs, i, notdone;
cur = buf;
left = buflen;
- truncated = 0;
len = snprintf(cur, left, "subject ");
if (len < 0 || len > left)
@@ -1216,7 +1215,7 @@ bsde_delete_rule(int rulenum, size_t buflen, char *errstr)
{
struct mac_bsdextended_rule rule;
int name[10];
- size_t len, size;
+ size_t len;
int error;
if (bsde_check_version(buflen, errstr) != 0)
@@ -1233,8 +1232,7 @@ bsde_delete_rule(int rulenum, size_t buflen, char *errstr)
name[len] = rulenum;
len++;
- size = sizeof(rule);
- error = sysctl(name, len, NULL, NULL, &rule, 0);
+ error = sysctl(name, len, NULL, NULL, &rule, sizeof(rule));
if (error) {
len = snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules",
rulenum, strerror(errno));
@@ -1249,7 +1247,7 @@ bsde_set_rule(int rulenum, struct mac_bsdextended_rule *rule, size_t buflen,
char *errstr)
{
int name[10];
- size_t len, size;
+ size_t len;
int error;
if (bsde_check_version(buflen, errstr) != 0)
@@ -1266,8 +1264,7 @@ bsde_set_rule(int rulenum, struct mac_bsdextended_rule *rule, size_t buflen,
name[len] = rulenum;
len++;
- size = sizeof(*rule);
- error = sysctl(name, len, NULL, NULL, rule, size);
+ error = sysctl(name, len, NULL, NULL, rule, sizeof(*rule));
if (error) {
len = snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules",
rulenum, strerror(errno));
@@ -1283,7 +1280,7 @@ bsde_add_rule(int *rulenum, struct mac_bsdextended_rule *rule, size_t buflen,
{
char charstr[BUFSIZ];
int name[10];
- size_t len, size;
+ size_t len;
int error, rule_slots;
if (bsde_check_version(buflen, errstr) != 0)
@@ -1307,8 +1304,7 @@ bsde_add_rule(int *rulenum, struct mac_bsdextended_rule *rule, size_t buflen,
name[len] = rule_slots;
len++;
- size = sizeof(*rule);
- error = sysctl(name, len, NULL, NULL, rule, size);
+ error = sysctl(name, len, NULL, NULL, rule, sizeof(*rule));
if (error) {
len = snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules",
rule_slots, strerror(errno));
diff --git a/lib/libulog/Makefile.depend b/lib/libulog/Makefile.depend
index da3a812..2e2a25e 100644
--- a/lib/libulog/Makefile.depend
+++ b/lib/libulog/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
include \
diff --git a/lib/libunbound/Makefile.depend b/lib/libunbound/Makefile.depend
index 2dac9b8..45199c4 100644
--- a/lib/libunbound/Makefile.depend
+++ b/lib/libunbound/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libusb/Makefile.depend b/lib/libusb/Makefile.depend
index fd5a535..0a2f351 100644
--- a/lib/libusb/Makefile.depend
+++ b/lib/libusb/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libusbhid/Makefile.depend b/lib/libusbhid/Makefile.depend
index 593d407..dde2d60 100644
--- a/lib/libusbhid/Makefile.depend
+++ b/lib/libusbhid/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libutil/Makefile b/lib/libutil/Makefile
index 7e5f1a3..35d146a 100644
--- a/lib/libutil/Makefile
+++ b/lib/libutil/Makefile
@@ -9,8 +9,9 @@ LIB= util
SHLIB_MAJOR= 9
SRCS= _secure_path.c auth.c expand_number.c flopen.c fparseln.c gr_util.c \
- hexdump.c humanize_number.c kinfo_getfile.c kinfo_getfile.c \
- kinfo_getallproc.c kinfo_getproc.c kinfo_getvmmap.c kld.c \
+ hexdump.c humanize_number.c kinfo_getfile.c \
+ kinfo_getallproc.c kinfo_getproc.c kinfo_getvmmap.c \
+ kinfo_getvmobject.c kld.c \
login_auth.c login_cap.c \
login_class.c login_crypt.c login_ok.c login_times.c login_tty.c \
pidfile.c property.c pty.c pw_util.c quotafile.c realhostname.c \
@@ -27,7 +28,8 @@ CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../libc/gen/
MAN+= expand_number.3 flopen.3 fparseln.3 hexdump.3 \
humanize_number.3 kinfo_getallproc.3 kinfo_getfile.3 \
- kinfo_getproc.3 kinfo_getvmmap.3 kld.3 login_auth.3 login_cap.3 \
+ kinfo_getproc.3 kinfo_getvmmap.3 kinfo_getvmobject.3 kld.3 \
+ login_auth.3 login_cap.3 \
login_class.3 login_ok.3 login_times.3 login_tty.3 pidfile.3 \
property.3 pty.3 quotafile.3 realhostname.3 realhostname_sa.3 \
_secure_path.3 trimdomain.3 uucplock.3 pw_util.3
diff --git a/lib/libutil/Makefile.depend b/lib/libutil/Makefile.depend
index bd8ae02..54c1f6f 100644
--- a/lib/libutil/Makefile.depend
+++ b/lib/libutil/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
@@ -9,7 +10,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libutil/hexdump.3 b/lib/libutil/hexdump.3
index 8e997ac..9fa96f8 100644
--- a/lib/libutil/hexdump.3
+++ b/lib/libutil/hexdump.3
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 1, 2008
+.Dd May 8, 2014
.Dt HEXDUMP 3
.Os
.Sh NAME
@@ -36,8 +36,17 @@
.Nd "dump a block of bytes to standard out in hexadecimal form"
.Sh SYNOPSIS
.In libutil.h
+.In sys/sbuf.h
.Ft void
.Fn hexdump "void *ptr" "int length" "const char *hdr" "int flags"
+.Ft void
+.Fo sbuf_hexdump
+.Fa "struct sbuf *sb"
+.Fa "void *ptr"
+.Fa "int length"
+.Fa "const char *hdr"
+.Fa "int flags"
+.Fc
.Sh DESCRIPTION
The
.Fn hexdump
@@ -50,6 +59,11 @@ output will start with an offset count, followed by 16 hexadecimal values,
followed by 16
.Tn ASCII
characters.
+.Pp
+The
+.Fn sbuf_hexdump
+function prints the hexdump to the supplied
+.Xr sbuf 9 .
.Bl -tag -width indent
.It Fa ptr
Pointer to the array of bytes to print.
@@ -88,7 +102,8 @@ Do not print the character values on each line.
.El
.El
.Sh SEE ALSO
-.Xr ascii 7
+.Xr ascii 7 ,
+.Xr sbuf 9
.Sh AUTHORS
This manual page was written by
.An Scott Long .
diff --git a/lib/libutil/kinfo_getallproc.3 b/lib/libutil/kinfo_getallproc.3
index 56d4ad6..7005d4f 100644
--- a/lib/libutil/kinfo_getallproc.3
+++ b/lib/libutil/kinfo_getallproc.3
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 9, 2009
+.Dd May 27, 2015
.Dt KINFO_GETALLPROC 3
.Os
.Sh NAME
@@ -35,6 +35,7 @@
.Lb libutil
.Sh SYNOPSIS
.In sys/types.h
+.In sys/user.h
.In libutil.h
.Ft struct kinfo_proc *
.Fn kinfo_getallproc "int *cntp"
diff --git a/lib/libutil/kinfo_getfile.3 b/lib/libutil/kinfo_getfile.3
index 1e0bab7..2a35687 100644
--- a/lib/libutil/kinfo_getfile.3
+++ b/lib/libutil/kinfo_getfile.3
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 6, 2008
+.Dd May 27, 2015
.Dt KINFO_GETFILE 3
.Os
.Sh NAME
@@ -35,6 +35,7 @@
.Lb libutil
.Sh SYNOPSIS
.In sys/types.h
+.In sys/user.h
.In libutil.h
.Ft struct kinfo_file *
.Fn kinfo_getfile "pid_t pid" "int *cntp"
diff --git a/lib/libutil/kinfo_getproc.3 b/lib/libutil/kinfo_getproc.3
index 804cb6c..f5ccbc5 100644
--- a/lib/libutil/kinfo_getproc.3
+++ b/lib/libutil/kinfo_getproc.3
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 1, 2013
+.Dd May 27, 2015
.Dt KINFO_GETPROC 3
.Os
.Sh NAME
@@ -35,6 +35,7 @@
.Lb libutil
.Sh SYNOPSIS
.In sys/types.h
+.In sys/user.h
.In libutil.h
.Ft struct kinfo_proc *
.Fn kinfo_getproc "pid_t pid"
diff --git a/lib/libutil/kinfo_getvmmap.3 b/lib/libutil/kinfo_getvmmap.3
index 165de60..c6a1370 100644
--- a/lib/libutil/kinfo_getvmmap.3
+++ b/lib/libutil/kinfo_getvmmap.3
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 6, 2008
+.Dd May 27, 2015
.Dt KINFO_GETVMMAP 3
.Os
.Sh NAME
@@ -35,6 +35,7 @@
.Lb libutil
.Sh SYNOPSIS
.In sys/types.h
+.In sys/user.h
.In libutil.h
.Ft struct kinfo_vmentry *
.Fn kinfo_getvmmap "pid_t pid" "int *cntp"
diff --git a/lib/libutil/kinfo_getvmobject.3 b/lib/libutil/kinfo_getvmobject.3
new file mode 100644
index 0000000..dc0edd2
--- /dev/null
+++ b/lib/libutil/kinfo_getvmobject.3
@@ -0,0 +1,74 @@
+.\"
+.\" Copyright (c) 2015 John Baldwin <jhb@FreeBSD.org>
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd May 27, 2015
+.Dt KINFO_GETVMOBJECT 3
+.Os
+.Sh NAME
+.Nm kinfo_getvmobject
+.Nd function for getting system-wide memory information
+.Sh LIBRARY
+.Lb libutil
+.Sh SYNOPSIS
+.In sys/types.h
+.In sys/user.h
+.In libutil.h
+.Ft struct kinfo_vmobject *
+.Fn kinfo_getvmobject "int *cntp"
+.Sh DESCRIPTION
+This function is used to obtain information about the objects using memory
+in the system.
+.Pp
+The
+.Ar cntp
+argument allows the caller to know how many records are returned.
+.Pp
+This function is a wrapper around the
+.Dq vm.objects
+.Xr sysctl 3
+MIB.
+While the kernel returns a packed structure, this function expands the
+data into a fixed record format.
+.Sh RETURN VALUES
+On success the
+.Fn kinfo_getvmobject
+function returns a pointer to an array of
+.Vt struct kinfo_vmobject
+structures as defined by
+.In sys/user.h .
+The array is allocated by an internal call to
+.Xr malloc 3
+and must be freed by the caller with a call to
+.Xr free 3 .
+On failure the
+.Fn kinfo_getvmobject
+function returns
+.Dv NULL .
+.Sh SEE ALSO
+.Xr free 3 ,
+.Xr kinfo_getvmmap 3 ,
+.Xr malloc 3
diff --git a/usr.bin/csup/token.l b/lib/libutil/kinfo_getvmobject.c
index 69f5ea4..7e031da 100644
--- a/usr.bin/csup/token.l
+++ b/lib/libutil/kinfo_getvmobject.c
@@ -1,6 +1,6 @@
-%{
-/*-
- * Copyright (c) 2003-2004, Maxime Henrion <mux@FreeBSD.org>
+/*
+ * Copyright (c) 2013 Hudson River Trading LLC
+ * Written by: John H. Baldwin <jhb@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,57 +23,72 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD$
*/
-#include <err.h>
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#include <sys/user.h>
#include <stdlib.h>
#include <string.h>
-#include "parse.h"
-#include "misc.h"
-#include "token.h"
-
-int lineno = 1;
-
-%}
+#include "libutil.h"
-%option nounput
-%option noyywrap
-
-%%
+struct kinfo_vmobject *
+kinfo_getvmobject(int *cntp)
+{
+ char *buf, *bp, *ep;
+ struct kinfo_vmobject *kvo, *list, *kp;
+ size_t len;
+ int cnt, i;
-[ \t]+ ;
-#.* ;
-\*default { return DEFAULT; }
-base { yylval.i = PT_BASE; return NAME; }
-date { yylval.i = PT_DATE; return NAME; }
-host { yylval.i = PT_HOST; return NAME; }
-prefix { yylval.i = PT_PREFIX; return NAME; }
-release { yylval.i = PT_RELEASE; return NAME; }
-tag { yylval.i = PT_TAG; return NAME; }
-umask { yylval.i = PT_UMASK; return NAME; }
-list { yylval.i = PT_LIST; return NAME; }
-norsync { yylval.i = PT_NORSYNC; return NAME; }
-= { return EQUAL; }
-compress { yylval.i = PT_COMPRESS; return BOOLEAN; }
-delete { yylval.i = PT_DELETE; return BOOLEAN; }
-use-rel-suffix { yylval.i = PT_USE_REL_SUFFIX; return BOOLEAN; }
-[a-zA-Z0-9./_-]+ {
- yylval.str = strdup(yytext);
- if (yylval.str == NULL)
- err(1, "strdup");
- return STRING;
- }
-\n lineno++;
+ buf = NULL;
+ for (i = 0; i < 3; i++) {
+ if (sysctlbyname("vm.objects", NULL, &len, NULL, 0) < 0)
+ return (NULL);
+ buf = reallocf(buf, len);
+ if (buf == NULL)
+ return (NULL);
+ if (sysctlbyname("vm.objects", buf, &len, NULL, 0) == 0)
+ goto unpack;
+ if (errno != ENOMEM) {
+ free(buf);
+ return (NULL);
+ }
+ }
+ free(buf);
+ return (NULL);
-%%
+unpack:
+ /* Count items */
+ cnt = 0;
+ bp = buf;
+ ep = buf + len;
+ while (bp < ep) {
+ kvo = (struct kinfo_vmobject *)(uintptr_t)bp;
+ bp += kvo->kvo_structsize;
+ cnt++;
+ }
-void
-yyerror(const char *s)
-{
+ list = calloc(cnt, sizeof(*list));
+ if (list == NULL) {
+ free(buf);
+ return (NULL);
+ }
- lprintf(-1, "Parse error line %d: %s: %s\n", lineno, s, yytext);
- exit(1);
+ /* Unpack */
+ bp = buf;
+ kp = list;
+ while (bp < ep) {
+ kvo = (struct kinfo_vmobject *)(uintptr_t)bp;
+ memcpy(kp, kvo, kvo->kvo_structsize);
+ bp += kvo->kvo_structsize;
+ kp->kvo_structsize = sizeof(*kp);
+ kp++;
+ }
+ free(buf);
+ *cntp = cnt;
+ return (list);
}
diff --git a/lib/libutil/libutil.h b/lib/libutil/libutil.h
index b8b9836..b20ffa2 100644
--- a/lib/libutil/libutil.h
+++ b/lib/libutil/libutil.h
@@ -102,6 +102,8 @@ struct kinfo_file *
kinfo_getfile(pid_t _pid, int *_cntp);
struct kinfo_vmentry *
kinfo_getvmmap(pid_t _pid, int *_cntp);
+struct kinfo_vmobject *
+ kinfo_getvmobject(int *_cntp);
struct kinfo_proc *
kinfo_getallproc(int *_cntp);
struct kinfo_proc *
diff --git a/lib/libutil/pw_util.3 b/lib/libutil/pw_util.3
index 0d8c763..706368f 100644
--- a/lib/libutil/pw_util.3
+++ b/lib/libutil/pw_util.3
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 30, 2012
+.Dd June 06, 2015
.Dt PW_UTIL 3
.Os
.Sh NAME
@@ -222,7 +222,7 @@ and it is the caller's responsibility to free it with
The
.Fn pw_mkdb
function regenerates the password database by running
-.Xr pw_mkdb 8 .
+.Xr pwd_mkdb 8 .
If
.Fa user
only the record corresponding to that user will be updated.
diff --git a/lib/libvgl/Makefile.depend b/lib/libvgl/Makefile.depend
index 467741f..09164c1 100644
--- a/lib/libvgl/Makefile.depend
+++ b/lib/libvgl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libvmmapi/Makefile.depend b/lib/libvmmapi/Makefile.depend
index 074ac81..a5c14b5 100644
--- a/lib/libvmmapi/Makefile.depend
+++ b/lib/libvmmapi/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/libwrap/Makefile.depend b/lib/libwrap/Makefile.depend
index bd8ae02..69d1724 100644
--- a/lib/libwrap/Makefile.depend
+++ b/lib/libwrap/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libxo/Makefile.depend b/lib/libxo/Makefile.depend
index 593d407..dde2d60 100644
--- a/lib/libxo/Makefile.depend
+++ b/lib/libxo/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/liby/Makefile.depend b/lib/liby/Makefile.depend
index 993ab06..79506ce 100644
--- a/lib/liby/Makefile.depend
+++ b/lib/liby/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/libypclnt/Makefile.depend b/lib/libypclnt/Makefile.depend
index 6b4dcd4..8ee531b 100644
--- a/lib/libypclnt/Makefile.depend
+++ b/lib/libypclnt/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
@@ -10,7 +11,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libz/Makefile.depend b/lib/libz/Makefile.depend
index 8bbd7a2..3646e2e 100644
--- a/lib/libz/Makefile.depend
+++ b/lib/libz/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
include \
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/msun/Makefile.depend b/lib/msun/Makefile.depend
index 8bbd7a2..3646e2e 100644
--- a/lib/msun/Makefile.depend
+++ b/lib/msun/Makefile.depend
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
gnu/lib/csu \
gnu/lib/libgcc \
include \
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/ncurses/form/Makefile.depend b/lib/ncurses/form/Makefile.depend
index c3295ff..fc0fd0c 100644
--- a/lib/ncurses/form/Makefile.depend
+++ b/lib/ncurses/form/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/ncurses/formw/Makefile.depend b/lib/ncurses/formw/Makefile.depend
index d56ffbb..04d041a4 100644
--- a/lib/ncurses/formw/Makefile.depend
+++ b/lib/ncurses/formw/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/ncurses/menu/Makefile.depend b/lib/ncurses/menu/Makefile.depend
index 5c8368f..cb8d80b 100644
--- a/lib/ncurses/menu/Makefile.depend
+++ b/lib/ncurses/menu/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/ncurses/menuw/Makefile.depend b/lib/ncurses/menuw/Makefile.depend
index 49f1882..771e004 100644
--- a/lib/ncurses/menuw/Makefile.depend
+++ b/lib/ncurses/menuw/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/ncurses/ncurses/Makefile.depend b/lib/ncurses/ncurses/Makefile.depend
index 52197c8..4a07eb0 100644
--- a/lib/ncurses/ncurses/Makefile.depend
+++ b/lib/ncurses/ncurses/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/ncurses/ncursesw/Makefile.depend b/lib/ncurses/ncursesw/Makefile.depend
index 045bbfc..1855faf 100644
--- a/lib/ncurses/ncursesw/Makefile.depend
+++ b/lib/ncurses/ncursesw/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/lib/ncurses/panel/Makefile.depend b/lib/ncurses/panel/Makefile.depend
index 2359930..3f7129c 100644
--- a/lib/ncurses/panel/Makefile.depend
+++ b/lib/ncurses/panel/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/lib/ncurses/panelw/Makefile.depend b/lib/ncurses/panelw/Makefile.depend
index 2ec6472..0e508be 100644
--- a/lib/ncurses/panelw/Makefile.depend
+++ b/lib/ncurses/panelw/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/libexec/atf/atf-check/Makefile.depend b/libexec/atf/atf-check/Makefile.depend
index 40b975a..494810e 100644
--- a/libexec/atf/atf-check/Makefile.depend
+++ b/libexec/atf/atf-check/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/atf/atf-sh/Makefile.depend b/libexec/atf/atf-sh/Makefile.depend
index 40b975a..494810e 100644
--- a/libexec/atf/atf-sh/Makefile.depend
+++ b/libexec/atf/atf-sh/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/atrun/Makefile.depend b/libexec/atrun/Makefile.depend
index ea1c9d1..8f9750f 100644
--- a/libexec/atrun/Makefile.depend
+++ b/libexec/atrun/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/bootpd/Makefile.depend b/libexec/bootpd/Makefile.depend
index 16b5e42..74de0b1 100644
--- a/libexec/bootpd/Makefile.depend
+++ b/libexec/bootpd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/libexec/bootpd/bootpgw/Makefile.depend b/libexec/bootpd/bootpgw/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/libexec/bootpd/bootpgw/Makefile.depend
+++ b/libexec/bootpd/bootpgw/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/bootpd/tools/bootpef/Makefile.depend b/libexec/bootpd/tools/bootpef/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/libexec/bootpd/tools/bootpef/Makefile.depend
+++ b/libexec/bootpd/tools/bootpef/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/bootpd/tools/bootptest/Makefile.depend b/libexec/bootpd/tools/bootptest/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/libexec/bootpd/tools/bootptest/Makefile.depend
+++ b/libexec/bootpd/tools/bootptest/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/comsat/Makefile.depend b/libexec/comsat/Makefile.depend
index f4b5142..3646e2e 100644
--- a/libexec/comsat/Makefile.depend
+++ b/libexec/comsat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/fingerd/Makefile.depend b/libexec/fingerd/Makefile.depend
index 45371c5..7de116d 100644
--- a/libexec/fingerd/Makefile.depend
+++ b/libexec/fingerd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/ftpd/Makefile b/libexec/ftpd/Makefile
index da41967..5089a12 100644
--- a/libexec/ftpd/Makefile
+++ b/libexec/ftpd/Makefile
@@ -13,7 +13,7 @@ YFLAGS=
WARNS?= 2
WFORMAT=0
-LIBADD= util crypt
+LIBADD= util crypt xo
# XXX Kluge! Conversation mechanism needs to be fixed.
LIBADD+= opie md
diff --git a/libexec/ftpd/Makefile.depend b/libexec/ftpd/Makefile.depend
index 8ab5829..aa86861 100644
--- a/libexec/ftpd/Makefile.depend
+++ b/libexec/ftpd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/getty/Makefile.depend b/libexec/getty/Makefile.depend
index 0eab23f..58f9a33 100644
--- a/libexec/getty/Makefile.depend
+++ b/libexec/getty/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/mail.local/Makefile.depend b/libexec/mail.local/Makefile.depend
index 0e250c8..59b2994 100644
--- a/libexec/mail.local/Makefile.depend
+++ b/libexec/mail.local/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/mknetid/Makefile.depend b/libexec/mknetid/Makefile.depend
index c3bc1bd..ddd5dbd 100644
--- a/libexec/mknetid/Makefile.depend
+++ b/libexec/mknetid/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/pppoed/Makefile.depend b/libexec/pppoed/Makefile.depend
index e8a95b2..4fa00ad 100644
--- a/libexec/pppoed/Makefile.depend
+++ b/libexec/pppoed/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/rbootd/Makefile.depend b/libexec/rbootd/Makefile.depend
index f4b5142..3646e2e 100644
--- a/libexec/rbootd/Makefile.depend
+++ b/libexec/rbootd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/revnetgroup/Makefile.depend b/libexec/revnetgroup/Makefile.depend
index f4b5142..3646e2e 100644
--- a/libexec/revnetgroup/Makefile.depend
+++ b/libexec/revnetgroup/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/rlogind/Makefile.depend b/libexec/rlogind/Makefile.depend
index 45371c5..7de116d 100644
--- a/libexec/rlogind/Makefile.depend
+++ b/libexec/rlogind/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/rpc.rquotad/Makefile.depend b/libexec/rpc.rquotad/Makefile.depend
index 0558552..b3a9fa6 100644
--- a/libexec/rpc.rquotad/Makefile.depend
+++ b/libexec/rpc.rquotad/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/rpc.rstatd/Makefile.depend b/libexec/rpc.rstatd/Makefile.depend
index d60511c..bbb48e4 100644
--- a/libexec/rpc.rstatd/Makefile.depend
+++ b/libexec/rpc.rstatd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/rpc.rusersd/Makefile.depend b/libexec/rpc.rusersd/Makefile.depend
index 9e3ced9..c8383bd 100644
--- a/libexec/rpc.rusersd/Makefile.depend
+++ b/libexec/rpc.rusersd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/rpc.rwalld/Makefile.depend b/libexec/rpc.rwalld/Makefile.depend
index 8dd4123..0a49c9e 100644
--- a/libexec/rpc.rwalld/Makefile.depend
+++ b/libexec/rpc.rwalld/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/rpc.sprayd/Makefile.depend b/libexec/rpc.sprayd/Makefile.depend
index 9e3ced9..c8383bd 100644
--- a/libexec/rpc.sprayd/Makefile.depend
+++ b/libexec/rpc.sprayd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/rshd/Makefile.depend b/libexec/rshd/Makefile.depend
index eef278d..7ce0fb7 100644
--- a/libexec/rshd/Makefile.depend
+++ b/libexec/rshd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/rtld-elf/Makefile.depend b/libexec/rtld-elf/Makefile.depend
index 359c150..920c1eb 100644
--- a/libexec/rtld-elf/Makefile.depend
+++ b/libexec/rtld-elf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/save-entropy/Makefile.depend b/libexec/save-entropy/Makefile.depend
index 11aba52..f80275d 100644
--- a/libexec/save-entropy/Makefile.depend
+++ b/libexec/save-entropy/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/smrsh/Makefile.depend b/libexec/smrsh/Makefile.depend
index ff9b088..0d59811 100644
--- a/libexec/smrsh/Makefile.depend
+++ b/libexec/smrsh/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/talkd/Makefile.depend b/libexec/talkd/Makefile.depend
index 39abfa7..e77ca8d 100644
--- a/libexec/talkd/Makefile.depend
+++ b/libexec/talkd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/tcpd/Makefile.depend b/libexec/tcpd/Makefile.depend
index 8c64a39..b320bb5 100644
--- a/libexec/tcpd/Makefile.depend
+++ b/libexec/tcpd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/telnetd/Makefile.depend b/libexec/telnetd/Makefile.depend
index 9d01a64..0417d53 100644
--- a/libexec/telnetd/Makefile.depend
+++ b/libexec/telnetd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/tftp-proxy/Makefile.depend b/libexec/tftp-proxy/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/libexec/tftp-proxy/Makefile.depend
+++ b/libexec/tftp-proxy/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/tftpd/Makefile.depend b/libexec/tftpd/Makefile.depend
index 57b0fdf..e314de5 100644
--- a/libexec/tftpd/Makefile.depend
+++ b/libexec/tftpd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/ulog-helper/Makefile.depend b/libexec/ulog-helper/Makefile.depend
index ab59eb1..4809f9b 100644
--- a/libexec/ulog-helper/Makefile.depend
+++ b/libexec/ulog-helper/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/ypxfr/Makefile.depend b/libexec/ypxfr/Makefile.depend
index b122d8a..6a84a3f 100644
--- a/libexec/ypxfr/Makefile.depend
+++ b/libexec/ypxfr/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/libexec/ypxfr/ypxfr_main.c b/libexec/ypxfr/ypxfr_main.c
index 70fd1f5..03a30f6 100644
--- a/libexec/ypxfr/ypxfr_main.c
+++ b/libexec/ypxfr/ypxfr_main.c
@@ -357,7 +357,7 @@ the local domain name isn't set");
ypxfr_mapname,
ypxfr_master, 0)) == 0) {
yp_error("failed to get order number of %s: %s",
- ypxfr_mapname, yp_errno == YPXFR_SUCC ?
+ ypxfr_mapname, yp_errno == YP_TRUE ?
"map has order 0" :
ypxfrerr_string((ypxfrstat)yp_errno));
ypxfr_exit(YPXFR_YPERR,NULL);
@@ -533,7 +533,7 @@ leave:
ypxfr_mapname,
ypxfr_master, 0)) == 0) {
yp_error("failed to get order number of %s: %s",
- ypxfr_mapname, yp_errno == YPXFR_SUCC ?
+ ypxfr_mapname, yp_errno == YP_TRUE ?
"map has order 0" :
ypxfrerr_string((ypxfrstat)yp_errno));
ypxfr_exit(YPXFR_YPERR,ypxfr_temp_map);
diff --git a/release/Makefile.ec2 b/release/Makefile.ec2
index a781bc6..4efdc7f 100644
--- a/release/Makefile.ec2
+++ b/release/Makefile.ec2
@@ -51,9 +51,9 @@ ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL}
@echo "--------------------------------------------------------------"
@false
.endif
- /usr/local/bin/bsdec2-image-upload ${PUBLISH} \
- ${.OBJDIR}/ec2.raw \
- "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \
- "${TYPE} ${REVISION}-${BRANCH}-${TARGET}" \
+ /usr/local/bin/bsdec2-image-upload ${PUBLISH} \
+ ${.OBJDIR}/ec2.raw \
+ "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \
+ "${TYPE} ${REVISION}-${BRANCH}-${TARGET}" \
${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE}
@touch ${.TARGET}
diff --git a/release/Makefile.mirrors b/release/Makefile.mirrors
index f534c19..ed10c55 100644
--- a/release/Makefile.mirrors
+++ b/release/Makefile.mirrors
@@ -16,7 +16,9 @@
RELEASEDIR?= /R
FTPDIR?= ${RELEASEDIR}/ftp-stage
+.if exists(${RELEASEDIR})
STAGE_TARGETS?= iso-images-stage
+.endif
.if (defined(EMBEDDED_TARGET) && !empty(EMBEDDED_TARGET)) || (defined(EMBEDDEDBUILD) && !empty(EMBEDDEDBUILD))
. if ${TARGET} == "arm" || ${EMBEDDED_TARGET} == "arm"
@@ -28,24 +30,26 @@ EMBEDDED= 1
.if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT"
SNAPSHOT= 1
TLD?= ${FTPDIR}/snapshots
-. for _D in /usr/bin /usr/local/bin
-. for _S in svnversion svnliteversion
-. if exists(${_D}/${_S})
+. if !defined(SVNREVISION) || empty(SVNREVISION)
+. for _D in /usr/bin /usr/local/bin
+. for _S in svnversion svnliteversion
+. if exists(${_D}/${_S})
SVNVERSION?= ${_D}/${_S}
-. endif
+. endif
+. endfor
. endfor
-. endfor
-. if exists(${.CURDIR}/${.OBJDIR}/dist/base/bin/sh)
+. if exists(${SVNVERSION}) && !empty(SVNVERSION)
+SVNREVISION!= ${SVNVERSION} ${WORLDDIR}/Makefile
+. endif
+. endif # !defined(SVNREVISION)
+. if !defined(BUILDDATE) || empty(BUILDDATE)
+. if exists(${.CURDIR}/${.OBJDIR}/dist/base/bin/sh)
BUILDDATE!= cd ${.CURDIR} && date -j -f '%s' $$(stat -f "%c" ${.OBJDIR}/dist/base/bin/sh) +%Y%m%d
-. else
+. else
BUILDDATE!= date +%Y%m%d
+. endif
. endif
-. if exists(${SVNVERSION}) && !empty(SVNVERSION)
-SVNREVISION!= ${SVNVERSION} ${WORLDDIR}/Makefile
-_SNAP_SUFFIX:= -r${SVNREVISION}-${BUILDDATE}
-. else
-_SNAP_SUFFIX:= -${BUILDDATE}
-. endif
+_SNAP_SUFFIX:= ${BUILDDATE}-r${SVNREVISION}
.else
# release
SNAPSHOT=
@@ -83,18 +87,16 @@ remove-old-bits:
iso-images-stage:
mkdir -p ${ISO_DIR}
mkdir -p ${TLD}/ISO-IMAGES/${REVISION}
-.if exists(${RELEASEDIR})
- @# Assume we have images to copy.
-. if defined(SNAPSHOT) && !empty(SNAPSHOT)
+.if defined(SNAPSHOT) && !empty(SNAPSHOT)
cd ${RELEASEDIR} && rm -f CHECKSUM.*
-. for IMAGE in ${IMAGES}
-. if defined(EMBEDDED) && !empty(EMBEDDED)
-. if defined(OLDNAME) && !empty(OLDNAME)
+. for IMAGE in ${IMAGES}
+. if defined(EMBEDDED) && !empty(EMBEDDED)
+. if defined(OLDNAME) && !empty(OLDNAME)
@# arm/armv6 IMX6 -> WANDBOARD, for example.
cd ${RELEASEDIR} && \
mv ${OSRELEASE}-${OLDNAME}.${IMAGE}.xz \
${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz
-. endif
+. endif
cd ${RELEASEDIR} && \
mv ${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz \
${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX}.${IMAGE}.xz
@@ -103,31 +105,31 @@ iso-images-stage:
cd ${TLD}/ISO-IMAGES/${REVISION} && \
ln -s \
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX}.${IMAGE}.xz
-. endif # not embedded
-. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE})
+. endif # not embedded
+. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE})
cd ${RELEASEDIR} && \
mv ${OSRELEASE}-${IMAGE} \
- ${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE} || true
+ ${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}
cp -p ${RELEASEDIR}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE} \
${ISO_DIR}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}
cd ${TLD}/ISO-IMAGES/${REVISION} && \
ln -s \
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}
-. endif
-. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz)
+. endif
+. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz)
cd ${RELEASEDIR} && \
mv ${OSRELEASE}-${IMAGE}.xz \
- ${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz || true
+ ${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz
cp -p ${RELEASEDIR}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz \
${ISO_DIR}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz
cd ${TLD}/ISO-IMAGES/${REVISION} && \
ln -s \
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${SNAP_SUFFIX}-${IMAGE}.xz
-. endif
-. endfor # images loop
+. endif
+. endfor # images loop
cd ${RELEASEDIR} && rm -f CHECKSUM.*
-. for CHECKSUM in ${CHECKSUM_FILES}
-. if defined(EMBEDDED) && !empty(EMBEDDED)
+. for CHECKSUM in ${CHECKSUM_FILES}
+. if defined(EMBEDDED) && !empty(EMBEDDED)
cd ${RELEASEDIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \
CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX}
cp -p ${RELEASEDIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX} \
@@ -135,7 +137,7 @@ iso-images-stage:
cd ${TLD}/ISO-IMAGES/${REVISION} && \
ln -s \
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}-${SNAP_SUFFIX}
-. else # not embedded
+. else # not embedded
cd ${RELEASEDIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \
CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX}
cp -p ${RELEASEDIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX} \
@@ -143,42 +145,42 @@ iso-images-stage:
cd ${TLD}/ISO-IMAGES/${REVISION} && \
ln -s \
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${SNAP_SUFFIX}
-. endif #
-. endfor # checksum files
-. else # not snapshot
-. for IMAGE in ${IMAGES}
-. if defined(EMBEDDED) && !empty(EMBEDDED)
-. if defined(OLDNAME) && !empty(OLDNAME)
+. endif #
+. endfor # checksum files
+.else # not snapshot
+. for IMAGE in ${IMAGES}
+. if defined(EMBEDDED) && !empty(EMBEDDED)
+. if defined(OLDNAME) && !empty(OLDNAME)
@# arm/armv6 IMX6 -> WANDBOARD, for example.
cd ${RELEASEDIR} && \
mv ${OSRELEASE}-${OLDNAME}.${IMAGE}.xz \
${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz
-. endif
+. endif
cp -p ${RELEASEDIR}/${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz \
${ISO_DIR}/${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz
cd ${TLD}/ISO-IMAGES/${REVISION} && \
ln -s \
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${BOARDNAME}.${IMAGE}.xz
-. endif # not embedded
-. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE})
+. endif # not embedded
+. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE})
cd ${RELEASEDIR} && \
cp -p ${RELEASEDIR}/${OSRELEASE}-${IMAGE} \
${ISO_DIR}/${OSRELEASE}-${IMAGE}
cd ${TLD}/ISO-IMAGES/${REVISION} && \
ln -s \
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${IMAGE}
-. endif
-. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz)
+. endif
+. if exists(${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz)
cp -p ${RELEASEDIR}/${OSRELEASE}-${IMAGE}.xz \
${ISO_DIR}/${OSRELEASE}-${IMAGE}.xz
cd ${TLD}/ISO-IMAGES/${REVISION} && \
ln -s \
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/${OSRELEASE}-${IMAGE}.xz
-. endif
-. endfor # images loop
+. endif
+. endfor # images loop
cd ${RELEASEDIR} && rm -f CHECKSUM.*
-. for CHECKSUM in ${CHECKSUM_FILES}
-. if defined(EMBEDDED) && !empty(EMBEDDED)
+. for CHECKSUM in ${CHECKSUM_FILES}
+. if defined(EMBEDDED) && !empty(EMBEDDED)
cd ${RELEASEDIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \
CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}
cp -p ${RELEASEDIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME} \
@@ -186,7 +188,7 @@ iso-images-stage:
cd ${TLD}/ISO-IMAGES/${REVISION} && \
ln -s \
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/CHECKSUM.${CHECKSUM}-${OSRELEASE}-${BOARDNAME}
-. else # not embedded
+. else # not embedded
cd ${RELEASEDIR} && ${CHECKSUM:tl} ${OSRELEASE}* > \
CHECKSUM.${CHECKSUM}-${OSRELEASE}
cp -p ${RELEASEDIR}/CHECKSUM.${CHECKSUM}-${OSRELEASE} \
@@ -194,17 +196,16 @@ iso-images-stage:
cd ${TLD}/ISO-IMAGES/${REVISION} && \
ln -s \
../../${TARGET}/${TARGET_ARCH}/ISO-IMAGES/${REVISION}/CHECKSUM.${CHECKSUM}-${OSRELEASE}
-. endif
-. endfor # checksum files
-. endif # release
-. if exists(${RELEASEDIR}/ftp)
+. endif
+. endfor # checksum files
+.endif # release
+.if exists(${RELEASEDIR}/ftp)
mkdir -p ${FTP_DIR}
cp -p ${RELEASEDIR}/ftp/*.txz ${RELEASEDIR}/ftp/MANIFEST ${FTP_DIR}
cd ${TLD}/${TARGET} && \
ln -s ${TARGET_ARCH}/${REVISION}-${BRANCH} \
${REVISION}-${BRANCH}
-. endif
-.endif # no RELEASEDIR
+.endif
vm-images-stage:
mkdir -p ${VM_DIR}
diff --git a/release/arm/BEAGLEBONE.conf b/release/arm/BEAGLEBONE.conf
index 3ae4871..48375b3 100644
--- a/release/arm/BEAGLEBONE.conf
+++ b/release/arm/BEAGLEBONE.conf
@@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6"
EMBEDDEDPORTS="sysutils/u-boot-beaglebone"
KERNEL="BEAGLEBONE"
WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000"
-IMAGE_SIZE="1G"
+IMAGE_SIZE="480M"
PART_SCHEME="MBR"
FAT_SIZE="2m"
FAT_TYPE="12"
@@ -23,7 +23,7 @@ arm_install_uboot() {
chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}"
chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT}
- chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/MLO ${FATMOUNT}/MLO
+ chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/MLO ${FATMOUNT}/MLO
chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/u-boot.img ${FATMOUNT}/u-boot.img
chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr
chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot
diff --git a/release/arm/CUBOX-HUMMINGBOARD.conf b/release/arm/CUBOX-HUMMINGBOARD.conf
new file mode 100644
index 0000000..5c82d40
--- /dev/null
+++ b/release/arm/CUBOX-HUMMINGBOARD.conf
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+EMBEDDEDBUILD=1
+EMBEDDED_TARGET="arm"
+EMBEDDED_TARGET_ARCH="armv6"
+EMBEDDEDPORTS="sysutils/u-boot-cubox-hummingboard"
+KERNEL="IMX6"
+WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x12000000"
+IMAGE_SIZE="480M"
+PART_SCHEME="MBR"
+FAT_SIZE="50m -b 16384"
+FAT_TYPE="16"
+MD_ARGS="-x 63 -y 255"
+NODOC=1
+export BOARDNAME="CUBOX-HUMMINGBOARD"
+
+arm_install_uboot() {
+ UBOOT_DIR="/usr/local/share/u-boot/u-boot-cubox-hummingboard"
+ UBOOT_FILES="u-boot.imx"
+ FATMOUNT="${DESTDIR%${KERNEL}}/fat"
+ UFSMOUNT="${DESTDIR%${KERNEL}}/ufs"
+ chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \
+ of=/dev/${mddev} bs=512 seek=2
+ chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}"
+ chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
+ chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT}
+ chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr
+ chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot
+ sync
+ umount_loop ${CHROOTDIR}/${FATMOUNT}
+ umount_loop ${CHROOTDIR}/${UFSMOUNT}
+ chroot ${CHROOTDIR} rmdir ${FATMOUNT}
+ chroot ${CHROOTDIR} rmdir ${UFSMOUNT}
+
+ return 0
+}
diff --git a/release/arm/GUMSTIX.conf b/release/arm/GUMSTIX.conf
new file mode 100644
index 0000000..92e8476
--- /dev/null
+++ b/release/arm/GUMSTIX.conf
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+EMBEDDEDBUILD=1
+EMBEDDED_TARGET="arm"
+EMBEDDED_TARGET_ARCH="armv6"
+EMBEDDEDPORTS="sysutils/u-boot-duovero"
+KERNEL="GUMSTIX"
+WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000"
+IMAGE_SIZE="480M"
+PART_SCHEME="MBR"
+FAT_SIZE="2m"
+FAT_TYPE="12"
+MD_ARGS="-x 63 -y 255"
+NODOC=1
+
+arm_install_uboot() {
+ UBOOT_DIR="/usr/local/share/u-boot/u-boot-duovero"
+ FATMOUNT="${DESTDIR%${KERNEL}}/fat"
+ UFSMOUNT="${DESTDIR%${KERNEL}}/ufs"
+ chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}"
+ chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
+ chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT}
+ chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/MLO ${FATMOUNT}/MLO
+ chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/u-boot.img ${FATMOUNT}/u-boot.img
+ chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr
+ chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot
+ sync
+ umount_loop ${CHROOTDIR}/${FATMOUNT}
+ umount_loop ${CHROOTDIR}/${UFSMOUNT}
+ chroot ${CHROOTDIR} rmdir ${FATMOUNT}
+ chroot ${CHROOTDIR} rmdir ${UFSMOUNT}
+
+ return 0
+}
diff --git a/release/arm/PANDABOARD.conf b/release/arm/PANDABOARD.conf
index b5a120e..0a51b30 100644
--- a/release/arm/PANDABOARD.conf
+++ b/release/arm/PANDABOARD.conf
@@ -8,13 +8,13 @@ EMBEDDED_TARGET="arm"
EMBEDDED_TARGET_ARCH="armv6"
EMBEDDEDPORTS="sysutils/u-boot-pandaboard"
KERNEL="PANDABOARD"
-NODOC=1
WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000"
-IMAGE_SIZE="1G"
+IMAGE_SIZE="480M"
PART_SCHEME="MBR"
FAT_SIZE="2m"
FAT_TYPE="12"
MD_ARGS="-x 63 -y 255"
+NODOC=1
arm_install_uboot() {
UBOOT_DIR="/usr/local/share/u-boot/u-boot-pandaboard"
diff --git a/release/arm/RPI-B.conf b/release/arm/RPI-B.conf
index e5abaab..ee3974b 100644
--- a/release/arm/RPI-B.conf
+++ b/release/arm/RPI-B.conf
@@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6"
EMBEDDEDPORTS="sysutils/u-boot-rpi"
KERNEL="RPI-B"
WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000"
-IMAGE_SIZE="1G"
+IMAGE_SIZE="480M"
PART_SCHEME="MBR"
FAT_SIZE="17m"
FAT_TYPE="16"
diff --git a/release/arm/RPI2.conf b/release/arm/RPI2.conf
index e1d15d1..d5fbb18 100644
--- a/release/arm/RPI2.conf
+++ b/release/arm/RPI2.conf
@@ -8,13 +8,13 @@ EMBEDDED_TARGET="arm"
EMBEDDED_TARGET_ARCH="armv6"
EMBEDDEDPORTS="sysutils/u-boot-rpi2"
KERNEL="RPI2"
-NODOC=1
WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000"
-IMAGE_SIZE="1G"
+IMAGE_SIZE="480M"
PART_SCHEME="MBR"
FAT_SIZE="50m"
FAT_TYPE="16"
MD_ARGS="-x 63 -y 255"
+NODOC=1
arm_install_uboot() {
UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi2"
diff --git a/release/arm/WANDBOARD.conf b/release/arm/WANDBOARD.conf
index 42b4523..3e5fae4 100644
--- a/release/arm/WANDBOARD.conf
+++ b/release/arm/WANDBOARD.conf
@@ -8,13 +8,14 @@ EMBEDDED_TARGET="arm"
EMBEDDED_TARGET_ARCH="armv6"
EMBEDDEDPORTS="sysutils/u-boot-wandboard"
KERNEL="IMX6"
-WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x11000000"
-IMAGE_SIZE="1G"
+WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x12000000"
+IMAGE_SIZE="480M"
PART_SCHEME="MBR"
FAT_SIZE="50m -b 16384"
FAT_TYPE="16"
MD_ARGS="-x 63 -y 255"
NODOC=1
+export BOARDNAME="WANDBOARD"
arm_install_uboot() {
UBOOT_DIR="/usr/local/share/u-boot/u-boot-wandboard"
@@ -27,9 +28,6 @@ arm_install_uboot() {
chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT}
chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr
- chroot ${CHROOTDIR} /bin/sh -c 'echo \
- setenv fdt_file wandboard-quad.dtb\; fatload mmc 0:1 11000000 ubldr\; bootelf 11000000\; \
- > ${FATMOUNT}/boot.txt'
chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot
sync
umount_loop ${CHROOTDIR}/${FATMOUNT}
diff --git a/release/tools/arm.subr b/release/tools/arm.subr
index 5cc61e3..564d9b6 100644
--- a/release/tools/arm.subr
+++ b/release/tools/arm.subr
@@ -72,7 +72,7 @@ arm_create_disk() {
chroot ${CHROOTDIR} gpart create -s bsd ${mddev}s2
chroot ${CHROOTDIR} gpart add -t freebsd-ufs -a 64k /dev/${mddev}s2
chroot ${CHROOTDIR} newfs -U -L rootfs /dev/${mddev}s2a
- chroot ${CHROOTDIR} tunefs -j enable -N enable /dev/${mddev}s2a
+ chroot ${CHROOTDIR} tunefs -N enable /dev/${mddev}s2a
return 0
}
@@ -80,11 +80,15 @@ arm_create_disk() {
arm_create_user() {
# Create a default user account 'freebsd' with the password 'freebsd',
# and set the default password for the 'root' user to 'root'.
- chroot ${CHROOTDIR} /usr/sbin/pw groupadd freebsd -g 1001
- chroot ${CHROOTDIR} /usr/sbin/pw useradd freebsd \
+ chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \
+ groupadd freebsd -g 1001
+ chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/home/freebsd
+ chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \
+ useradd freebsd \
-m -M 0755 -w yes -n freebsd -u 1001 -g 1001 -G 0 \
-c 'FreeBSD User' -d '/home/freebsd' -s '/bin/csh'
- chroot ${CHROOTDIR} /usr/sbin/pw usermod root -w yes
+ chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \
+ usermod root -w yes
return 0
}
diff --git a/rescue/librescue/Makefile.depend b/rescue/librescue/Makefile.depend
index c51d419..479669f 100644
--- a/rescue/librescue/Makefile.depend
+++ b/rescue/librescue/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/sbin/adjkerntz/Makefile.depend b/sbin/adjkerntz/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/adjkerntz/Makefile.depend
+++ b/sbin/adjkerntz/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/atm/atmconfig/Makefile.depend b/sbin/atm/atmconfig/Makefile.depend
index 3782b97..7df1c10 100644
--- a/sbin/atm/atmconfig/Makefile.depend
+++ b/sbin/atm/atmconfig/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/badsect/Makefile b/sbin/badsect/Makefile
index c11f8cba..68e2964 100644
--- a/sbin/badsect/Makefile
+++ b/sbin/badsect/Makefile
@@ -4,6 +4,5 @@
PROG= badsect
LIBADD= ufs
MAN= badsect.8
-WARNS?= 2
.include <bsd.prog.mk>
diff --git a/sbin/badsect/Makefile.depend b/sbin/badsect/Makefile.depend
index 6ce72cc..99cf113 100644
--- a/sbin/badsect/Makefile.depend
+++ b/sbin/badsect/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/bsdlabel/Makefile.depend b/sbin/bsdlabel/Makefile.depend
index 5d7ba23..851372c 100644
--- a/sbin/bsdlabel/Makefile.depend
+++ b/sbin/bsdlabel/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/camcontrol/Makefile b/sbin/camcontrol/Makefile
index f23ef52..cbc5452 100644
--- a/sbin/camcontrol/Makefile
+++ b/sbin/camcontrol/Makefile
@@ -3,7 +3,7 @@
PROG= camcontrol
SRCS= camcontrol.c util.c
.if !defined(RELEASE_CRUNCH)
-SRCS+= fwdownload.c modeedit.c persist.c progress.c
+SRCS+= attrib.c fwdownload.c modeedit.c persist.c progress.c
.else
CFLAGS+= -DMINIMALISTIC
.endif
diff --git a/sbin/camcontrol/Makefile.depend b/sbin/camcontrol/Makefile.depend
index 1448d0f..48a48dd 100644
--- a/sbin/camcontrol/Makefile.depend
+++ b/sbin/camcontrol/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/camcontrol/attrib.c b/sbin/camcontrol/attrib.c
new file mode 100644
index 0000000..62d4b1e
--- /dev/null
+++ b/sbin/camcontrol/attrib.c
@@ -0,0 +1,509 @@
+/*-
+ * Copyright (c) 2014 Spectra Logic Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ *
+ * Authors: Ken Merry (Spectra Logic Corporation)
+ */
+/*
+ * SCSI Read and Write Attribute support for camcontrol(8).
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/ioctl.h>
+#include <sys/stdint.h>
+#include <sys/types.h>
+#include <sys/endian.h>
+#include <sys/sbuf.h>
+#include <sys/queue.h>
+#include <sys/chio.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+#include <unistd.h>
+#include <string.h>
+#include <strings.h>
+#include <fcntl.h>
+#include <ctype.h>
+#include <limits.h>
+#include <err.h>
+#include <locale.h>
+
+#include <cam/cam.h>
+#include <cam/cam_debug.h>
+#include <cam/cam_ccb.h>
+#include <cam/scsi/scsi_all.h>
+#include <cam/scsi/scsi_pass.h>
+#include <cam/scsi/scsi_ch.h>
+#include <cam/scsi/scsi_message.h>
+#include <camlib.h>
+#include "camcontrol.h"
+
+#if 0
+struct scsi_attr_desc {
+ int attr_id;
+
+ STAILQ_ENTRY(scsi_attr_desc) links;
+};
+#endif
+
+static struct scsi_nv elem_type_map[] = {
+ { "all", ELEMENT_TYPE_ALL },
+ { "picker", ELEMENT_TYPE_MT },
+ { "slot", ELEMENT_TYPE_ST },
+ { "portal", ELEMENT_TYPE_IE },
+ { "drive", ELEMENT_TYPE_DT },
+};
+
+static struct scsi_nv sa_map[] = {
+ { "attr_values", SRA_SA_ATTR_VALUES },
+ { "attr_list", SRA_SA_ATTR_LIST },
+ { "lv_list", SRA_SA_LOG_VOL_LIST },
+ { "part_list", SRA_SA_PART_LIST },
+ { "supp_attr", SRA_SA_SUPPORTED_ATTRS }
+};
+
+static struct scsi_nv output_format_map[] = {
+ { "text_esc", SCSI_ATTR_OUTPUT_TEXT_ESC },
+ { "text_raw", SCSI_ATTR_OUTPUT_TEXT_RAW },
+ { "nonascii_esc", SCSI_ATTR_OUTPUT_NONASCII_ESC },
+ { "nonascii_trim", SCSI_ATTR_OUTPUT_NONASCII_TRIM },
+ { "nonascii_raw", SCSI_ATTR_OUTPUT_NONASCII_RAW },
+ { "field_all", SCSI_ATTR_OUTPUT_FIELD_ALL },
+ { "field_none", SCSI_ATTR_OUTPUT_FIELD_NONE },
+ { "field_desc", SCSI_ATTR_OUTPUT_FIELD_DESC },
+ { "field_num", SCSI_ATTR_OUTPUT_FIELD_NUM },
+ { "field_size", SCSI_ATTR_OUTPUT_FIELD_SIZE },
+ { "field_rw", SCSI_ATTR_OUTPUT_FIELD_RW },
+};
+
+int
+scsiattrib(struct cam_device *device, int argc, char **argv, char *combinedopt,
+ int retry_count, int timeout, int verbosemode, int err_recover)
+{
+ union ccb *ccb = NULL;
+ int attr_num = -1;
+#if 0
+ int num_attrs = 0;
+#endif
+ int start_attr = 0;
+ int cached_attr = 0;
+ int read_service_action = -1;
+ int read_attr = 0, write_attr = 0;
+ int element_address = 0;
+ int element_type = ELEMENT_TYPE_ALL;
+ int partition = 0;
+ int logical_volume = 0;
+ char *endptr;
+ uint8_t *data_buf = NULL;
+ uint32_t dxfer_len = UINT16_MAX - 1;
+ uint32_t valid_len;
+ uint32_t output_format;
+ STAILQ_HEAD(, scsi_attr_desc) write_attr_list;
+ int error = 0;
+ int c;
+
+ ccb = cam_getccb(device);
+ if (ccb == NULL) {
+ warnx("%s: error allocating CCB", __func__);
+ error = 1;
+ goto bailout;
+ }
+
+ bzero(&(&ccb->ccb_h)[1],
+ sizeof(union ccb) - sizeof(struct ccb_hdr));
+
+ STAILQ_INIT(&write_attr_list);
+
+ /*
+ * By default, when displaying attribute values, we trim out
+ * non-ASCII characters in ASCII fields. We display all fields
+ * (description, attribute number, attribute size, and readonly
+ * status). We default to displaying raw text.
+ *
+ * XXX KDM need to port this to stable/10 and newer FreeBSD
+ * versions that have iconv built in and can convert codesets.
+ */
+ output_format = SCSI_ATTR_OUTPUT_NONASCII_TRIM |
+ SCSI_ATTR_OUTPUT_FIELD_ALL |
+ SCSI_ATTR_OUTPUT_TEXT_RAW;
+
+ data_buf = malloc(dxfer_len);
+ if (data_buf == NULL) {
+ warn("%s: error allocating %u bytes", __func__, dxfer_len);
+ error = 1;
+ goto bailout;
+ }
+
+ while ((c = getopt(argc, argv, combinedopt)) != -1) {
+ switch (c) {
+ case 'a':
+ attr_num = strtol(optarg, &endptr, 0);
+ if (*endptr != '\0') {
+ warnx("%s: invalid attribute number %s",
+ __func__, optarg);
+ error = 1;
+ goto bailout;
+ }
+ start_attr = attr_num;
+ break;
+ case 'c':
+ cached_attr = 1;
+ break;
+ case 'e':
+ element_address = strtol(optarg, &endptr, 0);
+ if (*endptr != '\0') {
+ warnx("%s: invalid element address %s",
+ __func__, optarg);
+ error = 1;
+ goto bailout;
+ }
+ break;
+ case 'F': {
+ scsi_nv_status status;
+ scsi_attrib_output_flags new_outflags;
+ int entry_num = 0;
+ char *tmpstr;
+
+ if (isdigit(optarg[0])) {
+ output_format = strtoul(optarg, &endptr, 0);
+ if (*endptr != '\0') {
+ warnx("%s: invalid numeric output "
+ "format argument %s", __func__,
+ optarg);
+ error = 1;
+ goto bailout;
+ }
+ break;
+ }
+ new_outflags = SCSI_ATTR_OUTPUT_NONE;
+
+ while ((tmpstr = strsep(&optarg, ",")) != NULL) {
+ status = scsi_get_nv(output_format_map,
+ sizeof(output_format_map) /
+ sizeof(output_format_map[0]), tmpstr,
+ &entry_num, SCSI_NV_FLAG_IG_CASE);
+
+ if (status == SCSI_NV_FOUND)
+ new_outflags |=
+ output_format_map[entry_num].value;
+ else {
+ warnx("%s: %s format option %s",
+ __func__,
+ (status == SCSI_NV_AMBIGUOUS) ?
+ "ambiguous" : "invalid", tmpstr);
+ error = 1;
+ goto bailout;
+ }
+ }
+ output_format = new_outflags;
+ break;
+ }
+ case 'p':
+ partition = strtol(optarg, &endptr, 0);
+ if (*endptr != '\0') {
+ warnx("%s: invalid partition number %s",
+ __func__, optarg);
+ error = 1;
+ goto bailout;
+ }
+ break;
+ case 'r': {
+ scsi_nv_status status;
+ int entry_num = 0;
+
+ status = scsi_get_nv(sa_map, sizeof(sa_map) /
+ sizeof(sa_map[0]), optarg, &entry_num,
+ SCSI_NV_FLAG_IG_CASE);
+ if (status == SCSI_NV_FOUND)
+ read_service_action = sa_map[entry_num].value;
+ else {
+ warnx("%s: %s %s option %s", __func__,
+ (status == SCSI_NV_AMBIGUOUS) ?
+ "ambiguous" : "invalid", "service action",
+ optarg);
+ error = 1;
+ goto bailout;
+ }
+ read_attr = 1;
+ break;
+ }
+ case 's':
+ start_attr = strtol(optarg, &endptr, 0);
+ if (*endptr != '\0') {
+ warnx("%s: invalid starting attr argument %s",
+ __func__, optarg);
+ error = 1;
+ goto bailout;
+ }
+ break;
+ case 'T': {
+ scsi_nv_status status;
+ int entry_num = 0;
+
+ status = scsi_get_nv(elem_type_map,
+ sizeof(elem_type_map) / sizeof(elem_type_map[0]),
+ optarg, &entry_num, SCSI_NV_FLAG_IG_CASE);
+ if (status == SCSI_NV_FOUND)
+ element_type = elem_type_map[entry_num].value;
+ else {
+ warnx("%s: %s %s option %s", __func__,
+ (status == SCSI_NV_AMBIGUOUS) ?
+ "ambiguous" : "invalid", "element type",
+ optarg);
+ error = 1;
+ goto bailout;
+ }
+ break;
+ }
+ case 'w':
+ warnx("%s: writing attributes is not implemented yet",
+ __func__);
+ error = 1;
+ goto bailout;
+ break;
+ case 'V':
+ logical_volume = strtol(optarg, &endptr, 0);
+
+ if (*endptr != '\0') {
+ warnx("%s: invalid logical volume argument %s",
+ __func__, optarg);
+ error = 1;
+ goto bailout;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /*
+ * Default to reading attributes
+ */
+ if (((read_attr == 0) && (write_attr == 0))
+ || ((read_attr != 0) && (write_attr != 0))) {
+ warnx("%s: Must specify either -r or -w", __func__);
+ error = 1;
+ goto bailout;
+ }
+
+ if (read_attr != 0) {
+ scsi_read_attribute(&ccb->csio,
+ /*retries*/ retry_count,
+ /*cbfcnp*/ NULL,
+ /*tag_action*/ MSG_SIMPLE_Q_TAG,
+ /*service_action*/ read_service_action,
+ /*element*/ element_address,
+ /*elem_type*/ element_type,
+ /*logical_volume*/ logical_volume,
+ /*partition*/ partition,
+ /*first_attribute*/ start_attr,
+ /*cache*/ cached_attr,
+ /*data_ptr*/ data_buf,
+ /*length*/ dxfer_len,
+ /*sense_len*/ SSD_FULL_SIZE,
+ /*timeout*/ timeout ? timeout : 60000);
+#if 0
+ } else {
+#endif
+
+ }
+
+ ccb->ccb_h.flags |= CAM_DEV_QFRZDIS;
+
+ if (err_recover != 0)
+ ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER;
+
+ if (cam_send_ccb(device, ccb) < 0) {
+ warn("error sending %s ATTRIBUTE", (read_attr != 0) ?
+ "READ" : "WRITE");
+
+ if (verbosemode != 0) {
+ cam_error_print(device, ccb, CAM_ESF_ALL,
+ CAM_EPF_ALL, stderr);
+ }
+
+ error = 1;
+ goto bailout;
+ }
+
+ if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
+ if (verbosemode != 0) {
+ cam_error_print(device, ccb, CAM_ESF_ALL,
+ CAM_EPF_ALL, stderr);
+ }
+ error = 1;
+ goto bailout;
+ }
+
+ if (read_attr == 0)
+ goto bailout;
+
+ valid_len = dxfer_len - ccb->csio.resid;
+
+ switch (read_service_action) {
+ case SRA_SA_ATTR_VALUES: {
+ uint32_t len_left, hdr_len, cur_len;
+ struct scsi_read_attribute_values *hdr;
+ struct scsi_mam_attribute_header *cur_id;
+ char error_str[512];
+ uint8_t *cur_pos;
+ struct sbuf *sb;
+
+ hdr = (struct scsi_read_attribute_values *)data_buf;
+
+ if (valid_len < sizeof(*hdr)) {
+ fprintf(stdout, "No attributes returned.\n");
+ error = 0;
+ goto bailout;
+ }
+
+ sb = sbuf_new_auto();
+ if (sb == NULL) {
+ warn("%s: Unable to allocate sbuf", __func__);
+ error = 1;
+ goto bailout;
+ }
+ /*
+ * XXX KDM grab more data if it is available.
+ */
+ hdr_len = scsi_4btoul(hdr->length);
+
+ for (len_left = MIN(valid_len, hdr_len),
+ cur_pos = &hdr->attribute_0[0]; len_left > sizeof(*cur_id);
+ len_left -= cur_len, cur_pos += cur_len) {
+ int cur_attr_num;
+ cur_id = (struct scsi_mam_attribute_header *)cur_pos;
+ cur_len = scsi_2btoul(cur_id->length) + sizeof(*cur_id);
+ cur_attr_num = scsi_2btoul(cur_id->id);
+
+ if ((attr_num != -1)
+ && (cur_attr_num != attr_num))
+ continue;
+
+ error = scsi_attrib_sbuf(sb, cur_id, len_left,
+ /*user_table*/ NULL, /*num_user_entries*/ 0,
+ /*prefer_user_table*/ 0, output_format, error_str,
+ sizeof(error_str));
+ if (error != 0) {
+ warnx("%s: %s", __func__, error_str);
+ sbuf_delete(sb);
+ error = 1;
+ goto bailout;
+ }
+ if (attr_num != -1)
+ break;
+ }
+
+ sbuf_finish(sb);
+ fprintf(stdout, "%s", sbuf_data(sb));
+ sbuf_delete(sb);
+ break;
+ }
+ case SRA_SA_SUPPORTED_ATTRS:
+ case SRA_SA_ATTR_LIST: {
+ uint32_t len_left, hdr_len;
+ struct scsi_attrib_list_header *hdr;
+ struct scsi_attrib_table_entry *entry = NULL;
+ const char *sa_name = "Supported Attributes";
+ const char *at_name = "Available Attributes";
+ int attr_id;
+ uint8_t *cur_id;
+
+ hdr = (struct scsi_attrib_list_header *)data_buf;
+ if (valid_len < sizeof(*hdr)) {
+ fprintf(stdout, "No %s\n",
+ (read_service_action == SRA_SA_SUPPORTED_ATTRS)?
+ sa_name : at_name);
+ error = 0;
+ goto bailout;
+ }
+ fprintf(stdout, "%s:\n",
+ (read_service_action == SRA_SA_SUPPORTED_ATTRS) ?
+ sa_name : at_name);
+ hdr_len = scsi_4btoul(hdr->length);
+ for (len_left = MIN(valid_len, hdr_len),
+ cur_id = &hdr->first_attr_0[0]; len_left > 1;
+ len_left -= sizeof(uint16_t), cur_id += sizeof(uint16_t)) {
+ attr_id = scsi_2btoul(cur_id);
+
+ if ((attr_num != -1)
+ && (attr_id != attr_num))
+ continue;
+
+ entry = scsi_get_attrib_entry(attr_id);
+ fprintf(stdout, "0x%.4x", attr_id);
+ if (entry == NULL)
+ fprintf(stdout, "\n");
+ else
+ fprintf(stdout, ": %s\n", entry->desc);
+
+ if (attr_num != -1)
+ break;
+ }
+ break;
+ }
+ case SRA_SA_PART_LIST:
+ case SRA_SA_LOG_VOL_LIST: {
+ struct scsi_attrib_lv_list *lv_list;
+ const char *partition_name = "Partition";
+ const char *lv_name = "Logical Volume";
+
+ if (valid_len < sizeof(*lv_list)) {
+ fprintf(stdout, "No %s list returned\n",
+ (read_service_action == SRA_SA_PART_LIST) ?
+ partition_name : lv_name);
+ error = 0;
+ goto bailout;
+ }
+
+ lv_list = (struct scsi_attrib_lv_list *)data_buf;
+
+ fprintf(stdout, "First %s: %d\n",
+ (read_service_action == SRA_SA_PART_LIST) ?
+ partition_name : lv_name,
+ lv_list->first_lv_number);
+ fprintf(stdout, "Number of %ss: %d\n",
+ (read_service_action == SRA_SA_PART_LIST) ?
+ partition_name : lv_name,
+ lv_list->num_logical_volumes);
+ break;
+ }
+ default:
+ break;
+ }
+bailout:
+ if (ccb != NULL)
+ cam_freeccb(ccb);
+
+ free(data_buf);
+
+ return (error);
+}
diff --git a/sbin/camcontrol/camcontrol.8 b/sbin/camcontrol/camcontrol.8
index 15e1862..b9bb248 100644
--- a/sbin/camcontrol/camcontrol.8
+++ b/sbin/camcontrol/camcontrol.8
@@ -298,6 +298,19 @@
.Op Fl T Ar res_type
.Op Fl U
.Nm
+.Ic attrib
+.Op device id
+.Op generic args
+.Aq Fl r Ar action | Fl w Ar attrib
+.Op Fl a Ar attr_num
+.Op Fl c
+.Op Fl e Ar elem_addr
+.Op Fl F Ar form1,form2
+.Op Fl p Ar part
+.Op Fl s Ar start_addr
+.Op Fl T Ar elem_type
+.Op Fl V Ar lv_num
+.Nm
.Ic help
.Sh DESCRIPTION
The
@@ -1822,6 +1835,129 @@ Register and Move request.
This option only applies to the Register and Move service action of the
Persistent Reserve Out command.
.El
+.It Ic attrib
+Issue the
+.Tn SCSI
+READ or WRITE ATTRIBUTE commands.
+These commands are used to read and write attributes in Medium Auxiliary
+Memory (MAM).
+The most common place Medium Auxiliary Memory is found is small flash chips
+included tape cartriges.
+For instance,
+.Tn LTO
+tapes have MAM.
+Either the
+.Fl r
+option or the
+.Fl w
+option must be specified.
+.Bl -tag -width 14n
+.It Fl r Ar action
+Specify the READ ATTRIBUTE service action.
+.Bl -tag -width 11n
+.It attr_values
+Issue the ATTRIBUTE VALUES service action.
+Read and decode the available attributes and their values.
+.It attr_list
+Issue the ATTRIBUTE LIST service action.
+List the attributes that are available to read and write.
+.It lv_list
+Issue the LOGICAL VOLUME LIST service action.
+List the available logical volumes in the MAM.
+.It part_list
+Issue the PARTITION LIST service action.
+List the available partitions in the MAM.
+.It supp_attr
+Issue the SUPPORTED ATTRIBUTES service action.
+List attributes that are supported for reading or writing.
+These attributes may or may not be currently present in the MAM.
+.El
+.It Fl w Ar attr
+Specify an attribute to write to the MAM.
+This option is not yet implemented.
+.It Fl a Ar num
+Specify the attribute number to display.
+This option only works with the attr_values, attr_list and supp_attr
+arguments to
+.Fl r .
+.It Fl c
+Display cached attributes.
+If the device supports this flag, it allows displaying attributes for the
+last piece of media loaded in the drive.
+.It Fl e Ar num
+Specify the element address.
+This is used for specifying which element number in a medium changer to
+access when reading attributes.
+The element number could be for a picker, portal, slot or drive.
+.It Fl F Ar form1,form2
+Specify the output format for the attribute values (attr_val) display as a
+comma separated list of options.
+The default output is currently set to field_all,nonascii_trim,text_raw.
+Once this code is ported to FreeBSD 10, any text fields will be converted
+from their codeset to the user's native codeset with
+.Xr iconv 3 .
+.Pp
+The text options are mutually exclusive; if you specify more than one, you
+will get unpredictable results.
+The nonascii options are also mutually exclusive.
+Most of the field options may be logically ORed together.
+.Bl -tag -width 12n
+.It text_esc
+Print text fields with non-ASCII characters escaped.
+.It text_raw
+Print text fields natively, with no codeset conversion.
+.It nonascii_esc
+If any non-ASCII characters occur in fields that are supposed to be ASCII,
+escape the non-ASCII characters.
+.It nonascii_trim
+If any non-ASCII characters occur in fields that are supposed to be ASCII,
+omit the non-ASCII characters.
+.It nonascii_raw
+If any non-ASCII characters occur in fields that are supposed to be ASCII,
+print them as they are.
+.It field_all
+Print all of the prefix fields: description, attribute number, attribute
+size, and the attribute's readonly status.
+If field_all is specified, specifying any other field options will not have
+an effect.
+.It field_none
+Print none of the prefix fields, and only print out the attribute value.
+If field_none is specified, specifying any other field options will result
+in those fields being printed.
+.It field_desc
+Print out the attribute description.
+.It field_num
+Print out the attribute number.
+.It field_size
+Print out the attribute size.
+.It field_rw
+Print out the attribute's readonly status.
+.El
+.It Fl p Ar part
+Specify the partition.
+When the media has multiple partitions, specifying different partition
+numbers allows seeing the values for each individual partition.
+.It Fl s Ar start_num
+Specify the starting attribute number.
+This requests that the target device return attribute information starting
+at the given number.
+.It Fl T Ar elem_type
+Specify the element type.
+For medium changer devices, this allows specifying the type the element
+referenced in the element address (
+.Fl e ) .
+Valid types are:
+.Dq all ,
+.Dq picker ,
+.Dq slot ,
+.Dq portal ,
+and
+.Dq drive .
+.El
+.It Fl V Ar vol_num
+Specify the number of the logical volume to operate on.
+If the media has multiple logical volumes, this will allow displaying
+or writing attributes on the given logical volume.
.It Ic help
Print out verbose usage information.
.El
@@ -2047,6 +2183,15 @@ current initiator will be unregistered from the target.
The reservation will be moved to relative target port 2 on the target
device.
The registration will persist across power losses.
+.Pp
+.Bd -literal -offset indent
+camcontrol attrib sa0 -v -i attr_values -p 1
+.Ed
+.Pp
+This will read and decode the attribute values from partition 1 on the tape
+in tape drive sa0, and will display any
+.Tn SCSI
+errors that result.
.Sh SEE ALSO
.Xr cam 3 ,
.Xr cam_cdbparse 3 ,
diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c
index c0a1344..45826e7 100644
--- a/sbin/camcontrol/camcontrol.c
+++ b/sbin/camcontrol/camcontrol.c
@@ -98,7 +98,8 @@ typedef enum {
CAM_CMD_SANITIZE = 0x0000001f,
CAM_CMD_PERSIST = 0x00000020,
CAM_CMD_APM = 0x00000021,
- CAM_CMD_AAM = 0x00000022
+ CAM_CMD_AAM = 0x00000022,
+ CAM_CMD_ATTRIB = 0x00000023
} cam_cmdmask;
typedef enum {
@@ -224,6 +225,7 @@ static struct camcontrol_opts option_table[] = {
{"security", CAM_CMD_SECURITY, CAM_ARG_NONE, "d:e:fh:k:l:qs:T:U:y"},
{"hpa", CAM_CMD_HPA, CAM_ARG_NONE, "Pflp:qs:U:y"},
{"persist", CAM_CMD_PERSIST, CAM_ARG_NONE, "ai:I:k:K:o:ps:ST:U"},
+ {"attrib", CAM_CMD_ATTRIB, CAM_ARG_NONE, "a:ce:F:p:r:s:T:w:V:"},
#endif /* MINIMALISTIC */
{"help", CAM_CMD_USAGE, CAM_ARG_NONE, NULL},
{"-?", CAM_CMD_USAGE, CAM_ARG_NONE, NULL},
@@ -2566,12 +2568,11 @@ atahpa(struct cam_device *device, int retry_count, int timeout,
struct ata_params *ident_buf;
struct ccb_getdev cgd;
struct ata_set_max_pwd pwd;
- int error, confirm, quiet, c, action, actions, setpwd, persist;
+ int error, confirm, quiet, c, action, actions, persist;
int security, is48bit, pwdsize;
u_int64_t hpasize, maxsize;
actions = 0;
- setpwd = 0;
confirm = 0;
quiet = 0;
maxsize = 0;
@@ -8118,6 +8119,9 @@ usage(int printlong)
" camcontrol persist [dev_id][generic args] <-i action|-o action>\n"
" [-a][-I tid][-k key][-K sa_key][-p][-R rtp]\n"
" [-s scope][-S][-T type][-U]\n"
+" camcontrol attrib [dev_id][generic args] <-r action|-w attr>\n"
+" [-a attr_num][-c][-e elem][-F form1,form1]\n"
+" [-p part][-s start][-T type][-V vol]\n"
#endif /* MINIMALISTIC */
" camcontrol help\n");
if (!printlong)
@@ -8157,6 +8161,7 @@ usage(int printlong)
"fwdownload program firmware of the named device with the given image\n"
"security report or send ATA security commands to the named device\n"
"persist send the SCSI PERSISTENT RESERVE IN or OUT commands\n"
+"attrib send the SCSI READ or WRITE ATTRIBUTE commands\n"
"help this message\n"
"Device Identifiers:\n"
"bus:target specify the bus and target, lun defaults to 0\n"
@@ -8307,6 +8312,20 @@ usage(int printlong)
"-T res_type specify the reservation type: read_shared, wr_ex, rd_ex,\n"
" ex_ac, wr_ex_ro, ex_ac_ro, wr_ex_ar, ex_ac_ar\n"
"-U unregister the current initiator for register_move\n"
+"attrib arguments:\n"
+"-r action specify attr_values, attr_list, lv_list, part_list, or\n"
+" supp_attr\n"
+"-w attr specify an attribute to write, one -w argument per attr\n"
+"-a attr_num only display this attribute number\n"
+"-c get cached attributes\n"
+"-e elem_addr request attributes for the given element in a changer\n"
+"-F form1,form2 output format, comma separated list: text_esc, text_raw,\n"
+" nonascii_esc, nonascii_trim, nonascii_raw, field_all,\n"
+" field_none, field_desc, field_num, field_size, field_rw\n"
+"-p partition request attributes for the given partition\n"
+"-s start_attr request attributes starting at the given number\n"
+"-T elem_type specify the element type (used with -e)\n"
+"-V logical_vol specify the logical volume ID\n"
);
#endif /* MINIMALISTIC */
}
@@ -8651,6 +8670,11 @@ main(int argc, char **argv)
retry_count, timeout, arglist & CAM_ARG_VERBOSE,
arglist & CAM_ARG_ERR_RECOVER);
break;
+ case CAM_CMD_ATTRIB:
+ error = scsiattrib(cam_dev, argc, argv, combinedopt,
+ retry_count, timeout, arglist & CAM_ARG_VERBOSE,
+ arglist & CAM_ARG_ERR_RECOVER);
+ break;
#endif /* MINIMALISTIC */
case CAM_CMD_USAGE:
usage(1);
diff --git a/sbin/camcontrol/camcontrol.h b/sbin/camcontrol/camcontrol.h
index 7c249bf..582b6a3 100644
--- a/sbin/camcontrol/camcontrol.h
+++ b/sbin/camcontrol/camcontrol.h
@@ -66,6 +66,9 @@ int scsidoinquiry(struct cam_device *device, int argc, char **argv,
int scsipersist(struct cam_device *device, int argc, char **argv,
char *combinedopt, int retry_count, int timeout, int verbose,
int err_recover);
+int scsiattrib(struct cam_device *device, int argc, char **argv,
+ char *combinedopt, int retry_count, int timeout, int verbose,
+ int err_recover);
char *cget(void *hook, char *name);
int iget(void *hook, char *name);
void arg_put(void *hook, int letter, void *arg, int count, char *name);
diff --git a/sbin/camcontrol/persist.c b/sbin/camcontrol/persist.c
index bcc1073..c7e16c7 100644
--- a/sbin/camcontrol/persist.c
+++ b/sbin/camcontrol/persist.c
@@ -432,7 +432,7 @@ scsipersist(struct cam_device *device, int argc, char **argv, char *combinedopt,
uint32_t res_len = 0;
unsigned long rel_tgt_port = 0;
uint8_t *res_buf = NULL;
- int scope = SPR_LU_SCOPE, res_type = 0, key_set = 0, sa_key_set = 0;
+ int scope = SPR_LU_SCOPE, res_type = 0;
struct persist_transport_id *id, *id2;
STAILQ_HEAD(, persist_transport_id) transport_id_list;
uint64_t key = 0, sa_key = 0;
@@ -510,10 +510,8 @@ scsipersist(struct cam_device *device, int argc, char **argv, char *combinedopt,
}
if (c == 'k') {
key = tmpval;
- key_set = 1;
} else {
sa_key = tmpval;
- sa_key_set = 1;
}
break;
}
diff --git a/sbin/ccdconfig/Makefile.depend b/sbin/ccdconfig/Makefile.depend
index 5d7ba23..851372c 100644
--- a/sbin/ccdconfig/Makefile.depend
+++ b/sbin/ccdconfig/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/clri/Makefile.depend b/sbin/clri/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/clri/Makefile.depend
+++ b/sbin/clri/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/comcontrol/Makefile.depend b/sbin/comcontrol/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/comcontrol/Makefile.depend
+++ b/sbin/comcontrol/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/conscontrol/Makefile.depend b/sbin/conscontrol/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/conscontrol/Makefile.depend
+++ b/sbin/conscontrol/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/ddb/Makefile.depend b/sbin/ddb/Makefile.depend
index 7a06b0f..a1ac545 100644
--- a/sbin/ddb/Makefile.depend
+++ b/sbin/ddb/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/devd/Makefile.depend b/sbin/devd/Makefile.depend
index ff511e6..eb9beeb 100644
--- a/sbin/devd/Makefile.depend
+++ b/sbin/devd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/devfs/Makefile.depend b/sbin/devfs/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/devfs/Makefile.depend
+++ b/sbin/devfs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/dhclient/Makefile.depend b/sbin/dhclient/Makefile.depend
index 45371c5..7de116d 100644
--- a/sbin/dhclient/Makefile.depend
+++ b/sbin/dhclient/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 22b21f1..7905813 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1845,12 +1845,16 @@ rewrite_client_leases(void)
leaseFile = fopen(path_dhclient_db, "w");
if (!leaseFile)
error("can't create %s: %m", path_dhclient_db);
- cap_rights_init(&rights, CAP_FSTAT, CAP_FSYNC, CAP_FTRUNCATE,
- CAP_SEEK, CAP_WRITE);
+ cap_rights_init(&rights, CAP_FCNTL, CAP_FSTAT, CAP_FSYNC,
+ CAP_FTRUNCATE, CAP_SEEK, CAP_WRITE);
if (cap_rights_limit(fileno(leaseFile), &rights) < 0 &&
errno != ENOSYS) {
error("can't limit lease descriptor: %m");
}
+ if (cap_fcntls_limit(fileno(leaseFile), CAP_FCNTL_GETFL) < 0 &&
+ errno != ENOSYS) {
+ error("can't limit lease descriptor fcntls: %m");
+ }
} else {
fflush(leaseFile);
rewind(leaseFile);
diff --git a/sbin/dmesg/Makefile.depend b/sbin/dmesg/Makefile.depend
index 7a06b0f..a1ac545 100644
--- a/sbin/dmesg/Makefile.depend
+++ b/sbin/dmesg/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/dump/Makefile.depend b/sbin/dump/Makefile.depend
index 725077b..26cae4e 100644
--- a/sbin/dump/Makefile.depend
+++ b/sbin/dump/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/dumpfs/Makefile.depend b/sbin/dumpfs/Makefile.depend
index 6ce72cc..99cf113 100644
--- a/sbin/dumpfs/Makefile.depend
+++ b/sbin/dumpfs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/dumpfs/dumpfs.c b/sbin/dumpfs/dumpfs.c
index baf3d99..ce69ba1 100644
--- a/sbin/dumpfs/dumpfs.c
+++ b/sbin/dumpfs/dumpfs.c
@@ -165,7 +165,7 @@ dumpfs(const char *name)
fstime = afs.fs_time;
printf("magic\t%x (UFS2)\ttime\t%s",
afs.fs_magic, ctime(&fstime));
- printf("superblock location\t%jd\tid\t[ %x %x ]\n",
+ printf("superblock location\t%jd\tid\t[ %08x %08x ]\n",
(intmax_t)afs.fs_sblockloc, afs.fs_id[0], afs.fs_id[1]);
printf("ncg\t%d\tsize\t%jd\tblocks\t%jd\n",
afs.fs_ncg, (intmax_t)fssize, (intmax_t)afs.fs_dsize);
diff --git a/sbin/dumpon/Makefile.depend b/sbin/dumpon/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/dumpon/Makefile.depend
+++ b/sbin/dumpon/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/etherswitchcfg/Makefile.depend b/sbin/etherswitchcfg/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/etherswitchcfg/Makefile.depend
+++ b/sbin/etherswitchcfg/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/fdisk/Makefile.depend b/sbin/fdisk/Makefile.depend
index 5d7ba23..851372c 100644
--- a/sbin/fdisk/Makefile.depend
+++ b/sbin/fdisk/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/fdisk_pc98/Makefile.depend b/sbin/fdisk_pc98/Makefile.depend
index 25f093b..4c7271b 100644
--- a/sbin/fdisk_pc98/Makefile.depend
+++ b/sbin/fdisk_pc98/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/sbin/ffsinfo/Makefile.depend b/sbin/ffsinfo/Makefile.depend
index 6ce72cc..99cf113 100644
--- a/sbin/ffsinfo/Makefile.depend
+++ b/sbin/ffsinfo/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/fsck/Makefile.depend b/sbin/fsck/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/fsck/Makefile.depend
+++ b/sbin/fsck/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/fsck_ffs/Makefile.depend b/sbin/fsck_ffs/Makefile.depend
index 6ce72cc..99cf113 100644
--- a/sbin/fsck_ffs/Makefile.depend
+++ b/sbin/fsck_ffs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/fsck_msdosfs/Makefile.depend b/sbin/fsck_msdosfs/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/fsck_msdosfs/Makefile.depend
+++ b/sbin/fsck_msdosfs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/fsdb/Makefile.depend b/sbin/fsdb/Makefile.depend
index a0fbe50..a1c5d03 100644
--- a/sbin/fsdb/Makefile.depend
+++ b/sbin/fsdb/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/fsirand/Makefile.depend b/sbin/fsirand/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/fsirand/Makefile.depend
+++ b/sbin/fsirand/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/gbde/Makefile.depend b/sbin/gbde/Makefile.depend
index d71c69a..1d64ddb 100644
--- a/sbin/gbde/Makefile.depend
+++ b/sbin/gbde/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/geom/class/cache/Makefile.depend b/sbin/geom/class/cache/Makefile.depend
index f680682..1c2c57c 100644
--- a/sbin/geom/class/cache/Makefile.depend
+++ b/sbin/geom/class/cache/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/geom/class/concat/Makefile.depend b/sbin/geom/class/concat/Makefile.depend
index f680682..1c2c57c 100644
--- a/sbin/geom/class/concat/Makefile.depend
+++ b/sbin/geom/class/concat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/geom/class/eli/Makefile.depend b/sbin/geom/class/eli/Makefile.depend
index 02b0007..cbf4e19 100644
--- a/sbin/geom/class/eli/Makefile.depend
+++ b/sbin/geom/class/eli/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/geom/class/eli/geom_eli.c b/sbin/geom/class/eli/geom_eli.c
index 7df4d90..502303d 100644
--- a/sbin/geom/class/eli/geom_eli.c
+++ b/sbin/geom/class/eli/geom_eli.c
@@ -423,7 +423,7 @@ eli_genkey_passphrase_prompt(struct gctl_req *req, bool new, char *passbuf,
for (;;) {
p = readpassphrase(
- new ? "Enter new passphrase:" : "Enter passphrase:",
+ new ? "Enter new passphrase: " : "Enter passphrase: ",
passbuf, passbufsize, RPP_ECHO_OFF | RPP_REQUIRE_TTY);
if (p == NULL) {
bzero(passbuf, passbufsize);
diff --git a/sbin/geom/class/journal/Makefile.depend b/sbin/geom/class/journal/Makefile.depend
index 20b8969..f04aa87 100644
--- a/sbin/geom/class/journal/Makefile.depend
+++ b/sbin/geom/class/journal/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/geom/class/label/Makefile.depend b/sbin/geom/class/label/Makefile.depend
index f680682..1c2c57c 100644
--- a/sbin/geom/class/label/Makefile.depend
+++ b/sbin/geom/class/label/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/geom/class/mirror/Makefile.depend b/sbin/geom/class/mirror/Makefile.depend
index 9c072c2..87303d7 100644
--- a/sbin/geom/class/mirror/Makefile.depend
+++ b/sbin/geom/class/mirror/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/geom/class/mountver/Makefile.depend b/sbin/geom/class/mountver/Makefile.depend
index f680682..1c2c57c 100644
--- a/sbin/geom/class/mountver/Makefile.depend
+++ b/sbin/geom/class/mountver/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/geom/class/multipath/Makefile.depend b/sbin/geom/class/multipath/Makefile.depend
index f680682..1c2c57c 100644
--- a/sbin/geom/class/multipath/Makefile.depend
+++ b/sbin/geom/class/multipath/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/geom/class/multipath/gmultipath.8 b/sbin/geom/class/multipath/gmultipath.8
index 07ac01e..cdb2e8a 100644
--- a/sbin/geom/class/multipath/gmultipath.8
+++ b/sbin/geom/class/multipath/gmultipath.8
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd April 18, 2012
+.Dd June 11, 2015
.Dt GMULTIPATH 8
.Os
.Sh NAME
@@ -253,13 +253,13 @@ This I/O continues until an I/O is returned with
a generic I/O error or a "Nonexistent Device" error.
When this occurs, that path is marked FAIL, the next path
in a list is selected as active and the failed I/O reissued.
-In Active/Active mode all paths not marked FAIL may handle I/O same time.
+In Active/Active mode all paths not marked FAIL may handle I/O at the same time.
Requests are distributed between paths to equalize load.
-For capable devices it allows to utilize bandwidth of all paths.
-In Active/Read mode all paths not marked FAIL may handle reads same time,
-but unlike Active/Active only one path handles write requests at any
+For capable devices it allows to utilize the bandwidth of all paths.
+In Active/Read mode all paths not marked FAIL may handle reads at the same time,
+but unlike in Active/Active mode only one path handles write requests at any
point in time.
-It allows to closer follow original write request order if above layer
+It allows to closer follow the original write request order if the layer above
needs it for data consistency (not waiting for requisite write completion
before sending dependent write).
.Pp
@@ -269,9 +269,9 @@ GEOM class is given an opportunity to taste these new devices.
If a new
device has a
.Nm MULTIPATH
-on-disk metadata label, the device is used to either create a new
+on-disk metadata label, the device is either used to create a new
.Nm MULTIPATH
-GEOM, or been added the list of paths for an existing
+GEOM, or added to the list of paths for an existing
.Nm MULTIPATH
GEOM.
.Pp
@@ -281,7 +281,7 @@ and
.Xr mpt 4
based Fibre Channel disk devices.
For these devices, when a device disappears
-(due e.g., to a cable pull or power failure to a switch), the device is
+(due to e.g., a cable pull or power failure to a switch), the device is
proactively marked as gone and I/O to it failed.
This causes the
.Nm MULTIPATH
diff --git a/sbin/geom/class/nop/Makefile.depend b/sbin/geom/class/nop/Makefile.depend
index f680682..1c2c57c 100644
--- a/sbin/geom/class/nop/Makefile.depend
+++ b/sbin/geom/class/nop/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/geom/class/part/Makefile.depend b/sbin/geom/class/part/Makefile.depend
index 40c0f44..4622764 100644
--- a/sbin/geom/class/part/Makefile.depend
+++ b/sbin/geom/class/part/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/geom/class/raid/Makefile.depend b/sbin/geom/class/raid/Makefile.depend
index 9c072c2..87303d7 100644
--- a/sbin/geom/class/raid/Makefile.depend
+++ b/sbin/geom/class/raid/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/geom/class/raid3/Makefile.depend b/sbin/geom/class/raid3/Makefile.depend
index 9c072c2..87303d7 100644
--- a/sbin/geom/class/raid3/Makefile.depend
+++ b/sbin/geom/class/raid3/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/geom/class/sched/Makefile.depend b/sbin/geom/class/sched/Makefile.depend
index f680682..1c2c57c 100644
--- a/sbin/geom/class/sched/Makefile.depend
+++ b/sbin/geom/class/sched/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/geom/class/shsec/Makefile.depend b/sbin/geom/class/shsec/Makefile.depend
index f680682..1c2c57c 100644
--- a/sbin/geom/class/shsec/Makefile.depend
+++ b/sbin/geom/class/shsec/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/geom/class/stripe/Makefile.depend b/sbin/geom/class/stripe/Makefile.depend
index f680682..1c2c57c 100644
--- a/sbin/geom/class/stripe/Makefile.depend
+++ b/sbin/geom/class/stripe/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/geom/class/virstor/Makefile.depend b/sbin/geom/class/virstor/Makefile.depend
index f680682..1c2c57c 100644
--- a/sbin/geom/class/virstor/Makefile.depend
+++ b/sbin/geom/class/virstor/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/geom/core/Makefile.depend b/sbin/geom/core/Makefile.depend
index 870b870..7762933 100644
--- a/sbin/geom/core/Makefile.depend
+++ b/sbin/geom/core/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/ggate/ggatec/Makefile.depend b/sbin/ggate/ggatec/Makefile.depend
index 7127376..73bafe4 100644
--- a/sbin/ggate/ggatec/Makefile.depend
+++ b/sbin/ggate/ggatec/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/ggate/ggated/Makefile.depend b/sbin/ggate/ggated/Makefile.depend
index b721496..9185091 100644
--- a/sbin/ggate/ggated/Makefile.depend
+++ b/sbin/ggate/ggated/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/ggate/ggatel/Makefile.depend b/sbin/ggate/ggatel/Makefile.depend
index c8afe60..8ea3042 100644
--- a/sbin/ggate/ggatel/Makefile.depend
+++ b/sbin/ggate/ggatel/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/growfs/Makefile.depend b/sbin/growfs/Makefile.depend
index 0eab23f..58f9a33 100644
--- a/sbin/growfs/Makefile.depend
+++ b/sbin/growfs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/gvinum/Makefile.depend b/sbin/gvinum/Makefile.depend
index c85fadc..30266ac 100644
--- a/sbin/gvinum/Makefile.depend
+++ b/sbin/gvinum/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/hastctl/Makefile.depend b/sbin/hastctl/Makefile.depend
index 3afd982..fa326bb 100644
--- a/sbin/hastctl/Makefile.depend
+++ b/sbin/hastctl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/hastd/Makefile.depend b/sbin/hastd/Makefile.depend
index a6d7388..546ac40 100644
--- a/sbin/hastd/Makefile.depend
+++ b/sbin/hastd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/ifconfig/Makefile.depend b/sbin/ifconfig/Makefile.depend
index 1e768ab..768e8c6 100644
--- a/sbin/ifconfig/Makefile.depend
+++ b/sbin/ifconfig/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/init/Makefile.depend b/sbin/init/Makefile.depend
index 0d04553..10a95e7 100644
--- a/sbin/init/Makefile.depend
+++ b/sbin/init/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/ipf/ipf/Makefile.depend b/sbin/ipf/ipf/Makefile.depend
index e0b84fd..4eb9aad 100644
--- a/sbin/ipf/ipf/Makefile.depend
+++ b/sbin/ipf/ipf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/ipf/ipfs/Makefile.depend b/sbin/ipf/ipfs/Makefile.depend
index 814419a..baac233 100644
--- a/sbin/ipf/ipfs/Makefile.depend
+++ b/sbin/ipf/ipfs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/ipf/ipfstat/Makefile.depend b/sbin/ipf/ipfstat/Makefile.depend
index a72e1f3..9efa7cf 100644
--- a/sbin/ipf/ipfstat/Makefile.depend
+++ b/sbin/ipf/ipfstat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/ipf/ipftest/Makefile.depend b/sbin/ipf/ipftest/Makefile.depend
index d47fed7..6167828 100644
--- a/sbin/ipf/ipftest/Makefile.depend
+++ b/sbin/ipf/ipftest/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/ipf/ipmon/Makefile.depend b/sbin/ipf/ipmon/Makefile.depend
index 729899c..5bdb549 100644
--- a/sbin/ipf/ipmon/Makefile.depend
+++ b/sbin/ipf/ipmon/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/ipf/ipnat/Makefile.depend b/sbin/ipf/ipnat/Makefile.depend
index aa41ba1..1bbd418 100644
--- a/sbin/ipf/ipnat/Makefile.depend
+++ b/sbin/ipf/ipnat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/ipf/ippool/Makefile.depend b/sbin/ipf/ippool/Makefile.depend
index a91cdf7..cc3cf4d 100644
--- a/sbin/ipf/ippool/Makefile.depend
+++ b/sbin/ipf/ippool/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/ipf/ipresend/Makefile.depend b/sbin/ipf/ipresend/Makefile.depend
index ca9247f..9e0787f 100644
--- a/sbin/ipf/ipresend/Makefile.depend
+++ b/sbin/ipf/ipresend/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/ipf/libipf/Makefile.depend b/sbin/ipf/libipf/Makefile.depend
index f9d0411..55e67ed 100644
--- a/sbin/ipf/libipf/Makefile.depend
+++ b/sbin/ipf/libipf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/ipfw/Makefile.depend b/sbin/ipfw/Makefile.depend
index 57e21da..94816f2 100644
--- a/sbin/ipfw/Makefile.depend
+++ b/sbin/ipfw/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/iscontrol/Makefile.depend b/sbin/iscontrol/Makefile.depend
index 45dda90..6e045828 100644
--- a/sbin/iscontrol/Makefile.depend
+++ b/sbin/iscontrol/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/kldconfig/Makefile.depend b/sbin/kldconfig/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/kldconfig/Makefile.depend
+++ b/sbin/kldconfig/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/kldload/Makefile.depend b/sbin/kldload/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/kldload/Makefile.depend
+++ b/sbin/kldload/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/kldstat/Makefile.depend b/sbin/kldstat/Makefile.depend
index 461e710..9cb890b 100644
--- a/sbin/kldstat/Makefile.depend
+++ b/sbin/kldstat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/kldunload/Makefile.depend b/sbin/kldunload/Makefile.depend
index 461e710..9cb890b 100644
--- a/sbin/kldunload/Makefile.depend
+++ b/sbin/kldunload/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/ldconfig/Makefile.depend b/sbin/ldconfig/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/ldconfig/Makefile.depend
+++ b/sbin/ldconfig/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/mca/Makefile b/sbin/mca/Makefile
deleted file mode 100644
index 2616725..0000000
--- a/sbin/mca/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-# $FreeBSD$
-PROG= mca
-MAN= mca.8
-
-.include <bsd.prog.mk>
diff --git a/sbin/mca/Makefile.depend b/sbin/mca/Makefile.depend
deleted file mode 100644
index a839545..0000000
--- a/sbin/mca/Makefile.depend
+++ /dev/null
@@ -1,19 +0,0 @@
-# Autogenerated - do NOT edit!
-
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
-DEP_MACHINE := ${.PARSEFILE:E}
-
-DIRDEPS = \
- gnu/lib/libgcc \
- include \
- include/xlocale \
- lib/${CSU_DIR} \
- lib/libc \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/sbin/mca/mca.8 b/sbin/mca/mca.8
deleted file mode 100644
index e654d36..0000000
--- a/sbin/mca/mca.8
+++ /dev/null
@@ -1,73 +0,0 @@
-.\" Copyright (c) 2006 Marcel Moolenaar
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-.\"
-.\" $FreeBSD$
-.\"
-.Dd February 11, 2006
-.Dt MCA 8
-.Os
-.Sh NAME
-.Nm mca
-.Nd "Machine Check Architecture control utility"
-.Sh SYNOPSIS
-.Nm
-.Op Fl d
-.Op Fl f Ar filename
-.Sh DESCRIPTION
-The
-.Nm
-utility provides minimal functionality to dump or display MCA records
-that were saved by the kernel during boot.
-The default behaviour of the
-.Nm
-utility is to display all new MCA records on stdout.
-When the
-.Fl d
-option is given, the records are dumped in binary form.
-The default file to which records are dumped is
-.Pa /var/log/mca.log .
-This can be changed by specifying the
-.Fl f
-option.
-New records are appended to the dump file.
-.Pp
-Previously dumped records can be displayed by giving the name of
-the dump file with the
-.Fl f
-option.
-.Sh FILES
-.Bl -tag -width ".Pa /var/log/mca.log" -compact
-.It Pa /var/log/mca.log
-default dump file
-.El
-.Sh HISTORY
-The
-.Nm
-utility appeared in
-.Fx 5.0
-for ia64.
-.Sh BUGS
-The development of the
-.Nm
-utility is still a work in progress.
diff --git a/sbin/mca/mca.c b/sbin/mca/mca.c
deleted file mode 100644
index ed7bcff..0000000
--- a/sbin/mca/mca.c
+++ /dev/null
@@ -1,547 +0,0 @@
-/*
- * Copyright (c) 2002 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <sys/sysctl.h>
-#include <sys/uuid.h>
-
-/*
- * Hack to make this compile on non-ia64 machines.
- */
-#ifdef __ia64__
-#include <machine/mca.h>
-#else
-#include "../../sys/ia64/include/mca.h"
-#endif
-
-#include <err.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <uuid.h>
-
-#define BCD(x) ((x >> 4) * 10 + (x & 15))
-
-#define HW_MCA_MAX_CPUID 255
-
-static const char hw_mca_count[] = "hw.mca.count";
-static const char hw_mca_first[] = "hw.mca.first";
-static const char hw_mca_last[] = "hw.mca.last";
-static const char hw_mca_recid[] = "hw.mca.%d.%u";
-
-static char default_dumpfile[] = "/var/log/mca.log";
-
-int fl_dump;
-char *file;
-
-static const char *
-severity(int error)
-{
-
- switch (error) {
- case MCA_RH_ERROR_RECOVERABLE:
- return ("recoverable");
- case MCA_RH_ERROR_FATAL:
- return ("fatal");
- case MCA_RH_ERROR_CORRECTED:
- return ("corrected");
- }
-
- return ("unknown");
-}
-
-static const char *
-uuid(uuid_t *id)
-{
- static char buffer[64];
- char *s;
-
- uuid_to_string(id, &s, NULL);
- strcpy(buffer, s);
- free(s);
- return (buffer);
-}
-
-static int
-show_value(int indent, const char *var, const char *fmt, ...)
-{
- va_list ap;
- int len;
-
- len = indent;
- while (indent--)
- putchar(' ');
- len += printf("<%s>", var);
- va_start(ap, fmt);
- len += vprintf(fmt, ap);
- len += printf("</%s>\n", var);
- return (len);
-}
-
-static size_t
-show_header(struct mca_record_header *rh)
-{
-
- printf(" <header>\n");
- show_value(4, "seqnr", "%lld", (long long)rh->rh_seqnr);
- show_value(4, "revision", "%d.%d", BCD(rh->rh_major),
- BCD(rh->rh_minor));
- show_value(4, "severity", "%s", severity(rh->rh_error));
- show_value(4, "length", "%lld", (long long)rh->rh_length);
- show_value(4, "date", "%d%02d/%02d/%02d",
- BCD(rh->rh_time[MCA_RH_TIME_CENT]),
- BCD(rh->rh_time[MCA_RH_TIME_YEAR]),
- BCD(rh->rh_time[MCA_RH_TIME_MON]),
- BCD(rh->rh_time[MCA_RH_TIME_MDAY]));
- show_value(4, "time", "%02d:%02d:%02d",
- BCD(rh->rh_time[MCA_RH_TIME_HOUR]),
- BCD(rh->rh_time[MCA_RH_TIME_MIN]),
- BCD(rh->rh_time[MCA_RH_TIME_SEC]));
- if (rh->rh_flags & MCA_RH_FLAGS_PLATFORM_ID)
- show_value(4, "platform", "%s", uuid(&rh->rh_platform));
- printf(" </header>\n");
- return (rh->rh_length);
-}
-
-static void
-show_cpu_mod(const char *what, int idx, struct mca_cpu_mod *cpu_mod)
-{
- printf(" <%s-%d>\n", what, idx);
- if (cpu_mod->cpu_mod_flags & MCA_CPU_MOD_FLAGS_INFO)
- show_value(8, "info", "0x%016llx",
- (long long)cpu_mod->cpu_mod_info);
- if (cpu_mod->cpu_mod_flags & MCA_CPU_MOD_FLAGS_REQID)
- show_value(8, "requester", "0x%016llx",
- (long long)cpu_mod->cpu_mod_reqid);
- if (cpu_mod->cpu_mod_flags & MCA_CPU_MOD_FLAGS_RSPID)
- show_value(8, "responder", "0x%016llx",
- (long long)cpu_mod->cpu_mod_rspid);
- if (cpu_mod->cpu_mod_flags & MCA_CPU_MOD_FLAGS_TGTID)
- show_value(8, "target", "0x%016llx",
- (long long)cpu_mod->cpu_mod_tgtid);
- if (cpu_mod->cpu_mod_flags & MCA_CPU_MOD_FLAGS_IP)
- show_value(8, "ip", "0x%016llx",
- (long long)cpu_mod->cpu_mod_ip);
- printf(" </%s-%d>\n", what, idx);
-}
-
-static void
-show_cpu(struct mca_cpu_record *cpu)
-{
- char var[16];
- struct mca_cpu_mod *mod;
- struct mca_cpu_cpuid *cpuid;
-#ifdef notyet
- struct mca_cpu_psi *psi;
-#endif
- int i, n;
-
- printf(" <cpu>\n");
-
- if (cpu->cpu_flags & MCA_CPU_FLAGS_ERRMAP)
- show_value(6, "errmap", "0x%016llx",
- (long long)cpu->cpu_errmap);
- if (cpu->cpu_flags & MCA_CPU_FLAGS_STATE)
- show_value(6, "state", "0x%016llx",
- (long long)cpu->cpu_state);
- if (cpu->cpu_flags & MCA_CPU_FLAGS_CR_LID)
- show_value(6, "cr_lid", "0x%016llx",
- (long long)cpu->cpu_cr_lid);
-
- mod = (struct mca_cpu_mod*)(cpu + 1);
- n = MCA_CPU_FLAGS_CACHE(cpu->cpu_flags);
- for (i = 0; i < n; i++)
- show_cpu_mod("cache", i, mod++);
- n = MCA_CPU_FLAGS_TLB(cpu->cpu_flags);
- for (i = 0; i < n; i++)
- show_cpu_mod("tlb", i, mod++);
- n = MCA_CPU_FLAGS_BUS(cpu->cpu_flags);
- for (i = 0; i < n; i++)
- show_cpu_mod("bus", i, mod++);
- n = MCA_CPU_FLAGS_REG(cpu->cpu_flags);
- for (i = 0; i < n; i++)
- show_cpu_mod("reg", i, mod++);
- n = MCA_CPU_FLAGS_MS(cpu->cpu_flags);
- for (i = 0; i < n; i++)
- show_cpu_mod("ms", i, mod++);
-
- cpuid = (struct mca_cpu_cpuid*)mod;
- for (i = 0; i < 6; i++) {
- sprintf(var, "cpuid-%d", i);
- show_value(6, var, "0x%016llx", (long long)cpuid->cpuid[i]);
- }
-
-#ifdef notyet
- psi = (struct mca_cpu_psi*)(cpuid + 1);
-#endif
- /* TODO: Dump PSI */
-
- printf(" </cpu>\n");
-}
-
-static void
-show_memory(struct mca_mem_record *mem)
-{
- printf(" <memory>\n");
-
- if (mem->mem_flags & MCA_MEM_FLAGS_STATUS)
- show_value(6, "status", "0x%016llx",
- (long long)mem->mem_status);
- if (mem->mem_flags & MCA_MEM_FLAGS_ADDR)
- show_value(6, "address", "0x%016llx",
- (long long)mem->mem_addr);
- if (mem->mem_flags & MCA_MEM_FLAGS_ADDRMASK)
- show_value(6, "mask", "0x%016llx",
- (long long)mem->mem_addrmask);
- if (mem->mem_flags & MCA_MEM_FLAGS_NODE)
- show_value(6, "node", "0x%04x", mem->mem_node);
- if (mem->mem_flags & MCA_MEM_FLAGS_CARD)
- show_value(6, "card", "0x%04x", mem->mem_card);
- if (mem->mem_flags & MCA_MEM_FLAGS_MODULE)
- show_value(6, "module", "0x%04x", mem->mem_module);
- if (mem->mem_flags & MCA_MEM_FLAGS_BANK)
- show_value(6, "bank", "0x%04x", mem->mem_bank);
- if (mem->mem_flags & MCA_MEM_FLAGS_DEVICE)
- show_value(6, "device", "0x%04x", mem->mem_device);
- if (mem->mem_flags & MCA_MEM_FLAGS_ROW)
- show_value(6, "row", "0x%04x", mem->mem_row);
- if (mem->mem_flags & MCA_MEM_FLAGS_COLUMN)
- show_value(6, "column", "0x%04x", mem->mem_column);
- if (mem->mem_flags & MCA_MEM_FLAGS_BITPOS)
- show_value(6, "bit", "0x%04x", mem->mem_bitpos);
- if (mem->mem_flags & MCA_MEM_FLAGS_REQID)
- show_value(6, "requester", "0x%016llx",
- (long long)mem->mem_reqid);
- if (mem->mem_flags & MCA_MEM_FLAGS_RSPID)
- show_value(6, "responder", "0x%016llx",
- (long long)mem->mem_rspid);
- if (mem->mem_flags & MCA_MEM_FLAGS_TGTID)
- show_value(6, "target", "0x%016llx",
- (long long)mem->mem_tgtid);
- if (mem->mem_flags & MCA_MEM_FLAGS_BUSDATA)
- show_value(6, "status", "0x%016llx",
- (long long)mem->mem_busdata);
- if (mem->mem_flags & MCA_MEM_FLAGS_OEM_ID)
- show_value(6, "oem", "%s", uuid(&mem->mem_oem_id));
- /* TODO: Dump OEM data */
-
- printf(" </memory>\n");
-}
-
-static void
-show_sel(void)
-{
- printf(" # SEL\n");
-}
-
-static void
-show_pci_bus(struct mca_pcibus_record *pcibus)
-{
- printf(" <pci-bus>\n");
-
- if (pcibus->pcibus_flags & MCA_PCIBUS_FLAGS_STATUS)
- show_value(6, "status", "0x%016llx",
- (long long)pcibus->pcibus_status);
- if (pcibus->pcibus_flags & MCA_PCIBUS_FLAGS_ERROR)
- show_value(6, "error", "0x%04x", pcibus->pcibus_error);
- if (pcibus->pcibus_flags & MCA_PCIBUS_FLAGS_BUS)
- show_value(6, "bus", "0x%04x", pcibus->pcibus_bus);
- if (pcibus->pcibus_flags & MCA_PCIBUS_FLAGS_ADDR)
- show_value(6, "address", "0x%016llx",
- (long long)pcibus->pcibus_addr);
- if (pcibus->pcibus_flags & MCA_PCIBUS_FLAGS_DATA)
- show_value(6, "data", "0x%016llx",
- (long long)pcibus->pcibus_data);
- if (pcibus->pcibus_flags & MCA_PCIBUS_FLAGS_CMD)
- show_value(6, "cmd", "0x%016llx",
- (long long)pcibus->pcibus_cmd);
- if (pcibus->pcibus_flags & MCA_PCIBUS_FLAGS_REQID)
- show_value(6, "requester", "0x%016llx",
- (long long)pcibus->pcibus_reqid);
- if (pcibus->pcibus_flags & MCA_PCIBUS_FLAGS_RSPID)
- show_value(6, "responder", "0x%016llx",
- (long long)pcibus->pcibus_rspid);
- if (pcibus->pcibus_flags & MCA_PCIBUS_FLAGS_TGTID)
- show_value(6, "target", "0x%016llx",
- (long long)pcibus->pcibus_tgtid);
- if (pcibus->pcibus_flags & MCA_PCIBUS_FLAGS_OEM_ID)
- show_value(6, "oem", "%s", uuid(&pcibus->pcibus_oem_id));
- /* TODO: Dump OEM data */
-
- printf(" </pci-bus>\n");
-}
-
-static void
-show_smbios(void)
-{
- printf(" # SMBIOS\n");
-}
-
-static void
-show_pci_dev(struct mca_pcidev_record *pcidev)
-{
- printf(" <pci-dev>\n");
-
- if (pcidev->pcidev_flags & MCA_PCIDEV_FLAGS_STATUS)
- show_value(6, "status", "0x%016llx",
- (long long)pcidev->pcidev_status);
- if (pcidev->pcidev_flags & MCA_PCIDEV_FLAGS_INFO) {
- show_value(6, "vendor", "0x%04x",
- pcidev->pcidev_info.info_vendor);
- show_value(6, "device", "0x%04x",
- pcidev->pcidev_info.info_device);
- show_value(6, "class", "0x%06x",
- MCA_PCIDEV_INFO_CLASS(pcidev->pcidev_info.info_ccfn));
- show_value(6, "function", "0x%02x",
- MCA_PCIDEV_INFO_FUNCTION(pcidev->pcidev_info.info_ccfn));
- show_value(6, "slot", "0x%02x", pcidev->pcidev_info.info_slot);
- show_value(6, "bus", "0x%04x", pcidev->pcidev_info.info_bus);
- show_value(6, "segment", "0x%04x",
- pcidev->pcidev_info.info_segment);
- }
- /* TODO: dump registers */
- /* TODO: Dump OEM data */
-
- printf(" </pci-dev>\n");
-}
-
-static void
-show_generic(void)
-{
- printf(" # GENERIC\n");
-}
-
-static size_t
-show_section(struct mca_section_header *sh)
-{
- static uuid_t uuid_cpu = MCA_UUID_CPU;
- static uuid_t uuid_memory = MCA_UUID_MEMORY;
- static uuid_t uuid_sel = MCA_UUID_SEL;
- static uuid_t uuid_pci_bus = MCA_UUID_PCI_BUS;
- static uuid_t uuid_smbios = MCA_UUID_SMBIOS;
- static uuid_t uuid_pci_dev = MCA_UUID_PCI_DEV;
- static uuid_t uuid_generic = MCA_UUID_GENERIC;
-
- printf(" <section>\n");
- show_value(4, "uuid", "%s", uuid(&sh->sh_uuid));
- show_value(4, "revision", "%d.%d", BCD(sh->sh_major),
- BCD(sh->sh_minor));
-
- if (uuid_equal(&sh->sh_uuid, &uuid_cpu, NULL))
- show_cpu((void*)(sh + 1));
- else if (uuid_equal(&sh->sh_uuid, &uuid_memory, NULL))
- show_memory((void*)(sh + 1));
- else if (uuid_equal(&sh->sh_uuid, &uuid_sel, NULL))
- show_sel();
- else if (uuid_equal(&sh->sh_uuid, &uuid_pci_bus, NULL))
- show_pci_bus((void*)(sh + 1));
- else if (uuid_equal(&sh->sh_uuid, &uuid_smbios, NULL))
- show_smbios();
- else if (uuid_equal(&sh->sh_uuid, &uuid_pci_dev, NULL))
- show_pci_dev((void*)(sh + 1));
- else if (uuid_equal(&sh->sh_uuid, &uuid_generic, NULL))
- show_generic();
-
- printf(" </section>\n");
- return (sh->sh_length);
-}
-
-static void
-show(char *data, const char *mib)
-{
- size_t reclen, seclen;
-
- if (mib != NULL)
- printf("<!-- MIB: %s -->\n", mib);
-
- printf("<record>\n");
- reclen = show_header((void*)data) - sizeof(struct mca_record_header);
- data += sizeof(struct mca_record_header);
- while (reclen > sizeof(struct mca_section_header)) {
- seclen = show_section((void*)data);
- reclen -= seclen;
- data += seclen;
- }
- printf("</record>\n");
-}
-
-static void
-showall(char *buf, size_t buflen)
-{
- struct mca_record_header *rh;
- size_t reclen;
-
- do {
- if (buflen < sizeof(struct mca_record_header))
- return;
-
- rh = (void*)buf;
- reclen = rh->rh_length;
- if (buflen < reclen)
- return;
-
- show(buf, NULL);
-
- buf += reclen;
- buflen -= reclen;
- }
- while (1);
-}
-
-static void
-dump(char *data)
-{
- struct mca_record_header *rh;
- const char *fn;
- int fd;
-
- rh = (void*)data;
- fn = (file) ? file : default_dumpfile;
- fd = open(fn, O_WRONLY|O_CREAT|O_APPEND, 0660);
- if (fd == -1)
- err(2, "open(%s)", fn);
- if (write(fd, (void*)rh, rh->rh_length) == -1)
- err(2, "write(%s)", fn);
- close(fd);
-}
-
-static void
-usage(void)
-{
-
- fprintf(stderr, "usage: mca [-df]\n");
- exit (1);
-}
-
-int
-main(int argc, char **argv)
-{
- char mib[32];
- char *buf;
- size_t len;
- int ch, error, fd;
- int count, first, last, cpuid;
-
- while ((ch = getopt(argc, argv, "df:")) != -1) {
- switch(ch) {
- case 'd': /* dump */
- fl_dump = 1;
- break;
- case 'f':
- if (file)
- free(file); /* XXX complain! */
- file = strdup(optarg);
- break;
- default:
- usage();
- }
- }
-
- argc -= optind;
- argv += optind;
-
- if (file == NULL || fl_dump) {
- len = sizeof(count);
- if (sysctlbyname(hw_mca_count, &count, &len, NULL, 0) == -1)
- err(1, hw_mca_count);
-
- if (count == 0)
- errx(0, "no error records found");
-
- len = sizeof(first);
- if (sysctlbyname(hw_mca_first, &first, &len, NULL, 0) == -1)
- err(1, hw_mca_first);
-
- len = sizeof(last);
- if (sysctlbyname(hw_mca_last, &last, &len, NULL, 0) == -1)
- err(1, hw_mca_last);
-
- cpuid = 0;
- error = 0;
- while (count && first <= last) {
- do {
- sprintf(mib, hw_mca_recid, first, cpuid);
- len = 0;
- ch = sysctlbyname(mib, NULL, &len, NULL, 0);
- error = (ch == -1) ? errno : 0;
- if (error != ENOENT)
- break;
- cpuid++;
- } while (cpuid <= HW_MCA_MAX_CPUID);
- if (error == ENOENT && cpuid > HW_MCA_MAX_CPUID) {
- first++;
- cpuid = 0;
- continue;
- }
- if (error)
- errc(1, error, "%s(1)", mib);
-
- buf = malloc(len);
- if (buf == NULL)
- err(1, "buffer");
-
- if (sysctlbyname(mib, buf, &len, NULL, 0) == -1)
- err(1, "%s(2)", mib);
-
- if (fl_dump)
- dump(buf);
- else
- show(buf, mib);
-
- free(buf);
- count--;
- if (cpuid == HW_MCA_MAX_CPUID) {
- first++;
- cpuid = 0;
- } else
- cpuid++;
- }
- } else {
- fd = open(file, O_RDONLY);
- if (fd == -1)
- err(1, "open(%s)", file);
-
- len = lseek(fd, 0LL, SEEK_END);
- buf = mmap(NULL, len, PROT_READ, 0U, fd, 0LL);
- if (buf == MAP_FAILED)
- err(1, "mmap(%s)", file);
-
- showall(buf, len);
-
- munmap(buf, len);
- close(fd);
- }
-
- return (0);
-}
diff --git a/sbin/md5/Makefile.depend b/sbin/md5/Makefile.depend
index c0953ba..064e492 100644
--- a/sbin/md5/Makefile.depend
+++ b/sbin/md5/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/mdconfig/Makefile.depend b/sbin/mdconfig/Makefile.depend
index dd4a96f..bfd9ff6 100644
--- a/sbin/mdconfig/Makefile.depend
+++ b/sbin/mdconfig/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/mdmfs/Makefile.depend b/sbin/mdmfs/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/mdmfs/Makefile.depend
+++ b/sbin/mdmfs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/mknod/Makefile.depend b/sbin/mknod/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/mknod/Makefile.depend
+++ b/sbin/mknod/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/mksnap_ffs/Makefile.depend b/sbin/mksnap_ffs/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/mksnap_ffs/Makefile.depend
+++ b/sbin/mksnap_ffs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/mount/Makefile.depend b/sbin/mount/Makefile.depend
index 0eab23f..58f9a33 100644
--- a/sbin/mount/Makefile.depend
+++ b/sbin/mount/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/mount_cd9660/Makefile.depend b/sbin/mount_cd9660/Makefile.depend
index 467d7eb..5a8df4c 100644
--- a/sbin/mount_cd9660/Makefile.depend
+++ b/sbin/mount_cd9660/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/mount_fusefs/Makefile.depend b/sbin/mount_fusefs/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/mount_fusefs/Makefile.depend
+++ b/sbin/mount_fusefs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/mount_msdosfs/Makefile.depend b/sbin/mount_msdosfs/Makefile.depend
index 9a6cb3c..af10867 100644
--- a/sbin/mount_msdosfs/Makefile.depend
+++ b/sbin/mount_msdosfs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/mount_nfs/Makefile.depend b/sbin/mount_nfs/Makefile.depend
index f0ca83a..c0b7a14 100644
--- a/sbin/mount_nfs/Makefile.depend
+++ b/sbin/mount_nfs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/mount_nullfs/Makefile.depend b/sbin/mount_nullfs/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/mount_nullfs/Makefile.depend
+++ b/sbin/mount_nullfs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/mount_udf/Makefile.depend b/sbin/mount_udf/Makefile.depend
index 7c6a142..51cf539 100644
--- a/sbin/mount_udf/Makefile.depend
+++ b/sbin/mount_udf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/mount_unionfs/Makefile.depend b/sbin/mount_unionfs/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/mount_unionfs/Makefile.depend
+++ b/sbin/mount_unionfs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/natd/Makefile.depend b/sbin/natd/Makefile.depend
index 88214e1..3418575 100644
--- a/sbin/natd/Makefile.depend
+++ b/sbin/natd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/newfs/Makefile.depend b/sbin/newfs/Makefile.depend
index f5ecca9..24f47f3 100644
--- a/sbin/newfs/Makefile.depend
+++ b/sbin/newfs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/newfs_msdos/Makefile.depend b/sbin/newfs_msdos/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/newfs_msdos/Makefile.depend
+++ b/sbin/newfs_msdos/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/nfsiod/Makefile.depend b/sbin/nfsiod/Makefile.depend
index 461e710..9cb890b 100644
--- a/sbin/nfsiod/Makefile.depend
+++ b/sbin/nfsiod/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/nos-tun/Makefile.depend b/sbin/nos-tun/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/sbin/nos-tun/Makefile.depend
+++ b/sbin/nos-tun/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/nvmecontrol/Makefile.depend b/sbin/nvmecontrol/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/nvmecontrol/Makefile.depend
+++ b/sbin/nvmecontrol/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/pfctl/Makefile.depend b/sbin/pfctl/Makefile.depend
index 812d0c2..0113da6 100644
--- a/sbin/pfctl/Makefile.depend
+++ b/sbin/pfctl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/pflogd/Makefile.depend b/sbin/pflogd/Makefile.depend
index 2fabd86..268320b 100644
--- a/sbin/pflogd/Makefile.depend
+++ b/sbin/pflogd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/ping/Makefile.depend b/sbin/ping/Makefile.depend
index c9d90b8..35832c2 100644
--- a/sbin/ping/Makefile.depend
+++ b/sbin/ping/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/ping6/Makefile.depend b/sbin/ping6/Makefile.depend
index 056a764..c87ecaf 100644
--- a/sbin/ping6/Makefile.depend
+++ b/sbin/ping6/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/quotacheck/Makefile.depend b/sbin/quotacheck/Makefile.depend
index 0eab23f..58f9a33 100644
--- a/sbin/quotacheck/Makefile.depend
+++ b/sbin/quotacheck/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/rcorder/Makefile.depend b/sbin/rcorder/Makefile.depend
index 0eab23f..58f9a33 100644
--- a/sbin/rcorder/Makefile.depend
+++ b/sbin/rcorder/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/reboot/Makefile.depend b/sbin/reboot/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/reboot/Makefile.depend
+++ b/sbin/reboot/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/recoverdisk/Makefile.depend b/sbin/recoverdisk/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/recoverdisk/Makefile.depend
+++ b/sbin/recoverdisk/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/resolvconf/Makefile.depend b/sbin/resolvconf/Makefile.depend
index 11aba52..f80275d 100644
--- a/sbin/resolvconf/Makefile.depend
+++ b/sbin/resolvconf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/restore/Makefile.depend b/sbin/restore/Makefile.depend
index 725077b..26cae4e 100644
--- a/sbin/restore/Makefile.depend
+++ b/sbin/restore/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/route/Makefile.depend b/sbin/route/Makefile.depend
index 26a5ca9..a6497f2 100644
--- a/sbin/route/Makefile.depend
+++ b/sbin/route/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/routed/Makefile.depend b/sbin/routed/Makefile.depend
index 2ceda9e..9807567d 100644
--- a/sbin/routed/Makefile.depend
+++ b/sbin/routed/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/sbin/routed/rtquery/Makefile.depend b/sbin/routed/rtquery/Makefile.depend
index a2bd391..1dd2697 100644
--- a/sbin/routed/rtquery/Makefile.depend
+++ b/sbin/routed/rtquery/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/rtsol/Makefile.depend b/sbin/rtsol/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/sbin/rtsol/Makefile.depend
+++ b/sbin/rtsol/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/savecore/Makefile.depend b/sbin/savecore/Makefile.depend
index 2822d44..952944d 100644
--- a/sbin/savecore/Makefile.depend
+++ b/sbin/savecore/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/sconfig/Makefile.depend b/sbin/sconfig/Makefile.depend
index a839545..f52ca95 100644
--- a/sbin/sconfig/Makefile.depend
+++ b/sbin/sconfig/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/sbin/setkey/Makefile.depend b/sbin/setkey/Makefile.depend
index 68c2ae32..9764245 100644
--- a/sbin/setkey/Makefile.depend
+++ b/sbin/setkey/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/shutdown/Makefile.depend b/sbin/shutdown/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/shutdown/Makefile.depend
+++ b/sbin/shutdown/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/spppcontrol/Makefile.depend b/sbin/spppcontrol/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/spppcontrol/Makefile.depend
+++ b/sbin/spppcontrol/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/sunlabel/Makefile.depend b/sbin/sunlabel/Makefile.depend
index 25f093b..4c7271b 100644
--- a/sbin/sunlabel/Makefile.depend
+++ b/sbin/sunlabel/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/sbin/swapon/Makefile.depend b/sbin/swapon/Makefile.depend
index 0eab23f..58f9a33 100644
--- a/sbin/swapon/Makefile.depend
+++ b/sbin/swapon/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/sysctl/Makefile.depend b/sbin/sysctl/Makefile.depend
index f4b5142..3646e2e 100644
--- a/sbin/sysctl/Makefile.depend
+++ b/sbin/sysctl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/tunefs/Makefile.depend b/sbin/tunefs/Makefile.depend
index 6ce72cc..99cf113 100644
--- a/sbin/tunefs/Makefile.depend
+++ b/sbin/tunefs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sbin/umount/Makefile.depend b/sbin/umount/Makefile.depend
index c3bc1bd..ddd5dbd 100644
--- a/sbin/umount/Makefile.depend
+++ b/sbin/umount/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/secure/lib/libcrypto/Makefile.depend b/secure/lib/libcrypto/Makefile.depend
index 78145fa..0742ab2 100644
--- a/secure/lib/libcrypto/Makefile.depend
+++ b/secure/lib/libcrypto/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
@@ -10,7 +11,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/msun \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/secure/lib/libcrypto/Makefile.inc b/secure/lib/libcrypto/Makefile.inc
index ec7dabe..dcbbcc8 100644
--- a/secure/lib/libcrypto/Makefile.inc
+++ b/secure/lib/libcrypto/Makefile.inc
@@ -3,8 +3,8 @@
.include <bsd.own.mk>
# OpenSSL version used for manual page generation
-OPENSSL_VER= 1.0.1m
-OPENSSL_DATE= 2015-03-19
+OPENSSL_VER= 1.0.1o
+OPENSSL_DATE= 2015-06-12
LCRYPTO_SRC= ${.CURDIR}/../../../crypto/openssl
LCRYPTO_DOC= ${.CURDIR}/../../../crypto/openssl/doc
diff --git a/secure/lib/libcrypto/engines/lib4758cca/Makefile.depend b/secure/lib/libcrypto/engines/lib4758cca/Makefile.depend
index e9b5ed1..fc0b633 100644
--- a/secure/lib/libcrypto/engines/lib4758cca/Makefile.depend
+++ b/secure/lib/libcrypto/engines/lib4758cca/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/secure/lib/libcrypto/engines/libaep/Makefile.depend b/secure/lib/libcrypto/engines/libaep/Makefile.depend
index e9b5ed1..fc0b633 100644
--- a/secure/lib/libcrypto/engines/libaep/Makefile.depend
+++ b/secure/lib/libcrypto/engines/libaep/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/secure/lib/libcrypto/engines/libatalla/Makefile.depend b/secure/lib/libcrypto/engines/libatalla/Makefile.depend
index e9b5ed1..fc0b633 100644
--- a/secure/lib/libcrypto/engines/libatalla/Makefile.depend
+++ b/secure/lib/libcrypto/engines/libatalla/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/secure/lib/libcrypto/engines/libchil/Makefile.depend b/secure/lib/libcrypto/engines/libchil/Makefile.depend
index e9b5ed1..fc0b633 100644
--- a/secure/lib/libcrypto/engines/libchil/Makefile.depend
+++ b/secure/lib/libcrypto/engines/libchil/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/secure/lib/libcrypto/engines/libcswift/Makefile.depend b/secure/lib/libcrypto/engines/libcswift/Makefile.depend
index e9b5ed1..fc0b633 100644
--- a/secure/lib/libcrypto/engines/libcswift/Makefile.depend
+++ b/secure/lib/libcrypto/engines/libcswift/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/secure/lib/libcrypto/engines/libgost/Makefile.depend b/secure/lib/libcrypto/engines/libgost/Makefile.depend
index e9b5ed1..fc0b633 100644
--- a/secure/lib/libcrypto/engines/libgost/Makefile.depend
+++ b/secure/lib/libcrypto/engines/libgost/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/secure/lib/libcrypto/engines/libnuron/Makefile.depend b/secure/lib/libcrypto/engines/libnuron/Makefile.depend
index e9b5ed1..fc0b633 100644
--- a/secure/lib/libcrypto/engines/libnuron/Makefile.depend
+++ b/secure/lib/libcrypto/engines/libnuron/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/secure/lib/libcrypto/engines/libsureware/Makefile.depend b/secure/lib/libcrypto/engines/libsureware/Makefile.depend
index e9b5ed1..fc0b633 100644
--- a/secure/lib/libcrypto/engines/libsureware/Makefile.depend
+++ b/secure/lib/libcrypto/engines/libsureware/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/secure/lib/libcrypto/engines/libubsec/Makefile.depend b/secure/lib/libcrypto/engines/libubsec/Makefile.depend
index e9b5ed1..fc0b633 100644
--- a/secure/lib/libcrypto/engines/libubsec/Makefile.depend
+++ b/secure/lib/libcrypto/engines/libubsec/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 b/secure/lib/libcrypto/man/ASN1_OBJECT_new.3
index 4713d60..58e68f6 100644
--- a/secure/lib/libcrypto/man/ASN1_OBJECT_new.3
+++ b/secure/lib/libcrypto/man/ASN1_OBJECT_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ASN1_OBJECT_new 3"
-.TH ASN1_OBJECT_new 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH ASN1_OBJECT_new 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ASN1_STRING_length.3 b/secure/lib/libcrypto/man/ASN1_STRING_length.3
index 6f94768..9b49af2 100644
--- a/secure/lib/libcrypto/man/ASN1_STRING_length.3
+++ b/secure/lib/libcrypto/man/ASN1_STRING_length.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ASN1_STRING_length 3"
-.TH ASN1_STRING_length 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH ASN1_STRING_length 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ASN1_STRING_new.3 b/secure/lib/libcrypto/man/ASN1_STRING_new.3
index 3311e84..d3ded18 100644
--- a/secure/lib/libcrypto/man/ASN1_STRING_new.3
+++ b/secure/lib/libcrypto/man/ASN1_STRING_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ASN1_STRING_new 3"
-.TH ASN1_STRING_new 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH ASN1_STRING_new 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 b/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3
index 2a95bbd..97b50b8 100644
--- a/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3
+++ b/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ASN1_STRING_print_ex 3"
-.TH ASN1_STRING_print_ex 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH ASN1_STRING_print_ex 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ASN1_generate_nconf.3 b/secure/lib/libcrypto/man/ASN1_generate_nconf.3
index 40d7a40..486ed31 100644
--- a/secure/lib/libcrypto/man/ASN1_generate_nconf.3
+++ b/secure/lib/libcrypto/man/ASN1_generate_nconf.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ASN1_generate_nconf 3"
-.TH ASN1_generate_nconf 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH ASN1_generate_nconf 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_ctrl.3 b/secure/lib/libcrypto/man/BIO_ctrl.3
index c7c995c..bed4344 100644
--- a/secure/lib/libcrypto/man/BIO_ctrl.3
+++ b/secure/lib/libcrypto/man/BIO_ctrl.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_ctrl 3"
-.TH BIO_ctrl 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BIO_ctrl 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_f_base64.3 b/secure/lib/libcrypto/man/BIO_f_base64.3
index f0f0302..36d8df6 100644
--- a/secure/lib/libcrypto/man/BIO_f_base64.3
+++ b/secure/lib/libcrypto/man/BIO_f_base64.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_f_base64 3"
-.TH BIO_f_base64 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BIO_f_base64 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_f_buffer.3 b/secure/lib/libcrypto/man/BIO_f_buffer.3
index 6a2b76a..be271bb 100644
--- a/secure/lib/libcrypto/man/BIO_f_buffer.3
+++ b/secure/lib/libcrypto/man/BIO_f_buffer.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_f_buffer 3"
-.TH BIO_f_buffer 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BIO_f_buffer 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_f_cipher.3 b/secure/lib/libcrypto/man/BIO_f_cipher.3
index 1f0a61f..796141b 100644
--- a/secure/lib/libcrypto/man/BIO_f_cipher.3
+++ b/secure/lib/libcrypto/man/BIO_f_cipher.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_f_cipher 3"
-.TH BIO_f_cipher 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BIO_f_cipher 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_f_md.3 b/secure/lib/libcrypto/man/BIO_f_md.3
index 955b0ce..9990104 100644
--- a/secure/lib/libcrypto/man/BIO_f_md.3
+++ b/secure/lib/libcrypto/man/BIO_f_md.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_f_md 3"
-.TH BIO_f_md 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BIO_f_md 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_f_null.3 b/secure/lib/libcrypto/man/BIO_f_null.3
index 1e5328e..fa5878a 100644
--- a/secure/lib/libcrypto/man/BIO_f_null.3
+++ b/secure/lib/libcrypto/man/BIO_f_null.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_f_null 3"
-.TH BIO_f_null 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BIO_f_null 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_f_ssl.3 b/secure/lib/libcrypto/man/BIO_f_ssl.3
index 8cb1819..a5527e4 100644
--- a/secure/lib/libcrypto/man/BIO_f_ssl.3
+++ b/secure/lib/libcrypto/man/BIO_f_ssl.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_f_ssl 3"
-.TH BIO_f_ssl 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BIO_f_ssl 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_find_type.3 b/secure/lib/libcrypto/man/BIO_find_type.3
index cfc8fc8..8babdc1 100644
--- a/secure/lib/libcrypto/man/BIO_find_type.3
+++ b/secure/lib/libcrypto/man/BIO_find_type.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_find_type 3"
-.TH BIO_find_type 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BIO_find_type 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_new.3 b/secure/lib/libcrypto/man/BIO_new.3
index 509b11d..20770ce 100644
--- a/secure/lib/libcrypto/man/BIO_new.3
+++ b/secure/lib/libcrypto/man/BIO_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_new 3"
-.TH BIO_new 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BIO_new 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_new_CMS.3 b/secure/lib/libcrypto/man/BIO_new_CMS.3
index bc75f5a..e031998 100644
--- a/secure/lib/libcrypto/man/BIO_new_CMS.3
+++ b/secure/lib/libcrypto/man/BIO_new_CMS.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_new_CMS 3"
-.TH BIO_new_CMS 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BIO_new_CMS 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_push.3 b/secure/lib/libcrypto/man/BIO_push.3
index 603ad52..d3cc8ca 100644
--- a/secure/lib/libcrypto/man/BIO_push.3
+++ b/secure/lib/libcrypto/man/BIO_push.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_push 3"
-.TH BIO_push 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BIO_push 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_read.3 b/secure/lib/libcrypto/man/BIO_read.3
index ac34461..99c3790 100644
--- a/secure/lib/libcrypto/man/BIO_read.3
+++ b/secure/lib/libcrypto/man/BIO_read.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_read 3"
-.TH BIO_read 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BIO_read 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_s_accept.3 b/secure/lib/libcrypto/man/BIO_s_accept.3
index 317d2ae..a3bfd5c 100644
--- a/secure/lib/libcrypto/man/BIO_s_accept.3
+++ b/secure/lib/libcrypto/man/BIO_s_accept.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_s_accept 3"
-.TH BIO_s_accept 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BIO_s_accept 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_s_bio.3 b/secure/lib/libcrypto/man/BIO_s_bio.3
index f4064d2..fb2ded4 100644
--- a/secure/lib/libcrypto/man/BIO_s_bio.3
+++ b/secure/lib/libcrypto/man/BIO_s_bio.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_s_bio 3"
-.TH BIO_s_bio 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BIO_s_bio 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_s_connect.3 b/secure/lib/libcrypto/man/BIO_s_connect.3
index 0e6388c..85fdf02 100644
--- a/secure/lib/libcrypto/man/BIO_s_connect.3
+++ b/secure/lib/libcrypto/man/BIO_s_connect.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_s_connect 3"
-.TH BIO_s_connect 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BIO_s_connect 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_s_fd.3 b/secure/lib/libcrypto/man/BIO_s_fd.3
index 9e521a6..8e880b1 100644
--- a/secure/lib/libcrypto/man/BIO_s_fd.3
+++ b/secure/lib/libcrypto/man/BIO_s_fd.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_s_fd 3"
-.TH BIO_s_fd 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BIO_s_fd 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_s_file.3 b/secure/lib/libcrypto/man/BIO_s_file.3
index a22b488..7b56f84 100644
--- a/secure/lib/libcrypto/man/BIO_s_file.3
+++ b/secure/lib/libcrypto/man/BIO_s_file.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_s_file 3"
-.TH BIO_s_file 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BIO_s_file 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_s_mem.3 b/secure/lib/libcrypto/man/BIO_s_mem.3
index bc3c6fd..ecfba6a 100644
--- a/secure/lib/libcrypto/man/BIO_s_mem.3
+++ b/secure/lib/libcrypto/man/BIO_s_mem.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_s_mem 3"
-.TH BIO_s_mem 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BIO_s_mem 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_s_null.3 b/secure/lib/libcrypto/man/BIO_s_null.3
index c645820..4ed55fc 100644
--- a/secure/lib/libcrypto/man/BIO_s_null.3
+++ b/secure/lib/libcrypto/man/BIO_s_null.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_s_null 3"
-.TH BIO_s_null 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BIO_s_null 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_s_socket.3 b/secure/lib/libcrypto/man/BIO_s_socket.3
index 9e85993..58329e9 100644
--- a/secure/lib/libcrypto/man/BIO_s_socket.3
+++ b/secure/lib/libcrypto/man/BIO_s_socket.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_s_socket 3"
-.TH BIO_s_socket 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BIO_s_socket 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_set_callback.3 b/secure/lib/libcrypto/man/BIO_set_callback.3
index cedca3a..ae4841c 100644
--- a/secure/lib/libcrypto/man/BIO_set_callback.3
+++ b/secure/lib/libcrypto/man/BIO_set_callback.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_set_callback 3"
-.TH BIO_set_callback 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BIO_set_callback 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_should_retry.3 b/secure/lib/libcrypto/man/BIO_should_retry.3
index 21c079c..db1b796 100644
--- a/secure/lib/libcrypto/man/BIO_should_retry.3
+++ b/secure/lib/libcrypto/man/BIO_should_retry.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_should_retry 3"
-.TH BIO_should_retry 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BIO_should_retry 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_BLINDING_new.3 b/secure/lib/libcrypto/man/BN_BLINDING_new.3
index b5d4d8f..c26736b 100644
--- a/secure/lib/libcrypto/man/BN_BLINDING_new.3
+++ b/secure/lib/libcrypto/man/BN_BLINDING_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_BLINDING_new 3"
-.TH BN_BLINDING_new 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BN_BLINDING_new 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_CTX_new.3 b/secure/lib/libcrypto/man/BN_CTX_new.3
index faaba94..5676c1e 100644
--- a/secure/lib/libcrypto/man/BN_CTX_new.3
+++ b/secure/lib/libcrypto/man/BN_CTX_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_CTX_new 3"
-.TH BN_CTX_new 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BN_CTX_new 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_CTX_start.3 b/secure/lib/libcrypto/man/BN_CTX_start.3
index d939512..fe638ca 100644
--- a/secure/lib/libcrypto/man/BN_CTX_start.3
+++ b/secure/lib/libcrypto/man/BN_CTX_start.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_CTX_start 3"
-.TH BN_CTX_start 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BN_CTX_start 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_add.3 b/secure/lib/libcrypto/man/BN_add.3
index 52becbf..4e58a6b 100644
--- a/secure/lib/libcrypto/man/BN_add.3
+++ b/secure/lib/libcrypto/man/BN_add.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_add 3"
-.TH BN_add 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BN_add 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_add_word.3 b/secure/lib/libcrypto/man/BN_add_word.3
index cd58500..0869c2c 100644
--- a/secure/lib/libcrypto/man/BN_add_word.3
+++ b/secure/lib/libcrypto/man/BN_add_word.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_add_word 3"
-.TH BN_add_word 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BN_add_word 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_bn2bin.3 b/secure/lib/libcrypto/man/BN_bn2bin.3
index 50f7d5e..39849b5 100644
--- a/secure/lib/libcrypto/man/BN_bn2bin.3
+++ b/secure/lib/libcrypto/man/BN_bn2bin.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_bn2bin 3"
-.TH BN_bn2bin 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BN_bn2bin 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_cmp.3 b/secure/lib/libcrypto/man/BN_cmp.3
index 5037c95..c554e6a 100644
--- a/secure/lib/libcrypto/man/BN_cmp.3
+++ b/secure/lib/libcrypto/man/BN_cmp.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_cmp 3"
-.TH BN_cmp 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BN_cmp 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_copy.3 b/secure/lib/libcrypto/man/BN_copy.3
index 22506bf..2ab659c 100644
--- a/secure/lib/libcrypto/man/BN_copy.3
+++ b/secure/lib/libcrypto/man/BN_copy.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_copy 3"
-.TH BN_copy 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BN_copy 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_generate_prime.3 b/secure/lib/libcrypto/man/BN_generate_prime.3
index d7666a7..074db2b 100644
--- a/secure/lib/libcrypto/man/BN_generate_prime.3
+++ b/secure/lib/libcrypto/man/BN_generate_prime.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_generate_prime 3"
-.TH BN_generate_prime 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BN_generate_prime 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_mod_inverse.3 b/secure/lib/libcrypto/man/BN_mod_inverse.3
index 67d8093..d28a92f 100644
--- a/secure/lib/libcrypto/man/BN_mod_inverse.3
+++ b/secure/lib/libcrypto/man/BN_mod_inverse.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_mod_inverse 3"
-.TH BN_mod_inverse 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BN_mod_inverse 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 b/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3
index b720639..8429a29 100644
--- a/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3
+++ b/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_mod_mul_montgomery 3"
-.TH BN_mod_mul_montgomery 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BN_mod_mul_montgomery 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 b/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3
index 4868b16..29bd3a6 100644
--- a/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3
+++ b/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_mod_mul_reciprocal 3"
-.TH BN_mod_mul_reciprocal 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BN_mod_mul_reciprocal 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_new.3 b/secure/lib/libcrypto/man/BN_new.3
index 6f02a16..124f638 100644
--- a/secure/lib/libcrypto/man/BN_new.3
+++ b/secure/lib/libcrypto/man/BN_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_new 3"
-.TH BN_new 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BN_new 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_num_bytes.3 b/secure/lib/libcrypto/man/BN_num_bytes.3
index 5d35707..1da3a24 100644
--- a/secure/lib/libcrypto/man/BN_num_bytes.3
+++ b/secure/lib/libcrypto/man/BN_num_bytes.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_num_bytes 3"
-.TH BN_num_bytes 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BN_num_bytes 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_rand.3 b/secure/lib/libcrypto/man/BN_rand.3
index 7531b02..3748b95 100644
--- a/secure/lib/libcrypto/man/BN_rand.3
+++ b/secure/lib/libcrypto/man/BN_rand.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_rand 3"
-.TH BN_rand 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BN_rand 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -161,7 +161,8 @@ most significant bit of the random number can be zero. If \fBtop\fR is 0,
it is set to 1, and if \fBtop\fR is 1, the two most significant bits of
the number will be set to 1, so that the product of two such random
numbers will always have 2*\fBbits\fR length. If \fBbottom\fR is true, the
-number will be odd.
+number will be odd. The value of \fBbits\fR must be zero or greater. If \fBbits\fR is
+1 then \fBtop\fR cannot also be 1.
.PP
\&\fIBN_pseudo_rand()\fR does the same, but pseudo-random numbers generated by
this function are not necessarily unpredictable. They can be used for
diff --git a/secure/lib/libcrypto/man/BN_set_bit.3 b/secure/lib/libcrypto/man/BN_set_bit.3
index 9c474f6..38fad2e 100644
--- a/secure/lib/libcrypto/man/BN_set_bit.3
+++ b/secure/lib/libcrypto/man/BN_set_bit.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_set_bit 3"
-.TH BN_set_bit 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BN_set_bit 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -174,12 +174,12 @@ error occurs if \fBa\fR is shorter than \fBn\fR bits.
shorter than \fBn\fR bits.
.PP
\&\fIBN_lshift()\fR shifts \fBa\fR left by \fBn\fR bits and places the result in
-\&\fBr\fR (\f(CW\*(C`r=a*2^n\*(C'\fR). \fIBN_lshift1()\fR shifts \fBa\fR left by one and places
-the result in \fBr\fR (\f(CW\*(C`r=2*a\*(C'\fR).
+\&\fBr\fR (\f(CW\*(C`r=a*2^n\*(C'\fR). Note that \fBn\fR must be non-negative. \fIBN_lshift1()\fR shifts
+\&\fBa\fR left by one and places the result in \fBr\fR (\f(CW\*(C`r=2*a\*(C'\fR).
.PP
\&\fIBN_rshift()\fR shifts \fBa\fR right by \fBn\fR bits and places the result in
-\&\fBr\fR (\f(CW\*(C`r=a/2^n\*(C'\fR). \fIBN_rshift1()\fR shifts \fBa\fR right by one and places
-the result in \fBr\fR (\f(CW\*(C`r=a/2\*(C'\fR).
+\&\fBr\fR (\f(CW\*(C`r=a/2^n\*(C'\fR). Note that \fBn\fR must be non-negative. \fIBN_rshift1()\fR shifts
+\&\fBa\fR right by one and places the result in \fBr\fR (\f(CW\*(C`r=a/2\*(C'\fR).
.PP
For the shift functions, \fBr\fR and \fBa\fR may be the same variable.
.SH "RETURN VALUES"
diff --git a/secure/lib/libcrypto/man/BN_swap.3 b/secure/lib/libcrypto/man/BN_swap.3
index 9778b2a..0416b1d 100644
--- a/secure/lib/libcrypto/man/BN_swap.3
+++ b/secure/lib/libcrypto/man/BN_swap.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_swap 3"
-.TH BN_swap 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BN_swap 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_zero.3 b/secure/lib/libcrypto/man/BN_zero.3
index 48d3c4c..4dfa809 100644
--- a/secure/lib/libcrypto/man/BN_zero.3
+++ b/secure/lib/libcrypto/man/BN_zero.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_zero 3"
-.TH BN_zero 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH BN_zero 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_add0_cert.3 b/secure/lib/libcrypto/man/CMS_add0_cert.3
index d485194..60d0bfe 100644
--- a/secure/lib/libcrypto/man/CMS_add0_cert.3
+++ b/secure/lib/libcrypto/man/CMS_add0_cert.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_add0_cert 3"
-.TH CMS_add0_cert 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CMS_add0_cert 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 b/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3
index f302a1d..01ba868 100644
--- a/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3
+++ b/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_add1_recipient_cert 3"
-.TH CMS_add1_recipient_cert 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CMS_add1_recipient_cert 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_add1_signer.3 b/secure/lib/libcrypto/man/CMS_add1_signer.3
index 5e4a1d9..51bfd69 100644
--- a/secure/lib/libcrypto/man/CMS_add1_signer.3
+++ b/secure/lib/libcrypto/man/CMS_add1_signer.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_add1_signer 3"
-.TH CMS_add1_signer 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CMS_add1_signer 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_compress.3 b/secure/lib/libcrypto/man/CMS_compress.3
index 5e4083f..1b51fcf 100644
--- a/secure/lib/libcrypto/man/CMS_compress.3
+++ b/secure/lib/libcrypto/man/CMS_compress.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_compress 3"
-.TH CMS_compress 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CMS_compress 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_decrypt.3 b/secure/lib/libcrypto/man/CMS_decrypt.3
index e482061..f7b269c 100644
--- a/secure/lib/libcrypto/man/CMS_decrypt.3
+++ b/secure/lib/libcrypto/man/CMS_decrypt.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_decrypt 3"
-.TH CMS_decrypt 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CMS_decrypt 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_encrypt.3 b/secure/lib/libcrypto/man/CMS_encrypt.3
index 96d7b88..d19486f 100644
--- a/secure/lib/libcrypto/man/CMS_encrypt.3
+++ b/secure/lib/libcrypto/man/CMS_encrypt.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_encrypt 3"
-.TH CMS_encrypt 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CMS_encrypt 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_final.3 b/secure/lib/libcrypto/man/CMS_final.3
index 8dd11fe..a329e6b 100644
--- a/secure/lib/libcrypto/man/CMS_final.3
+++ b/secure/lib/libcrypto/man/CMS_final.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_final 3"
-.TH CMS_final 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CMS_final 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 b/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3
index c019edb..bc6639e 100644
--- a/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3
+++ b/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_get0_RecipientInfos 3"
-.TH CMS_get0_RecipientInfos 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CMS_get0_RecipientInfos 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 b/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3
index f77d2a5..1aa3218 100644
--- a/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3
+++ b/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_get0_SignerInfos 3"
-.TH CMS_get0_SignerInfos 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CMS_get0_SignerInfos 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_get0_type.3 b/secure/lib/libcrypto/man/CMS_get0_type.3
index 8192327..23cb6d4 100644
--- a/secure/lib/libcrypto/man/CMS_get0_type.3
+++ b/secure/lib/libcrypto/man/CMS_get0_type.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_get0_type 3"
-.TH CMS_get0_type 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CMS_get0_type 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 b/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3
index d567f2d..6a08414 100644
--- a/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3
+++ b/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_get1_ReceiptRequest 3"
-.TH CMS_get1_ReceiptRequest 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CMS_get1_ReceiptRequest 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_sign.3 b/secure/lib/libcrypto/man/CMS_sign.3
index e470246..2436e08 100644
--- a/secure/lib/libcrypto/man/CMS_sign.3
+++ b/secure/lib/libcrypto/man/CMS_sign.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_sign 3"
-.TH CMS_sign 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CMS_sign 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_sign_receipt.3 b/secure/lib/libcrypto/man/CMS_sign_receipt.3
index 12b1613..d97d577 100644
--- a/secure/lib/libcrypto/man/CMS_sign_receipt.3
+++ b/secure/lib/libcrypto/man/CMS_sign_receipt.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_sign_receipt 3"
-.TH CMS_sign_receipt 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CMS_sign_receipt 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_uncompress.3 b/secure/lib/libcrypto/man/CMS_uncompress.3
index 0152329..dad7e26 100644
--- a/secure/lib/libcrypto/man/CMS_uncompress.3
+++ b/secure/lib/libcrypto/man/CMS_uncompress.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_uncompress 3"
-.TH CMS_uncompress 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CMS_uncompress 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_verify.3 b/secure/lib/libcrypto/man/CMS_verify.3
index f484c7f..7753053 100644
--- a/secure/lib/libcrypto/man/CMS_verify.3
+++ b/secure/lib/libcrypto/man/CMS_verify.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_verify 3"
-.TH CMS_verify 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CMS_verify 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_verify_receipt.3 b/secure/lib/libcrypto/man/CMS_verify_receipt.3
index 7b6981c..a324820 100644
--- a/secure/lib/libcrypto/man/CMS_verify_receipt.3
+++ b/secure/lib/libcrypto/man/CMS_verify_receipt.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_verify_receipt 3"
-.TH CMS_verify_receipt 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CMS_verify_receipt 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CONF_modules_free.3 b/secure/lib/libcrypto/man/CONF_modules_free.3
index 120867d..139a8f8 100644
--- a/secure/lib/libcrypto/man/CONF_modules_free.3
+++ b/secure/lib/libcrypto/man/CONF_modules_free.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CONF_modules_free 3"
-.TH CONF_modules_free 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CONF_modules_free 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CONF_modules_load_file.3 b/secure/lib/libcrypto/man/CONF_modules_load_file.3
index 1d2a69c..2180371 100644
--- a/secure/lib/libcrypto/man/CONF_modules_load_file.3
+++ b/secure/lib/libcrypto/man/CONF_modules_load_file.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CONF_modules_load_file 3"
-.TH CONF_modules_load_file 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CONF_modules_load_file 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 b/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3
index 58a92b1..f7fc5ef 100644
--- a/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3
+++ b/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CRYPTO_set_ex_data 3"
-.TH CRYPTO_set_ex_data 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CRYPTO_set_ex_data 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DH_generate_key.3 b/secure/lib/libcrypto/man/DH_generate_key.3
index d251cf2..9699d0c 100644
--- a/secure/lib/libcrypto/man/DH_generate_key.3
+++ b/secure/lib/libcrypto/man/DH_generate_key.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DH_generate_key 3"
-.TH DH_generate_key 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH DH_generate_key 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DH_generate_parameters.3 b/secure/lib/libcrypto/man/DH_generate_parameters.3
index bb320a4..d36c64a 100644
--- a/secure/lib/libcrypto/man/DH_generate_parameters.3
+++ b/secure/lib/libcrypto/man/DH_generate_parameters.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DH_generate_parameters 3"
-.TH DH_generate_parameters 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH DH_generate_parameters 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DH_get_ex_new_index.3 b/secure/lib/libcrypto/man/DH_get_ex_new_index.3
index cf9baf1..79727c3 100644
--- a/secure/lib/libcrypto/man/DH_get_ex_new_index.3
+++ b/secure/lib/libcrypto/man/DH_get_ex_new_index.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DH_get_ex_new_index 3"
-.TH DH_get_ex_new_index 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH DH_get_ex_new_index 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DH_new.3 b/secure/lib/libcrypto/man/DH_new.3
index 064a94a..4c57bb5 100644
--- a/secure/lib/libcrypto/man/DH_new.3
+++ b/secure/lib/libcrypto/man/DH_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DH_new 3"
-.TH DH_new 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH DH_new 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DH_set_method.3 b/secure/lib/libcrypto/man/DH_set_method.3
index 61ee98e..60eeec2 100644
--- a/secure/lib/libcrypto/man/DH_set_method.3
+++ b/secure/lib/libcrypto/man/DH_set_method.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DH_set_method 3"
-.TH DH_set_method 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH DH_set_method 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DH_size.3 b/secure/lib/libcrypto/man/DH_size.3
index 020db13..1ee2f04 100644
--- a/secure/lib/libcrypto/man/DH_size.3
+++ b/secure/lib/libcrypto/man/DH_size.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DH_size 3"
-.TH DH_size 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH DH_size 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_SIG_new.3 b/secure/lib/libcrypto/man/DSA_SIG_new.3
index eb6d5f1..598ddcb 100644
--- a/secure/lib/libcrypto/man/DSA_SIG_new.3
+++ b/secure/lib/libcrypto/man/DSA_SIG_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_SIG_new 3"
-.TH DSA_SIG_new 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH DSA_SIG_new 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_do_sign.3 b/secure/lib/libcrypto/man/DSA_do_sign.3
index 99a4669..504e25c 100644
--- a/secure/lib/libcrypto/man/DSA_do_sign.3
+++ b/secure/lib/libcrypto/man/DSA_do_sign.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_do_sign 3"
-.TH DSA_do_sign 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH DSA_do_sign 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_dup_DH.3 b/secure/lib/libcrypto/man/DSA_dup_DH.3
index 3dd705e..053d61f 100644
--- a/secure/lib/libcrypto/man/DSA_dup_DH.3
+++ b/secure/lib/libcrypto/man/DSA_dup_DH.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_dup_DH 3"
-.TH DSA_dup_DH 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH DSA_dup_DH 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_generate_key.3 b/secure/lib/libcrypto/man/DSA_generate_key.3
index b9570ea..b8f8afb 100644
--- a/secure/lib/libcrypto/man/DSA_generate_key.3
+++ b/secure/lib/libcrypto/man/DSA_generate_key.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_generate_key 3"
-.TH DSA_generate_key 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH DSA_generate_key 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_generate_parameters.3 b/secure/lib/libcrypto/man/DSA_generate_parameters.3
index 3aeecf1..d90a954 100644
--- a/secure/lib/libcrypto/man/DSA_generate_parameters.3
+++ b/secure/lib/libcrypto/man/DSA_generate_parameters.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_generate_parameters 3"
-.TH DSA_generate_parameters 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH DSA_generate_parameters 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 b/secure/lib/libcrypto/man/DSA_get_ex_new_index.3
index 1bd5264..13ebc02 100644
--- a/secure/lib/libcrypto/man/DSA_get_ex_new_index.3
+++ b/secure/lib/libcrypto/man/DSA_get_ex_new_index.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_get_ex_new_index 3"
-.TH DSA_get_ex_new_index 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH DSA_get_ex_new_index 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_new.3 b/secure/lib/libcrypto/man/DSA_new.3
index 63f4d7a..06f74c7 100644
--- a/secure/lib/libcrypto/man/DSA_new.3
+++ b/secure/lib/libcrypto/man/DSA_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_new 3"
-.TH DSA_new 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH DSA_new 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_set_method.3 b/secure/lib/libcrypto/man/DSA_set_method.3
index f8520dd..fedd0a6 100644
--- a/secure/lib/libcrypto/man/DSA_set_method.3
+++ b/secure/lib/libcrypto/man/DSA_set_method.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_set_method 3"
-.TH DSA_set_method 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH DSA_set_method 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_sign.3 b/secure/lib/libcrypto/man/DSA_sign.3
index 20aecab..7ca08c9 100644
--- a/secure/lib/libcrypto/man/DSA_sign.3
+++ b/secure/lib/libcrypto/man/DSA_sign.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_sign 3"
-.TH DSA_sign 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH DSA_sign 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_size.3 b/secure/lib/libcrypto/man/DSA_size.3
index c556c71..aed21f7 100644
--- a/secure/lib/libcrypto/man/DSA_size.3
+++ b/secure/lib/libcrypto/man/DSA_size.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_size 3"
-.TH DSA_size 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH DSA_size 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_GET_LIB.3 b/secure/lib/libcrypto/man/ERR_GET_LIB.3
index eab80a6..fdac146 100644
--- a/secure/lib/libcrypto/man/ERR_GET_LIB.3
+++ b/secure/lib/libcrypto/man/ERR_GET_LIB.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_GET_LIB 3"
-.TH ERR_GET_LIB 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH ERR_GET_LIB 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_clear_error.3 b/secure/lib/libcrypto/man/ERR_clear_error.3
index 670d206..85435a6 100644
--- a/secure/lib/libcrypto/man/ERR_clear_error.3
+++ b/secure/lib/libcrypto/man/ERR_clear_error.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_clear_error 3"
-.TH ERR_clear_error 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH ERR_clear_error 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_error_string.3 b/secure/lib/libcrypto/man/ERR_error_string.3
index e29d933..9c0588a 100644
--- a/secure/lib/libcrypto/man/ERR_error_string.3
+++ b/secure/lib/libcrypto/man/ERR_error_string.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_error_string 3"
-.TH ERR_error_string 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH ERR_error_string 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_get_error.3 b/secure/lib/libcrypto/man/ERR_get_error.3
index c82d9c7..75170e0 100644
--- a/secure/lib/libcrypto/man/ERR_get_error.3
+++ b/secure/lib/libcrypto/man/ERR_get_error.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_get_error 3"
-.TH ERR_get_error 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH ERR_get_error 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 b/secure/lib/libcrypto/man/ERR_load_crypto_strings.3
index 2947c96..dbcb632 100644
--- a/secure/lib/libcrypto/man/ERR_load_crypto_strings.3
+++ b/secure/lib/libcrypto/man/ERR_load_crypto_strings.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_load_crypto_strings 3"
-.TH ERR_load_crypto_strings 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH ERR_load_crypto_strings 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_load_strings.3 b/secure/lib/libcrypto/man/ERR_load_strings.3
index 5fc34d5..1b2eb3c 100644
--- a/secure/lib/libcrypto/man/ERR_load_strings.3
+++ b/secure/lib/libcrypto/man/ERR_load_strings.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_load_strings 3"
-.TH ERR_load_strings 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH ERR_load_strings 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_print_errors.3 b/secure/lib/libcrypto/man/ERR_print_errors.3
index 6135132..193457b 100644
--- a/secure/lib/libcrypto/man/ERR_print_errors.3
+++ b/secure/lib/libcrypto/man/ERR_print_errors.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_print_errors 3"
-.TH ERR_print_errors 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH ERR_print_errors 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_put_error.3 b/secure/lib/libcrypto/man/ERR_put_error.3
index ad95314..cd84abf 100644
--- a/secure/lib/libcrypto/man/ERR_put_error.3
+++ b/secure/lib/libcrypto/man/ERR_put_error.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_put_error 3"
-.TH ERR_put_error 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH ERR_put_error 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_remove_state.3 b/secure/lib/libcrypto/man/ERR_remove_state.3
index 8f9716a..8ba7e8f 100644
--- a/secure/lib/libcrypto/man/ERR_remove_state.3
+++ b/secure/lib/libcrypto/man/ERR_remove_state.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_remove_state 3"
-.TH ERR_remove_state 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH ERR_remove_state 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_set_mark.3 b/secure/lib/libcrypto/man/ERR_set_mark.3
index e0aa667..7463b6d 100644
--- a/secure/lib/libcrypto/man/ERR_set_mark.3
+++ b/secure/lib/libcrypto/man/ERR_set_mark.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_set_mark 3"
-.TH ERR_set_mark 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH ERR_set_mark 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_BytesToKey.3 b/secure/lib/libcrypto/man/EVP_BytesToKey.3
index e07f3d3..4347d14 100644
--- a/secure/lib/libcrypto/man/EVP_BytesToKey.3
+++ b/secure/lib/libcrypto/man/EVP_BytesToKey.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_BytesToKey 3"
-.TH EVP_BytesToKey 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH EVP_BytesToKey 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_DigestInit.3 b/secure/lib/libcrypto/man/EVP_DigestInit.3
index a22f9ee..504a333 100644
--- a/secure/lib/libcrypto/man/EVP_DigestInit.3
+++ b/secure/lib/libcrypto/man/EVP_DigestInit.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_DigestInit 3"
-.TH EVP_DigestInit 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH EVP_DigestInit 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_DigestSignInit.3 b/secure/lib/libcrypto/man/EVP_DigestSignInit.3
index d88e8f4..f1343f4 100644
--- a/secure/lib/libcrypto/man/EVP_DigestSignInit.3
+++ b/secure/lib/libcrypto/man/EVP_DigestSignInit.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_DigestSignInit 3"
-.TH EVP_DigestSignInit 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH EVP_DigestSignInit 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 b/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3
index ec72af3..bd21874 100644
--- a/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3
+++ b/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_DigestVerifyInit 3"
-.TH EVP_DigestVerifyInit 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH EVP_DigestVerifyInit 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_EncryptInit.3 b/secure/lib/libcrypto/man/EVP_EncryptInit.3
index 9e38ba7..9fd9b0a 100644
--- a/secure/lib/libcrypto/man/EVP_EncryptInit.3
+++ b/secure/lib/libcrypto/man/EVP_EncryptInit.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_EncryptInit 3"
-.TH EVP_EncryptInit 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH EVP_EncryptInit 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_OpenInit.3 b/secure/lib/libcrypto/man/EVP_OpenInit.3
index 994f33b..52131a8 100644
--- a/secure/lib/libcrypto/man/EVP_OpenInit.3
+++ b/secure/lib/libcrypto/man/EVP_OpenInit.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_OpenInit 3"
-.TH EVP_OpenInit 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH EVP_OpenInit 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 b/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3
index ed0f239..e5adbc4 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_CTX_ctrl 3"
-.TH EVP_PKEY_CTX_ctrl 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH EVP_PKEY_CTX_ctrl 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 b/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3
index b3ce806..195eb9c 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_CTX_new 3"
-.TH EVP_PKEY_CTX_new 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH EVP_PKEY_CTX_new 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 b/secure/lib/libcrypto/man/EVP_PKEY_cmp.3
index a8610f6..e682a2f 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_cmp.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_cmp.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_cmp 3"
-.TH EVP_PKEY_cmp 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH EVP_PKEY_cmp 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 b/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3
index f8c6124..2f0417e 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_decrypt 3"
-.TH EVP_PKEY_decrypt 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH EVP_PKEY_decrypt 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_derive.3 b/secure/lib/libcrypto/man/EVP_PKEY_derive.3
index 9ba3c87..5cf79de 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_derive.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_derive.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_derive 3"
-.TH EVP_PKEY_derive 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH EVP_PKEY_derive 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 b/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3
index 45a7bb5..68147e7 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_encrypt 3"
-.TH EVP_PKEY_encrypt 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH EVP_PKEY_encrypt 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3 b/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3
index d7baaed..e031952 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_get_default_digest 3"
-.TH EVP_PKEY_get_default_digest 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH EVP_PKEY_get_default_digest 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 b/secure/lib/libcrypto/man/EVP_PKEY_keygen.3
index 9876ca2..f526733 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_keygen.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_keygen.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_keygen 3"
-.TH EVP_PKEY_keygen 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH EVP_PKEY_keygen 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_new.3 b/secure/lib/libcrypto/man/EVP_PKEY_new.3
index 2915985..2a3f66b3 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_new.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_new 3"
-.TH EVP_PKEY_new 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH EVP_PKEY_new 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 b/secure/lib/libcrypto/man/EVP_PKEY_print_private.3
index 15fccb2..5ca0af9 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_print_private.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_print_private.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_print_private 3"
-.TH EVP_PKEY_print_private 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH EVP_PKEY_print_private 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 b/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3
index 7867f04..b0edc22 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_set1_RSA 3"
-.TH EVP_PKEY_set1_RSA 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH EVP_PKEY_set1_RSA 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_sign.3 b/secure/lib/libcrypto/man/EVP_PKEY_sign.3
index b2546c5..8244cab 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_sign.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_sign.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_sign 3"
-.TH EVP_PKEY_sign 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH EVP_PKEY_sign 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_verify.3 b/secure/lib/libcrypto/man/EVP_PKEY_verify.3
index 3b7e9c2..e0ec309 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_verify.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_verify.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_verify 3"
-.TH EVP_PKEY_verify 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH EVP_PKEY_verify 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 b/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3
index ff6c291..8ff8081 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_verify_recover 3"
-.TH EVP_PKEY_verify_recover 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH EVP_PKEY_verify_recover 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_SealInit.3 b/secure/lib/libcrypto/man/EVP_SealInit.3
index 90360a7..c8e68ef 100644
--- a/secure/lib/libcrypto/man/EVP_SealInit.3
+++ b/secure/lib/libcrypto/man/EVP_SealInit.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_SealInit 3"
-.TH EVP_SealInit 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH EVP_SealInit 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_SignInit.3 b/secure/lib/libcrypto/man/EVP_SignInit.3
index 81b65a6d..767a298 100644
--- a/secure/lib/libcrypto/man/EVP_SignInit.3
+++ b/secure/lib/libcrypto/man/EVP_SignInit.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_SignInit 3"
-.TH EVP_SignInit 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH EVP_SignInit 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_VerifyInit.3 b/secure/lib/libcrypto/man/EVP_VerifyInit.3
index b3ac2a2..a7aee83 100644
--- a/secure/lib/libcrypto/man/EVP_VerifyInit.3
+++ b/secure/lib/libcrypto/man/EVP_VerifyInit.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_VerifyInit 3"
-.TH EVP_VerifyInit 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH EVP_VerifyInit 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/OBJ_nid2obj.3 b/secure/lib/libcrypto/man/OBJ_nid2obj.3
index 3818446..5d6e94b 100644
--- a/secure/lib/libcrypto/man/OBJ_nid2obj.3
+++ b/secure/lib/libcrypto/man/OBJ_nid2obj.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OBJ_nid2obj 3"
-.TH OBJ_nid2obj 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH OBJ_nid2obj 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/OPENSSL_Applink.3 b/secure/lib/libcrypto/man/OPENSSL_Applink.3
index 16d8aed..1df9211 100644
--- a/secure/lib/libcrypto/man/OPENSSL_Applink.3
+++ b/secure/lib/libcrypto/man/OPENSSL_Applink.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OPENSSL_Applink 3"
-.TH OPENSSL_Applink 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH OPENSSL_Applink 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 b/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3
index ccbf32a..286a252 100644
--- a/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3
+++ b/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OPENSSL_VERSION_NUMBER 3"
-.TH OPENSSL_VERSION_NUMBER 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH OPENSSL_VERSION_NUMBER 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/OPENSSL_config.3 b/secure/lib/libcrypto/man/OPENSSL_config.3
index 12b3086..4607b68 100644
--- a/secure/lib/libcrypto/man/OPENSSL_config.3
+++ b/secure/lib/libcrypto/man/OPENSSL_config.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OPENSSL_config 3"
-.TH OPENSSL_config 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH OPENSSL_config 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 b/secure/lib/libcrypto/man/OPENSSL_ia32cap.3
index 04395cf..48ae666 100644
--- a/secure/lib/libcrypto/man/OPENSSL_ia32cap.3
+++ b/secure/lib/libcrypto/man/OPENSSL_ia32cap.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OPENSSL_ia32cap 3"
-.TH OPENSSL_ia32cap 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH OPENSSL_ia32cap 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 b/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3
index 29cf323..de81330 100644
--- a/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3
+++ b/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OPENSSL_load_builtin_modules 3"
-.TH OPENSSL_load_builtin_modules 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH OPENSSL_load_builtin_modules 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 b/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3
index 8a32af2..2572458 100644
--- a/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3
+++ b/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OpenSSL_add_all_algorithms 3"
-.TH OpenSSL_add_all_algorithms 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH OpenSSL_add_all_algorithms 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 b/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3
index 47ed7e6..27a8f54 100644
--- a/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3
+++ b/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PEM_write_bio_CMS_stream 3"
-.TH PEM_write_bio_CMS_stream 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH PEM_write_bio_CMS_stream 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 b/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3
index 7c1f68cd..1ed5b5c 100644
--- a/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3
+++ b/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PEM_write_bio_PKCS7_stream 3"
-.TH PEM_write_bio_PKCS7_stream 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH PEM_write_bio_PKCS7_stream 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PKCS12_create.3 b/secure/lib/libcrypto/man/PKCS12_create.3
index 22360a4..56e630b 100644
--- a/secure/lib/libcrypto/man/PKCS12_create.3
+++ b/secure/lib/libcrypto/man/PKCS12_create.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS12_create 3"
-.TH PKCS12_create 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH PKCS12_create 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PKCS12_parse.3 b/secure/lib/libcrypto/man/PKCS12_parse.3
index b572784..f3d8afb 100644
--- a/secure/lib/libcrypto/man/PKCS12_parse.3
+++ b/secure/lib/libcrypto/man/PKCS12_parse.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS12_parse 3"
-.TH PKCS12_parse 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH PKCS12_parse 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PKCS7_decrypt.3 b/secure/lib/libcrypto/man/PKCS7_decrypt.3
index ebe751a..f7ad34e 100644
--- a/secure/lib/libcrypto/man/PKCS7_decrypt.3
+++ b/secure/lib/libcrypto/man/PKCS7_decrypt.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS7_decrypt 3"
-.TH PKCS7_decrypt 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH PKCS7_decrypt 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PKCS7_encrypt.3 b/secure/lib/libcrypto/man/PKCS7_encrypt.3
index d8519e1..2514a44 100644
--- a/secure/lib/libcrypto/man/PKCS7_encrypt.3
+++ b/secure/lib/libcrypto/man/PKCS7_encrypt.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS7_encrypt 3"
-.TH PKCS7_encrypt 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH PKCS7_encrypt 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PKCS7_sign.3 b/secure/lib/libcrypto/man/PKCS7_sign.3
index 271352d..9ed3d28 100644
--- a/secure/lib/libcrypto/man/PKCS7_sign.3
+++ b/secure/lib/libcrypto/man/PKCS7_sign.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS7_sign 3"
-.TH PKCS7_sign 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH PKCS7_sign 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 b/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3
index 1ba1493..f566b9e 100644
--- a/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3
+++ b/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS7_sign_add_signer 3"
-.TH PKCS7_sign_add_signer 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH PKCS7_sign_add_signer 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PKCS7_verify.3 b/secure/lib/libcrypto/man/PKCS7_verify.3
index 9e5afdc..0cf3476 100644
--- a/secure/lib/libcrypto/man/PKCS7_verify.3
+++ b/secure/lib/libcrypto/man/PKCS7_verify.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS7_verify 3"
-.TH PKCS7_verify 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH PKCS7_verify 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RAND_add.3 b/secure/lib/libcrypto/man/RAND_add.3
index 43bed0c..154c415 100644
--- a/secure/lib/libcrypto/man/RAND_add.3
+++ b/secure/lib/libcrypto/man/RAND_add.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RAND_add 3"
-.TH RAND_add 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH RAND_add 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RAND_bytes.3 b/secure/lib/libcrypto/man/RAND_bytes.3
index a66177f..11f7f0a 100644
--- a/secure/lib/libcrypto/man/RAND_bytes.3
+++ b/secure/lib/libcrypto/man/RAND_bytes.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RAND_bytes 3"
-.TH RAND_bytes 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH RAND_bytes 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RAND_cleanup.3 b/secure/lib/libcrypto/man/RAND_cleanup.3
index 21f9392..2c9605c 100644
--- a/secure/lib/libcrypto/man/RAND_cleanup.3
+++ b/secure/lib/libcrypto/man/RAND_cleanup.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RAND_cleanup 3"
-.TH RAND_cleanup 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH RAND_cleanup 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RAND_egd.3 b/secure/lib/libcrypto/man/RAND_egd.3
index a131fbb..1ad9659 100644
--- a/secure/lib/libcrypto/man/RAND_egd.3
+++ b/secure/lib/libcrypto/man/RAND_egd.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RAND_egd 3"
-.TH RAND_egd 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH RAND_egd 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RAND_load_file.3 b/secure/lib/libcrypto/man/RAND_load_file.3
index 73757cc..72684da 100644
--- a/secure/lib/libcrypto/man/RAND_load_file.3
+++ b/secure/lib/libcrypto/man/RAND_load_file.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RAND_load_file 3"
-.TH RAND_load_file 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH RAND_load_file 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RAND_set_rand_method.3 b/secure/lib/libcrypto/man/RAND_set_rand_method.3
index dfbc1e4..833704d 100644
--- a/secure/lib/libcrypto/man/RAND_set_rand_method.3
+++ b/secure/lib/libcrypto/man/RAND_set_rand_method.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RAND_set_rand_method 3"
-.TH RAND_set_rand_method 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH RAND_set_rand_method 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_blinding_on.3 b/secure/lib/libcrypto/man/RSA_blinding_on.3
index 42ef106..596073e 100644
--- a/secure/lib/libcrypto/man/RSA_blinding_on.3
+++ b/secure/lib/libcrypto/man/RSA_blinding_on.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_blinding_on 3"
-.TH RSA_blinding_on 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH RSA_blinding_on 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_check_key.3 b/secure/lib/libcrypto/man/RSA_check_key.3
index 2ae54f6..f18ef96 100644
--- a/secure/lib/libcrypto/man/RSA_check_key.3
+++ b/secure/lib/libcrypto/man/RSA_check_key.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_check_key 3"
-.TH RSA_check_key 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH RSA_check_key 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_generate_key.3 b/secure/lib/libcrypto/man/RSA_generate_key.3
index 9d16c21..1150ba2 100644
--- a/secure/lib/libcrypto/man/RSA_generate_key.3
+++ b/secure/lib/libcrypto/man/RSA_generate_key.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_generate_key 3"
-.TH RSA_generate_key 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH RSA_generate_key 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 b/secure/lib/libcrypto/man/RSA_get_ex_new_index.3
index f83aaa9..a670327 100644
--- a/secure/lib/libcrypto/man/RSA_get_ex_new_index.3
+++ b/secure/lib/libcrypto/man/RSA_get_ex_new_index.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_get_ex_new_index 3"
-.TH RSA_get_ex_new_index 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH RSA_get_ex_new_index 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_new.3 b/secure/lib/libcrypto/man/RSA_new.3
index 0a6bfab..369d485 100644
--- a/secure/lib/libcrypto/man/RSA_new.3
+++ b/secure/lib/libcrypto/man/RSA_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_new 3"
-.TH RSA_new 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH RSA_new 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 b/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3
index b109d58..1dd2e33 100644
--- a/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3
+++ b/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_padding_add_PKCS1_type_1 3"
-.TH RSA_padding_add_PKCS1_type_1 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH RSA_padding_add_PKCS1_type_1 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_print.3 b/secure/lib/libcrypto/man/RSA_print.3
index f6fd9b6..102df9b 100644
--- a/secure/lib/libcrypto/man/RSA_print.3
+++ b/secure/lib/libcrypto/man/RSA_print.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_print 3"
-.TH RSA_print 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH RSA_print 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_private_encrypt.3 b/secure/lib/libcrypto/man/RSA_private_encrypt.3
index e0baf93..29eaba8 100644
--- a/secure/lib/libcrypto/man/RSA_private_encrypt.3
+++ b/secure/lib/libcrypto/man/RSA_private_encrypt.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_private_encrypt 3"
-.TH RSA_private_encrypt 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH RSA_private_encrypt 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_public_encrypt.3 b/secure/lib/libcrypto/man/RSA_public_encrypt.3
index 6f71f1b..e67ae35a 100644
--- a/secure/lib/libcrypto/man/RSA_public_encrypt.3
+++ b/secure/lib/libcrypto/man/RSA_public_encrypt.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_public_encrypt 3"
-.TH RSA_public_encrypt 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH RSA_public_encrypt 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_set_method.3 b/secure/lib/libcrypto/man/RSA_set_method.3
index 57258a9..4729751 100644
--- a/secure/lib/libcrypto/man/RSA_set_method.3
+++ b/secure/lib/libcrypto/man/RSA_set_method.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_set_method 3"
-.TH RSA_set_method 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH RSA_set_method 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_sign.3 b/secure/lib/libcrypto/man/RSA_sign.3
index 22070c0..0b1958a 100644
--- a/secure/lib/libcrypto/man/RSA_sign.3
+++ b/secure/lib/libcrypto/man/RSA_sign.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_sign 3"
-.TH RSA_sign 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH RSA_sign 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 b/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3
index 320ba35..6edefc6 100644
--- a/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3
+++ b/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_sign_ASN1_OCTET_STRING 3"
-.TH RSA_sign_ASN1_OCTET_STRING 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH RSA_sign_ASN1_OCTET_STRING 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_size.3 b/secure/lib/libcrypto/man/RSA_size.3
index 003f1b2..7818195 100644
--- a/secure/lib/libcrypto/man/RSA_size.3
+++ b/secure/lib/libcrypto/man/RSA_size.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_size 3"
-.TH RSA_size 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH RSA_size 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/SMIME_read_CMS.3 b/secure/lib/libcrypto/man/SMIME_read_CMS.3
index f32e000..52a8d11 100644
--- a/secure/lib/libcrypto/man/SMIME_read_CMS.3
+++ b/secure/lib/libcrypto/man/SMIME_read_CMS.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SMIME_read_CMS 3"
-.TH SMIME_read_CMS 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SMIME_read_CMS 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 b/secure/lib/libcrypto/man/SMIME_read_PKCS7.3
index e989e9a..b4a4f10 100644
--- a/secure/lib/libcrypto/man/SMIME_read_PKCS7.3
+++ b/secure/lib/libcrypto/man/SMIME_read_PKCS7.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SMIME_read_PKCS7 3"
-.TH SMIME_read_PKCS7 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SMIME_read_PKCS7 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/SMIME_write_CMS.3 b/secure/lib/libcrypto/man/SMIME_write_CMS.3
index bf99bc3..c09066f 100644
--- a/secure/lib/libcrypto/man/SMIME_write_CMS.3
+++ b/secure/lib/libcrypto/man/SMIME_write_CMS.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SMIME_write_CMS 3"
-.TH SMIME_write_CMS 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SMIME_write_CMS 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 b/secure/lib/libcrypto/man/SMIME_write_PKCS7.3
index 53a56a9..3eb753e 100644
--- a/secure/lib/libcrypto/man/SMIME_write_PKCS7.3
+++ b/secure/lib/libcrypto/man/SMIME_write_PKCS7.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SMIME_write_PKCS7 3"
-.TH SMIME_write_PKCS7 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SMIME_write_PKCS7 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 b/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3
index d2f2201..cfbc283 100644
--- a/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3
+++ b/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_NAME_ENTRY_get_object 3"
-.TH X509_NAME_ENTRY_get_object 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH X509_NAME_ENTRY_get_object 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 b/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3
index b09ad9a..394138b 100644
--- a/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3
+++ b/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_NAME_add_entry_by_txt 3"
-.TH X509_NAME_add_entry_by_txt 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH X509_NAME_add_entry_by_txt 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 b/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3
index 7e6e431..5c10c9f 100644
--- a/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3
+++ b/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_NAME_get_index_by_NID 3"
-.TH X509_NAME_get_index_by_NID 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH X509_NAME_get_index_by_NID 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_NAME_print_ex.3 b/secure/lib/libcrypto/man/X509_NAME_print_ex.3
index d0caf7b..596d213 100644
--- a/secure/lib/libcrypto/man/X509_NAME_print_ex.3
+++ b/secure/lib/libcrypto/man/X509_NAME_print_ex.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_NAME_print_ex 3"
-.TH X509_NAME_print_ex 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH X509_NAME_print_ex 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 b/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3
index 5a5c162..1fb0090 100644
--- a/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3
+++ b/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_STORE_CTX_get_error 3"
-.TH X509_STORE_CTX_get_error 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH X509_STORE_CTX_get_error 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3 b/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3
index e1458a5..f1603c9 100644
--- a/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3
+++ b/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_STORE_CTX_get_ex_new_index 3"
-.TH X509_STORE_CTX_get_ex_new_index 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH X509_STORE_CTX_get_ex_new_index 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 b/secure/lib/libcrypto/man/X509_STORE_CTX_new.3
index 58caefb..fea612b 100644
--- a/secure/lib/libcrypto/man/X509_STORE_CTX_new.3
+++ b/secure/lib/libcrypto/man/X509_STORE_CTX_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_STORE_CTX_new 3"
-.TH X509_STORE_CTX_new 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH X509_STORE_CTX_new 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 b/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3
index 9884656..3c49c71 100644
--- a/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3
+++ b/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_STORE_CTX_set_verify_cb 3"
-.TH X509_STORE_CTX_set_verify_cb 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH X509_STORE_CTX_set_verify_cb 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 b/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3
index 931917e..6a3e736 100644
--- a/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3
+++ b/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_STORE_set_verify_cb_func 3"
-.TH X509_STORE_set_verify_cb_func 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH X509_STORE_set_verify_cb_func 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 b/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
index 4bc4952..d19f288 100644
--- a/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
+++ b/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_VERIFY_PARAM_set_flags 3"
-.TH X509_VERIFY_PARAM_set_flags 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH X509_VERIFY_PARAM_set_flags 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -267,6 +267,12 @@ issuer checks. It is \fBnot\fR needed unless you are logging certificate
verification. If this flag is set then additional status codes will be sent
to the verification callback and it \fBmust\fR be prepared to handle such cases
without assuming they are hard errors.
+.PP
+The \fBX509_V_FLAG_NO_ALT_CHAINS\fR flag suppresses checking for alternative
+chains. By default, when building a certificate chain, if the first certificate
+chain found is not trusted, then OpenSSL will continue to check to see if an
+alternative chain can be found that is trusted. With this flag set the behaviour
+will match that of OpenSSL versions prior to 1.0.1n and 1.0.2b.
.SH "NOTES"
.IX Header "NOTES"
The above functions should be used to manipulate verification parameters
@@ -298,4 +304,4 @@ connections associated with an \fB\s-1SSL_CTX\s0\fR structure \fBctx\fR:
\&\fIX509_verify_cert\fR\|(3)
.SH "HISTORY"
.IX Header "HISTORY"
-\&\s-1TBA\s0
+The \fBX509_V_FLAG_NO_ALT_CHAINS\fR flag was added in OpenSSL 1.0.1n and 1.0.2b
diff --git a/secure/lib/libcrypto/man/X509_new.3 b/secure/lib/libcrypto/man/X509_new.3
index 488ef7b..aa187ba 100644
--- a/secure/lib/libcrypto/man/X509_new.3
+++ b/secure/lib/libcrypto/man/X509_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_new 3"
-.TH X509_new 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH X509_new 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_verify_cert.3 b/secure/lib/libcrypto/man/X509_verify_cert.3
index 4b3de8d..42d1d87 100644
--- a/secure/lib/libcrypto/man/X509_verify_cert.3
+++ b/secure/lib/libcrypto/man/X509_verify_cert.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_verify_cert 3"
-.TH X509_verify_cert 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH X509_verify_cert 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/bio.3 b/secure/lib/libcrypto/man/bio.3
index b8e57ad..ce2396d 100644
--- a/secure/lib/libcrypto/man/bio.3
+++ b/secure/lib/libcrypto/man/bio.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "bio 3"
-.TH bio 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH bio 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/blowfish.3 b/secure/lib/libcrypto/man/blowfish.3
index ac91199..ccd2c6f 100644
--- a/secure/lib/libcrypto/man/blowfish.3
+++ b/secure/lib/libcrypto/man/blowfish.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "blowfish 3"
-.TH blowfish 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH blowfish 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/bn.3 b/secure/lib/libcrypto/man/bn.3
index 75ff5e1..01b6820 100644
--- a/secure/lib/libcrypto/man/bn.3
+++ b/secure/lib/libcrypto/man/bn.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "bn 3"
-.TH bn 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH bn 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/bn_internal.3 b/secure/lib/libcrypto/man/bn_internal.3
index f353f19..4701ad9 100644
--- a/secure/lib/libcrypto/man/bn_internal.3
+++ b/secure/lib/libcrypto/man/bn_internal.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "bn_internal 3"
-.TH bn_internal 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH bn_internal 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/buffer.3 b/secure/lib/libcrypto/man/buffer.3
index 800b6a4..995d3e9 100644
--- a/secure/lib/libcrypto/man/buffer.3
+++ b/secure/lib/libcrypto/man/buffer.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "buffer 3"
-.TH buffer 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH buffer 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/crypto.3 b/secure/lib/libcrypto/man/crypto.3
index 0767acf..998891d 100644
--- a/secure/lib/libcrypto/man/crypto.3
+++ b/secure/lib/libcrypto/man/crypto.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "crypto 3"
-.TH crypto 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH crypto 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 b/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3
index 4736f53..d4e49c9 100644
--- a/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3
+++ b/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_ASN1_OBJECT 3"
-.TH d2i_ASN1_OBJECT 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH d2i_ASN1_OBJECT 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3 b/secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3
index 21abe69..2818e82 100644
--- a/secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3
+++ b/secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_CMS_ContentInfo 3"
-.TH d2i_CMS_ContentInfo 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH d2i_CMS_ContentInfo 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_DHparams.3 b/secure/lib/libcrypto/man/d2i_DHparams.3
index db5b4da..6b44a33 100644
--- a/secure/lib/libcrypto/man/d2i_DHparams.3
+++ b/secure/lib/libcrypto/man/d2i_DHparams.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_DHparams 3"
-.TH d2i_DHparams 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH d2i_DHparams 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 b/secure/lib/libcrypto/man/d2i_DSAPublicKey.3
index 1d834fa..8fb4f42 100644
--- a/secure/lib/libcrypto/man/d2i_DSAPublicKey.3
+++ b/secure/lib/libcrypto/man/d2i_DSAPublicKey.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_DSAPublicKey 3"
-.TH d2i_DSAPublicKey 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH d2i_DSAPublicKey 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_ECPrivateKey.3 b/secure/lib/libcrypto/man/d2i_ECPrivateKey.3
index 52406fc..431e7e0 100644
--- a/secure/lib/libcrypto/man/d2i_ECPrivateKey.3
+++ b/secure/lib/libcrypto/man/d2i_ECPrivateKey.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_ECPrivateKey 3"
-.TH d2i_ECPrivateKey 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH d2i_ECPrivateKey 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 b/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3
index 23807f6..91d4936 100644
--- a/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3
+++ b/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_PKCS8PrivateKey 3"
-.TH d2i_PKCS8PrivateKey 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH d2i_PKCS8PrivateKey 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 b/secure/lib/libcrypto/man/d2i_RSAPublicKey.3
index 57c7c1a..519d9d1 100644
--- a/secure/lib/libcrypto/man/d2i_RSAPublicKey.3
+++ b/secure/lib/libcrypto/man/d2i_RSAPublicKey.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_RSAPublicKey 3"
-.TH d2i_RSAPublicKey 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH d2i_RSAPublicKey 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_X509.3 b/secure/lib/libcrypto/man/d2i_X509.3
index e5f63a8..8f13b46 100644
--- a/secure/lib/libcrypto/man/d2i_X509.3
+++ b/secure/lib/libcrypto/man/d2i_X509.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_X509 3"
-.TH d2i_X509 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH d2i_X509 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 b/secure/lib/libcrypto/man/d2i_X509_ALGOR.3
index cb32b70..b83b0af 100644
--- a/secure/lib/libcrypto/man/d2i_X509_ALGOR.3
+++ b/secure/lib/libcrypto/man/d2i_X509_ALGOR.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_X509_ALGOR 3"
-.TH d2i_X509_ALGOR 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH d2i_X509_ALGOR 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_X509_CRL.3 b/secure/lib/libcrypto/man/d2i_X509_CRL.3
index af0cbcc..fc02264 100644
--- a/secure/lib/libcrypto/man/d2i_X509_CRL.3
+++ b/secure/lib/libcrypto/man/d2i_X509_CRL.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_X509_CRL 3"
-.TH d2i_X509_CRL 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH d2i_X509_CRL 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_X509_NAME.3 b/secure/lib/libcrypto/man/d2i_X509_NAME.3
index f93ed16..1d953f2 100644
--- a/secure/lib/libcrypto/man/d2i_X509_NAME.3
+++ b/secure/lib/libcrypto/man/d2i_X509_NAME.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_X509_NAME 3"
-.TH d2i_X509_NAME 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH d2i_X509_NAME 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_X509_REQ.3 b/secure/lib/libcrypto/man/d2i_X509_REQ.3
index c88463a..ede040a 100644
--- a/secure/lib/libcrypto/man/d2i_X509_REQ.3
+++ b/secure/lib/libcrypto/man/d2i_X509_REQ.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_X509_REQ 3"
-.TH d2i_X509_REQ 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH d2i_X509_REQ 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_X509_SIG.3 b/secure/lib/libcrypto/man/d2i_X509_SIG.3
index efac791..4afe19b 100644
--- a/secure/lib/libcrypto/man/d2i_X509_SIG.3
+++ b/secure/lib/libcrypto/man/d2i_X509_SIG.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_X509_SIG 3"
-.TH d2i_X509_SIG 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH d2i_X509_SIG 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/des.3 b/secure/lib/libcrypto/man/des.3
index 97a1a57..eb704b4 100644
--- a/secure/lib/libcrypto/man/des.3
+++ b/secure/lib/libcrypto/man/des.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "des 3"
-.TH des 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH des 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/dh.3 b/secure/lib/libcrypto/man/dh.3
index 11c203b..659fd6b 100644
--- a/secure/lib/libcrypto/man/dh.3
+++ b/secure/lib/libcrypto/man/dh.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "dh 3"
-.TH dh 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH dh 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/dsa.3 b/secure/lib/libcrypto/man/dsa.3
index 45b843d..1a723b2 100644
--- a/secure/lib/libcrypto/man/dsa.3
+++ b/secure/lib/libcrypto/man/dsa.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "dsa 3"
-.TH dsa 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH dsa 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ecdsa.3 b/secure/lib/libcrypto/man/ecdsa.3
index 2ef80ab..1d978e4 100644
--- a/secure/lib/libcrypto/man/ecdsa.3
+++ b/secure/lib/libcrypto/man/ecdsa.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ecdsa 3"
-.TH ecdsa 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH ecdsa 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/engine.3 b/secure/lib/libcrypto/man/engine.3
index cf1f60b..f7f4ef1 100644
--- a/secure/lib/libcrypto/man/engine.3
+++ b/secure/lib/libcrypto/man/engine.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "engine 3"
-.TH engine 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH engine 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/err.3 b/secure/lib/libcrypto/man/err.3
index 2e6ed82..a825444 100644
--- a/secure/lib/libcrypto/man/err.3
+++ b/secure/lib/libcrypto/man/err.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "err 3"
-.TH err 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH err 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/evp.3 b/secure/lib/libcrypto/man/evp.3
index fd783a9..8de15fc 100644
--- a/secure/lib/libcrypto/man/evp.3
+++ b/secure/lib/libcrypto/man/evp.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "evp 3"
-.TH evp 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH evp 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/hmac.3 b/secure/lib/libcrypto/man/hmac.3
index 3dde3c5..a57a3bc 100644
--- a/secure/lib/libcrypto/man/hmac.3
+++ b/secure/lib/libcrypto/man/hmac.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "hmac 3"
-.TH hmac 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH hmac 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 b/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3
index d57687f..14cfb92 100644
--- a/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3
+++ b/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "i2d_CMS_bio_stream 3"
-.TH i2d_CMS_bio_stream 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH i2d_CMS_bio_stream 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 b/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3
index 2f53509..512c300 100644
--- a/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3
+++ b/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "i2d_PKCS7_bio_stream 3"
-.TH i2d_PKCS7_bio_stream 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH i2d_PKCS7_bio_stream 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/lh_stats.3 b/secure/lib/libcrypto/man/lh_stats.3
index 695be74..9b367be 100644
--- a/secure/lib/libcrypto/man/lh_stats.3
+++ b/secure/lib/libcrypto/man/lh_stats.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "lh_stats 3"
-.TH lh_stats 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH lh_stats 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/lhash.3 b/secure/lib/libcrypto/man/lhash.3
index 0c53c25..734de5a 100644
--- a/secure/lib/libcrypto/man/lhash.3
+++ b/secure/lib/libcrypto/man/lhash.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "lhash 3"
-.TH lhash 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH lhash 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/md5.3 b/secure/lib/libcrypto/man/md5.3
index 22fdfe6..045fca3 100644
--- a/secure/lib/libcrypto/man/md5.3
+++ b/secure/lib/libcrypto/man/md5.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "md5 3"
-.TH md5 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH md5 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/mdc2.3 b/secure/lib/libcrypto/man/mdc2.3
index a52058b..51ff478 100644
--- a/secure/lib/libcrypto/man/mdc2.3
+++ b/secure/lib/libcrypto/man/mdc2.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "mdc2 3"
-.TH mdc2 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH mdc2 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/pem.3 b/secure/lib/libcrypto/man/pem.3
index 54fc0b4..36d9f3b 100644
--- a/secure/lib/libcrypto/man/pem.3
+++ b/secure/lib/libcrypto/man/pem.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,13 +133,35 @@
.\" ========================================================================
.\"
.IX Title "pem 3"
-.TH pem 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH pem 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
-PEM, PEM_read_bio_PrivateKey, PEM_read_PrivateKey, PEM_write_bio_PrivateKey, PEM_write_PrivateKey, PEM_write_bio_PKCS8PrivateKey, PEM_write_PKCS8PrivateKey, PEM_write_bio_PKCS8PrivateKey_nid, PEM_write_PKCS8PrivateKey_nid, PEM_read_bio_PUBKEY, PEM_read_PUBKEY, PEM_write_bio_PUBKEY, PEM_write_PUBKEY, PEM_read_bio_RSAPrivateKey, PEM_read_RSAPrivateKey, PEM_write_bio_RSAPrivateKey, PEM_write_RSAPrivateKey, PEM_read_bio_RSAPublicKey, PEM_read_RSAPublicKey, PEM_write_bio_RSAPublicKey, PEM_write_RSAPublicKey, PEM_read_bio_RSA_PUBKEY, PEM_read_RSA_PUBKEY, PEM_write_bio_RSA_PUBKEY, PEM_write_RSA_PUBKEY, PEM_read_bio_DSAPrivateKey, PEM_read_DSAPrivateKey, PEM_write_bio_DSAPrivateKey, PEM_write_DSAPrivateKey, PEM_read_bio_DSA_PUBKEY, PEM_read_DSA_PUBKEY, PEM_write_bio_DSA_PUBKEY, PEM_write_DSA_PUBKEY, PEM_read_bio_DSAparams, PEM_read_DSAparams, PEM_write_bio_DSAparams, PEM_write_DSAparams, PEM_read_bio_DHparams, PEM_read_DHparams, PEM_write_bio_DHparams, PEM_write_DHparams, PEM_read_bio_X509, PEM_read_X509, PEM_write_bio_X509, PEM_write_X509, PEM_read_bio_X509_AUX, PEM_read_X509_AUX, PEM_write_bio_X509_AUX, PEM_write_X509_AUX, PEM_read_bio_X509_REQ, PEM_read_X509_REQ, PEM_write_bio_X509_REQ, PEM_write_X509_REQ, PEM_write_bio_X509_REQ_NEW, PEM_write_X509_REQ_NEW, PEM_read_bio_X509_CRL, PEM_read_X509_CRL, PEM_write_bio_X509_CRL, PEM_write_X509_CRL, PEM_read_bio_PKCS7, PEM_read_PKCS7, PEM_write_bio_PKCS7, PEM_write_PKCS7, PEM_read_bio_NETSCAPE_CERT_SEQUENCE, PEM_read_NETSCAPE_CERT_SEQUENCE, PEM_write_bio_NETSCAPE_CERT_SEQUENCE, PEM_write_NETSCAPE_CERT_SEQUENCE \- PEM routines
+PEM, PEM_read_bio_PrivateKey, PEM_read_PrivateKey, PEM_write_bio_PrivateKey,
+PEM_write_PrivateKey, PEM_write_bio_PKCS8PrivateKey, PEM_write_PKCS8PrivateKey,
+PEM_write_bio_PKCS8PrivateKey_nid, PEM_write_PKCS8PrivateKey_nid,
+PEM_read_bio_PUBKEY, PEM_read_PUBKEY, PEM_write_bio_PUBKEY, PEM_write_PUBKEY,
+PEM_read_bio_RSAPrivateKey, PEM_read_RSAPrivateKey,
+PEM_write_bio_RSAPrivateKey, PEM_write_RSAPrivateKey,
+PEM_read_bio_RSAPublicKey, PEM_read_RSAPublicKey, PEM_write_bio_RSAPublicKey,
+PEM_write_RSAPublicKey, PEM_read_bio_RSA_PUBKEY, PEM_read_RSA_PUBKEY,
+PEM_write_bio_RSA_PUBKEY, PEM_write_RSA_PUBKEY, PEM_read_bio_DSAPrivateKey,
+PEM_read_DSAPrivateKey, PEM_write_bio_DSAPrivateKey, PEM_write_DSAPrivateKey,
+PEM_read_bio_DSA_PUBKEY, PEM_read_DSA_PUBKEY, PEM_write_bio_DSA_PUBKEY,
+PEM_write_DSA_PUBKEY, PEM_read_bio_DSAparams, PEM_read_DSAparams,
+PEM_write_bio_DSAparams, PEM_write_DSAparams, PEM_read_bio_DHparams,
+PEM_read_DHparams, PEM_write_bio_DHparams, PEM_write_DHparams,
+PEM_read_bio_X509, PEM_read_X509, PEM_write_bio_X509, PEM_write_X509,
+PEM_read_bio_X509_AUX, PEM_read_X509_AUX, PEM_write_bio_X509_AUX,
+PEM_write_X509_AUX, PEM_read_bio_X509_REQ, PEM_read_X509_REQ,
+PEM_write_bio_X509_REQ, PEM_write_X509_REQ, PEM_write_bio_X509_REQ_NEW,
+PEM_write_X509_REQ_NEW, PEM_read_bio_X509_CRL, PEM_read_X509_CRL,
+PEM_write_bio_X509_CRL, PEM_write_X509_CRL, PEM_read_bio_PKCS7, PEM_read_PKCS7,
+PEM_write_bio_PKCS7, PEM_write_PKCS7, PEM_read_bio_NETSCAPE_CERT_SEQUENCE,
+PEM_read_NETSCAPE_CERT_SEQUENCE, PEM_write_bio_NETSCAPE_CERT_SEQUENCE,
+PEM_write_NETSCAPE_CERT_SEQUENCE \- PEM routines
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
@@ -376,7 +398,8 @@ SubjectPublicKeyInfo structure and an error occurs if the public
key is not \s-1DSA.\s0
.PP
The \fBDSAparams\fR functions process \s-1DSA\s0 parameters using a \s-1DSA\s0
-structure. The parameters are encoded using a foobar structure.
+structure. The parameters are encoded using a Dss-Parms structure
+as defined in \s-1RFC2459.\s0
.PP
The \fBDHparams\fR functions process \s-1DH\s0 parameters using a \s-1DH\s0
structure. The parameters are encoded using a PKCS#3 DHparameter
diff --git a/secure/lib/libcrypto/man/rand.3 b/secure/lib/libcrypto/man/rand.3
index 12906f1..c7e7897 100644
--- a/secure/lib/libcrypto/man/rand.3
+++ b/secure/lib/libcrypto/man/rand.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "rand 3"
-.TH rand 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH rand 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/rc4.3 b/secure/lib/libcrypto/man/rc4.3
index 4afd32d..b6db734 100644
--- a/secure/lib/libcrypto/man/rc4.3
+++ b/secure/lib/libcrypto/man/rc4.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "rc4 3"
-.TH rc4 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH rc4 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ripemd.3 b/secure/lib/libcrypto/man/ripemd.3
index 42b9d51..4475985 100644
--- a/secure/lib/libcrypto/man/ripemd.3
+++ b/secure/lib/libcrypto/man/ripemd.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ripemd 3"
-.TH ripemd 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH ripemd 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/rsa.3 b/secure/lib/libcrypto/man/rsa.3
index a129469..5028f95 100644
--- a/secure/lib/libcrypto/man/rsa.3
+++ b/secure/lib/libcrypto/man/rsa.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "rsa 3"
-.TH rsa 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH rsa 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/sha.3 b/secure/lib/libcrypto/man/sha.3
index 1895ffe..5b54c81 100644
--- a/secure/lib/libcrypto/man/sha.3
+++ b/secure/lib/libcrypto/man/sha.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "sha 3"
-.TH sha 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH sha 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/threads.3 b/secure/lib/libcrypto/man/threads.3
index 1133b50..05ffc9d 100644
--- a/secure/lib/libcrypto/man/threads.3
+++ b/secure/lib/libcrypto/man/threads.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "threads 3"
-.TH threads 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH threads 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ui.3 b/secure/lib/libcrypto/man/ui.3
index 4a30de4..4845afd 100644
--- a/secure/lib/libcrypto/man/ui.3
+++ b/secure/lib/libcrypto/man/ui.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ui 3"
-.TH ui 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH ui 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ui_compat.3 b/secure/lib/libcrypto/man/ui_compat.3
index 9fb7b8d..69ee06f 100644
--- a/secure/lib/libcrypto/man/ui_compat.3
+++ b/secure/lib/libcrypto/man/ui_compat.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ui_compat 3"
-.TH ui_compat 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH ui_compat 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/x509.3 b/secure/lib/libcrypto/man/x509.3
index 94183f5..83911c7 100644
--- a/secure/lib/libcrypto/man/x509.3
+++ b/secure/lib/libcrypto/man/x509.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "x509 3"
-.TH x509 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH x509 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssh/Makefile.depend b/secure/lib/libssh/Makefile.depend
index 79fb4cb..51e45b4 100644
--- a/secure/lib/libssh/Makefile.depend
+++ b/secure/lib/libssh/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
@@ -16,7 +17,6 @@ DIRDEPS = \
lib/libz \
secure/lib/libcrypto \
secure/lib/libssl \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/secure/lib/libssl/Makefile.depend b/secure/lib/libssl/Makefile.depend
index 640beb9..f318cc1 100644
--- a/secure/lib/libssl/Makefile.depend
+++ b/secure/lib/libssl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
@@ -10,7 +11,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
secure/lib/libcrypto \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/secure/lib/libssl/man/SSL_CIPHER_get_name.3 b/secure/lib/libssl/man/SSL_CIPHER_get_name.3
index f69ccfb..e4779fc 100644
--- a/secure/lib/libssl/man/SSL_CIPHER_get_name.3
+++ b/secure/lib/libssl/man/SSL_CIPHER_get_name.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CIPHER_get_name 3"
-.TH SSL_CIPHER_get_name 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CIPHER_get_name 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 b/secure/lib/libssl/man/SSL_COMP_add_compression_method.3
index 7d89651..3bd7acf 100644
--- a/secure/lib/libssl/man/SSL_COMP_add_compression_method.3
+++ b/secure/lib/libssl/man/SSL_COMP_add_compression_method.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_COMP_add_compression_method 3"
-.TH SSL_COMP_add_compression_method 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_COMP_add_compression_method 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 b/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3
index dc94ce2..c044866 100644
--- a/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3
+++ b/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_add_extra_chain_cert 3"
-.TH SSL_CTX_add_extra_chain_cert 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_add_extra_chain_cert 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_add_session.3 b/secure/lib/libssl/man/SSL_CTX_add_session.3
index 1d6597e..b6efc34 100644
--- a/secure/lib/libssl/man/SSL_CTX_add_session.3
+++ b/secure/lib/libssl/man/SSL_CTX_add_session.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_add_session 3"
-.TH SSL_CTX_add_session 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_add_session 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_ctrl.3 b/secure/lib/libssl/man/SSL_CTX_ctrl.3
index f04af7d..b89fcc1 100644
--- a/secure/lib/libssl/man/SSL_CTX_ctrl.3
+++ b/secure/lib/libssl/man/SSL_CTX_ctrl.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_ctrl 3"
-.TH SSL_CTX_ctrl 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_ctrl 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 b/secure/lib/libssl/man/SSL_CTX_flush_sessions.3
index 7998fe9..5b1f2c0 100644
--- a/secure/lib/libssl/man/SSL_CTX_flush_sessions.3
+++ b/secure/lib/libssl/man/SSL_CTX_flush_sessions.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_flush_sessions 3"
-.TH SSL_CTX_flush_sessions 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_flush_sessions 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_free.3 b/secure/lib/libssl/man/SSL_CTX_free.3
index 3a1f10d..812627d 100644
--- a/secure/lib/libssl/man/SSL_CTX_free.3
+++ b/secure/lib/libssl/man/SSL_CTX_free.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_free 3"
-.TH SSL_CTX_free 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_free 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 b/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3
index 7bd322d..627bdb4 100644
--- a/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3
+++ b/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_get_ex_new_index 3"
-.TH SSL_CTX_get_ex_new_index 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_get_ex_new_index 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 b/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3
index f14c8ab..4c7c027 100644
--- a/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3
+++ b/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_get_verify_mode 3"
-.TH SSL_CTX_get_verify_mode 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_get_verify_mode 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 b/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3
index 132bf20..9d405ab 100644
--- a/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3
+++ b/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_load_verify_locations 3"
-.TH SSL_CTX_load_verify_locations 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_load_verify_locations 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_new.3 b/secure/lib/libssl/man/SSL_CTX_new.3
index 937c857..1ada6ba 100644
--- a/secure/lib/libssl/man/SSL_CTX_new.3
+++ b/secure/lib/libssl/man/SSL_CTX_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_new 3"
-.TH SSL_CTX_new 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_new 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_sess_number.3 b/secure/lib/libssl/man/SSL_CTX_sess_number.3
index 4567fec..b797083 100644
--- a/secure/lib/libssl/man/SSL_CTX_sess_number.3
+++ b/secure/lib/libssl/man/SSL_CTX_sess_number.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_sess_number 3"
-.TH SSL_CTX_sess_number 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_sess_number 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 b/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3
index 3a5196f..d6849f2 100644
--- a/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3
+++ b/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_sess_set_cache_size 3"
-.TH SSL_CTX_sess_set_cache_size 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_sess_set_cache_size 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 b/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3
index e112111..4473e05 100644
--- a/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3
+++ b/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_sess_set_get_cb 3"
-.TH SSL_CTX_sess_set_get_cb 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_sess_set_get_cb 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_sessions.3 b/secure/lib/libssl/man/SSL_CTX_sessions.3
index 40e1d79..20e25ee 100644
--- a/secure/lib/libssl/man/SSL_CTX_sessions.3
+++ b/secure/lib/libssl/man/SSL_CTX_sessions.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_sessions 3"
-.TH SSL_CTX_sessions 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_sessions 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 b/secure/lib/libssl/man/SSL_CTX_set_cert_store.3
index 561c2ad..6bbe536 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_cert_store.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_cert_store.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_cert_store 3"
-.TH SSL_CTX_set_cert_store 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_set_cert_store 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 b/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3
index af153fd..2eb7d6d 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_cert_verify_callback 3"
-.TH SSL_CTX_set_cert_verify_callback 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_set_cert_verify_callback 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 b/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3
index 94ea8f9..02929e4 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_cipher_list 3"
-.TH SSL_CTX_set_cipher_list 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_set_cipher_list 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 b/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3
index 04460df..8664979 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_client_CA_list 3"
-.TH SSL_CTX_set_client_CA_list 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_set_client_CA_list 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 b/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3
index 429a587..278c735 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_client_cert_cb 3"
-.TH SSL_CTX_set_client_cert_cb 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_set_client_cert_cb 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 b/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3
index 4c7c6d8..69c1b1f 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_default_passwd_cb 3"
-.TH SSL_CTX_set_default_passwd_cb 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_set_default_passwd_cb 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 b/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3
index bc58395..2e9b69a 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_generate_session_id 3"
-.TH SSL_CTX_set_generate_session_id 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_set_generate_session_id 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 b/secure/lib/libssl/man/SSL_CTX_set_info_callback.3
index 3c110ec..feae479 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_info_callback.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_info_callback.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_info_callback 3"
-.TH SSL_CTX_set_info_callback 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_set_info_callback 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 b/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3
index 4394128..6595ef7 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_max_cert_list 3"
-.TH SSL_CTX_set_max_cert_list 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_set_max_cert_list 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_mode.3 b/secure/lib/libssl/man/SSL_CTX_set_mode.3
index c14c1d9..121be12 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_mode.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_mode.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_mode 3"
-.TH SSL_CTX_set_mode 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_set_mode 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 b/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3
index d36e01f..1fb3bf1 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_msg_callback 3"
-.TH SSL_CTX_set_msg_callback 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_set_msg_callback 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_options.3 b/secure/lib/libssl/man/SSL_CTX_set_options.3
index 627ff1b..c5165cb 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_options.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_options.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_options 3"
-.TH SSL_CTX_set_options 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_set_options 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3 b/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3
index 67d6640..d321b07 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_psk_client_callback 3"
-.TH SSL_CTX_set_psk_client_callback 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_set_psk_client_callback 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 b/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3
index 1c63297..d9048f2 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_quiet_shutdown 3"
-.TH SSL_CTX_set_quiet_shutdown 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_set_quiet_shutdown 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_read_ahead.3 b/secure/lib/libssl/man/SSL_CTX_set_read_ahead.3
index 85f724a..00a66c6 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_read_ahead.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_read_ahead.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_read_ahead 3"
-.TH SSL_CTX_set_read_ahead 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_set_read_ahead 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 b/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3
index d82f1ea..7c3c9eb 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_session_cache_mode 3"
-.TH SSL_CTX_set_session_cache_mode 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_set_session_cache_mode 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 b/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3
index 901dd82..aaf292e 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_session_id_context 3"
-.TH SSL_CTX_set_session_id_context 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_set_session_id_context 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 b/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3
index 225ef46..96f48fc 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_ssl_version 3"
-.TH SSL_CTX_set_ssl_version 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_set_ssl_version 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_timeout.3 b/secure/lib/libssl/man/SSL_CTX_set_timeout.3
index 2ead376..a202e2f 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_timeout.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_timeout.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_timeout 3"
-.TH SSL_CTX_set_timeout 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_set_timeout 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3 b/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3
index bf73bd6..300efbf 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_tlsext_ticket_key_cb 3"
-.TH SSL_CTX_set_tlsext_ticket_key_cb 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_set_tlsext_ticket_key_cb 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 b/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3
index 4d80acd..62b1091 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_tmp_dh_callback 3"
-.TH SSL_CTX_set_tmp_dh_callback 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_set_tmp_dh_callback 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -197,12 +197,12 @@ negotiation is being saved.
.PP
If \*(L"strong\*(R" primes were used to generate the \s-1DH\s0 parameters, it is not strictly
necessary to generate a new key for each handshake but it does improve forward
-secrecy. If it is not assured, that \*(L"strong\*(R" primes were used (see especially
-the section about \s-1DSA\s0 parameters below), \s-1SSL_OP_SINGLE_DH_USE\s0 must be used
-in order to prevent small subgroup attacks. Always using \s-1SSL_OP_SINGLE_DH_USE\s0
-has an impact on the computer time needed during negotiation, but it is not
-very large, so application authors/users should consider to always enable
-this option.
+secrecy. If it is not assured that \*(L"strong\*(R" primes were used,
+\&\s-1SSL_OP_SINGLE_DH_USE\s0 must be used in order to prevent small subgroup
+attacks. Always using \s-1SSL_OP_SINGLE_DH_USE\s0 has an impact on the
+computer time needed during negotiation, but it is not very large, so
+application authors/users should consider always enabling this option.
+The option is required to implement perfect forward secrecy (\s-1PFS\s0).
.PP
As generating \s-1DH\s0 parameters is extremely time consuming, an application
should not generate the parameters on the fly but supply the parameters.
@@ -210,82 +210,62 @@ should not generate the parameters on the fly but supply the parameters.
the negotiation. The risk in reusing \s-1DH\s0 parameters is that an attacker
may specialize on a very often used \s-1DH\s0 group. Applications should therefore
generate their own \s-1DH\s0 parameters during the installation process using the
-openssl \fIdhparam\fR\|(1) application. In order to reduce the computer
-time needed for this generation, it is possible to use \s-1DSA\s0 parameters
-instead (see \fIdhparam\fR\|(1)), but in this case \s-1SSL_OP_SINGLE_DH_USE\s0
-is mandatory.
+openssl \fIdhparam\fR\|(1) application. This application
+guarantees that \*(L"strong\*(R" primes are used.
.PP
-Application authors may compile in \s-1DH\s0 parameters. Files dh512.pem,
-dh1024.pem, dh2048.pem, and dh4096.pem in the 'apps' directory of current
+Files dh2048.pem, and dh4096.pem in the 'apps' directory of the current
version of the OpenSSL distribution contain the '\s-1SKIP\s0' \s-1DH\s0 parameters,
which use safe primes and were generated verifiably pseudo-randomly.
These files can be converted into C code using the \fB\-C\fR option of the
-\&\fIdhparam\fR\|(1) application.
-Authors may also generate their own set of parameters using
-\&\fIdhparam\fR\|(1), but a user may not be sure how the parameters were
-generated. The generation of \s-1DH\s0 parameters during installation is therefore
-recommended.
+\&\fIdhparam\fR\|(1) application. Generation of custom \s-1DH\s0
+parameters during installation should still be preferred to stop an
+attacker from specializing on a commonly used group. Files dh1024.pem
+and dh512.pem contain old parameters that must not be used by
+applications.
.PP
An application may either directly specify the \s-1DH\s0 parameters or
-can supply the \s-1DH\s0 parameters via a callback function. The callback approach
-has the advantage, that the callback may supply \s-1DH\s0 parameters for different
-key lengths.
+can supply the \s-1DH\s0 parameters via a callback function.
.PP
-The \fBtmp_dh_callback\fR is called with the \fBkeylength\fR needed and
-the \fBis_export\fR information. The \fBis_export\fR flag is set, when the
-ephemeral \s-1DH\s0 key exchange is performed with an export cipher.
+Previous versions of the callback used \fBis_export\fR and \fBkeylength\fR
+parameters to control parameter generation for export and non-export
+cipher suites. Modern servers that do not support export ciphersuites
+are advised to either use \fISSL_CTX_set_tmp_dh()\fR in combination with
+\&\s-1SSL_OP_SINGLE_DH_USE,\s0 or alternatively, use the callback but ignore
+\&\fBkeylength\fR and \fBis_export\fR and simply supply at least 2048\-bit
+parameters in the callback.
.SH "EXAMPLES"
.IX Header "EXAMPLES"
-Handle \s-1DH\s0 parameters for key lengths of 512 and 1024 bits. (Error handling
+Setup \s-1DH\s0 parameters with a key length of 2048 bits. (Error handling
partly left out.)
.PP
-.Vb 5
-\& ...
-\& /* Set up ephemeral DH stuff */
-\& DH *dh_512 = NULL;
-\& DH *dh_1024 = NULL;
-\& FILE *paramfile;
+.Vb 2
+\& Command\-line parameter generation:
+\& $ openssl dhparam \-out dh_param_2048.pem 2048
\&
+\& Code for setting up parameters during server initialization:
+\&
+\& ...
+\& SSL_CTX ctx = SSL_CTX_new();
\& ...
-\& /* "openssl dhparam \-out dh_param_512.pem \-2 512" */
-\& paramfile = fopen("dh_param_512.pem", "r");
+\&
+\& /* Set up ephemeral DH parameters. */
+\& DH *dh_2048 = NULL;
+\& FILE *paramfile;
+\& paramfile = fopen("dh_param_2048.pem", "r");
\& if (paramfile) {
-\& dh_512 = PEM_read_DHparams(paramfile, NULL, NULL, NULL);
+\& dh_2048 = PEM_read_DHparams(paramfile, NULL, NULL, NULL);
\& fclose(paramfile);
+\& } else {
+\& /* Error. */
\& }
-\& /* "openssl dhparam \-out dh_param_1024.pem \-2 1024" */
-\& paramfile = fopen("dh_param_1024.pem", "r");
-\& if (paramfile) {
-\& dh_1024 = PEM_read_DHparams(paramfile, NULL, NULL, NULL);
-\& fclose(paramfile);
+\& if (dh_2048 == NULL) {
+\& /* Error. */
\& }
-\& ...
-\&
-\& /* "openssl dhparam \-C \-2 512" etc... */
-\& DH *get_dh512() { ... }
-\& DH *get_dh1024() { ... }
-\&
-\& DH *tmp_dh_callback(SSL *s, int is_export, int keylength)
-\& {
-\& DH *dh_tmp=NULL;
-\&
-\& switch (keylength) {
-\& case 512:
-\& if (!dh_512)
-\& dh_512 = get_dh512();
-\& dh_tmp = dh_512;
-\& break;
-\& case 1024:
-\& if (!dh_1024)
-\& dh_1024 = get_dh1024();
-\& dh_tmp = dh_1024;
-\& break;
-\& default:
-\& /* Generating a key on the fly is very costly, so use what is there */
-\& setup_dh_parameters_like_above();
-\& }
-\& return(dh_tmp);
+\& if (SSL_CTX_set_tmp_dh(ctx, dh_2048) != 1) {
+\& /* Error. */
\& }
+\& SSL_CTX_set_options(ctx, SSL_OP_SINGLE_DH_USE);
+\& ...
.Ve
.SH "RETURN VALUES"
.IX Header "RETURN VALUES"
diff --git a/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 b/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3
index 55bd191..1a40aa4 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_tmp_rsa_callback 3"
-.TH SSL_CTX_set_tmp_rsa_callback 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_set_tmp_rsa_callback 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_verify.3 b/secure/lib/libssl/man/SSL_CTX_set_verify.3
index 923446d..2a9a49c 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_verify.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_verify.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_verify 3"
-.TH SSL_CTX_set_verify 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_set_verify 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_use_certificate.3 b/secure/lib/libssl/man/SSL_CTX_use_certificate.3
index 78ead25..e2d60a7 100644
--- a/secure/lib/libssl/man/SSL_CTX_use_certificate.3
+++ b/secure/lib/libssl/man/SSL_CTX_use_certificate.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_use_certificate 3"
-.TH SSL_CTX_use_certificate 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_use_certificate 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3 b/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3
index 7c5ea3b..1b6b7ef 100644
--- a/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3
+++ b/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_use_psk_identity_hint 3"
-.TH SSL_CTX_use_psk_identity_hint 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_CTX_use_psk_identity_hint 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_SESSION_free.3 b/secure/lib/libssl/man/SSL_SESSION_free.3
index 98b777b..01856bb 100644
--- a/secure/lib/libssl/man/SSL_SESSION_free.3
+++ b/secure/lib/libssl/man/SSL_SESSION_free.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_SESSION_free 3"
-.TH SSL_SESSION_free 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_SESSION_free 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 b/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3
index 1bdb354..482f6af 100644
--- a/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3
+++ b/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_SESSION_get_ex_new_index 3"
-.TH SSL_SESSION_get_ex_new_index 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_SESSION_get_ex_new_index 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_SESSION_get_time.3 b/secure/lib/libssl/man/SSL_SESSION_get_time.3
index 1076c8c..75d4694 100644
--- a/secure/lib/libssl/man/SSL_SESSION_get_time.3
+++ b/secure/lib/libssl/man/SSL_SESSION_get_time.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_SESSION_get_time 3"
-.TH SSL_SESSION_get_time 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_SESSION_get_time 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_accept.3 b/secure/lib/libssl/man/SSL_accept.3
index 60d1284..da8fa29 100644
--- a/secure/lib/libssl/man/SSL_accept.3
+++ b/secure/lib/libssl/man/SSL_accept.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_accept 3"
-.TH SSL_accept 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_accept 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_alert_type_string.3 b/secure/lib/libssl/man/SSL_alert_type_string.3
index d75509f..1c5e1bc 100644
--- a/secure/lib/libssl/man/SSL_alert_type_string.3
+++ b/secure/lib/libssl/man/SSL_alert_type_string.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_alert_type_string 3"
-.TH SSL_alert_type_string 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_alert_type_string 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_clear.3 b/secure/lib/libssl/man/SSL_clear.3
index 309810d..258bda0 100644
--- a/secure/lib/libssl/man/SSL_clear.3
+++ b/secure/lib/libssl/man/SSL_clear.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_clear 3"
-.TH SSL_clear 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_clear 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_connect.3 b/secure/lib/libssl/man/SSL_connect.3
index abeba2d..c90c6fd 100644
--- a/secure/lib/libssl/man/SSL_connect.3
+++ b/secure/lib/libssl/man/SSL_connect.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_connect 3"
-.TH SSL_connect 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_connect 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_do_handshake.3 b/secure/lib/libssl/man/SSL_do_handshake.3
index 61ab31e..a4deaec 100644
--- a/secure/lib/libssl/man/SSL_do_handshake.3
+++ b/secure/lib/libssl/man/SSL_do_handshake.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_do_handshake 3"
-.TH SSL_do_handshake 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_do_handshake 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_free.3 b/secure/lib/libssl/man/SSL_free.3
index 7d5e22e..1611011 100644
--- a/secure/lib/libssl/man/SSL_free.3
+++ b/secure/lib/libssl/man/SSL_free.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_free 3"
-.TH SSL_free 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_free 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_SSL_CTX.3 b/secure/lib/libssl/man/SSL_get_SSL_CTX.3
index ec42719..9354f9d 100644
--- a/secure/lib/libssl/man/SSL_get_SSL_CTX.3
+++ b/secure/lib/libssl/man/SSL_get_SSL_CTX.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_SSL_CTX 3"
-.TH SSL_get_SSL_CTX 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_get_SSL_CTX 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_ciphers.3 b/secure/lib/libssl/man/SSL_get_ciphers.3
index 4786c94..9111624 100644
--- a/secure/lib/libssl/man/SSL_get_ciphers.3
+++ b/secure/lib/libssl/man/SSL_get_ciphers.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_ciphers 3"
-.TH SSL_get_ciphers 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_get_ciphers 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_client_CA_list.3 b/secure/lib/libssl/man/SSL_get_client_CA_list.3
index 38a1dc7..4c5b67d 100644
--- a/secure/lib/libssl/man/SSL_get_client_CA_list.3
+++ b/secure/lib/libssl/man/SSL_get_client_CA_list.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_client_CA_list 3"
-.TH SSL_get_client_CA_list 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_get_client_CA_list 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_current_cipher.3 b/secure/lib/libssl/man/SSL_get_current_cipher.3
index 13ddc98..5f369a9 100644
--- a/secure/lib/libssl/man/SSL_get_current_cipher.3
+++ b/secure/lib/libssl/man/SSL_get_current_cipher.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_current_cipher 3"
-.TH SSL_get_current_cipher 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_get_current_cipher 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_default_timeout.3 b/secure/lib/libssl/man/SSL_get_default_timeout.3
index 2c2e15d..554e1a4 100644
--- a/secure/lib/libssl/man/SSL_get_default_timeout.3
+++ b/secure/lib/libssl/man/SSL_get_default_timeout.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_default_timeout 3"
-.TH SSL_get_default_timeout 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_get_default_timeout 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_error.3 b/secure/lib/libssl/man/SSL_get_error.3
index dead724..d3e6f4b 100644
--- a/secure/lib/libssl/man/SSL_get_error.3
+++ b/secure/lib/libssl/man/SSL_get_error.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_error 3"
-.TH SSL_get_error 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_get_error 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 b/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3
index 78035a7..b250de2 100644
--- a/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3
+++ b/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_ex_data_X509_STORE_CTX_idx 3"
-.TH SSL_get_ex_data_X509_STORE_CTX_idx 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_get_ex_data_X509_STORE_CTX_idx 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_ex_new_index.3 b/secure/lib/libssl/man/SSL_get_ex_new_index.3
index 18cc8a3..a14e591 100644
--- a/secure/lib/libssl/man/SSL_get_ex_new_index.3
+++ b/secure/lib/libssl/man/SSL_get_ex_new_index.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_ex_new_index 3"
-.TH SSL_get_ex_new_index 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_get_ex_new_index 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_fd.3 b/secure/lib/libssl/man/SSL_get_fd.3
index 3ef8028..120b921 100644
--- a/secure/lib/libssl/man/SSL_get_fd.3
+++ b/secure/lib/libssl/man/SSL_get_fd.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_fd 3"
-.TH SSL_get_fd 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_get_fd 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 b/secure/lib/libssl/man/SSL_get_peer_cert_chain.3
index 71febc7..cc2aaa6 100644
--- a/secure/lib/libssl/man/SSL_get_peer_cert_chain.3
+++ b/secure/lib/libssl/man/SSL_get_peer_cert_chain.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_peer_cert_chain 3"
-.TH SSL_get_peer_cert_chain 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_get_peer_cert_chain 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_peer_certificate.3 b/secure/lib/libssl/man/SSL_get_peer_certificate.3
index fc00428..3c7d50a 100644
--- a/secure/lib/libssl/man/SSL_get_peer_certificate.3
+++ b/secure/lib/libssl/man/SSL_get_peer_certificate.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_peer_certificate 3"
-.TH SSL_get_peer_certificate 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_get_peer_certificate 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_psk_identity.3 b/secure/lib/libssl/man/SSL_get_psk_identity.3
index c0c1b70..eb88b5f 100644
--- a/secure/lib/libssl/man/SSL_get_psk_identity.3
+++ b/secure/lib/libssl/man/SSL_get_psk_identity.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_psk_identity 3"
-.TH SSL_get_psk_identity 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_get_psk_identity 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_rbio.3 b/secure/lib/libssl/man/SSL_get_rbio.3
index cb85024..858b3e6 100644
--- a/secure/lib/libssl/man/SSL_get_rbio.3
+++ b/secure/lib/libssl/man/SSL_get_rbio.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_rbio 3"
-.TH SSL_get_rbio 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_get_rbio 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_session.3 b/secure/lib/libssl/man/SSL_get_session.3
index 4ba0908..7504532 100644
--- a/secure/lib/libssl/man/SSL_get_session.3
+++ b/secure/lib/libssl/man/SSL_get_session.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_session 3"
-.TH SSL_get_session 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_get_session 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_verify_result.3 b/secure/lib/libssl/man/SSL_get_verify_result.3
index b5d6f94..26950d1 100644
--- a/secure/lib/libssl/man/SSL_get_verify_result.3
+++ b/secure/lib/libssl/man/SSL_get_verify_result.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_verify_result 3"
-.TH SSL_get_verify_result 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_get_verify_result 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_version.3 b/secure/lib/libssl/man/SSL_get_version.3
index c01e1cf..c9e2615 100644
--- a/secure/lib/libssl/man/SSL_get_version.3
+++ b/secure/lib/libssl/man/SSL_get_version.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_version 3"
-.TH SSL_get_version 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_get_version 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_library_init.3 b/secure/lib/libssl/man/SSL_library_init.3
index 30969d3..08be353 100644
--- a/secure/lib/libssl/man/SSL_library_init.3
+++ b/secure/lib/libssl/man/SSL_library_init.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_library_init 3"
-.TH SSL_library_init 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_library_init 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_load_client_CA_file.3 b/secure/lib/libssl/man/SSL_load_client_CA_file.3
index ebe51bf..f27423b 100644
--- a/secure/lib/libssl/man/SSL_load_client_CA_file.3
+++ b/secure/lib/libssl/man/SSL_load_client_CA_file.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_load_client_CA_file 3"
-.TH SSL_load_client_CA_file 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_load_client_CA_file 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_new.3 b/secure/lib/libssl/man/SSL_new.3
index 4459826..01cd691 100644
--- a/secure/lib/libssl/man/SSL_new.3
+++ b/secure/lib/libssl/man/SSL_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_new 3"
-.TH SSL_new 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_new 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_pending.3 b/secure/lib/libssl/man/SSL_pending.3
index 4eda613..00a8e7c 100644
--- a/secure/lib/libssl/man/SSL_pending.3
+++ b/secure/lib/libssl/man/SSL_pending.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_pending 3"
-.TH SSL_pending 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_pending 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_read.3 b/secure/lib/libssl/man/SSL_read.3
index 4a2fde0..159c937 100644
--- a/secure/lib/libssl/man/SSL_read.3
+++ b/secure/lib/libssl/man/SSL_read.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_read 3"
-.TH SSL_read 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_read 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_rstate_string.3 b/secure/lib/libssl/man/SSL_rstate_string.3
index 1a60a40..7f0dc6d 100644
--- a/secure/lib/libssl/man/SSL_rstate_string.3
+++ b/secure/lib/libssl/man/SSL_rstate_string.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_rstate_string 3"
-.TH SSL_rstate_string 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_rstate_string 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_session_reused.3 b/secure/lib/libssl/man/SSL_session_reused.3
index fdcd4f8..14d9290 100644
--- a/secure/lib/libssl/man/SSL_session_reused.3
+++ b/secure/lib/libssl/man/SSL_session_reused.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_session_reused 3"
-.TH SSL_session_reused 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_session_reused 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_set_bio.3 b/secure/lib/libssl/man/SSL_set_bio.3
index 8ada003..668d2a8 100644
--- a/secure/lib/libssl/man/SSL_set_bio.3
+++ b/secure/lib/libssl/man/SSL_set_bio.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_set_bio 3"
-.TH SSL_set_bio 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_set_bio 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_set_connect_state.3 b/secure/lib/libssl/man/SSL_set_connect_state.3
index 20791d8..9754edd 100644
--- a/secure/lib/libssl/man/SSL_set_connect_state.3
+++ b/secure/lib/libssl/man/SSL_set_connect_state.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_set_connect_state 3"
-.TH SSL_set_connect_state 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_set_connect_state 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_set_fd.3 b/secure/lib/libssl/man/SSL_set_fd.3
index aa6a36d..70fdf61 100644
--- a/secure/lib/libssl/man/SSL_set_fd.3
+++ b/secure/lib/libssl/man/SSL_set_fd.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_set_fd 3"
-.TH SSL_set_fd 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_set_fd 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_set_session.3 b/secure/lib/libssl/man/SSL_set_session.3
index 2276d78..70c6c8f 100644
--- a/secure/lib/libssl/man/SSL_set_session.3
+++ b/secure/lib/libssl/man/SSL_set_session.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_set_session 3"
-.TH SSL_set_session 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_set_session 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_set_shutdown.3 b/secure/lib/libssl/man/SSL_set_shutdown.3
index 874bac1..ce1aa20 100644
--- a/secure/lib/libssl/man/SSL_set_shutdown.3
+++ b/secure/lib/libssl/man/SSL_set_shutdown.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_set_shutdown 3"
-.TH SSL_set_shutdown 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_set_shutdown 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_set_verify_result.3 b/secure/lib/libssl/man/SSL_set_verify_result.3
index 48739ba..fd97c53 100644
--- a/secure/lib/libssl/man/SSL_set_verify_result.3
+++ b/secure/lib/libssl/man/SSL_set_verify_result.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_set_verify_result 3"
-.TH SSL_set_verify_result 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_set_verify_result 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_shutdown.3 b/secure/lib/libssl/man/SSL_shutdown.3
index 036d2e7..e88abb8 100644
--- a/secure/lib/libssl/man/SSL_shutdown.3
+++ b/secure/lib/libssl/man/SSL_shutdown.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_shutdown 3"
-.TH SSL_shutdown 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_shutdown 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_state_string.3 b/secure/lib/libssl/man/SSL_state_string.3
index cc6eab1..3be5052 100644
--- a/secure/lib/libssl/man/SSL_state_string.3
+++ b/secure/lib/libssl/man/SSL_state_string.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_state_string 3"
-.TH SSL_state_string 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_state_string 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_want.3 b/secure/lib/libssl/man/SSL_want.3
index 9b43446..d3c4343 100644
--- a/secure/lib/libssl/man/SSL_want.3
+++ b/secure/lib/libssl/man/SSL_want.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_want 3"
-.TH SSL_want 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_want 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_write.3 b/secure/lib/libssl/man/SSL_write.3
index f56625c..f51bff5 100644
--- a/secure/lib/libssl/man/SSL_write.3
+++ b/secure/lib/libssl/man/SSL_write.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_write 3"
-.TH SSL_write 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SSL_write 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/d2i_SSL_SESSION.3 b/secure/lib/libssl/man/d2i_SSL_SESSION.3
index 6d25af6..38cd9c4 100644
--- a/secure/lib/libssl/man/d2i_SSL_SESSION.3
+++ b/secure/lib/libssl/man/d2i_SSL_SESSION.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_SSL_SESSION 3"
-.TH d2i_SSL_SESSION 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH d2i_SSL_SESSION 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/ssl.3 b/secure/lib/libssl/man/ssl.3
index e84383f..9b18701 100644
--- a/secure/lib/libssl/man/ssl.3
+++ b/secure/lib/libssl/man/ssl.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ssl 3"
-.TH ssl 3 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH ssl 3 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/libexec/sftp-server/Makefile.depend b/secure/libexec/sftp-server/Makefile.depend
index 6710af3..8531477 100644
--- a/secure/libexec/sftp-server/Makefile.depend
+++ b/secure/libexec/sftp-server/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/secure/libexec/ssh-keysign/Makefile.depend b/secure/libexec/ssh-keysign/Makefile.depend
index 6710af3..8531477 100644
--- a/secure/libexec/ssh-keysign/Makefile.depend
+++ b/secure/libexec/ssh-keysign/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/secure/libexec/ssh-pkcs11-helper/Makefile.depend b/secure/libexec/ssh-pkcs11-helper/Makefile.depend
index 6710af3..8531477 100644
--- a/secure/libexec/ssh-pkcs11-helper/Makefile.depend
+++ b/secure/libexec/ssh-pkcs11-helper/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/secure/usr.bin/bdes/Makefile.depend b/secure/usr.bin/bdes/Makefile.depend
index e9b5ed1..fc0b633 100644
--- a/secure/usr.bin/bdes/Makefile.depend
+++ b/secure/usr.bin/bdes/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/secure/usr.bin/openssl/Makefile.depend b/secure/usr.bin/openssl/Makefile.depend
index 4d65dad..67e2d76 100644
--- a/secure/usr.bin/openssl/Makefile.depend
+++ b/secure/usr.bin/openssl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/secure/usr.bin/openssl/man/CA.pl.1 b/secure/usr.bin/openssl/man/CA.pl.1
index 87627d6..f5a1c3b 100644
--- a/secure/usr.bin/openssl/man/CA.pl.1
+++ b/secure/usr.bin/openssl/man/CA.pl.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CA.PL 1"
-.TH CA.PL 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CA.PL 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/asn1parse.1 b/secure/usr.bin/openssl/man/asn1parse.1
index afea978f..53ce6ba 100644
--- a/secure/usr.bin/openssl/man/asn1parse.1
+++ b/secure/usr.bin/openssl/man/asn1parse.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ASN1PARSE 1"
-.TH ASN1PARSE 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH ASN1PARSE 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/c_rehash.1 b/secure/usr.bin/openssl/man/c_rehash.1
index 0a34ccd..3ae822b 100644
--- a/secure/usr.bin/openssl/man/c_rehash.1
+++ b/secure/usr.bin/openssl/man/c_rehash.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "C_REHASH 1"
-.TH C_REHASH 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH C_REHASH 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/ca.1 b/secure/usr.bin/openssl/man/ca.1
index 1697883..223171e 100644
--- a/secure/usr.bin/openssl/man/ca.1
+++ b/secure/usr.bin/openssl/man/ca.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CA 1"
-.TH CA 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CA 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/ciphers.1 b/secure/usr.bin/openssl/man/ciphers.1
index f1e2e32..f3c9c51 100644
--- a/secure/usr.bin/openssl/man/ciphers.1
+++ b/secure/usr.bin/openssl/man/ciphers.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CIPHERS 1"
-.TH CIPHERS 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CIPHERS 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/cms.1 b/secure/usr.bin/openssl/man/cms.1
index 55d7cf1..36355da 100644
--- a/secure/usr.bin/openssl/man/cms.1
+++ b/secure/usr.bin/openssl/man/cms.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS 1"
-.TH CMS 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CMS 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -171,6 +171,7 @@ cms \- CMS utility
[\fB\-print\fR]
[\fB\-CAfile file\fR]
[\fB\-CApath dir\fR]
+[\fB\-no_alt_chains\fR]
[\fB\-md digest\fR]
[\fB\-[cipher]\fR]
[\fB\-nointern\fR]
@@ -482,8 +483,8 @@ the relevant mail headers. These are included outside the signed
portion of a message so they may be included manually. If signing
then many S/MIME mail clients check the signers certificate's email
address matches that specified in the From: address.
-.IP "\fB\-purpose, \-ignore_critical, \-issuer_checks, \-crl_check, \-crl_check_all, \-policy_check, \-extended_crl, \-x509_strict, \-policy \-check_ss_sig\fR" 4
-.IX Item "-purpose, -ignore_critical, -issuer_checks, -crl_check, -crl_check_all, -policy_check, -extended_crl, -x509_strict, -policy -check_ss_sig"
+.IP "\fB\-purpose, \-ignore_critical, \-issuer_checks, \-crl_check, \-crl_check_all, \-policy_check, \-extended_crl, \-x509_strict, \-policy \-check_ss_sig \-no_alt_chains\fR" 4
+.IX Item "-purpose, -ignore_critical, -issuer_checks, -crl_check, -crl_check_all, -policy_check, -extended_crl, -x509_strict, -policy -check_ss_sig -no_alt_chains"
Set various certificate chain valiadition option. See the
\&\fBverify\fR manual page for details.
.SH "NOTES"
@@ -698,3 +699,5 @@ No revocation checking is done on the signer's certificate.
.IX Header "HISTORY"
The use of multiple \fB\-signer\fR options and the \fB\-resign\fR command were first
added in OpenSSL 1.0.0
+.PP
+The \-no_alt_chains options was first added to OpenSSL 1.0.1n and 1.0.2b.
diff --git a/secure/usr.bin/openssl/man/crl.1 b/secure/usr.bin/openssl/man/crl.1
index 70c3067..001fc82 100644
--- a/secure/usr.bin/openssl/man/crl.1
+++ b/secure/usr.bin/openssl/man/crl.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CRL 1"
-.TH CRL 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CRL 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/crl2pkcs7.1 b/secure/usr.bin/openssl/man/crl2pkcs7.1
index 98f792e..18dcbf8 100644
--- a/secure/usr.bin/openssl/man/crl2pkcs7.1
+++ b/secure/usr.bin/openssl/man/crl2pkcs7.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CRL2PKCS7 1"
-.TH CRL2PKCS7 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH CRL2PKCS7 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/dgst.1 b/secure/usr.bin/openssl/man/dgst.1
index 4565e7e..9a842b5f 100644
--- a/secure/usr.bin/openssl/man/dgst.1
+++ b/secure/usr.bin/openssl/man/dgst.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DGST 1"
-.TH DGST 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH DGST 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/dhparam.1 b/secure/usr.bin/openssl/man/dhparam.1
index d377080..a428173 100644
--- a/secure/usr.bin/openssl/man/dhparam.1
+++ b/secure/usr.bin/openssl/man/dhparam.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DHPARAM 1"
-.TH DHPARAM 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH DHPARAM 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -197,8 +197,10 @@ avoid small-subgroup attacks that may be possible otherwise.
check if the parameters are valid primes and generator.
.IP "\fB\-2\fR, \fB\-5\fR" 4
.IX Item "-2, -5"
-The generator to use, either 2 or 5. 2 is the default. If present then the
-input file is ignored and parameters are generated instead.
+The generator to use, either 2 or 5. If present then the
+input file is ignored and parameters are generated instead. If not
+present but \fBnumbits\fR is present, parameters are generated with the
+default generator 2.
.IP "\fB\-rand\fR \fIfile(s)\fR" 4
.IX Item "-rand file(s)"
a file or files containing random data used to seed the random number
@@ -209,9 +211,10 @@ all others.
.IP "\fInumbits\fR" 4
.IX Item "numbits"
this option specifies that a parameter set should be generated of size
-\&\fInumbits\fR. It must be the last option. If not present then a value of 512
-is used. If this option is present then the input file is ignored and
-parameters are generated instead.
+\&\fInumbits\fR. It must be the last option. If this option is present then
+the input file is ignored and parameters are generated instead. If
+this option is not present but a generator (\fB\-2\fR or \fB\-5\fR) is
+present, parameters are generated with a default length of 2048 bits.
.IP "\fB\-noout\fR" 4
.IX Item "-noout"
this option inhibits the output of the encoded version of the parameters.
diff --git a/secure/usr.bin/openssl/man/dsa.1 b/secure/usr.bin/openssl/man/dsa.1
index db8fff6..c1ddf93 100644
--- a/secure/usr.bin/openssl/man/dsa.1
+++ b/secure/usr.bin/openssl/man/dsa.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA 1"
-.TH DSA 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH DSA 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/dsaparam.1 b/secure/usr.bin/openssl/man/dsaparam.1
index 21f2f28..a684d1a 100644
--- a/secure/usr.bin/openssl/man/dsaparam.1
+++ b/secure/usr.bin/openssl/man/dsaparam.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSAPARAM 1"
-.TH DSAPARAM 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH DSAPARAM 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/ec.1 b/secure/usr.bin/openssl/man/ec.1
index d9e7499..bc72c67 100644
--- a/secure/usr.bin/openssl/man/ec.1
+++ b/secure/usr.bin/openssl/man/ec.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EC 1"
-.TH EC 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH EC 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/ecparam.1 b/secure/usr.bin/openssl/man/ecparam.1
index bd29211..55b4bbb 100644
--- a/secure/usr.bin/openssl/man/ecparam.1
+++ b/secure/usr.bin/openssl/man/ecparam.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ECPARAM 1"
-.TH ECPARAM 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH ECPARAM 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/enc.1 b/secure/usr.bin/openssl/man/enc.1
index 4fce370..ab1cdd1 100644
--- a/secure/usr.bin/openssl/man/enc.1
+++ b/secure/usr.bin/openssl/man/enc.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ENC 1"
-.TH ENC 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH ENC 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/errstr.1 b/secure/usr.bin/openssl/man/errstr.1
index eef9e67..2cadb1e 100644
--- a/secure/usr.bin/openssl/man/errstr.1
+++ b/secure/usr.bin/openssl/man/errstr.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERRSTR 1"
-.TH ERRSTR 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH ERRSTR 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/gendsa.1 b/secure/usr.bin/openssl/man/gendsa.1
index d7489c0..926484f 100644
--- a/secure/usr.bin/openssl/man/gendsa.1
+++ b/secure/usr.bin/openssl/man/gendsa.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "GENDSA 1"
-.TH GENDSA 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH GENDSA 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/genpkey.1 b/secure/usr.bin/openssl/man/genpkey.1
index 209f4b7..2697f05 100644
--- a/secure/usr.bin/openssl/man/genpkey.1
+++ b/secure/usr.bin/openssl/man/genpkey.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "GENPKEY 1"
-.TH GENPKEY 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH GENPKEY 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/genrsa.1 b/secure/usr.bin/openssl/man/genrsa.1
index 4b50ce1..f4a7bab 100644
--- a/secure/usr.bin/openssl/man/genrsa.1
+++ b/secure/usr.bin/openssl/man/genrsa.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "GENRSA 1"
-.TH GENRSA 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH GENRSA 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/nseq.1 b/secure/usr.bin/openssl/man/nseq.1
index d1c1561..e6d86ea 100644
--- a/secure/usr.bin/openssl/man/nseq.1
+++ b/secure/usr.bin/openssl/man/nseq.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "NSEQ 1"
-.TH NSEQ 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH NSEQ 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/ocsp.1 b/secure/usr.bin/openssl/man/ocsp.1
index 87735ff..7b8caec 100644
--- a/secure/usr.bin/openssl/man/ocsp.1
+++ b/secure/usr.bin/openssl/man/ocsp.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OCSP 1"
-.TH OCSP 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH OCSP 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -165,6 +165,7 @@ ocsp \- Online Certificate Status Protocol utility
[\fB\-path\fR]
[\fB\-CApath dir\fR]
[\fB\-CAfile file\fR]
+[\fB\-no_alt_chains\fR]]
[\fB\-VAfile file\fR]
[\fB\-validity_period n\fR]
[\fB\-status_age n\fR]
@@ -261,6 +262,9 @@ connection timeout to the \s-1OCSP\s0 responder in seconds
.IX Item "-CAfile file, -CApath pathname"
file or pathname containing trusted \s-1CA\s0 certificates. These are used to verify
the signature on the \s-1OCSP\s0 response.
+.IP "\fB\-no_alt_chains\fR" 4
+.IX Item "-no_alt_chains"
+See \fBverify\fR manual page for details.
.IP "\fB\-verify_other file\fR" 4
.IX Item "-verify_other file"
file containing additional certificates to search when attempting to locate
@@ -483,3 +487,6 @@ second file.
\& openssl ocsp \-index demoCA/index.txt \-rsigner rcert.pem \-CA demoCA/cacert.pem
\& \-reqin req.der \-respout resp.der
.Ve
+.SH "HISTORY"
+.IX Header "HISTORY"
+The \-no_alt_chains options was first added to OpenSSL 1.0.1n and 1.0.2b.
diff --git a/secure/usr.bin/openssl/man/openssl.1 b/secure/usr.bin/openssl/man/openssl.1
index b0477a9..c554c76 100644
--- a/secure/usr.bin/openssl/man/openssl.1
+++ b/secure/usr.bin/openssl/man/openssl.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OPENSSL 1"
-.TH OPENSSL 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH OPENSSL 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/passwd.1 b/secure/usr.bin/openssl/man/passwd.1
index e3804dc..65c491d 100644
--- a/secure/usr.bin/openssl/man/passwd.1
+++ b/secure/usr.bin/openssl/man/passwd.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PASSWD 1"
-.TH PASSWD 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH PASSWD 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/pkcs12.1 b/secure/usr.bin/openssl/man/pkcs12.1
index a93795e..2caa333 100644
--- a/secure/usr.bin/openssl/man/pkcs12.1
+++ b/secure/usr.bin/openssl/man/pkcs12.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS12 1"
-.TH PKCS12 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH PKCS12 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/pkcs7.1 b/secure/usr.bin/openssl/man/pkcs7.1
index cdc7ac7..ef3dc76 100644
--- a/secure/usr.bin/openssl/man/pkcs7.1
+++ b/secure/usr.bin/openssl/man/pkcs7.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS7 1"
-.TH PKCS7 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH PKCS7 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/pkcs8.1 b/secure/usr.bin/openssl/man/pkcs8.1
index fb6ade1..441a8f8 100644
--- a/secure/usr.bin/openssl/man/pkcs8.1
+++ b/secure/usr.bin/openssl/man/pkcs8.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS8 1"
-.TH PKCS8 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH PKCS8 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/pkey.1 b/secure/usr.bin/openssl/man/pkey.1
index b5f23ef..a41c8dd 100644
--- a/secure/usr.bin/openssl/man/pkey.1
+++ b/secure/usr.bin/openssl/man/pkey.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKEY 1"
-.TH PKEY 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH PKEY 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/pkeyparam.1 b/secure/usr.bin/openssl/man/pkeyparam.1
index af35471..e8ccec9 100644
--- a/secure/usr.bin/openssl/man/pkeyparam.1
+++ b/secure/usr.bin/openssl/man/pkeyparam.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKEYPARAM 1"
-.TH PKEYPARAM 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH PKEYPARAM 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/pkeyutl.1 b/secure/usr.bin/openssl/man/pkeyutl.1
index fa4d67b..2025771 100644
--- a/secure/usr.bin/openssl/man/pkeyutl.1
+++ b/secure/usr.bin/openssl/man/pkeyutl.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKEYUTL 1"
-.TH PKEYUTL 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH PKEYUTL 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/rand.1 b/secure/usr.bin/openssl/man/rand.1
index 0b37959..2c0ac33 100644
--- a/secure/usr.bin/openssl/man/rand.1
+++ b/secure/usr.bin/openssl/man/rand.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RAND 1"
-.TH RAND 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH RAND 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/req.1 b/secure/usr.bin/openssl/man/req.1
index b3b1ec8..29aa47f 100644
--- a/secure/usr.bin/openssl/man/req.1
+++ b/secure/usr.bin/openssl/man/req.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "REQ 1"
-.TH REQ 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH REQ 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/rsa.1 b/secure/usr.bin/openssl/man/rsa.1
index 0e398b6..2301072 100644
--- a/secure/usr.bin/openssl/man/rsa.1
+++ b/secure/usr.bin/openssl/man/rsa.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA 1"
-.TH RSA 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH RSA 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/rsautl.1 b/secure/usr.bin/openssl/man/rsautl.1
index 83c9e09..13220f9 100644
--- a/secure/usr.bin/openssl/man/rsautl.1
+++ b/secure/usr.bin/openssl/man/rsautl.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSAUTL 1"
-.TH RSAUTL 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH RSAUTL 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/s_client.1 b/secure/usr.bin/openssl/man/s_client.1
index 13c74ef..4cc8299f 100644
--- a/secure/usr.bin/openssl/man/s_client.1
+++ b/secure/usr.bin/openssl/man/s_client.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "S_CLIENT 1"
-.TH S_CLIENT 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH S_CLIENT 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -154,6 +154,7 @@ s_client \- SSL/TLS client program
[\fB\-pass arg\fR]
[\fB\-CApath directory\fR]
[\fB\-CAfile filename\fR]
+[\fB\-no_alt_chains\fR]
[\fB\-reconnect\fR]
[\fB\-pause\fR]
[\fB\-showcerts\fR]
@@ -236,8 +237,8 @@ also used when building the client certificate chain.
.IX Item "-CAfile file"
A file containing trusted certificates to use during server authentication
and to use when attempting to build the client certificate chain.
-.IP "\fB\-purpose, \-ignore_critical, \-issuer_checks, \-crl_check, \-crl_check_all, \-policy_check, \-extended_crl, \-x509_strict, \-policy \-check_ss_sig\fR" 4
-.IX Item "-purpose, -ignore_critical, -issuer_checks, -crl_check, -crl_check_all, -policy_check, -extended_crl, -x509_strict, -policy -check_ss_sig"
+.IP "\fB\-purpose, \-ignore_critical, \-issuer_checks, \-crl_check, \-crl_check_all, \-policy_check, \-extended_crl, \-x509_strict, \-policy \-check_ss_sig \-no_alt_chains\fR" 4
+.IX Item "-purpose, -ignore_critical, -issuer_checks, -crl_check, -crl_check_all, -policy_check, -extended_crl, -x509_strict, -policy -check_ss_sig -no_alt_chains"
Set various certificate chain valiadition option. See the
\&\fBverify\fR manual page for details.
.IP "\fB\-reconnect\fR" 4
@@ -434,3 +435,6 @@ information whenever a session is renegotiated.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fIsess_id\fR\|(1), \fIs_server\fR\|(1), \fIciphers\fR\|(1)
+.SH "HISTORY"
+.IX Header "HISTORY"
+The \-no_alt_chains options was first added to OpenSSL 1.0.1n and 1.0.2b.
diff --git a/secure/usr.bin/openssl/man/s_server.1 b/secure/usr.bin/openssl/man/s_server.1
index 781954a..34eb434 100644
--- a/secure/usr.bin/openssl/man/s_server.1
+++ b/secure/usr.bin/openssl/man/s_server.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "S_SERVER 1"
-.TH S_SERVER 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH S_SERVER 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -168,6 +168,7 @@ s_server \- SSL/TLS server program
[\fB\-state\fR]
[\fB\-CApath directory\fR]
[\fB\-CAfile filename\fR]
+[\fB\-no_alt_chains\fR]
[\fB\-nocert\fR]
[\fB\-cipher cipherlist\fR]
[\fB\-serverpref\fR]
@@ -291,6 +292,9 @@ A file containing trusted certificates to use during client authentication
and to use when attempting to build the server certificate chain. The list
is also used in the list of acceptable client CAs passed to the client when
a certificate is requested.
+.IP "\fB\-no_alt_chains\fR" 4
+.IX Item "-no_alt_chains"
+See the \fBverify\fR manual page for details.
.IP "\fB\-state\fR" 4
.IX Item "-state"
prints out the \s-1SSL\s0 session states.
@@ -470,3 +474,6 @@ unknown cipher suites a client says it supports.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fIsess_id\fR\|(1), \fIs_client\fR\|(1), \fIciphers\fR\|(1)
+.SH "HISTORY"
+.IX Header "HISTORY"
+The \-no_alt_chains options was first added to OpenSSL 1.0.1n and 1.0.2b.
diff --git a/secure/usr.bin/openssl/man/s_time.1 b/secure/usr.bin/openssl/man/s_time.1
index 89bb20d..79a19b6 100644
--- a/secure/usr.bin/openssl/man/s_time.1
+++ b/secure/usr.bin/openssl/man/s_time.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "S_TIME 1"
-.TH S_TIME 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH S_TIME 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/sess_id.1 b/secure/usr.bin/openssl/man/sess_id.1
index d45369d..f2f96bd 100644
--- a/secure/usr.bin/openssl/man/sess_id.1
+++ b/secure/usr.bin/openssl/man/sess_id.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SESS_ID 1"
-.TH SESS_ID 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SESS_ID 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/smime.1 b/secure/usr.bin/openssl/man/smime.1
index 10bb4e2..7236ff1 100644
--- a/secure/usr.bin/openssl/man/smime.1
+++ b/secure/usr.bin/openssl/man/smime.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SMIME 1"
-.TH SMIME 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SMIME 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -151,6 +151,7 @@ smime \- S/MIME utility
[\fB\-pk7out\fR]
[\fB\-[cipher]\fR]
[\fB\-in file\fR]
+[\fB\-no_alt_chains\fR]
[\fB\-certfile file\fR]
[\fB\-signer file\fR]
[\fB\-recip file\fR]
@@ -356,8 +357,8 @@ the relevant mail headers. These are included outside the signed
portion of a message so they may be included manually. If signing
then many S/MIME mail clients check the signers certificate's email
address matches that specified in the From: address.
-.IP "\fB\-purpose, \-ignore_critical, \-issuer_checks, \-crl_check, \-crl_check_all, \-policy_check, \-extended_crl, \-x509_strict, \-policy \-check_ss_sig\fR" 4
-.IX Item "-purpose, -ignore_critical, -issuer_checks, -crl_check, -crl_check_all, -policy_check, -extended_crl, -x509_strict, -policy -check_ss_sig"
+.IP "\fB\-purpose, \-ignore_critical, \-issuer_checks, \-crl_check, \-crl_check_all, \-policy_check, \-extended_crl, \-x509_strict, \-policy \-check_ss_sig \-no_alt_chains\fR" 4
+.IX Item "-purpose, -ignore_critical, -issuer_checks, -crl_check, -crl_check_all, -policy_check, -extended_crl, -x509_strict, -policy -check_ss_sig -no_alt_chains"
Set various options of certificate chain verification. See
\&\fBverify\fR manual page for details.
.SH "NOTES"
@@ -548,3 +549,5 @@ structures may cause parsing errors.
.IX Header "HISTORY"
The use of multiple \fB\-signer\fR options and the \fB\-resign\fR command were first
added in OpenSSL 1.0.0
+.PP
+The \-no_alt_chains options was first added to OpenSSL 1.0.1n and 1.0.2b.
diff --git a/secure/usr.bin/openssl/man/speed.1 b/secure/usr.bin/openssl/man/speed.1
index c427c2b..30aa927 100644
--- a/secure/usr.bin/openssl/man/speed.1
+++ b/secure/usr.bin/openssl/man/speed.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SPEED 1"
-.TH SPEED 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SPEED 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/spkac.1 b/secure/usr.bin/openssl/man/spkac.1
index 91c175f..1780d32 100644
--- a/secure/usr.bin/openssl/man/spkac.1
+++ b/secure/usr.bin/openssl/man/spkac.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SPKAC 1"
-.TH SPKAC 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH SPKAC 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/ts.1 b/secure/usr.bin/openssl/man/ts.1
index 0ae61eb..51ee65f 100644
--- a/secure/usr.bin/openssl/man/ts.1
+++ b/secure/usr.bin/openssl/man/ts.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "TS 1"
-.TH TS 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH TS 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/tsget.1 b/secure/usr.bin/openssl/man/tsget.1
index 019b5f3..946e16a 100644
--- a/secure/usr.bin/openssl/man/tsget.1
+++ b/secure/usr.bin/openssl/man/tsget.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "TSGET 1"
-.TH TSGET 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH TSGET 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/verify.1 b/secure/usr.bin/openssl/man/verify.1
index 2c3106f..8709a6c 100644
--- a/secure/usr.bin/openssl/man/verify.1
+++ b/secure/usr.bin/openssl/man/verify.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "VERIFY 1"
-.TH VERIFY 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH VERIFY 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -158,6 +158,7 @@ verify \- Utility to verify certificates.
[\fB\-extended_crl\fR]
[\fB\-use_deltas\fR]
[\fB\-policy_print\fR]
+[\fB\-no_alt_chains\fR]
[\fB\-untrusted file\fR]
[\fB\-help\fR]
[\fB\-issuer_checks\fR]
@@ -227,6 +228,13 @@ Set policy variable inhibit-any-policy (see \s-1RFC5280\s0).
.IP "\fB\-inhibit_map\fR" 4
.IX Item "-inhibit_map"
Set policy variable inhibit-policy-mapping (see \s-1RFC5280\s0).
+.IP "\fB\-no_alt_chains\fR" 4
+.IX Item "-no_alt_chains"
+When building a certificate chain, if the first certificate chain found is not
+trusted, then OpenSSL will continue to check to see if an alternative chain can
+be found that is trusted. With this option that behaviour is suppressed so that
+only the first chain found is ever used. Using this option will force the
+behaviour to match that of previous OpenSSL versions.
.IP "\fB\-policy_print\fR" 4
.IX Item "-policy_print"
Print out diagnostics related to policy processing.
@@ -477,3 +485,6 @@ Previous versions of this documentation swapped the meaning of the
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fIx509\fR\|(1)
+.SH "HISTORY"
+.IX Header "HISTORY"
+The \-no_alt_chains options was first added to OpenSSL 1.0.1n and 1.0.2b.
diff --git a/secure/usr.bin/openssl/man/version.1 b/secure/usr.bin/openssl/man/version.1
index 5188c0a..77ee222 100644
--- a/secure/usr.bin/openssl/man/version.1
+++ b/secure/usr.bin/openssl/man/version.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "VERSION 1"
-.TH VERSION 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH VERSION 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/x509.1 b/secure/usr.bin/openssl/man/x509.1
index 46ea514..7d6dd90 100644
--- a/secure/usr.bin/openssl/man/x509.1
+++ b/secure/usr.bin/openssl/man/x509.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509 1"
-.TH X509 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH X509 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/x509v3_config.1 b/secure/usr.bin/openssl/man/x509v3_config.1
index 5d331fc..1e1e63c 100644
--- a/secure/usr.bin/openssl/man/x509v3_config.1
+++ b/secure/usr.bin/openssl/man/x509v3_config.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509V3_CONFIG 1"
-.TH X509V3_CONFIG 1 "2015-03-19" "1.0.1m" "OpenSSL"
+.TH X509V3_CONFIG 1 "2015-06-12" "1.0.1o" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/scp/Makefile.depend b/secure/usr.bin/scp/Makefile.depend
index 6710af3..8531477 100644
--- a/secure/usr.bin/scp/Makefile.depend
+++ b/secure/usr.bin/scp/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/secure/usr.bin/sftp/Makefile.depend b/secure/usr.bin/sftp/Makefile.depend
index 708d665..8c545dd 100644
--- a/secure/usr.bin/sftp/Makefile.depend
+++ b/secure/usr.bin/sftp/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/secure/usr.bin/ssh-add/Makefile.depend b/secure/usr.bin/ssh-add/Makefile.depend
index 6710af3..8531477 100644
--- a/secure/usr.bin/ssh-add/Makefile.depend
+++ b/secure/usr.bin/ssh-add/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/secure/usr.bin/ssh-agent/Makefile.depend b/secure/usr.bin/ssh-agent/Makefile.depend
index 6710af3..8531477 100644
--- a/secure/usr.bin/ssh-agent/Makefile.depend
+++ b/secure/usr.bin/ssh-agent/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/secure/usr.bin/ssh-keygen/Makefile.depend b/secure/usr.bin/ssh-keygen/Makefile.depend
index 6710af3..8531477 100644
--- a/secure/usr.bin/ssh-keygen/Makefile.depend
+++ b/secure/usr.bin/ssh-keygen/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/secure/usr.bin/ssh-keyscan/Makefile.depend b/secure/usr.bin/ssh-keyscan/Makefile.depend
index 6710af3..8531477 100644
--- a/secure/usr.bin/ssh-keyscan/Makefile.depend
+++ b/secure/usr.bin/ssh-keyscan/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/secure/usr.bin/ssh/Makefile.depend b/secure/usr.bin/ssh/Makefile.depend
index e968da2..b8099fd 100644
--- a/secure/usr.bin/ssh/Makefile.depend
+++ b/secure/usr.bin/ssh/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/secure/usr.sbin/sshd/Makefile.depend b/secure/usr.sbin/sshd/Makefile.depend
index 860467c..d24b0be 100644
--- a/secure/usr.sbin/sshd/Makefile.depend
+++ b/secure/usr.sbin/sshd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/colldef/Makefile.depend b/share/colldef/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/colldef/Makefile.depend
+++ b/share/colldef/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/dict/Makefile.depend b/share/dict/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/dict/Makefile.depend
+++ b/share/dict/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/doc/IPv6/Makefile.depend b/share/doc/IPv6/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/doc/IPv6/Makefile.depend
+++ b/share/doc/IPv6/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/doc/atf/Makefile b/share/doc/atf/Makefile
index 1ac2af9..bfd7d06 100644
--- a/share/doc/atf/Makefile
+++ b/share/doc/atf/Makefile
@@ -29,7 +29,6 @@ ATF= ${.CURDIR}/../../../contrib/atf
.PATH: ${ATF}
.PATH: ${ATF}/doc
-
FILESGROUPS= TOP
TOPDIR= ${SHAREDIR}/doc/atf
diff --git a/share/doc/atf/Makefile.depend b/share/doc/atf/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/doc/atf/Makefile.depend
+++ b/share/doc/atf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/doc/legal/intel_ipw/Makefile.depend b/share/doc/legal/intel_ipw/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/doc/legal/intel_ipw/Makefile.depend
+++ b/share/doc/legal/intel_ipw/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/doc/legal/intel_iwi/Makefile.depend b/share/doc/legal/intel_iwi/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/doc/legal/intel_iwi/Makefile.depend
+++ b/share/doc/legal/intel_iwi/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/doc/legal/intel_iwn/Makefile.depend b/share/doc/legal/intel_iwn/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/doc/legal/intel_iwn/Makefile.depend
+++ b/share/doc/legal/intel_iwn/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/doc/legal/intel_wpi/Makefile.depend b/share/doc/legal/intel_wpi/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/doc/legal/intel_wpi/Makefile.depend
+++ b/share/doc/legal/intel_wpi/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/doc/legal/realtek/Makefile b/share/doc/legal/realtek/Makefile
index 18bbef3..2d96c42 100644
--- a/share/doc/legal/realtek/Makefile
+++ b/share/doc/legal/realtek/Makefile
@@ -1,6 +1,5 @@
# $FreeBSD$
-NO_OBJ=
FILES= ${.CURDIR}/../../../../sys/contrib/dev/urtwn/LICENSE
FILESDIR= ${SHAREDIR}/doc/legal/realtek
diff --git a/share/doc/legal/realtek/Makefile.depend b/share/doc/legal/realtek/Makefile.depend
index 57b7e10..d14a02b 100644
--- a/share/doc/legal/realtek/Makefile.depend
+++ b/share/doc/legal/realtek/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/share/doc/llvm/Makefile b/share/doc/llvm/Makefile
index 37493bb..250fedd 100644
--- a/share/doc/llvm/Makefile
+++ b/share/doc/llvm/Makefile
@@ -6,8 +6,6 @@ SRCDIR= ${.CURDIR}/../../../contrib/llvm
.PATH: ${SRCDIR} ${SRCDIR}/lib/Support
-NO_OBJ=
-
FILESGROUPS= TOP
TOP= LICENSE.TXT COPYRIGHT.regex
TOPDIR= ${DOCDIR}/llvm
diff --git a/share/doc/llvm/Makefile.depend b/share/doc/llvm/Makefile.depend
index 29fda55..3af2d7f 100644
--- a/share/doc/llvm/Makefile.depend
+++ b/share/doc/llvm/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/share/doc/llvm/clang/Makefile b/share/doc/llvm/clang/Makefile
index d1b5480..727f750 100644
--- a/share/doc/llvm/clang/Makefile
+++ b/share/doc/llvm/clang/Makefile
@@ -4,7 +4,6 @@ SRCDIR= ${.CURDIR}/../../../../contrib/llvm/tools/clang
.PATH: ${SRCDIR}
-
FILESGROUPS= TOP
TOP= LICENSE.TXT
TOPDIR= ${DOCDIR}/llvm/clang
diff --git a/share/doc/llvm/clang/Makefile.depend b/share/doc/llvm/clang/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/doc/llvm/clang/Makefile.depend
+++ b/share/doc/llvm/clang/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/doc/papers/bufbio/bio.ms b/share/doc/papers/bufbio/bio.ms
index 32e2917..02ea08d 100644
--- a/share/doc/papers/bufbio/bio.ms
+++ b/share/doc/papers/bufbio/bio.ms
@@ -40,7 +40,7 @@ This paper contains the road-map for a stackable "BIO" system in
FreeBSD, which will support these facilities.
.AE
.NH
-The miseducation of \f(CW.)struct buf\fP.
+The miseducation of \f(CWstruct buf\fP.
.PP
To fully appreciate the topic, I include a little historic overview
of struct buf, it is a most enlightening case of not exactly bit-rot
@@ -215,7 +215,7 @@ and Vinum. They all basically do the same: they map I/O requests from
a logical space to a physical space, and the mappings they perform
can be 1:1 or 1:N. \**
.FS
-It is interesting to note that Lions in his comments to the \f(CW.)rkaddr\fP
+It is interesting to note that Lions in his comments to the \f(CWrkaddr\fP
routine (p. 16-2) writes \fIThe code in this procedure incorporates
a special feature for files which extend over more than one disk
drive. This feature is described in the UPM Section "RK(IV)". Its
@@ -258,7 +258,7 @@ limited extent diskslice/label, which
need only the I/O aspect, not the vnode, caching or VM linkage.
.IP
.I
-The I/O aspect of struct buf should be put in a separate \f(CW.)struct bio\fP.
+The I/O aspect of struct buf should be put in a separate \f(CWstruct bio\fP.
.R
.NH 1
Implications for future struct buf improvements
@@ -296,7 +296,7 @@ Anything that could be added to or done with
the I/O aspect of struct buf can also be added to or done
with the I/O aspect if it lives in a new "struct bio".
.NH 1
-Implementing a \f(CW.)struct bio\fP
+Implementing a \f(CWstruct bio\fP
.PP
The first decision to be made was who got to use the name "struct buf",
and considering the fact that it is the I/O aspect which gets separated
diff --git a/share/doc/pjdfstest/Makefile b/share/doc/pjdfstest/Makefile
index 21d72f3..bbcb28c 100644
--- a/share/doc/pjdfstest/Makefile
+++ b/share/doc/pjdfstest/Makefile
@@ -1,7 +1,5 @@
# $FreeBSD$
-NO_OBJ=
-
FILESDIR= ${SHAREDIR}/doc/pjdfstest
FILES= README
diff --git a/share/dtrace/toolkit/Makefile.depend b/share/dtrace/toolkit/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/dtrace/toolkit/Makefile.depend
+++ b/share/dtrace/toolkit/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/examples/bhyve/vmrun.sh b/share/examples/bhyve/vmrun.sh
index 901404b..88cbd7c 100755
--- a/share/examples/bhyve/vmrun.sh
+++ b/share/examples/bhyve/vmrun.sh
@@ -104,7 +104,10 @@ while getopts ac:C:d:e:g:hH:iI:m:p:t: c ; do
console=${OPTARG}
;;
d)
- eval "disk_dev${disk_total}=\"${OPTARG}\""
+ disk_dev=${OPTARG%%,*}
+ disk_opts=${OPTARG#${disk_dev}}
+ eval "disk_dev${disk_total}=\"${disk_dev}\""
+ eval "disk_opts${disk_total}=\"${disk_opts}\""
disk_total=$(($disk_total + 1))
;;
e)
@@ -183,16 +186,16 @@ make_and_check_diskdev()
echo "Launching virtual machine \"$vmname\" ..."
-virtio_diskdev="$disk_dev0"
+first_diskdev="$disk_dev0"
${BHYVECTL} --vm=${vmname} --destroy > /dev/null 2>&1
while [ 1 ]; do
- file -s ${virtio_diskdev} | grep "boot sector" > /dev/null
+ file -s ${first_diskdev} | grep "boot sector" > /dev/null
rc=$?
if [ $rc -ne 0 ]; then
- file -s ${virtio_diskdev} | grep ": Unix Fast File sys" > /dev/null
+ file -s ${first_diskdev} | grep ": Unix Fast File sys" > /dev/null
rc=$?
fi
if [ $rc -ne 0 ]; then
@@ -207,14 +210,22 @@ while [ 1 ]; do
echo "is not readable"
exit 1
fi
- BOOTDISK=${isofile}
- installer_opt="-s 31:0,ahci-cd,${BOOTDISK}"
+ BOOTDISKS="-d ${isofile}"
+ installer_opt="-s 31:0,ahci-cd,${isofile}"
else
- BOOTDISK=${virtio_diskdev}
+ BOOTDISKS=""
+ i=0
+ while [ $i -lt $disk_total ] ; do
+ eval "disk=\$disk_dev${i}"
+ if [ -r ${disk} ] ; then
+ BOOTDISKS="$BOOTDISKS -d ${disk} "
+ fi
+ i=$(($i + 1))
+ done
installer_opt=""
fi
- ${LOADER} -c ${console} -m ${memsize} -d ${BOOTDISK} ${loader_opt} \
+ ${LOADER} -c ${console} -m ${memsize} ${BOOTDISKS} ${loader_opt} \
${vmname}
bhyve_exit=$?
if [ $bhyve_exit -ne 0 ]; then
@@ -237,8 +248,9 @@ while [ 1 ]; do
i=0
while [ $i -lt $disk_total ] ; do
eval "disk=\$disk_dev${i}"
+ eval "opts=\$disk_opts${i}"
make_and_check_diskdev "${disk}"
- devargs="$devargs -s $nextslot:0,virtio-blk,${disk} "
+ devargs="$devargs -s $nextslot:0,virtio-blk,${disk}${opts} "
nextslot=$(($nextslot + 1))
i=$(($i + 1))
done
diff --git a/share/examples/ipfilter/Makefile.depend b/share/examples/ipfilter/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/examples/ipfilter/Makefile.depend
+++ b/share/examples/ipfilter/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/examples/libvgl/Makefile.depend b/share/examples/libvgl/Makefile.depend
index a839545..f52ca95 100644
--- a/share/examples/libvgl/Makefile.depend
+++ b/share/examples/libvgl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/share/examples/pf/Makefile.depend b/share/examples/pf/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/examples/pf/Makefile.depend
+++ b/share/examples/pf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/csmapper/APPLE/Makefile.depend b/share/i18n/csmapper/APPLE/Makefile.depend
index e027058..e2e5f90 100644
--- a/share/i18n/csmapper/APPLE/Makefile.depend
+++ b/share/i18n/csmapper/APPLE/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/csmapper/AST/Makefile.depend b/share/i18n/csmapper/AST/Makefile.depend
index e027058..e2e5f90 100644
--- a/share/i18n/csmapper/AST/Makefile.depend
+++ b/share/i18n/csmapper/AST/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/csmapper/BIG5/Makefile.depend b/share/i18n/csmapper/BIG5/Makefile.depend
index e027058..e2e5f90 100644
--- a/share/i18n/csmapper/BIG5/Makefile.depend
+++ b/share/i18n/csmapper/BIG5/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/csmapper/CNS/Makefile.depend b/share/i18n/csmapper/CNS/Makefile.depend
index e027058..e2e5f90 100644
--- a/share/i18n/csmapper/CNS/Makefile.depend
+++ b/share/i18n/csmapper/CNS/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/csmapper/CP/Makefile.depend b/share/i18n/csmapper/CP/Makefile.depend
index e027058..e2e5f90 100644
--- a/share/i18n/csmapper/CP/Makefile.depend
+++ b/share/i18n/csmapper/CP/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/csmapper/EBCDIC/Makefile.depend b/share/i18n/csmapper/EBCDIC/Makefile.depend
index e027058..e2e5f90 100644
--- a/share/i18n/csmapper/EBCDIC/Makefile.depend
+++ b/share/i18n/csmapper/EBCDIC/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/csmapper/GB/Makefile.depend b/share/i18n/csmapper/GB/Makefile.depend
index e027058..e2e5f90 100644
--- a/share/i18n/csmapper/GB/Makefile.depend
+++ b/share/i18n/csmapper/GB/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/csmapper/GEORGIAN/Makefile.depend b/share/i18n/csmapper/GEORGIAN/Makefile.depend
index e027058..e2e5f90 100644
--- a/share/i18n/csmapper/GEORGIAN/Makefile.depend
+++ b/share/i18n/csmapper/GEORGIAN/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/csmapper/ISO-8859/Makefile.depend b/share/i18n/csmapper/ISO-8859/Makefile.depend
index e027058..e2e5f90 100644
--- a/share/i18n/csmapper/ISO-8859/Makefile.depend
+++ b/share/i18n/csmapper/ISO-8859/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/csmapper/ISO646/Makefile.depend b/share/i18n/csmapper/ISO646/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/i18n/csmapper/ISO646/Makefile.depend
+++ b/share/i18n/csmapper/ISO646/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/csmapper/JIS/Makefile.depend b/share/i18n/csmapper/JIS/Makefile.depend
index e027058..e2e5f90 100644
--- a/share/i18n/csmapper/JIS/Makefile.depend
+++ b/share/i18n/csmapper/JIS/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/csmapper/KAZAKH/Makefile.depend b/share/i18n/csmapper/KAZAKH/Makefile.depend
index e027058..e2e5f90 100644
--- a/share/i18n/csmapper/KAZAKH/Makefile.depend
+++ b/share/i18n/csmapper/KAZAKH/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/csmapper/KOI/Makefile.depend b/share/i18n/csmapper/KOI/Makefile.depend
index e027058..e2e5f90 100644
--- a/share/i18n/csmapper/KOI/Makefile.depend
+++ b/share/i18n/csmapper/KOI/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/csmapper/KS/Makefile.depend b/share/i18n/csmapper/KS/Makefile.depend
index e027058..e2e5f90 100644
--- a/share/i18n/csmapper/KS/Makefile.depend
+++ b/share/i18n/csmapper/KS/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/csmapper/MISC/Makefile.depend b/share/i18n/csmapper/MISC/Makefile.depend
index e027058..e2e5f90 100644
--- a/share/i18n/csmapper/MISC/Makefile.depend
+++ b/share/i18n/csmapper/MISC/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/csmapper/Makefile.depend b/share/i18n/csmapper/Makefile.depend
index d291e41..a969dcd 100644
--- a/share/i18n/csmapper/Makefile.depend
+++ b/share/i18n/csmapper/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/csmapper/TCVN/Makefile.depend b/share/i18n/csmapper/TCVN/Makefile.depend
index e027058..e2e5f90 100644
--- a/share/i18n/csmapper/TCVN/Makefile.depend
+++ b/share/i18n/csmapper/TCVN/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/esdb/APPLE/Makefile.depend b/share/i18n/esdb/APPLE/Makefile.depend
index 605ed3d..0f8bc72 100644
--- a/share/i18n/esdb/APPLE/Makefile.depend
+++ b/share/i18n/esdb/APPLE/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/esdb/AST/Makefile.depend b/share/i18n/esdb/AST/Makefile.depend
index 605ed3d..0f8bc72 100644
--- a/share/i18n/esdb/AST/Makefile.depend
+++ b/share/i18n/esdb/AST/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/esdb/BIG5/Makefile.depend b/share/i18n/esdb/BIG5/Makefile.depend
index 605ed3d..0f8bc72 100644
--- a/share/i18n/esdb/BIG5/Makefile.depend
+++ b/share/i18n/esdb/BIG5/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/esdb/CP/Makefile.depend b/share/i18n/esdb/CP/Makefile.depend
index 605ed3d..0f8bc72 100644
--- a/share/i18n/esdb/CP/Makefile.depend
+++ b/share/i18n/esdb/CP/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/esdb/DEC/Makefile.depend b/share/i18n/esdb/DEC/Makefile.depend
index 605ed3d..0f8bc72 100644
--- a/share/i18n/esdb/DEC/Makefile.depend
+++ b/share/i18n/esdb/DEC/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/esdb/EBCDIC/Makefile.depend b/share/i18n/esdb/EBCDIC/Makefile.depend
index 605ed3d..0f8bc72 100644
--- a/share/i18n/esdb/EBCDIC/Makefile.depend
+++ b/share/i18n/esdb/EBCDIC/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/esdb/EUC/Makefile.depend b/share/i18n/esdb/EUC/Makefile.depend
index 605ed3d..0f8bc72 100644
--- a/share/i18n/esdb/EUC/Makefile.depend
+++ b/share/i18n/esdb/EUC/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/esdb/GB/Makefile.depend b/share/i18n/esdb/GB/Makefile.depend
index 605ed3d..0f8bc72 100644
--- a/share/i18n/esdb/GB/Makefile.depend
+++ b/share/i18n/esdb/GB/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/esdb/GEORGIAN/Makefile.depend b/share/i18n/esdb/GEORGIAN/Makefile.depend
index 605ed3d..0f8bc72 100644
--- a/share/i18n/esdb/GEORGIAN/Makefile.depend
+++ b/share/i18n/esdb/GEORGIAN/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/esdb/ISO-2022/Makefile.depend b/share/i18n/esdb/ISO-2022/Makefile.depend
index 605ed3d..0f8bc72 100644
--- a/share/i18n/esdb/ISO-2022/Makefile.depend
+++ b/share/i18n/esdb/ISO-2022/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/esdb/ISO-8859/Makefile.depend b/share/i18n/esdb/ISO-8859/Makefile.depend
index 605ed3d..0f8bc72 100644
--- a/share/i18n/esdb/ISO-8859/Makefile.depend
+++ b/share/i18n/esdb/ISO-8859/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/esdb/ISO646/Makefile.depend b/share/i18n/esdb/ISO646/Makefile.depend
index 605ed3d..0f8bc72 100644
--- a/share/i18n/esdb/ISO646/Makefile.depend
+++ b/share/i18n/esdb/ISO646/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/esdb/KAZAKH/Makefile.depend b/share/i18n/esdb/KAZAKH/Makefile.depend
index 605ed3d..0f8bc72 100644
--- a/share/i18n/esdb/KAZAKH/Makefile.depend
+++ b/share/i18n/esdb/KAZAKH/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/esdb/KOI/Makefile.depend b/share/i18n/esdb/KOI/Makefile.depend
index 605ed3d..0f8bc72 100644
--- a/share/i18n/esdb/KOI/Makefile.depend
+++ b/share/i18n/esdb/KOI/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/esdb/MISC/Makefile.depend b/share/i18n/esdb/MISC/Makefile.depend
index 605ed3d..0f8bc72 100644
--- a/share/i18n/esdb/MISC/Makefile.depend
+++ b/share/i18n/esdb/MISC/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/esdb/Makefile.depend b/share/i18n/esdb/Makefile.depend
index 5bc8b12..d4f32a8 100644
--- a/share/i18n/esdb/Makefile.depend
+++ b/share/i18n/esdb/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/esdb/TCVN/Makefile.depend b/share/i18n/esdb/TCVN/Makefile.depend
index 605ed3d..0f8bc72 100644
--- a/share/i18n/esdb/TCVN/Makefile.depend
+++ b/share/i18n/esdb/TCVN/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/i18n/esdb/UTF/Makefile.depend b/share/i18n/esdb/UTF/Makefile.depend
index 605ed3d..0f8bc72 100644
--- a/share/i18n/esdb/UTF/Makefile.depend
+++ b/share/i18n/esdb/UTF/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/man/man1/Makefile.depend b/share/man/man1/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/man/man1/Makefile.depend
+++ b/share/man/man1/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/man/man3/Makefile.depend b/share/man/man3/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/man/man3/Makefile.depend
+++ b/share/man/man3/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/man/man3/pthread_setspecific.3 b/share/man/man3/pthread_setspecific.3
index 1ea3002..3153c99 100644
--- a/share/man/man3/pthread_setspecific.3
+++ b/share/man/man3/pthread_setspecific.3
@@ -67,7 +67,10 @@ is undefined.
The
.Fn pthread_setspecific
function may be called from a thread-specific data destructor function,
-however this may result in lost storage or infinite loops.
+however this may result in lost storage or infinite loops if doing so
+causes non-NULL key values to remain after
+.Bq PTHREAD_DESTRUCTOR_ITERATIONS
+iterations of destructor calls have been made.
.Sh RETURN VALUES
If successful, the
.Fn pthread_setspecific
diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile
index 4291e7a..b21002a 100644
--- a/share/man/man4/Makefile
+++ b/share/man/man4/Makefile
@@ -192,6 +192,7 @@ MAN= aac.4 \
icmp6.4 \
ida.4 \
ifmib.4 \
+ ig4.4 \
igb.4 \
igmp.4 \
iic.4 \
@@ -868,6 +869,7 @@ MAN+= \
ufoma.4 \
uftdi.4 \
ugen.4 \
+ ugold.4 \
uhci.4 \
uhid.4 \
uhso.4 \
diff --git a/share/man/man4/Makefile.depend b/share/man/man4/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/man/man4/Makefile.depend
+++ b/share/man/man4/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/man/man4/bwn.4 b/share/man/man4/bwn.4
index 3dc43b4..cc27d8f 100644
--- a/share/man/man4/bwn.4
+++ b/share/man/man4/bwn.4
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 15, 2011
+.Dd June 11, 2015
.Dt BWN 4
.Os
.Sh NAME
@@ -69,8 +69,12 @@ The
port needs to be installed before
.Xr ifconfig 8
will work.
-Most cases you need to use bwn_v4_ucode module but if you are a
-LP (low power) PHY user please uses bwn_v4_lp_ucode module.
+In most cases the
+.Pa bwn_v4_ucode
+kernel module from the port should be used.
+However, if an LP (low power) PHY is being used, the
+.Pa bwn_v4_lp_ucode
+module should be used.
.Sh HARDWARE
The
.Nm
diff --git a/share/man/man4/em.4 b/share/man/man4/em.4
index ab50ab1..aa0db1a 100644
--- a/share/man/man4/em.4
+++ b/share/man/man4/em.4
@@ -45,6 +45,14 @@ kernel configuration file:
.Cd "device em"
.Ed
.Pp
+Optional multiqueue support is available via the following kernel
+compile options:
+.Bd -ragged -offset indent
+.Cd "options EM_MULTIQUEUE"
+.Ed
+.Pp
+Note: Activating EM_MULTIQUEUE support is not supported by Intel.
+.Pp
Alternatively, to load the driver as a
module at boot time, place the following line in
.Xr loader.conf 5 :
@@ -197,6 +205,18 @@ Tunables can be set at the
prompt before booting the kernel or stored in
.Xr loader.conf 5 .
.Bl -tag -width indent
+.It Va hw.em.eee_setting
+Disable or enable Energy Efficient Ethernet.
+Default 1 (disabled).
+.It Va hw.em.msix
+Enable or disable MSI-X style interrupts.
+Default 1 (enabled).
+.It Va hw.em.smart_pwr_down
+Enable or disable smart power down features on newer adapters.
+Default 0 (disabled).
+.It Va hw.em.sbp
+Show bad packets when in promiscuous mode.
+Default 0 (off).
.It Va hw.em.rxd
Number of receive descriptors allocated by the driver.
The default value is 1024 for adapters newer than 82547,
@@ -228,6 +248,11 @@ If
.Va hw.em.tx_int_delay
is non-zero, this tunable limits the maximum delay in which a transmit
interrupt is generated.
+.It Va hw.em.num_queues
+Number of hardware queues that will be configured on this adapter (maximum of 2)
+Defaults to 1.
+Only valid with kernel configuration
+.Cd "options EM_MULTIQUEUE".
.El
.Sh FILES
.Bl -tag -width /dev/led/em*
@@ -287,3 +312,5 @@ You can enable it on an
.Nm
interface using
.Xr ifconfig 8 .
+.Pp
+Activating EM_MULTIQUEUE support requires MSI-X features.
diff --git a/share/man/man4/geom.4 b/share/man/man4/geom.4
index 8f42f1b..05d4839 100644
--- a/share/man/man4/geom.4
+++ b/share/man/man4/geom.4
@@ -34,7 +34,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 10, 2013
+.Dd June 8, 2015
.Dt GEOM 4
.Os
.Sh NAME
@@ -52,12 +52,14 @@
.Cd options GEOM_JOURNAL
.Cd options GEOM_LABEL
.Cd options GEOM_LINUX_LVM
+.Cd options GEOM_MAP
.Cd options GEOM_MBR
.Cd options GEOM_MIRROR
.Cd options GEOM_MULTIPATH
.Cd options GEOM_NOP
.Cd options GEOM_PART_APM
.Cd options GEOM_PART_BSD
+.Cd options GEOM_PART_BSD64
.Cd options GEOM_PART_EBR
.Cd options GEOM_PART_EBR_COMPAT
.Cd options GEOM_PART_GPT
@@ -71,6 +73,7 @@
.Cd options GEOM_SHSEC
.Cd options GEOM_STRIPE
.Cd options GEOM_SUNLABEL
+.Cd options GEOM_UNCOMPRESS
.Cd options GEOM_UZIP
.Cd options GEOM_VIRSTOR
.Cd options GEOM_VOL
diff --git a/share/man/man4/geom_map.4 b/share/man/man4/geom_map.4
index 51b15c7..47b2aa8 100644
--- a/share/man/man4/geom_map.4
+++ b/share/man/man4/geom_map.4
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 17, 2011
+.Dd June 8, 2015
.Dt GEOM_MAP 4
.Os
.Sh NAME
@@ -36,7 +36,7 @@ To compile this driver into the kernel,
place the following line in your
kernel configuration file:
.Bd -ragged -offset indent
-.Cd "device geom_map"
+.Cd "options geom_map"
.Ed
.Sh DESCRIPTION
The
diff --git a/share/man/man4/gre.4 b/share/man/man4/gre.4
index b8b47b1..1b99e4d 100644
--- a/share/man/man4/gre.4
+++ b/share/man/man4/gre.4
@@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 7, 2014
+.Dd June 2, 2015
.Dt GRE 4
.Os
.Sh NAME
@@ -117,6 +117,44 @@ ifconfig greN inet 192.168.2.1 192.168.1.1
ifconfig greN inet tunnel B A
route add -net 192.168.1 -netmask 255.255.255.0 192.168.1.1
.Ed
+.Pp
+In case when internal and external IP addresses are the same,
+different routing tables (FIB) should be used.
+The default FIB will be applied to IP packets before GRE encapsulation.
+After encapsulation GRE interface should set different FIB number to
+outgoing packet.
+Then different FIB will be applied to such encapsulated packets.
+According to this FIB packet should be routed to tunnel endpoint.
+.Bd -literal
+Host X -- Host A (198.51.100.1) ---tunnel--- Cisco D (203.0.113.1) -- Host E
+ \\ /
+ \\ /
+ +----- Host B ----- Host C -----+
+ (198.51.100.254)
+.Ed
+.Pp
+On Host A (FreeBSD):
+.Pp
+First of multiple FIBs should be configured via loader.conf:
+.Bd -literal -offset indent
+net.fibs=2
+net.add_addr_allfibs=0
+.Ed
+.Pp
+Then routes to the gateway and remote tunnel endpoint via this gateway
+should be added to the second FIB:
+.Bd -literal -offset indent
+route add -net 198.51.100.0 -netmask 255.255.255.0 -fib 1 -iface em0
+route add -host 203.0.113.1 -fib 1 198.51.100.254
+.Ed
+.Pp
+And GRE tunnel should be configured to change FIB for encapsulated packets:
+.Bd -literal -offset indent
+ifconfig greN create
+ifconfig greN inet 198.51.100.1 203.0.113.1
+ifconfig greN inet tunnel 198.51.100.1 203.0.113.1 tunnelfib 1
+.Ed
+.Pp
.Sh NOTES
The MTU of
.Nm
diff --git a/share/man/man4/ig4.4 b/share/man/man4/ig4.4
new file mode 100644
index 0000000..d4d7300
--- /dev/null
+++ b/share/man/man4/ig4.4
@@ -0,0 +1,79 @@
+.\" Copyright (c) 2015 Michael Gmelin <freebsd@grem.de>
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd May 30, 2015
+.Dt IG4 4
+.Os
+.Sh NAME
+.Nm ig4
+.Nd Intel(R) fourth generation mobile CPU integrated I2C SMBus driver
+.Sh SYNOPSIS
+To compile this driver into the kernel, place the following lines into
+the kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device ig4"
+.Cd "device smbus"
+.Ed
+.Pp
+Alternatively, to load the driver as a module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+ig4_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides access to peripherals attached to an I2C SMB controller.
+.Nm
+supports the SMBus controller found in fourth generation Intel(R) Core(TM)
+processors based on the mobile U-processor line for intelligent systems.
+This includes the i7-4650U, i5-4300U, i3-4010U, and 2980U.
+.Sh SYSCTL VARIABLES
+These
+.Xr sysctl 8
+variables are available:
+.Bl -tag -width "debug.ig4_dump"
+.It Va debug.ig4_dump
+Setting this to a non-zero value dumps controller registers to console and
+syslog once.
+The sysctl resets to zero immediately.
+.El
+.Sh SEE ALSO
+.Xr smb 4 ,
+.Xr smbus 4
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was written for DragonFly BSD by
+.An Matthew Dillon
+and subsequently ported to
+.Fx
+by
+.An Michael Gmelin Aq Mt freebsd@grem.de .
+.Pp
+This manual page was written by
+.An Michael Gmelin Aq Mt freebsd@grem.de .
diff --git a/share/man/man4/man4.arm/Makefile.depend b/share/man/man4/man4.arm/Makefile.depend
index 29fda55..3af2d7f 100644
--- a/share/man/man4/man4.arm/Makefile.depend
+++ b/share/man/man4/man4.arm/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/share/man/man4/man4.i386/Makefile.depend b/share/man/man4/man4.i386/Makefile.depend
index 29fda55..3af2d7f 100644
--- a/share/man/man4/man4.i386/Makefile.depend
+++ b/share/man/man4/man4.i386/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/share/man/man4/man4.powerpc/Makefile.depend b/share/man/man4/man4.powerpc/Makefile.depend
index 29fda55..3af2d7f 100644
--- a/share/man/man4/man4.powerpc/Makefile.depend
+++ b/share/man/man4/man4.powerpc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/share/man/man4/man4.sparc64/Makefile.depend b/share/man/man4/man4.sparc64/Makefile.depend
index 29fda55..3af2d7f 100644
--- a/share/man/man4/man4.sparc64/Makefile.depend
+++ b/share/man/man4/man4.sparc64/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/share/man/man4/sfxge.4 b/share/man/man4/sfxge.4
index c745368..462b620 100644
--- a/share/man/man4/sfxge.4
+++ b/share/man/man4/sfxge.4
@@ -1,26 +1,30 @@
-.\" Copyright (c) 2011 Solarflare Communications, Inc.
+.\" Copyright (c) 2011-2015 Solarflare Communications Inc.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
+.\" modification, are permitted provided that the following conditions are met:
.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
+.\" 1. Redistributions of source code must retain the above copyright notice,
+.\" this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright notice,
+.\" this list of conditions and the following disclaimer in the documentation
+.\" and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+.\" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+.\" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+.\" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+.\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+.\" OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+.\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" The views and conclusions contained in the software and documentation are
+.\" those of the authors and should not be interpreted as representing official
+.\" policies, either expressed or implied, of the FreeBSD Project.
.\"
.\" $FreeBSD$
.\"
@@ -116,6 +120,9 @@ If a packet is dropped, the
.Va tx_put_overflow
counter is incremented and the local sender receives ENOBUFS.
The value must be greater than or equal to 0.
+.It Va hw.sfxge.tso_fw_assisted
+Enable/disable usage of FW-assisted TSO if supported by NIC firmware.
+Enabled by default.
.It Va hw.sfxge.N.max_rss_channels
The maximum number of allocated RSS channels for the Nth adapter.
If set to 0 or unset, the number of channels is determined by the number
diff --git a/share/man/man4/ugold.4 b/share/man/man4/ugold.4
new file mode 100644
index 0000000..f75440d
--- /dev/null
+++ b/share/man/man4/ugold.4
@@ -0,0 +1,60 @@
+.\" $OpenBSD: ugold.4,v 1.1 2013/09/06 08:39:39 mpi Exp $
+.\"
+.\" Copyright (c) 2013 Takayoshi SASANO <sasano@openbsd.org>
+.\" Copyright (c) 2013 Martin Pieuchot <mpi@openbsd.org>
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd June 11, 2015
+.Dt UGOLD 4
+.Os
+.Sh NAME
+.Nm ugold
+.Nd TEMPer gold HID thermometer
+.Sh SYNOPSIS
+To compile this driver into the kernel, place the following lines into
+your kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device usb"
+.Cd "device ugold"
+.Ed
+.Pp
+Alternatively, to load the driver as a module at boot time,
+place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+ugold_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for pcsensors TEMPer gold devices.
+.Pp
+The driver possesses a collection of sensor values which are
+made available through the
+.Xr sysctl 8
+interface.
+.Sh HARDWARE
+The following devices are supported by the
+.Nm
+driver:
+.Pp
+.Bl -bullet -compact
+.It
+RDing TEMPer1V1.2
+.El
+.Sh SEE ALSO
+.Xr usb 4 ,
+.Xr sysctl 8
diff --git a/share/man/man5/Makefile.depend b/share/man/man5/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/man/man5/Makefile.depend
+++ b/share/man/man5/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5
index 13e8655..cca7ea2 100644
--- a/share/man/man5/src.conf.5
+++ b/share/man/man5/src.conf.5
@@ -1,7 +1,7 @@
.\" DO NOT EDIT-- this file is automatically generated.
.\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des
.\" $FreeBSD$
-.Dd April 19, 2015
+.Dd June 11, 2015
.Dt SRC.CONF 5
.Os
.Sh NAME
@@ -226,7 +226,7 @@ When set, it also enforces the following options:
Set to not build the Clang C/C++ compiler during the regular phase of the build.
.Pp
It is a default setting on
-arm/armeb, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64.
+mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64.
When set, it also enforces the following options:
.Pp
.Bl -item -compact
@@ -240,7 +240,7 @@ When set, it also enforces the following options:
Set to build the Clang C/C++ compiler during the normal phase of the build.
.Pp
It is a default setting on
-amd64/amd64, arm/arm, arm/armv6, arm/armv6hf, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64.
+amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv6hf, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64.
.It Va WITHOUT_CLANG_BOOTSTRAP
.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_BOOTSTRAP 273177 2014-10-16 18:28:11Z skreuzer
Set to not build the Clang C/C++ compiler during the bootstrap phase of the build.
@@ -249,13 +249,13 @@ unless an alternative compiler is provided via
XCC.
.Pp
It is a default setting on
-arm/armeb, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64.
+mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64.
.It Va WITH_CLANG_BOOTSTRAP
.\" from FreeBSD: head/tools/build/options/WITH_CLANG_BOOTSTRAP 264660 2014-04-18 17:03:58Z imp
Set to build the Clang C/C++ compiler during the bootstrap phase of the build.
.Pp
It is a default setting on
-amd64/amd64, arm/arm, arm/armv6, arm/armv6hf, i386/i386 and pc98/i386.
+amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv6hf, i386/i386 and pc98/i386.
.It Va WITH_CLANG_EXTRAS
.\" from FreeBSD: head/tools/build/options/WITH_CLANG_EXTRAS 231057 2012-02-05 23:56:22Z dim
Set to build additional clang and llvm tools, such as bugpoint.
@@ -282,7 +282,7 @@ and
.Pa /usr/bin/cpp .
.Pp
It is a default setting on
-arm/armeb, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64.
+mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64.
.It Va WITH_CLANG_IS_CC
.\" from FreeBSD: head/tools/build/options/WITH_CLANG_IS_CC 235342 2012-05-12 16:12:36Z gjb
Set to install the Clang C/C++ compiler as
@@ -292,7 +292,7 @@ and
.Pa /usr/bin/cpp .
.Pp
It is a default setting on
-amd64/amd64, arm/arm, arm/armv6, arm/armv6hf, i386/i386 and pc98/i386.
+amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv6hf, i386/i386 and pc98/i386.
.It Va WITHOUT_CPP
.\" from FreeBSD: head/tools/build/options/WITHOUT_CPP 156932 2006-03-21 07:50:50Z ru
Set to not build
@@ -494,13 +494,13 @@ Set to not build games.
Set to not build and install gcc and g++ as part of the normal build process.
.Pp
It is a default setting on
-amd64/amd64, arm/arm, arm/armv6, arm/armv6hf, i386/i386 and pc98/i386.
+amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv6hf, i386/i386 and pc98/i386.
.It Va WITH_GCC
.\" from FreeBSD: head/tools/build/options/WITH_GCC 255326 2013-09-06 20:49:48Z zeising
Set to build and install gcc and g++.
.Pp
It is a default setting on
-arm/armeb, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64.
+mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64.
.It Va WITHOUT_GCC_BOOTSTRAP
.\" from FreeBSD: head/tools/build/options/WITHOUT_GCC_BOOTSTRAP 273177 2014-10-16 18:28:11Z skreuzer
Set to not build gcc and g++ as part of the bootstrap process.
@@ -509,13 +509,13 @@ unless an alternative compiler is provided via
XCC.
.Pp
It is a default setting on
-amd64/amd64, arm/arm, arm/armv6, arm/armv6hf, i386/i386 and pc98/i386.
+amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv6hf, i386/i386 and pc98/i386.
.It Va WITH_GCC_BOOTSTRAP
.\" from FreeBSD: head/tools/build/options/WITH_GCC_BOOTSTRAP 264660 2014-04-18 17:03:58Z imp
Set to build gcc and g++ as part of the bootstrap process.
.Pp
It is a default setting on
-arm/armeb, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64.
+mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64.
.It Va WITHOUT_GCOV
.\" from FreeBSD: head/tools/build/options/WITHOUT_GCOV 156932 2006-03-21 07:50:50Z ru
Set to not build the
@@ -545,14 +545,14 @@ Do not build the GNU C++ stack (g++, libstdc++).
This is the default on platforms where clang is the system compiler.
.Pp
It is a default setting on
-amd64/amd64, arm/arm, arm/armv6, arm/armv6hf, i386/i386 and pc98/i386.
+amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv6hf, i386/i386 and pc98/i386.
.It Va WITH_GNUCXX
.\" from FreeBSD: head/tools/build/options/WITH_GNUCXX 255321 2013-09-06 20:08:03Z theraven
Build the GNU C++ stack (g++, libstdc++).
This is the default on platforms where gcc is the system compiler.
.Pp
It is a default setting on
-arm/armeb, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64.
+mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64.
.It Va WITHOUT_GNU_GREP_COMPAT
.\" from FreeBSD: head/tools/build/options/WITHOUT_GNU_GREP_COMPAT 273421 2014-10-21 20:44:33Z emaste
Set this option to omit the gnu extensions to grep from being included in
@@ -834,6 +834,13 @@ is set explicitly)
.\" from FreeBSD: head/tools/build/options/WITHOUT_MANCOMPRESS 266752 2014-05-27 15:52:27Z gjb
Set to not to install compressed man pages.
Only the uncompressed versions will be installed.
+.It Va WITHOUT_MANDOCDB
+.\" from FreeBSD: head/tools/build/options/WITHOUT_MANDOCDB 283777 2015-05-30 17:41:37Z bapt
+Use the
+.Xr mandoc 1
+version of
+.Xr makewhatis 8
+database and utilities.
.It Va WITHOUT_MAN_UTILS
.\" from FreeBSD: head/tools/build/options/WITHOUT_MAN_UTILS 208322 2010-05-20 00:07:21Z jkim
Set to not build utilities for manual pages,
diff --git a/share/man/man6/Makefile.depend b/share/man/man6/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/man/man6/Makefile.depend
+++ b/share/man/man6/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/man/man7/Makefile.depend b/share/man/man7/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/man/man7/Makefile.depend
+++ b/share/man/man7/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/man/man8/Makefile b/share/man/man8/Makefile
index 2b803b6..dc119b5 100644
--- a/share/man/man8/Makefile
+++ b/share/man/man8/Makefile
@@ -13,7 +13,9 @@ MAN= crash.8 \
${_uefi.8} \
yp.8
-MLINKS= rc.8 rc.atm.8 \
+MLINKS= \
+ nanobsd.8 nanobsd.sh.8 \
+ rc.8 rc.atm.8 \
rc.8 rc.d.8 \
rc.8 rc.firewall.8 \
rc.8 rc.local.8 \
diff --git a/share/man/man8/Makefile.depend b/share/man/man8/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/man/man8/Makefile.depend
+++ b/share/man/man8/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index 11dcb01..d0e204f 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -195,10 +195,10 @@ MAN= accept_filter.9 \
p_candebug.9 \
p_cansee.9 \
pci.9 \
- PCI_ADD_VF.9 \
- PCI_INIT_IOV.9 \
+ PCI_IOV_ADD_VF.9 \
+ PCI_IOV_INIT.9 \
pci_iov_schema.9 \
- PCI_UNINIT_IOV.9 \
+ PCI_IOV_UNINIT.9 \
pfil.9 \
pfind.9 \
pget.9 \
diff --git a/share/man/man9/Makefile.depend b/share/man/man9/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/man/man9/Makefile.depend
+++ b/share/man/man9/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/man/man9/PCI_ADD_VF.9 b/share/man/man9/PCI_IOV_ADD_VF.9
index 72a3a97..d99a106 100644
--- a/share/man/man9/PCI_ADD_VF.9
+++ b/share/man/man9/PCI_IOV_ADD_VF.9
@@ -25,38 +25,37 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 24, 2014
-.Dt PCI_ADD_VF 9
+.Dd May 28, 2015
+.Dt PCI_IOV_ADD_VF 9
.Os
.Sh NAME
-.Nm PCI_ADD_VF
+.Nm PCI_IOV_ADD_VF
.Nd inform a PF driver that a VF is being created
.Sh SYNOPSIS
.In sys/bus.h
.In machine/stdarg.h
.In sys/nv.h
-.In dev/pci/pcireg.h
-.In dev/pci/pcivar.h
+.In dev/pci/pci_iov.h
.Ft int
-.Fn PCI_ADD_VF "device_t dev" "uint16_t vfnum" "const nvlist_t *vf_config"
+.Fn PCI_IOV_ADD_VF "device_t dev" "uint16_t vfnum" "const nvlist_t *vf_config"
.Sh DESCRIPTION
The
-.Fn PCI_ADD_VF
+.Fn PCI_IOV_ADD_VF
method is called by the PCI Single-Root I/O Virtualization
.Pq SR-IOV
infrastructure when it is initializating a new Virtual Function (VF) as a child
of the given Physical Function (PF) device.
This method will not be called until a successful call to
-.Xr PCI_INIT_IOV 9
+.Xr PCI_IOV_INIT 9
has been made.
It is not guaranteed that this method will be called following a successful call
to
-.Xr PCI_INIT_IOV 9 .
+.Xr PCI_IOV_INIT 9 .
If the infrastructure encounters a failure to allocate resources following the
call to
-.Xr PCI_INIT_IOV 9 ,
+.Xr PCI_IOV_INIT 9 ,
the VF creation will be aborted and
-.Xr PCI_UNINIT_IOV 9
+.Xr PCI_IOV_UNINIT 9
will be called immediately without any preceding calls to
.Nm .
.Pp
@@ -87,15 +86,15 @@ Note that it is possible for the user to set different configuration values on
different VF devices that are children of the same PF.
The PF driver must not cache configuration parameters passed in previous calls
to
-.Fn PCI_ADD_VF
+.Fn PCI_IOV_ADD_VF
for other VFs and apply those parameters to the current VF.
.Pp
This function will not be called twice for the same
.Fa vf_num
on the same PF device without
-.Xr PCI_UNINIT_IOV 9
+.Xr PCI_IOV_UNINIT 9
and
-.Xr PCI_INIT_IOV 9
+.Xr PCI_IOV_INIT 9
first being called, in that order.
.Sh RETURN VALUES
This method returns 0 on success, otherwise an appropriate error is returned.
@@ -106,8 +105,8 @@ the PF.
.Xr nv 9 ,
.Xr pci 9 ,
.Xr pci_iov_schema 9 ,
-.Xr PCI_INIT_IOV 9 ,
-.Xr PCI_UNINIT_IOV 9
+.Xr PCI_IOV_INIT 9 ,
+.Xr PCI_IOV_UNINIT 9
.Sh AUTHORS
This manual page was written by
.An Ryan Stone Aq Mt rstone@FreeBSD.org .
diff --git a/share/man/man9/PCI_INIT_IOV.9 b/share/man/man9/PCI_IOV_INIT.9
index 1c8c64e..f9daa24 100644
--- a/share/man/man9/PCI_INIT_IOV.9
+++ b/share/man/man9/PCI_IOV_INIT.9
@@ -25,23 +25,22 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 24, 2014
-.Dt PCI_INIT_IOV 9
+.Dd May 28, 2015
+.Dt PCI_IOV_INIT 9
.Os
.Sh NAME
-.Nm PCI_INIT_IOV
+.Nm PCI_IOV_INIT
.Nd enable SR-IOV on a PF device
.Sh SYNOPSIS
.In sys/bus.h
.In machine/stdarg.h
.In sys/nv.h
-.In dev/pci/pcireg.h
-.In dev/pci/pcivar.h
+.In dev/pci/pci_iov.h
.Ft int
-.Fn PCI_INIT_IOV "device_t dev" "uint16_t num_vfs" "const nvlist_t *pf_config"
+.Fn PCI_IOV_INIT "device_t dev" "uint16_t num_vfs" "const nvlist_t *pf_config"
.Sh DESCRIPTION
The
-.Fn PCI_INIT_IOV
+.Fn PCI_IOV_INIT
method is called by the PCI Single-Root I/O Virtualization (SR-IOV)
infrastucture when the user requests that SR-IOV be enabled on a Physical
Function (PF).
@@ -70,7 +69,7 @@ valid values specified in the schema.
.Pp
If this method returns successfully, then this method will not be called again
on the same device until after a call to
-.Xr PCI_UNINIT_IOV .
+.Xr PCI_IOV_UNINIT .
.Sh RETURN VALUES
Returns 0 on success, otherwise an appropriate error is returned.
If this method returns an error then the SR-IOV configuration will be aborted
@@ -79,8 +78,8 @@ and no VFs will be created.
.Xr nv 9 ,
.Xr pci 9 ,
.Xr pci_iov_schema 9 ,
-.Xr PCI_ADD_VF 9 ,
-.Xr PCI_UNINIT_IOV 9
+.Xr PCI_IOV_ADD_VF 9 ,
+.Xr PCI_IOV_UNINIT 9
.Sh AUTHORS
This manual page was written by
.An Ryan Stone Aq Mt rstone@FreeBSD.org .
diff --git a/share/man/man9/PCI_UNINIT_IOV.9 b/share/man/man9/PCI_IOV_UNINIT.9
index fc4cc85..b95914e 100644
--- a/share/man/man9/PCI_UNINIT_IOV.9
+++ b/share/man/man9/PCI_IOV_UNINIT.9
@@ -25,21 +25,20 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 24, 2014
-.Dt PCI_UNINIT_IOV 9
+.Dd May 28, 2015
+.Dt PCI_IOV_UNINIT 9
.Os
.Sh NAME
-.Nm PCI_UNINIT_IOV
+.Nm PCI_IOV_UNINIT
.Nd disable SR-IOV on a PF device
.Sh SYNOPSIS
.In sys/bus.h
-.In dev/pci/pcireg.h
-.In dev/pci/pcivar.h
+.In dev/pci/pci_iov.h
.Ft void
-.Fn PCI_UNINIT_IOV "device_t dev"
+.Fn PCI_IOV_UNINIT "device_t dev"
.Sh DESCRIPTION
The
-.Fn PCI_UNINIT_IOV
+.Fn PCI_IOV_UNINIT
method is called by the PCI Single-Root I/O Virtualization (SR-IOV)
infrastructure when the user requests that SR-IOV be disabled on a Physical
Function (PF).
@@ -48,17 +47,17 @@ resources that it has allocated and disable any device-specific SR-IOV
configuration in the device.
.Pp
This method will only be called following a successful call to
-.Xr PCI_INIT_IOV .
+.Xr PCI_IOV_INIT .
It is not guaranteed that
-.Xr PCI_ADD_VF
+.Xr PCI_IOV_ADD_VF
will have been called for any Virtual Function (VF) after the call to
-.Xr PCI_INIT_IOV
+.Xr PCI_IOV_INIT
and before the call to
.Nm .
.Sh SEE ALSO
.Xr pci 9 ,
-.Xr PCI_ADD_VF 9 ,
-.Xr PCI_INIT_IOV 9
+.Xr PCI_IOV_ADD_VF 9 ,
+.Xr PCI_IOV_INIT 9
.Sh AUTHORS
This manual page was written by
.An Ryan Stone Aq Mt rstone@FreeBSD.org .
diff --git a/share/man/man9/pci.9 b/share/man/man9/pci.9
index a33d2ed..14500b5 100644
--- a/share/man/man9/pci.9
+++ b/share/man/man9/pci.9
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 24, 2014
+.Dd May 28, 2015
.Dt PCI 9
.Os
.Sh NAME
@@ -97,10 +97,6 @@
.Ft int
.Fn pci_get_vpd_readonly "device_t dev" "const char *kw" "const char **vptr"
.Ft int
-.Fn pci_iov_attach "device_t dev" "nvlist_t *pf_schema" "nvlist_t *vf_schema"
-.Ft int
-.Fn pci_iov_detach "device_t dev"
-.Ft int
.Fn pci_msi_count "device_t dev"
.Ft int
.Fn pci_msix_count "device_t dev"
@@ -122,6 +118,11 @@
.Fn pci_set_powerstate "device_t dev" "int state"
.Ft void
.Fn pci_write_config "device_t dev" "int reg" "uint32_t val" "int width"
+.In dev/pci/pci_iov.h
+.Ft int
+.Fn pci_iov_attach "device_t dev" "nvlist_t *pf_schema" "nvlist_t *vf_schema"
+.Ft int
+.Fn pci_iov_detach "device_t dev"
.Sh DESCRIPTION
The
.Nm
@@ -446,10 +447,10 @@ function is used to advertise that the given device
supports PCI Single-Root I/O Virtualization
.Po SR-IOV Pc .
A driver that supports SR-IOV must implement the
-.Xr PCI_INIT_IOV 9 ,
-.Xr PCI_ADD_VF 9
+.Xr PCI_IOV_INIT 9 ,
+.Xr PCI_IOV_ADD_VF 9
and
-.Xr PCI_UNIT_IOV 9
+.Xr PCI_IOV_UNINIT 9
methods.
This function should be called during the
.Xr DEVICE_ATTACH 9
diff --git a/share/man/man9/pci_iov_schema.9 b/share/man/man9/pci_iov_schema.9
index f2f1f30..36c0189 100644
--- a/share/man/man9/pci_iov_schema.9
+++ b/share/man/man9/pci_iov_schema.9
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 25, 2014
+.Dd May 28, 2015
.Dt pci_iov_schema 9
.Os
.Sh NAME
@@ -258,8 +258,8 @@ The
function returns a pointer to the allocated schema, or NULL if a failure occurs.
.Sh SEE ALSO
.Xr pci 9 ,
-.Xr PCI_ADD_VF 9 ,
-.Xr PCI_INIT_IOV 9
+.Xr PCI_IOV_ADD_VF 9 ,
+.Xr PCI_IOV_INIT 9
.Sh AUTHORS
This manual page was written by
.An Ryan Stone Aq rstone@FreeBSD.org .
diff --git a/share/man/man9/sbuf.9 b/share/man/man9/sbuf.9
index f696307..21faf97 100644
--- a/share/man/man9/sbuf.9
+++ b/share/man/man9/sbuf.9
@@ -56,7 +56,8 @@
.Nm sbuf_done ,
.Nm sbuf_delete ,
.Nm sbuf_start_section ,
-.Nm sbuf_end_section
+.Nm sbuf_end_section ,
+.Nm sbuf_hexdump
.Nd safe string composition
.Sh SYNOPSIS
.In sys/types.h
@@ -115,6 +116,14 @@
.Fn sbuf_start_section "struct sbuf *s" "ssize_t *old_lenp"
.Ft ssize_t
.Fn sbuf_end_section "struct sbuf *s" "ssize_t old_len" "size_t pad" "int c"
+.Ft void
+.Fo sbuf_hexdump
+.Fa "struct sbuf *sb"
+.Fa "void *ptr"
+.Fa "int length"
+.Fa "const char *hdr"
+.Fa "int flags"
+.Fc
.In sys/sysctl.h
.Ft struct sbuf *
.Fn sbuf_new_for_sysctl "struct sbuf *s" "char *buf" "int length" "struct sysctl_req *req"
@@ -455,6 +464,14 @@ and \-1 can be specified for
and
.Fa old_len
respectively.
+.Pp
+The
+.Fn sbuf_hexdump
+function prints an array of bytes to the supplied sbuf, along with an ASCII
+representation of the bytes if possible.
+See the
+.Xr hexdump 3
+man page for more details on the interface.
.Sh NOTES
If an operation caused an
.Fa sbuf
@@ -558,6 +575,7 @@ transmit_msg(sbuf_data(sb), sbuf_len(sb));
sbuf_delete(sb);
.Ed
.Sh SEE ALSO
+.Xr hexdump 3 ,
.Xr printf 3 ,
.Xr strcat 3 ,
.Xr strcpy 3 ,
diff --git a/share/man/man9/sleep.9 b/share/man/man9/sleep.9
index bd421ea..469d09f 100644
--- a/share/man/man9/sleep.9
+++ b/share/man/man9/sleep.9
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 19, 2013
+.Dd May 24, 2015
.Dt SLEEP 9
.Os
.Sh NAME
@@ -130,19 +130,6 @@ possible, and
is returned if the system call should be interrupted by the signal
(return
.Er EINTR ) .
-If the
-.Dv PBDRY
-flag is specified in addition to
-.Dv PCATCH ,
-then the sleeping thread is not stopped when
-.Dv SIGSTOP
-becomes pending
-or some other stop action occurs while it is sleeping.
-Instead, it is woken up, with the assumption
-that the stop will occur on reaching a stop
-point when returning to usermode.
-The flag should be used when the sleeping thread owns resources, for instance
-vnode locks, that should be released in a timely fashion.
.Pp
The parameter
.Fa wmesg
diff --git a/share/me/Makefile.depend b/share/me/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/me/Makefile.depend
+++ b/share/me/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/misc/Makefile.depend b/share/misc/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/misc/Makefile.depend
+++ b/share/misc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/misc/committers-ports.dot b/share/misc/committers-ports.dot
index 00e85f7..b007609 100644
--- a/share/misc/committers-ports.dot
+++ b/share/misc/committers-ports.dot
@@ -68,6 +68,7 @@ bf [label="Brendan Fabeny\nbf@FreeBSD.org\n2010/06/02"]
bland [label="Alexander Nedotsukov\nbland@FreeBSD.org\n2003/08/14"]
bmah [label="Bruce A. Mah\nbmah@FreeBSD.org\n2000/08/23"]
bofh [label="Muhammad Moinur Rahman\nbofh@FreeBSD.org\n2014/12/23"]
+brnrd [label="Bernard Spil\nbrnrd@FreeBSD.org\n2015/05/24"]
brix [label="Henrik Brix Andersen\nbrix@FreeBSD.org\n2007/10/31"]
brooks [label="Brooks Davies\nbrooks@FreeBSD.org\n2004/05/03"]
bsam [label="Boris Samorodov\nbsam@FreeBSD.org\n2006/07/20"]
@@ -224,6 +225,7 @@ trociny [label="Mikolaj Golub\ntrociny@FreeBSD.org\n2013/10/17"]
uqs [label="Ulrich Spoerlein\nuqs@FreeBSD.org\n2012/01/19"]
vd [label="Vasil Dimov\nvd@FreeBSD.org\n2006/01/19"]
vg [label="Veniamin Gvozdikov\nvg@FreeBSD.org\n2013/06/11"]
+vsevolod [label="Vsevolod Stakhov\nvsevolod@FreeBSD.org\n2005/07/22"]
wen [label="Wen Heping\nwen@FreeBSD.org\n2010/12/13"]
wg [label="William Grzybowski\nwg@FreeBSD.org\n2013/04/01"]
wxs [label="Wesley Shields\nwxs@FreeBSD.org\n2008/01/03"]
@@ -404,6 +406,7 @@ knu -> maho
knu -> nobutaka
knu -> nork
+koobs -> brnrd
koobs -> kami
koobs -> xmj
@@ -576,6 +579,8 @@ thierry -> riggs
tmclaugh -> itetcu
tmclaugh -> xride
+vsevolod -> brnrd
+
wen -> cs
wen -> culot
wen -> pawel
diff --git a/share/mk/Makefile b/share/mk/Makefile
index ba26cb4..d8aea5c 100644
--- a/share/mk/Makefile
+++ b/share/mk/Makefile
@@ -42,11 +42,14 @@ FILES= \
bsd.test.mk \
dirdeps.mk \
gendirdeps.mk \
+ install-new.mk \
meta.autodep.mk \
meta.stage.mk \
meta.subdir.mk \
meta.sys.mk \
+ stage-install.sh \
sys.mk \
+ sys.dependfile.mk \
version_gen.awk
NO_OBJ=
diff --git a/share/mk/auto.obj.mk b/share/mk/auto.obj.mk
index 7cc094c..0c13ae5 100644
--- a/share/mk/auto.obj.mk
+++ b/share/mk/auto.obj.mk
@@ -1,4 +1,5 @@
-# $Id: auto.obj.mk,v 1.8 2011/08/08 17:35:20 sjg Exp $
+# $FreeBSD$
+# $Id: auto.obj.mk,v 1.10 2015/04/16 16:59:00 sjg Exp $
#
# @(#) Copyright (c) 2004, Simon J. Gerraty
#
@@ -53,11 +54,12 @@ __objdir:= ${__objdir:tA}
__objdir_made != echo ${__objdir}/; umask ${OBJDIR_UMASK:U002}; \
${ECHO_TRACE} "[Creating objdir ${__objdir}...]" >&2; \
${Mkdirs}; Mkdirs ${__objdir}
+__objdir:= ${__objdir:tA}
.endif
# This causes make to use the specified directory as .OBJDIR
.OBJDIR: ${__objdir}
.if ${.OBJDIR} != ${__objdir} && ${__objdir_made:Uno:M${__objdir}/*} != ""
-.error could not use ${__objdir}
+.error could not use ${__objdir}: .OBJDIR=${.OBJDIR}
.endif
.endif
.endif
diff --git a/share/mk/bsd.init.mk b/share/mk/bsd.init.mk
index 1e6979d..3ad29cc 100644
--- a/share/mk/bsd.init.mk
+++ b/share/mk/bsd.init.mk
@@ -9,7 +9,7 @@
.if !target(__<bsd.init.mk>__)
__<bsd.init.mk>__:
.include <bsd.opts.mk>
-.sinclude "local.init.mk"
+.-include "local.init.mk"
.if exists(${.CURDIR}/../Makefile.inc)
.include "${.CURDIR}/../Makefile.inc"
.endif
@@ -20,5 +20,8 @@ __<bsd.init.mk>__:
# this tells lib.mk and prog.mk to not actually build anything
_SKIP_BUILD = not building at level 0
.endif
+.if !empty(_SKIP_BUILD)
+.warning ${_SKIP_BUILD}
+.endif
.endif # !target(__<bsd.init.mk>__)
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index 38fc3c2..f70cc95 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -171,7 +171,7 @@ _LIBS= lib${LIB_PRIVATE}${LIB}.a
lib${LIB_PRIVATE}${LIB}.a: ${OBJS} ${STATICOBJS}
@${ECHO} building static ${LIB} library
@rm -f ${.TARGET}
- @${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD}
+ ${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD}
${RANLIB} ${RANLIBFLAGS} ${.TARGET}
.endif
@@ -185,7 +185,7 @@ NOPATH_FILES+= ${POBJS}
lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS}
@${ECHO} building profiled ${LIB} library
@rm -f ${.TARGET}
- @${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' lorder ${POBJS} | tsort -q` ${ARADD}
+ ${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' lorder ${POBJS} | tsort -q` ${ARADD}
${RANLIB} ${RANLIBFLAGS} ${.TARGET}
.endif
@@ -272,7 +272,7 @@ _LIBS+= lib${LIB_PRIVATE}${LIB}_pic.a
lib${LIB_PRIVATE}${LIB}_pic.a: ${SOBJS}
@${ECHO} building special pic ${LIB} library
@rm -f ${.TARGET}
- @${AR} ${ARFLAGS} ${.TARGET} ${SOBJS} ${ARADD}
+ ${AR} ${ARFLAGS} ${.TARGET} ${SOBJS} ${ARADD}
${RANLIB} ${RANLIBFLAGS} ${.TARGET}
.endif
diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk
index ce69653..88f5196 100644
--- a/share/mk/bsd.opts.mk
+++ b/share/mk/bsd.opts.mk
@@ -68,12 +68,13 @@ __DEFAULT_YES_OPTIONS = \
__DEFAULT_NO_OPTIONS = \
CTF \
DEBUG_FILES \
- INSTALL_AS_USER
+ INSTALL_AS_USER \
+ STALE_STAGED
# meta mode related
__DEFAULT_DEPENDENT_OPTIONS = \
STAGING_MAN/STAGING \
- STAGING_PROG/STAGING
+ STAGING_PROG/STAGING \
.include <bsd.mkopt.mk>
@@ -97,6 +98,10 @@ MK_${var}:=no
.endif
.endfor
+.if ${MK_STAGING} == "no"
+MK_STALE_STAGED= no
+.endif
+
.endif # !_WITHOUT_SRCCONF
.endif
diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk
index d8ce3b4..20c66c4 100644
--- a/share/mk/bsd.own.mk
+++ b/share/mk/bsd.own.mk
@@ -128,8 +128,10 @@ __<bsd.own.mk>__:
.if ${MK_CTF} != "no"
CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.else
+.elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300)
CTFCONVERT_CMD=
+.else
+CTFCONVERT_CMD= @:
.endif
.if ${MK_INSTALL_AS_USER} != "no"
@@ -139,10 +141,9 @@ _uid!= id -u
USER!= id -un
.endif
_gid!= id -g
-_gn!= id -gn
.for x in BIN CONF DOC DTB INFO KMOD LIB MAN NLS SHARE
$xOWN= ${USER}
-$xGRP= ${_gn}
+$xGRP= ${_gid}
.endfor
.endif
.endif
diff --git a/share/mk/dirdeps.mk b/share/mk/dirdeps.mk
index 4aa101f..c3c19d2 100644
--- a/share/mk/dirdeps.mk
+++ b/share/mk/dirdeps.mk
@@ -1,3 +1,4 @@
+# $FreeBSD$
# $Id: dirdeps.mk,v 1.54 2015/06/08 20:55:11 sjg Exp $
# Copyright (c) 2010-2013, Juniper Networks, Inc.
diff --git a/share/mk/gendirdeps.mk b/share/mk/gendirdeps.mk
index 614a20e..f0c177d 100644
--- a/share/mk/gendirdeps.mk
+++ b/share/mk/gendirdeps.mk
@@ -1,3 +1,4 @@
+# $FreeBSD$
# $Id: gendirdeps.mk,v 1.27 2015/06/08 20:55:11 sjg Exp $
# Copyright (c) 2010-2013, Juniper Networks, Inc.
@@ -310,7 +311,7 @@ CAT_DEPEND ?= .depend
# The sed command at the end of the stream, allows for the filters
# to output _{VAR} tokens which we will turn into proper ${VAR} references.
${_DEPENDFILE}: ${CAT_DEPEND:M.depend} ${META_FILES:O:u:@m@${exists($m):?$m:}@} ${_this} ${META2DEPS}
- @(echo '# Autogenerated - do NOT edit!'; echo; \
+ @(${GENDIRDEPS_HEADER} echo '# Autogenerated - do NOT edit!'; echo; \
echo 'DIRDEPS = \'; \
echo '${DIRDEPS:@d@ $d \\${.newline}@}'; echo; \
${_include_src_dirdeps} \
@@ -330,7 +331,7 @@ DIRDEPS := ${SUBDIR:S,^,${RELDIR}/,:O:u}
all: ${_DEPENDFILE}
${_DEPENDFILE}: ${MAKEFILE} ${_this}
- @(echo '# Autogenerated - do NOT edit!'; echo; \
+ @(${GENDIRDEPS_HEADER} echo '# Autogenerated - do NOT edit!'; echo; \
echo 'DIRDEPS = \'; \
echo '${DIRDEPS:@d@ $d \\${.newline}@}'; echo; \
echo '.include <dirdeps.mk>'; \
diff --git a/share/mk/host-target.mk b/share/mk/host-target.mk
index 8430860..754f1ec 100644
--- a/share/mk/host-target.mk
+++ b/share/mk/host-target.mk
@@ -1,5 +1,6 @@
+# $FreeBSD$
# RCSid:
-# $Id: host-target.mk,v 1.6 2011/03/02 05:05:21 sjg Exp $
+# $Id: host-target.mk,v 1.7 2014/05/16 17:54:52 sjg Exp $
# Host platform information; may be overridden
.if !defined(_HOST_OSNAME)
diff --git a/share/mk/install-new.mk b/share/mk/install-new.mk
index ddfff20..469e986 100644
--- a/share/mk/install-new.mk
+++ b/share/mk/install-new.mk
@@ -1,3 +1,4 @@
+# $FreeBSD$
# $Id: install-new.mk,v 1.3 2012/03/24 18:25:49 sjg Exp $
#
# @(#) Copyright (c) 2009, Simon J. Gerraty
diff --git a/share/mk/local.autodep.mk b/share/mk/local.autodep.mk
index a123e9b..8223fec 100644
--- a/share/mk/local.autodep.mk
+++ b/share/mk/local.autodep.mk
@@ -1,3 +1,4 @@
+# $FreeBSD$
.if ${.MAKE.DEPENDFILE:M*.${MACHINE}} == ""
# by default only MACHINE0 does updates
diff --git a/share/mk/local.dirdeps.mk b/share/mk/local.dirdeps.mk
index 3383821..66a59b3 100644
--- a/share/mk/local.dirdeps.mk
+++ b/share/mk/local.dirdeps.mk
@@ -1,3 +1,4 @@
+# $FreeBSD$
.if !target(_DIRDEP_USE)
# we are the 1st makefile
@@ -90,7 +91,6 @@ DIRDEPS += targets/pseudo/stage
.endif
.endif
-CSU_DIR.i386 = csu/i386-elf
DEP_MACHINE_ARCH = ${MACHINE_ARCH.${DEP_MACHINE}}
CSU_DIR.${DEP_MACHINE_ARCH} ?= csu/${DEP_MACHINE_ARCH}
CSU_DIR := ${CSU_DIR.${DEP_MACHINE_ARCH}}
diff --git a/share/mk/local.gendirdeps.mk b/share/mk/local.gendirdeps.mk
index 6bfc5c6..024e1cb 100644
--- a/share/mk/local.gendirdeps.mk
+++ b/share/mk/local.gendirdeps.mk
@@ -1,3 +1,8 @@
+# $FreeBSD$
+
+# we need a keyword, this noise is to prevent it being expanded
+GENDIRDEPS_HEADER= echo '\# ${FreeBSD:L:@v@$$$v$$ @} ';
+
# supress optional/auto dependecies
# local.dirdeps.mk will put them in if necessary
GENDIRDEPS_FILTER+= \
diff --git a/share/mk/local.init.mk b/share/mk/local.init.mk
index c17c957..9298bd5 100644
--- a/share/mk/local.init.mk
+++ b/share/mk/local.init.mk
@@ -1,3 +1,4 @@
+# $FreeBSD$
.include "src.opts.mk"
diff --git a/share/mk/local.meta.sys.mk b/share/mk/local.meta.sys.mk
index ef7ddc3..ece72e1 100644
--- a/share/mk/local.meta.sys.mk
+++ b/share/mk/local.meta.sys.mk
@@ -41,6 +41,7 @@ MACHINE_ARCH_LIST.$m?= ${TARGET_ARCHES_${m}:U$m}
MACHINE_ARCH.$m?= ${MACHINE_ARCH_LIST.$m:[1]}
BOOT_MACHINE_DIR.$m ?= boot/$m
.endfor
+
.ifndef _TARGET_SPEC
.if empty(MACHINE_ARCH)
.if !empty(TARGET_ARCH)
@@ -107,9 +108,9 @@ OBJTOP := ${HOST_OBJTOP}
.if ${.MAKE.LEVEL} == 0
PYTHON ?= /usr/local/bin/python
+.export PYTHON
# this works best if share/mk is ready for it.
BUILD_AT_LEVEL0= no
-.export PYTHON
# we want to end up with a singe stage tree for all machines
.if ${MK_STAGING} == "yes"
@@ -138,7 +139,7 @@ STAGE_INCSDIR= ${STAGE_OBJTOP}${INCSDIR:U/include}
STAGE_SYMLINKS_DIR= ${STAGE_OBJTOP}
LDFLAGS_LAST+= -Wl,-rpath-link -Wl,${STAGE_LIBDIR}
-.ifdef WITH_SYSROOT
+.if ${MK_SYSROOT} == "yes"
SYSROOT?= ${STAGE_OBJTOP}/
.else
LDFLAGS_LAST+= -L${STAGE_LIBDIR}
@@ -163,9 +164,9 @@ LDFLAGS_LAST+= -L${STAGE_LIBDIR}
UPDATE_DEPENDFILE= NO
.endif
+# define the list of places that contain files we are responsible for
.MAKE.META.BAILIWICK = ${SB} ${OBJROOT} ${STAGE_ROOT}
-CSU_DIR.i386 = csu/i386-elf
CSU_DIR.${MACHINE_ARCH} ?= csu/${MACHINE_ARCH}
CSU_DIR := ${CSU_DIR.${MACHINE_ARCH}}
@@ -187,7 +188,9 @@ PATH:= ${PATH:S,:, ,g:@d@${exists(${TOOLSDIR}$d):?${TOOLSDIR}$d:}@:ts:}:${PATH}
.export PATH
.if exists(${TOOLSDIR}/usr/bin/cc)
HOST_CC?= ${TOOLSDIR}/usr/bin/cc
-.export HOST_CC
+CC?= ${TOOLSDIR}/usr/bin/cc
+CXX?= ${TOOLSDIR}/usr/bin/c++
+.export HOST_CC CC CXX
.endif
.endif
diff --git a/share/mk/local.sys.mk b/share/mk/local.sys.mk
index 6a11477..424a965 100644
--- a/share/mk/local.sys.mk
+++ b/share/mk/local.sys.mk
@@ -1,4 +1,4 @@
-WITH_INSTALL_AS_USER= yes
+# $FreeBSD$
.if !defined(_TARGETS)
# some things we do only once
@@ -6,15 +6,6 @@ _TARGETS:= ${.TARGETS}
.export _TARGETS
.endif
-.if (!empty(_TARGETS) && ${_TARGETS:Nbuildworld:Nuniverse:Ninstallworld} == "") || defined(WITHOUT_META_MODE)
-MK_AUTO_OBJ?= no
-MK_META_MODE= no
-MK_STAGING= no
-MK_STAGING_PROG= no
-MK_SYSROOT= no
-UPDATE_DEPENDFILE=NO
-.endif
-
# some handy macros
_this = ${.PARSEDIR:tA}/${.PARSEFILE}
# some useful modifiers
@@ -67,3 +58,4 @@ TIME_STAMP = ${TIME_STAMP_FMT:localtime}
TIME_STAMP_DATE = `date '+${TIME_STAMP_FMT}'`
TIME_STAMP_END?= ${TIME_STAMP_DATE}
+.include "src.sys.mk"
diff --git a/share/mk/meta.autodep.mk b/share/mk/meta.autodep.mk
index c5f4733..548ba53 100644
--- a/share/mk/meta.autodep.mk
+++ b/share/mk/meta.autodep.mk
@@ -1,3 +1,4 @@
+# $FreeBSD$
# $Id: meta.autodep.mk,v 1.36 2014/08/02 23:10:29 sjg Exp $
#
diff --git a/share/mk/meta.stage.mk b/share/mk/meta.stage.mk
index 588f50e..2301b8f 100644
--- a/share/mk/meta.stage.mk
+++ b/share/mk/meta.stage.mk
@@ -1,3 +1,4 @@
+# $FreeBSD$
# $Id: meta.stage.mk,v 1.35 2015/05/20 06:40:33 sjg Exp $
#
# @(#) Copyright (c) 2011, Simon J. Gerraty
diff --git a/share/mk/meta.subdir.mk b/share/mk/meta.subdir.mk
index 1a77b44..6a4db63 100644
--- a/share/mk/meta.subdir.mk
+++ b/share/mk/meta.subdir.mk
@@ -1,4 +1,5 @@
-# $Id: meta.subdir.mk,v 1.8 2011/11/09 22:27:25 sjg Exp $
+# $FreeBSD$
+# $Id: meta.subdir.mk,v 1.10 2012/07/03 05:26:46 sjg Exp $
#
# @(#) Copyright (c) 2010, Simon J. Gerraty
diff --git a/share/mk/meta.sys.mk b/share/mk/meta.sys.mk
index 622ac8a..8a42b6c 100644
--- a/share/mk/meta.sys.mk
+++ b/share/mk/meta.sys.mk
@@ -1,3 +1,4 @@
+# $FreeBSD$
# $Id: meta.sys.mk,v 1.19 2014/08/02 23:16:02 sjg Exp $
#
diff --git a/share/mk/meta2deps.py b/share/mk/meta2deps.py
index d4e4bb1..f3a4799 100755
--- a/share/mk/meta2deps.py
+++ b/share/mk/meta2deps.py
@@ -1,3 +1,4 @@
+# $FreeBSD$
#!/usr/bin/env python
from __future__ import print_function
@@ -37,7 +38,7 @@ We only pay attention to a subset of the information in the
"""
RCSid:
- $Id: meta2deps.py,v 1.16 2013/12/20 06:08:52 sjg Exp $
+ $Id: meta2deps.py,v 1.18 2015/04/03 18:23:25 sjg Exp $
Copyright (c) 2011-2013, Juniper Networks, Inc.
All rights reserved.
@@ -112,7 +113,8 @@ def abspath(path, cwd, last_dir=None, debug=0, debug_out=sys.stderr):
rpath = resolve(path, cwd, last_dir, debug, debug_out)
if rpath:
path = rpath
- if (path.find('./') > 0 or
+ if (path.find('/') < 0 or
+ path.find('./') > 0 or
path.endswith('/..') or
os.path.islink(path)):
return os.path.realpath(path)
@@ -142,7 +144,7 @@ class MetaFile:
host_target = None
srctops = []
objroots = []
-
+ excludes = []
seen = {}
obj_deps = []
src_deps = []
@@ -166,7 +168,7 @@ class MetaFile:
Sometimes MACHINE isn't enough.
HOST_TARGET
- when we build for the psuedo machine 'host'
+ when we build for the pseudo machine 'host'
the object tree uses HOST_TARGET rather than MACHINE.
OBJROOTS a list of the common prefix for all obj dirs it might
@@ -179,6 +181,10 @@ class MetaFile:
This can allow 'bmake' to learn all the dirs within
the tree that depend on 'foo.h'
+ EXCLUDES
+ A list of paths to ignore.
+ ccache(1) can otherwise be trouble.
+
debug desired debug level
debug_out open file to send debug output to (sys.stderr)
@@ -236,11 +242,14 @@ class MetaFile:
# we want the longest match
self.srctops.sort(reverse=True)
self.objroots.sort(reverse=True)
-
+
+ self.excludes = getv(conf, 'EXCLUDES', [])
+
if self.debug:
print("host_target=", self.host_target, file=self.debug_out)
print("srctops=", self.srctops, file=self.debug_out)
print("objroots=", self.objroots, file=self.debug_out)
+ print("excludes=", self.excludes, file=self.debug_out)
self.dirdep_re = re.compile(r'([^/]+)/(.+)')
@@ -257,6 +266,7 @@ class MetaFile:
self.dpdeps = None # we cannot do it?
self.cwd = os.getcwd() # make sure this is initialized
+ self.last_dir = self.cwd
if name:
self.try_parse()
@@ -296,7 +306,7 @@ class MetaFile:
print("%s: %sAdd: %s" % (self.name, clue, data), file=self.debug_out)
def find_top(self, path, list):
- """the logical tree may be split accross multiple trees"""
+ """the logical tree may be split across multiple trees"""
for top in list:
if path.startswith(top):
if self.debug > 2:
@@ -360,18 +370,18 @@ class MetaFile:
V 3
C "pid" "cwd"
E "pid" "path"
- F "pid" "child"
+ F "pid" "child"
R "pid" "path"
W "pid" "path"
X "pid" "status"
- D "pid" "path"
- L "pid" "src" "target"
- M "pid" "old" "new"
- S "pid" "path"
- # Bye bye
-
- We go to some effort to avoid processing a dependency more than once.
- Of the above record types only C,E,F,L,R,V and W are of interest.
+ D "pid" "path"
+ L "pid" "src" "target"
+ M "pid" "old" "new"
+ S "pid" "path"
+ # Bye bye
+
+ We go to some effort to avoid processing a dependency more than once.
+ Of the above record types only C,E,F,L,R,V and W are of interest.
"""
version = 0 # unknown
@@ -379,7 +389,7 @@ class MetaFile:
self.name = name;
if file:
f = file
- cwd = last_dir = self.cwd
+ cwd = self.last_dir = self.cwd
else:
f = open(self.name, 'r')
skip = True
@@ -412,7 +422,7 @@ class MetaFile:
interesting += 'W'
"""
elif w[0] == 'CWD':
- self.cwd = cwd = last_dir = w[1]
+ self.cwd = cwd = self.last_dir = w[1]
self.seenit(cwd) # ignore this
if self.debug:
print("%s: CWD=%s" % (self.name, cwd), file=self.debug_out)
@@ -422,9 +432,9 @@ class MetaFile:
if pid != last_pid:
if last_pid:
pid_cwd[last_pid] = cwd
- pid_last_dir[last_pid] = last_dir
+ pid_last_dir[last_pid] = self.last_dir
cwd = getv(pid_cwd, pid, self.cwd)
- last_dir = getv(pid_last_dir, pid, self.cwd)
+ self.last_dir = getv(pid_last_dir, pid, self.cwd)
last_pid = pid
# process operations
@@ -438,7 +448,7 @@ class MetaFile:
cwd = abspath(w[2], cwd, None, self.debug, self.debug_out)
if cwd.endswith('/.'):
cwd = cwd[0:-2]
- last_dir = cwd
+ self.last_dir = cwd
if self.debug > 1:
print("cwd=", cwd, file=self.debug_out)
continue
@@ -449,98 +459,114 @@ class MetaFile:
continue
# file operations
if w[0] in 'ML':
- path = w[2].strip("'")
- else:
- path = w[2]
- # we are never interested in .dirdep files as dependencies
- if path.endswith('.dirdep'):
+ # these are special, tread src as read and
+ # target as write
+ self.parse_path(w[1].strip("'"), cwd, 'R', w)
+ self.parse_path(w[2].strip("'"), cwd, 'W', w)
continue
- # we don't want to resolve the last component if it is
- # a symlink
- path = resolve(path, cwd, last_dir, self.debug, self.debug_out)
- if not path:
- continue
- dir,base = os.path.split(path)
- if dir in self.seen:
+ elif w[0] in 'ERWS':
+ path = w[2]
+ self.parse_path(path, cwd, w[0], w)
+
+ if not file:
+ f.close()
+
+ def parse_path(self, path, cwd, op=None, w=[]):
+ """look at a path for the op specified"""
+
+ if not op:
+ op = w[0]
+
+ # we are never interested in .dirdep files as dependencies
+ if path.endswith('.dirdep'):
+ return
+ for p in self.excludes:
+ if p and path.startswith(p):
if self.debug > 2:
- print("seen:", dir, file=self.debug_out)
- continue
- # we can have a path in an objdir which is a link
- # to the src dir, we may need to add dependencies for each
- rdir = dir
- dir = abspath(dir, cwd, last_dir, self.debug, self.debug_out)
- if rdir == dir or rdir.find('./') > 0:
- rdir = None
- # now put path back together
- path = '/'.join([dir,base])
- if self.debug > 1:
- print("raw=%s rdir=%s dir=%s path=%s" % (w[2], rdir, dir, path), file=self.debug_out)
- if w[0] in 'SRWL':
- if w[0] == 'W' and path.endswith('.dirdep'):
- continue
- if path in [last_dir, cwd, self.cwd, self.curdir]:
- if self.debug > 1:
- print("skipping:", path, file=self.debug_out)
- continue
- if os.path.isdir(path):
- if w[0] in 'RW':
- last_dir = path;
- if self.debug > 1:
- print("ldir=", last_dir, file=self.debug_out)
- continue
+ print >> self.debug_out, "exclude:", p, path
+ return
+ # we don't want to resolve the last component if it is
+ # a symlink
+ path = resolve(path, cwd, self.last_dir, self.debug, self.debug_out)
+ if not path:
+ return
+ dir,base = os.path.split(path)
+ if dir in self.seen:
+ if self.debug > 2:
+ print("seen:", dir, file=self.debug_out)
+ return
+ # we can have a path in an objdir which is a link
+ # to the src dir, we may need to add dependencies for each
+ rdir = dir
+ dir = abspath(dir, cwd, self.last_dir, self.debug, self.debug_out)
+ if rdir == dir or rdir.find('./') > 0:
+ rdir = None
+ # now put path back together
+ path = '/'.join([dir,base])
+ if self.debug > 1:
+ print("raw=%s rdir=%s dir=%s path=%s" % (w[2], rdir, dir, path), file=self.debug_out)
+ if op in 'RWS':
+ if path in [self.last_dir, cwd, self.cwd, self.curdir]:
+ if self.debug > 1:
+ print("skipping:", path, file=self.debug_out)
+ return
+ if os.path.isdir(path):
+ if op in 'RW':
+ self.last_dir = path;
+ if self.debug > 1:
+ print("ldir=", self.last_dir, file=self.debug_out)
+ return
+
+ if op in 'ERW':
+ # finally, we get down to it
+ if dir == self.cwd or dir == self.curdir:
+ return
+ srctop = self.find_top(path, self.srctops)
+ if srctop:
+ if self.dpdeps:
+ self.add(self.file_deps, path.replace(srctop,''), 'file')
+ self.add(self.src_deps, dir.replace(srctop,''), 'src')
+ self.seenit(w[2])
+ self.seenit(dir)
+ if rdir and not rdir.startswith(srctop):
+ dir = rdir # for below
+ rdir = None
+ else:
+ return
- if w[0] in 'REWML':
- # finally, we get down to it
- if dir == self.cwd or dir == self.curdir:
+ objroot = None
+ for dir in [dir,rdir]:
+ if not dir:
continue
- srctop = self.find_top(path, self.srctops)
- if srctop:
- if self.dpdeps:
- self.add(self.file_deps, path.replace(srctop,''), 'file')
- self.add(self.src_deps, dir.replace(srctop,''), 'src')
- self.seenit(w[2])
- self.seenit(dir)
- if rdir and not rdir.startswith(srctop):
- dir = rdir # for below
- rdir = None
- else:
- continue
-
- objroot = None
- for dir in [dir,rdir]:
- if not dir:
- continue
- objroot = self.find_top(dir, self.objroots)
- if objroot:
- break
+ objroot = self.find_top(dir, self.objroots)
if objroot:
- ddep = self.find_obj(objroot, dir, path, w[2])
- if ddep:
- self.add(self.obj_deps, ddep, 'obj')
- else:
- # don't waste time looking again
- self.seenit(w[2])
- self.seenit(dir)
- if not file:
- f.close()
+ break
+ if objroot:
+ ddep = self.find_obj(objroot, dir, path, w[2])
+ if ddep:
+ self.add(self.obj_deps, ddep, 'obj')
+ else:
+ # don't waste time looking again
+ self.seenit(w[2])
+ self.seenit(dir)
def main(argv, klass=MetaFile, xopts='', xoptf=None):
"""Simple driver for class MetaFile.
Usage:
- script [options] [key=value ...] "meta" ...
+ script [options] [key=value ...] "meta" ...
Options and key=value pairs contribute to the
dictionary passed to MetaFile.
-S "SRCTOP"
- add "SRCTOP" to the "SRCTOPS" list.
+ add "SRCTOP" to the "SRCTOPS" list.
-C "CURDIR"
-O "OBJROOT"
- add "OBJROOT" to the "OBJROOTS" list.
+ add "OBJROOT" to the "OBJROOTS" list.
-m "MACHINE"
@@ -550,7 +576,7 @@ def main(argv, klass=MetaFile, xopts='', xoptf=None):
-D "DPDEPS"
- -d bumps debug level
+ -d bumps debug level
"""
import getopt
@@ -568,6 +594,7 @@ def main(argv, klass=MetaFile, xopts='', xoptf=None):
conf = {
'SRCTOPS': [],
'OBJROOTS': [],
+ 'EXCLUDES': [],
}
try:
@@ -589,7 +616,7 @@ def main(argv, klass=MetaFile, xopts='', xoptf=None):
debug = 0
output = True
- opts, args = getopt.getopt(argv[1:], 'a:dS:C:O:R:m:D:H:qT:' + xopts)
+ opts, args = getopt.getopt(argv[1:], 'a:dS:C:O:R:m:D:H:qT:X:' + xopts)
for o, a in opts:
if o == '-a':
conf['MACHINE_ARCH'] = a
@@ -615,6 +642,9 @@ def main(argv, klass=MetaFile, xopts='', xoptf=None):
conf['MACHINE'] = a
elif o == '-T':
conf['TARGET_SPEC'] = a
+ elif o == '-X':
+ if a not in conf['EXCLUDES']:
+ conf['EXCLUDES'].append(a)
elif xoptf:
xoptf(o, a, conf)
@@ -649,16 +679,21 @@ def main(argv, klass=MetaFile, xopts='', xoptf=None):
for k,v in list(conf.items()):
print("%s=%s" % (k,v), file=debug_out)
+ m = None
for a in args:
if a.endswith('.meta'):
+ if not os.path.exists(a):
+ continue
m = klass(a, conf)
elif a.startswith('@'):
# there can actually multiple files per line
for line in open(a[1:]):
for f in line.strip().split():
+ if not os.path.exists(f):
+ continue
m = klass(f, conf)
- if output:
+ if output and m:
print(m.dirdeps())
print(m.src_dirdeps('\nsrc:'))
diff --git a/share/mk/meta2deps.sh b/share/mk/meta2deps.sh
index f6b5894..c012fd3 100755
--- a/share/mk/meta2deps.sh
+++ b/share/mk/meta2deps.sh
@@ -1,3 +1,4 @@
+# $FreeBSD$
#!/bin/sh
# NAME:
@@ -77,9 +78,10 @@
# RCSid:
-# $Id: meta2deps.sh,v 1.2 2011/10/02 00:34:47 sjg Exp $
+# $Id: meta2deps.sh,v 1.9 2015/04/03 18:23:25 sjg Exp $
-# Copyright (c) 2010, Juniper Networks, Inc.
+# Copyright (c) 2010-2013, Juniper Networks, Inc.
+# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -138,10 +140,15 @@ add_list() {
eval "$name=\"$list\""
}
+_excludes_f() {
+ egrep -v "$EXCLUDES"
+}
+
meta2deps() {
DPDEPS=
SRCTOPS=$SRCTOP
OBJROOTS=
+ EXCLUDES=
while :
do
case "$1" in
@@ -152,6 +159,7 @@ meta2deps() {
-H) HOST_TARGET=$2; shift 2;;
-S) add_list SRCTOPS $2; shift 2;;
-O) add_list OBJROOTS $2; shift 2;;
+ -X) add_list EXCLUDES '|' $2; shift 2;;
-R) RELDIR=$2; shift 2;;
-T) TARGET_SPEC=$2; shift 2;;
*) break;;
@@ -211,8 +219,26 @@ meta2deps() {
seenit=
seensrc=
lpid=
- cat /dev/null "$@" |
- sed -e 's,^CWD,C C,;/^[CREFL] /!d' -e "s,',,g" |
+ case "$EXCLUDES" in
+ "") _excludes=cat;;
+ *) _excludes=_excludes_f;;
+ esac
+ # handle @list files
+ case "$@" in
+ *@[!.]*)
+ for f in "$@"
+ do
+ case "$f" in
+ *.meta) cat $f;;
+ @*) xargs cat < ${f#@};;
+ *) cat $f;;
+ esac
+ done
+ ;;
+ *) cat /dev/null "$@";;
+ esac 2> /dev/null |
+ sed -e 's,^CWD,C C,;/^[CREFLM] /!d' -e "s,',,g" |
+ $_excludes |
while read op pid path junk
do
: op=$op pid=$pid path=$path
@@ -347,7 +373,7 @@ meta2deps() {
[ -s $f ] || continue
case $f in
*qual) # a list of .dirdep files
- # we can prefix everthing with $OBJTOP to
+ # we can prefix everything with $OBJTOP to
# tell gendirdeps.mk that these are
# DIRDEP entries, since they are already
# qualified with .<machine> as needed.
diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk
index ccca375..e8c6dd2 100644
--- a/share/mk/src.libnames.mk
+++ b/share/mk/src.libnames.mk
@@ -259,7 +259,7 @@ LDADD_${_l}?= -lprivate${_l}
.else
LDADD_${_l}?= ${LDADD_${_l}_L} -l${_l}
.endif
-.if defined(_DP_${_l}) && defined(NO_SHARED)
+.if defined(_DP_${_l}) && defined(NO_SHARED) && (${NO_SHARED} != "no" && ${NO_SHARED} != "NO")
.for _d in ${_DP_${_l}}
DPADD_${_l}+= ${DPADD_${_d}}
LDADD_${_l}+= ${LDADD_${_d}}
diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk
index 21041bf..127b81c 100644
--- a/share/mk/src.opts.mk
+++ b/share/mk/src.opts.mk
@@ -126,6 +126,7 @@ __DEFAULT_YES_OPTIONS = \
MAIL \
MAILWRAPPER \
MAKE \
+ MANDOCDB \
NDIS \
NETCAT \
NETGRAPH \
@@ -187,7 +188,6 @@ __DEFAULT_NO_OPTIONS = \
OPENSSH_NONE_CIPHER \
SHARED_TOOLCHAIN \
SORT_THREADS \
- STALE_STAGED \
SVN
#
@@ -219,9 +219,9 @@ __DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_FULL CLANG_IS_CC
# On x86 and arm64, clang is enabled, and will be installed as the default cc.
__DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_FULL CLANG_IS_CC
__DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX
-.elif ${__TT} == "arm" && ${__T:Marm*eb*} == ""
-# On little-endian arm, clang is enabled, and it is installed as the default
-# cc, but since gcc is unable to build the full clang, disable it by default.
+.elif ${__TT} == "arm"
+# On arm, clang is enabled, and it is installed as the default cc, but
+# since gcc is unable to build the full clang, disable it by default.
__DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_IS_CC
__DEFAULT_NO_OPTIONS+=CLANG_FULL GCC GCC_BOOTSTRAP GNUCXX
.elif ${__T:Mpowerpc*}
diff --git a/share/mk/src.sys.mk b/share/mk/src.sys.mk
index e235a64..f8dea28 100644
--- a/share/mk/src.sys.mk
+++ b/share/mk/src.sys.mk
@@ -14,13 +14,15 @@ SRCCONF?= /etc/src.conf
.sinclude "${SRCCONF}"
_srcconf_included_: .NOTMAIN
.endif
-# If we were found via .../share/mk we need to replace that in
-# with ${SRCTOP} so that we can be found by
+# If we were found via .../share/mk we need to replace that
+# with ${.PARSEDIR:tA} so that we can be found by
# sub-makes launched from objdir.
.if ${.MAKEFLAGS:M.../share/mk} != ""
-.MAKEFLAGS:= ${.MAKEFLAGS:S,.../share/mk,${SRCTOP}/share/mk,}
+.MAKEFLAGS:= ${.MAKEFLAGS:S,.../share/mk,${.PARSEDIR:tA},}
.endif
.if ${MAKESYSPATH:Uno:M*.../*} != ""
-MAKESYSPATH:= ${MAKESYSPATH:S,.../share/mk,${SRCTOP}/share/mk,}
+MAKESYSPATH:= ${MAKESYSPATH:S,.../share/mk,${.PARSEDIR:tA},}
.export MAKESYSPATH
.endif
+# tempting, but bsd.compiler.mk causes problems this early
+#.include "src.opts.mk"
diff --git a/share/mk/stage-install.sh b/share/mk/stage-install.sh
index 64d044f..20b1ebb 100755
--- a/share/mk/stage-install.sh
+++ b/share/mk/stage-install.sh
@@ -33,6 +33,7 @@
#
# RCSid:
+# $FreeBSD$
# $Id: stage-install.sh,v 1.5 2013/04/19 16:32:24 sjg Exp $
#
# @(#) Copyright (c) 2013, Simon J. Gerraty
diff --git a/share/mk/sys.dependfile.mk b/share/mk/sys.dependfile.mk
index e915082..d12d939 100644
--- a/share/mk/sys.dependfile.mk
+++ b/share/mk/sys.dependfile.mk
@@ -1,3 +1,4 @@
+# $FreeBSD$
# $Id: sys.dependfile.mk,v 1.6 2014/08/02 18:02:06 sjg Exp $
#
# @(#) Copyright (c) 2012, Simon J. Gerraty
diff --git a/share/mk/sys.mk b/share/mk/sys.mk
index 9532edd..f3534a6 100644
--- a/share/mk/sys.mk
+++ b/share/mk/sys.mk
@@ -16,6 +16,41 @@ unix ?= We run FreeBSD, not UNIX.
MACHINE_CPUARCH=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/}
.endif
+
+# Some options we need now
+__DEFAULT_NO_OPTIONS= \
+ DIRDEPS_CACHE \
+ META_MODE \
+ META_FILES \
+
+
+__DEFAULT_DEPENDENT_OPTIONS= \
+ AUTO_OBJ/META_MODE \
+ STAGING/META_MODE \
+ SYSROOT/META_MODE
+
+.include <bsd.mkopt.mk>
+
+# Pull in global settings.
+__MAKE_CONF?=/etc/make.conf
+.if exists(${__MAKE_CONF})
+.include "${__MAKE_CONF}"
+.endif
+
+# Set any local definitions first. Place this early, but it needs
+# MACHINE_CPUARCH to be defined.
+.-include <local.sys.mk>
+
+.if ${MK_META_MODE} == "yes"
+.-include <meta.sys.mk>
+.elif ${MK_META_FILES} == "yes" && ${.MAKEFLAGS:U:M-B} == ""
+.MAKE.MODE= meta verbose
+.endif
+.if ${MK_AUTO_OBJ} == "yes"
+# This needs to be done early - before .PATH is computed
+.-include <auto.obj.mk>
+.endif
+
# If the special target .POSIX appears (without prerequisites or
# commands) before the first noncomment line in the makefile, make shall
# process the makefile as specified by the Posix 1003.2 specification.
@@ -97,9 +132,17 @@ ECHODIR ?= true
.endif
.endif
+.if defined(.PARSEDIR)
# _+_ appears to be a workaround for the special src .MAKE not working.
# setting it to + interferes with -N
_+_ ?=
+.elif !empty(.MAKEFLAGS:M-n) && ${.MAKEFLAGS:M-n} == "-n"
+# the check above matches only a single -n, so -n -n will result
+# in _+_ = +
+_+_ ?=
+.else
+_+_ ?= +
+.endif
.if defined(%POSIX)
FC ?= fort77
@@ -318,44 +361,6 @@ YFLAGS ?= -d
${CTFCONVERT_CMD}
-# Some options we need now
-__DEFAULT_NO_OPTIONS= \
- DIRDEPS_CACHE \
- META_MODE \
- META_FILES \
-
-
-__DEFAULT_DEPENDENT_OPTIONS= \
- AUTO_OBJ/META_MODE \
- STAGING/META_MODE \
- SYSROOT/META_MODE
-
-.include <bsd.mkopt.mk>
-
-# Set any local definitions first. Place this early, but it needs
-# MACHINE_CPUARCH to be defined.
-.sinclude <local.sys.mk>
-
-# Pull in global settings.
-__MAKE_CONF?=/etc/make.conf
-.if exists(${__MAKE_CONF})
-.include "${__MAKE_CONF}"
-.endif
-
-# Setup anything for the FreeBSD source build, if we're building
-# inside the source tree. Needs to be after make.conf
-.sinclude <src.sys.mk>
-
-.if ${MK_META_MODE} == "yes"
-.sinclude <meta.sys.mk>
-.elif ${MK_META_FILES} == "yes" && ${.MAKEFLAGS:U:M-B} == ""
-.MAKE.MODE= meta verbose
-.endif
-.if ${MK_AUTO_OBJ} == "yes"
-# This needs to be done early - before .PATH is computed
-.sinclude <auto.obj.mk>
-.endif
-
.if defined(__MAKE_SHELL) && !empty(__MAKE_SHELL)
SHELL= ${__MAKE_SHELL}
.SHELL: path=${__MAKE_SHELL}
diff --git a/share/mklocale/Makefile.depend b/share/mklocale/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/mklocale/Makefile.depend
+++ b/share/mklocale/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/monetdef/Makefile.depend b/share/monetdef/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/monetdef/Makefile.depend
+++ b/share/monetdef/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/msgdef/Makefile.depend b/share/msgdef/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/msgdef/Makefile.depend
+++ b/share/msgdef/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/numericdef/Makefile.depend b/share/numericdef/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/numericdef/Makefile.depend
+++ b/share/numericdef/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/security/Makefile.depend b/share/security/Makefile.depend
index 29fda55..3af2d7f 100644
--- a/share/security/Makefile.depend
+++ b/share/security/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/share/sendmail/Makefile.depend b/share/sendmail/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/sendmail/Makefile.depend
+++ b/share/sendmail/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/skel/Makefile.depend b/share/skel/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/skel/Makefile.depend
+++ b/share/skel/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/snmp/mibs/Makefile.depend b/share/snmp/mibs/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/snmp/mibs/Makefile.depend
+++ b/share/snmp/mibs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/syscons/fonts/Makefile.depend b/share/syscons/fonts/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/syscons/fonts/Makefile.depend
+++ b/share/syscons/fonts/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/syscons/keymaps/Makefile.depend b/share/syscons/keymaps/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/syscons/keymaps/Makefile.depend
+++ b/share/syscons/keymaps/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/syscons/scrnmaps/Makefile.depend b/share/syscons/scrnmaps/Makefile.depend
index 461e710..9cb890b 100644
--- a/share/syscons/scrnmaps/Makefile.depend
+++ b/share/syscons/scrnmaps/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/tabset/Makefile.depend b/share/tabset/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/tabset/Makefile.depend
+++ b/share/tabset/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/termcap/Makefile.depend b/share/termcap/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/termcap/Makefile.depend
+++ b/share/termcap/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/timedef/Makefile.depend b/share/timedef/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/timedef/Makefile.depend
+++ b/share/timedef/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/share/zoneinfo/Makefile.depend b/share/zoneinfo/Makefile.depend
index 11aba52..f80275d 100644
--- a/share/zoneinfo/Makefile.depend
+++ b/share/zoneinfo/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/sys/Makefile b/sys/Makefile
index 46d883e..7575746 100644
--- a/sys/Makefile
+++ b/sys/Makefile
@@ -8,9 +8,9 @@ CSCOPEDIRS= boot bsm cam cddl compat conf contrib crypto ddb dev fs gdb \
rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR}
.if !defined(CSCOPE_ARCHDIR)
.if defined(ALL_ARCH)
-CSCOPE_ARCHDIR = amd64 arm i386 mips pc98 powerpc sparc64 x86
+CSCOPE_ARCHDIR = amd64 arm arm64 i386 mips pc98 powerpc sparc64 x86
.else
-CSCOPE_ARCHDIR = ${MACHINE}
+CSCOPE_ARCHDIR = ${MACHINE}
.if ${MACHINE} != ${MACHINE_CPUARCH}
CSCOPE_ARCHDIR += ${MACHINE_CPUARCH}
.endif
diff --git a/sys/amd64/amd64/elf_machdep.c b/sys/amd64/amd64/elf_machdep.c
index 23fa39b..d1cffd9 100644
--- a/sys/amd64/amd64/elf_machdep.c
+++ b/sys/amd64/amd64/elf_machdep.c
@@ -82,6 +82,7 @@ struct sysentvec elf64_freebsd_sysvec = {
.sv_shared_page_base = SHAREDPAGE,
.sv_shared_page_len = PAGE_SIZE,
.sv_schedtail = NULL,
+ .sv_thread_detach = NULL,
};
INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec);
diff --git a/sys/amd64/amd64/gdb_machdep.c b/sys/amd64/amd64/gdb_machdep.c
index 5775c8f..61ffad6 100644
--- a/sys/amd64/amd64/gdb_machdep.c
+++ b/sys/amd64/amd64/gdb_machdep.c
@@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$");
void *
gdb_cpu_getreg(int regnum, size_t *regsz)
{
+ static uint32_t _kcodesel = GSEL(GCODE_SEL, SEL_KPL);
+ static uint32_t _kdatasel = GSEL(GDATA_SEL, SEL_KPL);
*regsz = gdb_cpu_regsz(regnum);
@@ -76,6 +78,8 @@ gdb_cpu_getreg(int regnum, size_t *regsz)
case 14: return (&kdb_thrctx->pcb_r14);
case 15: return (&kdb_thrctx->pcb_r15);
case 16: return (&kdb_thrctx->pcb_rip);
+ case 18: return (&_kcodesel);
+ case 19: return (&_kdatasel);
}
return (NULL);
}
diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c
index 8551d27..36f2d0f 100644
--- a/sys/amd64/amd64/initcpu.c
+++ b/sys/amd64/amd64/initcpu.c
@@ -74,6 +74,7 @@ u_int cpu_fxsr; /* SSE enabled */
u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */
u_int cpu_clflush_line_size = 32;
u_int cpu_stdext_feature;
+u_int cpu_stdext_feature2;
u_int cpu_max_ext_state_size;
u_int cpu_mon_mwait_flags; /* MONITOR/MWAIT flags (CPUID.05H.ECX) */
u_int cpu_mon_min_size; /* MONITOR minimum range size, bytes */
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 7cd58b1..58cb978 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -398,10 +398,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
/* Align to 16 bytes. */
sfp = (struct sigframe *)((unsigned long)sp & ~0xFul);
- /* Translate the signal if appropriate. */
- if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize)
- sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
-
/* Build the argument list for the signal handler. */
regs->tf_rdi = sig; /* arg 1 in %rdi */
regs->tf_rdx = (register_t)&sfp->sf_uc; /* arg 3 in %rdx */
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 118bb34..6a3de60 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -381,7 +381,7 @@ caddr_t CADDR1 = 0;
static int pmap_flags = PMAP_PDE_SUPERPAGE; /* flags for x86 pmaps */
-int pmap_pcid_enabled = 0;
+int pmap_pcid_enabled = 1;
SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH,
&pmap_pcid_enabled, 0, "Is TLB Context ID enabled ?");
int invpcid_works = 0;
@@ -3935,7 +3935,6 @@ pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va,
pd_entry_t newpde;
pt_entry_t *firstpte, oldpte, pa, *pte;
pt_entry_t PG_G, PG_A, PG_M, PG_RW, PG_V;
- vm_offset_t oldpteva;
vm_page_t mpte;
int PG_PTE_CACHE;
@@ -3995,10 +3994,9 @@ setpte:
if (!atomic_cmpset_long(pte, oldpte, oldpte & ~PG_RW))
goto setpte;
oldpte &= ~PG_RW;
- oldpteva = (oldpte & PG_FRAME & PDRMASK) |
- (va & ~PDRMASK);
CTR2(KTR_PMAP, "pmap_promote_pde: protect for va %#lx"
- " in pmap %p", oldpteva, pmap);
+ " in pmap %p", (oldpte & PG_FRAME & PDRMASK) |
+ (va & ~PDRMASK), pmap);
}
if ((oldpte & PG_PTE_PROMOTE) != (newpde & PG_PTE_PROMOTE)) {
atomic_add_long(&pmap_pde_p_failures, 1);
@@ -4846,6 +4844,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, vm_size_t len,
PG_PS_FRAME, &lock))) {
*pde = srcptepaddr & ~PG_W;
pmap_resident_count_inc(dst_pmap, NBPDR / PAGE_SIZE);
+ atomic_add_long(&pmap_pde_mappings, 1);
} else
dstmpde->wire_count--;
continue;
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index 193d207..fa74eb2 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -257,8 +257,8 @@ trap(struct trapframe *frame)
td->td_pticks = 0;
td->td_frame = frame;
addr = frame->tf_rip;
- if (td->td_ucred != p->p_ucred)
- cred_update_thread(td);
+ if (td->td_cowgen != p->p_cowgen)
+ thread_cow_update(td);
switch (type) {
case T_PRIVINFLT: /* privileged instruction fault */
@@ -840,14 +840,8 @@ trap_fatal(frame, eva)
if (frame->tf_rflags & PSL_RF)
printf("resume, ");
printf("IOPL = %ld\n", (frame->tf_rflags & PSL_IOPL) >> 12);
- printf("current process = ");
- if (curproc) {
- printf("%lu (%s)\n",
- (u_long)curproc->p_pid, curthread->td_name ?
- curthread->td_name : "");
- } else {
- printf("Idle\n");
- }
+ printf("current process = %d (%s)\n",
+ curproc->p_pid, curthread->td_name);
#ifdef KDB
if (debugger_on_panic || kdb_active)
diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c
index 0d03ed6..1fb7016 100644
--- a/sys/amd64/amd64/vm_machdep.c
+++ b/sys/amd64/amd64/vm_machdep.c
@@ -155,7 +155,6 @@ cpu_fork(td1, p2, td2, flags)
struct pcb *pcb2;
struct mdproc *mdp1, *mdp2;
struct proc_ldt *pldt;
- pmap_t pmap2;
p1 = td1->td_proc;
if ((flags & RFPROC) == 0) {
@@ -218,7 +217,6 @@ cpu_fork(td1, p2, td2, flags)
* Set registers for trampoline to user mode. Leave space for the
* return address on stack. These are the kernel mode register values.
*/
- pmap2 = vmspace_pmap(p2->p_vmspace);
pcb2->pcb_r12 = (register_t)fork_return; /* fork_trampoline argument */
pcb2->pcb_rbp = 0;
pcb2->pcb_rsp = (register_t)td2->td_frame - sizeof(void *);
diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES
index e0fe465..97eefbf 100644
--- a/sys/amd64/conf/NOTES
+++ b/sys/amd64/conf/NOTES
@@ -17,6 +17,23 @@ profile 2
#
options KDTRACE_HOOKS
+# DTrace core
+# NOTE: introduces CDDL-licensed components into the kernel
+#device dtrace
+
+# DTrace modules
+#device dtrace_lockstat
+#device dtrace_profile
+#device dtrace_sdt
+#device dtrace_fbt
+#device dtrace_systrace
+#device dtrace_prototype
+#device dtnfscl
+#device dtmalloc
+
+# Alternatively include all the DTrace modules
+#device dtraceall
+
#####################################################################
# SMP OPTIONS:
diff --git a/sys/amd64/ia32/ia32_reg.c b/sys/amd64/ia32/ia32_reg.c
index 5bc18f1..d0e6bfe 100644
--- a/sys/amd64/ia32/ia32_reg.c
+++ b/sys/amd64/ia32/ia32_reg.c
@@ -79,11 +79,9 @@ __FBSDID("$FreeBSD$");
int
fill_regs32(struct thread *td, struct reg32 *regs)
{
- struct pcb *pcb;
struct trapframe *tp;
tp = td->td_frame;
- pcb = td->td_pcb;
if (tp->tf_flags & TF_HASSEGS) {
regs->r_gs = tp->tf_gs;
regs->r_fs = tp->tf_fs;
@@ -113,18 +111,16 @@ fill_regs32(struct thread *td, struct reg32 *regs)
int
set_regs32(struct thread *td, struct reg32 *regs)
{
- struct pcb *pcb;
struct trapframe *tp;
tp = td->td_frame;
if (!EFL_SECURE(regs->r_eflags, tp->tf_rflags) || !CS_SECURE(regs->r_cs))
return (EINVAL);
- pcb = td->td_pcb;
tp->tf_gs = regs->r_gs;
tp->tf_fs = regs->r_fs;
tp->tf_es = regs->r_es;
tp->tf_ds = regs->r_ds;
- set_pcb_flags(pcb, PCB_FULL_IRET);
+ set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
tp->tf_flags = TF_HASSEGS;
tp->tf_rdi = regs->r_edi;
tp->tf_rsi = regs->r_esi;
diff --git a/sys/amd64/ia32/ia32_signal.c b/sys/amd64/ia32/ia32_signal.c
index da01647..9831013 100644
--- a/sys/amd64/ia32/ia32_signal.c
+++ b/sys/amd64/ia32/ia32_signal.c
@@ -360,10 +360,6 @@ ia32_osendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
} else
fp = (struct ia32_sigframe3 *)regs->tf_rsp - 1;
- /* Translate the signal if appropriate. */
- if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize)
- sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
-
/* Build the argument list for the signal handler. */
sf.sf_signum = sig;
sf.sf_scp = (register_t)&fp->sf_siginfo.si_sc;
@@ -498,10 +494,6 @@ freebsd4_ia32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
sfp = (struct ia32_sigframe4 *)regs->tf_rsp - 1;
PROC_UNLOCK(p);
- /* Translate the signal if appropriate. */
- if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize)
- sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
-
/* Build the argument list for the signal handler. */
sf.sf_signum = sig;
sf.sf_ucontext = (register_t)&sfp->sf_uc;
@@ -643,10 +635,6 @@ ia32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
sfp = (struct ia32_sigframe *)((uintptr_t)sp & ~0xF);
PROC_UNLOCK(p);
- /* Translate the signal if appropriate. */
- if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize)
- sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
-
/* Build the argument list for the signal handler. */
sf.sf_signum = sig;
sf.sf_ucontext = (register_t)&sfp->sf_uc;
diff --git a/sys/amd64/include/md_var.h b/sys/amd64/include/md_var.h
index 0813e5f..954df3e 100644
--- a/sys/amd64/include/md_var.h
+++ b/sys/amd64/include/md_var.h
@@ -49,6 +49,7 @@ extern u_int via_feature_rng;
extern u_int via_feature_xcrypt;
extern u_int cpu_clflush_line_size;
extern u_int cpu_stdext_feature;
+extern u_int cpu_stdext_feature2;
extern u_int cpu_fxsr;
extern u_int cpu_high;
extern u_int cpu_id;
diff --git a/sys/amd64/include/vmm.h b/sys/amd64/include/vmm.h
index d3798bc..1a4e5ab 100644
--- a/sys/amd64/include/vmm.h
+++ b/sys/amd64/include/vmm.h
@@ -120,13 +120,18 @@ struct vm_object;
struct vm_guest_paging;
struct pmap;
+struct vm_eventinfo {
+ void *rptr; /* rendezvous cookie */
+ int *sptr; /* suspend cookie */
+ int *iptr; /* reqidle cookie */
+};
+
typedef int (*vmm_init_func_t)(int ipinum);
typedef int (*vmm_cleanup_func_t)(void);
typedef void (*vmm_resume_func_t)(void);
typedef void * (*vmi_init_func_t)(struct vm *vm, struct pmap *pmap);
typedef int (*vmi_run_func_t)(void *vmi, int vcpu, register_t rip,
- struct pmap *pmap, void *rendezvous_cookie,
- void *suspend_cookie);
+ struct pmap *pmap, struct vm_eventinfo *info);
typedef void (*vmi_cleanup_func_t)(void *vmi);
typedef int (*vmi_get_register_t)(void *vmi, int vcpu, int num,
uint64_t *retval);
@@ -208,6 +213,7 @@ struct vm_exit *vm_exitinfo(struct vm *vm, int vcpuid);
void vm_exit_suspended(struct vm *vm, int vcpuid, uint64_t rip);
void vm_exit_rendezvous(struct vm *vm, int vcpuid, uint64_t rip);
void vm_exit_astpending(struct vm *vm, int vcpuid, uint64_t rip);
+void vm_exit_reqidle(struct vm *vm, int vcpuid, uint64_t rip);
#ifdef _SYS__CPUSET_H_
/*
@@ -232,17 +238,24 @@ cpuset_t vm_suspended_cpus(struct vm *vm);
#endif /* _SYS__CPUSET_H_ */
static __inline int
-vcpu_rendezvous_pending(void *rendezvous_cookie)
+vcpu_rendezvous_pending(struct vm_eventinfo *info)
+{
+
+ return (*((uintptr_t *)(info->rptr)) != 0);
+}
+
+static __inline int
+vcpu_suspended(struct vm_eventinfo *info)
{
- return (*(uintptr_t *)rendezvous_cookie != 0);
+ return (*info->sptr);
}
static __inline int
-vcpu_suspended(void *suspend_cookie)
+vcpu_reqidle(struct vm_eventinfo *info)
{
- return (*(int *)suspend_cookie);
+ return (*info->iptr);
}
/*
@@ -506,6 +519,7 @@ enum vm_exitcode {
VM_EXITCODE_MONITOR,
VM_EXITCODE_MWAIT,
VM_EXITCODE_SVM,
+ VM_EXITCODE_REQIDLE,
VM_EXITCODE_MAX
};
diff --git a/sys/amd64/include/vmparam.h b/sys/amd64/include/vmparam.h
index a92dd4e..07158e8 100644
--- a/sys/amd64/include/vmparam.h
+++ b/sys/amd64/include/vmparam.h
@@ -90,13 +90,12 @@
#define VM_PHYSSEG_MAX 63
/*
- * Create three free page pools: VM_FREEPOOL_DEFAULT is the default pool
+ * Create two free page pools: VM_FREEPOOL_DEFAULT is the default pool
* from which physical pages are allocated and VM_FREEPOOL_DIRECT is
* the pool from which physical pages for page tables and small UMA
* objects are allocated.
*/
-#define VM_NFREEPOOL 3
-#define VM_FREEPOOL_CACHE 2
+#define VM_NFREEPOOL 2
#define VM_FREEPOOL_DEFAULT 0
#define VM_FREEPOOL_DIRECT 1
diff --git a/sys/amd64/linux/Makefile b/sys/amd64/linux/Makefile
new file mode 100644
index 0000000..c8899e6
--- /dev/null
+++ b/sys/amd64/linux/Makefile
@@ -0,0 +1,17 @@
+# Makefile for syscall tables
+#
+# $FreeBSD$
+
+all:
+ @echo "make sysent only"
+
+sysent: linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c
+
+linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c: \
+ ../../kern/makesyscalls.sh syscalls.master syscalls.conf
+ -mv -f linux_sysent.c linux_sysent.c.bak
+ -mv -f linux_syscall.h linux_syscall.h.bak
+ -mv -f linux_proto.h linux_proto.h.bak
+ -mv -f linux_syscalls.c linux_syscalls.c.bak
+ -mv -f linux_systrace_args.c linux_systrace_args.c.bak
+ sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf
diff --git a/sys/amd64/linux/linux.h b/sys/amd64/linux/linux.h
new file mode 100644
index 0000000..c4fe9ae
--- /dev/null
+++ b/sys/amd64/linux/linux.h
@@ -0,0 +1,549 @@
+/*-
+ * Copyright (c) 2013 Dmitry Chagin
+ * Copyright (c) 1994-1996 Søren Schmidt
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _AMD64_LINUX_H_
+#define _AMD64_LINUX_H_
+
+#include <compat/linux/linux.h>
+#include <amd64/linux/linux_syscall.h>
+
+/*
+ * debugging support
+ */
+extern u_char linux_debug_map[];
+#define ldebug(name) isclr(linux_debug_map, LINUX_SYS_linux_ ## name)
+#define ARGS(nm, fmt) "linux(%ld/%ld): "#nm"("fmt")\n", \
+ (long)td->td_proc->p_pid, (long)td->td_tid
+#define LMSG(fmt) "linux(%ld/%ld): "fmt"\n", \
+ (long)td->td_proc->p_pid, (long)td->td_tid
+#define LINUX_DTRACE linuxulator
+
+#define PTRIN(v) (void *)(v)
+#define PTROUT(v) (uintptr_t)(v)
+
+#define CP(src,dst,fld) do { (dst).fld = (src).fld; } while (0)
+#define CP2(src,dst,sfld,dfld) do { (dst).dfld = (src).sfld; } while (0)
+#define PTRIN_CP(src,dst,fld) \
+ do { (dst).fld = PTRIN((src).fld); } while (0)
+
+/*
+ * Provide a separate set of types for the Linux types.
+ */
+typedef int32_t l_int;
+typedef int64_t l_long;
+typedef int16_t l_short;
+typedef uint32_t l_uint;
+typedef uint64_t l_ulong;
+typedef uint16_t l_ushort;
+
+typedef l_ulong l_uintptr_t;
+typedef l_long l_clock_t;
+typedef l_int l_daddr_t;
+typedef l_ulong l_dev_t;
+typedef l_uint l_gid_t;
+typedef l_uint l_uid_t;
+typedef l_ulong l_ino_t;
+typedef l_int l_key_t;
+typedef l_long l_loff_t;
+typedef l_uint l_mode_t;
+typedef l_long l_off_t;
+typedef l_int l_pid_t;
+typedef l_ulong l_size_t;
+typedef l_long l_ssize_t;
+typedef l_long l_suseconds_t;
+typedef l_long l_time_t;
+typedef l_int l_timer_t;
+typedef l_int l_mqd_t;
+typedef l_size_t l_socklen_t;
+typedef l_ulong l_fd_mask;
+
+typedef struct {
+ l_int val[2];
+} l_fsid_t;
+
+typedef struct {
+ l_time_t tv_sec;
+ l_suseconds_t tv_usec;
+} l_timeval;
+
+#define l_fd_set fd_set
+
+/*
+ * Miscellaneous
+ */
+#define LINUX_NAME_MAX 255
+#define LINUX_CTL_MAXNAME 10
+
+#define LINUX_AT_COUNT 19 /* Count of used aux entry types. */
+
+struct l___sysctl_args
+{
+ l_uintptr_t name;
+ l_int nlen;
+ l_uintptr_t oldval;
+ l_uintptr_t oldlenp;
+ l_uintptr_t newval;
+ l_size_t newlen;
+ l_ulong __spare[4];
+};
+
+/* Scheduling policies */
+#define LINUX_SCHED_OTHER 0
+#define LINUX_SCHED_FIFO 1
+#define LINUX_SCHED_RR 2
+
+/* Resource limits */
+#define LINUX_RLIMIT_CPU 0
+#define LINUX_RLIMIT_FSIZE 1
+#define LINUX_RLIMIT_DATA 2
+#define LINUX_RLIMIT_STACK 3
+#define LINUX_RLIMIT_CORE 4
+#define LINUX_RLIMIT_RSS 5
+#define LINUX_RLIMIT_NPROC 6
+#define LINUX_RLIMIT_NOFILE 7
+#define LINUX_RLIMIT_MEMLOCK 8
+#define LINUX_RLIMIT_AS 9 /* Address space limit */
+
+#define LINUX_RLIM_NLIMITS 10
+
+struct l_rlimit {
+ l_ulong rlim_cur;
+ l_ulong rlim_max;
+};
+
+/* mmap options */
+#define LINUX_MAP_SHARED 0x0001
+#define LINUX_MAP_PRIVATE 0x0002
+#define LINUX_MAP_FIXED 0x0010
+#define LINUX_MAP_ANON 0x0020
+#define LINUX_MAP_GROWSDOWN 0x0100
+
+/*
+ * stat family of syscalls
+ */
+struct l_timespec {
+ l_time_t tv_sec;
+ l_long tv_nsec;
+};
+
+struct l_newstat {
+ l_dev_t st_dev;
+ l_ino_t st_ino;
+ l_ulong st_nlink;
+ l_uint st_mode;
+ l_uid_t st_uid;
+ l_gid_t st_gid;
+ l_uint __st_pad1;
+ l_dev_t st_rdev;
+ l_off_t st_size;
+ l_long st_blksize;
+ l_long st_blocks;
+ struct l_timespec st_atim;
+ struct l_timespec st_mtim;
+ struct l_timespec st_ctim;
+ l_long __unused1;
+ l_long __unused2;
+ l_long __unused3;
+};
+
+/* sigaction flags */
+#define LINUX_SA_NOCLDSTOP 0x00000001
+#define LINUX_SA_NOCLDWAIT 0x00000002
+#define LINUX_SA_SIGINFO 0x00000004
+#define LINUX_SA_RESTORER 0x04000000
+#define LINUX_SA_ONSTACK 0x08000000
+#define LINUX_SA_RESTART 0x10000000
+#define LINUX_SA_INTERRUPT 0x20000000
+#define LINUX_SA_NOMASK 0x40000000
+#define LINUX_SA_ONESHOT 0x80000000
+
+/* sigprocmask actions */
+#define LINUX_SIG_BLOCK 0
+#define LINUX_SIG_UNBLOCK 1
+#define LINUX_SIG_SETMASK 2
+
+/* sigaltstack */
+#define LINUX_MINSIGSTKSZ 2048
+
+typedef void (*l_handler_t)(l_int);
+
+typedef struct {
+ l_handler_t lsa_handler;
+ l_ulong lsa_flags;
+ l_uintptr_t lsa_restorer;
+ l_sigset_t lsa_mask;
+} l_sigaction_t;
+
+typedef struct {
+ l_uintptr_t ss_sp;
+ l_int ss_flags;
+ l_size_t ss_size;
+} l_stack_t;
+
+struct l_fpstate {
+ u_int16_t cwd;
+ u_int16_t swd;
+ u_int16_t twd;
+ u_int16_t fop;
+ u_int64_t rip;
+ u_int64_t rdp;
+ u_int32_t mxcsr;
+ u_int32_t mxcsr_mask;
+ u_int32_t st_space[32];
+ u_int32_t xmm_space[64];
+ u_int32_t reserved2[24];
+};
+
+struct l_sigcontext {
+ l_ulong sc_r8;
+ l_ulong sc_r9;
+ l_ulong sc_r10;
+ l_ulong sc_r11;
+ l_ulong sc_r12;
+ l_ulong sc_r13;
+ l_ulong sc_r14;
+ l_ulong sc_r15;
+ l_ulong sc_rdi;
+ l_ulong sc_rsi;
+ l_ulong sc_rbp;
+ l_ulong sc_rbx;
+ l_ulong sc_rdx;
+ l_ulong sc_rax;
+ l_ulong sc_rcx;
+ l_ulong sc_rsp;
+ l_ulong sc_rip;
+ l_ulong sc_rflags;
+ l_ushort sc_cs;
+ l_ushort sc_gs;
+ l_ushort sc_fs;
+ l_ushort sc___pad0;
+ l_ulong sc_err;
+ l_ulong sc_trapno;
+ l_sigset_t sc_mask;
+ l_ulong sc_cr2;
+ struct l_fpstate *sc_fpstate;
+ l_ulong sc_reserved1[8];
+};
+
+struct l_ucontext {
+ l_ulong uc_flags;
+ l_uintptr_t uc_link;
+ l_stack_t uc_stack;
+ struct l_sigcontext uc_mcontext;
+ l_sigset_t uc_sigmask;
+};
+
+#define LINUX_SI_PREAMBLE_SIZE (4 * sizeof(int))
+#define LINUX_SI_MAX_SIZE 128
+#define LINUX_SI_PAD_SIZE ((LINUX_SI_MAX_SIZE - \
+ LINUX_SI_PREAMBLE_SIZE) / sizeof(l_int))
+typedef union l_sigval {
+ l_int sival_int;
+ l_uintptr_t sival_ptr;
+} l_sigval_t;
+
+typedef struct l_siginfo {
+ l_int lsi_signo;
+ l_int lsi_errno;
+ l_int lsi_code;
+ union {
+ l_int _pad[LINUX_SI_PAD_SIZE];
+
+ struct {
+ l_pid_t _pid;
+ l_uid_t _uid;
+ } _kill;
+
+ struct {
+ l_timer_t _tid;
+ l_int _overrun;
+ char _pad[sizeof(l_uid_t) - sizeof(int)];
+ union l_sigval _sigval;
+ l_uint _sys_private;
+ } _timer;
+
+ struct {
+ l_pid_t _pid; /* sender's pid */
+ l_uid_t _uid; /* sender's uid */
+ union l_sigval _sigval;
+ } _rt;
+
+ struct {
+ l_pid_t _pid; /* which child */
+ l_uid_t _uid; /* sender's uid */
+ l_int _status; /* exit code */
+ l_clock_t _utime;
+ l_clock_t _stime;
+ } _sigchld;
+
+ struct {
+ l_uintptr_t _addr; /* Faulting insn/memory ref. */
+ } _sigfault;
+
+ struct {
+ l_long _band; /* POLL_IN,POLL_OUT,POLL_MSG */
+ l_int _fd;
+ } _sigpoll;
+ } _sifields;
+} l_siginfo_t;
+
+#define lsi_pid _sifields._kill._pid
+#define lsi_uid _sifields._kill._uid
+#define lsi_tid _sifields._timer._tid
+#define lsi_overrun _sifields._timer._overrun
+#define lsi_sys_private _sifields._timer._sys_private
+#define lsi_status _sifields._sigchld._status
+#define lsi_utime _sifields._sigchld._utime
+#define lsi_stime _sifields._sigchld._stime
+#define lsi_value _sifields._rt._sigval
+#define lsi_int _sifields._rt._sigval.sival_int
+#define lsi_ptr _sifields._rt._sigval.sival_ptr
+#define lsi_addr _sifields._sigfault._addr
+#define lsi_band _sifields._sigpoll._band
+#define lsi_fd _sifields._sigpoll._fd
+
+/*
+ * We make the stack look like Linux expects it when calling a signal
+ * handler, but use the BSD way of calling the handler and sigreturn().
+ * This means that we need to pass the pointer to the handler too.
+ * It is appended to the frame to not interfere with the rest of it.
+ */
+
+struct l_rt_sigframe {
+ struct l_ucontext sf_sc;
+ struct l_siginfo sf_si;
+ l_handler_t sf_handler;
+};
+
+/*
+ * mount flags
+ */
+#define LINUX_MS_RDONLY 0x0001
+#define LINUX_MS_NOSUID 0x0002
+#define LINUX_MS_NODEV 0x0004
+#define LINUX_MS_NOEXEC 0x0008
+#define LINUX_MS_REMOUNT 0x0020
+
+/*
+ * SystemV IPC defines
+ */
+#define LINUX_IPC_RMID 0
+#define LINUX_IPC_SET 1
+#define LINUX_IPC_STAT 2
+#define LINUX_IPC_INFO 3
+
+#define LINUX_SHM_LOCK 11
+#define LINUX_SHM_UNLOCK 12
+#define LINUX_SHM_STAT 13
+#define LINUX_SHM_INFO 14
+
+#define LINUX_SHM_RDONLY 0x1000
+#define LINUX_SHM_RND 0x2000
+#define LINUX_SHM_REMAP 0x4000
+
+/* semctl commands */
+#define LINUX_GETPID 11
+#define LINUX_GETVAL 12
+#define LINUX_GETALL 13
+#define LINUX_GETNCNT 14
+#define LINUX_GETZCNT 15
+#define LINUX_SETVAL 16
+#define LINUX_SETALL 17
+#define LINUX_SEM_STAT 18
+#define LINUX_SEM_INFO 19
+
+union l_semun {
+ l_int val;
+ l_uintptr_t buf;
+ l_uintptr_t array;
+ l_uintptr_t __buf;
+ l_uintptr_t __pad;
+};
+
+struct l_ipc_perm {
+ l_key_t key;
+ l_uid_t uid;
+ l_gid_t gid;
+ l_uid_t cuid;
+ l_gid_t cgid;
+ l_ushort mode;
+ l_ushort seq;
+};
+
+/*
+ * Socket defines
+ */
+
+#define LINUX_SOL_SOCKET 1
+#define LINUX_SOL_IP 0
+#define LINUX_SOL_IPX 256
+#define LINUX_SOL_AX25 257
+#define LINUX_SOL_TCP 6
+#define LINUX_SOL_UDP 17
+
+#define LINUX_SO_DEBUG 1
+#define LINUX_SO_REUSEADDR 2
+#define LINUX_SO_TYPE 3
+#define LINUX_SO_ERROR 4
+#define LINUX_SO_DONTROUTE 5
+#define LINUX_SO_BROADCAST 6
+#define LINUX_SO_SNDBUF 7
+#define LINUX_SO_RCVBUF 8
+#define LINUX_SO_KEEPALIVE 9
+#define LINUX_SO_OOBINLINE 10
+#define LINUX_SO_NO_CHECK 11
+#define LINUX_SO_PRIORITY 12
+#define LINUX_SO_LINGER 13
+#define LINUX_SO_PASSCRED 16
+#define LINUX_SO_PEERCRED 17
+#define LINUX_SO_RCVLOWAT 18
+#define LINUX_SO_SNDLOWAT 19
+#define LINUX_SO_RCVTIMEO 20
+#define LINUX_SO_SNDTIMEO 21
+#define LINUX_SO_TIMESTAMP 29
+#define LINUX_SO_ACCEPTCONN 30
+
+#define LINUX_IP_TOS 1
+#define LINUX_IP_TTL 2
+#define LINUX_IP_HDRINCL 3
+#define LINUX_IP_OPTIONS 4
+
+#define LINUX_IP_MULTICAST_IF 32
+#define LINUX_IP_MULTICAST_TTL 33
+#define LINUX_IP_MULTICAST_LOOP 34
+#define LINUX_IP_ADD_MEMBERSHIP 35
+#define LINUX_IP_DROP_MEMBERSHIP 36
+
+struct l_sockaddr {
+ l_ushort sa_family;
+ char sa_data[14];
+};
+
+struct l_ifmap {
+ l_ulong mem_start;
+ l_ulong mem_end;
+ l_ushort base_addr;
+ u_char irq;
+ u_char dma;
+ u_char port;
+} __packed;
+
+#define LINUX_IFHWADDRLEN 6
+#define LINUX_IFNAMSIZ 16
+
+struct l_ifreq {
+ union {
+ char ifrn_name[LINUX_IFNAMSIZ];
+ } ifr_ifrn;
+
+ union {
+ struct l_sockaddr ifru_addr;
+ struct l_sockaddr ifru_dstaddr;
+ struct l_sockaddr ifru_broadaddr;
+ struct l_sockaddr ifru_netmask;
+ struct l_sockaddr ifru_hwaddr;
+ l_short ifru_flags[1];
+ l_int ifru_metric;
+ l_int ifru_mtu;
+ struct l_ifmap ifru_map;
+ char ifru_slave[LINUX_IFNAMSIZ];
+ l_uintptr_t ifru_data;
+ } ifr_ifru;
+} __packed;
+
+#define ifr_name ifr_ifrn.ifrn_name /* Interface name */
+#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */
+
+struct l_ifconf {
+ int ifc_len;
+ union {
+ l_uintptr_t ifcu_buf;
+ l_uintptr_t ifcu_req;
+ } ifc_ifcu;
+};
+
+#define ifc_buf ifc_ifcu.ifcu_buf
+#define ifc_req ifc_ifcu.ifcu_req
+
+/*
+ * poll()
+ */
+#define LINUX_POLLIN 0x0001
+#define LINUX_POLLPRI 0x0002
+#define LINUX_POLLOUT 0x0004
+#define LINUX_POLLERR 0x0008
+#define LINUX_POLLHUP 0x0010
+#define LINUX_POLLNVAL 0x0020
+#define LINUX_POLLRDNORM 0x0040
+#define LINUX_POLLRDBAND 0x0080
+#define LINUX_POLLWRNORM 0x0100
+#define LINUX_POLLWRBAND 0x0200
+#define LINUX_POLLMSG 0x0400
+
+struct l_pollfd {
+ l_int fd;
+ l_short events;
+ l_short revents;
+};
+
+
+#define LINUX_CLONE_VM 0x00000100
+#define LINUX_CLONE_FS 0x00000200
+#define LINUX_CLONE_FILES 0x00000400
+#define LINUX_CLONE_SIGHAND 0x00000800
+#define LINUX_CLONE_PID 0x00001000 /* No longer exist in Linux */
+#define LINUX_CLONE_VFORK 0x00004000
+#define LINUX_CLONE_PARENT 0x00008000
+#define LINUX_CLONE_THREAD 0x00010000
+#define LINUX_CLONE_SETTLS 0x00080000
+#define LINUX_CLONE_PARENT_SETTID 0x00100000
+#define LINUX_CLONE_CHILD_CLEARTID 0x00200000
+#define LINUX_CLONE_CHILD_SETTID 0x01000000
+
+#define LINUX_ARCH_SET_GS 0x1001
+#define LINUX_ARCH_SET_FS 0x1002
+#define LINUX_ARCH_GET_GS 0x1003
+#define LINUX_ARCH_GET_FS 0x1004
+
+#define linux_copyout_rusage(r, u) copyout(r, u, sizeof(*r))
+
+/* robust futexes */
+struct linux_robust_list {
+ l_uintptr_t next;
+};
+
+struct linux_robust_list_head {
+ struct linux_robust_list list;
+ l_long futex_offset;
+ l_uintptr_t pending_list;
+};
+
+#endif /* !_AMD64_LINUX_H_ */
diff --git a/sys/amd64/linux/linux_dummy.c b/sys/amd64/linux/linux_dummy.c
new file mode 100644
index 0000000..96cf8d9
--- /dev/null
+++ b/sys/amd64/linux/linux_dummy.c
@@ -0,0 +1,141 @@
+/*-
+ * Copyright (c) 2013 Dmitry Chagin
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "opt_compat.h"
+#include "opt_kdtrace.h"
+
+#include <sys/param.h>
+#include <sys/kernel.h>
+#include <sys/sdt.h>
+#include <sys/systm.h>
+#include <sys/proc.h>
+
+#include <amd64/linux/linux.h>
+#include <amd64/linux/linux_proto.h>
+#include <compat/linux/linux_dtrace.h>
+#include <compat/linux/linux_util.h>
+
+/* DTrace init */
+LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE);
+
+DUMMY(mincore);
+DUMMY(sendfile);
+DUMMY(ptrace);
+DUMMY(syslog);
+DUMMY(setfsuid);
+DUMMY(setfsgid);
+DUMMY(sysfs);
+DUMMY(vhangup);
+DUMMY(pivot_root);
+DUMMY(adjtimex);
+DUMMY(swapoff);
+DUMMY(create_module);
+DUMMY(init_module);
+DUMMY(delete_module);
+DUMMY(get_kernel_syms);
+DUMMY(query_module);
+DUMMY(quotactl);
+DUMMY(nfsservctl);
+DUMMY(getpmsg);
+DUMMY(putpmsg);
+DUMMY(afs_syscall);
+DUMMY(tuxcall);
+DUMMY(security);
+DUMMY(set_thread_area);
+DUMMY(lookup_dcookie);
+DUMMY(epoll_ctl_old);
+DUMMY(epoll_wait_old);
+DUMMY(remap_file_pages);
+DUMMY(semtimedop);
+DUMMY(mbind);
+DUMMY(get_mempolicy);
+DUMMY(set_mempolicy);
+DUMMY(mq_open);
+DUMMY(mq_unlink);
+DUMMY(mq_timedsend);
+DUMMY(mq_timedreceive);
+DUMMY(mq_notify);
+DUMMY(mq_getsetattr);
+DUMMY(kexec_load);
+DUMMY(add_key);
+DUMMY(request_key);
+DUMMY(keyctl);
+DUMMY(ioprio_set);
+DUMMY(ioprio_get);
+DUMMY(inotify_init);
+DUMMY(inotify_add_watch);
+DUMMY(inotify_rm_watch);
+DUMMY(migrate_pages);
+DUMMY(unshare);
+DUMMY(splice);
+DUMMY(tee);
+DUMMY(sync_file_range);
+DUMMY(vmsplice);
+DUMMY(move_pages);
+DUMMY(signalfd);
+DUMMY(timerfd);
+DUMMY(timerfd_settime);
+DUMMY(timerfd_gettime);
+DUMMY(signalfd4);
+DUMMY(inotify_init1);
+DUMMY(preadv);
+DUMMY(pwritev);
+DUMMY(rt_tsigqueueinfo);
+DUMMY(perf_event_open);
+DUMMY(fanotify_init);
+DUMMY(fanotify_mark);
+DUMMY(name_to_handle_at);
+DUMMY(open_by_handle_at);
+DUMMY(clock_adjtime);
+DUMMY(setns);
+DUMMY(process_vm_readv);
+DUMMY(process_vm_writev);
+DUMMY(kcmp);
+DUMMY(finit_module);
+
+#define DUMMY_XATTR(s) \
+int \
+linux_ ## s ## xattr( \
+ struct thread *td, struct linux_ ## s ## xattr_args *arg) \
+{ \
+ \
+ return (ENOATTR); \
+}
+DUMMY_XATTR(set);
+DUMMY_XATTR(lset);
+DUMMY_XATTR(fset);
+DUMMY_XATTR(get);
+DUMMY_XATTR(lget);
+DUMMY_XATTR(fget);
+DUMMY_XATTR(list);
+DUMMY_XATTR(llist);
+DUMMY_XATTR(flist);
+DUMMY_XATTR(remove);
+DUMMY_XATTR(lremove);
+DUMMY_XATTR(fremove);
diff --git a/sys/amd64/linux/linux_genassym.c b/sys/amd64/linux/linux_genassym.c
new file mode 100644
index 0000000..0edb6a0
--- /dev/null
+++ b/sys/amd64/linux/linux_genassym.c
@@ -0,0 +1,15 @@
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/assym.h>
+#include <sys/systm.h>
+
+#include <amd64/linux/linux.h>
+#include <compat/linux/linux_mib.h>
+
+ASSYM(LINUX_RT_SIGF_HANDLER, offsetof(struct l_rt_sigframe, sf_handler));
+ASSYM(LINUX_RT_SIGF_UC, offsetof(struct l_rt_sigframe, sf_sc));
+ASSYM(LINUX_RT_SIGF_SC, offsetof(struct l_ucontext, uc_mcontext));
+ASSYM(LINUX_VERSION_CODE, LINUX_VERSION_CODE);
+ASSYM(LINUX_SC_RSP, offsetof(struct l_sigcontext, sc_rsp));
diff --git a/sys/amd64/linux/linux_ipc64.h b/sys/amd64/linux/linux_ipc64.h
new file mode 100644
index 0000000..913fc1a
--- /dev/null
+++ b/sys/amd64/linux/linux_ipc64.h
@@ -0,0 +1,142 @@
+/*-
+ * Copyright (c) 2002 Maxim Sobolev <sobomax@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _AMD64_LINUX_LINUX_IPC64_H_
+#define _AMD64_LINUX_LINUX_IPC64_H_
+
+/*
+ * The ipc64_perm structure for i386 architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 32-bit mode_t and seq
+ * - 2 miscellaneous 32-bit values
+ */
+
+struct l_ipc64_perm
+{
+ l_key_t key;
+ l_uid_t uid;
+ l_gid_t gid;
+ l_uid_t cuid;
+ l_gid_t cgid;
+ l_mode_t mode;
+ l_ushort __pad1;
+ l_ushort seq;
+ l_ushort __pad2;
+ l_ulong __unused1;
+ l_ulong __unused2;
+};
+
+/*
+ * The msqid64_ds structure for i386 architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 64-bit time_t to solve y2038 problem
+ * - 2 miscellaneous 32-bit values
+ */
+
+struct l_msqid64_ds {
+ struct l_ipc64_perm msg_perm;
+ l_time_t msg_stime; /* last msgsnd time */
+ l_ulong __unused1;
+ l_time_t msg_rtime; /* last msgrcv time */
+ l_ulong __unused2;
+ l_time_t msg_ctime; /* last change time */
+ l_ulong __unused3;
+ l_ulong msg_cbytes; /* current number of bytes on queue */
+ l_ulong msg_qnum; /* number of messages in queue */
+ l_ulong msg_qbytes; /* max number of bytes on queue */
+ l_pid_t msg_lspid; /* pid of last msgsnd */
+ l_pid_t msg_lrpid; /* last receive pid */
+ l_ulong __unused4;
+ l_ulong __unused5;
+};
+
+/*
+ * The semid64_ds structure for i386 architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 64-bit time_t to solve y2038 problem
+ * - 2 miscellaneous 32-bit values
+ */
+
+struct l_semid64_ds {
+ struct l_ipc64_perm sem_perm; /* permissions */
+ l_time_t sem_otime; /* last semop time */
+ l_ulong __unused1;
+ l_time_t sem_ctime; /* last change time */
+ l_ulong __unused2;
+ l_ulong sem_nsems; /* no. of semaphores in array */
+ l_ulong __unused3;
+ l_ulong __unused4;
+};
+
+/*
+ * The shmid64_ds structure for i386 architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 64-bit time_t to solve y2038 problem
+ * - 2 miscellaneous 32-bit values
+ */
+
+struct l_shmid64_ds {
+ struct l_ipc64_perm shm_perm; /* operation perms */
+ l_size_t shm_segsz; /* size of segment (bytes) */
+ l_time_t shm_atime; /* last attach time */
+ l_time_t shm_dtime; /* last detach time */
+ l_time_t shm_ctime; /* last change time */
+ l_pid_t shm_cpid; /* pid of creator */
+ l_pid_t shm_lpid; /* pid of last operator */
+ l_ulong shm_nattch; /* no. of current attaches */
+ l_ulong __unused4;
+ l_ulong __unused5;
+};
+
+struct l_shminfo64 {
+ l_ulong shmmax;
+ l_ulong shmmin;
+ l_ulong shmmni;
+ l_ulong shmseg;
+ l_ulong shmall;
+ l_ulong __unused1;
+ l_ulong __unused2;
+ l_ulong __unused3;
+ l_ulong __unused4;
+};
+
+#endif /* !_AMD64_LINUX_LINUX_IPC64_H_ */
diff --git a/sys/amd64/linux/linux_locore.s b/sys/amd64/linux/linux_locore.s
new file mode 100644
index 0000000..5dcc09a
--- /dev/null
+++ b/sys/amd64/linux/linux_locore.s
@@ -0,0 +1,76 @@
+/* $FreeBSD$ */
+
+#include "linux_assym.h" /* system definitions */
+#include <machine/asmacros.h> /* miscellaneous asm macros */
+
+#include <amd64/linux/linux_syscall.h> /* system call numbers */
+
+ .data
+
+ .globl linux_platform
+linux_platform:
+ .asciz "x86_64"
+
+
+ .text
+/*
+ * To avoid excess stack frame the signal trampoline code emulates
+ * the 'call' instruction.
+ */
+NON_GPROF_ENTRY(linux_rt_sigcode)
+ movq %rsp, %rbx /* preserve sigframe */
+ call .getip
+.getip:
+ popq %rax
+ add $.startrtsigcode-.getip, %rax /* ret address */
+ pushq %rax
+ jmp *LINUX_RT_SIGF_HANDLER(%rbx)
+.startrtsigcode:
+ movq $LINUX_SYS_linux_rt_sigreturn,%rax /* linux_rt_sigreturn() */
+ syscall /* enter kernel with args */
+ hlt
+0: jmp 0b
+
+NON_GPROF_ENTRY(__vdso_clock_gettime)
+ movq $LINUX_SYS_linux_clock_gettime,%rax
+ syscall
+ ret
+.weak clock_gettime
+.set clock_gettime, __vdso_clock_gettime
+
+NON_GPROF_ENTRY(__vdso_time)
+ movq $LINUX_SYS_linux_time,%rax
+ syscall
+ ret
+.weak time
+.set time, __vdso_time
+
+NON_GPROF_ENTRY(__vdso_gettimeofday)
+ movq $LINUX_SYS_gettimeofday,%rax
+ syscall
+ ret
+.weak gettimeofday
+.set gettimeofday, __vdso_gettimeofday
+
+NON_GPROF_ENTRY(__vdso_getcpu)
+ movq $-38,%rax /* not implemented */
+ ret
+.weak getcpu
+.set getcpu, __vdso_getcpu
+
+#if 0
+ .section .note.Linux, "a",@note
+ .long 2f - 1f /* namesz */
+ .balign 4
+ .long 4f - 3f /* descsz */
+ .long 0
+1:
+ .asciz "Linux"
+2:
+ .balign 4
+3:
+ .long LINUX_VERSION_CODE
+4:
+ .balign 4
+ .previous
+#endif
diff --git a/sys/amd64/linux/linux_machdep.c b/sys/amd64/linux/linux_machdep.c
new file mode 100644
index 0000000..451e4b4
--- /dev/null
+++ b/sys/amd64/linux/linux_machdep.c
@@ -0,0 +1,433 @@
+/*-
+ * Copyright (c) 2013 Dmitry Chagin
+ * Copyright (c) 2004 Tim J. Robbins
+ * Copyright (c) 2002 Doug Rabson
+ * Copyright (c) 2000 Marcel Moolenaar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
+#include <sys/capability.h>
+#include <sys/dirent.h>
+#include <sys/file.h>
+#include <sys/fcntl.h>
+#include <sys/filedesc.h>
+#include <sys/clock.h>
+#include <sys/imgact.h>
+#include <sys/ktr.h>
+#include <sys/limits.h>
+#include <sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mman.h>
+#include <sys/mutex.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/resource.h>
+#include <sys/resourcevar.h>
+#include <sys/sched.h>
+#include <sys/syscallsubr.h>
+#include <sys/sysproto.h>
+#include <sys/vnode.h>
+#include <sys/unistd.h>
+#include <sys/wait.h>
+
+#include <security/mac/mac_framework.h>
+
+#include <ufs/ufs/extattr.h>
+#include <ufs/ufs/quota.h>
+#include <ufs/ufs/ufsmount.h>
+
+#include <machine/frame.h>
+#include <machine/md_var.h>
+#include <machine/pcb.h>
+#include <machine/psl.h>
+#include <machine/segments.h>
+#include <machine/specialreg.h>
+
+#include <vm/vm.h>
+#include <vm/pmap.h>
+#include <vm/vm_extern.h>
+#include <vm/vm_kern.h>
+#include <vm/vm_map.h>
+
+#include <amd64/linux/linux.h>
+#include <amd64/linux/linux_proto.h>
+#include <compat/linux/linux_ipc.h>
+#include <compat/linux/linux_file.h>
+#include <compat/linux/linux_misc.h>
+#include <compat/linux/linux_signal.h>
+#include <compat/linux/linux_util.h>
+#include <compat/linux/linux_emul.h>
+
+
+int
+linux_execve(struct thread *td, struct linux_execve_args *args)
+{
+ struct image_args eargs;
+ char *path;
+ int error;
+
+ LCONVPATHEXIST(td, args->path, &path);
+
+ LINUX_CTR(execve);
+
+ error = exec_copyin_args(&eargs, path, UIO_SYSSPACE, args->argp,
+ args->envp);
+ free(path, M_TEMP);
+ if (error == 0)
+ error = linux_common_execve(td, &eargs);
+ return (error);
+}
+
+int
+linux_set_upcall_kse(struct thread *td, register_t stack)
+{
+
+ if (stack)
+ td->td_frame->tf_rsp = stack;
+
+ /*
+ * The newly created Linux thread returns
+ * to the user space by the same path that a parent do.
+ */
+ td->td_frame->tf_rax = 0;
+ return (0);
+}
+
+#define STACK_SIZE (2 * 1024 * 1024)
+#define GUARD_SIZE (4 * PAGE_SIZE)
+
+int
+linux_mmap2(struct thread *td, struct linux_mmap2_args *args)
+{
+ struct proc *p = td->td_proc;
+ struct mmap_args /* {
+ caddr_t addr;
+ size_t len;
+ int prot;
+ int flags;
+ int fd;
+ long pad;
+ off_t pos;
+ } */ bsd_args;
+ int error;
+ struct file *fp;
+ cap_rights_t rights;
+
+ LINUX_CTR6(mmap2, "0x%lx, %ld, %ld, 0x%08lx, %ld, 0x%lx",
+ args->addr, args->len, args->prot,
+ args->flags, args->fd, args->pgoff);
+
+ error = 0;
+ bsd_args.flags = 0;
+ fp = NULL;
+
+ /*
+ * Linux mmap(2):
+ * You must specify exactly one of MAP_SHARED and MAP_PRIVATE
+ */
+ if (! ((args->flags & LINUX_MAP_SHARED) ^
+ (args->flags & LINUX_MAP_PRIVATE)))
+ return (EINVAL);
+
+ if (args->flags & LINUX_MAP_SHARED)
+ bsd_args.flags |= MAP_SHARED;
+ if (args->flags & LINUX_MAP_PRIVATE)
+ bsd_args.flags |= MAP_PRIVATE;
+ if (args->flags & LINUX_MAP_FIXED)
+ bsd_args.flags |= MAP_FIXED;
+ if (args->flags & LINUX_MAP_ANON)
+ bsd_args.flags |= MAP_ANON;
+ else
+ bsd_args.flags |= MAP_NOSYNC;
+ if (args->flags & LINUX_MAP_GROWSDOWN)
+ bsd_args.flags |= MAP_STACK;
+
+ /*
+ * PROT_READ, PROT_WRITE, or PROT_EXEC implies PROT_READ and PROT_EXEC
+ * on Linux/i386. We do this to ensure maximum compatibility.
+ * Linux/ia64 does the same in i386 emulation mode.
+ */
+ bsd_args.prot = args->prot;
+ if (bsd_args.prot & (PROT_READ | PROT_WRITE | PROT_EXEC))
+ bsd_args.prot |= PROT_READ | PROT_EXEC;
+
+ /* Linux does not check file descriptor when MAP_ANONYMOUS is set. */
+ bsd_args.fd = (bsd_args.flags & MAP_ANON) ? -1 : args->fd;
+ if (bsd_args.fd != -1) {
+ /*
+ * Linux follows Solaris mmap(2) description:
+ * The file descriptor fildes is opened with
+ * read permission, regardless of the
+ * protection options specified.
+ */
+
+ error = fget(td, bsd_args.fd,
+ cap_rights_init(&rights, CAP_MMAP), &fp);
+ if (error != 0 )
+ return (error);
+ if (fp->f_type != DTYPE_VNODE) {
+ fdrop(fp, td);
+ return (EINVAL);
+ }
+
+ /* Linux mmap() just fails for O_WRONLY files */
+ if (!(fp->f_flag & FREAD)) {
+ fdrop(fp, td);
+ return (EACCES);
+ }
+
+ fdrop(fp, td);
+ }
+
+ if (args->flags & LINUX_MAP_GROWSDOWN) {
+ /*
+ * The Linux MAP_GROWSDOWN option does not limit auto
+ * growth of the region. Linux mmap with this option
+ * takes as addr the inital BOS, and as len, the initial
+ * region size. It can then grow down from addr without
+ * limit. However, Linux threads has an implicit internal
+ * limit to stack size of STACK_SIZE. Its just not
+ * enforced explicitly in Linux. But, here we impose
+ * a limit of (STACK_SIZE - GUARD_SIZE) on the stack
+ * region, since we can do this with our mmap.
+ *
+ * Our mmap with MAP_STACK takes addr as the maximum
+ * downsize limit on BOS, and as len the max size of
+ * the region. It then maps the top SGROWSIZ bytes,
+ * and auto grows the region down, up to the limit
+ * in addr.
+ *
+ * If we don't use the MAP_STACK option, the effect
+ * of this code is to allocate a stack region of a
+ * fixed size of (STACK_SIZE - GUARD_SIZE).
+ */
+
+ if ((caddr_t)PTRIN(args->addr) + args->len >
+ p->p_vmspace->vm_maxsaddr) {
+ /*
+ * Some Linux apps will attempt to mmap
+ * thread stacks near the top of their
+ * address space. If their TOS is greater
+ * than vm_maxsaddr, vm_map_growstack()
+ * will confuse the thread stack with the
+ * process stack and deliver a SEGV if they
+ * attempt to grow the thread stack past their
+ * current stacksize rlimit. To avoid this,
+ * adjust vm_maxsaddr upwards to reflect
+ * the current stacksize rlimit rather
+ * than the maximum possible stacksize.
+ * It would be better to adjust the
+ * mmap'ed region, but some apps do not check
+ * mmap's return value.
+ */
+ PROC_LOCK(p);
+ p->p_vmspace->vm_maxsaddr = (char *)USRSTACK -
+ lim_cur_proc(p, RLIMIT_STACK);
+ PROC_UNLOCK(p);
+ }
+
+ /*
+ * This gives us our maximum stack size and a new BOS.
+ * If we're using VM_STACK, then mmap will just map
+ * the top SGROWSIZ bytes, and let the stack grow down
+ * to the limit at BOS. If we're not using VM_STACK
+ * we map the full stack, since we don't have a way
+ * to autogrow it.
+ */
+ if (args->len > STACK_SIZE - GUARD_SIZE) {
+ bsd_args.addr = (caddr_t)PTRIN(args->addr);
+ bsd_args.len = args->len;
+ } else {
+ bsd_args.addr = (caddr_t)PTRIN(args->addr) -
+ (STACK_SIZE - GUARD_SIZE - args->len);
+ bsd_args.len = STACK_SIZE - GUARD_SIZE;
+ }
+ } else {
+ bsd_args.addr = (caddr_t)PTRIN(args->addr);
+ bsd_args.len = args->len;
+ }
+ bsd_args.pos = (off_t)args->pgoff;
+
+ error = sys_mmap(td, &bsd_args);
+
+ LINUX_CTR2(mmap2, "return: %d (%p)",
+ error, td->td_retval[0]);
+ return (error);
+}
+
+int
+linux_mprotect(struct thread *td, struct linux_mprotect_args *uap)
+{
+ struct mprotect_args bsd_args;
+
+ LINUX_CTR(mprotect);
+
+ bsd_args.addr = uap->addr;
+ bsd_args.len = uap->len;
+ bsd_args.prot = uap->prot;
+ if (bsd_args.prot & (PROT_READ | PROT_WRITE | PROT_EXEC))
+ bsd_args.prot |= PROT_READ | PROT_EXEC;
+ return (sys_mprotect(td, &bsd_args));
+}
+
+int
+linux_iopl(struct thread *td, struct linux_iopl_args *args)
+{
+ int error;
+
+ LINUX_CTR(iopl);
+
+ if (args->level > 3)
+ return (EINVAL);
+ if ((error = priv_check(td, PRIV_IO)) != 0)
+ return (error);
+ if ((error = securelevel_gt(td->td_ucred, 0)) != 0)
+ return (error);
+ td->td_frame->tf_rflags = (td->td_frame->tf_rflags & ~PSL_IOPL) |
+ (args->level * (PSL_IOPL / 3));
+
+ return (0);
+}
+
+int
+linux_rt_sigsuspend(struct thread *td, struct linux_rt_sigsuspend_args *uap)
+{
+ l_sigset_t lmask;
+ sigset_t sigmask;
+ int error;
+
+ LINUX_CTR2(rt_sigsuspend, "%p, %ld",
+ uap->newset, uap->sigsetsize);
+
+ if (uap->sigsetsize != sizeof(l_sigset_t))
+ return (EINVAL);
+
+ error = copyin(uap->newset, &lmask, sizeof(l_sigset_t));
+ if (error)
+ return (error);
+
+ linux_to_bsd_sigset(&lmask, &sigmask);
+ return (kern_sigsuspend(td, sigmask));
+}
+
+int
+linux_pause(struct thread *td, struct linux_pause_args *args)
+{
+ struct proc *p = td->td_proc;
+ sigset_t sigmask;
+
+ LINUX_CTR(pause);
+
+ PROC_LOCK(p);
+ sigmask = td->td_sigmask;
+ PROC_UNLOCK(p);
+ return (kern_sigsuspend(td, sigmask));
+}
+
+int
+linux_sigaltstack(struct thread *td, struct linux_sigaltstack_args *uap)
+{
+ stack_t ss, oss;
+ l_stack_t lss;
+ int error;
+
+ LINUX_CTR2(sigaltstack, "%p, %p", uap->uss, uap->uoss);
+
+ if (uap->uss != NULL) {
+ error = copyin(uap->uss, &lss, sizeof(l_stack_t));
+ if (error)
+ return (error);
+
+ ss.ss_sp = PTRIN(lss.ss_sp);
+ ss.ss_size = lss.ss_size;
+ ss.ss_flags = linux_to_bsd_sigaltstack(lss.ss_flags);
+ }
+ error = kern_sigaltstack(td, (uap->uss != NULL) ? &ss : NULL,
+ (uap->uoss != NULL) ? &oss : NULL);
+ if (!error && uap->uoss != NULL) {
+ lss.ss_sp = PTROUT(oss.ss_sp);
+ lss.ss_size = oss.ss_size;
+ lss.ss_flags = bsd_to_linux_sigaltstack(oss.ss_flags);
+ error = copyout(&lss, uap->uoss, sizeof(l_stack_t));
+ }
+
+ return (error);
+}
+
+/* XXX do all */
+int
+linux_arch_prctl(struct thread *td, struct linux_arch_prctl_args *args)
+{
+ int error;
+ struct pcb *pcb;
+
+ LINUX_CTR2(arch_prctl, "0x%x, %p", args->code, args->addr);
+
+ error = ENOTSUP;
+ pcb = td->td_pcb;
+
+ switch (args->code) {
+ case LINUX_ARCH_GET_GS:
+ error = copyout(&pcb->pcb_gsbase, (unsigned long *)args->addr,
+ sizeof(args->addr));
+ break;
+ case LINUX_ARCH_SET_GS:
+ if (args->addr >= VM_MAXUSER_ADDRESS)
+ return(EPERM);
+ break;
+ case LINUX_ARCH_GET_FS:
+ error = copyout(&pcb->pcb_fsbase, (unsigned long *)args->addr,
+ sizeof(args->addr));
+ break;
+ case LINUX_ARCH_SET_FS:
+ error = linux_set_cloned_tls(td, (void *)args->addr);
+ break;
+ default:
+ error = EINVAL;
+ }
+ return (error);
+}
+
+int
+linux_set_cloned_tls(struct thread *td, void *desc)
+{
+ struct pcb *pcb;
+
+ if ((uint64_t)desc >= VM_MAXUSER_ADDRESS)
+ return (EPERM);
+
+ pcb = td->td_pcb;
+ pcb->pcb_fsbase = (register_t)desc;
+ td->td_frame->tf_fs = _ufssel;
+
+ return (0);
+}
diff --git a/sys/amd64/linux/linux_proto.h b/sys/amd64/linux/linux_proto.h
new file mode 100644
index 0000000..795a830
--- /dev/null
+++ b/sys/amd64/linux/linux_proto.h
@@ -0,0 +1,1663 @@
+/*
+ * System call prototypes.
+ *
+ * DO NOT EDIT-- this file is automatically generated.
+ * $FreeBSD$
+ * created from FreeBSD: head/sys/amd64/linux/syscalls.master 283492 2015-05-24 18:08:01Z dchagin
+ */
+
+#ifndef _LINUX_SYSPROTO_H_
+#define _LINUX_SYSPROTO_H_
+
+#include <sys/signal.h>
+#include <sys/acl.h>
+#include <sys/cpuset.h>
+#include <sys/_ffcounter.h>
+#include <sys/_semaphore.h>
+#include <sys/ucontext.h>
+#include <sys/wait.h>
+
+#include <bsm/audit_kevents.h>
+
+struct proc;
+
+struct thread;
+
+#define PAD_(t) (sizeof(register_t) <= sizeof(t) ? \
+ 0 : sizeof(register_t) - sizeof(t))
+
+#if BYTE_ORDER == LITTLE_ENDIAN
+#define PADL_(t) 0
+#define PADR_(t) PAD_(t)
+#else
+#define PADL_(t) PAD_(t)
+#define PADR_(t) 0
+#endif
+
+#define nosys linux_nosys
+struct linux_open_args {
+ char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
+ char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)];
+};
+struct linux_newstat_args {
+ char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char buf_l_[PADL_(struct l_newstat *)]; struct l_newstat * buf; char buf_r_[PADR_(struct l_newstat *)];
+};
+struct linux_newfstat_args {
+ char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
+ char buf_l_[PADL_(struct l_newstat *)]; struct l_newstat * buf; char buf_r_[PADR_(struct l_newstat *)];
+};
+struct linux_newlstat_args {
+ char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char buf_l_[PADL_(struct l_newstat *)]; struct l_newstat * buf; char buf_r_[PADR_(struct l_newstat *)];
+};
+struct linux_lseek_args {
+ char fdes_l_[PADL_(l_uint)]; l_uint fdes; char fdes_r_[PADR_(l_uint)];
+ char off_l_[PADL_(l_off_t)]; l_off_t off; char off_r_[PADR_(l_off_t)];
+ char whence_l_[PADL_(l_int)]; l_int whence; char whence_r_[PADR_(l_int)];
+};
+struct linux_mmap2_args {
+ char addr_l_[PADL_(l_ulong)]; l_ulong addr; char addr_r_[PADR_(l_ulong)];
+ char len_l_[PADL_(l_ulong)]; l_ulong len; char len_r_[PADR_(l_ulong)];
+ char prot_l_[PADL_(l_ulong)]; l_ulong prot; char prot_r_[PADR_(l_ulong)];
+ char flags_l_[PADL_(l_ulong)]; l_ulong flags; char flags_r_[PADR_(l_ulong)];
+ char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
+ char pgoff_l_[PADL_(l_ulong)]; l_ulong pgoff; char pgoff_r_[PADR_(l_ulong)];
+};
+struct linux_mprotect_args {
+ char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)];
+ char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)];
+ char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)];
+};
+struct linux_brk_args {
+ char dsend_l_[PADL_(l_ulong)]; l_ulong dsend; char dsend_r_[PADR_(l_ulong)];
+};
+struct linux_rt_sigaction_args {
+ char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)];
+ char act_l_[PADL_(l_sigaction_t *)]; l_sigaction_t * act; char act_r_[PADR_(l_sigaction_t *)];
+ char oact_l_[PADL_(l_sigaction_t *)]; l_sigaction_t * oact; char oact_r_[PADR_(l_sigaction_t *)];
+ char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)];
+};
+struct linux_rt_sigprocmask_args {
+ char how_l_[PADL_(l_int)]; l_int how; char how_r_[PADR_(l_int)];
+ char mask_l_[PADL_(l_sigset_t *)]; l_sigset_t * mask; char mask_r_[PADR_(l_sigset_t *)];
+ char omask_l_[PADL_(l_sigset_t *)]; l_sigset_t * omask; char omask_r_[PADR_(l_sigset_t *)];
+ char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)];
+};
+struct linux_rt_sigreturn_args {
+ char ucp_l_[PADL_(struct l_ucontext *)]; struct l_ucontext * ucp; char ucp_r_[PADR_(struct l_ucontext *)];
+};
+struct linux_ioctl_args {
+ char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
+ char cmd_l_[PADL_(l_uint)]; l_uint cmd; char cmd_r_[PADR_(l_uint)];
+ char arg_l_[PADL_(uintptr_t)]; uintptr_t arg; char arg_r_[PADR_(uintptr_t)];
+};
+struct linux_pread_args {
+ char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
+ char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
+ char nbyte_l_[PADL_(l_size_t)]; l_size_t nbyte; char nbyte_r_[PADR_(l_size_t)];
+ char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)];
+};
+struct linux_pwrite_args {
+ char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
+ char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
+ char nbyte_l_[PADL_(l_size_t)]; l_size_t nbyte; char nbyte_r_[PADR_(l_size_t)];
+ char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)];
+};
+struct linux_access_args {
+ char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char amode_l_[PADL_(l_int)]; l_int amode; char amode_r_[PADR_(l_int)];
+};
+struct linux_pipe_args {
+ char pipefds_l_[PADL_(l_ulong *)]; l_ulong * pipefds; char pipefds_r_[PADR_(l_ulong *)];
+};
+struct linux_select_args {
+ char nfds_l_[PADL_(l_int)]; l_int nfds; char nfds_r_[PADR_(l_int)];
+ char readfds_l_[PADL_(l_fd_set *)]; l_fd_set * readfds; char readfds_r_[PADR_(l_fd_set *)];
+ char writefds_l_[PADL_(l_fd_set *)]; l_fd_set * writefds; char writefds_r_[PADR_(l_fd_set *)];
+ char exceptfds_l_[PADL_(l_fd_set *)]; l_fd_set * exceptfds; char exceptfds_r_[PADR_(l_fd_set *)];
+ char timeout_l_[PADL_(struct l_timeval *)]; struct l_timeval * timeout; char timeout_r_[PADR_(struct l_timeval *)];
+};
+struct linux_mremap_args {
+ char addr_l_[PADL_(l_ulong)]; l_ulong addr; char addr_r_[PADR_(l_ulong)];
+ char old_len_l_[PADL_(l_ulong)]; l_ulong old_len; char old_len_r_[PADR_(l_ulong)];
+ char new_len_l_[PADL_(l_ulong)]; l_ulong new_len; char new_len_r_[PADR_(l_ulong)];
+ char flags_l_[PADL_(l_ulong)]; l_ulong flags; char flags_r_[PADR_(l_ulong)];
+ char new_addr_l_[PADL_(l_ulong)]; l_ulong new_addr; char new_addr_r_[PADR_(l_ulong)];
+};
+struct linux_msync_args {
+ char addr_l_[PADL_(l_ulong)]; l_ulong addr; char addr_r_[PADR_(l_ulong)];
+ char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)];
+ char fl_l_[PADL_(l_int)]; l_int fl; char fl_r_[PADR_(l_int)];
+};
+struct linux_mincore_args {
+ char start_l_[PADL_(l_ulong)]; l_ulong start; char start_r_[PADR_(l_ulong)];
+ char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)];
+ char vec_l_[PADL_(u_char *)]; u_char * vec; char vec_r_[PADR_(u_char *)];
+};
+struct linux_shmget_args {
+ char key_l_[PADL_(l_key_t)]; l_key_t key; char key_r_[PADR_(l_key_t)];
+ char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)];
+ char shmflg_l_[PADL_(l_int)]; l_int shmflg; char shmflg_r_[PADR_(l_int)];
+};
+struct linux_shmat_args {
+ char shmid_l_[PADL_(l_int)]; l_int shmid; char shmid_r_[PADR_(l_int)];
+ char shmaddr_l_[PADL_(char *)]; char * shmaddr; char shmaddr_r_[PADR_(char *)];
+ char shmflg_l_[PADL_(l_int)]; l_int shmflg; char shmflg_r_[PADR_(l_int)];
+};
+struct linux_shmctl_args {
+ char shmid_l_[PADL_(l_int)]; l_int shmid; char shmid_r_[PADR_(l_int)];
+ char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)];
+ char buf_l_[PADL_(struct l_shmid_ds *)]; struct l_shmid_ds * buf; char buf_r_[PADR_(struct l_shmid_ds *)];
+};
+struct linux_pause_args {
+ register_t dummy;
+};
+struct linux_nanosleep_args {
+ char rqtp_l_[PADL_(const struct l_timespec *)]; const struct l_timespec * rqtp; char rqtp_r_[PADR_(const struct l_timespec *)];
+ char rmtp_l_[PADL_(struct l_timespec *)]; struct l_timespec * rmtp; char rmtp_r_[PADR_(struct l_timespec *)];
+};
+struct linux_getitimer_args {
+ char which_l_[PADL_(l_int)]; l_int which; char which_r_[PADR_(l_int)];
+ char itv_l_[PADL_(struct l_itimerval *)]; struct l_itimerval * itv; char itv_r_[PADR_(struct l_itimerval *)];
+};
+struct linux_alarm_args {
+ char secs_l_[PADL_(l_uint)]; l_uint secs; char secs_r_[PADR_(l_uint)];
+};
+struct linux_setitimer_args {
+ char which_l_[PADL_(l_int)]; l_int which; char which_r_[PADR_(l_int)];
+ char itv_l_[PADL_(struct l_itimerval *)]; struct l_itimerval * itv; char itv_r_[PADR_(struct l_itimerval *)];
+ char oitv_l_[PADL_(struct l_itimerval *)]; struct l_itimerval * oitv; char oitv_r_[PADR_(struct l_itimerval *)];
+};
+struct linux_getpid_args {
+ register_t dummy;
+};
+struct linux_sendfile_args {
+ char out_l_[PADL_(int)]; int out; char out_r_[PADR_(int)];
+ char in_l_[PADL_(int)]; int in; char in_r_[PADR_(int)];
+ char offset_l_[PADL_(l_long *)]; l_long * offset; char offset_r_[PADR_(l_long *)];
+ char count_l_[PADL_(l_size_t)]; l_size_t count; char count_r_[PADR_(l_size_t)];
+};
+struct linux_socket_args {
+ char domain_l_[PADL_(l_int)]; l_int domain; char domain_r_[PADR_(l_int)];
+ char type_l_[PADL_(l_int)]; l_int type; char type_r_[PADR_(l_int)];
+ char protocol_l_[PADL_(l_int)]; l_int protocol; char protocol_r_[PADR_(l_int)];
+};
+struct linux_connect_args {
+ char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
+ char name_l_[PADL_(l_uintptr_t)]; l_uintptr_t name; char name_r_[PADR_(l_uintptr_t)];
+ char namelen_l_[PADL_(l_int)]; l_int namelen; char namelen_r_[PADR_(l_int)];
+};
+struct linux_accept_args {
+ char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
+ char addr_l_[PADL_(l_uintptr_t)]; l_uintptr_t addr; char addr_r_[PADR_(l_uintptr_t)];
+ char namelen_l_[PADL_(l_uintptr_t)]; l_uintptr_t namelen; char namelen_r_[PADR_(l_uintptr_t)];
+};
+struct linux_sendto_args {
+ char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
+ char msg_l_[PADL_(l_uintptr_t)]; l_uintptr_t msg; char msg_r_[PADR_(l_uintptr_t)];
+ char len_l_[PADL_(l_int)]; l_int len; char len_r_[PADR_(l_int)];
+ char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
+ char to_l_[PADL_(l_uintptr_t)]; l_uintptr_t to; char to_r_[PADR_(l_uintptr_t)];
+ char tolen_l_[PADL_(l_int)]; l_int tolen; char tolen_r_[PADR_(l_int)];
+};
+struct linux_recvfrom_args {
+ char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
+ char buf_l_[PADL_(l_uintptr_t)]; l_uintptr_t buf; char buf_r_[PADR_(l_uintptr_t)];
+ char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)];
+ char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
+ char from_l_[PADL_(l_uintptr_t)]; l_uintptr_t from; char from_r_[PADR_(l_uintptr_t)];
+ char fromlen_l_[PADL_(l_uintptr_t)]; l_uintptr_t fromlen; char fromlen_r_[PADR_(l_uintptr_t)];
+};
+struct linux_sendmsg_args {
+ char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
+ char msg_l_[PADL_(l_uintptr_t)]; l_uintptr_t msg; char msg_r_[PADR_(l_uintptr_t)];
+ char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
+};
+struct linux_recvmsg_args {
+ char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
+ char msg_l_[PADL_(l_uintptr_t)]; l_uintptr_t msg; char msg_r_[PADR_(l_uintptr_t)];
+ char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
+};
+struct linux_shutdown_args {
+ char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
+ char how_l_[PADL_(l_int)]; l_int how; char how_r_[PADR_(l_int)];
+};
+struct linux_bind_args {
+ char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
+ char name_l_[PADL_(l_uintptr_t)]; l_uintptr_t name; char name_r_[PADR_(l_uintptr_t)];
+ char namelen_l_[PADL_(l_int)]; l_int namelen; char namelen_r_[PADR_(l_int)];
+};
+struct linux_listen_args {
+ char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
+ char backlog_l_[PADL_(l_int)]; l_int backlog; char backlog_r_[PADR_(l_int)];
+};
+struct linux_getsockname_args {
+ char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
+ char addr_l_[PADL_(l_uintptr_t)]; l_uintptr_t addr; char addr_r_[PADR_(l_uintptr_t)];
+ char namelen_l_[PADL_(l_uintptr_t)]; l_uintptr_t namelen; char namelen_r_[PADR_(l_uintptr_t)];
+};
+struct linux_getpeername_args {
+ char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
+ char addr_l_[PADL_(l_uintptr_t)]; l_uintptr_t addr; char addr_r_[PADR_(l_uintptr_t)];
+ char namelen_l_[PADL_(l_uintptr_t)]; l_uintptr_t namelen; char namelen_r_[PADR_(l_uintptr_t)];
+};
+struct linux_socketpair_args {
+ char domain_l_[PADL_(l_int)]; l_int domain; char domain_r_[PADR_(l_int)];
+ char type_l_[PADL_(l_int)]; l_int type; char type_r_[PADR_(l_int)];
+ char protocol_l_[PADL_(l_int)]; l_int protocol; char protocol_r_[PADR_(l_int)];
+ char rsv_l_[PADL_(l_uintptr_t)]; l_uintptr_t rsv; char rsv_r_[PADR_(l_uintptr_t)];
+};
+struct linux_setsockopt_args {
+ char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
+ char level_l_[PADL_(l_int)]; l_int level; char level_r_[PADR_(l_int)];
+ char optname_l_[PADL_(l_int)]; l_int optname; char optname_r_[PADR_(l_int)];
+ char optval_l_[PADL_(l_uintptr_t)]; l_uintptr_t optval; char optval_r_[PADR_(l_uintptr_t)];
+ char optlen_l_[PADL_(l_int)]; l_int optlen; char optlen_r_[PADR_(l_int)];
+};
+struct linux_getsockopt_args {
+ char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
+ char level_l_[PADL_(l_int)]; l_int level; char level_r_[PADR_(l_int)];
+ char optname_l_[PADL_(l_int)]; l_int optname; char optname_r_[PADR_(l_int)];
+ char optval_l_[PADL_(l_uintptr_t)]; l_uintptr_t optval; char optval_r_[PADR_(l_uintptr_t)];
+ char optlen_l_[PADL_(l_uintptr_t)]; l_uintptr_t optlen; char optlen_r_[PADR_(l_uintptr_t)];
+};
+struct linux_clone_args {
+ char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
+ char stack_l_[PADL_(void *)]; void * stack; char stack_r_[PADR_(void *)];
+ char parent_tidptr_l_[PADL_(void *)]; void * parent_tidptr; char parent_tidptr_r_[PADR_(void *)];
+ char child_tidptr_l_[PADL_(void *)]; void * child_tidptr; char child_tidptr_r_[PADR_(void *)];
+ char tls_l_[PADL_(void *)]; void * tls; char tls_r_[PADR_(void *)];
+};
+struct linux_fork_args {
+ register_t dummy;
+};
+struct linux_vfork_args {
+ register_t dummy;
+};
+struct linux_execve_args {
+ char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char argp_l_[PADL_(char **)]; char ** argp; char argp_r_[PADR_(char **)];
+ char envp_l_[PADL_(char **)]; char ** envp; char envp_r_[PADR_(char **)];
+};
+struct linux_exit_args {
+ char rval_l_[PADL_(int)]; int rval; char rval_r_[PADR_(int)];
+};
+struct linux_wait4_args {
+ char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+ char status_l_[PADL_(l_int *)]; l_int * status; char status_r_[PADR_(l_int *)];
+ char options_l_[PADL_(l_int)]; l_int options; char options_r_[PADR_(l_int)];
+ char rusage_l_[PADL_(struct rusage *)]; struct rusage * rusage; char rusage_r_[PADR_(struct rusage *)];
+};
+struct linux_kill_args {
+ char pid_l_[PADL_(l_int)]; l_int pid; char pid_r_[PADR_(l_int)];
+ char signum_l_[PADL_(l_int)]; l_int signum; char signum_r_[PADR_(l_int)];
+};
+struct linux_newuname_args {
+ char buf_l_[PADL_(struct l_new_utsname *)]; struct l_new_utsname * buf; char buf_r_[PADR_(struct l_new_utsname *)];
+};
+struct linux_semget_args {
+ char key_l_[PADL_(l_key_t)]; l_key_t key; char key_r_[PADR_(l_key_t)];
+ char nsems_l_[PADL_(l_int)]; l_int nsems; char nsems_r_[PADR_(l_int)];
+ char semflg_l_[PADL_(l_int)]; l_int semflg; char semflg_r_[PADR_(l_int)];
+};
+struct linux_semop_args {
+ char semid_l_[PADL_(l_int)]; l_int semid; char semid_r_[PADR_(l_int)];
+ char tsops_l_[PADL_(struct l_sembuf *)]; struct l_sembuf * tsops; char tsops_r_[PADR_(struct l_sembuf *)];
+ char nsops_l_[PADL_(l_uint)]; l_uint nsops; char nsops_r_[PADR_(l_uint)];
+};
+struct linux_semctl_args {
+ char semid_l_[PADL_(l_int)]; l_int semid; char semid_r_[PADR_(l_int)];
+ char semnum_l_[PADL_(l_int)]; l_int semnum; char semnum_r_[PADR_(l_int)];
+ char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)];
+ char arg_l_[PADL_(union l_semun)]; union l_semun arg; char arg_r_[PADR_(union l_semun)];
+};
+struct linux_shmdt_args {
+ char shmaddr_l_[PADL_(char *)]; char * shmaddr; char shmaddr_r_[PADR_(char *)];
+};
+struct linux_msgget_args {
+ char key_l_[PADL_(l_key_t)]; l_key_t key; char key_r_[PADR_(l_key_t)];
+ char msgflg_l_[PADL_(l_int)]; l_int msgflg; char msgflg_r_[PADR_(l_int)];
+};
+struct linux_msgsnd_args {
+ char msqid_l_[PADL_(l_int)]; l_int msqid; char msqid_r_[PADR_(l_int)];
+ char msgp_l_[PADL_(struct l_msgbuf *)]; struct l_msgbuf * msgp; char msgp_r_[PADR_(struct l_msgbuf *)];
+ char msgsz_l_[PADL_(l_size_t)]; l_size_t msgsz; char msgsz_r_[PADR_(l_size_t)];
+ char msgflg_l_[PADL_(l_int)]; l_int msgflg; char msgflg_r_[PADR_(l_int)];
+};
+struct linux_msgrcv_args {
+ char msqid_l_[PADL_(l_int)]; l_int msqid; char msqid_r_[PADR_(l_int)];
+ char msgp_l_[PADL_(struct l_msgbuf *)]; struct l_msgbuf * msgp; char msgp_r_[PADR_(struct l_msgbuf *)];
+ char msgsz_l_[PADL_(l_size_t)]; l_size_t msgsz; char msgsz_r_[PADR_(l_size_t)];
+ char msgtyp_l_[PADL_(l_long)]; l_long msgtyp; char msgtyp_r_[PADR_(l_long)];
+ char msgflg_l_[PADL_(l_int)]; l_int msgflg; char msgflg_r_[PADR_(l_int)];
+};
+struct linux_msgctl_args {
+ char msqid_l_[PADL_(l_int)]; l_int msqid; char msqid_r_[PADR_(l_int)];
+ char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)];
+ char buf_l_[PADL_(struct l_msqid_ds *)]; struct l_msqid_ds * buf; char buf_r_[PADR_(struct l_msqid_ds *)];
+};
+struct linux_fcntl_args {
+ char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
+ char cmd_l_[PADL_(l_uint)]; l_uint cmd; char cmd_r_[PADR_(l_uint)];
+ char arg_l_[PADL_(l_ulong)]; l_ulong arg; char arg_r_[PADR_(l_ulong)];
+};
+struct linux_fdatasync_args {
+ char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
+};
+struct linux_truncate_args {
+ char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char length_l_[PADL_(l_ulong)]; l_ulong length; char length_r_[PADR_(l_ulong)];
+};
+struct linux_ftruncate_args {
+ char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
+ char length_l_[PADL_(l_long)]; l_long length; char length_r_[PADR_(l_long)];
+};
+struct linux_getdents_args {
+ char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
+ char dent_l_[PADL_(void *)]; void * dent; char dent_r_[PADR_(void *)];
+ char count_l_[PADL_(l_uint)]; l_uint count; char count_r_[PADR_(l_uint)];
+};
+struct linux_getcwd_args {
+ char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
+ char bufsize_l_[PADL_(l_ulong)]; l_ulong bufsize; char bufsize_r_[PADR_(l_ulong)];
+};
+struct linux_chdir_args {
+ char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+};
+struct linux_rename_args {
+ char from_l_[PADL_(char *)]; char * from; char from_r_[PADR_(char *)];
+ char to_l_[PADL_(char *)]; char * to; char to_r_[PADR_(char *)];
+};
+struct linux_mkdir_args {
+ char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)];
+};
+struct linux_rmdir_args {
+ char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+};
+struct linux_creat_args {
+ char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)];
+};
+struct linux_link_args {
+ char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char to_l_[PADL_(char *)]; char * to; char to_r_[PADR_(char *)];
+};
+struct linux_unlink_args {
+ char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+};
+struct linux_symlink_args {
+ char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char to_l_[PADL_(char *)]; char * to; char to_r_[PADR_(char *)];
+};
+struct linux_readlink_args {
+ char name_l_[PADL_(char *)]; char * name; char name_r_[PADR_(char *)];
+ char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
+ char count_l_[PADL_(l_int)]; l_int count; char count_r_[PADR_(l_int)];
+};
+struct linux_chmod_args {
+ char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char mode_l_[PADL_(l_mode_t)]; l_mode_t mode; char mode_r_[PADR_(l_mode_t)];
+};
+struct linux_chown_args {
+ char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char uid_l_[PADL_(l_uid_t)]; l_uid_t uid; char uid_r_[PADR_(l_uid_t)];
+ char gid_l_[PADL_(l_gid_t)]; l_gid_t gid; char gid_r_[PADR_(l_gid_t)];
+};
+struct linux_lchown_args {
+ char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char uid_l_[PADL_(l_uid_t)]; l_uid_t uid; char uid_r_[PADR_(l_uid_t)];
+ char gid_l_[PADL_(l_gid_t)]; l_gid_t gid; char gid_r_[PADR_(l_gid_t)];
+};
+struct linux_getrlimit_args {
+ char resource_l_[PADL_(l_uint)]; l_uint resource; char resource_r_[PADR_(l_uint)];
+ char rlim_l_[PADL_(struct l_rlimit *)]; struct l_rlimit * rlim; char rlim_r_[PADR_(struct l_rlimit *)];
+};
+struct linux_sysinfo_args {
+ char info_l_[PADL_(struct l_sysinfo *)]; struct l_sysinfo * info; char info_r_[PADR_(struct l_sysinfo *)];
+};
+struct linux_times_args {
+ char buf_l_[PADL_(struct l_times_argv *)]; struct l_times_argv * buf; char buf_r_[PADR_(struct l_times_argv *)];
+};
+struct linux_ptrace_args {
+ char req_l_[PADL_(l_long)]; l_long req; char req_r_[PADR_(l_long)];
+ char pid_l_[PADL_(l_long)]; l_long pid; char pid_r_[PADR_(l_long)];
+ char addr_l_[PADL_(l_long)]; l_long addr; char addr_r_[PADR_(l_long)];
+ char data_l_[PADL_(l_long)]; l_long data; char data_r_[PADR_(l_long)];
+};
+struct linux_getuid_args {
+ register_t dummy;
+};
+struct linux_syslog_args {
+ char type_l_[PADL_(l_int)]; l_int type; char type_r_[PADR_(l_int)];
+ char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
+ char len_l_[PADL_(l_int)]; l_int len; char len_r_[PADR_(l_int)];
+};
+struct linux_getgid_args {
+ register_t dummy;
+};
+struct linux_getppid_args {
+ register_t dummy;
+};
+struct linux_getgroups_args {
+ char gidsetsize_l_[PADL_(l_int)]; l_int gidsetsize; char gidsetsize_r_[PADR_(l_int)];
+ char grouplist_l_[PADL_(l_gid_t *)]; l_gid_t * grouplist; char grouplist_r_[PADR_(l_gid_t *)];
+};
+struct linux_setgroups_args {
+ char gidsetsize_l_[PADL_(l_int)]; l_int gidsetsize; char gidsetsize_r_[PADR_(l_int)];
+ char grouplist_l_[PADL_(l_gid_t *)]; l_gid_t * grouplist; char grouplist_r_[PADR_(l_gid_t *)];
+};
+struct linux_setfsuid_args {
+ char uid_l_[PADL_(l_uid_t)]; l_uid_t uid; char uid_r_[PADR_(l_uid_t)];
+};
+struct linux_setfsgid_args {
+ char gid_l_[PADL_(l_gid_t)]; l_gid_t gid; char gid_r_[PADR_(l_gid_t)];
+};
+struct linux_getsid_args {
+ char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+};
+struct linux_capget_args {
+ char hdrp_l_[PADL_(struct l_user_cap_header *)]; struct l_user_cap_header * hdrp; char hdrp_r_[PADR_(struct l_user_cap_header *)];
+ char datap_l_[PADL_(struct l_user_cap_data *)]; struct l_user_cap_data * datap; char datap_r_[PADR_(struct l_user_cap_data *)];
+};
+struct linux_capset_args {
+ char hdrp_l_[PADL_(struct l_user_cap_header *)]; struct l_user_cap_header * hdrp; char hdrp_r_[PADR_(struct l_user_cap_header *)];
+ char datap_l_[PADL_(struct l_user_cap_data *)]; struct l_user_cap_data * datap; char datap_r_[PADR_(struct l_user_cap_data *)];
+};
+struct linux_rt_sigpending_args {
+ char set_l_[PADL_(l_sigset_t *)]; l_sigset_t * set; char set_r_[PADR_(l_sigset_t *)];
+ char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)];
+};
+struct linux_rt_sigtimedwait_args {
+ char mask_l_[PADL_(l_sigset_t *)]; l_sigset_t * mask; char mask_r_[PADR_(l_sigset_t *)];
+ char ptr_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * ptr; char ptr_r_[PADR_(l_siginfo_t *)];
+ char timeout_l_[PADL_(struct l_timeval *)]; struct l_timeval * timeout; char timeout_r_[PADR_(struct l_timeval *)];
+ char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)];
+};
+struct linux_rt_sigqueueinfo_args {
+ char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+ char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)];
+ char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)];
+};
+struct linux_rt_sigsuspend_args {
+ char newset_l_[PADL_(l_sigset_t *)]; l_sigset_t * newset; char newset_r_[PADR_(l_sigset_t *)];
+ char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)];
+};
+struct linux_sigaltstack_args {
+ char uss_l_[PADL_(l_stack_t *)]; l_stack_t * uss; char uss_r_[PADR_(l_stack_t *)];
+ char uoss_l_[PADL_(l_stack_t *)]; l_stack_t * uoss; char uoss_r_[PADR_(l_stack_t *)];
+};
+struct linux_utime_args {
+ char fname_l_[PADL_(char *)]; char * fname; char fname_r_[PADR_(char *)];
+ char times_l_[PADL_(struct l_utimbuf *)]; struct l_utimbuf * times; char times_r_[PADR_(struct l_utimbuf *)];
+};
+struct linux_mknod_args {
+ char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)];
+ char dev_l_[PADL_(l_dev_t)]; l_dev_t dev; char dev_r_[PADR_(l_dev_t)];
+};
+struct linux_personality_args {
+ char per_l_[PADL_(l_ulong)]; l_ulong per; char per_r_[PADR_(l_ulong)];
+};
+struct linux_ustat_args {
+ char dev_l_[PADL_(l_dev_t)]; l_dev_t dev; char dev_r_[PADR_(l_dev_t)];
+ char ubuf_l_[PADL_(struct l_ustat *)]; struct l_ustat * ubuf; char ubuf_r_[PADR_(struct l_ustat *)];
+};
+struct linux_statfs_args {
+ char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char buf_l_[PADL_(struct l_statfs_buf *)]; struct l_statfs_buf * buf; char buf_r_[PADR_(struct l_statfs_buf *)];
+};
+struct linux_fstatfs_args {
+ char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
+ char buf_l_[PADL_(struct l_statfs_buf *)]; struct l_statfs_buf * buf; char buf_r_[PADR_(struct l_statfs_buf *)];
+};
+struct linux_sysfs_args {
+ char option_l_[PADL_(l_int)]; l_int option; char option_r_[PADR_(l_int)];
+ char arg1_l_[PADL_(l_ulong)]; l_ulong arg1; char arg1_r_[PADR_(l_ulong)];
+ char arg2_l_[PADL_(l_ulong)]; l_ulong arg2; char arg2_r_[PADR_(l_ulong)];
+};
+struct linux_getpriority_args {
+ char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)];
+ char who_l_[PADL_(int)]; int who; char who_r_[PADR_(int)];
+};
+struct linux_sched_setparam_args {
+ char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+ char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)];
+};
+struct linux_sched_getparam_args {
+ char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+ char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)];
+};
+struct linux_sched_setscheduler_args {
+ char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+ char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)];
+ char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)];
+};
+struct linux_sched_getscheduler_args {
+ char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+};
+struct linux_sched_get_priority_max_args {
+ char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)];
+};
+struct linux_sched_get_priority_min_args {
+ char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)];
+};
+struct linux_sched_rr_get_interval_args {
+ char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+ char interval_l_[PADL_(struct l_timespec *)]; struct l_timespec * interval; char interval_r_[PADR_(struct l_timespec *)];
+};
+struct linux_vhangup_args {
+ register_t dummy;
+};
+struct linux_pivot_root_args {
+ register_t dummy;
+};
+struct linux_sysctl_args {
+ char args_l_[PADL_(struct l___sysctl_args *)]; struct l___sysctl_args * args; char args_r_[PADR_(struct l___sysctl_args *)];
+};
+struct linux_prctl_args {
+ char option_l_[PADL_(l_int)]; l_int option; char option_r_[PADR_(l_int)];
+ char arg2_l_[PADL_(l_uintptr_t)]; l_uintptr_t arg2; char arg2_r_[PADR_(l_uintptr_t)];
+ char arg3_l_[PADL_(l_uintptr_t)]; l_uintptr_t arg3; char arg3_r_[PADR_(l_uintptr_t)];
+ char arg4_l_[PADL_(l_uintptr_t)]; l_uintptr_t arg4; char arg4_r_[PADR_(l_uintptr_t)];
+ char arg5_l_[PADL_(l_uintptr_t)]; l_uintptr_t arg5; char arg5_r_[PADR_(l_uintptr_t)];
+};
+struct linux_arch_prctl_args {
+ char code_l_[PADL_(l_int)]; l_int code; char code_r_[PADR_(l_int)];
+ char addr_l_[PADL_(l_ulong)]; l_ulong addr; char addr_r_[PADR_(l_ulong)];
+};
+struct linux_adjtimex_args {
+ register_t dummy;
+};
+struct linux_setrlimit_args {
+ char resource_l_[PADL_(l_uint)]; l_uint resource; char resource_r_[PADR_(l_uint)];
+ char rlim_l_[PADL_(struct l_rlimit *)]; struct l_rlimit * rlim; char rlim_r_[PADR_(struct l_rlimit *)];
+};
+struct linux_mount_args {
+ char specialfile_l_[PADL_(char *)]; char * specialfile; char specialfile_r_[PADR_(char *)];
+ char dir_l_[PADL_(char *)]; char * dir; char dir_r_[PADR_(char *)];
+ char filesystemtype_l_[PADL_(char *)]; char * filesystemtype; char filesystemtype_r_[PADR_(char *)];
+ char rwflag_l_[PADL_(l_ulong)]; l_ulong rwflag; char rwflag_r_[PADR_(l_ulong)];
+ char data_l_[PADL_(void *)]; void * data; char data_r_[PADR_(void *)];
+};
+struct linux_umount_args {
+ char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
+};
+struct linux_swapoff_args {
+ register_t dummy;
+};
+struct linux_reboot_args {
+ char magic1_l_[PADL_(l_int)]; l_int magic1; char magic1_r_[PADR_(l_int)];
+ char magic2_l_[PADL_(l_int)]; l_int magic2; char magic2_r_[PADR_(l_int)];
+ char cmd_l_[PADL_(l_uint)]; l_uint cmd; char cmd_r_[PADR_(l_uint)];
+ char arg_l_[PADL_(void *)]; void * arg; char arg_r_[PADR_(void *)];
+};
+struct linux_sethostname_args {
+ char hostname_l_[PADL_(char *)]; char * hostname; char hostname_r_[PADR_(char *)];
+ char len_l_[PADL_(l_uint)]; l_uint len; char len_r_[PADR_(l_uint)];
+};
+struct linux_setdomainname_args {
+ char name_l_[PADL_(char *)]; char * name; char name_r_[PADR_(char *)];
+ char len_l_[PADL_(l_int)]; l_int len; char len_r_[PADR_(l_int)];
+};
+struct linux_iopl_args {
+ char level_l_[PADL_(l_uint)]; l_uint level; char level_r_[PADR_(l_uint)];
+};
+struct linux_create_module_args {
+ register_t dummy;
+};
+struct linux_init_module_args {
+ register_t dummy;
+};
+struct linux_delete_module_args {
+ register_t dummy;
+};
+struct linux_get_kernel_syms_args {
+ register_t dummy;
+};
+struct linux_query_module_args {
+ register_t dummy;
+};
+struct linux_quotactl_args {
+ register_t dummy;
+};
+struct linux_nfsservctl_args {
+ register_t dummy;
+};
+struct linux_getpmsg_args {
+ register_t dummy;
+};
+struct linux_putpmsg_args {
+ register_t dummy;
+};
+struct linux_afs_syscall_args {
+ register_t dummy;
+};
+struct linux_tuxcall_args {
+ register_t dummy;
+};
+struct linux_security_args {
+ register_t dummy;
+};
+struct linux_gettid_args {
+ register_t dummy;
+};
+struct linux_setxattr_args {
+ register_t dummy;
+};
+struct linux_lsetxattr_args {
+ register_t dummy;
+};
+struct linux_fsetxattr_args {
+ register_t dummy;
+};
+struct linux_getxattr_args {
+ register_t dummy;
+};
+struct linux_lgetxattr_args {
+ register_t dummy;
+};
+struct linux_fgetxattr_args {
+ register_t dummy;
+};
+struct linux_listxattr_args {
+ register_t dummy;
+};
+struct linux_llistxattr_args {
+ register_t dummy;
+};
+struct linux_flistxattr_args {
+ register_t dummy;
+};
+struct linux_removexattr_args {
+ register_t dummy;
+};
+struct linux_lremovexattr_args {
+ register_t dummy;
+};
+struct linux_fremovexattr_args {
+ register_t dummy;
+};
+struct linux_tkill_args {
+ char tid_l_[PADL_(int)]; int tid; char tid_r_[PADR_(int)];
+ char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)];
+};
+struct linux_time_args {
+ char tm_l_[PADL_(l_time_t *)]; l_time_t * tm; char tm_r_[PADR_(l_time_t *)];
+};
+struct linux_sys_futex_args {
+ char uaddr_l_[PADL_(void *)]; void * uaddr; char uaddr_r_[PADR_(void *)];
+ char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)];
+ char val_l_[PADL_(int)]; int val; char val_r_[PADR_(int)];
+ char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)];
+ char uaddr2_l_[PADL_(void *)]; void * uaddr2; char uaddr2_r_[PADR_(void *)];
+ char val3_l_[PADL_(int)]; int val3; char val3_r_[PADR_(int)];
+};
+struct linux_sched_setaffinity_args {
+ char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+ char len_l_[PADL_(l_uint)]; l_uint len; char len_r_[PADR_(l_uint)];
+ char user_mask_ptr_l_[PADL_(l_ulong *)]; l_ulong * user_mask_ptr; char user_mask_ptr_r_[PADR_(l_ulong *)];
+};
+struct linux_sched_getaffinity_args {
+ char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+ char len_l_[PADL_(l_uint)]; l_uint len; char len_r_[PADR_(l_uint)];
+ char user_mask_ptr_l_[PADL_(l_ulong *)]; l_ulong * user_mask_ptr; char user_mask_ptr_r_[PADR_(l_ulong *)];
+};
+struct linux_set_thread_area_args {
+ register_t dummy;
+};
+struct linux_lookup_dcookie_args {
+ register_t dummy;
+};
+struct linux_epoll_create_args {
+ char size_l_[PADL_(l_int)]; l_int size; char size_r_[PADR_(l_int)];
+};
+struct linux_epoll_ctl_old_args {
+ register_t dummy;
+};
+struct linux_epoll_wait_old_args {
+ register_t dummy;
+};
+struct linux_remap_file_pages_args {
+ register_t dummy;
+};
+struct linux_getdents64_args {
+ char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)];
+ char dirent_l_[PADL_(void *)]; void * dirent; char dirent_r_[PADR_(void *)];
+ char count_l_[PADL_(l_uint)]; l_uint count; char count_r_[PADR_(l_uint)];
+};
+struct linux_set_tid_address_args {
+ char tidptr_l_[PADL_(int *)]; int * tidptr; char tidptr_r_[PADR_(int *)];
+};
+struct linux_semtimedop_args {
+ register_t dummy;
+};
+struct linux_fadvise64_args {
+ char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
+ char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)];
+ char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)];
+ char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)];
+};
+struct linux_timer_create_args {
+ char clock_id_l_[PADL_(clockid_t)]; clockid_t clock_id; char clock_id_r_[PADR_(clockid_t)];
+ char evp_l_[PADL_(struct sigevent *)]; struct sigevent * evp; char evp_r_[PADR_(struct sigevent *)];
+ char timerid_l_[PADL_(l_timer_t *)]; l_timer_t * timerid; char timerid_r_[PADR_(l_timer_t *)];
+};
+struct linux_timer_settime_args {
+ char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)];
+ char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
+ char new_l_[PADL_(const struct itimerspec *)]; const struct itimerspec * new; char new_r_[PADR_(const struct itimerspec *)];
+ char old_l_[PADL_(struct itimerspec *)]; struct itimerspec * old; char old_r_[PADR_(struct itimerspec *)];
+};
+struct linux_timer_gettime_args {
+ char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)];
+ char setting_l_[PADL_(struct itimerspec *)]; struct itimerspec * setting; char setting_r_[PADR_(struct itimerspec *)];
+};
+struct linux_timer_getoverrun_args {
+ char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)];
+};
+struct linux_timer_delete_args {
+ char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)];
+};
+struct linux_clock_settime_args {
+ char which_l_[PADL_(clockid_t)]; clockid_t which; char which_r_[PADR_(clockid_t)];
+ char tp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tp; char tp_r_[PADR_(struct l_timespec *)];
+};
+struct linux_clock_gettime_args {
+ char which_l_[PADL_(clockid_t)]; clockid_t which; char which_r_[PADR_(clockid_t)];
+ char tp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tp; char tp_r_[PADR_(struct l_timespec *)];
+};
+struct linux_clock_getres_args {
+ char which_l_[PADL_(clockid_t)]; clockid_t which; char which_r_[PADR_(clockid_t)];
+ char tp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tp; char tp_r_[PADR_(struct l_timespec *)];
+};
+struct linux_clock_nanosleep_args {
+ char which_l_[PADL_(clockid_t)]; clockid_t which; char which_r_[PADR_(clockid_t)];
+ char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
+ char rqtp_l_[PADL_(struct l_timespec *)]; struct l_timespec * rqtp; char rqtp_r_[PADR_(struct l_timespec *)];
+ char rmtp_l_[PADL_(struct l_timespec *)]; struct l_timespec * rmtp; char rmtp_r_[PADR_(struct l_timespec *)];
+};
+struct linux_exit_group_args {
+ char error_code_l_[PADL_(int)]; int error_code; char error_code_r_[PADR_(int)];
+};
+struct linux_epoll_wait_args {
+ char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)];
+ char events_l_[PADL_(struct epoll_event *)]; struct epoll_event * events; char events_r_[PADR_(struct epoll_event *)];
+ char maxevents_l_[PADL_(l_int)]; l_int maxevents; char maxevents_r_[PADR_(l_int)];
+ char timeout_l_[PADL_(l_int)]; l_int timeout; char timeout_r_[PADR_(l_int)];
+};
+struct linux_epoll_ctl_args {
+ char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)];
+ char op_l_[PADL_(l_int)]; l_int op; char op_r_[PADR_(l_int)];
+ char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
+ char event_l_[PADL_(struct epoll_event *)]; struct epoll_event * event; char event_r_[PADR_(struct epoll_event *)];
+};
+struct linux_tgkill_args {
+ char tgid_l_[PADL_(int)]; int tgid; char tgid_r_[PADR_(int)];
+ char pid_l_[PADL_(int)]; int pid; char pid_r_[PADR_(int)];
+ char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)];
+};
+struct linux_utimes_args {
+ char fname_l_[PADL_(char *)]; char * fname; char fname_r_[PADR_(char *)];
+ char tptr_l_[PADL_(struct l_timeval *)]; struct l_timeval * tptr; char tptr_r_[PADR_(struct l_timeval *)];
+};
+struct linux_mbind_args {
+ register_t dummy;
+};
+struct linux_set_mempolicy_args {
+ register_t dummy;
+};
+struct linux_get_mempolicy_args {
+ register_t dummy;
+};
+struct linux_mq_open_args {
+ register_t dummy;
+};
+struct linux_mq_unlink_args {
+ register_t dummy;
+};
+struct linux_mq_timedsend_args {
+ register_t dummy;
+};
+struct linux_mq_timedreceive_args {
+ register_t dummy;
+};
+struct linux_mq_notify_args {
+ register_t dummy;
+};
+struct linux_mq_getsetattr_args {
+ register_t dummy;
+};
+struct linux_kexec_load_args {
+ register_t dummy;
+};
+struct linux_waitid_args {
+ char idtype_l_[PADL_(int)]; int idtype; char idtype_r_[PADR_(int)];
+ char id_l_[PADL_(l_pid_t)]; l_pid_t id; char id_r_[PADR_(l_pid_t)];
+ char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)];
+ char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)];
+ char rusage_l_[PADL_(struct rusage *)]; struct rusage * rusage; char rusage_r_[PADR_(struct rusage *)];
+};
+struct linux_add_key_args {
+ register_t dummy;
+};
+struct linux_request_key_args {
+ register_t dummy;
+};
+struct linux_keyctl_args {
+ register_t dummy;
+};
+struct linux_ioprio_set_args {
+ register_t dummy;
+};
+struct linux_ioprio_get_args {
+ register_t dummy;
+};
+struct linux_inotify_init_args {
+ register_t dummy;
+};
+struct linux_inotify_add_watch_args {
+ register_t dummy;
+};
+struct linux_inotify_rm_watch_args {
+ register_t dummy;
+};
+struct linux_migrate_pages_args {
+ register_t dummy;
+};
+struct linux_openat_args {
+ char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)];
+ char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)];
+ char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
+ char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)];
+};
+struct linux_mkdirat_args {
+ char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)];
+ char pathname_l_[PADL_(const char *)]; const char * pathname; char pathname_r_[PADR_(const char *)];
+ char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)];
+};
+struct linux_mknodat_args {
+ char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)];
+ char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)];
+ char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)];
+ char dev_l_[PADL_(l_uint)]; l_uint dev; char dev_r_[PADR_(l_uint)];
+};
+struct linux_fchownat_args {
+ char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)];
+ char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)];
+ char uid_l_[PADL_(l_uid_t)]; l_uid_t uid; char uid_r_[PADR_(l_uid_t)];
+ char gid_l_[PADL_(l_gid_t)]; l_gid_t gid; char gid_r_[PADR_(l_gid_t)];
+ char flag_l_[PADL_(l_int)]; l_int flag; char flag_r_[PADR_(l_int)];
+};
+struct linux_futimesat_args {
+ char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)];
+ char filename_l_[PADL_(char *)]; char * filename; char filename_r_[PADR_(char *)];
+ char utimes_l_[PADL_(struct l_timeval *)]; struct l_timeval * utimes; char utimes_r_[PADR_(struct l_timeval *)];
+};
+struct linux_newfstatat_args {
+ char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)];
+ char pathname_l_[PADL_(char *)]; char * pathname; char pathname_r_[PADR_(char *)];
+ char statbuf_l_[PADL_(struct l_stat64 *)]; struct l_stat64 * statbuf; char statbuf_r_[PADR_(struct l_stat64 *)];
+ char flag_l_[PADL_(l_int)]; l_int flag; char flag_r_[PADR_(l_int)];
+};
+struct linux_unlinkat_args {
+ char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)];
+ char pathname_l_[PADL_(const char *)]; const char * pathname; char pathname_r_[PADR_(const char *)];
+ char flag_l_[PADL_(l_int)]; l_int flag; char flag_r_[PADR_(l_int)];
+};
+struct linux_renameat_args {
+ char olddfd_l_[PADL_(l_int)]; l_int olddfd; char olddfd_r_[PADR_(l_int)];
+ char oldname_l_[PADL_(const char *)]; const char * oldname; char oldname_r_[PADR_(const char *)];
+ char newdfd_l_[PADL_(l_int)]; l_int newdfd; char newdfd_r_[PADR_(l_int)];
+ char newname_l_[PADL_(const char *)]; const char * newname; char newname_r_[PADR_(const char *)];
+};
+struct linux_linkat_args {
+ char olddfd_l_[PADL_(l_int)]; l_int olddfd; char olddfd_r_[PADR_(l_int)];
+ char oldname_l_[PADL_(const char *)]; const char * oldname; char oldname_r_[PADR_(const char *)];
+ char newdfd_l_[PADL_(l_int)]; l_int newdfd; char newdfd_r_[PADR_(l_int)];
+ char newname_l_[PADL_(const char *)]; const char * newname; char newname_r_[PADR_(const char *)];
+ char flag_l_[PADL_(l_int)]; l_int flag; char flag_r_[PADR_(l_int)];
+};
+struct linux_symlinkat_args {
+ char oldname_l_[PADL_(const char *)]; const char * oldname; char oldname_r_[PADR_(const char *)];
+ char newdfd_l_[PADL_(l_int)]; l_int newdfd; char newdfd_r_[PADR_(l_int)];
+ char newname_l_[PADL_(const char *)]; const char * newname; char newname_r_[PADR_(const char *)];
+};
+struct linux_readlinkat_args {
+ char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
+ char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
+ char bufsiz_l_[PADL_(l_int)]; l_int bufsiz; char bufsiz_r_[PADR_(l_int)];
+};
+struct linux_fchmodat_args {
+ char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)];
+ char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)];
+ char mode_l_[PADL_(l_mode_t)]; l_mode_t mode; char mode_r_[PADR_(l_mode_t)];
+};
+struct linux_faccessat_args {
+ char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)];
+ char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)];
+ char amode_l_[PADL_(l_int)]; l_int amode; char amode_r_[PADR_(l_int)];
+};
+struct linux_pselect6_args {
+ char nfds_l_[PADL_(l_int)]; l_int nfds; char nfds_r_[PADR_(l_int)];
+ char readfds_l_[PADL_(l_fd_set *)]; l_fd_set * readfds; char readfds_r_[PADR_(l_fd_set *)];
+ char writefds_l_[PADL_(l_fd_set *)]; l_fd_set * writefds; char writefds_r_[PADR_(l_fd_set *)];
+ char exceptfds_l_[PADL_(l_fd_set *)]; l_fd_set * exceptfds; char exceptfds_r_[PADR_(l_fd_set *)];
+ char tsp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tsp; char tsp_r_[PADR_(struct l_timespec *)];
+ char sig_l_[PADL_(l_uintptr_t *)]; l_uintptr_t * sig; char sig_r_[PADR_(l_uintptr_t *)];
+};
+struct linux_ppoll_args {
+ char fds_l_[PADL_(struct pollfd *)]; struct pollfd * fds; char fds_r_[PADR_(struct pollfd *)];
+ char nfds_l_[PADL_(uint32_t)]; uint32_t nfds; char nfds_r_[PADR_(uint32_t)];
+ char tsp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tsp; char tsp_r_[PADR_(struct l_timespec *)];
+ char sset_l_[PADL_(l_sigset_t *)]; l_sigset_t * sset; char sset_r_[PADR_(l_sigset_t *)];
+ char ssize_l_[PADL_(l_size_t)]; l_size_t ssize; char ssize_r_[PADR_(l_size_t)];
+};
+struct linux_unshare_args {
+ register_t dummy;
+};
+struct linux_set_robust_list_args {
+ char head_l_[PADL_(struct linux_robust_list_head *)]; struct linux_robust_list_head * head; char head_r_[PADR_(struct linux_robust_list_head *)];
+ char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)];
+};
+struct linux_get_robust_list_args {
+ char pid_l_[PADL_(l_int)]; l_int pid; char pid_r_[PADR_(l_int)];
+ char head_l_[PADL_(struct linux_robust_list_head *)]; struct linux_robust_list_head * head; char head_r_[PADR_(struct linux_robust_list_head *)];
+ char len_l_[PADL_(l_size_t *)]; l_size_t * len; char len_r_[PADR_(l_size_t *)];
+};
+struct linux_splice_args {
+ register_t dummy;
+};
+struct linux_tee_args {
+ register_t dummy;
+};
+struct linux_sync_file_range_args {
+ register_t dummy;
+};
+struct linux_vmsplice_args {
+ register_t dummy;
+};
+struct linux_move_pages_args {
+ register_t dummy;
+};
+struct linux_utimensat_args {
+ char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)];
+ char pathname_l_[PADL_(const char *)]; const char * pathname; char pathname_r_[PADR_(const char *)];
+ char times_l_[PADL_(const struct l_timespec *)]; const struct l_timespec * times; char times_r_[PADR_(const struct l_timespec *)];
+ char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
+};
+struct linux_epoll_pwait_args {
+ char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)];
+ char events_l_[PADL_(struct epoll_event *)]; struct epoll_event * events; char events_r_[PADR_(struct epoll_event *)];
+ char maxevents_l_[PADL_(l_int)]; l_int maxevents; char maxevents_r_[PADR_(l_int)];
+ char timeout_l_[PADL_(l_int)]; l_int timeout; char timeout_r_[PADR_(l_int)];
+ char mask_l_[PADL_(l_sigset_t *)]; l_sigset_t * mask; char mask_r_[PADR_(l_sigset_t *)];
+};
+struct linux_signalfd_args {
+ register_t dummy;
+};
+struct linux_timerfd_args {
+ register_t dummy;
+};
+struct linux_eventfd_args {
+ char initval_l_[PADL_(l_uint)]; l_uint initval; char initval_r_[PADR_(l_uint)];
+};
+struct linux_fallocate_args {
+ char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
+ char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)];
+ char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)];
+ char len_l_[PADL_(l_loff_t)]; l_loff_t len; char len_r_[PADR_(l_loff_t)];
+};
+struct linux_timerfd_settime_args {
+ register_t dummy;
+};
+struct linux_timerfd_gettime_args {
+ register_t dummy;
+};
+struct linux_accept4_args {
+ char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
+ char addr_l_[PADL_(l_uintptr_t)]; l_uintptr_t addr; char addr_r_[PADR_(l_uintptr_t)];
+ char namelen_l_[PADL_(l_uintptr_t)]; l_uintptr_t namelen; char namelen_r_[PADR_(l_uintptr_t)];
+ char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
+};
+struct linux_signalfd4_args {
+ register_t dummy;
+};
+struct linux_eventfd2_args {
+ char initval_l_[PADL_(l_uint)]; l_uint initval; char initval_r_[PADR_(l_uint)];
+ char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
+};
+struct linux_epoll_create1_args {
+ char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
+};
+struct linux_dup3_args {
+ char oldfd_l_[PADL_(l_int)]; l_int oldfd; char oldfd_r_[PADR_(l_int)];
+ char newfd_l_[PADL_(l_int)]; l_int newfd; char newfd_r_[PADR_(l_int)];
+ char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
+};
+struct linux_pipe2_args {
+ char pipefds_l_[PADL_(l_int *)]; l_int * pipefds; char pipefds_r_[PADR_(l_int *)];
+ char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
+};
+struct linux_inotify_init1_args {
+ register_t dummy;
+};
+struct linux_preadv_args {
+ register_t dummy;
+};
+struct linux_pwritev_args {
+ register_t dummy;
+};
+struct linux_rt_tsigqueueinfo_args {
+ register_t dummy;
+};
+struct linux_perf_event_open_args {
+ register_t dummy;
+};
+struct linux_recvmmsg_args {
+ char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
+ char msg_l_[PADL_(struct l_mmsghdr *)]; struct l_mmsghdr * msg; char msg_r_[PADR_(struct l_mmsghdr *)];
+ char vlen_l_[PADL_(l_uint)]; l_uint vlen; char vlen_r_[PADR_(l_uint)];
+ char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)];
+ char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)];
+};
+struct linux_fanotify_init_args {
+ register_t dummy;
+};
+struct linux_fanotify_mark_args {
+ register_t dummy;
+};
+struct linux_prlimit64_args {
+ char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+ char resource_l_[PADL_(l_uint)]; l_uint resource; char resource_r_[PADR_(l_uint)];
+ char new_l_[PADL_(struct rlimit *)]; struct rlimit * new; char new_r_[PADR_(struct rlimit *)];
+ char old_l_[PADL_(struct rlimit *)]; struct rlimit * old; char old_r_[PADR_(struct rlimit *)];
+};
+struct linux_name_to_handle_at_args {
+ register_t dummy;
+};
+struct linux_open_by_handle_at_args {
+ register_t dummy;
+};
+struct linux_clock_adjtime_args {
+ register_t dummy;
+};
+struct linux_syncfs_args {
+ char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
+};
+struct linux_sendmmsg_args {
+ char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
+ char msg_l_[PADL_(struct l_mmsghdr *)]; struct l_mmsghdr * msg; char msg_r_[PADR_(struct l_mmsghdr *)];
+ char vlen_l_[PADL_(l_uint)]; l_uint vlen; char vlen_r_[PADR_(l_uint)];
+ char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)];
+};
+struct linux_setns_args {
+ register_t dummy;
+};
+struct linux_process_vm_readv_args {
+ register_t dummy;
+};
+struct linux_process_vm_writev_args {
+ register_t dummy;
+};
+struct linux_kcmp_args {
+ register_t dummy;
+};
+struct linux_finit_module_args {
+ register_t dummy;
+};
+#define nosys linux_nosys
+int linux_open(struct thread *, struct linux_open_args *);
+int linux_newstat(struct thread *, struct linux_newstat_args *);
+int linux_newfstat(struct thread *, struct linux_newfstat_args *);
+int linux_newlstat(struct thread *, struct linux_newlstat_args *);
+int linux_lseek(struct thread *, struct linux_lseek_args *);
+int linux_mmap2(struct thread *, struct linux_mmap2_args *);
+int linux_mprotect(struct thread *, struct linux_mprotect_args *);
+int linux_brk(struct thread *, struct linux_brk_args *);
+int linux_rt_sigaction(struct thread *, struct linux_rt_sigaction_args *);
+int linux_rt_sigprocmask(struct thread *, struct linux_rt_sigprocmask_args *);
+int linux_rt_sigreturn(struct thread *, struct linux_rt_sigreturn_args *);
+int linux_ioctl(struct thread *, struct linux_ioctl_args *);
+int linux_pread(struct thread *, struct linux_pread_args *);
+int linux_pwrite(struct thread *, struct linux_pwrite_args *);
+int linux_access(struct thread *, struct linux_access_args *);
+int linux_pipe(struct thread *, struct linux_pipe_args *);
+int linux_select(struct thread *, struct linux_select_args *);
+int linux_mremap(struct thread *, struct linux_mremap_args *);
+int linux_msync(struct thread *, struct linux_msync_args *);
+int linux_mincore(struct thread *, struct linux_mincore_args *);
+int linux_shmget(struct thread *, struct linux_shmget_args *);
+int linux_shmat(struct thread *, struct linux_shmat_args *);
+int linux_shmctl(struct thread *, struct linux_shmctl_args *);
+int linux_pause(struct thread *, struct linux_pause_args *);
+int linux_nanosleep(struct thread *, struct linux_nanosleep_args *);
+int linux_getitimer(struct thread *, struct linux_getitimer_args *);
+int linux_alarm(struct thread *, struct linux_alarm_args *);
+int linux_setitimer(struct thread *, struct linux_setitimer_args *);
+int linux_getpid(struct thread *, struct linux_getpid_args *);
+int linux_sendfile(struct thread *, struct linux_sendfile_args *);
+int linux_socket(struct thread *, struct linux_socket_args *);
+int linux_connect(struct thread *, struct linux_connect_args *);
+int linux_accept(struct thread *, struct linux_accept_args *);
+int linux_sendto(struct thread *, struct linux_sendto_args *);
+int linux_recvfrom(struct thread *, struct linux_recvfrom_args *);
+int linux_sendmsg(struct thread *, struct linux_sendmsg_args *);
+int linux_recvmsg(struct thread *, struct linux_recvmsg_args *);
+int linux_shutdown(struct thread *, struct linux_shutdown_args *);
+int linux_bind(struct thread *, struct linux_bind_args *);
+int linux_listen(struct thread *, struct linux_listen_args *);
+int linux_getsockname(struct thread *, struct linux_getsockname_args *);
+int linux_getpeername(struct thread *, struct linux_getpeername_args *);
+int linux_socketpair(struct thread *, struct linux_socketpair_args *);
+int linux_setsockopt(struct thread *, struct linux_setsockopt_args *);
+int linux_getsockopt(struct thread *, struct linux_getsockopt_args *);
+int linux_clone(struct thread *, struct linux_clone_args *);
+int linux_fork(struct thread *, struct linux_fork_args *);
+int linux_vfork(struct thread *, struct linux_vfork_args *);
+int linux_execve(struct thread *, struct linux_execve_args *);
+int linux_exit(struct thread *, struct linux_exit_args *);
+int linux_wait4(struct thread *, struct linux_wait4_args *);
+int linux_kill(struct thread *, struct linux_kill_args *);
+int linux_newuname(struct thread *, struct linux_newuname_args *);
+int linux_semget(struct thread *, struct linux_semget_args *);
+int linux_semop(struct thread *, struct linux_semop_args *);
+int linux_semctl(struct thread *, struct linux_semctl_args *);
+int linux_shmdt(struct thread *, struct linux_shmdt_args *);
+int linux_msgget(struct thread *, struct linux_msgget_args *);
+int linux_msgsnd(struct thread *, struct linux_msgsnd_args *);
+int linux_msgrcv(struct thread *, struct linux_msgrcv_args *);
+int linux_msgctl(struct thread *, struct linux_msgctl_args *);
+int linux_fcntl(struct thread *, struct linux_fcntl_args *);
+int linux_fdatasync(struct thread *, struct linux_fdatasync_args *);
+int linux_truncate(struct thread *, struct linux_truncate_args *);
+int linux_ftruncate(struct thread *, struct linux_ftruncate_args *);
+int linux_getdents(struct thread *, struct linux_getdents_args *);
+int linux_getcwd(struct thread *, struct linux_getcwd_args *);
+int linux_chdir(struct thread *, struct linux_chdir_args *);
+int linux_rename(struct thread *, struct linux_rename_args *);
+int linux_mkdir(struct thread *, struct linux_mkdir_args *);
+int linux_rmdir(struct thread *, struct linux_rmdir_args *);
+int linux_creat(struct thread *, struct linux_creat_args *);
+int linux_link(struct thread *, struct linux_link_args *);
+int linux_unlink(struct thread *, struct linux_unlink_args *);
+int linux_symlink(struct thread *, struct linux_symlink_args *);
+int linux_readlink(struct thread *, struct linux_readlink_args *);
+int linux_chmod(struct thread *, struct linux_chmod_args *);
+int linux_chown(struct thread *, struct linux_chown_args *);
+int linux_lchown(struct thread *, struct linux_lchown_args *);
+int linux_getrlimit(struct thread *, struct linux_getrlimit_args *);
+int linux_sysinfo(struct thread *, struct linux_sysinfo_args *);
+int linux_times(struct thread *, struct linux_times_args *);
+int linux_ptrace(struct thread *, struct linux_ptrace_args *);
+int linux_getuid(struct thread *, struct linux_getuid_args *);
+int linux_syslog(struct thread *, struct linux_syslog_args *);
+int linux_getgid(struct thread *, struct linux_getgid_args *);
+int linux_getppid(struct thread *, struct linux_getppid_args *);
+int linux_getgroups(struct thread *, struct linux_getgroups_args *);
+int linux_setgroups(struct thread *, struct linux_setgroups_args *);
+int linux_setfsuid(struct thread *, struct linux_setfsuid_args *);
+int linux_setfsgid(struct thread *, struct linux_setfsgid_args *);
+int linux_getsid(struct thread *, struct linux_getsid_args *);
+int linux_capget(struct thread *, struct linux_capget_args *);
+int linux_capset(struct thread *, struct linux_capset_args *);
+int linux_rt_sigpending(struct thread *, struct linux_rt_sigpending_args *);
+int linux_rt_sigtimedwait(struct thread *, struct linux_rt_sigtimedwait_args *);
+int linux_rt_sigqueueinfo(struct thread *, struct linux_rt_sigqueueinfo_args *);
+int linux_rt_sigsuspend(struct thread *, struct linux_rt_sigsuspend_args *);
+int linux_sigaltstack(struct thread *, struct linux_sigaltstack_args *);
+int linux_utime(struct thread *, struct linux_utime_args *);
+int linux_mknod(struct thread *, struct linux_mknod_args *);
+int linux_personality(struct thread *, struct linux_personality_args *);
+int linux_ustat(struct thread *, struct linux_ustat_args *);
+int linux_statfs(struct thread *, struct linux_statfs_args *);
+int linux_fstatfs(struct thread *, struct linux_fstatfs_args *);
+int linux_sysfs(struct thread *, struct linux_sysfs_args *);
+int linux_getpriority(struct thread *, struct linux_getpriority_args *);
+int linux_sched_setparam(struct thread *, struct linux_sched_setparam_args *);
+int linux_sched_getparam(struct thread *, struct linux_sched_getparam_args *);
+int linux_sched_setscheduler(struct thread *, struct linux_sched_setscheduler_args *);
+int linux_sched_getscheduler(struct thread *, struct linux_sched_getscheduler_args *);
+int linux_sched_get_priority_max(struct thread *, struct linux_sched_get_priority_max_args *);
+int linux_sched_get_priority_min(struct thread *, struct linux_sched_get_priority_min_args *);
+int linux_sched_rr_get_interval(struct thread *, struct linux_sched_rr_get_interval_args *);
+int linux_vhangup(struct thread *, struct linux_vhangup_args *);
+int linux_pivot_root(struct thread *, struct linux_pivot_root_args *);
+int linux_sysctl(struct thread *, struct linux_sysctl_args *);
+int linux_prctl(struct thread *, struct linux_prctl_args *);
+int linux_arch_prctl(struct thread *, struct linux_arch_prctl_args *);
+int linux_adjtimex(struct thread *, struct linux_adjtimex_args *);
+int linux_setrlimit(struct thread *, struct linux_setrlimit_args *);
+int linux_mount(struct thread *, struct linux_mount_args *);
+int linux_umount(struct thread *, struct linux_umount_args *);
+int linux_swapoff(struct thread *, struct linux_swapoff_args *);
+int linux_reboot(struct thread *, struct linux_reboot_args *);
+int linux_sethostname(struct thread *, struct linux_sethostname_args *);
+int linux_setdomainname(struct thread *, struct linux_setdomainname_args *);
+int linux_iopl(struct thread *, struct linux_iopl_args *);
+int linux_create_module(struct thread *, struct linux_create_module_args *);
+int linux_init_module(struct thread *, struct linux_init_module_args *);
+int linux_delete_module(struct thread *, struct linux_delete_module_args *);
+int linux_get_kernel_syms(struct thread *, struct linux_get_kernel_syms_args *);
+int linux_query_module(struct thread *, struct linux_query_module_args *);
+int linux_quotactl(struct thread *, struct linux_quotactl_args *);
+int linux_nfsservctl(struct thread *, struct linux_nfsservctl_args *);
+int linux_getpmsg(struct thread *, struct linux_getpmsg_args *);
+int linux_putpmsg(struct thread *, struct linux_putpmsg_args *);
+int linux_afs_syscall(struct thread *, struct linux_afs_syscall_args *);
+int linux_tuxcall(struct thread *, struct linux_tuxcall_args *);
+int linux_security(struct thread *, struct linux_security_args *);
+int linux_gettid(struct thread *, struct linux_gettid_args *);
+int linux_setxattr(struct thread *, struct linux_setxattr_args *);
+int linux_lsetxattr(struct thread *, struct linux_lsetxattr_args *);
+int linux_fsetxattr(struct thread *, struct linux_fsetxattr_args *);
+int linux_getxattr(struct thread *, struct linux_getxattr_args *);
+int linux_lgetxattr(struct thread *, struct linux_lgetxattr_args *);
+int linux_fgetxattr(struct thread *, struct linux_fgetxattr_args *);
+int linux_listxattr(struct thread *, struct linux_listxattr_args *);
+int linux_llistxattr(struct thread *, struct linux_llistxattr_args *);
+int linux_flistxattr(struct thread *, struct linux_flistxattr_args *);
+int linux_removexattr(struct thread *, struct linux_removexattr_args *);
+int linux_lremovexattr(struct thread *, struct linux_lremovexattr_args *);
+int linux_fremovexattr(struct thread *, struct linux_fremovexattr_args *);
+int linux_tkill(struct thread *, struct linux_tkill_args *);
+int linux_time(struct thread *, struct linux_time_args *);
+int linux_sys_futex(struct thread *, struct linux_sys_futex_args *);
+int linux_sched_setaffinity(struct thread *, struct linux_sched_setaffinity_args *);
+int linux_sched_getaffinity(struct thread *, struct linux_sched_getaffinity_args *);
+int linux_set_thread_area(struct thread *, struct linux_set_thread_area_args *);
+int linux_lookup_dcookie(struct thread *, struct linux_lookup_dcookie_args *);
+int linux_epoll_create(struct thread *, struct linux_epoll_create_args *);
+int linux_epoll_ctl_old(struct thread *, struct linux_epoll_ctl_old_args *);
+int linux_epoll_wait_old(struct thread *, struct linux_epoll_wait_old_args *);
+int linux_remap_file_pages(struct thread *, struct linux_remap_file_pages_args *);
+int linux_getdents64(struct thread *, struct linux_getdents64_args *);
+int linux_set_tid_address(struct thread *, struct linux_set_tid_address_args *);
+int linux_semtimedop(struct thread *, struct linux_semtimedop_args *);
+int linux_fadvise64(struct thread *, struct linux_fadvise64_args *);
+int linux_timer_create(struct thread *, struct linux_timer_create_args *);
+int linux_timer_settime(struct thread *, struct linux_timer_settime_args *);
+int linux_timer_gettime(struct thread *, struct linux_timer_gettime_args *);
+int linux_timer_getoverrun(struct thread *, struct linux_timer_getoverrun_args *);
+int linux_timer_delete(struct thread *, struct linux_timer_delete_args *);
+int linux_clock_settime(struct thread *, struct linux_clock_settime_args *);
+int linux_clock_gettime(struct thread *, struct linux_clock_gettime_args *);
+int linux_clock_getres(struct thread *, struct linux_clock_getres_args *);
+int linux_clock_nanosleep(struct thread *, struct linux_clock_nanosleep_args *);
+int linux_exit_group(struct thread *, struct linux_exit_group_args *);
+int linux_epoll_wait(struct thread *, struct linux_epoll_wait_args *);
+int linux_epoll_ctl(struct thread *, struct linux_epoll_ctl_args *);
+int linux_tgkill(struct thread *, struct linux_tgkill_args *);
+int linux_utimes(struct thread *, struct linux_utimes_args *);
+int linux_mbind(struct thread *, struct linux_mbind_args *);
+int linux_set_mempolicy(struct thread *, struct linux_set_mempolicy_args *);
+int linux_get_mempolicy(struct thread *, struct linux_get_mempolicy_args *);
+int linux_mq_open(struct thread *, struct linux_mq_open_args *);
+int linux_mq_unlink(struct thread *, struct linux_mq_unlink_args *);
+int linux_mq_timedsend(struct thread *, struct linux_mq_timedsend_args *);
+int linux_mq_timedreceive(struct thread *, struct linux_mq_timedreceive_args *);
+int linux_mq_notify(struct thread *, struct linux_mq_notify_args *);
+int linux_mq_getsetattr(struct thread *, struct linux_mq_getsetattr_args *);
+int linux_kexec_load(struct thread *, struct linux_kexec_load_args *);
+int linux_waitid(struct thread *, struct linux_waitid_args *);
+int linux_add_key(struct thread *, struct linux_add_key_args *);
+int linux_request_key(struct thread *, struct linux_request_key_args *);
+int linux_keyctl(struct thread *, struct linux_keyctl_args *);
+int linux_ioprio_set(struct thread *, struct linux_ioprio_set_args *);
+int linux_ioprio_get(struct thread *, struct linux_ioprio_get_args *);
+int linux_inotify_init(struct thread *, struct linux_inotify_init_args *);
+int linux_inotify_add_watch(struct thread *, struct linux_inotify_add_watch_args *);
+int linux_inotify_rm_watch(struct thread *, struct linux_inotify_rm_watch_args *);
+int linux_migrate_pages(struct thread *, struct linux_migrate_pages_args *);
+int linux_openat(struct thread *, struct linux_openat_args *);
+int linux_mkdirat(struct thread *, struct linux_mkdirat_args *);
+int linux_mknodat(struct thread *, struct linux_mknodat_args *);
+int linux_fchownat(struct thread *, struct linux_fchownat_args *);
+int linux_futimesat(struct thread *, struct linux_futimesat_args *);
+int linux_newfstatat(struct thread *, struct linux_newfstatat_args *);
+int linux_unlinkat(struct thread *, struct linux_unlinkat_args *);
+int linux_renameat(struct thread *, struct linux_renameat_args *);
+int linux_linkat(struct thread *, struct linux_linkat_args *);
+int linux_symlinkat(struct thread *, struct linux_symlinkat_args *);
+int linux_readlinkat(struct thread *, struct linux_readlinkat_args *);
+int linux_fchmodat(struct thread *, struct linux_fchmodat_args *);
+int linux_faccessat(struct thread *, struct linux_faccessat_args *);
+int linux_pselect6(struct thread *, struct linux_pselect6_args *);
+int linux_ppoll(struct thread *, struct linux_ppoll_args *);
+int linux_unshare(struct thread *, struct linux_unshare_args *);
+int linux_set_robust_list(struct thread *, struct linux_set_robust_list_args *);
+int linux_get_robust_list(struct thread *, struct linux_get_robust_list_args *);
+int linux_splice(struct thread *, struct linux_splice_args *);
+int linux_tee(struct thread *, struct linux_tee_args *);
+int linux_sync_file_range(struct thread *, struct linux_sync_file_range_args *);
+int linux_vmsplice(struct thread *, struct linux_vmsplice_args *);
+int linux_move_pages(struct thread *, struct linux_move_pages_args *);
+int linux_utimensat(struct thread *, struct linux_utimensat_args *);
+int linux_epoll_pwait(struct thread *, struct linux_epoll_pwait_args *);
+int linux_signalfd(struct thread *, struct linux_signalfd_args *);
+int linux_timerfd(struct thread *, struct linux_timerfd_args *);
+int linux_eventfd(struct thread *, struct linux_eventfd_args *);
+int linux_fallocate(struct thread *, struct linux_fallocate_args *);
+int linux_timerfd_settime(struct thread *, struct linux_timerfd_settime_args *);
+int linux_timerfd_gettime(struct thread *, struct linux_timerfd_gettime_args *);
+int linux_accept4(struct thread *, struct linux_accept4_args *);
+int linux_signalfd4(struct thread *, struct linux_signalfd4_args *);
+int linux_eventfd2(struct thread *, struct linux_eventfd2_args *);
+int linux_epoll_create1(struct thread *, struct linux_epoll_create1_args *);
+int linux_dup3(struct thread *, struct linux_dup3_args *);
+int linux_pipe2(struct thread *, struct linux_pipe2_args *);
+int linux_inotify_init1(struct thread *, struct linux_inotify_init1_args *);
+int linux_preadv(struct thread *, struct linux_preadv_args *);
+int linux_pwritev(struct thread *, struct linux_pwritev_args *);
+int linux_rt_tsigqueueinfo(struct thread *, struct linux_rt_tsigqueueinfo_args *);
+int linux_perf_event_open(struct thread *, struct linux_perf_event_open_args *);
+int linux_recvmmsg(struct thread *, struct linux_recvmmsg_args *);
+int linux_fanotify_init(struct thread *, struct linux_fanotify_init_args *);
+int linux_fanotify_mark(struct thread *, struct linux_fanotify_mark_args *);
+int linux_prlimit64(struct thread *, struct linux_prlimit64_args *);
+int linux_name_to_handle_at(struct thread *, struct linux_name_to_handle_at_args *);
+int linux_open_by_handle_at(struct thread *, struct linux_open_by_handle_at_args *);
+int linux_clock_adjtime(struct thread *, struct linux_clock_adjtime_args *);
+int linux_syncfs(struct thread *, struct linux_syncfs_args *);
+int linux_sendmmsg(struct thread *, struct linux_sendmmsg_args *);
+int linux_setns(struct thread *, struct linux_setns_args *);
+int linux_process_vm_readv(struct thread *, struct linux_process_vm_readv_args *);
+int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args *);
+int linux_kcmp(struct thread *, struct linux_kcmp_args *);
+int linux_finit_module(struct thread *, struct linux_finit_module_args *);
+
+#ifdef COMPAT_43
+
+#define nosys linux_nosys
+
+#endif /* COMPAT_43 */
+
+
+#ifdef COMPAT_FREEBSD4
+
+#define nosys linux_nosys
+
+#endif /* COMPAT_FREEBSD4 */
+
+
+#ifdef COMPAT_FREEBSD6
+
+#define nosys linux_nosys
+
+#endif /* COMPAT_FREEBSD6 */
+
+
+#ifdef COMPAT_FREEBSD7
+
+#define nosys linux_nosys
+
+#endif /* COMPAT_FREEBSD7 */
+
+#define LINUX_SYS_AUE_linux_open AUE_OPEN_RWTC
+#define LINUX_SYS_AUE_linux_newstat AUE_STAT
+#define LINUX_SYS_AUE_linux_newfstat AUE_FSTAT
+#define LINUX_SYS_AUE_linux_newlstat AUE_LSTAT
+#define LINUX_SYS_AUE_linux_lseek AUE_LSEEK
+#define LINUX_SYS_AUE_linux_mmap2 AUE_MMAP
+#define LINUX_SYS_AUE_linux_mprotect AUE_MPROTECT
+#define LINUX_SYS_AUE_linux_brk AUE_NULL
+#define LINUX_SYS_AUE_linux_rt_sigaction AUE_NULL
+#define LINUX_SYS_AUE_linux_rt_sigprocmask AUE_NULL
+#define LINUX_SYS_AUE_linux_rt_sigreturn AUE_NULL
+#define LINUX_SYS_AUE_linux_ioctl AUE_IOCTL
+#define LINUX_SYS_AUE_linux_pread AUE_PREAD
+#define LINUX_SYS_AUE_linux_pwrite AUE_PWRITE
+#define LINUX_SYS_AUE_linux_access AUE_ACCESS
+#define LINUX_SYS_AUE_linux_pipe AUE_PIPE
+#define LINUX_SYS_AUE_linux_select AUE_SELECT
+#define LINUX_SYS_AUE_linux_mremap AUE_NULL
+#define LINUX_SYS_AUE_linux_msync AUE_MSYNC
+#define LINUX_SYS_AUE_linux_mincore AUE_MINCORE
+#define LINUX_SYS_AUE_linux_shmget AUE_NULL
+#define LINUX_SYS_AUE_linux_shmat AUE_NULL
+#define LINUX_SYS_AUE_linux_shmctl AUE_NULL
+#define LINUX_SYS_AUE_linux_pause AUE_NULL
+#define LINUX_SYS_AUE_linux_nanosleep AUE_NULL
+#define LINUX_SYS_AUE_linux_getitimer AUE_GETITIMER
+#define LINUX_SYS_AUE_linux_alarm AUE_NULL
+#define LINUX_SYS_AUE_linux_setitimer AUE_SETITIMER
+#define LINUX_SYS_AUE_linux_getpid AUE_GETPID
+#define LINUX_SYS_AUE_linux_sendfile AUE_SENDFILE
+#define LINUX_SYS_AUE_linux_socket AUE_SOCKET
+#define LINUX_SYS_AUE_linux_connect AUE_CONNECT
+#define LINUX_SYS_AUE_linux_accept AUE_ACCEPT
+#define LINUX_SYS_AUE_linux_sendto AUE_SENDTO
+#define LINUX_SYS_AUE_linux_recvfrom AUE_RECVFROM
+#define LINUX_SYS_AUE_linux_sendmsg AUE_SENDMSG
+#define LINUX_SYS_AUE_linux_recvmsg AUE_RECVMSG
+#define LINUX_SYS_AUE_linux_shutdown AUE_NULL
+#define LINUX_SYS_AUE_linux_bind AUE_BIND
+#define LINUX_SYS_AUE_linux_listen AUE_LISTEN
+#define LINUX_SYS_AUE_linux_getsockname AUE_GETSOCKNAME
+#define LINUX_SYS_AUE_linux_getpeername AUE_GETPEERNAME
+#define LINUX_SYS_AUE_linux_socketpair AUE_SOCKETPAIR
+#define LINUX_SYS_AUE_linux_setsockopt AUE_SETSOCKOPT
+#define LINUX_SYS_AUE_linux_getsockopt AUE_GETSOCKOPT
+#define LINUX_SYS_AUE_linux_clone AUE_RFORK
+#define LINUX_SYS_AUE_linux_fork AUE_FORK
+#define LINUX_SYS_AUE_linux_vfork AUE_VFORK
+#define LINUX_SYS_AUE_linux_execve AUE_EXECVE
+#define LINUX_SYS_AUE_linux_exit AUE_EXIT
+#define LINUX_SYS_AUE_linux_wait4 AUE_WAIT4
+#define LINUX_SYS_AUE_linux_kill AUE_KILL
+#define LINUX_SYS_AUE_linux_newuname AUE_NULL
+#define LINUX_SYS_AUE_linux_semget AUE_NULL
+#define LINUX_SYS_AUE_linux_semop AUE_NULL
+#define LINUX_SYS_AUE_linux_semctl AUE_NULL
+#define LINUX_SYS_AUE_linux_shmdt AUE_NULL
+#define LINUX_SYS_AUE_linux_msgget AUE_NULL
+#define LINUX_SYS_AUE_linux_msgsnd AUE_NULL
+#define LINUX_SYS_AUE_linux_msgrcv AUE_NULL
+#define LINUX_SYS_AUE_linux_msgctl AUE_NULL
+#define LINUX_SYS_AUE_linux_fcntl AUE_FCNTL
+#define LINUX_SYS_AUE_linux_fdatasync AUE_NULL
+#define LINUX_SYS_AUE_linux_truncate AUE_TRUNCATE
+#define LINUX_SYS_AUE_linux_ftruncate AUE_FTRUNCATE
+#define LINUX_SYS_AUE_linux_getdents AUE_GETDIRENTRIES
+#define LINUX_SYS_AUE_linux_getcwd AUE_GETCWD
+#define LINUX_SYS_AUE_linux_chdir AUE_CHDIR
+#define LINUX_SYS_AUE_linux_rename AUE_RENAME
+#define LINUX_SYS_AUE_linux_mkdir AUE_MKDIR
+#define LINUX_SYS_AUE_linux_rmdir AUE_RMDIR
+#define LINUX_SYS_AUE_linux_creat AUE_CREAT
+#define LINUX_SYS_AUE_linux_link AUE_LINK
+#define LINUX_SYS_AUE_linux_unlink AUE_UNLINK
+#define LINUX_SYS_AUE_linux_symlink AUE_SYMLINK
+#define LINUX_SYS_AUE_linux_readlink AUE_READLINK
+#define LINUX_SYS_AUE_linux_chmod AUE_CHMOD
+#define LINUX_SYS_AUE_linux_chown AUE_LCHOWN
+#define LINUX_SYS_AUE_linux_lchown AUE_LCHOWN
+#define LINUX_SYS_AUE_linux_getrlimit AUE_GETRLIMIT
+#define LINUX_SYS_AUE_linux_sysinfo AUE_NULL
+#define LINUX_SYS_AUE_linux_times AUE_NULL
+#define LINUX_SYS_AUE_linux_ptrace AUE_PTRACE
+#define LINUX_SYS_AUE_linux_getuid AUE_GETUID
+#define LINUX_SYS_AUE_linux_syslog AUE_NULL
+#define LINUX_SYS_AUE_linux_getgid AUE_GETGID
+#define LINUX_SYS_AUE_linux_getppid AUE_GETPPID
+#define LINUX_SYS_AUE_linux_getgroups AUE_GETGROUPS
+#define LINUX_SYS_AUE_linux_setgroups AUE_SETGROUPS
+#define LINUX_SYS_AUE_linux_setfsuid AUE_SETFSUID
+#define LINUX_SYS_AUE_linux_setfsgid AUE_SETFSGID
+#define LINUX_SYS_AUE_linux_getsid AUE_GETSID
+#define LINUX_SYS_AUE_linux_capget AUE_CAPGET
+#define LINUX_SYS_AUE_linux_capset AUE_CAPSET
+#define LINUX_SYS_AUE_linux_rt_sigpending AUE_NULL
+#define LINUX_SYS_AUE_linux_rt_sigtimedwait AUE_NULL
+#define LINUX_SYS_AUE_linux_rt_sigqueueinfo AUE_NULL
+#define LINUX_SYS_AUE_linux_rt_sigsuspend AUE_NULL
+#define LINUX_SYS_AUE_linux_sigaltstack AUE_NULL
+#define LINUX_SYS_AUE_linux_utime AUE_UTIME
+#define LINUX_SYS_AUE_linux_mknod AUE_MKNOD
+#define LINUX_SYS_AUE_linux_personality AUE_PERSONALITY
+#define LINUX_SYS_AUE_linux_ustat AUE_NULL
+#define LINUX_SYS_AUE_linux_statfs AUE_STATFS
+#define LINUX_SYS_AUE_linux_fstatfs AUE_FSTATFS
+#define LINUX_SYS_AUE_linux_sysfs AUE_NULL
+#define LINUX_SYS_AUE_linux_getpriority AUE_GETPRIORITY
+#define LINUX_SYS_AUE_linux_sched_setparam AUE_SCHED_SETPARAM
+#define LINUX_SYS_AUE_linux_sched_getparam AUE_SCHED_GETPARAM
+#define LINUX_SYS_AUE_linux_sched_setscheduler AUE_SCHED_SETSCHEDULER
+#define LINUX_SYS_AUE_linux_sched_getscheduler AUE_SCHED_GETSCHEDULER
+#define LINUX_SYS_AUE_linux_sched_get_priority_max AUE_SCHED_GET_PRIORITY_MAX
+#define LINUX_SYS_AUE_linux_sched_get_priority_min AUE_SCHED_GET_PRIORITY_MIN
+#define LINUX_SYS_AUE_linux_sched_rr_get_interval AUE_SCHED_RR_GET_INTERVAL
+#define LINUX_SYS_AUE_linux_vhangup AUE_NULL
+#define LINUX_SYS_AUE_linux_pivot_root AUE_PIVOT_ROOT
+#define LINUX_SYS_AUE_linux_sysctl AUE_SYSCTL
+#define LINUX_SYS_AUE_linux_prctl AUE_PRCTL
+#define LINUX_SYS_AUE_linux_arch_prctl AUE_PRCTL
+#define LINUX_SYS_AUE_linux_adjtimex AUE_ADJTIME
+#define LINUX_SYS_AUE_linux_setrlimit AUE_SETRLIMIT
+#define LINUX_SYS_AUE_linux_mount AUE_MOUNT
+#define LINUX_SYS_AUE_linux_umount AUE_UMOUNT
+#define LINUX_SYS_AUE_linux_swapoff AUE_SWAPOFF
+#define LINUX_SYS_AUE_linux_reboot AUE_REBOOT
+#define LINUX_SYS_AUE_linux_sethostname AUE_SYSCTL
+#define LINUX_SYS_AUE_linux_setdomainname AUE_SYSCTL
+#define LINUX_SYS_AUE_linux_iopl AUE_NULL
+#define LINUX_SYS_AUE_linux_create_module AUE_NULL
+#define LINUX_SYS_AUE_linux_init_module AUE_NULL
+#define LINUX_SYS_AUE_linux_delete_module AUE_NULL
+#define LINUX_SYS_AUE_linux_get_kernel_syms AUE_NULL
+#define LINUX_SYS_AUE_linux_query_module AUE_NULL
+#define LINUX_SYS_AUE_linux_quotactl AUE_QUOTACTL
+#define LINUX_SYS_AUE_linux_nfsservctl AUE_NULL
+#define LINUX_SYS_AUE_linux_getpmsg AUE_GETPMSG
+#define LINUX_SYS_AUE_linux_putpmsg AUE_PUTPMSG
+#define LINUX_SYS_AUE_linux_afs_syscall AUE_NULL
+#define LINUX_SYS_AUE_linux_tuxcall AUE_NULL
+#define LINUX_SYS_AUE_linux_security AUE_NULL
+#define LINUX_SYS_AUE_linux_gettid AUE_NULL
+#define LINUX_SYS_AUE_linux_setxattr AUE_NULL
+#define LINUX_SYS_AUE_linux_lsetxattr AUE_NULL
+#define LINUX_SYS_AUE_linux_fsetxattr AUE_NULL
+#define LINUX_SYS_AUE_linux_getxattr AUE_NULL
+#define LINUX_SYS_AUE_linux_lgetxattr AUE_NULL
+#define LINUX_SYS_AUE_linux_fgetxattr AUE_NULL
+#define LINUX_SYS_AUE_linux_listxattr AUE_NULL
+#define LINUX_SYS_AUE_linux_llistxattr AUE_NULL
+#define LINUX_SYS_AUE_linux_flistxattr AUE_NULL
+#define LINUX_SYS_AUE_linux_removexattr AUE_NULL
+#define LINUX_SYS_AUE_linux_lremovexattr AUE_NULL
+#define LINUX_SYS_AUE_linux_fremovexattr AUE_NULL
+#define LINUX_SYS_AUE_linux_tkill AUE_NULL
+#define LINUX_SYS_AUE_linux_time AUE_NULL
+#define LINUX_SYS_AUE_linux_sys_futex AUE_NULL
+#define LINUX_SYS_AUE_linux_sched_setaffinity AUE_NULL
+#define LINUX_SYS_AUE_linux_sched_getaffinity AUE_NULL
+#define LINUX_SYS_AUE_linux_set_thread_area AUE_NULL
+#define LINUX_SYS_AUE_linux_lookup_dcookie AUE_NULL
+#define LINUX_SYS_AUE_linux_epoll_create AUE_NULL
+#define LINUX_SYS_AUE_linux_epoll_ctl_old AUE_NULL
+#define LINUX_SYS_AUE_linux_epoll_wait_old AUE_NULL
+#define LINUX_SYS_AUE_linux_remap_file_pages AUE_NULL
+#define LINUX_SYS_AUE_linux_getdents64 AUE_GETDIRENTRIES
+#define LINUX_SYS_AUE_linux_set_tid_address AUE_NULL
+#define LINUX_SYS_AUE_linux_semtimedop AUE_NULL
+#define LINUX_SYS_AUE_linux_fadvise64 AUE_NULL
+#define LINUX_SYS_AUE_linux_timer_create AUE_NULL
+#define LINUX_SYS_AUE_linux_timer_settime AUE_NULL
+#define LINUX_SYS_AUE_linux_timer_gettime AUE_NULL
+#define LINUX_SYS_AUE_linux_timer_getoverrun AUE_NULL
+#define LINUX_SYS_AUE_linux_timer_delete AUE_NULL
+#define LINUX_SYS_AUE_linux_clock_settime AUE_CLOCK_SETTIME
+#define LINUX_SYS_AUE_linux_clock_gettime AUE_NULL
+#define LINUX_SYS_AUE_linux_clock_getres AUE_NULL
+#define LINUX_SYS_AUE_linux_clock_nanosleep AUE_NULL
+#define LINUX_SYS_AUE_linux_exit_group AUE_EXIT
+#define LINUX_SYS_AUE_linux_epoll_wait AUE_NULL
+#define LINUX_SYS_AUE_linux_epoll_ctl AUE_NULL
+#define LINUX_SYS_AUE_linux_tgkill AUE_NULL
+#define LINUX_SYS_AUE_linux_utimes AUE_UTIMES
+#define LINUX_SYS_AUE_linux_mbind AUE_NULL
+#define LINUX_SYS_AUE_linux_set_mempolicy AUE_NULL
+#define LINUX_SYS_AUE_linux_get_mempolicy AUE_NULL
+#define LINUX_SYS_AUE_linux_mq_open AUE_NULL
+#define LINUX_SYS_AUE_linux_mq_unlink AUE_NULL
+#define LINUX_SYS_AUE_linux_mq_timedsend AUE_NULL
+#define LINUX_SYS_AUE_linux_mq_timedreceive AUE_NULL
+#define LINUX_SYS_AUE_linux_mq_notify AUE_NULL
+#define LINUX_SYS_AUE_linux_mq_getsetattr AUE_NULL
+#define LINUX_SYS_AUE_linux_kexec_load AUE_NULL
+#define LINUX_SYS_AUE_linux_waitid AUE_WAIT6
+#define LINUX_SYS_AUE_linux_add_key AUE_NULL
+#define LINUX_SYS_AUE_linux_request_key AUE_NULL
+#define LINUX_SYS_AUE_linux_keyctl AUE_NULL
+#define LINUX_SYS_AUE_linux_ioprio_set AUE_NULL
+#define LINUX_SYS_AUE_linux_ioprio_get AUE_NULL
+#define LINUX_SYS_AUE_linux_inotify_init AUE_NULL
+#define LINUX_SYS_AUE_linux_inotify_add_watch AUE_NULL
+#define LINUX_SYS_AUE_linux_inotify_rm_watch AUE_NULL
+#define LINUX_SYS_AUE_linux_migrate_pages AUE_NULL
+#define LINUX_SYS_AUE_linux_openat AUE_OPEN_RWTC
+#define LINUX_SYS_AUE_linux_mkdirat AUE_MKDIRAT
+#define LINUX_SYS_AUE_linux_mknodat AUE_MKNODAT
+#define LINUX_SYS_AUE_linux_fchownat AUE_FCHOWNAT
+#define LINUX_SYS_AUE_linux_futimesat AUE_FUTIMESAT
+#define LINUX_SYS_AUE_linux_newfstatat AUE_FSTATAT
+#define LINUX_SYS_AUE_linux_unlinkat AUE_UNLINKAT
+#define LINUX_SYS_AUE_linux_renameat AUE_RENAMEAT
+#define LINUX_SYS_AUE_linux_linkat AUE_LINKAT
+#define LINUX_SYS_AUE_linux_symlinkat AUE_SYMLINKAT
+#define LINUX_SYS_AUE_linux_readlinkat AUE_READLINKAT
+#define LINUX_SYS_AUE_linux_fchmodat AUE_FCHMODAT
+#define LINUX_SYS_AUE_linux_faccessat AUE_FACCESSAT
+#define LINUX_SYS_AUE_linux_pselect6 AUE_SELECT
+#define LINUX_SYS_AUE_linux_ppoll AUE_POLL
+#define LINUX_SYS_AUE_linux_unshare AUE_NULL
+#define LINUX_SYS_AUE_linux_set_robust_list AUE_NULL
+#define LINUX_SYS_AUE_linux_get_robust_list AUE_NULL
+#define LINUX_SYS_AUE_linux_splice AUE_NULL
+#define LINUX_SYS_AUE_linux_tee AUE_NULL
+#define LINUX_SYS_AUE_linux_sync_file_range AUE_NULL
+#define LINUX_SYS_AUE_linux_vmsplice AUE_NULL
+#define LINUX_SYS_AUE_linux_move_pages AUE_NULL
+#define LINUX_SYS_AUE_linux_utimensat AUE_FUTIMESAT
+#define LINUX_SYS_AUE_linux_epoll_pwait AUE_NULL
+#define LINUX_SYS_AUE_linux_signalfd AUE_NULL
+#define LINUX_SYS_AUE_linux_timerfd AUE_NULL
+#define LINUX_SYS_AUE_linux_eventfd AUE_NULL
+#define LINUX_SYS_AUE_linux_fallocate AUE_NULL
+#define LINUX_SYS_AUE_linux_timerfd_settime AUE_NULL
+#define LINUX_SYS_AUE_linux_timerfd_gettime AUE_NULL
+#define LINUX_SYS_AUE_linux_accept4 AUE_ACCEPT
+#define LINUX_SYS_AUE_linux_signalfd4 AUE_NULL
+#define LINUX_SYS_AUE_linux_eventfd2 AUE_NULL
+#define LINUX_SYS_AUE_linux_epoll_create1 AUE_NULL
+#define LINUX_SYS_AUE_linux_dup3 AUE_NULL
+#define LINUX_SYS_AUE_linux_pipe2 AUE_NULL
+#define LINUX_SYS_AUE_linux_inotify_init1 AUE_NULL
+#define LINUX_SYS_AUE_linux_preadv AUE_NULL
+#define LINUX_SYS_AUE_linux_pwritev AUE_NULL
+#define LINUX_SYS_AUE_linux_rt_tsigqueueinfo AUE_NULL
+#define LINUX_SYS_AUE_linux_perf_event_open AUE_NULL
+#define LINUX_SYS_AUE_linux_recvmmsg AUE_NULL
+#define LINUX_SYS_AUE_linux_fanotify_init AUE_NULL
+#define LINUX_SYS_AUE_linux_fanotify_mark AUE_NULL
+#define LINUX_SYS_AUE_linux_prlimit64 AUE_NULL
+#define LINUX_SYS_AUE_linux_name_to_handle_at AUE_NULL
+#define LINUX_SYS_AUE_linux_open_by_handle_at AUE_NULL
+#define LINUX_SYS_AUE_linux_clock_adjtime AUE_NULL
+#define LINUX_SYS_AUE_linux_syncfs AUE_SYNC
+#define LINUX_SYS_AUE_linux_sendmmsg AUE_NULL
+#define LINUX_SYS_AUE_linux_setns AUE_NULL
+#define LINUX_SYS_AUE_linux_process_vm_readv AUE_NULL
+#define LINUX_SYS_AUE_linux_process_vm_writev AUE_NULL
+#define LINUX_SYS_AUE_linux_kcmp AUE_NULL
+#define LINUX_SYS_AUE_linux_finit_module AUE_NULL
+
+#undef PAD_
+#undef PADL_
+#undef PADR_
+
+#endif /* !_LINUX_SYSPROTO_H_ */
diff --git a/sys/amd64/linux/linux_support.s b/sys/amd64/linux/linux_support.s
new file mode 100644
index 0000000..2a3ba1a
--- /dev/null
+++ b/sys/amd64/linux/linux_support.s
@@ -0,0 +1,124 @@
+/*-
+ * Copyright (c) 2007 Konstantin Belousov
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include "linux_assym.h" /* system definitions */
+#include <machine/asmacros.h> /* miscellaneous asm macros */
+
+#include "assym.s"
+
+futex_fault:
+ movq $0,PCB_ONFAULT(%r8)
+ movl $-EFAULT,%eax
+ ret
+
+ENTRY(futex_xchgl)
+ movq PCPU(CURPCB),%r8
+ movq $futex_fault,PCB_ONFAULT(%r8)
+ movq $VM_MAXUSER_ADDRESS-4,%rax
+ cmpq %rax,%rsi
+ ja futex_fault
+ xchgl %edi,(%rsi)
+ movl %edi,(%rdx)
+ xorl %eax,%eax
+ movq %rax,PCB_ONFAULT(%r8)
+ ret
+
+ENTRY(futex_addl)
+ movq PCPU(CURPCB),%r8
+ movq $futex_fault,PCB_ONFAULT(%r8)
+ movq $VM_MAXUSER_ADDRESS-4,%rax
+ cmpq %rax,%rsi
+ ja futex_fault
+#ifdef SMP
+ lock
+#endif
+ xaddl %edi,(%rsi)
+ movl %edi,(%rdx)
+ xorl %eax,%eax
+ movq %rax,PCB_ONFAULT(%r8)
+ ret
+
+ENTRY(futex_orl)
+ movq PCPU(CURPCB),%r8
+ movq $futex_fault,PCB_ONFAULT(%r8)
+ movq $VM_MAXUSER_ADDRESS-4,%rax
+ cmpq %rax,%rsi
+ ja futex_fault
+ movl (%rsi),%eax
+1: movl %eax,%ecx
+ orl %edi,%ecx
+#ifdef SMP
+ lock
+#endif
+ cmpxchgl %ecx,(%rsi)
+ jnz 1b
+ movl %eax,(%rdx)
+ xorl %eax,%eax
+ movq %rax,PCB_ONFAULT(%r8)
+ ret
+
+ENTRY(futex_andl)
+ movq PCPU(CURPCB),%r8
+ movq $futex_fault,PCB_ONFAULT(%r8)
+ movq $VM_MAXUSER_ADDRESS-4,%rax
+ cmpq %rax,%rsi
+ ja futex_fault
+ movl (%rsi),%eax
+1: movl %eax,%ecx
+ andl %edi,%ecx
+#ifdef SMP
+ lock
+#endif
+ cmpxchgl %ecx,(%rsi)
+ jnz 1b
+ movl %eax,(%rdx)
+ xorl %eax,%eax
+ movq %rax,PCB_ONFAULT(%r8)
+ ret
+
+ENTRY(futex_xorl)
+ movq PCPU(CURPCB),%r8
+ movq $futex_fault,PCB_ONFAULT(%r8)
+ movq $VM_MAXUSER_ADDRESS-4,%rax
+ cmpq %rax,%rsi
+ ja futex_fault
+ movl (%rsi),%eax
+1: movl %eax,%ecx
+ xorl %edi,%ecx
+#ifdef SMP
+ lock
+#endif
+ cmpxchgl %ecx,(%rsi)
+ jnz 1b
+ movl %eax,(%rdx)
+ xorl %eax,%eax
+ movq %rax,PCB_ONFAULT(%r8)
+ ret
diff --git a/sys/amd64/linux/linux_syscall.h b/sys/amd64/linux/linux_syscall.h
new file mode 100644
index 0000000..19a0265
--- /dev/null
+++ b/sys/amd64/linux/linux_syscall.h
@@ -0,0 +1,310 @@
+/*
+ * System call numbers.
+ *
+ * DO NOT EDIT-- this file is automatically generated.
+ * $FreeBSD$
+ * created from FreeBSD: head/sys/amd64/linux/syscalls.master 283492 2015-05-24 18:08:01Z dchagin
+ */
+
+#define LINUX_SYS_read 0
+#define LINUX_SYS_write 1
+#define LINUX_SYS_linux_open 2
+#define LINUX_SYS_close 3
+#define LINUX_SYS_linux_newstat 4
+#define LINUX_SYS_linux_newfstat 5
+#define LINUX_SYS_linux_newlstat 6
+#define LINUX_SYS_poll 7
+#define LINUX_SYS_linux_lseek 8
+#define LINUX_SYS_linux_mmap2 9
+#define LINUX_SYS_linux_mprotect 10
+#define LINUX_SYS_munmap 11
+#define LINUX_SYS_linux_brk 12
+#define LINUX_SYS_linux_rt_sigaction 13
+#define LINUX_SYS_linux_rt_sigprocmask 14
+#define LINUX_SYS_linux_rt_sigreturn 15
+#define LINUX_SYS_linux_ioctl 16
+#define LINUX_SYS_linux_pread 17
+#define LINUX_SYS_linux_pwrite 18
+#define LINUX_SYS_readv 19
+#define LINUX_SYS_writev 20
+#define LINUX_SYS_linux_access 21
+#define LINUX_SYS_linux_pipe 22
+#define LINUX_SYS_linux_select 23
+#define LINUX_SYS_sched_yield 24
+#define LINUX_SYS_linux_mremap 25
+#define LINUX_SYS_linux_msync 26
+#define LINUX_SYS_linux_mincore 27
+#define LINUX_SYS_madvise 28
+#define LINUX_SYS_linux_shmget 29
+#define LINUX_SYS_linux_shmat 30
+#define LINUX_SYS_linux_shmctl 31
+#define LINUX_SYS_dup 32
+#define LINUX_SYS_dup2 33
+#define LINUX_SYS_linux_pause 34
+#define LINUX_SYS_linux_nanosleep 35
+#define LINUX_SYS_linux_getitimer 36
+#define LINUX_SYS_linux_alarm 37
+#define LINUX_SYS_linux_setitimer 38
+#define LINUX_SYS_linux_getpid 39
+#define LINUX_SYS_linux_sendfile 40
+#define LINUX_SYS_linux_socket 41
+#define LINUX_SYS_linux_connect 42
+#define LINUX_SYS_linux_accept 43
+#define LINUX_SYS_linux_sendto 44
+#define LINUX_SYS_linux_recvfrom 45
+#define LINUX_SYS_linux_sendmsg 46
+#define LINUX_SYS_linux_recvmsg 47
+#define LINUX_SYS_linux_shutdown 48
+#define LINUX_SYS_linux_bind 49
+#define LINUX_SYS_linux_listen 50
+#define LINUX_SYS_linux_getsockname 51
+#define LINUX_SYS_linux_getpeername 52
+#define LINUX_SYS_linux_socketpair 53
+#define LINUX_SYS_linux_setsockopt 54
+#define LINUX_SYS_linux_getsockopt 55
+#define LINUX_SYS_linux_clone 56
+#define LINUX_SYS_linux_fork 57
+#define LINUX_SYS_linux_vfork 58
+#define LINUX_SYS_linux_execve 59
+#define LINUX_SYS_linux_exit 60
+#define LINUX_SYS_linux_wait4 61
+#define LINUX_SYS_linux_kill 62
+#define LINUX_SYS_linux_newuname 63
+#define LINUX_SYS_linux_semget 64
+#define LINUX_SYS_linux_semop 65
+#define LINUX_SYS_linux_semctl 66
+#define LINUX_SYS_linux_shmdt 67
+#define LINUX_SYS_linux_msgget 68
+#define LINUX_SYS_linux_msgsnd 69
+#define LINUX_SYS_linux_msgrcv 70
+#define LINUX_SYS_linux_msgctl 71
+#define LINUX_SYS_linux_fcntl 72
+#define LINUX_SYS_flock 73
+#define LINUX_SYS_fsync 74
+#define LINUX_SYS_linux_fdatasync 75
+#define LINUX_SYS_linux_truncate 76
+#define LINUX_SYS_linux_ftruncate 77
+#define LINUX_SYS_linux_getdents 78
+#define LINUX_SYS_linux_getcwd 79
+#define LINUX_SYS_linux_chdir 80
+#define LINUX_SYS_fchdir 81
+#define LINUX_SYS_linux_rename 82
+#define LINUX_SYS_linux_mkdir 83
+#define LINUX_SYS_linux_rmdir 84
+#define LINUX_SYS_linux_creat 85
+#define LINUX_SYS_linux_link 86
+#define LINUX_SYS_linux_unlink 87
+#define LINUX_SYS_linux_symlink 88
+#define LINUX_SYS_linux_readlink 89
+#define LINUX_SYS_linux_chmod 90
+#define LINUX_SYS_fchmod 91
+#define LINUX_SYS_linux_chown 92
+#define LINUX_SYS_fchown 93
+#define LINUX_SYS_linux_lchown 94
+#define LINUX_SYS_umask 95
+#define LINUX_SYS_gettimeofday 96
+#define LINUX_SYS_linux_getrlimit 97
+#define LINUX_SYS_getrusage 98
+#define LINUX_SYS_linux_sysinfo 99
+#define LINUX_SYS_linux_times 100
+#define LINUX_SYS_linux_ptrace 101
+#define LINUX_SYS_linux_getuid 102
+#define LINUX_SYS_linux_syslog 103
+#define LINUX_SYS_linux_getgid 104
+#define LINUX_SYS_setuid 105
+#define LINUX_SYS_setgid 106
+#define LINUX_SYS_geteuid 107
+#define LINUX_SYS_getegid 108
+#define LINUX_SYS_setpgid 109
+#define LINUX_SYS_linux_getppid 110
+#define LINUX_SYS_getpgrp 111
+#define LINUX_SYS_setsid 112
+#define LINUX_SYS_setreuid 113
+#define LINUX_SYS_setregid 114
+#define LINUX_SYS_linux_getgroups 115
+#define LINUX_SYS_linux_setgroups 116
+#define LINUX_SYS_setresuid 117
+#define LINUX_SYS_getresuid 118
+#define LINUX_SYS_setresgid 119
+#define LINUX_SYS_getresgid 120
+#define LINUX_SYS_getpgid 121
+#define LINUX_SYS_linux_setfsuid 122
+#define LINUX_SYS_linux_setfsgid 123
+#define LINUX_SYS_linux_getsid 124
+#define LINUX_SYS_linux_capget 125
+#define LINUX_SYS_linux_capset 126
+#define LINUX_SYS_linux_rt_sigpending 127
+#define LINUX_SYS_linux_rt_sigtimedwait 128
+#define LINUX_SYS_linux_rt_sigqueueinfo 129
+#define LINUX_SYS_linux_rt_sigsuspend 130
+#define LINUX_SYS_linux_sigaltstack 131
+#define LINUX_SYS_linux_utime 132
+#define LINUX_SYS_linux_mknod 133
+#define LINUX_SYS_linux_personality 135
+#define LINUX_SYS_linux_ustat 136
+#define LINUX_SYS_linux_statfs 137
+#define LINUX_SYS_linux_fstatfs 138
+#define LINUX_SYS_linux_sysfs 139
+#define LINUX_SYS_linux_getpriority 140
+#define LINUX_SYS_setpriority 141
+#define LINUX_SYS_linux_sched_setparam 142
+#define LINUX_SYS_linux_sched_getparam 143
+#define LINUX_SYS_linux_sched_setscheduler 144
+#define LINUX_SYS_linux_sched_getscheduler 145
+#define LINUX_SYS_linux_sched_get_priority_max 146
+#define LINUX_SYS_linux_sched_get_priority_min 147
+#define LINUX_SYS_linux_sched_rr_get_interval 148
+#define LINUX_SYS_mlock 149
+#define LINUX_SYS_munlock 150
+#define LINUX_SYS_mlockall 151
+#define LINUX_SYS_munlockall 152
+#define LINUX_SYS_linux_vhangup 153
+#define LINUX_SYS_linux_pivot_root 155
+#define LINUX_SYS_linux_sysctl 156
+#define LINUX_SYS_linux_prctl 157
+#define LINUX_SYS_linux_arch_prctl 158
+#define LINUX_SYS_linux_adjtimex 159
+#define LINUX_SYS_linux_setrlimit 160
+#define LINUX_SYS_chroot 161
+#define LINUX_SYS_sync 162
+#define LINUX_SYS_acct 163
+#define LINUX_SYS_settimeofday 164
+#define LINUX_SYS_linux_mount 165
+#define LINUX_SYS_linux_umount 166
+#define LINUX_SYS_swapon 167
+#define LINUX_SYS_linux_swapoff 168
+#define LINUX_SYS_linux_reboot 169
+#define LINUX_SYS_linux_sethostname 170
+#define LINUX_SYS_linux_setdomainname 171
+#define LINUX_SYS_linux_iopl 172
+#define LINUX_SYS_linux_create_module 174
+#define LINUX_SYS_linux_init_module 175
+#define LINUX_SYS_linux_delete_module 176
+#define LINUX_SYS_linux_get_kernel_syms 177
+#define LINUX_SYS_linux_query_module 178
+#define LINUX_SYS_linux_quotactl 179
+#define LINUX_SYS_linux_nfsservctl 180
+#define LINUX_SYS_linux_getpmsg 181
+#define LINUX_SYS_linux_putpmsg 182
+#define LINUX_SYS_linux_afs_syscall 183
+#define LINUX_SYS_linux_tuxcall 184
+#define LINUX_SYS_linux_security 185
+#define LINUX_SYS_linux_gettid 186
+#define LINUX_SYS_linux_setxattr 188
+#define LINUX_SYS_linux_lsetxattr 189
+#define LINUX_SYS_linux_fsetxattr 190
+#define LINUX_SYS_linux_getxattr 191
+#define LINUX_SYS_linux_lgetxattr 192
+#define LINUX_SYS_linux_fgetxattr 193
+#define LINUX_SYS_linux_listxattr 194
+#define LINUX_SYS_linux_llistxattr 195
+#define LINUX_SYS_linux_flistxattr 196
+#define LINUX_SYS_linux_removexattr 197
+#define LINUX_SYS_linux_lremovexattr 198
+#define LINUX_SYS_linux_fremovexattr 199
+#define LINUX_SYS_linux_tkill 200
+#define LINUX_SYS_linux_time 201
+#define LINUX_SYS_linux_sys_futex 202
+#define LINUX_SYS_linux_sched_setaffinity 203
+#define LINUX_SYS_linux_sched_getaffinity 204
+#define LINUX_SYS_linux_set_thread_area 205
+#define LINUX_SYS_linux_lookup_dcookie 212
+#define LINUX_SYS_linux_epoll_create 213
+#define LINUX_SYS_linux_epoll_ctl_old 214
+#define LINUX_SYS_linux_epoll_wait_old 215
+#define LINUX_SYS_linux_remap_file_pages 216
+#define LINUX_SYS_linux_getdents64 217
+#define LINUX_SYS_linux_set_tid_address 218
+#define LINUX_SYS_linux_semtimedop 220
+#define LINUX_SYS_linux_fadvise64 221
+#define LINUX_SYS_linux_timer_create 222
+#define LINUX_SYS_linux_timer_settime 223
+#define LINUX_SYS_linux_timer_gettime 224
+#define LINUX_SYS_linux_timer_getoverrun 225
+#define LINUX_SYS_linux_timer_delete 226
+#define LINUX_SYS_linux_clock_settime 227
+#define LINUX_SYS_linux_clock_gettime 228
+#define LINUX_SYS_linux_clock_getres 229
+#define LINUX_SYS_linux_clock_nanosleep 230
+#define LINUX_SYS_linux_exit_group 231
+#define LINUX_SYS_linux_epoll_wait 232
+#define LINUX_SYS_linux_epoll_ctl 233
+#define LINUX_SYS_linux_tgkill 234
+#define LINUX_SYS_linux_utimes 235
+#define LINUX_SYS_linux_mbind 237
+#define LINUX_SYS_linux_set_mempolicy 238
+#define LINUX_SYS_linux_get_mempolicy 239
+#define LINUX_SYS_linux_mq_open 240
+#define LINUX_SYS_linux_mq_unlink 241
+#define LINUX_SYS_linux_mq_timedsend 242
+#define LINUX_SYS_linux_mq_timedreceive 243
+#define LINUX_SYS_linux_mq_notify 244
+#define LINUX_SYS_linux_mq_getsetattr 245
+#define LINUX_SYS_linux_kexec_load 246
+#define LINUX_SYS_linux_waitid 247
+#define LINUX_SYS_linux_add_key 248
+#define LINUX_SYS_linux_request_key 249
+#define LINUX_SYS_linux_keyctl 250
+#define LINUX_SYS_linux_ioprio_set 251
+#define LINUX_SYS_linux_ioprio_get 252
+#define LINUX_SYS_linux_inotify_init 253
+#define LINUX_SYS_linux_inotify_add_watch 254
+#define LINUX_SYS_linux_inotify_rm_watch 255
+#define LINUX_SYS_linux_migrate_pages 256
+#define LINUX_SYS_linux_openat 257
+#define LINUX_SYS_linux_mkdirat 258
+#define LINUX_SYS_linux_mknodat 259
+#define LINUX_SYS_linux_fchownat 260
+#define LINUX_SYS_linux_futimesat 261
+#define LINUX_SYS_linux_newfstatat 262
+#define LINUX_SYS_linux_unlinkat 263
+#define LINUX_SYS_linux_renameat 264
+#define LINUX_SYS_linux_linkat 265
+#define LINUX_SYS_linux_symlinkat 266
+#define LINUX_SYS_linux_readlinkat 267
+#define LINUX_SYS_linux_fchmodat 268
+#define LINUX_SYS_linux_faccessat 269
+#define LINUX_SYS_linux_pselect6 270
+#define LINUX_SYS_linux_ppoll 271
+#define LINUX_SYS_linux_unshare 272
+#define LINUX_SYS_linux_set_robust_list 273
+#define LINUX_SYS_linux_get_robust_list 274
+#define LINUX_SYS_linux_splice 275
+#define LINUX_SYS_linux_tee 276
+#define LINUX_SYS_linux_sync_file_range 277
+#define LINUX_SYS_linux_vmsplice 278
+#define LINUX_SYS_linux_move_pages 279
+#define LINUX_SYS_linux_utimensat 280
+#define LINUX_SYS_linux_epoll_pwait 281
+#define LINUX_SYS_linux_signalfd 282
+#define LINUX_SYS_linux_timerfd 283
+#define LINUX_SYS_linux_eventfd 284
+#define LINUX_SYS_linux_fallocate 285
+#define LINUX_SYS_linux_timerfd_settime 286
+#define LINUX_SYS_linux_timerfd_gettime 287
+#define LINUX_SYS_linux_accept4 288
+#define LINUX_SYS_linux_signalfd4 289
+#define LINUX_SYS_linux_eventfd2 290
+#define LINUX_SYS_linux_epoll_create1 291
+#define LINUX_SYS_linux_dup3 292
+#define LINUX_SYS_linux_pipe2 293
+#define LINUX_SYS_linux_inotify_init1 294
+#define LINUX_SYS_linux_preadv 295
+#define LINUX_SYS_linux_pwritev 296
+#define LINUX_SYS_linux_rt_tsigqueueinfo 297
+#define LINUX_SYS_linux_perf_event_open 298
+#define LINUX_SYS_linux_recvmmsg 299
+#define LINUX_SYS_linux_fanotify_init 300
+#define LINUX_SYS_linux_fanotify_mark 301
+#define LINUX_SYS_linux_prlimit64 302
+#define LINUX_SYS_linux_name_to_handle_at 303
+#define LINUX_SYS_linux_open_by_handle_at 304
+#define LINUX_SYS_linux_clock_adjtime 305
+#define LINUX_SYS_linux_syncfs 306
+#define LINUX_SYS_linux_sendmmsg 307
+#define LINUX_SYS_linux_setns 308
+#define LINUX_SYS_linux_process_vm_readv 309
+#define LINUX_SYS_linux_process_vm_writev 310
+#define LINUX_SYS_linux_kcmp 311
+#define LINUX_SYS_linux_finit_module 312
+#define LINUX_SYS_MAXSYSCALL 314
diff --git a/sys/amd64/linux/linux_syscalls.c b/sys/amd64/linux/linux_syscalls.c
new file mode 100644
index 0000000..f19d285
--- /dev/null
+++ b/sys/amd64/linux/linux_syscalls.c
@@ -0,0 +1,325 @@
+/*
+ * System call names.
+ *
+ * DO NOT EDIT-- this file is automatically generated.
+ * $FreeBSD$
+ * created from FreeBSD: head/sys/amd64/linux/syscalls.master 283492 2015-05-24 18:08:01Z dchagin
+ */
+
+const char *linux_syscallnames[] = {
+#define nosys linux_nosys
+ "read", /* 0 = read */
+ "write", /* 1 = write */
+ "linux_open", /* 2 = linux_open */
+ "close", /* 3 = close */
+ "linux_newstat", /* 4 = linux_newstat */
+ "linux_newfstat", /* 5 = linux_newfstat */
+ "linux_newlstat", /* 6 = linux_newlstat */
+ "poll", /* 7 = poll */
+ "linux_lseek", /* 8 = linux_lseek */
+ "linux_mmap2", /* 9 = linux_mmap2 */
+ "linux_mprotect", /* 10 = linux_mprotect */
+ "munmap", /* 11 = munmap */
+ "linux_brk", /* 12 = linux_brk */
+ "linux_rt_sigaction", /* 13 = linux_rt_sigaction */
+ "linux_rt_sigprocmask", /* 14 = linux_rt_sigprocmask */
+ "linux_rt_sigreturn", /* 15 = linux_rt_sigreturn */
+ "linux_ioctl", /* 16 = linux_ioctl */
+ "linux_pread", /* 17 = linux_pread */
+ "linux_pwrite", /* 18 = linux_pwrite */
+ "readv", /* 19 = readv */
+ "writev", /* 20 = writev */
+ "linux_access", /* 21 = linux_access */
+ "linux_pipe", /* 22 = linux_pipe */
+ "linux_select", /* 23 = linux_select */
+ "sched_yield", /* 24 = sched_yield */
+ "linux_mremap", /* 25 = linux_mremap */
+ "linux_msync", /* 26 = linux_msync */
+ "linux_mincore", /* 27 = linux_mincore */
+ "madvise", /* 28 = madvise */
+ "linux_shmget", /* 29 = linux_shmget */
+ "linux_shmat", /* 30 = linux_shmat */
+ "linux_shmctl", /* 31 = linux_shmctl */
+ "dup", /* 32 = dup */
+ "dup2", /* 33 = dup2 */
+ "linux_pause", /* 34 = linux_pause */
+ "linux_nanosleep", /* 35 = linux_nanosleep */
+ "linux_getitimer", /* 36 = linux_getitimer */
+ "linux_alarm", /* 37 = linux_alarm */
+ "linux_setitimer", /* 38 = linux_setitimer */
+ "linux_getpid", /* 39 = linux_getpid */
+ "linux_sendfile", /* 40 = linux_sendfile */
+ "linux_socket", /* 41 = linux_socket */
+ "linux_connect", /* 42 = linux_connect */
+ "linux_accept", /* 43 = linux_accept */
+ "linux_sendto", /* 44 = linux_sendto */
+ "linux_recvfrom", /* 45 = linux_recvfrom */
+ "linux_sendmsg", /* 46 = linux_sendmsg */
+ "linux_recvmsg", /* 47 = linux_recvmsg */
+ "linux_shutdown", /* 48 = linux_shutdown */
+ "linux_bind", /* 49 = linux_bind */
+ "linux_listen", /* 50 = linux_listen */
+ "linux_getsockname", /* 51 = linux_getsockname */
+ "linux_getpeername", /* 52 = linux_getpeername */
+ "linux_socketpair", /* 53 = linux_socketpair */
+ "linux_setsockopt", /* 54 = linux_setsockopt */
+ "linux_getsockopt", /* 55 = linux_getsockopt */
+ "linux_clone", /* 56 = linux_clone */
+ "linux_fork", /* 57 = linux_fork */
+ "linux_vfork", /* 58 = linux_vfork */
+ "linux_execve", /* 59 = linux_execve */
+ "linux_exit", /* 60 = linux_exit */
+ "linux_wait4", /* 61 = linux_wait4 */
+ "linux_kill", /* 62 = linux_kill */
+ "linux_newuname", /* 63 = linux_newuname */
+ "linux_semget", /* 64 = linux_semget */
+ "linux_semop", /* 65 = linux_semop */
+ "linux_semctl", /* 66 = linux_semctl */
+ "linux_shmdt", /* 67 = linux_shmdt */
+ "linux_msgget", /* 68 = linux_msgget */
+ "linux_msgsnd", /* 69 = linux_msgsnd */
+ "linux_msgrcv", /* 70 = linux_msgrcv */
+ "linux_msgctl", /* 71 = linux_msgctl */
+ "linux_fcntl", /* 72 = linux_fcntl */
+ "flock", /* 73 = flock */
+ "fsync", /* 74 = fsync */
+ "linux_fdatasync", /* 75 = linux_fdatasync */
+ "linux_truncate", /* 76 = linux_truncate */
+ "linux_ftruncate", /* 77 = linux_ftruncate */
+ "linux_getdents", /* 78 = linux_getdents */
+ "linux_getcwd", /* 79 = linux_getcwd */
+ "linux_chdir", /* 80 = linux_chdir */
+ "fchdir", /* 81 = fchdir */
+ "linux_rename", /* 82 = linux_rename */
+ "linux_mkdir", /* 83 = linux_mkdir */
+ "linux_rmdir", /* 84 = linux_rmdir */
+ "linux_creat", /* 85 = linux_creat */
+ "linux_link", /* 86 = linux_link */
+ "linux_unlink", /* 87 = linux_unlink */
+ "linux_symlink", /* 88 = linux_symlink */
+ "linux_readlink", /* 89 = linux_readlink */
+ "linux_chmod", /* 90 = linux_chmod */
+ "fchmod", /* 91 = fchmod */
+ "linux_chown", /* 92 = linux_chown */
+ "fchown", /* 93 = fchown */
+ "linux_lchown", /* 94 = linux_lchown */
+ "umask", /* 95 = umask */
+ "gettimeofday", /* 96 = gettimeofday */
+ "linux_getrlimit", /* 97 = linux_getrlimit */
+ "getrusage", /* 98 = getrusage */
+ "linux_sysinfo", /* 99 = linux_sysinfo */
+ "linux_times", /* 100 = linux_times */
+ "linux_ptrace", /* 101 = linux_ptrace */
+ "linux_getuid", /* 102 = linux_getuid */
+ "linux_syslog", /* 103 = linux_syslog */
+ "linux_getgid", /* 104 = linux_getgid */
+ "setuid", /* 105 = setuid */
+ "setgid", /* 106 = setgid */
+ "geteuid", /* 107 = geteuid */
+ "getegid", /* 108 = getegid */
+ "setpgid", /* 109 = setpgid */
+ "linux_getppid", /* 110 = linux_getppid */
+ "getpgrp", /* 111 = getpgrp */
+ "setsid", /* 112 = setsid */
+ "setreuid", /* 113 = setreuid */
+ "setregid", /* 114 = setregid */
+ "linux_getgroups", /* 115 = linux_getgroups */
+ "linux_setgroups", /* 116 = linux_setgroups */
+ "setresuid", /* 117 = setresuid */
+ "getresuid", /* 118 = getresuid */
+ "setresgid", /* 119 = setresgid */
+ "getresgid", /* 120 = getresgid */
+ "getpgid", /* 121 = getpgid */
+ "linux_setfsuid", /* 122 = linux_setfsuid */
+ "linux_setfsgid", /* 123 = linux_setfsgid */
+ "linux_getsid", /* 124 = linux_getsid */
+ "linux_capget", /* 125 = linux_capget */
+ "linux_capset", /* 126 = linux_capset */
+ "linux_rt_sigpending", /* 127 = linux_rt_sigpending */
+ "linux_rt_sigtimedwait", /* 128 = linux_rt_sigtimedwait */
+ "linux_rt_sigqueueinfo", /* 129 = linux_rt_sigqueueinfo */
+ "linux_rt_sigsuspend", /* 130 = linux_rt_sigsuspend */
+ "linux_sigaltstack", /* 131 = linux_sigaltstack */
+ "linux_utime", /* 132 = linux_utime */
+ "linux_mknod", /* 133 = linux_mknod */
+ "#134", /* 134 = uselib */
+ "linux_personality", /* 135 = linux_personality */
+ "linux_ustat", /* 136 = linux_ustat */
+ "linux_statfs", /* 137 = linux_statfs */
+ "linux_fstatfs", /* 138 = linux_fstatfs */
+ "linux_sysfs", /* 139 = linux_sysfs */
+ "linux_getpriority", /* 140 = linux_getpriority */
+ "setpriority", /* 141 = setpriority */
+ "linux_sched_setparam", /* 142 = linux_sched_setparam */
+ "linux_sched_getparam", /* 143 = linux_sched_getparam */
+ "linux_sched_setscheduler", /* 144 = linux_sched_setscheduler */
+ "linux_sched_getscheduler", /* 145 = linux_sched_getscheduler */
+ "linux_sched_get_priority_max", /* 146 = linux_sched_get_priority_max */
+ "linux_sched_get_priority_min", /* 147 = linux_sched_get_priority_min */
+ "linux_sched_rr_get_interval", /* 148 = linux_sched_rr_get_interval */
+ "mlock", /* 149 = mlock */
+ "munlock", /* 150 = munlock */
+ "mlockall", /* 151 = mlockall */
+ "munlockall", /* 152 = munlockall */
+ "linux_vhangup", /* 153 = linux_vhangup */
+ "#154", /* 154 = modify_ldt */
+ "linux_pivot_root", /* 155 = linux_pivot_root */
+ "linux_sysctl", /* 156 = linux_sysctl */
+ "linux_prctl", /* 157 = linux_prctl */
+ "linux_arch_prctl", /* 158 = linux_arch_prctl */
+ "linux_adjtimex", /* 159 = linux_adjtimex */
+ "linux_setrlimit", /* 160 = linux_setrlimit */
+ "chroot", /* 161 = chroot */
+ "sync", /* 162 = sync */
+ "acct", /* 163 = acct */
+ "settimeofday", /* 164 = settimeofday */
+ "linux_mount", /* 165 = linux_mount */
+ "linux_umount", /* 166 = linux_umount */
+ "swapon", /* 167 = swapon */
+ "linux_swapoff", /* 168 = linux_swapoff */
+ "linux_reboot", /* 169 = linux_reboot */
+ "linux_sethostname", /* 170 = linux_sethostname */
+ "linux_setdomainname", /* 171 = linux_setdomainname */
+ "linux_iopl", /* 172 = linux_iopl */
+ "#173", /* 173 = ioperm */
+ "linux_create_module", /* 174 = linux_create_module */
+ "linux_init_module", /* 175 = linux_init_module */
+ "linux_delete_module", /* 176 = linux_delete_module */
+ "linux_get_kernel_syms", /* 177 = linux_get_kernel_syms */
+ "linux_query_module", /* 178 = linux_query_module */
+ "linux_quotactl", /* 179 = linux_quotactl */
+ "linux_nfsservctl", /* 180 = linux_nfsservctl */
+ "linux_getpmsg", /* 181 = linux_getpmsg */
+ "linux_putpmsg", /* 182 = linux_putpmsg */
+ "linux_afs_syscall", /* 183 = linux_afs_syscall */
+ "linux_tuxcall", /* 184 = linux_tuxcall */
+ "linux_security", /* 185 = linux_security */
+ "linux_gettid", /* 186 = linux_gettid */
+ "#187", /* 187 = linux_readahead */
+ "linux_setxattr", /* 188 = linux_setxattr */
+ "linux_lsetxattr", /* 189 = linux_lsetxattr */
+ "linux_fsetxattr", /* 190 = linux_fsetxattr */
+ "linux_getxattr", /* 191 = linux_getxattr */
+ "linux_lgetxattr", /* 192 = linux_lgetxattr */
+ "linux_fgetxattr", /* 193 = linux_fgetxattr */
+ "linux_listxattr", /* 194 = linux_listxattr */
+ "linux_llistxattr", /* 195 = linux_llistxattr */
+ "linux_flistxattr", /* 196 = linux_flistxattr */
+ "linux_removexattr", /* 197 = linux_removexattr */
+ "linux_lremovexattr", /* 198 = linux_lremovexattr */
+ "linux_fremovexattr", /* 199 = linux_fremovexattr */
+ "linux_tkill", /* 200 = linux_tkill */
+ "linux_time", /* 201 = linux_time */
+ "linux_sys_futex", /* 202 = linux_sys_futex */
+ "linux_sched_setaffinity", /* 203 = linux_sched_setaffinity */
+ "linux_sched_getaffinity", /* 204 = linux_sched_getaffinity */
+ "linux_set_thread_area", /* 205 = linux_set_thread_area */
+ "#206", /* 206 = linux_io_setup */
+ "#207", /* 207 = linux_io_destroy */
+ "#208", /* 208 = linux_io_getevents */
+ "#209", /* 209 = inux_io_submit */
+ "#210", /* 210 = linux_io_cancel */
+ "#211", /* 211 = linux_get_thread_area */
+ "linux_lookup_dcookie", /* 212 = linux_lookup_dcookie */
+ "linux_epoll_create", /* 213 = linux_epoll_create */
+ "linux_epoll_ctl_old", /* 214 = linux_epoll_ctl_old */
+ "linux_epoll_wait_old", /* 215 = linux_epoll_wait_old */
+ "linux_remap_file_pages", /* 216 = linux_remap_file_pages */
+ "linux_getdents64", /* 217 = linux_getdents64 */
+ "linux_set_tid_address", /* 218 = linux_set_tid_address */
+ "#219", /* 219 = restart_syscall */
+ "linux_semtimedop", /* 220 = linux_semtimedop */
+ "linux_fadvise64", /* 221 = linux_fadvise64 */
+ "linux_timer_create", /* 222 = linux_timer_create */
+ "linux_timer_settime", /* 223 = linux_timer_settime */
+ "linux_timer_gettime", /* 224 = linux_timer_gettime */
+ "linux_timer_getoverrun", /* 225 = linux_timer_getoverrun */
+ "linux_timer_delete", /* 226 = linux_timer_delete */
+ "linux_clock_settime", /* 227 = linux_clock_settime */
+ "linux_clock_gettime", /* 228 = linux_clock_gettime */
+ "linux_clock_getres", /* 229 = linux_clock_getres */
+ "linux_clock_nanosleep", /* 230 = linux_clock_nanosleep */
+ "linux_exit_group", /* 231 = linux_exit_group */
+ "linux_epoll_wait", /* 232 = linux_epoll_wait */
+ "linux_epoll_ctl", /* 233 = linux_epoll_ctl */
+ "linux_tgkill", /* 234 = linux_tgkill */
+ "linux_utimes", /* 235 = linux_utimes */
+ "#236", /* 236 = vserver */
+ "linux_mbind", /* 237 = linux_mbind */
+ "linux_set_mempolicy", /* 238 = linux_set_mempolicy */
+ "linux_get_mempolicy", /* 239 = linux_get_mempolicy */
+ "linux_mq_open", /* 240 = linux_mq_open */
+ "linux_mq_unlink", /* 241 = linux_mq_unlink */
+ "linux_mq_timedsend", /* 242 = linux_mq_timedsend */
+ "linux_mq_timedreceive", /* 243 = linux_mq_timedreceive */
+ "linux_mq_notify", /* 244 = linux_mq_notify */
+ "linux_mq_getsetattr", /* 245 = linux_mq_getsetattr */
+ "linux_kexec_load", /* 246 = linux_kexec_load */
+ "linux_waitid", /* 247 = linux_waitid */
+ "linux_add_key", /* 248 = linux_add_key */
+ "linux_request_key", /* 249 = linux_request_key */
+ "linux_keyctl", /* 250 = linux_keyctl */
+ "linux_ioprio_set", /* 251 = linux_ioprio_set */
+ "linux_ioprio_get", /* 252 = linux_ioprio_get */
+ "linux_inotify_init", /* 253 = linux_inotify_init */
+ "linux_inotify_add_watch", /* 254 = linux_inotify_add_watch */
+ "linux_inotify_rm_watch", /* 255 = linux_inotify_rm_watch */
+ "linux_migrate_pages", /* 256 = linux_migrate_pages */
+ "linux_openat", /* 257 = linux_openat */
+ "linux_mkdirat", /* 258 = linux_mkdirat */
+ "linux_mknodat", /* 259 = linux_mknodat */
+ "linux_fchownat", /* 260 = linux_fchownat */
+ "linux_futimesat", /* 261 = linux_futimesat */
+ "linux_newfstatat", /* 262 = linux_newfstatat */
+ "linux_unlinkat", /* 263 = linux_unlinkat */
+ "linux_renameat", /* 264 = linux_renameat */
+ "linux_linkat", /* 265 = linux_linkat */
+ "linux_symlinkat", /* 266 = linux_symlinkat */
+ "linux_readlinkat", /* 267 = linux_readlinkat */
+ "linux_fchmodat", /* 268 = linux_fchmodat */
+ "linux_faccessat", /* 269 = linux_faccessat */
+ "linux_pselect6", /* 270 = linux_pselect6 */
+ "linux_ppoll", /* 271 = linux_ppoll */
+ "linux_unshare", /* 272 = linux_unshare */
+ "linux_set_robust_list", /* 273 = linux_set_robust_list */
+ "linux_get_robust_list", /* 274 = linux_get_robust_list */
+ "linux_splice", /* 275 = linux_splice */
+ "linux_tee", /* 276 = linux_tee */
+ "linux_sync_file_range", /* 277 = linux_sync_file_range */
+ "linux_vmsplice", /* 278 = linux_vmsplice */
+ "linux_move_pages", /* 279 = linux_move_pages */
+ "linux_utimensat", /* 280 = linux_utimensat */
+ "linux_epoll_pwait", /* 281 = linux_epoll_pwait */
+ "linux_signalfd", /* 282 = linux_signalfd */
+ "linux_timerfd", /* 283 = linux_timerfd */
+ "linux_eventfd", /* 284 = linux_eventfd */
+ "linux_fallocate", /* 285 = linux_fallocate */
+ "linux_timerfd_settime", /* 286 = linux_timerfd_settime */
+ "linux_timerfd_gettime", /* 287 = linux_timerfd_gettime */
+ "linux_accept4", /* 288 = linux_accept4 */
+ "linux_signalfd4", /* 289 = linux_signalfd4 */
+ "linux_eventfd2", /* 290 = linux_eventfd2 */
+ "linux_epoll_create1", /* 291 = linux_epoll_create1 */
+ "linux_dup3", /* 292 = linux_dup3 */
+ "linux_pipe2", /* 293 = linux_pipe2 */
+ "linux_inotify_init1", /* 294 = linux_inotify_init1 */
+ "linux_preadv", /* 295 = linux_preadv */
+ "linux_pwritev", /* 296 = linux_pwritev */
+ "linux_rt_tsigqueueinfo", /* 297 = linux_rt_tsigqueueinfo */
+ "linux_perf_event_open", /* 298 = linux_perf_event_open */
+ "linux_recvmmsg", /* 299 = linux_recvmmsg */
+ "linux_fanotify_init", /* 300 = linux_fanotify_init */
+ "linux_fanotify_mark", /* 301 = linux_fanotify_mark */
+ "linux_prlimit64", /* 302 = linux_prlimit64 */
+ "linux_name_to_handle_at", /* 303 = linux_name_to_handle_at */
+ "linux_open_by_handle_at", /* 304 = linux_open_by_handle_at */
+ "linux_clock_adjtime", /* 305 = linux_clock_adjtime */
+ "linux_syncfs", /* 306 = linux_syncfs */
+ "linux_sendmmsg", /* 307 = linux_sendmmsg */
+ "linux_setns", /* 308 = linux_setns */
+ "linux_process_vm_readv", /* 309 = linux_process_vm_readv */
+ "linux_process_vm_writev", /* 310 = linux_process_vm_writev */
+ "linux_kcmp", /* 311 = linux_kcmp */
+ "linux_finit_module", /* 312 = linux_finit_module */
+ "#313", /* 313 = nosys */
+};
diff --git a/sys/amd64/linux/linux_sysent.c b/sys/amd64/linux/linux_sysent.c
new file mode 100644
index 0000000..a575787
--- /dev/null
+++ b/sys/amd64/linux/linux_sysent.c
@@ -0,0 +1,335 @@
+/*
+ * System call switch table.
+ *
+ * DO NOT EDIT-- this file is automatically generated.
+ * $FreeBSD$
+ * created from FreeBSD: head/sys/amd64/linux/syscalls.master 283492 2015-05-24 18:08:01Z dchagin
+ */
+
+#include <sys/param.h>
+#include <sys/sysent.h>
+#include <sys/sysproto.h>
+#include <compat/linux/linux_sysproto.h>
+#include <amd64/linux/linux.h>
+#include <amd64/linux/linux_proto.h>
+
+#define AS(name) (sizeof(struct name) / sizeof(register_t))
+
+/* The casts are bogus but will do for now. */
+struct sysent linux_sysent[] = {
+#define nosys linux_nosys
+ { AS(read_args), (sy_call_t *)sys_read, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 0 = read */
+ { AS(write_args), (sy_call_t *)sys_write, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 1 = write */
+ { AS(linux_open_args), (sy_call_t *)linux_open, AUE_OPEN_RWTC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 2 = linux_open */
+ { AS(close_args), (sy_call_t *)sys_close, AUE_CLOSE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 3 = close */
+ { AS(linux_newstat_args), (sy_call_t *)linux_newstat, AUE_STAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 4 = linux_newstat */
+ { AS(linux_newfstat_args), (sy_call_t *)linux_newfstat, AUE_FSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 5 = linux_newfstat */
+ { AS(linux_newlstat_args), (sy_call_t *)linux_newlstat, AUE_LSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 6 = linux_newlstat */
+ { AS(poll_args), (sy_call_t *)sys_poll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 7 = poll */
+ { AS(linux_lseek_args), (sy_call_t *)linux_lseek, AUE_LSEEK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 8 = linux_lseek */
+ { AS(linux_mmap2_args), (sy_call_t *)linux_mmap2, AUE_MMAP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 9 = linux_mmap2 */
+ { AS(linux_mprotect_args), (sy_call_t *)linux_mprotect, AUE_MPROTECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 10 = linux_mprotect */
+ { AS(munmap_args), (sy_call_t *)sys_munmap, AUE_MUNMAP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 11 = munmap */
+ { AS(linux_brk_args), (sy_call_t *)linux_brk, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 12 = linux_brk */
+ { AS(linux_rt_sigaction_args), (sy_call_t *)linux_rt_sigaction, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 13 = linux_rt_sigaction */
+ { AS(linux_rt_sigprocmask_args), (sy_call_t *)linux_rt_sigprocmask, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 14 = linux_rt_sigprocmask */
+ { AS(linux_rt_sigreturn_args), (sy_call_t *)linux_rt_sigreturn, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 15 = linux_rt_sigreturn */
+ { AS(linux_ioctl_args), (sy_call_t *)linux_ioctl, AUE_IOCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 16 = linux_ioctl */
+ { AS(linux_pread_args), (sy_call_t *)linux_pread, AUE_PREAD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 17 = linux_pread */
+ { AS(linux_pwrite_args), (sy_call_t *)linux_pwrite, AUE_PWRITE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 18 = linux_pwrite */
+ { AS(readv_args), (sy_call_t *)sys_readv, AUE_READV, NULL, 0, 0, 0, SY_THR_STATIC }, /* 19 = readv */
+ { AS(writev_args), (sy_call_t *)sys_writev, AUE_WRITEV, NULL, 0, 0, 0, SY_THR_STATIC }, /* 20 = writev */
+ { AS(linux_access_args), (sy_call_t *)linux_access, AUE_ACCESS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 21 = linux_access */
+ { AS(linux_pipe_args), (sy_call_t *)linux_pipe, AUE_PIPE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 22 = linux_pipe */
+ { AS(linux_select_args), (sy_call_t *)linux_select, AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 23 = linux_select */
+ { 0, (sy_call_t *)sys_sched_yield, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 24 = sched_yield */
+ { AS(linux_mremap_args), (sy_call_t *)linux_mremap, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 25 = linux_mremap */
+ { AS(linux_msync_args), (sy_call_t *)linux_msync, AUE_MSYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 26 = linux_msync */
+ { AS(linux_mincore_args), (sy_call_t *)linux_mincore, AUE_MINCORE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 27 = linux_mincore */
+ { AS(madvise_args), (sy_call_t *)sys_madvise, AUE_MADVISE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 28 = madvise */
+ { AS(linux_shmget_args), (sy_call_t *)linux_shmget, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 29 = linux_shmget */
+ { AS(linux_shmat_args), (sy_call_t *)linux_shmat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 30 = linux_shmat */
+ { AS(linux_shmctl_args), (sy_call_t *)linux_shmctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 31 = linux_shmctl */
+ { AS(dup_args), (sy_call_t *)sys_dup, AUE_DUP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 32 = dup */
+ { AS(dup2_args), (sy_call_t *)sys_dup2, AUE_DUP2, NULL, 0, 0, 0, SY_THR_STATIC }, /* 33 = dup2 */
+ { 0, (sy_call_t *)linux_pause, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 34 = linux_pause */
+ { AS(linux_nanosleep_args), (sy_call_t *)linux_nanosleep, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 35 = linux_nanosleep */
+ { AS(linux_getitimer_args), (sy_call_t *)linux_getitimer, AUE_GETITIMER, NULL, 0, 0, 0, SY_THR_STATIC }, /* 36 = linux_getitimer */
+ { AS(linux_alarm_args), (sy_call_t *)linux_alarm, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 37 = linux_alarm */
+ { AS(linux_setitimer_args), (sy_call_t *)linux_setitimer, AUE_SETITIMER, NULL, 0, 0, 0, SY_THR_STATIC }, /* 38 = linux_setitimer */
+ { 0, (sy_call_t *)linux_getpid, AUE_GETPID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 39 = linux_getpid */
+ { AS(linux_sendfile_args), (sy_call_t *)linux_sendfile, AUE_SENDFILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 40 = linux_sendfile */
+ { AS(linux_socket_args), (sy_call_t *)linux_socket, AUE_SOCKET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 41 = linux_socket */
+ { AS(linux_connect_args), (sy_call_t *)linux_connect, AUE_CONNECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 42 = linux_connect */
+ { AS(linux_accept_args), (sy_call_t *)linux_accept, AUE_ACCEPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 43 = linux_accept */
+ { AS(linux_sendto_args), (sy_call_t *)linux_sendto, AUE_SENDTO, NULL, 0, 0, 0, SY_THR_STATIC }, /* 44 = linux_sendto */
+ { AS(linux_recvfrom_args), (sy_call_t *)linux_recvfrom, AUE_RECVFROM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 45 = linux_recvfrom */
+ { AS(linux_sendmsg_args), (sy_call_t *)linux_sendmsg, AUE_SENDMSG, NULL, 0, 0, 0, SY_THR_STATIC }, /* 46 = linux_sendmsg */
+ { AS(linux_recvmsg_args), (sy_call_t *)linux_recvmsg, AUE_RECVMSG, NULL, 0, 0, 0, SY_THR_STATIC }, /* 47 = linux_recvmsg */
+ { AS(linux_shutdown_args), (sy_call_t *)linux_shutdown, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 48 = linux_shutdown */
+ { AS(linux_bind_args), (sy_call_t *)linux_bind, AUE_BIND, NULL, 0, 0, 0, SY_THR_STATIC }, /* 49 = linux_bind */
+ { AS(linux_listen_args), (sy_call_t *)linux_listen, AUE_LISTEN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 50 = linux_listen */
+ { AS(linux_getsockname_args), (sy_call_t *)linux_getsockname, AUE_GETSOCKNAME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 51 = linux_getsockname */
+ { AS(linux_getpeername_args), (sy_call_t *)linux_getpeername, AUE_GETPEERNAME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 52 = linux_getpeername */
+ { AS(linux_socketpair_args), (sy_call_t *)linux_socketpair, AUE_SOCKETPAIR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 53 = linux_socketpair */
+ { AS(linux_setsockopt_args), (sy_call_t *)linux_setsockopt, AUE_SETSOCKOPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 54 = linux_setsockopt */
+ { AS(linux_getsockopt_args), (sy_call_t *)linux_getsockopt, AUE_GETSOCKOPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 55 = linux_getsockopt */
+ { AS(linux_clone_args), (sy_call_t *)linux_clone, AUE_RFORK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 56 = linux_clone */
+ { 0, (sy_call_t *)linux_fork, AUE_FORK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 57 = linux_fork */
+ { 0, (sy_call_t *)linux_vfork, AUE_VFORK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 58 = linux_vfork */
+ { AS(linux_execve_args), (sy_call_t *)linux_execve, AUE_EXECVE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 59 = linux_execve */
+ { AS(linux_exit_args), (sy_call_t *)linux_exit, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 60 = linux_exit */
+ { AS(linux_wait4_args), (sy_call_t *)linux_wait4, AUE_WAIT4, NULL, 0, 0, 0, SY_THR_STATIC }, /* 61 = linux_wait4 */
+ { AS(linux_kill_args), (sy_call_t *)linux_kill, AUE_KILL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 62 = linux_kill */
+ { AS(linux_newuname_args), (sy_call_t *)linux_newuname, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 63 = linux_newuname */
+ { AS(linux_semget_args), (sy_call_t *)linux_semget, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 64 = linux_semget */
+ { AS(linux_semop_args), (sy_call_t *)linux_semop, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 65 = linux_semop */
+ { AS(linux_semctl_args), (sy_call_t *)linux_semctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 66 = linux_semctl */
+ { AS(linux_shmdt_args), (sy_call_t *)linux_shmdt, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 67 = linux_shmdt */
+ { AS(linux_msgget_args), (sy_call_t *)linux_msgget, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 68 = linux_msgget */
+ { AS(linux_msgsnd_args), (sy_call_t *)linux_msgsnd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 69 = linux_msgsnd */
+ { AS(linux_msgrcv_args), (sy_call_t *)linux_msgrcv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 70 = linux_msgrcv */
+ { AS(linux_msgctl_args), (sy_call_t *)linux_msgctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 71 = linux_msgctl */
+ { AS(linux_fcntl_args), (sy_call_t *)linux_fcntl, AUE_FCNTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 72 = linux_fcntl */
+ { AS(flock_args), (sy_call_t *)sys_flock, AUE_FLOCK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 73 = flock */
+ { AS(fsync_args), (sy_call_t *)sys_fsync, AUE_FSYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 74 = fsync */
+ { AS(linux_fdatasync_args), (sy_call_t *)linux_fdatasync, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 75 = linux_fdatasync */
+ { AS(linux_truncate_args), (sy_call_t *)linux_truncate, AUE_TRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 76 = linux_truncate */
+ { AS(linux_ftruncate_args), (sy_call_t *)linux_ftruncate, AUE_FTRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 77 = linux_ftruncate */
+ { AS(linux_getdents_args), (sy_call_t *)linux_getdents, AUE_GETDIRENTRIES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 78 = linux_getdents */
+ { AS(linux_getcwd_args), (sy_call_t *)linux_getcwd, AUE_GETCWD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 79 = linux_getcwd */
+ { AS(linux_chdir_args), (sy_call_t *)linux_chdir, AUE_CHDIR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 80 = linux_chdir */
+ { AS(fchdir_args), (sy_call_t *)sys_fchdir, AUE_FCHDIR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 81 = fchdir */
+ { AS(linux_rename_args), (sy_call_t *)linux_rename, AUE_RENAME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 82 = linux_rename */
+ { AS(linux_mkdir_args), (sy_call_t *)linux_mkdir, AUE_MKDIR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 83 = linux_mkdir */
+ { AS(linux_rmdir_args), (sy_call_t *)linux_rmdir, AUE_RMDIR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 84 = linux_rmdir */
+ { AS(linux_creat_args), (sy_call_t *)linux_creat, AUE_CREAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 85 = linux_creat */
+ { AS(linux_link_args), (sy_call_t *)linux_link, AUE_LINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 86 = linux_link */
+ { AS(linux_unlink_args), (sy_call_t *)linux_unlink, AUE_UNLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 87 = linux_unlink */
+ { AS(linux_symlink_args), (sy_call_t *)linux_symlink, AUE_SYMLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 88 = linux_symlink */
+ { AS(linux_readlink_args), (sy_call_t *)linux_readlink, AUE_READLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 89 = linux_readlink */
+ { AS(linux_chmod_args), (sy_call_t *)linux_chmod, AUE_CHMOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 90 = linux_chmod */
+ { AS(fchmod_args), (sy_call_t *)sys_fchmod, AUE_FCHMOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 91 = fchmod */
+ { AS(linux_chown_args), (sy_call_t *)linux_chown, AUE_LCHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 92 = linux_chown */
+ { AS(fchown_args), (sy_call_t *)sys_fchown, AUE_FCHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 93 = fchown */
+ { AS(linux_lchown_args), (sy_call_t *)linux_lchown, AUE_LCHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 94 = linux_lchown */
+ { AS(umask_args), (sy_call_t *)sys_umask, AUE_UMASK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 95 = umask */
+ { AS(gettimeofday_args), (sy_call_t *)sys_gettimeofday, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 96 = gettimeofday */
+ { AS(linux_getrlimit_args), (sy_call_t *)linux_getrlimit, AUE_GETRLIMIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 97 = linux_getrlimit */
+ { AS(getrusage_args), (sy_call_t *)sys_getrusage, AUE_GETRUSAGE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 98 = getrusage */
+ { AS(linux_sysinfo_args), (sy_call_t *)linux_sysinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 99 = linux_sysinfo */
+ { AS(linux_times_args), (sy_call_t *)linux_times, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 100 = linux_times */
+ { AS(linux_ptrace_args), (sy_call_t *)linux_ptrace, AUE_PTRACE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 101 = linux_ptrace */
+ { 0, (sy_call_t *)linux_getuid, AUE_GETUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 102 = linux_getuid */
+ { AS(linux_syslog_args), (sy_call_t *)linux_syslog, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 103 = linux_syslog */
+ { 0, (sy_call_t *)linux_getgid, AUE_GETGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 104 = linux_getgid */
+ { AS(setuid_args), (sy_call_t *)sys_setuid, AUE_SETUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 105 = setuid */
+ { AS(setgid_args), (sy_call_t *)sys_setgid, AUE_SETGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 106 = setgid */
+ { 0, (sy_call_t *)sys_geteuid, AUE_GETEUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 107 = geteuid */
+ { 0, (sy_call_t *)sys_getegid, AUE_GETEGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 108 = getegid */
+ { AS(setpgid_args), (sy_call_t *)sys_setpgid, AUE_SETPGRP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 109 = setpgid */
+ { 0, (sy_call_t *)linux_getppid, AUE_GETPPID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 110 = linux_getppid */
+ { 0, (sy_call_t *)sys_getpgrp, AUE_GETPGRP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 111 = getpgrp */
+ { 0, (sy_call_t *)sys_setsid, AUE_SETSID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 112 = setsid */
+ { AS(setreuid_args), (sy_call_t *)sys_setreuid, AUE_SETREUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 113 = setreuid */
+ { AS(setregid_args), (sy_call_t *)sys_setregid, AUE_SETREGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 114 = setregid */
+ { AS(linux_getgroups_args), (sy_call_t *)linux_getgroups, AUE_GETGROUPS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 115 = linux_getgroups */
+ { AS(linux_setgroups_args), (sy_call_t *)linux_setgroups, AUE_SETGROUPS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 116 = linux_setgroups */
+ { AS(setresuid_args), (sy_call_t *)sys_setresuid, AUE_SETRESUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 117 = setresuid */
+ { AS(getresuid_args), (sy_call_t *)sys_getresuid, AUE_GETRESUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 118 = getresuid */
+ { AS(setresgid_args), (sy_call_t *)sys_setresgid, AUE_SETRESGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 119 = setresgid */
+ { AS(getresgid_args), (sy_call_t *)sys_getresgid, AUE_GETRESGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 120 = getresgid */
+ { AS(getpgid_args), (sy_call_t *)sys_getpgid, AUE_GETPGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 121 = getpgid */
+ { AS(linux_setfsuid_args), (sy_call_t *)linux_setfsuid, AUE_SETFSUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 122 = linux_setfsuid */
+ { AS(linux_setfsgid_args), (sy_call_t *)linux_setfsgid, AUE_SETFSGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 123 = linux_setfsgid */
+ { AS(linux_getsid_args), (sy_call_t *)linux_getsid, AUE_GETSID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 124 = linux_getsid */
+ { AS(linux_capget_args), (sy_call_t *)linux_capget, AUE_CAPGET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 125 = linux_capget */
+ { AS(linux_capset_args), (sy_call_t *)linux_capset, AUE_CAPSET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 126 = linux_capset */
+ { AS(linux_rt_sigpending_args), (sy_call_t *)linux_rt_sigpending, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 127 = linux_rt_sigpending */
+ { AS(linux_rt_sigtimedwait_args), (sy_call_t *)linux_rt_sigtimedwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 128 = linux_rt_sigtimedwait */
+ { AS(linux_rt_sigqueueinfo_args), (sy_call_t *)linux_rt_sigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 129 = linux_rt_sigqueueinfo */
+ { AS(linux_rt_sigsuspend_args), (sy_call_t *)linux_rt_sigsuspend, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 130 = linux_rt_sigsuspend */
+ { AS(linux_sigaltstack_args), (sy_call_t *)linux_sigaltstack, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 131 = linux_sigaltstack */
+ { AS(linux_utime_args), (sy_call_t *)linux_utime, AUE_UTIME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 132 = linux_utime */
+ { AS(linux_mknod_args), (sy_call_t *)linux_mknod, AUE_MKNOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 133 = linux_mknod */
+ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 134 = uselib */
+ { AS(linux_personality_args), (sy_call_t *)linux_personality, AUE_PERSONALITY, NULL, 0, 0, 0, SY_THR_STATIC }, /* 135 = linux_personality */
+ { AS(linux_ustat_args), (sy_call_t *)linux_ustat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 136 = linux_ustat */
+ { AS(linux_statfs_args), (sy_call_t *)linux_statfs, AUE_STATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 137 = linux_statfs */
+ { AS(linux_fstatfs_args), (sy_call_t *)linux_fstatfs, AUE_FSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 138 = linux_fstatfs */
+ { AS(linux_sysfs_args), (sy_call_t *)linux_sysfs, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 139 = linux_sysfs */
+ { AS(linux_getpriority_args), (sy_call_t *)linux_getpriority, AUE_GETPRIORITY, NULL, 0, 0, 0, SY_THR_STATIC }, /* 140 = linux_getpriority */
+ { AS(setpriority_args), (sy_call_t *)sys_setpriority, AUE_SETPRIORITY, NULL, 0, 0, 0, SY_THR_STATIC }, /* 141 = setpriority */
+ { AS(linux_sched_setparam_args), (sy_call_t *)linux_sched_setparam, AUE_SCHED_SETPARAM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 142 = linux_sched_setparam */
+ { AS(linux_sched_getparam_args), (sy_call_t *)linux_sched_getparam, AUE_SCHED_GETPARAM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 143 = linux_sched_getparam */
+ { AS(linux_sched_setscheduler_args), (sy_call_t *)linux_sched_setscheduler, AUE_SCHED_SETSCHEDULER, NULL, 0, 0, 0, SY_THR_STATIC }, /* 144 = linux_sched_setscheduler */
+ { AS(linux_sched_getscheduler_args), (sy_call_t *)linux_sched_getscheduler, AUE_SCHED_GETSCHEDULER, NULL, 0, 0, 0, SY_THR_STATIC }, /* 145 = linux_sched_getscheduler */
+ { AS(linux_sched_get_priority_max_args), (sy_call_t *)linux_sched_get_priority_max, AUE_SCHED_GET_PRIORITY_MAX, NULL, 0, 0, 0, SY_THR_STATIC }, /* 146 = linux_sched_get_priority_max */
+ { AS(linux_sched_get_priority_min_args), (sy_call_t *)linux_sched_get_priority_min, AUE_SCHED_GET_PRIORITY_MIN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 147 = linux_sched_get_priority_min */
+ { AS(linux_sched_rr_get_interval_args), (sy_call_t *)linux_sched_rr_get_interval, AUE_SCHED_RR_GET_INTERVAL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 148 = linux_sched_rr_get_interval */
+ { AS(mlock_args), (sy_call_t *)sys_mlock, AUE_MLOCK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 149 = mlock */
+ { AS(munlock_args), (sy_call_t *)sys_munlock, AUE_MUNLOCK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 150 = munlock */
+ { AS(mlockall_args), (sy_call_t *)sys_mlockall, AUE_MLOCKALL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 151 = mlockall */
+ { 0, (sy_call_t *)sys_munlockall, AUE_MUNLOCKALL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 152 = munlockall */
+ { 0, (sy_call_t *)linux_vhangup, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 153 = linux_vhangup */
+ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 154 = modify_ldt */
+ { 0, (sy_call_t *)linux_pivot_root, AUE_PIVOT_ROOT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 155 = linux_pivot_root */
+ { AS(linux_sysctl_args), (sy_call_t *)linux_sysctl, AUE_SYSCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 156 = linux_sysctl */
+ { AS(linux_prctl_args), (sy_call_t *)linux_prctl, AUE_PRCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 157 = linux_prctl */
+ { AS(linux_arch_prctl_args), (sy_call_t *)linux_arch_prctl, AUE_PRCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 158 = linux_arch_prctl */
+ { 0, (sy_call_t *)linux_adjtimex, AUE_ADJTIME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 159 = linux_adjtimex */
+ { AS(linux_setrlimit_args), (sy_call_t *)linux_setrlimit, AUE_SETRLIMIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 160 = linux_setrlimit */
+ { AS(chroot_args), (sy_call_t *)sys_chroot, AUE_CHROOT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 161 = chroot */
+ { 0, (sy_call_t *)sys_sync, AUE_SYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 162 = sync */
+ { AS(acct_args), (sy_call_t *)sys_acct, AUE_ACCT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 163 = acct */
+ { AS(settimeofday_args), (sy_call_t *)sys_settimeofday, AUE_SETTIMEOFDAY, NULL, 0, 0, 0, SY_THR_STATIC }, /* 164 = settimeofday */
+ { AS(linux_mount_args), (sy_call_t *)linux_mount, AUE_MOUNT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 165 = linux_mount */
+ { AS(linux_umount_args), (sy_call_t *)linux_umount, AUE_UMOUNT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 166 = linux_umount */
+ { AS(swapon_args), (sy_call_t *)sys_swapon, AUE_SWAPON, NULL, 0, 0, 0, SY_THR_STATIC }, /* 167 = swapon */
+ { 0, (sy_call_t *)linux_swapoff, AUE_SWAPOFF, NULL, 0, 0, 0, SY_THR_STATIC }, /* 168 = linux_swapoff */
+ { AS(linux_reboot_args), (sy_call_t *)linux_reboot, AUE_REBOOT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 169 = linux_reboot */
+ { AS(linux_sethostname_args), (sy_call_t *)linux_sethostname, AUE_SYSCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 170 = linux_sethostname */
+ { AS(linux_setdomainname_args), (sy_call_t *)linux_setdomainname, AUE_SYSCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 171 = linux_setdomainname */
+ { AS(linux_iopl_args), (sy_call_t *)linux_iopl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 172 = linux_iopl */
+ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 173 = ioperm */
+ { 0, (sy_call_t *)linux_create_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 174 = linux_create_module */
+ { 0, (sy_call_t *)linux_init_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 175 = linux_init_module */
+ { 0, (sy_call_t *)linux_delete_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 176 = linux_delete_module */
+ { 0, (sy_call_t *)linux_get_kernel_syms, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 177 = linux_get_kernel_syms */
+ { 0, (sy_call_t *)linux_query_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 178 = linux_query_module */
+ { 0, (sy_call_t *)linux_quotactl, AUE_QUOTACTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 179 = linux_quotactl */
+ { 0, (sy_call_t *)linux_nfsservctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 180 = linux_nfsservctl */
+ { 0, (sy_call_t *)linux_getpmsg, AUE_GETPMSG, NULL, 0, 0, 0, SY_THR_STATIC }, /* 181 = linux_getpmsg */
+ { 0, (sy_call_t *)linux_putpmsg, AUE_PUTPMSG, NULL, 0, 0, 0, SY_THR_STATIC }, /* 182 = linux_putpmsg */
+ { 0, (sy_call_t *)linux_afs_syscall, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 183 = linux_afs_syscall */
+ { 0, (sy_call_t *)linux_tuxcall, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 184 = linux_tuxcall */
+ { 0, (sy_call_t *)linux_security, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 185 = linux_security */
+ { 0, (sy_call_t *)linux_gettid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 186 = linux_gettid */
+ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 187 = linux_readahead */
+ { 0, (sy_call_t *)linux_setxattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 188 = linux_setxattr */
+ { 0, (sy_call_t *)linux_lsetxattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 189 = linux_lsetxattr */
+ { 0, (sy_call_t *)linux_fsetxattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 190 = linux_fsetxattr */
+ { 0, (sy_call_t *)linux_getxattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 191 = linux_getxattr */
+ { 0, (sy_call_t *)linux_lgetxattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 192 = linux_lgetxattr */
+ { 0, (sy_call_t *)linux_fgetxattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 193 = linux_fgetxattr */
+ { 0, (sy_call_t *)linux_listxattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 194 = linux_listxattr */
+ { 0, (sy_call_t *)linux_llistxattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 195 = linux_llistxattr */
+ { 0, (sy_call_t *)linux_flistxattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 196 = linux_flistxattr */
+ { 0, (sy_call_t *)linux_removexattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 197 = linux_removexattr */
+ { 0, (sy_call_t *)linux_lremovexattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 198 = linux_lremovexattr */
+ { 0, (sy_call_t *)linux_fremovexattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 199 = linux_fremovexattr */
+ { AS(linux_tkill_args), (sy_call_t *)linux_tkill, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 200 = linux_tkill */
+ { AS(linux_time_args), (sy_call_t *)linux_time, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 201 = linux_time */
+ { AS(linux_sys_futex_args), (sy_call_t *)linux_sys_futex, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 202 = linux_sys_futex */
+ { AS(linux_sched_setaffinity_args), (sy_call_t *)linux_sched_setaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 203 = linux_sched_setaffinity */
+ { AS(linux_sched_getaffinity_args), (sy_call_t *)linux_sched_getaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 204 = linux_sched_getaffinity */
+ { 0, (sy_call_t *)linux_set_thread_area, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 205 = linux_set_thread_area */
+ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 206 = linux_io_setup */
+ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 207 = linux_io_destroy */
+ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 208 = linux_io_getevents */
+ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 209 = inux_io_submit */
+ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 210 = linux_io_cancel */
+ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 211 = linux_get_thread_area */
+ { 0, (sy_call_t *)linux_lookup_dcookie, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 212 = linux_lookup_dcookie */
+ { AS(linux_epoll_create_args), (sy_call_t *)linux_epoll_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 213 = linux_epoll_create */
+ { 0, (sy_call_t *)linux_epoll_ctl_old, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 214 = linux_epoll_ctl_old */
+ { 0, (sy_call_t *)linux_epoll_wait_old, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 215 = linux_epoll_wait_old */
+ { 0, (sy_call_t *)linux_remap_file_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 216 = linux_remap_file_pages */
+ { AS(linux_getdents64_args), (sy_call_t *)linux_getdents64, AUE_GETDIRENTRIES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 217 = linux_getdents64 */
+ { AS(linux_set_tid_address_args), (sy_call_t *)linux_set_tid_address, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 218 = linux_set_tid_address */
+ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 219 = restart_syscall */
+ { 0, (sy_call_t *)linux_semtimedop, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 220 = linux_semtimedop */
+ { AS(linux_fadvise64_args), (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 221 = linux_fadvise64 */
+ { AS(linux_timer_create_args), (sy_call_t *)linux_timer_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 222 = linux_timer_create */
+ { AS(linux_timer_settime_args), (sy_call_t *)linux_timer_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 223 = linux_timer_settime */
+ { AS(linux_timer_gettime_args), (sy_call_t *)linux_timer_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 224 = linux_timer_gettime */
+ { AS(linux_timer_getoverrun_args), (sy_call_t *)linux_timer_getoverrun, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 225 = linux_timer_getoverrun */
+ { AS(linux_timer_delete_args), (sy_call_t *)linux_timer_delete, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 226 = linux_timer_delete */
+ { AS(linux_clock_settime_args), (sy_call_t *)linux_clock_settime, AUE_CLOCK_SETTIME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 227 = linux_clock_settime */
+ { AS(linux_clock_gettime_args), (sy_call_t *)linux_clock_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 228 = linux_clock_gettime */
+ { AS(linux_clock_getres_args), (sy_call_t *)linux_clock_getres, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 229 = linux_clock_getres */
+ { AS(linux_clock_nanosleep_args), (sy_call_t *)linux_clock_nanosleep, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 230 = linux_clock_nanosleep */
+ { AS(linux_exit_group_args), (sy_call_t *)linux_exit_group, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 231 = linux_exit_group */
+ { AS(linux_epoll_wait_args), (sy_call_t *)linux_epoll_wait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 232 = linux_epoll_wait */
+ { AS(linux_epoll_ctl_args), (sy_call_t *)linux_epoll_ctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 233 = linux_epoll_ctl */
+ { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 234 = linux_tgkill */
+ { AS(linux_utimes_args), (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 235 = linux_utimes */
+ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 236 = vserver */
+ { 0, (sy_call_t *)linux_mbind, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 237 = linux_mbind */
+ { 0, (sy_call_t *)linux_set_mempolicy, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 238 = linux_set_mempolicy */
+ { 0, (sy_call_t *)linux_get_mempolicy, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 239 = linux_get_mempolicy */
+ { 0, (sy_call_t *)linux_mq_open, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 240 = linux_mq_open */
+ { 0, (sy_call_t *)linux_mq_unlink, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 241 = linux_mq_unlink */
+ { 0, (sy_call_t *)linux_mq_timedsend, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 242 = linux_mq_timedsend */
+ { 0, (sy_call_t *)linux_mq_timedreceive, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 243 = linux_mq_timedreceive */
+ { 0, (sy_call_t *)linux_mq_notify, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 244 = linux_mq_notify */
+ { 0, (sy_call_t *)linux_mq_getsetattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 245 = linux_mq_getsetattr */
+ { 0, (sy_call_t *)linux_kexec_load, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 246 = linux_kexec_load */
+ { AS(linux_waitid_args), (sy_call_t *)linux_waitid, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 247 = linux_waitid */
+ { 0, (sy_call_t *)linux_add_key, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 248 = linux_add_key */
+ { 0, (sy_call_t *)linux_request_key, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 249 = linux_request_key */
+ { 0, (sy_call_t *)linux_keyctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 250 = linux_keyctl */
+ { 0, (sy_call_t *)linux_ioprio_set, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 251 = linux_ioprio_set */
+ { 0, (sy_call_t *)linux_ioprio_get, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 252 = linux_ioprio_get */
+ { 0, (sy_call_t *)linux_inotify_init, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 253 = linux_inotify_init */
+ { 0, (sy_call_t *)linux_inotify_add_watch, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 254 = linux_inotify_add_watch */
+ { 0, (sy_call_t *)linux_inotify_rm_watch, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 255 = linux_inotify_rm_watch */
+ { 0, (sy_call_t *)linux_migrate_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 256 = linux_migrate_pages */
+ { AS(linux_openat_args), (sy_call_t *)linux_openat, AUE_OPEN_RWTC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 257 = linux_openat */
+ { AS(linux_mkdirat_args), (sy_call_t *)linux_mkdirat, AUE_MKDIRAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 258 = linux_mkdirat */
+ { AS(linux_mknodat_args), (sy_call_t *)linux_mknodat, AUE_MKNODAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 259 = linux_mknodat */
+ { AS(linux_fchownat_args), (sy_call_t *)linux_fchownat, AUE_FCHOWNAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 260 = linux_fchownat */
+ { AS(linux_futimesat_args), (sy_call_t *)linux_futimesat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 261 = linux_futimesat */
+ { AS(linux_newfstatat_args), (sy_call_t *)linux_newfstatat, AUE_FSTATAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 262 = linux_newfstatat */
+ { AS(linux_unlinkat_args), (sy_call_t *)linux_unlinkat, AUE_UNLINKAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 263 = linux_unlinkat */
+ { AS(linux_renameat_args), (sy_call_t *)linux_renameat, AUE_RENAMEAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 264 = linux_renameat */
+ { AS(linux_linkat_args), (sy_call_t *)linux_linkat, AUE_LINKAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 265 = linux_linkat */
+ { AS(linux_symlinkat_args), (sy_call_t *)linux_symlinkat, AUE_SYMLINKAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 266 = linux_symlinkat */
+ { AS(linux_readlinkat_args), (sy_call_t *)linux_readlinkat, AUE_READLINKAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 267 = linux_readlinkat */
+ { AS(linux_fchmodat_args), (sy_call_t *)linux_fchmodat, AUE_FCHMODAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 268 = linux_fchmodat */
+ { AS(linux_faccessat_args), (sy_call_t *)linux_faccessat, AUE_FACCESSAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 269 = linux_faccessat */
+ { AS(linux_pselect6_args), (sy_call_t *)linux_pselect6, AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 270 = linux_pselect6 */
+ { AS(linux_ppoll_args), (sy_call_t *)linux_ppoll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 271 = linux_ppoll */
+ { 0, (sy_call_t *)linux_unshare, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 272 = linux_unshare */
+ { AS(linux_set_robust_list_args), (sy_call_t *)linux_set_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 273 = linux_set_robust_list */
+ { AS(linux_get_robust_list_args), (sy_call_t *)linux_get_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 274 = linux_get_robust_list */
+ { 0, (sy_call_t *)linux_splice, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 275 = linux_splice */
+ { 0, (sy_call_t *)linux_tee, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 276 = linux_tee */
+ { 0, (sy_call_t *)linux_sync_file_range, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 277 = linux_sync_file_range */
+ { 0, (sy_call_t *)linux_vmsplice, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 278 = linux_vmsplice */
+ { 0, (sy_call_t *)linux_move_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 279 = linux_move_pages */
+ { AS(linux_utimensat_args), (sy_call_t *)linux_utimensat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 280 = linux_utimensat */
+ { AS(linux_epoll_pwait_args), (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 281 = linux_epoll_pwait */
+ { 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 282 = linux_signalfd */
+ { 0, (sy_call_t *)linux_timerfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 283 = linux_timerfd */
+ { AS(linux_eventfd_args), (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 284 = linux_eventfd */
+ { AS(linux_fallocate_args), (sy_call_t *)linux_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 285 = linux_fallocate */
+ { 0, (sy_call_t *)linux_timerfd_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 286 = linux_timerfd_settime */
+ { 0, (sy_call_t *)linux_timerfd_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 287 = linux_timerfd_gettime */
+ { AS(linux_accept4_args), (sy_call_t *)linux_accept4, AUE_ACCEPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 288 = linux_accept4 */
+ { 0, (sy_call_t *)linux_signalfd4, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 289 = linux_signalfd4 */
+ { AS(linux_eventfd2_args), (sy_call_t *)linux_eventfd2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 290 = linux_eventfd2 */
+ { AS(linux_epoll_create1_args), (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 291 = linux_epoll_create1 */
+ { AS(linux_dup3_args), (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 292 = linux_dup3 */
+ { AS(linux_pipe2_args), (sy_call_t *)linux_pipe2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 293 = linux_pipe2 */
+ { 0, (sy_call_t *)linux_inotify_init1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 294 = linux_inotify_init1 */
+ { 0, (sy_call_t *)linux_preadv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 295 = linux_preadv */
+ { 0, (sy_call_t *)linux_pwritev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 296 = linux_pwritev */
+ { 0, (sy_call_t *)linux_rt_tsigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 297 = linux_rt_tsigqueueinfo */
+ { 0, (sy_call_t *)linux_perf_event_open, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 298 = linux_perf_event_open */
+ { AS(linux_recvmmsg_args), (sy_call_t *)linux_recvmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 299 = linux_recvmmsg */
+ { 0, (sy_call_t *)linux_fanotify_init, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 300 = linux_fanotify_init */
+ { 0, (sy_call_t *)linux_fanotify_mark, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 301 = linux_fanotify_mark */
+ { AS(linux_prlimit64_args), (sy_call_t *)linux_prlimit64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 302 = linux_prlimit64 */
+ { 0, (sy_call_t *)linux_name_to_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 303 = linux_name_to_handle_at */
+ { 0, (sy_call_t *)linux_open_by_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 304 = linux_open_by_handle_at */
+ { 0, (sy_call_t *)linux_clock_adjtime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 305 = linux_clock_adjtime */
+ { AS(linux_syncfs_args), (sy_call_t *)linux_syncfs, AUE_SYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 306 = linux_syncfs */
+ { AS(linux_sendmmsg_args), (sy_call_t *)linux_sendmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 307 = linux_sendmmsg */
+ { 0, (sy_call_t *)linux_setns, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 308 = linux_setns */
+ { 0, (sy_call_t *)linux_process_vm_readv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 309 = linux_process_vm_readv */
+ { 0, (sy_call_t *)linux_process_vm_writev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 310 = linux_process_vm_writev */
+ { 0, (sy_call_t *)linux_kcmp, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 311 = linux_kcmp */
+ { 0, (sy_call_t *)linux_finit_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 312 = linux_finit_module */
+ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 313 = nosys */
+};
diff --git a/sys/amd64/linux/linux_systrace_args.c b/sys/amd64/linux/linux_systrace_args.c
new file mode 100644
index 0000000..529e768
--- /dev/null
+++ b/sys/amd64/linux/linux_systrace_args.c
@@ -0,0 +1,6885 @@
+/*
+ * System call argument to DTrace register array converstion.
+ *
+ * DO NOT EDIT-- this file is automatically generated.
+ * $FreeBSD$
+ * This file is part of the DTrace syscall provider.
+ */
+
+static void
+systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
+{
+ int64_t *iarg = (int64_t *) uarg;
+ switch (sysnum) {
+#define nosys linux_nosys
+ /* read */
+ case 0: {
+ struct read_args *p = params;
+ iarg[0] = p->fd; /* int */
+ uarg[1] = (intptr_t) p->buf; /* char * */
+ uarg[2] = p->nbyte; /* u_int */
+ *n_args = 3;
+ break;
+ }
+ /* write */
+ case 1: {
+ struct write_args *p = params;
+ iarg[0] = p->fd; /* int */
+ uarg[1] = (intptr_t) p->buf; /* char * */
+ uarg[2] = p->nbyte; /* u_int */
+ *n_args = 3;
+ break;
+ }
+ /* linux_open */
+ case 2: {
+ struct linux_open_args *p = params;
+ uarg[0] = (intptr_t) p->path; /* char * */
+ iarg[1] = p->flags; /* l_int */
+ iarg[2] = p->mode; /* l_int */
+ *n_args = 3;
+ break;
+ }
+ /* close */
+ case 3: {
+ struct close_args *p = params;
+ iarg[0] = p->fd; /* int */
+ *n_args = 1;
+ break;
+ }
+ /* linux_newstat */
+ case 4: {
+ struct linux_newstat_args *p = params;
+ uarg[0] = (intptr_t) p->path; /* char * */
+ uarg[1] = (intptr_t) p->buf; /* struct l_newstat * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_newfstat */
+ case 5: {
+ struct linux_newfstat_args *p = params;
+ iarg[0] = p->fd; /* l_uint */
+ uarg[1] = (intptr_t) p->buf; /* struct l_newstat * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_newlstat */
+ case 6: {
+ struct linux_newlstat_args *p = params;
+ uarg[0] = (intptr_t) p->path; /* char * */
+ uarg[1] = (intptr_t) p->buf; /* struct l_newstat * */
+ *n_args = 2;
+ break;
+ }
+ /* poll */
+ case 7: {
+ struct poll_args *p = params;
+ iarg[0] = p->*; /* struct pollfd */
+ uarg[1] = p->nfds; /* unsigned int */
+ iarg[2] = p->timeout; /* int */
+ *n_args = 3;
+ break;
+ }
+ /* linux_lseek */
+ case 8: {
+ struct linux_lseek_args *p = params;
+ iarg[0] = p->fdes; /* l_uint */
+ iarg[1] = p->off; /* l_off_t */
+ iarg[2] = p->whence; /* l_int */
+ *n_args = 3;
+ break;
+ }
+ /* linux_mmap2 */
+ case 9: {
+ struct linux_mmap2_args *p = params;
+ iarg[0] = p->addr; /* l_ulong */
+ iarg[1] = p->len; /* l_ulong */
+ iarg[2] = p->prot; /* l_ulong */
+ iarg[3] = p->flags; /* l_ulong */
+ iarg[4] = p->fd; /* l_ulong */
+ iarg[5] = p->pgoff; /* l_ulong */
+ *n_args = 6;
+ break;
+ }
+ /* linux_mprotect */
+ case 10: {
+ struct linux_mprotect_args *p = params;
+ uarg[0] = (intptr_t) p->addr; /* caddr_t */
+ iarg[1] = p->len; /* int */
+ iarg[2] = p->prot; /* int */
+ *n_args = 3;
+ break;
+ }
+ /* munmap */
+ case 11: {
+ struct munmap_args *p = params;
+ uarg[0] = (intptr_t) p->addr; /* caddr_t */
+ iarg[1] = p->len; /* int */
+ *n_args = 2;
+ break;
+ }
+ /* linux_brk */
+ case 12: {
+ struct linux_brk_args *p = params;
+ iarg[0] = p->dsend; /* l_ulong */
+ *n_args = 1;
+ break;
+ }
+ /* linux_rt_sigaction */
+ case 13: {
+ struct linux_rt_sigaction_args *p = params;
+ iarg[0] = p->sig; /* l_int */
+ uarg[1] = (intptr_t) p->act; /* l_sigaction_t * */
+ uarg[2] = (intptr_t) p->oact; /* l_sigaction_t * */
+ iarg[3] = p->sigsetsize; /* l_size_t */
+ *n_args = 4;
+ break;
+ }
+ /* linux_rt_sigprocmask */
+ case 14: {
+ struct linux_rt_sigprocmask_args *p = params;
+ iarg[0] = p->how; /* l_int */
+ uarg[1] = (intptr_t) p->mask; /* l_sigset_t * */
+ uarg[2] = (intptr_t) p->omask; /* l_sigset_t * */
+ iarg[3] = p->sigsetsize; /* l_size_t */
+ *n_args = 4;
+ break;
+ }
+ /* linux_rt_sigreturn */
+ case 15: {
+ struct linux_rt_sigreturn_args *p = params;
+ uarg[0] = (intptr_t) p->ucp; /* struct l_ucontext * */
+ *n_args = 1;
+ break;
+ }
+ /* linux_ioctl */
+ case 16: {
+ struct linux_ioctl_args *p = params;
+ iarg[0] = p->fd; /* l_uint */
+ iarg[1] = p->cmd; /* l_uint */
+ uarg[2] = p->arg; /* uintptr_t */
+ *n_args = 3;
+ break;
+ }
+ /* linux_pread */
+ case 17: {
+ struct linux_pread_args *p = params;
+ iarg[0] = p->fd; /* l_uint */
+ uarg[1] = (intptr_t) p->buf; /* char * */
+ iarg[2] = p->nbyte; /* l_size_t */
+ iarg[3] = p->offset; /* l_loff_t */
+ *n_args = 4;
+ break;
+ }
+ /* linux_pwrite */
+ case 18: {
+ struct linux_pwrite_args *p = params;
+ iarg[0] = p->fd; /* l_uint */
+ uarg[1] = (intptr_t) p->buf; /* char * */
+ iarg[2] = p->nbyte; /* l_size_t */
+ iarg[3] = p->offset; /* l_loff_t */
+ *n_args = 4;
+ break;
+ }
+ /* readv */
+ case 19: {
+ struct readv_args *p = params;
+ iarg[0] = p->fd; /* int */
+ uarg[1] = (intptr_t) p->iovp; /* struct iovec * */
+ uarg[2] = p->iovcnt; /* u_int */
+ *n_args = 3;
+ break;
+ }
+ /* writev */
+ case 20: {
+ struct writev_args *p = params;
+ iarg[0] = p->fd; /* int */
+ uarg[1] = (intptr_t) p->iovp; /* struct iovec * */
+ uarg[2] = p->iovcnt; /* u_int */
+ *n_args = 3;
+ break;
+ }
+ /* linux_access */
+ case 21: {
+ struct linux_access_args *p = params;
+ uarg[0] = (intptr_t) p->path; /* char * */
+ iarg[1] = p->amode; /* l_int */
+ *n_args = 2;
+ break;
+ }
+ /* linux_pipe */
+ case 22: {
+ struct linux_pipe_args *p = params;
+ uarg[0] = (intptr_t) p->pipefds; /* l_ulong * */
+ *n_args = 1;
+ break;
+ }
+ /* linux_select */
+ case 23: {
+ struct linux_select_args *p = params;
+ iarg[0] = p->nfds; /* l_int */
+ uarg[1] = (intptr_t) p->readfds; /* l_fd_set * */
+ uarg[2] = (intptr_t) p->writefds; /* l_fd_set * */
+ uarg[3] = (intptr_t) p->exceptfds; /* l_fd_set * */
+ uarg[4] = (intptr_t) p->timeout; /* struct l_timeval * */
+ *n_args = 5;
+ break;
+ }
+ /* sched_yield */
+ case 24: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_mremap */
+ case 25: {
+ struct linux_mremap_args *p = params;
+ iarg[0] = p->addr; /* l_ulong */
+ iarg[1] = p->old_len; /* l_ulong */
+ iarg[2] = p->new_len; /* l_ulong */
+ iarg[3] = p->flags; /* l_ulong */
+ iarg[4] = p->new_addr; /* l_ulong */
+ *n_args = 5;
+ break;
+ }
+ /* linux_msync */
+ case 26: {
+ struct linux_msync_args *p = params;
+ iarg[0] = p->addr; /* l_ulong */
+ iarg[1] = p->len; /* l_size_t */
+ iarg[2] = p->fl; /* l_int */
+ *n_args = 3;
+ break;
+ }
+ /* linux_mincore */
+ case 27: {
+ struct linux_mincore_args *p = params;
+ iarg[0] = p->start; /* l_ulong */
+ iarg[1] = p->len; /* l_size_t */
+ uarg[2] = (intptr_t) p->vec; /* u_char * */
+ *n_args = 3;
+ break;
+ }
+ /* madvise */
+ case 28: {
+ struct madvise_args *p = params;
+ uarg[0] = (intptr_t) p->addr; /* void * */
+ uarg[1] = p->len; /* size_t */
+ iarg[2] = p->behav; /* int */
+ *n_args = 3;
+ break;
+ }
+ /* linux_shmget */
+ case 29: {
+ struct linux_shmget_args *p = params;
+ iarg[0] = p->key; /* l_key_t */
+ iarg[1] = p->size; /* l_size_t */
+ iarg[2] = p->shmflg; /* l_int */
+ *n_args = 3;
+ break;
+ }
+ /* linux_shmat */
+ case 30: {
+ struct linux_shmat_args *p = params;
+ iarg[0] = p->shmid; /* l_int */
+ uarg[1] = (intptr_t) p->shmaddr; /* char * */
+ iarg[2] = p->shmflg; /* l_int */
+ *n_args = 3;
+ break;
+ }
+ /* linux_shmctl */
+ case 31: {
+ struct linux_shmctl_args *p = params;
+ iarg[0] = p->shmid; /* l_int */
+ iarg[1] = p->cmd; /* l_int */
+ uarg[2] = (intptr_t) p->buf; /* struct l_shmid_ds * */
+ *n_args = 3;
+ break;
+ }
+ /* dup */
+ case 32: {
+ struct dup_args *p = params;
+ uarg[0] = p->fd; /* u_int */
+ *n_args = 1;
+ break;
+ }
+ /* dup2 */
+ case 33: {
+ struct dup2_args *p = params;
+ uarg[0] = p->from; /* u_int */
+ uarg[1] = p->to; /* u_int */
+ *n_args = 2;
+ break;
+ }
+ /* linux_pause */
+ case 34: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_nanosleep */
+ case 35: {
+ struct linux_nanosleep_args *p = params;
+ uarg[0] = (intptr_t) p->rqtp; /* const struct l_timespec * */
+ uarg[1] = (intptr_t) p->rmtp; /* struct l_timespec * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_getitimer */
+ case 36: {
+ struct linux_getitimer_args *p = params;
+ iarg[0] = p->which; /* l_int */
+ uarg[1] = (intptr_t) p->itv; /* struct l_itimerval * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_alarm */
+ case 37: {
+ struct linux_alarm_args *p = params;
+ iarg[0] = p->secs; /* l_uint */
+ *n_args = 1;
+ break;
+ }
+ /* linux_setitimer */
+ case 38: {
+ struct linux_setitimer_args *p = params;
+ iarg[0] = p->which; /* l_int */
+ uarg[1] = (intptr_t) p->itv; /* struct l_itimerval * */
+ uarg[2] = (intptr_t) p->oitv; /* struct l_itimerval * */
+ *n_args = 3;
+ break;
+ }
+ /* linux_getpid */
+ case 39: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_sendfile */
+ case 40: {
+ struct linux_sendfile_args *p = params;
+ iarg[0] = p->out; /* int */
+ iarg[1] = p->in; /* int */
+ uarg[2] = (intptr_t) p->offset; /* l_long * */
+ iarg[3] = p->count; /* l_size_t */
+ *n_args = 4;
+ break;
+ }
+ /* linux_socket */
+ case 41: {
+ struct linux_socket_args *p = params;
+ iarg[0] = p->domain; /* l_int */
+ iarg[1] = p->type; /* l_int */
+ iarg[2] = p->protocol; /* l_int */
+ *n_args = 3;
+ break;
+ }
+ /* linux_connect */
+ case 42: {
+ struct linux_connect_args *p = params;
+ iarg[0] = p->s; /* l_int */
+ iarg[1] = p->name; /* l_uintptr_t */
+ iarg[2] = p->namelen; /* l_int */
+ *n_args = 3;
+ break;
+ }
+ /* linux_accept */
+ case 43: {
+ struct linux_accept_args *p = params;
+ iarg[0] = p->s; /* l_int */
+ iarg[1] = p->addr; /* l_uintptr_t */
+ iarg[2] = p->namelen; /* l_uintptr_t */
+ *n_args = 3;
+ break;
+ }
+ /* linux_sendto */
+ case 44: {
+ struct linux_sendto_args *p = params;
+ iarg[0] = p->s; /* l_int */
+ iarg[1] = p->msg; /* l_uintptr_t */
+ iarg[2] = p->len; /* l_int */
+ iarg[3] = p->flags; /* l_int */
+ iarg[4] = p->to; /* l_uintptr_t */
+ iarg[5] = p->tolen; /* l_int */
+ *n_args = 6;
+ break;
+ }
+ /* linux_recvfrom */
+ case 45: {
+ struct linux_recvfrom_args *p = params;
+ iarg[0] = p->s; /* l_int */
+ iarg[1] = p->buf; /* l_uintptr_t */
+ iarg[2] = p->len; /* l_size_t */
+ iarg[3] = p->flags; /* l_int */
+ iarg[4] = p->from; /* l_uintptr_t */
+ iarg[5] = p->fromlen; /* l_uintptr_t */
+ *n_args = 6;
+ break;
+ }
+ /* linux_sendmsg */
+ case 46: {
+ struct linux_sendmsg_args *p = params;
+ iarg[0] = p->s; /* l_int */
+ iarg[1] = p->msg; /* l_uintptr_t */
+ iarg[2] = p->flags; /* l_int */
+ *n_args = 3;
+ break;
+ }
+ /* linux_recvmsg */
+ case 47: {
+ struct linux_recvmsg_args *p = params;
+ iarg[0] = p->s; /* l_int */
+ iarg[1] = p->msg; /* l_uintptr_t */
+ iarg[2] = p->flags; /* l_int */
+ *n_args = 3;
+ break;
+ }
+ /* linux_shutdown */
+ case 48: {
+ struct linux_shutdown_args *p = params;
+ iarg[0] = p->s; /* l_int */
+ iarg[1] = p->how; /* l_int */
+ *n_args = 2;
+ break;
+ }
+ /* linux_bind */
+ case 49: {
+ struct linux_bind_args *p = params;
+ iarg[0] = p->s; /* l_int */
+ iarg[1] = p->name; /* l_uintptr_t */
+ iarg[2] = p->namelen; /* l_int */
+ *n_args = 3;
+ break;
+ }
+ /* linux_listen */
+ case 50: {
+ struct linux_listen_args *p = params;
+ iarg[0] = p->s; /* l_int */
+ iarg[1] = p->backlog; /* l_int */
+ *n_args = 2;
+ break;
+ }
+ /* linux_getsockname */
+ case 51: {
+ struct linux_getsockname_args *p = params;
+ iarg[0] = p->s; /* l_int */
+ iarg[1] = p->addr; /* l_uintptr_t */
+ iarg[2] = p->namelen; /* l_uintptr_t */
+ *n_args = 3;
+ break;
+ }
+ /* linux_getpeername */
+ case 52: {
+ struct linux_getpeername_args *p = params;
+ iarg[0] = p->s; /* l_int */
+ iarg[1] = p->addr; /* l_uintptr_t */
+ iarg[2] = p->namelen; /* l_uintptr_t */
+ *n_args = 3;
+ break;
+ }
+ /* linux_socketpair */
+ case 53: {
+ struct linux_socketpair_args *p = params;
+ iarg[0] = p->domain; /* l_int */
+ iarg[1] = p->type; /* l_int */
+ iarg[2] = p->protocol; /* l_int */
+ iarg[3] = p->rsv; /* l_uintptr_t */
+ *n_args = 4;
+ break;
+ }
+ /* linux_setsockopt */
+ case 54: {
+ struct linux_setsockopt_args *p = params;
+ iarg[0] = p->s; /* l_int */
+ iarg[1] = p->level; /* l_int */
+ iarg[2] = p->optname; /* l_int */
+ iarg[3] = p->optval; /* l_uintptr_t */
+ iarg[4] = p->optlen; /* l_int */
+ *n_args = 5;
+ break;
+ }
+ /* linux_getsockopt */
+ case 55: {
+ struct linux_getsockopt_args *p = params;
+ iarg[0] = p->s; /* l_int */
+ iarg[1] = p->level; /* l_int */
+ iarg[2] = p->optname; /* l_int */
+ iarg[3] = p->optval; /* l_uintptr_t */
+ iarg[4] = p->optlen; /* l_uintptr_t */
+ *n_args = 5;
+ break;
+ }
+ /* linux_clone */
+ case 56: {
+ struct linux_clone_args *p = params;
+ iarg[0] = p->flags; /* l_int */
+ uarg[1] = (intptr_t) p->stack; /* void * */
+ uarg[2] = (intptr_t) p->parent_tidptr; /* void * */
+ uarg[3] = (intptr_t) p->child_tidptr; /* void * */
+ uarg[4] = (intptr_t) p->tls; /* void * */
+ *n_args = 5;
+ break;
+ }
+ /* linux_fork */
+ case 57: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_vfork */
+ case 58: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_execve */
+ case 59: {
+ struct linux_execve_args *p = params;
+ uarg[0] = (intptr_t) p->path; /* char * */
+ uarg[1] = (intptr_t) p->argp; /* char ** */
+ uarg[2] = (intptr_t) p->envp; /* char ** */
+ *n_args = 3;
+ break;
+ }
+ /* linux_exit */
+ case 60: {
+ struct linux_exit_args *p = params;
+ iarg[0] = p->rval; /* int */
+ *n_args = 1;
+ break;
+ }
+ /* linux_wait4 */
+ case 61: {
+ struct linux_wait4_args *p = params;
+ iarg[0] = p->pid; /* l_pid_t */
+ uarg[1] = (intptr_t) p->status; /* l_int * */
+ iarg[2] = p->options; /* l_int */
+ uarg[3] = (intptr_t) p->rusage; /* struct rusage * */
+ *n_args = 4;
+ break;
+ }
+ /* linux_kill */
+ case 62: {
+ struct linux_kill_args *p = params;
+ iarg[0] = p->pid; /* l_int */
+ iarg[1] = p->signum; /* l_int */
+ *n_args = 2;
+ break;
+ }
+ /* linux_newuname */
+ case 63: {
+ struct linux_newuname_args *p = params;
+ uarg[0] = (intptr_t) p->buf; /* struct l_new_utsname * */
+ *n_args = 1;
+ break;
+ }
+ /* linux_semget */
+ case 64: {
+ struct linux_semget_args *p = params;
+ iarg[0] = p->key; /* l_key_t */
+ iarg[1] = p->nsems; /* l_int */
+ iarg[2] = p->semflg; /* l_int */
+ *n_args = 3;
+ break;
+ }
+ /* linux_semop */
+ case 65: {
+ struct linux_semop_args *p = params;
+ iarg[0] = p->semid; /* l_int */
+ uarg[1] = (intptr_t) p->tsops; /* struct l_sembuf * */
+ iarg[2] = p->nsops; /* l_uint */
+ *n_args = 3;
+ break;
+ }
+ /* linux_semctl */
+ case 66: {
+ struct linux_semctl_args *p = params;
+ iarg[0] = p->semid; /* l_int */
+ iarg[1] = p->semnum; /* l_int */
+ iarg[2] = p->cmd; /* l_int */
+ uarg[3] = p->arg; /* union l_semun */
+ *n_args = 4;
+ break;
+ }
+ /* linux_shmdt */
+ case 67: {
+ struct linux_shmdt_args *p = params;
+ uarg[0] = (intptr_t) p->shmaddr; /* char * */
+ *n_args = 1;
+ break;
+ }
+ /* linux_msgget */
+ case 68: {
+ struct linux_msgget_args *p = params;
+ iarg[0] = p->key; /* l_key_t */
+ iarg[1] = p->msgflg; /* l_int */
+ *n_args = 2;
+ break;
+ }
+ /* linux_msgsnd */
+ case 69: {
+ struct linux_msgsnd_args *p = params;
+ iarg[0] = p->msqid; /* l_int */
+ uarg[1] = (intptr_t) p->msgp; /* struct l_msgbuf * */
+ iarg[2] = p->msgsz; /* l_size_t */
+ iarg[3] = p->msgflg; /* l_int */
+ *n_args = 4;
+ break;
+ }
+ /* linux_msgrcv */
+ case 70: {
+ struct linux_msgrcv_args *p = params;
+ iarg[0] = p->msqid; /* l_int */
+ uarg[1] = (intptr_t) p->msgp; /* struct l_msgbuf * */
+ iarg[2] = p->msgsz; /* l_size_t */
+ iarg[3] = p->msgtyp; /* l_long */
+ iarg[4] = p->msgflg; /* l_int */
+ *n_args = 5;
+ break;
+ }
+ /* linux_msgctl */
+ case 71: {
+ struct linux_msgctl_args *p = params;
+ iarg[0] = p->msqid; /* l_int */
+ iarg[1] = p->cmd; /* l_int */
+ uarg[2] = (intptr_t) p->buf; /* struct l_msqid_ds * */
+ *n_args = 3;
+ break;
+ }
+ /* linux_fcntl */
+ case 72: {
+ struct linux_fcntl_args *p = params;
+ iarg[0] = p->fd; /* l_uint */
+ iarg[1] = p->cmd; /* l_uint */
+ iarg[2] = p->arg; /* l_ulong */
+ *n_args = 3;
+ break;
+ }
+ /* flock */
+ case 73: {
+ struct flock_args *p = params;
+ iarg[0] = p->fd; /* int */
+ iarg[1] = p->how; /* int */
+ *n_args = 2;
+ break;
+ }
+ /* fsync */
+ case 74: {
+ struct fsync_args *p = params;
+ iarg[0] = p->fd; /* int */
+ *n_args = 1;
+ break;
+ }
+ /* linux_fdatasync */
+ case 75: {
+ struct linux_fdatasync_args *p = params;
+ iarg[0] = p->fd; /* l_uint */
+ *n_args = 1;
+ break;
+ }
+ /* linux_truncate */
+ case 76: {
+ struct linux_truncate_args *p = params;
+ uarg[0] = (intptr_t) p->path; /* char * */
+ iarg[1] = p->length; /* l_ulong */
+ *n_args = 2;
+ break;
+ }
+ /* linux_ftruncate */
+ case 77: {
+ struct linux_ftruncate_args *p = params;
+ iarg[0] = p->fd; /* l_int */
+ iarg[1] = p->length; /* l_long */
+ *n_args = 2;
+ break;
+ }
+ /* linux_getdents */
+ case 78: {
+ struct linux_getdents_args *p = params;
+ iarg[0] = p->fd; /* l_uint */
+ uarg[1] = (intptr_t) p->dent; /* void * */
+ iarg[2] = p->count; /* l_uint */
+ *n_args = 3;
+ break;
+ }
+ /* linux_getcwd */
+ case 79: {
+ struct linux_getcwd_args *p = params;
+ uarg[0] = (intptr_t) p->buf; /* char * */
+ iarg[1] = p->bufsize; /* l_ulong */
+ *n_args = 2;
+ break;
+ }
+ /* linux_chdir */
+ case 80: {
+ struct linux_chdir_args *p = params;
+ uarg[0] = (intptr_t) p->path; /* char * */
+ *n_args = 1;
+ break;
+ }
+ /* fchdir */
+ case 81: {
+ struct fchdir_args *p = params;
+ iarg[0] = p->fd; /* int */
+ *n_args = 1;
+ break;
+ }
+ /* linux_rename */
+ case 82: {
+ struct linux_rename_args *p = params;
+ uarg[0] = (intptr_t) p->from; /* char * */
+ uarg[1] = (intptr_t) p->to; /* char * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_mkdir */
+ case 83: {
+ struct linux_mkdir_args *p = params;
+ uarg[0] = (intptr_t) p->path; /* char * */
+ iarg[1] = p->mode; /* l_int */
+ *n_args = 2;
+ break;
+ }
+ /* linux_rmdir */
+ case 84: {
+ struct linux_rmdir_args *p = params;
+ uarg[0] = (intptr_t) p->path; /* char * */
+ *n_args = 1;
+ break;
+ }
+ /* linux_creat */
+ case 85: {
+ struct linux_creat_args *p = params;
+ uarg[0] = (intptr_t) p->path; /* char * */
+ iarg[1] = p->mode; /* l_int */
+ *n_args = 2;
+ break;
+ }
+ /* linux_link */
+ case 86: {
+ struct linux_link_args *p = params;
+ uarg[0] = (intptr_t) p->path; /* char * */
+ uarg[1] = (intptr_t) p->to; /* char * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_unlink */
+ case 87: {
+ struct linux_unlink_args *p = params;
+ uarg[0] = (intptr_t) p->path; /* char * */
+ *n_args = 1;
+ break;
+ }
+ /* linux_symlink */
+ case 88: {
+ struct linux_symlink_args *p = params;
+ uarg[0] = (intptr_t) p->path; /* char * */
+ uarg[1] = (intptr_t) p->to; /* char * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_readlink */
+ case 89: {
+ struct linux_readlink_args *p = params;
+ uarg[0] = (intptr_t) p->name; /* char * */
+ uarg[1] = (intptr_t) p->buf; /* char * */
+ iarg[2] = p->count; /* l_int */
+ *n_args = 3;
+ break;
+ }
+ /* linux_chmod */
+ case 90: {
+ struct linux_chmod_args *p = params;
+ uarg[0] = (intptr_t) p->path; /* char * */
+ iarg[1] = p->mode; /* l_mode_t */
+ *n_args = 2;
+ break;
+ }
+ /* fchmod */
+ case 91: {
+ struct fchmod_args *p = params;
+ iarg[0] = p->fd; /* int */
+ iarg[1] = p->mode; /* int */
+ *n_args = 2;
+ break;
+ }
+ /* linux_chown */
+ case 92: {
+ struct linux_chown_args *p = params;
+ uarg[0] = (intptr_t) p->path; /* char * */
+ iarg[1] = p->uid; /* l_uid_t */
+ iarg[2] = p->gid; /* l_gid_t */
+ *n_args = 3;
+ break;
+ }
+ /* fchown */
+ case 93: {
+ struct fchown_args *p = params;
+ iarg[0] = p->fd; /* int */
+ iarg[1] = p->uid; /* int */
+ iarg[2] = p->gid; /* int */
+ *n_args = 3;
+ break;
+ }
+ /* linux_lchown */
+ case 94: {
+ struct linux_lchown_args *p = params;
+ uarg[0] = (intptr_t) p->path; /* char * */
+ iarg[1] = p->uid; /* l_uid_t */
+ iarg[2] = p->gid; /* l_gid_t */
+ *n_args = 3;
+ break;
+ }
+ /* umask */
+ case 95: {
+ struct umask_args *p = params;
+ iarg[0] = p->newmask; /* int */
+ *n_args = 1;
+ break;
+ }
+ /* gettimeofday */
+ case 96: {
+ struct gettimeofday_args *p = params;
+ uarg[0] = (intptr_t) p->tp; /* struct l_timeval * */
+ uarg[1] = (intptr_t) p->tzp; /* struct timezone * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_getrlimit */
+ case 97: {
+ struct linux_getrlimit_args *p = params;
+ iarg[0] = p->resource; /* l_uint */
+ uarg[1] = (intptr_t) p->rlim; /* struct l_rlimit * */
+ *n_args = 2;
+ break;
+ }
+ /* getrusage */
+ case 98: {
+ struct getrusage_args *p = params;
+ iarg[0] = p->who; /* int */
+ uarg[1] = (intptr_t) p->rusage; /* struct rusage * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_sysinfo */
+ case 99: {
+ struct linux_sysinfo_args *p = params;
+ uarg[0] = (intptr_t) p->info; /* struct l_sysinfo * */
+ *n_args = 1;
+ break;
+ }
+ /* linux_times */
+ case 100: {
+ struct linux_times_args *p = params;
+ uarg[0] = (intptr_t) p->buf; /* struct l_times_argv * */
+ *n_args = 1;
+ break;
+ }
+ /* linux_ptrace */
+ case 101: {
+ struct linux_ptrace_args *p = params;
+ iarg[0] = p->req; /* l_long */
+ iarg[1] = p->pid; /* l_long */
+ iarg[2] = p->addr; /* l_long */
+ iarg[3] = p->data; /* l_long */
+ *n_args = 4;
+ break;
+ }
+ /* linux_getuid */
+ case 102: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_syslog */
+ case 103: {
+ struct linux_syslog_args *p = params;
+ iarg[0] = p->type; /* l_int */
+ uarg[1] = (intptr_t) p->buf; /* char * */
+ iarg[2] = p->len; /* l_int */
+ *n_args = 3;
+ break;
+ }
+ /* linux_getgid */
+ case 104: {
+ *n_args = 0;
+ break;
+ }
+ /* setuid */
+ case 105: {
+ struct setuid_args *p = params;
+ uarg[0] = p->uid; /* uid_t */
+ *n_args = 1;
+ break;
+ }
+ /* setgid */
+ case 106: {
+ struct setgid_args *p = params;
+ iarg[0] = p->gid; /* gid_t */
+ *n_args = 1;
+ break;
+ }
+ /* geteuid */
+ case 107: {
+ *n_args = 0;
+ break;
+ }
+ /* getegid */
+ case 108: {
+ *n_args = 0;
+ break;
+ }
+ /* setpgid */
+ case 109: {
+ struct setpgid_args *p = params;
+ iarg[0] = p->pid; /* int */
+ iarg[1] = p->pgid; /* int */
+ *n_args = 2;
+ break;
+ }
+ /* linux_getppid */
+ case 110: {
+ *n_args = 0;
+ break;
+ }
+ /* getpgrp */
+ case 111: {
+ *n_args = 0;
+ break;
+ }
+ /* setsid */
+ case 112: {
+ *n_args = 0;
+ break;
+ }
+ /* setreuid */
+ case 113: {
+ struct setreuid_args *p = params;
+ uarg[0] = p->ruid; /* uid_t */
+ uarg[1] = p->euid; /* uid_t */
+ *n_args = 2;
+ break;
+ }
+ /* setregid */
+ case 114: {
+ struct setregid_args *p = params;
+ iarg[0] = p->rgid; /* gid_t */
+ iarg[1] = p->egid; /* gid_t */
+ *n_args = 2;
+ break;
+ }
+ /* linux_getgroups */
+ case 115: {
+ struct linux_getgroups_args *p = params;
+ iarg[0] = p->gidsetsize; /* l_int */
+ uarg[1] = (intptr_t) p->grouplist; /* l_gid_t * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_setgroups */
+ case 116: {
+ struct linux_setgroups_args *p = params;
+ iarg[0] = p->gidsetsize; /* l_int */
+ uarg[1] = (intptr_t) p->grouplist; /* l_gid_t * */
+ *n_args = 2;
+ break;
+ }
+ /* setresuid */
+ case 117: {
+ struct setresuid_args *p = params;
+ uarg[0] = p->ruid; /* uid_t */
+ uarg[1] = p->euid; /* uid_t */
+ uarg[2] = p->suid; /* uid_t */
+ *n_args = 3;
+ break;
+ }
+ /* getresuid */
+ case 118: {
+ struct getresuid_args *p = params;
+ uarg[0] = (intptr_t) p->ruid; /* uid_t * */
+ uarg[1] = (intptr_t) p->euid; /* uid_t * */
+ uarg[2] = (intptr_t) p->suid; /* uid_t * */
+ *n_args = 3;
+ break;
+ }
+ /* setresgid */
+ case 119: {
+ struct setresgid_args *p = params;
+ iarg[0] = p->rgid; /* gid_t */
+ iarg[1] = p->egid; /* gid_t */
+ iarg[2] = p->sgid; /* gid_t */
+ *n_args = 3;
+ break;
+ }
+ /* getresgid */
+ case 120: {
+ struct getresgid_args *p = params;
+ uarg[0] = (intptr_t) p->rgid; /* gid_t * */
+ uarg[1] = (intptr_t) p->egid; /* gid_t * */
+ uarg[2] = (intptr_t) p->sgid; /* gid_t * */
+ *n_args = 3;
+ break;
+ }
+ /* getpgid */
+ case 121: {
+ struct getpgid_args *p = params;
+ iarg[0] = p->pid; /* int */
+ *n_args = 1;
+ break;
+ }
+ /* linux_setfsuid */
+ case 122: {
+ struct linux_setfsuid_args *p = params;
+ iarg[0] = p->uid; /* l_uid_t */
+ *n_args = 1;
+ break;
+ }
+ /* linux_setfsgid */
+ case 123: {
+ struct linux_setfsgid_args *p = params;
+ iarg[0] = p->gid; /* l_gid_t */
+ *n_args = 1;
+ break;
+ }
+ /* linux_getsid */
+ case 124: {
+ struct linux_getsid_args *p = params;
+ iarg[0] = p->pid; /* l_pid_t */
+ *n_args = 1;
+ break;
+ }
+ /* linux_capget */
+ case 125: {
+ struct linux_capget_args *p = params;
+ uarg[0] = (intptr_t) p->hdrp; /* struct l_user_cap_header * */
+ uarg[1] = (intptr_t) p->datap; /* struct l_user_cap_data * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_capset */
+ case 126: {
+ struct linux_capset_args *p = params;
+ uarg[0] = (intptr_t) p->hdrp; /* struct l_user_cap_header * */
+ uarg[1] = (intptr_t) p->datap; /* struct l_user_cap_data * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_rt_sigpending */
+ case 127: {
+ struct linux_rt_sigpending_args *p = params;
+ uarg[0] = (intptr_t) p->set; /* l_sigset_t * */
+ iarg[1] = p->sigsetsize; /* l_size_t */
+ *n_args = 2;
+ break;
+ }
+ /* linux_rt_sigtimedwait */
+ case 128: {
+ struct linux_rt_sigtimedwait_args *p = params;
+ uarg[0] = (intptr_t) p->mask; /* l_sigset_t * */
+ uarg[1] = (intptr_t) p->ptr; /* l_siginfo_t * */
+ uarg[2] = (intptr_t) p->timeout; /* struct l_timeval * */
+ iarg[3] = p->sigsetsize; /* l_size_t */
+ *n_args = 4;
+ break;
+ }
+ /* linux_rt_sigqueueinfo */
+ case 129: {
+ struct linux_rt_sigqueueinfo_args *p = params;
+ iarg[0] = p->pid; /* l_pid_t */
+ iarg[1] = p->sig; /* l_int */
+ uarg[2] = (intptr_t) p->info; /* l_siginfo_t * */
+ *n_args = 3;
+ break;
+ }
+ /* linux_rt_sigsuspend */
+ case 130: {
+ struct linux_rt_sigsuspend_args *p = params;
+ uarg[0] = (intptr_t) p->newset; /* l_sigset_t * */
+ iarg[1] = p->sigsetsize; /* l_size_t */
+ *n_args = 2;
+ break;
+ }
+ /* linux_sigaltstack */
+ case 131: {
+ struct linux_sigaltstack_args *p = params;
+ uarg[0] = (intptr_t) p->uss; /* l_stack_t * */
+ uarg[1] = (intptr_t) p->uoss; /* l_stack_t * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_utime */
+ case 132: {
+ struct linux_utime_args *p = params;
+ uarg[0] = (intptr_t) p->fname; /* char * */
+ uarg[1] = (intptr_t) p->times; /* struct l_utimbuf * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_mknod */
+ case 133: {
+ struct linux_mknod_args *p = params;
+ uarg[0] = (intptr_t) p->path; /* char * */
+ iarg[1] = p->mode; /* l_int */
+ iarg[2] = p->dev; /* l_dev_t */
+ *n_args = 3;
+ break;
+ }
+ /* linux_personality */
+ case 135: {
+ struct linux_personality_args *p = params;
+ iarg[0] = p->per; /* l_ulong */
+ *n_args = 1;
+ break;
+ }
+ /* linux_ustat */
+ case 136: {
+ struct linux_ustat_args *p = params;
+ iarg[0] = p->dev; /* l_dev_t */
+ uarg[1] = (intptr_t) p->ubuf; /* struct l_ustat * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_statfs */
+ case 137: {
+ struct linux_statfs_args *p = params;
+ uarg[0] = (intptr_t) p->path; /* char * */
+ uarg[1] = (intptr_t) p->buf; /* struct l_statfs_buf * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_fstatfs */
+ case 138: {
+ struct linux_fstatfs_args *p = params;
+ iarg[0] = p->fd; /* l_uint */
+ uarg[1] = (intptr_t) p->buf; /* struct l_statfs_buf * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_sysfs */
+ case 139: {
+ struct linux_sysfs_args *p = params;
+ iarg[0] = p->option; /* l_int */
+ iarg[1] = p->arg1; /* l_ulong */
+ iarg[2] = p->arg2; /* l_ulong */
+ *n_args = 3;
+ break;
+ }
+ /* linux_getpriority */
+ case 140: {
+ struct linux_getpriority_args *p = params;
+ iarg[0] = p->which; /* int */
+ iarg[1] = p->who; /* int */
+ *n_args = 2;
+ break;
+ }
+ /* setpriority */
+ case 141: {
+ struct setpriority_args *p = params;
+ iarg[0] = p->which; /* int */
+ iarg[1] = p->who; /* int */
+ iarg[2] = p->prio; /* int */
+ *n_args = 3;
+ break;
+ }
+ /* linux_sched_setparam */
+ case 142: {
+ struct linux_sched_setparam_args *p = params;
+ iarg[0] = p->pid; /* l_pid_t */
+ uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_sched_getparam */
+ case 143: {
+ struct linux_sched_getparam_args *p = params;
+ iarg[0] = p->pid; /* l_pid_t */
+ uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_sched_setscheduler */
+ case 144: {
+ struct linux_sched_setscheduler_args *p = params;
+ iarg[0] = p->pid; /* l_pid_t */
+ iarg[1] = p->policy; /* l_int */
+ uarg[2] = (intptr_t) p->param; /* struct l_sched_param * */
+ *n_args = 3;
+ break;
+ }
+ /* linux_sched_getscheduler */
+ case 145: {
+ struct linux_sched_getscheduler_args *p = params;
+ iarg[0] = p->pid; /* l_pid_t */
+ *n_args = 1;
+ break;
+ }
+ /* linux_sched_get_priority_max */
+ case 146: {
+ struct linux_sched_get_priority_max_args *p = params;
+ iarg[0] = p->policy; /* l_int */
+ *n_args = 1;
+ break;
+ }
+ /* linux_sched_get_priority_min */
+ case 147: {
+ struct linux_sched_get_priority_min_args *p = params;
+ iarg[0] = p->policy; /* l_int */
+ *n_args = 1;
+ break;
+ }
+ /* linux_sched_rr_get_interval */
+ case 148: {
+ struct linux_sched_rr_get_interval_args *p = params;
+ iarg[0] = p->pid; /* l_pid_t */
+ uarg[1] = (intptr_t) p->interval; /* struct l_timespec * */
+ *n_args = 2;
+ break;
+ }
+ /* mlock */
+ case 149: {
+ struct mlock_args *p = params;
+ uarg[0] = (intptr_t) p->addr; /* const void * */
+ uarg[1] = p->len; /* size_t */
+ *n_args = 2;
+ break;
+ }
+ /* munlock */
+ case 150: {
+ struct munlock_args *p = params;
+ uarg[0] = (intptr_t) p->addr; /* const void * */
+ uarg[1] = p->len; /* size_t */
+ *n_args = 2;
+ break;
+ }
+ /* mlockall */
+ case 151: {
+ struct mlockall_args *p = params;
+ iarg[0] = p->how; /* int */
+ *n_args = 1;
+ break;
+ }
+ /* munlockall */
+ case 152: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_vhangup */
+ case 153: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_pivot_root */
+ case 155: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_sysctl */
+ case 156: {
+ struct linux_sysctl_args *p = params;
+ uarg[0] = (intptr_t) p->args; /* struct l___sysctl_args * */
+ *n_args = 1;
+ break;
+ }
+ /* linux_prctl */
+ case 157: {
+ struct linux_prctl_args *p = params;
+ iarg[0] = p->option; /* l_int */
+ iarg[1] = p->arg2; /* l_uintptr_t */
+ iarg[2] = p->arg3; /* l_uintptr_t */
+ iarg[3] = p->arg4; /* l_uintptr_t */
+ iarg[4] = p->arg5; /* l_uintptr_t */
+ *n_args = 5;
+ break;
+ }
+ /* linux_arch_prctl */
+ case 158: {
+ struct linux_arch_prctl_args *p = params;
+ iarg[0] = p->code; /* l_int */
+ iarg[1] = p->addr; /* l_ulong */
+ *n_args = 2;
+ break;
+ }
+ /* linux_adjtimex */
+ case 159: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_setrlimit */
+ case 160: {
+ struct linux_setrlimit_args *p = params;
+ iarg[0] = p->resource; /* l_uint */
+ uarg[1] = (intptr_t) p->rlim; /* struct l_rlimit * */
+ *n_args = 2;
+ break;
+ }
+ /* chroot */
+ case 161: {
+ struct chroot_args *p = params;
+ uarg[0] = (intptr_t) p->path; /* char * */
+ *n_args = 1;
+ break;
+ }
+ /* sync */
+ case 162: {
+ *n_args = 0;
+ break;
+ }
+ /* acct */
+ case 163: {
+ struct acct_args *p = params;
+ uarg[0] = (intptr_t) p->path; /* char * */
+ *n_args = 1;
+ break;
+ }
+ /* settimeofday */
+ case 164: {
+ struct settimeofday_args *p = params;
+ uarg[0] = (intptr_t) p->tp; /* struct l_timeval * */
+ uarg[1] = (intptr_t) p->tzp; /* struct timezone * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_mount */
+ case 165: {
+ struct linux_mount_args *p = params;
+ uarg[0] = (intptr_t) p->specialfile; /* char * */
+ uarg[1] = (intptr_t) p->dir; /* char * */
+ uarg[2] = (intptr_t) p->filesystemtype; /* char * */
+ iarg[3] = p->rwflag; /* l_ulong */
+ uarg[4] = (intptr_t) p->data; /* void * */
+ *n_args = 5;
+ break;
+ }
+ /* linux_umount */
+ case 166: {
+ struct linux_umount_args *p = params;
+ uarg[0] = (intptr_t) p->path; /* char * */
+ iarg[1] = p->flags; /* l_int */
+ *n_args = 2;
+ break;
+ }
+ /* swapon */
+ case 167: {
+ struct swapon_args *p = params;
+ uarg[0] = (intptr_t) p->name; /* char * */
+ *n_args = 1;
+ break;
+ }
+ /* linux_swapoff */
+ case 168: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_reboot */
+ case 169: {
+ struct linux_reboot_args *p = params;
+ iarg[0] = p->magic1; /* l_int */
+ iarg[1] = p->magic2; /* l_int */
+ iarg[2] = p->cmd; /* l_uint */
+ uarg[3] = (intptr_t) p->arg; /* void * */
+ *n_args = 4;
+ break;
+ }
+ /* linux_sethostname */
+ case 170: {
+ struct linux_sethostname_args *p = params;
+ uarg[0] = (intptr_t) p->hostname; /* char * */
+ iarg[1] = p->len; /* l_uint */
+ *n_args = 2;
+ break;
+ }
+ /* linux_setdomainname */
+ case 171: {
+ struct linux_setdomainname_args *p = params;
+ uarg[0] = (intptr_t) p->name; /* char * */
+ iarg[1] = p->len; /* l_int */
+ *n_args = 2;
+ break;
+ }
+ /* linux_iopl */
+ case 172: {
+ struct linux_iopl_args *p = params;
+ iarg[0] = p->level; /* l_uint */
+ *n_args = 1;
+ break;
+ }
+ /* linux_create_module */
+ case 174: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_init_module */
+ case 175: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_delete_module */
+ case 176: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_get_kernel_syms */
+ case 177: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_query_module */
+ case 178: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_quotactl */
+ case 179: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_nfsservctl */
+ case 180: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_getpmsg */
+ case 181: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_putpmsg */
+ case 182: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_afs_syscall */
+ case 183: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_tuxcall */
+ case 184: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_security */
+ case 185: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_gettid */
+ case 186: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_setxattr */
+ case 188: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_lsetxattr */
+ case 189: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_fsetxattr */
+ case 190: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_getxattr */
+ case 191: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_lgetxattr */
+ case 192: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_fgetxattr */
+ case 193: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_listxattr */
+ case 194: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_llistxattr */
+ case 195: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_flistxattr */
+ case 196: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_removexattr */
+ case 197: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_lremovexattr */
+ case 198: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_fremovexattr */
+ case 199: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_tkill */
+ case 200: {
+ struct linux_tkill_args *p = params;
+ iarg[0] = p->tid; /* int */
+ iarg[1] = p->sig; /* int */
+ *n_args = 2;
+ break;
+ }
+ /* linux_time */
+ case 201: {
+ struct linux_time_args *p = params;
+ uarg[0] = (intptr_t) p->tm; /* l_time_t * */
+ *n_args = 1;
+ break;
+ }
+ /* linux_sys_futex */
+ case 202: {
+ struct linux_sys_futex_args *p = params;
+ uarg[0] = (intptr_t) p->uaddr; /* void * */
+ iarg[1] = p->op; /* int */
+ iarg[2] = p->val; /* int */
+ uarg[3] = (intptr_t) p->timeout; /* struct l_timespec * */
+ uarg[4] = (intptr_t) p->uaddr2; /* void * */
+ iarg[5] = p->val3; /* int */
+ *n_args = 6;
+ break;
+ }
+ /* linux_sched_setaffinity */
+ case 203: {
+ struct linux_sched_setaffinity_args *p = params;
+ iarg[0] = p->pid; /* l_pid_t */
+ iarg[1] = p->len; /* l_uint */
+ uarg[2] = (intptr_t) p->user_mask_ptr; /* l_ulong * */
+ *n_args = 3;
+ break;
+ }
+ /* linux_sched_getaffinity */
+ case 204: {
+ struct linux_sched_getaffinity_args *p = params;
+ iarg[0] = p->pid; /* l_pid_t */
+ iarg[1] = p->len; /* l_uint */
+ uarg[2] = (intptr_t) p->user_mask_ptr; /* l_ulong * */
+ *n_args = 3;
+ break;
+ }
+ /* linux_set_thread_area */
+ case 205: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_lookup_dcookie */
+ case 212: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_epoll_create */
+ case 213: {
+ struct linux_epoll_create_args *p = params;
+ iarg[0] = p->size; /* l_int */
+ *n_args = 1;
+ break;
+ }
+ /* linux_epoll_ctl_old */
+ case 214: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_epoll_wait_old */
+ case 215: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_remap_file_pages */
+ case 216: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_getdents64 */
+ case 217: {
+ struct linux_getdents64_args *p = params;
+ iarg[0] = p->fd; /* l_uint */
+ uarg[1] = (intptr_t) p->dirent; /* void * */
+ iarg[2] = p->count; /* l_uint */
+ *n_args = 3;
+ break;
+ }
+ /* linux_set_tid_address */
+ case 218: {
+ struct linux_set_tid_address_args *p = params;
+ uarg[0] = (intptr_t) p->tidptr; /* int * */
+ *n_args = 1;
+ break;
+ }
+ /* linux_semtimedop */
+ case 220: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_fadvise64 */
+ case 221: {
+ struct linux_fadvise64_args *p = params;
+ iarg[0] = p->fd; /* int */
+ iarg[1] = p->offset; /* l_loff_t */
+ iarg[2] = p->len; /* l_size_t */
+ iarg[3] = p->advice; /* int */
+ *n_args = 4;
+ break;
+ }
+ /* linux_timer_create */
+ case 222: {
+ struct linux_timer_create_args *p = params;
+ iarg[0] = p->clock_id; /* clockid_t */
+ uarg[1] = (intptr_t) p->evp; /* struct sigevent * */
+ uarg[2] = (intptr_t) p->timerid; /* l_timer_t * */
+ *n_args = 3;
+ break;
+ }
+ /* linux_timer_settime */
+ case 223: {
+ struct linux_timer_settime_args *p = params;
+ iarg[0] = p->timerid; /* l_timer_t */
+ iarg[1] = p->flags; /* l_int */
+ uarg[2] = (intptr_t) p->new; /* const struct itimerspec * */
+ uarg[3] = (intptr_t) p->old; /* struct itimerspec * */
+ *n_args = 4;
+ break;
+ }
+ /* linux_timer_gettime */
+ case 224: {
+ struct linux_timer_gettime_args *p = params;
+ iarg[0] = p->timerid; /* l_timer_t */
+ uarg[1] = (intptr_t) p->setting; /* struct itimerspec * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_timer_getoverrun */
+ case 225: {
+ struct linux_timer_getoverrun_args *p = params;
+ iarg[0] = p->timerid; /* l_timer_t */
+ *n_args = 1;
+ break;
+ }
+ /* linux_timer_delete */
+ case 226: {
+ struct linux_timer_delete_args *p = params;
+ iarg[0] = p->timerid; /* l_timer_t */
+ *n_args = 1;
+ break;
+ }
+ /* linux_clock_settime */
+ case 227: {
+ struct linux_clock_settime_args *p = params;
+ iarg[0] = p->which; /* clockid_t */
+ uarg[1] = (intptr_t) p->tp; /* struct l_timespec * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_clock_gettime */
+ case 228: {
+ struct linux_clock_gettime_args *p = params;
+ iarg[0] = p->which; /* clockid_t */
+ uarg[1] = (intptr_t) p->tp; /* struct l_timespec * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_clock_getres */
+ case 229: {
+ struct linux_clock_getres_args *p = params;
+ iarg[0] = p->which; /* clockid_t */
+ uarg[1] = (intptr_t) p->tp; /* struct l_timespec * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_clock_nanosleep */
+ case 230: {
+ struct linux_clock_nanosleep_args *p = params;
+ iarg[0] = p->which; /* clockid_t */
+ iarg[1] = p->flags; /* int */
+ uarg[2] = (intptr_t) p->rqtp; /* struct l_timespec * */
+ uarg[3] = (intptr_t) p->rmtp; /* struct l_timespec * */
+ *n_args = 4;
+ break;
+ }
+ /* linux_exit_group */
+ case 231: {
+ struct linux_exit_group_args *p = params;
+ iarg[0] = p->error_code; /* int */
+ *n_args = 1;
+ break;
+ }
+ /* linux_epoll_wait */
+ case 232: {
+ struct linux_epoll_wait_args *p = params;
+ iarg[0] = p->epfd; /* l_int */
+ uarg[1] = (intptr_t) p->events; /* struct epoll_event * */
+ iarg[2] = p->maxevents; /* l_int */
+ iarg[3] = p->timeout; /* l_int */
+ *n_args = 4;
+ break;
+ }
+ /* linux_epoll_ctl */
+ case 233: {
+ struct linux_epoll_ctl_args *p = params;
+ iarg[0] = p->epfd; /* l_int */
+ iarg[1] = p->op; /* l_int */
+ iarg[2] = p->fd; /* l_int */
+ uarg[3] = (intptr_t) p->event; /* struct epoll_event * */
+ *n_args = 4;
+ break;
+ }
+ /* linux_tgkill */
+ case 234: {
+ struct linux_tgkill_args *p = params;
+ iarg[0] = p->tgid; /* int */
+ iarg[1] = p->pid; /* int */
+ iarg[2] = p->sig; /* int */
+ *n_args = 3;
+ break;
+ }
+ /* linux_utimes */
+ case 235: {
+ struct linux_utimes_args *p = params;
+ uarg[0] = (intptr_t) p->fname; /* char * */
+ uarg[1] = (intptr_t) p->tptr; /* struct l_timeval * */
+ *n_args = 2;
+ break;
+ }
+ /* linux_mbind */
+ case 237: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_set_mempolicy */
+ case 238: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_get_mempolicy */
+ case 239: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_mq_open */
+ case 240: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_mq_unlink */
+ case 241: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_mq_timedsend */
+ case 242: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_mq_timedreceive */
+ case 243: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_mq_notify */
+ case 244: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_mq_getsetattr */
+ case 245: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_kexec_load */
+ case 246: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_waitid */
+ case 247: {
+ struct linux_waitid_args *p = params;
+ iarg[0] = p->idtype; /* int */
+ iarg[1] = p->id; /* l_pid_t */
+ uarg[2] = (intptr_t) p->info; /* l_siginfo_t * */
+ iarg[3] = p->options; /* int */
+ uarg[4] = (intptr_t) p->rusage; /* struct rusage * */
+ *n_args = 5;
+ break;
+ }
+ /* linux_add_key */
+ case 248: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_request_key */
+ case 249: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_keyctl */
+ case 250: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_ioprio_set */
+ case 251: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_ioprio_get */
+ case 252: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_inotify_init */
+ case 253: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_inotify_add_watch */
+ case 254: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_inotify_rm_watch */
+ case 255: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_migrate_pages */
+ case 256: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_openat */
+ case 257: {
+ struct linux_openat_args *p = params;
+ iarg[0] = p->dfd; /* l_int */
+ uarg[1] = (intptr_t) p->filename; /* const char * */
+ iarg[2] = p->flags; /* l_int */
+ iarg[3] = p->mode; /* l_int */
+ *n_args = 4;
+ break;
+ }
+ /* linux_mkdirat */
+ case 258: {
+ struct linux_mkdirat_args *p = params;
+ iarg[0] = p->dfd; /* l_int */
+ uarg[1] = (intptr_t) p->pathname; /* const char * */
+ iarg[2] = p->mode; /* l_int */
+ *n_args = 3;
+ break;
+ }
+ /* linux_mknodat */
+ case 259: {
+ struct linux_mknodat_args *p = params;
+ iarg[0] = p->dfd; /* l_int */
+ uarg[1] = (intptr_t) p->filename; /* const char * */
+ iarg[2] = p->mode; /* l_int */
+ iarg[3] = p->dev; /* l_uint */
+ *n_args = 4;
+ break;
+ }
+ /* linux_fchownat */
+ case 260: {
+ struct linux_fchownat_args *p = params;
+ iarg[0] = p->dfd; /* l_int */
+ uarg[1] = (intptr_t) p->filename; /* const char * */
+ iarg[2] = p->uid; /* l_uid_t */
+ iarg[3] = p->gid; /* l_gid_t */
+ iarg[4] = p->flag; /* l_int */
+ *n_args = 5;
+ break;
+ }
+ /* linux_futimesat */
+ case 261: {
+ struct linux_futimesat_args *p = params;
+ iarg[0] = p->dfd; /* l_int */
+ uarg[1] = (intptr_t) p->filename; /* char * */
+ uarg[2] = (intptr_t) p->utimes; /* struct l_timeval * */
+ *n_args = 3;
+ break;
+ }
+ /* linux_newfstatat */
+ case 262: {
+ struct linux_newfstatat_args *p = params;
+ iarg[0] = p->dfd; /* l_int */
+ uarg[1] = (intptr_t) p->pathname; /* char * */
+ uarg[2] = (intptr_t) p->statbuf; /* struct l_stat64 * */
+ iarg[3] = p->flag; /* l_int */
+ *n_args = 4;
+ break;
+ }
+ /* linux_unlinkat */
+ case 263: {
+ struct linux_unlinkat_args *p = params;
+ iarg[0] = p->dfd; /* l_int */
+ uarg[1] = (intptr_t) p->pathname; /* const char * */
+ iarg[2] = p->flag; /* l_int */
+ *n_args = 3;
+ break;
+ }
+ /* linux_renameat */
+ case 264: {
+ struct linux_renameat_args *p = params;
+ iarg[0] = p->olddfd; /* l_int */
+ uarg[1] = (intptr_t) p->oldname; /* const char * */
+ iarg[2] = p->newdfd; /* l_int */
+ uarg[3] = (intptr_t) p->newname; /* const char * */
+ *n_args = 4;
+ break;
+ }
+ /* linux_linkat */
+ case 265: {
+ struct linux_linkat_args *p = params;
+ iarg[0] = p->olddfd; /* l_int */
+ uarg[1] = (intptr_t) p->oldname; /* const char * */
+ iarg[2] = p->newdfd; /* l_int */
+ uarg[3] = (intptr_t) p->newname; /* const char * */
+ iarg[4] = p->flag; /* l_int */
+ *n_args = 5;
+ break;
+ }
+ /* linux_symlinkat */
+ case 266: {
+ struct linux_symlinkat_args *p = params;
+ uarg[0] = (intptr_t) p->oldname; /* const char * */
+ iarg[1] = p->newdfd; /* l_int */
+ uarg[2] = (intptr_t) p->newname; /* const char * */
+ *n_args = 3;
+ break;
+ }
+ /* linux_readlinkat */
+ case 267: {
+ struct linux_readlinkat_args *p = params;
+ iarg[0] = p->dfd; /* l_int */
+ uarg[1] = (intptr_t) p->path; /* const char * */
+ uarg[2] = (intptr_t) p->buf; /* char * */
+ iarg[3] = p->bufsiz; /* l_int */
+ *n_args = 4;
+ break;
+ }
+ /* linux_fchmodat */
+ case 268: {
+ struct linux_fchmodat_args *p = params;
+ iarg[0] = p->dfd; /* l_int */
+ uarg[1] = (intptr_t) p->filename; /* const char * */
+ iarg[2] = p->mode; /* l_mode_t */
+ *n_args = 3;
+ break;
+ }
+ /* linux_faccessat */
+ case 269: {
+ struct linux_faccessat_args *p = params;
+ iarg[0] = p->dfd; /* l_int */
+ uarg[1] = (intptr_t) p->filename; /* const char * */
+ iarg[2] = p->amode; /* l_int */
+ *n_args = 3;
+ break;
+ }
+ /* linux_pselect6 */
+ case 270: {
+ struct linux_pselect6_args *p = params;
+ iarg[0] = p->nfds; /* l_int */
+ uarg[1] = (intptr_t) p->readfds; /* l_fd_set * */
+ uarg[2] = (intptr_t) p->writefds; /* l_fd_set * */
+ uarg[3] = (intptr_t) p->exceptfds; /* l_fd_set * */
+ uarg[4] = (intptr_t) p->tsp; /* struct l_timespec * */
+ uarg[5] = (intptr_t) p->sig; /* l_uintptr_t * */
+ *n_args = 6;
+ break;
+ }
+ /* linux_ppoll */
+ case 271: {
+ struct linux_ppoll_args *p = params;
+ uarg[0] = (intptr_t) p->fds; /* struct pollfd * */
+ uarg[1] = p->nfds; /* uint32_t */
+ uarg[2] = (intptr_t) p->tsp; /* struct l_timespec * */
+ uarg[3] = (intptr_t) p->sset; /* l_sigset_t * */
+ iarg[4] = p->ssize; /* l_size_t */
+ *n_args = 5;
+ break;
+ }
+ /* linux_unshare */
+ case 272: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_set_robust_list */
+ case 273: {
+ struct linux_set_robust_list_args *p = params;
+ uarg[0] = (intptr_t) p->head; /* struct linux_robust_list_head * */
+ iarg[1] = p->len; /* l_size_t */
+ *n_args = 2;
+ break;
+ }
+ /* linux_get_robust_list */
+ case 274: {
+ struct linux_get_robust_list_args *p = params;
+ iarg[0] = p->pid; /* l_int */
+ uarg[1] = (intptr_t) p->head; /* struct linux_robust_list_head * */
+ uarg[2] = (intptr_t) p->len; /* l_size_t * */
+ *n_args = 3;
+ break;
+ }
+ /* linux_splice */
+ case 275: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_tee */
+ case 276: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_sync_file_range */
+ case 277: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_vmsplice */
+ case 278: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_move_pages */
+ case 279: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_utimensat */
+ case 280: {
+ struct linux_utimensat_args *p = params;
+ iarg[0] = p->dfd; /* l_int */
+ uarg[1] = (intptr_t) p->pathname; /* const char * */
+ uarg[2] = (intptr_t) p->times; /* const struct l_timespec * */
+ iarg[3] = p->flags; /* l_int */
+ *n_args = 4;
+ break;
+ }
+ /* linux_epoll_pwait */
+ case 281: {
+ struct linux_epoll_pwait_args *p = params;
+ iarg[0] = p->epfd; /* l_int */
+ uarg[1] = (intptr_t) p->events; /* struct epoll_event * */
+ iarg[2] = p->maxevents; /* l_int */
+ iarg[3] = p->timeout; /* l_int */
+ uarg[4] = (intptr_t) p->mask; /* l_sigset_t * */
+ *n_args = 5;
+ break;
+ }
+ /* linux_signalfd */
+ case 282: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_timerfd */
+ case 283: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_eventfd */
+ case 284: {
+ struct linux_eventfd_args *p = params;
+ iarg[0] = p->initval; /* l_uint */
+ *n_args = 1;
+ break;
+ }
+ /* linux_fallocate */
+ case 285: {
+ struct linux_fallocate_args *p = params;
+ iarg[0] = p->fd; /* l_int */
+ iarg[1] = p->mode; /* l_int */
+ iarg[2] = p->offset; /* l_loff_t */
+ iarg[3] = p->len; /* l_loff_t */
+ *n_args = 4;
+ break;
+ }
+ /* linux_timerfd_settime */
+ case 286: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_timerfd_gettime */
+ case 287: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_accept4 */
+ case 288: {
+ struct linux_accept4_args *p = params;
+ iarg[0] = p->s; /* l_int */
+ iarg[1] = p->addr; /* l_uintptr_t */
+ iarg[2] = p->namelen; /* l_uintptr_t */
+ iarg[3] = p->flags; /* int */
+ *n_args = 4;
+ break;
+ }
+ /* linux_signalfd4 */
+ case 289: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_eventfd2 */
+ case 290: {
+ struct linux_eventfd2_args *p = params;
+ iarg[0] = p->initval; /* l_uint */
+ iarg[1] = p->flags; /* l_int */
+ *n_args = 2;
+ break;
+ }
+ /* linux_epoll_create1 */
+ case 291: {
+ struct linux_epoll_create1_args *p = params;
+ iarg[0] = p->flags; /* l_int */
+ *n_args = 1;
+ break;
+ }
+ /* linux_dup3 */
+ case 292: {
+ struct linux_dup3_args *p = params;
+ iarg[0] = p->oldfd; /* l_int */
+ iarg[1] = p->newfd; /* l_int */
+ iarg[2] = p->flags; /* l_int */
+ *n_args = 3;
+ break;
+ }
+ /* linux_pipe2 */
+ case 293: {
+ struct linux_pipe2_args *p = params;
+ uarg[0] = (intptr_t) p->pipefds; /* l_int * */
+ iarg[1] = p->flags; /* l_int */
+ *n_args = 2;
+ break;
+ }
+ /* linux_inotify_init1 */
+ case 294: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_preadv */
+ case 295: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_pwritev */
+ case 296: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_rt_tsigqueueinfo */
+ case 297: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_perf_event_open */
+ case 298: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_recvmmsg */
+ case 299: {
+ struct linux_recvmmsg_args *p = params;
+ iarg[0] = p->s; /* l_int */
+ uarg[1] = (intptr_t) p->msg; /* struct l_mmsghdr * */
+ iarg[2] = p->vlen; /* l_uint */
+ iarg[3] = p->flags; /* l_uint */
+ uarg[4] = (intptr_t) p->timeout; /* struct l_timespec * */
+ *n_args = 5;
+ break;
+ }
+ /* linux_fanotify_init */
+ case 300: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_fanotify_mark */
+ case 301: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_prlimit64 */
+ case 302: {
+ struct linux_prlimit64_args *p = params;
+ iarg[0] = p->pid; /* l_pid_t */
+ iarg[1] = p->resource; /* l_uint */
+ uarg[2] = (intptr_t) p->new; /* struct rlimit * */
+ uarg[3] = (intptr_t) p->old; /* struct rlimit * */
+ *n_args = 4;
+ break;
+ }
+ /* linux_name_to_handle_at */
+ case 303: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_open_by_handle_at */
+ case 304: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_clock_adjtime */
+ case 305: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_syncfs */
+ case 306: {
+ struct linux_syncfs_args *p = params;
+ iarg[0] = p->fd; /* l_int */
+ *n_args = 1;
+ break;
+ }
+ /* linux_sendmmsg */
+ case 307: {
+ struct linux_sendmmsg_args *p = params;
+ iarg[0] = p->s; /* l_int */
+ uarg[1] = (intptr_t) p->msg; /* struct l_mmsghdr * */
+ iarg[2] = p->vlen; /* l_uint */
+ iarg[3] = p->flags; /* l_uint */
+ *n_args = 4;
+ break;
+ }
+ /* linux_setns */
+ case 308: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_process_vm_readv */
+ case 309: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_process_vm_writev */
+ case 310: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_kcmp */
+ case 311: {
+ *n_args = 0;
+ break;
+ }
+ /* linux_finit_module */
+ case 312: {
+ *n_args = 0;
+ break;
+ }
+ default:
+ *n_args = 0;
+ break;
+ };
+}
+static void
+systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
+{
+ const char *p = NULL;
+ switch (sysnum) {
+#define nosys linux_nosys
+ /* read */
+ case 0:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ case 1:
+ p = "char *";
+ break;
+ case 2:
+ p = "u_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* write */
+ case 1:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ case 1:
+ p = "char *";
+ break;
+ case 2:
+ p = "u_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_open */
+ case 2:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* close */
+ case 3:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_newstat */
+ case 4:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "struct l_newstat *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_newfstat */
+ case 5:
+ switch(ndx) {
+ case 0:
+ p = "l_uint";
+ break;
+ case 1:
+ p = "struct l_newstat *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_newlstat */
+ case 6:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "struct l_newstat *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* poll */
+ case 7:
+ switch(ndx) {
+ case 0:
+ p = "struct pollfd";
+ break;
+ case 1:
+ p = "unsigned int";
+ break;
+ case 2:
+ p = "int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_lseek */
+ case 8:
+ switch(ndx) {
+ case 0:
+ p = "l_uint";
+ break;
+ case 1:
+ p = "l_off_t";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_mmap2 */
+ case 9:
+ switch(ndx) {
+ case 0:
+ p = "l_ulong";
+ break;
+ case 1:
+ p = "l_ulong";
+ break;
+ case 2:
+ p = "l_ulong";
+ break;
+ case 3:
+ p = "l_ulong";
+ break;
+ case 4:
+ p = "l_ulong";
+ break;
+ case 5:
+ p = "l_ulong";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_mprotect */
+ case 10:
+ switch(ndx) {
+ case 0:
+ p = "caddr_t";
+ break;
+ case 1:
+ p = "int";
+ break;
+ case 2:
+ p = "int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* munmap */
+ case 11:
+ switch(ndx) {
+ case 0:
+ p = "caddr_t";
+ break;
+ case 1:
+ p = "int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_brk */
+ case 12:
+ switch(ndx) {
+ case 0:
+ p = "l_ulong";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_rt_sigaction */
+ case 13:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_sigaction_t *";
+ break;
+ case 2:
+ p = "l_sigaction_t *";
+ break;
+ case 3:
+ p = "l_size_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_rt_sigprocmask */
+ case 14:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_sigset_t *";
+ break;
+ case 2:
+ p = "l_sigset_t *";
+ break;
+ case 3:
+ p = "l_size_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_rt_sigreturn */
+ case 15:
+ switch(ndx) {
+ case 0:
+ p = "struct l_ucontext *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_ioctl */
+ case 16:
+ switch(ndx) {
+ case 0:
+ p = "l_uint";
+ break;
+ case 1:
+ p = "l_uint";
+ break;
+ case 2:
+ p = "uintptr_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_pread */
+ case 17:
+ switch(ndx) {
+ case 0:
+ p = "l_uint";
+ break;
+ case 1:
+ p = "char *";
+ break;
+ case 2:
+ p = "l_size_t";
+ break;
+ case 3:
+ p = "l_loff_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_pwrite */
+ case 18:
+ switch(ndx) {
+ case 0:
+ p = "l_uint";
+ break;
+ case 1:
+ p = "char *";
+ break;
+ case 2:
+ p = "l_size_t";
+ break;
+ case 3:
+ p = "l_loff_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* readv */
+ case 19:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ case 1:
+ p = "struct iovec *";
+ break;
+ case 2:
+ p = "u_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* writev */
+ case 20:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ case 1:
+ p = "struct iovec *";
+ break;
+ case 2:
+ p = "u_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_access */
+ case 21:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_pipe */
+ case 22:
+ switch(ndx) {
+ case 0:
+ p = "l_ulong *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_select */
+ case 23:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_fd_set *";
+ break;
+ case 2:
+ p = "l_fd_set *";
+ break;
+ case 3:
+ p = "l_fd_set *";
+ break;
+ case 4:
+ p = "struct l_timeval *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* sched_yield */
+ case 24:
+ break;
+ /* linux_mremap */
+ case 25:
+ switch(ndx) {
+ case 0:
+ p = "l_ulong";
+ break;
+ case 1:
+ p = "l_ulong";
+ break;
+ case 2:
+ p = "l_ulong";
+ break;
+ case 3:
+ p = "l_ulong";
+ break;
+ case 4:
+ p = "l_ulong";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_msync */
+ case 26:
+ switch(ndx) {
+ case 0:
+ p = "l_ulong";
+ break;
+ case 1:
+ p = "l_size_t";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_mincore */
+ case 27:
+ switch(ndx) {
+ case 0:
+ p = "l_ulong";
+ break;
+ case 1:
+ p = "l_size_t";
+ break;
+ case 2:
+ p = "u_char *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* madvise */
+ case 28:
+ switch(ndx) {
+ case 0:
+ p = "void *";
+ break;
+ case 1:
+ p = "size_t";
+ break;
+ case 2:
+ p = "int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_shmget */
+ case 29:
+ switch(ndx) {
+ case 0:
+ p = "l_key_t";
+ break;
+ case 1:
+ p = "l_size_t";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_shmat */
+ case 30:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "char *";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_shmctl */
+ case 31:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "struct l_shmid_ds *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* dup */
+ case 32:
+ switch(ndx) {
+ case 0:
+ p = "u_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* dup2 */
+ case 33:
+ switch(ndx) {
+ case 0:
+ p = "u_int";
+ break;
+ case 1:
+ p = "u_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_pause */
+ case 34:
+ break;
+ /* linux_nanosleep */
+ case 35:
+ switch(ndx) {
+ case 0:
+ p = "const struct l_timespec *";
+ break;
+ case 1:
+ p = "struct l_timespec *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_getitimer */
+ case 36:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "struct l_itimerval *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_alarm */
+ case 37:
+ switch(ndx) {
+ case 0:
+ p = "l_uint";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_setitimer */
+ case 38:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "struct l_itimerval *";
+ break;
+ case 2:
+ p = "struct l_itimerval *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_getpid */
+ case 39:
+ break;
+ /* linux_sendfile */
+ case 40:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ case 1:
+ p = "int";
+ break;
+ case 2:
+ p = "l_long *";
+ break;
+ case 3:
+ p = "l_size_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_socket */
+ case 41:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_connect */
+ case 42:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_uintptr_t";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_accept */
+ case 43:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_uintptr_t";
+ break;
+ case 2:
+ p = "l_uintptr_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_sendto */
+ case 44:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_uintptr_t";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ case 3:
+ p = "l_int";
+ break;
+ case 4:
+ p = "l_uintptr_t";
+ break;
+ case 5:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_recvfrom */
+ case 45:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_uintptr_t";
+ break;
+ case 2:
+ p = "l_size_t";
+ break;
+ case 3:
+ p = "l_int";
+ break;
+ case 4:
+ p = "l_uintptr_t";
+ break;
+ case 5:
+ p = "l_uintptr_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_sendmsg */
+ case 46:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_uintptr_t";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_recvmsg */
+ case 47:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_uintptr_t";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_shutdown */
+ case 48:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_bind */
+ case 49:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_uintptr_t";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_listen */
+ case 50:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_getsockname */
+ case 51:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_uintptr_t";
+ break;
+ case 2:
+ p = "l_uintptr_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_getpeername */
+ case 52:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_uintptr_t";
+ break;
+ case 2:
+ p = "l_uintptr_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_socketpair */
+ case 53:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ case 3:
+ p = "l_uintptr_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_setsockopt */
+ case 54:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ case 3:
+ p = "l_uintptr_t";
+ break;
+ case 4:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_getsockopt */
+ case 55:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ case 3:
+ p = "l_uintptr_t";
+ break;
+ case 4:
+ p = "l_uintptr_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_clone */
+ case 56:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "void *";
+ break;
+ case 2:
+ p = "void *";
+ break;
+ case 3:
+ p = "void *";
+ break;
+ case 4:
+ p = "void *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_fork */
+ case 57:
+ break;
+ /* linux_vfork */
+ case 58:
+ break;
+ /* linux_execve */
+ case 59:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "char **";
+ break;
+ case 2:
+ p = "char **";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_exit */
+ case 60:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_wait4 */
+ case 61:
+ switch(ndx) {
+ case 0:
+ p = "l_pid_t";
+ break;
+ case 1:
+ p = "l_int *";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ case 3:
+ p = "struct rusage *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_kill */
+ case 62:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_newuname */
+ case 63:
+ switch(ndx) {
+ case 0:
+ p = "struct l_new_utsname *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_semget */
+ case 64:
+ switch(ndx) {
+ case 0:
+ p = "l_key_t";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_semop */
+ case 65:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "struct l_sembuf *";
+ break;
+ case 2:
+ p = "l_uint";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_semctl */
+ case 66:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ case 3:
+ p = "union l_semun";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_shmdt */
+ case 67:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_msgget */
+ case 68:
+ switch(ndx) {
+ case 0:
+ p = "l_key_t";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_msgsnd */
+ case 69:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "struct l_msgbuf *";
+ break;
+ case 2:
+ p = "l_size_t";
+ break;
+ case 3:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_msgrcv */
+ case 70:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "struct l_msgbuf *";
+ break;
+ case 2:
+ p = "l_size_t";
+ break;
+ case 3:
+ p = "l_long";
+ break;
+ case 4:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_msgctl */
+ case 71:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "struct l_msqid_ds *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_fcntl */
+ case 72:
+ switch(ndx) {
+ case 0:
+ p = "l_uint";
+ break;
+ case 1:
+ p = "l_uint";
+ break;
+ case 2:
+ p = "l_ulong";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* flock */
+ case 73:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ case 1:
+ p = "int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* fsync */
+ case 74:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_fdatasync */
+ case 75:
+ switch(ndx) {
+ case 0:
+ p = "l_uint";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_truncate */
+ case 76:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "l_ulong";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_ftruncate */
+ case 77:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_long";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_getdents */
+ case 78:
+ switch(ndx) {
+ case 0:
+ p = "l_uint";
+ break;
+ case 1:
+ p = "void *";
+ break;
+ case 2:
+ p = "l_uint";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_getcwd */
+ case 79:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "l_ulong";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_chdir */
+ case 80:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* fchdir */
+ case 81:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_rename */
+ case 82:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "char *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_mkdir */
+ case 83:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_rmdir */
+ case 84:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_creat */
+ case 85:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_link */
+ case 86:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "char *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_unlink */
+ case 87:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_symlink */
+ case 88:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "char *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_readlink */
+ case 89:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "char *";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_chmod */
+ case 90:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "l_mode_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* fchmod */
+ case 91:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ case 1:
+ p = "int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_chown */
+ case 92:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "l_uid_t";
+ break;
+ case 2:
+ p = "l_gid_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* fchown */
+ case 93:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ case 1:
+ p = "int";
+ break;
+ case 2:
+ p = "int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_lchown */
+ case 94:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "l_uid_t";
+ break;
+ case 2:
+ p = "l_gid_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* umask */
+ case 95:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* gettimeofday */
+ case 96:
+ switch(ndx) {
+ case 0:
+ p = "struct l_timeval *";
+ break;
+ case 1:
+ p = "struct timezone *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_getrlimit */
+ case 97:
+ switch(ndx) {
+ case 0:
+ p = "l_uint";
+ break;
+ case 1:
+ p = "struct l_rlimit *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* getrusage */
+ case 98:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ case 1:
+ p = "struct rusage *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_sysinfo */
+ case 99:
+ switch(ndx) {
+ case 0:
+ p = "struct l_sysinfo *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_times */
+ case 100:
+ switch(ndx) {
+ case 0:
+ p = "struct l_times_argv *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_ptrace */
+ case 101:
+ switch(ndx) {
+ case 0:
+ p = "l_long";
+ break;
+ case 1:
+ p = "l_long";
+ break;
+ case 2:
+ p = "l_long";
+ break;
+ case 3:
+ p = "l_long";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_getuid */
+ case 102:
+ break;
+ /* linux_syslog */
+ case 103:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "char *";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_getgid */
+ case 104:
+ break;
+ /* setuid */
+ case 105:
+ switch(ndx) {
+ case 0:
+ p = "uid_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* setgid */
+ case 106:
+ switch(ndx) {
+ case 0:
+ p = "gid_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* geteuid */
+ case 107:
+ break;
+ /* getegid */
+ case 108:
+ break;
+ /* setpgid */
+ case 109:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ case 1:
+ p = "int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_getppid */
+ case 110:
+ break;
+ /* getpgrp */
+ case 111:
+ break;
+ /* setsid */
+ case 112:
+ break;
+ /* setreuid */
+ case 113:
+ switch(ndx) {
+ case 0:
+ p = "uid_t";
+ break;
+ case 1:
+ p = "uid_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* setregid */
+ case 114:
+ switch(ndx) {
+ case 0:
+ p = "gid_t";
+ break;
+ case 1:
+ p = "gid_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_getgroups */
+ case 115:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_gid_t *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_setgroups */
+ case 116:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_gid_t *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* setresuid */
+ case 117:
+ switch(ndx) {
+ case 0:
+ p = "uid_t";
+ break;
+ case 1:
+ p = "uid_t";
+ break;
+ case 2:
+ p = "uid_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* getresuid */
+ case 118:
+ switch(ndx) {
+ case 0:
+ p = "uid_t *";
+ break;
+ case 1:
+ p = "uid_t *";
+ break;
+ case 2:
+ p = "uid_t *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* setresgid */
+ case 119:
+ switch(ndx) {
+ case 0:
+ p = "gid_t";
+ break;
+ case 1:
+ p = "gid_t";
+ break;
+ case 2:
+ p = "gid_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* getresgid */
+ case 120:
+ switch(ndx) {
+ case 0:
+ p = "gid_t *";
+ break;
+ case 1:
+ p = "gid_t *";
+ break;
+ case 2:
+ p = "gid_t *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* getpgid */
+ case 121:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_setfsuid */
+ case 122:
+ switch(ndx) {
+ case 0:
+ p = "l_uid_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_setfsgid */
+ case 123:
+ switch(ndx) {
+ case 0:
+ p = "l_gid_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_getsid */
+ case 124:
+ switch(ndx) {
+ case 0:
+ p = "l_pid_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_capget */
+ case 125:
+ switch(ndx) {
+ case 0:
+ p = "struct l_user_cap_header *";
+ break;
+ case 1:
+ p = "struct l_user_cap_data *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_capset */
+ case 126:
+ switch(ndx) {
+ case 0:
+ p = "struct l_user_cap_header *";
+ break;
+ case 1:
+ p = "struct l_user_cap_data *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_rt_sigpending */
+ case 127:
+ switch(ndx) {
+ case 0:
+ p = "l_sigset_t *";
+ break;
+ case 1:
+ p = "l_size_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_rt_sigtimedwait */
+ case 128:
+ switch(ndx) {
+ case 0:
+ p = "l_sigset_t *";
+ break;
+ case 1:
+ p = "l_siginfo_t *";
+ break;
+ case 2:
+ p = "struct l_timeval *";
+ break;
+ case 3:
+ p = "l_size_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_rt_sigqueueinfo */
+ case 129:
+ switch(ndx) {
+ case 0:
+ p = "l_pid_t";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "l_siginfo_t *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_rt_sigsuspend */
+ case 130:
+ switch(ndx) {
+ case 0:
+ p = "l_sigset_t *";
+ break;
+ case 1:
+ p = "l_size_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_sigaltstack */
+ case 131:
+ switch(ndx) {
+ case 0:
+ p = "l_stack_t *";
+ break;
+ case 1:
+ p = "l_stack_t *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_utime */
+ case 132:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "struct l_utimbuf *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_mknod */
+ case 133:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "l_dev_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_personality */
+ case 135:
+ switch(ndx) {
+ case 0:
+ p = "l_ulong";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_ustat */
+ case 136:
+ switch(ndx) {
+ case 0:
+ p = "l_dev_t";
+ break;
+ case 1:
+ p = "struct l_ustat *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_statfs */
+ case 137:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "struct l_statfs_buf *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_fstatfs */
+ case 138:
+ switch(ndx) {
+ case 0:
+ p = "l_uint";
+ break;
+ case 1:
+ p = "struct l_statfs_buf *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_sysfs */
+ case 139:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_ulong";
+ break;
+ case 2:
+ p = "l_ulong";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_getpriority */
+ case 140:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ case 1:
+ p = "int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* setpriority */
+ case 141:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ case 1:
+ p = "int";
+ break;
+ case 2:
+ p = "int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_sched_setparam */
+ case 142:
+ switch(ndx) {
+ case 0:
+ p = "l_pid_t";
+ break;
+ case 1:
+ p = "struct l_sched_param *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_sched_getparam */
+ case 143:
+ switch(ndx) {
+ case 0:
+ p = "l_pid_t";
+ break;
+ case 1:
+ p = "struct l_sched_param *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_sched_setscheduler */
+ case 144:
+ switch(ndx) {
+ case 0:
+ p = "l_pid_t";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "struct l_sched_param *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_sched_getscheduler */
+ case 145:
+ switch(ndx) {
+ case 0:
+ p = "l_pid_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_sched_get_priority_max */
+ case 146:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_sched_get_priority_min */
+ case 147:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_sched_rr_get_interval */
+ case 148:
+ switch(ndx) {
+ case 0:
+ p = "l_pid_t";
+ break;
+ case 1:
+ p = "struct l_timespec *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* mlock */
+ case 149:
+ switch(ndx) {
+ case 0:
+ p = "const void *";
+ break;
+ case 1:
+ p = "size_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* munlock */
+ case 150:
+ switch(ndx) {
+ case 0:
+ p = "const void *";
+ break;
+ case 1:
+ p = "size_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* mlockall */
+ case 151:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* munlockall */
+ case 152:
+ break;
+ /* linux_vhangup */
+ case 153:
+ break;
+ /* linux_pivot_root */
+ case 155:
+ break;
+ /* linux_sysctl */
+ case 156:
+ switch(ndx) {
+ case 0:
+ p = "struct l___sysctl_args *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_prctl */
+ case 157:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_uintptr_t";
+ break;
+ case 2:
+ p = "l_uintptr_t";
+ break;
+ case 3:
+ p = "l_uintptr_t";
+ break;
+ case 4:
+ p = "l_uintptr_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_arch_prctl */
+ case 158:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_ulong";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_adjtimex */
+ case 159:
+ break;
+ /* linux_setrlimit */
+ case 160:
+ switch(ndx) {
+ case 0:
+ p = "l_uint";
+ break;
+ case 1:
+ p = "struct l_rlimit *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* chroot */
+ case 161:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* sync */
+ case 162:
+ break;
+ /* acct */
+ case 163:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* settimeofday */
+ case 164:
+ switch(ndx) {
+ case 0:
+ p = "struct l_timeval *";
+ break;
+ case 1:
+ p = "struct timezone *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_mount */
+ case 165:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "char *";
+ break;
+ case 2:
+ p = "char *";
+ break;
+ case 3:
+ p = "l_ulong";
+ break;
+ case 4:
+ p = "void *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_umount */
+ case 166:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* swapon */
+ case 167:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_swapoff */
+ case 168:
+ break;
+ /* linux_reboot */
+ case 169:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "l_uint";
+ break;
+ case 3:
+ p = "void *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_sethostname */
+ case 170:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "l_uint";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_setdomainname */
+ case 171:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_iopl */
+ case 172:
+ switch(ndx) {
+ case 0:
+ p = "l_uint";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_create_module */
+ case 174:
+ break;
+ /* linux_init_module */
+ case 175:
+ break;
+ /* linux_delete_module */
+ case 176:
+ break;
+ /* linux_get_kernel_syms */
+ case 177:
+ break;
+ /* linux_query_module */
+ case 178:
+ break;
+ /* linux_quotactl */
+ case 179:
+ break;
+ /* linux_nfsservctl */
+ case 180:
+ break;
+ /* linux_getpmsg */
+ case 181:
+ break;
+ /* linux_putpmsg */
+ case 182:
+ break;
+ /* linux_afs_syscall */
+ case 183:
+ break;
+ /* linux_tuxcall */
+ case 184:
+ break;
+ /* linux_security */
+ case 185:
+ break;
+ /* linux_gettid */
+ case 186:
+ break;
+ /* linux_setxattr */
+ case 188:
+ break;
+ /* linux_lsetxattr */
+ case 189:
+ break;
+ /* linux_fsetxattr */
+ case 190:
+ break;
+ /* linux_getxattr */
+ case 191:
+ break;
+ /* linux_lgetxattr */
+ case 192:
+ break;
+ /* linux_fgetxattr */
+ case 193:
+ break;
+ /* linux_listxattr */
+ case 194:
+ break;
+ /* linux_llistxattr */
+ case 195:
+ break;
+ /* linux_flistxattr */
+ case 196:
+ break;
+ /* linux_removexattr */
+ case 197:
+ break;
+ /* linux_lremovexattr */
+ case 198:
+ break;
+ /* linux_fremovexattr */
+ case 199:
+ break;
+ /* linux_tkill */
+ case 200:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ case 1:
+ p = "int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_time */
+ case 201:
+ switch(ndx) {
+ case 0:
+ p = "l_time_t *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_sys_futex */
+ case 202:
+ switch(ndx) {
+ case 0:
+ p = "void *";
+ break;
+ case 1:
+ p = "int";
+ break;
+ case 2:
+ p = "int";
+ break;
+ case 3:
+ p = "struct l_timespec *";
+ break;
+ case 4:
+ p = "void *";
+ break;
+ case 5:
+ p = "int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_sched_setaffinity */
+ case 203:
+ switch(ndx) {
+ case 0:
+ p = "l_pid_t";
+ break;
+ case 1:
+ p = "l_uint";
+ break;
+ case 2:
+ p = "l_ulong *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_sched_getaffinity */
+ case 204:
+ switch(ndx) {
+ case 0:
+ p = "l_pid_t";
+ break;
+ case 1:
+ p = "l_uint";
+ break;
+ case 2:
+ p = "l_ulong *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_set_thread_area */
+ case 205:
+ break;
+ /* linux_lookup_dcookie */
+ case 212:
+ break;
+ /* linux_epoll_create */
+ case 213:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_epoll_ctl_old */
+ case 214:
+ break;
+ /* linux_epoll_wait_old */
+ case 215:
+ break;
+ /* linux_remap_file_pages */
+ case 216:
+ break;
+ /* linux_getdents64 */
+ case 217:
+ switch(ndx) {
+ case 0:
+ p = "l_uint";
+ break;
+ case 1:
+ p = "void *";
+ break;
+ case 2:
+ p = "l_uint";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_set_tid_address */
+ case 218:
+ switch(ndx) {
+ case 0:
+ p = "int *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_semtimedop */
+ case 220:
+ break;
+ /* linux_fadvise64 */
+ case 221:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ case 1:
+ p = "l_loff_t";
+ break;
+ case 2:
+ p = "l_size_t";
+ break;
+ case 3:
+ p = "int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_timer_create */
+ case 222:
+ switch(ndx) {
+ case 0:
+ p = "clockid_t";
+ break;
+ case 1:
+ p = "struct sigevent *";
+ break;
+ case 2:
+ p = "l_timer_t *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_timer_settime */
+ case 223:
+ switch(ndx) {
+ case 0:
+ p = "l_timer_t";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "const struct itimerspec *";
+ break;
+ case 3:
+ p = "struct itimerspec *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_timer_gettime */
+ case 224:
+ switch(ndx) {
+ case 0:
+ p = "l_timer_t";
+ break;
+ case 1:
+ p = "struct itimerspec *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_timer_getoverrun */
+ case 225:
+ switch(ndx) {
+ case 0:
+ p = "l_timer_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_timer_delete */
+ case 226:
+ switch(ndx) {
+ case 0:
+ p = "l_timer_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_clock_settime */
+ case 227:
+ switch(ndx) {
+ case 0:
+ p = "clockid_t";
+ break;
+ case 1:
+ p = "struct l_timespec *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_clock_gettime */
+ case 228:
+ switch(ndx) {
+ case 0:
+ p = "clockid_t";
+ break;
+ case 1:
+ p = "struct l_timespec *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_clock_getres */
+ case 229:
+ switch(ndx) {
+ case 0:
+ p = "clockid_t";
+ break;
+ case 1:
+ p = "struct l_timespec *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_clock_nanosleep */
+ case 230:
+ switch(ndx) {
+ case 0:
+ p = "clockid_t";
+ break;
+ case 1:
+ p = "int";
+ break;
+ case 2:
+ p = "struct l_timespec *";
+ break;
+ case 3:
+ p = "struct l_timespec *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_exit_group */
+ case 231:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_epoll_wait */
+ case 232:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "struct epoll_event *";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ case 3:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_epoll_ctl */
+ case 233:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ case 3:
+ p = "struct epoll_event *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_tgkill */
+ case 234:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ case 1:
+ p = "int";
+ break;
+ case 2:
+ p = "int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_utimes */
+ case 235:
+ switch(ndx) {
+ case 0:
+ p = "char *";
+ break;
+ case 1:
+ p = "struct l_timeval *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_mbind */
+ case 237:
+ break;
+ /* linux_set_mempolicy */
+ case 238:
+ break;
+ /* linux_get_mempolicy */
+ case 239:
+ break;
+ /* linux_mq_open */
+ case 240:
+ break;
+ /* linux_mq_unlink */
+ case 241:
+ break;
+ /* linux_mq_timedsend */
+ case 242:
+ break;
+ /* linux_mq_timedreceive */
+ case 243:
+ break;
+ /* linux_mq_notify */
+ case 244:
+ break;
+ /* linux_mq_getsetattr */
+ case 245:
+ break;
+ /* linux_kexec_load */
+ case 246:
+ break;
+ /* linux_waitid */
+ case 247:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ case 1:
+ p = "l_pid_t";
+ break;
+ case 2:
+ p = "l_siginfo_t *";
+ break;
+ case 3:
+ p = "int";
+ break;
+ case 4:
+ p = "struct rusage *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_add_key */
+ case 248:
+ break;
+ /* linux_request_key */
+ case 249:
+ break;
+ /* linux_keyctl */
+ case 250:
+ break;
+ /* linux_ioprio_set */
+ case 251:
+ break;
+ /* linux_ioprio_get */
+ case 252:
+ break;
+ /* linux_inotify_init */
+ case 253:
+ break;
+ /* linux_inotify_add_watch */
+ case 254:
+ break;
+ /* linux_inotify_rm_watch */
+ case 255:
+ break;
+ /* linux_migrate_pages */
+ case 256:
+ break;
+ /* linux_openat */
+ case 257:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "const char *";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ case 3:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_mkdirat */
+ case 258:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "const char *";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_mknodat */
+ case 259:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "const char *";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ case 3:
+ p = "l_uint";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_fchownat */
+ case 260:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "const char *";
+ break;
+ case 2:
+ p = "l_uid_t";
+ break;
+ case 3:
+ p = "l_gid_t";
+ break;
+ case 4:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_futimesat */
+ case 261:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "char *";
+ break;
+ case 2:
+ p = "struct l_timeval *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_newfstatat */
+ case 262:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "char *";
+ break;
+ case 2:
+ p = "struct l_stat64 *";
+ break;
+ case 3:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_unlinkat */
+ case 263:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "const char *";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_renameat */
+ case 264:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "const char *";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ case 3:
+ p = "const char *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_linkat */
+ case 265:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "const char *";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ case 3:
+ p = "const char *";
+ break;
+ case 4:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_symlinkat */
+ case 266:
+ switch(ndx) {
+ case 0:
+ p = "const char *";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "const char *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_readlinkat */
+ case 267:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "const char *";
+ break;
+ case 2:
+ p = "char *";
+ break;
+ case 3:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_fchmodat */
+ case 268:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "const char *";
+ break;
+ case 2:
+ p = "l_mode_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_faccessat */
+ case 269:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "const char *";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_pselect6 */
+ case 270:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_fd_set *";
+ break;
+ case 2:
+ p = "l_fd_set *";
+ break;
+ case 3:
+ p = "l_fd_set *";
+ break;
+ case 4:
+ p = "struct l_timespec *";
+ break;
+ case 5:
+ p = "l_uintptr_t *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_ppoll */
+ case 271:
+ switch(ndx) {
+ case 0:
+ p = "struct pollfd *";
+ break;
+ case 1:
+ p = "uint32_t";
+ break;
+ case 2:
+ p = "struct l_timespec *";
+ break;
+ case 3:
+ p = "l_sigset_t *";
+ break;
+ case 4:
+ p = "l_size_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_unshare */
+ case 272:
+ break;
+ /* linux_set_robust_list */
+ case 273:
+ switch(ndx) {
+ case 0:
+ p = "struct linux_robust_list_head *";
+ break;
+ case 1:
+ p = "l_size_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_get_robust_list */
+ case 274:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "struct linux_robust_list_head *";
+ break;
+ case 2:
+ p = "l_size_t *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_splice */
+ case 275:
+ break;
+ /* linux_tee */
+ case 276:
+ break;
+ /* linux_sync_file_range */
+ case 277:
+ break;
+ /* linux_vmsplice */
+ case 278:
+ break;
+ /* linux_move_pages */
+ case 279:
+ break;
+ /* linux_utimensat */
+ case 280:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "const char *";
+ break;
+ case 2:
+ p = "const struct l_timespec *";
+ break;
+ case 3:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_epoll_pwait */
+ case 281:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "struct epoll_event *";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ case 3:
+ p = "l_int";
+ break;
+ case 4:
+ p = "l_sigset_t *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_signalfd */
+ case 282:
+ break;
+ /* linux_timerfd */
+ case 283:
+ break;
+ /* linux_eventfd */
+ case 284:
+ switch(ndx) {
+ case 0:
+ p = "l_uint";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_fallocate */
+ case 285:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "l_loff_t";
+ break;
+ case 3:
+ p = "l_loff_t";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_timerfd_settime */
+ case 286:
+ break;
+ /* linux_timerfd_gettime */
+ case 287:
+ break;
+ /* linux_accept4 */
+ case 288:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_uintptr_t";
+ break;
+ case 2:
+ p = "l_uintptr_t";
+ break;
+ case 3:
+ p = "int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_signalfd4 */
+ case 289:
+ break;
+ /* linux_eventfd2 */
+ case 290:
+ switch(ndx) {
+ case 0:
+ p = "l_uint";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_epoll_create1 */
+ case 291:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_dup3 */
+ case 292:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_pipe2 */
+ case 293:
+ switch(ndx) {
+ case 0:
+ p = "l_int *";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_inotify_init1 */
+ case 294:
+ break;
+ /* linux_preadv */
+ case 295:
+ break;
+ /* linux_pwritev */
+ case 296:
+ break;
+ /* linux_rt_tsigqueueinfo */
+ case 297:
+ break;
+ /* linux_perf_event_open */
+ case 298:
+ break;
+ /* linux_recvmmsg */
+ case 299:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "struct l_mmsghdr *";
+ break;
+ case 2:
+ p = "l_uint";
+ break;
+ case 3:
+ p = "l_uint";
+ break;
+ case 4:
+ p = "struct l_timespec *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_fanotify_init */
+ case 300:
+ break;
+ /* linux_fanotify_mark */
+ case 301:
+ break;
+ /* linux_prlimit64 */
+ case 302:
+ switch(ndx) {
+ case 0:
+ p = "l_pid_t";
+ break;
+ case 1:
+ p = "l_uint";
+ break;
+ case 2:
+ p = "struct rlimit *";
+ break;
+ case 3:
+ p = "struct rlimit *";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_name_to_handle_at */
+ case 303:
+ break;
+ /* linux_open_by_handle_at */
+ case 304:
+ break;
+ /* linux_clock_adjtime */
+ case 305:
+ break;
+ /* linux_syncfs */
+ case 306:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_sendmmsg */
+ case 307:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "struct l_mmsghdr *";
+ break;
+ case 2:
+ p = "l_uint";
+ break;
+ case 3:
+ p = "l_uint";
+ break;
+ default:
+ break;
+ };
+ break;
+ /* linux_setns */
+ case 308:
+ break;
+ /* linux_process_vm_readv */
+ case 309:
+ break;
+ /* linux_process_vm_writev */
+ case 310:
+ break;
+ /* linux_kcmp */
+ case 311:
+ break;
+ /* linux_finit_module */
+ case 312:
+ break;
+ default:
+ break;
+ };
+ if (p != NULL)
+ strlcpy(desc, p, descsz);
+}
+static void
+systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
+{
+ const char *p = NULL;
+ switch (sysnum) {
+#define nosys linux_nosys
+ /* read */
+ case 0:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* write */
+ case 1:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_open */
+ case 2:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* close */
+ case 3:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_newstat */
+ case 4:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_newfstat */
+ case 5:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_newlstat */
+ case 6:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* poll */
+ case 7:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_lseek */
+ case 8:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_mmap2 */
+ case 9:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_mprotect */
+ case 10:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* munmap */
+ case 11:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_brk */
+ case 12:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_rt_sigaction */
+ case 13:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_rt_sigprocmask */
+ case 14:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_rt_sigreturn */
+ case 15:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_ioctl */
+ case 16:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_pread */
+ case 17:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_pwrite */
+ case 18:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* readv */
+ case 19:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* writev */
+ case 20:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_access */
+ case 21:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_pipe */
+ case 22:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_select */
+ case 23:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* sched_yield */
+ case 24:
+ /* linux_mremap */
+ case 25:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_msync */
+ case 26:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_mincore */
+ case 27:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* madvise */
+ case 28:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_shmget */
+ case 29:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_shmat */
+ case 30:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_shmctl */
+ case 31:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* dup */
+ case 32:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* dup2 */
+ case 33:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_pause */
+ case 34:
+ /* linux_nanosleep */
+ case 35:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_getitimer */
+ case 36:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_alarm */
+ case 37:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_setitimer */
+ case 38:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_getpid */
+ case 39:
+ /* linux_sendfile */
+ case 40:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_socket */
+ case 41:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_connect */
+ case 42:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_accept */
+ case 43:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_sendto */
+ case 44:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_recvfrom */
+ case 45:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_sendmsg */
+ case 46:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_recvmsg */
+ case 47:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_shutdown */
+ case 48:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_bind */
+ case 49:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_listen */
+ case 50:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_getsockname */
+ case 51:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_getpeername */
+ case 52:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_socketpair */
+ case 53:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_setsockopt */
+ case 54:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_getsockopt */
+ case 55:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_clone */
+ case 56:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_fork */
+ case 57:
+ /* linux_vfork */
+ case 58:
+ /* linux_execve */
+ case 59:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_exit */
+ case 60:
+ if (ndx == 0 || ndx == 1)
+ p = "void";
+ break;
+ /* linux_wait4 */
+ case 61:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_kill */
+ case 62:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_newuname */
+ case 63:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_semget */
+ case 64:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_semop */
+ case 65:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_semctl */
+ case 66:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_shmdt */
+ case 67:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_msgget */
+ case 68:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_msgsnd */
+ case 69:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_msgrcv */
+ case 70:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_msgctl */
+ case 71:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_fcntl */
+ case 72:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* flock */
+ case 73:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* fsync */
+ case 74:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_fdatasync */
+ case 75:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_truncate */
+ case 76:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_ftruncate */
+ case 77:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_getdents */
+ case 78:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_getcwd */
+ case 79:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_chdir */
+ case 80:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* fchdir */
+ case 81:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_rename */
+ case 82:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_mkdir */
+ case 83:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_rmdir */
+ case 84:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_creat */
+ case 85:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_link */
+ case 86:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_unlink */
+ case 87:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_symlink */
+ case 88:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_readlink */
+ case 89:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_chmod */
+ case 90:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* fchmod */
+ case 91:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_chown */
+ case 92:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* fchown */
+ case 93:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_lchown */
+ case 94:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* umask */
+ case 95:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* gettimeofday */
+ case 96:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_getrlimit */
+ case 97:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* getrusage */
+ case 98:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_sysinfo */
+ case 99:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_times */
+ case 100:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_ptrace */
+ case 101:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_getuid */
+ case 102:
+ /* linux_syslog */
+ case 103:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_getgid */
+ case 104:
+ /* setuid */
+ case 105:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* setgid */
+ case 106:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* geteuid */
+ case 107:
+ /* getegid */
+ case 108:
+ /* setpgid */
+ case 109:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_getppid */
+ case 110:
+ /* getpgrp */
+ case 111:
+ /* setsid */
+ case 112:
+ /* setreuid */
+ case 113:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* setregid */
+ case 114:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_getgroups */
+ case 115:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_setgroups */
+ case 116:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* setresuid */
+ case 117:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* getresuid */
+ case 118:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* setresgid */
+ case 119:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* getresgid */
+ case 120:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* getpgid */
+ case 121:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_setfsuid */
+ case 122:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_setfsgid */
+ case 123:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_getsid */
+ case 124:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_capget */
+ case 125:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_capset */
+ case 126:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_rt_sigpending */
+ case 127:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_rt_sigtimedwait */
+ case 128:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_rt_sigqueueinfo */
+ case 129:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_rt_sigsuspend */
+ case 130:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_sigaltstack */
+ case 131:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_utime */
+ case 132:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_mknod */
+ case 133:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_personality */
+ case 135:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_ustat */
+ case 136:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_statfs */
+ case 137:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_fstatfs */
+ case 138:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_sysfs */
+ case 139:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_getpriority */
+ case 140:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* setpriority */
+ case 141:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_sched_setparam */
+ case 142:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_sched_getparam */
+ case 143:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_sched_setscheduler */
+ case 144:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_sched_getscheduler */
+ case 145:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_sched_get_priority_max */
+ case 146:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_sched_get_priority_min */
+ case 147:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_sched_rr_get_interval */
+ case 148:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* mlock */
+ case 149:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* munlock */
+ case 150:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* mlockall */
+ case 151:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* munlockall */
+ case 152:
+ /* linux_vhangup */
+ case 153:
+ /* linux_pivot_root */
+ case 155:
+ /* linux_sysctl */
+ case 156:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_prctl */
+ case 157:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_arch_prctl */
+ case 158:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_adjtimex */
+ case 159:
+ /* linux_setrlimit */
+ case 160:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* chroot */
+ case 161:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* sync */
+ case 162:
+ /* acct */
+ case 163:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* settimeofday */
+ case 164:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_mount */
+ case 165:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_umount */
+ case 166:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* swapon */
+ case 167:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_swapoff */
+ case 168:
+ /* linux_reboot */
+ case 169:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_sethostname */
+ case 170:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_setdomainname */
+ case 171:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_iopl */
+ case 172:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_create_module */
+ case 174:
+ /* linux_init_module */
+ case 175:
+ /* linux_delete_module */
+ case 176:
+ /* linux_get_kernel_syms */
+ case 177:
+ /* linux_query_module */
+ case 178:
+ /* linux_quotactl */
+ case 179:
+ /* linux_nfsservctl */
+ case 180:
+ /* linux_getpmsg */
+ case 181:
+ /* linux_putpmsg */
+ case 182:
+ /* linux_afs_syscall */
+ case 183:
+ /* linux_tuxcall */
+ case 184:
+ /* linux_security */
+ case 185:
+ /* linux_gettid */
+ case 186:
+ /* linux_setxattr */
+ case 188:
+ /* linux_lsetxattr */
+ case 189:
+ /* linux_fsetxattr */
+ case 190:
+ /* linux_getxattr */
+ case 191:
+ /* linux_lgetxattr */
+ case 192:
+ /* linux_fgetxattr */
+ case 193:
+ /* linux_listxattr */
+ case 194:
+ /* linux_llistxattr */
+ case 195:
+ /* linux_flistxattr */
+ case 196:
+ /* linux_removexattr */
+ case 197:
+ /* linux_lremovexattr */
+ case 198:
+ /* linux_fremovexattr */
+ case 199:
+ /* linux_tkill */
+ case 200:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_time */
+ case 201:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_sys_futex */
+ case 202:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_sched_setaffinity */
+ case 203:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_sched_getaffinity */
+ case 204:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_set_thread_area */
+ case 205:
+ /* linux_lookup_dcookie */
+ case 212:
+ /* linux_epoll_create */
+ case 213:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_epoll_ctl_old */
+ case 214:
+ /* linux_epoll_wait_old */
+ case 215:
+ /* linux_remap_file_pages */
+ case 216:
+ /* linux_getdents64 */
+ case 217:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_set_tid_address */
+ case 218:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_semtimedop */
+ case 220:
+ /* linux_fadvise64 */
+ case 221:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_timer_create */
+ case 222:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_timer_settime */
+ case 223:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_timer_gettime */
+ case 224:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_timer_getoverrun */
+ case 225:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_timer_delete */
+ case 226:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_clock_settime */
+ case 227:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_clock_gettime */
+ case 228:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_clock_getres */
+ case 229:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_clock_nanosleep */
+ case 230:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_exit_group */
+ case 231:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_epoll_wait */
+ case 232:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_epoll_ctl */
+ case 233:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_tgkill */
+ case 234:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_utimes */
+ case 235:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_mbind */
+ case 237:
+ /* linux_set_mempolicy */
+ case 238:
+ /* linux_get_mempolicy */
+ case 239:
+ /* linux_mq_open */
+ case 240:
+ /* linux_mq_unlink */
+ case 241:
+ /* linux_mq_timedsend */
+ case 242:
+ /* linux_mq_timedreceive */
+ case 243:
+ /* linux_mq_notify */
+ case 244:
+ /* linux_mq_getsetattr */
+ case 245:
+ /* linux_kexec_load */
+ case 246:
+ /* linux_waitid */
+ case 247:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_add_key */
+ case 248:
+ /* linux_request_key */
+ case 249:
+ /* linux_keyctl */
+ case 250:
+ /* linux_ioprio_set */
+ case 251:
+ /* linux_ioprio_get */
+ case 252:
+ /* linux_inotify_init */
+ case 253:
+ /* linux_inotify_add_watch */
+ case 254:
+ /* linux_inotify_rm_watch */
+ case 255:
+ /* linux_migrate_pages */
+ case 256:
+ /* linux_openat */
+ case 257:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_mkdirat */
+ case 258:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_mknodat */
+ case 259:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_fchownat */
+ case 260:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_futimesat */
+ case 261:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_newfstatat */
+ case 262:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_unlinkat */
+ case 263:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_renameat */
+ case 264:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_linkat */
+ case 265:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_symlinkat */
+ case 266:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_readlinkat */
+ case 267:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_fchmodat */
+ case 268:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_faccessat */
+ case 269:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_pselect6 */
+ case 270:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_ppoll */
+ case 271:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_unshare */
+ case 272:
+ /* linux_set_robust_list */
+ case 273:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_get_robust_list */
+ case 274:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_splice */
+ case 275:
+ /* linux_tee */
+ case 276:
+ /* linux_sync_file_range */
+ case 277:
+ /* linux_vmsplice */
+ case 278:
+ /* linux_move_pages */
+ case 279:
+ /* linux_utimensat */
+ case 280:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_epoll_pwait */
+ case 281:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_signalfd */
+ case 282:
+ /* linux_timerfd */
+ case 283:
+ /* linux_eventfd */
+ case 284:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_fallocate */
+ case 285:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_timerfd_settime */
+ case 286:
+ /* linux_timerfd_gettime */
+ case 287:
+ /* linux_accept4 */
+ case 288:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_signalfd4 */
+ case 289:
+ /* linux_eventfd2 */
+ case 290:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_epoll_create1 */
+ case 291:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_dup3 */
+ case 292:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_pipe2 */
+ case 293:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_inotify_init1 */
+ case 294:
+ /* linux_preadv */
+ case 295:
+ /* linux_pwritev */
+ case 296:
+ /* linux_rt_tsigqueueinfo */
+ case 297:
+ /* linux_perf_event_open */
+ case 298:
+ /* linux_recvmmsg */
+ case 299:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_fanotify_init */
+ case 300:
+ /* linux_fanotify_mark */
+ case 301:
+ /* linux_prlimit64 */
+ case 302:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_name_to_handle_at */
+ case 303:
+ /* linux_open_by_handle_at */
+ case 304:
+ /* linux_clock_adjtime */
+ case 305:
+ /* linux_syncfs */
+ case 306:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_sendmmsg */
+ case 307:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
+ /* linux_setns */
+ case 308:
+ /* linux_process_vm_readv */
+ case 309:
+ /* linux_process_vm_writev */
+ case 310:
+ /* linux_kcmp */
+ case 311:
+ /* linux_finit_module */
+ case 312:
+ default:
+ break;
+ };
+ if (p != NULL)
+ strlcpy(desc, p, descsz);
+}
diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c
new file mode 100644
index 0000000..e9ab8b3
--- /dev/null
+++ b/sys/amd64/linux/linux_sysvec.c
@@ -0,0 +1,946 @@
+/*-
+ * Copyright (c) 2013 Dmitry Chagin
+ * Copyright (c) 2004 Tim J. Robbins
+ * Copyright (c) 2003 Peter Wemm
+ * Copyright (c) 2002 Doug Rabson
+ * Copyright (c) 1998-1999 Andrew Gallatin
+ * Copyright (c) 1994-1996 Søren Schmidt
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "opt_compat.h"
+
+#define __ELF_WORD_SIZE 64
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/exec.h>
+#include <sys/fcntl.h>
+#include <sys/imgact.h>
+#include <sys/imgact_elf.h>
+#include <sys/kernel.h>
+#include <sys/ktr.h>
+#include <sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/mutex.h>
+#include <sys/proc.h>
+#include <sys/resourcevar.h>
+#include <sys/signalvar.h>
+#include <sys/sysctl.h>
+#include <sys/syscallsubr.h>
+#include <sys/sysent.h>
+#include <sys/sysproto.h>
+#include <sys/vnode.h>
+#include <sys/eventhandler.h>
+
+#include <vm/vm.h>
+#include <vm/pmap.h>
+#include <vm/vm_extern.h>
+#include <vm/vm_map.h>
+#include <vm/vm_object.h>
+#include <vm/vm_page.h>
+#include <vm/vm_param.h>
+
+#include <machine/cpu.h>
+#include <machine/md_var.h>
+#include <machine/pcb.h>
+#include <machine/specialreg.h>
+
+#include <amd64/linux/linux.h>
+#include <amd64/linux/linux_proto.h>
+#include <compat/linux/linux_emul.h>
+#include <compat/linux/linux_futex.h>
+#include <compat/linux/linux_ioctl.h>
+#include <compat/linux/linux_mib.h>
+#include <compat/linux/linux_misc.h>
+#include <compat/linux/linux_signal.h>
+#include <compat/linux/linux_sysproto.h>
+#include <compat/linux/linux_util.h>
+#include <compat/linux/linux_vdso.h>
+
+MODULE_VERSION(linux64, 1);
+
+#if BYTE_ORDER == LITTLE_ENDIAN
+#define SHELLMAGIC 0x2123 /* #! */
+#else
+#define SHELLMAGIC 0x2321
+#endif
+
+#if defined(DEBUG)
+SYSCTL_PROC(_compat_linux, OID_AUTO, debug,
+ CTLTYPE_STRING | CTLFLAG_RW,
+ 0, 0, linux_sysctl_debug, "A",
+ "Linux 64 debugging control");
+#endif
+
+/*
+ * Allow the this functions to use the ldebug() facility
+ * even though they are not syscalls themselves. Map them
+ * to syscall 0. This is slightly less bogus than using
+ * ldebug(sigreturn).
+ */
+#define LINUX_SYS_linux_rt_sendsig 0
+
+const char *linux_kplatform;
+static int linux_szsigcode;
+static vm_object_t linux_shared_page_obj;
+static char *linux_shared_page_mapping;
+extern char _binary_linux_locore_o_start;
+extern char _binary_linux_locore_o_end;
+
+extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL];
+
+SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler);
+
+static register_t * linux_copyout_strings(struct image_params *imgp);
+static int elf_linux_fixup(register_t **stack_base,
+ struct image_params *iparams);
+static boolean_t linux_trans_osrel(const Elf_Note *note, int32_t *osrel);
+static void linux_vdso_install(void *param);
+static void linux_vdso_deinstall(void *param);
+static void linux_set_syscall_retval(struct thread *td, int error);
+static int linux_fetch_syscall_args(struct thread *td, struct syscall_args *sa);
+static void linux_exec_setregs(struct thread *td, struct image_params *imgp,
+ u_long stack);
+
+/*
+ * Linux syscalls return negative errno's, we do positive and map them
+ * Reference:
+ * FreeBSD: src/sys/sys/errno.h
+ * Linux: linux-2.6.17.8/include/asm-generic/errno-base.h
+ * linux-2.6.17.8/include/asm-generic/errno.h
+ */
+static int bsd_to_linux_errno[ELAST + 1] = {
+ -0, -1, -2, -3, -4, -5, -6, -7, -8, -9,
+ -10, -35, -12, -13, -14, -15, -16, -17, -18, -19,
+ -20, -21, -22, -23, -24, -25, -26, -27, -28, -29,
+ -30, -31, -32, -33, -34, -11,-115,-114, -88, -89,
+ -90, -91, -92, -93, -94, -95, -96, -97, -98, -99,
+ -100,-101,-102,-103,-104,-105,-106,-107,-108,-109,
+ -110,-111, -40, -36,-112,-113, -39, -11, -87,-122,
+ -116, -66, -6, -6, -6, -6, -6, -37, -38, -9,
+ -6, -6, -43, -42, -75,-125, -84, -95, -16, -74,
+ -72, -67, -71
+};
+
+#define LINUX_T_UNKNOWN 255
+static int _bsd_to_linux_trapcode[] = {
+ LINUX_T_UNKNOWN, /* 0 */
+ 6, /* 1 T_PRIVINFLT */
+ LINUX_T_UNKNOWN, /* 2 */
+ 3, /* 3 T_BPTFLT */
+ LINUX_T_UNKNOWN, /* 4 */
+ LINUX_T_UNKNOWN, /* 5 */
+ 16, /* 6 T_ARITHTRAP */
+ 254, /* 7 T_ASTFLT */
+ LINUX_T_UNKNOWN, /* 8 */
+ 13, /* 9 T_PROTFLT */
+ 1, /* 10 T_TRCTRAP */
+ LINUX_T_UNKNOWN, /* 11 */
+ 14, /* 12 T_PAGEFLT */
+ LINUX_T_UNKNOWN, /* 13 */
+ 17, /* 14 T_ALIGNFLT */
+ LINUX_T_UNKNOWN, /* 15 */
+ LINUX_T_UNKNOWN, /* 16 */
+ LINUX_T_UNKNOWN, /* 17 */
+ 0, /* 18 T_DIVIDE */
+ 2, /* 19 T_NMI */
+ 4, /* 20 T_OFLOW */
+ 5, /* 21 T_BOUND */
+ 7, /* 22 T_DNA */
+ 8, /* 23 T_DOUBLEFLT */
+ 9, /* 24 T_FPOPFLT */
+ 10, /* 25 T_TSSFLT */
+ 11, /* 26 T_SEGNPFLT */
+ 12, /* 27 T_STKFLT */
+ 18, /* 28 T_MCHK */
+ 19, /* 29 T_XMMFLT */
+ 15 /* 30 T_RESERVED */
+};
+#define bsd_to_linux_trapcode(code) \
+ ((code)<sizeof(_bsd_to_linux_trapcode)/sizeof(*_bsd_to_linux_trapcode)? \
+ _bsd_to_linux_trapcode[(code)]: \
+ LINUX_T_UNKNOWN)
+
+LINUX_VDSO_SYM_INTPTR(linux_rt_sigcode);
+LINUX_VDSO_SYM_CHAR(linux_platform);
+
+/*
+ * If FreeBSD & Linux have a difference of opinion about what a trap
+ * means, deal with it here.
+ *
+ * MPSAFE
+ */
+static int
+translate_traps(int signal, int trap_code)
+{
+
+ if (signal != SIGBUS)
+ return signal;
+ switch (trap_code) {
+ case T_PROTFLT:
+ case T_TSSFLT:
+ case T_DOUBLEFLT:
+ case T_PAGEFLT:
+ return SIGSEGV;
+ default:
+ return signal;
+ }
+}
+
+static int
+linux_fetch_syscall_args(struct thread *td, struct syscall_args *sa)
+{
+ struct proc *p;
+ struct trapframe *frame;
+
+ p = td->td_proc;
+ frame = td->td_frame;
+
+ sa->args[0] = frame->tf_rdi;
+ sa->args[1] = frame->tf_rsi;
+ sa->args[2] = frame->tf_rdx;
+ sa->args[3] = frame->tf_rcx;
+ sa->args[4] = frame->tf_r8;
+ sa->args[5] = frame->tf_r9;
+ sa->code = frame->tf_rax;
+
+ if (sa->code >= p->p_sysent->sv_size)
+ /* nosys */
+ sa->callp = &p->p_sysent->sv_table[LINUX_SYS_MAXSYSCALL];
+ else
+ sa->callp = &p->p_sysent->sv_table[sa->code];
+ sa->narg = sa->callp->sy_narg;
+
+ td->td_retval[0] = 0;
+ return (0);
+}
+
+static void
+linux_set_syscall_retval(struct thread *td, int error)
+{
+ struct trapframe *frame = td->td_frame;
+
+ /*
+ * On Linux only %rcx and %r11 values are not preserved across
+ * the syscall.
+ * So, do not clobber %rdx and %r10
+ */
+ td->td_retval[1] = frame->tf_rdx;
+ frame->tf_r10 = frame->tf_rcx;
+
+ cpu_set_syscall_retval(td, error);
+
+ /* Restore all registers. */
+ set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
+}
+
+static int
+elf_linux_fixup(register_t **stack_base, struct image_params *imgp)
+{
+ Elf_Auxargs *args;
+ Elf_Addr *base;
+ Elf_Addr *pos;
+ struct ps_strings *arginfo;
+ struct proc *p;
+
+ p = imgp->proc;
+ arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings;
+
+ KASSERT(curthread->td_proc == imgp->proc,
+ ("unsafe elf_linux_fixup(), should be curproc"));
+ base = (Elf64_Addr *)*stack_base;
+ args = (Elf64_Auxargs *)imgp->auxargs;
+ pos = base + (imgp->args->argc + imgp->args->envc + 2);
+
+ AUXARGS_ENTRY(pos, LINUX_AT_SYSINFO_EHDR,
+ imgp->proc->p_sysent->sv_shared_page_base);
+ AUXARGS_ENTRY(pos, LINUX_AT_HWCAP, cpu_feature);
+ AUXARGS_ENTRY(pos, LINUX_AT_CLKTCK, stclohz);
+ AUXARGS_ENTRY(pos, AT_PHDR, args->phdr);
+ AUXARGS_ENTRY(pos, AT_PHENT, args->phent);
+ AUXARGS_ENTRY(pos, AT_PHNUM, args->phnum);
+ AUXARGS_ENTRY(pos, AT_PAGESZ, args->pagesz);
+ AUXARGS_ENTRY(pos, AT_BASE, args->base);
+ AUXARGS_ENTRY(pos, AT_FLAGS, args->flags);
+ AUXARGS_ENTRY(pos, AT_ENTRY, args->entry);
+ AUXARGS_ENTRY(pos, AT_UID, imgp->proc->p_ucred->cr_ruid);
+ AUXARGS_ENTRY(pos, AT_EUID, imgp->proc->p_ucred->cr_svuid);
+ AUXARGS_ENTRY(pos, AT_GID, imgp->proc->p_ucred->cr_rgid);
+ AUXARGS_ENTRY(pos, AT_EGID, imgp->proc->p_ucred->cr_svgid);
+ AUXARGS_ENTRY(pos, LINUX_AT_SECURE, 0);
+ AUXARGS_ENTRY(pos, LINUX_AT_PLATFORM, PTROUT(linux_platform));
+ AUXARGS_ENTRY(pos, LINUX_AT_RANDOM, imgp->canary);
+ if (imgp->execpathp != 0)
+ AUXARGS_ENTRY(pos, LINUX_AT_EXECFN, imgp->execpathp);
+ if (args->execfd != -1)
+ AUXARGS_ENTRY(pos, AT_EXECFD, args->execfd);
+ AUXARGS_ENTRY(pos, AT_NULL, 0);
+ free(imgp->auxargs, M_TEMP);
+ imgp->auxargs = NULL;
+
+ base--;
+ suword(base, (uint64_t)imgp->args->argc);
+
+ *stack_base = (register_t *)base;
+ return (0);
+}
+
+/*
+ * Copy strings out to the new process address space, constructing new arg
+ * and env vector tables. Return a pointer to the base so that it can be used
+ * as the initial stack pointer.
+ */
+static register_t *
+linux_copyout_strings(struct image_params *imgp)
+{
+ int argc, envc;
+ char **vectp;
+ char *stringp, *destp;
+ register_t *stack_base;
+ struct ps_strings *arginfo;
+ char canary[LINUX_AT_RANDOM_LEN];
+ size_t execpath_len;
+ struct proc *p;
+
+ /*
+ * Calculate string base and vector table pointers.
+ */
+ if (imgp->execpath != NULL && imgp->auxargs != NULL)
+ execpath_len = strlen(imgp->execpath) + 1;
+ else
+ execpath_len = 0;
+
+ p = imgp->proc;
+ arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings;
+ destp = (caddr_t)arginfo - SPARE_USRSPACE -
+ roundup(sizeof(canary), sizeof(char *)) -
+ roundup(execpath_len, sizeof(char *)) -
+ roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *));
+
+ if (execpath_len != 0) {
+ imgp->execpathp = (uintptr_t)arginfo - execpath_len;
+ copyout(imgp->execpath, (void *)imgp->execpathp, execpath_len);
+ }
+
+ /*
+ * Prepare the canary for SSP.
+ */
+ arc4rand(canary, sizeof(canary), 0);
+ imgp->canary = (uintptr_t)arginfo -
+ roundup(execpath_len, sizeof(char *)) -
+ roundup(sizeof(canary), sizeof(char *));
+ copyout(canary, (void *)imgp->canary, sizeof(canary));
+
+ /*
+ * If we have a valid auxargs ptr, prepare some room
+ * on the stack.
+ */
+ if (imgp->auxargs) {
+ /*
+ * 'AT_COUNT*2' is size for the ELF Auxargs data. This is for
+ * lower compatibility.
+ */
+ imgp->auxarg_size = (imgp->auxarg_size) ? imgp->auxarg_size :
+ (LINUX_AT_COUNT * 2);
+
+ /*
+ * The '+ 2' is for the null pointers at the end of each of
+ * the arg and env vector sets,and imgp->auxarg_size is room
+ * for argument of Runtime loader.
+ */
+ vectp = (char **)(destp - (imgp->args->argc +
+ imgp->args->envc + 2 + imgp->auxarg_size) * sizeof(char *));
+
+ } else {
+ /*
+ * The '+ 2' is for the null pointers at the end of each of
+ * the arg and env vector sets
+ */
+ vectp = (char **)(destp - (imgp->args->argc +
+ imgp->args->envc + 2) * sizeof(char *));
+ }
+
+ /*
+ * vectp also becomes our initial stack base
+ */
+ stack_base = (register_t *)vectp;
+
+ stringp = imgp->args->begin_argv;
+ argc = imgp->args->argc;
+ envc = imgp->args->envc;
+
+ /*
+ * Copy out strings - arguments and environment.
+ */
+ copyout(stringp, destp, ARG_MAX - imgp->args->stringspace);
+
+ /*
+ * Fill in "ps_strings" struct for ps, w, etc.
+ */
+ suword(&arginfo->ps_argvstr, (long)(intptr_t)vectp);
+ suword(&arginfo->ps_nargvstr, argc);
+
+ /*
+ * Fill in argument portion of vector table.
+ */
+ for (; argc > 0; --argc) {
+ suword(vectp++, (long)(intptr_t)destp);
+ while (*stringp++ != 0)
+ destp++;
+ destp++;
+ }
+
+ /* a null vector table pointer separates the argp's from the envp's */
+ suword(vectp++, 0);
+
+ suword(&arginfo->ps_envstr, (long)(intptr_t)vectp);
+ suword(&arginfo->ps_nenvstr, envc);
+
+ /*
+ * Fill in environment portion of vector table.
+ */
+ for (; envc > 0; --envc) {
+ suword(vectp++, (long)(intptr_t)destp);
+ while (*stringp++ != 0)
+ destp++;
+ destp++;
+ }
+
+ /* end of vector table is a null pointer */
+ suword(vectp, 0);
+ return (stack_base);
+}
+
+/*
+ * Reset registers to default values on exec.
+ */
+static void
+linux_exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
+{
+ struct trapframe *regs = td->td_frame;
+ struct pcb *pcb = td->td_pcb;
+
+ mtx_lock(&dt_lock);
+ if (td->td_proc->p_md.md_ldt != NULL)
+ user_ldt_free(td);
+ else
+ mtx_unlock(&dt_lock);
+
+ pcb->pcb_fsbase = 0;
+ pcb->pcb_gsbase = 0;
+ clear_pcb_flags(pcb, PCB_32BIT);
+ pcb->pcb_initial_fpucw = __LINUX_NPXCW__;
+ set_pcb_flags(pcb, PCB_FULL_IRET);
+
+ bzero((char *)regs, sizeof(struct trapframe));
+ regs->tf_rip = imgp->entry_addr;
+ regs->tf_rsp = stack;
+ regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T);
+ regs->tf_ss = _udatasel;
+ regs->tf_cs = _ucodesel;
+ regs->tf_ds = _udatasel;
+ regs->tf_es = _udatasel;
+ regs->tf_fs = _ufssel;
+ regs->tf_gs = _ugssel;
+ regs->tf_flags = TF_HASSEGS;
+
+ /*
+ * Reset the hardware debug registers if they were in use.
+ * They won't have any meaning for the newly exec'd process.
+ */
+ if (pcb->pcb_flags & PCB_DBREGS) {
+ pcb->pcb_dr0 = 0;
+ pcb->pcb_dr1 = 0;
+ pcb->pcb_dr2 = 0;
+ pcb->pcb_dr3 = 0;
+ pcb->pcb_dr6 = 0;
+ pcb->pcb_dr7 = 0;
+ if (pcb == curpcb) {
+ /*
+ * Clear the debug registers on the running
+ * CPU, otherwise they will end up affecting
+ * the next process we switch to.
+ */
+ reset_dbregs();
+ }
+ clear_pcb_flags(pcb, PCB_DBREGS);
+ }
+
+ /*
+ * Drop the FP state if we hold it, so that the process gets a
+ * clean FP state if it uses the FPU again.
+ */
+ fpstate_drop(td);
+}
+
+/*
+ * Copied from amd64/amd64/machdep.c
+ *
+ * XXX fpu state need? don't think so
+ */
+int
+linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args)
+{
+ struct proc *p;
+ struct l_ucontext uc;
+ struct l_sigcontext *context;
+ struct trapframe *regs;
+ unsigned long rflags;
+ int error;
+ ksiginfo_t ksi;
+
+ regs = td->td_frame;
+ error = copyin((void *)regs->tf_rbx, &uc, sizeof(uc));
+ if (error != 0)
+ return (error);
+
+ p = td->td_proc;
+ context = &uc.uc_mcontext;
+ rflags = context->sc_rflags;
+
+ /*
+ * Don't allow users to change privileged or reserved flags.
+ */
+ /*
+ * XXX do allow users to change the privileged flag PSL_RF.
+ * The cpu sets PSL_RF in tf_rflags for faults. Debuggers
+ * should sometimes set it there too. tf_rflags is kept in
+ * the signal context during signal handling and there is no
+ * other place to remember it, so the PSL_RF bit may be
+ * corrupted by the signal handler without us knowing.
+ * Corruption of the PSL_RF bit at worst causes one more or
+ * one less debugger trap, so allowing it is fairly harmless.
+ */
+
+#define RFLAG_SECURE(ef, oef) ((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0)
+ if (!RFLAG_SECURE(rflags & ~PSL_RF, regs->tf_rflags & ~PSL_RF)) {
+ printf("linux_rt_sigreturn: rflags = 0x%lx\n", rflags);
+ return (EINVAL);
+ }
+
+ /*
+ * Don't allow users to load a valid privileged %cs. Let the
+ * hardware check for invalid selectors, excess privilege in
+ * other selectors, invalid %eip's and invalid %esp's.
+ */
+#define CS_SECURE(cs) (ISPL(cs) == SEL_UPL)
+ if (!CS_SECURE(context->sc_cs)) {
+ printf("linux_rt_sigreturn: cs = 0x%x\n", context->sc_cs);
+ ksiginfo_init_trap(&ksi);
+ ksi.ksi_signo = SIGBUS;
+ ksi.ksi_code = BUS_OBJERR;
+ ksi.ksi_trapno = T_PROTFLT;
+ ksi.ksi_addr = (void *)regs->tf_rip;
+ trapsignal(td, &ksi);
+ return (EINVAL);
+ }
+
+ PROC_LOCK(p);
+ linux_to_bsd_sigset(&uc.uc_sigmask, &td->td_sigmask);
+ SIG_CANTMASK(td->td_sigmask);
+ signotify(td);
+ PROC_UNLOCK(p);
+
+ regs->tf_rdi = context->sc_rdi;
+ regs->tf_rsi = context->sc_rsi;
+ regs->tf_rdx = context->sc_rdx;
+ regs->tf_rbp = context->sc_rbp;
+ regs->tf_rbx = context->sc_rbx;
+ regs->tf_rcx = context->sc_rcx;
+ regs->tf_rax = context->sc_rax;
+ regs->tf_rip = context->sc_rip;
+ regs->tf_rsp = context->sc_rsp;
+ regs->tf_r8 = context->sc_r8;
+ regs->tf_r9 = context->sc_r9;
+ regs->tf_r10 = context->sc_r10;
+ regs->tf_r11 = context->sc_r11;
+ regs->tf_r12 = context->sc_r12;
+ regs->tf_r13 = context->sc_r13;
+ regs->tf_r14 = context->sc_r14;
+ regs->tf_r15 = context->sc_r15;
+ regs->tf_cs = context->sc_cs;
+ regs->tf_err = context->sc_err;
+ regs->tf_rflags = rflags;
+
+ set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
+ return (EJUSTRETURN);
+}
+
+/*
+ * copied from amd64/amd64/machdep.c
+ *
+ * Send an interrupt to process.
+ */
+static void
+linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
+{
+ struct l_rt_sigframe sf, *sfp;
+ struct proc *p;
+ struct thread *td;
+ struct sigacts *psp;
+ caddr_t sp;
+ struct trapframe *regs;
+ int sig, code;
+ int oonstack;
+
+ td = curthread;
+ p = td->td_proc;
+ PROC_LOCK_ASSERT(p, MA_OWNED);
+ sig = ksi->ksi_signo;
+ psp = p->p_sigacts;
+ code = ksi->ksi_code;
+ mtx_assert(&psp->ps_mtx, MA_OWNED);
+ regs = td->td_frame;
+ oonstack = sigonstack(regs->tf_rsp);
+
+ LINUX_CTR4(rt_sendsig, "%p, %d, %p, %u",
+ catcher, sig, mask, code);
+
+ /* Allocate space for the signal handler context. */
+ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack &&
+ SIGISMEMBER(psp->ps_sigonstack, sig)) {
+ sp = td->td_sigstk.ss_sp + td->td_sigstk.ss_size -
+ sizeof(struct l_rt_sigframe);
+ } else
+ sp = (caddr_t)regs->tf_rsp - sizeof(struct l_rt_sigframe) - 128;
+ /* Align to 16 bytes. */
+ sfp = (struct l_rt_sigframe *)((unsigned long)sp & ~0xFul);
+ mtx_unlock(&psp->ps_mtx);
+
+ /* Translate the signal. */
+ sig = bsd_to_linux_signal(sig);
+
+ /* Save user context. */
+ bzero(&sf, sizeof(sf));
+ bsd_to_linux_sigset(mask, &sf.sf_sc.uc_sigmask);
+ bsd_to_linux_sigset(mask, &sf.sf_sc.uc_mcontext.sc_mask);
+
+ sf.sf_sc.uc_stack.ss_sp = PTROUT(td->td_sigstk.ss_sp);
+ sf.sf_sc.uc_stack.ss_size = td->td_sigstk.ss_size;
+ sf.sf_sc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK)
+ ? ((oonstack) ? LINUX_SS_ONSTACK : 0) : LINUX_SS_DISABLE;
+ PROC_UNLOCK(p);
+
+ sf.sf_sc.uc_mcontext.sc_rdi = regs->tf_rdi;
+ sf.sf_sc.uc_mcontext.sc_rsi = regs->tf_rsi;
+ sf.sf_sc.uc_mcontext.sc_rdx = regs->tf_rdx;
+ sf.sf_sc.uc_mcontext.sc_rbp = regs->tf_rbp;
+ sf.sf_sc.uc_mcontext.sc_rbx = regs->tf_rbx;
+ sf.sf_sc.uc_mcontext.sc_rcx = regs->tf_rcx;
+ sf.sf_sc.uc_mcontext.sc_rax = regs->tf_rax;
+ sf.sf_sc.uc_mcontext.sc_rip = regs->tf_rip;
+ sf.sf_sc.uc_mcontext.sc_rsp = regs->tf_rsp;
+ sf.sf_sc.uc_mcontext.sc_r8 = regs->tf_r8;
+ sf.sf_sc.uc_mcontext.sc_r9 = regs->tf_r9;
+ sf.sf_sc.uc_mcontext.sc_r10 = regs->tf_r10;
+ sf.sf_sc.uc_mcontext.sc_r11 = regs->tf_r11;
+ sf.sf_sc.uc_mcontext.sc_r12 = regs->tf_r12;
+ sf.sf_sc.uc_mcontext.sc_r13 = regs->tf_r13;
+ sf.sf_sc.uc_mcontext.sc_r14 = regs->tf_r14;
+ sf.sf_sc.uc_mcontext.sc_r15 = regs->tf_r15;
+ sf.sf_sc.uc_mcontext.sc_cs = regs->tf_cs;
+ sf.sf_sc.uc_mcontext.sc_rflags = regs->tf_rflags;
+ sf.sf_sc.uc_mcontext.sc_err = regs->tf_err;
+ sf.sf_sc.uc_mcontext.sc_trapno = bsd_to_linux_trapcode(code);
+ sf.sf_sc.uc_mcontext.sc_cr2 = (register_t)ksi->ksi_addr;
+
+ /* Build the argument list for the signal handler. */
+ regs->tf_rdi = sig; /* arg 1 in %rdi */
+ regs->tf_rax = 0;
+ regs->tf_rsi = (register_t)&sfp->sf_si; /* arg 2 in %rsi */
+ regs->tf_rdx = (register_t)&sfp->sf_sc; /* arg 3 in %rdx */
+
+ sf.sf_handler = catcher;
+ /* Fill in POSIX parts */
+ ksiginfo_to_lsiginfo(ksi, &sf.sf_si, sig);
+
+ /*
+ * Copy the sigframe out to the user's stack.
+ */
+ if (copyout(&sf, sfp, sizeof(*sfp)) != 0) {
+#ifdef DEBUG
+ printf("process %ld has trashed its stack\n", (long)p->p_pid);
+#endif
+ PROC_LOCK(p);
+ sigexit(td, SIGILL);
+ }
+
+ regs->tf_rsp = (long)sfp;
+ regs->tf_rip = linux_rt_sigcode;
+ regs->tf_rflags &= ~(PSL_T | PSL_D);
+ regs->tf_cs = _ucodesel;
+ set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
+ PROC_LOCK(p);
+ mtx_lock(&psp->ps_mtx);
+}
+
+/*
+ * If a linux binary is exec'ing something, try this image activator
+ * first. We override standard shell script execution in order to
+ * be able to modify the interpreter path. We only do this if a linux
+ * binary is doing the exec, so we do not create an EXEC module for it.
+ */
+static int exec_linux_imgact_try(struct image_params *iparams);
+
+static int
+exec_linux_imgact_try(struct image_params *imgp)
+{
+ const char *head = (const char *)imgp->image_header;
+ char *rpath;
+ int error = -1, len;
+
+ /*
+ * The interpreter for shell scripts run from a linux binary needs
+ * to be located in /compat/linux if possible in order to recursively
+ * maintain linux path emulation.
+ */
+ if (((const short *)head)[0] == SHELLMAGIC) {
+ /*
+ * Run our normal shell image activator. If it succeeds
+ * attempt to use the alternate path for the interpreter.
+ * If an alternate path is found, use our stringspace
+ * to store it.
+ */
+ if ((error = exec_shell_imgact(imgp)) == 0) {
+ linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc),
+ imgp->interpreter_name, UIO_SYSSPACE,
+ &rpath, 0, AT_FDCWD);
+ if (rpath != NULL) {
+ len = strlen(rpath) + 1;
+
+ if (len <= MAXSHELLCMDLEN)
+ memcpy(imgp->interpreter_name,
+ rpath, len);
+ free(rpath, M_TEMP);
+ }
+ }
+ }
+ return(error);
+}
+
+struct sysentvec elf_linux_sysvec = {
+ .sv_size = LINUX_SYS_MAXSYSCALL,
+ .sv_table = linux_sysent,
+ .sv_mask = 0,
+ .sv_sigsize = 0,
+ .sv_sigtbl = NULL,
+ .sv_errsize = ELAST + 1,
+ .sv_errtbl = bsd_to_linux_errno,
+ .sv_transtrap = translate_traps,
+ .sv_fixup = elf_linux_fixup,
+ .sv_sendsig = linux_rt_sendsig,
+ .sv_sigcode = &_binary_linux_locore_o_start,
+ .sv_szsigcode = &linux_szsigcode,
+ .sv_prepsyscall = NULL,
+ .sv_name = "Linux ELF64",
+ .sv_coredump = elf64_coredump,
+ .sv_imgact_try = exec_linux_imgact_try,
+ .sv_minsigstksz = LINUX_MINSIGSTKSZ,
+ .sv_pagesize = PAGE_SIZE,
+ .sv_minuser = VM_MIN_ADDRESS,
+ .sv_maxuser = VM_MAXUSER_ADDRESS,
+ .sv_usrstack = USRSTACK,
+ .sv_psstrings = PS_STRINGS,
+ .sv_stackprot = VM_PROT_ALL,
+ .sv_copyout_strings = linux_copyout_strings,
+ .sv_setregs = linux_exec_setregs,
+ .sv_fixlimit = NULL,
+ .sv_maxssiz = NULL,
+ .sv_flags = SV_ABI_LINUX | SV_LP64 | SV_SHP,
+ .sv_set_syscall_retval = linux_set_syscall_retval,
+ .sv_fetch_syscall_args = linux_fetch_syscall_args,
+ .sv_syscallnames = NULL,
+ .sv_shared_page_base = SHAREDPAGE,
+ .sv_shared_page_len = PAGE_SIZE,
+ .sv_schedtail = linux_schedtail,
+ .sv_thread_detach = linux_thread_detach
+};
+
+static void
+linux_vdso_install(void *param)
+{
+
+ linux_szsigcode = (&_binary_linux_locore_o_end -
+ &_binary_linux_locore_o_start);
+
+ if (linux_szsigcode > elf_linux_sysvec.sv_shared_page_len)
+ panic("Linux invalid vdso size\n");
+
+ __elfN(linux_vdso_fixup)(&elf_linux_sysvec);
+
+ linux_shared_page_obj = __elfN(linux_shared_page_init)
+ (&linux_shared_page_mapping);
+
+ __elfN(linux_vdso_reloc)(&elf_linux_sysvec, SHAREDPAGE);
+
+ bcopy(elf_linux_sysvec.sv_sigcode, linux_shared_page_mapping,
+ linux_szsigcode);
+ elf_linux_sysvec.sv_shared_page_obj = linux_shared_page_obj;
+
+ linux_kplatform = linux_shared_page_mapping +
+ (linux_platform - (caddr_t)SHAREDPAGE);
+}
+SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_ANY,
+ (sysinit_cfunc_t)linux_vdso_install, NULL);
+
+static void
+linux_vdso_deinstall(void *param)
+{
+
+ __elfN(linux_shared_page_fini)(linux_shared_page_obj);
+};
+SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER_FIRST,
+ (sysinit_cfunc_t)linux_vdso_deinstall, NULL);
+
+static char GNULINUX_ABI_VENDOR[] = "GNU";
+static int GNULINUX_ABI_DESC = 0;
+
+static boolean_t
+linux_trans_osrel(const Elf_Note *note, int32_t *osrel)
+{
+ const Elf32_Word *desc;
+ uintptr_t p;
+
+ p = (uintptr_t)(note + 1);
+ p += roundup2(note->n_namesz, sizeof(Elf32_Addr));
+
+ desc = (const Elf32_Word *)p;
+ if (desc[0] != GNULINUX_ABI_DESC)
+ return (FALSE);
+
+ /*
+ * For linux we encode osrel as follows (see linux_mib.c):
+ * VVVMMMIII (version, major, minor), see linux_mib.c.
+ */
+ *osrel = desc[1] * 1000000 + desc[2] * 1000 + desc[3];
+
+ return (TRUE);
+}
+
+static Elf_Brandnote linux64_brandnote = {
+ .hdr.n_namesz = sizeof(GNULINUX_ABI_VENDOR),
+ .hdr.n_descsz = 16,
+ .hdr.n_type = 1,
+ .vendor = GNULINUX_ABI_VENDOR,
+ .flags = BN_TRANSLATE_OSREL,
+ .trans_osrel = linux_trans_osrel
+};
+
+static Elf64_Brandinfo linux_glibc2brand = {
+ .brand = ELFOSABI_LINUX,
+ .machine = EM_X86_64,
+ .compat_3_brand = "Linux",
+ .emul_path = "/compat/linux",
+ .interp_path = "/lib64/ld-linux-x86-64.so.2",
+ .sysvec = &elf_linux_sysvec,
+ .interp_newpath = NULL,
+ .brand_note = &linux64_brandnote,
+ .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE
+};
+
+static Elf64_Brandinfo linux_glibc2brandshort = {
+ .brand = ELFOSABI_LINUX,
+ .machine = EM_X86_64,
+ .compat_3_brand = "Linux",
+ .emul_path = "/compat/linux",
+ .interp_path = "/lib64/ld-linux.so.2",
+ .sysvec = &elf_linux_sysvec,
+ .interp_newpath = NULL,
+ .brand_note = &linux64_brandnote,
+ .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE
+};
+
+Elf64_Brandinfo *linux_brandlist[] = {
+ &linux_glibc2brand,
+ &linux_glibc2brandshort,
+ NULL
+};
+
+static int
+linux64_elf_modevent(module_t mod, int type, void *data)
+{
+ Elf64_Brandinfo **brandinfo;
+ int error;
+ struct linux_ioctl_handler **lihp;
+
+ error = 0;
+
+ switch(type) {
+ case MOD_LOAD:
+ for (brandinfo = &linux_brandlist[0]; *brandinfo != NULL;
+ ++brandinfo)
+ if (elf64_insert_brand_entry(*brandinfo) < 0)
+ error = EINVAL;
+ if (error == 0) {
+ SET_FOREACH(lihp, linux_ioctl_handler_set)
+ linux_ioctl_register_handler(*lihp);
+ LIST_INIT(&futex_list);
+ mtx_init(&futex_mtx, "ftllk64", NULL, MTX_DEF);
+ stclohz = (stathz ? stathz : hz);
+ if (bootverbose)
+ printf("Linux x86-64 ELF exec handler installed\n");
+ } else
+ printf("cannot insert Linux x86-64 ELF brand handler\n");
+ break;
+ case MOD_UNLOAD:
+ for (brandinfo = &linux_brandlist[0]; *brandinfo != NULL;
+ ++brandinfo)
+ if (elf64_brand_inuse(*brandinfo))
+ error = EBUSY;
+ if (error == 0) {
+ for (brandinfo = &linux_brandlist[0];
+ *brandinfo != NULL; ++brandinfo)
+ if (elf64_remove_brand_entry(*brandinfo) < 0)
+ error = EINVAL;
+ }
+ if (error == 0) {
+ SET_FOREACH(lihp, linux_ioctl_handler_set)
+ linux_ioctl_unregister_handler(*lihp);
+ mtx_destroy(&futex_mtx);
+ if (bootverbose)
+ printf("Linux ELF exec handler removed\n");
+ } else
+ printf("Could not deinstall ELF interpreter entry\n");
+ break;
+ default:
+ return (EOPNOTSUPP);
+ }
+ return (error);
+}
+
+static moduledata_t linux64_elf_mod = {
+ "linux64elf",
+ linux64_elf_modevent,
+ 0
+};
+
+DECLARE_MODULE_TIED(linux64elf, linux64_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY);
+MODULE_DEPEND(linux64elf, linux_common, 1, 1, 1);
diff --git a/sys/amd64/linux/linux_vdso.lds.s b/sys/amd64/linux/linux_vdso.lds.s
new file mode 100644
index 0000000..94f0266
--- /dev/null
+++ b/sys/amd64/linux/linux_vdso.lds.s
@@ -0,0 +1,69 @@
+/*
+ * Linker script for 64-bit vDSO.
+ * Copied from Linux kernel arch/x86/vdso/vdso-layout.lds.S
+ *
+ * $FreeBSD$
+ */
+
+SECTIONS
+{
+ . = . + SIZEOF_HEADERS;
+
+ .hash : { *(.hash) } :text
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+
+ .note : { *(.note.*) } :text :note
+
+ .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
+ .eh_frame : { KEEP (*(.eh_frame)) } :text
+
+ .dynamic : { *(.dynamic) } :text :dynamic
+
+ .rodata : { *(.rodata*) } :text
+ .data : {
+ *(.data*)
+ *(.sdata*)
+ *(.got.plt) *(.got)
+ *(.gnu.linkonce.d.*)
+ *(.bss*)
+ *(.dynbss*)
+ *(.gnu.linkonce.b.*)
+ }
+
+ .altinstructions : { *(.altinstructions) }
+ .altinstr_replacement : { *(.altinstr_replacement) }
+
+ . = ALIGN(0x100);
+ .text : { *(.test .text*) } :text =0x90909090
+}
+
+PHDRS
+{
+ text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
+ dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
+ note PT_NOTE FLAGS(4); /* PF_R */
+ eh_frame_hdr PT_GNU_EH_FRAME;
+}
+
+VERSION
+{
+ LINUX_2.6 {
+ global:
+ time;
+ __vdso_time;
+ gettimeofday;
+ __vdso_gettimeofday;
+ getcpu;
+ __vdso_getcpu;
+ clock_gettime;
+ __vdso_clock_gettime;
+ linux_rt_sigcode;
+ linux_platform;
+ local: *;
+ };
+}
diff --git a/sys/amd64/linux/syscalls.conf b/sys/amd64/linux/syscalls.conf
new file mode 100644
index 0000000..29f3792
--- /dev/null
+++ b/sys/amd64/linux/syscalls.conf
@@ -0,0 +1,11 @@
+# $FreeBSD$
+sysnames="linux_syscalls.c"
+sysproto="linux_proto.h"
+sysproto_h=_LINUX_SYSPROTO_H_
+syshdr="linux_syscall.h"
+syssw="linux_sysent.c"
+sysmk="/dev/null"
+syscallprefix="LINUX_SYS_"
+switchname="linux_sysent"
+namesname="linux_syscallnames"
+systrace="linux_systrace_args.c"
diff --git a/sys/amd64/linux/syscalls.master b/sys/amd64/linux/syscalls.master
new file mode 100644
index 0000000..d840f88
--- /dev/null
+++ b/sys/amd64/linux/syscalls.master
@@ -0,0 +1,515 @@
+ $FreeBSD$
+
+; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
+; System call name/number master file (or rather, slave, from LINUX).
+; Processed to create linux_sysent.c, linux_proto.h and linux_syscall.h.
+
+; Columns: number audit type nargs name alt{name,tag,rtyp}/comments
+; number system call number, must be in order
+; audit the audit event associated with the system call
+; A value of AUE_NULL means no auditing, but it also means that
+; there is no audit event for the call at this time. For the
+; case where the event exists, but we don't want auditing, the
+; event should be #defined to AUE_NULL in audit_kevents.h.
+; type one of STD, OBSOL, UNIMPL
+; name psuedo-prototype of syscall routine
+; If one of the following alts is different, then all appear:
+; altname name of system call if different
+; alttag name of args struct tag if different from [o]`name'"_args"
+; altrtyp return type if not int (bogus - syscalls always return int)
+; for UNIMPL/OBSOL, name continues with comments
+
+; types:
+; STD always included
+; OBSOL obsolete, not included in system, only specifies name
+; UNIMPL not implemented, placeholder only
+
+#include <sys/param.h>
+#include <sys/sysent.h>
+#include <sys/sysproto.h>
+#include <compat/linux/linux_sysproto.h>
+#include <amd64/linux/linux.h>
+#include <amd64/linux/linux_proto.h>
+
+; Isn't pretty, but there seems to be no other way to trap nosys
+#define nosys linux_nosys
+
+; #ifdef's, etc. may be included, and are copied to the output files.
+
+0 AUE_NULL NOPROTO { int read(int fd, char *buf, \
+ u_int nbyte); }
+1 AUE_NULL NOPROTO { int write(int fd, char *buf, \
+ u_int nbyte); }
+2 AUE_OPEN_RWTC STD { int linux_open(char *path, l_int flags, \
+ l_int mode); }
+3 AUE_CLOSE NOPROTO { int close(int fd); }
+4 AUE_STAT STD { int linux_newstat(char *path, \
+ struct l_newstat *buf); }
+5 AUE_FSTAT STD { int linux_newfstat(l_uint fd, \
+ struct l_newstat *buf); }
+6 AUE_LSTAT STD { int linux_newlstat(char *path, \
+ struct l_newstat *buf); }
+7 AUE_POLL NOPROTO { int poll(struct pollfd*, \
+ unsigned int nfds, int timeout); }
+8 AUE_LSEEK STD { int linux_lseek(l_uint fdes, l_off_t off, \
+ l_int whence); }
+9 AUE_MMAP STD { int linux_mmap2(l_ulong addr, l_ulong len, \
+ l_ulong prot, l_ulong flags, l_ulong fd, \
+ l_ulong pgoff); }
+10 AUE_MPROTECT STD { int linux_mprotect(caddr_t addr, int len, \
+ int prot); }
+11 AUE_MUNMAP NOPROTO { int munmap(caddr_t addr, int len); }
+12 AUE_NULL STD { int linux_brk(l_ulong dsend); }
+13 AUE_NULL STD { int linux_rt_sigaction(l_int sig, \
+ l_sigaction_t *act, l_sigaction_t *oact, \
+ l_size_t sigsetsize); }
+14 AUE_NULL STD { int linux_rt_sigprocmask(l_int how, \
+ l_sigset_t *mask, l_sigset_t *omask, \
+ l_size_t sigsetsize); }
+15 AUE_NULL STD { int linux_rt_sigreturn( \
+ struct l_ucontext *ucp); }
+16 AUE_IOCTL STD { int linux_ioctl(l_uint fd, l_uint cmd, \
+ uintptr_t arg); }
+17 AUE_PREAD STD { int linux_pread(l_uint fd, char *buf, \
+ l_size_t nbyte, l_loff_t offset); }
+18 AUE_PWRITE STD { int linux_pwrite(l_uint fd, char *buf, \
+ l_size_t nbyte, l_loff_t offset); }
+19 AUE_READV NOPROTO { int readv(int fd, struct iovec *iovp, \
+ u_int iovcnt); }
+20 AUE_WRITEV NOPROTO { int writev(int fd, struct iovec *iovp, \
+ u_int iovcnt); }
+21 AUE_ACCESS STD { int linux_access(char *path, l_int amode); }
+22 AUE_PIPE STD { int linux_pipe(l_ulong *pipefds); }
+23 AUE_SELECT STD { int linux_select(l_int nfds, \
+ l_fd_set *readfds, l_fd_set *writefds, \
+ l_fd_set *exceptfds, \
+ struct l_timeval *timeout); }
+24 AUE_NULL NOPROTO { int sched_yield(void); }
+25 AUE_NULL STD { int linux_mremap(l_ulong addr, \
+ l_ulong old_len, l_ulong new_len, \
+ l_ulong flags, l_ulong new_addr); }
+26 AUE_MSYNC STD { int linux_msync(l_ulong addr, \
+ l_size_t len, l_int fl); }
+27 AUE_MINCORE STD { int linux_mincore(l_ulong start, \
+ l_size_t len, u_char *vec); }
+28 AUE_MADVISE NOPROTO { int madvise(void *addr, size_t len, \
+ int behav); }
+29 AUE_NULL STD { int linux_shmget(l_key_t key, l_size_t size, \
+ l_int shmflg); }
+30 AUE_NULL STD { int linux_shmat(l_int shmid, char *shmaddr, \
+ l_int shmflg); }
+31 AUE_NULL STD { int linux_shmctl(l_int shmid, l_int cmd, \
+ struct l_shmid_ds *buf); }
+32 AUE_DUP NOPROTO { int dup(u_int fd); }
+33 AUE_DUP2 NOPROTO { int dup2(u_int from, u_int to); }
+34 AUE_NULL STD { int linux_pause(void); }
+35 AUE_NULL STD { int linux_nanosleep( \
+ const struct l_timespec *rqtp, \
+ struct l_timespec *rmtp); }
+36 AUE_GETITIMER STD { int linux_getitimer(l_int which, \
+ struct l_itimerval *itv); }
+37 AUE_NULL STD { int linux_alarm(l_uint secs); }
+38 AUE_SETITIMER STD { int linux_setitimer(l_int which, \
+ struct l_itimerval *itv, \
+ struct l_itimerval *oitv); }
+39 AUE_GETPID STD { int linux_getpid(void); }
+40 AUE_SENDFILE STD { int linux_sendfile(int out, int in, \
+ l_long *offset, l_size_t count); }
+41 AUE_SOCKET STD { int linux_socket(l_int domain, l_int type, \
+ l_int protocol); }
+42 AUE_CONNECT STD { int linux_connect(l_int s, l_uintptr_t name, \
+ l_int namelen); }
+43 AUE_ACCEPT STD { int linux_accept(l_int s, l_uintptr_t addr, \
+ l_uintptr_t namelen); }
+44 AUE_SENDTO STD { int linux_sendto(l_int s, l_uintptr_t msg, \
+ l_int len, l_int flags, l_uintptr_t to, \
+ l_int tolen); }
+45 AUE_RECVFROM STD { int linux_recvfrom(l_int s, l_uintptr_t buf, \
+ l_size_t len, l_int flags, l_uintptr_t from, \
+ l_uintptr_t fromlen); }
+46 AUE_SENDMSG STD { int linux_sendmsg(l_int s, l_uintptr_t msg, \
+ l_int flags); }
+47 AUE_RECVMSG STD { int linux_recvmsg(l_int s, l_uintptr_t msg, \
+ l_int flags); }
+48 AUE_NULL STD { int linux_shutdown(l_int s, l_int how); }
+49 AUE_BIND STD { int linux_bind(l_int s, l_uintptr_t name, \
+ l_int namelen); }
+50 AUE_LISTEN STD { int linux_listen(l_int s, l_int backlog); }
+51 AUE_GETSOCKNAME STD { int linux_getsockname(l_int s, \
+ l_uintptr_t addr, l_uintptr_t namelen); }
+52 AUE_GETPEERNAME STD { int linux_getpeername(l_int s, \
+ l_uintptr_t addr, l_uintptr_t namelen); }
+53 AUE_SOCKETPAIR STD { int linux_socketpair(l_int domain, \
+ l_int type, l_int protocol, l_uintptr_t rsv); }
+54 AUE_SETSOCKOPT STD { int linux_setsockopt(l_int s, l_int level, \
+ l_int optname, l_uintptr_t optval, \
+ l_int optlen); }
+55 AUE_GETSOCKOPT STD { int linux_getsockopt(l_int s, l_int level, \
+ l_int optname, l_uintptr_t optval, \
+ l_uintptr_t optlen); }
+56 AUE_RFORK STD { int linux_clone(l_int flags, void *stack, \
+ void *parent_tidptr, void * child_tidptr, void *tls ); }
+57 AUE_FORK STD { int linux_fork(void); }
+58 AUE_VFORK STD { int linux_vfork(void); }
+59 AUE_EXECVE STD { int linux_execve(char *path, char **argp, \
+ char **envp); }
+60 AUE_EXIT STD { void linux_exit(int rval); }
+61 AUE_WAIT4 STD { int linux_wait4(l_pid_t pid, \
+ l_int *status, l_int options, \
+ struct rusage *rusage); }
+62 AUE_KILL STD { int linux_kill(l_int pid, l_int signum); }
+63 AUE_NULL STD { int linux_newuname( \
+ struct l_new_utsname *buf); }
+64 AUE_NULL STD { int linux_semget(l_key_t key, \
+ l_int nsems, l_int semflg); }
+65 AUE_NULL STD { int linux_semop(l_int semid, \
+ struct l_sembuf *tsops, l_uint nsops); }
+66 AUE_NULL STD { int linux_semctl(l_int semid, \
+ l_int semnum, l_int cmd, union l_semun arg); }
+67 AUE_NULL STD { int linux_shmdt(char *shmaddr); }
+68 AUE_NULL STD { int linux_msgget(l_key_t key, l_int msgflg); }
+69 AUE_NULL STD { int linux_msgsnd(l_int msqid, \
+ struct l_msgbuf *msgp, l_size_t msgsz, \
+ l_int msgflg); }
+70 AUE_NULL STD { int linux_msgrcv(l_int msqid, \
+ struct l_msgbuf *msgp, l_size_t msgsz, \
+ l_long msgtyp, l_int msgflg); }
+71 AUE_NULL STD { int linux_msgctl(l_int msqid, l_int cmd, \
+ struct l_msqid_ds *buf); }
+72 AUE_FCNTL STD { int linux_fcntl(l_uint fd, l_uint cmd, \
+ l_ulong arg); }
+73 AUE_FLOCK NOPROTO { int flock(int fd, int how); }
+74 AUE_FSYNC NOPROTO { int fsync(int fd); }
+75 AUE_NULL STD { int linux_fdatasync(l_uint fd); }
+76 AUE_TRUNCATE STD { int linux_truncate(char *path, \
+ l_ulong length); }
+77 AUE_FTRUNCATE STD { int linux_ftruncate(l_int fd, l_long length); }
+78 AUE_GETDIRENTRIES STD { int linux_getdents(l_uint fd, void *dent, \
+ l_uint count); }
+79 AUE_GETCWD STD { int linux_getcwd(char *buf, \
+ l_ulong bufsize); }
+80 AUE_CHDIR STD { int linux_chdir(char *path); }
+81 AUE_FCHDIR NOPROTO { int fchdir(int fd); }
+82 AUE_RENAME STD { int linux_rename(char *from, char *to); }
+83 AUE_MKDIR STD { int linux_mkdir(char *path, l_int mode); }
+84 AUE_RMDIR STD { int linux_rmdir(char *path); }
+85 AUE_CREAT STD { int linux_creat(char *path, \
+ l_int mode); }
+86 AUE_LINK STD { int linux_link(char *path, char *to); }
+87 AUE_UNLINK STD { int linux_unlink(char *path); }
+88 AUE_SYMLINK STD { int linux_symlink(char *path, char *to); }
+89 AUE_READLINK STD { int linux_readlink(char *name, char *buf, \
+ l_int count); }
+90 AUE_CHMOD STD { int linux_chmod(char *path, \
+ l_mode_t mode); }
+91 AUE_FCHMOD NOPROTO { int fchmod(int fd, int mode); }
+92 AUE_LCHOWN STD { int linux_chown(char *path, \
+ l_uid_t uid, l_gid_t gid); }
+93 AUE_FCHOWN NOPROTO { int fchown(int fd, int uid, int gid); }
+94 AUE_LCHOWN STD { int linux_lchown(char *path, l_uid_t uid, \
+ l_gid_t gid); }
+95 AUE_UMASK NOPROTO { int umask(int newmask); }
+96 AUE_NULL NOPROTO { int gettimeofday(struct l_timeval *tp, \
+ struct timezone *tzp); }
+97 AUE_GETRLIMIT STD { int linux_getrlimit(l_uint resource, \
+ struct l_rlimit *rlim); }
+98 AUE_GETRUSAGE NOPROTO { int getrusage(int who, struct rusage *rusage); }
+99 AUE_NULL STD { int linux_sysinfo(struct l_sysinfo *info); }
+100 AUE_NULL STD { int linux_times(struct l_times_argv *buf); }
+101 AUE_PTRACE STD { int linux_ptrace(l_long req, l_long pid, \
+ l_long addr, l_long data); }
+102 AUE_GETUID STD { int linux_getuid(void); }
+103 AUE_NULL STD { int linux_syslog(l_int type, char *buf, \
+ l_int len); }
+104 AUE_GETGID STD { int linux_getgid(void); }
+105 AUE_SETUID NOPROTO { int setuid(uid_t uid); }
+106 AUE_SETGID NOPROTO { int setgid(gid_t gid); }
+107 AUE_GETEUID NOPROTO { int geteuid(void); }
+108 AUE_GETEGID NOPROTO { int getegid(void); }
+109 AUE_SETPGRP NOPROTO { int setpgid(int pid, int pgid); }
+110 AUE_GETPPID STD { int linux_getppid(void); }
+111 AUE_GETPGRP NOPROTO { int getpgrp(void); }
+112 AUE_SETSID NOPROTO { int setsid(void); }
+113 AUE_SETREUID NOPROTO { int setreuid(uid_t ruid, uid_t euid); }
+114 AUE_SETREGID NOPROTO { int setregid(gid_t rgid, gid_t egid); }
+115 AUE_GETGROUPS STD { int linux_getgroups(l_int gidsetsize, \
+ l_gid_t *grouplist); }
+116 AUE_SETGROUPS STD { int linux_setgroups(l_int gidsetsize, \
+ l_gid_t *grouplist); }
+117 AUE_SETRESUID NOPROTO { int setresuid(uid_t ruid, uid_t euid, \
+ uid_t suid); }
+118 AUE_GETRESUID NOPROTO { int getresuid(uid_t *ruid, uid_t *euid, \
+ uid_t *suid); }
+119 AUE_SETRESGID NOPROTO { int setresgid(gid_t rgid, gid_t egid, \
+ gid_t sgid); }
+120 AUE_GETRESGID NOPROTO { int getresgid(gid_t *rgid, gid_t *egid, \
+ gid_t *sgid); }
+121 AUE_GETPGID NOPROTO { int getpgid(int pid); }
+122 AUE_SETFSUID STD { int linux_setfsuid(l_uid_t uid); }
+123 AUE_SETFSGID STD { int linux_setfsgid(l_gid_t gid); }
+124 AUE_GETSID STD { int linux_getsid(l_pid_t pid); }
+125 AUE_CAPGET STD { int linux_capget(struct l_user_cap_header *hdrp, \
+ struct l_user_cap_data *datap); }
+126 AUE_CAPSET STD { int linux_capset(struct l_user_cap_header *hdrp, \
+ struct l_user_cap_data *datap); }
+127 AUE_NULL STD { int linux_rt_sigpending(l_sigset_t *set, \
+ l_size_t sigsetsize); }
+128 AUE_NULL STD { int linux_rt_sigtimedwait(l_sigset_t *mask, \
+ l_siginfo_t *ptr, \
+ struct l_timeval *timeout, \
+ l_size_t sigsetsize); }
+129 AUE_NULL STD { int linux_rt_sigqueueinfo(l_pid_t pid, l_int sig, \
+ l_siginfo_t *info); }
+130 AUE_NULL STD { int linux_rt_sigsuspend( \
+ l_sigset_t *newset, \
+ l_size_t sigsetsize); }
+131 AUE_NULL STD { int linux_sigaltstack(l_stack_t *uss, \
+ l_stack_t *uoss); }
+132 AUE_UTIME STD { int linux_utime(char *fname, \
+ struct l_utimbuf *times); }
+133 AUE_MKNOD STD { int linux_mknod(char *path, l_int mode, \
+ l_dev_t dev); }
+134 AUE_USELIB UNIMPL uselib
+135 AUE_PERSONALITY STD { int linux_personality(l_ulong per); }
+136 AUE_NULL STD { int linux_ustat(l_dev_t dev, \
+ struct l_ustat *ubuf); }
+137 AUE_STATFS STD { int linux_statfs(char *path, \
+ struct l_statfs_buf *buf); }
+138 AUE_FSTATFS STD { int linux_fstatfs(l_uint fd, \
+ struct l_statfs_buf *buf); }
+139 AUE_NULL STD { int linux_sysfs(l_int option, \
+ l_ulong arg1, l_ulong arg2); }
+140 AUE_GETPRIORITY STD { int linux_getpriority(int which, int who); }
+141 AUE_SETPRIORITY NOPROTO { int setpriority(int which, int who, \
+ int prio); }
+142 AUE_SCHED_SETPARAM STD { int linux_sched_setparam(l_pid_t pid, \
+ struct l_sched_param *param); }
+143 AUE_SCHED_GETPARAM STD { int linux_sched_getparam(l_pid_t pid, \
+ struct l_sched_param *param); }
+144 AUE_SCHED_SETSCHEDULER STD { int linux_sched_setscheduler( \
+ l_pid_t pid, l_int policy, \
+ struct l_sched_param *param); }
+145 AUE_SCHED_GETSCHEDULER STD { int linux_sched_getscheduler( \
+ l_pid_t pid); }
+146 AUE_SCHED_GET_PRIORITY_MAX STD { int linux_sched_get_priority_max( \
+ l_int policy); }
+147 AUE_SCHED_GET_PRIORITY_MIN STD { int linux_sched_get_priority_min( \
+ l_int policy); }
+148 AUE_SCHED_RR_GET_INTERVAL STD { int linux_sched_rr_get_interval(l_pid_t pid, \
+ struct l_timespec *interval); }
+149 AUE_MLOCK NOPROTO { int mlock(const void *addr, size_t len); }
+150 AUE_MUNLOCK NOPROTO { int munlock(const void *addr, size_t len); }
+151 AUE_MLOCKALL NOPROTO { int mlockall(int how); }
+152 AUE_MUNLOCKALL NOPROTO { int munlockall(void); }
+153 AUE_NULL STD { int linux_vhangup(void); }
+154 AUE_NULL UNIMPL modify_ldt
+155 AUE_PIVOT_ROOT STD { int linux_pivot_root(void); }
+156 AUE_SYSCTL STD { int linux_sysctl( \
+ struct l___sysctl_args *args); }
+157 AUE_PRCTL STD { int linux_prctl(l_int option, l_uintptr_t arg2, \
+ l_uintptr_t arg3, l_uintptr_t arg4, \
+ l_uintptr_t arg5); }
+158 AUE_PRCTL STD { int linux_arch_prctl(l_int code, l_ulong addr); }
+159 AUE_ADJTIME STD { int linux_adjtimex(void); }
+160 AUE_SETRLIMIT STD { int linux_setrlimit(l_uint resource, \
+ struct l_rlimit *rlim); }
+161 AUE_CHROOT NOPROTO { int chroot(char *path); }
+162 AUE_SYNC NOPROTO { int sync(void); }
+163 AUE_ACCT NOPROTO { int acct(char *path); }
+164 AUE_SETTIMEOFDAY NOPROTO { int settimeofday(struct l_timeval *tp, struct timezone *tzp); }
+165 AUE_MOUNT STD { int linux_mount(char *specialfile, \
+ char *dir, char *filesystemtype, \
+ l_ulong rwflag, void *data); }
+166 AUE_UMOUNT STD { int linux_umount(char *path, l_int flags); }
+167 AUE_SWAPON NOPROTO { int swapon(char *name); }
+168 AUE_SWAPOFF STD { int linux_swapoff(void); }
+169 AUE_REBOOT STD { int linux_reboot(l_int magic1, \
+ l_int magic2, l_uint cmd, void *arg); }
+170 AUE_SYSCTL STD { int linux_sethostname(char *hostname, \
+ l_uint len); }
+171 AUE_SYSCTL STD { int linux_setdomainname(char *name, \
+ l_int len); }
+172 AUE_NULL STD { int linux_iopl(l_uint level); }
+173 AUE_NULL UNIMPL ioperm
+174 AUE_NULL STD { int linux_create_module(void); }
+175 AUE_NULL STD { int linux_init_module(void); }
+176 AUE_NULL STD { int linux_delete_module(void); }
+177 AUE_NULL STD { int linux_get_kernel_syms(void); }
+178 AUE_NULL STD { int linux_query_module(void); }
+179 AUE_QUOTACTL STD { int linux_quotactl(void); }
+180 AUE_NULL STD { int linux_nfsservctl(void); }
+181 AUE_GETPMSG STD { int linux_getpmsg(void); }
+182 AUE_PUTPMSG STD { int linux_putpmsg(void); }
+183 AUE_NULL STD { int linux_afs_syscall(void); }
+184 AUE_NULL STD { int linux_tuxcall(void); }
+185 AUE_NULL STD { int linux_security(void); }
+186 AUE_NULL STD { int linux_gettid(void); }
+187 AUE_NULL UNIMPL linux_readahead
+188 AUE_NULL STD { int linux_setxattr(void); }
+189 AUE_NULL STD { int linux_lsetxattr(void); }
+190 AUE_NULL STD { int linux_fsetxattr(void); }
+191 AUE_NULL STD { int linux_getxattr(void); }
+192 AUE_NULL STD { int linux_lgetxattr(void); }
+193 AUE_NULL STD { int linux_fgetxattr(void); }
+194 AUE_NULL STD { int linux_listxattr(void); }
+195 AUE_NULL STD { int linux_llistxattr(void); }
+196 AUE_NULL STD { int linux_flistxattr(void); }
+197 AUE_NULL STD { int linux_removexattr(void); }
+198 AUE_NULL STD { int linux_lremovexattr(void); }
+199 AUE_NULL STD { int linux_fremovexattr(void); }
+200 AUE_NULL STD { int linux_tkill(int tid, int sig); }
+201 AUE_NULL STD { int linux_time(l_time_t *tm); }
+202 AUE_NULL STD { int linux_sys_futex(void *uaddr, int op, int val, \
+ struct l_timespec *timeout, void *uaddr2, int val3); }
+203 AUE_NULL STD { int linux_sched_setaffinity(l_pid_t pid, l_uint len, \
+ l_ulong *user_mask_ptr); }
+204 AUE_NULL STD { int linux_sched_getaffinity(l_pid_t pid, l_uint len, \
+ l_ulong *user_mask_ptr); }
+205 AUE_NULL STD { int linux_set_thread_area(void); }
+206 AUE_NULL UNIMPL linux_io_setup
+207 AUE_NULL UNIMPL linux_io_destroy
+208 AUE_NULL UNIMPL linux_io_getevents
+209 AUE_NULL UNIMPL inux_io_submit
+210 AUE_NULL UNIMPL linux_io_cancel
+211 AUE_NULL UNIMPL linux_get_thread_area
+212 AUE_NULL STD { int linux_lookup_dcookie(void); }
+213 AUE_NULL STD { int linux_epoll_create(l_int size); }
+214 AUE_NULL STD { int linux_epoll_ctl_old(void); }
+215 AUE_NULL STD { int linux_epoll_wait_old(void); }
+216 AUE_NULL STD { int linux_remap_file_pages(void); }
+217 AUE_GETDIRENTRIES STD { int linux_getdents64(l_uint fd, \
+ void *dirent, l_uint count); }
+218 AUE_NULL STD { int linux_set_tid_address(int *tidptr); }
+219 AUE_NULL UNIMPL restart_syscall
+220 AUE_NULL STD { int linux_semtimedop(void); }
+221 AUE_NULL STD { int linux_fadvise64(int fd, l_loff_t offset, \
+ l_size_t len, int advice); }
+222 AUE_NULL STD { int linux_timer_create(clockid_t clock_id, \
+ struct sigevent *evp, l_timer_t *timerid); }
+223 AUE_NULL STD { int linux_timer_settime(l_timer_t timerid, l_int flags, \
+ const struct itimerspec *new, struct itimerspec *old); }
+224 AUE_NULL STD { int linux_timer_gettime(l_timer_t timerid, struct itimerspec *setting); }
+225 AUE_NULL STD { int linux_timer_getoverrun(l_timer_t timerid); }
+226 AUE_NULL STD { int linux_timer_delete(l_timer_t timerid); }
+227 AUE_CLOCK_SETTIME STD { int linux_clock_settime(clockid_t which, struct l_timespec *tp); }
+228 AUE_NULL STD { int linux_clock_gettime(clockid_t which, struct l_timespec *tp); }
+229 AUE_NULL STD { int linux_clock_getres(clockid_t which, struct l_timespec *tp); }
+230 AUE_NULL STD { int linux_clock_nanosleep(clockid_t which, int flags, \
+ struct l_timespec *rqtp, struct l_timespec *rmtp); }
+231 AUE_EXIT STD { int linux_exit_group(int error_code); }
+232 AUE_NULL STD { int linux_epoll_wait(l_int epfd, struct epoll_event *events, \
+ l_int maxevents, l_int timeout); }
+233 AUE_NULL STD { int linux_epoll_ctl(l_int epfd, l_int op, l_int fd, \
+ struct epoll_event *event); }
+234 AUE_NULL STD { int linux_tgkill(int tgid, int pid, int sig); }
+235 AUE_UTIMES STD { int linux_utimes(char *fname, \
+ struct l_timeval *tptr); }
+236 AUE_NULL UNIMPL vserver
+237 AUE_NULL STD { int linux_mbind(void); }
+238 AUE_NULL STD { int linux_set_mempolicy(void); }
+239 AUE_NULL STD { int linux_get_mempolicy(void); }
+240 AUE_NULL STD { int linux_mq_open(void); }
+241 AUE_NULL STD { int linux_mq_unlink(void); }
+242 AUE_NULL STD { int linux_mq_timedsend(void); }
+243 AUE_NULL STD { int linux_mq_timedreceive(void); }
+244 AUE_NULL STD { int linux_mq_notify(void); }
+245 AUE_NULL STD { int linux_mq_getsetattr(void); }
+246 AUE_NULL STD { int linux_kexec_load(void); }
+247 AUE_WAIT6 STD { int linux_waitid(int idtype, l_pid_t id, \
+ l_siginfo_t *info, int options, \
+ struct rusage *rusage); }
+248 AUE_NULL STD { int linux_add_key(void); }
+249 AUE_NULL STD { int linux_request_key(void); }
+250 AUE_NULL STD { int linux_keyctl(void); }
+251 AUE_NULL STD { int linux_ioprio_set(void); }
+252 AUE_NULL STD { int linux_ioprio_get(void); }
+253 AUE_NULL STD { int linux_inotify_init(void); }
+254 AUE_NULL STD { int linux_inotify_add_watch(void); }
+255 AUE_NULL STD { int linux_inotify_rm_watch(void); }
+256 AUE_NULL STD { int linux_migrate_pages(void); }
+257 AUE_OPEN_RWTC STD { int linux_openat(l_int dfd, const char *filename, \
+ l_int flags, l_int mode); }
+258 AUE_MKDIRAT STD { int linux_mkdirat(l_int dfd, const char *pathname, \
+ l_int mode); }
+259 AUE_MKNODAT STD { int linux_mknodat(l_int dfd, const char *filename, \
+ l_int mode, l_uint dev); }
+260 AUE_FCHOWNAT STD { int linux_fchownat(l_int dfd, const char *filename, \
+ l_uid_t uid, l_gid_t gid, l_int flag); }
+261 AUE_FUTIMESAT STD { int linux_futimesat(l_int dfd, char *filename, \
+ struct l_timeval *utimes); }
+262 AUE_FSTATAT STD { int linux_newfstatat(l_int dfd, char *pathname, \
+ struct l_stat64 *statbuf, l_int flag); }
+263 AUE_UNLINKAT STD { int linux_unlinkat(l_int dfd, const char *pathname, \
+ l_int flag); }
+264 AUE_RENAMEAT STD { int linux_renameat(l_int olddfd, const char *oldname, \
+ l_int newdfd, const char *newname); }
+265 AUE_LINKAT STD { int linux_linkat(l_int olddfd, const char *oldname, \
+ l_int newdfd, const char *newname, l_int flag); }
+266 AUE_SYMLINKAT STD { int linux_symlinkat(const char *oldname, l_int newdfd, \
+ const char *newname); }
+267 AUE_READLINKAT STD { int linux_readlinkat(l_int dfd, const char *path, \
+ char *buf, l_int bufsiz); }
+268 AUE_FCHMODAT STD { int linux_fchmodat(l_int dfd, const char *filename, \
+ l_mode_t mode); }
+269 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, \
+ l_int amode); }
+270 AUE_SELECT STD { int linux_pselect6(l_int nfds, \
+ l_fd_set *readfds, l_fd_set *writefds, l_fd_set *exceptfds, \
+ struct l_timespec *tsp, l_uintptr_t *sig); }
+271 AUE_POLL STD { int linux_ppoll(struct pollfd *fds, uint32_t nfds, \
+ struct l_timespec *tsp, l_sigset_t *sset, l_size_t ssize); }
+272 AUE_NULL STD { int linux_unshare(void); }
+273 AUE_NULL STD { int linux_set_robust_list(struct linux_robust_list_head *head, \
+ l_size_t len); }
+274 AUE_NULL STD { int linux_get_robust_list(l_int pid, struct linux_robust_list_head *head, \
+ l_size_t *len); }
+275 AUE_NULL STD { int linux_splice(void); }
+276 AUE_NULL STD { int linux_tee(void); }
+277 AUE_NULL STD { int linux_sync_file_range(void); }
+278 AUE_NULL STD { int linux_vmsplice(void); }
+279 AUE_NULL STD { int linux_move_pages(void); }
+280 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \
+ const struct l_timespec *times, l_int flags); }
+281 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \
+ l_int maxevents, l_int timeout, l_sigset_t *mask); }
+282 AUE_NULL STD { int linux_signalfd(void); }
+283 AUE_NULL STD { int linux_timerfd(void); }
+284 AUE_NULL STD { int linux_eventfd(l_uint initval); }
+285 AUE_NULL STD { int linux_fallocate(l_int fd, l_int mode, \
+ l_loff_t offset, l_loff_t len); }
+286 AUE_NULL STD { int linux_timerfd_settime(void); }
+287 AUE_NULL STD { int linux_timerfd_gettime(void); }
+288 AUE_ACCEPT STD { int linux_accept4(l_int s, l_uintptr_t addr, \
+ l_uintptr_t namelen, int flags); }
+289 AUE_NULL STD { int linux_signalfd4(void); }
+290 AUE_NULL STD { int linux_eventfd2(l_uint initval, l_int flags); }
+291 AUE_NULL STD { int linux_epoll_create1(l_int flags); }
+292 AUE_NULL STD { int linux_dup3(l_int oldfd, \
+ l_int newfd, l_int flags); }
+293 AUE_NULL STD { int linux_pipe2(l_int *pipefds, l_int flags); }
+294 AUE_NULL STD { int linux_inotify_init1(void); }
+295 AUE_NULL STD { int linux_preadv(void); }
+296 AUE_NULL STD { int linux_pwritev(void); }
+297 AUE_NULL STD { int linux_rt_tsigqueueinfo(void); }
+298 AUE_NULL STD { int linux_perf_event_open(void); }
+299 AUE_NULL STD { int linux_recvmmsg(l_int s, \
+ struct l_mmsghdr *msg, l_uint vlen, \
+ l_uint flags, struct l_timespec *timeout); }
+300 AUE_NULL STD { int linux_fanotify_init(void); }
+301 AUE_NULL STD { int linux_fanotify_mark(void); }
+302 AUE_NULL STD { int linux_prlimit64(l_pid_t pid, l_uint resource, \
+ struct rlimit *new, struct rlimit *old); }
+303 AUE_NULL STD { int linux_name_to_handle_at(void); }
+304 AUE_NULL STD { int linux_open_by_handle_at(void); }
+305 AUE_NULL STD { int linux_clock_adjtime(void); }
+306 AUE_SYNC STD { int linux_syncfs(l_int fd); }
+307 AUE_NULL STD { int linux_sendmmsg(l_int s, \
+ struct l_mmsghdr *msg, l_uint vlen, \
+ l_uint flags); }
+308 AUE_NULL STD { int linux_setns(void); }
+309 AUE_NULL STD { int linux_process_vm_readv(void); }
+310 AUE_NULL STD { int linux_process_vm_writev(void); }
+311 AUE_NULL STD { int linux_kcmp(void); }
+312 AUE_NULL STD { int linux_finit_module(void); }
+; please, keep this line at the end.
+313 AUE_NULL UNIMPL nosys
diff --git a/sys/amd64/linux32/linux.h b/sys/amd64/linux32/linux.h
index 39c17c8..e3b9f11 100644
--- a/sys/amd64/linux32/linux.h
+++ b/sys/amd64/linux32/linux.h
@@ -33,6 +33,7 @@
#ifndef _AMD64_LINUX_H_
#define _AMD64_LINUX_H_
+#include <compat/linux/linux.h>
#include <amd64/linux32/linux32_syscall.h>
/*
@@ -40,14 +41,12 @@
*/
extern u_char linux_debug_map[];
#define ldebug(name) isclr(linux_debug_map, LINUX_SYS_linux_ ## name)
-#define ARGS(nm, fmt) "linux(%ld): "#nm"("fmt")\n", (long)td->td_proc->p_pid
-#define LMSG(fmt) "linux(%ld): "fmt"\n", (long)td->td_proc->p_pid
+#define ARGS(nm, fmt) "linux(%ld/%ld): "#nm"("fmt")\n", \
+ (long)td->td_proc->p_pid, (long)td->td_tid
+#define LMSG(fmt) "linux(%ld/%ld): "fmt"\n", \
+ (long)td->td_proc->p_pid, (long)td->td_tid
#define LINUX_DTRACE linuxulator32
-#ifdef MALLOC_DECLARE
-MALLOC_DECLARE(M_LINUX);
-#endif
-
#define LINUX32_MAXUSER ((1ul << 32) - PAGE_SIZE)
#define LINUX32_SHAREDPAGE (LINUX32_MAXUSER - PAGE_SIZE)
#define LINUX32_USRSTACK LINUX32_SHAREDPAGE
@@ -97,6 +96,7 @@ typedef l_uint l_uid_t;
typedef l_ushort l_uid16_t;
typedef l_int l_timer_t;
typedef l_int l_mqd_t;
+typedef l_ulong l_fd_mask;
typedef struct {
l_int val[2];
@@ -112,7 +112,7 @@ typedef struct {
/*
* Miscellaneous
*/
-#define LINUX_AT_COUNT 16 /* Count of used aux entry types.
+#define LINUX_AT_COUNT 20 /* Count of used aux entry types.
* Keep this synchronized with
* elf_linux_fixup() code.
*/
@@ -260,49 +260,6 @@ struct l_statfs64 {
l_int f_spare[6];
} __packed;
-/*
- * Signalling
- */
-#define LINUX_SIGHUP 1
-#define LINUX_SIGINT 2
-#define LINUX_SIGQUIT 3
-#define LINUX_SIGILL 4
-#define LINUX_SIGTRAP 5
-#define LINUX_SIGABRT 6
-#define LINUX_SIGIOT LINUX_SIGABRT
-#define LINUX_SIGBUS 7
-#define LINUX_SIGFPE 8
-#define LINUX_SIGKILL 9
-#define LINUX_SIGUSR1 10
-#define LINUX_SIGSEGV 11
-#define LINUX_SIGUSR2 12
-#define LINUX_SIGPIPE 13
-#define LINUX_SIGALRM 14
-#define LINUX_SIGTERM 15
-#define LINUX_SIGSTKFLT 16
-#define LINUX_SIGCHLD 17
-#define LINUX_SIGCONT 18
-#define LINUX_SIGSTOP 19
-#define LINUX_SIGTSTP 20
-#define LINUX_SIGTTIN 21
-#define LINUX_SIGTTOU 22
-#define LINUX_SIGURG 23
-#define LINUX_SIGXCPU 24
-#define LINUX_SIGXFSZ 25
-#define LINUX_SIGVTALRM 26
-#define LINUX_SIGPROF 27
-#define LINUX_SIGWINCH 28
-#define LINUX_SIGIO 29
-#define LINUX_SIGPOLL LINUX_SIGIO
-#define LINUX_SIGPWR 30
-#define LINUX_SIGSYS 31
-#define LINUX_SIGRTMIN 32
-
-#define LINUX_SIGTBLSZ 31
-#define LINUX_NSIG_WORDS 2
-#define LINUX_NBPW 32
-#define LINUX_NSIG (LINUX_NBPW * LINUX_NSIG_WORDS)
-
/* sigaction flags */
#define LINUX_SA_NOCLDSTOP 0x00000001
#define LINUX_SA_NOCLDWAIT 0x00000002
@@ -319,27 +276,13 @@ struct l_statfs64 {
#define LINUX_SIG_UNBLOCK 1
#define LINUX_SIG_SETMASK 2
-/* sigset_t macros */
-#define LINUX_SIGEMPTYSET(set) (set).__bits[0] = (set).__bits[1] = 0
-#define LINUX_SIGISMEMBER(set, sig) SIGISMEMBER(set, sig)
-#define LINUX_SIGADDSET(set, sig) SIGADDSET(set, sig)
-
/* sigaltstack */
#define LINUX_MINSIGSTKSZ 2048
-#define LINUX_SS_ONSTACK 1
-#define LINUX_SS_DISABLE 2
-
-int linux_to_bsd_sigaltstack(int lsa);
-int bsd_to_linux_sigaltstack(int bsa);
typedef l_uintptr_t l_handler_t;
typedef l_ulong l_osigset_t;
typedef struct {
- l_uint __bits[LINUX_NSIG_WORDS];
-} __packed l_sigset_t;
-
-typedef struct {
l_handler_t lsa_handler;
l_osigset_t lsa_mask;
l_ulong lsa_flags;
@@ -508,7 +451,7 @@ struct l_sigframe {
l_int sf_sig;
struct l_sigcontext sf_sc;
struct l_fpstate sf_fpstate;
- l_uint sf_extramask[LINUX_NSIG_WORDS-1];
+ l_uint sf_extramask[1];
l_handler_t sf_handler;
} __packed;
@@ -521,50 +464,13 @@ struct l_rt_sigframe {
l_handler_t sf_handler;
} __packed;
-extern struct sysentvec elf_linux_sysvec;
-
/*
- * open/fcntl flags
+ * arch specific open/fcntl flags
*/
-#define LINUX_O_RDONLY 00000000
-#define LINUX_O_WRONLY 00000001
-#define LINUX_O_RDWR 00000002
-#define LINUX_O_ACCMODE 00000003
-#define LINUX_O_CREAT 00000100
-#define LINUX_O_EXCL 00000200
-#define LINUX_O_NOCTTY 00000400
-#define LINUX_O_TRUNC 00001000
-#define LINUX_O_APPEND 00002000
-#define LINUX_O_NONBLOCK 00004000
-#define LINUX_O_NDELAY LINUX_O_NONBLOCK
-#define LINUX_O_SYNC 00010000
-#define LINUX_FASYNC 00020000
-#define LINUX_O_DIRECT 00040000 /* Direct disk access hint */
-#define LINUX_O_LARGEFILE 00100000
-#define LINUX_O_DIRECTORY 00200000 /* Must be a directory */
-#define LINUX_O_NOFOLLOW 00400000 /* Do not follow links */
-#define LINUX_O_NOATIME 01000000
-#define LINUX_O_CLOEXEC 02000000
-
-#define LINUX_F_DUPFD 0
-#define LINUX_F_GETFD 1
-#define LINUX_F_SETFD 2
-#define LINUX_F_GETFL 3
-#define LINUX_F_SETFL 4
-#define LINUX_F_GETLK 5
-#define LINUX_F_SETLK 6
-#define LINUX_F_SETLKW 7
-#define LINUX_F_SETOWN 8
-#define LINUX_F_GETOWN 9
-
#define LINUX_F_GETLK64 12
#define LINUX_F_SETLK64 13
#define LINUX_F_SETLKW64 14
-#define LINUX_F_RDLCK 0
-#define LINUX_F_WRLCK 1
-#define LINUX_F_UNLCK 2
-
union l_semun {
l_int val;
l_uintptr_t buf;
@@ -573,6 +479,16 @@ union l_semun {
l_uintptr_t __pad;
} __packed;
+struct l_ipc_perm {
+ l_key_t key;
+ l_uid16_t uid;
+ l_gid16_t gid;
+ l_uid16_t cuid;
+ l_gid16_t cgid;
+ l_ushort mode;
+ l_ushort seq;
+};
+
/*
* Socket defines
*/
@@ -609,22 +525,6 @@ struct l_sockaddr {
char sa_data[14];
} __packed;
-struct l_msghdr {
- l_uintptr_t msg_name;
- l_int msg_namelen;
- l_uintptr_t msg_iov;
- l_size_t msg_iovlen;
- l_uintptr_t msg_control;
- l_size_t msg_controllen;
- l_uint msg_flags;
-};
-
-struct l_cmsghdr {
- l_size_t cmsg_len;
- l_int cmsg_level;
- l_int cmsg_type;
-};
-
struct l_ifmap {
l_ulong mem_start;
l_ulong mem_end;
@@ -778,6 +678,7 @@ struct l_iovec32 {
int linux32_copyiniov(struct l_iovec32 *iovp32, l_ulong iovcnt,
struct iovec **iovp, int error);
+int linux_copyout_rusage(struct rusage *ru, void *uaddr);
/* robust futexes */
struct linux_robust_list {
diff --git a/sys/amd64/linux32/linux32_dummy.c b/sys/amd64/linux32/linux32_dummy.c
index ecf5168..e4e9f50 100644
--- a/sys/amd64/linux32/linux32_dummy.c
+++ b/sys/amd64/linux32/linux32_dummy.c
@@ -61,7 +61,6 @@ DUMMY(bdflush);
DUMMY(sysfs);
DUMMY(query_module);
DUMMY(nfsservctl);
-DUMMY(rt_sigqueueinfo);
DUMMY(sendfile);
DUMMY(setfsuid);
DUMMY(setfsgid);
@@ -69,9 +68,6 @@ DUMMY(pivot_root);
DUMMY(mincore);
DUMMY(ptrace);
DUMMY(lookup_dcookie);
-DUMMY(epoll_create);
-DUMMY(epoll_ctl);
-DUMMY(epoll_wait);
DUMMY(remap_file_pages);
DUMMY(fstatfs64);
DUMMY(mbind);
@@ -84,7 +80,6 @@ DUMMY(mq_timedreceive);
DUMMY(mq_notify);
DUMMY(mq_getsetattr);
DUMMY(kexec_load);
-DUMMY(waitid);
/* linux 2.6.11: */
DUMMY(add_key);
DUMMY(request_key);
@@ -97,8 +92,6 @@ DUMMY(inotify_add_watch);
DUMMY(inotify_rm_watch);
/* linux 2.6.16: */
DUMMY(migrate_pages);
-DUMMY(pselect6);
-DUMMY(ppoll);
DUMMY(unshare);
/* linux 2.6.17: */
DUMMY(splice);
@@ -109,22 +102,14 @@ DUMMY(vmsplice);
DUMMY(move_pages);
/* linux 2.6.19: */
DUMMY(getcpu);
-DUMMY(epoll_pwait);
/* linux 2.6.22: */
-DUMMY(utimensat);
DUMMY(signalfd);
DUMMY(timerfd_create);
-DUMMY(eventfd);
-/* linux 2.6.23: */
-DUMMY(fallocate);
/* linux 2.6.25: */
DUMMY(timerfd_settime);
DUMMY(timerfd_gettime);
/* linux 2.6.27: */
DUMMY(signalfd4);
-DUMMY(eventfd2);
-DUMMY(epoll_create1);
-DUMMY(dup3);
DUMMY(inotify_init1);
/* linux 2.6.30: */
DUMMY(preadv);
@@ -133,17 +118,12 @@ DUMMY(pwritev);
DUMMY(rt_tsigqueueinfo);
DUMMY(perf_event_open);
/* linux 2.6.33: */
-DUMMY(recvmmsg);
DUMMY(fanotify_init);
DUMMY(fanotify_mark);
-/* linux 2.6.36: */
-DUMMY(prlimit64);
/* later: */
DUMMY(name_to_handle_at);
DUMMY(open_by_handle_at);
DUMMY(clock_adjtime);
-DUMMY(syncfs);
-DUMMY(sendmmsg);
DUMMY(setns);
DUMMY(process_vm_readv);
DUMMY(process_vm_writev);
diff --git a/sys/amd64/linux32/linux32_genassym.c b/sys/amd64/linux32/linux32_genassym.c
index a022fac..bc94139 100644
--- a/sys/amd64/linux32/linux32_genassym.c
+++ b/sys/amd64/linux32/linux32_genassym.c
@@ -3,12 +3,16 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/assym.h>
+#include <sys/resource.h>
#include <sys/systm.h>
#include <amd64/linux32/linux.h>
+#include <compat/linux/linux_mib.h>
ASSYM(LINUX_SIGF_HANDLER, offsetof(struct l_sigframe, sf_handler));
ASSYM(LINUX_SIGF_SC, offsetof(struct l_sigframe, sf_sc));
ASSYM(LINUX_RT_SIGF_HANDLER, offsetof(struct l_rt_sigframe, sf_handler));
ASSYM(LINUX_RT_SIGF_UC, offsetof(struct l_rt_sigframe, sf_sc));
ASSYM(LINUX_RT_SIGF_SC, offsetof(struct l_ucontext, uc_mcontext));
+ASSYM(LINUX_VERSION_CODE, LINUX_VERSION_CODE);
+ASSYM(LINUX_SC_ESP, offsetof(struct l_sigcontext, sc_esp));
diff --git a/sys/amd64/linux32/linux32_locore.s b/sys/amd64/linux32/linux32_locore.s
index 36e1abf..4edbdf3 100644
--- a/sys/amd64/linux32/linux32_locore.s
+++ b/sys/amd64/linux32/linux32_locore.s
@@ -5,34 +5,152 @@
#include <amd64/linux32/linux32_syscall.h> /* system call numbers */
+.data
+
+ .globl linux_platform
+linux_platform:
+ .asciz "i686"
+
.text
.code32
-NON_GPROF_ENTRY(linux_sigcode)
- call *LINUX_SIGF_HANDLER(%esp)
- leal LINUX_SIGF_SC(%esp),%ebx /* linux scp */
- movl %esp, %ebx /* pass sigframe */
- push %eax /* fake ret addr */
+/*
+ * To avoid excess stack frame the signal trampoline code emulates
+ * the 'call' instruction.
+ */
+NON_GPROF_ENTRY(linux32_sigcode)
+ movl %esp, %ebx /* preserve sigframe */
+ call .getip0
+.getip0:
+ popl %eax
+ add $.startsigcode-.getip0, %eax /* ret address */
+ push %eax
+ jmp *LINUX_SIGF_HANDLER(%ebx)
+.startsigcode:
+ popl %eax
movl $LINUX_SYS_linux_sigreturn,%eax /* linux_sigreturn() */
int $0x80 /* enter kernel with args */
+.endsigcode:
0: jmp 0b
- ALIGN_TEXT
-/* XXXXX */
-linux_rt_sigcode:
- call *LINUX_RT_SIGF_HANDLER(%esp)
+
+NON_GPROF_ENTRY(linux32_rt_sigcode)
leal LINUX_RT_SIGF_UC(%esp),%ebx /* linux ucp */
leal LINUX_RT_SIGF_SC(%ebx),%ecx /* linux sigcontext */
- push %eax /* fake ret addr */
+ movl %esp, %edi
+ call .getip1
+.getip1:
+ popl %eax
+ add $.startrtsigcode-.getip1, %eax /* ret address */
+ push %eax
+ jmp *LINUX_RT_SIGF_HANDLER(%edi)
+.startrtsigcode:
movl $LINUX_SYS_linux_rt_sigreturn,%eax /* linux_rt_sigreturn() */
int $0x80 /* enter kernel with args */
+.endrtsigcode:
0: jmp 0b
- ALIGN_TEXT
-/* XXXXX */
-linux_esigcode:
-
- .data
- .globl linux_szsigcode, linux_sznonrtsigcode
-linux_szsigcode:
- .long linux_esigcode-linux_sigcode
-linux_sznonrtsigcode:
- .long linux_rt_sigcode-linux_sigcode
+
+NON_GPROF_ENTRY(linux32_vsyscall)
+.startvsyscall:
+ int $0x80
+ ret
+.endvsyscall:
+
+#if 0
+ .section .note.Linux, "a",@note
+ .long 2f - 1f /* namesz */
+ .balign 4
+ .long 4f - 3f /* descsz */
+ .long 0
+1:
+ .asciz "Linux"
+2:
+ .balign 4
+3:
+ .long LINUX_VERSION_CODE
+4:
+ .balign 4
+ .previous
+#endif
+
+#define do_cfa_expr(offset) \
+ .byte 0x0f; /* DW_CFA_def_cfa_expression */ \
+ .uleb128 11f-10f; /* length */ \
+10: .byte 0x74; /* DW_OP_breg4 */ \
+ .sleb128 offset; /* offset */ \
+ .byte 0x06; /* DW_OP_deref */ \
+11:
+
+
+ /* CIE */
+ .section .eh_frame,"a",@progbits
+.LSTARTFRAMEDLSI1:
+ .long .LENDCIEDLSI1-.LSTARTCIEDLSI1
+.LSTARTCIEDLSI1:
+ .long 0 /* CIE ID */
+ .byte 1 /* Version number */
+ .string "zRS" /* NULL-terminated
+ * augmentation string
+ */
+ .uleb128 1 /* Code alignment factor */
+ .sleb128 -4 /* Data alignment factor */
+ .byte 8 /* Return address
+ * register column
+ */
+ .uleb128 1 /* Augmentation value length */
+ .byte 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */
+ .byte 0 /* DW_CFA_nop */
+ .align 4
+.LENDCIEDLSI1:
+
+ /* FDE */
+ .long .LENDFDEDLSI1-.LSTARTFDEDLSI1 /* Length FDE */
+.LSTARTFDEDLSI1:
+ .long .LSTARTFDEDLSI1-.LSTARTFRAMEDLSI1 /* CIE pointer */
+ .long .startsigcode-. /* PC-relative start address */
+ .long .endsigcode-.startsigcode
+ .uleb128 0 /* Augmentation */
+ do_cfa_expr(LINUX_SIGF_SC-8)
+ .align 4
+.LENDFDEDLSI1:
+
+ .long .LENDFDEDLSI2-.LSTARTFDEDLSI2 /* Length FDE */
+.LSTARTFDEDLSI2:
+ .long .LSTARTFDEDLSI2-.LSTARTFRAMEDLSI1 /* CIE pointer */
+ .long .startrtsigcode-. /* PC-relative start address */
+ .long .endrtsigcode-.startrtsigcode
+ .uleb128 0 /* Augmentation */
+ do_cfa_expr(LINUX_RT_SIGF_SC-4+LINUX_SC_ESP)
+ .align 4
+.LENDFDEDLSI2:
+ .previous
+
+ .section .eh_frame,"a",@progbits
+.LSTARTFRAMEDLSI2:
+ .long .LENDCIEDLSI2-.LSTARTCIEDLSI2
+.LSTARTCIEDLSI2:
+ .long 0 /* CIE ID */
+ .byte 1 /* Version number */
+ .string "zR" /* NULL-terminated
+ * augmentation string
+ */
+ .uleb128 1 /* Code alignment factor */
+ .sleb128 -4 /* Data alignment factor */
+ .byte 8 /* Return address register column */
+ .uleb128 1 /* Augmentation value length */
+ .byte 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */
+ .byte 0x0c /* DW_CFA_def_cfa */
+ .uleb128 4
+ .uleb128 4
+ .byte 0x88 /* DW_CFA_offset, column 0x8 */
+ .uleb128 1
+ .align 4
+.LENDCIEDLSI2:
+ .long .LENDFDEDLSI3-.LSTARTFDEDLSI3 /* Length FDE */
+.LSTARTFDEDLSI3:
+ .long .LSTARTFDEDLSI3-.LSTARTFRAMEDLSI2 /* CIE pointer */
+ .long .startvsyscall-. /* PC-relative start address */
+ .long .endvsyscall-.startvsyscall
+ .uleb128 0
+ .align 4
+.LENDFDEDLSI3:
+ .previous
diff --git a/sys/amd64/linux32/linux32_machdep.c b/sys/amd64/linux32/linux32_machdep.c
index 155e90b..1c54c5c 100644
--- a/sys/amd64/linux32/linux32_machdep.c
+++ b/sys/amd64/linux32/linux32_machdep.c
@@ -31,6 +31,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_compat.h"
+
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/systm.h>
@@ -48,7 +50,6 @@ __FBSDID("$FreeBSD$");
#include <sys/proc.h>
#include <sys/resource.h>
#include <sys/resourcevar.h>
-#include <sys/sched.h>
#include <sys/syscallsubr.h>
#include <sys/sysproto.h>
#include <sys/unistd.h>
@@ -73,6 +74,8 @@ __FBSDID("$FreeBSD$");
#include <compat/linux/linux_util.h>
#include <compat/linux/linux_emul.h>
+static void bsd_to_linux_rusage(struct rusage *ru, struct l_rusage *lru);
+
struct l_old_select_argv {
l_int nfds;
l_uintptr_t readfds;
@@ -81,34 +84,10 @@ struct l_old_select_argv {
l_uintptr_t timeout;
} __packed;
-int
-linux_to_bsd_sigaltstack(int lsa)
-{
- int bsa = 0;
-
- if (lsa & LINUX_SS_DISABLE)
- bsa |= SS_DISABLE;
- if (lsa & LINUX_SS_ONSTACK)
- bsa |= SS_ONSTACK;
- return (bsa);
-}
-
static int linux_mmap_common(struct thread *td, l_uintptr_t addr,
l_size_t len, l_int prot, l_int flags, l_int fd,
l_loff_t pos);
-int
-bsd_to_linux_sigaltstack(int bsa)
-{
- int lsa = 0;
-
- if (bsa & SS_DISABLE)
- lsa |= LINUX_SS_DISABLE;
- if (bsa & SS_ONSTACK)
- lsa |= LINUX_SS_ONSTACK;
- return (lsa);
-}
-
static void
bsd_to_linux_rusage(struct rusage *ru, struct l_rusage *lru)
{
@@ -134,10 +113,19 @@ bsd_to_linux_rusage(struct rusage *ru, struct l_rusage *lru)
}
int
+linux_copyout_rusage(struct rusage *ru, void *uaddr)
+{
+ struct l_rusage lru;
+
+ bsd_to_linux_rusage(ru, &lru);
+
+ return (copyout(&lru, uaddr, sizeof(struct l_rusage)));
+}
+
+int
linux_execve(struct thread *td, struct linux_execve_args *args)
{
struct image_args eargs;
- struct vmspace *oldvmspace;
char *path;
int error;
@@ -148,26 +136,11 @@ linux_execve(struct thread *td, struct linux_execve_args *args)
printf(ARGS(execve, "%s"), path);
#endif
- error = pre_execve(td, &oldvmspace);
- if (error != 0) {
- free(path, M_TEMP);
- return (error);
- }
error = freebsd32_exec_copyin_args(&eargs, path, UIO_SYSSPACE,
args->argp, args->envp);
free(path, M_TEMP);
if (error == 0)
- error = kern_execve(td, &eargs, NULL);
- if (error == 0) {
- /* Linux process can execute FreeBSD one, do not attempt
- * to create emuldata for such process using
- * linux_proc_init, this leads to a panic on KASSERT
- * because such process has p->p_emuldata == NULL.
- */
- if (SV_PROC_ABI(td->td_proc) == SV_ABI_LINUX)
- error = linux_proc_init(td, 0, 0);
- }
- post_execve(td, error, oldvmspace);
+ error = linux_common_execve(td, &eargs);
return (error);
}
@@ -465,8 +438,14 @@ int
linux_set_upcall_kse(struct thread *td, register_t stack)
{
- td->td_frame->tf_rsp = stack;
+ if (stack)
+ td->td_frame->tf_rsp = stack;
+ /*
+ * The newly created Linux thread returns
+ * to the user space by the same path that a parent do.
+ */
+ td->td_frame->tf_rax = 0;
return (0);
}
@@ -636,7 +615,7 @@ linux_mmap_common(struct thread *td, l_uintptr_t addr, l_size_t len, l_int prot,
*/
PROC_LOCK(p);
p->p_vmspace->vm_maxsaddr = (char *)LINUX32_USRSTACK -
- lim_cur(p, RLIMIT_STACK);
+ lim_cur_proc(p, RLIMIT_STACK);
PROC_UNLOCK(p);
}
@@ -729,7 +708,7 @@ linux_sigaction(struct thread *td, struct linux_sigaction_args *args)
act.lsa_flags = osa.lsa_flags;
act.lsa_restorer = osa.lsa_restorer;
LINUX_SIGEMPTYSET(act.lsa_mask);
- act.lsa_mask.__bits[0] = osa.lsa_mask;
+ act.lsa_mask.__mask = osa.lsa_mask;
}
error = linux_do_sigaction(td, args->sig, args->nsa ? &act : NULL,
@@ -739,7 +718,7 @@ linux_sigaction(struct thread *td, struct linux_sigaction_args *args)
osa.lsa_handler = oact.lsa_handler;
osa.lsa_flags = oact.lsa_flags;
osa.lsa_restorer = oact.lsa_restorer;
- osa.lsa_mask = oact.lsa_mask.__bits[0];
+ osa.lsa_mask = oact.lsa_mask.__mask;
error = copyout(&osa, args->osa, sizeof(l_osigaction_t));
}
@@ -763,7 +742,7 @@ linux_sigsuspend(struct thread *td, struct linux_sigsuspend_args *args)
#endif
LINUX_SIGEMPTYSET(mask);
- mask.__bits[0] = args->mask;
+ mask.__mask = args->mask;
linux_to_bsd_sigset(&mask, &sigmask);
return (kern_sigsuspend(td, sigmask));
}
@@ -910,37 +889,18 @@ linux_settimeofday(struct thread *td, struct linux_settimeofday_args *uap)
int
linux_getrusage(struct thread *td, struct linux_getrusage_args *uap)
{
- struct l_rusage s32;
struct rusage s;
int error;
error = kern_getrusage(td, uap->who, &s);
if (error != 0)
return (error);
- if (uap->rusage != NULL) {
- bsd_to_linux_rusage(&s, &s32);
- error = copyout(&s32, uap->rusage, sizeof(s32));
- }
+ if (uap->rusage != NULL)
+ error = linux_copyout_rusage(&s, uap->rusage);
return (error);
}
int
-linux_sched_rr_get_interval(struct thread *td,
- struct linux_sched_rr_get_interval_args *uap)
-{
- struct timespec ts;
- struct l_timespec ts32;
- int error;
-
- error = kern_sched_rr_get_interval(td, uap->pid, &ts);
- if (error != 0)
- return (error);
- ts32.tv_sec = ts.tv_sec;
- ts32.tv_nsec = ts.tv_nsec;
- return (copyout(&ts32, uap->interval, sizeof(ts32)));
-}
-
-int
linux_set_thread_area(struct thread *td,
struct linux_set_thread_area_args *args)
{
@@ -1042,37 +1002,3 @@ linux_set_thread_area(struct thread *td,
return (0);
}
-
-int
-linux_wait4(struct thread *td, struct linux_wait4_args *args)
-{
- int error, options;
- struct rusage ru, *rup;
- struct l_rusage lru;
-
-#ifdef DEBUG
- if (ldebug(wait4))
- printf(ARGS(wait4, "%d, %p, %d, %p"),
- args->pid, (void *)args->status, args->options,
- (void *)args->rusage);
-#endif
-
- options = (args->options & (WNOHANG | WUNTRACED));
- /* WLINUXCLONE should be equal to __WCLONE, but we make sure */
- if (args->options & __WCLONE)
- options |= WLINUXCLONE;
-
- if (args->rusage != NULL)
- rup = &ru;
- else
- rup = NULL;
- error = linux_common_wait(td, args->pid, args->status, options, rup);
- if (error)
- return (error);
- if (args->rusage != NULL) {
- bsd_to_linux_rusage(rup, &lru);
- error = copyout(&lru, args->rusage, sizeof(lru));
- }
-
- return (error);
-}
diff --git a/sys/amd64/linux32/linux32_proto.h b/sys/amd64/linux32/linux32_proto.h
index fd6b542..c6b233e 100644
--- a/sys/amd64/linux32/linux32_proto.h
+++ b/sys/amd64/linux32/linux32_proto.h
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 276508 2015-01-01 18:37:03Z dchagin
+ * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 283492 2015-05-24 18:08:01Z dchagin
*/
#ifndef _LINUX_SYSPROTO_H_
@@ -35,6 +35,9 @@ struct thread;
#endif
#define nosys linux_nosys
+struct linux_exit_args {
+ char rval_l_[PADL_(int)]; int rval; char rval_r_[PADR_(int)];
+};
struct linux_fork_args {
register_t dummy;
};
@@ -475,6 +478,14 @@ struct linux_fdatasync_args {
struct linux_sysctl_args {
char args_l_[PADL_(struct l___sysctl_args *)]; struct l___sysctl_args * args; char args_r_[PADR_(struct l___sysctl_args *)];
};
+struct linux_sched_setparam_args {
+ char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+ char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)];
+};
+struct linux_sched_getparam_args {
+ char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+ char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)];
+};
struct linux_sched_setscheduler_args {
char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)];
@@ -563,7 +574,9 @@ struct linux_rt_sigtimedwait_args {
char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)];
};
struct linux_rt_sigqueueinfo_args {
- register_t dummy;
+ char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+ char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)];
+ char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)];
};
struct linux_rt_sigsuspend_args {
char newset_l_[PADL_(l_sigset_t *)]; l_sigset_t * newset; char newset_r_[PADR_(l_sigset_t *)];
@@ -766,13 +779,19 @@ struct linux_lookup_dcookie_args {
register_t dummy;
};
struct linux_epoll_create_args {
- register_t dummy;
+ char size_l_[PADL_(l_int)]; l_int size; char size_r_[PADR_(l_int)];
};
struct linux_epoll_ctl_args {
- register_t dummy;
+ char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)];
+ char op_l_[PADL_(l_int)]; l_int op; char op_r_[PADR_(l_int)];
+ char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
+ char event_l_[PADL_(struct epoll_event *)]; struct epoll_event * event; char event_r_[PADR_(struct epoll_event *)];
};
struct linux_epoll_wait_args {
- register_t dummy;
+ char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)];
+ char events_l_[PADL_(struct epoll_event *)]; struct epoll_event * events; char events_r_[PADR_(struct epoll_event *)];
+ char maxevents_l_[PADL_(l_int)]; l_int maxevents; char maxevents_r_[PADR_(l_int)];
+ char timeout_l_[PADL_(l_int)]; l_int timeout; char timeout_r_[PADR_(l_int)];
};
struct linux_remap_file_pages_args {
register_t dummy;
@@ -873,7 +892,11 @@ struct linux_kexec_load_args {
register_t dummy;
};
struct linux_waitid_args {
- register_t dummy;
+ char idtype_l_[PADL_(int)]; int idtype; char idtype_r_[PADR_(int)];
+ char id_l_[PADL_(l_pid_t)]; l_pid_t id; char id_r_[PADR_(l_pid_t)];
+ char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)];
+ char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)];
+ char rusage_l_[PADL_(struct l_rusage *)]; struct l_rusage * rusage; char rusage_r_[PADR_(struct l_rusage *)];
};
struct linux_add_key_args {
register_t dummy;
@@ -975,13 +998,21 @@ struct linux_faccessat_args {
char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)];
char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)];
char amode_l_[PADL_(l_int)]; l_int amode; char amode_r_[PADR_(l_int)];
- char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)];
};
struct linux_pselect6_args {
- register_t dummy;
+ char nfds_l_[PADL_(l_int)]; l_int nfds; char nfds_r_[PADR_(l_int)];
+ char readfds_l_[PADL_(l_fd_set *)]; l_fd_set * readfds; char readfds_r_[PADR_(l_fd_set *)];
+ char writefds_l_[PADL_(l_fd_set *)]; l_fd_set * writefds; char writefds_r_[PADR_(l_fd_set *)];
+ char exceptfds_l_[PADL_(l_fd_set *)]; l_fd_set * exceptfds; char exceptfds_r_[PADR_(l_fd_set *)];
+ char tsp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tsp; char tsp_r_[PADR_(struct l_timespec *)];
+ char sig_l_[PADL_(l_uintptr_t *)]; l_uintptr_t * sig; char sig_r_[PADR_(l_uintptr_t *)];
};
struct linux_ppoll_args {
- register_t dummy;
+ char fds_l_[PADL_(struct pollfd *)]; struct pollfd * fds; char fds_r_[PADR_(struct pollfd *)];
+ char nfds_l_[PADL_(uint32_t)]; uint32_t nfds; char nfds_r_[PADR_(uint32_t)];
+ char tsp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tsp; char tsp_r_[PADR_(struct l_timespec *)];
+ char sset_l_[PADL_(l_sigset_t *)]; l_sigset_t * sset; char sset_r_[PADR_(l_sigset_t *)];
+ char ssize_l_[PADL_(l_size_t)]; l_size_t ssize; char ssize_r_[PADR_(l_size_t)];
};
struct linux_unshare_args {
register_t dummy;
@@ -1014,10 +1045,17 @@ struct linux_getcpu_args {
register_t dummy;
};
struct linux_epoll_pwait_args {
- register_t dummy;
+ char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)];
+ char events_l_[PADL_(struct epoll_event *)]; struct epoll_event * events; char events_r_[PADR_(struct epoll_event *)];
+ char maxevents_l_[PADL_(l_int)]; l_int maxevents; char maxevents_r_[PADR_(l_int)];
+ char timeout_l_[PADL_(l_int)]; l_int timeout; char timeout_r_[PADR_(l_int)];
+ char mask_l_[PADL_(l_sigset_t *)]; l_sigset_t * mask; char mask_r_[PADR_(l_sigset_t *)];
};
struct linux_utimensat_args {
- register_t dummy;
+ char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)];
+ char pathname_l_[PADL_(const char *)]; const char * pathname; char pathname_r_[PADR_(const char *)];
+ char times_l_[PADL_(const struct l_timespec *)]; const struct l_timespec * times; char times_r_[PADR_(const struct l_timespec *)];
+ char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
};
struct linux_signalfd_args {
register_t dummy;
@@ -1026,10 +1064,13 @@ struct linux_timerfd_create_args {
register_t dummy;
};
struct linux_eventfd_args {
- register_t dummy;
+ char initval_l_[PADL_(l_uint)]; l_uint initval; char initval_r_[PADR_(l_uint)];
};
struct linux_fallocate_args {
- register_t dummy;
+ char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
+ char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)];
+ char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)];
+ char len_l_[PADL_(l_loff_t)]; l_loff_t len; char len_r_[PADR_(l_loff_t)];
};
struct linux_timerfd_settime_args {
register_t dummy;
@@ -1041,13 +1082,16 @@ struct linux_signalfd4_args {
register_t dummy;
};
struct linux_eventfd2_args {
- register_t dummy;
+ char initval_l_[PADL_(l_uint)]; l_uint initval; char initval_r_[PADR_(l_uint)];
+ char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
};
struct linux_epoll_create1_args {
- register_t dummy;
+ char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
};
struct linux_dup3_args {
- register_t dummy;
+ char oldfd_l_[PADL_(l_int)]; l_int oldfd; char oldfd_r_[PADR_(l_int)];
+ char newfd_l_[PADL_(l_int)]; l_int newfd; char newfd_r_[PADR_(l_int)];
+ char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
};
struct linux_pipe2_args {
char pipefds_l_[PADL_(l_int *)]; l_int * pipefds; char pipefds_r_[PADR_(l_int *)];
@@ -1069,7 +1113,11 @@ struct linux_perf_event_open_args {
register_t dummy;
};
struct linux_recvmmsg_args {
- register_t dummy;
+ char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
+ char msg_l_[PADL_(struct l_mmsghdr *)]; struct l_mmsghdr * msg; char msg_r_[PADR_(struct l_mmsghdr *)];
+ char vlen_l_[PADL_(l_uint)]; l_uint vlen; char vlen_r_[PADR_(l_uint)];
+ char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)];
+ char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)];
};
struct linux_fanotify_init_args {
register_t dummy;
@@ -1078,7 +1126,10 @@ struct linux_fanotify_mark_args {
register_t dummy;
};
struct linux_prlimit64_args {
- register_t dummy;
+ char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+ char resource_l_[PADL_(l_uint)]; l_uint resource; char resource_r_[PADR_(l_uint)];
+ char new_l_[PADL_(struct rlimit *)]; struct rlimit * new; char new_r_[PADR_(struct rlimit *)];
+ char old_l_[PADL_(struct rlimit *)]; struct rlimit * old; char old_r_[PADR_(struct rlimit *)];
};
struct linux_name_to_handle_at_args {
register_t dummy;
@@ -1090,10 +1141,13 @@ struct linux_clock_adjtime_args {
register_t dummy;
};
struct linux_syncfs_args {
- register_t dummy;
+ char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
};
struct linux_sendmmsg_args {
- register_t dummy;
+ char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
+ char msg_l_[PADL_(struct l_mmsghdr *)]; struct l_mmsghdr * msg; char msg_r_[PADR_(struct l_mmsghdr *)];
+ char vlen_l_[PADL_(l_uint)]; l_uint vlen; char vlen_r_[PADR_(l_uint)];
+ char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)];
};
struct linux_setns_args {
register_t dummy;
@@ -1105,6 +1159,7 @@ struct linux_process_vm_writev_args {
register_t dummy;
};
#define nosys linux_nosys
+int linux_exit(struct thread *, struct linux_exit_args *);
int linux_fork(struct thread *, struct linux_fork_args *);
int linux_open(struct thread *, struct linux_open_args *);
int linux_waitpid(struct thread *, struct linux_waitpid_args *);
@@ -1216,6 +1271,8 @@ int linux_writev(struct thread *, struct linux_writev_args *);
int linux_getsid(struct thread *, struct linux_getsid_args *);
int linux_fdatasync(struct thread *, struct linux_fdatasync_args *);
int linux_sysctl(struct thread *, struct linux_sysctl_args *);
+int linux_sched_setparam(struct thread *, struct linux_sched_setparam_args *);
+int linux_sched_getparam(struct thread *, struct linux_sched_getparam_args *);
int linux_sched_setscheduler(struct thread *, struct linux_sched_setscheduler_args *);
int linux_sched_getscheduler(struct thread *, struct linux_sched_getscheduler_args *);
int linux_sched_get_priority_max(struct thread *, struct linux_sched_get_priority_max_args *);
@@ -1407,6 +1464,7 @@ int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args
#endif /* COMPAT_FREEBSD7 */
+#define LINUX_SYS_AUE_linux_exit AUE_EXIT
#define LINUX_SYS_AUE_linux_fork AUE_FORK
#define LINUX_SYS_AUE_linux_open AUE_OPEN_RWTC
#define LINUX_SYS_AUE_linux_waitpid AUE_WAIT4
@@ -1518,6 +1576,8 @@ int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args
#define LINUX_SYS_AUE_linux_getsid AUE_GETSID
#define LINUX_SYS_AUE_linux_fdatasync AUE_NULL
#define LINUX_SYS_AUE_linux_sysctl AUE_SYSCTL
+#define LINUX_SYS_AUE_linux_sched_setparam AUE_SCHED_SETPARAM
+#define LINUX_SYS_AUE_linux_sched_getparam AUE_SCHED_GETPARAM
#define LINUX_SYS_AUE_linux_sched_setscheduler AUE_SCHED_SETSCHEDULER
#define LINUX_SYS_AUE_linux_sched_getscheduler AUE_SCHED_GETSCHEDULER
#define LINUX_SYS_AUE_linux_sched_get_priority_max AUE_SCHED_GET_PRIORITY_MAX
@@ -1617,7 +1677,7 @@ int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args
#define LINUX_SYS_AUE_linux_mq_notify AUE_NULL
#define LINUX_SYS_AUE_linux_mq_getsetattr AUE_NULL
#define LINUX_SYS_AUE_linux_kexec_load AUE_NULL
-#define LINUX_SYS_AUE_linux_waitid AUE_NULL
+#define LINUX_SYS_AUE_linux_waitid AUE_WAIT6
#define LINUX_SYS_AUE_linux_add_key AUE_NULL
#define LINUX_SYS_AUE_linux_request_key AUE_NULL
#define LINUX_SYS_AUE_linux_keyctl AUE_NULL
@@ -1640,8 +1700,8 @@ int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args
#define LINUX_SYS_AUE_linux_readlinkat AUE_READLINKAT
#define LINUX_SYS_AUE_linux_fchmodat AUE_FCHMODAT
#define LINUX_SYS_AUE_linux_faccessat AUE_FACCESSAT
-#define LINUX_SYS_AUE_linux_pselect6 AUE_NULL
-#define LINUX_SYS_AUE_linux_ppoll AUE_NULL
+#define LINUX_SYS_AUE_linux_pselect6 AUE_SELECT
+#define LINUX_SYS_AUE_linux_ppoll AUE_POLL
#define LINUX_SYS_AUE_linux_unshare AUE_NULL
#define LINUX_SYS_AUE_linux_set_robust_list AUE_NULL
#define LINUX_SYS_AUE_linux_get_robust_list AUE_NULL
@@ -1652,7 +1712,7 @@ int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args
#define LINUX_SYS_AUE_linux_move_pages AUE_NULL
#define LINUX_SYS_AUE_linux_getcpu AUE_NULL
#define LINUX_SYS_AUE_linux_epoll_pwait AUE_NULL
-#define LINUX_SYS_AUE_linux_utimensat AUE_NULL
+#define LINUX_SYS_AUE_linux_utimensat AUE_FUTIMESAT
#define LINUX_SYS_AUE_linux_signalfd AUE_NULL
#define LINUX_SYS_AUE_linux_timerfd_create AUE_NULL
#define LINUX_SYS_AUE_linux_eventfd AUE_NULL
@@ -1676,7 +1736,7 @@ int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args
#define LINUX_SYS_AUE_linux_name_to_handle_at AUE_NULL
#define LINUX_SYS_AUE_linux_open_by_handle_at AUE_NULL
#define LINUX_SYS_AUE_linux_clock_adjtime AUE_NULL
-#define LINUX_SYS_AUE_linux_syncfs AUE_NULL
+#define LINUX_SYS_AUE_linux_syncfs AUE_SYNC
#define LINUX_SYS_AUE_linux_sendmmsg AUE_NULL
#define LINUX_SYS_AUE_linux_setns AUE_NULL
#define LINUX_SYS_AUE_linux_process_vm_readv AUE_NULL
diff --git a/sys/amd64/linux32/linux32_syscall.h b/sys/amd64/linux32/linux32_syscall.h
index 01fd99a..f2410f3 100644
--- a/sys/amd64/linux32/linux32_syscall.h
+++ b/sys/amd64/linux32/linux32_syscall.h
@@ -3,10 +3,10 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 276508 2015-01-01 18:37:03Z dchagin
+ * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 283492 2015-05-24 18:08:01Z dchagin
*/
-#define LINUX_SYS_exit 1
+#define LINUX_SYS_linux_exit 1
#define LINUX_SYS_linux_fork 2
#define LINUX_SYS_read 3
#define LINUX_SYS_write 4
@@ -143,8 +143,8 @@
#define LINUX_SYS_munlock 151
#define LINUX_SYS_mlockall 152
#define LINUX_SYS_munlockall 153
-#define LINUX_SYS_sched_setparam 154
-#define LINUX_SYS_sched_getparam 155
+#define LINUX_SYS_linux_sched_setparam 154
+#define LINUX_SYS_linux_sched_getparam 155
#define LINUX_SYS_linux_sched_setscheduler 156
#define LINUX_SYS_linux_sched_getscheduler 157
#define LINUX_SYS_sched_yield 158
@@ -321,4 +321,4 @@
#define LINUX_SYS_linux_setns 346
#define LINUX_SYS_linux_process_vm_readv 347
#define LINUX_SYS_linux_process_vm_writev 348
-#define LINUX_SYS_MAXSYSCALL 349
+#define LINUX_SYS_MAXSYSCALL 350
diff --git a/sys/amd64/linux32/linux32_syscalls.c b/sys/amd64/linux32/linux32_syscalls.c
index cb80458..6f26207 100644
--- a/sys/amd64/linux32/linux32_syscalls.c
+++ b/sys/amd64/linux32/linux32_syscalls.c
@@ -3,13 +3,13 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 276508 2015-01-01 18:37:03Z dchagin
+ * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 283492 2015-05-24 18:08:01Z dchagin
*/
const char *linux_syscallnames[] = {
#define nosys linux_nosys
"#0", /* 0 = setup */
- "exit", /* 1 = exit */
+ "linux_exit", /* 1 = linux_exit */
"linux_fork", /* 2 = linux_fork */
"read", /* 3 = read */
"write", /* 4 = write */
@@ -162,8 +162,8 @@ const char *linux_syscallnames[] = {
"munlock", /* 151 = munlock */
"mlockall", /* 152 = mlockall */
"munlockall", /* 153 = munlockall */
- "sched_setparam", /* 154 = sched_setparam */
- "sched_getparam", /* 155 = sched_getparam */
+ "linux_sched_setparam", /* 154 = linux_sched_setparam */
+ "linux_sched_getparam", /* 155 = linux_sched_getparam */
"linux_sched_setscheduler", /* 156 = linux_sched_setscheduler */
"linux_sched_getscheduler", /* 157 = linux_sched_getscheduler */
"sched_yield", /* 158 = sched_yield */
@@ -357,4 +357,5 @@ const char *linux_syscallnames[] = {
"linux_setns", /* 346 = linux_setns */
"linux_process_vm_readv", /* 347 = linux_process_vm_readv */
"linux_process_vm_writev", /* 348 = linux_process_vm_writev */
+ "#349", /* 349 = nosys */
};
diff --git a/sys/amd64/linux32/linux32_sysent.c b/sys/amd64/linux32/linux32_sysent.c
index 4fee146..004b886 100644
--- a/sys/amd64/linux32/linux32_sysent.c
+++ b/sys/amd64/linux32/linux32_sysent.c
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 276508 2015-01-01 18:37:03Z dchagin
+ * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 283492 2015-05-24 18:08:01Z dchagin
*/
#include "opt_compat.h"
@@ -20,7 +20,7 @@
struct sysent linux_sysent[] = {
#define nosys linux_nosys
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 0 = setup */
- { AS(sys_exit_args), (sy_call_t *)sys_sys_exit, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 1 = exit */
+ { AS(linux_exit_args), (sy_call_t *)linux_exit, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 1 = linux_exit */
{ 0, (sy_call_t *)linux_fork, AUE_FORK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 2 = linux_fork */
{ AS(read_args), (sy_call_t *)sys_read, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 3 = read */
{ AS(write_args), (sy_call_t *)sys_write, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 4 = write */
@@ -173,8 +173,8 @@ struct sysent linux_sysent[] = {
{ AS(munlock_args), (sy_call_t *)sys_munlock, AUE_MUNLOCK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 151 = munlock */
{ AS(mlockall_args), (sy_call_t *)sys_mlockall, AUE_MLOCKALL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 152 = mlockall */
{ 0, (sy_call_t *)sys_munlockall, AUE_MUNLOCKALL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 153 = munlockall */
- { AS(sched_setparam_args), (sy_call_t *)sys_sched_setparam, AUE_SCHED_SETPARAM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 154 = sched_setparam */
- { AS(sched_getparam_args), (sy_call_t *)sys_sched_getparam, AUE_SCHED_GETPARAM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 155 = sched_getparam */
+ { AS(linux_sched_setparam_args), (sy_call_t *)linux_sched_setparam, AUE_SCHED_SETPARAM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 154 = linux_sched_setparam */
+ { AS(linux_sched_getparam_args), (sy_call_t *)linux_sched_getparam, AUE_SCHED_GETPARAM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 155 = linux_sched_getparam */
{ AS(linux_sched_setscheduler_args), (sy_call_t *)linux_sched_setscheduler, AUE_SCHED_SETSCHEDULER, NULL, 0, 0, 0, SY_THR_STATIC }, /* 156 = linux_sched_setscheduler */
{ AS(linux_sched_getscheduler_args), (sy_call_t *)linux_sched_getscheduler, AUE_SCHED_GETSCHEDULER, NULL, 0, 0, 0, SY_THR_STATIC }, /* 157 = linux_sched_getscheduler */
{ 0, (sy_call_t *)sys_sched_yield, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 158 = sched_yield */
@@ -197,7 +197,7 @@ struct sysent linux_sysent[] = {
{ AS(linux_rt_sigprocmask_args), (sy_call_t *)linux_rt_sigprocmask, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 175 = linux_rt_sigprocmask */
{ AS(linux_rt_sigpending_args), (sy_call_t *)linux_rt_sigpending, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 176 = linux_rt_sigpending */
{ AS(linux_rt_sigtimedwait_args), (sy_call_t *)linux_rt_sigtimedwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 177 = linux_rt_sigtimedwait */
- { 0, (sy_call_t *)linux_rt_sigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 178 = linux_rt_sigqueueinfo */
+ { AS(linux_rt_sigqueueinfo_args), (sy_call_t *)linux_rt_sigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 178 = linux_rt_sigqueueinfo */
{ AS(linux_rt_sigsuspend_args), (sy_call_t *)linux_rt_sigsuspend, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 179 = linux_rt_sigsuspend */
{ AS(linux_pread_args), (sy_call_t *)linux_pread, AUE_PREAD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 180 = linux_pread */
{ AS(linux_pwrite_args), (sy_call_t *)linux_pwrite, AUE_PWRITE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 181 = linux_pwrite */
@@ -273,9 +273,9 @@ struct sysent linux_sysent[] = {
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 251 = */
{ AS(linux_exit_group_args), (sy_call_t *)linux_exit_group, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 252 = linux_exit_group */
{ 0, (sy_call_t *)linux_lookup_dcookie, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 253 = linux_lookup_dcookie */
- { 0, (sy_call_t *)linux_epoll_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 254 = linux_epoll_create */
- { 0, (sy_call_t *)linux_epoll_ctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 255 = linux_epoll_ctl */
- { 0, (sy_call_t *)linux_epoll_wait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 256 = linux_epoll_wait */
+ { AS(linux_epoll_create_args), (sy_call_t *)linux_epoll_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 254 = linux_epoll_create */
+ { AS(linux_epoll_ctl_args), (sy_call_t *)linux_epoll_ctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 255 = linux_epoll_ctl */
+ { AS(linux_epoll_wait_args), (sy_call_t *)linux_epoll_wait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 256 = linux_epoll_wait */
{ 0, (sy_call_t *)linux_remap_file_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 257 = linux_remap_file_pages */
{ AS(linux_set_tid_address_args), (sy_call_t *)linux_set_tid_address, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 258 = linux_set_tid_address */
{ AS(linux_timer_create_args), (sy_call_t *)linux_timer_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 259 = linux_timer_create */
@@ -303,7 +303,7 @@ struct sysent linux_sysent[] = {
{ 0, (sy_call_t *)linux_mq_notify, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 281 = linux_mq_notify */
{ 0, (sy_call_t *)linux_mq_getsetattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 282 = linux_mq_getsetattr */
{ 0, (sy_call_t *)linux_kexec_load, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 283 = linux_kexec_load */
- { 0, (sy_call_t *)linux_waitid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 284 = linux_waitid */
+ { AS(linux_waitid_args), (sy_call_t *)linux_waitid, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 284 = linux_waitid */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 285 = */
{ 0, (sy_call_t *)linux_add_key, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 286 = linux_add_key */
{ 0, (sy_call_t *)linux_request_key, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 287 = linux_request_key */
@@ -327,8 +327,8 @@ struct sysent linux_sysent[] = {
{ AS(linux_readlinkat_args), (sy_call_t *)linux_readlinkat, AUE_READLINKAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 305 = linux_readlinkat */
{ AS(linux_fchmodat_args), (sy_call_t *)linux_fchmodat, AUE_FCHMODAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 306 = linux_fchmodat */
{ AS(linux_faccessat_args), (sy_call_t *)linux_faccessat, AUE_FACCESSAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 307 = linux_faccessat */
- { 0, (sy_call_t *)linux_pselect6, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 308 = linux_pselect6 */
- { 0, (sy_call_t *)linux_ppoll, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 309 = linux_ppoll */
+ { AS(linux_pselect6_args), (sy_call_t *)linux_pselect6, AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 308 = linux_pselect6 */
+ { AS(linux_ppoll_args), (sy_call_t *)linux_ppoll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 309 = linux_ppoll */
{ 0, (sy_call_t *)linux_unshare, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 310 = linux_unshare */
{ AS(linux_set_robust_list_args), (sy_call_t *)linux_set_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 311 = linux_set_robust_list */
{ AS(linux_get_robust_list_args), (sy_call_t *)linux_get_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 312 = linux_get_robust_list */
@@ -338,34 +338,35 @@ struct sysent linux_sysent[] = {
{ 0, (sy_call_t *)linux_vmsplice, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 316 = linux_vmsplice */
{ 0, (sy_call_t *)linux_move_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 317 = linux_move_pages */
{ 0, (sy_call_t *)linux_getcpu, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 318 = linux_getcpu */
- { 0, (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 319 = linux_epoll_pwait */
- { 0, (sy_call_t *)linux_utimensat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 320 = linux_utimensat */
+ { AS(linux_epoll_pwait_args), (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 319 = linux_epoll_pwait */
+ { AS(linux_utimensat_args), (sy_call_t *)linux_utimensat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 320 = linux_utimensat */
{ 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 321 = linux_signalfd */
{ 0, (sy_call_t *)linux_timerfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 322 = linux_timerfd_create */
- { 0, (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 323 = linux_eventfd */
- { 0, (sy_call_t *)linux_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 324 = linux_fallocate */
+ { AS(linux_eventfd_args), (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 323 = linux_eventfd */
+ { AS(linux_fallocate_args), (sy_call_t *)linux_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 324 = linux_fallocate */
{ 0, (sy_call_t *)linux_timerfd_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 325 = linux_timerfd_settime */
{ 0, (sy_call_t *)linux_timerfd_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 326 = linux_timerfd_gettime */
{ 0, (sy_call_t *)linux_signalfd4, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 327 = linux_signalfd4 */
- { 0, (sy_call_t *)linux_eventfd2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 328 = linux_eventfd2 */
- { 0, (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 329 = linux_epoll_create1 */
- { 0, (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 330 = linux_dup3 */
+ { AS(linux_eventfd2_args), (sy_call_t *)linux_eventfd2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 328 = linux_eventfd2 */
+ { AS(linux_epoll_create1_args), (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 329 = linux_epoll_create1 */
+ { AS(linux_dup3_args), (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 330 = linux_dup3 */
{ AS(linux_pipe2_args), (sy_call_t *)linux_pipe2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 331 = linux_pipe2 */
{ 0, (sy_call_t *)linux_inotify_init1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 332 = linux_inotify_init1 */
{ 0, (sy_call_t *)linux_preadv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 333 = linux_preadv */
{ 0, (sy_call_t *)linux_pwritev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 334 = linux_pwritev */
{ 0, (sy_call_t *)linux_rt_tsigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 335 = linux_rt_tsigqueueinfo */
{ 0, (sy_call_t *)linux_perf_event_open, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 336 = linux_perf_event_open */
- { 0, (sy_call_t *)linux_recvmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = linux_recvmmsg */
+ { AS(linux_recvmmsg_args), (sy_call_t *)linux_recvmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = linux_recvmmsg */
{ 0, (sy_call_t *)linux_fanotify_init, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = linux_fanotify_init */
{ 0, (sy_call_t *)linux_fanotify_mark, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 339 = linux_fanotify_mark */
- { 0, (sy_call_t *)linux_prlimit64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 340 = linux_prlimit64 */
+ { AS(linux_prlimit64_args), (sy_call_t *)linux_prlimit64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 340 = linux_prlimit64 */
{ 0, (sy_call_t *)linux_name_to_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 341 = linux_name_to_handle_at */
{ 0, (sy_call_t *)linux_open_by_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 342 = linux_open_by_handle_at */
{ 0, (sy_call_t *)linux_clock_adjtime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 343 = linux_clock_adjtime */
- { 0, (sy_call_t *)linux_syncfs, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 344 = linux_syncfs */
- { 0, (sy_call_t *)linux_sendmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 345 = linux_sendmmsg */
+ { AS(linux_syncfs_args), (sy_call_t *)linux_syncfs, AUE_SYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 344 = linux_syncfs */
+ { AS(linux_sendmmsg_args), (sy_call_t *)linux_sendmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 345 = linux_sendmmsg */
{ 0, (sy_call_t *)linux_setns, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 346 = linux_setns */
{ 0, (sy_call_t *)linux_process_vm_readv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 347 = linux_process_vm_readv */
{ 0, (sy_call_t *)linux_process_vm_writev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 348 = linux_process_vm_writev */
+ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 349 = nosys */
};
diff --git a/sys/amd64/linux32/linux32_systrace_args.c b/sys/amd64/linux32/linux32_systrace_args.c
index 2d563ac..b6ccd33 100644
--- a/sys/amd64/linux32/linux32_systrace_args.c
+++ b/sys/amd64/linux32/linux32_systrace_args.c
@@ -12,9 +12,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
int64_t *iarg = (int64_t *) uarg;
switch (sysnum) {
#define nosys linux_nosys
- /* sys_exit */
+ /* linux_exit */
case 1: {
- struct sys_exit_args *p = params;
+ struct linux_exit_args *p = params;
iarg[0] = p->rval; /* int */
*n_args = 1;
break;
@@ -1043,19 +1043,19 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
*n_args = 0;
break;
}
- /* sched_setparam */
+ /* linux_sched_setparam */
case 154: {
- struct sched_setparam_args *p = params;
- iarg[0] = p->pid; /* pid_t */
- uarg[1] = (intptr_t) p->param; /* const struct sched_param * */
+ struct linux_sched_setparam_args *p = params;
+ iarg[0] = p->pid; /* l_pid_t */
+ uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */
*n_args = 2;
break;
}
- /* sched_getparam */
+ /* linux_sched_getparam */
case 155: {
- struct sched_getparam_args *p = params;
- iarg[0] = p->pid; /* pid_t */
- uarg[1] = (intptr_t) p->param; /* struct sched_param * */
+ struct linux_sched_getparam_args *p = params;
+ iarg[0] = p->pid; /* l_pid_t */
+ uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */
*n_args = 2;
break;
}
@@ -1234,7 +1234,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* linux_rt_sigqueueinfo */
case 178: {
- *n_args = 0;
+ struct linux_rt_sigqueueinfo_args *p = params;
+ iarg[0] = p->pid; /* l_pid_t */
+ iarg[1] = p->sig; /* l_int */
+ uarg[2] = (intptr_t) p->info; /* l_siginfo_t * */
+ *n_args = 3;
break;
}
/* linux_rt_sigsuspend */
@@ -1693,17 +1697,29 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* linux_epoll_create */
case 254: {
- *n_args = 0;
+ struct linux_epoll_create_args *p = params;
+ iarg[0] = p->size; /* l_int */
+ *n_args = 1;
break;
}
/* linux_epoll_ctl */
case 255: {
- *n_args = 0;
+ struct linux_epoll_ctl_args *p = params;
+ iarg[0] = p->epfd; /* l_int */
+ iarg[1] = p->op; /* l_int */
+ iarg[2] = p->fd; /* l_int */
+ uarg[3] = (intptr_t) p->event; /* struct epoll_event * */
+ *n_args = 4;
break;
}
/* linux_epoll_wait */
case 256: {
- *n_args = 0;
+ struct linux_epoll_wait_args *p = params;
+ iarg[0] = p->epfd; /* l_int */
+ uarg[1] = (intptr_t) p->events; /* struct epoll_event * */
+ iarg[2] = p->maxevents; /* l_int */
+ iarg[3] = p->timeout; /* l_int */
+ *n_args = 4;
break;
}
/* linux_remap_file_pages */
@@ -1886,7 +1902,13 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* linux_waitid */
case 284: {
- *n_args = 0;
+ struct linux_waitid_args *p = params;
+ iarg[0] = p->idtype; /* int */
+ iarg[1] = p->id; /* l_pid_t */
+ uarg[2] = (intptr_t) p->info; /* l_siginfo_t * */
+ iarg[3] = p->options; /* int */
+ uarg[4] = (intptr_t) p->rusage; /* struct l_rusage * */
+ *n_args = 5;
break;
}
/* linux_add_key */
@@ -2057,18 +2079,30 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
iarg[0] = p->dfd; /* l_int */
uarg[1] = (intptr_t) p->filename; /* const char * */
iarg[2] = p->amode; /* l_int */
- iarg[3] = p->flag; /* int */
- *n_args = 4;
+ *n_args = 3;
break;
}
/* linux_pselect6 */
case 308: {
- *n_args = 0;
+ struct linux_pselect6_args *p = params;
+ iarg[0] = p->nfds; /* l_int */
+ uarg[1] = (intptr_t) p->readfds; /* l_fd_set * */
+ uarg[2] = (intptr_t) p->writefds; /* l_fd_set * */
+ uarg[3] = (intptr_t) p->exceptfds; /* l_fd_set * */
+ uarg[4] = (intptr_t) p->tsp; /* struct l_timespec * */
+ uarg[5] = (intptr_t) p->sig; /* l_uintptr_t * */
+ *n_args = 6;
break;
}
/* linux_ppoll */
case 309: {
- *n_args = 0;
+ struct linux_ppoll_args *p = params;
+ uarg[0] = (intptr_t) p->fds; /* struct pollfd * */
+ uarg[1] = p->nfds; /* uint32_t */
+ uarg[2] = (intptr_t) p->tsp; /* struct l_timespec * */
+ uarg[3] = (intptr_t) p->sset; /* l_sigset_t * */
+ iarg[4] = p->ssize; /* l_size_t */
+ *n_args = 5;
break;
}
/* linux_unshare */
@@ -2125,12 +2159,23 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* linux_epoll_pwait */
case 319: {
- *n_args = 0;
+ struct linux_epoll_pwait_args *p = params;
+ iarg[0] = p->epfd; /* l_int */
+ uarg[1] = (intptr_t) p->events; /* struct epoll_event * */
+ iarg[2] = p->maxevents; /* l_int */
+ iarg[3] = p->timeout; /* l_int */
+ uarg[4] = (intptr_t) p->mask; /* l_sigset_t * */
+ *n_args = 5;
break;
}
/* linux_utimensat */
case 320: {
- *n_args = 0;
+ struct linux_utimensat_args *p = params;
+ iarg[0] = p->dfd; /* l_int */
+ uarg[1] = (intptr_t) p->pathname; /* const char * */
+ uarg[2] = (intptr_t) p->times; /* const struct l_timespec * */
+ iarg[3] = p->flags; /* l_int */
+ *n_args = 4;
break;
}
/* linux_signalfd */
@@ -2145,12 +2190,19 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* linux_eventfd */
case 323: {
- *n_args = 0;
+ struct linux_eventfd_args *p = params;
+ iarg[0] = p->initval; /* l_uint */
+ *n_args = 1;
break;
}
/* linux_fallocate */
case 324: {
- *n_args = 0;
+ struct linux_fallocate_args *p = params;
+ iarg[0] = p->fd; /* l_int */
+ iarg[1] = p->mode; /* l_int */
+ iarg[2] = p->offset; /* l_loff_t */
+ iarg[3] = p->len; /* l_loff_t */
+ *n_args = 4;
break;
}
/* linux_timerfd_settime */
@@ -2170,17 +2222,26 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* linux_eventfd2 */
case 328: {
- *n_args = 0;
+ struct linux_eventfd2_args *p = params;
+ iarg[0] = p->initval; /* l_uint */
+ iarg[1] = p->flags; /* l_int */
+ *n_args = 2;
break;
}
/* linux_epoll_create1 */
case 329: {
- *n_args = 0;
+ struct linux_epoll_create1_args *p = params;
+ iarg[0] = p->flags; /* l_int */
+ *n_args = 1;
break;
}
/* linux_dup3 */
case 330: {
- *n_args = 0;
+ struct linux_dup3_args *p = params;
+ iarg[0] = p->oldfd; /* l_int */
+ iarg[1] = p->newfd; /* l_int */
+ iarg[2] = p->flags; /* l_int */
+ *n_args = 3;
break;
}
/* linux_pipe2 */
@@ -2218,7 +2279,13 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* linux_recvmmsg */
case 337: {
- *n_args = 0;
+ struct linux_recvmmsg_args *p = params;
+ iarg[0] = p->s; /* l_int */
+ uarg[1] = (intptr_t) p->msg; /* struct l_mmsghdr * */
+ iarg[2] = p->vlen; /* l_uint */
+ iarg[3] = p->flags; /* l_uint */
+ uarg[4] = (intptr_t) p->timeout; /* struct l_timespec * */
+ *n_args = 5;
break;
}
/* linux_fanotify_init */
@@ -2233,7 +2300,12 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* linux_prlimit64 */
case 340: {
- *n_args = 0;
+ struct linux_prlimit64_args *p = params;
+ iarg[0] = p->pid; /* l_pid_t */
+ iarg[1] = p->resource; /* l_uint */
+ uarg[2] = (intptr_t) p->new; /* struct rlimit * */
+ uarg[3] = (intptr_t) p->old; /* struct rlimit * */
+ *n_args = 4;
break;
}
/* linux_name_to_handle_at */
@@ -2253,12 +2325,19 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* linux_syncfs */
case 344: {
- *n_args = 0;
+ struct linux_syncfs_args *p = params;
+ iarg[0] = p->fd; /* l_int */
+ *n_args = 1;
break;
}
/* linux_sendmmsg */
case 345: {
- *n_args = 0;
+ struct linux_sendmmsg_args *p = params;
+ iarg[0] = p->s; /* l_int */
+ uarg[1] = (intptr_t) p->msg; /* struct l_mmsghdr * */
+ iarg[2] = p->vlen; /* l_uint */
+ iarg[3] = p->flags; /* l_uint */
+ *n_args = 4;
break;
}
/* linux_setns */
@@ -2287,7 +2366,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
const char *p = NULL;
switch (sysnum) {
#define nosys linux_nosys
- /* sys_exit */
+ /* linux_exit */
case 1:
switch(ndx) {
case 0:
@@ -3848,27 +3927,27 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
/* munlockall */
case 153:
break;
- /* sched_setparam */
+ /* linux_sched_setparam */
case 154:
switch(ndx) {
case 0:
- p = "pid_t";
+ p = "l_pid_t";
break;
case 1:
- p = "const struct sched_param *";
+ p = "struct l_sched_param *";
break;
default:
break;
};
break;
- /* sched_getparam */
+ /* linux_sched_getparam */
case 155:
switch(ndx) {
case 0:
- p = "pid_t";
+ p = "l_pid_t";
break;
case 1:
- p = "struct sched_param *";
+ p = "struct l_sched_param *";
break;
default:
break;
@@ -4161,6 +4240,19 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_rt_sigqueueinfo */
case 178:
+ switch(ndx) {
+ case 0:
+ p = "l_pid_t";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "l_siginfo_t *";
+ break;
+ default:
+ break;
+ };
break;
/* linux_rt_sigsuspend */
case 179:
@@ -4823,12 +4915,51 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_epoll_create */
case 254:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
break;
/* linux_epoll_ctl */
case 255:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ case 3:
+ p = "struct epoll_event *";
+ break;
+ default:
+ break;
+ };
break;
/* linux_epoll_wait */
case 256:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "struct epoll_event *";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ case 3:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
break;
/* linux_remap_file_pages */
case 257:
@@ -5068,6 +5199,25 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_waitid */
case 284:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ case 1:
+ p = "l_pid_t";
+ break;
+ case 2:
+ p = "l_siginfo_t *";
+ break;
+ case 3:
+ p = "int";
+ break;
+ case 4:
+ p = "struct l_rusage *";
+ break;
+ default:
+ break;
+ };
break;
/* linux_add_key */
case 286:
@@ -5327,18 +5477,56 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
case 2:
p = "l_int";
break;
- case 3:
- p = "int";
- break;
default:
break;
};
break;
/* linux_pselect6 */
case 308:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_fd_set *";
+ break;
+ case 2:
+ p = "l_fd_set *";
+ break;
+ case 3:
+ p = "l_fd_set *";
+ break;
+ case 4:
+ p = "struct l_timespec *";
+ break;
+ case 5:
+ p = "l_uintptr_t *";
+ break;
+ default:
+ break;
+ };
break;
/* linux_ppoll */
case 309:
+ switch(ndx) {
+ case 0:
+ p = "struct pollfd *";
+ break;
+ case 1:
+ p = "uint32_t";
+ break;
+ case 2:
+ p = "struct l_timespec *";
+ break;
+ case 3:
+ p = "l_sigset_t *";
+ break;
+ case 4:
+ p = "l_size_t";
+ break;
+ default:
+ break;
+ };
break;
/* linux_unshare */
case 310:
@@ -5392,9 +5580,44 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_epoll_pwait */
case 319:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "struct epoll_event *";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ case 3:
+ p = "l_int";
+ break;
+ case 4:
+ p = "l_sigset_t *";
+ break;
+ default:
+ break;
+ };
break;
/* linux_utimensat */
case 320:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "const char *";
+ break;
+ case 2:
+ p = "const struct l_timespec *";
+ break;
+ case 3:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
break;
/* linux_signalfd */
case 321:
@@ -5404,9 +5627,32 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_eventfd */
case 323:
+ switch(ndx) {
+ case 0:
+ p = "l_uint";
+ break;
+ default:
+ break;
+ };
break;
/* linux_fallocate */
case 324:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "l_loff_t";
+ break;
+ case 3:
+ p = "l_loff_t";
+ break;
+ default:
+ break;
+ };
break;
/* linux_timerfd_settime */
case 325:
@@ -5419,12 +5665,42 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_eventfd2 */
case 328:
+ switch(ndx) {
+ case 0:
+ p = "l_uint";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
break;
/* linux_epoll_create1 */
case 329:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
break;
/* linux_dup3 */
case 330:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
break;
/* linux_pipe2 */
case 331:
@@ -5456,6 +5732,25 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_recvmmsg */
case 337:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "struct l_mmsghdr *";
+ break;
+ case 2:
+ p = "l_uint";
+ break;
+ case 3:
+ p = "l_uint";
+ break;
+ case 4:
+ p = "struct l_timespec *";
+ break;
+ default:
+ break;
+ };
break;
/* linux_fanotify_init */
case 338:
@@ -5465,6 +5760,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_prlimit64 */
case 340:
+ switch(ndx) {
+ case 0:
+ p = "l_pid_t";
+ break;
+ case 1:
+ p = "l_uint";
+ break;
+ case 2:
+ p = "struct rlimit *";
+ break;
+ case 3:
+ p = "struct rlimit *";
+ break;
+ default:
+ break;
+ };
break;
/* linux_name_to_handle_at */
case 341:
@@ -5477,9 +5788,32 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_syncfs */
case 344:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
break;
/* linux_sendmmsg */
case 345:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "struct l_mmsghdr *";
+ break;
+ case 2:
+ p = "l_uint";
+ break;
+ case 3:
+ p = "l_uint";
+ break;
+ default:
+ break;
+ };
break;
/* linux_setns */
case 346:
@@ -5502,7 +5836,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
const char *p = NULL;
switch (sysnum) {
#define nosys linux_nosys
- /* sys_exit */
+ /* linux_exit */
case 1:
if (ndx == 0 || ndx == 1)
p = "void";
@@ -6112,12 +6446,12 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* munlockall */
case 153:
- /* sched_setparam */
+ /* linux_sched_setparam */
case 154:
if (ndx == 0 || ndx == 1)
p = "int";
break;
- /* sched_getparam */
+ /* linux_sched_getparam */
case 155:
if (ndx == 0 || ndx == 1)
p = "int";
@@ -6220,6 +6554,9 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_rt_sigqueueinfo */
case 178:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_rt_sigsuspend */
case 179:
if (ndx == 0 || ndx == 1)
@@ -6469,10 +6806,19 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
case 253:
/* linux_epoll_create */
case 254:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_epoll_ctl */
case 255:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_epoll_wait */
case 256:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_remap_file_pages */
case 257:
/* linux_set_tid_address */
@@ -6569,6 +6915,9 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
case 283:
/* linux_waitid */
case 284:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_add_key */
case 286:
/* linux_request_key */
@@ -6654,8 +7003,14 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_pselect6 */
case 308:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_ppoll */
case 309:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_unshare */
case 310:
/* linux_set_robust_list */
@@ -6682,16 +7037,28 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
case 318:
/* linux_epoll_pwait */
case 319:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_utimensat */
case 320:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_signalfd */
case 321:
/* linux_timerfd_create */
case 322:
/* linux_eventfd */
case 323:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_fallocate */
case 324:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_timerfd_settime */
case 325:
/* linux_timerfd_gettime */
@@ -6700,10 +7067,19 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
case 327:
/* linux_eventfd2 */
case 328:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_epoll_create1 */
case 329:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_dup3 */
case 330:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_pipe2 */
case 331:
if (ndx == 0 || ndx == 1)
@@ -6721,12 +7097,18 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
case 336:
/* linux_recvmmsg */
case 337:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_fanotify_init */
case 338:
/* linux_fanotify_mark */
case 339:
/* linux_prlimit64 */
case 340:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_name_to_handle_at */
case 341:
/* linux_open_by_handle_at */
@@ -6735,8 +7117,14 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
case 343:
/* linux_syncfs */
case 344:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_sendmmsg */
case 345:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_setns */
case 346:
/* linux_process_vm_readv */
diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c
index c06ce11..4364438 100644
--- a/sys/amd64/linux32/linux32_sysvec.c
+++ b/sys/amd64/linux32/linux32_sysvec.c
@@ -83,11 +83,10 @@ __FBSDID("$FreeBSD$");
#include <compat/linux/linux_misc.h>
#include <compat/linux/linux_signal.h>
#include <compat/linux/linux_util.h>
+#include <compat/linux/linux_vdso.h>
MODULE_VERSION(linux, 1);
-MALLOC_DEFINE(M_LINUX, "linux", "Linux mode structures");
-
#define AUXARGS_ENTRY_32(pos, id, val) \
do { \
suword32(pos++, id); \
@@ -109,15 +108,16 @@ MALLOC_DEFINE(M_LINUX, "linux", "Linux mode structures");
#define LINUX_SYS_linux_rt_sendsig 0
#define LINUX_SYS_linux_sendsig 0
-const char *linux_platform = "i686";
-static int linux_szplatform;
-extern char linux_sigcode[];
-extern int linux_szsigcode;
+const char *linux_kplatform;
+static int linux_szsigcode;
+static vm_object_t linux_shared_page_obj;
+static char *linux_shared_page_mapping;
+extern char _binary_linux32_locore_o_start;
+extern char _binary_linux32_locore_o_end;
extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL];
SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler);
-SET_DECLARE(linux_device_handler_set, struct linux_device_handler);
static int elf_linux_fixup(register_t **stack_base,
struct image_params *iparams);
@@ -127,9 +127,8 @@ static void exec_linux_setregs(struct thread *td,
struct image_params *imgp, u_long stack);
static void linux32_fixlimit(struct rlimit *rl, int which);
static boolean_t linux32_trans_osrel(const Elf_Note *note, int32_t *osrel);
-
-static eventhandler_tag linux_exit_tag;
-static eventhandler_tag linux_exec_tag;
+static void linux_vdso_install(void *param);
+static void linux_vdso_deinstall(void *param);
/*
* Linux syscalls return negative errno's, we do positive and map them
@@ -151,28 +150,6 @@ static int bsd_to_linux_errno[ELAST + 1] = {
-72, -67, -71
};
-int bsd_to_linux_signal[LINUX_SIGTBLSZ] = {
- LINUX_SIGHUP, LINUX_SIGINT, LINUX_SIGQUIT, LINUX_SIGILL,
- LINUX_SIGTRAP, LINUX_SIGABRT, 0, LINUX_SIGFPE,
- LINUX_SIGKILL, LINUX_SIGBUS, LINUX_SIGSEGV, LINUX_SIGSYS,
- LINUX_SIGPIPE, LINUX_SIGALRM, LINUX_SIGTERM, LINUX_SIGURG,
- LINUX_SIGSTOP, LINUX_SIGTSTP, LINUX_SIGCONT, LINUX_SIGCHLD,
- LINUX_SIGTTIN, LINUX_SIGTTOU, LINUX_SIGIO, LINUX_SIGXCPU,
- LINUX_SIGXFSZ, LINUX_SIGVTALRM, LINUX_SIGPROF, LINUX_SIGWINCH,
- 0, LINUX_SIGUSR1, LINUX_SIGUSR2
-};
-
-int linux_to_bsd_signal[LINUX_SIGTBLSZ] = {
- SIGHUP, SIGINT, SIGQUIT, SIGILL,
- SIGTRAP, SIGABRT, SIGBUS, SIGFPE,
- SIGKILL, SIGUSR1, SIGSEGV, SIGUSR2,
- SIGPIPE, SIGALRM, SIGTERM, SIGBUS,
- SIGCHLD, SIGCONT, SIGSTOP, SIGTSTP,
- SIGTTIN, SIGTTOU, SIGURG, SIGXCPU,
- SIGXFSZ, SIGVTALRM, SIGPROF, SIGWINCH,
- SIGIO, SIGURG, SIGSYS
-};
-
#define LINUX_T_UNKNOWN 255
static int _bsd_to_linux_trapcode[] = {
LINUX_T_UNKNOWN, /* 0 */
@@ -219,6 +196,11 @@ struct linux32_ps_strings {
u_int ps_nenvstr; /* the number of environment strings */
};
+LINUX_VDSO_SYM_INTPTR(linux32_sigcode);
+LINUX_VDSO_SYM_INTPTR(linux32_rt_sigcode);
+LINUX_VDSO_SYM_INTPTR(linux32_vsyscall);
+LINUX_VDSO_SYM_CHAR(linux_platform);
+
/*
* If FreeBSD & Linux have a difference of opinion about what a trap
* means, deal with it here.
@@ -246,11 +228,10 @@ elf_linux_fixup(register_t **stack_base, struct image_params *imgp)
{
Elf32_Auxargs *args;
Elf32_Addr *base;
- Elf32_Addr *pos, *uplatform;
+ Elf32_Addr *pos;
struct linux32_ps_strings *arginfo;
arginfo = (struct linux32_ps_strings *)LINUX32_PS_STRINGS;
- uplatform = (Elf32_Addr *)((caddr_t)arginfo - linux_szplatform);
KASSERT(curthread->td_proc == imgp->proc,
("unsafe elf_linux_fixup(), should be curproc"));
@@ -258,6 +239,9 @@ elf_linux_fixup(register_t **stack_base, struct image_params *imgp)
args = (Elf32_Auxargs *)imgp->auxargs;
pos = base + (imgp->args->argc + imgp->args->envc + 2);
+ AUXARGS_ENTRY_32(pos, LINUX_AT_SYSINFO_EHDR,
+ imgp->proc->p_sysent->sv_shared_page_base);
+ AUXARGS_ENTRY_32(pos, LINUX_AT_SYSINFO, linux32_vsyscall);
AUXARGS_ENTRY_32(pos, LINUX_AT_HWCAP, cpu_feature);
/*
@@ -282,7 +266,10 @@ elf_linux_fixup(register_t **stack_base, struct image_params *imgp)
AUXARGS_ENTRY_32(pos, AT_EUID, imgp->proc->p_ucred->cr_svuid);
AUXARGS_ENTRY_32(pos, AT_GID, imgp->proc->p_ucred->cr_rgid);
AUXARGS_ENTRY_32(pos, AT_EGID, imgp->proc->p_ucred->cr_svgid);
- AUXARGS_ENTRY_32(pos, LINUX_AT_PLATFORM, PTROUT(uplatform));
+ AUXARGS_ENTRY_32(pos, LINUX_AT_PLATFORM, PTROUT(linux_platform));
+ AUXARGS_ENTRY(pos, LINUX_AT_RANDOM, PTROUT(imgp->canary));
+ if (imgp->execpathp != 0)
+ AUXARGS_ENTRY(pos, LINUX_AT_EXECFN, PTROUT(imgp->execpathp));
if (args->execfd != -1)
AUXARGS_ENTRY_32(pos, AT_EXECFD, args->execfd);
AUXARGS_ENTRY_32(pos, AT_NULL, 0);
@@ -293,11 +280,9 @@ elf_linux_fixup(register_t **stack_base, struct image_params *imgp)
base--;
suword32(base, (uint32_t)imgp->args->argc);
*stack_base = (register_t *)base;
- return 0;
+ return (0);
}
-extern unsigned long linux_sznonrtsigcode;
-
static void
linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
{
@@ -337,9 +322,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
/*
* Build the argument list for the signal handler.
*/
- if (p->p_sysent->sv_sigtbl)
- if (sig <= p->p_sysent->sv_sigsize)
- sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
+ sig = bsd_to_linux_signal(sig);
bzero(&frame, sizeof(frame));
@@ -352,7 +335,8 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
ksiginfo_to_lsiginfo(ksi, &frame.sf_si, sig);
/*
- * Build the signal context to be used by sigreturn.
+ * Build the signal context to be used by sigreturn
+ * and libgcc unwind.
*/
frame.sf_sc.uc_flags = 0; /* XXX ??? */
frame.sf_sc.uc_link = 0; /* XXX ??? */
@@ -365,11 +349,12 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
bsd_to_linux_sigset(mask, &frame.sf_sc.uc_sigmask);
- frame.sf_sc.uc_mcontext.sc_mask = frame.sf_sc.uc_sigmask.__bits[0];
+ frame.sf_sc.uc_mcontext.sc_mask = frame.sf_sc.uc_sigmask.__mask;
frame.sf_sc.uc_mcontext.sc_edi = regs->tf_rdi;
frame.sf_sc.uc_mcontext.sc_esi = regs->tf_rsi;
frame.sf_sc.uc_mcontext.sc_ebp = regs->tf_rbp;
frame.sf_sc.uc_mcontext.sc_ebx = regs->tf_rbx;
+ frame.sf_sc.uc_mcontext.sc_esp = regs->tf_rsp;
frame.sf_sc.uc_mcontext.sc_edx = regs->tf_rdx;
frame.sf_sc.uc_mcontext.sc_ecx = regs->tf_rcx;
frame.sf_sc.uc_mcontext.sc_eax = regs->tf_rax;
@@ -411,7 +396,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
* Build context to run handler in.
*/
regs->tf_rsp = PTROUT(fp);
- regs->tf_rip = p->p_sysent->sv_sigcode_base + linux_sznonrtsigcode;
+ regs->tf_rip = linux32_rt_sigcode;
regs->tf_rflags &= ~(PSL_T | PSL_D);
regs->tf_cs = _ucode32sel;
regs->tf_ss = _udatasel;
@@ -445,7 +430,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
struct trapframe *regs;
struct l_sigframe *fp, frame;
l_sigset_t lmask;
- int oonstack, i;
+ int oonstack;
int sig, code;
sig = ksi->ksi_signo;
@@ -483,9 +468,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
/*
* Build the argument list for the signal handler.
*/
- if (p->p_sysent->sv_sigtbl)
- if (sig <= p->p_sysent->sv_sigsize)
- sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
+ sig = bsd_to_linux_signal(sig);
bzero(&frame, sizeof(frame));
@@ -497,7 +480,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
/*
* Build the signal context to be used by sigreturn.
*/
- frame.sf_sc.sc_mask = lmask.__bits[0];
+ frame.sf_sc.sc_mask = lmask.__mask;
frame.sf_sc.sc_gs = regs->tf_gs;
frame.sf_sc.sc_fs = regs->tf_fs;
frame.sf_sc.sc_es = regs->tf_es;
@@ -506,6 +489,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
frame.sf_sc.sc_esi = regs->tf_rsi;
frame.sf_sc.sc_ebp = regs->tf_rbp;
frame.sf_sc.sc_ebx = regs->tf_rbx;
+ frame.sf_sc.sc_esp = regs->tf_rsp;
frame.sf_sc.sc_edx = regs->tf_rdx;
frame.sf_sc.sc_ecx = regs->tf_rcx;
frame.sf_sc.sc_eax = regs->tf_rax;
@@ -518,8 +502,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
frame.sf_sc.sc_cr2 = (u_int32_t)(uintptr_t)ksi->ksi_addr;
frame.sf_sc.sc_trapno = bsd_to_linux_trapcode(code);
- for (i = 0; i < (LINUX_NSIG_WORDS-1); i++)
- frame.sf_extramask[i] = lmask.__bits[i+1];
+ frame.sf_extramask[0] = lmask.__mask;
if (copyout(&frame, fp, sizeof(frame)) != 0) {
/*
@@ -534,7 +517,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
* Build context to run handler in.
*/
regs->tf_rsp = PTROUT(fp);
- regs->tf_rip = p->p_sysent->sv_sigcode_base;
+ regs->tf_rip = linux32_sigcode;
regs->tf_rflags &= ~(PSL_T | PSL_D);
regs->tf_cs = _ucode32sel;
regs->tf_ss = _udatasel;
@@ -565,7 +548,7 @@ linux_sigreturn(struct thread *td, struct linux_sigreturn_args *args)
struct trapframe *regs;
sigset_t bmask;
l_sigset_t lmask;
- int eflags, i;
+ int eflags;
ksiginfo_t ksi;
regs = td->td_frame;
@@ -606,9 +589,8 @@ linux_sigreturn(struct thread *td, struct linux_sigreturn_args *args)
return(EINVAL);
}
- lmask.__bits[0] = frame.sf_sc.sc_mask;
- for (i = 0; i < (LINUX_NSIG_WORDS-1); i++)
- lmask.__bits[i+1] = frame.sf_extramask[i];
+ lmask.__mask = frame.sf_sc.sc_mask;
+ lmask.__mask = frame.sf_extramask[0];
linux_to_bsd_sigset(&lmask, &bmask);
kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0);
@@ -758,7 +740,8 @@ linux32_fetch_syscall_args(struct thread *td, struct syscall_args *sa)
sa->code = frame->tf_rax;
if (sa->code >= p->p_sysent->sv_size)
- sa->callp = &p->p_sysent->sv_table[0];
+ /* nosys */
+ sa->callp = &p->p_sysent->sv_table[LINUX_SYS_MAXSYSCALL];
else
sa->callp = &p->p_sysent->sv_table[sa->code];
sa->narg = sa->callp->sy_narg;
@@ -862,21 +845,36 @@ linux_copyout_strings(struct image_params *imgp)
char *stringp, *destp;
u_int32_t *stack_base;
struct linux32_ps_strings *arginfo;
+ char canary[LINUX_AT_RANDOM_LEN];
+ size_t execpath_len;
/*
* Calculate string base and vector table pointers.
- * Also deal with signal trampoline code for this exec type.
*/
+ if (imgp->execpath != NULL && imgp->auxargs != NULL)
+ execpath_len = strlen(imgp->execpath) + 1;
+ else
+ execpath_len = 0;
+
arginfo = (struct linux32_ps_strings *)LINUX32_PS_STRINGS;
- destp = (caddr_t)arginfo - SPARE_USRSPACE - linux_szplatform -
- roundup((ARG_MAX - imgp->args->stringspace),
- sizeof(char *));
+ destp = (caddr_t)arginfo - SPARE_USRSPACE -
+ roundup(sizeof(canary), sizeof(char *)) -
+ roundup(execpath_len, sizeof(char *)) -
+ roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *));
+
+ if (execpath_len != 0) {
+ imgp->execpathp = (uintptr_t)arginfo - execpath_len;
+ copyout(imgp->execpath, (void *)imgp->execpathp, execpath_len);
+ }
/*
- * Install LINUX_PLATFORM
+ * Prepare the canary for SSP.
*/
- copyout(linux_platform, ((caddr_t)arginfo - linux_szplatform),
- linux_szplatform);
+ arc4rand(canary, sizeof(canary), 0);
+ imgp->canary = (uintptr_t)arginfo -
+ roundup(execpath_len, sizeof(char *)) -
+ roundup(sizeof(canary), sizeof(char *));
+ copyout(canary, (void *)imgp->canary, sizeof(canary));
/*
* If we have a valid auxargs ptr, prepare some room
@@ -970,6 +968,13 @@ static u_long linux32_maxvmem = LINUX32_MAXVMEM;
SYSCTL_ULONG(_compat_linux32, OID_AUTO, maxvmem, CTLFLAG_RW,
&linux32_maxvmem, 0, "");
+#if defined(DEBUG)
+SYSCTL_PROC(_compat_linux32, OID_AUTO, debug,
+ CTLTYPE_STRING | CTLFLAG_RW,
+ 0, 0, linux_sysctl_debug, "A",
+ "Linux debugging control");
+#endif
+
static void
linux32_fixlimit(struct rlimit *rl, int which)
{
@@ -1006,14 +1011,14 @@ struct sysentvec elf_linux_sysvec = {
.sv_size = LINUX_SYS_MAXSYSCALL,
.sv_table = linux_sysent,
.sv_mask = 0,
- .sv_sigsize = LINUX_SIGTBLSZ,
- .sv_sigtbl = bsd_to_linux_signal,
+ .sv_sigsize = 0,
+ .sv_sigtbl = NULL,
.sv_errsize = ELAST + 1,
.sv_errtbl = bsd_to_linux_errno,
.sv_transtrap = translate_traps,
.sv_fixup = elf_linux_fixup,
.sv_sendsig = linux_sendsig,
- .sv_sigcode = linux_sigcode,
+ .sv_sigcode = &_binary_linux32_locore_o_start,
.sv_szsigcode = &linux_szsigcode,
.sv_prepsyscall = NULL,
.sv_name = "Linux ELF32",
@@ -1037,8 +1042,44 @@ struct sysentvec elf_linux_sysvec = {
.sv_shared_page_base = LINUX32_SHAREDPAGE,
.sv_shared_page_len = PAGE_SIZE,
.sv_schedtail = linux_schedtail,
+ .sv_thread_detach = linux_thread_detach,
};
-INIT_SYSENTVEC(elf_sysvec, &elf_linux_sysvec);
+
+static void
+linux_vdso_install(void *param)
+{
+
+ linux_szsigcode = (&_binary_linux32_locore_o_end -
+ &_binary_linux32_locore_o_start);
+
+ if (linux_szsigcode > elf_linux_sysvec.sv_shared_page_len)
+ panic("Linux invalid vdso size\n");
+
+ __elfN(linux_vdso_fixup)(&elf_linux_sysvec);
+
+ linux_shared_page_obj = __elfN(linux_shared_page_init)
+ (&linux_shared_page_mapping);
+
+ __elfN(linux_vdso_reloc)(&elf_linux_sysvec, LINUX32_SHAREDPAGE);
+
+ bcopy(elf_linux_sysvec.sv_sigcode, linux_shared_page_mapping,
+ linux_szsigcode);
+ elf_linux_sysvec.sv_shared_page_obj = linux_shared_page_obj;
+
+ linux_kplatform = linux_shared_page_mapping +
+ (linux_platform - (caddr_t)LINUX32_SHAREDPAGE);
+}
+SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_ANY,
+ (sysinit_cfunc_t)linux_vdso_install, NULL);
+
+static void
+linux_vdso_deinstall(void *param)
+{
+
+ __elfN(linux_shared_page_fini)(linux_shared_page_obj);
+};
+SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER_FIRST,
+ (sysinit_cfunc_t)linux_vdso_deinstall, NULL);
static char GNU_ABI_VENDOR[] = "GNU";
static int GNULINUX_ABI_DESC = 0;
@@ -1110,7 +1151,6 @@ linux_elf_modevent(module_t mod, int type, void *data)
Elf32_Brandinfo **brandinfo;
int error;
struct linux_ioctl_handler **lihp;
- struct linux_device_handler **ldhp;
error = 0;
@@ -1123,19 +1163,8 @@ linux_elf_modevent(module_t mod, int type, void *data)
if (error == 0) {
SET_FOREACH(lihp, linux_ioctl_handler_set)
linux_ioctl_register_handler(*lihp);
- SET_FOREACH(ldhp, linux_device_handler_set)
- linux_device_register_handler(*ldhp);
- mtx_init(&emul_lock, "emuldata lock", NULL, MTX_DEF);
- sx_init(&emul_shared_lock, "emuldata->shared lock");
LIST_INIT(&futex_list);
mtx_init(&futex_mtx, "ftllk", NULL, MTX_DEF);
- linux_exit_tag = EVENTHANDLER_REGISTER(process_exit,
- linux_proc_exit, NULL, 1000);
- linux_exec_tag = EVENTHANDLER_REGISTER(process_exec,
- linux_proc_exec, NULL, 1000);
- linux_szplatform = roundup(strlen(linux_platform) + 1,
- sizeof(char *));
- linux_osd_jail_register();
stclohz = (stathz ? stathz : hz);
if (bootverbose)
printf("Linux ELF exec handler installed\n");
@@ -1156,23 +1185,16 @@ linux_elf_modevent(module_t mod, int type, void *data)
if (error == 0) {
SET_FOREACH(lihp, linux_ioctl_handler_set)
linux_ioctl_unregister_handler(*lihp);
- SET_FOREACH(ldhp, linux_device_handler_set)
- linux_device_unregister_handler(*ldhp);
- mtx_destroy(&emul_lock);
- sx_destroy(&emul_shared_lock);
mtx_destroy(&futex_mtx);
- EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag);
- EVENTHANDLER_DEREGISTER(process_exec, linux_exec_tag);
- linux_osd_jail_deregister();
if (bootverbose)
printf("Linux ELF exec handler removed\n");
} else
printf("Could not deinstall ELF interpreter entry\n");
break;
default:
- return EOPNOTSUPP;
+ return (EOPNOTSUPP);
}
- return error;
+ return (error);
}
static moduledata_t linux_elf_mod = {
@@ -1182,3 +1204,4 @@ static moduledata_t linux_elf_mod = {
};
DECLARE_MODULE_TIED(linuxelf, linux_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY);
+MODULE_DEPEND(linuxelf, linux_common, 1, 1, 1);
diff --git a/sys/amd64/linux32/linux32_vdso.lds.s b/sys/amd64/linux32/linux32_vdso.lds.s
new file mode 100644
index 0000000..a49c209
--- /dev/null
+++ b/sys/amd64/linux32/linux32_vdso.lds.s
@@ -0,0 +1,66 @@
+/*
+ * Linker script for 32-bit vDSO.
+ * Copied from Linux kernel arch/x86/vdso/vdso-layout.lds.S
+ * and arch/x86/vdso/vdso32/vdso32.lds.S
+ *
+ * $FreeBSD$
+ */
+
+SECTIONS
+{
+ . = . + SIZEOF_HEADERS;
+
+ .hash : { *(.hash) } :text
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+
+ .note : { *(.note.*) } :text :note
+
+ .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
+ .eh_frame : { KEEP (*(.eh_frame)) } :text
+
+ .dynamic : { *(.dynamic) } :text :dynamic
+
+ .rodata : { *(.rodata*) } :text
+ .data : {
+ *(.data*)
+ *(.sdata*)
+ *(.got.plt) *(.got)
+ *(.gnu.linkonce.d.*)
+ *(.bss*)
+ *(.dynbss*)
+ *(.gnu.linkonce.b.*)
+ }
+
+ .altinstructions : { *(.altinstructions) }
+ .altinstr_replacement : { *(.altinstr_replacement) }
+
+ . = ALIGN(0x100);
+ .text : { *(.text*) } :text =0x90909090
+}
+
+PHDRS
+{
+ text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
+ dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
+ note PT_NOTE FLAGS(4); /* PF_R */
+ eh_frame_hdr PT_GNU_EH_FRAME;
+}
+
+ENTRY(linux32_vsyscall);
+
+VERSION
+{
+ LINUX_2.5 {
+ global:
+ linux32_vsyscall;
+ linux32_sigcode;
+ linux32_rt_sigcode;
+ linux_platform;
+ local: *;
+ };
+}
diff --git a/sys/amd64/linux32/syscalls.master b/sys/amd64/linux32/syscalls.master
index 5b39dc3..5f688f3 100644
--- a/sys/amd64/linux32/syscalls.master
+++ b/sys/amd64/linux32/syscalls.master
@@ -38,8 +38,7 @@
; #ifdef's, etc. may be included, and are copied to the output files.
0 AUE_NULL UNIMPL setup
-1 AUE_EXIT NOPROTO { void sys_exit(int rval); } exit \
- sys_exit_args void
+1 AUE_EXIT STD { void linux_exit(int rval); }
2 AUE_FORK STD { int linux_fork(void); }
3 AUE_NULL NOPROTO { int read(int fd, char *buf, \
u_int nbyte); }
@@ -268,10 +267,10 @@
151 AUE_MUNLOCK NOPROTO { int munlock(const void *addr, size_t len); }
152 AUE_MLOCKALL NOPROTO { int mlockall(int how); }
153 AUE_MUNLOCKALL NOPROTO { int munlockall(void); }
-154 AUE_SCHED_SETPARAM NOPROTO { int sched_setparam(pid_t pid, \
- const struct sched_param *param); }
-155 AUE_SCHED_GETPARAM NOPROTO { int sched_getparam(pid_t pid, \
- struct sched_param *param); }
+154 AUE_SCHED_SETPARAM STD { int linux_sched_setparam(l_pid_t pid, \
+ struct l_sched_param *param); }
+155 AUE_SCHED_GETPARAM STD { int linux_sched_getparam(l_pid_t pid, \
+ struct l_sched_param *param); }
156 AUE_SCHED_SETSCHEDULER STD { int linux_sched_setscheduler( \
l_pid_t pid, l_int policy, \
struct l_sched_param *param); }
@@ -319,7 +318,8 @@
l_siginfo_t *ptr, \
struct l_timeval *timeout, \
l_size_t sigsetsize); }
-178 AUE_NULL STD { int linux_rt_sigqueueinfo(void); }
+178 AUE_NULL STD { int linux_rt_sigqueueinfo(l_pid_t pid, l_int sig, \
+ l_siginfo_t *info); }
179 AUE_NULL STD { int linux_rt_sigsuspend( \
l_sigset_t *newset, \
l_size_t sigsetsize); }
@@ -430,9 +430,11 @@
251 AUE_NULL UNIMPL
252 AUE_EXIT STD { int linux_exit_group(int error_code); }
253 AUE_NULL STD { int linux_lookup_dcookie(void); }
-254 AUE_NULL STD { int linux_epoll_create(void); }
-255 AUE_NULL STD { int linux_epoll_ctl(void); }
-256 AUE_NULL STD { int linux_epoll_wait(void); }
+254 AUE_NULL STD { int linux_epoll_create(l_int size); }
+255 AUE_NULL STD { int linux_epoll_ctl(l_int epfd, l_int op, l_int fd, \
+ struct epoll_event *event); }
+256 AUE_NULL STD { int linux_epoll_wait(l_int epfd, struct epoll_event *events, \
+ l_int maxevents, l_int timeout); }
257 AUE_NULL STD { int linux_remap_file_pages(void); }
258 AUE_NULL STD { int linux_set_tid_address(int *tidptr); }
259 AUE_NULL STD { int linux_timer_create(clockid_t clock_id, \
@@ -467,7 +469,9 @@
281 AUE_NULL STD { int linux_mq_notify(void); }
282 AUE_NULL STD { int linux_mq_getsetattr(void); }
283 AUE_NULL STD { int linux_kexec_load(void); }
-284 AUE_NULL STD { int linux_waitid(void); }
+284 AUE_WAIT6 STD { int linux_waitid(int idtype, l_pid_t id, \
+ l_siginfo_t *info, int options, \
+ struct l_rusage *rusage); }
285 AUE_NULL UNIMPL
; linux 2.6.11:
286 AUE_NULL STD { int linux_add_key(void); }
@@ -505,9 +509,13 @@
char *buf, l_int bufsiz); }
306 AUE_FCHMODAT STD { int linux_fchmodat(l_int dfd, const char *filename, \
l_mode_t mode); }
-307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, l_int amode, int flag); }
-308 AUE_NULL STD { int linux_pselect6(void); }
-309 AUE_NULL STD { int linux_ppoll(void); }
+307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, \
+ l_int amode); }
+308 AUE_SELECT STD { int linux_pselect6(l_int nfds, l_fd_set *readfds, \
+ l_fd_set *writefds, l_fd_set *exceptfds, \
+ struct l_timespec *tsp, l_uintptr_t *sig); }
+309 AUE_POLL STD { int linux_ppoll(struct pollfd *fds, uint32_t nfds, \
+ struct l_timespec *tsp, l_sigset_t *sset, l_size_t ssize); }
310 AUE_NULL STD { int linux_unshare(void); }
; linux 2.6.17:
311 AUE_NULL STD { int linux_set_robust_list(struct linux_robust_list_head *head, \
@@ -522,22 +530,26 @@
317 AUE_NULL STD { int linux_move_pages(void); }
; linux 2.6.19:
318 AUE_NULL STD { int linux_getcpu(void); }
-319 AUE_NULL STD { int linux_epoll_pwait(void); }
+319 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \
+ l_int maxevents, l_int timeout, l_sigset_t *mask); }
; linux 2.6.22:
-320 AUE_NULL STD { int linux_utimensat(void); }
+320 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \
+ const struct l_timespec *times, l_int flags); }
321 AUE_NULL STD { int linux_signalfd(void); }
322 AUE_NULL STD { int linux_timerfd_create(void); }
-323 AUE_NULL STD { int linux_eventfd(void); }
+323 AUE_NULL STD { int linux_eventfd(l_uint initval); }
; linux 2.6.23:
-324 AUE_NULL STD { int linux_fallocate(void); }
+324 AUE_NULL STD { int linux_fallocate(l_int fd, l_int mode, \
+ l_loff_t offset, l_loff_t len); }
; linux 2.6.25:
325 AUE_NULL STD { int linux_timerfd_settime(void); }
326 AUE_NULL STD { int linux_timerfd_gettime(void); }
; linux 2.6.27:
327 AUE_NULL STD { int linux_signalfd4(void); }
-328 AUE_NULL STD { int linux_eventfd2(void); }
-329 AUE_NULL STD { int linux_epoll_create1(void); }
-330 AUE_NULL STD { int linux_dup3(void); }
+328 AUE_NULL STD { int linux_eventfd2(l_uint initval, l_int flags); }
+329 AUE_NULL STD { int linux_epoll_create1(l_int flags); }
+330 AUE_NULL STD { int linux_dup3(l_int oldfd, \
+ l_int newfd, l_int flags); }
331 AUE_NULL STD { int linux_pipe2(l_int *pipefds, l_int flags); }
332 AUE_NULL STD { int linux_inotify_init1(void); }
; linux 2.6.30:
@@ -547,17 +559,26 @@
335 AUE_NULL STD { int linux_rt_tsigqueueinfo(void); }
336 AUE_NULL STD { int linux_perf_event_open(void); }
; linux 2.6.33:
-337 AUE_NULL STD { int linux_recvmmsg(void); }
+337 AUE_NULL STD { int linux_recvmmsg(l_int s, \
+ struct l_mmsghdr *msg, l_uint vlen, \
+ l_uint flags, struct l_timespec *timeout); }
338 AUE_NULL STD { int linux_fanotify_init(void); }
339 AUE_NULL STD { int linux_fanotify_mark(void); }
; linux 2.6.36:
-340 AUE_NULL STD { int linux_prlimit64(void); }
+340 AUE_NULL STD { int linux_prlimit64(l_pid_t pid, \
+ l_uint resource, \
+ struct rlimit *new, \
+ struct rlimit *old); }
; later:
341 AUE_NULL STD { int linux_name_to_handle_at(void); }
342 AUE_NULL STD { int linux_open_by_handle_at(void); }
343 AUE_NULL STD { int linux_clock_adjtime(void); }
-344 AUE_NULL STD { int linux_syncfs(void); }
-345 AUE_NULL STD { int linux_sendmmsg(void); }
+344 AUE_SYNC STD { int linux_syncfs(l_int fd); }
+345 AUE_NULL STD { int linux_sendmmsg(l_int s, \
+ struct l_mmsghdr *msg, l_uint vlen, \
+ l_uint flags); }
346 AUE_NULL STD { int linux_setns(void); }
347 AUE_NULL STD { int linux_process_vm_readv(void); }
348 AUE_NULL STD { int linux_process_vm_writev(void); }
+; please, keep this line at the end.
+349 AUE_NULL UNIMPL nosys
diff --git a/sys/amd64/vmm/amd/svm.c b/sys/amd64/vmm/amd/svm.c
index 20e8f76..b25d69d 100644
--- a/sys/amd64/vmm/amd/svm.c
+++ b/sys/amd64/vmm/amd/svm.c
@@ -102,8 +102,8 @@ static MALLOC_DEFINE(M_SVM_VLAPIC, "svm-vlapic", "svm-vlapic");
/* Per-CPU context area. */
extern struct pcpu __pcpu[];
-static uint32_t svm_feature; /* AMD SVM features. */
-SYSCTL_UINT(_hw_vmm_svm, OID_AUTO, features, CTLFLAG_RD, &svm_feature, 0,
+static uint32_t svm_feature = ~0U; /* AMD SVM features. */
+SYSCTL_UINT(_hw_vmm_svm, OID_AUTO, features, CTLFLAG_RDTUN, &svm_feature, 0,
"SVM features advertised by CPUID.8000000AH:EDX");
static int disable_npf_assist;
@@ -112,7 +112,7 @@ SYSCTL_INT(_hw_vmm_svm, OID_AUTO, disable_npf_assist, CTLFLAG_RWTUN,
/* Maximum ASIDs supported by the processor */
static uint32_t nasid;
-SYSCTL_UINT(_hw_vmm_svm, OID_AUTO, num_asids, CTLFLAG_RD, &nasid, 0,
+SYSCTL_UINT(_hw_vmm_svm, OID_AUTO, num_asids, CTLFLAG_RDTUN, &nasid, 0,
"Number of ASIDs supported by this processor");
/* Current ASID generation for each host cpu */
@@ -174,9 +174,14 @@ check_svm_features(void)
/* CPUID Fn8000_000A is for SVM */
do_cpuid(0x8000000A, regs);
- svm_feature = regs[3];
+ svm_feature &= regs[3];
- nasid = regs[1];
+ /*
+ * The number of ASIDs can be configured to be less than what is
+ * supported by the hardware but not more.
+ */
+ if (nasid == 0 || nasid > regs[1])
+ nasid = regs[1];
KASSERT(nasid > 1, ("Insufficient ASIDs for guests: %#x", nasid));
/* bhyve requires the Nested Paging feature */
@@ -1900,7 +1905,7 @@ enable_gintr(void)
*/
static int
svm_vmrun(void *arg, int vcpu, register_t rip, pmap_t pmap,
- void *rend_cookie, void *suspended_cookie)
+ struct vm_eventinfo *evinfo)
{
struct svm_regctx *gctx;
struct svm_softc *svm_sc;
@@ -1975,18 +1980,24 @@ svm_vmrun(void *arg, int vcpu, register_t rip, pmap_t pmap,
*/
disable_gintr();
- if (vcpu_suspended(suspended_cookie)) {
+ if (vcpu_suspended(evinfo)) {
enable_gintr();
vm_exit_suspended(vm, vcpu, state->rip);
break;
}
- if (vcpu_rendezvous_pending(rend_cookie)) {
+ if (vcpu_rendezvous_pending(evinfo)) {
enable_gintr();
vm_exit_rendezvous(vm, vcpu, state->rip);
break;
}
+ if (vcpu_reqidle(evinfo)) {
+ enable_gintr();
+ vm_exit_reqidle(vm, vcpu, state->rip);
+ break;
+ }
+
/* We are asked to give the cpu by scheduler. */
if (vcpu_should_yield(vm, vcpu)) {
enable_gintr();
diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c
index 4c3f20d..f590586 100644
--- a/sys/amd64/vmm/intel/vmx.c
+++ b/sys/amd64/vmm/intel/vmx.c
@@ -856,10 +856,11 @@ vmx_vminit(struct vm *vm, pmap_t pmap)
* VM exit and entry respectively. It is also restored from the
* host VMCS area on a VM exit.
*
- * The TSC MSR is exposed read-only. Writes are disallowed as that
- * will impact the host TSC.
- * XXX Writes would be implemented with a wrmsr trap, and
- * then modifying the TSC offset in the VMCS.
+ * The TSC MSR is exposed read-only. Writes are disallowed as
+ * that will impact the host TSC. If the guest does a write
+ * the "use TSC offsetting" execution control is enabled and the
+ * difference between the host TSC and the guest TSC is written
+ * into the TSC offset in the VMCS.
*/
if (guest_msr_rw(vmx, MSR_GSBASE) ||
guest_msr_rw(vmx, MSR_FSBASE) ||
@@ -1130,6 +1131,22 @@ vmx_clear_nmi_window_exiting(struct vmx *vmx, int vcpu)
VCPU_CTR0(vmx->vm, vcpu, "Disabling NMI window exiting");
}
+int
+vmx_set_tsc_offset(struct vmx *vmx, int vcpu, uint64_t offset)
+{
+ int error;
+
+ if ((vmx->cap[vcpu].proc_ctls & PROCBASED_TSC_OFFSET) == 0) {
+ vmx->cap[vcpu].proc_ctls |= PROCBASED_TSC_OFFSET;
+ vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls);
+ VCPU_CTR0(vmx->vm, vcpu, "Enabling TSC offsetting");
+ }
+
+ error = vmwrite(VMCS_TSC_OFFSET, offset);
+
+ return (error);
+}
+
#define NMI_BLOCKING (VMCS_INTERRUPTIBILITY_NMI_BLOCKING | \
VMCS_INTERRUPTIBILITY_MOVSS_BLOCKING)
#define HWINTR_BLOCKING (VMCS_INTERRUPTIBILITY_STI_BLOCKING | \
@@ -2554,7 +2571,7 @@ vmx_exit_handle_nmi(struct vmx *vmx, int vcpuid, struct vm_exit *vmexit)
static int
vmx_run(void *arg, int vcpu, register_t rip, pmap_t pmap,
- void *rendezvous_cookie, void *suspend_cookie)
+ struct vm_eventinfo *evinfo)
{
int rc, handled, launched;
struct vmx *vmx;
@@ -2623,18 +2640,24 @@ vmx_run(void *arg, int vcpu, register_t rip, pmap_t pmap,
* vmx_inject_interrupts() can suspend the vcpu due to a
* triple fault.
*/
- if (vcpu_suspended(suspend_cookie)) {
+ if (vcpu_suspended(evinfo)) {
enable_intr();
vm_exit_suspended(vmx->vm, vcpu, rip);
break;
}
- if (vcpu_rendezvous_pending(rendezvous_cookie)) {
+ if (vcpu_rendezvous_pending(evinfo)) {
enable_intr();
vm_exit_rendezvous(vmx->vm, vcpu, rip);
break;
}
+ if (vcpu_reqidle(evinfo)) {
+ enable_intr();
+ vm_exit_reqidle(vmx->vm, vcpu, rip);
+ break;
+ }
+
if (vcpu_should_yield(vm, vcpu)) {
enable_intr();
vm_exit_astpending(vmx->vm, vcpu, rip);
diff --git a/sys/amd64/vmm/intel/vmx.h b/sys/amd64/vmm/intel/vmx.h
index bc48861..57f5b28 100644
--- a/sys/amd64/vmm/intel/vmx.h
+++ b/sys/amd64/vmm/intel/vmx.h
@@ -135,6 +135,8 @@ void vmx_call_isr(uintptr_t entry);
u_long vmx_fix_cr0(u_long cr0);
u_long vmx_fix_cr4(u_long cr4);
+int vmx_set_tsc_offset(struct vmx *vmx, int vcpu, uint64_t offset);
+
extern char vmx_exit_guest[];
#endif
diff --git a/sys/amd64/vmm/intel/vmx_msr.c b/sys/amd64/vmm/intel/vmx_msr.c
index 3091f68..91b2c01 100644
--- a/sys/amd64/vmm/intel/vmx_msr.c
+++ b/sys/amd64/vmm/intel/vmx_msr.c
@@ -474,6 +474,9 @@ vmx_wrmsr(struct vmx *vmx, int vcpuid, u_int num, uint64_t val, bool *retu)
else
vm_inject_gp(vmx->vm, vcpuid);
break;
+ case MSR_TSC:
+ error = vmx_set_tsc_offset(vmx, vcpuid, val - rdtsc());
+ break;
default:
error = EINVAL;
break;
diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c
index 2671295..2c37a1a 100644
--- a/sys/amd64/vmm/vmm.c
+++ b/sys/amd64/vmm/vmm.c
@@ -95,6 +95,7 @@ struct vcpu {
struct mtx mtx; /* (o) protects 'state' and 'hostcpu' */
enum vcpu_state state; /* (o) vcpu state */
int hostcpu; /* (o) vcpu's host cpu */
+ int reqidle; /* (i) request vcpu to idle */
struct vlapic *vlapic; /* (i) APIC device model */
enum x2apic_state x2apic_state; /* (i) APIC mode */
uint64_t exitintinfo; /* (i) events pending at VM exit */
@@ -164,8 +165,8 @@ static struct vmm_ops *ops;
#define VMM_RESUME() (ops != NULL ? (*ops->resume)() : 0)
#define VMINIT(vm, pmap) (ops != NULL ? (*ops->vminit)(vm, pmap): NULL)
-#define VMRUN(vmi, vcpu, rip, pmap, rptr, sptr) \
- (ops != NULL ? (*ops->vmrun)(vmi, vcpu, rip, pmap, rptr, sptr) : ENXIO)
+#define VMRUN(vmi, vcpu, rip, pmap, evinfo) \
+ (ops != NULL ? (*ops->vmrun)(vmi, vcpu, rip, pmap, evinfo) : ENXIO)
#define VMCLEANUP(vmi) (ops != NULL ? (*ops->vmcleanup)(vmi) : NULL)
#define VMSPACE_ALLOC(min, max) \
(ops != NULL ? (*ops->vmspace_alloc)(min, max) : NULL)
@@ -221,6 +222,28 @@ TUNABLE_INT("hw.vmm.force_iommu", &vmm_force_iommu);
SYSCTL_INT(_hw_vmm, OID_AUTO, force_iommu, CTLFLAG_RDTUN, &vmm_force_iommu, 0,
"Force use of I/O MMU even if no passthrough devices were found.");
+static void vcpu_notify_event_locked(struct vcpu *vcpu, bool lapic_intr);
+
+#ifdef KTR
+static const char *
+vcpu_state2str(enum vcpu_state state)
+{
+
+ switch (state) {
+ case VCPU_IDLE:
+ return ("idle");
+ case VCPU_FROZEN:
+ return ("frozen");
+ case VCPU_RUNNING:
+ return ("running");
+ case VCPU_SLEEPING:
+ return ("sleeping");
+ default:
+ return ("unknown");
+ }
+}
+#endif
+
static void
vcpu_cleanup(struct vm *vm, int i, bool destroy)
{
@@ -255,6 +278,7 @@ vcpu_init(struct vm *vm, int vcpu_id, bool create)
vcpu->vlapic = VLAPIC_INIT(vm->cookie, vcpu_id);
vm_set_x2apic_state(vm, vcpu_id, X2APIC_DISABLED);
+ vcpu->reqidle = 0;
vcpu->exitintinfo = 0;
vcpu->nmi_pending = 0;
vcpu->extint_pending = 0;
@@ -980,11 +1004,13 @@ save_guest_fpustate(struct vcpu *vcpu)
static VMM_STAT(VCPU_IDLE_TICKS, "number of ticks vcpu was idle");
static int
-vcpu_set_state_locked(struct vcpu *vcpu, enum vcpu_state newstate,
+vcpu_set_state_locked(struct vm *vm, int vcpuid, enum vcpu_state newstate,
bool from_idle)
{
+ struct vcpu *vcpu;
int error;
+ vcpu = &vm->vcpu[vcpuid];
vcpu_assert_locked(vcpu);
/*
@@ -993,8 +1019,13 @@ vcpu_set_state_locked(struct vcpu *vcpu, enum vcpu_state newstate,
* ioctl() operating on a vcpu at any point.
*/
if (from_idle) {
- while (vcpu->state != VCPU_IDLE)
+ while (vcpu->state != VCPU_IDLE) {
+ vcpu->reqidle = 1;
+ vcpu_notify_event_locked(vcpu, false);
+ VCPU_CTR1(vm, vcpuid, "vcpu state change from %s to "
+ "idle requested", vcpu_state2str(vcpu->state));
msleep_spin(&vcpu->state, &vcpu->mtx, "vmstat", hz);
+ }
} else {
KASSERT(vcpu->state != VCPU_IDLE, ("invalid transition from "
"vcpu idle state"));
@@ -1031,6 +1062,9 @@ vcpu_set_state_locked(struct vcpu *vcpu, enum vcpu_state newstate,
if (error)
return (EBUSY);
+ VCPU_CTR2(vm, vcpuid, "vcpu state changed from %s to %s",
+ vcpu_state2str(vcpu->state), vcpu_state2str(newstate));
+
vcpu->state = newstate;
if (newstate == VCPU_RUNNING)
vcpu->hostcpu = curcpu;
@@ -1053,11 +1087,11 @@ vcpu_require_state(struct vm *vm, int vcpuid, enum vcpu_state newstate)
}
static void
-vcpu_require_state_locked(struct vcpu *vcpu, enum vcpu_state newstate)
+vcpu_require_state_locked(struct vm *vm, int vcpuid, enum vcpu_state newstate)
{
int error;
- if ((error = vcpu_set_state_locked(vcpu, newstate, false)) != 0)
+ if ((error = vcpu_set_state_locked(vm, vcpuid, newstate, false)) != 0)
panic("Error %d setting state to %d", error, newstate);
}
@@ -1145,7 +1179,7 @@ vm_handle_hlt(struct vm *vm, int vcpuid, bool intr_disabled, bool *retu)
* vcpu returned from VMRUN() and before it acquired the
* vcpu lock above.
*/
- if (vm->rendezvous_func != NULL || vm->suspend)
+ if (vm->rendezvous_func != NULL || vm->suspend || vcpu->reqidle)
break;
if (vm_nmi_pending(vm, vcpuid))
break;
@@ -1182,13 +1216,13 @@ vm_handle_hlt(struct vm *vm, int vcpuid, bool intr_disabled, bool *retu)
}
t = ticks;
- vcpu_require_state_locked(vcpu, VCPU_SLEEPING);
+ vcpu_require_state_locked(vm, vcpuid, VCPU_SLEEPING);
/*
* XXX msleep_spin() cannot be interrupted by signals so
* wake up periodically to check pending signals.
*/
msleep_spin(vcpu, &vcpu->mtx, wmesg, hz);
- vcpu_require_state_locked(vcpu, VCPU_FROZEN);
+ vcpu_require_state_locked(vm, vcpuid, VCPU_FROZEN);
vmm_stat_incr(vm, vcpuid, VCPU_IDLE_TICKS, ticks - t);
}
@@ -1350,9 +1384,9 @@ vm_handle_suspend(struct vm *vm, int vcpuid, bool *retu)
if (vm->rendezvous_func == NULL) {
VCPU_CTR0(vm, vcpuid, "Sleeping during suspend");
- vcpu_require_state_locked(vcpu, VCPU_SLEEPING);
+ vcpu_require_state_locked(vm, vcpuid, VCPU_SLEEPING);
msleep_spin(vcpu, &vcpu->mtx, "vmsusp", hz);
- vcpu_require_state_locked(vcpu, VCPU_FROZEN);
+ vcpu_require_state_locked(vm, vcpuid, VCPU_FROZEN);
} else {
VCPU_CTR0(vm, vcpuid, "Rendezvous during suspend");
vcpu_unlock(vcpu);
@@ -1375,6 +1409,19 @@ vm_handle_suspend(struct vm *vm, int vcpuid, bool *retu)
return (0);
}
+static int
+vm_handle_reqidle(struct vm *vm, int vcpuid, bool *retu)
+{
+ struct vcpu *vcpu = &vm->vcpu[vcpuid];
+
+ vcpu_lock(vcpu);
+ KASSERT(vcpu->reqidle, ("invalid vcpu reqidle %d", vcpu->reqidle));
+ vcpu->reqidle = 0;
+ vcpu_unlock(vcpu);
+ *retu = true;
+ return (0);
+}
+
int
vm_suspend(struct vm *vm, enum vm_suspend_how how)
{
@@ -1432,6 +1479,18 @@ vm_exit_rendezvous(struct vm *vm, int vcpuid, uint64_t rip)
}
void
+vm_exit_reqidle(struct vm *vm, int vcpuid, uint64_t rip)
+{
+ struct vm_exit *vmexit;
+
+ vmexit = vm_exitinfo(vm, vcpuid);
+ vmexit->rip = rip;
+ vmexit->inst_length = 0;
+ vmexit->exitcode = VM_EXITCODE_REQIDLE;
+ vmm_stat_incr(vm, vcpuid, VMEXIT_REQIDLE, 1);
+}
+
+void
vm_exit_astpending(struct vm *vm, int vcpuid, uint64_t rip)
{
struct vm_exit *vmexit;
@@ -1446,6 +1505,7 @@ vm_exit_astpending(struct vm *vm, int vcpuid, uint64_t rip)
int
vm_run(struct vm *vm, struct vm_run *vmrun)
{
+ struct vm_eventinfo evinfo;
int error, vcpuid;
struct vcpu *vcpu;
struct pcb *pcb;
@@ -1453,7 +1513,6 @@ vm_run(struct vm *vm, struct vm_run *vmrun)
struct vm_exit *vme;
bool retu, intr_disabled;
pmap_t pmap;
- void *rptr, *sptr;
vcpuid = vmrun->cpuid;
@@ -1466,11 +1525,12 @@ vm_run(struct vm *vm, struct vm_run *vmrun)
if (CPU_ISSET(vcpuid, &vm->suspended_cpus))
return (EINVAL);
- rptr = &vm->rendezvous_func;
- sptr = &vm->suspend;
pmap = vmspace_pmap(vm->vmspace);
vcpu = &vm->vcpu[vcpuid];
vme = &vcpu->exitinfo;
+ evinfo.rptr = &vm->rendezvous_func;
+ evinfo.sptr = &vm->suspend;
+ evinfo.iptr = &vcpu->reqidle;
restart:
critical_enter();
@@ -1485,7 +1545,7 @@ restart:
restore_guest_fpustate(vcpu);
vcpu_require_state(vm, vcpuid, VCPU_RUNNING);
- error = VMRUN(vm->cookie, vcpuid, vcpu->nextrip, pmap, rptr, sptr);
+ error = VMRUN(vm->cookie, vcpuid, vcpu->nextrip, pmap, &evinfo);
vcpu_require_state(vm, vcpuid, VCPU_FROZEN);
save_guest_fpustate(vcpu);
@@ -1498,6 +1558,9 @@ restart:
retu = false;
vcpu->nextrip = vme->rip + vme->inst_length;
switch (vme->exitcode) {
+ case VM_EXITCODE_REQIDLE:
+ error = vm_handle_reqidle(vm, vcpuid, &retu);
+ break;
case VM_EXITCODE_SUSPENDED:
error = vm_handle_suspend(vm, vcpuid, &retu);
break;
@@ -1536,6 +1599,8 @@ restart:
if (error == 0 && retu == false)
goto restart;
+ VCPU_CTR2(vm, vcpuid, "retu %d/%d", error, vme->exitcode);
+
/* copy the exit information */
bcopy(vme, &vmrun->vm_exit, sizeof(struct vm_exit));
return (error);
@@ -2072,7 +2137,7 @@ vcpu_set_state(struct vm *vm, int vcpuid, enum vcpu_state newstate,
vcpu = &vm->vcpu[vcpuid];
vcpu_lock(vcpu);
- error = vcpu_set_state_locked(vcpu, newstate, from_idle);
+ error = vcpu_set_state_locked(vm, vcpuid, newstate, from_idle);
vcpu_unlock(vcpu);
return (error);
@@ -2168,15 +2233,11 @@ vm_set_x2apic_state(struct vm *vm, int vcpuid, enum x2apic_state state)
* - If the vcpu is running on a different host_cpu then an IPI will be directed
* to the host_cpu to cause the vcpu to trap into the hypervisor.
*/
-void
-vcpu_notify_event(struct vm *vm, int vcpuid, bool lapic_intr)
+static void
+vcpu_notify_event_locked(struct vcpu *vcpu, bool lapic_intr)
{
int hostcpu;
- struct vcpu *vcpu;
-
- vcpu = &vm->vcpu[vcpuid];
- vcpu_lock(vcpu);
hostcpu = vcpu->hostcpu;
if (vcpu->state == VCPU_RUNNING) {
KASSERT(hostcpu != NOCPU, ("vcpu running on invalid hostcpu"));
@@ -2201,6 +2262,15 @@ vcpu_notify_event(struct vm *vm, int vcpuid, bool lapic_intr)
if (vcpu->state == VCPU_SLEEPING)
wakeup_one(vcpu);
}
+}
+
+void
+vcpu_notify_event(struct vm *vm, int vcpuid, bool lapic_intr)
+{
+ struct vcpu *vcpu = &vm->vcpu[vcpuid];
+
+ vcpu_lock(vcpu);
+ vcpu_notify_event_locked(vcpu, lapic_intr);
vcpu_unlock(vcpu);
}
diff --git a/sys/amd64/vmm/vmm_instruction_emul.c b/sys/amd64/vmm/vmm_instruction_emul.c
index 9b5713d..758b7e8 100644
--- a/sys/amd64/vmm/vmm_instruction_emul.c
+++ b/sys/amd64/vmm/vmm_instruction_emul.c
@@ -2342,7 +2342,7 @@ verify_gla(struct vm *vm, int cpuid, uint64_t gla, struct vie *vie)
* instruction
*/
if (vie->base_register == VM_REG_GUEST_RIP)
- base += vie->num_valid;
+ base += vie->num_processed;
}
idx = 0;
diff --git a/sys/amd64/vmm/vmm_stat.c b/sys/amd64/vmm/vmm_stat.c
index 4ae5fb9..7e2f64d 100644
--- a/sys/amd64/vmm/vmm_stat.c
+++ b/sys/amd64/vmm/vmm_stat.c
@@ -164,6 +164,7 @@ VMM_STAT(VMEXIT_NESTED_FAULT, "vm exits due to nested page fault");
VMM_STAT(VMEXIT_INST_EMUL, "vm exits for instruction emulation");
VMM_STAT(VMEXIT_UNKNOWN, "number of vm exits for unknown reason");
VMM_STAT(VMEXIT_ASTPENDING, "number of times astpending at exit");
+VMM_STAT(VMEXIT_REQIDLE, "number of times idle requested at exit");
VMM_STAT(VMEXIT_USERSPACE, "number of vm exits handled in userspace");
VMM_STAT(VMEXIT_RENDEZVOUS, "number of times rendezvous pending at exit");
VMM_STAT(VMEXIT_EXCEPTION, "number of vm exits due to exceptions");
diff --git a/sys/amd64/vmm/vmm_stat.h b/sys/amd64/vmm/vmm_stat.h
index 1640ba3..c695840 100644
--- a/sys/amd64/vmm/vmm_stat.h
+++ b/sys/amd64/vmm/vmm_stat.h
@@ -157,4 +157,5 @@ VMM_STAT_DECLARE(VMEXIT_ASTPENDING);
VMM_STAT_DECLARE(VMEXIT_USERSPACE);
VMM_STAT_DECLARE(VMEXIT_RENDEZVOUS);
VMM_STAT_DECLARE(VMEXIT_EXCEPTION);
+VMM_STAT_DECLARE(VMEXIT_REQIDLE);
#endif
diff --git a/sys/arm/arm/bcopyinout.S b/sys/arm/arm/bcopyinout.S
index 3624f92..c030e24 100644
--- a/sys/arm/arm/bcopyinout.S
+++ b/sys/arm/arm/bcopyinout.S
@@ -38,6 +38,7 @@
#include "assym.s"
+#include <machine/acle-compat.h>
#include <machine/asm.h>
#include <sys/errno.h>
@@ -54,7 +55,7 @@ __FBSDID("$FreeBSD$");
.text
.align 2
-#ifdef _ARM_ARCH_6
+#if __ARM_ARCH >= 6
#define GET_PCB(tmp) \
mrc p15, 0, tmp, c13, c0, 4; \
add tmp, tmp, #(TD_PCB)
@@ -69,7 +70,7 @@ __FBSDID("$FreeBSD$");
#define SAVE_REGS stmfd sp!, {r4-r11}
#define RESTORE_REGS ldmfd sp!, {r4-r11}
-
+
#if defined(_ARM_ARCH_5E)
#define HELLOCPP #
#define PREFETCH(rx,o) pld [ rx , HELLOCPP (o) ]
@@ -88,7 +89,7 @@ __FBSDID("$FreeBSD$");
* r4-r11 are scratch
*/
ENTRY(copyin)
- /* Quick exit if length is zero */
+ /* Quick exit if length is zero */
teq r2, #0
moveq r0, #0
RETeq
@@ -326,7 +327,7 @@ END(copyin)
*/
ENTRY(copyout)
- /* Quick exit if length is zero */
+ /* Quick exit if length is zero */
teq r2, #0
moveq r0, #0
RETeq
diff --git a/sys/arm/arm/bcopyinout_xscale.S b/sys/arm/arm/bcopyinout_xscale.S
index 487737e..7a5abb5 100644
--- a/sys/arm/arm/bcopyinout_xscale.S
+++ b/sys/arm/arm/bcopyinout_xscale.S
@@ -38,11 +38,13 @@
#include <machine/asm.h>
__FBSDID("$FreeBSD$");
+#include <machine/acle-compat.h>
+
.syntax unified
.text
.align 2
-#ifdef _ARM_ARCH_6
+#if __ARM_ARCH >= 6
#define GET_PCB(tmp) \
mrc p15, 0, tmp, c13, c0, 4; \
add tmp, tmp, #(TD_PCB)
@@ -85,7 +87,7 @@ ENTRY(copyin)
ldmfd sp!, {r0-r2, r4, lr}
moveq r0, #0
RETeq
-
+
.Lnormal:
stmfd sp!, {r10-r11, lr}
@@ -527,8 +529,8 @@ ENTRY(copyout)
ldmfd sp!, {r0-r2, r4, lr}
moveq r0, #0
RETeq
-
-.Lnormale:
+
+.Lnormale:
stmfd sp!, {r10-r11, lr}
GET_PCB(r10)
@@ -584,7 +586,7 @@ ENTRY(copyout)
ldrne ip, [r0], #0x04
subne r2, r2, #0x04
strtne ip, [r1], #0x04
-
+
stmfd sp!, {r4-r9} /* Free up some registers */
mov r3, #-1 /* Signal restore r4-r9 */
diff --git a/sys/arm/arm/blockio.S b/sys/arm/arm/blockio.S
index 28f502b..eb049c1 100644
--- a/sys/arm/arm/blockio.S
+++ b/sys/arm/arm/blockio.S
@@ -43,7 +43,7 @@
*
* Created : 08/10/94
* Modified : 22/01/99 -- R.Earnshaw
- * Faster, and small tweaks for StrongARM
+ * Faster, and small tweaks for StrongARM
*/
#include <machine/asm.h>
@@ -251,7 +251,7 @@ ENTRY(outsw)
str r3, [r0]
str ip, [r0]
-
+
/* mov ip, r3, lsl #16
* orr ip, ip, ip, lsr #16
* str ip, [r0]
@@ -358,7 +358,7 @@ ENTRY(outsw16)
eor r3, r3, r4, lsl #16 /* r3 = (A^B^A)(B) = (B)(B) */
str r3, [r0]
str r4, [r0]
-
+
/* mov r3, r4, lsl #16
* orr r3, r3, r3, lsr #16
* str r3, [r0]
diff --git a/sys/arm/arm/bus_space_base.c b/sys/arm/arm/bus_space_base.c
index 4e4f33c..0eeaaa3 100644
--- a/sys/arm/arm/bus_space_base.c
+++ b/sys/arm/arm/bus_space_base.c
@@ -116,10 +116,10 @@ static struct bus_space arm_base_bus_space __aligned(CACHE_LINE_SIZE) = {
.bs_c_8 = BS_UNIMPLEMENTED,
/* read stream (single) */
- .bs_r_1_s = NULL, /* Use inline code in bus.h */
- .bs_r_2_s = NULL, /* Use inline code in bus.h */
- .bs_r_4_s = NULL, /* Use inline code in bus.h */
- .bs_r_8_s = NULL, /* Use inline code in bus.h */
+ .bs_r_1_s = NULL, /* Use inline code in bus.h */
+ .bs_r_2_s = NULL, /* Use inline code in bus.h */
+ .bs_r_4_s = NULL, /* Use inline code in bus.h */
+ .bs_r_8_s = NULL, /* Use inline code in bus.h */
/* read multiple stream */
.bs_rm_1_s = generic_bs_rm_1,
@@ -134,10 +134,10 @@ static struct bus_space arm_base_bus_space __aligned(CACHE_LINE_SIZE) = {
.bs_rr_8_s = BS_UNIMPLEMENTED,
/* write stream (single) */
- .bs_w_1_s = NULL, /* Use inline code in bus.h */
- .bs_w_2_s = NULL, /* Use inline code in bus.h */
- .bs_w_4_s = NULL, /* Use inline code in bus.h */
- .bs_w_8_s = NULL, /* Use inline code in bus.h */
+ .bs_w_1_s = NULL, /* Use inline code in bus.h */
+ .bs_w_2_s = NULL, /* Use inline code in bus.h */
+ .bs_w_4_s = NULL, /* Use inline code in bus.h */
+ .bs_w_8_s = NULL, /* Use inline code in bus.h */
/* write multiple stream */
.bs_wm_1_s = generic_bs_wm_1,
diff --git a/sys/arm/arm/busdma_machdep-v6.c b/sys/arm/arm/busdma_machdep-v6.c
index 7236c5a..67e053b 100644
--- a/sys/arm/arm/busdma_machdep-v6.c
+++ b/sys/arm/arm/busdma_machdep-v6.c
@@ -160,7 +160,7 @@ SYSCTL_UINT(_hw_busdma, OID_AUTO, maps_dmamem, CTLFLAG_RD, &maps_dmamem, 0,
"Number of active maps for bus_dmamem_alloc buffers");
SYSCTL_UINT(_hw_busdma, OID_AUTO, maps_coherent, CTLFLAG_RD, &maps_coherent, 0,
"Number of active maps with BUS_DMA_COHERENT flag set");
-SYSCTL_COUNTER_U64(_hw_busdma, OID_AUTO, maploads_total, CTLFLAG_RD,
+SYSCTL_COUNTER_U64(_hw_busdma, OID_AUTO, maploads_total, CTLFLAG_RD,
&maploads_total, "Number of load operations performed");
SYSCTL_COUNTER_U64(_hw_busdma, OID_AUTO, maploads_bounced, CTLFLAG_RD,
&maploads_bounced, "Number of load operations that used bounce buffers");
@@ -230,14 +230,14 @@ busdma_init(void *dummy)
uma_flags = 0;
/* Create a cache of buffers in standard (cacheable) memory. */
- standard_allocator = busdma_bufalloc_create("buffer",
+ standard_allocator = busdma_bufalloc_create("buffer",
arm_dcache_align, /* minimum_alignment */
- NULL, /* uma_alloc func */
+ NULL, /* uma_alloc func */
NULL, /* uma_free func */
uma_flags); /* uma_zcreate_flags */
#ifdef INVARIANTS
- /*
+ /*
* Force UMA zone to allocate service structures like
* slabs using own allocator. uma_debug code performs
* atomic ops on uma_slab_t fields and safety of this
@@ -251,8 +251,8 @@ busdma_init(void *dummy)
*/
coherent_allocator = busdma_bufalloc_create("coherent",
arm_dcache_align, /* minimum_alignment */
- busdma_bufalloc_alloc_uncacheable,
- busdma_bufalloc_free_uncacheable,
+ busdma_bufalloc_alloc_uncacheable,
+ busdma_bufalloc_free_uncacheable,
uma_flags); /* uma_zcreate_flags */
}
@@ -343,7 +343,7 @@ cacheline_bounce(bus_dmamap_t map, bus_addr_t addr, bus_size_t size)
* address spaces.
*/
static __inline int
-might_bounce(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t addr,
+might_bounce(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t addr,
bus_size_t size)
{
@@ -364,7 +364,7 @@ might_bounce(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t addr,
* the DMA needs to bounce, otherwise any DMA within the zone bounces.
*/
static int
-must_bounce(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t paddr,
+must_bounce(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t paddr,
bus_size_t size)
{
@@ -387,11 +387,11 @@ must_bounce(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t paddr,
*/
while (dmat != NULL && exclusion_bounce(dmat)) {
if ((paddr >= dmat->lowaddr && paddr <= dmat->highaddr) &&
- (dmat->filter == NULL ||
+ (dmat->filter == NULL ||
dmat->filter(dmat->filterarg, paddr) != 0))
return (1);
dmat = dmat->parent;
- }
+ }
return (0);
}
@@ -554,7 +554,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
* number of pages in a transfer.
*/
maxsize = roundup2(maxsize, PAGE_SIZE) + PAGE_SIZE;
-
+
if ((error = alloc_bounce_zone(newtag)) != 0) {
free(newtag, M_DEVBUF);
return (error);
@@ -630,7 +630,7 @@ static int allocate_bz_and_pages(bus_dma_tag_t dmat, bus_dmamap_t mapp)
struct bounce_zone *bz;
int maxpages;
int error;
-
+
if (dmat->bounce_zone == NULL)
if ((error = alloc_bounce_zone(dmat)) != 0)
return (error);
@@ -651,13 +651,13 @@ static int allocate_bz_and_pages(bus_dma_tag_t dmat, bus_dmamap_t mapp)
if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 ||
(bz->map_count > 0 && bz->total_bpages < maxpages)) {
int pages;
-
+
pages = atop(roundup2(dmat->maxsize, PAGE_SIZE)) + 1;
pages = MIN(maxpages - bz->total_bpages, pages);
pages = MAX(pages, 2);
if (alloc_bounce_pages(dmat, pages) < pages)
return (ENOMEM);
-
+
if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0)
dmat->flags |= BUS_DMA_MIN_ALLOC_COMP;
}
@@ -676,7 +676,7 @@ allocate_map(bus_dma_tag_t dmat, int mflags)
* variable-sized array of sync_list structures. Following that
* we allocate enough extra space to hold the array of bus_dma_segments.
*/
- KASSERT(dmat->nsegments <= MAX_DMA_SEGMENTS,
+ KASSERT(dmat->nsegments <= MAX_DMA_SEGMENTS,
("cannot allocate %u dma segments (max is %u)",
dmat->nsegments, MAX_DMA_SEGMENTS));
segsize = sizeof(struct bus_dma_segment) * dmat->nsegments;
@@ -931,7 +931,7 @@ _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map,
else
paddr = pmap_extract(map->pmap, vaddr);
if (must_bounce(dmat, map, paddr,
- min(vendaddr - vaddr, (PAGE_SIZE - ((vm_offset_t)vaddr &
+ min(vendaddr - vaddr, (PAGE_SIZE - ((vm_offset_t)vaddr &
PAGE_MASK)))) != 0) {
map->pagesneeded++;
}
@@ -1267,7 +1267,7 @@ _bus_dmamap_fix_user(vm_offset_t buf, bus_size_t len,
bus_addr_t curaddr;
vm_offset_t va;
- /*
+ /*
* each synclist entry is contained within a single page.
* this would be needed if BUS_DMASYNC_POSTxxxx was implemented
*/
@@ -1339,7 +1339,7 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op)
cpu_dcache_wb_range((vm_offset_t)bpage->vaddr,
bpage->datacount);
l2cache_wb_range((vm_offset_t)bpage->vaddr,
- (vm_offset_t)bpage->busaddr,
+ (vm_offset_t)bpage->busaddr,
bpage->datacount);
bpage = STAILQ_NEXT(bpage, links);
}
@@ -1387,10 +1387,10 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op)
startv = bpage->vaddr &~ arm_dcache_align_mask;
startp = bpage->busaddr &~ arm_dcache_align_mask;
len = bpage->datacount;
-
+
if (startv != bpage->vaddr)
len += bpage->vaddr & arm_dcache_align_mask;
- if (len & arm_dcache_align_mask)
+ if (len & arm_dcache_align_mask)
len = (len -
(len & arm_dcache_align_mask)) +
arm_dcache_align;
@@ -1473,7 +1473,7 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op)
sl->busaddr, 1);
}
cpu_dcache_inv_range(sl->vaddr, sl->datacount);
- l2cache_inv_range(sl->vaddr, sl->busaddr,
+ l2cache_inv_range(sl->vaddr, sl->busaddr,
sl->datacount);
sl++;
}
@@ -1485,7 +1485,7 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op)
case BUS_DMASYNC_POSTREAD:
case BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE:
while (sl != end) {
- l2cache_inv_range(sl->vaddr, sl->busaddr,
+ l2cache_inv_range(sl->vaddr, sl->busaddr,
sl->datacount);
cpu_dcache_inv_range(sl->vaddr, sl->datacount);
sl++;
diff --git a/sys/arm/arm/busdma_machdep.c b/sys/arm/arm/busdma_machdep.c
index acd8f81..d7498c5 100644
--- a/sys/arm/arm/busdma_machdep.c
+++ b/sys/arm/arm/busdma_machdep.c
@@ -237,7 +237,7 @@ dmamap_ctor(void *mem, int size, void *arg, int flags)
* This is the dtor function passed to uma_zcreate() for the pool of dma maps.
* It may need platform-specific changes if this code is copied .
*/
-static void
+static void
dmamap_dtor(void *mem, int size, void *arg)
{
bus_dmamap_t map;
@@ -256,9 +256,9 @@ busdma_init(void *dummy)
dmamap_ctor, dmamap_dtor, NULL, NULL, UMA_ALIGN_PTR, 0);
/* Create a cache of buffers in standard (cacheable) memory. */
- standard_allocator = busdma_bufalloc_create("buffer",
+ standard_allocator = busdma_bufalloc_create("buffer",
arm_dcache_align, /* minimum_alignment */
- NULL, /* uma_alloc func */
+ NULL, /* uma_alloc func */
NULL, /* uma_free func */
0); /* uma_zcreate_flags */
@@ -268,8 +268,8 @@ busdma_init(void *dummy)
*/
coherent_allocator = busdma_bufalloc_create("coherent",
arm_dcache_align, /* minimum_alignment */
- busdma_bufalloc_alloc_uncacheable,
- busdma_bufalloc_free_uncacheable,
+ busdma_bufalloc_alloc_uncacheable,
+ busdma_bufalloc_free_uncacheable,
0); /* uma_zcreate_flags */
}
@@ -308,7 +308,7 @@ run_filter(bus_dma_tag_t dmat, bus_addr_t paddr)
|| (*dmat->filter)(dmat->filterarg, paddr) != 0))
retval = 1;
- dmat = dmat->parent;
+ dmat = dmat->parent;
} while (retval == 0 && dmat != NULL);
return (retval);
}
@@ -531,13 +531,13 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat)
#endif
if (dmat != NULL) {
-
+
if (dmat->map_count != 0)
return (EBUSY);
-
+
while (dmat != NULL) {
bus_dma_tag_t parent;
-
+
parent = dmat->parent;
atomic_subtract_int(&dmat->ref_count, 1);
if (dmat->ref_count == 0) {
@@ -588,7 +588,7 @@ bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp)
* now, because we can't sleep for resources at map load time.
*/
if (dmat->segments == NULL) {
- dmat->segments = malloc(dmat->nsegments *
+ dmat->segments = malloc(dmat->nsegments *
sizeof(*dmat->segments), M_DEVBUF, M_NOWAIT);
if (dmat->segments == NULL) {
free(slist, M_DEVBUF);
@@ -701,7 +701,7 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void **vaddrp, int flags,
* now, because we can't sleep for resources at map load time.
*/
if (dmat->segments == NULL)
- dmat->segments = malloc(dmat->nsegments *
+ dmat->segments = malloc(dmat->nsegments *
sizeof(*dmat->segments), M_DEVBUF, mflags);
slist = malloc(sizeof(*slist) * dmat->nsegments, M_DEVBUF, M_NOWAIT);
@@ -918,7 +918,7 @@ _bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t curaddr,
* memory address to an address in the DMA window.
*/
curaddr = (curaddr - dr->dr_sysbase) + dr->dr_busbase;
-
+
}
seg = *segp;
@@ -1206,7 +1206,7 @@ _bus_dmamap_sync_bp(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op)
STAILQ_FOREACH(bpage, &map->bpages, links) {
if (op & BUS_DMASYNC_PREWRITE) {
if (bpage->datavaddr != 0)
- bcopy((void *)bpage->datavaddr,
+ bcopy((void *)bpage->datavaddr,
(void *)bpage->vaddr, bpage->datacount);
else
physcopyout(bpage->dataaddr,
diff --git a/sys/arm/arm/copystr.S b/sys/arm/arm/copystr.S
index 57c9e70..48c296b 100644
--- a/sys/arm/arm/copystr.S
+++ b/sys/arm/arm/copystr.S
@@ -38,8 +38,8 @@
* Created : 16/05/95
*/
-
#include "assym.s"
+#include <machine/acle-compat.h>
#include <machine/asm.h>
#include <machine/armreg.h>
__FBSDID("$FreeBSD$");
@@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$");
.text
.align 2
-#ifdef _ARM_ARCH_6
+#if __ARM_ARCH >= 6
#define GET_PCB(tmp) \
mrc p15, 0, tmp, c13, c0, 4; \
add tmp, tmp, #(TD_PCB)
@@ -195,6 +195,7 @@ END(copyoutstr)
/* A fault occurred during the copy */
.Lcopystrfault:
+ mov r0, #EFAULT
mov r1, #0x00000000
str r1, [r4, #PCB_ONFAULT]
RESTORE_REGS
diff --git a/sys/arm/arm/cpu_asm-v6.S b/sys/arm/arm/cpu_asm-v6.S
index b36c9d1..e3dce4c 100644
--- a/sys/arm/arm/cpu_asm-v6.S
+++ b/sys/arm/arm/cpu_asm-v6.S
@@ -26,6 +26,7 @@
*
* $FreeBSD$
*/
+#include "assym.s"
#include <machine/acle-compat.h>
#include <machine/asm.h>
@@ -33,10 +34,21 @@
#include <machine/armreg.h>
#include <machine/sysreg.h>
-/*
+#if __ARM_ARCH >= 6
+#define GET_PCB(tmp) \
+ mrc CP15_TPIDRPRW(tmp); \
+ add tmp, tmp, #(TD_PCB)
+#else
+.Lcurpcb:
+ .word _C_LABEL(__pcpu) + PC_CURPCB
+#define GET_PCB(tmp) \
+ ldr tmp, .Lcurpcb
+#endif
+
+/*
* Define cache functions used by startup code, which counts on the fact that
* only r0-r3,r12 (ip) are modified and no stack space is used. These functions
- * must be called with interrupts disabled. Moreover, these work only with
+ * must be called with interrupts disabled. Moreover, these work only with
* caches integrated to CPU (accessible via CP15); systems with an external L2
* cache controller such as a PL310 need separate calls to that device driver
* to affect L2 caches. This is not a factor during early kernel startup, as
@@ -208,3 +220,59 @@ ASENTRY_NP(dcache_wbinv_poc_all)
bx lr
#endif /* __ARM_ARCH == 6 */
END(dcache_wbinv_poc_all)
+
+ASENTRY_NP(dcache_wb_pou_checked)
+ ldr ip, .Lcpuinfo
+ ldr ip, [ip, #DCACHE_LINE_SIZE]
+
+ GET_PCB(r2)
+ ldr r2, [r2]
+
+ adr r3, _C_LABEL(cachebailout)
+ str r3, [r2, #PCB_ONFAULT]
+1:
+ mcr CP15_DCCMVAC(r0)
+ add r0, r0, ip
+ subs r1, r1, ip
+ bhi 1b
+ DSB
+ mov r0, #0
+ str r0, [r2, #PCB_ONFAULT]
+ mov r0, #1 /* cannot be faulting address */
+ RET
+
+.Lcpuinfo:
+ .word cpuinfo
+END(dcache_wb_pou_checked)
+
+ASENTRY_NP(icache_inv_pou_checked)
+ ldr ip, .Lcpuinfo
+ ldr ip, [ip, #ICACHE_LINE_SIZE]
+
+ GET_PCB(r2)
+ ldr r2, [r2]
+
+ adr r3, _C_LABEL(cachebailout)
+ str r3, [r2, #PCB_ONFAULT]
+
+1:
+ mcr CP15_ICIMVAU(r0)
+ add r0, r0, ip
+ subs r1, r1, ip
+ bhi 1b
+ DSB
+ ISB
+ mov r0, #0
+ str r0, [r2, #PCB_ONFAULT]
+ mov r0, #1 /* cannot be faulting address */
+ RET
+END(icache_inv_pou_checked)
+
+/* label must be global as trap-v6.c references it */
+ .global _C_LABEL(cachebailout)
+_C_LABEL(cachebailout):
+ DSB
+ ISB
+ mov r1, #0
+ str r1, [r2, #PCB_ONFAULT]
+ RET
diff --git a/sys/arm/arm/cpufunc.c b/sys/arm/arm/cpufunc.c
index f3d9a52..0b589ed 100644
--- a/sys/arm/arm/cpufunc.c
+++ b/sys/arm/arm/cpufunc.c
@@ -361,7 +361,7 @@ struct cpu_functions pj4bv7_cpufuncs = {
struct cpu_functions xscale_cpufuncs = {
/* CPU functions */
-
+
cpufunc_id, /* id */
xscale_cpwait, /* cpwait */
@@ -426,7 +426,7 @@ struct cpu_functions xscale_cpufuncs = {
#ifdef CPU_XSCALE_81342
struct cpu_functions xscalec3_cpufuncs = {
/* CPU functions */
-
+
cpufunc_id, /* id */
xscale_cpwait, /* cpwait */
@@ -553,63 +553,63 @@ struct cpu_functions fa526_cpufuncs = {
#if defined(CPU_ARM1176)
struct cpu_functions arm1176_cpufuncs = {
/* CPU functions */
-
+
cpufunc_id, /* id */
cpufunc_nullop, /* cpwait */
-
+
/* MMU functions */
-
+
cpufunc_control, /* control */
cpufunc_domains, /* Domain */
arm11x6_setttb, /* Setttb */
cpufunc_faultstatus, /* Faultstatus */
cpufunc_faultaddress, /* Faultaddress */
-
+
/* TLB functions */
-
+
arm11_tlb_flushID, /* tlb_flushID */
arm11_tlb_flushID_SE, /* tlb_flushID_SE */
arm11_tlb_flushI, /* tlb_flushI */
arm11_tlb_flushI_SE, /* tlb_flushI_SE */
arm11_tlb_flushD, /* tlb_flushD */
arm11_tlb_flushD_SE, /* tlb_flushD_SE */
-
+
/* Cache operations */
-
+
arm11x6_icache_sync_all, /* icache_sync_all */
arm11x6_icache_sync_range, /* icache_sync_range */
-
+
arm11x6_dcache_wbinv_all, /* dcache_wbinv_all */
armv6_dcache_wbinv_range, /* dcache_wbinv_range */
armv6_dcache_inv_range, /* dcache_inv_range */
armv6_dcache_wb_range, /* dcache_wb_range */
-
+
armv6_idcache_inv_all, /* idcache_inv_all */
arm11x6_idcache_wbinv_all, /* idcache_wbinv_all */
arm11x6_idcache_wbinv_range, /* idcache_wbinv_range */
-
+
(void *)cpufunc_nullop, /* l2cache_wbinv_all */
(void *)cpufunc_nullop, /* l2cache_wbinv_range */
(void *)cpufunc_nullop, /* l2cache_inv_range */
(void *)cpufunc_nullop, /* l2cache_wb_range */
(void *)cpufunc_nullop, /* l2cache_drain_writebuf */
-
+
/* Other functions */
-
+
arm11x6_flush_prefetchbuf, /* flush_prefetchbuf */
arm11_drain_writebuf, /* drain_writebuf */
cpufunc_nullop, /* flush_brnchtgt_C */
(void *)cpufunc_nullop, /* flush_brnchtgt_E */
-
+
arm11x6_sleep, /* sleep */
-
+
/* Soft functions */
-
+
cpufunc_null_fixup, /* dataabt_fixup */
cpufunc_null_fixup, /* prefetchabt_fixup */
-
+
arm11_context_switch, /* context_switch */
-
+
arm11x6_setup /* cpu setup */
};
#endif /*CPU_ARM1176 */
@@ -617,46 +617,46 @@ struct cpu_functions arm1176_cpufuncs = {
#if defined(CPU_CORTEXA) || defined(CPU_KRAIT)
struct cpu_functions cortexa_cpufuncs = {
/* CPU functions */
-
+
cpufunc_id, /* id */
cpufunc_nullop, /* cpwait */
-
+
/* MMU functions */
-
+
cpufunc_control, /* control */
cpufunc_domains, /* Domain */
armv7_setttb, /* Setttb */
cpufunc_faultstatus, /* Faultstatus */
cpufunc_faultaddress, /* Faultaddress */
-
- /*
+
+ /*
* TLB functions. ARMv7 does all TLB ops based on a unified TLB model
* whether the hardware implements separate I+D or not, so we use the
* same 'ID' functions for all 3 variations.
*/
-
+
armv7_tlb_flushID, /* tlb_flushID */
armv7_tlb_flushID_SE, /* tlb_flushID_SE */
armv7_tlb_flushID, /* tlb_flushI */
armv7_tlb_flushID_SE, /* tlb_flushI_SE */
armv7_tlb_flushID, /* tlb_flushD */
armv7_tlb_flushID_SE, /* tlb_flushD_SE */
-
+
/* Cache operations */
-
+
armv7_icache_sync_all, /* icache_sync_all */
armv7_icache_sync_range, /* icache_sync_range */
-
+
armv7_dcache_wbinv_all, /* dcache_wbinv_all */
armv7_dcache_wbinv_range, /* dcache_wbinv_range */
armv7_dcache_inv_range, /* dcache_inv_range */
armv7_dcache_wb_range, /* dcache_wb_range */
-
+
armv7_idcache_inv_all, /* idcache_inv_all */
armv7_idcache_wbinv_all, /* idcache_wbinv_all */
armv7_idcache_wbinv_range, /* idcache_wbinv_range */
-
- /*
+
+ /*
* Note: For CPUs using the PL310 the L2 ops are filled in when the
* L2 cache controller is actually enabled.
*/
@@ -665,23 +665,23 @@ struct cpu_functions cortexa_cpufuncs = {
(void *)cpufunc_nullop, /* l2cache_inv_range */
(void *)cpufunc_nullop, /* l2cache_wb_range */
(void *)cpufunc_nullop, /* l2cache_drain_writebuf */
-
+
/* Other functions */
-
+
cpufunc_nullop, /* flush_prefetchbuf */
armv7_drain_writebuf, /* drain_writebuf */
cpufunc_nullop, /* flush_brnchtgt_C */
(void *)cpufunc_nullop, /* flush_brnchtgt_E */
-
+
armv7_cpu_sleep, /* sleep */
-
+
/* Soft functions */
-
+
cpufunc_null_fixup, /* dataabt_fixup */
cpufunc_null_fixup, /* prefetchabt_fixup */
-
+
armv7_context_switch, /* context_switch */
-
+
cortexa_setup /* cpu setup */
};
#endif /* CPU_CORTEXA */
@@ -758,7 +758,7 @@ get_cachetype_cp15()
__asm __volatile("mrc p15, 1, %0, c0, c0, 0"
: "=r" (csize));
arm_cache_type[sel] = csize;
- arm_dcache_align = 1 <<
+ arm_dcache_align = 1 <<
(CPUV7_CT_xSIZE_LEN(csize) + 4);
arm_dcache_align_mask = arm_dcache_align - 1;
}
@@ -913,12 +913,12 @@ set_cpufuncs()
cpufuncs = cortexa_cpufuncs;
cpu_reset_needs_v4_MMU_disable = 1; /* V4 or higher */
get_cachetype_cp15();
-
+
pmap_pte_init_mmu_v6();
goto out;
}
#endif /* CPU_CORTEXA */
-
+
#if defined(CPU_MV_PJ4B)
if (cputype == CPU_ID_MV88SV581X_V7 ||
cputype == CPU_ID_MV88SV584X_V7 ||
@@ -1116,37 +1116,20 @@ cpu_scc_setup_ccnt(void)
* you want!
*/
#ifdef _PMC_USER_READ_WRITE_
-#if defined(CPU_ARM1176)
- /* Use the Secure User and Non-secure Access Validation Control Register
- * to allow userland access
- */
- __asm volatile ("mcr p15, 0, %0, c15, c9, 0\n\t"
- :
- : "r"(0x00000001));
-#else
/* Set PMUSERENR[0] to allow userland access */
- __asm volatile ("mcr p15, 0, %0, c9, c14, 0\n\t"
- :
- : "r"(0x00000001));
-#endif
+ cp15_pmuserenr_set(1);
#endif
#if defined(CPU_ARM1176)
/* Set PMCR[2,0] to enable counters and reset CCNT */
- __asm volatile ("mcr p15, 0, %0, c15, c12, 0\n\t"
- :
- : "r"(0x00000005));
+ cp15_pmcr_set(5);
#else
/* Set up the PMCCNTR register as a cyclecounter:
* Set PMINTENCLR to 0xFFFFFFFF to block interrupts
* Set PMCR[2,0] to enable counters and reset CCNT
* Set PMCNTENSET to 0x80000000 to enable CCNT */
- __asm volatile ("mcr p15, 0, %0, c9, c14, 2\n\t"
- "mcr p15, 0, %1, c9, c12, 0\n\t"
- "mcr p15, 0, %2, c9, c12, 1\n\t"
- :
- : "r"(0xFFFFFFFF),
- "r"(0x00000005),
- "r"(0x80000000));
+ cp15_pminten_clr(0xFFFFFFFF);
+ cp15_pmcr_set(5);
+ cp15_pmcnten_set(0x80000000);
#endif
}
#endif
@@ -1182,7 +1165,7 @@ arm11x6_setup(void)
(3 << 30) | /* SBZ */
(1 << 29) | /* FA */
(1 << 28) | /* TR */
- (3 << 26) | /* SBZ */
+ (3 << 26) | /* SBZ */
(3 << 19) | /* SBZ */
(1 << 17); /* SBZ */
@@ -1214,19 +1197,18 @@ arm11x6_setup(void)
__asm volatile ("mcr\tp15, 0, %0, c7, c7, 0" : : "r"(sbz));
/* Allow detection code to find the VFP if it's fitted. */
- __asm volatile ("mcr\tp15, 0, %0, c1, c0, 2" : : "r" (0x0fffffff));
+ cp15_cpacr_set(0x0fffffff);
/* Set the control register */
ctrl = cpuctrl;
cpu_control(~cpuctrl_wax, cpuctrl);
- __asm volatile ("mrc p15, 0, %0, c1, c0, 1\n\t"
- "and %1, %0, %2\n\t"
- "orr %1, %1, %3\n\t"
- "teq %0, %1\n\t"
- "mcrne p15, 0, %1, c1, c0, 1\n\t"
- : "=r"(tmp), "=r"(tmp2) :
- "r"(auxctrl_wax), "r"(auxctrl));
+ tmp = cp15_actlr_get();
+ tmp2 = tmp;
+ tmp &= auxctrl_wax;
+ tmp |= auxctrl;
+ if (tmp != tmp2)
+ cp15_actlr_set(tmp);
/* And again. */
cpu_idcache_wbinv_all();
@@ -1276,39 +1258,39 @@ void
cortexa_setup(void)
{
int cpuctrl, cpuctrlmask;
-
+
cpuctrlmask = CPU_CONTROL_MMU_ENABLE | /* MMU enable [0] */
CPU_CONTROL_AFLT_ENABLE | /* Alignment fault [1] */
CPU_CONTROL_DC_ENABLE | /* DCache enable [2] */
CPU_CONTROL_BPRD_ENABLE | /* Branch prediction [11] */
CPU_CONTROL_IC_ENABLE | /* ICache enable [12] */
CPU_CONTROL_VECRELOC; /* Vector relocation [13] */
-
+
cpuctrl = CPU_CONTROL_MMU_ENABLE |
CPU_CONTROL_IC_ENABLE |
CPU_CONTROL_DC_ENABLE |
CPU_CONTROL_BPRD_ENABLE;
-
+
#ifndef ARM32_DISABLE_ALIGNMENT_FAULTS
cpuctrl |= CPU_CONTROL_AFLT_ENABLE;
#endif
-
+
/* Switch to big endian */
#ifdef __ARMEB__
cpuctrl |= CPU_CONTROL_BEND_ENABLE;
#endif
-
+
/* Check if the vector page is at the high address (0xffff0000) */
if (vector_page == ARM_VECTORS_HIGH)
cpuctrl |= CPU_CONTROL_VECRELOC;
-
+
/* Clear out the cache */
cpu_idcache_wbinv_all();
-
+
/* Set the control register */
ctrl = cpuctrl;
cpu_control(cpuctrlmask, cpuctrl);
-
+
/* And again. */
cpu_idcache_wbinv_all();
#ifdef SMP
diff --git a/sys/arm/arm/cpufunc_asm_arm11x6.S b/sys/arm/arm/cpufunc_asm_arm11x6.S
index 4d2697a..b88c0fd 100644
--- a/sys/arm/arm/cpufunc_asm_arm11x6.S
+++ b/sys/arm/arm/cpufunc_asm_arm11x6.S
@@ -73,7 +73,7 @@ __FBSDID("$FreeBSD$");
*
* Erratum 411920 in ARM1136 (fixed in r1p4)
* Erratum 415045 in ARM1176 (fixed in r0p5?)
- *
+ *
* - value of arg 'reg' Should Be Zero
*/
#define Invalidate_I_cache(Rtmp1, Rtmp2) \
@@ -150,20 +150,20 @@ ENTRY_NP(arm11x6_icache_sync_range)
/* Erratum ARM1176 371367 */
mrs r2, cpsr /* save the CPSR */
cpsid ifa /* disable interrupts (irq,fiq,abort) */
- mov r3, #0
+ mov r3, #0
mcr p15, 0, r3, c13, c0, 0 /* write FCSE (uTLB invalidate) */
mcr p15, 0, r3, c7, c5, 4 /* flush prefetch buffer */
- add r3, pc, #0x24
+ add r3, pc, #0x24
mcr p15, 0, r3, c7, c13, 1 /* prefetch I-cache line */
mcrr p15, 0, r1, r0, c5 /* invalidate I-cache range */
msr cpsr_cx, r2 /* local_irq_restore */
- nop
- nop
- nop
- nop
- nop
- nop
- nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
mcrr p15, 0, r1, r0, c12 /* clean and invalidate D cache range */ /* XXXNH */
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
@@ -177,20 +177,20 @@ ENTRY_NP(arm11x6_idcache_wbinv_range)
/* Erratum ARM1176 371367 */
mrs r2, cpsr /* save the CPSR */
cpsid ifa /* disable interrupts (irq,fiq,abort) */
- mov r3, #0
+ mov r3, #0
mcr p15, 0, r3, c13, c0, 0 /* write FCSE (uTLB invalidate) */
mcr p15, 0, r3, c7, c5, 4 /* flush prefetch buffer */
- add r3, pc, #0x24
+ add r3, pc, #0x24
mcr p15, 0, r3, c7, c13, 1 /* prefetch I-cache line */
mcrr p15, 0, r1, r0, c5 /* invalidate I-cache range */
msr cpsr_cx, r2 /* local_irq_restore */
- nop
- nop
- nop
- nop
- nop
- nop
- nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
mcrr p15, 0, r1, r0, c14 /* clean and invalidate D cache range */
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
@@ -199,7 +199,7 @@ END(arm11x6_idcache_wbinv_range)
/*
* Preload the cache before issuing the WFI by conditionally disabling the
- * mcr intstructions the first time around the loop. Ensure the function is
+ * mcr intstructions the first time around the loop. Ensure the function is
* cacheline aligned.
*/
.arch armv6
diff --git a/sys/arm/arm/cpufunc_asm_arm9.S b/sys/arm/arm/cpufunc_asm_arm9.S
index 24a3142..9247b0c 100644
--- a/sys/arm/arm/cpufunc_asm_arm9.S
+++ b/sys/arm/arm/cpufunc_asm_arm9.S
@@ -130,7 +130,7 @@ ENTRY(arm9_dcache_wb_range)
bhi .Larm9_wb_next
mov pc, lr
END(arm9_dcache_wb_range)
-
+
ENTRY(arm9_dcache_wbinv_range)
ldr ip, .Larm9_line_size
cmp r1, #0x4000
@@ -147,7 +147,7 @@ ENTRY(arm9_dcache_wbinv_range)
bhi .Larm9_wbinv_next
mov pc, lr
END(arm9_dcache_wbinv_range)
-
+
/*
* Note, we must not invalidate everything. If the range is too big we
* must use wb-inv of the entire cache.
diff --git a/sys/arm/arm/cpufunc_asm_armv6.S b/sys/arm/arm/cpufunc_asm_armv6.S
index 7c111c7..7d3af6e 100644
--- a/sys/arm/arm/cpufunc_asm_armv6.S
+++ b/sys/arm/arm/cpufunc_asm_armv6.S
@@ -37,7 +37,7 @@
/*
* $FreeBSD$
*/
-
+
#include <machine/asm.h>
.arch armv6
@@ -69,7 +69,7 @@ ENTRY(armv6_dcache_wb_range)
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
END(armv6_dcache_wb_range)
-
+
/* LINTSTUB: void armv6_dcache_wbinv_range(vaddr_t, vsize_t); */
ENTRY(armv6_dcache_wbinv_range)
add r1, r1, r0
@@ -78,7 +78,7 @@ ENTRY(armv6_dcache_wbinv_range)
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
END(armv6_dcache_wbinv_range)
-
+
/*
* Note, we must not invalidate everything. If the range is too big we
* must use wb-inv of the entire cache.
diff --git a/sys/arm/arm/cpufunc_asm_armv7.S b/sys/arm/arm/cpufunc_asm_armv7.S
index 1e7d7e2..42ccc6d 100644
--- a/sys/arm/arm/cpufunc_asm_armv7.S
+++ b/sys/arm/arm/cpufunc_asm_armv7.S
@@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$");
#define PT_OUTER_WT (2 << 3)
#define PT_OUTER_WB (3 << 3)
#define PT_OUTER_WBWA (1 << 3)
-
+
#ifdef SMP
#define PT_ATTR (PT_S|PT_INNER_WBWA|PT_OUTER_WBWA|PT_NOS)
#else
diff --git a/sys/arm/arm/cpufunc_asm_xscale_c3.S b/sys/arm/arm/cpufunc_asm_xscale_c3.S
index 78fa2d5..cb770a8 100644
--- a/sys/arm/arm/cpufunc_asm_xscale_c3.S
+++ b/sys/arm/arm/cpufunc_asm_xscale_c3.S
@@ -135,7 +135,7 @@ __FBSDID("$FreeBSD$");
ldr r4, .Lblock_userspace_access ; \
ldr ip, [r4] ; \
orr r0, ip, #1 ; \
- str r0, [r4]
+ str r0, [r4]
#define XSCALE_CACHE_CLEAN_UNBLOCK \
str ip, [r3] ; \
@@ -217,7 +217,7 @@ ENTRY(xscalec3_cache_syncI_rng)
CPWAIT_AND_RETURN(r0)
END(xscalec3_cache_syncI_rng)
-
+
ENTRY(xscalec3_cache_purgeD_rng)
cmp r1, #0x4000
diff --git a/sys/arm/arm/cpuinfo.c b/sys/arm/arm/cpuinfo.c
index d989906..311eba1 100644
--- a/sys/arm/arm/cpuinfo.c
+++ b/sys/arm/arm/cpuinfo.c
@@ -48,7 +48,7 @@ void
cpuinfo_init(void)
{
- cpuinfo.midr = cp15_midr_get();
+ cpuinfo.midr = cp15_midr_get();
/* Test old version id schemes first */
if ((cpuinfo.midr & CPU_ID_IMPLEMENTOR_MASK) == CPU_ID_ARM_LTD) {
if (CPU_ID_ISOLD(cpuinfo.midr)) {
@@ -74,7 +74,7 @@ cpuinfo_init(void)
/* non ARM -> must be new id scheme */
cpuinfo.architecture = (cpuinfo.midr >> 16) & 0x0F;
cpuinfo.revision = (cpuinfo.midr >> 20) & 0x0F;
- }
+ }
/* Parse rest of MIDR */
cpuinfo.implementer = (cpuinfo.midr >> 24) & 0xFF;
cpuinfo.part_number = (cpuinfo.midr >> 4) & 0xFFF;
@@ -86,11 +86,11 @@ cpuinfo_init(void)
cpuinfo.tlbtr = cp15_tlbtr_get();
cpuinfo.mpidr = cp15_mpidr_get();
cpuinfo.revidr = cp15_revidr_get();
-
+
/* if CPU is not v7 cpu id scheme */
if (cpuinfo.architecture != 0xF)
return;
-
+
cpuinfo.id_pfr0 = cp15_id_pfr0_get();
cpuinfo.id_pfr1 = cp15_id_pfr1_get();
cpuinfo.id_dfr0 = cp15_id_dfr0_get();
diff --git a/sys/arm/arm/db_interface.c b/sys/arm/arm/db_interface.c
index 6906650..3a2515e 100644
--- a/sys/arm/arm/db_interface.c
+++ b/sys/arm/arm/db_interface.c
@@ -326,12 +326,9 @@ branch_taken(u_int insn, db_addr_t pc)
default:
break; /* XXX */
}
-
}
return (addr + offset);
-
}
-
case 0xa: /* b ... */
case 0xb: /* bl ... */
addr = ((insn << 2) & 0x03ffffff);
diff --git a/sys/arm/arm/elf_machdep.c b/sys/arm/arm/elf_machdep.c
index 598decc..e5cc6a0 100644
--- a/sys/arm/arm/elf_machdep.c
+++ b/sys/arm/arm/elf_machdep.c
@@ -81,6 +81,7 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
.sv_syscallnames = syscallnames,
.sv_schedtail = NULL,
+ .sv_thread_detach = NULL,
};
static Elf32_Brandinfo freebsd_brand_info = {
diff --git a/sys/arm/arm/elf_trampoline.c b/sys/arm/arm/elf_trampoline.c
index bdde6d6..c3a7eed 100644
--- a/sys/arm/arm/elf_trampoline.c
+++ b/sys/arm/arm/elf_trampoline.c
@@ -93,7 +93,7 @@ extern void sheeva_l2cache_wbinv_all(void);
#define cpu_idcache_wbinv_all armv7_idcache_wbinv_all
#define cpu_l2cache_wbinv_all()
#else
-#define cpu_l2cache_wbinv_all()
+#define cpu_l2cache_wbinv_all()
#endif
static void armadaxp_idcache_wbinv_all(void);
@@ -216,7 +216,7 @@ _startC(void)
"mov sp, %1\n"
"mov pc, %0\n"
: : "r" (target_addr), "r" (tmp_sp));
-
+
}
#endif
#ifdef KZIP
@@ -225,7 +225,7 @@ _startC(void)
sp += 2 * L1_TABLE_SIZE;
#endif
sp += 1024 * 1024; /* Should be enough for a stack */
-
+
__asm __volatile("adr %0, 2f\n"
"bic %0, %0, #0xff000000\n"
"and %1, %1, #0xff000000\n"
@@ -366,7 +366,7 @@ get_cachetype_cp15()
static void
arm9_setup(void)
{
-
+
get_cachetype_cp15();
arm9_dcache_sets_inc = 1U << arm_dcache_l2_linesize;
arm9_dcache_sets_max = (1U << (arm_dcache_l2_linesize +
@@ -490,7 +490,7 @@ load_kernel(unsigned int kstart, unsigned int curaddr,unsigned int func_end,
vm_offset_t lastaddr = 0;
Elf_Addr ssym = 0;
Elf_Dyn *dp;
-
+
eh = (Elf32_Ehdr *)kstart;
ssym = 0;
entry_point = (void*)eh->e_entry;
@@ -504,7 +504,7 @@ load_kernel(unsigned int kstart, unsigned int curaddr,unsigned int func_end,
lastaddr = phdr[i].p_vaddr - KERNVIRTADDR +
curaddr + phdr[i].p_memsz;
}
-
+
/* Save the symbol tables, as there're about to be scratched. */
memcpy(shdr, (void *)(kstart + eh->e_shoff),
sizeof(*shdr) * eh->e_shnum);
@@ -552,12 +552,12 @@ load_kernel(unsigned int kstart, unsigned int curaddr,unsigned int func_end,
lastaddr = roundup(lastaddr,
sizeof(shdr[symstrindex].sh_size));
}
-
+
}
}
if (!d)
return ((void *)lastaddr);
-
+
j = eh->e_phnum;
for (i = 0; i < j; i++) {
volatile char c;
@@ -610,7 +610,7 @@ load_kernel(unsigned int kstart, unsigned int curaddr,unsigned int func_end,
((void(*)(void))(entry_point - KERNVIRTADDR + curaddr))();
__asm __volatile(".globl func_end\n"
"func_end:");
-
+
/* NOTREACHED */
return NULL;
}
@@ -653,7 +653,7 @@ setup_pagetables(unsigned int pt_addr, vm_paddr_t physstart, vm_paddr_t physend,
"mov r0, r0\n"
"sub pc, pc, #4\n" :
"=r" (tmp) : "r" (pd), "r" (domain));
-
+
/*
* XXX: This is the most stupid workaround I've ever wrote.
* For some reason, the KB9202 won't boot the kernel unless
@@ -680,7 +680,7 @@ __start(void)
if (*kernel == 0x1f && kernel[1] == 0x8b) {
pt_addr = (((int)&_end + KERNSIZE + 0x100) &
~(L1_TABLE_SIZE - 1)) + L1_TABLE_SIZE;
-
+
#ifdef CPU_ARM9
/* So that idcache_wbinv works; */
if ((cpufunc_id() & 0x0000f000) == 0x00009000)
@@ -715,7 +715,7 @@ __start(void)
dst = (void *)(((vm_offset_t)dst & ~3));
pt_addr = ((unsigned int)dst &~(L1_TABLE_SIZE - 1)) + L1_TABLE_SIZE;
setup_pagetables(pt_addr, (vm_paddr_t)curaddr,
- (vm_paddr_t)curaddr + 0x10000000, 0);
+ (vm_paddr_t)curaddr + 0x10000000, 0);
sp = pt_addr + L1_TABLE_SIZE + 8192;
sp = sp &~3;
dst = (void *)(sp + 4);
@@ -725,7 +725,6 @@ __start(void)
(unsigned int)(&load_kernel) + 800, sp);
}
-#ifdef __ARM_EABI__
/* We need to provide these functions but never call them */
void __aeabi_unwind_cpp_pr0(void);
void __aeabi_unwind_cpp_pr1(void);
@@ -737,5 +736,3 @@ void
__aeabi_unwind_cpp_pr0(void)
{
}
-#endif
-
diff --git a/sys/arm/arm/exception.S b/sys/arm/arm/exception.S
index b85dcfc..5f1dff7 100644
--- a/sys/arm/arm/exception.S
+++ b/sys/arm/arm/exception.S
@@ -49,6 +49,7 @@
#include "assym.s"
#include "opt_kdtrace.h"
+#include <machine/acle-compat.h>
#include <machine/asm.h>
#include <machine/armreg.h>
#include <machine/asmacros.h>
@@ -63,7 +64,7 @@ _C_LABEL(dtrace_invop_calltrap_addr):
.word 0
#endif
- .text
+ .text
.align 2
/*
@@ -80,7 +81,7 @@ _C_LABEL(dtrace_invop_calltrap_addr):
* NOTE: r13 and r14 are stored separately as a work around for the
* SA110 rev 2 STM^ bug
*/
-#ifdef ARM_TP_ADDRESS
+#if __ARM_ARCH < 6
#define PUSHFRAME \
sub sp, sp, #4; /* Align the stack */ \
str lr, [sp, #-4]!; /* Push the return address */ \
@@ -114,7 +115,7 @@ _C_LABEL(dtrace_invop_calltrap_addr):
* Since the current mode is used, the SVC lr field is ignored.
*/
-#ifdef ARM_TP_ADDRESS
+#if __ARM_ARCH < 6
#define PULLFRAME \
ldr r0, [sp], #4; /* Get the SPSR from stack */ \
msr spsr_fsxc, r0; \
@@ -123,7 +124,7 @@ _C_LABEL(dtrace_invop_calltrap_addr):
add sp, sp, #(4*17); /* Adjust the stack pointer */ \
ldr lr, [sp], #4; /* Pull the return address */ \
add sp, sp, #4 /* Align the stack */
-#else
+#else
#define PULLFRAME \
ldr r0, [sp], #4 ; /* Get the SPSR from stack */ \
msr spsr_fsxc, r0; \
@@ -145,7 +146,7 @@ _C_LABEL(dtrace_invop_calltrap_addr):
* NOTE: r13 and r14 are stored separately as a work around for the
* SA110 rev 2 STM^ bug
*/
-#ifdef ARM_TP_ADDRESS
+#if __ARM_ARCH < 6
#define PUSHFRAMEINSVC \
stmdb sp, {r0-r3}; /* Save 4 registers */ \
mov r0, lr; /* Save xxx32 r14 */ \
@@ -218,7 +219,7 @@ _C_LABEL(dtrace_invop_calltrap_addr):
* exit.
*/
-#ifdef ARM_TP_ADDRESS
+#if __ARM_ARCH < 6
#define PULLFRAMEFROMSVCANDEXIT \
ldr r0, [sp], #4; /* Get the SPSR from stack */ \
msr spsr_fsxc, r0; /* restore SPSR */ \
@@ -226,7 +227,7 @@ _C_LABEL(dtrace_invop_calltrap_addr):
mov r0, r0; /* NOP for previous instruction */ \
add sp, sp, #(4*15); /* Adjust the stack pointer */ \
ldmia sp, {sp, lr, pc}^ /* Restore lr and exit */
-#else
+#else
#define PULLFRAMEFROMSVCANDEXIT \
ldr r0, [sp], #4; /* Get the SPSR from stack */ \
msr spsr_fsxc, r0; /* restore SPSR */ \
@@ -237,7 +238,6 @@ _C_LABEL(dtrace_invop_calltrap_addr):
ldmia sp, {sp, lr, pc}^ /* Restore lr and exit */
#endif
-#if defined(__ARM_EABI__)
/*
* Unwind hints so we can unwind past functions that use
* PULLFRAMEFROMSVCANDEXIT. They are run in reverse order.
@@ -249,9 +249,6 @@ _C_LABEL(dtrace_invop_calltrap_addr):
.pad #(2*4); /* Skip user sp and lr */ \
.save {r0-r12}; /* Restore r0-r12 */ \
.pad #(4) /* Skip spsr */
-#else
-#define UNWINDSVCFRAME
-#endif
#define DO_AST \
ldr r0, [sp]; /* Get the SPSR from stack */ \
@@ -320,7 +317,7 @@ END(exception_exit)
* Entry point for a Prefetch Abort exception.
*
* The hardware switches to the abort mode stack; we switch to svc32 before
- * calling the handler, then return directly to the original mode/stack
+ * calling the handler, then return directly to the original mode/stack
* on exit (without transitioning back through the abort mode stack).
*/
ASENTRY_NP(prefetch_abort_entry)
@@ -340,7 +337,7 @@ END(prefetch_abort_entry)
* Entry point for a Data Abort exception.
*
* The hardware switches to the abort mode stack; we switch to svc32 before
- * calling the handler, then return directly to the original mode/stack
+ * calling the handler, then return directly to the original mode/stack
* on exit (without transitioning back through the abort mode stack).
*/
ASENTRY_NP(data_abort_entry)
@@ -360,7 +357,7 @@ END(data_abort_entry)
* Entry point for an Undefined Instruction exception.
*
* The hardware switches to the undefined mode stack; we switch to svc32 before
- * calling the handler, then return directly to the original mode/stack
+ * calling the handler, then return directly to the original mode/stack
* on exit (without transitioning back through the undefined mode stack).
*/
ASENTRY_NP(undefined_entry)
@@ -374,7 +371,7 @@ END(undefined_entry)
* Entry point for a normal IRQ.
*
* The hardware switches to the IRQ mode stack; we switch to svc32 before
- * calling the handler, then return directly to the original mode/stack
+ * calling the handler, then return directly to the original mode/stack
* on exit (without transitioning back through the IRQ mode stack).
*/
ASENTRY_NP(irq_entry)
@@ -383,12 +380,12 @@ ASENTRY_NP(irq_entry)
adr lr, exception_exit /* Return from handler via standard */
mov r0, sp /* exception exit routine. Pass the */
b _C_LABEL(arm_irq_handler)/* trapframe to the handler. */
-END(irq_entry)
+END(irq_entry)
/*
* Entry point for an FIQ interrupt.
*
- * We don't currently support FIQ handlers very much. Something can
+ * We don't currently support FIQ handlers very much. Something can
* install itself in the FIQ vector using code (that may or may not work
* these days) in fiq.c. If nobody does that and an FIQ happens, this
* default handler just disables FIQs and otherwise ignores it.
@@ -416,7 +413,7 @@ Laddr_exception_msg:
END(addr_exception_entry)
/*
- * Entry point for the system Reset vector.
+ * Entry point for the system Reset vector.
* This should never happen, so panic.
*/
ASENTRY_NP(reset_entry)
@@ -434,8 +431,8 @@ END(reset_entry)
* the ARM vectors page (high or low) as part of CPU initialization. The
* code that does the copy assumes that page0_data holds one 32-bit word
* of data for each of the predefined ARM vectors. It also assumes that
- * page0_data follows the vectors in page0, but other stuff can appear
- * between the two. We currently leave room between the two for some fiq
+ * page0_data follows the vectors in page0, but other stuff can appear
+ * between the two. We currently leave room between the two for some fiq
* handler code to be copied in.
*/
.global _C_LABEL(page0), _C_LABEL(page0_data)
diff --git a/sys/arm/arm/fiq.c b/sys/arm/arm/fiq.c
index 08f8670..94231de 100644
--- a/sys/arm/arm/fiq.c
+++ b/sys/arm/arm/fiq.c
@@ -59,7 +59,7 @@ extern uint32_t fiq_nullhandler_size;
* fiq_installhandler:
*
* Actually install the FIQ handler down at the FIQ vector.
- *
+ *
* The FIQ vector is fixed by the hardware definition as the
* seventh 32-bit word in the vector page.
*
diff --git a/sys/arm/arm/fusu.S b/sys/arm/arm/fusu.S
index ab7fb58..06853c4 100644
--- a/sys/arm/arm/fusu.S
+++ b/sys/arm/arm/fusu.S
@@ -70,11 +70,11 @@ EENTRY_NP(casuword32)
adr r4, .Lcasuwordfault
str r4, [r3, #PCB_ONFAULT]
#if __ARM_ARCH >= 6
-1:
+1:
cmp r0, #KERNBASE
mvnhs r0, #0
bhs 2f
-
+
ldrex r5, [r0]
cmp r5, r1
movne r0, r5
@@ -106,7 +106,7 @@ END(casuword)
str r0, [r3, #PCB_ONFAULT]
mvn r0, #0x00000000
ldmfd sp!, {r4, r5}
- RET
+ RET
/*
* fuword(caddr_t uaddr);
diff --git a/sys/arm/arm/genassym.c b/sys/arm/arm/genassym.c
index 3301ce1..11bb90f 100644
--- a/sys/arm/arm/genassym.c
+++ b/sys/arm/arm/genassym.c
@@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_param.h>
#include <vm/pmap.h>
#include <vm/vm_map.h>
+
+#include <machine/acle-compat.h>
#include <machine/vmparam.h>
#include <machine/armreg.h>
#include <machine/frame.h>
@@ -124,7 +126,7 @@ ASSYM(P_FLAG, offsetof(struct proc, p_flag));
ASSYM(SIGF_UC, offsetof(struct sigframe, sf_uc));
-#ifdef ARM_TP_ADDRESS
+#if __ARM_ARCH < 6
ASSYM(ARM_TP_ADDRESS, ARM_TP_ADDRESS);
ASSYM(ARM_RAS_START, ARM_RAS_START);
ASSYM(ARM_RAS_END, ARM_RAS_END);
@@ -133,8 +135,6 @@ ASSYM(ARM_RAS_END, ARM_RAS_END);
#ifdef VFP
ASSYM(PCB_VFPSTATE, offsetof(struct pcb, pcb_vfpstate));
-ASSYM(PC_CPU, offsetof(struct pcpu, pc_cpu));
-
ASSYM(PC_CURPMAP, offsetof(struct pcpu, pc_curpmap));
#endif
diff --git a/sys/arm/arm/generic_timer.c b/sys/arm/arm/generic_timer.c
index 56db9ca..636ba75 100644
--- a/sys/arm/arm/generic_timer.c
+++ b/sys/arm/arm/generic_timer.c
@@ -34,6 +34,9 @@
* Cortex-A7, Cortex-A15, ARMv8 and later Generic Timer
*/
+#include "opt_acpi.h"
+#include "opt_platform.h"
+
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -51,12 +54,17 @@ __FBSDID("$FreeBSD$");
#include <machine/cpu.h>
#include <machine/intr.h>
+#ifdef FDT
#include <dev/fdt/fdt_common.h>
#include <dev/ofw/openfirm.h>
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
+#endif
-#include <machine/bus.h>
+#ifdef DEV_ACPI
+#include <contrib/dev/acpica/include/acpi.h>
+#include <dev/acpica/acpivar.h>
+#endif
#define GT_CTRL_ENABLE (1 << 0)
#define GT_CTRL_INT_MASK (1 << 1)
@@ -247,8 +255,9 @@ arm_tmr_intr(void *arg)
return (FILTER_HANDLED);
}
+#ifdef FDT
static int
-arm_tmr_probe(device_t dev)
+arm_tmr_fdt_probe(device_t dev)
{
if (!ofw_bus_status_okay(dev))
@@ -264,14 +273,62 @@ arm_tmr_probe(device_t dev)
return (ENXIO);
}
+#endif
+
+#ifdef DEV_ACPI
+static void
+arm_tmr_acpi_identify(driver_t *driver, device_t parent)
+{
+ ACPI_TABLE_GTDT *gtdt;
+ vm_paddr_t physaddr;
+ device_t dev;
+
+ physaddr = acpi_find_table(ACPI_SIG_GTDT);
+ if (physaddr == 0)
+ return;
+
+ gtdt = acpi_map_table(physaddr, ACPI_SIG_GTDT);
+ if (gtdt == NULL) {
+ device_printf(parent, "gic: Unable to map the GTDT\n");
+ return;
+ }
+
+ dev = BUS_ADD_CHILD(parent, BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE,
+ "generic_timer", -1);
+ if (dev == NULL) {
+ device_printf(parent, "add gic child failed\n");
+ goto out;
+ }
+
+ BUS_SET_RESOURCE(parent, dev, SYS_RES_IRQ, 0,
+ gtdt->SecureEl1Interrupt, 1);
+ BUS_SET_RESOURCE(parent, dev, SYS_RES_IRQ, 1,
+ gtdt->NonSecureEl1Interrupt, 1);
+ BUS_SET_RESOURCE(parent, dev, SYS_RES_IRQ, 2,
+ gtdt->VirtualTimerInterrupt, 1);
+
+out:
+ acpi_unmap_table(gtdt);
+}
+
+static int
+arm_tmr_acpi_probe(device_t dev)
+{
+
+ device_set_desc(dev, "ARM Generic Timer");
+ return (BUS_PROBE_NOWILDCARD);
+}
+#endif
static int
arm_tmr_attach(device_t dev)
{
struct arm_tmr_softc *sc;
+#ifdef FDT
phandle_t node;
pcell_t clock;
+#endif
int error;
int i;
@@ -279,12 +336,17 @@ arm_tmr_attach(device_t dev)
if (arm_tmr_sc)
return (ENXIO);
+#ifdef FDT
/* Get the base clock frequency */
node = ofw_bus_get_node(dev);
- error = OF_getprop(node, "clock-frequency", &clock, sizeof(clock));
- if (error > 0) {
- sc->clkfreq = fdt32_to_cpu(clock);
+ if (node > 0) {
+ error = OF_getprop(node, "clock-frequency", &clock,
+ sizeof(clock));
+ if (error > 0) {
+ sc->clkfreq = fdt32_to_cpu(clock);
+ }
}
+#endif
if (sc->clkfreq == 0) {
/* Try to get clock frequency from timer */
@@ -339,24 +401,46 @@ arm_tmr_attach(device_t dev)
return (0);
}
-static device_method_t arm_tmr_methods[] = {
- DEVMETHOD(device_probe, arm_tmr_probe),
+#ifdef FDT
+static device_method_t arm_tmr_fdt_methods[] = {
+ DEVMETHOD(device_probe, arm_tmr_fdt_probe),
DEVMETHOD(device_attach, arm_tmr_attach),
{ 0, 0 }
};
-static driver_t arm_tmr_driver = {
+static driver_t arm_tmr_fdt_driver = {
"generic_timer",
- arm_tmr_methods,
+ arm_tmr_fdt_methods,
sizeof(struct arm_tmr_softc),
};
-static devclass_t arm_tmr_devclass;
+static devclass_t arm_tmr_fdt_devclass;
-EARLY_DRIVER_MODULE(timer, simplebus, arm_tmr_driver, arm_tmr_devclass, 0, 0,
- BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE);
-EARLY_DRIVER_MODULE(timer, ofwbus, arm_tmr_driver, arm_tmr_devclass, 0, 0,
- BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE);
+EARLY_DRIVER_MODULE(timer, simplebus, arm_tmr_fdt_driver, arm_tmr_fdt_devclass,
+ 0, 0, BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE);
+EARLY_DRIVER_MODULE(timer, ofwbus, arm_tmr_fdt_driver, arm_tmr_fdt_devclass,
+ 0, 0, BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE);
+#endif
+
+#ifdef DEV_ACPI
+static device_method_t arm_tmr_acpi_methods[] = {
+ DEVMETHOD(device_identify, arm_tmr_acpi_identify),
+ DEVMETHOD(device_probe, arm_tmr_acpi_probe),
+ DEVMETHOD(device_attach, arm_tmr_attach),
+ { 0, 0 }
+};
+
+static driver_t arm_tmr_acpi_driver = {
+ "generic_timer",
+ arm_tmr_acpi_methods,
+ sizeof(struct arm_tmr_softc),
+};
+
+static devclass_t arm_tmr_acpi_devclass;
+
+EARLY_DRIVER_MODULE(timer, acpi, arm_tmr_acpi_driver, arm_tmr_acpi_devclass,
+ 0, 0, BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE);
+#endif
void
DELAY(int usec)
diff --git a/sys/arm/arm/gic.c b/sys/arm/arm/gic.c
index 45fb903..6fcb7e0 100644
--- a/sys/arm/arm/gic.c
+++ b/sys/arm/arm/gic.c
@@ -197,8 +197,8 @@ gic_decode_fdt(uint32_t iparent, uint32_t *intr, int *interrupt,
static u_int num_intr_cells;
if (num_intr_cells == 0) {
- if (OF_searchencprop(OF_node_from_xref(iparent),
- "#interrupt-cells", &num_intr_cells,
+ if (OF_searchencprop(OF_node_from_xref(iparent),
+ "#interrupt-cells", &num_intr_cells,
sizeof(num_intr_cells)) == -1) {
num_intr_cells = 1;
}
diff --git a/sys/arm/arm/intr.c b/sys/arm/arm/intr.c
index 9505915..7ab87cc 100644
--- a/sys/arm/arm/intr.c
+++ b/sys/arm/arm/intr.c
@@ -149,7 +149,7 @@ arm_setup_irqhandler(const char *name, driver_filter_t *filt,
if (error)
return;
intr_events[irq] = event;
- snprintf(&intrnames[irq * INTRNAME_LEN], INTRNAME_LEN,
+ snprintf(&intrnames[irq * INTRNAME_LEN], INTRNAME_LEN,
"irq%d: %-*s", irq, INTRNAME_LEN - 1, name);
}
intr_event_add_handler(event, name, filt, hand, arg,
@@ -164,7 +164,7 @@ arm_remove_irqhandler(int irq, void *cookie)
event = intr_events[irq];
arm_mask_irq(irq);
-
+
error = intr_event_remove_handler(cookie);
if (!TAILQ_EMPTY(&event->ie_handlers))
diff --git a/sys/arm/arm/locore-v4.S b/sys/arm/arm/locore-v4.S
index d798e97..cc4f636 100644
--- a/sys/arm/arm/locore-v4.S
+++ b/sys/arm/arm/locore-v4.S
@@ -49,8 +49,7 @@ __FBSDID("$FreeBSD$");
*
* TODO: Fix the ARMv4/v5 case.
*/
-#if (defined(FLASHADDR) || defined(LOADERRAMADDR) || !defined(_ARM_ARCH_6)) && \
- !defined(PHYSADDR)
+#ifndef PHYSADDR
#error PHYSADDR must be defined for this configuration
#endif
diff --git a/sys/arm/arm/machdep.c b/sys/arm/arm/machdep.c
index 01e8fe3..99d4572 100644
--- a/sys/arm/arm/machdep.c
+++ b/sys/arm/arm/machdep.c
@@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$");
#include <sys/bus.h>
#include <sys/cons.h>
#include <sys/cpu.h>
+#include <sys/efi.h>
#include <sys/exec.h>
#include <sys/imgact.h>
#include <sys/kdb.h>
@@ -71,6 +72,7 @@ __FBSDID("$FreeBSD$");
#include <sys/mutex.h>
#include <sys/pcpu.h>
#include <sys/ptrace.h>
+#include <sys/reboot.h>
#include <sys/rwlock.h>
#include <sys/sched.h>
#include <sys/signalvar.h>
@@ -245,7 +247,7 @@ void
board_set_serial(uint64_t serial)
{
- snprintf(board_serial, sizeof(board_serial)-1,
+ snprintf(board_serial, sizeof(board_serial)-1,
"%016jx", serial);
}
@@ -297,7 +299,7 @@ sendsig(catcher, ksi, mask)
/* make room on the stack */
fp--;
-
+
/* make the stack aligned */
fp = (struct sigframe *)STACKALIGN(fp);
/* Populate the siginfo frame. */
@@ -318,17 +320,13 @@ sendsig(catcher, ksi, mask)
sigexit(td, SIGILL);
}
- /* Translate the signal if appropriate. */
- if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize)
- sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
-
/*
* Build context to run handler in. We invoke the handler
* directly, only returning via the trampoline. Note the
* trampoline version numbers are coordinated with machine-
* dependent code in libc.
*/
-
+
tf->tf_r0 = sig;
tf->tf_r1 = (register_t)&fp->sf_si;
tf->tf_r2 = (register_t)&fp->sf_uc;
@@ -430,7 +428,7 @@ cpu_startup(void *dummy)
/*
* Display the RAM layout.
*/
- printf("real memory = %ju (%ju MB)\n",
+ printf("real memory = %ju (%ju MB)\n",
(uintmax_t)arm32_ptob(realmem),
(uintmax_t)arm32_ptob(realmem) / mbyte);
printf("avail memory = %ju (%ju MB)\n",
@@ -492,7 +490,7 @@ cpu_est_clockrate(int cpu_id, uint64_t *rate)
void
cpu_idle(int busy)
{
-
+
CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", busy, curcpu);
spinlock_enter();
#ifndef NO_EVENTTIMERS
@@ -562,14 +560,14 @@ int
set_regs(struct thread *td, struct reg *regs)
{
struct trapframe *tf = td->td_frame;
-
+
bcopy(regs->r, &tf->tf_r0, sizeof(regs->r));
tf->tf_usr_sp = regs->r_sp;
tf->tf_usr_lr = regs->r_lr;
tf->tf_pc = regs->r_pc;
tf->tf_spsr &= ~PSR_FLAGS;
tf->tf_spsr |= regs->r_cpsr & PSR_FLAGS;
- return (0);
+ return (0);
}
int
@@ -633,7 +631,7 @@ ptrace_single_step(struct thread *td)
{
struct proc *p;
int error;
-
+
/* TODO: This needs to be updated for Thumb-2 */
if ((td->td_frame->tf_spsr & PSR_T) != 0)
return (EINVAL);
@@ -743,10 +741,13 @@ get_mcontext(struct thread *td, mcontext_t *mcp, int clear_ret)
struct trapframe *tf = td->td_frame;
__greg_t *gr = mcp->__gregs;
- if (clear_ret & GET_MC_CLEAR_RET)
+ if (clear_ret & GET_MC_CLEAR_RET) {
gr[_REG_R0] = 0;
- else
+ gr[_REG_CPSR] = tf->tf_spsr & ~PSR_C;
+ } else {
gr[_REG_R0] = tf->tf_r0;
+ gr[_REG_CPSR] = tf->tf_spsr;
+ }
gr[_REG_R1] = tf->tf_r1;
gr[_REG_R2] = tf->tf_r2;
gr[_REG_R3] = tf->tf_r3;
@@ -762,7 +763,6 @@ get_mcontext(struct thread *td, mcontext_t *mcp, int clear_ret)
gr[_REG_SP] = tf->tf_usr_sp;
gr[_REG_LR] = tf->tf_usr_lr;
gr[_REG_PC] = tf->tf_pc;
- gr[_REG_CPSR] = tf->tf_spsr;
return (0);
}
@@ -812,7 +812,7 @@ sys_sigreturn(td, uap)
{
ucontext_t uc;
int spsr;
-
+
if (uap == NULL)
return (EFAULT);
if (copyin(uap->sigcntxp, &uc, sizeof(uc)))
@@ -911,14 +911,11 @@ fake_preload_metadata(struct arm_boot_params *abp __unused)
void
pcpu0_init(void)
{
-#if ARM_ARCH_6 || ARM_ARCH_7A || defined(CPU_MV_PJ4B)
+#if __ARM_ARCH >= 6
set_curthread(&thread0);
#endif
pcpu_init(pcpup, 0, sizeof(struct pcpu));
PCPU_SET(curthread, &thread0);
-#ifdef VFP
- PCPU_SET(cpu, 0);
-#endif
}
#if defined(LINUX_BOOT_ABI)
@@ -1102,6 +1099,113 @@ set_stackptrs(int cpu)
}
#endif
+#ifdef EFI
+#define efi_next_descriptor(ptr, size) \
+ ((struct efi_md *)(((uint8_t *) ptr) + size))
+
+static void
+add_efi_map_entries(struct efi_map_header *efihdr, struct mem_region *mr,
+ int *mrcnt, uint32_t *memsize)
+{
+ struct efi_md *map, *p;
+ const char *type;
+ size_t efisz, memory_size;
+ int ndesc, i, j;
+
+ static const char *types[] = {
+ "Reserved",
+ "LoaderCode",
+ "LoaderData",
+ "BootServicesCode",
+ "BootServicesData",
+ "RuntimeServicesCode",
+ "RuntimeServicesData",
+ "ConventionalMemory",
+ "UnusableMemory",
+ "ACPIReclaimMemory",
+ "ACPIMemoryNVS",
+ "MemoryMappedIO",
+ "MemoryMappedIOPortSpace",
+ "PalCode"
+ };
+
+ *mrcnt = 0;
+ *memsize = 0;
+
+ /*
+ * Memory map data provided by UEFI via the GetMemoryMap
+ * Boot Services API.
+ */
+ efisz = roundup2(sizeof(struct efi_map_header), 0x10);
+ map = (struct efi_md *)((uint8_t *)efihdr + efisz);
+
+ if (efihdr->descriptor_size == 0)
+ return;
+ ndesc = efihdr->memory_size / efihdr->descriptor_size;
+
+ if (boothowto & RB_VERBOSE)
+ printf("%23s %12s %12s %8s %4s\n",
+ "Type", "Physical", "Virtual", "#Pages", "Attr");
+
+ memory_size = 0;
+ for (i = 0, j = 0, p = map; i < ndesc; i++,
+ p = efi_next_descriptor(p, efihdr->descriptor_size)) {
+ if (boothowto & RB_VERBOSE) {
+ if (p->md_type <= EFI_MD_TYPE_PALCODE)
+ type = types[p->md_type];
+ else
+ type = "<INVALID>";
+ printf("%23s %012llx %12p %08llx ", type, p->md_phys,
+ p->md_virt, p->md_pages);
+ if (p->md_attr & EFI_MD_ATTR_UC)
+ printf("UC ");
+ if (p->md_attr & EFI_MD_ATTR_WC)
+ printf("WC ");
+ if (p->md_attr & EFI_MD_ATTR_WT)
+ printf("WT ");
+ if (p->md_attr & EFI_MD_ATTR_WB)
+ printf("WB ");
+ if (p->md_attr & EFI_MD_ATTR_UCE)
+ printf("UCE ");
+ if (p->md_attr & EFI_MD_ATTR_WP)
+ printf("WP ");
+ if (p->md_attr & EFI_MD_ATTR_RP)
+ printf("RP ");
+ if (p->md_attr & EFI_MD_ATTR_XP)
+ printf("XP ");
+ if (p->md_attr & EFI_MD_ATTR_RT)
+ printf("RUNTIME");
+ printf("\n");
+ }
+
+ switch (p->md_type) {
+ case EFI_MD_TYPE_CODE:
+ case EFI_MD_TYPE_DATA:
+ case EFI_MD_TYPE_BS_CODE:
+ case EFI_MD_TYPE_BS_DATA:
+ case EFI_MD_TYPE_FREE:
+ /*
+ * We're allowed to use any entry with these types.
+ */
+ break;
+ default:
+ continue;
+ }
+
+ j++;
+ if (j >= FDT_MEM_REGIONS)
+ break;
+
+ mr[j].mr_start = p->md_phys;
+ mr[j].mr_size = p->md_pages * PAGE_SIZE;
+ memory_size += mr[j].mr_size;
+ }
+
+ *mrcnt = j;
+ *memsize = memory_size;
+}
+#endif /* EFI */
+
#ifdef FDT
static char *
kenv_next(char *cp)
@@ -1186,7 +1290,7 @@ initarm(struct arm_boot_params *abp)
/* Grab reserved memory regions information from device tree. */
if (fdt_get_reserved_regions(mem_regions, &mem_regions_sz) == 0)
- arm_physmem_exclude_regions(mem_regions, mem_regions_sz,
+ arm_physmem_exclude_regions(mem_regions, mem_regions_sz,
EXFLAG_NODUMP | EXFLAG_NOALLOC);
/* Platform-specific initialisation */
@@ -1392,7 +1496,7 @@ initarm(struct arm_boot_params *abp)
*
* Prepare the list of physical memory available to the vm subsystem.
*/
- arm_physmem_exclude_region(abp->abp_physaddr,
+ arm_physmem_exclude_region(abp->abp_physaddr,
(virtual_avail - KERNVIRTADDR), EXFLAG_NOALLOC);
arm_physmem_init_kernel_globals();
@@ -1413,6 +1517,9 @@ initarm(struct arm_boot_params *abp)
char *env;
void *kmdp;
int err_devmap, mem_regions_sz;
+#ifdef EFI
+ struct efi_map_header *efihdr;
+#endif
/* get last allocated physical address */
arm_physmem_kernaddr = abp->abp_physaddr;
@@ -1445,9 +1552,20 @@ initarm(struct arm_boot_params *abp)
if (OF_init((void *)dtbp) != 0)
panic("OF_init failed with the found device tree");
- /* Grab physical memory regions information from device tree. */
- if (fdt_get_mem_regions(mem_regions, &mem_regions_sz, &memsize) != 0)
- panic("Cannot get physical memory regions");
+#ifdef EFI
+ efihdr = (struct efi_map_header *)preload_search_info(kmdp,
+ MODINFO_METADATA | MODINFOMD_EFI_MAP);
+ if (efihdr != NULL) {
+ add_efi_map_entries(efihdr, mem_regions, &mem_regions_sz,
+ &memsize);
+ } else
+#endif
+ {
+ /* Grab physical memory regions information from device tree. */
+ if (fdt_get_mem_regions(mem_regions, &mem_regions_sz,
+ &memsize) != 0)
+ panic("Cannot get physical memory regions");
+ }
arm_physmem_hardware_regions(mem_regions, mem_regions_sz);
/* Grab reserved memory regions information from device tree. */
diff --git a/sys/arm/arm/mp_machdep.c b/sys/arm/arm/mp_machdep.c
index 88104f0..083e62e 100644
--- a/sys/arm/arm/mp_machdep.c
+++ b/sys/arm/arm/mp_machdep.c
@@ -197,8 +197,6 @@ init_secondary(int cpu)
pc->pc_curpcb = pc->pc_idlethread->td_pcb;
set_curthread(pc->pc_idlethread);
#ifdef VFP
- pc->pc_cpu = cpu;
-
vfp_init();
#endif
@@ -222,7 +220,7 @@ init_secondary(int cpu)
end = IPI_IRQ_START;
#endif
#endif
-
+
for (int i = start; i <= end; i++)
arm_unmask_irq(i);
enable_interrupts(PSR_I);
@@ -344,7 +342,7 @@ release_aps(void *dummy __unused)
/*
* IPI handler
*/
- /*
+ /*
* Use 0xdeadbeef as the argument value for irq 0,
* if we used 0, the intr code will give the trap frame
* pointer instead.
diff --git a/sys/arm/arm/mpcore_timer.c b/sys/arm/arm/mpcore_timer.c
index 88060cf..fb30d38 100644
--- a/sys/arm/arm/mpcore_timer.c
+++ b/sys/arm/arm/mpcore_timer.c
@@ -414,7 +414,7 @@ arm_tmr_attach(device_t dev)
if (!arm_tmr_freq_varies)
tc_err = attach_tc(sc);
else if (bootverbose)
- device_printf(sc->dev,
+ device_printf(sc->dev,
"not using variable-frequency device as timecounter");
sc->memrid++;
sc->irqrid++;
@@ -488,7 +488,7 @@ arm_tmr_change_frequency(uint64_t newfreq)
* @usec: number of microseconds to delay by
*
* This function is called all over the kernel and is suppose to provide a
- * consistent delay. This function may also be called before the console
+ * consistent delay. This function may also be called before the console
* is setup so no printf's can be called here.
*
* RETURNS:
diff --git a/sys/arm/arm/nexus.c b/sys/arm/arm/nexus.c
index 06f2d6f..def6c1a 100644
--- a/sys/arm/arm/nexus.c
+++ b/sys/arm/arm/nexus.c
@@ -127,7 +127,7 @@ static driver_t nexus_driver = {
nexus_methods,
1 /* no softc */
};
-EARLY_DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0,
+EARLY_DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0,
BUS_PASS_BUS + BUS_PASS_ORDER_EARLY);
static int
@@ -236,7 +236,7 @@ nexus_release_resource(device_t bus, device_t child, int type, int rid,
struct resource *res)
{
int error;
-
+
if (rman_get_flags(res) & RF_ACTIVE) {
error = bus_deactivate_resource(child, type, rid, res);
if (error)
diff --git a/sys/arm/arm/physmem.c b/sys/arm/arm/physmem.c
index bc72ce2..a922163 100644
--- a/sys/arm/arm/physmem.c
+++ b/sys/arm/arm/physmem.c
@@ -62,7 +62,7 @@ static size_t hwcnt;
static size_t excnt;
/*
- * These "avail lists" are globals used to communicate physical memory layout to
+ * These "avail lists" are globals used to communicate physical memory layout to
* other parts of the kernel. Within the arrays, each value is the starting
* address of a contiguous area of physical address space. The values at even
* indexes are areas that contain usable memory and the values at odd indexes
diff --git a/sys/arm/arm/pl190.c b/sys/arm/arm/pl190.c
index 5e81134..8cd744e 100644
--- a/sys/arm/arm/pl190.c
+++ b/sys/arm/arm/pl190.c
@@ -121,7 +121,7 @@ pl190_intc_attach(device_t dev)
id = 0;
for (i = 3; i >= 0; i--) {
- id = (id << 8) |
+ id = (id << 8) |
(intc_vic_read_4(VICPERIPHID + i*4) & 0xff);
}
@@ -129,7 +129,7 @@ pl190_intc_attach(device_t dev)
id = 0;
for (i = 3; i >= 0; i--) {
- id = (id << 8) |
+ id = (id << 8) |
(intc_vic_read_4(VICPRIMECELLID + i*4) & 0xff);
}
@@ -152,7 +152,7 @@ static driver_t pl190_intc_driver = {
static devclass_t pl190_intc_devclass;
-EARLY_DRIVER_MODULE(intc, simplebus, pl190_intc_driver, pl190_intc_devclass,
+EARLY_DRIVER_MODULE(intc, simplebus, pl190_intc_driver, pl190_intc_devclass,
0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE);
int
@@ -164,7 +164,7 @@ arm_get_next_irq(int last_irq)
/* Sanity check */
if (irq < 0)
irq = 0;
-
+
pending = intc_vic_read_4(VICIRQSTATUS);
while (irq < VIC_NIRQS) {
if (pending & (1 << irq))
diff --git a/sys/arm/arm/pl310.c b/sys/arm/arm/pl310.c
index 3305f35..2fba6a8 100644
--- a/sys/arm/arm/pl310.c
+++ b/sys/arm/arm/pl310.c
@@ -50,11 +50,11 @@ __FBSDID("$FreeBSD$");
/*
* Define this if you need to disable PL310 for debugging purpose
- * Spec:
+ * Spec:
* http://infocenter.arm.com/help/topic/com.arm.doc.ddi0246e/DDI0246E_l2c310_r3p1_trm.pdf
*/
-/*
+/*
* Hardcode errata for now
* http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0246b/pr01s02s02.html
*/
@@ -137,7 +137,7 @@ pl310_set_ram_latency(struct pl310_softc *sc, uint32_t which_reg,
{
uint32_t v;
- KASSERT(which_reg == PL310_TAG_RAM_CTRL ||
+ KASSERT(which_reg == PL310_TAG_RAM_CTRL ||
which_reg == PL310_DATA_RAM_CTRL,
("bad pl310 ram latency register address"));
@@ -191,7 +191,7 @@ pl310_wait_background_op(uint32_t off, uint32_t mask)
/**
* pl310_cache_sync - performs a cache sync operation
- *
+ *
* According to the TRM:
*
* "Before writing to any other register you must perform an explicit
@@ -231,7 +231,7 @@ pl310_wbinv_all(void)
for (i = 0; i < g_ways_assoc; i++) {
for (j = 0; j < g_way_size / g_l2cache_line_size; j++) {
- pl310_write4(pl310_softc,
+ pl310_write4(pl310_softc,
PL310_CLEAN_INV_LINE_IDX,
(i << 28 | j << 5));
}
@@ -278,8 +278,8 @@ pl310_wbinv_range(vm_paddr_t start, vm_size_t size)
while (size > 0) {
#ifdef PL310_ERRATA_588369
if (pl310_softc->sc_rtl_revision <= CACHE_ID_RELEASE_r1p0) {
- /*
- * Errata 588369 says that clean + inv may keep the
+ /*
+ * Errata 588369 says that clean + inv may keep the
* cache line if it was clean, the recommanded
* workaround is to clean then invalidate the cache
* line, with write-back and cache linefill disabled.
@@ -402,10 +402,10 @@ pl310_config_intr(void *arg)
pl310_filter, NULL, sc, &sc->sc_irq_h);
/* Cache Line Eviction for Counter 0 */
- pl310_write4(sc, PL310_EVENT_COUNTER0_CONF,
+ pl310_write4(sc, PL310_EVENT_COUNTER0_CONF,
EVENT_COUNTER_CONF_INCR | EVENT_COUNTER_CONF_CO);
/* Data Read Request for Counter 1 */
- pl310_write4(sc, PL310_EVENT_COUNTER1_CONF,
+ pl310_write4(sc, PL310_EVENT_COUNTER1_CONF,
EVENT_COUNTER_CONF_INCR | EVENT_COUNTER_CONF_DRREQ);
/* Enable and clear pending interrupts */
@@ -413,9 +413,9 @@ pl310_config_intr(void *arg)
pl310_write4(sc, PL310_INTR_MASK, INTR_MASK_ALL);
/* Enable counters and reset C0 and C1 */
- pl310_write4(sc, PL310_EVENT_COUNTER_CTRL,
- EVENT_COUNTER_CTRL_ENABLED |
- EVENT_COUNTER_CTRL_C0_RESET |
+ pl310_write4(sc, PL310_EVENT_COUNTER_CTRL,
+ EVENT_COUNTER_CTRL_ENABLED |
+ EVENT_COUNTER_CTRL_C0_RESET |
EVENT_COUNTER_CTRL_C1_RESET);
config_intrhook_disestablish(sc->sc_ich);
@@ -426,7 +426,7 @@ pl310_config_intr(void *arg)
static int
pl310_probe(device_t dev)
{
-
+
if (!ofw_bus_status_okay(dev))
return (ENXIO);
if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data)
@@ -444,7 +444,7 @@ pl310_attach(device_t dev)
sc->sc_dev = dev;
rid = 0;
- sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
+ sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
RF_ACTIVE);
if (sc->sc_mem_res == NULL)
panic("%s: Cannot map registers", device_get_name(dev));
@@ -501,7 +501,7 @@ pl310_attach(device_t dev)
pl310_write4(pl310_softc, PL310_INV_WAY, 0xffff);
pl310_wait_background_op(PL310_INV_WAY, 0xffff);
platform_pl310_write_ctrl(sc, CTRL_ENABLED);
- device_printf(dev, "L2 Cache enabled: %uKB/%dB %d ways\n",
+ device_printf(dev, "L2 Cache enabled: %uKB/%dB %d ways\n",
(g_l2cache_size / 1024), g_l2cache_line_size, g_ways_assoc);
if (bootverbose)
pl310_print_config(sc);
diff --git a/sys/arm/arm/pmap-v6-new.c b/sys/arm/arm/pmap-v6-new.c
index 8fd6222..13a97de 100644
--- a/sys/arm/arm/pmap-v6-new.c
+++ b/sys/arm/arm/pmap-v6-new.c
@@ -2194,7 +2194,7 @@ pmap_release(pmap_t pmap)
pmap->pm_stats.resident_count));
KASSERT(pt2tab_user_is_empty(pmap->pm_pt2tab),
("%s: has allocated user PT2(s)", __func__));
- KASSERT(CPU_EMPTY(&pmap->pm_active),
+ KASSERT(CPU_EMPTY(&pmap->pm_active),
("%s: pmap %p is active on some CPU(s)", __func__, pmap));
mtx_lock_spin(&allpmaps_lock);
@@ -5768,6 +5768,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, vm_size_t len,
~PTE1_W;
dst_pmap->pm_stats.resident_count +=
PTE1_SIZE / PAGE_SIZE;
+ pmap_pte1_mappings++;
}
continue;
} else if (!pte1_is_link(src_pte1))
@@ -5958,7 +5959,7 @@ pmap_kenter_device(vm_offset_t va, vm_size_t size, vm_paddr_t pa)
{
vm_offset_t sva;
- KASSERT((size & PAGE_MASK) == 0,
+ KASSERT((size & PAGE_MASK) == 0,
("%s: device mapping not page-sized", __func__));
sva = va;
@@ -5976,7 +5977,7 @@ pmap_kremove_device(vm_offset_t va, vm_size_t size)
{
vm_offset_t sva;
- KASSERT((size & PAGE_MASK) == 0,
+ KASSERT((size & PAGE_MASK) == 0,
("%s: device mapping not page-sized", __func__));
sva = va;
diff --git a/sys/arm/arm/pmap-v6.c b/sys/arm/arm/pmap-v6.c
index 0e0d884..a9421aa 100644
--- a/sys/arm/arm/pmap-v6.c
+++ b/sys/arm/arm/pmap-v6.c
@@ -1145,7 +1145,7 @@ vector_page_setprot(int prot)
/*
* Set referenced flag.
* Vectors' page is always desired
- * to be allowed to reside in TLB.
+ * to be allowed to reside in TLB.
*/
*ptep |= L2_S_REF;
@@ -2221,7 +2221,7 @@ pmap_remove_pages(pmap_t pmap)
vm_offset_t va;
uint32_t inuse, bitmask;
int allfree, bit, field, idx;
-
+
rw_wlock(&pvh_global_lock);
PMAP_LOCK(pmap);
@@ -2455,7 +2455,7 @@ pmap_kenter_device(vm_offset_t va, vm_size_t size, vm_paddr_t pa)
{
vm_offset_t sva;
- KASSERT((size & PAGE_MASK) == 0,
+ KASSERT((size & PAGE_MASK) == 0,
("%s: device mapping not page-sized", __func__));
sva = va;
@@ -2472,7 +2472,7 @@ pmap_kremove_device(vm_offset_t va, vm_size_t size)
{
vm_offset_t sva;
- KASSERT((size & PAGE_MASK) == 0,
+ KASSERT((size & PAGE_MASK) == 0,
("%s: device mapping not page-sized", __func__));
sva = va;
@@ -3093,7 +3093,7 @@ do_l2b_alloc:
if ((pve = pmap_remove_pv(om, pmap, va))) {
is_exec |= PTE_BEEN_EXECD(opte);
is_refd |= PTE_BEEN_REFD(opte);
-
+
if (m && ((m->oflags & VPO_UNMANAGED)))
pmap_free_pv_entry(pmap, pve);
}
@@ -3303,7 +3303,7 @@ pmap_unwire(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
vm_offset_t next_bucket;
vm_paddr_t pa;
vm_page_t m;
-
+
rw_wlock(&pvh_global_lock);
PMAP_LOCK(pmap);
while (sva < eva) {
@@ -3572,7 +3572,7 @@ pmap_pv_insert_section(pmap_t pmap, vm_offset_t va, vm_paddr_t pa)
pv_entry_t pv;
rw_assert(&pvh_global_lock, RA_WLOCKED);
- if (pv_entry_count < pv_entry_high_water &&
+ if (pv_entry_count < pv_entry_high_water &&
(pv = pmap_get_pv_entry(pmap, TRUE)) != NULL) {
pv->pv_va = va;
pvh = pa_to_pvh(pa);
@@ -3661,7 +3661,7 @@ pmap_pv_promote_section(pmap_t pmap, vm_offset_t va, vm_paddr_t pa)
* Tries to create a 1MB page mapping. Returns TRUE if successful and
* FALSE otherwise. Fails if (1) page is unmanageg, kernel pmap or vectors
* page, (2) a mapping already exists at the specified virtual address, or
- * (3) a pv entry cannot be allocated without reclaiming another pv entry.
+ * (3) a pv entry cannot be allocated without reclaiming another pv entry.
*/
static boolean_t
pmap_enter_section(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot)
@@ -3692,7 +3692,7 @@ pmap_enter_section(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot)
" in pmap %p", va, pmap);
return (FALSE);
}
- pa = VM_PAGE_TO_PHYS(m);
+ pa = VM_PAGE_TO_PHYS(m);
/*
* Abort this mapping if its PV entry could not be created.
*/
@@ -3767,7 +3767,7 @@ pmap_remove_section(pmap_t pmap, vm_offset_t sva)
TAILQ_EMPTY(&pvh->pv_list))
vm_page_aflag_clear(m, PGA_WRITEABLE);
}
-
+
l2b = pmap_get_l2_bucket(pmap, sva);
if (l2b != NULL) {
KASSERT(l2b->l2b_occupancy == L2_PTE_NUM_TOTAL,
@@ -3879,8 +3879,8 @@ pmap_promote_section(pmap_t pmap, vm_offset_t va)
if (!L2_S_EXECUTABLE(firstpte))
prot &= ~VM_PROT_EXECUTE;
- /*
- * Examine each of the other PTEs in the specified l2_bucket.
+ /*
+ * Examine each of the other PTEs in the specified l2_bucket.
* Abort if this PTE maps an unexpected 4KB physical page or
* does not have identical characteristics to the first PTE.
*/
@@ -4000,7 +4000,7 @@ pmap_demote_section(pmap_t pmap, vm_offset_t va)
/*
* According to assumptions described in pmap_promote_section,
* kernel is and always should be mapped using 1MB section mappings.
- * What more, managed kernel pages were not to be promoted.
+ * What more, managed kernel pages were not to be promoted.
*/
KASSERT(pmap != pmap_kernel() && L1_IDX(va) != L1_IDX(vector_page),
("pmap_demote_section: forbidden section mapping"));
@@ -4010,7 +4010,7 @@ pmap_demote_section(pmap_t pmap, vm_offset_t va)
l1pd = *pl1pd;
KASSERT((l1pd & L1_TYPE_MASK) == L1_S_PROTO,
("pmap_demote_section: not section or invalid section"));
-
+
pa = l1pd & L1_S_FRAME;
m = PHYS_TO_VM_PAGE(pa);
KASSERT((m != NULL && (m->oflags & VPO_UNMANAGED) == 0),
@@ -4063,7 +4063,7 @@ pmap_demote_section(pmap_t pmap, vm_offset_t va)
/*
* If the mapping has changed attributes, update the page table
* entries.
- */
+ */
if ((*firstptep & L2_S_PROMOTE) != (L1_S_DEMOTE(l1pd)))
pmap_fill_l2b(l2b, newpte);
}
@@ -4493,7 +4493,7 @@ pmap_zero_page_gen(vm_page_t m, int off, int size)
{
struct czpages *czp;
- KASSERT(TAILQ_EMPTY(&m->md.pv_list),
+ KASSERT(TAILQ_EMPTY(&m->md.pv_list),
("pmap_zero_page_gen: page has mappings"));
vm_paddr_t phys = VM_PAGE_TO_PHYS(m);
@@ -4501,7 +4501,7 @@ pmap_zero_page_gen(vm_page_t m, int off, int size)
sched_pin();
czp = &cpu_czpages[PCPU_GET(cpuid)];
mtx_lock(&czp->lock);
-
+
/*
* Hook in the page, zero it.
*/
@@ -4589,7 +4589,7 @@ pmap_copy_page_generic(vm_paddr_t src, vm_paddr_t dst)
sched_pin();
czp = &cpu_czpages[PCPU_GET(cpuid)];
mtx_lock(&czp->lock);
-
+
/*
* Map the pages into the page hook points, copy them, and purge the
* cache for the appropriate page.
@@ -5338,7 +5338,7 @@ pmap_dmap_iscurrent(pmap_t pmap)
void
pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma)
{
- /*
+ /*
* Remember the memattr in a field that gets used to set the appropriate
* bits in the PTEs as mappings are established.
*/
diff --git a/sys/arm/arm/pmap.c b/sys/arm/arm/pmap.c
index 55e1aab..dfd5bcb 100644
--- a/sys/arm/arm/pmap.c
+++ b/sys/arm/arm/pmap.c
@@ -1005,7 +1005,7 @@ pmap_l2ptp_ctor(void *mem, int size, void *arg, int flags)
l2b = pmap_get_l2_bucket(pmap_kernel(), va);
ptep = &l2b->l2b_kva[l2pte_index(va)];
pte = *ptep;
-
+
if ((pte & L2_S_CACHE_MASK) != pte_l2_s_cache_mode_pt) {
/*
* Page tables must have the cache-mode set to
@@ -1357,7 +1357,7 @@ pmap_clearbit(struct vm_page *pg, u_int maskbits)
if (!(oflags & maskbits)) {
if ((maskbits & PVF_WRITE) && (pv->pv_flags & PVF_NC)) {
- if (pg->md.pv_memattr !=
+ if (pg->md.pv_memattr !=
VM_MEMATTR_UNCACHEABLE) {
PMAP_LOCK(pm);
l2b = pmap_get_l2_bucket(pm, va);
@@ -1955,7 +1955,7 @@ pmap_postinit(void)
pt_entry_t *ptep, pte;
vm_offset_t va, eva;
u_int loop, needed;
-
+
needed = (maxproc / PMAP_DOMAINS) + ((maxproc % PMAP_DOMAINS) ? 1 : 0);
needed -= 1;
l1 = malloc(sizeof(*l1) * needed, M_VMPMAP, M_WAITOK);
@@ -1970,7 +1970,7 @@ pmap_postinit(void)
eva = va + L1_TABLE_SIZE;
pl1pt = (pd_entry_t *)va;
-
+
while (va < eva) {
l2b = pmap_get_l2_bucket(pmap_kernel(), va);
ptep = &l2b->l2b_kva[l2pte_index(va)];
@@ -1979,7 +1979,7 @@ pmap_postinit(void)
*ptep = pte;
PTE_SYNC(ptep);
cpu_tlb_flushD_SE(va);
-
+
va += PAGE_SIZE;
}
pmap_init_l1(l1, pl1pt);
@@ -2162,11 +2162,11 @@ pmap_bootstrap(vm_offset_t firstaddr, struct pv_addr *l1pt)
PDEBUG(1, printf("firstaddr = %08x, lastaddr = %08x\n",
firstaddr, vm_max_kernel_address));
-
+
virtual_avail = firstaddr;
kernel_pmap->pm_l1 = l1;
kernel_l1pa = l1pt->pv_pa;
-
+
/*
* Scan the L1 translation table created by initarm() and create
* the required metadata for all valid mappings found in it.
@@ -2187,7 +2187,7 @@ pmap_bootstrap(vm_offset_t firstaddr, struct pv_addr *l1pt)
*/
pa = (vm_paddr_t)(pde & L1_C_ADDR_MASK);
ptep = (pt_entry_t *)kernel_pt_lookup(pa);
-
+
if (ptep == NULL) {
panic("pmap_bootstrap: No L2 for va 0x%x, pa 0x%lx",
(u_int)l1idx << L1_S_SHIFT, (long unsigned int)pa);
@@ -2241,7 +2241,7 @@ pmap_bootstrap(vm_offset_t firstaddr, struct pv_addr *l1pt)
}
}
-
+
/*
* Ensure the primary (kernel) L1 has the correct cache mode for
* a page table. Bitch if it is not correctly set.
@@ -2267,7 +2267,7 @@ pmap_bootstrap(vm_offset_t firstaddr, struct pv_addr *l1pt)
* Initialize the global pv list lock.
*/
rw_init_flags(&pvh_global_lock, "pmap pv global", RW_RECURSE);
-
+
/*
* Reserve some special page table entries/VA space for temporary
* mapping of pages.
@@ -2281,7 +2281,7 @@ pmap_bootstrap(vm_offset_t firstaddr, struct pv_addr *l1pt)
pmap_alloc_specials(&virtual_avail,
round_page(size * L2_TABLE_SIZE_REAL) / PAGE_SIZE,
&pmap_kernel_l2ptp_kva, NULL);
-
+
size = (size + (L2_BUCKET_SIZE - 1)) / L2_BUCKET_SIZE;
pmap_alloc_specials(&virtual_avail,
round_page(size * sizeof(struct l2_dtable)) / PAGE_SIZE,
@@ -2319,7 +2319,7 @@ void
pmap_release(pmap_t pmap)
{
struct pcb *pcb;
-
+
pmap_idcache_wbinv_all(pmap);
cpu_l2cache_wbinv_all();
pmap_tlb_flushID(pmap);
@@ -2352,7 +2352,7 @@ pmap_release(pmap_t pmap)
}
pmap_free_l1(pmap);
-
+
dprintf("pmap_release()\n");
}
@@ -2368,7 +2368,7 @@ pmap_grow_map(vm_offset_t va, pt_entry_t cache_mode, vm_paddr_t *pap)
pt_entry_t *ptep;
vm_paddr_t pa;
struct vm_page *pg;
-
+
pg = vm_page_alloc(NULL, 0, VM_ALLOC_NOOBJ | VM_ALLOC_WIRED);
if (pg == NULL)
return (1);
@@ -2530,7 +2530,7 @@ pmap_remove_pages(pmap_t pmap)
struct l2_bucket *l2b = NULL;
vm_page_t m;
pt_entry_t *pt;
-
+
rw_wlock(&pvh_global_lock);
PMAP_LOCK(pmap);
cpu_idcache_wbinv_all();
@@ -2576,7 +2576,7 @@ pmap_kenter_supersection(vm_offset_t va, uint64_t pa, int flags)
pd_entry_t pd = L1_S_PROTO | L1_S_SUPERSEC | (pa & L1_SUP_FRAME) |
(((pa >> 32) & 0xf) << 20) | L1_S_PROT(PTE_KERNEL,
VM_PROT_READ|VM_PROT_WRITE) | L1_S_DOM(PMAP_DOMAIN_KERNEL);
- struct l1_ttable *l1;
+ struct l1_ttable *l1;
vm_offset_t va0, va_end;
KASSERT(((va | pa) & L1_SUP_OFFSET) == 0,
@@ -2685,7 +2685,7 @@ pmap_kenter_internal(vm_offset_t va, vm_offset_t pa, int flags)
rw_wlock(&pvh_global_lock);
if (!TAILQ_EMPTY(&m->md.pv_list) || m->md.pv_kva != 0) {
if ((pve = pmap_get_pv_entry()) == NULL)
- panic("pmap_kenter_internal: no pv entries");
+ panic("pmap_kenter_internal: no pv entries");
PMAP_LOCK(pmap_kernel());
pmap_enter_pv(m, pve, pmap_kernel(), va,
PVF_WRITE | PVF_UNMAN);
@@ -2716,7 +2716,7 @@ pmap_kenter_device(vm_offset_t va, vm_size_t size, vm_paddr_t pa)
{
vm_offset_t sva;
- KASSERT((size & PAGE_MASK) == 0,
+ KASSERT((size & PAGE_MASK) == 0,
("%s: device mapping not page-sized", __func__));
sva = va;
@@ -2733,7 +2733,7 @@ pmap_kremove_device(vm_offset_t va, vm_size_t size)
{
vm_offset_t sva;
- KASSERT((size & PAGE_MASK) == 0,
+ KASSERT((size & PAGE_MASK) == 0,
("%s: device mapping not page-sized", __func__));
sva = va;
@@ -2775,7 +2775,7 @@ pmap_kremove(vm_offset_t va)
struct pv_entry *pve;
vm_page_t m;
vm_offset_t pa;
-
+
l2b = pmap_get_l2_bucket(pmap_kernel(), va);
if (!l2b)
return;
@@ -3287,9 +3287,9 @@ do_l2b_alloc:
* so no need to re-do referenced emulation here.
*/
npte |= L2_S_PROTO;
-
+
nflags |= PVF_REF;
-
+
if (m && ((prot & VM_PROT_WRITE) != 0 ||
(m->md.pvh_attrs & PVF_MOD))) {
/*
@@ -3310,7 +3310,7 @@ do_l2b_alloc:
*/
npte |= L2_TYPE_INV;
}
-
+
if (prot & VM_PROT_WRITE) {
npte |= L2_S_PROT_W;
if (m != NULL &&
@@ -3326,7 +3326,7 @@ do_l2b_alloc:
oflags = pmap_modify_pv(m, pmap, va,
PVF_WRITE | PVF_EXEC | PVF_WIRED |
PVF_MOD | PVF_REF, nflags);
-
+
/*
* We may need to flush the cache if we're
* doing rw-ro...
@@ -3544,7 +3544,7 @@ pmap_unwire(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
pv_entry_t pv;
vm_offset_t next_bucket;
vm_page_t m;
-
+
rw_wlock(&pvh_global_lock);
PMAP_LOCK(pmap);
while (sva < eva) {
@@ -3690,7 +3690,7 @@ retry:
m = PHYS_TO_VM_PAGE(pa);
vm_page_hold(m);
}
-
+
} else {
/*
* Note that we can't rely on the validity of the L1
@@ -3717,13 +3717,13 @@ retry:
case L2_TYPE_L:
pa = (pte & L2_L_FRAME) | (va & L2_L_OFFSET);
break;
-
+
default:
pa = (pte & L2_S_FRAME) | (va & L2_S_OFFSET);
break;
}
if (vm_page_pa_tryrelock(pmap, pa & PG_FRAME, &paddr))
- goto retry;
+ goto retry;
m = PHYS_TO_VM_PAGE(pa);
vm_page_hold(m);
}
@@ -3743,12 +3743,12 @@ int
pmap_pinit(pmap_t pmap)
{
PDEBUG(1, printf("pmap_pinit: pmap = %08x\n", (uint32_t) pmap));
-
+
pmap_alloc_l1(pmap);
bzero(pmap->pm_l2, sizeof(pmap->pm_l2));
CPU_ZERO(&pmap->pm_active);
-
+
TAILQ_INIT(&pmap->pm_pvlist);
bzero(&pmap->pm_stats, sizeof pmap->pm_stats);
pmap->pm_stats.resident_count = 1;
@@ -3783,7 +3783,7 @@ static pv_entry_t
pmap_get_pv_entry(void)
{
pv_entry_t ret_value;
-
+
pv_entry_count++;
if (pv_entry_count > pv_entry_high_water)
pagedaemon_wakeup();
@@ -4353,7 +4353,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_page_t m)
pv_entry_t pv;
int loops = 0;
boolean_t rv;
-
+
KASSERT((m->oflags & VPO_UNMANAGED) == 0,
("pmap_page_exists_quick: page %p is not managed", m));
rv = FALSE;
@@ -4425,7 +4425,7 @@ pmap_is_modified(vm_page_t m)
("pmap_is_modified: page %p is not managed", m));
if (m->md.pvh_attrs & PVF_MOD)
return (TRUE);
-
+
return(FALSE);
}
@@ -4631,7 +4631,7 @@ pmap_link_l2pt(vm_offset_t l1pt, vm_offset_t va, struct pv_addr *l2pv)
SLIST_INSERT_HEAD(&kernel_pt_list, l2pv, pv_list);
-
+
}
/*
@@ -4793,7 +4793,7 @@ pmap_map_chunk(vm_offset_t l1pt, vm_offset_t va, vm_offset_t pa,
void
pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma)
{
- /*
+ /*
* Remember the memattr in a field that gets used to set the appropriate
* bits in the PTEs as mappings are established.
*/
diff --git a/sys/arm/arm/stack_machdep.c b/sys/arm/arm/stack_machdep.c
index 9c984a9..9e68023 100644
--- a/sys/arm/arm/stack_machdep.c
+++ b/sys/arm/arm/stack_machdep.c
@@ -49,16 +49,6 @@ extern vm_offset_t kernel_vm_end;
static void
stack_capture(struct stack *st, u_int32_t *frame)
{
-#if !defined(__ARM_EABI__) && !defined(__clang__)
- vm_offset_t callpc;
-
- while (INKERNEL(frame) && (vm_offset_t)frame < kernel_vm_end) {
- callpc = frame[FR_SCP];
- if (stack_put(st, callpc) == -1)
- break;
- frame = (u_int32_t *)(frame[FR_RFP]);
- }
-#endif
}
void
diff --git a/sys/arm/arm/support.S b/sys/arm/arm/support.S
index b095aed..e26ac82 100644
--- a/sys/arm/arm/support.S
+++ b/sys/arm/arm/support.S
@@ -430,7 +430,7 @@ EENTRY(memmove)
/* blat 32 bytes at a time */
/* XXX for really big copies perhaps we should use more registers */
-.Lmemmove_floop32:
+.Lmemmove_floop32:
ldmia r1!, {r3, r4, r12, lr}
stmia r0!, {r3, r4, r12, lr}
ldmia r1!, {r3, r4, r12, lr}
@@ -988,7 +988,7 @@ ENTRY(memcpy)
/* blat 32 bytes at a time */
/* XXX for really big copies perhaps we should use more registers */
-.Lmemcpy_loop32:
+.Lmemcpy_loop32:
ldmia r1!, {r3, r4, r12, lr}
stmia r0!, {r3, r4, r12, lr}
ldmia r1!, {r3, r4, r12, lr}
diff --git a/sys/arm/arm/swtch.S b/sys/arm/arm/swtch.S
index 4773557..ee63685 100644
--- a/sys/arm/arm/swtch.S
+++ b/sys/arm/arm/swtch.S
@@ -143,7 +143,7 @@ ENTRY(cpu_throw)
GET_PCPU(r7, r9)
ldr r7, [r5, #(TD_PCB)] /* r7 = new thread's PCB */
-
+
/* Switch to lwp0 context */
ldr r9, .Lcpufuncs
@@ -198,20 +198,20 @@ ENTRY(cpu_throw)
str r7, [r6, #PC_CURPCB]
/* We have a new curthread now so make a note it */
str r5, [r6, #PC_CURTHREAD]
-#ifndef ARM_TP_ADDRESS
+#if __ARM_ARCH >= 6
mcr p15, 0, r5, c13, c0, 4
#endif
/* Set the new tp */
ldr r6, [r5, #(TD_MD + MD_TP)]
-#ifdef ARM_TP_ADDRESS
+#if __ARM_ARCH >= 6
+ mcr p15, 0, r6, c13, c0, 3
+#else
ldr r4, =ARM_TP_ADDRESS
str r6, [r4]
ldr r6, [r5, #(TD_MD + MD_RAS_START)]
str r6, [r4, #4] /* ARM_RAS_START */
ldr r6, [r5, #(TD_MD + MD_RAS_END)]
str r6, [r4, #8] /* ARM_RAS_END */
-#else
- mcr p15, 0, r6, c13, c0, 3
#endif
/* Restore all the saved registers and exit */
add r3, r7, #PCB_R4
@@ -245,7 +245,7 @@ ENTRY(cpu_switch)
/* We have a new curthread now so make a note it */
GET_PCPU(r7, r2)
str r1, [r7, #PC_CURTHREAD]
-#ifndef ARM_TP_ADDRESS
+#if __ARM_ARCH >= 6
mcr p15, 0, r1, c13, c0, 4
#endif
@@ -259,7 +259,14 @@ ENTRY(cpu_switch)
ldr r2, [r0, #(TD_PCB)]
mov r4, r0 /* Save the old thread. */
-#ifdef ARM_TP_ADDRESS
+#if __ARM_ARCH >= 6
+ /*
+ * Set new tp. No need to store the old one first, userland can't
+ * change it directly on armv6.
+ */
+ ldr r9, [r1, #(TD_MD + MD_TP)]
+ mcr p15, 0, r9, c13, c0, 3
+#else
/* Store the old tp; userland can change it on armv4. */
ldr r3, =ARM_TP_ADDRESS
ldr r9, [r3]
@@ -276,15 +283,8 @@ ENTRY(cpu_switch)
str r9, [r3, #4]
ldr r9, [r1, #(TD_MD + MD_RAS_END)]
str r9, [r3, #8]
-#else
- /*
- * Set new tp. No need to store the old one first, userland can't
- * change it directly on armv6.
- */
- ldr r9, [r1, #(TD_MD + MD_TP)]
- mcr p15, 0, r9, c13, c0, 3
#endif
-
+
/* Get the user structure for the new process in r9 */
ldr r9, [r1, #(TD_PCB)]
@@ -407,7 +407,7 @@ ENTRY(cpu_switch)
cmp r4, r6
beq 1b
#endif
-
+
/* XXXSCW: Safe to re-enable FIQs here */
/* rem: r9 = new PCB */
@@ -794,7 +794,7 @@ END(cpu_switch)
ENTRY(savectx)
stmfd sp!, {lr}
sub sp, sp, #4
-
+
/* Store all the registers in the thread's pcb */
add r3, r0, #(PCB_R4)
stmia r3, {r4-r12, sp, lr, pc}
diff --git a/sys/arm/arm/sys_machdep.c b/sys/arm/arm/sys_machdep.c
index b12cdd5..efebda3 100644
--- a/sys/arm/arm/sys_machdep.c
+++ b/sys/arm/arm/sys_machdep.c
@@ -41,8 +41,13 @@ __FBSDID("$FreeBSD$");
#include <sys/sysproto.h>
#include <sys/syscall.h>
#include <sys/sysent.h>
+#include <vm/vm.h>
+#include <vm/vm_extern.h>
+#include <machine/acle-compat.h>
+#include <machine/cpu-v6.h>
#include <machine/sysarch.h>
+#include <machine/vmparam.h>
#ifndef _SYS_SYSPROTO_H_
struct sysarch_args {
@@ -55,16 +60,89 @@ struct sysarch_args {
static int arm32_sync_icache (struct thread *, void *);
static int arm32_drain_writebuf(struct thread *, void *);
+#if __ARM_ARCH >= 6
+static int
+sync_icache(uintptr_t addr, size_t len)
+{
+ size_t size;
+ vm_offset_t rv;
+
+ /*
+ * Align starting address to even number because value of "1"
+ * is used as return value for success.
+ */
+ len += addr & 1;
+ addr &= ~1;
+
+ /* Break whole range to pages. */
+ do {
+ size = PAGE_SIZE - (addr & PAGE_MASK);
+ size = min(size, len);
+ rv = dcache_wb_pou_checked(addr, size);
+ if (rv == 1) /* see dcache_wb_pou_checked() */
+ rv = icache_inv_pou_checked(addr, size);
+ if (rv != 1) {
+ if (!useracc((void *)addr, size, VM_PROT_READ)) {
+ /* Invalid access */
+ return (rv);
+ }
+ /* Valid but unmapped page - skip it. */
+ }
+ len -= size;
+ addr += size;
+ } while (len > 0);
+
+ /* Invalidate branch predictor buffer. */
+ bpb_inv_all();
+ return (1);
+}
+#endif
+
static int
arm32_sync_icache(struct thread *td, void *args)
{
struct arm_sync_icache_args ua;
int error;
+ ksiginfo_t ksi;
+#if __ARM_ARCH >= 6
+ vm_offset_t rv;
+#endif
if ((error = copyin(args, &ua, sizeof(ua))) != 0)
return (error);
+ if (ua.len == 0) {
+ td->td_retval[0] = 0;
+ return (0);
+ }
+
+ /*
+ * Validate arguments. Address and length are unsigned,
+ * so we can use wrapped overflow check.
+ */
+ if (((ua.addr + ua.len) < ua.addr) ||
+ ((ua.addr + ua.len) > VM_MAXUSER_ADDRESS)) {
+ ksiginfo_init_trap(&ksi);
+ ksi.ksi_signo = SIGSEGV;
+ ksi.ksi_code = SEGV_ACCERR;
+ ksi.ksi_addr = (void *)max(ua.addr, VM_MAXUSER_ADDRESS);
+ trapsignal(td, &ksi);
+ return (EINVAL);
+ }
+
+#if __ARM_ARCH >= 6
+ rv = sync_icache(ua.addr, ua.len);
+ if (rv != 1) {
+ ksiginfo_init_trap(&ksi);
+ ksi.ksi_signo = SIGSEGV;
+ ksi.ksi_code = SEGV_MAPERR;
+ ksi.ksi_addr = (void *)rv;
+ trapsignal(td, &ksi);
+ return (EINVAL);
+ }
+#else
cpu_icache_sync_range(ua.addr, ua.len);
+#endif
td->td_retval[0] = 0;
return (0);
@@ -85,7 +163,7 @@ arm32_set_tp(struct thread *td, void *args)
{
td->td_md.md_tp = (register_t)args;
-#ifndef ARM_TP_ADDRESS
+#if __ARM_ARCH >= 6
set_tls(args);
#else
*(register_t *)ARM_TP_ADDRESS = (register_t)args;
@@ -97,7 +175,7 @@ static int
arm32_get_tp(struct thread *td, void *args)
{
-#ifndef ARM_TP_ADDRESS
+#if __ARM_ARCH >= 6
td->td_retval[0] = td->td_md.md_tp;
#else
td->td_retval[0] = *(register_t *)ARM_TP_ADDRESS;
diff --git a/sys/arm/arm/trap-v6.c b/sys/arm/arm/trap-v6.c
index abafa86..b15062c 100644
--- a/sys/arm/arm/trap-v6.c
+++ b/sys/arm/arm/trap-v6.c
@@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$");
#endif
extern char fusubailout[];
+extern char cachebailout[];
#ifdef DEBUG
int last_fault_code; /* For the benefit of pmap_fault_fixup() */
@@ -133,7 +134,7 @@ static const struct abort aborts[] = {
{abort_align, "Alignment Fault"},
{abort_fatal, "Debug Event"},
{NULL, "Access Bit (L1)"},
- {abort_icache, "Instruction cache maintenance"},
+ {NULL, "Instruction cache maintenance"},
{NULL, "Translation Fault (L1)"},
{NULL, "Access Bit (L2)"},
{NULL, "Translation Fault (L2)"},
@@ -394,8 +395,8 @@ abort_handler(struct trapframe *tf, int prefetch)
p = td->td_proc;
if (usermode) {
td->td_pticks = 0;
- if (td->td_ucred != p->p_ucred)
- cred_update_thread(td);
+ if (td->td_cowgen != p->p_cowgen)
+ thread_cow_update(td);
}
/* Invoke the appropriate handler, if necessary. */
@@ -406,6 +407,24 @@ abort_handler(struct trapframe *tf, int prefetch)
}
/*
+ * Don't pass faulting cache operation to vm_fault(). We don't want
+ * to handle all vm stuff at this moment.
+ */
+ pcb = td->td_pcb;
+ if (__predict_false(pcb->pcb_onfault == cachebailout)) {
+ tf->tf_r0 = far; /* return failing address */
+ tf->tf_pc = (register_t)pcb->pcb_onfault;
+ return;
+ }
+
+ /* Handle remaining I cache aborts. */
+ if (idx == FAULT_ICACHE) {
+ if (abort_icache(tf, idx, fsr, far, prefetch, td, &ksig))
+ goto do_trapsignal;
+ goto out;
+ }
+
+ /*
* At this point, we're dealing with one of the following aborts:
*
* FAULT_TRAN_xx - Translation
diff --git a/sys/arm/arm/trap.c b/sys/arm/arm/trap.c
index 0f142ce..56407aa 100644
--- a/sys/arm/arm/trap.c
+++ b/sys/arm/arm/trap.c
@@ -98,6 +98,7 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_map.h>
#include <vm/vm_extern.h>
+#include <machine/acle-compat.h>
#include <machine/cpu.h>
#include <machine/frame.h>
#include <machine/machdep.h>
@@ -119,7 +120,7 @@ struct ksig {
u_long code;
};
struct data_abort {
- int (*func)(struct trapframe *, u_int, u_int, struct thread *,
+ int (*func)(struct trapframe *, u_int, u_int, struct thread *,
struct ksig *);
const char *desc;
};
@@ -214,8 +215,8 @@ abort_handler(struct trapframe *tf, int type)
if (user) {
td->td_pticks = 0;
td->td_frame = tf;
- if (td->td_ucred != td->td_proc->p_ucred)
- cred_update_thread(td);
+ if (td->td_cowgen != td->td_proc->p_cowgen)
+ thread_cow_update(td);
}
/* Grab the current pcb */
@@ -325,7 +326,7 @@ abort_handler(struct trapframe *tf, int type)
* location, so we can deal with those quickly. Otherwise we need to
* disassemble the faulting instruction to determine if it was a write.
*/
-#if ARM_ARCH_6 || ARM_ARCH_7A
+#if __ARM_ARCH >= 6
ftype = (fsr & FAULT_WNR) ? VM_PROT_READ | VM_PROT_WRITE : VM_PROT_READ;
#else
if (IS_PERMISSION_FAULT(fsr))
@@ -644,8 +645,8 @@ prefetch_abort_handler(struct trapframe *tf)
if (TRAP_USERMODE(tf)) {
td->td_frame = tf;
- if (td->td_ucred != td->td_proc->p_ucred)
- cred_update_thread(td);
+ if (td->td_cowgen != td->td_proc->p_cowgen)
+ thread_cow_update(td);
}
fault_pc = tf->tf_pc;
if (td->td_md.md_spinlock_count == 0) {
@@ -763,4 +764,4 @@ badaddr_read(void *addr, size_t size, void *rptr)
/* Return EFAULT if the address was invalid, else zero */
return (rv);
-} \ No newline at end of file
+}
diff --git a/sys/arm/arm/vfp.c b/sys/arm/arm/vfp.c
index 38aff98..2494461 100644
--- a/sys/arm/arm/vfp.c
+++ b/sys/arm/arm/vfp.c
@@ -107,7 +107,7 @@ vfp_init(void)
coproc = get_coprocessorACR();
coproc |= COPROC10 | COPROC11;
set_coprocessorACR(coproc);
-
+
fpsid = fmrx(fpsid); /* read the vfp system id */
fpexc = fmrx(fpexc); /* read the vfp exception reg */
@@ -199,7 +199,7 @@ vfp_bounce(u_int addr, u_int insn, struct trapframe *frame, int code)
*/
fmxr(fpexc, fpexc | VFPEXC_EN);
curpcb = curthread->td_pcb;
- cpu = PCPU_GET(cpu);
+ cpu = PCPU_GET(cpuid);
if (curpcb->pcb_vfpcpu != cpu || curthread != PCPU_GET(fpcurthread)) {
vfp_restore(&curpcb->pcb_vfpstate);
curpcb->pcb_vfpcpu = cpu;
diff --git a/sys/arm/arm/vm_machdep.c b/sys/arm/arm/vm_machdep.c
index 5e4ee0c..223ad96 100644
--- a/sys/arm/arm/vm_machdep.c
+++ b/sys/arm/arm/vm_machdep.c
@@ -54,6 +54,8 @@ __FBSDID("$FreeBSD$");
#include <sys/sysctl.h>
#include <sys/sysent.h>
#include <sys/unistd.h>
+
+#include <machine/acle-compat.h>
#include <machine/cpu.h>
#include <machine/frame.h>
#include <machine/pcb.h>
@@ -108,10 +110,10 @@ cpu_fork(register struct thread *td1, register struct proc *p2,
#endif
#endif
td2->td_pcb = pcb2;
-
+
/* Clone td1's pcb */
bcopy(td1->td_pcb, pcb2, sizeof(*pcb2));
-
+
/* Point to mdproc and then copy over td1's contents */
mdp2 = &p2->p_md;
bcopy(&td1->td_proc->p_md, mdp2, sizeof(*mdp2));
@@ -133,7 +135,7 @@ cpu_fork(register struct thread *td1, register struct proc *p2,
pcb2->pcb_vfpcpu = -1;
pcb2->pcb_vfpstate.fpscr = VFPSCR_DN | VFPSCR_FZ;
-
+
tf = td2->td_frame;
tf->tf_spsr &= ~PSR_C;
tf->tf_r0 = 0;
@@ -143,13 +145,13 @@ cpu_fork(register struct thread *td1, register struct proc *p2,
/* Setup to release spin count in fork_exit(). */
td2->td_md.md_spinlock_count = 1;
td2->td_md.md_saved_cspr = PSR_SVC32_MODE;;
-#ifdef ARM_TP_ADDRESS
- td2->td_md.md_tp = *(register_t *)ARM_TP_ADDRESS;
-#else
+#if __ARM_ARCH >= 6
td2->td_md.md_tp = td1->td_md.md_tp;
+#else
+ td2->td_md.md_tp = *(register_t *)ARM_TP_ADDRESS;
#endif
}
-
+
void
cpu_thread_swapin(struct thread *td)
{
@@ -273,10 +275,10 @@ cpu_set_user_tls(struct thread *td, void *tls_base)
td->td_md.md_tp = (register_t)tls_base;
if (td == curthread) {
critical_enter();
-#ifdef ARM_TP_ADDRESS
- *(register_t *)ARM_TP_ADDRESS = (register_t)tls_base;
-#else
+#if __ARM_ARCH >= 6
set_tls(tls_base);
+#else
+ *(register_t *)ARM_TP_ADDRESS = (register_t)tls_base;
#endif
critical_exit();
}
@@ -336,7 +338,7 @@ cpu_set_fork_handler(struct thread *td, void (*func)(void *), void *arg)
void
swi_vm(void *dummy)
{
-
+
if (busdma_swi_pending)
busdma_swi();
}
diff --git a/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c b/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
index e950ec6..33204ba 100644
--- a/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
@@ -76,23 +76,13 @@ TUNABLE_INT("hw.bcm2835.sdhci.pio_mode", &bcm2835_sdhci_pio_mode);
struct bcm_sdhci_softc {
device_t sc_dev;
- struct mtx sc_mtx;
struct resource * sc_mem_res;
struct resource * sc_irq_res;
bus_space_tag_t sc_bst;
bus_space_handle_t sc_bsh;
void * sc_intrhand;
struct mmc_request * sc_req;
- struct mmc_data * sc_data;
- uint32_t sc_flags;
-#define LPC_SD_FLAGS_IGNORECRC (1 << 0)
- int sc_xfer_direction;
-#define DIRECTION_READ 0
-#define DIRECTION_WRITE 1
- int sc_xfer_done;
- int sc_bus_busy;
struct sdhci_slot sc_slot;
- int sc_dma_inuse;
int sc_dma_ch;
bus_dma_tag_t sc_dma_tag;
bus_dmamap_t sc_dma_map;
@@ -113,11 +103,6 @@ static void bcm_sdhci_intr(void *);
static int bcm_sdhci_get_ro(device_t, device_t);
static void bcm_sdhci_dma_intr(int ch, void *arg);
-#define bcm_sdhci_lock(_sc) \
- mtx_lock(&_sc->sc_mtx);
-#define bcm_sdhci_unlock(_sc) \
- mtx_unlock(&_sc->sc_mtx);
-
static void
bcm_sdhci_dmacb(void *arg, bus_dma_segment_t *segs, int nseg, int err)
{
@@ -187,8 +172,6 @@ bcm_sdhci_attach(device_t dev)
if (bootverbose)
device_printf(dev, "SDHCI frequency: %dMHz\n", default_freq);
- mtx_init(&sc->sc_mtx, "bcm sdhci", "sdhci", MTX_DEF);
-
rid = 0;
sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
RF_ACTIVE);
@@ -277,7 +260,6 @@ fail:
bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res);
if (sc->sc_mem_res)
bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res);
- mtx_destroy(&sc->sc_mtx);
return (err);
}
diff --git a/sys/arm/broadcom/bcm2835/bcm2835_spi.c b/sys/arm/broadcom/bcm2835/bcm2835_spi.c
index 3692c67..99de5e7 100644
--- a/sys/arm/broadcom/bcm2835/bcm2835_spi.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_spi.c
@@ -427,6 +427,15 @@ bcm_spi_transfer(device_t dev, device_t child, struct spi_command *cmd)
KASSERT(cmd->tx_data_sz == cmd->rx_data_sz,
("TX/RX data sizes should be equal"));
+ /* Get the proper chip select for this child. */
+ spibus_get_cs(child, &cs);
+ if (cs < 0 || cs > 2) {
+ device_printf(dev,
+ "Invalid chip select %d requested by %s\n", cs,
+ device_get_nameunit(child));
+ return (EINVAL);
+ }
+
BCM_SPI_LOCK(sc);
/* If the controller is in use wait until it is available. */
@@ -441,16 +450,6 @@ bcm_spi_transfer(device_t dev, device_t child, struct spi_command *cmd)
SPI_CS_CLEAR_RXFIFO | SPI_CS_CLEAR_TXFIFO,
SPI_CS_CLEAR_RXFIFO | SPI_CS_CLEAR_TXFIFO);
- /* Get the proper chip select for this child. */
- spibus_get_cs(child, &cs);
- if (cs < 0 || cs > 2) {
- device_printf(dev,
- "Invalid chip select %d requested by %s\n", cs,
- device_get_nameunit(child));
- BCM_SPI_UNLOCK(sc);
- return (EINVAL);
- }
-
/* Save a pointer to the SPI command. */
sc->sc_cmd = cmd;
sc->sc_read = 0;
@@ -471,8 +470,10 @@ bcm_spi_transfer(device_t dev, device_t child, struct spi_command *cmd)
/* Make sure the SPI engine and interrupts are disabled. */
bcm_spi_modifyreg(sc, SPI_CS, SPI_CS_TA | SPI_CS_INTR | SPI_CS_INTD, 0);
- /* Clear the controller flags. */
+ /* Release the controller and wakeup the next thread waiting for it. */
sc->sc_flags = 0;
+ wakeup_one(dev);
+ BCM_SPI_UNLOCK(sc);
/*
* Check for transfer timeout. The SPI controller doesn't
@@ -483,8 +484,6 @@ bcm_spi_transfer(device_t dev, device_t child, struct spi_command *cmd)
err = EIO;
}
- BCM_SPI_UNLOCK(sc);
-
return (err);
}
diff --git a/sys/arm/conf/ALPINE b/sys/arm/conf/ALPINE
index 626dcfa..075cc1f 100644
--- a/sys/arm/conf/ALPINE
+++ b/sys/arm/conf/ALPINE
@@ -31,7 +31,7 @@ options SMP # Enable multiple cores
# Debugging
makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols
-options BREAK_TO_DEBUGGER
+options ALT_BREAK_TO_DEBUGGER
options KDB
options DDB #Enable the kernel debugger
diff --git a/sys/arm/conf/BEAGLEBONE b/sys/arm/conf/BEAGLEBONE
index 6b8ab64..38c6b4a 100644
--- a/sys/arm/conf/BEAGLEBONE
+++ b/sys/arm/conf/BEAGLEBONE
@@ -40,7 +40,7 @@ options PLATFORM
# Debugging for use in -current
makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
-options BREAK_TO_DEBUGGER
+options ALT_BREAK_TO_DEBUGGER
#options VERBOSE_SYSINIT # Enable verbose sysinit messages
options KDB # Enable kernel debugger support
# For minimum debugger support (stable branch) use:
diff --git a/sys/arm/conf/CUBIEBOARD b/sys/arm/conf/CUBIEBOARD
index 04c1502..c1df03a 100644
--- a/sys/arm/conf/CUBIEBOARD
+++ b/sys/arm/conf/CUBIEBOARD
@@ -29,7 +29,7 @@ options SCHED_4BSD # 4BSD scheduler
# Debugging for use in -current
makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
-options BREAK_TO_DEBUGGER
+options ALT_BREAK_TO_DEBUGGER
#options VERBOSE_SYSINIT # Enable verbose sysinit messages
options KDB # Enable kernel debugger support
# For minimum debugger support (stable branch) use:
diff --git a/sys/arm/conf/CUBIEBOARD2 b/sys/arm/conf/CUBIEBOARD2
index 86dbb2e..c8fded0 100644
--- a/sys/arm/conf/CUBIEBOARD2
+++ b/sys/arm/conf/CUBIEBOARD2
@@ -30,7 +30,7 @@ options SMP # Enable multiple cores
# Debugging for use in -current
makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
-options BREAK_TO_DEBUGGER
+options ALT_BREAK_TO_DEBUGGER
#options VERBOSE_SYSINIT # Enable verbose sysinit messages
options KDB # Enable kernel debugger support
# For minimum debugger support (stable branch) use:
diff --git a/sys/arm/conf/DOCKSTAR b/sys/arm/conf/DOCKSTAR
index 16eeef9..b00b3bf 100644
--- a/sys/arm/conf/DOCKSTAR
+++ b/sys/arm/conf/DOCKSTAR
@@ -50,7 +50,6 @@ options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
# Debugging for use in -current
makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
-options BREAK_TO_DEBUGGER
options ALT_BREAK_TO_DEBUGGER
options KDB # Enable kernel debugger support
options DDB # Enable the kernel debugger
diff --git a/sys/arm/conf/DREAMPLUG-1001 b/sys/arm/conf/DREAMPLUG-1001
index 247eadb..3baacaa 100644
--- a/sys/arm/conf/DREAMPLUG-1001
+++ b/sys/arm/conf/DREAMPLUG-1001
@@ -53,7 +53,6 @@ options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
# Debugging for use in -current
makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
-options BREAK_TO_DEBUGGER
options ALT_BREAK_TO_DEBUGGER
options KDB # Enable kernel debugger support
options DDB # Enable the kernel debugger
diff --git a/sys/arm/conf/EFIKA_MX b/sys/arm/conf/EFIKA_MX
index dc22943..2c4d973 100644
--- a/sys/arm/conf/EFIKA_MX
+++ b/sys/arm/conf/EFIKA_MX
@@ -38,7 +38,7 @@ options INCLUDE_CONFIG_FILE # Include this file in kernel
# Debugging for use in -current
makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
-options BREAK_TO_DEBUGGER
+options ALT_BREAK_TO_DEBUGGER
#options VERBOSE_SYSINIT # Enable verbose sysinit messages
options KDB # Enable kernel debugger support
# For minimum debugger support (stable branch) use:
diff --git a/sys/arm/conf/EXYNOS5.common b/sys/arm/conf/EXYNOS5.common
index 446d272..80c8677 100644
--- a/sys/arm/conf/EXYNOS5.common
+++ b/sys/arm/conf/EXYNOS5.common
@@ -58,7 +58,7 @@ options SMP # Enable multiple cores
# Debugging for use in -current
makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
-options BREAK_TO_DEBUGGER
+options ALT_BREAK_TO_DEBUGGER
#options VERBOSE_SYSINIT # Enable verbose sysinit messages
options KDB # Enable kernel debugger support
# For minimum debugger support (stable branch) use:
diff --git a/sys/arm/conf/NOTES b/sys/arm/conf/NOTES
index 85a4c16..885bfd1 100644
--- a/sys/arm/conf/NOTES
+++ b/sys/arm/conf/NOTES
@@ -86,3 +86,26 @@ nodevice cxgbe
nodevice pcii
nodevice snd_cmi
nodevice tnt4882
+
+#
+# Enable the kernel DTrace hooks which are required to load the DTrace
+# kernel modules.
+#
+options KDTRACE_HOOKS
+
+# DTrace core
+# NOTE: introduces CDDL-licensed components into the kernel
+#device dtrace
+
+# DTrace modules
+#device dtrace_lockstat
+#device dtrace_profile
+#device dtrace_sdt
+#device dtrace_fbt
+#device dtrace_systrace
+#device dtrace_prototype
+#device dtnfscl
+#device dtmalloc
+
+# Alternatively include all the DTrace modules
+#device dtraceall
diff --git a/sys/arm/conf/PANDABOARD b/sys/arm/conf/PANDABOARD
index 0e1dec0..d04b81a 100644
--- a/sys/arm/conf/PANDABOARD
+++ b/sys/arm/conf/PANDABOARD
@@ -37,7 +37,7 @@ options SMP # Enable multiple cores
# Debugging for use in -current
makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
-options BREAK_TO_DEBUGGER
+options ALT_BREAK_TO_DEBUGGER
#options VERBOSE_SYSINIT # Enable verbose sysinit messages
options KDB # Enable kernel debugger support
# For minimum debugger support (stable branch) use:
diff --git a/sys/arm/conf/RK3188 b/sys/arm/conf/RK3188
index 540b49e..1c9d0ad 100644
--- a/sys/arm/conf/RK3188
+++ b/sys/arm/conf/RK3188
@@ -29,7 +29,7 @@ options SMP # Enable multiple cores
# Debugging for use in -current
makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
-options BREAK_TO_DEBUGGER
+options ALT_BREAK_TO_DEBUGGER
#options VERBOSE_SYSINIT # Enable verbose sysinit messages
options KDB # Enable kernel debugger support
# For minimum debugger support (stable branch) use:
diff --git a/sys/arm/conf/RPI-B b/sys/arm/conf/RPI-B
index 9193bca..db5f767 100644
--- a/sys/arm/conf/RPI-B
+++ b/sys/arm/conf/RPI-B
@@ -30,7 +30,6 @@ options PLATFORM
# Debugging for use in -current
makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
-options BREAK_TO_DEBUGGER
options ALT_BREAK_TO_DEBUGGER
#options VERBOSE_SYSINIT # Enable verbose sysinit messages
options KDB # Enable kernel debugger support
diff --git a/sys/arm/conf/RPI2 b/sys/arm/conf/RPI2
index 27caac9..2e5b054 100644
--- a/sys/arm/conf/RPI2
+++ b/sys/arm/conf/RPI2
@@ -31,7 +31,6 @@ options PLATFORM
# Debugging for use in -current
makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
-options BREAK_TO_DEBUGGER
options ALT_BREAK_TO_DEBUGGER
#options VERBOSE_SYSINIT # Enable verbose sysinit messages
options KDB # Enable kernel debugger support
diff --git a/sys/arm/conf/SOCKIT.common b/sys/arm/conf/SOCKIT.common
index 8c6e475..f30dca1 100644
--- a/sys/arm/conf/SOCKIT.common
+++ b/sys/arm/conf/SOCKIT.common
@@ -31,7 +31,7 @@ options SMP # Enable multiple cores
# Debugging for use in -current
makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
-options BREAK_TO_DEBUGGER
+options ALT_BREAK_TO_DEBUGGER
#options VERBOSE_SYSINIT # Enable verbose sysinit messages
options KDB # Enable kernel debugger support
# For minimum debugger support (stable branch) use:
diff --git a/sys/arm/conf/VIRT b/sys/arm/conf/VIRT
index 3206fda..bbaa5d7 100644
--- a/sys/arm/conf/VIRT
+++ b/sys/arm/conf/VIRT
@@ -24,8 +24,9 @@ include "std.armv6"
include "../qemu/std.virt"
options HZ=100
-options SCHED_4BSD # 4BSD scheduler
+options SCHED_ULE # 4BSD scheduler
options PLATFORM
+options SMP # Enable multiple cores
# Debugging for use in -current
makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
@@ -66,3 +67,6 @@ device random # Entropy device
# Flattened Device Tree
options FDT # Configure using FDT/DTB data
+# Extensible Firmware Interface
+options EFI
+
diff --git a/sys/arm/conf/VYBRID b/sys/arm/conf/VYBRID
index a31ef07..ed04653 100644
--- a/sys/arm/conf/VYBRID
+++ b/sys/arm/conf/VYBRID
@@ -31,7 +31,7 @@ options SCHED_4BSD # 4BSD scheduler
# Debugging for use in -current
makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
-options BREAK_TO_DEBUGGER
+options ALT_BREAK_TO_DEBUGGER
#options VERBOSE_SYSINIT # Enable verbose sysinit messages
options KDB # Enable kernel debugger support
# For minimum debugger support (stable branch) use:
diff --git a/sys/arm/conf/YYHD18 b/sys/arm/conf/YYHD18
new file mode 100644
index 0000000..1a251ce9
--- /dev/null
+++ b/sys/arm/conf/YYHD18
@@ -0,0 +1,26 @@
+# YYHD18 -- Custom configuration for the Yiyate Android TV box
+#
+# For more information on this file, please read the config(5) manual page,
+# and/or the handbook section on Kernel Configuration Files:
+#
+# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
+#
+# The handbook is also available locally in /usr/share/doc/handbook
+# if you've installed the doc distribution, otherwise always see the
+# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the
+# latest information.
+#
+# An exhaustive list of options and more detailed explanations of the
+# device lines is also present in the ../../conf/NOTES and NOTES files.
+# If you are in doubt as to the purpose or necessity of a line, check first
+# in NOTES.
+#
+# $FreeBSD$
+
+#NO_UNIVERSE
+
+include "AML8726"
+ident YYHD18
+
+options FDT_DTB_STATIC
+makeoptions FDT_DTS_FILE=yyhd18-m3.dts
diff --git a/sys/arm/conf/ZEDBOARD b/sys/arm/conf/ZEDBOARD
index a0fe66a..f5fc850 100644
--- a/sys/arm/conf/ZEDBOARD
+++ b/sys/arm/conf/ZEDBOARD
@@ -30,7 +30,7 @@ options SMP # Enable multiple cores
# Debugging for use in -current
makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
-#options BREAK_TO_DEBUGGER
+options ALT_BREAK_TO_DEBUGGER
options KDB # Enable kernel debugger support
# For minimum debugger support (stable branch) use:
#options KDB_TRACE # Print a stack trace for a panic
diff --git a/sys/arm/freescale/imx/imx6_sdma.c b/sys/arm/freescale/imx/imx6_sdma.c
index 91d66af..ae9a339 100644
--- a/sys/arm/freescale/imx/imx6_sdma.c
+++ b/sys/arm/freescale/imx/imx6_sdma.c
@@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$");
#include <vm/vm.h>
#include <vm/vm_extern.h>
#include <vm/vm_kern.h>
+#include <vm/pmap.h>
#include <dev/fdt/fdt_common.h>
#include <dev/ofw/openfirm.h>
diff --git a/sys/arm/include/_types.h b/sys/arm/include/_types.h
index e36699c..b627963 100644
--- a/sys/arm/include/_types.h
+++ b/sys/arm/include/_types.h
@@ -105,15 +105,9 @@ typedef __uint32_t __vm_paddr_t;
typedef __uint64_t __vm_pindex_t;
typedef __uint32_t __vm_size_t;
-#ifdef __ARM_EABI__
typedef unsigned int ___wchar_t;
#define __WCHAR_MIN 0 /* min value for a wchar_t */
#define __WCHAR_MAX __UINT_MAX /* max value for a wchar_t */
-#else
-typedef int ___wchar_t;
-#define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */
-#define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */
-#endif
/*
* Unusual type definitions.
diff --git a/sys/arm/include/asm.h b/sys/arm/include/asm.h
index 0c25d7b..2f64c37 100644
--- a/sys/arm/include/asm.h
+++ b/sys/arm/include/asm.h
@@ -49,7 +49,7 @@
# define _ALIGN_TEXT .align 2
#endif
-#if defined(__ARM_EABI__) && !defined(_STANDALONE)
+#ifndef _STANDALONE
#define STOP_UNWINDING .cantunwind
#define _FNSTART .fnstart
#define _FNEND .fnend
diff --git a/sys/arm/include/cpu-v6.h b/sys/arm/include/cpu-v6.h
index 3481513..e4a8936 100644
--- a/sys/arm/include/cpu-v6.h
+++ b/sys/arm/include/cpu-v6.h
@@ -139,6 +139,8 @@ _WF1(_CP15_ICIMVAU, CP15_ICIMVAU(%0)) /* Instruction cache invalidate */
/* Various control registers */
+_RF0(cp15_cpacr_get, CP15_CPACR(%0))
+_WF1(cp15_cpacr_set, CP15_CPACR(%0))
_RF0(cp15_dfsr_get, CP15_DFSR(%0))
_RF0(cp15_ifsr_get, CP15_IFSR(%0))
_WF1(cp15_prrr_set, CP15_PRRR(%0))
@@ -149,8 +151,10 @@ _RF0(cp15_dfar_get, CP15_DFAR(%0))
_RF0(cp15_ifar_get, CP15_IFAR(%0))
_RF0(cp15_l2ctlr_get, CP15_L2CTLR(%0))
#endif
-#if __ARM_ARCH >= 6
+/* ARMv6+ and XScale */
_RF0(cp15_actlr_get, CP15_ACTLR(%0))
+_WF1(cp15_actlr_set, CP15_ACTLR(%0))
+#if __ARM_ARCH >= 6
_WF1(cp15_ats1cpr_set, CP15_ATS1CPR(%0));
_RF0(cp15_par_get, CP15_PAR);
_RF0(cp15_sctlr_get, CP15_SCTLR(%0))
@@ -163,7 +167,10 @@ _RF0(cp15_tcmtr_get, CP15_TCMTR(%0))
_RF0(cp15_tlbtr_get, CP15_TLBTR(%0))
_RF0(cp15_mpidr_get, CP15_MPIDR(%0))
_RF0(cp15_revidr_get, CP15_REVIDR(%0))
+_RF0(cp15_ccsidr_get, CP15_CCSIDR(%0))
+_RF0(cp15_clidr_get, CP15_CLIDR(%0))
_RF0(cp15_aidr_get, CP15_AIDR(%0))
+_WF1(cp15_csselr_set, CP15_CSSELR(%0))
_RF0(cp15_id_pfr0_get, CP15_ID_PFR0(%0))
_RF0(cp15_id_pfr1_get, CP15_ID_PFR1(%0))
_RF0(cp15_id_dfr0_get, CP15_ID_DFR0(%0))
@@ -183,6 +190,10 @@ _RF0(cp15_cbar_get, CP15_CBAR(%0))
/* Performance Monitor registers */
#if __ARM_ARCH == 6 && defined(CPU_ARM1176)
+_RF0(cp15_pmuserenr_get, CP15_PMUSERENR(%0))
+_WF1(cp15_pmuserenr_set, CP15_PMUSERENR(%0))
+_RF0(cp15_pmcr_get, CP15_PMCR(%0))
+_WF1(cp15_pmcr_set, CP15_PMCR(%0))
_RF0(cp15_pmccntr_get, CP15_PMCCNTR(%0))
_WF1(cp15_pmccntr_set, CP15_PMCCNTR(%0))
#elif __ARM_ARCH > 6
diff --git a/sys/arm/include/pcpu.h b/sys/arm/include/pcpu.h
index ee79343..73400c5 100644
--- a/sys/arm/include/pcpu.h
+++ b/sys/arm/include/pcpu.h
@@ -32,6 +32,7 @@
#ifdef _KERNEL
+#include <machine/acle-compat.h>
#include <machine/cpuconf.h>
#define ALT_STACK_SIZE 128
@@ -40,14 +41,13 @@ struct vmspace;
#endif /* _KERNEL */
-#ifdef VFP
+#if __ARM_ARCH >= 6
#define PCPU_MD_FIELDS \
- unsigned int pc_cpu; \
unsigned int pc_vfpsid; \
unsigned int pc_vfpmvfr0; \
unsigned int pc_vfpmvfr1; \
struct pmap *pc_curpmap; \
- char __pad[137]
+ char __pad[141]
#else
#define PCPU_MD_FIELDS \
char __pad[157]
@@ -59,9 +59,8 @@ struct pcb;
struct pcpu;
extern struct pcpu *pcpup;
-#if ARM_ARCH_6 || ARM_ARCH_7A
-/* or ARM_TP_ADDRESS mark REMOVE ME NOTE */
+#if __ARM_ARCH >= 6
#define CPU_MASK (0xf)
#ifndef SMP
diff --git a/sys/arm/include/proc.h b/sys/arm/include/proc.h
index a86df35..25f4480 100644
--- a/sys/arm/include/proc.h
+++ b/sys/arm/include/proc.h
@@ -61,11 +61,7 @@ struct mdproc {
void *md_sigtramp;
};
-#ifdef __ARM_EABI__
#define KINFO_PROC_SIZE 816
-#else
-#define KINFO_PROC_SIZE 792
-#endif
#define MAXARGS 8
/*
diff --git a/sys/arm/include/sysreg.h b/sys/arm/include/sysreg.h
index fb13487..31097e9 100644
--- a/sys/arm/include/sysreg.h
+++ b/sys/arm/include/sysreg.h
@@ -210,6 +210,8 @@
* CP15 C9 registers
*/
#if __ARM_ARCH == 6 && defined(CPU_ARM1176)
+#define CP15_PMUSERENR(rr) p15, 0, rr, c15, c9, 0 /* Access Validation Control Register */
+#define CP15_PMCR(rr) p15, 0, rr, c15, c12, 0 /* Performance Monitor Control Register */
#define CP15_PMCCNTR(rr) p15, 0, rr, c15, c12, 1 /* PM Cycle Count Register */
#elif __ARM_ARCH > 6
#define CP15_L2CTLR(rr) p15, 1, rr, c9, c0, 2 /* L2 Control Register */
diff --git a/sys/arm/include/vmparam.h b/sys/arm/include/vmparam.h
index 91b6a63..b6e76bf 100644
--- a/sys/arm/include/vmparam.h
+++ b/sys/arm/include/vmparam.h
@@ -84,13 +84,12 @@
#define VM_PHYSSEG_SPARSE
/*
- * Create two free page pools. Since the ARM kernel virtual address
+ * Create one free page pool. Since the ARM kernel virtual address
* space does not include a mapping onto the machine's entire physical
* memory, VM_FREEPOOL_DIRECT is defined as an alias for the default
* pool, VM_FREEPOOL_DEFAULT.
*/
-#define VM_NFREEPOOL 2
-#define VM_FREEPOOL_CACHE 1
+#define VM_NFREEPOOL 1
#define VM_FREEPOOL_DEFAULT 0
#define VM_FREEPOOL_DIRECT 0
diff --git a/sys/arm/qemu/files.qemu b/sys/arm/qemu/files.qemu
index 888c4c7..48d7e4a 100644
--- a/sys/arm/qemu/files.qemu
+++ b/sys/arm/qemu/files.qemu
@@ -13,3 +13,6 @@ kern/kern_clocksource.c standard
arm/arm/generic_timer.c standard
arm/qemu/virt_common.c standard
arm/qemu/virt_machdep.c standard
+arm/qemu/virt_mp.c optional smp
+
+dev/ofw/ofw_cpu.c standard
diff --git a/usr.bin/csup/attrstack.c b/sys/arm/qemu/virt_mp.c
index f5f56b3..4942745 100644
--- a/usr.bin/csup/attrstack.c
+++ b/sys/arm/qemu/virt_mp.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2006, Maxime Henrion <mux@FreeBSD.org>
+ * Copyright (c) 2015 Andrew Turner
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,68 +23,97 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
*/
-#include <assert.h>
-#include <stdlib.h>
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
-#include "attrstack.h"
-#include "fattr.h"
-#include "misc.h"
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/pcpu.h>
+#include <sys/smp.h>
-#define ATTRSTACK_DEFSIZE 16 /* Initial size of the stack. */
+#include <vm/vm.h>
+#include <vm/pmap.h>
-struct attrstack {
- struct fattr **stack;
- size_t cur;
- size_t size;
-};
+#include <machine/intr.h>
+#include <machine/smp.h>
-struct attrstack *
-attrstack_new(void)
+#include <dev/ofw/openfirm.h>
+#include <dev/ofw/ofw_cpu.h>
+#include <dev/psci/psci.h>
+
+static int running_cpus;
+
+int
+platform_mp_probe(void)
{
- struct attrstack *as;
+ int ncpus;
+
+ ncpus = ofw_cpu_early_foreach(NULL, true);
+ if (ncpus <= 1) {
+ mp_ncpus = 1;
+ return (0);
+ }
+
+ mp_ncpus = MIN(ncpus, MAXCPU);
- as = xmalloc(sizeof(struct attrstack));
- as->stack = xmalloc(sizeof(struct fattr *) * ATTRSTACK_DEFSIZE);
- as->size = ATTRSTACK_DEFSIZE;
- as->cur = 0;
- return (as);
+ return (1);
}
-struct fattr *
-attrstack_pop(struct attrstack *as)
+static boolean_t
+virt_maxid(u_int id, phandle_t node, u_int addr_cells, pcell_t *reg)
{
- assert(as->cur > 0);
- return (as->stack[--as->cur]);
+ if (mp_maxid < id)
+ mp_maxid = id;
+
+ return (true);
}
void
-attrstack_push(struct attrstack *as, struct fattr *fa)
+platform_mp_setmaxid(void)
{
- if (as->cur >= as->size) {
- as->size *= 2;
- as->stack = xrealloc(as->stack,
- sizeof(struct fattr *) * as->size);
- }
- as->stack[as->cur++] = fa;
+ mp_maxid = PCPU_GET(cpuid);
+ ofw_cpu_early_foreach(virt_maxid, true);
+}
+
+static boolean_t
+virt_start_ap(u_int id, phandle_t node, u_int addr_cells, pcell_t *reg)
+{
+ int err;
+
+ if (running_cpus >= mp_ncpus)
+ return (false);
+ running_cpus++;
+
+ err = psci_cpu_on(*reg, pmap_kextract((vm_offset_t)mpentry), id);
+
+ if (err != PSCI_RETVAL_SUCCESS)
+ return (false);
+
+ return (true);
+}
+
+void
+platform_mp_start_ap(void)
+{
+
+ ofw_cpu_early_foreach(virt_start_ap, true);
}
-size_t
-attrstack_size(struct attrstack *as)
+void
+platform_mp_init_secondary(void)
{
- return (as->cur);
+ arm_init_secondary_ic();
}
void
-attrstack_free(struct attrstack *as)
+platform_ipi_send(cpuset_t cpus, u_int ipi)
{
- assert(as->cur == 0);
- free(as->stack);
- free(as);
+ pic_ipi_send(cpus, ipi);
}
diff --git a/sys/arm/ti/am335x/am335x_lcd.c b/sys/arm/ti/am335x/am335x_lcd.c
index df5c537..501042a 100644
--- a/sys/arm/ti/am335x/am335x_lcd.c
+++ b/sys/arm/ti/am335x/am335x_lcd.c
@@ -273,7 +273,7 @@ am335x_read_timing(device_t dev, phandle_t node, struct panel_info *panel)
int error;
phandle_t timings_node, timing_node, native;
- timings_node = fdt_find_child(node, "display-timings");
+ timings_node = ofw_bus_find_child(node, "display-timings");
if (timings_node == 0) {
device_printf(dev, "no \"display-timings\" node\n");
return (-1);
@@ -346,7 +346,7 @@ am335x_read_panel_info(device_t dev, phandle_t node, struct panel_info *panel)
int error;
phandle_t panel_info_node;
- panel_info_node = fdt_find_child(node, "panel-info");
+ panel_info_node = ofw_bus_find_child(node, "panel-info");
if (panel_info_node == 0)
return (-1);
diff --git a/sys/arm/ti/am335x/am335x_pmic.c b/sys/arm/ti/am335x/am335x_pmic.c
index 18bc438..eefece8 100644
--- a/sys/arm/ti/am335x/am335x_pmic.c
+++ b/sys/arm/ti/am335x/am335x_pmic.c
@@ -27,7 +27,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
-* TPS65217 PMIC companion chip for AM335x SoC sitting on I2C bus
+* TI TPS65217 PMIC companion chip for AM335x SoC sitting on I2C bus
*/
#include <sys/param.h>
#include <sys/systm.h>
@@ -50,30 +50,10 @@ __FBSDID("$FreeBSD$");
#include <dev/ofw/ofw_bus_subr.h>
#include <arm/ti/am335x/am335x_rtcvar.h>
+#include <arm/ti/am335x/tps65217x.h>
#include "iicbus_if.h"
-#define TPS65217A 0x7
-#define TPS65217B 0xF
-#define TPS65217C 0xE
-#define TPS65217D 0x6
-
-/* TPS65217 Reisters */
-#define TPS65217_CHIPID_REG 0x00
-#define TPS65217_INT_REG 0x02
-#define TPS65217_INT_PBM (1U << 6)
-#define TPS65217_INT_ACM (1U << 5)
-#define TPS65217_INT_USBM (1U << 4)
-#define TPS65217_INT_PBI (1U << 2)
-#define TPS65217_INT_ACI (1U << 1)
-#define TPS65217_INT_USBI (1U << 0)
-
-#define TPS65217_STATUS_REG 0x0A
-#define TPS65217_STATUS_OFF (1U << 7)
-#define TPS65217_STATUS_ACPWR (1U << 3)
-#define TPS65217_STATUS_USBPWR (1U << 2)
-#define TPS65217_STATUS_BT (1U << 0)
-
#define MAX_IIC_DATA_SIZE 2
@@ -85,6 +65,13 @@ struct am335x_pmic_softc {
void *sc_intrhand;
};
+static const char *tps65217_voreg_c[4] = {"4.10V", "4.15V", "4.20V", "4.25V"};
+
+static int am335x_pmic_bootverbose = 0;
+TUNABLE_INT("hw.am335x_pmic.bootverbose", &am335x_pmic_bootverbose);
+static char am335x_pmic_vo[6];
+TUNABLE_STR("hw.am335x_pmic.vo", am335x_pmic_vo, sizeof(am335x_pmic_vo));
+
static void am335x_pmic_shutdown(void *, int);
static int
@@ -120,18 +107,19 @@ static void
am335x_pmic_intr(void *arg)
{
struct am335x_pmic_softc *sc = (struct am335x_pmic_softc *)arg;
- uint8_t int_reg, status_reg;
+ struct tps65217_status_reg status_reg;
+ struct tps65217_int_reg int_reg;
int rv;
char notify_buf[16];
THREAD_SLEEPING_OK();
- rv = am335x_pmic_read(sc->sc_dev, TPS65217_INT_REG, &int_reg, 1);
+ rv = am335x_pmic_read(sc->sc_dev, TPS65217_INT_REG, (uint8_t *)&int_reg, 1);
if (rv != 0) {
device_printf(sc->sc_dev, "Cannot read interrupt register\n");
THREAD_NO_SLEEPING();
return;
}
- rv = am335x_pmic_read(sc->sc_dev, TPS65217_STATUS_REG, &status_reg, 1);
+ rv = am335x_pmic_read(sc->sc_dev, TPS65217_STATUS_REG, (uint8_t *)&status_reg, 1);
if (rv != 0) {
device_printf(sc->sc_dev, "Cannot read status register\n");
THREAD_NO_SLEEPING();
@@ -139,11 +127,11 @@ am335x_pmic_intr(void *arg)
}
THREAD_NO_SLEEPING();
- if ((int_reg & TPS65217_INT_PBI) && (status_reg & TPS65217_STATUS_BT))
+ if (int_reg.pbi && status_reg.pb)
shutdown_nice(RB_POWEROFF);
- if (int_reg & TPS65217_INT_ACI) {
+ if (int_reg.aci) {
snprintf(notify_buf, sizeof(notify_buf), "notify=0x%02x",
- (status_reg & TPS65217_STATUS_ACPWR) ? 1 : 0);
+ status_reg.acpwr);
devctl_notify_f("ACPI", "ACAD", "power", notify_buf, M_NOWAIT);
}
}
@@ -167,37 +155,120 @@ am335x_pmic_probe(device_t dev)
}
static void
+am335x_pmic_dump_chgconfig(device_t dev)
+{
+ struct tps65217_chgconfig0_reg reg0;
+ struct tps65217_chgconfig1_reg reg1;
+ struct tps65217_chgconfig2_reg reg2;
+ struct tps65217_chgconfig3_reg reg3;
+ const char *e_d[] = {"enabled", "disabled"};
+ const char *d_e[] = {"disabled", "enabled"};
+ const char *i_a[] = {"inactive", "active"};
+ const char *f_t[] = {"false", "true"};
+ const char *timer_c[] = {"4h", "5h", "6h", "8h"};
+ const char *ntc_type_c[] = {"100k", "10k"};
+ const char *vprechg_c[] = {"2.9V", "2.5V"};
+ const char *trange_c[] = {"0-45 C", "0-60 C"};
+ const char *termif_c[] = {"2.5%", "7.5%", "15%", "18%"};
+ const char *pchrgt_c[] = {"30 min", "60 min"};
+ const char *dppmth_c[] = {"3.50V", "3.75V", "4.00V", "4.25V"};
+ const char *ichrg_c[] = {"300mA", "400mA", "500mA", "700mA"};
+
+ am335x_pmic_read(dev, TPS65217_CHGCONFIG0_REG, (uint8_t *)&reg0, 1);
+ device_printf(dev, " BAT TEMP/NTC ERROR: %s\n", f_t[reg0.battemp]);
+ device_printf(dev, " Pre-charge timer time-out: %s\n", f_t[reg0.pchgtout]);
+ device_printf(dev, " Charge timer time-out: %s\n", f_t[reg0.chgtout]);
+ device_printf(dev, " Charger active: %s\n", f_t[reg0.active]);
+ device_printf(dev, " Termination current detected: %s\n", f_t[reg0.termi]);
+ device_printf(dev, " Thermal suspend: %s\n", f_t[reg0.tsusp]);
+ device_printf(dev, " DPPM active: %s\n", f_t[reg0.dppm]);
+ device_printf(dev, " Thermal regulation: %s\n", i_a[reg0.treg]);
+
+ am335x_pmic_read(dev, TPS65217_CHGCONFIG1_REG, (uint8_t *)&reg1, 1);
+ device_printf(dev, " Charger: %s\n", d_e[reg1.chg_en]);
+ device_printf(dev, " Suspend charge: %s\n", i_a[reg1.susp]);
+ device_printf(dev, " Charge termination: %s\n", e_d[reg1.term]);
+ device_printf(dev, " Charger reset: %s\n", i_a[reg1.reset]);
+ device_printf(dev, " NTC TYPE: %s\n", ntc_type_c[reg1.ntc_type]);
+ device_printf(dev, " Safety timer: %s\n", d_e[reg1.tmr_en]);
+ device_printf(dev, " Charge safety timer: %s\n", timer_c[reg1.timer]);
+
+ am335x_pmic_read(dev, TPS65217_CHGCONFIG2_REG, (uint8_t *)&reg2, 1);
+ device_printf(dev, " Charge voltage: %s\n", tps65217_voreg_c[reg2.voreg]);
+ device_printf(dev, " Pre-charge to fast charge transition voltage: %s\n",
+ vprechg_c[reg2.vprechg]);
+ device_printf(dev, " Dynamic timer function: %s\n", d_e[reg2.dyntmr]);
+
+ am335x_pmic_read(dev, TPS65217_CHGCONFIG3_REG, (uint8_t *)&reg3, 1);
+ device_printf(dev, " Temperature range for charging: %s\n", trange_c[reg3.trange]);
+ device_printf(dev, " Termination current factor: %s\n", termif_c[reg3.termif]);
+ device_printf(dev, " Pre-charge time: %s\n", pchrgt_c[reg3.pchrgt]);
+ device_printf(dev, " Power path DPPM threshold: %s\n", dppmth_c[reg3.dppmth]);
+ device_printf(dev, " Charge current: %s\n", ichrg_c[reg3.ichrg]);
+}
+
+static void
+am335x_pmic_setvo(device_t dev, uint8_t vo)
+{
+ struct tps65217_chgconfig2_reg reg2;
+
+ am335x_pmic_read(dev, TPS65217_CHGCONFIG2_REG, (uint8_t *)&reg2, 1);
+ reg2.voreg = vo;
+ am335x_pmic_write(dev, TPS65217_CHGCONFIG2_REG, (uint8_t *)&reg2, 1);
+}
+
+static void
am335x_pmic_start(void *xdev)
{
struct am335x_pmic_softc *sc;
device_t dev = (device_t)xdev;
- uint8_t reg;
+ struct tps65217_status_reg status_reg;
+ struct tps65217_chipid_reg chipid_reg;
+ uint8_t reg, vo;
char name[20];
- char pwr[4][11] = {"Unknown", "USB", "AC", "USB and AC"};
+ char pwr[4][11] = {"Battery", "USB", "AC", "USB and AC"};
int rv;
sc = device_get_softc(dev);
- am335x_pmic_read(dev, TPS65217_CHIPID_REG, &reg, 1);
- switch (reg>>4) {
+ am335x_pmic_read(dev, TPS65217_CHIPID_REG, (uint8_t *)&chipid_reg, 1);
+ switch (chipid_reg.chip) {
case TPS65217A:
- sprintf(name, "TPS65217A ver 1.%u", reg & 0xF);
+ sprintf(name, "TPS65217A ver 1.%u", chipid_reg.rev);
break;
case TPS65217B:
- sprintf(name, "TPS65217B ver 1.%u", reg & 0xF);
+ sprintf(name, "TPS65217B ver 1.%u", chipid_reg.rev);
break;
case TPS65217C:
- sprintf(name, "TPS65217C ver 1.%u", reg & 0xF);
+ sprintf(name, "TPS65217C ver 1.%u", chipid_reg.rev);
break;
case TPS65217D:
- sprintf(name, "TPS65217D ver 1.%u", reg & 0xF);
+ sprintf(name, "TPS65217D ver 1.%u", chipid_reg.rev);
break;
default:
sprintf(name, "Unknown PMIC");
}
- am335x_pmic_read(dev, TPS65217_STATUS_REG, &reg, 1);
- device_printf(dev, "%s powered by %s\n", name, pwr[(reg>>2)&0x03]);
+ am335x_pmic_read(dev, TPS65217_STATUS_REG, (uint8_t *)&status_reg, 1);
+ device_printf(dev, "%s powered by %s\n", name,
+ pwr[status_reg.usbpwr | (status_reg.acpwr << 1)]);
+
+ if (am335x_pmic_vo[0] != '\0') {
+ for (vo = 0; vo < 4; vo++) {
+ if (strcmp(tps65217_voreg_c[vo], am335x_pmic_vo) == 0)
+ break;
+ }
+ if (vo == 4) {
+ device_printf(dev, "WARNING: hw.am335x_pmic.vo=\"%s\""
+ ": unsupported value\n", am335x_pmic_vo);
+ } else {
+ am335x_pmic_setvo(dev, vo);
+ }
+ }
+
+ if (bootverbose || am335x_pmic_bootverbose) {
+ am335x_pmic_dump_chgconfig(dev);
+ }
EVENTHANDLER_REGISTER(shutdown_final, am335x_pmic_shutdown, dev,
SHUTDOWN_PRI_LAST);
@@ -248,14 +319,15 @@ static void
am335x_pmic_shutdown(void *xdev, int howto)
{
device_t dev;
- uint8_t reg;
+ struct tps65217_status_reg reg;
if (!(howto & RB_POWEROFF))
return;
dev = (device_t)xdev;
+ am335x_pmic_read(dev, TPS65217_STATUS_REG, (uint8_t *)&reg, 1);
/* Set the OFF bit on status register to start the shutdown sequence. */
- reg = TPS65217_STATUS_OFF;
- am335x_pmic_write(dev, TPS65217_STATUS_REG, &reg, 1);
+ reg.off = 1;
+ am335x_pmic_write(dev, TPS65217_STATUS_REG, (uint8_t *)&reg, 1);
/* Toggle pmic_pwr_enable to shutdown the PMIC. */
am335x_rtc_pmic_pwr_toggle();
}
diff --git a/sys/arm/ti/am335x/tps65217x.h b/sys/arm/ti/am335x/tps65217x.h
new file mode 100644
index 0000000..cdeca25
--- /dev/null
+++ b/sys/arm/ti/am335x/tps65217x.h
@@ -0,0 +1,114 @@
+/*-
+ * Copyright (c) 2012 Damjan Marion <dmarion@FreeBSD.org>
+ * Copyright (c) 2015 Maksym Sobolyev <sobomax@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef __TPS65217X_H__
+#define __TPS65217X_H__
+
+/*
+ * TPS65217 PMIC is a companion chip for AM335x SoC sitting on I2C bus
+ */
+
+/* TPS65217 Registers */
+#define TPS65217_CHIPID_REG 0x00
+struct tps65217_chipid_reg {
+ unsigned int rev:4;
+ unsigned int chip:4;
+#define TPS65217A 0x7
+#define TPS65217B 0xF
+#define TPS65217C 0xE
+#define TPS65217D 0x6
+} __attribute__((__packed__));
+
+#define TPS65217_INT_REG 0x02
+struct tps65217_int_reg {
+ unsigned int usbi:1;
+ unsigned int aci:1;
+ unsigned int pbi:1;
+ unsigned int reserved3:1;
+ unsigned int usbm:1;
+ unsigned int acm:1;
+ unsigned int pbm:1;
+ unsigned int reserved7:1;
+} __attribute__((__packed__));
+
+#define TPS65217_STATUS_REG 0x0A
+struct tps65217_status_reg {
+ unsigned int pb:1;
+ unsigned int reserved1:1;
+ unsigned int usbpwr:1;
+ unsigned int acpwr:1;
+ unsigned int reserved4:3;
+ unsigned int off:1;
+} __attribute__((__packed__));
+
+#define TPS65217_CHGCONFIG0_REG 0x03
+struct tps65217_chgconfig0_reg {
+ unsigned int battemp:1;
+ unsigned int pchgtout:1;
+ unsigned int chgtout:1;
+ unsigned int active:1;
+ unsigned int termi:1;
+ unsigned int tsusp:1;
+ unsigned int dppm:1;
+ unsigned int treg:1;
+} __attribute__((__packed__));
+
+#define TPS65217_CHGCONFIG1_REG 0x04
+struct tps65217_chgconfig1_reg {
+ unsigned int chg_en:1;
+ unsigned int susp:1;
+ unsigned int term:1;
+ unsigned int reset:1;
+ unsigned int ntc_type:1;
+ unsigned int tmr_en:1;
+ unsigned int timer:2;
+} __attribute__((__packed__));
+
+#define TPS65217_CHGCONFIG2_REG 0x05
+struct tps65217_chgconfig2_reg {
+ unsigned int reserved:4;
+ unsigned int voreg:2;
+#define TPS65217_VO_410V 0b00
+#define TPS65217_VO_415V 0b01
+#define TPS65217_VO_420V 0b10
+#define TPS65217_VO_425V 0b11
+ unsigned int vprechg:1;
+ unsigned int dyntmr:1;
+} __attribute__((__packed__));
+
+#define TPS65217_CHGCONFIG3_REG 0x06
+struct tps65217_chgconfig3_reg {
+ unsigned int trange:1;
+ unsigned int termif:2;
+ unsigned int pchrgt:1;
+ unsigned int dppmth:2;
+ unsigned int ichrg:2;
+} __attribute__((__packed__));
+
+#endif /* __TPS65217X_H__ */
diff --git a/usr.bin/csup/rcstokenizer.l b/sys/arm64/acpica/OsdEnvironment.c
index 56f0f41..79dc212 100644
--- a/usr.bin/csup/rcstokenizer.l
+++ b/sys/arm64/acpica/OsdEnvironment.c
@@ -1,5 +1,6 @@
/*-
- * Copyright (c) 2007-2009, Ulf Lilleengen <lulf@FreeBSD.org>
+ * Copyright (c) 2000,2001 Michael Smith
+ * Copyright (c) 2000 BSDi
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -22,52 +23,54 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD$
*/
-/*
- * This tokenizer must be generated by a lexxer with support for reentrancy.
- */
-%{
-#include <string.h>
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
-#include "misc.h"
-#include "rcsparse.h"
+#include <sys/types.h>
+#include <sys/bus.h>
+#include <sys/sysctl.h>
-%}
-%option reentrant noyywrap
-%option header-file="rcstokenizer.h"
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/actables.h>
-everything (.|\n)*
-num [0-9\.]+
-whitespace [\t\n ]
-digit [0-9]
-idchar [^$,.:;\t\n ]
-string @([^@]|\n|"@@")*@
-keyword head|access|symbols|locks|comment|expand|strict|date|author|state|branches|next|desc|log|text
-keyword2 branch
-newline \n
-%%
+static u_long acpi_root_phys;
-{keyword2} {
- return (KEYWORD_TWO);
-}
-{keyword} {
- return (KEYWORD);
+SYSCTL_ULONG(_machdep, OID_AUTO, acpi_root, CTLFLAG_RD, &acpi_root_phys, 0,
+ "The physical address of the RSDP");
+
+ACPI_STATUS
+AcpiOsInitialize(void)
+{
+
+ return (AE_OK);
}
-{string} {
- return (STRING);
+
+ACPI_STATUS
+AcpiOsTerminate(void)
+{
+
+ return (AE_OK);
}
-{num} {
- return (NUM);
+
+static u_long
+acpi_get_root_from_loader(void)
+{
+ long acpi_root;
+
+ if (resource_long_value("acpi", 0, "rsdp", &acpi_root) == 0)
+ return (acpi_root);
+
+ return (0);
}
-{num}?{idchar}({idchar}|{num})* {
-/* This will use ID as both ID and SYM. Do extra checking elsewhere.*/
- return (ID);
+
+ACPI_PHYSICAL_ADDRESS
+AcpiOsGetRootPointer(void)
+{
+
+ if (acpi_root_phys == 0)
+ acpi_root_phys = acpi_get_root_from_loader();
+
+ return (acpi_root_phys);
}
-; { return (SEMIC); }
-: { return (COLON); }
-\n ;
-[ \t]+ ;
-%%
diff --git a/sys/arm64/acpica/acpi_machdep.c b/sys/arm64/acpica/acpi_machdep.c
new file mode 100644
index 0000000..da07cfc
--- /dev/null
+++ b/sys/arm64/acpica/acpi_machdep.c
@@ -0,0 +1,217 @@
+/*-
+ * Copyright (c) 2001 Mitsuru IWASAKI
+ * Copyright (c) 2015 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Andrew Turner under
+ * sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+
+#include <vm/vm.h>
+#include <vm/pmap.h>
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/actables.h>
+
+#include <dev/acpica/acpivar.h>
+
+int
+acpi_machdep_init(device_t dev)
+{
+
+ return (0);
+}
+
+int
+acpi_machdep_quirks(int *quirks)
+{
+
+ return (0);
+}
+
+static void *
+map_table(vm_paddr_t pa, int offset, const char *sig)
+{
+ ACPI_TABLE_HEADER *header;
+ vm_offset_t length;
+ void *table;
+
+ header = pmap_mapbios(pa, sizeof(ACPI_TABLE_HEADER));
+ if (strncmp(header->Signature, sig, ACPI_NAME_SIZE) != 0) {
+ pmap_unmapbios((vm_offset_t)header, sizeof(ACPI_TABLE_HEADER));
+ return (NULL);
+ }
+ length = header->Length;
+ pmap_unmapbios((vm_offset_t)header, sizeof(ACPI_TABLE_HEADER));
+
+ table = pmap_mapbios(pa, length);
+ if (ACPI_FAILURE(AcpiTbChecksum(table, length))) {
+ if (bootverbose)
+ printf("ACPI: Failed checksum for table %s\n", sig);
+#if (ACPI_CHECKSUM_ABORT)
+ pmap_unmapbios(table, length);
+ return (NULL);
+#endif
+ }
+ return (table);
+}
+
+/*
+ * See if a given ACPI table is the requested table. Returns the
+ * length of the able if it matches or zero on failure.
+ */
+static int
+probe_table(vm_paddr_t address, const char *sig)
+{
+ ACPI_TABLE_HEADER *table;
+
+ table = pmap_mapbios(address, sizeof(ACPI_TABLE_HEADER));
+ if (table == NULL) {
+ if (bootverbose)
+ printf("ACPI: Failed to map table at 0x%jx\n",
+ (uintmax_t)address);
+ return (0);
+ }
+ if (bootverbose)
+ printf("Table '%.4s' at 0x%jx\n", table->Signature,
+ (uintmax_t)address);
+
+ if (strncmp(table->Signature, sig, ACPI_NAME_SIZE) != 0) {
+ pmap_unmapbios((vm_offset_t)table, sizeof(ACPI_TABLE_HEADER));
+ return (0);
+ }
+ pmap_unmapbios((vm_offset_t)table, sizeof(ACPI_TABLE_HEADER));
+ return (1);
+}
+
+/* Unmap a table previously mapped via acpi_map_table(). */
+void
+acpi_unmap_table(void *table)
+{
+ ACPI_TABLE_HEADER *header;
+
+ header = (ACPI_TABLE_HEADER *)table;
+ pmap_unmapbios((vm_offset_t)table, header->Length);
+}
+
+/*
+ * Try to map a table at a given physical address previously returned
+ * by acpi_find_table().
+ */
+void *
+acpi_map_table(vm_paddr_t pa, const char *sig)
+{
+
+ return (map_table(pa, 0, sig));
+}
+
+/*
+ * Return the physical address of the requested table or zero if one
+ * is not found.
+ */
+vm_paddr_t
+acpi_find_table(const char *sig)
+{
+ ACPI_PHYSICAL_ADDRESS rsdp_ptr;
+ ACPI_TABLE_RSDP *rsdp;
+ ACPI_TABLE_XSDT *xsdt;
+ ACPI_TABLE_HEADER *table;
+ vm_paddr_t addr;
+ int i, count;
+
+ if (resource_disabled("acpi", 0))
+ return (0);
+
+ /*
+ * Map in the RSDP. Since ACPI uses AcpiOsMapMemory() which in turn
+ * calls pmap_mapbios() to find the RSDP, we assume that we can use
+ * pmap_mapbios() to map the RSDP.
+ */
+ if ((rsdp_ptr = AcpiOsGetRootPointer()) == 0)
+ return (0);
+ rsdp = pmap_mapbios(rsdp_ptr, sizeof(ACPI_TABLE_RSDP));
+ if (rsdp == NULL) {
+ if (bootverbose)
+ printf("ACPI: Failed to map RSDP\n");
+ return (0);
+ }
+
+ addr = 0;
+ if (rsdp->Revision >= 2 && rsdp->XsdtPhysicalAddress != 0) {
+ /*
+ * AcpiOsGetRootPointer only verifies the checksum for
+ * the version 1.0 portion of the RSDP. Version 2.0 has
+ * an additional checksum that we verify first.
+ */
+ if (AcpiTbChecksum((UINT8 *)rsdp, ACPI_RSDP_XCHECKSUM_LENGTH)) {
+ if (bootverbose)
+ printf("ACPI: RSDP failed extended checksum\n");
+ return (0);
+ }
+ xsdt = map_table(rsdp->XsdtPhysicalAddress, 2, ACPI_SIG_XSDT);
+ if (xsdt == NULL) {
+ if (bootverbose)
+ printf("ACPI: Failed to map XSDT\n");
+ pmap_unmapbios((vm_offset_t)rsdp,
+ sizeof(ACPI_TABLE_RSDP));
+ return (0);
+ }
+ count = (xsdt->Header.Length - sizeof(ACPI_TABLE_HEADER)) /
+ sizeof(UINT64);
+ for (i = 0; i < count; i++)
+ if (probe_table(xsdt->TableOffsetEntry[i], sig)) {
+ addr = xsdt->TableOffsetEntry[i];
+ break;
+ }
+ acpi_unmap_table(xsdt);
+ }
+ pmap_unmapbios((vm_offset_t)rsdp, sizeof(ACPI_TABLE_RSDP));
+
+ if (addr == 0) {
+ if (bootverbose)
+ printf("ACPI: No %s table found\n", sig);
+ return (0);
+ }
+ if (bootverbose)
+ printf("%s: Found table at 0x%jx\n", sig, (uintmax_t)addr);
+
+ /*
+ * Verify that we can map the full table and that its checksum is
+ * correct, etc.
+ */
+ table = map_table(addr, 0, sig);
+ if (table == NULL)
+ return (0);
+ acpi_unmap_table(table);
+
+ return (addr);
+}
diff --git a/usr.bin/csup/parse.y b/sys/arm64/acpica/acpi_wakeup.c
index 3dcd617..7724fdd 100644
--- a/usr.bin/csup/parse.y
+++ b/sys/arm64/acpica/acpi_wakeup.c
@@ -1,8 +1,10 @@
-%{
/*-
- * Copyright (c) 2003-2004, Maxime Henrion <mux@FreeBSD.org>
+ * Copyright (c) 2015 The FreeBSD Foundation
* All rights reserved.
*
+ * This software was developed by Andrew Turner under
+ * sponsorship from the FreeBSD Foundation.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -23,69 +25,37 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD$
*/
-#include <sys/types.h>
-
-#include "config.h"
-#include "token.h"
-
-%}
-
-%union {
- char *str;
- int i;
-}
-
-%token DEFAULT
-%token <i> NAME
-%token <i> BOOLEAN
-%token EQUAL
-%token <str> STRING
-
-%%
-
-config_file
- : config_list
- |
- ;
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
-config_list
- : config
- | config_list config
- ;
+#include <sys/param.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
-config
- : default_line
- | collection
- ;
+#include <contrib/dev/acpica/include/acpi.h>
-default_line
- : DEFAULT options
- { coll_setdef(); }
- ;
+#include <dev/acpica/acpivar.h>
-collection
- : STRING options
- { coll_add($1); }
- ;
+/*
+ * ARM64TODO: Implement this.
+ */
+int
+acpi_sleep_machdep(struct acpi_softc *sc, int state)
+{
-options
- :
- | options option
- ;
+ return (-1);
+}
-option
- : BOOLEAN
- { coll_setopt($1, NULL); }
- | value
- ;
+int
+acpi_wakeup_machdep(struct acpi_softc *sc, int state, int sleep_result,
+ int intr_enabled)
+{
-value
- : NAME EQUAL STRING
- { coll_setopt($1, $3); }
- ;
+ /* ARM64TODO: We will need this with acpi_sleep_machdep */
+ KASSERT(sleep_result == -1,
+ ("acpi_wakeup_machdep: Invalid sleep result"));
-%%
+ return (sleep_result);
+}
diff --git a/sys/arm64/arm64/db_interface.c b/sys/arm64/arm64/db_interface.c
index 38834af..e40802f 100644
--- a/sys/arm64/arm64/db_interface.c
+++ b/sys/arm64/arm64/db_interface.c
@@ -156,13 +156,11 @@ db_write_bytes(vm_offset_t addr, size_t size, char *data)
}
*dst++ = *data++;
}
+ dsb(ish);
- dsb();
/* Clean D-cache and invalidate I-cache */
cpu_dcache_wb_range(addr, (vm_size_t)size);
cpu_icache_sync_range(addr, (vm_size_t)size);
- dsb();
- isb();
return (0);
}
diff --git a/sys/arm64/arm64/db_trace.c b/sys/arm64/arm64/db_trace.c
index 1e89bac..c606377 100644
--- a/sys/arm64/arm64/db_trace.c
+++ b/sys/arm64/arm64/db_trace.c
@@ -38,12 +38,7 @@ __FBSDID("$FreeBSD$");
#include <machine/armreg.h>
#include <machine/debug_monitor.h>
-
-struct unwind_state {
- uint64_t fp;
- uint64_t sp;
- uint64_t pc;
-};
+#include <machine/stack.h>
void
db_md_list_watchpoints()
@@ -67,22 +62,6 @@ db_md_set_watchpoint(db_expr_t addr, db_expr_t size)
HW_BREAKPOINT_RW));
}
-static int
-db_unwind_frame(struct unwind_state *frame)
-{
- uint64_t fp = frame->fp;
-
- if (fp == 0)
- return -1;
-
- frame->sp = fp + 0x10;
- /* FP to previous frame (X29) */
- frame->fp = *(uint64_t *)(fp);
- /* LR (X30) */
- frame->pc = *(uint64_t *)(fp + 8) - 4;
- return (0);
-}
-
static void
db_stack_trace_cmd(struct unwind_state *frame)
{
@@ -95,7 +74,7 @@ db_stack_trace_cmd(struct unwind_state *frame)
uint64_t pc = frame->pc;
int ret;
- ret = db_unwind_frame(frame);
+ ret = unwind_frame(frame);
if (ret < 0)
break;
diff --git a/sys/arm64/arm64/exception.S b/sys/arm64/arm64/exception.S
index efb1364..9568075 100644
--- a/sys/arm64/arm64/exception.S
+++ b/sys/arm64/arm64/exception.S
@@ -33,6 +33,9 @@ __FBSDID("$FreeBSD$");
.text
.macro save_registers el
+.if \el == 1
+ mov x18, sp
+.endif
stp x28, x29, [sp, #-16]!
stp x26, x27, [sp, #-16]!
stp x24, x25, [sp, #-16]!
@@ -51,22 +54,20 @@ __FBSDID("$FreeBSD$");
mrs x10, elr_el1
mrs x11, spsr_el1
.if \el == 0
- mrs x12, sp_el0
-.else
- mov x12, sp
+ mrs x18, sp_el0
.endif
stp x10, x11, [sp, #-16]!
- stp x12, lr, [sp, #-16]!
+ stp x18, lr, [sp, #-16]!
mrs x18, tpidr_el1
.endm
.macro restore_registers el
- ldp x12, lr, [sp], #16
+ msr daifset, #2 /* Disable interrupts, x18 may change
+ * in the interrupt exception handler */
+ ldp x18, lr, [sp], #16
ldp x10, x11, [sp], #16
.if \el == 0
- msr sp_el0, x12
-.else
- mov sp, x12
+ msr sp_el0, x18
.endif
msr spsr_el1, x11
msr elr_el1, x10
@@ -89,6 +90,10 @@ __FBSDID("$FreeBSD$");
ldp x24, x25, [sp], #16
ldp x26, x27, [sp], #16
ldp x28, x29, [sp], #16
+.if \el == 1
+ mov sp, x18
+ mrs x18, tpidr_el1
+.endif
.endm
.macro do_ast
diff --git a/sys/arm64/arm64/gic.c b/sys/arm64/arm64/gic.c
index 59fac99..7c0692e 100644
--- a/sys/arm64/arm64/gic.c
+++ b/sys/arm64/arm64/gic.c
@@ -51,11 +51,7 @@ __FBSDID("$FreeBSD$");
#include <machine/intr.h>
#include <machine/smp.h>
-#include <dev/fdt/fdt_common.h>
-#include <dev/ofw/openfirm.h>
-#include <dev/ofw/ofw_bus.h>
-#include <dev/ofw/ofw_bus_subr.h>
-
+#include <arm64/arm64/gic.h>
#include "pic_if.h"
@@ -102,18 +98,6 @@ __FBSDID("$FreeBSD$");
#define GICD_ICFGR_TRIG_EDGE (1 << 1)
#define GICD_ICFGR_TRIG_MASK 0x2
-struct arm_gic_softc {
- device_t gic_dev;
- struct resource * gic_res[3];
- bus_space_tag_t gic_c_bst;
- bus_space_tag_t gic_d_bst;
- bus_space_handle_t gic_c_bsh;
- bus_space_handle_t gic_d_bsh;
- uint8_t ver;
- struct mtx mutex;
- uint32_t nirqs;
-};
-
static struct resource_spec arm_gic_spec[] = {
{ SYS_RES_MEMORY, 0, RF_ACTIVE }, /* Distributor registers */
{ SYS_RES_MEMORY, 1, RF_ACTIVE }, /* CPU Interrupt Intf. registers */
@@ -136,31 +120,6 @@ static pic_eoi_t gic_eoi;
static pic_mask_t gic_mask_irq;
static pic_unmask_t gic_unmask_irq;
-static struct ofw_compat_data compat_data[] = {
- {"arm,gic", true}, /* Non-standard, used in FreeBSD dts. */
- {"arm,gic-400", true},
- {"arm,cortex-a15-gic", true},
- {"arm,cortex-a9-gic", true},
- {"arm,cortex-a7-gic", true},
- {"arm,arm11mp-gic", true},
- {"brcm,brahma-b15-gic", true},
- {NULL, false}
-};
-
-static int
-arm_gic_probe(device_t dev)
-{
-
- if (!ofw_bus_status_okay(dev))
- return (ENXIO);
-
- if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data)
- return (ENXIO);
-
- device_set_desc(dev, "ARM Generic Interrupt Controller");
- return (BUS_PROBE_DEFAULT);
-}
-
#ifdef SMP
static void
gic_init_secondary(device_t dev)
@@ -367,7 +326,6 @@ arm_gic_ipi_clear(device_t dev, int ipi)
static device_method_t arm_gic_methods[] = {
/* Device interface */
- DEVMETHOD(device_probe, arm_gic_probe),
DEVMETHOD(device_attach, arm_gic_attach),
/* pic_if */
@@ -384,15 +342,5 @@ static device_method_t arm_gic_methods[] = {
{ 0, 0 }
};
-static driver_t arm_gic_driver = {
- "gic",
- arm_gic_methods,
- sizeof(struct arm_gic_softc),
-};
-
-static devclass_t arm_gic_devclass;
-
-EARLY_DRIVER_MODULE(gic, simplebus, arm_gic_driver, arm_gic_devclass, 0, 0,
- BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE);
-EARLY_DRIVER_MODULE(gic, ofwbus, arm_gic_driver, arm_gic_devclass, 0, 0,
- BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE);
+DEFINE_CLASS_0(gic, arm_gic_driver, arm_gic_methods,
+ sizeof(struct arm_gic_softc));
diff --git a/usr.bin/csup/fixups.h b/sys/arm64/arm64/gic.h
index b57eb9a..2660884 100644
--- a/usr.bin/csup/fixups.h
+++ b/sys/arm64/arm64/gic.h
@@ -1,7 +1,12 @@
/*-
- * Copyright (c) 2006, Maxime Henrion <mux@FreeBSD.org>
+ * Copyright (c) 2011 The FreeBSD Foundation
+ * Copyright (c) 2014 Andrew Turner
* All rights reserved.
*
+ * Developed by Damjan Marion <damjan.marion@gmail.com>
+ *
+ * Based on OMAP4 GIC code by Ben Gray
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -10,11 +15,14 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
+ * 3. The name of the company nor the name of the author may be used to
+ * endorse or promote products derived from this software without specific
+ * prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
@@ -25,24 +33,22 @@
*
* $FreeBSD$
*/
-#ifndef _FIXUPS_H_
-#define _FIXUPS_H_
-#include <sys/queue.h>
+#ifndef _ARM64_GIC_H_
+#define _ARM64_GIC_H_
-struct coll;
-struct fixups;
+DECLARE_CLASS(arm_gic_driver);
-struct fixup {
- struct coll *f_coll;
- char *f_name;
- STAILQ_ENTRY(fixup) f_link; /* Not for consumers. */
+struct arm_gic_softc {
+ device_t gic_dev;
+ struct resource * gic_res[3];
+ bus_space_tag_t gic_c_bst;
+ bus_space_tag_t gic_d_bst;
+ bus_space_handle_t gic_c_bsh;
+ bus_space_handle_t gic_d_bsh;
+ uint8_t ver;
+ struct mtx mutex;
+ uint32_t nirqs;
};
-struct fixups *fixups_new(void);
-void fixups_put(struct fixups *, struct coll *, const char *);
-struct fixup *fixups_get(struct fixups *);
-void fixups_close(struct fixups *);
-void fixups_free(struct fixups *);
-
-#endif /* !_FIXUPS_H_ */
+#endif
diff --git a/sys/arm64/arm64/gic_acpi.c b/sys/arm64/arm64/gic_acpi.c
new file mode 100644
index 0000000..ad26c0c
--- /dev/null
+++ b/sys/arm64/arm64/gic_acpi.c
@@ -0,0 +1,161 @@
+/*-
+ * Copyright (c) 2015 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Andrew Turner under
+ * sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+
+#include <machine/bus.h>
+
+#include <arm64/arm64/gic.h>
+
+#include <contrib/dev/acpica/include/acpi.h>
+
+#include <dev/acpica/acpivar.h>
+
+struct arm_gic_acpi_softc {
+ struct arm_gic_softc gic_sc;
+ struct resource_list res;
+};
+
+struct madt_table_data {
+ device_t parent;
+ ACPI_MADT_GENERIC_DISTRIBUTOR *dist;
+ ACPI_MADT_GENERIC_INTERRUPT *intr;
+};
+
+static void
+madt_handler(ACPI_SUBTABLE_HEADER *entry, void *arg)
+{
+ struct madt_table_data *madt_data;
+
+ madt_data = (struct madt_table_data *)arg;
+
+ switch(entry->Type) {
+ case ACPI_MADT_TYPE_GENERIC_INTERRUPT:
+ if (madt_data->intr != NULL) {
+ if (bootverbose)
+ device_printf(madt_data->parent,
+ "gic: Already have an interrupt table");
+ break;
+ }
+
+ madt_data->intr = (ACPI_MADT_GENERIC_INTERRUPT *)entry;
+ break;
+
+ case ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR:
+ if (madt_data->dist != NULL) {
+ if (bootverbose)
+ device_printf(madt_data->parent,
+ "gic: Already have a distributor table");
+ break;
+ }
+
+ madt_data->dist = (ACPI_MADT_GENERIC_DISTRIBUTOR *)entry;
+ break;
+
+ default:
+ break;
+ }
+}
+
+static void
+arm_gic_acpi_identify(driver_t *driver, device_t parent)
+{
+ struct madt_table_data madt_data;
+ ACPI_TABLE_MADT *madt;
+ vm_paddr_t physaddr;
+ device_t dev;
+
+ physaddr = acpi_find_table(ACPI_SIG_MADT);
+ if (physaddr == 0)
+ return;
+
+ madt = acpi_map_table(physaddr, ACPI_SIG_MADT);
+ if (madt == NULL) {
+ device_printf(parent, "gic: Unable to map the MADT\n");
+ return;
+ }
+
+ madt_data.parent = parent;
+ madt_data.dist = NULL;
+ madt_data.intr = NULL;
+
+ acpi_walk_subtables(madt + 1, (char *)madt + madt->Header.Length,
+ madt_handler, &madt_data);
+ if (madt_data.intr == NULL || madt_data.dist == NULL) {
+ device_printf(parent,
+ "No gic interrupt or distributor table\n");
+ goto out;
+ }
+
+ dev = BUS_ADD_CHILD(parent, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE,
+ "gic", -1);
+ if (dev == NULL) {
+ device_printf(parent, "add gic child failed\n");
+ goto out;
+ }
+
+ /* Add the MADT data */
+ BUS_SET_RESOURCE(parent, dev, SYS_RES_MEMORY, 0,
+ madt_data.dist->BaseAddress, PAGE_SIZE);
+ BUS_SET_RESOURCE(parent, dev, SYS_RES_MEMORY, 1,
+ madt_data.intr->BaseAddress, PAGE_SIZE);
+
+out:
+ acpi_unmap_table(madt);
+}
+
+static int
+arm_gic_acpi_probe(device_t dev)
+{
+
+ device_set_desc(dev, "ARM Generic Interrupt Controller");
+ return (BUS_PROBE_NOWILDCARD);
+}
+
+static device_method_t arm_gic_acpi_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_identify, arm_gic_acpi_identify),
+ DEVMETHOD(device_probe, arm_gic_acpi_probe),
+
+ DEVMETHOD_END
+};
+
+DEFINE_CLASS_1(gic, arm_gic_acpi_driver, arm_gic_acpi_methods,
+ sizeof(struct arm_gic_acpi_softc), arm_gic_driver);
+
+static devclass_t arm_gic_acpi_devclass;
+
+EARLY_DRIVER_MODULE(gic, acpi, arm_gic_acpi_driver,
+ arm_gic_acpi_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE);
diff --git a/sys/arm64/arm64/gic_fdt.c b/sys/arm64/arm64/gic_fdt.c
new file mode 100644
index 0000000..5b70624
--- /dev/null
+++ b/sys/arm64/arm64/gic_fdt.c
@@ -0,0 +1,87 @@
+/*-
+ * Copyright (c) 2015 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Andrew Turner under
+ * sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+
+#include <machine/bus.h>
+
+#include <dev/fdt/fdt_common.h>
+#include <dev/ofw/openfirm.h>
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
+
+#include <arm64/arm64/gic.h>
+
+static struct ofw_compat_data compat_data[] = {
+ {"arm,gic", true}, /* Non-standard, used in FreeBSD dts. */
+ {"arm,gic-400", true},
+ {"arm,cortex-a15-gic", true},
+ {"arm,cortex-a9-gic", true},
+ {"arm,cortex-a7-gic", true},
+ {"arm,arm11mp-gic", true},
+ {"brcm,brahma-b15-gic", true},
+ {NULL, false}
+};
+
+static int
+arm_gic_fdt_probe(device_t dev)
+{
+
+ if (!ofw_bus_status_okay(dev))
+ return (ENXIO);
+
+ if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data)
+ return (ENXIO);
+
+ device_set_desc(dev, "ARM Generic Interrupt Controller");
+ return (BUS_PROBE_DEFAULT);
+}
+
+static device_method_t arm_gic_fdt_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, arm_gic_fdt_probe),
+
+ DEVMETHOD_END
+};
+
+DEFINE_CLASS_1(gic, arm_gic_fdt_driver, arm_gic_fdt_methods,
+ sizeof(struct arm_gic_softc), arm_gic_driver);
+
+static devclass_t arm_gic_fdt_devclass;
+
+EARLY_DRIVER_MODULE(gic, simplebus, arm_gic_fdt_driver,
+ arm_gic_fdt_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE);
+EARLY_DRIVER_MODULE(gic, ofwbus, arm_gic_fdt_driver, arm_gic_fdt_devclass,
+ 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE);
diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c
index 221b138..c36769d 100644
--- a/sys/arm64/arm64/machdep.c
+++ b/sys/arm64/arm64/machdep.c
@@ -392,6 +392,8 @@ cpu_est_clockrate(int cpu_id, uint64_t *rate)
void
cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t size)
{
+
+ pcpu->pc_acpi_id = 0xffffffff;
}
void
diff --git a/sys/arm64/arm64/nexus.c b/sys/arm64/arm64/nexus.c
index d6c6d2b..764012e 100644
--- a/sys/arm64/arm64/nexus.c
+++ b/sys/arm64/arm64/nexus.c
@@ -60,12 +60,17 @@ __FBSDID("$FreeBSD$");
#include <machine/resource.h>
#include <machine/intr.h>
+#include "opt_acpi.h"
#include "opt_platform.h"
#ifdef FDT
#include <dev/fdt/fdt_common.h>
#include "ofw_bus_if.h"
#endif
+#ifdef DEV_ACPI
+#include <contrib/dev/acpica/include/acpi.h>
+#include <dev/acpica/acpivar.h>
+#endif
extern struct bus_space memmap_bus;
@@ -78,9 +83,19 @@ struct nexus_device {
#define DEVTONX(dev) ((struct nexus_device *)device_get_ivars(dev))
static struct rman mem_rman;
+static struct rman irq_rman;
-static int nexus_probe(device_t);
static int nexus_attach(device_t);
+
+#ifdef FDT
+static device_probe_t nexus_fdt_probe;
+static device_attach_t nexus_fdt_attach;
+#endif
+#ifdef DEV_ACPI
+static device_probe_t nexus_acpi_probe;
+static device_attach_t nexus_acpi_attach;
+#endif
+
static int nexus_print_child(device_t, device_t);
static device_t nexus_add_child(device_t, u_int, const char *, int);
static struct resource *nexus_alloc_resource(device_t, device_t, int, int *,
@@ -89,6 +104,8 @@ static int nexus_activate_resource(device_t, device_t, int, int,
struct resource *);
static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig,
enum intr_polarity pol);
+static struct resource_list *nexus_get_reslist(device_t, device_t);
+static int nexus_set_resource(device_t, device_t, int, int, u_long, u_long);
static int nexus_deactivate_resource(device_t, device_t, int, int,
struct resource *);
@@ -102,21 +119,18 @@ static int nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent,
#endif
static device_method_t nexus_methods[] = {
- /* Device interface */
- DEVMETHOD(device_probe, nexus_probe),
- DEVMETHOD(device_attach, nexus_attach),
/* Bus interface */
DEVMETHOD(bus_print_child, nexus_print_child),
DEVMETHOD(bus_add_child, nexus_add_child),
DEVMETHOD(bus_alloc_resource, nexus_alloc_resource),
DEVMETHOD(bus_activate_resource, nexus_activate_resource),
DEVMETHOD(bus_config_intr, nexus_config_intr),
+ DEVMETHOD(bus_get_resource_list, nexus_get_reslist),
+ DEVMETHOD(bus_set_resource, nexus_set_resource),
DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource),
DEVMETHOD(bus_setup_intr, nexus_setup_intr),
DEVMETHOD(bus_teardown_intr, nexus_teardown_intr),
-#ifdef FDT
- DEVMETHOD(ofw_bus_map_intr, nexus_ofw_map_intr),
-#endif
+
{ 0, 0 }
};
@@ -129,15 +143,6 @@ static driver_t nexus_driver = {
DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0);
static int
-nexus_probe(device_t dev)
-{
-
- device_quiet(dev); /* suppress attach message for neatness */
-
- return (BUS_PROBE_DEFAULT);
-}
-
-static int
nexus_attach(device_t dev)
{
@@ -146,15 +151,14 @@ nexus_attach(device_t dev)
mem_rman.rm_type = RMAN_ARRAY;
mem_rman.rm_descr = "I/O memory addresses";
if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, ~0))
- panic("nexus_probe mem_rman");
-
- /* Add the ofwbus device */
- /* ARM64TODO: Alternatively add acpi */
- nexus_add_child(dev, 10, "ofwbus", 0);
+ panic("nexus_attach mem_rman");
+ irq_rman.rm_start = 0;
+ irq_rman.rm_end = ~0ul;
+ irq_rman.rm_type = RMAN_ARRAY;
+ irq_rman.rm_descr = "Interrupts";
+ if (rman_init(&irq_rman) || rman_manage_region(&irq_rman, 0, ~0))
+ panic("nexus_attach irq_rman");
- /*
- * First, deal with the children we know about already
- */
bus_generic_probe(dev);
bus_generic_attach(dev);
@@ -201,11 +205,34 @@ static struct resource *
nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
{
+ struct nexus_device *ndev = DEVTONX(child);
struct resource *rv;
+ struct resource_list_entry *rle;
struct rman *rm;
int needactivate = flags & RF_ACTIVE;
+ /*
+ * If this is an allocation of the "default" range for a given
+ * RID, and we know what the resources for this device are
+ * (ie. they aren't maintained by a child bus), then work out
+ * the start/end values.
+ */
+ if ((start == 0UL) && (end == ~0UL) && (count == 1)) {
+ if (device_get_parent(child) != bus || ndev == NULL)
+ return(NULL);
+ rle = resource_list_find(&ndev->nx_resources, type, *rid);
+ if (rle == NULL)
+ return(NULL);
+ start = rle->start;
+ end = rle->end;
+ count = rle->count;
+ }
+
switch (type) {
+ case SYS_RES_IRQ:
+ rm = &irq_rman;
+ break;
+
case SYS_RES_MEMORY:
case SYS_RES_IOPORT:
rm = &mem_rman;
@@ -297,6 +324,28 @@ nexus_activate_resource(device_t bus, device_t child, int type, int rid,
return (0);
}
+static struct resource_list *
+nexus_get_reslist(device_t dev, device_t child)
+{
+ struct nexus_device *ndev = DEVTONX(child);
+
+ return (&ndev->nx_resources);
+}
+
+static int
+nexus_set_resource(device_t dev, device_t child, int type, int rid,
+ u_long start, u_long count)
+{
+ struct nexus_device *ndev = DEVTONX(child);
+ struct resource_list *rl = &ndev->nx_resources;
+
+ /* XXX this should return a success/failure indicator */
+ resource_list_add(rl, type, rid, start, start + count - 1, count);
+
+ return(0);
+}
+
+
static int
nexus_deactivate_resource(device_t bus, device_t child, int type, int rid,
struct resource *r)
@@ -317,6 +366,41 @@ nexus_deactivate_resource(device_t bus, device_t child, int type, int rid,
}
#ifdef FDT
+static device_method_t nexus_fdt_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, nexus_fdt_probe),
+ DEVMETHOD(device_attach, nexus_fdt_attach),
+
+ /* OFW interface */
+ DEVMETHOD(ofw_bus_map_intr, nexus_ofw_map_intr),
+};
+
+#define nexus_baseclasses nexus_fdt_baseclasses
+DEFINE_CLASS_1(nexus, nexus_fdt_driver, nexus_fdt_methods, 1, nexus_driver);
+#undef nexus_baseclasses
+static devclass_t nexus_fdt_devclass;
+
+DRIVER_MODULE(nexus_fdt, root, nexus_fdt_driver, nexus_fdt_devclass, 0, 0);
+
+static int
+nexus_fdt_probe(device_t dev)
+{
+
+ if (OF_peer(0) == 0)
+ return (ENXIO);
+
+ device_quiet(dev);
+ return (BUS_PROBE_DEFAULT);
+}
+
+static int
+nexus_fdt_attach(device_t dev)
+{
+
+ nexus_add_child(dev, 10, "ofwbus", 0);
+ return (nexus_attach(dev));
+}
+
static int
nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int icells,
pcell_t *intr)
@@ -336,3 +420,37 @@ nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int icells,
}
#endif
+#ifdef DEV_ACPI
+static device_method_t nexus_acpi_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, nexus_acpi_probe),
+ DEVMETHOD(device_attach, nexus_acpi_attach),
+};
+
+#define nexus_baseclasses nexus_acpi_baseclasses
+DEFINE_CLASS_1(nexus, nexus_acpi_driver, nexus_acpi_methods, 1,
+ nexus_driver);
+#undef nexus_baseclasses
+static devclass_t nexus_acpi_devclass;
+
+DRIVER_MODULE(nexus_acpi, root, nexus_acpi_driver, nexus_acpi_devclass, 0, 0);
+
+static int
+nexus_acpi_probe(device_t dev)
+{
+
+ if (acpi_identify() != 0)
+ return (ENXIO);
+
+ device_quiet(dev);
+ return (BUS_PROBE_LOW_PRIORITY);
+}
+
+static int
+nexus_acpi_attach(device_t dev)
+{
+
+ nexus_add_child(dev, 10, "acpi", 0);
+ return (nexus_attach(dev));
+}
+#endif
diff --git a/usr.bin/csup/idcache.h b/sys/arm64/arm64/unwind.c
index 558af0c..13e0b54 100644
--- a/usr.bin/csup/idcache.h
+++ b/sys/arm64/arm64/unwind.c
@@ -1,7 +1,10 @@
/*-
- * Copyright (c) 2006, Maxime Henrion <mux@FreeBSD.org>
+ * Copyright (c) 2015 The FreeBSD Foundation
* All rights reserved.
*
+ * This software was developed by Semihalf under
+ * the sponsorship of the FreeBSD Foundation.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -14,7 +17,7 @@
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
@@ -22,20 +25,28 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD$
*/
-#ifndef _IDCACHE_H_
-#define _IDCACHE_H_
-#include <sys/types.h>
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+#include <sys/param.h>
+
+#include <machine/stack.h>
+
+int
+unwind_frame(struct unwind_state *frame)
+{
+ uint64_t fp;
-void idcache_init(void);
-void idcache_fini(void);
+ fp = frame->fp;
+ if (fp == 0)
+ return (-1);
-char *getuserbyid(uid_t);
-char *getgroupbyid(gid_t);
-int getuidbyname(const char *, uid_t *);
-int getgidbyname(const char *, gid_t *);
+ frame->sp = fp + 0x10;
+ /* FP to previous frame (X29) */
+ frame->fp = *(uint64_t *)(fp);
+ /* LR (X30) */
+ frame->pc = *(uint64_t *)(fp + 8) - 4;
-#endif /* !_IDCACHE_H_ */
+ return (0);
+}
diff --git a/sys/arm64/arm64/vfp.c b/sys/arm64/arm64/vfp.c
index 7ce59b8..5e44d5e 100644
--- a/sys/arm64/arm64/vfp.c
+++ b/sys/arm64/arm64/vfp.c
@@ -120,7 +120,7 @@ vfp_save_state(struct thread *td)
td->td_pcb->pcb_fpcr = fpcr;
td->td_pcb->pcb_fpsr = fpsr;
- dsb();
+ dsb(ish);
vfp_disable();
}
critical_exit();
diff --git a/sys/arm64/conf/GENERIC b/sys/arm64/conf/GENERIC
index 8e20d60..4eae4df 100644
--- a/sys/arm64/conf/GENERIC
+++ b/sys/arm64/conf/GENERIC
@@ -95,3 +95,4 @@ device psci # Support for ARM PSCI
device bpf # Berkeley packet filter
options FDT
+device acpi
diff --git a/usr.bin/csup/proto.h b/sys/arm64/include/acpica_machdep.h
index 0c4a782..9a3434a 100644
--- a/usr.bin/csup/proto.h
+++ b/sys/arm64/include/acpica_machdep.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2003-2006, Maxime Henrion <mux@FreeBSD.org>
+ * Copyright (c) 2002 Mitsuru IWASAKI
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,26 +25,31 @@
*
* $FreeBSD$
*/
-#ifndef _PROTO_H_
-#define _PROTO_H_
-#include <time.h>
+/******************************************************************************
+ *
+ * Name: acpica_machdep.h - arch-specific defines, etc.
+ * $Revision$
+ *
+ *****************************************************************************/
+
+#ifndef __ACPICA_MACHDEP_H__
+#define __ACPICA_MACHDEP_H__
+
+
+#ifdef _KERNEL
-#include "misc.h"
+/* Only use the reduced hardware model */
+#define ACPI_REDUCED_HARDWARE 1
-#define PROTO_MAJ 17
-#define PROTO_MIN 0
-#define PROTO_SWVER "CSUP_1_0"
+/* Section 5.2.10.1: global lock acquire/release functions */
+int acpi_acquire_global_lock(volatile uint32_t *);
+int acpi_release_global_lock(volatile uint32_t *);
-struct stream;
+void *acpi_map_table(vm_paddr_t pa, const char *sig);
+void acpi_unmap_table(void *table);
+vm_paddr_t acpi_find_table(const char *sig);
-int proto_connect(struct config *, int, uint16_t);
-int proto_run(struct config *);
-int proto_printf(struct stream *, const char *, ...);
-char *proto_get_ascii(char **);
-char *proto_get_rest(char **);
-int proto_get_int(char **, int *, int);
-int proto_get_sizet(char **, size_t *, int);
-int proto_get_time(char **, time_t *);
+#endif /* _KERNEL */
-#endif /* !_PROTO_H_ */
+#endif /* __ACPICA_MACHDEP_H__ */
diff --git a/sys/arm64/include/atomic.h b/sys/arm64/include/atomic.h
index f0f6c17..99252b8 100644
--- a/sys/arm64/include/atomic.h
+++ b/sys/arm64/include/atomic.h
@@ -29,13 +29,29 @@
#ifndef _MACHINE_ATOMIC_H_
#define _MACHINE_ATOMIC_H_
-#define isb() __asm __volatile("isb" : : : "memory")
-#define dsb() __asm __volatile("dsb sy" : : : "memory")
-#define dmb() __asm __volatile("dmb sy" : : : "memory")
+#define isb() __asm __volatile("isb" : : : "memory")
-#define mb() dmb()
-#define wmb() dmb()
-#define rmb() dmb()
+/*
+ * Options for DMB and DSB:
+ * oshld Outer Shareable, load
+ * oshst Outer Shareable, store
+ * osh Outer Shareable, all
+ * nshld Non-shareable, load
+ * nshst Non-shareable, store
+ * nsh Non-shareable, all
+ * ishld Inner Shareable, load
+ * ishst Inner Shareable, store
+ * ish Inner Shareable, all
+ * ld Full system, load
+ * st Full system, store
+ * sy Full system, all
+ */
+#define dsb(opt) __asm __volatile("dsb " __STRING(opt) : : : "memory")
+#define dmb(opt) __asm __volatile("dmb " __STRING(opt) : : : "memory")
+
+#define mb() dmb(sy) /* Full system memory barrier all */
+#define wmb() dmb(st) /* Full system memory barrier store */
+#define rmb() dmb(ld) /* Full system memory barrier load */
static __inline void
atomic_add_32(volatile uint32_t *p, uint32_t val)
diff --git a/sys/arm64/include/iodev.h b/sys/arm64/include/iodev.h
new file mode 100644
index 0000000..5521ff7
--- /dev/null
+++ b/sys/arm64/include/iodev.h
@@ -0,0 +1,65 @@
+/*-
+ * Copyright (c) 2015 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Andrew Turner under
+ * sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_IODEV_H_
+#define _MACHINE_IODEV_H_
+
+#define iodev_read_1(a) \
+({ \
+ uint8_t val; \
+ __asm __volatile("ldrb %w0, [%1]" : "=&r" (val) : "r"(a)); \
+ val; \
+})
+
+#define iodev_read_2(a) \
+({ \
+ uint16_t val; \
+ __asm __volatile("ldrh %w0, [%1]" : "=&r" (val) : "r"(a)); \
+ val; \
+})
+
+#define iodev_read_4(a) \
+({ \
+ uint32_t val; \
+ __asm __volatile("ldr %w0, [%1]" : "=&r" (val) : "r"(a)); \
+ val; \
+})
+
+#define iodev_write_1(a, v) \
+ __asm __volatile("strb %w0, [%1]" :: "r" (v), "r"(a))
+
+#define iodev_write_2(a, v) \
+ __asm __volatile("strh %w0, [%1]" :: "r" (v), "r"(a))
+
+#define iodev_write_4(a, v) \
+ __asm __volatile("str %w0, [%1]" :: "r" (v), "r"(a))
+
+#endif /* _MACHINE_IODEV_H_ */
diff --git a/sys/arm64/include/pci_cfgreg.h b/sys/arm64/include/pci_cfgreg.h
new file mode 100644
index 0000000..da23dbe
--- /dev/null
+++ b/sys/arm64/include/pci_cfgreg.h
@@ -0,0 +1 @@
+/* $FreeBSD$ */
diff --git a/sys/arm64/include/pcpu.h b/sys/arm64/include/pcpu.h
index 6de3e89..19cd758 100644
--- a/sys/arm64/include/pcpu.h
+++ b/sys/arm64/include/pcpu.h
@@ -36,7 +36,8 @@
#define ALT_STACK_SIZE 128
#define PCPU_MD_FIELDS \
- char __pad[129]
+ u_int pc_acpi_id; /* ACPI CPU id */ \
+ char __pad[125]
#ifdef _KERNEL
diff --git a/sys/arm64/include/stack.h b/sys/arm64/include/stack.h
index 8131ce5..db0d4ab 100644
--- a/sys/arm64/include/stack.h
+++ b/sys/arm64/include/stack.h
@@ -32,4 +32,12 @@
#define INKERNEL(va) \
((va) >= VM_MIN_KERNEL_ADDRESS && (va) <= VM_MAX_KERNEL_ADDRESS)
+struct unwind_state {
+ uint64_t fp;
+ uint64_t sp;
+ uint64_t pc;
+};
+
+int unwind_frame(struct unwind_state *);
+
#endif /* !_MACHINE_STACK_H_ */
diff --git a/sys/arm64/include/vmparam.h b/sys/arm64/include/vmparam.h
index 2065fda..9a2d6e5 100644
--- a/sys/arm64/include/vmparam.h
+++ b/sys/arm64/include/vmparam.h
@@ -75,13 +75,12 @@
#define VM_PHYSSEG_MAX 64
/*
- * Create three free page pools: VM_FREEPOOL_DEFAULT is the default pool
+ * Create two free page pools: VM_FREEPOOL_DEFAULT is the default pool
* from which physical pages are allocated and VM_FREEPOOL_DIRECT is
* the pool from which physical pages for small UMA objects are
* allocated.
*/
-#define VM_NFREEPOOL 3
-#define VM_FREEPOOL_CACHE 2
+#define VM_NFREEPOOL 2
#define VM_FREEPOOL_DEFAULT 0
#define VM_FREEPOOL_DIRECT 1
diff --git a/sys/boot/efi/libefi/Makefile.depend b/sys/boot/efi/libefi/Makefile.depend
index e248139..c77da59 100644
--- a/sys/boot/efi/libefi/Makefile.depend
+++ b/sys/boot/efi/libefi/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/sys/boot/efi/loader/arch/arm64/exec.c b/sys/boot/efi/loader/arch/arm64/exec.c
index 1f72269..d13e97b 100644
--- a/sys/boot/efi/loader/arch/arm64/exec.c
+++ b/sys/boot/efi/loader/arch/arm64/exec.c
@@ -42,6 +42,15 @@ __FBSDID("$FreeBSD$");
#include "loader_efi.h"
#include "cache.h"
+#include "platform/acfreebsd.h"
+#include "acconfig.h"
+#define ACPI_SYSTEM_XFACE
+#include "actypes.h"
+#include "actbl.h"
+
+static EFI_GUID acpi_guid = ACPI_TABLE_GUID;
+static EFI_GUID acpi20_guid = ACPI_20_TABLE_GUID;
+
static int elf64_exec(struct preloaded_file *amp);
static int elf64_obj_exec(struct preloaded_file *amp);
@@ -64,12 +73,41 @@ elf64_exec(struct preloaded_file *fp)
vm_offset_t clean_addr;
size_t clean_size;
struct file_metadata *md;
+ ACPI_TABLE_RSDP *rsdp;
EFI_STATUS status;
EFI_PHYSICAL_ADDRESS addr;
Elf_Ehdr *ehdr;
- int err;
+ char buf[24];
+ int err, revision;
void (*entry)(vm_offset_t);
+ rsdp = efi_get_table(&acpi20_guid);
+ if (rsdp == NULL) {
+ rsdp = efi_get_table(&acpi_guid);
+ }
+ if (rsdp != NULL) {
+ sprintf(buf, "0x%016llx", (unsigned long long)rsdp);
+ setenv("hint.acpi.0.rsdp", buf, 1);
+ revision = rsdp->Revision;
+ if (revision == 0)
+ revision = 1;
+ sprintf(buf, "%d", revision);
+ setenv("hint.acpi.0.revision", buf, 1);
+ strncpy(buf, rsdp->OemId, sizeof(rsdp->OemId));
+ buf[sizeof(rsdp->OemId)] = '\0';
+ setenv("hint.acpi.0.oem", buf, 1);
+ sprintf(buf, "0x%016x", rsdp->RsdtPhysicalAddress);
+ setenv("hint.acpi.0.rsdt", buf, 1);
+ if (revision >= 2) {
+ /* XXX extended checksum? */
+ sprintf(buf, "0x%016llx",
+ (unsigned long long)rsdp->XsdtPhysicalAddress);
+ setenv("hint.acpi.0.xsdt", buf, 1);
+ sprintf(buf, "%d", rsdp->Length);
+ setenv("hint.acpi.0.xsdt_length", buf, 1);
+ }
+ }
+
if ((md = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL)
return(EFTYPE);
diff --git a/usr.bin/csup/diff.h b/sys/boot/fdt/dts/arm/meson3.dtsi
index b0c8c97..444e3cf 100644
--- a/usr.bin/csup/diff.h
+++ b/sys/boot/fdt/dts/arm/meson3.dtsi
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2003-2006, Maxime Henrion <mux@FreeBSD.org>
+ * Copyright (c) 2015 John Wehle <john@feith.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -14,7 +14,7 @@
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
@@ -25,28 +25,53 @@
*
* $FreeBSD$
*/
-#ifndef _DIFF_H_
-#define _DIFF_H_
-
-struct stream;
-struct keyword;
-struct file_update;
-
-/* Description of an RCS delta. */
-struct diffinfo {
- char *di_rcsfile; /* RCS filename */
- char *di_cvsroot; /* CVS root prefix */
- char *di_revnum; /* Revision number */
- char *di_revdate; /* Revision date */
- char *di_author; /* Author of the delta */
- char *di_tag; /* CVS tag, if any */
- char *di_state; /* State of the branch */
- int di_expand; /* CVS expansion mode */
+
+/*
+ * The basic single core aml8726 (aka meson) uses an Amlogic interrupt
+ * controller, however meson.dtsi specifies GIC (which is present on
+ * the multicore aml8726) so we need to override things here.
+ */
+
+/include/ "meson.dtsi"
+
+/ {
+ model = "Amlogic Meson3 SoC";
+ compatible = "amlogic,meson3";
+
+ interrupt-parent = <&pic>;
+
+ pic: pic@c1109a40 {
+ device_type = "interrupt-controller";
+ compatible = "amlogic,aml8726-pic";
+ reg = <0xc1109a40 128>; /* cbus 0x2690 */
+
+ interrupt-controller;
+ #interrupt-cells = <3>;
+ };
+
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ cpu@200 {
+ device_type = "cpu";
+ compatible = "arm,cortex-a9";
+ next-level-cache = <&L2>;
+ reg = <0x200>;
+ };
+ };
+
+ clk81: clk@0 {
+ #clock-cells = <0>;
+ compatible = "fixed-clock";
+ clock-frequency = <0>;
+ };
};
-int diff_apply(struct stream *, struct stream *, struct stream *,
- struct keyword *, struct diffinfo *, int);
-int diff_reverse(struct stream *, struct stream *,
- struct stream *, struct keyword *, struct diffinfo *);
+&gic {
+ status = "disabled";
+};
-#endif /* !_DIFF_H_ */
+&L2 {
+ interrupts = <0 61 1>;
+};
diff --git a/sys/boot/fdt/dts/arm/sun4i-a10.dtsi b/sys/boot/fdt/dts/arm/sun4i-a10.dtsi
index 087e314..0d554f2 100644
--- a/sys/boot/fdt/dts/arm/sun4i-a10.dtsi
+++ b/sys/boot/fdt/dts/arm/sun4i-a10.dtsi
@@ -127,7 +127,6 @@
current-speed = <115200>;
clock-frequency = < 24000000 >;
busy-detect = <1>;
- broken-txfifo = <1>;
};
emac@01c0b000 {
diff --git a/sys/boot/fdt/dts/arm/sun7i-a20.dtsi b/sys/boot/fdt/dts/arm/sun7i-a20.dtsi
index 7dd8947..fa60c38 100644
--- a/sys/boot/fdt/dts/arm/sun7i-a20.dtsi
+++ b/sys/boot/fdt/dts/arm/sun7i-a20.dtsi
@@ -133,7 +133,6 @@
current-speed = <115200>;
clock-frequency = < 24000000 >;
busy-detect = <1>;
- broken-txfifo = <1>;
};
emac@01c0b000 {
diff --git a/sys/boot/fdt/dts/arm/vsatv102-m6.dts b/sys/boot/fdt/dts/arm/vsatv102-m6.dts
index 786f80a..468d5f0 100644
--- a/sys/boot/fdt/dts/arm/vsatv102-m6.dts
+++ b/sys/boot/fdt/dts/arm/vsatv102-m6.dts
@@ -282,6 +282,17 @@
};
};
+ leds {
+ compatible = "gpio-leds";
+
+ sys_led {
+ gpios = <&gpioao 2>; /* gpioao_2 sys_led */
+ label = "sys_led";
+
+ default-state = "on";
+ };
+ };
+
chosen {
stdin = "uart0";
stdout = "uart0";
diff --git a/sys/boot/fdt/dts/arm/yyhd18-m3.dts b/sys/boot/fdt/dts/arm/yyhd18-m3.dts
new file mode 100644
index 0000000..bdb425d
--- /dev/null
+++ b/sys/boot/fdt/dts/arm/yyhd18-m3.dts
@@ -0,0 +1,237 @@
+/*-
+ * Copyright (c) 2015 John Wehle <john@feith.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+/*
+ * The ordering of certain devices is significant (e.g. usb depends on
+ * usb-phy which depends on gpio, also the timer should appear early on
+ * to provide a reasonably accurate DELAY implementation).
+ */
+
+/dts-v1/;
+
+/memreserve/ 0x84900000 0x00600000; /* 6MB frame buffer */
+
+#include "meson3.dtsi"
+
+/ {
+ /*
+ * My development unit is a Yiyate Android TV Box containing
+ * a HD18 motherboard and an aml8726-m3 SoC ... later versions
+ * shipped with an aml8726-m6. Printenv in uboot shows m3-oplay
+ * as the boardname supplied as part of mmcargs.
+ */
+
+ model = "yiyate,hd18-m3";
+ compatible = "yiyate,hd18-m3", "amlogic,meson3";
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ aliases {
+ soc = &soc;
+ screen = &screen;
+ uart0 = &uart_AO;
+ };
+
+ memory {
+ device_type = "memory";
+ reg = <0x80000000 0x40000000>; /* 1GB RAM */
+ };
+
+ soc: soc {
+ device_type = "soc";
+ bus-frequency = <0>;
+
+ ccm@c1104140 {
+ compatible = "amlogic,aml8726-ccm";
+ reg = <0xc1104140 20>; /* cbus 0x1050 */
+
+ functions = "ethernet", "i2c", "rng", "sdio",
+ "uart-a", "uart-b", "uart-c",
+ "usb-a", "usb-b";
+ };
+
+ pinctrl: pinctrl@c11080b0 {
+ compatible = "amlogic,aml8726-pinctrl";
+ reg = <0xc11080b0 40>, /* mux */
+ <0xc11080e8 24>, /* pu/pd */
+ <0xc11080e8 24>, /* pull enable */
+ <0xc8100014 4>, /* ao mux */
+ <0xc810002c 4>, /* ao pu/pd */
+ <0xc810002c 4>; /* ao pull enable */
+
+ /*
+ * Currently only pin muxing that deviates
+ * from the power on default of gpio is
+ * specified here.
+ */
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&pins_uartao &pins_ethernet &pins_hdmi>;
+
+ pins_ethernet: ethernet {
+ amlogic,pins = "clk_out", "tx_en",
+ "tx_d0", "tx_d1",
+ "crs_dv", "rx_err",
+ "rx_d0", "rx_d1",
+ "mdc", "mdio";
+ amlogic,function = "ethernet";
+ };
+
+ pins_hdmi: hdmi {
+ amlogic,pins = "cec", "hpd",
+ "scl", "sda";
+ amlogic,function = "hdmi";
+ };
+
+ pins_sdio_b: sdio_b {
+ amlogic,pins = "clk", "cmd",
+ "d0", "d1",
+ "d2", "d3";
+ amlogic,function = "sdio-b";
+ };
+
+ pins_uartao: uartao {
+ amlogic,pins = "tx", "rx";
+ amlogic,function = "uart-ao";
+ };
+ };
+
+ rtc@c8100740 {
+ compatible = "amlogic,aml8726-rtc";
+ reg = <0xc8100740 20>; /* aobus 0x1d0 */
+ interrupts = <0 72 1>; /* AM_IRQ2(8) */
+ };
+
+ clkmsr: clkmsr@c1108758 {
+ compatible = "amlogic,aml8726-clkmsr";
+ reg = <0xc1108758 16>; /* cbus 0x21d6 */
+
+ clocks = <&clk81>;
+ };
+
+ gpio5: gpio@c110806c {
+ compatible = "amlogic,aml8726-gpio";
+ reg = <0xc110806c 4>, /* oen cbus 0x201b */
+ <0xc1108070 4>, /* out */
+ <0xc1108074 4>; /* in */
+
+ gpio-controller;
+ #gpio-cells = <1>;
+ pin-count = <32>;
+ };
+
+ mmc@c1108c20 {
+ compatible = "amlogic,aml8726-mmc";
+ reg = <0xc1108c20 32>; /* cbus 0x2308 */
+ interrupts = <0 28 1>; /* AM_IRQ0(28) */
+
+ clocks = <&clk81>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&pins_sdio_b>;
+
+ mmc-voltages = "3.3";
+
+ mmc-pwr-en = <&gpio5 31 0>; /* card_8 */
+ ins-detect = <&gpio5 29 0>; /* card_6 */
+ };
+
+ rng@c1108100 {
+ compatible = "amlogic,aml8726-rng";
+ reg = <0xc1108100 8>; /* cbus 0x2040 */
+ };
+
+ usb-phy@c1108400 {
+ /* usb-a and usb-b phy */
+ compatible = "amlogic,aml8726-m3-usb-phy";
+ reg = <0xc1108400 32>; /* cbus 0x2100 */
+ };
+
+ usb@c9040000 {
+ /* usb-a */
+ compatible = "synopsys,designware-hs-otg2";
+ reg = <0xc9040000 0x40000>; /* ahbbus 0x40000*/
+ interrupts = <0 30 4>; /* AM_IRQ0(30) */
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+
+ usb@c90c0000 {
+ /* usb-b */
+ compatible = "synopsys,designware-hs-otg2";
+ reg = <0xc90c0000 0x40000>; /* ahbbus 0xc0000 */
+ interrupts = <0 31 4>; /* AM_IRQ0(31) */
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ dr_mode = "host";
+ };
+
+ eth@c9410000 {
+ /* ethernet */
+ compatible = "snps,dwmac";
+ reg = <0xc9410000 0x2000>; /* ahbbus 0x410000 */
+ interrupts = <0 8 1>; /* AM_IRQ0(8) */
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+
+ screen: fb@c8001324 {
+ device_type = "display";
+ compatible = "amlogic,aml8726-fb";
+ reg = <0xc8001324 12>, /* CANVAS */
+ <0xc1106800 1024>, /* VIU */
+ <0xc1107400 1024>; /* VPP */
+ interrupts = <0 2 1>, /* AM_IRQ0(2) */
+ <0 3 1>, /* AM_IRQ0(3) */
+ <0 12 1>, /* AM_IRQ0(12) */
+ <0 13 1>; /* AM_IRQ0(13) */
+
+ address = <0x84900000>; /* match memreserve */
+ width = <720>;
+ height = <480>;
+ depth = <24>;
+ linebytes = <2160>;
+ };
+ };
+
+ chosen {
+ stdin = "uart0";
+ stdout = "uart0";
+ };
+};
+
+&clk81 {
+ clock-frequency = <0>;
+};
+
+&uart_AO {
+ status = "okay";
+ current-speed = <115200>;
+};
diff --git a/sys/boot/ficl/Makefile.depend b/sys/boot/ficl/Makefile.depend
index ff32eeb..ab9c549 100644
--- a/sys/boot/ficl/Makefile.depend
+++ b/sys/boot/ficl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/sys/boot/forth/support.4th b/sys/boot/forth/support.4th
index 367d157..08f5004 100644
--- a/sys/boot/forth/support.4th
+++ b/sys/boot/forth/support.4th
@@ -1437,12 +1437,12 @@ also builtins
abort" Unable to load a kernel!"
;
-: load_xen ( -- )
+: load_xen ( -- flag )
s" xen_kernel" getenv dup -1 <> if
- 1 1 load
+ 1 1 load ( c-addr/u flag N -- flag )
else
drop
- 0
+ 0 ( -1 -- flag )
then
;
diff --git a/sys/boot/i386/boot0/Makefile.depend b/sys/boot/i386/boot0/Makefile.depend
index 29fda55..3af2d7f 100644
--- a/sys/boot/i386/boot0/Makefile.depend
+++ b/sys/boot/i386/boot0/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/sys/boot/i386/boot0sio/Makefile.depend b/sys/boot/i386/boot0sio/Makefile.depend
index 29fda55..3af2d7f 100644
--- a/sys/boot/i386/boot0sio/Makefile.depend
+++ b/sys/boot/i386/boot0sio/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/sys/boot/i386/boot2/Makefile.depend b/sys/boot/i386/boot2/Makefile.depend
index 29fda55..3af2d7f 100644
--- a/sys/boot/i386/boot2/Makefile.depend
+++ b/sys/boot/i386/boot2/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/sys/boot/i386/loader/Makefile.depend b/sys/boot/i386/loader/Makefile.depend
index 29fda55..3af2d7f 100644
--- a/sys/boot/i386/loader/Makefile.depend
+++ b/sys/boot/i386/loader/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/sys/boot/i386/zfsloader/Makefile.depend b/sys/boot/i386/zfsloader/Makefile.depend
index 29fda55..3af2d7f 100644
--- a/sys/boot/i386/zfsloader/Makefile.depend
+++ b/sys/boot/i386/zfsloader/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/sys/boot/uboot/lib/module.c b/sys/boot/uboot/lib/module.c
index ed887b7..0951ed6 100644
--- a/sys/boot/uboot/lib/module.c
+++ b/sys/boot/uboot/lib/module.c
@@ -47,8 +47,10 @@ uboot_autoload(void)
#if defined(LOADER_FDT_SUPPORT)
int err;
- if ((err = fdt_setup_fdtp()) != 0)
+ if ((err = fdt_setup_fdtp()) != 0) {
+ printf("No valid device tree blob found!\n");
return (err);
+ }
#endif
return(0);
diff --git a/sys/boot/userboot/userboot/conf.c b/sys/boot/userboot/userboot/conf.c
index 6727a22..b8daa73 100644
--- a/sys/boot/userboot/userboot/conf.c
+++ b/sys/boot/userboot/userboot/conf.c
@@ -65,10 +65,11 @@ struct fs_ops *file_system[] = {
&host_fsops,
&ufs_fsops,
&cd9660_fsops,
- &gzipfs_fsops,
#if defined(USERBOOT_ZFS_SUPPORT)
&zfs_fsops,
#endif
+ &gzipfs_fsops,
+ &bzipfs_fsops,
NULL
};
diff --git a/sys/boot/zfs/zfsimpl.c b/sys/boot/zfs/zfsimpl.c
index 8d21c57..d889047 100644
--- a/sys/boot/zfs/zfsimpl.c
+++ b/sys/boot/zfs/zfsimpl.c
@@ -1255,6 +1255,10 @@ dnode_read(const spa_t *spa, const dnode_phys_t *dnode, off_t offset, void *buf,
ibn = bn >> ((nlevels - i - 1) * ibshift);
ibn &= ((1 << ibshift) - 1);
bp = indbp[ibn];
+ if (BP_IS_HOLE(&bp)) {
+ memset(dnode_cache_buf, 0, bsize);
+ break;
+ }
rc = zio_read(spa, &bp, dnode_cache_buf);
if (rc)
return (rc);
diff --git a/sys/cam/cam.c b/sys/cam/cam.c
index 939dd76..1f627ef 100644
--- a/sys/cam/cam.c
+++ b/sys/cam/cam.c
@@ -157,6 +157,56 @@ cam_strvis(u_int8_t *dst, const u_int8_t *src, int srclen, int dstlen)
*dst = '\0';
}
+void
+cam_strvis_sbuf(struct sbuf *sb, const u_int8_t *src, int srclen,
+ uint32_t flags)
+{
+
+ /* Trim leading/trailing spaces, nulls. */
+ while (srclen > 0 && src[0] == ' ')
+ src++, srclen--;
+ while (srclen > 0
+ && (src[srclen-1] == ' ' || src[srclen-1] == '\0'))
+ srclen--;
+
+ while (srclen > 0) {
+ if (*src < 0x20 || *src >= 0x80) {
+ /* SCSI-II Specifies that these should never occur. */
+ /* non-printable character */
+ switch (flags & CAM_STRVIS_FLAG_NONASCII_MASK) {
+ case CAM_STRVIS_FLAG_NONASCII_ESC:
+ sbuf_printf(sb, "\\%c%c%c",
+ ((*src & 0300) >> 6) + '0',
+ ((*src & 0070) >> 3) + '0',
+ ((*src & 0007) >> 0) + '0');
+ break;
+ case CAM_STRVIS_FLAG_NONASCII_RAW:
+ /*
+ * If we run into a NUL, just transform it
+ * into a space.
+ */
+ if (*src != 0x00)
+ sbuf_putc(sb, *src);
+ else
+ sbuf_putc(sb, ' ');
+ break;
+ case CAM_STRVIS_FLAG_NONASCII_SPC:
+ sbuf_putc(sb, ' ');
+ break;
+ case CAM_STRVIS_FLAG_NONASCII_TRIM:
+ default:
+ break;
+ }
+ } else {
+ /* normal character */
+ sbuf_putc(sb, *src);
+ }
+ src++;
+ srclen--;
+ }
+}
+
+
/*
* Compare string with pattern, returning 0 on match.
* Short pattern matches trailing blanks in name,
diff --git a/sys/cam/cam.h b/sys/cam/cam.h
index e08524b..63f83c7 100644
--- a/sys/cam/cam.h
+++ b/sys/cam/cam.h
@@ -342,6 +342,15 @@ typedef enum {
CAM_EAF_PRINT_RESULT = 0x20
} cam_error_ata_flags;
+typedef enum {
+ CAM_STRVIS_FLAG_NONE = 0x00,
+ CAM_STRVIS_FLAG_NONASCII_MASK = 0x03,
+ CAM_STRVIS_FLAG_NONASCII_TRIM = 0x00,
+ CAM_STRVIS_FLAG_NONASCII_RAW = 0x01,
+ CAM_STRVIS_FLAG_NONASCII_SPC = 0x02,
+ CAM_STRVIS_FLAG_NONASCII_ESC = 0x03
+} cam_strvis_flags;
+
struct cam_status_entry
{
cam_status status_code;
@@ -354,6 +363,7 @@ extern const int num_cam_status_entries;
extern int cam_sort_io_queues;
#endif
union ccb;
+struct sbuf;
#ifdef SYSCTL_DECL /* from sysctl.h */
SYSCTL_DECL(_kern_cam);
@@ -366,6 +376,8 @@ caddr_t cam_quirkmatch(caddr_t target, caddr_t quirk_table, int num_entries,
int entry_size, cam_quirkmatch_t *comp_func);
void cam_strvis(u_int8_t *dst, const u_int8_t *src, int srclen, int dstlen);
+void cam_strvis_sbuf(struct sbuf *sb, const u_int8_t *src, int srclen,
+ uint32_t flags);
int cam_strmatch(const u_int8_t *str, const u_int8_t *pattern, int str_len);
const struct cam_status_entry*
diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c
index b2cdb71..6276774 100644
--- a/sys/cam/ctl/ctl.c
+++ b/sys/cam/ctl/ctl.c
@@ -5011,9 +5011,9 @@ ctl_disable_lun(struct ctl_be_lun *be_lun)
lun->lun);
mtx_lock(&softc->ctl_lock);
if (retval != 0) {
- printf("ctl_alloc_lun: FETD %s port %d returned error "
+ printf("%s: FETD %s port %d returned error "
"%d for lun_disable on target %ju lun %jd\n",
- port->port_name, port->targ_port, retval,
+ __func__, port->port_name, port->targ_port, retval,
(uintmax_t)lun->target.id, (intmax_t)lun->lun);
}
}
diff --git a/sys/cam/ctl/scsi_ctl.c b/sys/cam/ctl/scsi_ctl.c
index ba59550..74ec3df 100644
--- a/sys/cam/ctl/scsi_ctl.c
+++ b/sys/cam/ctl/scsi_ctl.c
@@ -1657,16 +1657,24 @@ ctlfe_onoffline(void *arg, int online)
* down to the SIM. Otherwise, record what the SIM
* has reported.
*/
- if ((bus_softc->port.wwnn != 0)
- && (bus_softc->port.wwpn != 0)) {
+ if (bus_softc->port.wwnn != 0 && bus_softc->port.wwnn
+ != ccb->knob.xport_specific.fc.wwnn) {
ccb->knob.xport_specific.fc.wwnn =
- bus_softc->port.wwnn;
- ccb->knob.xport_specific.fc.wwpn =
- bus_softc->port.wwpn;
+ bus_softc->port.wwnn;
set_wwnn = 1;
} else {
ctl_port_set_wwns(&bus_softc->port,
true, ccb->knob.xport_specific.fc.wwnn,
+ false, 0);
+ }
+ if (bus_softc->port.wwpn != 0 && bus_softc->port.wwpn
+ != ccb->knob.xport_specific.fc.wwpn) {
+ ccb->knob.xport_specific.fc.wwpn =
+ bus_softc->port.wwpn;
+ set_wwnn = 1;
+ } else {
+ ctl_port_set_wwns(&bus_softc->port,
+ false, 0,
true, ccb->knob.xport_specific.fc.wwpn);
}
#endif /* RANDOM_WWNN */
diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c
index a429259..8f27fd9 100644
--- a/sys/cam/scsi/scsi_all.c
+++ b/sys/cam/scsi/scsi_all.c
@@ -6453,6 +6453,830 @@ bailout:
return (retval);
}
+struct scsi_attrib_table_entry scsi_mam_attr_table[] = {
+ { SMA_ATTR_REM_CAP_PARTITION, SCSI_ATTR_FLAG_NONE,
+ "Remaining Capacity in Partition",
+ /*suffix*/ "MB", /*to_str*/ scsi_attrib_int_sbuf,/*parse_str*/ NULL },
+ { SMA_ATTR_MAX_CAP_PARTITION, SCSI_ATTR_FLAG_NONE,
+ "Maximum Capacity in Partition",
+ /*suffix*/"MB", /*to_str*/ scsi_attrib_int_sbuf, /*parse_str*/ NULL },
+ { SMA_ATTR_TAPEALERT_FLAGS, SCSI_ATTR_FLAG_HEX,
+ "TapeAlert Flags",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_int_sbuf, /*parse_str*/ NULL },
+ { SMA_ATTR_LOAD_COUNT, SCSI_ATTR_FLAG_NONE,
+ "Load Count",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_int_sbuf, /*parse_str*/ NULL },
+ { SMA_ATTR_MAM_SPACE_REMAINING, SCSI_ATTR_FLAG_NONE,
+ "MAM Space Remaining",
+ /*suffix*/"bytes", /*to_str*/ scsi_attrib_int_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_DEV_ASSIGNING_ORG, SCSI_ATTR_FLAG_NONE,
+ "Assigning Organization",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_ascii_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_FORMAT_DENSITY_CODE, SCSI_ATTR_FLAG_HEX,
+ "Format Density Code",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_int_sbuf, /*parse_str*/ NULL },
+ { SMA_ATTR_INITIALIZATION_COUNT, SCSI_ATTR_FLAG_NONE,
+ "Initialization Count",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_int_sbuf, /*parse_str*/ NULL },
+ { SMA_ATTR_VOLUME_ID, SCSI_ATTR_FLAG_NONE,
+ "Volume Identifier",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_ascii_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_VOLUME_CHANGE_REF, SCSI_ATTR_FLAG_HEX,
+ "Volume Change Reference",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_int_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_DEV_SERIAL_LAST_LOAD, SCSI_ATTR_FLAG_NONE,
+ "Device Vendor/Serial at Last Load",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_vendser_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_DEV_SERIAL_LAST_LOAD_1, SCSI_ATTR_FLAG_NONE,
+ "Device Vendor/Serial at Last Load - 1",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_vendser_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_DEV_SERIAL_LAST_LOAD_2, SCSI_ATTR_FLAG_NONE,
+ "Device Vendor/Serial at Last Load - 2",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_vendser_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_DEV_SERIAL_LAST_LOAD_3, SCSI_ATTR_FLAG_NONE,
+ "Device Vendor/Serial at Last Load - 3",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_vendser_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_TOTAL_MB_WRITTEN_LT, SCSI_ATTR_FLAG_NONE,
+ "Total MB Written in Medium Life",
+ /*suffix*/ "MB", /*to_str*/ scsi_attrib_int_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_TOTAL_MB_READ_LT, SCSI_ATTR_FLAG_NONE,
+ "Total MB Read in Medium Life",
+ /*suffix*/ "MB", /*to_str*/ scsi_attrib_int_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_TOTAL_MB_WRITTEN_CUR, SCSI_ATTR_FLAG_NONE,
+ "Total MB Written in Current/Last Load",
+ /*suffix*/ "MB", /*to_str*/ scsi_attrib_int_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_TOTAL_MB_READ_CUR, SCSI_ATTR_FLAG_NONE,
+ "Total MB Read in Current/Last Load",
+ /*suffix*/ "MB", /*to_str*/ scsi_attrib_int_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_FIRST_ENC_BLOCK, SCSI_ATTR_FLAG_NONE,
+ "Logical Position of First Encrypted Block",
+ /*suffix*/ NULL, /*to_str*/ scsi_attrib_int_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_NEXT_UNENC_BLOCK, SCSI_ATTR_FLAG_NONE,
+ "Logical Position of First Unencrypted Block after First "
+ "Encrypted Block",
+ /*suffix*/ NULL, /*to_str*/ scsi_attrib_int_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_MEDIUM_USAGE_HIST, SCSI_ATTR_FLAG_NONE,
+ "Medium Usage History",
+ /*suffix*/ NULL, /*to_str*/ NULL,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_PART_USAGE_HIST, SCSI_ATTR_FLAG_NONE,
+ "Partition Usage History",
+ /*suffix*/ NULL, /*to_str*/ NULL,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_MED_MANUF, SCSI_ATTR_FLAG_NONE,
+ "Medium Manufacturer",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_ascii_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_MED_SERIAL, SCSI_ATTR_FLAG_NONE,
+ "Medium Serial Number",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_ascii_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_MED_LENGTH, SCSI_ATTR_FLAG_NONE,
+ "Medium Length",
+ /*suffix*/"m", /*to_str*/ scsi_attrib_int_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_MED_WIDTH, SCSI_ATTR_FLAG_FP | SCSI_ATTR_FLAG_DIV_10 |
+ SCSI_ATTR_FLAG_FP_1DIGIT,
+ "Medium Width",
+ /*suffix*/"mm", /*to_str*/ scsi_attrib_int_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_MED_ASSIGNING_ORG, SCSI_ATTR_FLAG_NONE,
+ "Assigning Organization",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_ascii_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_MED_DENSITY_CODE, SCSI_ATTR_FLAG_HEX,
+ "Medium Density Code",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_int_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_MED_MANUF_DATE, SCSI_ATTR_FLAG_NONE,
+ "Medium Manufacture Date",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_ascii_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_MAM_CAPACITY, SCSI_ATTR_FLAG_NONE,
+ "MAM Capacity",
+ /*suffix*/"bytes", /*to_str*/ scsi_attrib_int_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_MED_TYPE, SCSI_ATTR_FLAG_HEX,
+ "Medium Type",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_int_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_MED_TYPE_INFO, SCSI_ATTR_FLAG_HEX,
+ "Medium Type Information",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_int_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_MED_SERIAL_NUM, SCSI_ATTR_FLAG_NONE,
+ "Medium Serial Number",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_int_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_APP_VENDOR, SCSI_ATTR_FLAG_NONE,
+ "Application Vendor",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_ascii_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_APP_NAME, SCSI_ATTR_FLAG_NONE,
+ "Application Name",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_ascii_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_APP_VERSION, SCSI_ATTR_FLAG_NONE,
+ "Application Version",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_ascii_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_USER_MED_TEXT_LABEL, SCSI_ATTR_FLAG_NONE,
+ "User Medium Text Label",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_text_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_LAST_WRITTEN_TIME, SCSI_ATTR_FLAG_NONE,
+ "Date and Time Last Written",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_ascii_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_TEXT_LOCAL_ID, SCSI_ATTR_FLAG_HEX,
+ "Text Localization Identifier",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_int_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_BARCODE, SCSI_ATTR_FLAG_NONE,
+ "Barcode",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_ascii_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_HOST_OWNER_NAME, SCSI_ATTR_FLAG_NONE,
+ "Owning Host Textual Name",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_text_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_MEDIA_POOL, SCSI_ATTR_FLAG_NONE,
+ "Media Pool",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_text_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_PART_USER_LABEL, SCSI_ATTR_FLAG_NONE,
+ "Partition User Text Label",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_ascii_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_LOAD_UNLOAD_AT_PART, SCSI_ATTR_FLAG_NONE,
+ "Load/Unload at Partition",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_int_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_APP_FORMAT_VERSION, SCSI_ATTR_FLAG_NONE,
+ "Application Format Version",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_ascii_sbuf,
+ /*parse_str*/ NULL },
+ { SMA_ATTR_VOL_COHERENCY_INFO, SCSI_ATTR_FLAG_NONE,
+ "Volume Coherency Information",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_volcoh_sbuf,
+ /*parse_str*/ NULL },
+ { 0x0ff1, SCSI_ATTR_FLAG_NONE,
+ "Spectra MLM Creation",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_hexdump_sbuf,
+ /*parse_str*/ NULL },
+ { 0x0ff2, SCSI_ATTR_FLAG_NONE,
+ "Spectra MLM C3",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_hexdump_sbuf,
+ /*parse_str*/ NULL },
+ { 0x0ff3, SCSI_ATTR_FLAG_NONE,
+ "Spectra MLM RW",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_hexdump_sbuf,
+ /*parse_str*/ NULL },
+ { 0x0ff4, SCSI_ATTR_FLAG_NONE,
+ "Spectra MLM SDC List",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_hexdump_sbuf,
+ /*parse_str*/ NULL },
+ { 0x0ff7, SCSI_ATTR_FLAG_NONE,
+ "Spectra MLM Post Scan",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_hexdump_sbuf,
+ /*parse_str*/ NULL },
+ { 0x0ffe, SCSI_ATTR_FLAG_NONE,
+ "Spectra MLM Checksum",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_hexdump_sbuf,
+ /*parse_str*/ NULL },
+ { 0x17f1, SCSI_ATTR_FLAG_NONE,
+ "Spectra MLM Creation",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_hexdump_sbuf,
+ /*parse_str*/ NULL },
+ { 0x17f2, SCSI_ATTR_FLAG_NONE,
+ "Spectra MLM C3",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_hexdump_sbuf,
+ /*parse_str*/ NULL },
+ { 0x17f3, SCSI_ATTR_FLAG_NONE,
+ "Spectra MLM RW",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_hexdump_sbuf,
+ /*parse_str*/ NULL },
+ { 0x17f4, SCSI_ATTR_FLAG_NONE,
+ "Spectra MLM SDC List",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_hexdump_sbuf,
+ /*parse_str*/ NULL },
+ { 0x17f7, SCSI_ATTR_FLAG_NONE,
+ "Spectra MLM Post Scan",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_hexdump_sbuf,
+ /*parse_str*/ NULL },
+ { 0x17ff, SCSI_ATTR_FLAG_NONE,
+ "Spectra MLM Checksum",
+ /*suffix*/NULL, /*to_str*/ scsi_attrib_hexdump_sbuf,
+ /*parse_str*/ NULL },
+};
+
+/*
+ * Print out Volume Coherency Information (Attribute 0x080c).
+ * This field has two variable length members, including one at the
+ * beginning, so it isn't practical to have a fixed structure definition.
+ * This is current as of SSC4r03 (see section 4.2.21.3), dated March 25,
+ * 2013.
+ */
+int
+scsi_attrib_volcoh_sbuf(struct sbuf *sb, struct scsi_mam_attribute_header *hdr,
+ uint32_t valid_len, uint32_t flags,
+ uint32_t output_flags, char *error_str,
+ int error_str_len)
+{
+ size_t avail_len;
+ uint32_t field_size;
+ uint64_t tmp_val;
+ uint8_t *cur_ptr;
+ int retval;
+ int vcr_len, as_len;
+
+ retval = 0;
+ tmp_val = 0;
+
+ field_size = scsi_2btoul(hdr->length);
+ avail_len = valid_len - sizeof(*hdr);
+ if (field_size > avail_len) {
+ if (error_str != NULL) {
+ snprintf(error_str, error_str_len, "Available "
+ "length of attribute ID 0x%.4x %zu < field "
+ "length %u", scsi_2btoul(hdr->id), avail_len,
+ field_size);
+ }
+ retval = 1;
+ goto bailout;
+ } else if (field_size == 0) {
+ /*
+ * It isn't clear from the spec whether a field length of
+ * 0 is invalid here. It probably is, but be lenient here
+ * to avoid inconveniencing the user.
+ */
+ goto bailout;
+ }
+ cur_ptr = hdr->attribute;
+ vcr_len = *cur_ptr;
+ cur_ptr++;
+
+ sbuf_printf(sb, "\n\tVolume Change Reference Value:");
+
+ switch (vcr_len) {
+ case 0:
+ if (error_str != NULL) {
+ snprintf(error_str, error_str_len, "Volume Change "
+ "Reference value has length of 0");
+ }
+ retval = 1;
+ goto bailout;
+ break; /*NOTREACHED*/
+ case 1:
+ tmp_val = *cur_ptr;
+ break;
+ case 2:
+ tmp_val = scsi_2btoul(cur_ptr);
+ break;
+ case 3:
+ tmp_val = scsi_3btoul(cur_ptr);
+ break;
+ case 4:
+ tmp_val = scsi_4btoul(cur_ptr);
+ break;
+ case 8:
+ tmp_val = scsi_8btou64(cur_ptr);
+ break;
+ default:
+ sbuf_printf(sb, "\n");
+ sbuf_hexdump(sb, cur_ptr, vcr_len, NULL, 0);
+ break;
+ }
+ if (vcr_len <= 8)
+ sbuf_printf(sb, " 0x%jx\n", (uintmax_t)tmp_val);
+
+ cur_ptr += vcr_len;
+ tmp_val = scsi_8btou64(cur_ptr);
+ sbuf_printf(sb, "\tVolume Coherency Count: %ju\n", (uintmax_t)tmp_val);
+
+ cur_ptr += sizeof(tmp_val);
+ tmp_val = scsi_8btou64(cur_ptr);
+ sbuf_printf(sb, "\tVolume Coherency Set Identifier: 0x%jx\n",
+ (uintmax_t)tmp_val);
+
+ /*
+ * Figure out how long the Application Client Specific Information
+ * is and produce a hexdump.
+ */
+ cur_ptr += sizeof(tmp_val);
+ as_len = scsi_2btoul(cur_ptr);
+ cur_ptr += sizeof(uint16_t);
+ sbuf_printf(sb, "\tApplication Client Specific Information: ");
+ if (((as_len == SCSI_LTFS_VER0_LEN)
+ || (as_len == SCSI_LTFS_VER1_LEN))
+ && (strncmp(cur_ptr, SCSI_LTFS_STR_NAME, SCSI_LTFS_STR_LEN) == 0)) {
+ sbuf_printf(sb, "LTFS\n");
+ cur_ptr += SCSI_LTFS_STR_LEN + 1;
+ if (cur_ptr[SCSI_LTFS_UUID_LEN] != '\0')
+ cur_ptr[SCSI_LTFS_UUID_LEN] = '\0';
+ sbuf_printf(sb, "\tLTFS UUID: %s\n", cur_ptr);
+ cur_ptr += SCSI_LTFS_UUID_LEN + 1;
+ /* XXX KDM check the length */
+ sbuf_printf(sb, "\tLTFS Version: %d\n", *cur_ptr);
+ } else {
+ sbuf_printf(sb, "Unknown\n");
+ sbuf_hexdump(sb, cur_ptr, as_len, NULL, 0);
+ }
+
+bailout:
+ return (retval);
+}
+
+int
+scsi_attrib_vendser_sbuf(struct sbuf *sb, struct scsi_mam_attribute_header *hdr,
+ uint32_t valid_len, uint32_t flags,
+ uint32_t output_flags, char *error_str,
+ int error_str_len)
+{
+ size_t avail_len;
+ uint32_t field_size;
+ struct scsi_attrib_vendser *vendser;
+ cam_strvis_flags strvis_flags;
+ int retval = 0;
+
+ field_size = scsi_2btoul(hdr->length);
+ avail_len = valid_len - sizeof(*hdr);
+ if (field_size > avail_len) {
+ if (error_str != NULL) {
+ snprintf(error_str, error_str_len, "Available "
+ "length of attribute ID 0x%.4x %zu < field "
+ "length %u", scsi_2btoul(hdr->id), avail_len,
+ field_size);
+ }
+ retval = 1;
+ goto bailout;
+ } else if (field_size == 0) {
+ /*
+ * A field size of 0 doesn't make sense here. The device
+ * can at least give you the vendor ID, even if it can't
+ * give you the serial number.
+ */
+ if (error_str != NULL) {
+ snprintf(error_str, error_str_len, "The length of "
+ "attribute ID 0x%.4x is 0",
+ scsi_2btoul(hdr->id));
+ }
+ retval = 1;
+ goto bailout;
+ }
+ vendser = (struct scsi_attrib_vendser *)hdr->attribute;
+
+ switch (output_flags & SCSI_ATTR_OUTPUT_NONASCII_MASK) {
+ case SCSI_ATTR_OUTPUT_NONASCII_TRIM:
+ strvis_flags = CAM_STRVIS_FLAG_NONASCII_TRIM;
+ break;
+ case SCSI_ATTR_OUTPUT_NONASCII_RAW:
+ strvis_flags = CAM_STRVIS_FLAG_NONASCII_RAW;
+ break;
+ case SCSI_ATTR_OUTPUT_NONASCII_ESC:
+ default:
+ strvis_flags = CAM_STRVIS_FLAG_NONASCII_ESC;
+ break;;
+ }
+ cam_strvis_sbuf(sb, vendser->vendor, sizeof(vendser->vendor),
+ strvis_flags);
+ sbuf_putc(sb, ' ');
+ cam_strvis_sbuf(sb, vendser->serial_num, sizeof(vendser->serial_num),
+ strvis_flags);
+bailout:
+ return (retval);
+}
+
+int
+scsi_attrib_hexdump_sbuf(struct sbuf *sb, struct scsi_mam_attribute_header *hdr,
+ uint32_t valid_len, uint32_t flags,
+ uint32_t output_flags, char *error_str,
+ int error_str_len)
+{
+ uint32_t field_size;
+ ssize_t avail_len;
+ uint32_t print_len;
+ uint8_t *num_ptr;
+ int retval = 0;
+
+ field_size = scsi_2btoul(hdr->length);
+ avail_len = valid_len - sizeof(*hdr);
+ print_len = MIN(avail_len, field_size);
+ num_ptr = hdr->attribute;
+
+ if (print_len > 0) {
+ sbuf_printf(sb, "\n");
+ sbuf_hexdump(sb, num_ptr, print_len, NULL, 0);
+ }
+
+ return (retval);
+}
+
+int
+scsi_attrib_int_sbuf(struct sbuf *sb, struct scsi_mam_attribute_header *hdr,
+ uint32_t valid_len, uint32_t flags,
+ uint32_t output_flags, char *error_str,
+ int error_str_len)
+{
+ uint64_t print_number;
+ size_t avail_len;
+ uint32_t number_size;
+ int retval = 0;
+
+ number_size = scsi_2btoul(hdr->length);
+
+ avail_len = valid_len - sizeof(*hdr);
+ if (avail_len < number_size) {
+ if (error_str != NULL) {
+ snprintf(error_str, error_str_len, "Available "
+ "length of attribute ID 0x%.4x %zu < field "
+ "length %u", scsi_2btoul(hdr->id), avail_len,
+ number_size);
+ }
+ retval = 1;
+ goto bailout;
+ }
+
+ switch (number_size) {
+ case 0:
+ /*
+ * We don't treat this as an error, since there may be
+ * scenarios where a device reports a field but then gives
+ * a length of 0. See the note in scsi_attrib_ascii_sbuf().
+ */
+ goto bailout;
+ break; /*NOTREACHED*/
+ case 1:
+ print_number = hdr->attribute[0];
+ break;
+ case 2:
+ print_number = scsi_2btoul(hdr->attribute);
+ break;
+ case 3:
+ print_number = scsi_3btoul(hdr->attribute);
+ break;
+ case 4:
+ print_number = scsi_4btoul(hdr->attribute);
+ break;
+ case 8:
+ print_number = scsi_8btou64(hdr->attribute);
+ break;
+ default:
+ /*
+ * If we wind up here, the number is too big to print
+ * normally, so just do a hexdump.
+ */
+ retval = scsi_attrib_hexdump_sbuf(sb, hdr, valid_len,
+ flags, output_flags,
+ error_str, error_str_len);
+ goto bailout;
+ break;
+ }
+
+ if (flags & SCSI_ATTR_FLAG_FP) {
+#ifndef _KERNEL
+ long double num_float;
+
+ num_float = (long double)print_number;
+
+ if (flags & SCSI_ATTR_FLAG_DIV_10)
+ num_float /= 10;
+
+ sbuf_printf(sb, "%.*Lf", (flags & SCSI_ATTR_FLAG_FP_1DIGIT) ?
+ 1 : 0, num_float);
+#else /* _KERNEL */
+ sbuf_printf(sb, "%ju", (flags & SCSI_ATTR_FLAG_DIV_10) ?
+ (print_number / 10) : print_number);
+#endif /* _KERNEL */
+ } else if (flags & SCSI_ATTR_FLAG_HEX) {
+ sbuf_printf(sb, "0x%jx", (uintmax_t)print_number);
+ } else
+ sbuf_printf(sb, "%ju", (uintmax_t)print_number);
+
+bailout:
+ return (retval);
+}
+
+int
+scsi_attrib_ascii_sbuf(struct sbuf *sb, struct scsi_mam_attribute_header *hdr,
+ uint32_t valid_len, uint32_t flags,
+ uint32_t output_flags, char *error_str,
+ int error_str_len)
+{
+ size_t avail_len;
+ uint32_t field_size, print_size;
+ int retval = 0;
+
+ avail_len = valid_len - sizeof(*hdr);
+ field_size = scsi_2btoul(hdr->length);
+ print_size = MIN(avail_len, field_size);
+
+ if (print_size > 0) {
+ cam_strvis_flags strvis_flags;
+
+ switch (output_flags & SCSI_ATTR_OUTPUT_NONASCII_MASK) {
+ case SCSI_ATTR_OUTPUT_NONASCII_TRIM:
+ strvis_flags = CAM_STRVIS_FLAG_NONASCII_TRIM;
+ break;
+ case SCSI_ATTR_OUTPUT_NONASCII_RAW:
+ strvis_flags = CAM_STRVIS_FLAG_NONASCII_RAW;
+ break;
+ case SCSI_ATTR_OUTPUT_NONASCII_ESC:
+ default:
+ strvis_flags = CAM_STRVIS_FLAG_NONASCII_ESC;
+ break;
+ }
+ cam_strvis_sbuf(sb, hdr->attribute, print_size, strvis_flags);
+ } else if (avail_len < field_size) {
+ /*
+ * We only report an error if the user didn't allocate
+ * enough space to hold the full value of this field. If
+ * the field length is 0, that is allowed by the spec.
+ * e.g. in SPC-4r37, section 7.4.2.2.5, VOLUME IDENTIFIER
+ * "This attribute indicates the current volume identifier
+ * (see SMC-3) of the medium. If the device server supports
+ * this attribute but does not have access to the volume
+ * identifier, the device server shall report this attribute
+ * with an attribute length value of zero."
+ */
+ if (error_str != NULL) {
+ snprintf(error_str, error_str_len, "Available "
+ "length of attribute ID 0x%.4x %zu < field "
+ "length %u", scsi_2btoul(hdr->id), avail_len,
+ field_size);
+ }
+ retval = 1;
+ }
+
+ return (retval);
+}
+
+int
+scsi_attrib_text_sbuf(struct sbuf *sb, struct scsi_mam_attribute_header *hdr,
+ uint32_t valid_len, uint32_t flags,
+ uint32_t output_flags, char *error_str,
+ int error_str_len)
+{
+ size_t avail_len;
+ uint32_t field_size, print_size;
+ int retval = 0;
+ int esc_text = 1;
+
+ avail_len = valid_len - sizeof(*hdr);
+ field_size = scsi_2btoul(hdr->length);
+ print_size = MIN(avail_len, field_size);
+
+ if ((output_flags & SCSI_ATTR_OUTPUT_TEXT_MASK) ==
+ SCSI_ATTR_OUTPUT_TEXT_RAW)
+ esc_text = 0;
+
+ if (print_size > 0) {
+ uint32_t i;
+
+ for (i = 0; i < print_size; i++) {
+ if (hdr->attribute[i] == '\0')
+ continue;
+ else if (((unsigned char)hdr->attribute[i] < 0x80)
+ || (esc_text == 0))
+ sbuf_putc(sb, hdr->attribute[i]);
+ else
+ sbuf_printf(sb, "%%%02x",
+ (unsigned char)hdr->attribute[i]);
+ }
+ } else if (avail_len < field_size) {
+ /*
+ * We only report an error if the user didn't allocate
+ * enough space to hold the full value of this field.
+ */
+ if (error_str != NULL) {
+ snprintf(error_str, error_str_len, "Available "
+ "length of attribute ID 0x%.4x %zu < field "
+ "length %u", scsi_2btoul(hdr->id), avail_len,
+ field_size);
+ }
+ retval = 1;
+ }
+
+ return (retval);
+}
+
+struct scsi_attrib_table_entry *
+scsi_find_attrib_entry(struct scsi_attrib_table_entry *table,
+ size_t num_table_entries, uint32_t id)
+{
+ uint32_t i;
+
+ for (i = 0; i < num_table_entries; i++) {
+ if (table[i].id == id)
+ return (&table[i]);
+ }
+
+ return (NULL);
+}
+
+struct scsi_attrib_table_entry *
+scsi_get_attrib_entry(uint32_t id)
+{
+ return (scsi_find_attrib_entry(scsi_mam_attr_table,
+ sizeof(scsi_mam_attr_table) / sizeof(scsi_mam_attr_table[0]),
+ id));
+}
+
+int
+scsi_attrib_value_sbuf(struct sbuf *sb, uint32_t valid_len,
+ struct scsi_mam_attribute_header *hdr, uint32_t output_flags,
+ char *error_str, size_t error_str_len)
+{
+ int retval;
+
+ switch (hdr->byte2 & SMA_FORMAT_MASK) {
+ case SMA_FORMAT_ASCII:
+ retval = scsi_attrib_ascii_sbuf(sb, hdr, valid_len,
+ SCSI_ATTR_FLAG_NONE, output_flags, error_str,error_str_len);
+ break;
+ case SMA_FORMAT_BINARY:
+ if (scsi_2btoul(hdr->length) <= 8)
+ retval = scsi_attrib_int_sbuf(sb, hdr, valid_len,
+ SCSI_ATTR_FLAG_NONE, output_flags, error_str,
+ error_str_len);
+ else
+ retval = scsi_attrib_hexdump_sbuf(sb, hdr, valid_len,
+ SCSI_ATTR_FLAG_NONE, output_flags, error_str,
+ error_str_len);
+ break;
+ case SMA_FORMAT_TEXT:
+ retval = scsi_attrib_text_sbuf(sb, hdr, valid_len,
+ SCSI_ATTR_FLAG_NONE, output_flags, error_str,
+ error_str_len);
+ break;
+ default:
+ if (error_str != NULL) {
+ snprintf(error_str, error_str_len, "Unknown attribute "
+ "format 0x%x", hdr->byte2 & SMA_FORMAT_MASK);
+ }
+ retval = 1;
+ goto bailout;
+ break; /*NOTREACHED*/
+ }
+
+ sbuf_trim(sb);
+
+bailout:
+
+ return (retval);
+}
+
+void
+scsi_attrib_prefix_sbuf(struct sbuf *sb, uint32_t output_flags,
+ struct scsi_mam_attribute_header *hdr,
+ uint32_t valid_len, const char *desc)
+{
+ int need_space = 0;
+ uint32_t len;
+ uint32_t id;
+
+ /*
+ * We can't do anything if we don't have enough valid data for the
+ * header.
+ */
+ if (valid_len < sizeof(*hdr))
+ return;
+
+ id = scsi_2btoul(hdr->id);
+ /*
+ * Note that we print out the value of the attribute listed in the
+ * header, regardless of whether we actually got that many bytes
+ * back from the device through the controller. A truncated result
+ * could be the result of a failure to ask for enough data; the
+ * header indicates how many bytes are allocated for this attribute
+ * in the MAM.
+ */
+ len = scsi_2btoul(hdr->length);
+
+ if ((output_flags & SCSI_ATTR_OUTPUT_FIELD_MASK) ==
+ SCSI_ATTR_OUTPUT_FIELD_NONE)
+ return;
+
+ if ((output_flags & SCSI_ATTR_OUTPUT_FIELD_DESC)
+ && (desc != NULL)) {
+ sbuf_printf(sb, "%s", desc);
+ need_space = 1;
+ }
+
+ if (output_flags & SCSI_ATTR_OUTPUT_FIELD_NUM) {
+ sbuf_printf(sb, "%s(0x%.4x)", (need_space) ? " " : "", id);
+ need_space = 0;
+ }
+
+ if (output_flags & SCSI_ATTR_OUTPUT_FIELD_SIZE) {
+ sbuf_printf(sb, "%s[%d]", (need_space) ? " " : "", len);
+ need_space = 0;
+ }
+ if (output_flags & SCSI_ATTR_OUTPUT_FIELD_RW) {
+ sbuf_printf(sb, "%s(%s)", (need_space) ? " " : "",
+ (hdr->byte2 & SMA_READ_ONLY) ? "RO" : "RW");
+ }
+ sbuf_printf(sb, ": ");
+}
+
+int
+scsi_attrib_sbuf(struct sbuf *sb, struct scsi_mam_attribute_header *hdr,
+ uint32_t valid_len, struct scsi_attrib_table_entry *user_table,
+ size_t num_user_entries, int prefer_user_table,
+ uint32_t output_flags, char *error_str, int error_str_len)
+{
+ int retval;
+ struct scsi_attrib_table_entry *table1 = NULL, *table2 = NULL;
+ struct scsi_attrib_table_entry *entry = NULL;
+ size_t table1_size = 0, table2_size = 0;
+ uint32_t id;
+
+ retval = 0;
+
+ if (valid_len < sizeof(*hdr)) {
+ retval = 1;
+ goto bailout;
+ }
+
+ id = scsi_2btoul(hdr->id);
+
+ if (user_table != NULL) {
+ if (prefer_user_table != 0) {
+ table1 = user_table;
+ table1_size = num_user_entries;
+ table2 = scsi_mam_attr_table;
+ table2_size = sizeof(scsi_mam_attr_table) /
+ sizeof(scsi_mam_attr_table[0]);
+ } else {
+ table1 = scsi_mam_attr_table;
+ table1_size = sizeof(scsi_mam_attr_table) /
+ sizeof(scsi_mam_attr_table[0]);
+ table2 = user_table;
+ table2_size = num_user_entries;
+ }
+ } else {
+ table1 = scsi_mam_attr_table;
+ table1_size = sizeof(scsi_mam_attr_table) /
+ sizeof(scsi_mam_attr_table[0]);
+ }
+
+ entry = scsi_find_attrib_entry(table1, table1_size, id);
+ if (entry != NULL) {
+ scsi_attrib_prefix_sbuf(sb, output_flags, hdr, valid_len,
+ entry->desc);
+ if (entry->to_str == NULL)
+ goto print_default;
+ retval = entry->to_str(sb, hdr, valid_len, entry->flags,
+ output_flags, error_str, error_str_len);
+ goto bailout;
+ }
+ if (table2 != NULL) {
+ entry = scsi_find_attrib_entry(table2, table2_size, id);
+ if (entry != NULL) {
+ if (entry->to_str == NULL)
+ goto print_default;
+
+ scsi_attrib_prefix_sbuf(sb, output_flags, hdr,
+ valid_len, entry->desc);
+ retval = entry->to_str(sb, hdr, valid_len, entry->flags,
+ output_flags, error_str,
+ error_str_len);
+ goto bailout;
+ }
+ }
+
+ scsi_attrib_prefix_sbuf(sb, output_flags, hdr, valid_len, NULL);
+
+print_default:
+ retval = scsi_attrib_value_sbuf(sb, valid_len, hdr, output_flags,
+ error_str, error_str_len);
+bailout:
+ if (retval == 0) {
+ if ((entry != NULL)
+ && (entry->suffix != NULL))
+ sbuf_printf(sb, " %s", entry->suffix);
+
+ sbuf_trim(sb);
+ sbuf_printf(sb, "\n");
+ }
+
+ return (retval);
+}
+
void
scsi_test_unit_ready(struct ccb_scsiio *csio, u_int32_t retries,
void (*cbfcnp)(struct cam_periph *, union ccb *),
@@ -7403,6 +8227,74 @@ scsi_start_stop(struct ccb_scsiio *csio, u_int32_t retries,
timeout);
}
+void
+scsi_read_attribute(struct ccb_scsiio *csio, u_int32_t retries,
+ void (*cbfcnp)(struct cam_periph *, union ccb *),
+ u_int8_t tag_action, u_int8_t service_action,
+ uint32_t element, u_int8_t elem_type, int logical_volume,
+ int partition, u_int32_t first_attribute, int cache,
+ u_int8_t *data_ptr, u_int32_t length, int sense_len,
+ u_int32_t timeout)
+{
+ struct scsi_read_attribute *scsi_cmd;
+
+ scsi_cmd = (struct scsi_read_attribute *)&csio->cdb_io.cdb_bytes;
+ bzero(scsi_cmd, sizeof(*scsi_cmd));
+
+ scsi_cmd->opcode = READ_ATTRIBUTE;
+ scsi_cmd->service_action = service_action,
+ scsi_ulto2b(element, scsi_cmd->element);
+ scsi_cmd->elem_type = elem_type;
+ scsi_cmd->logical_volume = logical_volume;
+ scsi_cmd->partition = partition;
+ scsi_ulto2b(first_attribute, scsi_cmd->first_attribute);
+ scsi_ulto4b(length, scsi_cmd->length);
+ if (cache != 0)
+ scsi_cmd->cache |= SRA_CACHE;
+
+ cam_fill_csio(csio,
+ retries,
+ cbfcnp,
+ /*flags*/CAM_DIR_IN,
+ tag_action,
+ /*data_ptr*/data_ptr,
+ /*dxfer_len*/length,
+ sense_len,
+ sizeof(*scsi_cmd),
+ timeout);
+}
+
+void
+scsi_write_attribute(struct ccb_scsiio *csio, u_int32_t retries,
+ void (*cbfcnp)(struct cam_periph *, union ccb *),
+ u_int8_t tag_action, uint32_t element, int logical_volume,
+ int partition, int wtc, u_int8_t *data_ptr,
+ u_int32_t length, int sense_len, u_int32_t timeout)
+{
+ struct scsi_write_attribute *scsi_cmd;
+
+ scsi_cmd = (struct scsi_write_attribute *)&csio->cdb_io.cdb_bytes;
+ bzero(scsi_cmd, sizeof(*scsi_cmd));
+
+ scsi_cmd->opcode = WRITE_ATTRIBUTE;
+ if (wtc != 0)
+ scsi_cmd->byte2 = SWA_WTC;
+ scsi_ulto3b(element, scsi_cmd->element);
+ scsi_cmd->logical_volume = logical_volume;
+ scsi_cmd->partition = partition;
+ scsi_ulto4b(length, scsi_cmd->length);
+
+ cam_fill_csio(csio,
+ retries,
+ cbfcnp,
+ /*flags*/CAM_DIR_OUT,
+ tag_action,
+ /*data_ptr*/data_ptr,
+ /*dxfer_len*/length,
+ sense_len,
+ sizeof(*scsi_cmd),
+ timeout);
+}
void
scsi_persistent_reserve_in(struct ccb_scsiio *csio, uint32_t retries,
diff --git a/sys/cam/scsi/scsi_all.h b/sys/cam/scsi/scsi_all.h
index f70b094..e446f6c 100644
--- a/sys/cam/scsi/scsi_all.h
+++ b/sys/cam/scsi/scsi_all.h
@@ -996,6 +996,216 @@ struct scsi_write_buffer
u_int8_t control;
};
+struct scsi_read_attribute
+{
+ u_int8_t opcode;
+ u_int8_t service_action;
+#define SRA_SA_ATTR_VALUES 0x00
+#define SRA_SA_ATTR_LIST 0x01
+#define SRA_SA_LOG_VOL_LIST 0x02
+#define SRA_SA_PART_LIST 0x03
+#define SRA_SA_RESTRICTED 0x04
+#define SRA_SA_SUPPORTED_ATTRS 0x05
+#define SRA_SA_MASK 0x1f
+ u_int8_t element[2];
+ u_int8_t elem_type;
+ u_int8_t logical_volume;
+ u_int8_t reserved1;
+ u_int8_t partition;
+ u_int8_t first_attribute[2];
+ u_int8_t length[4];
+ u_int8_t cache;
+#define SRA_CACHE 0x01
+ u_int8_t control;
+};
+
+struct scsi_write_attribute
+{
+ u_int8_t opcode;
+ u_int8_t byte2;
+#define SWA_WTC 0x01
+ u_int8_t element[3];
+ u_int8_t logical_volume;
+ u_int8_t reserved1;
+ u_int8_t partition;
+ u_int8_t reserved2[2];
+ u_int8_t length[4];
+ u_int8_t reserved3;
+ u_int8_t control;
+};
+
+
+struct scsi_read_attribute_values
+{
+ u_int8_t length[4];
+ u_int8_t attribute_0[0];
+};
+
+struct scsi_mam_attribute_header
+{
+ u_int8_t id[2];
+ /*
+ * Attributes obtained from SPC-4r36g (section 7.4.2.2) and
+ * SSC-4r03 (section 4.2.21).
+ */
+#define SMA_ATTR_ID_DEVICE_MIN 0x0000
+
+#define SMA_ATTR_REM_CAP_PARTITION 0x0000
+#define SMA_ATTR_MAX_CAP_PARTITION 0x0001
+#define SMA_ATTR_TAPEALERT_FLAGS 0x0002
+#define SMA_ATTR_LOAD_COUNT 0x0003
+#define SMA_ATTR_MAM_SPACE_REMAINING 0x0004
+
+#define SMA_ATTR_DEV_ASSIGNING_ORG 0x0005
+#define SMA_ATTR_FORMAT_DENSITY_CODE 0x0006
+#define SMA_ATTR_INITIALIZATION_COUNT 0x0007
+#define SMA_ATTR_VOLUME_ID 0x0008
+#define SMA_ATTR_VOLUME_CHANGE_REF 0x0009
+
+#define SMA_ATTR_DEV_SERIAL_LAST_LOAD 0x020a
+#define SMA_ATTR_DEV_SERIAL_LAST_LOAD_1 0x020b
+#define SMA_ATTR_DEV_SERIAL_LAST_LOAD_2 0x020c
+#define SMA_ATTR_DEV_SERIAL_LAST_LOAD_3 0x020d
+
+#define SMA_ATTR_TOTAL_MB_WRITTEN_LT 0x0220
+#define SMA_ATTR_TOTAL_MB_READ_LT 0x0221
+#define SMA_ATTR_TOTAL_MB_WRITTEN_CUR 0x0222
+#define SMA_ATTR_TOTAL_MB_READ_CUR 0x0223
+#define SMA_ATTR_FIRST_ENC_BLOCK 0x0224
+#define SMA_ATTR_NEXT_UNENC_BLOCK 0x0225
+
+#define SMA_ATTR_MEDIUM_USAGE_HIST 0x0340
+#define SMA_ATTR_PART_USAGE_HIST 0x0341
+
+#define SMA_ATTR_ID_DEVICE_MAX 0x03ff
+
+#define SMA_ATTR_ID_MEDIUM_MIN 0x0400
+
+#define SMA_ATTR_MED_MANUF 0x0400
+#define SMA_ATTR_MED_SERIAL 0x0401
+
+#define SMA_ATTR_MED_LENGTH 0x0402
+#define SMA_ATTR_MED_WIDTH 0x0403
+#define SMA_ATTR_MED_ASSIGNING_ORG 0x0404
+#define SMA_ATTR_MED_DENSITY_CODE 0x0405
+
+#define SMA_ATTR_MED_MANUF_DATE 0x0406
+#define SMA_ATTR_MAM_CAPACITY 0x0407
+#define SMA_ATTR_MED_TYPE 0x0408
+#define SMA_ATTR_MED_TYPE_INFO 0x0409
+#define SMA_ATTR_MED_SERIAL_NUM 0x040a
+
+#define SMA_ATTR_ID_MEDIUM_MAX 0x07ff
+
+#define SMA_ATTR_ID_HOST_MIN 0x0800
+
+#define SMA_ATTR_APP_VENDOR 0x0800
+#define SMA_ATTR_APP_NAME 0x0801
+#define SMA_ATTR_APP_VERSION 0x0802
+#define SMA_ATTR_USER_MED_TEXT_LABEL 0x0803
+#define SMA_ATTR_LAST_WRITTEN_TIME 0x0804
+#define SMA_ATTR_TEXT_LOCAL_ID 0x0805
+#define SMA_ATTR_BARCODE 0x0806
+#define SMA_ATTR_HOST_OWNER_NAME 0x0807
+#define SMA_ATTR_MEDIA_POOL 0x0808
+#define SMA_ATTR_PART_USER_LABEL 0x0809
+#define SMA_ATTR_LOAD_UNLOAD_AT_PART 0x080a
+#define SMA_ATTR_APP_FORMAT_VERSION 0x080b
+#define SMA_ATTR_VOL_COHERENCY_INFO 0x080c
+
+#define SMA_ATTR_ID_HOST_MAX 0x0bff
+
+#define SMA_ATTR_VENDOR_DEVICE_MIN 0x0c00
+#define SMA_ATTR_VENDOR_DEVICE_MAX 0x0fff
+#define SMA_ATTR_VENDOR_MEDIUM_MIN 0x1000
+#define SMA_ATTR_VENDOR_MEDIUM_MAX 0x13ff
+#define SMA_ATTR_VENDOR_HOST_MIN 0x1400
+#define SMA_ATTR_VENDOR_HOST_MAX 0x17ff
+ u_int8_t byte2;
+#define SMA_FORMAT_BINARY 0x00
+#define SMA_FORMAT_ASCII 0x01
+#define SMA_FORMAT_TEXT 0x02
+#define SMA_FORMAT_MASK 0x03
+#define SMA_READ_ONLY 0x80
+ u_int8_t length[2];
+ u_int8_t attribute[0];
+};
+
+struct scsi_attrib_list_header {
+ u_int8_t length[4];
+ u_int8_t first_attr_0[0];
+};
+
+struct scsi_attrib_lv_list {
+ u_int8_t length[2];
+ u_int8_t first_lv_number;
+ u_int8_t num_logical_volumes;
+};
+
+struct scsi_attrib_vendser {
+ uint8_t vendor[8];
+ uint8_t serial_num[32];
+};
+
+/*
+ * These values are used to decode the Volume Coherency Information
+ * Attribute (0x080c) for LTFS-format coherency information.
+ * Although the Application Client Specific lengths are different for
+ * Version 0 and Version 1, the data is in fact the same. The length
+ * difference was due to a code bug.
+ */
+#define SCSI_LTFS_VER0_LEN 42
+#define SCSI_LTFS_VER1_LEN 43
+#define SCSI_LTFS_UUID_LEN 36
+#define SCSI_LTFS_STR_NAME "LTFS"
+#define SCSI_LTFS_STR_LEN 4
+
+typedef enum {
+ SCSI_ATTR_FLAG_NONE = 0x00,
+ SCSI_ATTR_FLAG_HEX = 0x01,
+ SCSI_ATTR_FLAG_FP = 0x02,
+ SCSI_ATTR_FLAG_DIV_10 = 0x04,
+ SCSI_ATTR_FLAG_FP_1DIGIT = 0x08
+} scsi_attrib_flags;
+
+typedef enum {
+ SCSI_ATTR_OUTPUT_NONE = 0x00,
+ SCSI_ATTR_OUTPUT_TEXT_MASK = 0x03,
+ SCSI_ATTR_OUTPUT_TEXT_RAW = 0x00,
+ SCSI_ATTR_OUTPUT_TEXT_ESC = 0x01,
+ SCSI_ATTR_OUTPUT_TEXT_RSV1 = 0x02,
+ SCSI_ATTR_OUTPUT_TEXT_RSV2 = 0x03,
+ SCSI_ATTR_OUTPUT_NONASCII_MASK = 0x0c,
+ SCSI_ATTR_OUTPUT_NONASCII_TRIM = 0x00,
+ SCSI_ATTR_OUTPUT_NONASCII_ESC = 0x04,
+ SCSI_ATTR_OUTPUT_NONASCII_RAW = 0x08,
+ SCSI_ATTR_OUTPUT_NONASCII_RSV1 = 0x0c,
+ SCSI_ATTR_OUTPUT_FIELD_MASK = 0xf0,
+ SCSI_ATTR_OUTPUT_FIELD_ALL = 0xf0,
+ SCSI_ATTR_OUTPUT_FIELD_NONE = 0x00,
+ SCSI_ATTR_OUTPUT_FIELD_DESC = 0x10,
+ SCSI_ATTR_OUTPUT_FIELD_NUM = 0x20,
+ SCSI_ATTR_OUTPUT_FIELD_SIZE = 0x40,
+ SCSI_ATTR_OUTPUT_FIELD_RW = 0x80
+} scsi_attrib_output_flags;
+
+struct sbuf;
+
+struct scsi_attrib_table_entry
+{
+ u_int32_t id;
+ u_int32_t flags;
+ const char *desc;
+ const char *suffix;
+ int (*to_str)(struct sbuf *sb, struct scsi_mam_attribute_header *hdr,
+ uint32_t valid_len, uint32_t flags,
+ uint32_t output_flags, char *error_str,
+ int error_str_len);
+ int (*parse_str)(char *str, struct scsi_mam_attribute_header *hdr,
+ uint32_t alloc_len, uint32_t flags, char *error_str,
+ int error_str_len);
+};
+
struct scsi_rw_6
{
u_int8_t opcode;
@@ -1750,6 +1960,8 @@ struct ata_pass_16 {
#define READ_16 0x88
#define COMPARE_AND_WRITE 0x89
#define WRITE_16 0x8A
+#define READ_ATTRIBUTE 0x8C
+#define WRITE_ATTRIBUTE 0x8D
#define WRITE_VERIFY_16 0x8E
#define VERIFY_16 0x8F
#define SYNCHRONIZE_CACHE_16 0x91
@@ -3272,8 +3484,6 @@ struct cam_device;
extern const char *scsi_sense_key_text[];
-struct sbuf;
-
__BEGIN_DECLS
void scsi_sense_desc(int sense_key, int asc, int ascq,
struct scsi_inquiry_data *inq_data,
@@ -3465,6 +3675,63 @@ int scsi_parse_transportid(char *transportid_str,
#endif
char *error_str, int error_str_len);
+
+int scsi_attrib_volcoh_sbuf(struct sbuf *sb,
+ struct scsi_mam_attribute_header *hdr,
+ uint32_t valid_len, uint32_t flags,
+ uint32_t output_flags, char *error_str,
+ int error_str_len);
+
+int scsi_attrib_vendser_sbuf(struct sbuf *sb,
+ struct scsi_mam_attribute_header *hdr,
+ uint32_t valid_len, uint32_t flags,
+ uint32_t output_flags, char *error_str,
+ int error_str_len);
+
+int scsi_attrib_hexdump_sbuf(struct sbuf *sb,
+ struct scsi_mam_attribute_header *hdr,
+ uint32_t valid_len, uint32_t flags,
+ uint32_t output_flags, char *error_str,
+ int error_str_len);
+
+int scsi_attrib_int_sbuf(struct sbuf *sb, struct scsi_mam_attribute_header *hdr,
+ uint32_t valid_len, uint32_t flags,
+ uint32_t output_flags, char *error_str,
+ int error_str_len);
+
+int scsi_attrib_ascii_sbuf(struct sbuf *sb,
+ struct scsi_mam_attribute_header *hdr,
+ uint32_t valid_len, uint32_t flags,
+ uint32_t output_flags, char *error_str,
+ int error_str_len);
+
+int scsi_attrib_text_sbuf(struct sbuf *sb,
+ struct scsi_mam_attribute_header *hdr,
+ uint32_t valid_len, uint32_t flags,
+ uint32_t output_flags, char *error_str,
+ int error_str_len);
+
+struct scsi_attrib_table_entry *scsi_find_attrib_entry(
+ struct scsi_attrib_table_entry *table,
+ size_t num_table_entries, uint32_t id);
+
+struct scsi_attrib_table_entry *scsi_get_attrib_entry(uint32_t id);
+
+int scsi_attrib_value_sbuf(struct sbuf *sb, uint32_t valid_len,
+ struct scsi_mam_attribute_header *hdr,
+ uint32_t output_flags, char *error_str,
+ size_t error_str_len);
+
+void scsi_attrib_prefix_sbuf(struct sbuf *sb, uint32_t output_flags,
+ struct scsi_mam_attribute_header *hdr,
+ uint32_t valid_len, const char *desc);
+
+int scsi_attrib_sbuf(struct sbuf *sb, struct scsi_mam_attribute_header *hdr,
+ uint32_t valid_len,
+ struct scsi_attrib_table_entry *user_table,
+ size_t num_user_entries, int prefer_user_table,
+ uint32_t output_flags, char *error_str, int error_str_len);
+
void scsi_test_unit_ready(struct ccb_scsiio *csio, u_int32_t retries,
void (*cbfcnp)(struct cam_periph *,
union ccb *),
@@ -3659,6 +3926,18 @@ void scsi_start_stop(struct ccb_scsiio *csio, u_int32_t retries,
void (*cbfcnp)(struct cam_periph *, union ccb *),
u_int8_t tag_action, int start, int load_eject,
int immediate, u_int8_t sense_len, u_int32_t timeout);
+void scsi_read_attribute(struct ccb_scsiio *csio, u_int32_t retries,
+ void (*cbfcnp)(struct cam_periph *, union ccb *),
+ u_int8_t tag_action, u_int8_t service_action,
+ uint32_t element, u_int8_t elem_type,
+ int logical_volume, int partition,
+ u_int32_t first_attribute, int cache, u_int8_t *data_ptr,
+ u_int32_t length, int sense_len, u_int32_t timeout);
+void scsi_write_attribute(struct ccb_scsiio *csio, u_int32_t retries,
+ void (*cbfcnp)(struct cam_periph *, union ccb *),
+ u_int8_t tag_action, uint32_t element,
+ int logical_volume, int partition, int wtc, u_int8_t *data_ptr,
+ u_int32_t length, int sense_len, u_int32_t timeout);
void scsi_security_protocol_in(struct ccb_scsiio *csio, uint32_t retries,
void (*cbfcnp)(struct cam_periph *, union ccb *),
diff --git a/sys/cddl/compat/opensolaris/sys/nvpair.h b/sys/cddl/compat/opensolaris/sys/nvpair.h
index fcb0c87..c90ab70 100644
--- a/sys/cddl/compat/opensolaris/sys/nvpair.h
+++ b/sys/cddl/compat/opensolaris/sys/nvpair.h
@@ -29,6 +29,8 @@
#ifndef _OPENSOLARIS_SYS_NVPAIR_H_
#define _OPENSOLARIS_SYS_NVPAIR_H_
+#ifdef _KERNEL
+
/*
* Some of the symbols in the Illumos nvpair library conflict with symbols
* provided by nv(9), so we use this preprocessor hack to avoid the conflict.
@@ -254,6 +256,8 @@
#define nvpair_unpack illumos_nvpair_unpack
#define nvpair_unpack_descriptor illumos_nvpair_unpack_descriptor
+#endif /* _KERNEL */
+
#include_next <sys/nvpair.h>
#endif
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
index a0c1377..fd6e800 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
@@ -855,6 +855,10 @@ dmu_send_estimate(dsl_dataset_t *ds, dsl_dataset_t *fromds, uint64_t *sizep)
if (!dsl_dataset_is_snapshot(ds))
return (SET_ERROR(EINVAL));
+ /* fromsnap, if provided, must be a snapshot */
+ if (fromds != NULL && !dsl_dataset_is_snapshot(fromds))
+ return (SET_ERROR(EINVAL));
+
/*
* fromsnap must be an earlier snapshot from the same fs as tosnap,
* or the origin's fs.
@@ -983,10 +987,12 @@ recv_begin_check_existing_impl(dmu_recv_begin_arg_t *drba, dsl_dataset_t *ds,
dsl_dataset_rele(snap, FTAG);
} else {
- /* if full, most recent snapshot must be $ORIGIN */
- if (dsl_dataset_phys(ds)->ds_prev_snap_txg >= TXG_INITIAL)
- return (SET_ERROR(ENODEV));
- drba->drba_snapobj = dsl_dataset_phys(ds)->ds_prev_snap_obj;
+ /* if full, then must be forced */
+ if (!drba->drba_cookie->drc_force)
+ return (SET_ERROR(EEXIST));
+ /* start from $ORIGIN@$ORIGIN, if supported */
+ drba->drba_snapobj = dp->dp_origin_snap != NULL ?
+ dp->dp_origin_snap->ds_object : 0;
}
return (0);
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
index 58db4dd..7319c76 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
@@ -2161,12 +2161,14 @@ dsl_dataset_promote_check(void *arg, dmu_tx_t *tx)
int err;
uint64_t unused;
uint64_t ss_mv_cnt;
+ size_t max_snap_len;
err = promote_hold(ddpa, dp, FTAG);
if (err != 0)
return (err);
hds = ddpa->ddpa_clone;
+ max_snap_len = MAXNAMELEN - strlen(ddpa->ddpa_clonename) - 1;
if (dsl_dataset_phys(hds)->ds_flags & DS_FLAG_NOPROMOTE) {
promote_rele(ddpa, FTAG);
@@ -2230,6 +2232,10 @@ dsl_dataset_promote_check(void *arg, dmu_tx_t *tx)
/* Check that the snapshot name does not conflict */
VERIFY0(dsl_dataset_get_snapname(ds));
+ if (strlen(ds->ds_snapname) >= max_snap_len) {
+ err = SET_ERROR(ENAMETOOLONG);
+ goto out;
+ }
err = dsl_dataset_snap_lookup(hds, ds->ds_snapname, &val);
if (err == 0) {
(void) strcpy(ddpa->err_ds, snap->ds->ds_snapname);
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
index 8700f4c..7c89454 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
@@ -2256,6 +2256,8 @@ spa_load_impl(spa_t *spa, uint64_t pool_guid, nvlist_t *config,
return (error);
ASSERT(spa->spa_root_vdev == rvd);
+ ASSERT3U(spa->spa_min_ashift, >=, SPA_MINBLOCKSHIFT);
+ ASSERT3U(spa->spa_max_ashift, <=, SPA_MAXBLOCKSHIFT);
if (type != SPA_IMPORT_ASSEMBLE) {
ASSERT(spa_guid(spa) == pool_guid);
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
index d072dc3..994fb1c 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright 2013 Martin Matuska <mm@FreeBSD.org>. All rights reserved.
*/
@@ -719,6 +719,9 @@ spa_add(const char *name, nvlist_t *config, const char *altroot)
spa->spa_debug = ((zfs_flags & ZFS_DEBUG_SPA) != 0);
+ spa->spa_min_ashift = INT_MAX;
+ spa->spa_max_ashift = 0;
+
/*
* As a pool is being created, treat all features as disabled by
* setting SPA_FEATURE_DISABLED for all entries in the feature
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h
index d1737e1..c656013 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright 2013 Martin Matuska <mm@FreeBSD.org>. All rights reserved.
*/
@@ -147,6 +147,8 @@ struct spa {
objset_t *spa_meta_objset; /* copy of dp->dp_meta_objset */
txg_list_t spa_vdev_txg_list; /* per-txg dirty vdev list */
vdev_t *spa_root_vdev; /* top-level vdev container */
+ int spa_min_ashift; /* of vdevs in normal class */
+ int spa_max_ashift; /* of vdevs in normal class */
uint64_t spa_config_guid; /* config pool guid */
uint64_t spa_load_guid; /* spa_load initialized guid */
uint64_t spa_last_synced_guid; /* last synced guid */
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h
index e7515d5..c14ac21 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
*/
#ifndef _SYS_VDEV_IMPL_H
@@ -225,7 +225,7 @@ struct vdev {
boolean_t vdev_isl2cache; /* was a l2cache device */
vdev_queue_t vdev_queue; /* I/O deadline schedule queue */
vdev_cache_t vdev_cache; /* physical block cache */
- spa_aux_vdev_t *vdev_aux; /* for l2cache vdevs */
+ spa_aux_vdev_t *vdev_aux; /* for l2cache and spares vdevs */
zio_t *vdev_probe_zio; /* root of current probe */
vdev_aux_t vdev_label_aux; /* on-disk aux state */
struct trim_map *vdev_trimmap; /* map on outstanding trims */
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
index a3ec38e..c434f0c 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
@@ -21,8 +21,8 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
+ * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
* Copyright 2013 Martin Matuska <mm@FreeBSD.org>. All rights reserved.
*/
@@ -278,8 +278,9 @@ vdev_add_child(vdev_t *pvd, vdev_t *cvd)
size_t oldsize, newsize;
uint64_t id = cvd->vdev_id;
vdev_t **newchild;
+ spa_t *spa = cvd->vdev_spa;
- ASSERT(spa_config_held(cvd->vdev_spa, SCL_ALL, RW_WRITER) == SCL_ALL);
+ ASSERT(spa_config_held(spa, SCL_ALL, RW_WRITER) == SCL_ALL);
ASSERT(cvd->vdev_parent == NULL);
cvd->vdev_parent = pvd;
@@ -1398,6 +1399,17 @@ vdev_open(vdev_t *vd)
}
/*
+ * Track the min and max ashift values for normal data devices.
+ */
+ if (vd->vdev_top == vd && vd->vdev_ashift != 0 &&
+ !vd->vdev_islog && vd->vdev_aux == NULL) {
+ if (vd->vdev_ashift > spa->spa_max_ashift)
+ spa->spa_max_ashift = vd->vdev_ashift;
+ if (vd->vdev_ashift < spa->spa_min_ashift)
+ spa->spa_min_ashift = vd->vdev_ashift;
+ }
+
+ /*
* If a leaf vdev has a DTL, and seems healthy, then kick off a
* resilver. But don't do this if we are doing a reopen for a scrub,
* since this would just restart the scrub we are already doing.
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
index 9e0b8a0..c2dd020 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
@@ -697,6 +697,7 @@ zfsctl_unmount_snap(zfs_snapentry_t *sep, int fflags, cred_t *cr)
return (0);
#else
+ vfs_ref(vn_mountedvfs(svp));
return (dounmount(vn_mountedvfs(svp), fflags, curthread));
#endif
}
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
index 8f31e3f..e3b6581 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
@@ -25,12 +25,11 @@
* All rights reserved.
* Copyright 2013 Martin Matuska <mm@FreeBSD.org>. All rights reserved.
* Copyright 2014 Xin Li <delphij@FreeBSD.org>. All rights reserved.
- * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2014, Joyent, Inc. All rights reserved.
* Copyright (c) 2011, 2014 by Delphix. All rights reserved.
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
* Copyright (c) 2013 Steven Hartland. All rights reserved.
- * Copyright (c) 2014, Nexenta Systems, Inc. All rights reserved.
*/
/*
@@ -3481,9 +3480,8 @@ zfs_unmount_snap(const char *snapname)
#ifdef illumos
(void) dounmount(vfsp, MS_FORCE, kcred);
#else
- mtx_lock(&Giant); /* dounmount() */
+ vfs_ref(vfsp);
(void) dounmount(vfsp, MS_FORCE, curthread);
- mtx_unlock(&Giant); /* dounmount() */
#endif
return (0);
}
@@ -5241,6 +5239,7 @@ zfs_ioc_smb_acl(zfs_cmd_t *zc)
static int
zfs_ioc_hold(const char *pool, nvlist_t *args, nvlist_t *errlist)
{
+ nvpair_t *pair;
nvlist_t *holds;
int cleanup_fd = -1;
int error;
@@ -5250,6 +5249,19 @@ zfs_ioc_hold(const char *pool, nvlist_t *args, nvlist_t *errlist)
if (error != 0)
return (SET_ERROR(EINVAL));
+ /* make sure the user didn't pass us any invalid (empty) tags */
+ for (pair = nvlist_next_nvpair(holds, NULL); pair != NULL;
+ pair = nvlist_next_nvpair(holds, pair)) {
+ char *htag;
+
+ error = nvpair_value_string(pair, &htag);
+ if (error != 0)
+ return (SET_ERROR(error));
+
+ if (strlen(htag) == 0)
+ return (SET_ERROR(EINVAL));
+ }
+
if (nvlist_lookup_int32(args, "cleanup_fd", &cleanup_fd) == 0) {
error = zfs_onexit_fd_hold(cleanup_fd, &minor);
if (error != 0)
@@ -5363,11 +5375,19 @@ zfs_ioc_space_snaps(const char *lastsnap, nvlist_t *innvl, nvlist_t *outnvl)
return (error);
error = dsl_dataset_hold(dp, lastsnap, FTAG, &new);
+ if (error == 0 && !dsl_dataset_is_snapshot(new)) {
+ dsl_dataset_rele(new, FTAG);
+ error = SET_ERROR(EINVAL);
+ }
if (error != 0) {
dsl_pool_rele(dp, FTAG);
return (error);
}
error = dsl_dataset_hold(dp, firstsnap, FTAG, &old);
+ if (error == 0 && !dsl_dataset_is_snapshot(old)) {
+ dsl_dataset_rele(old, FTAG);
+ error = SET_ERROR(EINVAL);
+ }
if (error != 0) {
dsl_dataset_rele(new, FTAG);
dsl_pool_rele(dp, FTAG);
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
index 5824828..1193e47 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
@@ -2314,8 +2314,10 @@ bail:
* Since we couldn't setup the sa framework, try to force
* unmount this file system.
*/
- if (vn_vfswlock(zfsvfs->z_vfs->vfs_vnodecovered) == 0)
+ if (vn_vfswlock(zfsvfs->z_vfs->vfs_vnodecovered) == 0) {
+ vfs_ref(zfsvfs->z_vfs);
(void) dounmount(zfsvfs->z_vfs, MS_FORCE, curthread);
+ }
}
return (err);
}
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
index e3b314f..3d30082 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
@@ -1797,7 +1797,6 @@ log:
void
zfs_create_fs(objset_t *os, cred_t *cr, nvlist_t *zplprops, dmu_tx_t *tx)
{
- zfsvfs_t zfsvfs;
uint64_t moid, obj, sa_obj, version;
uint64_t sense = ZFS_CASE_SENSITIVE;
uint64_t norm = 0;
@@ -1805,6 +1804,7 @@ zfs_create_fs(objset_t *os, cred_t *cr, nvlist_t *zplprops, dmu_tx_t *tx)
int error;
int i;
znode_t *rootzp = NULL;
+ zfsvfs_t *zfsvfs;
vattr_t vattr;
znode_t *zp;
zfs_acl_ids_t acl_ids;
@@ -1880,7 +1880,7 @@ zfs_create_fs(objset_t *os, cred_t *cr, nvlist_t *zplprops, dmu_tx_t *tx)
vattr.va_uid = crgetuid(cr);
vattr.va_gid = crgetgid(cr);
- bzero(&zfsvfs, sizeof (zfsvfs_t));
+ zfsvfs = kmem_zalloc(sizeof (zfsvfs_t), KM_SLEEP);
rootzp = kmem_cache_alloc(znode_cache, KM_SLEEP);
ASSERT(!POINTER_IS_VALID(rootzp->z_zfsvfs));
@@ -1889,15 +1889,15 @@ zfs_create_fs(objset_t *os, cred_t *cr, nvlist_t *zplprops, dmu_tx_t *tx)
rootzp->z_atime_dirty = 0;
rootzp->z_is_sa = USE_SA(version, os);
- zfsvfs.z_os = os;
- zfsvfs.z_parent = &zfsvfs;
- zfsvfs.z_version = version;
- zfsvfs.z_use_fuids = USE_FUIDS(version, os);
- zfsvfs.z_use_sa = USE_SA(version, os);
- zfsvfs.z_norm = norm;
+ zfsvfs->z_os = os;
+ zfsvfs->z_parent = zfsvfs;
+ zfsvfs->z_version = version;
+ zfsvfs->z_use_fuids = USE_FUIDS(version, os);
+ zfsvfs->z_use_sa = USE_SA(version, os);
+ zfsvfs->z_norm = norm;
error = sa_setup(os, sa_obj, zfs_attr_table, ZPL_END,
- &zfsvfs.z_attr_table);
+ &zfsvfs->z_attr_table);
ASSERT(error == 0);
@@ -1906,16 +1906,16 @@ zfs_create_fs(objset_t *os, cred_t *cr, nvlist_t *zplprops, dmu_tx_t *tx)
* insensitive.
*/
if (sense == ZFS_CASE_INSENSITIVE || sense == ZFS_CASE_MIXED)
- zfsvfs.z_norm |= U8_TEXTPREP_TOUPPER;
+ zfsvfs->z_norm |= U8_TEXTPREP_TOUPPER;
- mutex_init(&zfsvfs.z_znodes_lock, NULL, MUTEX_DEFAULT, NULL);
- list_create(&zfsvfs.z_all_znodes, sizeof (znode_t),
+ mutex_init(&zfsvfs->z_znodes_lock, NULL, MUTEX_DEFAULT, NULL);
+ list_create(&zfsvfs->z_all_znodes, sizeof (znode_t),
offsetof(znode_t, z_link_node));
for (i = 0; i != ZFS_OBJ_MTX_SZ; i++)
- mutex_init(&zfsvfs.z_hold_mtx[i], NULL, MUTEX_DEFAULT, NULL);
+ mutex_init(&zfsvfs->z_hold_mtx[i], NULL, MUTEX_DEFAULT, NULL);
- rootzp->z_zfsvfs = &zfsvfs;
+ rootzp->z_zfsvfs = zfsvfs;
VERIFY(0 == zfs_acl_ids_create(rootzp, IS_ROOT_NODE, &vattr,
cr, NULL, &acl_ids));
zfs_mknode(rootzp, &vattr, tx, cr, IS_ROOT_NODE, &zp, &acl_ids);
@@ -1932,12 +1932,13 @@ zfs_create_fs(objset_t *os, cred_t *cr, nvlist_t *zplprops, dmu_tx_t *tx)
* Create shares directory
*/
- error = zfs_create_share_dir(&zfsvfs, tx);
+ error = zfs_create_share_dir(zfsvfs, tx);
ASSERT(error == 0);
for (i = 0; i != ZFS_OBJ_MTX_SZ; i++)
- mutex_destroy(&zfsvfs.z_hold_mtx[i]);
+ mutex_destroy(&zfsvfs->z_hold_mtx[i]);
+ kmem_free(zfsvfs, sizeof (zfsvfs_t));
}
#endif /* _KERNEL */
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
index afda3e4..ae4d00c 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
* Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved.
*/
@@ -1264,19 +1264,23 @@ zio_write_bp_init(zio_t *zio)
return (ZIO_PIPELINE_CONTINUE);
} else {
/*
- * Round up compressed size to MINBLOCKSIZE and
- * zero the tail.
+ * Round up compressed size up to the ashift
+ * of the smallest-ashift device, and zero the tail.
+ * This ensures that the compressed size of the BP
+ * (and thus compressratio property) are correct,
+ * in that we charge for the padding used to fill out
+ * the last sector.
*/
- size_t rounded =
- P2ROUNDUP(psize, (size_t)SPA_MINBLOCKSIZE);
- if (rounded > psize) {
- bzero((char *)cbuf + psize, rounded - psize);
- psize = rounded;
- }
- if (psize == lsize) {
+ ASSERT3U(spa->spa_min_ashift, >=, SPA_MINBLOCKSHIFT);
+ size_t rounded = (size_t)P2ROUNDUP(psize,
+ 1ULL << spa->spa_min_ashift);
+ if (rounded >= lsize) {
compress = ZIO_COMPRESS_OFF;
zio_buf_free(cbuf, lsize);
+ psize = lsize;
} else {
+ bzero((char *)cbuf + psize, rounded - psize);
+ psize = rounded;
zio_push_transform(zio, cbuf,
psize, lsize, NULL);
}
diff --git a/sys/cddl/dev/dtrace/amd64/dtrace_asm.S b/sys/cddl/dev/dtrace/amd64/dtrace_asm.S
index a6c079e..eb5856d 100644
--- a/sys/cddl/dev/dtrace/amd64/dtrace_asm.S
+++ b/sys/cddl/dev/dtrace/amd64/dtrace_asm.S
@@ -60,8 +60,6 @@
1: addq $TF_RIP,%rsp;
- .globl calltrap
- .type calltrap,@function
ENTRY(dtrace_invop_start)
/*
diff --git a/sys/cddl/dev/dtrace/arm/dtrace_asm.S b/sys/cddl/dev/dtrace/arm/dtrace_asm.S
index 06e91d2..fd0ce6c 100644
--- a/sys/cddl/dev/dtrace/arm/dtrace_asm.S
+++ b/sys/cddl/dev/dtrace/arm/dtrace_asm.S
@@ -28,7 +28,6 @@
#define _ASM
#define _LOCORE
-#define LOCORE
#include <sys/cpuvar_defs.h>
#include <sys/dtrace.h>
diff --git a/sys/cddl/dev/dtrace/i386/dtrace_asm.S b/sys/cddl/dev/dtrace/i386/dtrace_asm.S
index d44f6c3..425e99c 100644
--- a/sys/cddl/dev/dtrace/i386/dtrace_asm.S
+++ b/sys/cddl/dev/dtrace/i386/dtrace_asm.S
@@ -34,8 +34,6 @@
#include "assym.s"
- .globl calltrap
- .type calltrap,@function
ENTRY(dtrace_invop_start)
pushl %eax /* push %eax -- may be return value */
diff --git a/sys/compat/ia32/ia32_sysvec.c b/sys/compat/ia32/ia32_sysvec.c
index 6dd02af..51a9e9f 100644
--- a/sys/compat/ia32/ia32_sysvec.c
+++ b/sys/compat/ia32/ia32_sysvec.c
@@ -136,6 +136,7 @@ struct sysentvec ia32_freebsd_sysvec = {
.sv_shared_page_base = FREEBSD32_SHAREDPAGE,
.sv_shared_page_len = PAGE_SIZE,
.sv_schedtail = NULL,
+ .sv_thread_detach = NULL,
};
INIT_SYSENTVEC(elf_ia32_sysvec, &ia32_freebsd_sysvec);
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c
index b2444c1..25a8325 100644
--- a/sys/compat/linprocfs/linprocfs.c
+++ b/sys/compat/linprocfs/linprocfs.c
@@ -39,8 +39,6 @@
* @(#)procfs_status.c 8.4 (Berkeley) 6/15/94
*/
-#include "opt_compat.h"
-
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -69,6 +67,7 @@ __FBSDID("$FreeBSD$");
#include <sys/socket.h>
#include <sys/syscallsubr.h>
#include <sys/sysctl.h>
+#include <sys/sysent.h>
#include <sys/systm.h>
#include <sys/time.h>
#include <sys/tty.h>
@@ -80,7 +79,7 @@ __FBSDID("$FreeBSD$");
#include <net/if.h>
#include <net/if_var.h>
-#include <net/vnet.h>
+#include <net/if_types.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
@@ -100,11 +99,7 @@ __FBSDID("$FreeBSD$");
#include <machine/md_var.h>
#endif /* __i386__ || __amd64__ */
-#ifdef COMPAT_FREEBSD32
-#include <compat/freebsd32/freebsd32_util.h>
-#endif
-
-#include <compat/linux/linux_ioctl.h>
+#include <compat/linux/linux.h>
#include <compat/linux/linux_mib.h>
#include <compat/linux/linux_misc.h>
#include <compat/linux/linux_util.h>
@@ -748,6 +743,7 @@ linprocfs_doprocstatus(PFS_FILL_ARGS)
segsz_t lsize;
struct thread *td2;
struct sigacts *ps;
+ l_sigset_t siglist, sigignore, sigcatch;
int i;
sx_slock(&proctree_lock);
@@ -839,29 +835,25 @@ linprocfs_doprocstatus(PFS_FILL_ARGS)
/*
* Signal masks
- *
- * We support up to 128 signals, while Linux supports 32,
- * but we only define 32 (the same 32 as Linux, to boot), so
- * just show the lower 32 bits of each mask. XXX hack.
- *
- * NB: on certain platforms (Sparc at least) Linux actually
- * supports 64 signals, but this code is a long way from
- * running on anything but i386, so ignore that for now.
*/
PROC_LOCK(p);
- sbuf_printf(sb, "SigPnd:\t%08x\n", p->p_siglist.__bits[0]);
- /*
- * I can't seem to find out where the signal mask is in
- * relation to struct proc, so SigBlk is left unimplemented.
- */
- sbuf_printf(sb, "SigBlk:\t%08x\n", 0); /* XXX */
+ bsd_to_linux_sigset(&p->p_siglist, &siglist);
ps = p->p_sigacts;
mtx_lock(&ps->ps_mtx);
- sbuf_printf(sb, "SigIgn:\t%08x\n", ps->ps_sigignore.__bits[0]);
- sbuf_printf(sb, "SigCgt:\t%08x\n", ps->ps_sigcatch.__bits[0]);
+ bsd_to_linux_sigset(&ps->ps_sigignore, &sigignore);
+ bsd_to_linux_sigset(&ps->ps_sigcatch, &sigcatch);
mtx_unlock(&ps->ps_mtx);
PROC_UNLOCK(p);
+ sbuf_printf(sb, "SigPnd:\t%016jx\n", siglist.__mask);
+ /*
+ * XXX. SigBlk - target thread's signal mask, td_sigmask.
+ * To implement SigBlk pseudofs should support proc/tid dir entries.
+ */
+ sbuf_printf(sb, "SigBlk:\t%016x\n", 0);
+ sbuf_printf(sb, "SigIgn:\t%016jx\n", sigignore.__mask);
+ sbuf_printf(sb, "SigCgt:\t%016jx\n", sigcatch.__mask);
+
/*
* Linux also prints the capability masks, but we don't have
* capabilities yet, and when we do get them they're likely to
@@ -954,34 +946,22 @@ linprocfs_doproccmdline(PFS_FILL_ARGS)
static int
linprocfs_doprocenviron(PFS_FILL_ARGS)
{
- int ret;
-
- PROC_LOCK(p);
- if ((ret = p_candebug(td, p)) != 0) {
- PROC_UNLOCK(p);
- return (ret);
- }
/*
* Mimic linux behavior and pass only processes with usermode
* address space as valid. Return zero silently otherwize.
*/
- if (p->p_vmspace == &vmspace0) {
- PROC_UNLOCK(p);
- return (0);
- }
-
- if ((p->p_flag & P_SYSTEM) != 0) {
- PROC_UNLOCK(p);
+ if (p->p_vmspace == &vmspace0)
return (0);
- }
- PROC_UNLOCK(p);
-
- ret = proc_getenvv(td, p, sb);
- return (ret);
+ return (proc_getenvv(td, p, sb));
}
+static char l32_map_str[] = "%08lx-%08lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n";
+static char l64_map_str[] = "%016lx-%016lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n";
+static char vdso_str[] = " [vdso]";
+static char stack_str[] = " [stack]";
+
/*
* Filler function for proc/pid/maps
*/
@@ -997,6 +977,7 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
vm_prot_t e_prot;
unsigned int last_timestamp;
char *name = "", *freename = NULL;
+ const char *l_map_str;
ino_t ino;
int ref_count, shadow_count, flags;
int error;
@@ -1016,6 +997,11 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
vm = vmspace_acquire_ref(p);
if (vm == NULL)
return (ESRCH);
+
+ if (SV_CURPROC_FLAG(SV_LP64))
+ l_map_str = l64_map_str;
+ else
+ l_map_str = l32_map_str;
map = &vm->vm_map;
vm_map_lock_read(map);
for (entry = map->header.next; entry != &map->header;
@@ -1039,25 +1025,26 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
ino = 0;
if (lobj) {
off = IDX_TO_OFF(lobj->size);
- if (lobj->type == OBJT_VNODE) {
- vp = lobj->handle;
- if (vp)
- vref(vp);
- }
- else
- vp = NULL;
+ vp = vm_object_vnode(lobj);
+ if (vp != NULL)
+ vref(vp);
if (lobj != obj)
VM_OBJECT_RUNLOCK(lobj);
flags = obj->flags;
ref_count = obj->ref_count;
shadow_count = obj->shadow_count;
VM_OBJECT_RUNLOCK(obj);
- if (vp) {
+ if (vp != NULL) {
vn_fullpath(td, vp, &name, &freename);
vn_lock(vp, LK_SHARED | LK_RETRY);
VOP_GETATTR(vp, &vat, td->td_ucred);
ino = vat.va_fileid;
vput(vp);
+ } else if (SV_PROC_ABI(p) == SV_ABI_LINUX) {
+ if (e_start == p->p_sysent->sv_shared_page_base)
+ name = vdso_str;
+ if (e_end == p->p_sysent->sv_usrstack)
+ name = stack_str;
}
} else {
flags = 0;
@@ -1069,8 +1056,7 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
* format:
* start, end, access, offset, major, minor, inode, name.
*/
- error = sbuf_printf(sb,
- "%08lx-%08lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n",
+ error = sbuf_printf(sb, l_map_str,
(u_long)e_start, (u_long)e_end,
(e_prot & VM_PROT_READ)?"r":"-",
(e_prot & VM_PROT_WRITE)?"w":"-",
@@ -1107,6 +1093,35 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
}
/*
+ * Criteria for interface name translation
+ */
+#define IFP_IS_ETH(ifp) (ifp->if_type == IFT_ETHER)
+
+static int
+linux_ifname(struct ifnet *ifp, char *buffer, size_t buflen)
+{
+ struct ifnet *ifscan;
+ int ethno;
+
+ IFNET_RLOCK_ASSERT();
+
+ /* Short-circuit non ethernet interfaces */
+ if (!IFP_IS_ETH(ifp))
+ return (strlcpy(buffer, ifp->if_xname, buflen));
+
+ /* Determine the (relative) unit number for ethernet interfaces */
+ ethno = 0;
+ TAILQ_FOREACH(ifscan, &V_ifnet, if_link) {
+ if (ifscan == ifp)
+ return (snprintf(buffer, buflen, "eth%d", ethno));
+ if (IFP_IS_ETH(ifscan))
+ ethno++;
+ }
+
+ return (0);
+}
+
+/*
* Filler function for proc/net/dev
*/
static int
@@ -1254,8 +1269,6 @@ linprocfs_doscsiscsi(PFS_FILL_ARGS)
return (0);
}
-extern struct cdevsw *cdevsw[];
-
/*
* Filler function for proc/devices
*/
@@ -1350,6 +1363,52 @@ linprocfs_douuid(PFS_FILL_ARGS)
return(0);
}
+/*
+ * Filler function for proc/pid/auxv
+ */
+static int
+linprocfs_doauxv(PFS_FILL_ARGS)
+{
+ struct sbuf *asb;
+ off_t buflen, resid;
+ int error;
+
+ /*
+ * Mimic linux behavior and pass only processes with usermode
+ * address space as valid. Return zero silently otherwise.
+ */
+ if (p->p_vmspace == &vmspace0)
+ return (0);
+
+ if (uio->uio_resid == 0)
+ return (0);
+ if (uio->uio_offset < 0 || uio->uio_resid < 0)
+ return (EINVAL);
+
+ asb = sbuf_new_auto();
+ if (asb == NULL)
+ return (ENOMEM);
+ error = proc_getauxv(td, p, asb);
+ if (error == 0)
+ error = sbuf_finish(asb);
+
+ resid = sbuf_len(asb) - uio->uio_offset;
+ if (resid > uio->uio_resid)
+ buflen = uio->uio_resid;
+ else
+ buflen = resid;
+ if (buflen > IOSIZE_MAX)
+ return (EINVAL);
+ if (buflen > MAXPHYS)
+ buflen = MAXPHYS;
+ if (resid <= 0)
+ return (0);
+
+ if (error == 0)
+ error = uiomove(sbuf_data(asb) + uio->uio_offset, buflen, uio);
+ sbuf_delete(asb);
+ return (error);
+}
/*
* Constructor
@@ -1408,7 +1467,7 @@ linprocfs_init(PFS_INIT_ARGS)
pfs_create_link(dir, "cwd", &linprocfs_doproccwd,
NULL, NULL, NULL, 0);
pfs_create_file(dir, "environ", &linprocfs_doprocenviron,
- NULL, NULL, NULL, PFS_RD);
+ NULL, &procfs_candebug, NULL, PFS_RD);
pfs_create_link(dir, "exe", &procfs_doprocfile,
NULL, &procfs_notsystem, NULL, 0);
pfs_create_file(dir, "maps", &linprocfs_doprocmaps,
@@ -1425,6 +1484,8 @@ linprocfs_init(PFS_INIT_ARGS)
NULL, NULL, NULL, PFS_RD);
pfs_create_link(dir, "fd", &linprocfs_dofdescfs,
NULL, NULL, NULL, 0);
+ pfs_create_file(dir, "auxv", &linprocfs_doauxv,
+ NULL, &procfs_candebug, NULL, PFS_RD|PFS_RAWRD);
/* /proc/scsi/... */
dir = pfs_create_dir(root, "scsi", NULL, NULL, NULL, 0);
@@ -1470,7 +1531,11 @@ linprocfs_uninit(PFS_INIT_ARGS)
}
PSEUDOFS(linprocfs, 1, 0);
+#if defined(__amd64__)
+MODULE_DEPEND(linprocfs, linux_common, 1, 1, 1);
+#else
MODULE_DEPEND(linprocfs, linux, 1, 1, 1);
+#endif
MODULE_DEPEND(linprocfs, procfs, 1, 1, 1);
MODULE_DEPEND(linprocfs, sysvmsg, 1, 1, 1);
MODULE_DEPEND(linprocfs, sysvsem, 1, 1, 1);
diff --git a/sys/compat/linsysfs/linsysfs.c b/sys/compat/linsysfs/linsysfs.c
index 069e7ff..bc85ac3 100644
--- a/sys/compat/linsysfs/linsysfs.c
+++ b/sys/compat/linsysfs/linsysfs.c
@@ -62,12 +62,6 @@ __FBSDID("$FreeBSD$");
#include <machine/bus.h>
-#include "opt_compat.h"
-#ifdef COMPAT_LINUX32 /* XXX */
-#include <machine/../linux32/linux.h>
-#else
-#include <machine/../linux/linux.h>
-#endif
#include <compat/linux/linux_ioctl.h>
#include <compat/linux/linux_mib.h>
#include <compat/linux/linux_util.h>
@@ -282,4 +276,8 @@ linsysfs_uninit(PFS_INIT_ARGS)
}
PSEUDOFS(linsysfs, 1, 0);
+#if defined(__amd64__)
+MODULE_DEPEND(linsysfs, linux_common, 1, 1, 1);
+#else
MODULE_DEPEND(linsysfs, linux, 1, 1, 1);
+#endif
diff --git a/sys/compat/linux/check_error.d b/sys/compat/linux/check_error.d
index 9e3c00a..389e768 100644
--- a/sys/compat/linux/check_error.d
+++ b/sys/compat/linux/check_error.d
@@ -36,8 +36,8 @@
*/
linuxulator*:dummy::not_implemented,
-linuxulator*:emul:proc_exit:child_clear_tid_error,
-linuxulator*:emul:proc_exit:futex_failed,
+linuxulator*:emul:linux_thread_detach:child_clear_tid_error,
+linuxulator*:emul:linux_thread_detach:futex_failed,
linuxulator*:emul:linux_schedtail:copyout_error,
linuxulator*:futex:futex_get:error,
linuxulator*:futex:futex_sleep:requeue_error,
diff --git a/sys/compat/linux/check_internal_locks.d b/sys/compat/linux/check_internal_locks.d
index 2bdef68..b9d7c61 100644
--- a/sys/compat/linux/check_internal_locks.d
+++ b/sys/compat/linux/check_internal_locks.d
@@ -41,14 +41,9 @@
BEGIN
{
- check["emul_lock"] = 0;
- check["emul_shared_rlock"] = 0;
- check["emul_shared_wlock"] = 0;
check["futex_mtx"] = 0;
}
-linuxulator*:locks:emul_lock:locked,
-linuxulator*:locks:emul_shared_wlock:locked,
linuxulator*:locks:futex_mtx:locked
/check[probefunc] > 0/
{
@@ -57,9 +52,6 @@ linuxulator*:locks:futex_mtx:locked
stack();
}
-linuxulator*:locks:emul_lock:locked,
-linuxulator*:locks:emul_shared_rlock:locked,
-linuxulator*:locks:emul_shared_wlock:locked,
linuxulator*:locks:futex_mtx:locked
{
++check[probefunc];
@@ -69,9 +61,6 @@ linuxulator*:locks:futex_mtx:locked
spec[probefunc] = speculation();
}
-linuxulator*:locks:emul_lock:unlock,
-linuxulator*:locks:emul_shared_rlock:unlock,
-linuxulator*:locks:emul_shared_wlock:unlock,
linuxulator*:locks:futex_mtx:unlock
/check[probefunc] == 0/
{
@@ -82,9 +71,6 @@ linuxulator*:locks:futex_mtx:unlock
stack();
}
-linuxulator*:locks:emul_lock:unlock,
-linuxulator*:locks:emul_shared_rlock:unlock,
-linuxulator*:locks:emul_shared_wlock:unlock,
linuxulator*:locks:futex_mtx:unlock
{
discard(spec[probefunc]);
@@ -95,27 +81,6 @@ linuxulator*:locks:futex_mtx:unlock
/* Timeout handling */
tick-10s
-/spec["emul_lock"] != 0 && timestamp - ts["emul_lock"] >= 9999999000/
-{
- commit(spec["emul_lock"]);
- spec["emul_lock"] = 0;
-}
-
-tick-10s
-/spec["emul_shared_wlock"] != 0 && timestamp - ts["emul_shared_wlock"] >= 9999999000/
-{
- commit(spec["emul_shared_wlock"]);
- spec["emul_shared_wlock"] = 0;
-}
-
-tick-10s
-/spec["emul_shared_rlock"] != 0 && timestamp - ts["emul_shared_rlock"] >= 9999999000/
-{
- commit(spec["emul_shared_rlock"]);
- spec["emul_shared_rlock"] = 0;
-}
-
-tick-10s
/spec["futex_mtx"] != 0 && timestamp - ts["futex_mtx"] >= 9999999000/
{
commit(spec["futex_mtx"]);
diff --git a/sys/compat/linux/linux.c b/sys/compat/linux/linux.c
new file mode 100644
index 0000000..d1d7877
--- /dev/null
+++ b/sys/compat/linux/linux.c
@@ -0,0 +1,205 @@
+/*-
+ * Copyright (c) 2015 Dmitry Chagin
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/signalvar.h>
+
+#include <compat/linux/linux.h>
+
+
+static int bsd_to_linux_sigtbl[LINUX_SIGTBLSZ] = {
+ LINUX_SIGHUP, /* SIGHUP */
+ LINUX_SIGINT, /* SIGINT */
+ LINUX_SIGQUIT, /* SIGQUIT */
+ LINUX_SIGILL, /* SIGILL */
+ LINUX_SIGTRAP, /* SIGTRAP */
+ LINUX_SIGABRT, /* SIGABRT */
+ 0, /* SIGEMT */
+ LINUX_SIGFPE, /* SIGFPE */
+ LINUX_SIGKILL, /* SIGKILL */
+ LINUX_SIGBUS, /* SIGBUS */
+ LINUX_SIGSEGV, /* SIGSEGV */
+ LINUX_SIGSYS, /* SIGSYS */
+ LINUX_SIGPIPE, /* SIGPIPE */
+ LINUX_SIGALRM, /* SIGALRM */
+ LINUX_SIGTERM, /* SIGTERM */
+ LINUX_SIGURG, /* SIGURG */
+ LINUX_SIGSTOP, /* SIGSTOP */
+ LINUX_SIGTSTP, /* SIGTSTP */
+ LINUX_SIGCONT, /* SIGCONT */
+ LINUX_SIGCHLD, /* SIGCHLD */
+ LINUX_SIGTTIN, /* SIGTTIN */
+ LINUX_SIGTTOU, /* SIGTTOU */
+ LINUX_SIGIO, /* SIGIO */
+ LINUX_SIGXCPU, /* SIGXCPU */
+ LINUX_SIGXFSZ, /* SIGXFSZ */
+ LINUX_SIGVTALRM,/* SIGVTALRM */
+ LINUX_SIGPROF, /* SIGPROF */
+ LINUX_SIGWINCH, /* SIGWINCH */
+ 0, /* SIGINFO */
+ LINUX_SIGUSR1, /* SIGUSR1 */
+ LINUX_SIGUSR2 /* SIGUSR2 */
+};
+
+static int linux_to_bsd_sigtbl[LINUX_SIGTBLSZ] = {
+ SIGHUP, /* LINUX_SIGHUP */
+ SIGINT, /* LINUX_SIGINT */
+ SIGQUIT, /* LINUX_SIGQUIT */
+ SIGILL, /* LINUX_SIGILL */
+ SIGTRAP, /* LINUX_SIGTRAP */
+ SIGABRT, /* LINUX_SIGABRT */
+ SIGBUS, /* LINUX_SIGBUS */
+ SIGFPE, /* LINUX_SIGFPE */
+ SIGKILL, /* LINUX_SIGKILL */
+ SIGUSR1, /* LINUX_SIGUSR1 */
+ SIGSEGV, /* LINUX_SIGSEGV */
+ SIGUSR2, /* LINUX_SIGUSR2 */
+ SIGPIPE, /* LINUX_SIGPIPE */
+ SIGALRM, /* LINUX_SIGALRM */
+ SIGTERM, /* LINUX_SIGTERM */
+ SIGBUS, /* LINUX_SIGSTKFLT */
+ SIGCHLD, /* LINUX_SIGCHLD */
+ SIGCONT, /* LINUX_SIGCONT */
+ SIGSTOP, /* LINUX_SIGSTOP */
+ SIGTSTP, /* LINUX_SIGTSTP */
+ SIGTTIN, /* LINUX_SIGTTIN */
+ SIGTTOU, /* LINUX_SIGTTOU */
+ SIGURG, /* LINUX_SIGURG */
+ SIGXCPU, /* LINUX_SIGXCPU */
+ SIGXFSZ, /* LINUX_SIGXFSZ */
+ SIGVTALRM, /* LINUX_SIGVTALARM */
+ SIGPROF, /* LINUX_SIGPROF */
+ SIGWINCH, /* LINUX_SIGWINCH */
+ SIGIO, /* LINUX_SIGIO */
+ /*
+ * FreeBSD does not have SIGPWR signal, map Linux SIGPWR signal
+ * to the first unused FreeBSD signal number. Since Linux supports
+ * signals from 1 to 64 we are ok here as our SIGRTMIN = 65.
+ */
+ SIGRTMIN, /* LINUX_SIGPWR */
+ SIGSYS /* LINUX_SIGSYS */
+};
+
+/*
+ * Map Linux RT signals to the FreeBSD RT signals.
+ */
+static inline int
+linux_to_bsd_rt_signal(int sig)
+{
+
+ return (SIGRTMIN + 1 + sig - LINUX_SIGRTMIN);
+}
+
+static inline int
+bsd_to_linux_rt_signal(int sig)
+{
+
+ return (sig - SIGRTMIN - 1 + LINUX_SIGRTMIN);
+}
+
+int
+linux_to_bsd_signal(int sig)
+{
+
+ KASSERT(sig > 0 && sig <= LINUX_SIGRTMAX, ("Invalid Linux signal\n"));
+
+ if (sig < LINUX_SIGRTMIN)
+ return (linux_to_bsd_sigtbl[_SIG_IDX(sig)]);
+
+ return (linux_to_bsd_rt_signal(sig));
+}
+
+int
+bsd_to_linux_signal(int sig)
+{
+
+ if (sig <= LINUX_SIGTBLSZ)
+ return (bsd_to_linux_sigtbl[_SIG_IDX(sig)]);
+ if (sig == SIGRTMIN)
+ return (LINUX_SIGPWR);
+
+ return (bsd_to_linux_rt_signal(sig));
+}
+
+int
+linux_to_bsd_sigaltstack(int lsa)
+{
+ int bsa = 0;
+
+ if (lsa & LINUX_SS_DISABLE)
+ bsa |= SS_DISABLE;
+ /*
+ * Linux ignores SS_ONSTACK flag for ss
+ * parameter while FreeBSD prohibits it.
+ */
+ return (bsa);
+}
+
+int
+bsd_to_linux_sigaltstack(int bsa)
+{
+ int lsa = 0;
+
+ if (bsa & SS_DISABLE)
+ lsa |= LINUX_SS_DISABLE;
+ if (bsa & SS_ONSTACK)
+ lsa |= LINUX_SS_ONSTACK;
+ return (lsa);
+}
+
+void
+linux_to_bsd_sigset(l_sigset_t *lss, sigset_t *bss)
+{
+ int b, l;
+
+ SIGEMPTYSET(*bss);
+ for (l = 1; l <= LINUX_SIGRTMAX; l++) {
+ if (LINUX_SIGISMEMBER(*lss, l)) {
+ b = linux_to_bsd_signal(l);
+ if (b)
+ SIGADDSET(*bss, b);
+ }
+ }
+}
+
+void
+bsd_to_linux_sigset(sigset_t *bss, l_sigset_t *lss)
+{
+ int b, l;
+
+ LINUX_SIGEMPTYSET(*lss);
+ for (b = 1; b <= SIGRTMAX; b++) {
+ if (SIGISMEMBER(*bss, b)) {
+ l = bsd_to_linux_signal(b);
+ if (l)
+ LINUX_SIGADDSET(*lss, l);
+ }
+ }
+}
diff --git a/sys/compat/linux/linux.h b/sys/compat/linux/linux.h
new file mode 100644
index 0000000..974440f
--- /dev/null
+++ b/sys/compat/linux/linux.h
@@ -0,0 +1,95 @@
+/*-
+ * Copyright (c) 2015 Dmitry Chagin
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _LINUX_MI_H_
+#define _LINUX_MI_H_
+
+/* sigaltstack */
+#define LINUX_SS_ONSTACK 1
+#define LINUX_SS_DISABLE 2
+
+int linux_to_bsd_sigaltstack(int lsa);
+int bsd_to_linux_sigaltstack(int bsa);
+
+/* sigset */
+typedef struct {
+ uint64_t __mask;
+} l_sigset_t;
+
+/* primitives to manipulate sigset_t */
+#define LINUX_SIGEMPTYSET(set) (set).__mask = 0
+#define LINUX_SIGISMEMBER(set, sig) (1UL & ((set).__mask >> _SIG_IDX(sig)))
+#define LINUX_SIGADDSET(set, sig) (set).__mask |= 1UL << _SIG_IDX(sig)
+
+void linux_to_bsd_sigset(l_sigset_t *, sigset_t *);
+void bsd_to_linux_sigset(sigset_t *, l_sigset_t *);
+
+/* signaling */
+#define LINUX_SIGHUP 1
+#define LINUX_SIGINT 2
+#define LINUX_SIGQUIT 3
+#define LINUX_SIGILL 4
+#define LINUX_SIGTRAP 5
+#define LINUX_SIGABRT 6
+#define LINUX_SIGIOT LINUX_SIGABRT
+#define LINUX_SIGBUS 7
+#define LINUX_SIGFPE 8
+#define LINUX_SIGKILL 9
+#define LINUX_SIGUSR1 10
+#define LINUX_SIGSEGV 11
+#define LINUX_SIGUSR2 12
+#define LINUX_SIGPIPE 13
+#define LINUX_SIGALRM 14
+#define LINUX_SIGTERM 15
+#define LINUX_SIGSTKFLT 16
+#define LINUX_SIGCHLD 17
+#define LINUX_SIGCONT 18
+#define LINUX_SIGSTOP 19
+#define LINUX_SIGTSTP 20
+#define LINUX_SIGTTIN 21
+#define LINUX_SIGTTOU 22
+#define LINUX_SIGURG 23
+#define LINUX_SIGXCPU 24
+#define LINUX_SIGXFSZ 25
+#define LINUX_SIGVTALRM 26
+#define LINUX_SIGPROF 27
+#define LINUX_SIGWINCH 28
+#define LINUX_SIGIO 29
+#define LINUX_SIGPOLL LINUX_SIGIO
+#define LINUX_SIGPWR 30
+#define LINUX_SIGSYS 31
+#define LINUX_SIGTBLSZ 31
+#define LINUX_SIGRTMIN 32
+#define LINUX_SIGRTMAX 64
+
+#define LINUX_SIG_VALID(sig) ((sig) <= LINUX_SIGRTMAX && (sig) > 0)
+
+int linux_to_bsd_signal(int sig);
+int bsd_to_linux_signal(int sig);
+
+#endif /* _LINUX_MI_H_ */
diff --git a/sys/compat/linux/linux_common.c b/sys/compat/linux/linux_common.c
new file mode 100644
index 0000000..b9e3531
--- /dev/null
+++ b/sys/compat/linux/linux_common.c
@@ -0,0 +1,93 @@
+/*-
+ * Copyright (c) 2014 Vassilis Laganakos
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/exec.h>
+#include <sys/imgact.h>
+#include <sys/imgact_elf.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/eventhandler.h>
+#include <sys/sysctl.h>
+
+#include <compat/linux/linux_emul.h>
+#include <compat/linux/linux_mib.h>
+#include <compat/linux/linux_util.h>
+
+FEATURE(linuxulator_v4l, "V4L ioctl wrapper support in the linuxulator");
+FEATURE(linuxulator_v4l2, "V4L2 ioctl wrapper support in the linuxulator");
+
+MODULE_VERSION(linux_common, 1);
+
+SET_DECLARE(linux_device_handler_set, struct linux_device_handler);
+
+static eventhandler_tag linux_exec_tag;
+static eventhandler_tag linux_thread_dtor_tag;
+static eventhandler_tag linux_exit_tag;
+
+
+static int
+linux_common_modevent(module_t mod, int type, void *data)
+{
+ struct linux_device_handler **ldhp;
+
+ switch(type) {
+ case MOD_LOAD:
+ linux_osd_jail_register();
+ linux_exit_tag = EVENTHANDLER_REGISTER(process_exit,
+ linux_proc_exit, NULL, 1000);
+ linux_exec_tag = EVENTHANDLER_REGISTER(process_exec,
+ linux_proc_exec, NULL, 1000);
+ linux_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor,
+ linux_thread_dtor, NULL, EVENTHANDLER_PRI_ANY);
+ SET_FOREACH(ldhp, linux_device_handler_set)
+ linux_device_register_handler(*ldhp);
+ break;
+ case MOD_UNLOAD:
+ linux_osd_jail_deregister();
+ SET_FOREACH(ldhp, linux_device_handler_set)
+ linux_device_unregister_handler(*ldhp);
+ EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag);
+ EVENTHANDLER_DEREGISTER(process_exec, linux_exec_tag);
+ EVENTHANDLER_DEREGISTER(thread_dtor, linux_thread_dtor_tag);
+ break;
+ default:
+ return (EOPNOTSUPP);
+ }
+ return (0);
+}
+
+static moduledata_t linux_common_mod = {
+ "linuxcommon",
+ linux_common_modevent,
+ 0
+};
+
+DECLARE_MODULE(linuxcommon, linux_common_mod, SI_SUB_EXEC, SI_ORDER_ANY);
diff --git a/sys/compat/linux/linux_emul.c b/sys/compat/linux/linux_emul.c
index ec19cd9..c2bf3ae 100644
--- a/sys/compat/linux/linux_emul.c
+++ b/sys/compat/linux/linux_emul.c
@@ -1,5 +1,6 @@
/*-
* Copyright (c) 2006 Roman Divacky
+ * Copyright (c) 2013 Dmitry Chagin
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,363 +30,235 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include "opt_compat.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/imgact.h>
#include <sys/kernel.h>
+#include <sys/ktr.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mutex.h>
-#include <sys/sdt.h>
#include <sys/sx.h>
#include <sys/proc.h>
#include <sys/syscallsubr.h>
#include <sys/sysent.h>
-#include <sys/sysproto.h>
-#include <sys/unistd.h>
-
-#ifdef COMPAT_LINUX32
-#include <machine/../linux32/linux.h>
-#include <machine/../linux32/linux32_proto.h>
-#else
-#include <machine/../linux/linux.h>
-#include <machine/../linux/linux_proto.h>
-#endif
-
-#include <compat/linux/linux_dtrace.h>
+
#include <compat/linux/linux_emul.h>
-#include <compat/linux/linux_futex.h>
#include <compat/linux/linux_misc.h>
+#include <compat/linux/linux_util.h>
-/**
- * Special DTrace provider for the linuxulator.
- *
- * In this file we define the provider for the entire linuxulator. All
- * modules (= files of the linuxulator) use it.
- *
- * We define a different name depending on the emulated bitsize, see
- * ../../<ARCH>/linux{,32}/linux.h, e.g.:
- * native bitsize = linuxulator
- * amd64, 32bit emulation = linuxulator32
- */
-LIN_SDT_PROVIDER_DEFINE(LINUX_DTRACE);
-/**
- * Special DTrace module "locks", it covers some linuxulator internal
- * locks.
- */
-LIN_SDT_PROBE_DEFINE1(locks, emul_lock, locked, "struct mtx *");
-LIN_SDT_PROBE_DEFINE1(locks, emul_lock, unlock, "struct mtx *");
-LIN_SDT_PROBE_DEFINE1(locks, emul_shared_rlock, locked, "struct sx *");
-LIN_SDT_PROBE_DEFINE1(locks, emul_shared_rlock, unlock, "struct sx *");
-LIN_SDT_PROBE_DEFINE1(locks, emul_shared_wlock, locked, "struct sx *");
-LIN_SDT_PROBE_DEFINE1(locks, emul_shared_wlock, unlock, "struct sx *");
-
-/**
- * DTrace probes in this module.
+/*
+ * This returns reference to the thread emuldata entry (if found)
+ *
+ * Hold PROC_LOCK when referencing emuldata from other threads.
*/
-LIN_SDT_PROBE_DEFINE2(emul, em_find, entry, "struct proc *", "int");
-LIN_SDT_PROBE_DEFINE0(emul, em_find, return);
-LIN_SDT_PROBE_DEFINE3(emul, proc_init, entry, "struct thread *", "pid_t",
- "int");
-LIN_SDT_PROBE_DEFINE0(emul, proc_init, create_thread);
-LIN_SDT_PROBE_DEFINE0(emul, proc_init, fork);
-LIN_SDT_PROBE_DEFINE0(emul, proc_init, exec);
-LIN_SDT_PROBE_DEFINE0(emul, proc_init, return);
-LIN_SDT_PROBE_DEFINE1(emul, proc_exit, entry, "struct proc *");
-LIN_SDT_PROBE_DEFINE0(emul, proc_exit, futex_failed);
-LIN_SDT_PROBE_DEFINE3(emul, proc_exit, reparent, "pid_t", "pid_t",
- "struct proc *");
-LIN_SDT_PROBE_DEFINE1(emul, proc_exit, child_clear_tid_error, "int");
-LIN_SDT_PROBE_DEFINE0(emul, proc_exit, return);
-LIN_SDT_PROBE_DEFINE2(emul, proc_exec, entry, "struct proc *",
- "struct image_params *");
-LIN_SDT_PROBE_DEFINE0(emul, proc_exec, return);
-LIN_SDT_PROBE_DEFINE0(emul, linux_schedtail, entry);
-LIN_SDT_PROBE_DEFINE1(emul, linux_schedtail, copyout_error, "int");
-LIN_SDT_PROBE_DEFINE0(emul, linux_schedtail, return);
-LIN_SDT_PROBE_DEFINE1(emul, linux_set_tid_address, entry, "int *");
-LIN_SDT_PROBE_DEFINE0(emul, linux_set_tid_address, return);
-LIN_SDT_PROBE_DEFINE2(emul, linux_kill_threads, entry, "struct thread *",
- "int");
-LIN_SDT_PROBE_DEFINE1(emul, linux_kill_threads, kill, "pid_t");
-LIN_SDT_PROBE_DEFINE0(emul, linux_kill_threads, return);
-
-struct sx emul_shared_lock;
-struct mtx emul_lock;
-
-/* this returns locked reference to the emuldata entry (if found) */
struct linux_emuldata *
-em_find(struct proc *p, int locked)
+em_find(struct thread *td)
{
struct linux_emuldata *em;
- LIN_SDT_PROBE2(emul, em_find, entry, p, locked);
+ em = td->td_emuldata;
- if (locked == EMUL_DOLOCK)
- EMUL_LOCK(&emul_lock);
+ return (em);
+}
- em = p->p_emuldata;
+/*
+ * This returns reference to the proc pemuldata entry (if found)
+ *
+ * Hold PROC_LOCK when referencing proc pemuldata from other threads.
+ * Hold LINUX_PEM_LOCK wher referencing pemuldata members.
+ */
+struct linux_pemuldata *
+pem_find(struct proc *p)
+{
+ struct linux_pemuldata *pem;
- if (em == NULL && locked == EMUL_DOLOCK)
- EMUL_UNLOCK(&emul_lock);
+ pem = p->p_emuldata;
- LIN_SDT_PROBE1(emul, em_find, return, em);
- return (em);
+ return (pem);
}
-int
-linux_proc_init(struct thread *td, pid_t child, int flags)
+void
+linux_proc_init(struct thread *td, struct thread *newtd, int flags)
{
- struct linux_emuldata *em, *p_em;
+ struct linux_emuldata *em;
+ struct linux_pemuldata *pem;
+ struct epoll_emuldata *emd;
struct proc *p;
- LIN_SDT_PROBE3(emul, proc_init, entry, td, child, flags);
+ if (newtd != NULL) {
+ p = newtd->td_proc;
- if (child != 0) {
- /* fork or create a thread */
- em = malloc(sizeof *em, M_LINUX, M_WAITOK | M_ZERO);
- em->pid = child;
- em->pdeath_signal = 0;
- em->flags = 0;
- em->robust_futexes = NULL;
+ /* non-exec call */
+ em = malloc(sizeof(*em), M_TEMP, M_WAITOK | M_ZERO);
if (flags & LINUX_CLONE_THREAD) {
- /* handled later in the code */
- LIN_SDT_PROBE0(emul, proc_init, create_thread);
- } else {
- struct linux_emuldata_shared *s;
+ LINUX_CTR1(proc_init, "thread newtd(%d)",
+ newtd->td_tid);
- LIN_SDT_PROBE0(emul, proc_init, fork);
+ em->em_tid = newtd->td_tid;
+ } else {
+ LINUX_CTR1(proc_init, "fork newtd(%d)", p->p_pid);
- s = malloc(sizeof *s, M_LINUX, M_WAITOK | M_ZERO);
- s->refs = 1;
- s->group_pid = child;
+ em->em_tid = p->p_pid;
- LIST_INIT(&s->threads);
- em->shared = s;
+ pem = malloc(sizeof(*pem), M_LINUX, M_WAITOK | M_ZERO);
+ sx_init(&pem->pem_sx, "lpemlk");
+ p->p_emuldata = pem;
}
+ newtd->td_emuldata = em;
} else {
+ p = td->td_proc;
+
/* exec */
- LIN_SDT_PROBE0(emul, proc_init, exec);
+ LINUX_CTR1(proc_init, "exec newtd(%d)", p->p_pid);
/* lookup the old one */
- em = em_find(td->td_proc, EMUL_DOLOCK);
+ em = em_find(td);
KASSERT(em != NULL, ("proc_init: emuldata not found in exec case.\n"));
- }
-
- em->child_clear_tid = NULL;
- em->child_set_tid = NULL;
- /*
- * allocate the shared struct only in clone()/fork cases in the case
- * of clone() td = calling proc and child = pid of the newly created
- * proc
- */
- if (child != 0) {
- if (flags & LINUX_CLONE_THREAD) {
- /* lookup the parent */
- /*
- * we dont have to lock the p_em because
- * its waiting for us in linux_clone so
- * there is no chance of it changing the
- * p_em->shared address
- */
- p_em = em_find(td->td_proc, EMUL_DONTLOCK);
- KASSERT(p_em != NULL, ("proc_init: parent emuldata not found for CLONE_THREAD\n"));
- em->shared = p_em->shared;
- EMUL_SHARED_WLOCK(&emul_shared_lock);
- em->shared->refs++;
- EMUL_SHARED_WUNLOCK(&emul_shared_lock);
- } else {
- /*
- * handled earlier to avoid malloc(M_WAITOK) with
- * rwlock held
- */
- }
+ em->em_tid = p->p_pid;
+ em->flags = 0;
+ em->pdeath_signal = 0;
+ em->robust_futexes = NULL;
+ em->child_clear_tid = NULL;
+ em->child_set_tid = NULL;
- EMUL_SHARED_WLOCK(&emul_shared_lock);
- LIST_INSERT_HEAD(&em->shared->threads, em, threads);
- EMUL_SHARED_WUNLOCK(&emul_shared_lock);
+ /* epoll should be destroyed in a case of exec. */
+ pem = pem_find(p);
+ KASSERT(pem != NULL, ("proc_exit: proc emuldata not found.\n"));
- p = pfind(child);
- KASSERT(p != NULL, ("process not found in proc_init\n"));
- p->p_emuldata = em;
- PROC_UNLOCK(p);
- } else
- EMUL_UNLOCK(&emul_lock);
+ if (pem->epoll != NULL) {
+ emd = pem->epoll;
+ pem->epoll = NULL;
+ free(emd, M_EPOLL);
+ }
+ }
- LIN_SDT_PROBE0(emul, proc_init, return);
- return (0);
}
-void
+void
linux_proc_exit(void *arg __unused, struct proc *p)
{
- struct linux_emuldata *em;
- int error, shared_flags, shared_xstat;
- struct thread *td = FIRST_THREAD_IN_PROC(p);
- int *child_clear_tid;
- struct proc *q, *nq;
+ struct linux_pemuldata *pem;
+ struct epoll_emuldata *emd;
+ struct thread *td = curthread;
- if (__predict_true(p->p_sysent != &elf_linux_sysvec))
+ if (__predict_false(SV_CURPROC_ABI() != SV_ABI_LINUX))
return;
- LIN_SDT_PROBE1(emul, proc_exit, entry, p);
-
- release_futexes(p);
+ LINUX_CTR3(proc_exit, "thread(%d) proc(%d) p %p",
+ td->td_tid, p->p_pid, p);
- /* find the emuldata */
- em = em_find(p, EMUL_DOLOCK);
+ pem = pem_find(p);
+ if (pem == NULL)
+ return;
+ (p->p_sysent->sv_thread_detach)(td);
- KASSERT(em != NULL, ("proc_exit: emuldata not found.\n"));
+ p->p_emuldata = NULL;
- /* reparent all procs that are not a thread leader to initproc */
- if (em->shared->group_pid != p->p_pid) {
- LIN_SDT_PROBE3(emul, proc_exit, reparent,
- em->shared->group_pid, p->p_pid, p);
-
- child_clear_tid = em->child_clear_tid;
- EMUL_UNLOCK(&emul_lock);
- sx_xlock(&proctree_lock);
- wakeup(initproc);
- PROC_LOCK(p);
- proc_reparent(p, initproc);
- p->p_sigparent = SIGCHLD;
- PROC_UNLOCK(p);
- sx_xunlock(&proctree_lock);
- } else {
- child_clear_tid = em->child_clear_tid;
- EMUL_UNLOCK(&emul_lock);
+ if (pem->epoll != NULL) {
+ emd = pem->epoll;
+ pem->epoll = NULL;
+ free(emd, M_EPOLL);
}
- EMUL_SHARED_WLOCK(&emul_shared_lock);
- shared_flags = em->shared->flags;
- shared_xstat = em->shared->xstat;
- LIST_REMOVE(em, threads);
+ sx_destroy(&pem->pem_sx);
+ free(pem, M_LINUX);
+}
- em->shared->refs--;
- if (em->shared->refs == 0) {
- EMUL_SHARED_WUNLOCK(&emul_shared_lock);
- free(em->shared, M_LINUX);
- } else
- EMUL_SHARED_WUNLOCK(&emul_shared_lock);
+int
+linux_common_execve(struct thread *td, struct image_args *eargs)
+{
+ struct linux_pemuldata *pem;
+ struct epoll_emuldata *emd;
+ struct vmspace *oldvmspace;
+ struct linux_emuldata *em;
+ struct proc *p;
+ int error;
- if ((shared_flags & EMUL_SHARED_HASXSTAT) != 0)
- p->p_xstat = shared_xstat;
+ p = td->td_proc;
- if (child_clear_tid != NULL) {
- struct linux_sys_futex_args cup;
- int null = 0;
+ error = pre_execve(td, &oldvmspace);
+ if (error != 0)
+ return (error);
- error = copyout(&null, child_clear_tid, sizeof(null));
- if (error) {
- LIN_SDT_PROBE1(emul, proc_exit,
- child_clear_tid_error, error);
+ error = kern_execve(td, eargs, NULL);
+ post_execve(td, error, oldvmspace);
+ if (error != 0)
+ return (error);
- free(em, M_LINUX);
+ /*
+ * In a case of transition from Linux binary execing to
+ * FreeBSD binary we destroy linux emuldata thread & proc entries.
+ */
+ if (SV_CURPROC_ABI() != SV_ABI_LINUX) {
+ PROC_LOCK(p);
+ em = em_find(td);
+ KASSERT(em != NULL, ("proc_exec: thread emuldata not found.\n"));
+ td->td_emuldata = NULL;
- LIN_SDT_PROBE0(emul, proc_exit, return);
- return;
- }
+ pem = pem_find(p);
+ KASSERT(pem != NULL, ("proc_exec: proc pemuldata not found.\n"));
+ p->p_emuldata = NULL;
+ PROC_UNLOCK(p);
- /* futexes stuff */
- cup.uaddr = child_clear_tid;
- cup.op = LINUX_FUTEX_WAKE;
- cup.val = 0x7fffffff; /* Awake everyone */
- cup.timeout = NULL;
- cup.uaddr2 = NULL;
- cup.val3 = 0;
- error = linux_sys_futex(FIRST_THREAD_IN_PROC(p), &cup);
- /*
- * this cannot happen at the moment and if this happens it
- * probably means there is a user space bug
- */
- if (error) {
- LIN_SDT_PROBE0(emul, proc_exit, futex_failed);
- printf(LMSG("futex stuff in proc_exit failed.\n"));
+ if (pem->epoll != NULL) {
+ emd = pem->epoll;
+ pem->epoll = NULL;
+ free(emd, M_EPOLL);
}
- }
- /* clean the stuff up */
- free(em, M_LINUX);
-
- /* this is a little weird but rewritten from exit1() */
- sx_xlock(&proctree_lock);
- q = LIST_FIRST(&p->p_children);
- for (; q != NULL; q = nq) {
- nq = LIST_NEXT(q, p_sibling);
- if (q->p_flag & P_WEXIT)
- continue;
- if (__predict_false(q->p_sysent != &elf_linux_sysvec))
- continue;
- em = em_find(q, EMUL_DOLOCK);
- KASSERT(em != NULL, ("linux_reparent: emuldata not found: %i\n", q->p_pid));
- PROC_LOCK(q);
- if ((q->p_flag & P_WEXIT) == 0 && em->pdeath_signal != 0) {
- kern_psignal(q, em->pdeath_signal);
- }
- PROC_UNLOCK(q);
- EMUL_UNLOCK(&emul_lock);
+ free(em, M_TEMP);
+ free(pem, M_LINUX);
}
- sx_xunlock(&proctree_lock);
-
- LIN_SDT_PROBE0(emul, proc_exit, return);
+ return (0);
}
-/*
- * This is used in a case of transition from FreeBSD binary execing to linux binary
- * in this case we create linux emuldata proc entry with the pid of the currently running
- * process.
- */
void
linux_proc_exec(void *arg __unused, struct proc *p, struct image_params *imgp)
{
- if (__predict_false(imgp->sysent == &elf_linux_sysvec)) {
- LIN_SDT_PROBE2(emul, proc_exec, entry, p, imgp);
- }
- if (__predict_false(imgp->sysent == &elf_linux_sysvec
- && p->p_sysent != &elf_linux_sysvec))
- linux_proc_init(FIRST_THREAD_IN_PROC(p), p->p_pid, 0);
- if (__predict_false((p->p_sysent->sv_flags & SV_ABI_MASK) ==
- SV_ABI_LINUX))
- /* Kill threads regardless of imgp->sysent value */
- linux_kill_threads(FIRST_THREAD_IN_PROC(p), SIGKILL);
- if (__predict_false(imgp->sysent != &elf_linux_sysvec
- && p->p_sysent == &elf_linux_sysvec)) {
- struct linux_emuldata *em;
-
- /*
- * XXX:There's a race because here we assign p->p_emuldata NULL
- * but the process is still counted as linux one for a short
- * time so some other process might reference it and try to
- * access its p->p_emuldata and panicing on a NULL reference.
- */
- em = em_find(p, EMUL_DONTLOCK);
-
- KASSERT(em != NULL, ("proc_exec: emuldata not found.\n"));
-
- EMUL_SHARED_WLOCK(&emul_shared_lock);
- LIST_REMOVE(em, threads);
+ struct thread *td = curthread;
+ struct thread *othertd;
- PROC_LOCK(p);
- p->p_emuldata = NULL;
- PROC_UNLOCK(p);
+ /*
+ * In a case of execing from linux binary properly detach
+ * other threads from the user space.
+ */
+ if (__predict_false(SV_PROC_ABI(p) == SV_ABI_LINUX)) {
+ FOREACH_THREAD_IN_PROC(p, othertd) {
+ if (td != othertd)
+ (p->p_sysent->sv_thread_detach)(othertd);
+ }
+ }
- em->shared->refs--;
- if (em->shared->refs == 0) {
- EMUL_SHARED_WUNLOCK(&emul_shared_lock);
- free(em->shared, M_LINUX);
- } else
- EMUL_SHARED_WUNLOCK(&emul_shared_lock);
+ /*
+ * In a case of execing to linux binary we create linux
+ * emuldata thread entry.
+ */
+ if (__predict_false((imgp->sysent->sv_flags & SV_ABI_MASK) ==
+ SV_ABI_LINUX)) {
- free(em, M_LINUX);
+ if (SV_PROC_ABI(p) == SV_ABI_LINUX)
+ linux_proc_init(td, NULL, 0);
+ else
+ linux_proc_init(td, td, 0);
}
+}
- if (__predict_false(imgp->sysent == &elf_linux_sysvec)) {
- LIN_SDT_PROBE0(emul, proc_exec, return);
- }
+void
+linux_thread_dtor(void *arg __unused, struct thread *td)
+{
+ struct linux_emuldata *em;
+
+ em = em_find(td);
+ if (em == NULL)
+ return;
+ td->td_emuldata = NULL;
+
+ LINUX_CTR1(thread_dtor, "thread(%d)", em->em_tid);
+
+ free(em, M_TEMP);
}
void
@@ -398,76 +271,15 @@ linux_schedtail(struct thread *td)
p = td->td_proc;
- LIN_SDT_PROBE1(emul, linux_schedtail, entry, p);
-
- /* find the emuldata */
- em = em_find(p, EMUL_DOLOCK);
-
- KASSERT(em != NULL, ("linux_schedtail: emuldata not found.\n"));
+ em = em_find(td);
+ KASSERT(em != NULL, ("linux_schedtail: thread emuldata not found.\n"));
child_set_tid = em->child_set_tid;
- EMUL_UNLOCK(&emul_lock);
if (child_set_tid != NULL) {
- error = copyout(&p->p_pid, (int *)child_set_tid,
- sizeof(p->p_pid));
-
- if (error != 0) {
- LIN_SDT_PROBE1(emul, linux_schedtail, copyout_error,
- error);
- }
- }
-
- LIN_SDT_PROBE0(emul, linux_schedtail, return);
-
- return;
-}
-
-int
-linux_set_tid_address(struct thread *td, struct linux_set_tid_address_args *args)
-{
- struct linux_emuldata *em;
-
- LIN_SDT_PROBE1(emul, linux_set_tid_address, entry, args->tidptr);
-
- /* find the emuldata */
- em = em_find(td->td_proc, EMUL_DOLOCK);
-
- KASSERT(em != NULL, ("set_tid_address: emuldata not found.\n"));
-
- em->child_clear_tid = args->tidptr;
- td->td_retval[0] = td->td_proc->p_pid;
-
- EMUL_UNLOCK(&emul_lock);
-
- LIN_SDT_PROBE0(emul, linux_set_tid_address, return);
- return 0;
-}
-
-void
-linux_kill_threads(struct thread *td, int sig)
-{
- struct linux_emuldata *em, *td_em, *tmp_em;
- struct proc *sp;
-
- LIN_SDT_PROBE2(emul, linux_kill_threads, entry, td, sig);
-
- td_em = em_find(td->td_proc, EMUL_DONTLOCK);
-
- KASSERT(td_em != NULL, ("linux_kill_threads: emuldata not found.\n"));
-
- EMUL_SHARED_RLOCK(&emul_shared_lock);
- LIST_FOREACH_SAFE(em, &td_em->shared->threads, threads, tmp_em) {
- if (em->pid == td_em->pid)
- continue;
-
- sp = pfind(em->pid);
- if ((sp->p_flag & P_WEXIT) == 0)
- kern_psignal(sp, sig);
- PROC_UNLOCK(sp);
-
- LIN_SDT_PROBE1(emul, linux_kill_threads, kill, em->pid);
- }
- EMUL_SHARED_RUNLOCK(&emul_shared_lock);
-
- LIN_SDT_PROBE0(emul, linux_kill_threads, return);
+ error = copyout(&em->em_tid, child_set_tid,
+ sizeof(em->em_tid));
+ LINUX_CTR4(schedtail, "thread(%d) %p stored %d error %d",
+ td->td_tid, child_set_tid, em->em_tid, error);
+ } else
+ LINUX_CTR1(schedtail, "thread(%d)", em->em_tid);
}
diff --git a/sys/compat/linux/linux_emul.h b/sys/compat/linux/linux_emul.h
index f409a34..7262093 100644
--- a/sys/compat/linux/linux_emul.h
+++ b/sys/compat/linux/linux_emul.h
@@ -1,5 +1,6 @@
/*-
* Copyright (c) 2006 Roman Divacky
+ * Copyright (c) 2013 Dmitry Chagin
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -31,91 +32,48 @@
#ifndef _LINUX_EMUL_H_
#define _LINUX_EMUL_H_
-#define EMUL_SHARED_HASXSTAT 0x01
-
-struct linux_emuldata_shared {
- int refs;
- int flags;
- int xstat;
- pid_t group_pid;
-
- LIST_HEAD(, linux_emuldata) threads; /* head of list of linux threads */
-};
-
/*
* modeled after similar structure in NetBSD
* this will be extended as we need more functionality
*/
struct linux_emuldata {
- pid_t pid;
-
int *child_set_tid; /* in clone(): Child's TID to set on clone */
int *child_clear_tid;/* in clone(): Child's TID to clear on exit */
- struct linux_emuldata_shared *shared;
-
int pdeath_signal; /* parent death signal */
- int flags; /* different emuldata flags */
+ int flags; /* thread emuldata flags */
+ int em_tid; /* thread id */
struct linux_robust_list_head *robust_futexes;
-
- LIST_ENTRY(linux_emuldata) threads; /* list of linux threads */
};
-struct linux_emuldata *em_find(struct proc *, int locked);
-
-/*
- * DTrace probes for locks should be fired after locking and before releasing
- * to prevent races (to provide data/function stability in dtrace, see the
- * output of "dtrace -v ..." and the corresponding dtrace docs).
- */
-#define EMUL_LOCK(l) do { \
- mtx_lock(l); \
- LIN_SDT_PROBE1(locks, emul_lock, \
- locked, l); \
- } while (0)
-#define EMUL_UNLOCK(l) do { \
- LIN_SDT_PROBE1(locks, emul_lock, \
- unlock, l); \
- mtx_unlock(l); \
- } while (0)
+struct linux_emuldata *em_find(struct thread *);
-#define EMUL_SHARED_RLOCK(l) do { \
- sx_slock(l); \
- LIN_SDT_PROBE1(locks, emul_shared_rlock, \
- locked, l); \
- } while (0)
-#define EMUL_SHARED_RUNLOCK(l) do { \
- LIN_SDT_PROBE1(locks, emul_shared_rlock, \
- unlock, l); \
- sx_sunlock(l); \
- } while (0)
-#define EMUL_SHARED_WLOCK(l) do { \
- sx_xlock(l); \
- LIN_SDT_PROBE1(locks, emul_shared_wlock, \
- locked, l); \
- } while (0)
-#define EMUL_SHARED_WUNLOCK(l) do { \
- LIN_SDT_PROBE1(locks, emul_shared_wlock, \
- unlock, l); \
- sx_xunlock(l); \
- } while (0)
-
-/* for em_find use */
-#define EMUL_DOLOCK 1
-#define EMUL_DONTLOCK 0
+void linux_proc_init(struct thread *, struct thread *, int);
+void linux_proc_exit(void *, struct proc *);
+void linux_schedtail(struct thread *);
+void linux_proc_exec(void *, struct proc *, struct image_params *);
+void linux_thread_dtor(void *arg __unused, struct thread *);
+void linux_thread_detach(struct thread *);
+int linux_common_execve(struct thread *, struct image_args *);
-/* emuldata flags */
+/* process emuldata flags */
#define LINUX_XDEPR_REQUEUEOP 0x00000001 /* uses deprecated
futex REQUEUE op*/
+#define LINUX_XUNSUP_EPOLL 0x00000002 /* unsupported epoll events */
+#define LINUX_XUNSUP_FUTEXPIOP 0x00000004 /* uses unsupported pi futex */
-int linux_proc_init(struct thread *, pid_t, int);
-void linux_proc_exit(void *, struct proc *);
-void linux_schedtail(struct thread *);
-void linux_proc_exec(void *, struct proc *, struct image_params *);
-void linux_kill_threads(struct thread *, int);
+struct linux_pemuldata {
+ uint32_t flags; /* process emuldata flags */
+ struct sx pem_sx; /* lock for this struct */
+ void *epoll; /* epoll data */
+};
+
+#define LINUX_PEM_XLOCK(p) sx_xlock(&(p)->pem_sx)
+#define LINUX_PEM_XUNLOCK(p) sx_xunlock(&(p)->pem_sx)
+#define LINUX_PEM_SLOCK(p) sx_slock(&(p)->pem_sx)
+#define LINUX_PEM_SUNLOCK(p) sx_sunlock(&(p)->pem_sx)
-extern struct sx emul_shared_lock;
-extern struct mtx emul_lock;
+struct linux_pemuldata *pem_find(struct proc *);
#endif /* !_LINUX_EMUL_H_ */
diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c
new file mode 100644
index 0000000..4031588
--- /dev/null
+++ b/sys/compat/linux/linux_event.c
@@ -0,0 +1,890 @@
+/*-
+ * Copyright (c) 2007 Roman Divacky
+ * Copyright (c) 2014 Dmitry Chagin
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "opt_compat.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/imgact.h>
+#include <sys/kernel.h>
+#include <sys/limits.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/capability.h>
+#include <sys/types.h>
+#include <sys/user.h>
+#include <sys/file.h>
+#include <sys/filedesc.h>
+#include <sys/errno.h>
+#include <sys/event.h>
+#include <sys/poll.h>
+#include <sys/proc.h>
+#include <sys/selinfo.h>
+#include <sys/sx.h>
+#include <sys/syscallsubr.h>
+#include <sys/timespec.h>
+
+#ifdef COMPAT_LINUX32
+#include <machine/../linux32/linux.h>
+#include <machine/../linux32/linux32_proto.h>
+#else
+#include <machine/../linux/linux.h>
+#include <machine/../linux/linux_proto.h>
+#endif
+
+#include <compat/linux/linux_emul.h>
+#include <compat/linux/linux_event.h>
+#include <compat/linux/linux_file.h>
+#include <compat/linux/linux_util.h>
+
+/*
+ * epoll defines 'struct epoll_event' with the field 'data' as 64 bits
+ * on all architectures. But on 32 bit architectures BSD 'struct kevent' only
+ * has 32 bit opaque pointer as 'udata' field. So we can't pass epoll supplied
+ * data verbatuim. Therefore we allocate 64-bit memory block to pass
+ * user supplied data for every file descriptor.
+ */
+
+typedef uint64_t epoll_udata_t;
+
+struct epoll_emuldata {
+ uint32_t fdc; /* epoll udata max index */
+ epoll_udata_t udata[1]; /* epoll user data vector */
+};
+
+#define EPOLL_DEF_SZ 16
+#define EPOLL_SIZE(fdn) \
+ (sizeof(struct epoll_emuldata)+(fdn) * sizeof(epoll_udata_t))
+
+struct epoll_event {
+ uint32_t events;
+ epoll_udata_t data;
+}
+#if defined(__amd64__)
+__attribute__((packed))
+#endif
+;
+
+#define LINUX_MAX_EVENTS (INT_MAX / sizeof(struct epoll_event))
+
+static void epoll_fd_install(struct thread *td, int fd, epoll_udata_t udata);
+static int epoll_to_kevent(struct thread *td, struct file *epfp,
+ int fd, struct epoll_event *l_event, int *kev_flags,
+ struct kevent *kevent, int *nkevents);
+static void kevent_to_epoll(struct kevent *kevent, struct epoll_event *l_event);
+static int epoll_kev_copyout(void *arg, struct kevent *kevp, int count);
+static int epoll_kev_copyin(void *arg, struct kevent *kevp, int count);
+static int epoll_delete_event(struct thread *td, struct file *epfp,
+ int fd, int filter);
+static int epoll_delete_all_events(struct thread *td, struct file *epfp,
+ int fd);
+
+struct epoll_copyin_args {
+ struct kevent *changelist;
+};
+
+struct epoll_copyout_args {
+ struct epoll_event *leventlist;
+ struct proc *p;
+ uint32_t count;
+ int error;
+};
+
+/* eventfd */
+typedef uint64_t eventfd_t;
+
+static fo_rdwr_t eventfd_read;
+static fo_rdwr_t eventfd_write;
+static fo_truncate_t eventfd_truncate;
+static fo_ioctl_t eventfd_ioctl;
+static fo_poll_t eventfd_poll;
+static fo_kqfilter_t eventfd_kqfilter;
+static fo_stat_t eventfd_stat;
+static fo_close_t eventfd_close;
+static fo_fill_kinfo_t eventfd_fill_kinfo;
+
+static struct fileops eventfdops = {
+ .fo_read = eventfd_read,
+ .fo_write = eventfd_write,
+ .fo_truncate = eventfd_truncate,
+ .fo_ioctl = eventfd_ioctl,
+ .fo_poll = eventfd_poll,
+ .fo_kqfilter = eventfd_kqfilter,
+ .fo_stat = eventfd_stat,
+ .fo_close = eventfd_close,
+ .fo_chmod = invfo_chmod,
+ .fo_chown = invfo_chown,
+ .fo_sendfile = invfo_sendfile,
+ .fo_fill_kinfo = eventfd_fill_kinfo,
+ .fo_flags = DFLAG_PASSABLE
+};
+
+static void filt_eventfddetach(struct knote *kn);
+static int filt_eventfdread(struct knote *kn, long hint);
+static int filt_eventfdwrite(struct knote *kn, long hint);
+
+static struct filterops eventfd_rfiltops = {
+ .f_isfd = 1,
+ .f_detach = filt_eventfddetach,
+ .f_event = filt_eventfdread
+};
+static struct filterops eventfd_wfiltops = {
+ .f_isfd = 1,
+ .f_detach = filt_eventfddetach,
+ .f_event = filt_eventfdwrite
+};
+
+struct eventfd {
+ eventfd_t efd_count;
+ uint32_t efd_flags;
+ struct selinfo efd_sel;
+ struct mtx efd_lock;
+};
+
+static int eventfd_create(struct thread *td, uint32_t initval, int flags);
+
+
+static void
+epoll_fd_install(struct thread *td, int fd, epoll_udata_t udata)
+{
+ struct linux_pemuldata *pem;
+ struct epoll_emuldata *emd;
+ struct proc *p;
+
+ p = td->td_proc;
+
+ pem = pem_find(p);
+ KASSERT(pem != NULL, ("epoll proc emuldata not found.\n"));
+
+ LINUX_PEM_XLOCK(pem);
+ if (pem->epoll == NULL) {
+ emd = malloc(EPOLL_SIZE(fd), M_EPOLL, M_WAITOK);
+ emd->fdc = fd;
+ pem->epoll = emd;
+ } else {
+ emd = pem->epoll;
+ if (fd > emd->fdc) {
+ emd = realloc(emd, EPOLL_SIZE(fd), M_EPOLL, M_WAITOK);
+ emd->fdc = fd;
+ pem->epoll = emd;
+ }
+ }
+ emd->udata[fd] = udata;
+ LINUX_PEM_XUNLOCK(pem);
+}
+
+static int
+epoll_create_common(struct thread *td, int flags)
+{
+ int error;
+
+ error = kern_kqueue(td, flags);
+ if (error)
+ return (error);
+
+ epoll_fd_install(td, EPOLL_DEF_SZ, 0);
+
+ return (0);
+}
+
+int
+linux_epoll_create(struct thread *td, struct linux_epoll_create_args *args)
+{
+
+ /*
+ * args->size is unused. Linux just tests it
+ * and then forgets it as well.
+ */
+ if (args->size <= 0)
+ return (EINVAL);
+
+ return (epoll_create_common(td, 0));
+}
+
+int
+linux_epoll_create1(struct thread *td, struct linux_epoll_create1_args *args)
+{
+ int flags;
+
+ if ((args->flags & ~(LINUX_O_CLOEXEC)) != 0)
+ return (EINVAL);
+
+ flags = 0;
+ if ((args->flags & LINUX_O_CLOEXEC) != 0)
+ flags |= O_CLOEXEC;
+
+ return (epoll_create_common(td, flags));
+}
+
+/* Structure converting function from epoll to kevent. */
+static int
+epoll_to_kevent(struct thread *td, struct file *epfp,
+ int fd, struct epoll_event *l_event, int *kev_flags,
+ struct kevent *kevent, int *nkevents)
+{
+ uint32_t levents = l_event->events;
+ struct linux_pemuldata *pem;
+ struct proc *p;
+
+ /* flags related to how event is registered */
+ if ((levents & LINUX_EPOLLONESHOT) != 0)
+ *kev_flags |= EV_ONESHOT;
+ if ((levents & LINUX_EPOLLET) != 0)
+ *kev_flags |= EV_CLEAR;
+ if ((levents & LINUX_EPOLLERR) != 0)
+ *kev_flags |= EV_ERROR;
+
+ /* flags related to what event is registered */
+ if ((levents & LINUX_EPOLL_EVRD) != 0) {
+ EV_SET(kevent++, fd, EVFILT_READ, *kev_flags, 0, 0, 0);
+ ++(*nkevents);
+ }
+ if ((levents & LINUX_EPOLL_EVWR) != 0) {
+ EV_SET(kevent++, fd, EVFILT_WRITE, *kev_flags, 0, 0, 0);
+ ++(*nkevents);
+ }
+
+ if ((levents & ~(LINUX_EPOLL_EVSUP)) != 0) {
+ p = td->td_proc;
+
+ pem = pem_find(p);
+ KASSERT(pem != NULL, ("epoll proc emuldata not found.\n"));
+ KASSERT(pem->epoll != NULL, ("epoll proc epolldata not found.\n"));
+
+ LINUX_PEM_XLOCK(pem);
+ if ((pem->flags & LINUX_XUNSUP_EPOLL) == 0) {
+ pem->flags |= LINUX_XUNSUP_EPOLL;
+ LINUX_PEM_XUNLOCK(pem);
+ linux_msg(td, "epoll_ctl unsupported flags: 0x%x\n",
+ levents);
+ } else
+ LINUX_PEM_XUNLOCK(pem);
+ return (EINVAL);
+ }
+
+ return (0);
+}
+
+/*
+ * Structure converting function from kevent to epoll. In a case
+ * this is called on error in registration we store the error in
+ * event->data and pick it up later in linux_epoll_ctl().
+ */
+static void
+kevent_to_epoll(struct kevent *kevent, struct epoll_event *l_event)
+{
+
+ if ((kevent->flags & EV_ERROR) != 0) {
+ l_event->events = LINUX_EPOLLERR;
+ return;
+ }
+
+ switch (kevent->filter) {
+ case EVFILT_READ:
+ l_event->events = LINUX_EPOLLIN|LINUX_EPOLLRDNORM|LINUX_EPOLLPRI;
+ break;
+ case EVFILT_WRITE:
+ l_event->events = LINUX_EPOLLOUT|LINUX_EPOLLWRNORM;
+ break;
+ }
+}
+
+/*
+ * Copyout callback used by kevent. This converts kevent
+ * events to epoll events and copies them back to the
+ * userspace. This is also called on error on registering
+ * of the filter.
+ */
+static int
+epoll_kev_copyout(void *arg, struct kevent *kevp, int count)
+{
+ struct epoll_copyout_args *args;
+ struct linux_pemuldata *pem;
+ struct epoll_emuldata *emd;
+ struct epoll_event *eep;
+ int error, fd, i;
+
+ args = (struct epoll_copyout_args*) arg;
+ eep = malloc(sizeof(*eep) * count, M_EPOLL, M_WAITOK | M_ZERO);
+
+ pem = pem_find(args->p);
+ KASSERT(pem != NULL, ("epoll proc emuldata not found.\n"));
+ LINUX_PEM_SLOCK(pem);
+ emd = pem->epoll;
+ KASSERT(emd != NULL, ("epoll proc epolldata not found.\n"));
+
+ for (i = 0; i < count; i++) {
+ kevent_to_epoll(&kevp[i], &eep[i]);
+
+ fd = kevp[i].ident;
+ KASSERT(fd <= emd->fdc, ("epoll user data vector"
+ " is too small.\n"));
+ eep[i].data = emd->udata[fd];
+ }
+ LINUX_PEM_SUNLOCK(pem);
+
+ error = copyout(eep, args->leventlist, count * sizeof(*eep));
+ if (error == 0) {
+ args->leventlist += count;
+ args->count += count;
+ } else if (args->error == 0)
+ args->error = error;
+
+ free(eep, M_EPOLL);
+ return (error);
+}
+
+/*
+ * Copyin callback used by kevent. This copies already
+ * converted filters from kernel memory to the kevent
+ * internal kernel memory. Hence the memcpy instead of
+ * copyin.
+ */
+static int
+epoll_kev_copyin(void *arg, struct kevent *kevp, int count)
+{
+ struct epoll_copyin_args *args;
+
+ args = (struct epoll_copyin_args*) arg;
+
+ memcpy(kevp, args->changelist, count * sizeof(*kevp));
+ args->changelist += count;
+
+ return (0);
+}
+
+/*
+ * Load epoll filter, convert it to kevent filter
+ * and load it into kevent subsystem.
+ */
+int
+linux_epoll_ctl(struct thread *td, struct linux_epoll_ctl_args *args)
+{
+ struct file *epfp, *fp;
+ struct epoll_copyin_args ciargs;
+ struct kevent kev[2];
+ struct kevent_copyops k_ops = { &ciargs,
+ NULL,
+ epoll_kev_copyin};
+ struct epoll_event le;
+ cap_rights_t rights;
+ int kev_flags;
+ int nchanges = 0;
+ int error;
+
+ if (args->op != LINUX_EPOLL_CTL_DEL) {
+ error = copyin(args->event, &le, sizeof(le));
+ if (error != 0)
+ return (error);
+ }
+
+ error = fget(td, args->epfd,
+ cap_rights_init(&rights, CAP_KQUEUE_CHANGE), &epfp);
+ if (error != 0)
+ return (error);
+ if (epfp->f_type != DTYPE_KQUEUE)
+ goto leave1;
+
+ /* Protect user data vector from incorrectly supplied fd. */
+ error = fget(td, args->fd, cap_rights_init(&rights, CAP_POLL_EVENT), &fp);
+ if (error != 0)
+ goto leave1;
+
+ /* Linux disallows spying on himself */
+ if (epfp == fp) {
+ error = EINVAL;
+ goto leave0;
+ }
+
+ ciargs.changelist = kev;
+
+ switch (args->op) {
+ case LINUX_EPOLL_CTL_MOD:
+ /*
+ * We don't memorize which events were set for this FD
+ * on this level, so just delete all we could have set:
+ * EVFILT_READ and EVFILT_WRITE, ignoring any errors
+ */
+ error = epoll_delete_all_events(td, epfp, args->fd);
+ if (error)
+ goto leave0;
+ /* FALLTHROUGH */
+
+ case LINUX_EPOLL_CTL_ADD:
+ kev_flags = EV_ADD | EV_ENABLE;
+ break;
+
+ case LINUX_EPOLL_CTL_DEL:
+ /* CTL_DEL means unregister this fd with this epoll */
+ error = epoll_delete_all_events(td, epfp, args->fd);
+ goto leave0;
+
+ default:
+ error = EINVAL;
+ goto leave0;
+ }
+
+ error = epoll_to_kevent(td, epfp, args->fd, &le, &kev_flags,
+ kev, &nchanges);
+ if (error)
+ goto leave0;
+
+ epoll_fd_install(td, args->fd, le.data);
+
+ error = kern_kevent_fp(td, epfp, nchanges, 0, &k_ops, NULL);
+
+leave0:
+ fdrop(fp, td);
+
+leave1:
+ fdrop(epfp, td);
+ return (error);
+}
+
+/*
+ * Wait for a filter to be triggered on the epoll file descriptor.
+ */
+static int
+linux_epoll_wait_common(struct thread *td, int epfd, struct epoll_event *events,
+ int maxevents, int timeout, sigset_t *uset)
+{
+ struct file *epfp;
+ struct timespec ts, *tsp;
+ cap_rights_t rights;
+ struct epoll_copyout_args coargs;
+ struct kevent_copyops k_ops = { &coargs,
+ epoll_kev_copyout,
+ NULL};
+ int error;
+
+ if (maxevents <= 0 || maxevents > LINUX_MAX_EVENTS)
+ return (EINVAL);
+
+ if (uset != NULL) {
+ error = kern_sigprocmask(td, SIG_SETMASK, uset,
+ &td->td_oldsigmask, 0);
+ if (error != 0)
+ return (error);
+ td->td_pflags |= TDP_OLDMASK;
+ /*
+ * Make sure that ast() is called on return to
+ * usermode and TDP_OLDMASK is cleared, restoring old
+ * sigmask.
+ */
+ thread_lock(td);
+ td->td_flags |= TDF_ASTPENDING;
+ thread_unlock(td);
+ }
+
+ error = fget(td, epfd,
+ cap_rights_init(&rights, CAP_KQUEUE_EVENT), &epfp);
+ if (error != 0)
+ return (error);
+
+ coargs.leventlist = events;
+ coargs.p = td->td_proc;
+ coargs.count = 0;
+ coargs.error = 0;
+
+ if (timeout != -1) {
+ if (timeout < 0) {
+ error = EINVAL;
+ goto leave;
+ }
+ /* Convert from milliseconds to timespec. */
+ ts.tv_sec = timeout / 1000;
+ ts.tv_nsec = (timeout % 1000) * 1000000;
+ tsp = &ts;
+ } else {
+ tsp = NULL;
+ }
+
+ error = kern_kevent_fp(td, epfp, 0, maxevents, &k_ops, tsp);
+ if (error == 0 && coargs.error != 0)
+ error = coargs.error;
+
+ /*
+ * kern_kevent might return ENOMEM which is not expected from epoll_wait.
+ * Maybe we should translate that but I don't think it matters at all.
+ */
+ if (error == 0)
+ td->td_retval[0] = coargs.count;
+leave:
+ fdrop(epfp, td);
+ return (error);
+}
+
+int
+linux_epoll_wait(struct thread *td, struct linux_epoll_wait_args *args)
+{
+
+ return (linux_epoll_wait_common(td, args->epfd, args->events,
+ args->maxevents, args->timeout, NULL));
+}
+
+int
+linux_epoll_pwait(struct thread *td, struct linux_epoll_pwait_args *args)
+{
+ sigset_t mask, *pmask;
+ l_sigset_t lmask;
+ int error;
+
+ if (args->mask != NULL) {
+ error = copyin(args->mask, &lmask, sizeof(l_sigset_t));
+ if (error != 0)
+ return (error);
+ linux_to_bsd_sigset(&lmask, &mask);
+ pmask = &mask;
+ } else
+ pmask = NULL;
+ return (linux_epoll_wait_common(td, args->epfd, args->events,
+ args->maxevents, args->timeout, pmask));
+}
+
+static int
+epoll_delete_event(struct thread *td, struct file *epfp, int fd, int filter)
+{
+ struct epoll_copyin_args ciargs;
+ struct kevent kev;
+ struct kevent_copyops k_ops = { &ciargs,
+ NULL,
+ epoll_kev_copyin};
+ int error;
+
+ ciargs.changelist = &kev;
+ EV_SET(&kev, fd, filter, EV_DELETE | EV_DISABLE, 0, 0, 0);
+
+ error = kern_kevent_fp(td, epfp, 1, 0, &k_ops, NULL);
+
+ /*
+ * here we ignore ENONT, because we don't keep track of events here
+ */
+ if (error == ENOENT)
+ error = 0;
+ return (error);
+}
+
+static int
+epoll_delete_all_events(struct thread *td, struct file *epfp, int fd)
+{
+ int error1, error2;
+
+ error1 = epoll_delete_event(td, epfp, fd, EVFILT_READ);
+ error2 = epoll_delete_event(td, epfp, fd, EVFILT_WRITE);
+
+ /* report any errors we got */
+ return (error1 == 0 ? error2 : error1);
+}
+
+static int
+eventfd_create(struct thread *td, uint32_t initval, int flags)
+{
+ struct filedesc *fdp;
+ struct eventfd *efd;
+ struct file *fp;
+ int fflags, fd, error;
+
+ fflags = 0;
+ if ((flags & LINUX_O_CLOEXEC) != 0)
+ fflags |= O_CLOEXEC;
+
+ fdp = td->td_proc->p_fd;
+ error = falloc(td, &fp, &fd, fflags);
+ if (error)
+ return (error);
+
+ efd = malloc(sizeof(*efd), M_EPOLL, M_WAITOK | M_ZERO);
+ efd->efd_flags = flags;
+ efd->efd_count = initval;
+ mtx_init(&efd->efd_lock, "eventfd", NULL, MTX_DEF);
+
+ knlist_init_mtx(&efd->efd_sel.si_note, &efd->efd_lock);
+
+ fflags = FREAD | FWRITE;
+ if ((flags & LINUX_O_NONBLOCK) != 0)
+ fflags |= FNONBLOCK;
+
+ finit(fp, fflags, DTYPE_LINUXEFD, efd, &eventfdops);
+ fdrop(fp, td);
+
+ td->td_retval[0] = fd;
+ return (error);
+}
+
+int
+linux_eventfd(struct thread *td, struct linux_eventfd_args *args)
+{
+
+ return (eventfd_create(td, args->initval, 0));
+}
+
+int
+linux_eventfd2(struct thread *td, struct linux_eventfd2_args *args)
+{
+
+ if ((args->flags & ~(LINUX_O_CLOEXEC|LINUX_O_NONBLOCK|LINUX_EFD_SEMAPHORE)) != 0)
+ return (EINVAL);
+
+ return (eventfd_create(td, args->initval, args->flags));
+}
+
+static int
+eventfd_close(struct file *fp, struct thread *td)
+{
+ struct eventfd *efd;
+
+ efd = fp->f_data;
+ if (fp->f_type != DTYPE_LINUXEFD || efd == NULL)
+ return (EBADF);
+
+ seldrain(&efd->efd_sel);
+ knlist_destroy(&efd->efd_sel.si_note);
+
+ fp->f_ops = &badfileops;
+ mtx_destroy(&efd->efd_lock);
+ free(efd, M_EPOLL);
+
+ return (0);
+}
+
+static int
+eventfd_read(struct file *fp, struct uio *uio, struct ucred *active_cred,
+ int flags, struct thread *td)
+{
+ struct eventfd *efd;
+ eventfd_t count;
+ int error;
+
+ efd = fp->f_data;
+ if (fp->f_type != DTYPE_LINUXEFD || efd == NULL)
+ return (EBADF);
+
+ if (uio->uio_resid < sizeof(eventfd_t))
+ return (EINVAL);
+
+ error = 0;
+ mtx_lock(&efd->efd_lock);
+retry:
+ if (efd->efd_count == 0) {
+ if ((efd->efd_flags & LINUX_O_NONBLOCK) != 0) {
+ mtx_unlock(&efd->efd_lock);
+ return (EAGAIN);
+ }
+ error = mtx_sleep(&efd->efd_count, &efd->efd_lock, PCATCH, "lefdrd", 0);
+ if (error == 0)
+ goto retry;
+ }
+ if (error == 0) {
+ if ((efd->efd_flags & LINUX_EFD_SEMAPHORE) != 0) {
+ count = 1;
+ --efd->efd_count;
+ } else {
+ count = efd->efd_count;
+ efd->efd_count = 0;
+ }
+ KNOTE_LOCKED(&efd->efd_sel.si_note, 0);
+ selwakeup(&efd->efd_sel);
+ wakeup(&efd->efd_count);
+ mtx_unlock(&efd->efd_lock);
+ error = uiomove(&count, sizeof(eventfd_t), uio);
+ } else
+ mtx_unlock(&efd->efd_lock);
+
+ return (error);
+}
+
+static int
+eventfd_write(struct file *fp, struct uio *uio, struct ucred *active_cred,
+ int flags, struct thread *td)
+{
+ struct eventfd *efd;
+ eventfd_t count;
+ int error;
+
+ efd = fp->f_data;
+ if (fp->f_type != DTYPE_LINUXEFD || efd == NULL)
+ return (EBADF);
+
+ if (uio->uio_resid < sizeof(eventfd_t))
+ return (EINVAL);
+
+ error = uiomove(&count, sizeof(eventfd_t), uio);
+ if (error)
+ return (error);
+ if (count == UINT64_MAX)
+ return (EINVAL);
+
+ mtx_lock(&efd->efd_lock);
+retry:
+ if (UINT64_MAX - efd->efd_count <= count) {
+ if ((efd->efd_flags & LINUX_O_NONBLOCK) != 0) {
+ mtx_unlock(&efd->efd_lock);
+ return (EAGAIN);
+ }
+ error = mtx_sleep(&efd->efd_count, &efd->efd_lock,
+ PCATCH, "lefdwr", 0);
+ if (error == 0)
+ goto retry;
+ }
+ if (error == 0) {
+ efd->efd_count += count;
+ KNOTE_LOCKED(&efd->efd_sel.si_note, 0);
+ selwakeup(&efd->efd_sel);
+ wakeup(&efd->efd_count);
+ }
+ mtx_unlock(&efd->efd_lock);
+
+ return (error);
+}
+
+static int
+eventfd_poll(struct file *fp, int events, struct ucred *active_cred,
+ struct thread *td)
+{
+ struct eventfd *efd;
+ int revents = 0;
+
+ efd = fp->f_data;
+ if (fp->f_type != DTYPE_LINUXEFD || efd == NULL)
+ return (POLLERR);
+
+ mtx_lock(&efd->efd_lock);
+ if ((events & (POLLIN|POLLRDNORM)) && efd->efd_count > 0)
+ revents |= events & (POLLIN|POLLRDNORM);
+ if ((events & (POLLOUT|POLLWRNORM)) && UINT64_MAX - 1 > efd->efd_count)
+ revents |= events & (POLLOUT|POLLWRNORM);
+ if (revents == 0)
+ selrecord(td, &efd->efd_sel);
+ mtx_unlock(&efd->efd_lock);
+
+ return (revents);
+}
+
+/*ARGSUSED*/
+static int
+eventfd_kqfilter(struct file *fp, struct knote *kn)
+{
+ struct eventfd *efd;
+
+ efd = fp->f_data;
+ if (fp->f_type != DTYPE_LINUXEFD || efd == NULL)
+ return (EINVAL);
+
+ mtx_lock(&efd->efd_lock);
+ switch (kn->kn_filter) {
+ case EVFILT_READ:
+ kn->kn_fop = &eventfd_rfiltops;
+ break;
+ case EVFILT_WRITE:
+ kn->kn_fop = &eventfd_wfiltops;
+ break;
+ default:
+ mtx_unlock(&efd->efd_lock);
+ return (EINVAL);
+ }
+
+ kn->kn_hook = efd;
+ knlist_add(&efd->efd_sel.si_note, kn, 1);
+ mtx_unlock(&efd->efd_lock);
+
+ return (0);
+}
+
+static void
+filt_eventfddetach(struct knote *kn)
+{
+ struct eventfd *efd = kn->kn_hook;
+
+ mtx_lock(&efd->efd_lock);
+ knlist_remove(&efd->efd_sel.si_note, kn, 1);
+ mtx_unlock(&efd->efd_lock);
+}
+
+/*ARGSUSED*/
+static int
+filt_eventfdread(struct knote *kn, long hint)
+{
+ struct eventfd *efd = kn->kn_hook;
+ int ret;
+
+ mtx_assert(&efd->efd_lock, MA_OWNED);
+ ret = (efd->efd_count > 0);
+
+ return (ret);
+}
+
+/*ARGSUSED*/
+static int
+filt_eventfdwrite(struct knote *kn, long hint)
+{
+ struct eventfd *efd = kn->kn_hook;
+ int ret;
+
+ mtx_assert(&efd->efd_lock, MA_OWNED);
+ ret = (UINT64_MAX - 1 > efd->efd_count);
+
+ return (ret);
+}
+
+/*ARGSUSED*/
+static int
+eventfd_truncate(struct file *fp, off_t length, struct ucred *active_cred,
+ struct thread *td)
+{
+
+ return (ENXIO);
+}
+
+/*ARGSUSED*/
+static int
+eventfd_ioctl(struct file *fp, u_long cmd, void *data,
+ struct ucred *active_cred, struct thread *td)
+{
+
+ return (ENXIO);
+}
+
+/*ARGSUSED*/
+static int
+eventfd_stat(struct file *fp, struct stat *st, struct ucred *active_cred,
+ struct thread *td)
+{
+
+ return (ENXIO);
+}
+
+/*ARGSUSED*/
+static int
+eventfd_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp)
+{
+
+ kif->kf_type = KF_TYPE_UNKNOWN;
+ return (0);
+}
diff --git a/usr.bin/csup/pathcomp.h b/sys/compat/linux/linux_event.h
index 3cea410..0c030ad 100644
--- a/usr.bin/csup/pathcomp.h
+++ b/sys/compat/linux/linux_event.h
@@ -1,5 +1,6 @@
/*-
- * Copyright (c) 2006, Maxime Henrion <mux@FreeBSD.org>
+ * Copyright (c) 2007 Roman Divacky
+ * Copyright (c) 2014 Dmitry Chagin
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,20 +26,35 @@
*
* $FreeBSD$
*/
-#ifndef _PATHCOMP_H
-#define _PATHCOMP_H
-/* File types */
-#define PC_DIRDOWN 0
-#define PC_FILE 1
-#define PC_DIRUP 2
+#ifndef _LINUX_EVENT_H_
+#define _LINUX_EVENT_H_
-struct pathcomp;
+#define LINUX_EPOLLIN 0x001
+#define LINUX_EPOLLPRI 0x002
+#define LINUX_EPOLLOUT 0x004
+#define LINUX_EPOLLRDNORM 0x040
+#define LINUX_EPOLLRDBAND 0x080
+#define LINUX_EPOLLWRNORM 0x100
+#define LINUX_EPOLLWRBAND 0x200
+#define LINUX_EPOLLMSG 0x400
+#define LINUX_EPOLLERR 0x008
+#define LINUX_EPOLLHUP 0x010
+#define LINUX_EPOLLRDHUP 0x2000
+#define LINUX_EPOLLWAKEUP 1u<<29
+#define LINUX_EPOLLONESHOT 1u<<30
+#define LINUX_EPOLLET 1u<<31
-struct pathcomp *pathcomp_new(void);
-int pathcomp_put(struct pathcomp *, int, char *);
-int pathcomp_get(struct pathcomp *, int *, char **);
-void pathcomp_finish(struct pathcomp *);
-void pathcomp_free(struct pathcomp *);
+#define LINUX_EPOLL_EVRD (LINUX_EPOLLIN|LINUX_EPOLLRDNORM \
+ |LINUX_EPOLLHUP|LINUX_EPOLLERR|LINUX_EPOLLPRI)
+#define LINUX_EPOLL_EVWR (LINUX_EPOLLOUT|LINUX_EPOLLWRNORM)
+#define LINUX_EPOLL_EVSUP (LINUX_EPOLLET|LINUX_EPOLLONESHOT \
+ |LINUX_EPOLL_EVRD|LINUX_EPOLL_EVWR)
-#endif /* !_PATHCOMP_H */
+#define LINUX_EPOLL_CTL_ADD 1
+#define LINUX_EPOLL_CTL_DEL 2
+#define LINUX_EPOLL_CTL_MOD 3
+
+#define LINUX_EFD_SEMAPHORE (1 << 0)
+
+#endif /* !_LINUX_EVENT_H_ */
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c
index 78a65d0..9251a20 100644
--- a/sys/compat/linux/linux_file.c
+++ b/sys/compat/linux/linux_file.c
@@ -235,6 +235,7 @@ linux_lseek(struct thread *td, struct linux_lseek_args *args)
return error;
}
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
int
linux_llseek(struct thread *td, struct linux_llseek_args *args)
{
@@ -273,6 +274,7 @@ linux_readdir(struct thread *td, struct linux_readdir_args *args)
lda.count = 1;
return linux_getdents(td, &lda);
}
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
/*
* Note that linux_getdents(2) and linux_getdents64(2) have the same
@@ -367,8 +369,8 @@ getdents_common(struct thread *td, struct linux_getdents64_args *args,
buflen = max(LINUX_DIRBLKSIZ, nbytes);
buflen = min(buflen, MAXBSIZE);
- buf = malloc(buflen, M_TEMP, M_WAITOK);
- lbuf = malloc(LINUX_MAXRECLEN, M_TEMP, M_WAITOK | M_ZERO);
+ buf = malloc(buflen, M_LINUX, M_WAITOK);
+ lbuf = malloc(LINUX_MAXRECLEN, M_LINUX, M_WAITOK | M_ZERO);
vn_lock(vp, LK_SHARED | LK_RETRY);
aiov.iov_base = buf;
@@ -519,8 +521,8 @@ out:
VOP_UNLOCK(vp, 0);
foffset_unlock(fp, off, 0);
fdrop(fp, td);
- free(buf, M_TEMP);
- free(lbuf, M_TEMP);
+ free(buf, M_LINUX);
+ free(lbuf, M_LINUX);
return (error);
}
@@ -579,10 +581,8 @@ int
linux_faccessat(struct thread *td, struct linux_faccessat_args *args)
{
char *path;
- int error, dfd, flag;
+ int error, dfd;
- if (args->flag & ~LINUX_AT_EACCESS)
- return (EINVAL);
/* linux convention */
if (args->amode & ~(F_OK | X_OK | W_OK | R_OK))
return (EINVAL);
@@ -595,8 +595,7 @@ linux_faccessat(struct thread *td, struct linux_faccessat_args *args)
printf(ARGS(access, "%s, %d"), path, args->amode);
#endif
- flag = (args->flag & LINUX_AT_EACCESS) == 0 ? 0 : AT_EACCESS;
- error = kern_accessat(td, dfd, path, UIO_SYSSPACE, flag, args->amode);
+ error = kern_accessat(td, dfd, path, UIO_SYSSPACE, 0, args->amode);
LFREEPATH(path);
return (error);
@@ -924,6 +923,7 @@ linux_truncate(struct thread *td, struct linux_truncate_args *args)
return (error);
}
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
int
linux_truncate64(struct thread *td, struct linux_truncate64_args *args)
{
@@ -941,6 +941,8 @@ linux_truncate64(struct thread *td, struct linux_truncate64_args *args)
LFREEPATH(path);
return (error);
}
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
+
int
linux_ftruncate(struct thread *td, struct linux_ftruncate_args *args)
{
@@ -1129,6 +1131,7 @@ linux_mount(struct thread *td, struct linux_mount_args *args)
return (error);
}
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
int
linux_oldumount(struct thread *td, struct linux_oldumount_args *args)
{
@@ -1138,6 +1141,7 @@ linux_oldumount(struct thread *td, struct linux_oldumount_args *args)
args2.flags = 0;
return (linux_umount(td, &args2));
}
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
int
linux_umount(struct thread *td, struct linux_umount_args *args)
@@ -1268,7 +1272,7 @@ bsd_to_linux_flock64(struct flock *bsd_flock, struct l_flock64 *linux_flock)
#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
static int
-fcntl_common(struct thread *td, struct linux_fcntl64_args *args)
+fcntl_common(struct thread *td, struct linux_fcntl_args *args)
{
struct l_flock linux_flock;
struct flock bsd_flock;
@@ -1386,6 +1390,9 @@ fcntl_common(struct thread *td, struct linux_fcntl64_args *args)
fdrop(fp, td);
return (kern_fcntl(td, args->fd, F_SETOWN, args->arg));
+
+ case LINUX_F_DUPFD_CLOEXEC:
+ return (kern_fcntl(td, args->fd, F_DUPFD_CLOEXEC, args->arg));
}
return (EINVAL);
@@ -1394,17 +1401,13 @@ fcntl_common(struct thread *td, struct linux_fcntl64_args *args)
int
linux_fcntl(struct thread *td, struct linux_fcntl_args *args)
{
- struct linux_fcntl64_args args64;
#ifdef DEBUG
if (ldebug(fcntl))
printf(ARGS(fcntl, "%d, %08x, *"), args->fd, args->cmd);
#endif
- args64.fd = args->fd;
- args64.cmd = args->cmd;
- args64.arg = args->arg;
- return (fcntl_common(td, &args64));
+ return (fcntl_common(td, args));
}
#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
@@ -1413,6 +1416,7 @@ linux_fcntl64(struct thread *td, struct linux_fcntl64_args *args)
{
struct l_flock64 linux_flock;
struct flock bsd_flock;
+ struct linux_fcntl_args fcntl_args;
int error;
#ifdef DEBUG
@@ -1453,7 +1457,10 @@ linux_fcntl64(struct thread *td, struct linux_fcntl64_args *args)
(intptr_t)&bsd_flock));
}
- return (fcntl_common(td, args));
+ fcntl_args.fd = args->fd;
+ fcntl_args.cmd = args->cmd;
+ fcntl_args.arg = args->arg;
+ return (fcntl_common(td, &fcntl_args));
}
#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
@@ -1551,6 +1558,7 @@ linux_fadvise64(struct thread *td, struct linux_fadvise64_args *args)
advice));
}
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
int
linux_fadvise64_64(struct thread *td, struct linux_fadvise64_64_args *args)
{
@@ -1562,6 +1570,7 @@ linux_fadvise64_64(struct thread *td, struct linux_fadvise64_64_args *args)
return (kern_posix_fadvise(td, args->fd, args->offset, args->len,
advice));
}
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
int
linux_pipe(struct thread *td, struct linux_pipe_args *args)
@@ -1608,3 +1617,37 @@ linux_pipe2(struct thread *td, struct linux_pipe2_args *args)
/* XXX: Close descriptors on error. */
return (copyout(fildes, args->pipefds, sizeof(fildes)));
}
+
+int
+linux_dup3(struct thread *td, struct linux_dup3_args *args)
+{
+ int cmd;
+ intptr_t newfd;
+
+ if (args->oldfd == args->newfd)
+ return (EINVAL);
+ if ((args->flags & ~LINUX_O_CLOEXEC) != 0)
+ return (EINVAL);
+ if (args->flags & LINUX_O_CLOEXEC)
+ cmd = F_DUP2FD_CLOEXEC;
+ else
+ cmd = F_DUP2FD;
+
+ newfd = args->newfd;
+ return (kern_fcntl(td, args->oldfd, cmd, newfd));
+}
+
+int
+linux_fallocate(struct thread *td, struct linux_fallocate_args *args)
+{
+
+ /*
+ * We emulate only posix_fallocate system call for which
+ * mode should be 0.
+ */
+ if (args->mode != 0)
+ return (ENOSYS);
+
+ return (kern_posix_fallocate(td, args->fd, args->offset,
+ args->len));
+}
diff --git a/sys/compat/linux/linux_file.h b/sys/compat/linux/linux_file.h
index 2d3106f..f27d5b4 100644
--- a/sys/compat/linux/linux_file.h
+++ b/sys/compat/linux/linux_file.h
@@ -54,4 +54,75 @@
#define LINUX_MS_NOEXEC 0x0008
#define LINUX_MS_REMOUNT 0x0020
+/*
+ * common open/fcntl flags
+ */
+#define LINUX_O_RDONLY 00000000
+#define LINUX_O_WRONLY 00000001
+#define LINUX_O_RDWR 00000002
+#define LINUX_O_ACCMODE 00000003
+#define LINUX_O_CREAT 00000100
+#define LINUX_O_EXCL 00000200
+#define LINUX_O_NOCTTY 00000400
+#define LINUX_O_TRUNC 00001000
+#define LINUX_O_APPEND 00002000
+#define LINUX_O_NONBLOCK 00004000
+#define LINUX_O_NDELAY LINUX_O_NONBLOCK
+#define LINUX_O_SYNC 00010000
+#define LINUX_FASYNC 00020000
+#define LINUX_O_DIRECT 00040000 /* Direct disk access hint */
+#define LINUX_O_LARGEFILE 00100000
+#define LINUX_O_DIRECTORY 00200000 /* Must be a directory */
+#define LINUX_O_NOFOLLOW 00400000 /* Do not follow links */
+#define LINUX_O_NOATIME 01000000
+#define LINUX_O_CLOEXEC 02000000
+
+#define LINUX_F_DUPFD 0
+#define LINUX_F_GETFD 1
+#define LINUX_F_SETFD 2
+#define LINUX_F_GETFL 3
+#define LINUX_F_SETFL 4
+#ifndef LINUX_F_GETLK
+#define LINUX_F_GETLK 5
+#define LINUX_F_SETLK 6
+#define LINUX_F_SETLKW 7
+#endif
+#ifndef LINUX_F_SETOWN
+#define LINUX_F_SETOWN 8
+#define LINUX_F_GETOWN 9
+#endif
+#ifndef LINUX_F_SETSIG
+#define LINUX_F_SETSIG 10
+#define LINUX_F_GETSIG 11
+#endif
+#ifndef LINUX_F_SETOWN_EX
+#define LINUX_F_SETOWN_EX 15
+#define LINUX_F_GETOWN_EX 16
+#define LINUX_F_GETOWNER_UIDS 17
+#endif
+
+#define LINUX_F_SPECIFIC_BASE 1024
+
+#define LINUX_F_SETLEASE (LINUX_F_SPECIFIC_BASE + 0)
+#define LINUX_F_GETLEASE (LINUX_F_SPECIFIC_BASE + 1)
+#define LINUX_F_CANCELLK (LINUX_F_SPECIFIC_BASE + 5)
+#define LINUX_F_DUPFD_CLOEXEC (LINUX_F_SPECIFIC_BASE + 6)
+#define LINUX_F_NOTIFY (LINUX_F_SPECIFIC_BASE + 2)
+#define LINUX_F_SETPIPE_SZ (LINUX_F_SPECIFIC_BASE + 7)
+#define LINUX_F_GETPIPE_SZ (LINUX_F_SPECIFIC_BASE + 8)
+
+#define LINUX_F_GETLKP 36
+#define LINUX_F_SETLKP 37
+#define LINUX_F_SETLKPW 38
+
+#define LINUX_F_OWNER_TID 0
+#define LINUX_F_OWNER_PID 1
+#define LINUX_F_OWNER_PGRP 2
+
+#ifndef LINUX_F_RDLCK
+#define LINUX_F_RDLCK 0
+#define LINUX_F_WRLCK 1
+#define LINUX_F_UNLCK 2
+#endif
+
#endif /* !_LINUX_FILE_H_ */
diff --git a/sys/compat/linux/linux_fork.c b/sys/compat/linux/linux_fork.c
index 316cf2a..394c26f 100644
--- a/sys/compat/linux/linux_fork.c
+++ b/sys/compat/linux/linux_fork.c
@@ -34,13 +34,20 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/imgact.h>
+#include <sys/ktr.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/proc.h>
+#include <sys/racct.h>
#include <sys/sched.h>
-#include <sys/sdt.h>
+#include <sys/syscallsubr.h>
#include <sys/sx.h>
#include <sys/unistd.h>
+#include <sys/wait.h>
+
+#include <vm/vm.h>
+#include <vm/pmap.h>
+#include <vm/vm_map.h>
#ifdef COMPAT_LINUX32
#include <machine/../linux32/linux.h>
@@ -49,18 +56,10 @@ __FBSDID("$FreeBSD$");
#include <machine/../linux/linux.h>
#include <machine/../linux/linux_proto.h>
#endif
-#include <compat/linux/linux_dtrace.h>
-#include <compat/linux/linux_signal.h>
#include <compat/linux/linux_emul.h>
+#include <compat/linux/linux_futex.h>
#include <compat/linux/linux_misc.h>
-
-/* DTrace init */
-LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE);
-
-/* Linuxulator-global DTrace probes */
-LIN_SDT_PROBE_DECLARE(locks, emul_lock, locked);
-LIN_SDT_PROBE_DECLARE(locks, emul_lock, unlock);
-
+#include <compat/linux/linux_util.h>
int
linux_fork(struct thread *td, struct linux_fork_args *args)
@@ -78,14 +77,11 @@ linux_fork(struct thread *td, struct linux_fork_args *args)
!= 0)
return (error);
- td->td_retval[0] = p2->p_pid;
- td->td_retval[1] = 0;
+ td2 = FIRST_THREAD_IN_PROC(p2);
- error = linux_proc_init(td, td->td_retval[0], 0);
- if (error)
- return (error);
+ linux_proc_init(td, td2, 0);
- td2 = FIRST_THREAD_IN_PROC(p2);
+ td->td_retval[0] = p2->p_pid;
/*
* Make this runnable after we are finished with it.
@@ -115,17 +111,16 @@ linux_vfork(struct thread *td, struct linux_vfork_args *args)
NULL, 0)) != 0)
return (error);
- td->td_retval[0] = p2->p_pid;
- error = linux_proc_init(td, td->td_retval[0], 0);
- if (error)
- return (error);
+ td2 = FIRST_THREAD_IN_PROC(p2);
+
+ linux_proc_init(td, td2, 0);
PROC_LOCK(p2);
p2->p_flag |= P_PPWAIT;
PROC_UNLOCK(p2);
- td2 = FIRST_THREAD_IN_PROC(p2);
+ td->td_retval[0] = p2->p_pid;
/*
* Make this runnable after we are finished with it.
@@ -144,8 +139,8 @@ linux_vfork(struct thread *td, struct linux_vfork_args *args)
return (0);
}
-int
-linux_clone(struct thread *td, struct linux_clone_args *args)
+static int
+linux_clone_proc(struct thread *td, struct linux_clone_args *args)
{
int error, ff = RFPROC | RFSTOPPED;
struct proc *p2;
@@ -163,9 +158,7 @@ linux_clone(struct thread *td, struct linux_clone_args *args)
exit_signal = args->flags & 0x000000ff;
if (LINUX_SIG_VALID(exit_signal)) {
- if (exit_signal <= LINUX_SIGTBLSZ)
- exit_signal =
- linux_to_bsd_signal[_SIG_IDX(exit_signal)];
+ exit_signal = linux_to_bsd_signal(exit_signal);
} else if (exit_signal != 0)
return (EINVAL);
@@ -182,22 +175,6 @@ linux_clone(struct thread *td, struct linux_clone_args *args)
if (!(args->flags & (LINUX_CLONE_FILES | LINUX_CLONE_FS)))
ff |= RFFDG;
- /*
- * Attempt to detect when linux_clone(2) is used for creating
- * kernel threads. Unfortunately despite the existence of the
- * CLONE_THREAD flag, version of linuxthreads package used in
- * most popular distros as of beginning of 2005 doesn't make
- * any use of it. Therefore, this detection relies on
- * empirical observation that linuxthreads sets certain
- * combination of flags, so that we can make more or less
- * precise detection and notify the FreeBSD kernel that several
- * processes are in fact part of the same threading group, so
- * that special treatment is necessary for signal delivery
- * between those processes and fd locking.
- */
- if ((args->flags & 0xffffff00) == LINUX_THREADING_FLAGS)
- ff |= RFTHREAD;
-
if (args->flags & LINUX_CLONE_PARENT_SETTID)
if (args->parent_tidptr == NULL)
return (EINVAL);
@@ -206,29 +183,13 @@ linux_clone(struct thread *td, struct linux_clone_args *args)
if (error)
return (error);
- if (args->flags & (LINUX_CLONE_PARENT | LINUX_CLONE_THREAD)) {
- sx_xlock(&proctree_lock);
- PROC_LOCK(p2);
- proc_reparent(p2, td->td_proc->p_pptr);
- PROC_UNLOCK(p2);
- sx_xunlock(&proctree_lock);
- }
+ td2 = FIRST_THREAD_IN_PROC(p2);
/* create the emuldata */
- error = linux_proc_init(td, p2->p_pid, args->flags);
- /* reference it - no need to check this */
- em = em_find(p2, EMUL_DOLOCK);
- KASSERT(em != NULL, ("clone: emuldata not found."));
- /* and adjust it */
-
- if (args->flags & LINUX_CLONE_THREAD) {
-#ifdef notyet
- PROC_LOCK(p2);
- p2->p_pgrp = td->td_proc->p_pgrp;
- PROC_UNLOCK(p2);
-#endif
- exit_signal = 0;
- }
+ linux_proc_init(td, td2, args->flags);
+
+ em = em_find(td2);
+ KASSERT(em != NULL, ("clone_proc: emuldata not found.\n"));
if (args->flags & LINUX_CLONE_CHILD_SETTID)
em->child_set_tid = args->child_tidptr;
@@ -240,8 +201,6 @@ linux_clone(struct thread *td, struct linux_clone_args *args)
else
em->child_clear_tid = NULL;
- EMUL_UNLOCK(&emul_lock);
-
if (args->flags & LINUX_CLONE_PARENT_SETTID) {
error = copyout(&p2->p_pid, args->parent_tidptr,
sizeof(p2->p_pid));
@@ -252,14 +211,12 @@ linux_clone(struct thread *td, struct linux_clone_args *args)
PROC_LOCK(p2);
p2->p_sigparent = exit_signal;
PROC_UNLOCK(p2);
- td2 = FIRST_THREAD_IN_PROC(p2);
/*
* In a case of stack = NULL, we are supposed to COW calling process
* stack. This is what normal fork() does, so we just keep tf_rsp arg
* intact.
*/
- if (args->stack)
- linux_set_upcall_kse(td2, PTROUT(args->stack));
+ linux_set_upcall_kse(td2, PTROUT(args->stack));
if (args->flags & LINUX_CLONE_SETTLS)
linux_set_cloned_tls(td2, args->tls);
@@ -270,6 +227,7 @@ linux_clone(struct thread *td, struct linux_clone_args *args)
"stack %p sig = %d"), (int)p2->p_pid, args->stack,
exit_signal);
#endif
+
if (args->flags & LINUX_CLONE_VFORK) {
PROC_LOCK(p2);
p2->p_flag |= P_PPWAIT;
@@ -285,7 +243,6 @@ linux_clone(struct thread *td, struct linux_clone_args *args)
thread_unlock(td2);
td->td_retval[0] = p2->p_pid;
- td->td_retval[1] = 0;
if (args->flags & LINUX_CLONE_VFORK) {
/* wait for the children to exit, ie. emulate vfork */
@@ -297,3 +254,210 @@ linux_clone(struct thread *td, struct linux_clone_args *args)
return (0);
}
+
+static int
+linux_clone_thread(struct thread *td, struct linux_clone_args *args)
+{
+ struct linux_emuldata *em;
+ struct thread *newtd;
+ struct proc *p;
+ int error;
+
+#ifdef DEBUG
+ if (ldebug(clone)) {
+ printf(ARGS(clone, "thread: flags %x, stack %p, parent tid: %p, "
+ "child tid: %p"), (unsigned)args->flags,
+ args->stack, args->parent_tidptr, args->child_tidptr);
+ }
+#endif
+
+ LINUX_CTR4(clone_thread, "thread(%d) flags %x ptid %p ctid %p",
+ td->td_tid, (unsigned)args->flags,
+ args->parent_tidptr, args->child_tidptr);
+
+ if (args->flags & LINUX_CLONE_PARENT_SETTID)
+ if (args->parent_tidptr == NULL)
+ return (EINVAL);
+
+ /* Threads should be created with own stack */
+ if (args->stack == NULL)
+ return (EINVAL);
+
+ p = td->td_proc;
+
+ /* Initialize our td */
+ error = kern_thr_alloc(p, 0, &newtd);
+ if (error)
+ return (error);
+
+ cpu_set_upcall(newtd, td);
+
+ bzero(&newtd->td_startzero,
+ __rangeof(struct thread, td_startzero, td_endzero));
+ bcopy(&td->td_startcopy, &newtd->td_startcopy,
+ __rangeof(struct thread, td_startcopy, td_endcopy));
+
+ newtd->td_proc = p;
+ thread_cow_get(newtd, td);
+
+ /* create the emuldata */
+ linux_proc_init(td, newtd, args->flags);
+
+ em = em_find(newtd);
+ KASSERT(em != NULL, ("clone_thread: emuldata not found.\n"));
+
+ if (args->flags & LINUX_CLONE_SETTLS)
+ linux_set_cloned_tls(newtd, args->tls);
+
+ if (args->flags & LINUX_CLONE_CHILD_SETTID)
+ em->child_set_tid = args->child_tidptr;
+ else
+ em->child_set_tid = NULL;
+
+ if (args->flags & LINUX_CLONE_CHILD_CLEARTID)
+ em->child_clear_tid = args->child_tidptr;
+ else
+ em->child_clear_tid = NULL;
+
+ cpu_thread_clean(newtd);
+
+ linux_set_upcall_kse(newtd, PTROUT(args->stack));
+
+ PROC_LOCK(p);
+ p->p_flag |= P_HADTHREADS;
+ bcopy(p->p_comm, newtd->td_name, sizeof(newtd->td_name));
+
+ if (args->flags & LINUX_CLONE_PARENT)
+ thread_link(newtd, p->p_pptr);
+ else
+ thread_link(newtd, p);
+
+ thread_lock(td);
+ /* let the scheduler know about these things. */
+ sched_fork_thread(td, newtd);
+ thread_unlock(td);
+ if (P_SHOULDSTOP(p))
+ newtd->td_flags |= TDF_ASTPENDING | TDF_NEEDSUSPCHK;
+ PROC_UNLOCK(p);
+
+ tidhash_add(newtd);
+
+#ifdef DEBUG
+ if (ldebug(clone))
+ printf(ARGS(clone, "successful clone to %d, stack %p"),
+ (int)newtd->td_tid, args->stack);
+#endif
+
+ LINUX_CTR2(clone_thread, "thread(%d) successful clone to %d",
+ td->td_tid, newtd->td_tid);
+
+ if (args->flags & LINUX_CLONE_PARENT_SETTID) {
+ error = copyout(&newtd->td_tid, args->parent_tidptr,
+ sizeof(newtd->td_tid));
+ if (error)
+ printf(LMSG("clone_thread: copyout failed!"));
+ }
+
+ /*
+ * Make this runnable after we are finished with it.
+ */
+ thread_lock(newtd);
+ TD_SET_CAN_RUN(newtd);
+ sched_add(newtd, SRQ_BORING);
+ thread_unlock(newtd);
+
+ td->td_retval[0] = newtd->td_tid;
+
+ return (0);
+}
+
+int
+linux_clone(struct thread *td, struct linux_clone_args *args)
+{
+
+ if (args->flags & LINUX_CLONE_THREAD)
+ return (linux_clone_thread(td, args));
+ else
+ return (linux_clone_proc(td, args));
+}
+
+int
+linux_exit(struct thread *td, struct linux_exit_args *args)
+{
+ struct linux_emuldata *em;
+
+ em = em_find(td);
+ KASSERT(em != NULL, ("exit: emuldata not found.\n"));
+
+ LINUX_CTR2(exit, "thread(%d) (%d)", em->em_tid, args->rval);
+
+ linux_thread_detach(td);
+
+ /*
+ * XXX. When the last two threads of a process
+ * exit via pthread_exit() try thr_exit() first.
+ */
+ kern_thr_exit(td);
+ exit1(td, W_EXITCODE(args->rval, 0));
+ /* NOTREACHED */
+}
+
+int
+linux_set_tid_address(struct thread *td, struct linux_set_tid_address_args *args)
+{
+ struct linux_emuldata *em;
+
+ em = em_find(td);
+ KASSERT(em != NULL, ("set_tid_address: emuldata not found.\n"));
+
+ em->child_clear_tid = args->tidptr;
+
+ td->td_retval[0] = em->em_tid;
+
+ LINUX_CTR3(set_tid_address, "tidptr(%d) %p, returns %d",
+ em->em_tid, args->tidptr, td->td_retval[0]);
+
+ return (0);
+}
+
+void
+linux_thread_detach(struct thread *td)
+{
+ struct linux_sys_futex_args cup;
+ struct linux_emuldata *em;
+ int *child_clear_tid;
+ int error;
+
+ em = em_find(td);
+ KASSERT(em != NULL, ("thread_detach: emuldata not found.\n"));
+
+ LINUX_CTR1(thread_detach, "thread(%d)", em->em_tid);
+
+ release_futexes(td, em);
+
+ child_clear_tid = em->child_clear_tid;
+
+ if (child_clear_tid != NULL) {
+
+ LINUX_CTR2(thread_detach, "thread(%d) %p",
+ em->em_tid, child_clear_tid);
+
+ error = suword32(child_clear_tid, 0);
+ if (error != 0)
+ return;
+
+ cup.uaddr = child_clear_tid;
+ cup.op = LINUX_FUTEX_WAKE;
+ cup.val = 1; /* wake one */
+ cup.timeout = NULL;
+ cup.uaddr2 = NULL;
+ cup.val3 = 0;
+ error = linux_sys_futex(td, &cup);
+ /*
+ * this cannot happen at the moment and if this happens it
+ * probably means there is a user space bug
+ */
+ if (error != 0)
+ linux_msg(td, "futex stuff in thread_detach failed.");
+ }
+}
diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c
index 3a0952b..84fc996 100644
--- a/sys/compat/linux/linux_futex.c
+++ b/sys/compat/linux/linux_futex.c
@@ -65,15 +65,12 @@ __KERNEL_RCSID(1, "$NetBSD: linux_futex.c,v 1.7 2006/07/24 19:01:49 manu Exp $")
#include <compat/linux/linux_dtrace.h>
#include <compat/linux/linux_emul.h>
#include <compat/linux/linux_futex.h>
+#include <compat/linux/linux_timer.h>
#include <compat/linux/linux_util.h>
/* DTrace init */
LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE);
-/* Linuxulator-global DTrace probes */
-LIN_SDT_PROBE_DECLARE(locks, emul_lock, locked);
-LIN_SDT_PROBE_DECLARE(locks, emul_lock, unlock);
-
/**
* Futex part for the special DTrace module "locks".
*/
@@ -174,8 +171,8 @@ LIN_SDT_PROBE_DEFINE2(futex, linux_get_robust_list, entry, "struct thread *",
"struct linux_get_robust_list_args *");
LIN_SDT_PROBE_DEFINE1(futex, linux_get_robust_list, copyout_error, "int");
LIN_SDT_PROBE_DEFINE1(futex, linux_get_robust_list, return, "int");
-LIN_SDT_PROBE_DEFINE3(futex, handle_futex_death, entry, "struct proc *",
- "uint32_t *", "unsigned int");
+LIN_SDT_PROBE_DEFINE3(futex, handle_futex_death, entry,
+ "struct linux_emuldata *", "uint32_t *", "unsigned int");
LIN_SDT_PROBE_DEFINE1(futex, handle_futex_death, copyin_error, "int");
LIN_SDT_PROBE_DEFINE1(futex, handle_futex_death, return, "int");
LIN_SDT_PROBE_DEFINE3(futex, fetch_robust_entry, entry,
@@ -183,13 +180,11 @@ LIN_SDT_PROBE_DEFINE3(futex, fetch_robust_entry, entry,
"unsigned int *");
LIN_SDT_PROBE_DEFINE1(futex, fetch_robust_entry, copyin_error, "int");
LIN_SDT_PROBE_DEFINE1(futex, fetch_robust_entry, return, "int");
-LIN_SDT_PROBE_DEFINE1(futex, release_futexes, entry, "struct proc *");
+LIN_SDT_PROBE_DEFINE2(futex, release_futexes, entry, "struct thread *",
+ "struct linux_emuldata *");
LIN_SDT_PROBE_DEFINE1(futex, release_futexes, copyin_error, "int");
LIN_SDT_PROBE_DEFINE0(futex, release_futexes, return);
-static MALLOC_DEFINE(M_FUTEX, "futex", "Linux futexes");
-static MALLOC_DEFINE(M_FUTEX_WP, "futex wp", "Linux futexes wp");
-
struct futex;
struct waiting_proc {
@@ -252,6 +247,21 @@ struct mtx futex_mtx; /* protects the futex list */
* wp_list to prevent double wakeup.
*/
+static void futex_put(struct futex *, struct waiting_proc *);
+static int futex_get0(uint32_t *, struct futex **f, uint32_t);
+static int futex_get(uint32_t *, struct waiting_proc **, struct futex **,
+ uint32_t);
+static int futex_sleep(struct futex *, struct waiting_proc *, int);
+static int futex_wake(struct futex *, int, uint32_t);
+static int futex_requeue(struct futex *, int, struct futex *, int);
+static int futex_wait(struct futex *, struct waiting_proc *, int,
+ uint32_t);
+static int futex_atomic_op(struct thread *, int, uint32_t *);
+static int handle_futex_death(struct linux_emuldata *, uint32_t *,
+ unsigned int);
+static int fetch_robust_entry(struct linux_robust_list **,
+ struct linux_robust_list **, unsigned int *);
+
/* support.s */
int futex_xchgl(int oparg, uint32_t *uaddr, int *oldval);
int futex_addl(int oparg, uint32_t *uaddr, int *oldval);
@@ -259,6 +269,7 @@ int futex_orl(int oparg, uint32_t *uaddr, int *oldval);
int futex_andl(int oparg, uint32_t *uaddr, int *oldval);
int futex_xorl(int oparg, uint32_t *uaddr, int *oldval);
+
static void
futex_put(struct futex *f, struct waiting_proc *wp)
{
@@ -656,10 +667,11 @@ int
linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args)
{
int clockrt, nrwake, op_ret, ret;
- struct linux_emuldata *em;
+ struct linux_pemuldata *pem;
struct waiting_proc *wp;
struct futex *f, *f2;
- struct l_timespec timeout;
+ struct l_timespec ltimeout;
+ struct timespec timeout;
struct timeval utv, ctv;
int timeout_hz;
int error;
@@ -703,6 +715,38 @@ linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args)
LINUX_CTR3(sys_futex, "WAIT uaddr %p val 0x%x bitset 0x%x",
args->uaddr, args->val, args->val3);
+ if (args->timeout != NULL) {
+ error = copyin(args->timeout, &ltimeout, sizeof(ltimeout));
+ if (error) {
+ LIN_SDT_PROBE1(futex, linux_sys_futex, copyin_error,
+ error);
+ LIN_SDT_PROBE1(futex, linux_sys_futex, return, error);
+ return (error);
+ }
+ error = linux_to_native_timespec(&timeout, &ltimeout);
+ if (error)
+ return (error);
+ TIMESPEC_TO_TIMEVAL(&utv, &timeout);
+ error = itimerfix(&utv);
+ if (error) {
+ LIN_SDT_PROBE1(futex, linux_sys_futex, itimerfix_error,
+ error);
+ LIN_SDT_PROBE1(futex, linux_sys_futex, return, error);
+ return (error);
+ }
+ if (clockrt) {
+ microtime(&ctv);
+ timevalsub(&utv, &ctv);
+ } else if (args->op == LINUX_FUTEX_WAIT_BITSET) {
+ microuptime(&ctv);
+ timevalsub(&utv, &ctv);
+ }
+ if (utv.tv_sec < 0)
+ timevalclear(&utv);
+ timeout_hz = tvtohz(&utv);
+ } else
+ timeout_hz = 0;
+
error = futex_get(args->uaddr, &wp, &f,
flags | FUTEX_CREATE_WP);
if (error) {
@@ -735,37 +779,6 @@ linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args)
return (EWOULDBLOCK);
}
- if (args->timeout != NULL) {
- error = copyin(args->timeout, &timeout, sizeof(timeout));
- if (error) {
- LIN_SDT_PROBE1(futex, linux_sys_futex, copyin_error,
- error);
- LIN_SDT_PROBE1(futex, linux_sys_futex, return, error);
- futex_put(f, wp);
- return (error);
- }
- TIMESPEC_TO_TIMEVAL(&utv, &timeout);
- error = itimerfix(&utv);
- if (error) {
- LIN_SDT_PROBE1(futex, linux_sys_futex, itimerfix_error,
- error);
- LIN_SDT_PROBE1(futex, linux_sys_futex, return, error);
- futex_put(f, wp);
- return (error);
- }
- if (clockrt) {
- microtime(&ctv);
- timevalsub(&utv, &ctv);
- } else if (args->op == LINUX_FUTEX_WAIT_BITSET) {
- microuptime(&ctv);
- timevalsub(&utv, &ctv);
- }
- if (utv.tv_sec < 0)
- timevalclear(&utv);
- timeout_hz = tvtohz(&utv);
- } else
- timeout_hz = 0;
-
error = futex_wait(f, wp, timeout_hz, args->val3);
break;
@@ -942,29 +955,43 @@ linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args)
case LINUX_FUTEX_LOCK_PI:
/* not yet implemented */
- linux_msg(td,
- "linux_sys_futex: "
- "op LINUX_FUTEX_LOCK_PI not implemented\n");
- LIN_SDT_PROBE0(futex, linux_sys_futex, unimplemented_lock_pi);
+ pem = pem_find(td->td_proc);
+ if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) {
+ linux_msg(td,
+ "linux_sys_futex: "
+ "unsupported futex_pi op\n");
+ pem->flags |= LINUX_XUNSUP_FUTEXPIOP;
+ LIN_SDT_PROBE0(futex, linux_sys_futex,
+ unimplemented_lock_pi);
+ }
LIN_SDT_PROBE1(futex, linux_sys_futex, return, ENOSYS);
return (ENOSYS);
case LINUX_FUTEX_UNLOCK_PI:
/* not yet implemented */
- linux_msg(td,
- "linux_sys_futex: "
- "op LINUX_FUTEX_UNLOCK_PI not implemented\n");
- LIN_SDT_PROBE0(futex, linux_sys_futex, unimplemented_unlock_pi);
+ pem = pem_find(td->td_proc);
+ if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) {
+ linux_msg(td,
+ "linux_sys_futex: "
+ "unsupported futex_pi op\n");
+ pem->flags |= LINUX_XUNSUP_FUTEXPIOP;
+ LIN_SDT_PROBE0(futex, linux_sys_futex,
+ unimplemented_unlock_pi);
+ }
LIN_SDT_PROBE1(futex, linux_sys_futex, return, ENOSYS);
return (ENOSYS);
case LINUX_FUTEX_TRYLOCK_PI:
/* not yet implemented */
- linux_msg(td,
- "linux_sys_futex: "
- "op LINUX_FUTEX_TRYLOCK_PI not implemented\n");
- LIN_SDT_PROBE0(futex, linux_sys_futex,
- unimplemented_trylock_pi);
+ pem = pem_find(td->td_proc);
+ if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) {
+ linux_msg(td,
+ "linux_sys_futex: "
+ "unsupported futex_pi op\n");
+ pem->flags |= LINUX_XUNSUP_FUTEXPIOP;
+ LIN_SDT_PROBE0(futex, linux_sys_futex,
+ unimplemented_trylock_pi);
+ }
LIN_SDT_PROBE1(futex, linux_sys_futex, return, ENOSYS);
return (ENOSYS);
@@ -976,12 +1003,12 @@ linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args)
* Glibc versions prior to 2.3.3 fall back to FUTEX_WAKE when
* FUTEX_REQUEUE returned EINVAL.
*/
- em = em_find(td->td_proc, EMUL_DONTLOCK);
- if ((em->flags & LINUX_XDEPR_REQUEUEOP) == 0) {
+ pem = pem_find(td->td_proc);
+ if ((pem->flags & LINUX_XDEPR_REQUEUEOP) == 0) {
linux_msg(td,
"linux_sys_futex: "
"unsupported futex_requeue op\n");
- em->flags |= LINUX_XDEPR_REQUEUEOP;
+ pem->flags |= LINUX_XDEPR_REQUEUEOP;
LIN_SDT_PROBE0(futex, linux_sys_futex,
deprecated_requeue);
}
@@ -991,21 +1018,29 @@ linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args)
case LINUX_FUTEX_WAIT_REQUEUE_PI:
/* not yet implemented */
- linux_msg(td,
- "linux_sys_futex: "
- "op FUTEX_WAIT_REQUEUE_PI not implemented\n");
- LIN_SDT_PROBE0(futex, linux_sys_futex,
- unimplemented_wait_requeue_pi);
+ pem = pem_find(td->td_proc);
+ if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) {
+ linux_msg(td,
+ "linux_sys_futex: "
+ "unsupported futex_pi op\n");
+ pem->flags |= LINUX_XUNSUP_FUTEXPIOP;
+ LIN_SDT_PROBE0(futex, linux_sys_futex,
+ unimplemented_wait_requeue_pi);
+ }
LIN_SDT_PROBE1(futex, linux_sys_futex, return, ENOSYS);
return (ENOSYS);
case LINUX_FUTEX_CMP_REQUEUE_PI:
/* not yet implemented */
- linux_msg(td,
- "linux_sys_futex: "
- "op LINUX_FUTEX_CMP_REQUEUE_PI not implemented\n");
- LIN_SDT_PROBE0(futex, linux_sys_futex,
- unimplemented_cmp_requeue_pi);
+ pem = pem_find(td->td_proc);
+ if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) {
+ linux_msg(td,
+ "linux_sys_futex: "
+ "unsupported futex_pi op\n");
+ pem->flags |= LINUX_XUNSUP_FUTEXPIOP;
+ LIN_SDT_PROBE0(futex, linux_sys_futex,
+ unimplemented_cmp_requeue_pi);
+ }
LIN_SDT_PROBE1(futex, linux_sys_futex, return, ENOSYS);
return (ENOSYS);
@@ -1035,9 +1070,8 @@ linux_set_robust_list(struct thread *td, struct linux_set_robust_list_args *args
return (EINVAL);
}
- em = em_find(td->td_proc, EMUL_DOLOCK);
+ em = em_find(td);
em->robust_futexes = args->head;
- EMUL_UNLOCK(&emul_lock);
LIN_SDT_PROBE1(futex, linux_set_robust_list, return, 0);
return (0);
@@ -1049,29 +1083,30 @@ linux_get_robust_list(struct thread *td, struct linux_get_robust_list_args *args
struct linux_emuldata *em;
struct linux_robust_list_head *head;
l_size_t len = sizeof(struct linux_robust_list_head);
+ struct thread *td2;
int error = 0;
LIN_SDT_PROBE2(futex, linux_get_robust_list, entry, td, args);
if (!args->pid) {
- em = em_find(td->td_proc, EMUL_DONTLOCK);
+ em = em_find(td);
+ KASSERT(em != NULL, ("get_robust_list: emuldata notfound.\n"));
head = em->robust_futexes;
} else {
- struct proc *p;
-
- p = pfind(args->pid);
- if (p == NULL) {
+ td2 = tdfind(args->pid, -1);
+ if (td2 == NULL) {
LIN_SDT_PROBE1(futex, linux_get_robust_list, return,
ESRCH);
return (ESRCH);
}
- em = em_find(p, EMUL_DONTLOCK);
+ em = em_find(td2);
+ KASSERT(em != NULL, ("get_robust_list: emuldata notfound.\n"));
/* XXX: ptrace? */
if (priv_check(td, PRIV_CRED_SETUID) ||
priv_check(td, PRIV_CRED_SETEUID) ||
- p_candebug(td, p)) {
- PROC_UNLOCK(p);
+ p_candebug(td, td2->td_proc)) {
+ PROC_UNLOCK(td2->td_proc);
LIN_SDT_PROBE1(futex, linux_get_robust_list, return,
EPERM);
@@ -1079,7 +1114,7 @@ linux_get_robust_list(struct thread *td, struct linux_get_robust_list_args *args
}
head = em->robust_futexes;
- PROC_UNLOCK(p);
+ PROC_UNLOCK(td2->td_proc);
}
error = copyout(&len, args->len, sizeof(l_size_t));
@@ -1101,13 +1136,14 @@ linux_get_robust_list(struct thread *td, struct linux_get_robust_list_args *args
}
static int
-handle_futex_death(struct proc *p, uint32_t *uaddr, unsigned int pi)
+handle_futex_death(struct linux_emuldata *em, uint32_t *uaddr,
+ unsigned int pi)
{
uint32_t uval, nval, mval;
struct futex *f;
int error;
- LIN_SDT_PROBE3(futex, handle_futex_death, entry, p, uaddr, pi);
+ LIN_SDT_PROBE3(futex, handle_futex_death, entry, em, uaddr, pi);
retry:
error = copyin(uaddr, &uval, 4);
@@ -1116,7 +1152,7 @@ retry:
LIN_SDT_PROBE1(futex, handle_futex_death, return, EFAULT);
return (EFAULT);
}
- if ((uval & FUTEX_TID_MASK) == p->p_pid) {
+ if ((uval & FUTEX_TID_MASK) == em->em_tid) {
mval = (uval & FUTEX_WAITERS) | FUTEX_OWNER_DIED;
nval = casuword32(uaddr, uval, mval);
@@ -1173,18 +1209,16 @@ fetch_robust_entry(struct linux_robust_list **entry,
/* This walks the list of robust futexes releasing them. */
void
-release_futexes(struct proc *p)
+release_futexes(struct thread *td, struct linux_emuldata *em)
{
struct linux_robust_list_head *head = NULL;
struct linux_robust_list *entry, *next_entry, *pending;
unsigned int limit = 2048, pi, next_pi, pip;
- struct linux_emuldata *em;
l_long futex_offset;
int rc, error;
- LIN_SDT_PROBE1(futex, release_futexes, entry, p);
+ LIN_SDT_PROBE2(futex, release_futexes, entry, td, em);
- em = em_find(p, EMUL_DONTLOCK);
head = em->robust_futexes;
if (head == NULL) {
@@ -1214,7 +1248,7 @@ release_futexes(struct proc *p)
rc = fetch_robust_entry(&next_entry, PTRIN(&entry->next), &next_pi);
if (entry != pending)
- if (handle_futex_death(p,
+ if (handle_futex_death(em,
(uint32_t *)((caddr_t)entry + futex_offset), pi)) {
LIN_SDT_PROBE0(futex, release_futexes, return);
return;
@@ -1234,7 +1268,7 @@ release_futexes(struct proc *p)
}
if (pending)
- handle_futex_death(p, (uint32_t *)((caddr_t)pending + futex_offset), pip);
+ handle_futex_death(em, (uint32_t *)((caddr_t)pending + futex_offset), pip);
LIN_SDT_PROBE0(futex, release_futexes, return);
}
diff --git a/sys/compat/linux/linux_futex.h b/sys/compat/linux/linux_futex.h
index 0990daa..7922743 100644
--- a/sys/compat/linux/linux_futex.h
+++ b/sys/compat/linux/linux_futex.h
@@ -76,6 +76,7 @@ extern struct mtx futex_mtx;
#define FUTEX_TID_MASK 0x3fffffff
#define FUTEX_BITSET_MATCH_ANY 0xffffffff
-void release_futexes(struct proc *);
+void release_futexes(struct thread *,
+ struct linux_emuldata *);
#endif /* !_LINUX_FUTEX_H */
diff --git a/sys/compat/linux/linux_getcwd.c b/sys/compat/linux/linux_getcwd.c
index ebcf970..e6be015 100644
--- a/sys/compat/linux/linux_getcwd.c
+++ b/sys/compat/linux/linux_getcwd.c
@@ -74,7 +74,7 @@ linux_getcwd(struct thread *td, struct linux_getcwd_args *args)
if (args->bufsize < 2)
return (ERANGE);
- path = malloc(LINUX_PATH_MAX, M_TEMP, M_WAITOK);
+ path = malloc(LINUX_PATH_MAX, M_LINUX, M_WAITOK);
error = kern___getcwd(td, path, UIO_SYSSPACE, args->bufsize,
LINUX_PATH_MAX);
@@ -85,6 +85,6 @@ linux_getcwd(struct thread *td, struct linux_getcwd_args *args)
td->td_retval[0] = lenused;
}
- free(path, M_TEMP);
+ free(path, M_LINUX);
return (error);
}
diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c
index 0148fec..572060e 100644
--- a/sys/compat/linux/linux_ioctl.c
+++ b/sys/compat/linux/linux_ioctl.c
@@ -69,7 +69,6 @@ __FBSDID("$FreeBSD$");
#include <net/if_var.h>
#include <net/if_dl.h>
#include <net/if_types.h>
-#include <net/vnet.h>
#include <dev/usb/usb_ioctl.h>
@@ -96,9 +95,6 @@ __FBSDID("$FreeBSD$");
CTASSERT(LINUX_IFNAMSIZ == IFNAMSIZ);
-FEATURE(linuxulator_v4l, "V4L ioctl wrapper support in the linuxulator");
-FEATURE(linuxulator_v4l2, "V4L2 ioctl wrapper support in the linuxulator");
-
static linux_ioctl_function_t linux_ioctl_cdrom;
static linux_ioctl_function_t linux_ioctl_vfat;
static linux_ioctl_function_t linux_ioctl_console;
@@ -1981,8 +1977,6 @@ linux_ioctl_sound(struct thread *td, struct linux_ioctl_args *args)
* Console related ioctls
*/
-#define ISSIGVALID(sig) ((sig) > 0 && (sig) < NSIG)
-
static int
linux_ioctl_console(struct thread *td, struct linux_ioctl_args *args)
{
@@ -2065,8 +2059,16 @@ linux_ioctl_console(struct thread *td, struct linux_ioctl_args *args)
struct vt_mode mode;
if ((error = copyin((void *)args->arg, &mode, sizeof(mode))))
break;
- if (!ISSIGVALID(mode.frsig) && ISSIGVALID(mode.acqsig))
- mode.frsig = mode.acqsig;
+ if (LINUX_SIG_VALID(mode.relsig))
+ mode.relsig = linux_to_bsd_signal(mode.relsig);
+ else
+ mode.relsig = 0;
+ if (LINUX_SIG_VALID(mode.acqsig))
+ mode.acqsig = linux_to_bsd_signal(mode.acqsig);
+ else
+ mode.acqsig = 0;
+ /* XXX. Linux ignores frsig and set it to 0. */
+ mode.frsig = 0;
if ((error = copyout(&mode, (void *)args->arg, sizeof(mode))))
break;
args->cmd = VT_SETMODE;
@@ -2109,34 +2111,6 @@ linux_ioctl_console(struct thread *td, struct linux_ioctl_args *args)
#define IFP_IS_ETH(ifp) (ifp->if_type == IFT_ETHER)
/*
- * Interface function used by linprocfs (at the time of writing). It's not
- * used by the Linuxulator itself.
- */
-int
-linux_ifname(struct ifnet *ifp, char *buffer, size_t buflen)
-{
- struct ifnet *ifscan;
- int ethno;
-
- IFNET_RLOCK_ASSERT();
-
- /* Short-circuit non ethernet interfaces */
- if (!IFP_IS_ETH(ifp))
- return (strlcpy(buffer, ifp->if_xname, buflen));
-
- /* Determine the (relative) unit number for ethernet interfaces */
- ethno = 0;
- TAILQ_FOREACH(ifscan, &V_ifnet, if_link) {
- if (ifscan == ifp)
- return (snprintf(buffer, buflen, "eth%d", ethno));
- if (IFP_IS_ETH(ifscan))
- ethno++;
- }
-
- return (0);
-}
-
-/*
* Translate a Linux interface name to a FreeBSD interface name,
* and return the associated ifnet structure
* bsdname and lxname need to be least IFNAMSIZ bytes long, but
@@ -3622,9 +3596,16 @@ linux_ioctl(struct thread *td, struct linux_ioctl_args *args)
sx_sunlock(&linux_ioctl_sx);
fdrop(fp, td);
- linux_msg(td, "ioctl fd=%d, cmd=0x%x ('%c',%d) is not implemented",
- args->fd, (int)(args->cmd & 0xffff),
- (int)(args->cmd & 0xff00) >> 8, (int)(args->cmd & 0xff));
+ switch (args->cmd & 0xffff) {
+ case LINUX_BTRFS_IOC_CLONE:
+ return (ENOTSUP);
+
+ default:
+ linux_msg(td, "ioctl fd=%d, cmd=0x%x ('%c',%d) is not implemented",
+ args->fd, (int)(args->cmd & 0xffff),
+ (int)(args->cmd & 0xff00) >> 8, (int)(args->cmd & 0xff));
+ break;
+ }
return (EINVAL);
}
diff --git a/sys/compat/linux/linux_ioctl.h b/sys/compat/linux/linux_ioctl.h
index 3f63b21..873937d 100644
--- a/sys/compat/linux/linux_ioctl.h
+++ b/sys/compat/linux/linux_ioctl.h
@@ -581,13 +581,6 @@
#define LINUX_IOCTL_DRM_MAX 0x64ff
/*
- * This doesn't really belong here, but I can't think of a better
- * place to put it.
- */
-struct ifnet;
-int linux_ifname(struct ifnet *, char *, size_t);
-
-/*
* video
*/
#define LINUX_VIDIOCGCAP 0x7601
@@ -752,6 +745,12 @@ int linux_ifname(struct ifnet *, char *, size_t);
#define FBSD_LUSB_MIN 0xffdd
/*
+ * Linux btrfs clone operation
+ */
+#define LINUX_BTRFS_IOC_CLONE 0x9409 /* 0x40049409 */
+
+
+/*
* Pluggable ioctl handlers
*/
struct linux_ioctl_args;
diff --git a/sys/compat/linux/linux_ipc.c b/sys/compat/linux/linux_ipc.c
index 1237edc..7a92c6a 100644
--- a/sys/compat/linux/linux_ipc.c
+++ b/sys/compat/linux/linux_ipc.c
@@ -117,16 +117,6 @@ bsd_to_linux_shm_info( struct shm_info *bpp, struct l_shm_info *lpp)
lpp->swap_successes = bpp->swap_successes ;
}
-struct l_ipc_perm {
- l_key_t key;
- l_uid16_t uid;
- l_gid16_t gid;
- l_uid16_t cuid;
- l_gid16_t cgid;
- l_ushort mode;
- l_ushort seq;
-};
-
static void
linux_to_bsd_ipc_perm(struct l_ipc_perm *lpp, struct ipc_perm *bpp)
{
diff --git a/sys/compat/linux/linux_ipc.h b/sys/compat/linux/linux_ipc.h
index f1531ba..8e9c050 100644
--- a/sys/compat/linux/linux_ipc.h
+++ b/sys/compat/linux/linux_ipc.h
@@ -82,7 +82,7 @@
#define LINUX_IPC_64 0x0100 /* New version (support 32-bit UIDs, bigger
message sizes, etc. */
-#if defined(__i386__) || defined(__amd64__)
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
struct linux_msgctl_args
{
@@ -177,6 +177,6 @@ int linux_shmctl(struct thread *, struct linux_shmctl_args *);
int linux_shmdt(struct thread *, struct linux_shmdt_args *);
int linux_shmget(struct thread *, struct linux_shmget_args *);
-#endif /* __i386__ || __amd64__ */
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
#endif /* _LINUX_IPC_H_ */
diff --git a/sys/compat/linux/linux_mib.c b/sys/compat/linux/linux_mib.c
index 8f8cb81..396344b 100644
--- a/sys/compat/linux/linux_mib.c
+++ b/sys/compat/linux/linux_mib.c
@@ -29,8 +29,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include "opt_compat.h"
-
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/sdt.h>
@@ -41,85 +39,11 @@ __FBSDID("$FreeBSD$");
#include <sys/mount.h>
#include <sys/jail.h>
#include <sys/lock.h>
-#include <sys/mutex.h>
#include <sys/sx.h>
-#ifdef COMPAT_LINUX32
-#include <machine/../linux32/linux.h>
-#else
-#include <machine/../linux/linux.h>
-#endif
-#include <compat/linux/linux_dtrace.h>
#include <compat/linux/linux_mib.h>
#include <compat/linux/linux_misc.h>
-/* DTrace init */
-LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE);
-
-/**
- * DTrace probes in this module.
- */
-LIN_SDT_PROBE_DEFINE0(mib, linux_sysctl_osname, entry);
-LIN_SDT_PROBE_DEFINE1(mib, linux_sysctl_osname, sysctl_string_error, "int");
-LIN_SDT_PROBE_DEFINE1(mib, linux_sysctl_osname, return, "int");
-
-LIN_SDT_PROBE_DEFINE0(mib, linux_sysctl_osrelease, entry);
-LIN_SDT_PROBE_DEFINE1(mib, linux_sysctl_osrelease, sysctl_string_error, "int");
-LIN_SDT_PROBE_DEFINE1(mib, linux_sysctl_osrelease, return, "int");
-LIN_SDT_PROBE_DEFINE0(mib, linux_sysctl_oss_version, entry);
-LIN_SDT_PROBE_DEFINE1(mib, linux_sysctl_oss_version, sysctl_string_error,
- "int");
-LIN_SDT_PROBE_DEFINE1(mib, linux_sysctl_oss_version, return, "int");
-LIN_SDT_PROBE_DEFINE2(mib, linux_map_osrel, entry, "char *", "int *");
-LIN_SDT_PROBE_DEFINE1(mib, linux_map_osrel, return, "int");
-LIN_SDT_PROBE_DEFINE2(mib, linux_get_prison, entry, "struct prison *",
- "struct prison **");
-LIN_SDT_PROBE_DEFINE1(mib, linux_get_prison, return, "struct linux_prison *");
-LIN_SDT_PROBE_DEFINE2(mib, linux_alloc_prison, entry, "struct prison *",
- "struct linux_prison **");
-LIN_SDT_PROBE_DEFINE1(mib, linux_alloc_prison, return, "int");
-LIN_SDT_PROBE_DEFINE2(mib, linux_prison_create, entry, "void *", "void *");
-LIN_SDT_PROBE_DEFINE1(mib, linux_prison_create, vfs_copyopt_error, "int");
-LIN_SDT_PROBE_DEFINE1(mib, linux_prison_create, return, "int");
-LIN_SDT_PROBE_DEFINE2(mib, linux_prison_check, entry, "void *", "void *");
-LIN_SDT_PROBE_DEFINE1(mib, linux_prison_check, vfs_copyopt_error, "int");
-LIN_SDT_PROBE_DEFINE1(mib, linux_prison_check, vfs_getopt_error, "int");
-LIN_SDT_PROBE_DEFINE1(mib, linux_prison_check, return, "int");
-LIN_SDT_PROBE_DEFINE2(mib, linux_prison_set, entry, "void *", "void *");
-LIN_SDT_PROBE_DEFINE1(mib, linux_prison_set, vfs_copyopt_error, "int");
-LIN_SDT_PROBE_DEFINE1(mib, linux_prison_set, vfs_getopt_error, "int");
-LIN_SDT_PROBE_DEFINE1(mib, linux_prison_set, return, "int");
-LIN_SDT_PROBE_DEFINE2(mib, linux_prison_get, entry, "void *", "void *");
-LIN_SDT_PROBE_DEFINE1(mib, linux_prison_get, vfs_setopt_error, "int");
-LIN_SDT_PROBE_DEFINE1(mib, linux_prison_get, vfs_setopts_error, "int");
-LIN_SDT_PROBE_DEFINE1(mib, linux_prison_get, return, "int");
-LIN_SDT_PROBE_DEFINE1(mib, linux_prison_destructor, entry, "void *");
-LIN_SDT_PROBE_DEFINE0(mib, linux_prison_destructor, return);
-LIN_SDT_PROBE_DEFINE0(mib, linux_osd_jail_register, entry);
-LIN_SDT_PROBE_DEFINE0(mib, linux_osd_jail_register, return);
-LIN_SDT_PROBE_DEFINE0(mib, linux_osd_jail_deregister, entry);
-LIN_SDT_PROBE_DEFINE0(mib, linux_osd_jail_deregister, return);
-LIN_SDT_PROBE_DEFINE2(mib, linux_get_osname, entry, "struct thread *",
- "char *");
-LIN_SDT_PROBE_DEFINE0(mib, linux_get_osname, return);
-LIN_SDT_PROBE_DEFINE2(mib, linux_set_osname, entry, "struct thread *",
- "char *");
-LIN_SDT_PROBE_DEFINE1(mib, linux_set_osname, return, "int");
-LIN_SDT_PROBE_DEFINE2(mib, linux_get_osrelease, entry, "struct thread *",
- "char *");
-LIN_SDT_PROBE_DEFINE0(mib, linux_get_osrelease, return);
-LIN_SDT_PROBE_DEFINE1(mib, linux_kernver, entry, "struct thread *");
-LIN_SDT_PROBE_DEFINE1(mib, linux_kernver, return, "int");
-LIN_SDT_PROBE_DEFINE2(mib, linux_set_osrelease, entry, "struct thread *",
- "char *");
-LIN_SDT_PROBE_DEFINE1(mib, linux_set_osrelease, return, "int");
-LIN_SDT_PROBE_DEFINE1(mib, linux_get_oss_version, entry, "struct thread *");
-LIN_SDT_PROBE_DEFINE1(mib, linux_get_oss_version, return, "int");
-
-LIN_SDT_PROBE_DEFINE2(mib, linux_set_oss_version, entry, "struct thread *",
- "int");
-LIN_SDT_PROBE_DEFINE1(mib, linux_set_oss_version, return, "int");
-
struct linux_prison {
char pr_osname[LINUX_MAX_UTSNAME];
char pr_osrelease[LINUX_MAX_UTSNAME];
@@ -129,15 +53,14 @@ struct linux_prison {
static struct linux_prison lprison0 = {
.pr_osname = "Linux",
- .pr_osrelease = "2.6.18",
+ .pr_osrelease = LINUX_VERSION_STR,
.pr_oss_version = 0x030600,
- .pr_osrel = 2006018
+ .pr_osrel = LINUX_VERSION_CODE
};
static unsigned linux_osd_jail_slot;
-static SYSCTL_NODE(_compat, OID_AUTO, linux, CTLFLAG_RW, 0,
- "Linux mode");
+SYSCTL_NODE(_compat, OID_AUTO, linux, CTLFLAG_RW, 0, "Linux mode");
static int linux_set_osname(struct thread *td, char *osname);
static int linux_set_osrelease(struct thread *td, char *osrelease);
@@ -149,19 +72,12 @@ linux_sysctl_osname(SYSCTL_HANDLER_ARGS)
char osname[LINUX_MAX_UTSNAME];
int error;
- LIN_SDT_PROBE0(mib, linux_sysctl_osname, entry);
-
linux_get_osname(req->td, osname);
error = sysctl_handle_string(oidp, osname, LINUX_MAX_UTSNAME, req);
- if (error != 0 || req->newptr == NULL) {
- LIN_SDT_PROBE1(mib, linux_sysctl_osname, sysctl_string_error,
- error);
- LIN_SDT_PROBE1(mib, linux_sysctl_osname, return, error);
+ if (error != 0 || req->newptr == NULL)
return (error);
- }
error = linux_set_osname(req->td, osname);
- LIN_SDT_PROBE1(mib, linux_sysctl_osname, return, error);
return (error);
}
@@ -176,19 +92,12 @@ linux_sysctl_osrelease(SYSCTL_HANDLER_ARGS)
char osrelease[LINUX_MAX_UTSNAME];
int error;
- LIN_SDT_PROBE0(mib, linux_sysctl_osrelease, entry);
-
linux_get_osrelease(req->td, osrelease);
error = sysctl_handle_string(oidp, osrelease, LINUX_MAX_UTSNAME, req);
- if (error != 0 || req->newptr == NULL) {
- LIN_SDT_PROBE1(mib, linux_sysctl_osrelease, sysctl_string_error,
- error);
- LIN_SDT_PROBE1(mib, linux_sysctl_osrelease, return, error);
+ if (error != 0 || req->newptr == NULL)
return (error);
- }
error = linux_set_osrelease(req->td, osrelease);
- LIN_SDT_PROBE1(mib, linux_sysctl_osrelease, return, error);
return (error);
}
@@ -203,19 +112,12 @@ linux_sysctl_oss_version(SYSCTL_HANDLER_ARGS)
int oss_version;
int error;
- LIN_SDT_PROBE0(mib, linux_sysctl_oss_version, entry);
-
oss_version = linux_get_oss_version(req->td);
error = sysctl_handle_int(oidp, &oss_version, 0, req);
- if (error != 0 || req->newptr == NULL) {
- LIN_SDT_PROBE1(mib, linux_sysctl_oss_version,
- sysctl_string_error, error);
- LIN_SDT_PROBE1(mib, linux_sysctl_oss_version, return, error);
+ if (error != 0 || req->newptr == NULL)
return (error);
- }
error = linux_set_oss_version(req->td, oss_version);
- LIN_SDT_PROBE1(mib, linux_sysctl_oss_version, return, error);
return (error);
}
@@ -233,37 +135,26 @@ linux_map_osrel(char *osrelease, int *osrel)
char *sep, *eosrelease;
int len, v0, v1, v2, v;
- LIN_SDT_PROBE2(mib, linux_map_osrel, entry, osrelease, osrel);
-
len = strlen(osrelease);
eosrelease = osrelease + len;
v0 = strtol(osrelease, &sep, 10);
- if (osrelease == sep || sep + 1 >= eosrelease || *sep != '.') {
- LIN_SDT_PROBE1(mib, linux_map_osrel, return, EINVAL);
+ if (osrelease == sep || sep + 1 >= eosrelease || *sep != '.')
return (EINVAL);
- }
osrelease = sep + 1;
v1 = strtol(osrelease, &sep, 10);
- if (osrelease == sep || sep + 1 >= eosrelease || *sep != '.') {
- LIN_SDT_PROBE1(mib, linux_map_osrel, return, EINVAL);
+ if (osrelease == sep || sep + 1 >= eosrelease || *sep != '.')
return (EINVAL);
- }
osrelease = sep + 1;
v2 = strtol(osrelease, &sep, 10);
- if (osrelease == sep || sep != eosrelease) {
- LIN_SDT_PROBE1(mib, linux_map_osrel, return, EINVAL);
+ if (osrelease == sep || sep != eosrelease)
return (EINVAL);
- }
v = v0 * 1000000 + v1 * 1000 + v2;
- if (v < 1000000) {
- LIN_SDT_PROBE1(mib, linux_map_osrel, return, EINVAL);
+ if (v < 1000000)
return (EINVAL);
- }
*osrel = v;
- LIN_SDT_PROBE1(mib, linux_map_osrel, return, 0);
return (0);
}
@@ -277,8 +168,6 @@ linux_find_prison(struct prison *spr, struct prison **prp)
struct prison *pr;
struct linux_prison *lpr;
- LIN_SDT_PROBE2(mib, linux_get_prison, entry, spr, prp);
-
if (!linux_osd_jail_slot)
/* In case osd_register failed. */
spr = &prison0;
@@ -293,7 +182,6 @@ linux_find_prison(struct prison *spr, struct prison **prp)
}
*prp = pr;
- LIN_SDT_PROBE1(mib, linux_get_prison, return, lpr);
return (lpr);
}
@@ -308,8 +196,6 @@ linux_alloc_prison(struct prison *pr, struct linux_prison **lprp)
struct linux_prison *lpr, *nlpr;
int error;
- LIN_SDT_PROBE2(mib, linux_alloc_prison, entry, pr, lprp);
-
/* If this prison already has Linux info, return that. */
error = 0;
lpr = linux_find_prison(pr, &ppr);
@@ -343,7 +229,6 @@ linux_alloc_prison(struct prison *pr, struct linux_prison **lprp)
else
mtx_unlock(&pr->pr_mtx);
- LIN_SDT_PROBE1(mib, linux_alloc_prison, return, error);
return (error);
}
@@ -355,26 +240,16 @@ linux_prison_create(void *obj, void *data)
{
struct prison *pr = obj;
struct vfsoptlist *opts = data;
- int jsys, error;
-
- LIN_SDT_PROBE2(mib, linux_prison_create, entry, obj, data);
+ int jsys;
- error = vfs_copyopt(opts, "linux", &jsys, sizeof(jsys));
- if (error != 0) {
- LIN_SDT_PROBE1(mib, linux_prison_create, vfs_copyopt_error,
- error);
- } else if (jsys == JAIL_SYS_INHERIT) {
- LIN_SDT_PROBE1(mib, linux_prison_create, return, 0);
+ if (vfs_copyopt(opts, "linux", &jsys, sizeof(jsys)) == 0 &&
+ jsys == JAIL_SYS_INHERIT)
return (0);
- }
/*
* Inherit a prison's initial values from its parent
* (different from JAIL_SYS_INHERIT which also inherits changes).
*/
- error = linux_alloc_prison(pr, NULL);
-
- LIN_SDT_PROBE1(mib, linux_prison_create, return, error);
- return (error);
+ return (linux_alloc_prison(pr, NULL));
}
static int
@@ -384,80 +259,46 @@ linux_prison_check(void *obj __unused, void *data)
char *osname, *osrelease;
int error, jsys, len, osrel, oss_version;
- LIN_SDT_PROBE2(mib, linux_prison_check, entry, obj, data);
-
/* Check that the parameters are correct. */
error = vfs_copyopt(opts, "linux", &jsys, sizeof(jsys));
- if (error != 0) {
- LIN_SDT_PROBE1(mib, linux_prison_check, vfs_copyopt_error,
- error);
- }
if (error != ENOENT) {
- if (error != 0) {
- LIN_SDT_PROBE1(mib, linux_prison_check, return, error);
+ if (error != 0)
return (error);
- }
- if (jsys != JAIL_SYS_NEW && jsys != JAIL_SYS_INHERIT) {
- LIN_SDT_PROBE1(mib, linux_prison_check, return, EINVAL);
+ if (jsys != JAIL_SYS_NEW && jsys != JAIL_SYS_INHERIT)
return (EINVAL);
- }
}
error = vfs_getopt(opts, "linux.osname", (void **)&osname, &len);
- if (error != 0) {
- LIN_SDT_PROBE1(mib, linux_prison_check, vfs_getopt_error,
- error);
- }
if (error != ENOENT) {
- if (error != 0) {
- LIN_SDT_PROBE1(mib, linux_prison_check, return, error);
+ if (error != 0)
return (error);
- }
- if (len == 0 || osname[len - 1] != '\0') {
- LIN_SDT_PROBE1(mib, linux_prison_check, return, EINVAL);
+ if (len == 0 || osname[len - 1] != '\0')
return (EINVAL);
- }
if (len > LINUX_MAX_UTSNAME) {
vfs_opterror(opts, "linux.osname too long");
- LIN_SDT_PROBE1(mib, linux_prison_check, return,
- ENAMETOOLONG);
return (ENAMETOOLONG);
}
}
error = vfs_getopt(opts, "linux.osrelease", (void **)&osrelease, &len);
- if (error != 0) {
- LIN_SDT_PROBE1(mib, linux_prison_check, vfs_getopt_error,
- error);
- }
if (error != ENOENT) {
- if (error != 0) {
- LIN_SDT_PROBE1(mib, linux_prison_check, return, error);
+ if (error != 0)
return (error);
- }
- if (len == 0 || osrelease[len - 1] != '\0') {
- LIN_SDT_PROBE1(mib, linux_prison_check, return, EINVAL);
+ if (len == 0 || osrelease[len - 1] != '\0')
return (EINVAL);
- }
if (len > LINUX_MAX_UTSNAME) {
vfs_opterror(opts, "linux.osrelease too long");
- LIN_SDT_PROBE1(mib, linux_prison_check, return,
- ENAMETOOLONG);
return (ENAMETOOLONG);
}
error = linux_map_osrel(osrelease, &osrel);
if (error != 0) {
vfs_opterror(opts, "linux.osrelease format error");
- LIN_SDT_PROBE1(mib, linux_prison_check, return, error);
return (error);
}
}
error = vfs_copyopt(opts, "linux.oss_version", &oss_version,
sizeof(oss_version));
- if (error != 0)
- LIN_SDT_PROBE1(mib, linux_prison_check, vfs_copyopt_error, error);
if (error == ENOENT)
error = 0;
- LIN_SDT_PROBE1(mib, linux_prison_check, return, error);
return (error);
}
@@ -470,32 +311,22 @@ linux_prison_set(void *obj, void *data)
char *osname, *osrelease;
int error, gotversion, jsys, len, oss_version;
- LIN_SDT_PROBE2(mib, linux_prison_set, entry, obj, data);
-
/* Set the parameters, which should be correct. */
error = vfs_copyopt(opts, "linux", &jsys, sizeof(jsys));
- if (error != 0)
- LIN_SDT_PROBE1(mib, linux_prison_set, vfs_copyopt_error, error);
if (error == ENOENT)
jsys = -1;
error = vfs_getopt(opts, "linux.osname", (void **)&osname, &len);
- if (error != 0)
- LIN_SDT_PROBE1(mib, linux_prison_set, vfs_getopt_error, error);
if (error == ENOENT)
osname = NULL;
else
jsys = JAIL_SYS_NEW;
error = vfs_getopt(opts, "linux.osrelease", (void **)&osrelease, &len);
- if (error != 0)
- LIN_SDT_PROBE1(mib, linux_prison_set, vfs_getopt_error, error);
if (error == ENOENT)
osrelease = NULL;
else
jsys = JAIL_SYS_NEW;
error = vfs_copyopt(opts, "linux.oss_version", &oss_version,
sizeof(oss_version));
- if (error != 0)
- LIN_SDT_PROBE1(mib, linux_prison_set, vfs_copyopt_error, error);
if (error == ENOENT)
gotversion = 0;
else {
@@ -517,15 +348,12 @@ linux_prison_set(void *obj, void *data)
error = linux_alloc_prison(pr, &lpr);
if (error) {
mtx_unlock(&pr->pr_mtx);
- LIN_SDT_PROBE1(mib, linux_prison_set, return, error);
return (error);
}
if (osrelease) {
error = linux_map_osrel(osrelease, &lpr->pr_osrel);
if (error) {
mtx_unlock(&pr->pr_mtx);
- LIN_SDT_PROBE1(mib, linux_prison_set, return,
- error);
return (error);
}
strlcpy(lpr->pr_osrelease, osrelease,
@@ -538,7 +366,6 @@ linux_prison_set(void *obj, void *data)
mtx_unlock(&pr->pr_mtx);
}
- LIN_SDT_PROBE1(mib, linux_prison_set, return, 0);
return (0);
}
@@ -561,74 +388,44 @@ linux_prison_get(void *obj, void *data)
static int version0;
- LIN_SDT_PROBE2(mib, linux_prison_get, entry, obj, data);
-
/* See if this prison is the one with the Linux info. */
lpr = linux_find_prison(pr, &ppr);
i = (ppr == pr) ? JAIL_SYS_NEW : JAIL_SYS_INHERIT;
error = vfs_setopt(opts, "linux", &i, sizeof(i));
- if (error != 0) {
- LIN_SDT_PROBE1(mib, linux_prison_get, vfs_setopt_error, error);
- if (error != ENOENT)
- goto done;
- }
+ if (error != 0 && error != ENOENT)
+ goto done;
if (i) {
error = vfs_setopts(opts, "linux.osname", lpr->pr_osname);
- if (error != 0) {
- LIN_SDT_PROBE1(mib, linux_prison_get, vfs_setopts_error,
- error);
- if (error != ENOENT)
- goto done;
- }
+ if (error != 0 && error != ENOENT)
+ goto done;
error = vfs_setopts(opts, "linux.osrelease", lpr->pr_osrelease);
- if (error != 0) {
- LIN_SDT_PROBE1(mib, linux_prison_get, vfs_setopts_error,
- error);
- if (error != ENOENT)
- goto done;
- }
+ if (error != 0 && error != ENOENT)
+ goto done;
error = vfs_setopt(opts, "linux.oss_version",
&lpr->pr_oss_version, sizeof(lpr->pr_oss_version));
- if (error != 0) {
- LIN_SDT_PROBE1(mib, linux_prison_get, vfs_setopt_error,
- error);
- if(error != ENOENT)
- goto done;
- }
+ if (error != 0 && error != ENOENT)
+ goto done;
} else {
/*
* If this prison is inheriting its Linux info, report
* empty/zero parameters.
*/
error = vfs_setopts(opts, "linux.osname", "");
- if (error != 0) {
- LIN_SDT_PROBE1(mib, linux_prison_get, vfs_setopts_error,
- error);
- if(error != ENOENT)
- goto done;
- }
+ if (error != 0 && error != ENOENT)
+ goto done;
error = vfs_setopts(opts, "linux.osrelease", "");
- if (error != 0) {
- LIN_SDT_PROBE1(mib, linux_prison_get, vfs_setopts_error,
- error);
- if(error != ENOENT)
- goto done;
- }
+ if (error != 0 && error != ENOENT)
+ goto done;
error = vfs_setopt(opts, "linux.oss_version", &version0,
sizeof(lpr->pr_oss_version));
- if (error != 0) {
- LIN_SDT_PROBE1(mib, linux_prison_get, vfs_setopt_error,
- error);
- if(error != ENOENT)
- goto done;
- }
+ if (error != 0 && error != ENOENT)
+ goto done;
}
error = 0;
done:
mtx_unlock(&ppr->pr_mtx);
- LIN_SDT_PROBE1(mib, linux_prison_get, return, error);
return (error);
}
@@ -636,9 +433,7 @@ static void
linux_prison_destructor(void *data)
{
- LIN_SDT_PROBE1(mib, linux_prison_destructor, entry, data);
free(data, M_PRISON);
- LIN_SDT_PROBE0(mib, linux_prison_destructor, return);
}
void
@@ -652,8 +447,6 @@ linux_osd_jail_register(void)
[PR_METHOD_CHECK] = linux_prison_check
};
- LIN_SDT_PROBE0(mib, linux_osd_jail_register, entry);
-
linux_osd_jail_slot =
osd_jail_register(linux_prison_destructor, methods);
if (linux_osd_jail_slot > 0) {
@@ -663,20 +456,14 @@ linux_osd_jail_register(void)
(void)linux_alloc_prison(pr, NULL);
sx_xunlock(&allprison_lock);
}
-
- LIN_SDT_PROBE0(mib, linux_osd_jail_register, return);
}
void
linux_osd_jail_deregister(void)
{
- LIN_SDT_PROBE0(mib, linux_osd_jail_register, entry);
-
if (linux_osd_jail_slot)
osd_jail_deregister(linux_osd_jail_slot);
-
- LIN_SDT_PROBE0(mib, linux_osd_jail_register, return);
}
void
@@ -685,13 +472,9 @@ linux_get_osname(struct thread *td, char *dst)
struct prison *pr;
struct linux_prison *lpr;
- LIN_SDT_PROBE2(mib, linux_get_osname, entry, td, dst);
-
lpr = linux_find_prison(td->td_ucred->cr_prison, &pr);
bcopy(lpr->pr_osname, dst, LINUX_MAX_UTSNAME);
mtx_unlock(&pr->pr_mtx);
-
- LIN_SDT_PROBE0(mib, linux_get_osname, return);
}
static int
@@ -700,13 +483,10 @@ linux_set_osname(struct thread *td, char *osname)
struct prison *pr;
struct linux_prison *lpr;
- LIN_SDT_PROBE2(mib, linux_set_osname, entry, td, osname);
-
lpr = linux_find_prison(td->td_ucred->cr_prison, &pr);
strlcpy(lpr->pr_osname, osname, LINUX_MAX_UTSNAME);
mtx_unlock(&pr->pr_mtx);
- LIN_SDT_PROBE1(mib, linux_set_osname, return, 0);
return (0);
}
@@ -716,13 +496,9 @@ linux_get_osrelease(struct thread *td, char *dst)
struct prison *pr;
struct linux_prison *lpr;
- LIN_SDT_PROBE2(mib, linux_get_osrelease, entry, td, dst);
-
lpr = linux_find_prison(td->td_ucred->cr_prison, &pr);
bcopy(lpr->pr_osrelease, dst, LINUX_MAX_UTSNAME);
mtx_unlock(&pr->pr_mtx);
-
- LIN_SDT_PROBE0(mib, linux_get_osrelease, return);
}
int
@@ -732,13 +508,10 @@ linux_kernver(struct thread *td)
struct linux_prison *lpr;
int osrel;
- LIN_SDT_PROBE1(mib, linux_kernver, entry, td);
-
lpr = linux_find_prison(td->td_ucred->cr_prison, &pr);
osrel = lpr->pr_osrel;
mtx_unlock(&pr->pr_mtx);
- LIN_SDT_PROBE1(mib, linux_kernver, return, osrel);
return (osrel);
}
@@ -749,15 +522,12 @@ linux_set_osrelease(struct thread *td, char *osrelease)
struct linux_prison *lpr;
int error;
- LIN_SDT_PROBE2(mib, linux_set_osrelease, entry, td, osrelease);
-
lpr = linux_find_prison(td->td_ucred->cr_prison, &pr);
error = linux_map_osrel(osrelease, &lpr->pr_osrel);
if (error == 0)
strlcpy(lpr->pr_osrelease, osrelease, LINUX_MAX_UTSNAME);
mtx_unlock(&pr->pr_mtx);
- LIN_SDT_PROBE1(mib, linux_set_osrelease, return, error);
return (error);
}
@@ -768,13 +538,10 @@ linux_get_oss_version(struct thread *td)
struct linux_prison *lpr;
int version;
- LIN_SDT_PROBE1(mib, linux_get_oss_version, entry, td);
-
lpr = linux_find_prison(td->td_ucred->cr_prison, &pr);
version = lpr->pr_oss_version;
mtx_unlock(&pr->pr_mtx);
- LIN_SDT_PROBE1(mib, linux_get_oss_version, return, version);
return (version);
}
@@ -784,74 +551,9 @@ linux_set_oss_version(struct thread *td, int oss_version)
struct prison *pr;
struct linux_prison *lpr;
- LIN_SDT_PROBE2(mib, linux_set_oss_version, entry, td, oss_version);
-
lpr = linux_find_prison(td->td_ucred->cr_prison, &pr);
lpr->pr_oss_version = oss_version;
mtx_unlock(&pr->pr_mtx);
- LIN_SDT_PROBE1(mib, linux_set_oss_version, return, 0);
return (0);
}
-
-#if defined(DEBUG) || defined(KTR)
-/* XXX: can be removed when every ldebug(...) and KTR stuff are removed. */
-
-u_char linux_debug_map[howmany(LINUX_SYS_MAXSYSCALL, sizeof(u_char))];
-
-static int
-linux_debug(int syscall, int toggle, int global)
-{
-
- if (global) {
- char c = toggle ? 0 : 0xff;
-
- memset(linux_debug_map, c, sizeof(linux_debug_map));
- return (0);
- }
- if (syscall < 0 || syscall >= LINUX_SYS_MAXSYSCALL)
- return (EINVAL);
- if (toggle)
- clrbit(linux_debug_map, syscall);
- else
- setbit(linux_debug_map, syscall);
- return (0);
-}
-
-/*
- * Usage: sysctl linux.debug=<syscall_nr>.<0/1>
- *
- * E.g.: sysctl linux.debug=21.0
- *
- * As a special case, syscall "all" will apply to all syscalls globally.
- */
-#define LINUX_MAX_DEBUGSTR 16
-static int
-linux_sysctl_debug(SYSCTL_HANDLER_ARGS)
-{
- char value[LINUX_MAX_DEBUGSTR], *p;
- int error, sysc, toggle;
- int global = 0;
-
- value[0] = '\0';
- error = sysctl_handle_string(oidp, value, LINUX_MAX_DEBUGSTR, req);
- if (error || req->newptr == NULL)
- return (error);
- for (p = value; *p != '\0' && *p != '.'; p++);
- if (*p == '\0')
- return (EINVAL);
- *p++ = '\0';
- sysc = strtol(value, NULL, 0);
- toggle = strtol(p, NULL, 0);
- if (strcmp(value, "all") == 0)
- global = 1;
- error = linux_debug(sysc, toggle, global);
- return (error);
-}
-
-SYSCTL_PROC(_compat_linux, OID_AUTO, debug,
- CTLTYPE_STRING | CTLFLAG_RW,
- 0, 0, linux_sysctl_debug, "A",
- "Linux debugging control");
-
-#endif /* DEBUG || KTR */
diff --git a/sys/compat/linux/linux_mib.h b/sys/compat/linux/linux_mib.h
index e8eedf9..80b6c97 100644
--- a/sys/compat/linux/linux_mib.h
+++ b/sys/compat/linux/linux_mib.h
@@ -31,6 +31,10 @@
#ifndef _LINUX_MIB_H_
#define _LINUX_MIB_H_
+#ifdef SYSCTL_DECL
+SYSCTL_DECL(_compat_linux);
+#endif
+
void linux_osd_jail_register(void);
void linux_osd_jail_deregister(void);
@@ -42,8 +46,19 @@ int linux_get_oss_version(struct thread *td);
int linux_kernver(struct thread *td);
-#define LINUX_KERNVER_2004000 2004000
-#define LINUX_KERNVER_2006000 2006000
+#define LINUX_KVERSION 2
+#define LINUX_KPATCHLEVEL 6
+#define LINUX_KSUBLEVEL 32
+
+#define LINUX_KERNVER(a,b,c) (((a) << 16) + ((b) << 8) + (c))
+#define LINUX_VERSION_CODE LINUX_KERNVER(LINUX_KVERSION, \
+ LINUX_KPATCHLEVEL, LINUX_KSUBLEVEL)
+#define LINUX_KERNVERSTR(x) #x
+#define LINUX_XKERNVERSTR(x) LINUX_KERNVERSTR(x)
+#define LINUX_VERSION_STR LINUX_XKERNVERSTR(LINUX_KVERSION.LINUX_KPATCHLEVEL.LINUX_KSUBLEVEL)
+
+#define LINUX_KERNVER_2004000 LINUX_KERNVER(2,4,0)
+#define LINUX_KERNVER_2006000 LINUX_KERNVER(2,6,0)
#define linux_use26(t) (linux_kernver(t) >= LINUX_KERNVER_2006000)
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index ec531d3..fa5feaf 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -88,21 +88,24 @@ __FBSDID("$FreeBSD$");
#include <compat/linux/linux_file.h>
#include <compat/linux/linux_mib.h>
#include <compat/linux/linux_signal.h>
+#include <compat/linux/linux_timer.h>
#include <compat/linux/linux_util.h>
#include <compat/linux/linux_sysproto.h>
#include <compat/linux/linux_emul.h>
#include <compat/linux/linux_misc.h>
-/* DTrace init */
-LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE);
-
-/* Linuxulator-global DTrace probes */
-LIN_SDT_PROBE_DECLARE(locks, emul_lock, locked);
-LIN_SDT_PROBE_DECLARE(locks, emul_lock, unlock);
-LIN_SDT_PROBE_DECLARE(locks, emul_shared_rlock, locked);
-LIN_SDT_PROBE_DECLARE(locks, emul_shared_rlock, unlock);
-LIN_SDT_PROBE_DECLARE(locks, emul_shared_wlock, locked);
-LIN_SDT_PROBE_DECLARE(locks, emul_shared_wlock, unlock);
+/**
+ * Special DTrace provider for the linuxulator.
+ *
+ * In this file we define the provider for the entire linuxulator. All
+ * modules (= files of the linuxulator) use it.
+ *
+ * We define a different name depending on the emulated bitsize, see
+ * ../../<ARCH>/linux{,32}/linux.h, e.g.:
+ * native bitsize = linuxulator
+ * amd64, 32bit emulation = linuxulator32
+ */
+LIN_SDT_PROVIDER_DEFINE(LINUX_DTRACE);
int stclohz; /* Statistics clock frequency */
@@ -129,6 +132,15 @@ struct l_sysinfo {
l_uint mem_unit;
char _f[20-2*sizeof(l_long)-sizeof(l_int)]; /* padding */
};
+
+struct l_pselect6arg {
+ l_uintptr_t ss;
+ l_size_t ss_len;
+};
+
+static int linux_utimensat_nsec_valid(l_long);
+
+
int
linux_sysinfo(struct thread *td, struct linux_sysinfo_args *args)
{
@@ -371,7 +383,7 @@ linux_uselib(struct thread *td, struct linux_uselib_args *args)
*/
PROC_LOCK(td->td_proc);
if (a_out->a_text > maxtsiz ||
- a_out->a_data + bss_size > lim_cur(td->td_proc, RLIMIT_DATA) ||
+ a_out->a_data + bss_size > lim_cur_proc(td->td_proc, RLIMIT_DATA) ||
racct_set(td->td_proc, RACCT_DATA, a_out->a_data +
bss_size) != 0) {
PROC_UNLOCK(td->td_proc);
@@ -523,7 +535,7 @@ linux_select(struct thread *td, struct linux_select_args *args)
tvp = NULL;
error = kern_select(td, args->nfds, args->readfds, args->writefds,
- args->exceptfds, tvp, sizeof(l_int) * 8);
+ args->exceptfds, tvp, LINUX_NFDBITS);
#ifdef DEBUG
if (ldebug(select))
@@ -738,12 +750,11 @@ linux_newuname(struct thread *td, struct linux_newuname_args *args)
*p = '\0';
break;
}
- strlcpy(utsname.machine, linux_platform, LINUX_MAX_UTSNAME);
+ strlcpy(utsname.machine, linux_kplatform, LINUX_MAX_UTSNAME);
return (copyout(&utsname, args->buf, sizeof(utsname)));
}
-#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
struct l_utimbuf {
l_time_t l_actime;
l_time_t l_modtime;
@@ -816,6 +827,98 @@ linux_utimes(struct thread *td, struct linux_utimes_args *args)
return (error);
}
+static int
+linux_utimensat_nsec_valid(l_long nsec)
+{
+
+ if (nsec == LINUX_UTIME_OMIT || nsec == LINUX_UTIME_NOW)
+ return (0);
+ if (nsec >= 0 && nsec <= 999999999)
+ return (0);
+ return (1);
+}
+
+int
+linux_utimensat(struct thread *td, struct linux_utimensat_args *args)
+{
+ struct l_timespec l_times[2];
+ struct timespec times[2], *timesp = NULL;
+ char *path = NULL;
+ int error, dfd, flags = 0;
+
+ dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
+
+#ifdef DEBUG
+ if (ldebug(utimensat))
+ printf(ARGS(utimensat, "%d, *"), dfd);
+#endif
+
+ if (args->flags & ~LINUX_AT_SYMLINK_NOFOLLOW)
+ return (EINVAL);
+
+ if (args->times != NULL) {
+ error = copyin(args->times, l_times, sizeof(l_times));
+ if (error != 0)
+ return (error);
+
+ if (linux_utimensat_nsec_valid(l_times[0].tv_nsec) != 0 ||
+ linux_utimensat_nsec_valid(l_times[1].tv_nsec) != 0)
+ return (EINVAL);
+
+ times[0].tv_sec = l_times[0].tv_sec;
+ switch (l_times[0].tv_nsec)
+ {
+ case LINUX_UTIME_OMIT:
+ times[0].tv_nsec = UTIME_OMIT;
+ break;
+ case LINUX_UTIME_NOW:
+ times[0].tv_nsec = UTIME_NOW;
+ break;
+ default:
+ times[0].tv_nsec = l_times[0].tv_nsec;
+ }
+
+ times[1].tv_sec = l_times[1].tv_sec;
+ switch (l_times[1].tv_nsec)
+ {
+ case LINUX_UTIME_OMIT:
+ times[1].tv_nsec = UTIME_OMIT;
+ break;
+ case LINUX_UTIME_NOW:
+ times[1].tv_nsec = UTIME_NOW;
+ break;
+ default:
+ times[1].tv_nsec = l_times[1].tv_nsec;
+ break;
+ }
+ timesp = times;
+ }
+
+ if (times[0].tv_nsec == UTIME_OMIT && times[1].tv_nsec == UTIME_OMIT)
+ /* This breaks POSIX, but is what the Linux kernel does
+ * _on purpose_ (documented in the man page for utimensat(2)),
+ * so we must follow that behaviour. */
+ return (0);
+
+ if (args->pathname != NULL)
+ LCONVPATHEXIST_AT(td, args->pathname, &path, dfd);
+ else if (args->flags != 0)
+ return (EINVAL);
+
+ if (args->flags & LINUX_AT_SYMLINK_NOFOLLOW)
+ flags |= AT_SYMLINK_NOFOLLOW;
+
+ if (path == NULL)
+ error = kern_futimens(td, dfd, timesp, UIO_SYSSPACE);
+ else {
+ error = kern_utimensat(td, dfd, path, UIO_SYSSPACE, timesp,
+ UIO_SYSSPACE, flags);
+ LFREEPATH(path);
+ }
+
+ return (error);
+}
+
int
linux_futimesat(struct thread *td, struct linux_futimesat_args *args)
{
@@ -848,7 +951,6 @@ linux_futimesat(struct thread *td, struct linux_futimesat_args *args)
LFREEPATH(fname);
return (error);
}
-#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
int
linux_common_wait(struct thread *td, int pid, int *status,
@@ -864,41 +966,131 @@ linux_common_wait(struct thread *td, int pid, int *status,
tmpstat &= 0xffff;
if (WIFSIGNALED(tmpstat))
tmpstat = (tmpstat & 0xffffff80) |
- BSD_TO_LINUX_SIGNAL(WTERMSIG(tmpstat));
+ bsd_to_linux_signal(WTERMSIG(tmpstat));
else if (WIFSTOPPED(tmpstat))
tmpstat = (tmpstat & 0xffff00ff) |
- (BSD_TO_LINUX_SIGNAL(WSTOPSIG(tmpstat)) << 8);
+ (bsd_to_linux_signal(WSTOPSIG(tmpstat)) << 8);
+ else if (WIFCONTINUED(tmpstat))
+ tmpstat = 0xffff;
error = copyout(&tmpstat, status, sizeof(int));
}
return (error);
}
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
int
linux_waitpid(struct thread *td, struct linux_waitpid_args *args)
{
- int options;
-
+ struct linux_wait4_args wait4_args;
+
#ifdef DEBUG
if (ldebug(waitpid))
printf(ARGS(waitpid, "%d, %p, %d"),
args->pid, (void *)args->status, args->options);
#endif
- /*
- * this is necessary because the test in kern_wait doesn't work
- * because we mess with the options here
- */
- if (args->options & ~(WUNTRACED | WNOHANG | WCONTINUED | __WCLONE))
+
+ wait4_args.pid = args->pid;
+ wait4_args.status = args->status;
+ wait4_args.options = args->options;
+ wait4_args.rusage = NULL;
+
+ return (linux_wait4(td, &wait4_args));
+}
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
+
+int
+linux_wait4(struct thread *td, struct linux_wait4_args *args)
+{
+ int error, options;
+ struct rusage ru, *rup;
+
+#ifdef DEBUG
+ if (ldebug(wait4))
+ printf(ARGS(wait4, "%d, %p, %d, %p"),
+ args->pid, (void *)args->status, args->options,
+ (void *)args->rusage);
+#endif
+ if (args->options & ~(LINUX_WUNTRACED | LINUX_WNOHANG |
+ LINUX_WCONTINUED | __WCLONE | __WNOTHREAD | __WALL))
return (EINVAL);
-
- options = (args->options & (WNOHANG | WUNTRACED));
- /* WLINUXCLONE should be equal to __WCLONE, but we make sure */
- if (args->options & __WCLONE)
- options |= WLINUXCLONE;
- return (linux_common_wait(td, args->pid, args->status, options, NULL));
+ options = WEXITED;
+ linux_to_bsd_waitopts(args->options, &options);
+
+ if (args->rusage != NULL)
+ rup = &ru;
+ else
+ rup = NULL;
+ error = linux_common_wait(td, args->pid, args->status, options, rup);
+ if (error != 0)
+ return (error);
+ if (args->rusage != NULL)
+ error = linux_copyout_rusage(&ru, args->rusage);
+ return (error);
}
+int
+linux_waitid(struct thread *td, struct linux_waitid_args *args)
+{
+ int status, options, sig;
+ struct __wrusage wru;
+ siginfo_t siginfo;
+ l_siginfo_t lsi;
+ idtype_t idtype;
+ struct proc *p;
+ int error;
+
+ options = 0;
+ linux_to_bsd_waitopts(args->options, &options);
+
+ if (options & ~(WNOHANG | WNOWAIT | WEXITED | WUNTRACED | WCONTINUED))
+ return (EINVAL);
+ if (!(options & (WEXITED | WUNTRACED | WCONTINUED)))
+ return (EINVAL);
+
+ switch (args->idtype) {
+ case LINUX_P_ALL:
+ idtype = P_ALL;
+ break;
+ case LINUX_P_PID:
+ if (args->id <= 0)
+ return (EINVAL);
+ idtype = P_PID;
+ break;
+ case LINUX_P_PGID:
+ if (args->id <= 0)
+ return (EINVAL);
+ idtype = P_PGID;
+ break;
+ default:
+ return (EINVAL);
+ }
+
+ error = kern_wait6(td, idtype, args->id, &status, options,
+ &wru, &siginfo);
+ if (error != 0)
+ return (error);
+ if (args->rusage != NULL) {
+ error = linux_copyout_rusage(&wru.wru_children,
+ args->rusage);
+ if (error != 0)
+ return (error);
+ }
+ if (args->info != NULL) {
+ p = td->td_proc;
+ if (td->td_retval[0] == 0)
+ bzero(&lsi, sizeof(lsi));
+ else {
+ sig = bsd_to_linux_signal(siginfo.si_signo);
+ siginfo_to_lsiginfo(&siginfo, &lsi, sig);
+ }
+ error = copyout(&lsi, args->info, sizeof(lsi));
+ }
+ td->td_retval[0] = 0;
+
+ return (error);
+}
int
linux_mknod(struct thread *td, struct linux_mknod_args *args)
@@ -910,7 +1102,8 @@ linux_mknod(struct thread *td, struct linux_mknod_args *args)
#ifdef DEBUG
if (ldebug(mknod))
- printf(ARGS(mknod, "%s, %d, %d"), path, args->mode, args->dev);
+ printf(ARGS(mknod, "%s, %d, %ju"), path, args->mode,
+ (uintmax_t)args->dev);
#endif
switch (args->mode & S_IFMT) {
@@ -1081,6 +1274,7 @@ linux_getitimer(struct thread *td, struct linux_getitimer_args *uap)
return (copyout(&ls, uap->itv, sizeof(ls)));
}
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
int
linux_nice(struct thread *td, struct linux_nice_args *args)
{
@@ -1091,6 +1285,7 @@ linux_nice(struct thread *td, struct linux_nice_args *args)
bsd_args.prio = args->inc;
return (sys_setpriority(td, &bsd_args));
}
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
int
linux_setgroups(struct thread *td, struct linux_setgroups_args *args)
@@ -1104,7 +1299,7 @@ linux_setgroups(struct thread *td, struct linux_setgroups_args *args)
ngrp = args->gidsetsize;
if (ngrp < 0 || ngrp >= ngroups_max + 1)
return (EINVAL);
- linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_TEMP, M_WAITOK);
+ linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_LINUX, M_WAITOK);
error = copyin(args->grouplist, linux_gidset, ngrp * sizeof(l_gid_t));
if (error)
goto out;
@@ -1143,7 +1338,7 @@ linux_setgroups(struct thread *td, struct linux_setgroups_args *args)
crfree(oldcred);
error = 0;
out:
- free(linux_gidset, M_TEMP);
+ free(linux_gidset, M_LINUX);
return (error);
}
@@ -1175,14 +1370,14 @@ linux_getgroups(struct thread *td, struct linux_getgroups_args *args)
ngrp = 0;
linux_gidset = malloc(bsd_gidsetsz * sizeof(*linux_gidset),
- M_TEMP, M_WAITOK);
+ M_LINUX, M_WAITOK);
while (ngrp < bsd_gidsetsz) {
linux_gidset[ngrp] = bsd_gidset[ngrp + 1];
ngrp++;
}
error = copyout(linux_gidset, args->grouplist, ngrp * sizeof(l_gid_t));
- free(linux_gidset, M_TEMP);
+ free(linux_gidset, M_LINUX);
if (error)
return (error);
@@ -1220,11 +1415,11 @@ linux_setrlimit(struct thread *td, struct linux_setrlimit_args *args)
return (kern_setrlimit(td, which, &bsd_rlim));
}
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
int
linux_old_getrlimit(struct thread *td, struct linux_old_getrlimit_args *args)
{
struct l_rlimit rlim;
- struct proc *p = td->td_proc;
struct rlimit bsd_rlim;
u_int which;
@@ -1241,9 +1436,7 @@ linux_old_getrlimit(struct thread *td, struct linux_old_getrlimit_args *args)
if (which == -1)
return (EINVAL);
- PROC_LOCK(p);
- lim_rlimit(p, which, &bsd_rlim);
- PROC_UNLOCK(p);
+ lim_rlimit(td, which, &bsd_rlim);
#ifdef COMPAT_LINUX32
rlim.rlim_cur = (unsigned int)bsd_rlim.rlim_cur;
@@ -1262,12 +1455,12 @@ linux_old_getrlimit(struct thread *td, struct linux_old_getrlimit_args *args)
#endif
return (copyout(&rlim, args->rlim, sizeof(rlim)));
}
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
int
linux_getrlimit(struct thread *td, struct linux_getrlimit_args *args)
{
struct l_rlimit rlim;
- struct proc *p = td->td_proc;
struct rlimit bsd_rlim;
u_int which;
@@ -1284,9 +1477,7 @@ linux_getrlimit(struct thread *td, struct linux_getrlimit_args *args)
if (which == -1)
return (EINVAL);
- PROC_LOCK(p);
- lim_rlimit(p, which, &bsd_rlim);
- PROC_UNLOCK(p);
+ lim_rlimit(td, which, &bsd_rlim);
rlim.rlim_cur = (l_ulong)bsd_rlim.rlim_cur;
rlim.rlim_max = (l_ulong)bsd_rlim.rlim_max;
@@ -1297,7 +1488,9 @@ int
linux_sched_setscheduler(struct thread *td,
struct linux_sched_setscheduler_args *args)
{
- struct sched_setscheduler_args bsd;
+ struct sched_param sched_param;
+ struct thread *tdt;
+ int error, policy;
#ifdef DEBUG
if (ldebug(sched_setscheduler))
@@ -1307,39 +1500,51 @@ linux_sched_setscheduler(struct thread *td,
switch (args->policy) {
case LINUX_SCHED_OTHER:
- bsd.policy = SCHED_OTHER;
+ policy = SCHED_OTHER;
break;
case LINUX_SCHED_FIFO:
- bsd.policy = SCHED_FIFO;
+ policy = SCHED_FIFO;
break;
case LINUX_SCHED_RR:
- bsd.policy = SCHED_RR;
+ policy = SCHED_RR;
break;
default:
return (EINVAL);
}
- bsd.pid = args->pid;
- bsd.param = (struct sched_param *)args->param;
- return (sys_sched_setscheduler(td, &bsd));
+ error = copyin(args->param, &sched_param, sizeof(sched_param));
+ if (error)
+ return (error);
+
+ tdt = linux_tdfind(td, args->pid, -1);
+ if (tdt == NULL)
+ return (ESRCH);
+
+ error = kern_sched_setscheduler(td, tdt, policy, &sched_param);
+ PROC_UNLOCK(tdt->td_proc);
+ return (error);
}
int
linux_sched_getscheduler(struct thread *td,
struct linux_sched_getscheduler_args *args)
{
- struct sched_getscheduler_args bsd;
- int error;
+ struct thread *tdt;
+ int error, policy;
#ifdef DEBUG
if (ldebug(sched_getscheduler))
printf(ARGS(sched_getscheduler, "%d"), args->pid);
#endif
- bsd.pid = args->pid;
- error = sys_sched_getscheduler(td, &bsd);
+ tdt = linux_tdfind(td, args->pid, -1);
+ if (tdt == NULL)
+ return (ESRCH);
- switch (td->td_retval[0]) {
+ error = kern_sched_getscheduler(td, tdt, &policy);
+ PROC_UNLOCK(tdt->td_proc);
+
+ switch (policy) {
case SCHED_OTHER:
td->td_retval[0] = LINUX_SCHED_OTHER;
break;
@@ -1350,7 +1555,6 @@ linux_sched_getscheduler(struct thread *td,
td->td_retval[0] = LINUX_SCHED_RR;
break;
}
-
return (error);
}
@@ -1476,20 +1680,12 @@ linux_reboot(struct thread *td, struct linux_reboot_args *args)
int
linux_getpid(struct thread *td, struct linux_getpid_args *args)
{
- struct linux_emuldata *em;
#ifdef DEBUG
if (ldebug(getpid))
printf(ARGS(getpid, ""));
#endif
-
- if (linux_use26(td)) {
- em = em_find(td->td_proc, EMUL_DONTLOCK);
- KASSERT(em != NULL, ("getpid: emuldata not found.\n"));
- td->td_retval[0] = em->shared->group_pid;
- } else {
- td->td_retval[0] = td->td_proc->p_pid;
- }
+ td->td_retval[0] = td->td_proc->p_pid;
return (0);
}
@@ -1497,13 +1693,18 @@ linux_getpid(struct thread *td, struct linux_getpid_args *args)
int
linux_gettid(struct thread *td, struct linux_gettid_args *args)
{
+ struct linux_emuldata *em;
#ifdef DEBUG
if (ldebug(gettid))
printf(ARGS(gettid, ""));
#endif
- td->td_retval[0] = td->td_proc->p_pid;
+ em = em_find(td);
+ KASSERT(em != NULL, ("gettid: emuldata not found.\n"));
+
+ td->td_retval[0] = em->em_tid;
+
return (0);
}
@@ -1511,50 +1712,15 @@ linux_gettid(struct thread *td, struct linux_gettid_args *args)
int
linux_getppid(struct thread *td, struct linux_getppid_args *args)
{
- struct linux_emuldata *em;
- struct proc *p, *pp;
#ifdef DEBUG
if (ldebug(getppid))
printf(ARGS(getppid, ""));
#endif
- if (!linux_use26(td)) {
- PROC_LOCK(td->td_proc);
- td->td_retval[0] = td->td_proc->p_pptr->p_pid;
- PROC_UNLOCK(td->td_proc);
- return (0);
- }
-
- em = em_find(td->td_proc, EMUL_DONTLOCK);
-
- KASSERT(em != NULL, ("getppid: process emuldata not found.\n"));
-
- /* find the group leader */
- p = pfind(em->shared->group_pid);
-
- if (p == NULL) {
-#ifdef DEBUG
- printf(LMSG("parent process not found.\n"));
-#endif
- return (0);
- }
-
- pp = p->p_pptr; /* switch to parent */
- PROC_LOCK(pp);
- PROC_UNLOCK(p);
-
- /* if its also linux process */
- if (pp->p_sysent == &elf_linux_sysvec) {
- em = em_find(pp, EMUL_DONTLOCK);
- KASSERT(em != NULL, ("getppid: parent emuldata not found.\n"));
-
- td->td_retval[0] = em->shared->group_pid;
- } else
- td->td_retval[0] = pp->p_pid;
-
- PROC_UNLOCK(pp);
-
+ PROC_LOCK(td->td_proc);
+ td->td_retval[0] = td->td_proc->p_pptr->p_pid;
+ PROC_UNLOCK(td->td_proc);
return (0);
}
@@ -1659,22 +1825,14 @@ linux_setdomainname(struct thread *td, struct linux_setdomainname_args *args)
int
linux_exit_group(struct thread *td, struct linux_exit_group_args *args)
{
- struct linux_emuldata *em;
#ifdef DEBUG
if (ldebug(exit_group))
printf(ARGS(exit_group, "%i"), args->error_code);
#endif
- em = em_find(td->td_proc, EMUL_DONTLOCK);
- if (em->shared->refs > 1) {
- EMUL_SHARED_WLOCK(&emul_shared_lock);
- em->shared->flags |= EMUL_SHARED_HASXSTAT;
- em->shared->xstat = W_EXITCODE(args->error_code, 0);
- EMUL_SHARED_WUNLOCK(&emul_shared_lock);
- if (linux_use26(td))
- linux_kill_threads(td, SIGKILL);
- }
+ LINUX_CTR2(exit_group, "thread(%d) (%d)", td->td_tid,
+ args->error_code);
/*
* XXX: we should send a signal to the parent if
@@ -1682,8 +1840,7 @@ linux_exit_group(struct thread *td, struct linux_exit_group_args *args)
* as it doesnt occur often.
*/
exit1(td, W_EXITCODE(args->error_code, 0));
-
- return (0);
+ /* NOTREACHED */
}
#define _LINUX_CAPABILITY_VERSION 0x19980330
@@ -1791,24 +1948,23 @@ linux_prctl(struct thread *td, struct linux_prctl_args *args)
#ifdef DEBUG
if (ldebug(prctl))
- printf(ARGS(prctl, "%d, %d, %d, %d, %d"), args->option,
- args->arg2, args->arg3, args->arg4, args->arg5);
+ printf(ARGS(prctl, "%d, %ju, %ju, %ju, %ju"), args->option,
+ (uintmax_t)args->arg2, (uintmax_t)args->arg3,
+ (uintmax_t)args->arg4, (uintmax_t)args->arg5);
#endif
switch (args->option) {
case LINUX_PR_SET_PDEATHSIG:
if (!LINUX_SIG_VALID(args->arg2))
return (EINVAL);
- em = em_find(p, EMUL_DOLOCK);
+ em = em_find(td);
KASSERT(em != NULL, ("prctl: emuldata not found.\n"));
em->pdeath_signal = args->arg2;
- EMUL_UNLOCK(&emul_lock);
break;
case LINUX_PR_GET_PDEATHSIG:
- em = em_find(p, EMUL_DOLOCK);
+ em = em_find(td);
KASSERT(em != NULL, ("prctl: emuldata not found.\n"));
pdeath_signal = em->pdeath_signal;
- EMUL_UNLOCK(&emul_lock);
error = copyout(&pdeath_signal,
(void *)(register_t)args->arg2,
sizeof(pdeath_signal));
@@ -1873,6 +2029,57 @@ linux_prctl(struct thread *td, struct linux_prctl_args *args)
return (error);
}
+int
+linux_sched_setparam(struct thread *td,
+ struct linux_sched_setparam_args *uap)
+{
+ struct sched_param sched_param;
+ struct thread *tdt;
+ int error;
+
+#ifdef DEBUG
+ if (ldebug(sched_setparam))
+ printf(ARGS(sched_setparam, "%d, *"), uap->pid);
+#endif
+
+ error = copyin(uap->param, &sched_param, sizeof(sched_param));
+ if (error)
+ return (error);
+
+ tdt = linux_tdfind(td, uap->pid, -1);
+ if (tdt == NULL)
+ return (ESRCH);
+
+ error = kern_sched_setparam(td, tdt, &sched_param);
+ PROC_UNLOCK(tdt->td_proc);
+ return (error);
+}
+
+int
+linux_sched_getparam(struct thread *td,
+ struct linux_sched_getparam_args *uap)
+{
+ struct sched_param sched_param;
+ struct thread *tdt;
+ int error;
+
+#ifdef DEBUG
+ if (ldebug(sched_getparam))
+ printf(ARGS(sched_getparam, "%d, *"), uap->pid);
+#endif
+
+ tdt = linux_tdfind(td, uap->pid, -1);
+ if (tdt == NULL)
+ return (ESRCH);
+
+ error = kern_sched_getparam(td, tdt, &sched_param);
+ PROC_UNLOCK(tdt->td_proc);
+ if (error == 0)
+ error = copyout(&sched_param, uap->param,
+ sizeof(sched_param));
+ return (error);
+}
+
/*
* Get affinity of a process.
*/
@@ -1881,6 +2088,7 @@ linux_sched_getaffinity(struct thread *td,
struct linux_sched_getaffinity_args *args)
{
int error;
+ struct thread *tdt;
struct cpuset_getaffinity_args cga;
#ifdef DEBUG
@@ -1891,9 +2099,14 @@ linux_sched_getaffinity(struct thread *td,
if (args->len < sizeof(cpuset_t))
return (EINVAL);
+ tdt = linux_tdfind(td, args->pid, -1);
+ if (tdt == NULL)
+ return (ESRCH);
+
+ PROC_UNLOCK(tdt->td_proc);
cga.level = CPU_LEVEL_WHICH;
- cga.which = CPU_WHICH_PID;
- cga.id = args->pid;
+ cga.which = CPU_WHICH_TID;
+ cga.id = tdt->td_tid;
cga.cpusetsize = sizeof(cpuset_t);
cga.mask = (cpuset_t *) args->user_mask_ptr;
@@ -1911,6 +2124,7 @@ linux_sched_setaffinity(struct thread *td,
struct linux_sched_setaffinity_args *args)
{
struct cpuset_setaffinity_args csa;
+ struct thread *tdt;
#ifdef DEBUG
if (ldebug(sched_setaffinity))
@@ -1920,11 +2134,369 @@ linux_sched_setaffinity(struct thread *td,
if (args->len < sizeof(cpuset_t))
return (EINVAL);
+ tdt = linux_tdfind(td, args->pid, -1);
+ if (tdt == NULL)
+ return (ESRCH);
+
+ PROC_UNLOCK(tdt->td_proc);
csa.level = CPU_LEVEL_WHICH;
- csa.which = CPU_WHICH_PID;
- csa.id = args->pid;
+ csa.which = CPU_WHICH_TID;
+ csa.id = tdt->td_tid;
csa.cpusetsize = sizeof(cpuset_t);
csa.mask = (cpuset_t *) args->user_mask_ptr;
return (sys_cpuset_setaffinity(td, &csa));
}
+
+struct linux_rlimit64 {
+ uint64_t rlim_cur;
+ uint64_t rlim_max;
+};
+
+int
+linux_prlimit64(struct thread *td, struct linux_prlimit64_args *args)
+{
+ struct rlimit rlim, nrlim;
+ struct linux_rlimit64 lrlim;
+ struct proc *p;
+ u_int which;
+ int flags;
+ int error;
+
+#ifdef DEBUG
+ if (ldebug(prlimit64))
+ printf(ARGS(prlimit64, "%d, %d, %p, %p"), args->pid,
+ args->resource, (void *)args->new, (void *)args->old);
+#endif
+
+ if (args->resource >= LINUX_RLIM_NLIMITS)
+ return (EINVAL);
+
+ which = linux_to_bsd_resource[args->resource];
+ if (which == -1)
+ return (EINVAL);
+
+ if (args->new != NULL) {
+ /*
+ * Note. Unlike FreeBSD where rlim is signed 64-bit Linux
+ * rlim is unsigned 64-bit. FreeBSD treats negative limits
+ * as INFINITY so we do not need a conversion even.
+ */
+ error = copyin(args->new, &nrlim, sizeof(nrlim));
+ if (error != 0)
+ return (error);
+ }
+
+ flags = PGET_HOLD | PGET_NOTWEXIT;
+ if (args->new != NULL)
+ flags |= PGET_CANDEBUG;
+ else
+ flags |= PGET_CANSEE;
+ error = pget(args->pid, flags, &p);
+ if (error != 0)
+ return (error);
+
+ if (args->old != NULL) {
+ PROC_LOCK(p);
+ lim_rlimit_proc(p, which, &rlim);
+ PROC_UNLOCK(p);
+ if (rlim.rlim_cur == RLIM_INFINITY)
+ lrlim.rlim_cur = LINUX_RLIM_INFINITY;
+ else
+ lrlim.rlim_cur = rlim.rlim_cur;
+ if (rlim.rlim_max == RLIM_INFINITY)
+ lrlim.rlim_max = LINUX_RLIM_INFINITY;
+ else
+ lrlim.rlim_max = rlim.rlim_max;
+ error = copyout(&lrlim, args->old, sizeof(lrlim));
+ if (error != 0)
+ goto out;
+ }
+
+ if (args->new != NULL)
+ error = kern_proc_setrlimit(td, p, which, &nrlim);
+
+ out:
+ PRELE(p);
+ return (error);
+}
+
+int
+linux_pselect6(struct thread *td, struct linux_pselect6_args *args)
+{
+ struct timeval utv, tv0, tv1, *tvp;
+ struct l_pselect6arg lpse6;
+ struct l_timespec lts;
+ struct timespec uts;
+ l_sigset_t l_ss;
+ sigset_t *ssp;
+ sigset_t ss;
+ int error;
+
+ ssp = NULL;
+ if (args->sig != NULL) {
+ error = copyin(args->sig, &lpse6, sizeof(lpse6));
+ if (error != 0)
+ return (error);
+ if (lpse6.ss_len != sizeof(l_ss))
+ return (EINVAL);
+ if (lpse6.ss != 0) {
+ error = copyin(PTRIN(lpse6.ss), &l_ss,
+ sizeof(l_ss));
+ if (error != 0)
+ return (error);
+ linux_to_bsd_sigset(&l_ss, &ss);
+ ssp = &ss;
+ }
+ }
+
+ /*
+ * Currently glibc changes nanosecond number to microsecond.
+ * This mean losing precision but for now it is hardly seen.
+ */
+ if (args->tsp != NULL) {
+ error = copyin(args->tsp, &lts, sizeof(lts));
+ if (error != 0)
+ return (error);
+ error = linux_to_native_timespec(&uts, &lts);
+ if (error != 0)
+ return (error);
+
+ TIMESPEC_TO_TIMEVAL(&utv, &uts);
+ if (itimerfix(&utv))
+ return (EINVAL);
+
+ microtime(&tv0);
+ tvp = &utv;
+ } else
+ tvp = NULL;
+
+ error = kern_pselect(td, args->nfds, args->readfds, args->writefds,
+ args->exceptfds, tvp, ssp, LINUX_NFDBITS);
+
+ if (error == 0 && args->tsp != NULL) {
+ if (td->td_retval[0] != 0) {
+ /*
+ * Compute how much time was left of the timeout,
+ * by subtracting the current time and the time
+ * before we started the call, and subtracting
+ * that result from the user-supplied value.
+ */
+
+ microtime(&tv1);
+ timevalsub(&tv1, &tv0);
+ timevalsub(&utv, &tv1);
+ if (utv.tv_sec < 0)
+ timevalclear(&utv);
+ } else
+ timevalclear(&utv);
+
+ TIMEVAL_TO_TIMESPEC(&utv, &uts);
+
+ native_to_linux_timespec(&lts, &uts);
+ error = copyout(&lts, args->tsp, sizeof(lts));
+ }
+
+ return (error);
+}
+
+int
+linux_ppoll(struct thread *td, struct linux_ppoll_args *args)
+{
+ struct timespec ts0, ts1;
+ struct l_timespec lts;
+ struct timespec uts, *tsp;
+ l_sigset_t l_ss;
+ sigset_t *ssp;
+ sigset_t ss;
+ int error;
+
+ if (args->sset != NULL) {
+ if (args->ssize != sizeof(l_ss))
+ return (EINVAL);
+ error = copyin(args->sset, &l_ss, sizeof(l_ss));
+ if (error)
+ return (error);
+ linux_to_bsd_sigset(&l_ss, &ss);
+ ssp = &ss;
+ } else
+ ssp = NULL;
+ if (args->tsp != NULL) {
+ error = copyin(args->tsp, &lts, sizeof(lts));
+ if (error)
+ return (error);
+ error = linux_to_native_timespec(&uts, &lts);
+ if (error != 0)
+ return (error);
+
+ nanotime(&ts0);
+ tsp = &uts;
+ } else
+ tsp = NULL;
+
+ error = kern_poll(td, args->fds, args->nfds, tsp, ssp);
+
+ if (error == 0 && args->tsp != NULL) {
+ if (td->td_retval[0]) {
+ nanotime(&ts1);
+ timespecsub(&ts1, &ts0);
+ timespecsub(&uts, &ts1);
+ if (uts.tv_sec < 0)
+ timespecclear(&uts);
+ } else
+ timespecclear(&uts);
+
+ native_to_linux_timespec(&lts, &uts);
+ error = copyout(&lts, args->tsp, sizeof(lts));
+ }
+
+ return (error);
+}
+
+#if defined(DEBUG) || defined(KTR)
+/* XXX: can be removed when every ldebug(...) and KTR stuff are removed. */
+
+u_char linux_debug_map[howmany(LINUX_SYS_MAXSYSCALL, sizeof(u_char))];
+
+static int
+linux_debug(int syscall, int toggle, int global)
+{
+
+ if (global) {
+ char c = toggle ? 0 : 0xff;
+
+ memset(linux_debug_map, c, sizeof(linux_debug_map));
+ return (0);
+ }
+ if (syscall < 0 || syscall >= LINUX_SYS_MAXSYSCALL)
+ return (EINVAL);
+ if (toggle)
+ clrbit(linux_debug_map, syscall);
+ else
+ setbit(linux_debug_map, syscall);
+ return (0);
+}
+
+/*
+ * Usage: sysctl linux.debug=<syscall_nr>.<0/1>
+ *
+ * E.g.: sysctl linux.debug=21.0
+ *
+ * As a special case, syscall "all" will apply to all syscalls globally.
+ */
+#define LINUX_MAX_DEBUGSTR 16
+int
+linux_sysctl_debug(SYSCTL_HANDLER_ARGS)
+{
+ char value[LINUX_MAX_DEBUGSTR], *p;
+ int error, sysc, toggle;
+ int global = 0;
+
+ value[0] = '\0';
+ error = sysctl_handle_string(oidp, value, LINUX_MAX_DEBUGSTR, req);
+ if (error || req->newptr == NULL)
+ return (error);
+ for (p = value; *p != '\0' && *p != '.'; p++);
+ if (*p == '\0')
+ return (EINVAL);
+ *p++ = '\0';
+ sysc = strtol(value, NULL, 0);
+ toggle = strtol(p, NULL, 0);
+ if (strcmp(value, "all") == 0)
+ global = 1;
+ error = linux_debug(sysc, toggle, global);
+ return (error);
+}
+
+#endif /* DEBUG || KTR */
+
+int
+linux_sched_rr_get_interval(struct thread *td,
+ struct linux_sched_rr_get_interval_args *uap)
+{
+ struct timespec ts;
+ struct l_timespec lts;
+ struct thread *tdt;
+ int error;
+
+ /*
+ * According to man in case the invalid pid specified
+ * EINVAL should be returned.
+ */
+ if (uap->pid < 0)
+ return (EINVAL);
+
+ tdt = linux_tdfind(td, uap->pid, -1);
+ if (tdt == NULL)
+ return (ESRCH);
+
+ error = kern_sched_rr_get_interval_td(td, tdt, &ts);
+ PROC_UNLOCK(tdt->td_proc);
+ if (error != 0)
+ return (error);
+ native_to_linux_timespec(&lts, &ts);
+ return (copyout(&lts, uap->interval, sizeof(lts)));
+}
+
+/*
+ * In case when the Linux thread is the initial thread in
+ * the thread group thread id is equal to the process id.
+ * Glibc depends on this magic (assert in pthread_getattr_np.c).
+ */
+struct thread *
+linux_tdfind(struct thread *td, lwpid_t tid, pid_t pid)
+{
+ struct linux_emuldata *em;
+ struct thread *tdt;
+ struct proc *p;
+
+ tdt = NULL;
+ if (tid == 0 || tid == td->td_tid) {
+ tdt = td;
+ PROC_LOCK(tdt->td_proc);
+ } else if (tid > PID_MAX)
+ tdt = tdfind(tid, pid);
+ else {
+ /*
+ * Initial thread where the tid equal to the pid.
+ */
+ p = pfind(tid);
+ if (p != NULL) {
+ if (SV_PROC_ABI(p) != SV_ABI_LINUX) {
+ /*
+ * p is not a Linuxulator process.
+ */
+ PROC_UNLOCK(p);
+ return (NULL);
+ }
+ FOREACH_THREAD_IN_PROC(p, tdt) {
+ em = em_find(tdt);
+ if (tid == em->em_tid)
+ return (tdt);
+ }
+ PROC_UNLOCK(p);
+ }
+ return (NULL);
+ }
+
+ return (tdt);
+}
+
+void
+linux_to_bsd_waitopts(int options, int *bsdopts)
+{
+
+ if (options & LINUX_WNOHANG)
+ *bsdopts |= WNOHANG;
+ if (options & LINUX_WUNTRACED)
+ *bsdopts |= WUNTRACED;
+ if (options & LINUX_WEXITED)
+ *bsdopts |= WEXITED;
+ if (options & LINUX_WCONTINUED)
+ *bsdopts |= WCONTINUED;
+ if (options & LINUX_WNOWAIT)
+ *bsdopts |= WNOWAIT;
+
+ if (options & __WCLONE)
+ *bsdopts |= WLINUXCLONE;
+}
diff --git a/sys/compat/linux/linux_misc.h b/sys/compat/linux/linux_misc.h
index 51135d8..08bc85f 100644
--- a/sys/compat/linux/linux_misc.h
+++ b/sys/compat/linux/linux_misc.h
@@ -31,6 +31,11 @@
#ifndef _LINUX_MISC_H_
#define _LINUX_MISC_H_
+#include <sys/sysctl.h>
+
+ /* bits per mask */
+#define LINUX_NFDBITS sizeof(l_fd_mask) * 8
+
/*
* Miscellaneous
*/
@@ -57,7 +62,7 @@
#define LINUX_PATH_MAX 4096
-extern const char *linux_platform;
+extern const char *linux_kplatform;
/*
* Non-standard aux entry types used in Linux ELF binaries.
@@ -70,7 +75,12 @@ extern const char *linux_platform;
#define LINUX_AT_BASE_PLATFORM 24 /* string identifying real platform, may
* differ from AT_PLATFORM.
*/
+#define LINUX_AT_RANDOM 25 /* address of random bytes */
#define LINUX_AT_EXECFN 31 /* filename of program */
+#define LINUX_AT_SYSINFO 32 /* vsyscall */
+#define LINUX_AT_SYSINFO_EHDR 33 /* vdso header */
+
+#define LINUX_AT_RANDOM_LEN 16 /* size of random bytes */
/* Linux sets the i387 to extended precision. */
#if defined(__i386__) || defined(__amd64__)
@@ -90,10 +100,6 @@ extern const char *linux_platform;
#define LINUX_CLONE_CHILD_CLEARTID 0x00200000
#define LINUX_CLONE_CHILD_SETTID 0x01000000
-#define LINUX_THREADING_FLAGS \
- (LINUX_CLONE_VM | LINUX_CLONE_FS | LINUX_CLONE_FILES | \
- LINUX_CLONE_SIGHAND | LINUX_CLONE_THREAD)
-
/* Scheduling policies */
#define LINUX_SCHED_OTHER 0
#define LINUX_SCHED_FIFO 1
@@ -115,13 +121,37 @@ struct l_new_utsname {
#define LINUX_CLOCK_REALTIME_HR 4
#define LINUX_CLOCK_MONOTONIC_HR 5
+#define LINUX_UTIME_NOW 0x3FFFFFFF
+#define LINUX_UTIME_OMIT 0x3FFFFFFE
+
extern int stclohz;
-#define __WCLONE 0x80000000
+#define LINUX_WNOHANG 0x00000001
+#define LINUX_WUNTRACED 0x00000002
+#define LINUX_WSTOPPED LINUX_WUNTRACED
+#define LINUX_WEXITED 0x00000004
+#define LINUX_WCONTINUED 0x00000008
+#define LINUX_WNOWAIT 0x01000000
+
+
+#define __WNOTHREAD 0x20000000
+#define __WALL 0x40000000
+#define __WCLONE 0x80000000
+
+/* Linux waitid idtype */
+#define LINUX_P_ALL 0
+#define LINUX_P_PID 1
+#define LINUX_P_PGID 2
+
+#define LINUX_RLIM_INFINITY (~0UL)
int linux_common_wait(struct thread *td, int pid, int *status,
int options, struct rusage *ru);
+void linux_to_bsd_waitopts(int options, int *bsdopts);
int linux_set_upcall_kse(struct thread *td, register_t stack);
int linux_set_cloned_tls(struct thread *td, void *desc);
+struct thread *linux_tdfind(struct thread *, lwpid_t, pid_t);
+
+int linux_sysctl_debug(SYSCTL_HANDLER_ARGS);
#endif /* _LINUX_MISC_H_ */
diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c
index 1c778f9..0ecf537 100644
--- a/sys/compat/linux/linux_signal.c
+++ b/sys/compat/linux/linux_signal.c
@@ -53,40 +53,12 @@ __FBSDID("$FreeBSD$");
#include <compat/linux/linux_signal.h>
#include <compat/linux/linux_util.h>
#include <compat/linux/linux_emul.h>
+#include <compat/linux/linux_misc.h>
-void
-linux_to_bsd_sigset(l_sigset_t *lss, sigset_t *bss)
-{
- int b, l;
-
- SIGEMPTYSET(*bss);
- bss->__bits[0] = lss->__bits[0] & ~((1U << LINUX_SIGTBLSZ) - 1);
- bss->__bits[1] = lss->__bits[1];
- for (l = 1; l <= LINUX_SIGTBLSZ; l++) {
- if (LINUX_SIGISMEMBER(*lss, l)) {
- b = linux_to_bsd_signal[_SIG_IDX(l)];
- if (b)
- SIGADDSET(*bss, b);
- }
- }
-}
+static int linux_do_tkill(struct thread *td, struct thread *tdt,
+ ksiginfo_t *ksi);
+static void sicode_to_lsicode(int si_code, int *lsi_code);
-void
-bsd_to_linux_sigset(sigset_t *bss, l_sigset_t *lss)
-{
- int b, l;
-
- LINUX_SIGEMPTYSET(*lss);
- lss->__bits[0] = bss->__bits[0] & ~((1U << LINUX_SIGTBLSZ) - 1);
- lss->__bits[1] = bss->__bits[1];
- for (b = 1; b <= LINUX_SIGTBLSZ; b++) {
- if (SIGISMEMBER(*bss, b)) {
- l = bsd_to_linux_signal[_SIG_IDX(b)];
- if (l)
- LINUX_SIGADDSET(*lss, l);
- }
- }
-}
static void
linux_to_bsd_sigaction(l_sigaction_t *lsa, struct sigaction *bsa)
@@ -155,11 +127,7 @@ linux_do_sigaction(struct thread *td, int linux_sig, l_sigaction_t *linux_nsa,
linux_to_bsd_sigaction(linux_nsa, nsa);
} else
nsa = NULL;
-
- if (linux_sig <= LINUX_SIGTBLSZ)
- sig = linux_to_bsd_signal[_SIG_IDX(linux_sig)];
- else
- sig = linux_sig;
+ sig = linux_to_bsd_signal(linux_sig);
error = kern_sigaction(td, sig, nsa, osa, 0);
if (error)
@@ -171,7 +139,7 @@ linux_do_sigaction(struct thread *td, int linux_sig, l_sigaction_t *linux_nsa,
return (0);
}
-
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
int
linux_signal(struct thread *td, struct linux_signal_args *args)
{
@@ -193,6 +161,7 @@ linux_signal(struct thread *td, struct linux_signal_args *args)
return (error);
}
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
int
linux_rt_sigaction(struct thread *td, struct linux_rt_sigaction_args *args)
@@ -262,6 +231,7 @@ linux_do_sigprocmask(struct thread *td, int how, l_sigset_t *new,
return (error);
}
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
int
linux_sigprocmask(struct thread *td, struct linux_sigprocmask_args *args)
{
@@ -279,7 +249,7 @@ linux_sigprocmask(struct thread *td, struct linux_sigprocmask_args *args)
if (error)
return (error);
LINUX_SIGEMPTYSET(set);
- set.__bits[0] = mask;
+ set.__mask = mask;
}
error = linux_do_sigprocmask(td, args->how,
@@ -287,12 +257,13 @@ linux_sigprocmask(struct thread *td, struct linux_sigprocmask_args *args)
args->omask ? &oset : NULL);
if (args->omask != NULL && !error) {
- mask = oset.__bits[0];
+ mask = oset.__mask;
error = copyout(&mask, args->omask, sizeof(l_osigset_t));
}
return (error);
}
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
int
linux_rt_sigprocmask(struct thread *td, struct linux_rt_sigprocmask_args *args)
@@ -327,6 +298,7 @@ linux_rt_sigprocmask(struct thread *td, struct linux_rt_sigprocmask_args *args)
return (error);
}
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
int
linux_sgetmask(struct thread *td, struct linux_sgetmask_args *args)
{
@@ -341,7 +313,7 @@ linux_sgetmask(struct thread *td, struct linux_sgetmask_args *args)
PROC_LOCK(p);
bsd_to_linux_sigset(&td->td_sigmask, &mask);
PROC_UNLOCK(p);
- td->td_retval[0] = mask.__bits[0];
+ td->td_retval[0] = mask.__mask;
return (0);
}
@@ -359,9 +331,9 @@ linux_ssetmask(struct thread *td, struct linux_ssetmask_args *args)
PROC_LOCK(p);
bsd_to_linux_sigset(&td->td_sigmask, &lset);
- td->td_retval[0] = lset.__bits[0];
+ td->td_retval[0] = lset.__mask;
LINUX_SIGEMPTYSET(lset);
- lset.__bits[0] = args->mask;
+ lset.__mask = args->mask;
linux_to_bsd_sigset(&lset, &bset);
td->td_sigmask = bset;
SIG_CANTMASK(td->td_sigmask);
@@ -370,9 +342,6 @@ linux_ssetmask(struct thread *td, struct linux_ssetmask_args *args)
return (0);
}
-/*
- * MPSAFE
- */
int
linux_sigpending(struct thread *td, struct linux_sigpending_args *args)
{
@@ -392,9 +361,10 @@ linux_sigpending(struct thread *td, struct linux_sigpending_args *args)
SIGSETAND(bset, td->td_sigmask);
PROC_UNLOCK(p);
bsd_to_linux_sigset(&bset, &lset);
- mask = lset.__bits[0];
+ mask = lset.__mask;
return (copyout(&mask, args->mask, sizeof(mask)));
}
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
/*
* MPSAFE
@@ -458,8 +428,8 @@ linux_rt_sigtimedwait(struct thread *td,
#ifdef DEBUG
if (ldebug(rt_sigtimedwait))
printf(LMSG("linux_rt_sigtimedwait: "
- "incoming timeout (%d/%d)\n"),
- ltv.tv_sec, ltv.tv_usec);
+ "incoming timeout (%jd/%jd)\n"),
+ (intmax_t)ltv.tv_sec, (intmax_t)ltv.tv_usec);
#endif
tv.tv_sec = (long)ltv.tv_sec;
tv.tv_usec = (suseconds_t)ltv.tv_usec;
@@ -495,7 +465,7 @@ linux_rt_sigtimedwait(struct thread *td,
if (error)
return (error);
- sig = BSD_TO_LINUX_SIGNAL(info.ksi_signo);
+ sig = bsd_to_linux_signal(info.ksi_signo);
if (args->ptr) {
memset(&linfo, 0, sizeof(linfo));
@@ -527,66 +497,31 @@ linux_kill(struct thread *td, struct linux_kill_args *args)
if (!LINUX_SIG_VALID(args->signum) && args->signum != 0)
return (EINVAL);
- if (args->signum > 0 && args->signum <= LINUX_SIGTBLSZ)
- tmp.signum = linux_to_bsd_signal[_SIG_IDX(args->signum)];
+ if (args->signum > 0)
+ tmp.signum = linux_to_bsd_signal(args->signum);
else
- tmp.signum = args->signum;
+ tmp.signum = 0;
tmp.pid = args->pid;
return (sys_kill(td, &tmp));
}
static int
-linux_do_tkill(struct thread *td, l_int tgid, l_int pid, l_int signum)
+linux_do_tkill(struct thread *td, struct thread *tdt, ksiginfo_t *ksi)
{
- struct proc *proc = td->td_proc;
- struct linux_emuldata *em;
struct proc *p;
- ksiginfo_t ksi;
int error;
- AUDIT_ARG_SIGNUM(signum);
- AUDIT_ARG_PID(pid);
-
- /*
- * Allow signal 0 as a means to check for privileges
- */
- if (!LINUX_SIG_VALID(signum) && signum != 0)
- return (EINVAL);
-
- if (signum > 0 && signum <= LINUX_SIGTBLSZ)
- signum = linux_to_bsd_signal[_SIG_IDX(signum)];
-
- if ((p = pfind(pid)) == NULL) {
- if ((p = zpfind(pid)) == NULL)
- return (ESRCH);
- }
-
+ p = tdt->td_proc;
+ AUDIT_ARG_SIGNUM(ksi->ksi_signo);
+ AUDIT_ARG_PID(p->p_pid);
AUDIT_ARG_PROCESS(p);
- error = p_cansignal(td, p, signum);
- if (error != 0 || signum == 0)
- goto out;
-
- error = ESRCH;
- em = em_find(p, EMUL_DONTLOCK);
- if (em == NULL) {
-#ifdef DEBUG
- printf("emuldata not found in do_tkill.\n");
-#endif
+ error = p_cansignal(td, p, ksi->ksi_signo);
+ if (error != 0 || ksi->ksi_signo == 0)
goto out;
- }
- if (tgid > 0 && em->shared->group_pid != tgid)
- goto out;
-
- ksiginfo_init(&ksi);
- ksi.ksi_signo = signum;
- ksi.ksi_code = LINUX_SI_TKILL;
- ksi.ksi_errno = 0;
- ksi.ksi_pid = proc->p_pid;
- ksi.ksi_uid = proc->p_ucred->cr_ruid;
- error = pksignal(p, ksi.ksi_signo, &ksi);
+ tdksignal(tdt, ksi->ksi_signo, ksi);
out:
PROC_UNLOCK(p);
@@ -596,20 +531,53 @@ out:
int
linux_tgkill(struct thread *td, struct linux_tgkill_args *args)
{
+ struct thread *tdt;
+ ksiginfo_t ksi;
+ int sig;
#ifdef DEBUG
if (ldebug(tgkill))
- printf(ARGS(tgkill, "%d, %d, %d"), args->tgid, args->pid, args->sig);
+ printf(ARGS(tgkill, "%d, %d, %d"),
+ args->tgid, args->pid, args->sig);
#endif
+
if (args->pid <= 0 || args->tgid <=0)
return (EINVAL);
- return (linux_do_tkill(td, args->tgid, args->pid, args->sig));
+ /*
+ * Allow signal 0 as a means to check for privileges
+ */
+ if (!LINUX_SIG_VALID(args->sig) && args->sig != 0)
+ return (EINVAL);
+
+ if (args->sig > 0)
+ sig = linux_to_bsd_signal(args->sig);
+ else
+ sig = 0;
+
+ tdt = linux_tdfind(td, args->pid, args->tgid);
+ if (tdt == NULL)
+ return (ESRCH);
+
+ ksiginfo_init(&ksi);
+ ksi.ksi_signo = sig;
+ ksi.ksi_code = SI_LWP;
+ ksi.ksi_errno = 0;
+ ksi.ksi_pid = td->td_proc->p_pid;
+ ksi.ksi_uid = td->td_proc->p_ucred->cr_ruid;
+ return (linux_do_tkill(td, tdt, &ksi));
}
+/*
+ * Deprecated since 2.5.75. Replaced by tgkill().
+ */
int
linux_tkill(struct thread *td, struct linux_tkill_args *args)
{
+ struct thread *tdt;
+ ksiginfo_t ksi;
+ int sig;
+
#ifdef DEBUG
if (ldebug(tkill))
printf(ARGS(tkill, "%i, %i"), args->tid, args->sig);
@@ -617,40 +585,182 @@ linux_tkill(struct thread *td, struct linux_tkill_args *args)
if (args->tid <= 0)
return (EINVAL);
- return (linux_do_tkill(td, 0, args->tid, args->sig));
+ if (!LINUX_SIG_VALID(args->sig))
+ return (EINVAL);
+
+ sig = linux_to_bsd_signal(args->sig);
+
+ tdt = linux_tdfind(td, args->tid, -1);
+ if (tdt == NULL)
+ return (ESRCH);
+
+ ksiginfo_init(&ksi);
+ ksi.ksi_signo = sig;
+ ksi.ksi_code = SI_LWP;
+ ksi.ksi_errno = 0;
+ ksi.ksi_pid = td->td_proc->p_pid;
+ ksi.ksi_uid = td->td_proc->p_ucred->cr_ruid;
+ return (linux_do_tkill(td, tdt, &ksi));
+}
+
+void
+ksiginfo_to_lsiginfo(const ksiginfo_t *ksi, l_siginfo_t *lsi, l_int sig)
+{
+
+ siginfo_to_lsiginfo(&ksi->ksi_info, lsi, sig);
+}
+
+static void
+sicode_to_lsicode(int si_code, int *lsi_code)
+{
+
+ switch (si_code) {
+ case SI_USER:
+ *lsi_code = LINUX_SI_USER;
+ break;
+ case SI_KERNEL:
+ *lsi_code = LINUX_SI_KERNEL;
+ break;
+ case SI_QUEUE:
+ *lsi_code = LINUX_SI_QUEUE;
+ break;
+ case SI_TIMER:
+ *lsi_code = LINUX_SI_TIMER;
+ break;
+ case SI_MESGQ:
+ *lsi_code = LINUX_SI_MESGQ;
+ break;
+ case SI_ASYNCIO:
+ *lsi_code = LINUX_SI_ASYNCIO;
+ break;
+ case SI_LWP:
+ *lsi_code = LINUX_SI_TKILL;
+ break;
+ default:
+ *lsi_code = si_code;
+ break;
+ }
}
void
-ksiginfo_to_lsiginfo(ksiginfo_t *ksi, l_siginfo_t *lsi, l_int sig)
+siginfo_to_lsiginfo(const siginfo_t *si, l_siginfo_t *lsi, l_int sig)
{
+ /* sig alredy converted */
lsi->lsi_signo = sig;
- lsi->lsi_code = ksi->ksi_code;
+ sicode_to_lsicode(si->si_code, &lsi->lsi_code);
- switch (sig) {
- case LINUX_SIGPOLL:
- /* XXX si_fd? */
- lsi->lsi_band = ksi->ksi_band;
+ switch (si->si_code) {
+ case SI_LWP:
+ lsi->lsi_pid = si->si_pid;
+ lsi->lsi_uid = si->si_uid;
break;
- case LINUX_SIGCHLD:
- lsi->lsi_pid = ksi->ksi_pid;
- lsi->lsi_uid = ksi->ksi_uid;
- lsi->lsi_status = ksi->ksi_status;
+
+ case SI_TIMER:
+ lsi->lsi_int = si->si_value.sival_int;
+ lsi->lsi_ptr = PTROUT(si->si_value.sival_ptr);
+ lsi->lsi_tid = si->si_timerid;
break;
- case LINUX_SIGBUS:
- case LINUX_SIGILL:
- case LINUX_SIGFPE:
- case LINUX_SIGSEGV:
- lsi->lsi_addr = PTROUT(ksi->ksi_addr);
+
+ case SI_QUEUE:
+ lsi->lsi_pid = si->si_pid;
+ lsi->lsi_uid = si->si_uid;
+ lsi->lsi_ptr = PTROUT(si->si_value.sival_ptr);
break;
+
+ case SI_ASYNCIO:
+ lsi->lsi_int = si->si_value.sival_int;
+ lsi->lsi_ptr = PTROUT(si->si_value.sival_ptr);
+ break;
+
default:
- /* XXX SI_TIMER etc... */
- lsi->lsi_pid = ksi->ksi_pid;
- lsi->lsi_uid = ksi->ksi_uid;
+ switch (sig) {
+ case LINUX_SIGPOLL:
+ /* XXX si_fd? */
+ lsi->lsi_band = si->si_band;
+ break;
+
+ case LINUX_SIGCHLD:
+ lsi->lsi_errno = 0;
+ lsi->lsi_pid = si->si_pid;
+ lsi->lsi_uid = si->si_uid;
+
+ if (si->si_code == CLD_STOPPED)
+ lsi->lsi_status = bsd_to_linux_signal(si->si_status);
+ else if (si->si_code == CLD_CONTINUED)
+ lsi->lsi_status = bsd_to_linux_signal(SIGCONT);
+ else
+ lsi->lsi_status = si->si_status;
+ break;
+
+ case LINUX_SIGBUS:
+ case LINUX_SIGILL:
+ case LINUX_SIGFPE:
+ case LINUX_SIGSEGV:
+ lsi->lsi_addr = PTROUT(si->si_addr);
+ break;
+
+ default:
+ lsi->lsi_pid = si->si_pid;
+ lsi->lsi_uid = si->si_uid;
+ if (sig >= LINUX_SIGRTMIN) {
+ lsi->lsi_int = si->si_value.sival_int;
+ lsi->lsi_ptr = PTROUT(si->si_value.sival_ptr);
+ }
+ break;
+ }
break;
}
- if (sig >= LINUX_SIGRTMIN) {
- lsi->lsi_int = ksi->ksi_info.si_value.sival_int;
- lsi->lsi_ptr = PTROUT(ksi->ksi_info.si_value.sival_ptr);
+}
+
+void
+lsiginfo_to_ksiginfo(const l_siginfo_t *lsi, ksiginfo_t *ksi, int sig)
+{
+
+ ksi->ksi_signo = sig;
+ ksi->ksi_code = lsi->lsi_code; /* XXX. Convert. */
+ ksi->ksi_pid = lsi->lsi_pid;
+ ksi->ksi_uid = lsi->lsi_uid;
+ ksi->ksi_status = lsi->lsi_status;
+ ksi->ksi_addr = PTRIN(lsi->lsi_addr);
+ ksi->ksi_info.si_value.sival_int = lsi->lsi_int;
+}
+
+int
+linux_rt_sigqueueinfo(struct thread *td, struct linux_rt_sigqueueinfo_args *args)
+{
+ l_siginfo_t linfo;
+ struct proc *p;
+ ksiginfo_t ksi;
+ int error;
+ int sig;
+
+ if (!LINUX_SIG_VALID(args->sig))
+ return (EINVAL);
+
+ error = copyin(args->info, &linfo, sizeof(linfo));
+ if (error != 0)
+ return (error);
+
+ if (linfo.lsi_code >= 0)
+ return (EPERM);
+
+ sig = linux_to_bsd_signal(args->sig);
+
+ error = ESRCH;
+ if ((p = pfind(args->pid)) != NULL ||
+ (p = zpfind(args->pid)) != NULL) {
+ error = p_cansignal(td, p, sig);
+ if (error != 0) {
+ PROC_UNLOCK(p);
+ return (error);
+ }
+
+ ksiginfo_init(&ksi);
+ lsiginfo_to_ksiginfo(&linfo, &ksi, sig);
+ error = tdsendsignal(p, NULL, sig, &ksi);
+ PROC_UNLOCK(p);
}
+
+ return (error);
}
diff --git a/sys/compat/linux/linux_signal.h b/sys/compat/linux/linux_signal.h
index 426cf43..510bfb3 100644
--- a/sys/compat/linux/linux_signal.h
+++ b/sys/compat/linux/linux_signal.h
@@ -31,19 +31,21 @@
#ifndef _LINUX_SIGNAL_H_
#define _LINUX_SIGNAL_H_
-#define LINUX_SI_TKILL -6;
-
-extern int bsd_to_linux_signal[];
-extern int linux_to_bsd_signal[];
+/*
+ * si_code values
+ */
+#define LINUX_SI_USER 0 /* sent by kill, sigsend, raise */
+#define LINUX_SI_KERNEL 0x80 /* sent by the kernel from somewhere */
+#define LINUX_SI_QUEUE -1 /* sent by sigqueue */
+#define LINUX_SI_TIMER -2 /* sent by timer expiration */
+#define LINUX_SI_MESGQ -3 /* sent by real time mesq state change */
+#define LINUX_SI_ASYNCIO -4 /* sent by AIO completion */
+#define LINUX_SI_SIGIO -5 /* sent by queued SIGIO */
+#define LINUX_SI_TKILL -6 /* sent by tkill system call */
-void linux_to_bsd_sigset(l_sigset_t *, sigset_t *);
-void bsd_to_linux_sigset(sigset_t *, l_sigset_t *);
int linux_do_sigaction(struct thread *, int, l_sigaction_t *, l_sigaction_t *);
-void ksiginfo_to_lsiginfo(ksiginfo_t *ksi, l_siginfo_t *lsi, l_int sig);
-
-#define LINUX_SIG_VALID(sig) ((sig) <= LINUX_NSIG && (sig) > 0)
-
-#define BSD_TO_LINUX_SIGNAL(sig) \
- (((sig) <= LINUX_SIGTBLSZ) ? bsd_to_linux_signal[_SIG_IDX(sig)] : sig)
+void ksiginfo_to_lsiginfo(const ksiginfo_t *ksi, l_siginfo_t *lsi, l_int sig);
+void siginfo_to_lsiginfo(const siginfo_t *si, l_siginfo_t *lsi, l_int sig);
+void lsiginfo_to_ksiginfo(const l_siginfo_t *lsi, ksiginfo_t *ksi, int sig);
#endif /* _LINUX_SIGNAL_H_ */
diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c
index f433787..34d69ff 100644
--- a/sys/compat/linux/linux_socket.c
+++ b/sys/compat/linux/linux_socket.c
@@ -70,10 +70,17 @@ __FBSDID("$FreeBSD$");
#include <machine/../linux/linux.h>
#include <machine/../linux/linux_proto.h>
#endif
+#include <compat/linux/linux_file.h>
#include <compat/linux/linux_socket.h>
+#include <compat/linux/linux_timer.h>
#include <compat/linux/linux_util.h>
static int linux_to_bsd_domain(int);
+static int linux_sendmsg_common(struct thread *, l_int, struct l_msghdr *,
+ l_uint);
+static int linux_recvmsg_common(struct thread *, l_int, struct l_msghdr *,
+ l_uint, struct msghdr *);
+static int linux_set_socket_flags(int, int *);
/*
* Reads a linux sockaddr and does any necessary translation.
@@ -428,7 +435,6 @@ linux_to_bsd_sockaddr(struct sockaddr *arg, int len)
return (error);
}
-
static int
linux_sa_put(struct osockaddr *osa)
{
@@ -477,6 +483,8 @@ bsd_to_linux_cmsg_type(int cmsg_type)
return (LINUX_SCM_RIGHTS);
case SCM_CREDS:
return (LINUX_SCM_CREDENTIALS);
+ case SCM_TIMESTAMP:
+ return (LINUX_SCM_TIMESTAMP);
}
return (-1);
}
@@ -529,20 +537,15 @@ bsd_to_linux_msghdr(const struct msghdr *bhdr, struct l_msghdr *lhdr)
}
static int
-linux_set_socket_flags(struct thread *td, int s, int flags)
+linux_set_socket_flags(int lflags, int *flags)
{
- int error;
- if (flags & LINUX_SOCK_NONBLOCK) {
- error = kern_fcntl(td, s, F_SETFL, O_NONBLOCK);
- if (error)
- return (error);
- }
- if (flags & LINUX_SOCK_CLOEXEC) {
- error = kern_fcntl(td, s, F_SETFD, FD_CLOEXEC);
- if (error)
- return (error);
- }
+ if (lflags & ~(LINUX_SOCK_CLOEXEC | LINUX_SOCK_NONBLOCK))
+ return (EINVAL);
+ if (lflags & LINUX_SOCK_NONBLOCK)
+ *flags |= SOCK_NONBLOCK;
+ if (lflags & LINUX_SOCK_CLOEXEC)
+ *flags |= SOCK_CLOEXEC;
return (0);
}
@@ -585,15 +588,6 @@ linux_check_hdrincl(struct thread *td, int s)
return (optval == 0);
}
-struct linux_sendto_args {
- int s;
- l_uintptr_t msg;
- int len;
- int flags;
- l_uintptr_t to;
- int tolen;
-};
-
/*
* Updated sendto() when IP_HDRINCL is set:
* tweak endian-dependent fields in the IP packet.
@@ -618,7 +612,7 @@ linux_sendto_hdrincl(struct thread *td, struct linux_sendto_args *linux_args)
linux_args->len > IP_MAXPACKET)
return (EINVAL);
- packet = (struct ip *)malloc(linux_args->len, M_TEMP, M_WAITOK);
+ packet = (struct ip *)malloc(linux_args->len, M_LINUX, M_WAITOK);
/* Make kernel copy of the packet to be sent */
if ((error = copyin(PTRIN(linux_args->msg), packet,
@@ -641,17 +635,11 @@ linux_sendto_hdrincl(struct thread *td, struct linux_sendto_args *linux_args)
error = linux_sendit(td, linux_args->s, &msg, linux_args->flags,
NULL, UIO_SYSSPACE);
goout:
- free(packet, M_TEMP);
+ free(packet, M_LINUX);
return (error);
}
-struct linux_socket_args {
- int domain;
- int type;
- int protocol;
-};
-
-static int
+int
linux_socket(struct thread *td, struct linux_socket_args *args)
{
struct socket_args /* {
@@ -659,15 +647,16 @@ linux_socket(struct thread *td, struct linux_socket_args *args)
int type;
int protocol;
} */ bsd_args;
- int retval_socket, socket_flags;
+ int retval_socket;
bsd_args.protocol = args->protocol;
- socket_flags = args->type & ~LINUX_SOCK_TYPE_MASK;
- if (socket_flags & ~(LINUX_SOCK_CLOEXEC | LINUX_SOCK_NONBLOCK))
- return (EINVAL);
bsd_args.type = args->type & LINUX_SOCK_TYPE_MASK;
if (bsd_args.type < 0 || bsd_args.type > LINUX_SOCK_MAX)
return (EINVAL);
+ retval_socket = linux_set_socket_flags(args->type & ~LINUX_SOCK_TYPE_MASK,
+ &bsd_args.type);
+ if (retval_socket != 0)
+ return (retval_socket);
bsd_args.domain = linux_to_bsd_domain(args->domain);
if (bsd_args.domain == -1)
return (EAFNOSUPPORT);
@@ -676,13 +665,6 @@ linux_socket(struct thread *td, struct linux_socket_args *args)
if (retval_socket)
return (retval_socket);
- retval_socket = linux_set_socket_flags(td, td->td_retval[0],
- socket_flags);
- if (retval_socket) {
- (void)kern_close(td, td->td_retval[0]);
- goto out;
- }
-
if (bsd_args.type == SOCK_RAW
&& (bsd_args.protocol == IPPROTO_RAW || bsd_args.protocol == 0)
&& bsd_args.domain == PF_INET) {
@@ -711,17 +693,10 @@ linux_socket(struct thread *td, struct linux_socket_args *args)
}
#endif
-out:
return (retval_socket);
}
-struct linux_bind_args {
- int s;
- l_uintptr_t name;
- int namelen;
-};
-
-static int
+int
linux_bind(struct thread *td, struct linux_bind_args *args)
{
struct sockaddr *sa;
@@ -739,13 +714,6 @@ linux_bind(struct thread *td, struct linux_bind_args *args)
return (error);
}
-struct linux_connect_args {
- int s;
- l_uintptr_t name;
- int namelen;
-};
-int linux_connect(struct thread *, struct linux_connect_args *);
-
int
linux_connect(struct thread *td, struct linux_connect_args *args)
{
@@ -790,12 +758,7 @@ linux_connect(struct thread *td, struct linux_connect_args *args)
return (error);
}
-struct linux_listen_args {
- int s;
- int backlog;
-};
-
-static int
+int
linux_listen(struct thread *td, struct linux_listen_args *args)
{
struct listen_args /* {
@@ -812,43 +775,31 @@ static int
linux_accept_common(struct thread *td, int s, l_uintptr_t addr,
l_uintptr_t namelen, int flags)
{
- struct accept_args /* {
+ struct accept4_args /* {
int s;
struct sockaddr * __restrict name;
socklen_t * __restrict anamelen;
+ int flags;
} */ bsd_args;
int error;
- if (flags & ~(LINUX_SOCK_CLOEXEC | LINUX_SOCK_NONBLOCK))
- return (EINVAL);
-
bsd_args.s = s;
/* XXX: */
bsd_args.name = (struct sockaddr * __restrict)PTRIN(addr);
bsd_args.anamelen = PTRIN(namelen);/* XXX */
- error = sys_accept(td, &bsd_args);
+ bsd_args.flags = 0;
+ error = linux_set_socket_flags(flags, &bsd_args.flags);
+ if (error != 0)
+ return (error);
+ error = sys_accept4(td, &bsd_args);
bsd_to_linux_sockaddr((struct sockaddr *)bsd_args.name);
if (error) {
if (error == EFAULT && namelen != sizeof(struct sockaddr_in))
return (EINVAL);
return (error);
}
-
- /*
- * linux appears not to copy flags from the parent socket to the
- * accepted one, so we must clear the flags in the new descriptor
- * and apply the requested flags.
- */
- error = kern_fcntl(td, td->td_retval[0], F_SETFL, 0);
- if (error)
- goto out;
- error = linux_set_socket_flags(td, td->td_retval[0], flags);
- if (error)
- goto out;
if (addr)
error = linux_sa_put(PTRIN(addr));
-
-out:
if (error) {
(void)kern_close(td, td->td_retval[0]);
td->td_retval[0] = 0;
@@ -856,13 +807,7 @@ out:
return (error);
}
-struct linux_accept_args {
- int s;
- l_uintptr_t addr;
- l_uintptr_t namelen;
-};
-
-static int
+int
linux_accept(struct thread *td, struct linux_accept_args *args)
{
@@ -870,14 +815,7 @@ linux_accept(struct thread *td, struct linux_accept_args *args)
args->namelen, 0));
}
-struct linux_accept4_args {
- int s;
- l_uintptr_t addr;
- l_uintptr_t namelen;
- int flags;
-};
-
-static int
+int
linux_accept4(struct thread *td, struct linux_accept4_args *args)
{
@@ -885,13 +823,7 @@ linux_accept4(struct thread *td, struct linux_accept4_args *args)
args->namelen, args->flags));
}
-struct linux_getsockname_args {
- int s;
- l_uintptr_t addr;
- l_uintptr_t namelen;
-};
-
-static int
+int
linux_getsockname(struct thread *td, struct linux_getsockname_args *args)
{
struct getsockname_args /* {
@@ -915,13 +847,7 @@ linux_getsockname(struct thread *td, struct linux_getsockname_args *args)
return (0);
}
-struct linux_getpeername_args {
- int s;
- l_uintptr_t addr;
- l_uintptr_t namelen;
-};
-
-static int
+int
linux_getpeername(struct thread *td, struct linux_getpeername_args *args)
{
struct getpeername_args /* {
@@ -944,14 +870,7 @@ linux_getpeername(struct thread *td, struct linux_getpeername_args *args)
return (0);
}
-struct linux_socketpair_args {
- int domain;
- int type;
- int protocol;
- l_uintptr_t rsv;
-};
-
-static int
+int
linux_socketpair(struct thread *td, struct linux_socketpair_args *args)
{
struct socketpair_args /* {
@@ -960,20 +879,18 @@ linux_socketpair(struct thread *td, struct linux_socketpair_args *args)
int protocol;
int *rsv;
} */ bsd_args;
- int error, socket_flags;
- int sv[2];
+ int error;
bsd_args.domain = linux_to_bsd_domain(args->domain);
if (bsd_args.domain != PF_LOCAL)
return (EAFNOSUPPORT);
-
- socket_flags = args->type & ~LINUX_SOCK_TYPE_MASK;
- if (socket_flags & ~(LINUX_SOCK_CLOEXEC | LINUX_SOCK_NONBLOCK))
- return (EINVAL);
bsd_args.type = args->type & LINUX_SOCK_TYPE_MASK;
if (bsd_args.type < 0 || bsd_args.type > LINUX_SOCK_MAX)
return (EINVAL);
-
+ error = linux_set_socket_flags(args->type & ~LINUX_SOCK_TYPE_MASK,
+ &bsd_args.type);
+ if (error != 0)
+ return (error);
if (args->protocol != 0 && args->protocol != PF_UNIX)
/*
@@ -986,27 +903,10 @@ linux_socketpair(struct thread *td, struct linux_socketpair_args *args)
else
bsd_args.protocol = 0;
bsd_args.rsv = (int *)PTRIN(args->rsv);
- error = kern_socketpair(td, bsd_args.domain, bsd_args.type,
- bsd_args.protocol, sv);
- if (error)
- return (error);
- error = linux_set_socket_flags(td, sv[0], socket_flags);
- if (error)
- goto out;
- error = linux_set_socket_flags(td, sv[1], socket_flags);
- if (error)
- goto out;
-
- error = copyout(sv, bsd_args.rsv, 2 * sizeof(int));
-
-out:
- if (error) {
- (void)kern_close(td, sv[0]);
- (void)kern_close(td, sv[1]);
- }
- return (error);
+ return (sys_socketpair(td, &bsd_args));
}
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
struct linux_send_args {
int s;
l_uintptr_t msg;
@@ -1062,8 +962,9 @@ linux_recv(struct thread *td, struct linux_recv_args *args)
bsd_args.fromlenaddr = 0;
return (sys_recvfrom(td, &bsd_args));
}
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
-static int
+int
linux_sendto(struct thread *td, struct linux_sendto_args *args)
{
struct msghdr msg;
@@ -1087,63 +988,58 @@ linux_sendto(struct thread *td, struct linux_sendto_args *args)
return (error);
}
-struct linux_recvfrom_args {
- int s;
- l_uintptr_t buf;
- int len;
- int flags;
- l_uintptr_t from;
- l_uintptr_t fromlen;
-};
-
-static int
+int
linux_recvfrom(struct thread *td, struct linux_recvfrom_args *args)
{
- struct recvfrom_args /* {
- int s;
- caddr_t buf;
- size_t len;
- int flags;
- struct sockaddr * __restrict from;
- socklen_t * __restrict fromlenaddr;
- } */ bsd_args;
- size_t len;
+ struct msghdr msg;
+ struct iovec aiov;
int error;
- if ((error = copyin(PTRIN(args->fromlen), &len, sizeof(size_t))))
- return (error);
+ if (PTRIN(args->fromlen) != NULL) {
+ error = copyin(PTRIN(args->fromlen), &msg.msg_namelen,
+ sizeof(msg.msg_namelen));
+ if (error != 0)
+ return (error);
- bsd_args.s = args->s;
- bsd_args.buf = PTRIN(args->buf);
- bsd_args.len = args->len;
- bsd_args.flags = linux_to_bsd_msg_flags(args->flags);
- /* XXX: */
- bsd_args.from = (struct sockaddr * __restrict)PTRIN(args->from);
- bsd_args.fromlenaddr = PTRIN(args->fromlen);/* XXX */
-
- linux_to_bsd_sockaddr((struct sockaddr *)bsd_args.from, len);
- error = sys_recvfrom(td, &bsd_args);
- bsd_to_linux_sockaddr((struct sockaddr *)bsd_args.from);
-
- if (error)
+ error = linux_to_bsd_sockaddr((struct sockaddr *)PTRIN(args->from),
+ msg.msg_namelen);
+ if (error != 0)
+ return (error);
+ } else
+ msg.msg_namelen = 0;
+
+ msg.msg_name = (struct sockaddr * __restrict)PTRIN(args->from);
+ msg.msg_iov = &aiov;
+ msg.msg_iovlen = 1;
+ aiov.iov_base = PTRIN(args->buf);
+ aiov.iov_len = args->len;
+ msg.msg_control = 0;
+ msg.msg_flags = linux_to_bsd_msg_flags(args->flags);
+
+ error = kern_recvit(td, args->s, &msg, UIO_USERSPACE, NULL);
+ if (error != 0)
return (error);
- if (args->from) {
- error = linux_sa_put((struct osockaddr *)
+
+ if (PTRIN(args->from) != NULL) {
+ error = bsd_to_linux_sockaddr((struct sockaddr *)
PTRIN(args->from));
- if (error)
+ if (error != 0)
return (error);
+
+ error = linux_sa_put((struct osockaddr *)
+ PTRIN(args->from));
}
- return (0);
-}
-struct linux_sendmsg_args {
- int s;
- l_uintptr_t msg;
- int flags;
-};
+ if (PTRIN(args->fromlen) != NULL)
+ error = copyout(&msg.msg_namelen, PTRIN(args->fromlen),
+ sizeof(msg.msg_namelen));
+
+ return (error);
+}
static int
-linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args)
+linux_sendmsg_common(struct thread *td, l_int s, struct l_msghdr *msghdr,
+ l_uint flags)
{
struct cmsghdr *cmsg;
struct cmsgcred cmcred;
@@ -1159,8 +1055,8 @@ linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args)
void *data;
int error;
- error = copyin(PTRIN(args->msg), &linux_msg, sizeof(linux_msg));
- if (error)
+ error = copyin(msghdr, &linux_msg, sizeof(linux_msg));
+ if (error != 0)
return (error);
/*
@@ -1174,7 +1070,7 @@ linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args)
linux_msg.msg_control = PTROUT(NULL);
error = linux_to_bsd_msghdr(&msg, &linux_msg);
- if (error)
+ if (error != 0)
return (error);
#ifdef COMPAT_LINUX32
@@ -1183,29 +1079,27 @@ linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args)
#else
error = copyiniov(msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE);
#endif
- if (error)
+ if (error != 0)
return (error);
control = NULL;
cmsg = NULL;
if ((ptr_cmsg = LINUX_CMSG_FIRSTHDR(&linux_msg)) != NULL) {
- error = kern_getsockname(td, args->s, &sa, &datalen);
- if (error)
+ error = kern_getsockname(td, s, &sa, &datalen);
+ if (error != 0)
goto bad;
sa_family = sa->sa_family;
free(sa, M_SONAME);
error = ENOBUFS;
- cmsg = malloc(CMSG_HDRSZ, M_TEMP, M_WAITOK | M_ZERO);
+ cmsg = malloc(CMSG_HDRSZ, M_LINUX, M_WAITOK|M_ZERO);
control = m_get(M_WAITOK, MT_CONTROL);
- if (control == NULL)
- goto bad;
do {
error = copyin(ptr_cmsg, &linux_cmsg,
sizeof(struct l_cmsghdr));
- if (error)
+ if (error != 0)
goto bad;
error = EINVAL;
@@ -1269,28 +1163,60 @@ linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args)
msg.msg_iov = iov;
msg.msg_flags = 0;
- error = linux_sendit(td, args->s, &msg, args->flags, control,
- UIO_USERSPACE);
+ error = linux_sendit(td, s, &msg, flags, control, UIO_USERSPACE);
bad:
+ m_freem(control);
free(iov, M_IOV);
if (cmsg)
- free(cmsg, M_TEMP);
+ free(cmsg, M_LINUX);
return (error);
}
-struct linux_recvmsg_args {
- int s;
- l_uintptr_t msg;
- int flags;
-};
+int
+linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args)
+{
+
+ return (linux_sendmsg_common(td, args->s, PTRIN(args->msg),
+ args->flags));
+}
+
+int
+linux_sendmmsg(struct thread *td, struct linux_sendmmsg_args *args)
+{
+ struct l_mmsghdr *msg;
+ l_uint retval;
+ int error, datagrams;
+
+ if (args->vlen > UIO_MAXIOV)
+ args->vlen = UIO_MAXIOV;
+
+ msg = PTRIN(args->msg);
+ datagrams = 0;
+ while (datagrams < args->vlen) {
+ error = linux_sendmsg_common(td, args->s, &msg->msg_hdr,
+ args->flags);
+ if (error != 0)
+ break;
+
+ retval = td->td_retval[0];
+ error = copyout(&retval, &msg->msg_len, sizeof(msg->msg_len));
+ if (error != 0)
+ break;
+ ++msg;
+ ++datagrams;
+ }
+ if (error == 0)
+ td->td_retval[0] = datagrams;
+ return (error);
+}
static int
-linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args)
+linux_recvmsg_common(struct thread *td, l_int s, struct l_msghdr *msghdr,
+ l_uint flags, struct msghdr *msg)
{
struct cmsghdr *cm;
struct cmsgcred *cmcred;
- struct msghdr msg;
struct l_cmsghdr *linux_cmsg = NULL;
struct l_ucred linux_ucred;
socklen_t datalen, outlen;
@@ -1298,55 +1224,57 @@ linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args)
struct iovec *iov, *uiov;
struct mbuf *control = NULL;
struct mbuf **controlp;
+ struct timeval *ftmvl;
+ l_timeval ltmvl;
caddr_t outbuf;
void *data;
int error, i, fd, fds, *fdp;
- error = copyin(PTRIN(args->msg), &linux_msg, sizeof(linux_msg));
- if (error)
+ error = copyin(msghdr, &linux_msg, sizeof(linux_msg));
+ if (error != 0)
return (error);
- error = linux_to_bsd_msghdr(&msg, &linux_msg);
- if (error)
+ error = linux_to_bsd_msghdr(msg, &linux_msg);
+ if (error != 0)
return (error);
#ifdef COMPAT_LINUX32
- error = linux32_copyiniov(PTRIN(msg.msg_iov), msg.msg_iovlen,
+ error = linux32_copyiniov(PTRIN(msg->msg_iov), msg->msg_iovlen,
&iov, EMSGSIZE);
#else
- error = copyiniov(msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE);
+ error = copyiniov(msg->msg_iov, msg->msg_iovlen, &iov, EMSGSIZE);
#endif
- if (error)
+ if (error != 0)
return (error);
- if (msg.msg_name) {
- error = linux_to_bsd_sockaddr((struct sockaddr *)msg.msg_name,
- msg.msg_namelen);
- if (error)
+ if (msg->msg_name) {
+ error = linux_to_bsd_sockaddr((struct sockaddr *)msg->msg_name,
+ msg->msg_namelen);
+ if (error != 0)
goto bad;
}
- uiov = msg.msg_iov;
- msg.msg_iov = iov;
- controlp = (msg.msg_control != NULL) ? &control : NULL;
- error = kern_recvit(td, args->s, &msg, UIO_USERSPACE, controlp);
- msg.msg_iov = uiov;
- if (error)
+ uiov = msg->msg_iov;
+ msg->msg_iov = iov;
+ controlp = (msg->msg_control != NULL) ? &control : NULL;
+ error = kern_recvit(td, s, msg, UIO_USERSPACE, controlp);
+ msg->msg_iov = uiov;
+ if (error != 0)
goto bad;
- error = bsd_to_linux_msghdr(&msg, &linux_msg);
- if (error)
+ error = bsd_to_linux_msghdr(msg, &linux_msg);
+ if (error != 0)
goto bad;
if (linux_msg.msg_name) {
error = bsd_to_linux_sockaddr((struct sockaddr *)
PTRIN(linux_msg.msg_name));
- if (error)
+ if (error != 0)
goto bad;
}
if (linux_msg.msg_name && linux_msg.msg_namelen > 2) {
error = linux_sa_put(PTRIN(linux_msg.msg_name));
- if (error)
+ if (error != 0)
goto bad;
}
@@ -1354,12 +1282,12 @@ linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args)
outlen = 0;
if (control) {
- linux_cmsg = malloc(L_CMSG_HDRSZ, M_TEMP, M_WAITOK | M_ZERO);
+ linux_cmsg = malloc(L_CMSG_HDRSZ, M_LINUX, M_WAITOK | M_ZERO);
- msg.msg_control = mtod(control, struct cmsghdr *);
- msg.msg_controllen = control->m_len;
+ msg->msg_control = mtod(control, struct cmsghdr *);
+ msg->msg_controllen = control->m_len;
- cm = CMSG_FIRSTHDR(&msg);
+ cm = CMSG_FIRSTHDR(msg);
while (cm != NULL) {
linux_cmsg->cmsg_type =
@@ -1379,7 +1307,7 @@ linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args)
switch (cm->cmsg_type)
{
case SCM_RIGHTS:
- if (args->flags & LINUX_MSG_CMSG_CLOEXEC) {
+ if (flags & LINUX_MSG_CMSG_CLOEXEC) {
fds = datalen / sizeof(int);
fdp = data;
for (i = 0; i < fds; i++) {
@@ -1408,6 +1336,18 @@ linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args)
data = &linux_ucred;
datalen = sizeof(linux_ucred);
break;
+
+ case SCM_TIMESTAMP:
+ if (datalen != sizeof(struct timeval)) {
+ error = EMSGSIZE;
+ goto bad;
+ }
+ ftmvl = (struct timeval *)data;
+ ltmvl.tv_sec = ftmvl->tv_sec;
+ ltmvl.tv_usec = ftmvl->tv_usec;
+ data = &ltmvl;
+ datalen = sizeof(ltmvl);
+ break;
}
if (outlen + LINUX_CMSG_LEN(datalen) >
@@ -1436,28 +1376,92 @@ linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args)
outbuf += LINUX_CMSG_ALIGN(datalen);
outlen += LINUX_CMSG_LEN(datalen);
- cm = CMSG_NXTHDR(&msg, cm);
+ cm = CMSG_NXTHDR(msg, cm);
}
}
out:
linux_msg.msg_controllen = outlen;
- error = copyout(&linux_msg, PTRIN(args->msg), sizeof(linux_msg));
+ error = copyout(&linux_msg, msghdr, sizeof(linux_msg));
bad:
free(iov, M_IOV);
m_freem(control);
- free(linux_cmsg, M_TEMP);
+ free(linux_cmsg, M_LINUX);
return (error);
}
-struct linux_shutdown_args {
- int s;
- int how;
-};
+int
+linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args)
+{
+ struct msghdr bsd_msg;
-static int
+ return (linux_recvmsg_common(td, args->s, PTRIN(args->msg),
+ args->flags, &bsd_msg));
+}
+
+int
+linux_recvmmsg(struct thread *td, struct linux_recvmmsg_args *args)
+{
+ struct l_mmsghdr *msg;
+ struct msghdr bsd_msg;
+ struct l_timespec lts;
+ struct timespec ts, tts;
+ l_uint retval;
+ int error, datagrams;
+
+ if (args->timeout) {
+ error = copyin(args->timeout, &lts, sizeof(struct l_timespec));
+ if (error != 0)
+ return (error);
+ error = linux_to_native_timespec(&ts, &lts);
+ if (error != 0)
+ return (error);
+ getnanotime(&tts);
+ timespecadd(&tts, &ts);
+ }
+
+ msg = PTRIN(args->msg);
+ datagrams = 0;
+ while (datagrams < args->vlen) {
+ error = linux_recvmsg_common(td, args->s, &msg->msg_hdr,
+ args->flags & ~LINUX_MSG_WAITFORONE, &bsd_msg);
+ if (error != 0)
+ break;
+
+ retval = td->td_retval[0];
+ error = copyout(&retval, &msg->msg_len, sizeof(msg->msg_len));
+ if (error != 0)
+ break;
+ ++msg;
+ ++datagrams;
+
+ /*
+ * MSG_WAITFORONE turns on MSG_DONTWAIT after one packet.
+ */
+ if (args->flags & LINUX_MSG_WAITFORONE)
+ args->flags |= LINUX_MSG_DONTWAIT;
+
+ /*
+ * See BUGS section of recvmmsg(2).
+ */
+ if (args->timeout) {
+ getnanotime(&ts);
+ timespecsub(&ts, &tts);
+ if (!timespecisset(&ts) || ts.tv_sec > 0)
+ break;
+ }
+ /* Out of band data, return right away. */
+ if (bsd_msg.msg_flags & MSG_OOB)
+ break;
+ }
+ if (error == 0)
+ td->td_retval[0] = datagrams;
+ return (error);
+}
+
+int
linux_shutdown(struct thread *td, struct linux_shutdown_args *args)
{
struct shutdown_args /* {
@@ -1470,15 +1474,7 @@ linux_shutdown(struct thread *td, struct linux_shutdown_args *args)
return (sys_shutdown(td, &bsd_args));
}
-struct linux_setsockopt_args {
- int s;
- int level;
- int optname;
- l_uintptr_t optval;
- int optlen;
-};
-
-static int
+int
linux_setsockopt(struct thread *td, struct linux_setsockopt_args *args)
{
struct setsockopt_args /* {
@@ -1543,15 +1539,7 @@ linux_setsockopt(struct thread *td, struct linux_setsockopt_args *args)
return (error);
}
-struct linux_getsockopt_args {
- int s;
- int level;
- int optname;
- l_uintptr_t optval;
- l_uintptr_t optlen;
-};
-
-static int
+int
linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args)
{
struct getsockopt_args /* {
@@ -1635,6 +1623,8 @@ linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args)
return (error);
}
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
+
/* Argument list sizes for linux_socketcall */
#define LINUX_AL(x) ((x) * sizeof(l_ulong))
@@ -1649,7 +1639,8 @@ static const unsigned char lxs_args[] = {
LINUX_AL(6) /* recvfrom */, LINUX_AL(2) /* shutdown */,
LINUX_AL(5) /* setsockopt */, LINUX_AL(5) /* getsockopt */,
LINUX_AL(3) /* sendmsg */, LINUX_AL(3) /* recvmsg */,
- LINUX_AL(4) /* accept4 */
+ LINUX_AL(4) /* accept4 */, LINUX_AL(5) /* recvmmsg */,
+ LINUX_AL(4) /* sendmmsg */
};
#define LINUX_AL_SIZE sizeof(lxs_args) / sizeof(lxs_args[0]) - 1
@@ -1705,8 +1696,13 @@ linux_socketcall(struct thread *td, struct linux_socketcall_args *args)
return (linux_recvmsg(td, arg));
case LINUX_ACCEPT4:
return (linux_accept4(td, arg));
+ case LINUX_RECVMMSG:
+ return (linux_recvmmsg(td, arg));
+ case LINUX_SENDMMSG:
+ return (linux_sendmmsg(td, arg));
}
uprintf("LINUX: 'socket' typ=%d not implemented\n", args->what);
return (ENOSYS);
}
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
diff --git a/sys/compat/linux/linux_socket.h b/sys/compat/linux/linux_socket.h
index e6efadb..b32a969 100644
--- a/sys/compat/linux/linux_socket.h
+++ b/sys/compat/linux/linux_socket.h
@@ -48,12 +48,36 @@
#define LINUX_MSG_RST 0x1000
#define LINUX_MSG_ERRQUEUE 0x2000
#define LINUX_MSG_NOSIGNAL 0x4000
+#define LINUX_MSG_WAITFORONE 0x10000
#define LINUX_MSG_CMSG_CLOEXEC 0x40000000
/* Socket-level control message types */
#define LINUX_SCM_RIGHTS 0x01
-#define LINUX_SCM_CREDENTIALS 0x02
+#define LINUX_SCM_CREDENTIALS 0x02
+#define LINUX_SCM_TIMESTAMP 0x1D
+
+struct l_msghdr {
+ l_uintptr_t msg_name;
+ l_int msg_namelen;
+ l_uintptr_t msg_iov;
+ l_size_t msg_iovlen;
+ l_uintptr_t msg_control;
+ l_size_t msg_controllen;
+ l_uint msg_flags;
+};
+
+struct l_mmsghdr {
+ struct l_msghdr msg_hdr;
+ l_uint msg_len;
+
+};
+
+struct l_cmsghdr {
+ l_size_t cmsg_len;
+ l_int cmsg_level;
+ l_int cmsg_type;
+};
/* Ancilliary data object information macros */
@@ -116,6 +140,133 @@ struct l_ucred {
uint32_t gid;
};
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
+
+struct linux_sendto_args {
+ int s;
+ l_uintptr_t msg;
+ int len;
+ int flags;
+ l_uintptr_t to;
+ int tolen;
+};
+
+struct linux_socket_args {
+ int domain;
+ int type;
+ int protocol;
+};
+
+struct linux_bind_args {
+ int s;
+ l_uintptr_t name;
+ int namelen;
+};
+
+struct linux_connect_args {
+ int s;
+ l_uintptr_t name;
+ int namelen;
+};
+
+struct linux_listen_args {
+ int s;
+ int backlog;
+};
+
+struct linux_accept_args {
+ int s;
+ l_uintptr_t addr;
+ l_uintptr_t namelen;
+};
+
+struct linux_accept4_args {
+ int s;
+ l_uintptr_t addr;
+ l_uintptr_t namelen;
+ int flags;
+};
+
+struct linux_getsockname_args {
+ int s;
+ l_uintptr_t addr;
+ l_uintptr_t namelen;
+};
+
+struct linux_getpeername_args {
+ int s;
+ l_uintptr_t addr;
+ l_uintptr_t namelen;
+};
+
+struct linux_socketpair_args {
+ int domain;
+ int type;
+ int protocol;
+ l_uintptr_t rsv;
+};
+
+struct linux_recvfrom_args {
+ int s;
+ l_uintptr_t buf;
+ int len;
+ int flags;
+ l_uintptr_t from;
+ l_uintptr_t fromlen;
+};
+
+struct linux_sendmsg_args {
+ int s;
+ l_uintptr_t msg;
+ int flags;
+};
+
+struct linux_recvmsg_args {
+ int s;
+ l_uintptr_t msg;
+ int flags;
+};
+
+struct linux_shutdown_args {
+ int s;
+ int how;
+};
+
+struct linux_setsockopt_args {
+ int s;
+ int level;
+ int optname;
+ l_uintptr_t optval;
+ int optlen;
+};
+
+struct linux_getsockopt_args {
+ int s;
+ int level;
+ int optname;
+ l_uintptr_t optval;
+ l_uintptr_t optlen;
+};
+
+int linux_socket(struct thread *td, struct linux_socket_args *args);
+int linux_bind(struct thread *td, struct linux_bind_args *args);
+int linux_connect(struct thread *, struct linux_connect_args *);
+int linux_listen(struct thread *td, struct linux_listen_args *args);
+int linux_accept(struct thread *td, struct linux_accept_args *args);
+int linux_accept4(struct thread *td, struct linux_accept4_args *args);
+int linux_getsockname(struct thread *td, struct linux_getsockname_args *args);
+int linux_getpeername(struct thread *td, struct linux_getpeername_args *args);
+int linux_socketpair(struct thread *td, struct linux_socketpair_args *args);
+int linux_sendto(struct thread *td, struct linux_sendto_args *args);
+int linux_recvfrom(struct thread *td, struct linux_recvfrom_args *args);
+int linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args);
+int linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args);
+int linux_shutdown(struct thread *td, struct linux_shutdown_args *args);
+int linux_setsockopt(struct thread *td, struct linux_setsockopt_args *args);
+int linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args);
+
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
+
/* Operations for socketcall */
#define LINUX_SOCKET 1
@@ -136,6 +287,8 @@ struct l_ucred {
#define LINUX_SENDMSG 16
#define LINUX_RECVMSG 17
#define LINUX_ACCEPT4 18
+#define LINUX_RECVMMSG 19
+#define LINUX_SENDMMSG 20
/* Socket options */
#define LINUX_IP_TOS 1
diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c
index b6dd86d..05d335a 100644
--- a/sys/compat/linux/linux_stats.c
+++ b/sys/compat/linux/linux_stats.c
@@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
#include "opt_compat.h"
#include <sys/param.h>
+#include <sys/capsicum.h>
#include <sys/dirent.h>
#include <sys/file.h>
#include <sys/filedesc.h>
@@ -58,7 +59,6 @@ __FBSDID("$FreeBSD$");
#include <compat/linux/linux_util.h>
#include <compat/linux/linux_file.h>
-#define LINUX_SHMFS_MAGIC 0x01021994
static void
translate_vnhook_major_minor(struct vnode *vp, struct stat *sb)
@@ -251,6 +251,7 @@ linux_newfstat(struct thread *td, struct linux_newfstat_args *args)
return (error);
}
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
static int
stat_copyout(struct stat *buf, void *ubuf)
{
@@ -325,19 +326,19 @@ linux_lstat(struct thread *td, struct linux_lstat_args *args)
LFREEPATH(path);
return(stat_copyout(&buf, args->up));
}
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
-/* XXX - All fields of type l_int are defined as l_long on i386 */
struct l_statfs {
- l_int f_type;
- l_int f_bsize;
- l_int f_blocks;
- l_int f_bfree;
- l_int f_bavail;
- l_int f_files;
- l_int f_ffree;
+ l_long f_type;
+ l_long f_bsize;
+ l_long f_blocks;
+ l_long f_bfree;
+ l_long f_bavail;
+ l_long f_files;
+ l_long f_ffree;
l_fsid_t f_fsid;
- l_int f_namelen;
- l_int f_spare[6];
+ l_long f_namelen;
+ l_long f_spare[6];
};
#define LINUX_CODA_SUPER_MAGIC 0x73757245L
@@ -351,6 +352,7 @@ struct l_statfs {
#define LINUX_PROC_SUPER_MAGIC 0x9fa0L
#define LINUX_UFS_SUPER_MAGIC 0x00011954L /* XXX - UFS_MAGIC in Linux */
#define LINUX_DEVFS_SUPER_MAGIC 0x1373L
+#define LINUX_SHMFS_MAGIC 0x01021994
static long
bsd_to_linux_ftype(const char *fstypename)
@@ -368,6 +370,7 @@ bsd_to_linux_ftype(const char *fstypename)
{"hpfs", LINUX_HPFS_SUPER_MAGIC},
{"coda", LINUX_CODA_SUPER_MAGIC},
{"devfs", LINUX_DEVFS_SUPER_MAGIC},
+ {"tmpfs", LINUX_SHMFS_MAGIC},
{NULL, 0L}};
for (i = 0; b2l_tbl[i].bsd_name != NULL; i++)
@@ -399,7 +402,7 @@ linux_statfs(struct thread *td, struct linux_statfs_args *args)
struct l_statfs linux_statfs;
struct statfs bsd_statfs;
char *path;
- int error, dev_shm;
+ int error;
LCONVPATHEXIST(td, args->path, &path);
@@ -407,20 +410,15 @@ linux_statfs(struct thread *td, struct linux_statfs_args *args)
if (ldebug(statfs))
printf(ARGS(statfs, "%s, *"), path);
#endif
- dev_shm = 0;
error = kern_statfs(td, path, UIO_SYSSPACE, &bsd_statfs);
- if (strncmp(path, "/dev/shm", sizeof("/dev/shm") - 1) == 0)
- dev_shm = (path[8] == '\0'
- || (path[8] == '/' && path[9] == '\0'));
LFREEPATH(path);
if (error)
return (error);
bsd_to_linux_statfs(&bsd_statfs, &linux_statfs);
- if (dev_shm)
- linux_statfs.f_type = LINUX_SHMFS_MAGIC;
return copyout(&linux_statfs, args->buf, sizeof(linux_statfs));
}
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
static void
bsd_to_linux_statfs64(struct statfs *bsd_statfs, struct l_statfs64 *linux_statfs)
{
@@ -461,6 +459,7 @@ linux_statfs64(struct thread *td, struct linux_statfs64_args *args)
bsd_to_linux_statfs64(&bsd_statfs, &linux_statfs);
return copyout(&linux_statfs, args->buf, sizeof(linux_statfs));
}
+#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
int
linux_fstatfs(struct thread *td, struct linux_fstatfs_args *args)
@@ -493,7 +492,7 @@ linux_ustat(struct thread *td, struct linux_ustat_args *args)
{
#ifdef DEBUG
if (ldebug(ustat))
- printf(ARGS(ustat, "%d, *"), args->dev);
+ printf(ARGS(ustat, "%ju, *"), (uintmax_t)args->dev);
#endif
return (EOPNOTSUPP);
@@ -624,4 +623,74 @@ linux_fstatat64(struct thread *td, struct linux_fstatat64_args *args)
return (error);
}
+#else /* __amd64__ && !COMPAT_LINUX32 */
+
+int
+linux_newfstatat(struct thread *td, struct linux_newfstatat_args *args)
+{
+ char *path;
+ int error, dfd, flag;
+ struct stat buf;
+
+ if (args->flag & ~LINUX_AT_SYMLINK_NOFOLLOW)
+ return (EINVAL);
+ flag = (args->flag & LINUX_AT_SYMLINK_NOFOLLOW) ?
+ AT_SYMLINK_NOFOLLOW : 0;
+
+ dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
+ LCONVPATHEXIST_AT(td, args->pathname, &path, dfd);
+
+#ifdef DEBUG
+ if (ldebug(newfstatat))
+ printf(ARGS(newfstatat, "%i, %s, %i"), args->dfd, path, args->flag);
+#endif
+
+ error = linux_kern_statat(td, flag, dfd, path, UIO_SYSSPACE, &buf);
+ if (error == 0)
+ error = newstat_copyout(&buf, args->statbuf);
+ LFREEPATH(path);
+
+ return (error);
+}
+
#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
+
+int
+linux_syncfs(struct thread *td, struct linux_syncfs_args *args)
+{
+ cap_rights_t rights;
+ struct mount *mp;
+ struct vnode *vp;
+ int error, save;
+
+ error = fgetvp(td, args->fd, cap_rights_init(&rights, CAP_FSYNC), &vp);
+ if (error != 0)
+ /*
+ * Linux syncfs() returns only EBADF, however fgetvp()
+ * can return EINVAL in case of file descriptor does
+ * not represent a vnode. XXX.
+ */
+ return (error);
+
+ mp = vp->v_mount;
+ mtx_lock(&mountlist_mtx);
+ error = vfs_busy(mp, MBF_MNTLSTLOCK);
+ if (error != 0) {
+ /* See comment above. */
+ mtx_unlock(&mountlist_mtx);
+ goto out;
+ }
+ if ((mp->mnt_flag & MNT_RDONLY) == 0 &&
+ vn_start_write(NULL, &mp, V_NOWAIT) == 0) {
+ save = curthread_pflags_set(TDP_SYNCIO);
+ vfs_msync(mp, MNT_NOWAIT);
+ VFS_SYNC(mp, MNT_NOWAIT);
+ curthread_pflags_restore(save);
+ vn_finished_write(mp);
+ }
+ vfs_unbusy(mp);
+
+ out:
+ vrele(vp);
+ return (error);
+}
diff --git a/sys/compat/linux/linux_sysctl.c b/sys/compat/linux/linux_sysctl.c
index 7d263df..44fe41d 100644
--- a/sys/compat/linux/linux_sysctl.c
+++ b/sys/compat/linux/linux_sysctl.c
@@ -140,12 +140,12 @@ linux_sysctl(struct thread *td, struct linux_sysctl_args *args)
return (ENOTDIR);
}
- mib = malloc(la.nlen * sizeof(l_int), M_TEMP, M_WAITOK);
+ mib = malloc(la.nlen * sizeof(l_int), M_LINUX, M_WAITOK);
error = copyin(PTRIN(la.name), mib, la.nlen * sizeof(l_int));
if (error) {
LIN_SDT_PROBE1(sysctl, linux_sysctl, copyin_error, error);
LIN_SDT_PROBE1(sysctl, linux_sysctl, return, error);
- free(mib, M_TEMP);
+ free(mib, M_LINUX);
return (error);
}
@@ -157,7 +157,7 @@ linux_sysctl(struct thread *td, struct linux_sysctl_args *args)
switch (mib[1]) {
case LINUX_KERN_VERSION:
error = handle_string(&la, version);
- free(mib, M_TEMP);
+ free(mib, M_LINUX);
LIN_SDT_PROBE1(sysctl, linux_sysctl, return, error);
return (error);
default:
@@ -186,7 +186,7 @@ linux_sysctl(struct thread *td, struct linux_sysctl_args *args)
sbuf_delete(sb);
}
- free(mib, M_TEMP);
+ free(mib, M_LINUX);
LIN_SDT_PROBE1(sysctl, linux_sysctl, return, ENOTDIR);
return (ENOTDIR);
diff --git a/sys/compat/linux/linux_time.c b/sys/compat/linux/linux_time.c
index be6e169..2d29330 100644
--- a/sys/compat/linux/linux_time.c
+++ b/sys/compat/linux/linux_time.c
@@ -39,8 +39,11 @@ __KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.14 2006/05/14 03:40:54 christos Exp
#include <sys/param.h>
#include <sys/kernel.h>
+#include <sys/lock.h>
#include <sys/ucred.h>
#include <sys/mount.h>
+#include <sys/mutex.h>
+#include <sys/resourcevar.h>
#include <sys/sdt.h>
#include <sys/signal.h>
#include <sys/stdint.h>
@@ -59,7 +62,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.14 2006/05/14 03:40:54 christos Exp
#endif
#include <compat/linux/linux_dtrace.h>
-#include <compat/linux/linux_misc.h>
+#include <compat/linux/linux_timer.h>
/* DTrace init */
LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE);
@@ -102,27 +105,20 @@ LIN_SDT_PROBE_DEFINE1(time, linux_clock_getres, return, "int");
LIN_SDT_PROBE_DEFINE2(time, linux_nanosleep, entry, "const struct l_timespec *",
"struct l_timespec *");
LIN_SDT_PROBE_DEFINE1(time, linux_nanosleep, conversion_error, "int");
-LIN_SDT_PROBE_DEFINE1(time, linux_nanosleep, nanosleep_error, "int");
LIN_SDT_PROBE_DEFINE1(time, linux_nanosleep, copyout_error, "int");
LIN_SDT_PROBE_DEFINE1(time, linux_nanosleep, copyin_error, "int");
LIN_SDT_PROBE_DEFINE1(time, linux_nanosleep, return, "int");
LIN_SDT_PROBE_DEFINE4(time, linux_clock_nanosleep, entry, "clockid_t", "int",
"struct l_timespec *", "struct l_timespec *");
LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep, conversion_error, "int");
-LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep, nanosleep_error, "int");
LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep, copyout_error, "int");
LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep, copyin_error, "int");
LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep, unsupported_flags, "int");
LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep, unsupported_clockid, "int");
LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep, return, "int");
-static void native_to_linux_timespec(struct l_timespec *,
- struct timespec *);
-static int linux_to_native_timespec(struct timespec *,
- struct l_timespec *);
-static int linux_to_native_clockid(clockid_t *, clockid_t);
-static void
+void
native_to_linux_timespec(struct l_timespec *ltp, struct timespec *ntp)
{
@@ -134,7 +130,7 @@ native_to_linux_timespec(struct l_timespec *ltp, struct timespec *ntp)
LIN_SDT_PROBE0(time, native_to_linux_timespec, return);
}
-static int
+int
linux_to_native_timespec(struct timespec *ntp, struct l_timespec *ltp)
{
@@ -151,12 +147,26 @@ linux_to_native_timespec(struct timespec *ntp, struct l_timespec *ltp)
return (0);
}
-static int
+int
linux_to_native_clockid(clockid_t *n, clockid_t l)
{
LIN_SDT_PROBE2(time, linux_to_native_clockid, entry, n, l);
+ if (l < 0) {
+ /* cpu-clock */
+ if ((l & LINUX_CLOCKFD_MASK) == LINUX_CLOCKFD)
+ return (EINVAL);
+ if (LINUX_CPUCLOCK_WHICH(l) >= LINUX_CPUCLOCK_MAX)
+ return (EINVAL);
+
+ if (LINUX_CPUCLOCK_PERTHREAD(l))
+ *n = CLOCK_THREAD_CPUTIME_ID;
+ else
+ *n = CLOCK_PROCESS_CPUTIME_ID;
+ return (0);
+ }
+
switch (l) {
case LINUX_CLOCK_REALTIME:
*n = CLOCK_REALTIME;
@@ -164,21 +174,27 @@ linux_to_native_clockid(clockid_t *n, clockid_t l)
case LINUX_CLOCK_MONOTONIC:
*n = CLOCK_MONOTONIC;
break;
- case LINUX_CLOCK_PROCESS_CPUTIME_ID:
- case LINUX_CLOCK_THREAD_CPUTIME_ID:
- case LINUX_CLOCK_REALTIME_HR:
- case LINUX_CLOCK_MONOTONIC_HR:
+ case LINUX_CLOCK_REALTIME_COARSE:
+ *n = CLOCK_REALTIME_FAST;
+ break;
+ case LINUX_CLOCK_MONOTONIC_COARSE:
+ *n = CLOCK_MONOTONIC_FAST;
+ break;
+ case LINUX_CLOCK_MONOTONIC_RAW:
+ case LINUX_CLOCK_BOOTTIME:
+ case LINUX_CLOCK_REALTIME_ALARM:
+ case LINUX_CLOCK_BOOTTIME_ALARM:
+ case LINUX_CLOCK_SGI_CYCLE:
+ case LINUX_CLOCK_TAI:
LIN_SDT_PROBE1(time, linux_to_native_clockid,
unsupported_clockid, l);
LIN_SDT_PROBE1(time, linux_to_native_clockid, return, EINVAL);
return (EINVAL);
- break;
default:
LIN_SDT_PROBE1(time, linux_to_native_clockid,
unknown_clockid, l);
LIN_SDT_PROBE1(time, linux_to_native_clockid, return, EINVAL);
return (EINVAL);
- break;
}
LIN_SDT_PROBE1(time, linux_to_native_clockid, return, 0);
@@ -189,9 +205,14 @@ int
linux_clock_gettime(struct thread *td, struct linux_clock_gettime_args *args)
{
struct l_timespec lts;
- int error;
- clockid_t nwhich = 0; /* XXX: GCC */
struct timespec tp;
+ struct rusage ru;
+ struct thread *targettd;
+ struct proc *p;
+ int error, clockwhich;
+ clockid_t nwhich = 0; /* XXX: GCC */
+ pid_t pid;
+ lwpid_t tid;
LIN_SDT_PROBE2(time, linux_clock_gettime, entry, args->which, args->tp);
@@ -202,7 +223,100 @@ linux_clock_gettime(struct thread *td, struct linux_clock_gettime_args *args)
LIN_SDT_PROBE1(time, linux_clock_gettime, return, error);
return (error);
}
- error = kern_clock_gettime(td, nwhich, &tp);
+
+ switch (nwhich) {
+ case CLOCK_PROCESS_CPUTIME_ID:
+ clockwhich = LINUX_CPUCLOCK_WHICH(args->which);
+ pid = LINUX_CPUCLOCK_ID(args->which);
+ if (pid == 0) {
+ p = td->td_proc;
+ PROC_LOCK(p);
+ } else {
+ error = pget(pid, PGET_CANSEE, &p);
+ if (error != 0)
+ return (EINVAL);
+ }
+ switch (clockwhich) {
+ case LINUX_CPUCLOCK_PROF:
+ PROC_STATLOCK(p);
+ calcru(p, &ru.ru_utime, &ru.ru_stime);
+ PROC_STATUNLOCK(p);
+ PROC_UNLOCK(p);
+ timevaladd(&ru.ru_utime, &ru.ru_stime);
+ TIMEVAL_TO_TIMESPEC(&ru.ru_utime, &tp);
+ break;
+ case LINUX_CPUCLOCK_VIRT:
+ PROC_STATLOCK(p);
+ calcru(p, &ru.ru_utime, &ru.ru_stime);
+ PROC_STATUNLOCK(p);
+ PROC_UNLOCK(p);
+ TIMEVAL_TO_TIMESPEC(&ru.ru_utime, &tp);
+ break;
+ case LINUX_CPUCLOCK_SCHED:
+ PROC_UNLOCK(p);
+ error = kern_clock_getcpuclockid2(td, pid,
+ CPUCLOCK_WHICH_PID, &nwhich);
+ if (error != 0)
+ return (EINVAL);
+ error = kern_clock_gettime(td, nwhich, &tp);
+ break;
+ default:
+ PROC_UNLOCK(p);
+ return (EINVAL);
+ }
+
+ break;
+
+ case CLOCK_THREAD_CPUTIME_ID:
+ clockwhich = LINUX_CPUCLOCK_WHICH(args->which);
+ p = td->td_proc;
+ tid = LINUX_CPUCLOCK_ID(args->which);
+ if (tid == 0) {
+ targettd = td;
+ PROC_LOCK(p);
+ } else {
+ targettd = tdfind(tid, p->p_pid);
+ if (targettd == NULL)
+ return (EINVAL);
+ }
+ switch (clockwhich) {
+ case LINUX_CPUCLOCK_PROF:
+ PROC_STATLOCK(p);
+ thread_lock(targettd);
+ rufetchtd(targettd, &ru);
+ thread_unlock(targettd);
+ PROC_STATUNLOCK(p);
+ PROC_UNLOCK(p);
+ timevaladd(&ru.ru_utime, &ru.ru_stime);
+ TIMEVAL_TO_TIMESPEC(&ru.ru_utime, &tp);
+ break;
+ case LINUX_CPUCLOCK_VIRT:
+ PROC_STATLOCK(p);
+ thread_lock(targettd);
+ rufetchtd(targettd, &ru);
+ thread_unlock(targettd);
+ PROC_STATUNLOCK(p);
+ PROC_UNLOCK(p);
+ TIMEVAL_TO_TIMESPEC(&ru.ru_utime, &tp);
+ break;
+ case LINUX_CPUCLOCK_SCHED:
+ error = kern_clock_getcpuclockid2(td, tid,
+ CPUCLOCK_WHICH_TID, &nwhich);
+ PROC_UNLOCK(p);
+ if (error != 0)
+ return (EINVAL);
+ error = kern_clock_gettime(td, nwhich, &tp);
+ break;
+ default:
+ PROC_UNLOCK(p);
+ return (EINVAL);
+ }
+ break;
+
+ default:
+ error = kern_clock_gettime(td, nwhich, &tp);
+ break;
+ }
if (error != 0) {
LIN_SDT_PROBE1(time, linux_clock_gettime, gettime_error, error);
LIN_SDT_PROBE1(time, linux_clock_gettime, return, error);
@@ -260,19 +374,16 @@ linux_clock_settime(struct thread *td, struct linux_clock_settime_args *args)
int
linux_clock_getres(struct thread *td, struct linux_clock_getres_args *args)
{
+ struct proc *p;
struct timespec ts;
struct l_timespec lts;
- int error;
+ int error, clockwhich;
clockid_t nwhich = 0; /* XXX: GCC */
+ pid_t pid;
+ lwpid_t tid;
LIN_SDT_PROBE2(time, linux_clock_getres, entry, args->which, args->tp);
- if (args->tp == NULL) {
- LIN_SDT_PROBE0(time, linux_clock_getres, nullcall);
- LIN_SDT_PROBE1(time, linux_clock_getres, return, 0);
- return (0);
- }
-
error = linux_to_native_clockid(&nwhich, args->which);
if (error != 0) {
LIN_SDT_PROBE1(time, linux_clock_getres, conversion_error,
@@ -280,6 +391,59 @@ linux_clock_getres(struct thread *td, struct linux_clock_getres_args *args)
LIN_SDT_PROBE1(time, linux_clock_getres, return, error);
return (error);
}
+
+ /*
+ * Check user supplied clock id in case of per-process
+ * or thread-specific cpu-time clock.
+ */
+ switch (nwhich) {
+ case CLOCK_THREAD_CPUTIME_ID:
+ tid = LINUX_CPUCLOCK_ID(args->which);
+ if (tid != 0) {
+ p = td->td_proc;
+ if (tdfind(tid, p->p_pid) == NULL)
+ return (ESRCH);
+ PROC_UNLOCK(p);
+ }
+ break;
+ case CLOCK_PROCESS_CPUTIME_ID:
+ pid = LINUX_CPUCLOCK_ID(args->which);
+ if (pid != 0) {
+ error = pget(pid, PGET_CANSEE, &p);
+ if (error != 0)
+ return (EINVAL);
+ PROC_UNLOCK(p);
+ }
+ break;
+ }
+
+ if (args->tp == NULL) {
+ LIN_SDT_PROBE0(time, linux_clock_getres, nullcall);
+ LIN_SDT_PROBE1(time, linux_clock_getres, return, 0);
+ return (0);
+ }
+
+ switch (nwhich) {
+ case CLOCK_THREAD_CPUTIME_ID:
+ case CLOCK_PROCESS_CPUTIME_ID:
+ clockwhich = LINUX_CPUCLOCK_WHICH(args->which);
+ switch (clockwhich) {
+ case LINUX_CPUCLOCK_PROF:
+ nwhich = CLOCK_PROF;
+ break;
+ case LINUX_CPUCLOCK_VIRT:
+ nwhich = CLOCK_VIRTUAL;
+ break;
+ case LINUX_CPUCLOCK_SCHED:
+ break;
+ default:
+ return (EINVAL);
+ }
+ break;
+
+ default:
+ break;
+ }
error = kern_clock_getres(td, nwhich, &ts);
if (error != 0) {
LIN_SDT_PROBE1(time, linux_clock_getres, getres_error, error);
@@ -302,7 +466,7 @@ linux_nanosleep(struct thread *td, struct linux_nanosleep_args *args)
struct timespec *rmtp;
struct l_timespec lrqts, lrmts;
struct timespec rqts, rmts;
- int error;
+ int error, error2;
LIN_SDT_PROBE2(time, linux_nanosleep, entry, args->rqtp, args->rmtp);
@@ -314,9 +478,9 @@ linux_nanosleep(struct thread *td, struct linux_nanosleep_args *args)
}
if (args->rmtp != NULL)
- rmtp = &rmts;
+ rmtp = &rmts;
else
- rmtp = NULL;
+ rmtp = NULL;
error = linux_to_native_timespec(&rqts, &lrqts);
if (error != 0) {
@@ -325,25 +489,19 @@ linux_nanosleep(struct thread *td, struct linux_nanosleep_args *args)
return (error);
}
error = kern_nanosleep(td, &rqts, rmtp);
- if (error != 0) {
- LIN_SDT_PROBE1(time, linux_nanosleep, nanosleep_error, error);
- LIN_SDT_PROBE1(time, linux_nanosleep, return, error);
- return (error);
- }
-
if (args->rmtp != NULL) {
- native_to_linux_timespec(&lrmts, rmtp);
- error = copyout(&lrmts, args->rmtp, sizeof(lrmts));
- if (error != 0) {
+ native_to_linux_timespec(&lrmts, rmtp);
+ error2 = copyout(&lrmts, args->rmtp, sizeof(lrmts));
+ if (error2 != 0) {
LIN_SDT_PROBE1(time, linux_nanosleep, copyout_error,
- error);
- LIN_SDT_PROBE1(time, linux_nanosleep, return, error);
- return (error);
+ error2);
+ LIN_SDT_PROBE1(time, linux_nanosleep, return, error2);
+ return (error2);
}
}
- LIN_SDT_PROBE1(time, linux_nanosleep, return, 0);
- return (0);
+ LIN_SDT_PROBE1(time, linux_nanosleep, return, error);
+ return (error);
}
int
@@ -352,7 +510,7 @@ linux_clock_nanosleep(struct thread *td, struct linux_clock_nanosleep_args *args
struct timespec *rmtp;
struct l_timespec lrqts, lrmts;
struct timespec rqts, rmts;
- int error;
+ int error, error2;
LIN_SDT_PROBE4(time, linux_clock_nanosleep, entry, args->which,
args->flags, args->rqtp, args->rmtp);
@@ -372,7 +530,7 @@ linux_clock_nanosleep(struct thread *td, struct linux_clock_nanosleep_args *args
return (EINVAL);
}
- error = copyin(args->rqtp, &lrqts, sizeof lrqts);
+ error = copyin(args->rqtp, &lrqts, sizeof(lrqts));
if (error != 0) {
LIN_SDT_PROBE1(time, linux_clock_nanosleep, copyin_error,
error);
@@ -381,9 +539,9 @@ linux_clock_nanosleep(struct thread *td, struct linux_clock_nanosleep_args *args
}
if (args->rmtp != NULL)
- rmtp = &rmts;
+ rmtp = &rmts;
else
- rmtp = NULL;
+ rmtp = NULL;
error = linux_to_native_timespec(&rqts, &lrqts);
if (error != 0) {
@@ -393,24 +551,19 @@ linux_clock_nanosleep(struct thread *td, struct linux_clock_nanosleep_args *args
return (error);
}
error = kern_nanosleep(td, &rqts, rmtp);
- if (error != 0) {
- LIN_SDT_PROBE1(time, linux_clock_nanosleep, nanosleep_error,
- error);
- LIN_SDT_PROBE1(time, linux_clock_nanosleep, return, error);
- return (error);
- }
-
if (args->rmtp != NULL) {
+ /* XXX. Not for TIMER_ABSTIME */
native_to_linux_timespec(&lrmts, rmtp);
- error = copyout(&lrmts, args->rmtp, sizeof lrmts );
- if (error != 0) {
+ error2 = copyout(&lrmts, args->rmtp, sizeof(lrmts));
+ if (error2 != 0) {
+ LIN_SDT_PROBE1(time, linux_clock_nanosleep,
+ copyout_error, error2);
LIN_SDT_PROBE1(time, linux_clock_nanosleep,
- copyout_error, error);
- LIN_SDT_PROBE1(time, linux_nanosleep, return, error);
- return (error);
+ return, error2);
+ return (error2);
}
}
- LIN_SDT_PROBE1(time, linux_clock_nanosleep, return, 0);
- return (0);
+ LIN_SDT_PROBE1(time, linux_clock_nanosleep, return, error);
+ return (error);
}
diff --git a/sys/compat/linux/linux_timer.c b/sys/compat/linux/linux_timer.c
index 92dae4c..7dbddbe 100644
--- a/sys/compat/linux/linux_timer.c
+++ b/sys/compat/linux/linux_timer.c
@@ -49,23 +49,6 @@ __FBSDID("$FreeBSD$");
#endif
#include <compat/linux/linux_timer.h>
-static int
-linux_convert_l_clockid(clockid_t *clock_id)
-{
-
- switch (*clock_id) {
- case LINUX_CLOCK_REALTIME:
- *clock_id = CLOCK_REALTIME;
- break;
- case LINUX_CLOCK_MONOTONIC:
- *clock_id = CLOCK_MONOTONIC;
- break;
- default:
- return (EINVAL);
- }
-
- return (0);
-}
static int
linux_convert_l_sigevent(struct l_sigevent *l_sig, struct sigevent *sig)
@@ -75,7 +58,7 @@ linux_convert_l_sigevent(struct l_sigevent *l_sig, struct sigevent *sig)
switch (l_sig->sigev_notify) {
case L_SIGEV_SIGNAL:
sig->sigev_notify = SIGEV_SIGNAL;
- CP(*l_sig, *sig, sigev_signo);
+ sig->sigev_signo = linux_to_bsd_signal(l_sig->sigev_signo);
PTRIN_CP(*l_sig, *sig, sigev_value.sival_ptr);
break;
case L_SIGEV_NONE:
@@ -92,7 +75,7 @@ linux_convert_l_sigevent(struct l_sigevent *l_sig, struct sigevent *sig)
case L_SIGEV_THREAD_ID:
sig->sigev_notify = SIGEV_THREAD_ID;
CP2(*l_sig, *sig, _l_sigev_un._tid, sigev_notify_thread_id);
- CP(*l_sig, *sig, sigev_signo);
+ sig->sigev_signo = linux_to_bsd_signal(l_sig->sigev_signo);
PTRIN_CP(*l_sig, *sig, sigev_value.sival_ptr);
break;
default:
@@ -106,6 +89,7 @@ linux_timer_create(struct thread *td, struct linux_timer_create_args *uap)
{
struct l_sigevent l_ev;
struct sigevent ev, *evp;
+ clockid_t nwhich;
int error, id;
if (uap->evp == NULL) {
@@ -119,10 +103,10 @@ linux_timer_create(struct thread *td, struct linux_timer_create_args *uap)
return (error);
evp = &ev;
}
- error = linux_convert_l_clockid(&uap->clock_id);
+ error = linux_to_native_clockid(&nwhich, uap->clock_id);
if (error != 0)
return (error);
- error = kern_ktimer_create(td, uap->clock_id, evp, &id, -1);
+ error = kern_ktimer_create(td, nwhich, evp, &id, -1);
if (error == 0) {
error = copyout(&id, uap->timerid, sizeof(int));
if (error != 0)
@@ -179,4 +163,3 @@ linux_timer_delete(struct thread *td, struct linux_timer_delete_args *uap)
return (kern_ktimer_delete(td, uap->timerid));
}
-
diff --git a/sys/compat/linux/linux_timer.h b/sys/compat/linux/linux_timer.h
index 4f64ee5..c79c08d 100644
--- a/sys/compat/linux/linux_timer.h
+++ b/sys/compat/linux/linux_timer.h
@@ -56,6 +56,23 @@
#define LINUX_CLOCK_SGI_CYCLE 10
#define LINUX_CLOCK_TAI 11
+#define LINUX_CPUCLOCK_PERTHREAD_MASK 4
+#define LINUX_CPUCLOCK_MASK 3
+#define LINUX_CPUCLOCK_WHICH(clock) \
+ ((clock) & (clockid_t) LINUX_CPUCLOCK_MASK)
+#define LINUX_CPUCLOCK_PROF 0
+#define LINUX_CPUCLOCK_VIRT 1
+#define LINUX_CPUCLOCK_SCHED 2
+#define LINUX_CPUCLOCK_MAX 3
+#define LINUX_CLOCKFD LINUX_CPUCLOCK_MAX
+#define LINUX_CLOCKFD_MASK \
+ (LINUX_CPUCLOCK_PERTHREAD_MASK|LINUX_CPUCLOCK_MASK)
+
+#define LINUX_CPUCLOCK_ID(clock) ((pid_t) ~((clock) >> 3))
+#define LINUX_CPUCLOCK_PERTHREAD(clock) \
+ (((clock) & (clockid_t) LINUX_CPUCLOCK_PERTHREAD_MASK) != 0)
+
+
#define L_SIGEV_SIGNAL 0
#define L_SIGEV_NONE 1
#define L_SIGEV_THREAD 2
@@ -94,4 +111,10 @@ struct l_itimerspec {
struct l_timespec it_value;
};
+void native_to_linux_timespec(struct l_timespec *,
+ struct timespec *);
+int linux_to_native_timespec(struct timespec *,
+ struct l_timespec *);
+int linux_to_native_clockid(clockid_t *, clockid_t);
+
#endif /* _LINUX_TIMER_H */
diff --git a/sys/compat/linux/linux_uid16.c b/sys/compat/linux/linux_uid16.c
index 8c7c760..8aa728c 100644
--- a/sys/compat/linux/linux_uid16.c
+++ b/sys/compat/linux/linux_uid16.c
@@ -171,12 +171,12 @@ linux_setgroups16(struct thread *td, struct linux_setgroups16_args *args)
LIN_SDT_PROBE1(uid16, linux_setgroups16, return, EINVAL);
return (EINVAL);
}
- linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_TEMP, M_WAITOK);
+ linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_LINUX, M_WAITOK);
error = copyin(args->gidset, linux_gidset, ngrp * sizeof(l_gid16_t));
if (error) {
LIN_SDT_PROBE1(uid16, linux_setgroups16, copyin_error, error);
LIN_SDT_PROBE1(uid16, linux_setgroups16, return, error);
- free(linux_gidset, M_TEMP);
+ free(linux_gidset, M_LINUX);
return (error);
}
newcred = crget();
@@ -218,7 +218,7 @@ linux_setgroups16(struct thread *td, struct linux_setgroups16_args *args)
crfree(oldcred);
error = 0;
out:
- free(linux_gidset, M_TEMP);
+ free(linux_gidset, M_LINUX);
LIN_SDT_PROBE1(uid16, linux_setgroups16, return, error);
return (error);
@@ -259,14 +259,14 @@ linux_getgroups16(struct thread *td, struct linux_getgroups16_args *args)
ngrp = 0;
linux_gidset = malloc(bsd_gidsetsz * sizeof(*linux_gidset),
- M_TEMP, M_WAITOK);
+ M_LINUX, M_WAITOK);
while (ngrp < bsd_gidsetsz) {
linux_gidset[ngrp] = bsd_gidset[ngrp + 1];
ngrp++;
}
error = copyout(linux_gidset, args->gidset, ngrp * sizeof(l_gid16_t));
- free(linux_gidset, M_TEMP);
+ free(linux_gidset, M_LINUX);
if (error) {
LIN_SDT_PROBE1(uid16, linux_getgroups16, copyout_error, error);
LIN_SDT_PROBE1(uid16, linux_getgroups16, return, error);
diff --git a/sys/compat/linux/linux_util.c b/sys/compat/linux/linux_util.c
index be52459..466c588 100644
--- a/sys/compat/linux/linux_util.c
+++ b/sys/compat/linux/linux_util.c
@@ -52,48 +52,14 @@ __FBSDID("$FreeBSD$");
#include <machine/stdarg.h>
#include <compat/linux/linux_util.h>
-#ifdef COMPAT_LINUX32
-#include <machine/../linux32/linux.h>
-#else
-#include <machine/../linux/linux.h>
-#endif
-#include <compat/linux/linux_dtrace.h>
+MALLOC_DEFINE(M_LINUX, "linux", "Linux mode structures");
+MALLOC_DEFINE(M_EPOLL, "lepoll", "Linux events structures");
+MALLOC_DEFINE(M_FUTEX, "futex", "Linux futexes");
+MALLOC_DEFINE(M_FUTEX_WP, "futex wp", "Linux futex waiting proc");
const char linux_emul_path[] = "/compat/linux";
-/* DTrace init */
-LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE);
-
-/**
- * DTrace probes in this module.
- */
-LIN_SDT_PROBE_DEFINE5(util, linux_emul_convpath, entry, "const char *",
- "enum uio_seg", "char **", "int", "int");
-LIN_SDT_PROBE_DEFINE1(util, linux_emul_convpath, return, "int");
-LIN_SDT_PROBE_DEFINE1(util, linux_msg, entry, "const char *");
-LIN_SDT_PROBE_DEFINE0(util, linux_msg, return);
-LIN_SDT_PROBE_DEFINE2(util, linux_driver_get_name_dev, entry, "device_t",
- "const char *");
-LIN_SDT_PROBE_DEFINE0(util, linux_driver_get_name_dev, nullcall);
-LIN_SDT_PROBE_DEFINE1(util, linux_driver_get_name_dev, return, "char *");
-LIN_SDT_PROBE_DEFINE3(util, linux_driver_get_major_minor, entry, "char *",
- "int *", "int *");
-LIN_SDT_PROBE_DEFINE0(util, linux_driver_get_major_minor, nullcall);
-LIN_SDT_PROBE_DEFINE1(util, linux_driver_get_major_minor, notfound, "char *");
-LIN_SDT_PROBE_DEFINE3(util, linux_driver_get_major_minor, return, "int",
- "int", "int");
-LIN_SDT_PROBE_DEFINE0(util, linux_get_char_devices, entry);
-LIN_SDT_PROBE_DEFINE1(util, linux_get_char_devices, return, "char *");
-LIN_SDT_PROBE_DEFINE1(util, linux_free_get_char_devices, entry, "char *");
-LIN_SDT_PROBE_DEFINE0(util, linux_free_get_char_devices, return);
-LIN_SDT_PROBE_DEFINE1(util, linux_device_register_handler, entry,
- "struct linux_device_handler *");
-LIN_SDT_PROBE_DEFINE1(util, linux_device_register_handler, return, "int");
-LIN_SDT_PROBE_DEFINE1(util, linux_device_unregister_handler, entry,
- "struct linux_device_handler *");
-LIN_SDT_PROBE_DEFINE1(util, linux_device_unregister_handler, return, "int");
-
/*
* Search an alternate path before passing pathname arguments on to
* system calls. Useful for keeping a separate 'emulation tree'.
@@ -107,13 +73,9 @@ linux_emul_convpath(struct thread *td, const char *path, enum uio_seg pathseg,
{
int retval;
- LIN_SDT_PROBE5(util, linux_emul_convpath, entry, path, pathseg, pbuf,
- cflag, dfd);
-
retval = kern_alternate_path(td, linux_emul_path, path, pathseg, pbuf,
cflag, dfd);
- LIN_SDT_PROBE1(util, linux_emul_convpath, return, retval);
return (retval);
}
@@ -123,16 +85,12 @@ linux_msg(const struct thread *td, const char *fmt, ...)
va_list ap;
struct proc *p;
- LIN_SDT_PROBE1(util, linux_msg, entry, fmt);
-
p = td->td_proc;
printf("linux: pid %d (%s): ", (int)p->p_pid, p->p_comm);
va_start(ap, fmt);
vprintf(fmt, ap);
va_end(ap);
printf("\n");
-
- LIN_SDT_PROBE0(util, linux_msg, return);
}
struct device_element
@@ -155,24 +113,14 @@ linux_driver_get_name_dev(device_t dev)
struct device_element *de;
const char *device_name = device_get_name(dev);
- LIN_SDT_PROBE2(util, linux_driver_get_name_dev, entry, dev,
- device_name);
-
- if (device_name == NULL) {
- LIN_SDT_PROBE0(util, linux_driver_get_name_dev, nullcall);
- LIN_SDT_PROBE1(util, linux_driver_get_name_dev, return, NULL);
+ if (device_name == NULL)
return NULL;
- }
TAILQ_FOREACH(de, &devices, list) {
- if (strcmp(device_name, de->entry.bsd_driver_name) == 0) {
- LIN_SDT_PROBE1(util, linux_driver_get_name_dev, return,
- de->entry.linux_driver_name);
+ if (strcmp(device_name, de->entry.bsd_driver_name) == 0)
return (de->entry.linux_driver_name);
- }
}
- LIN_SDT_PROBE1(util, linux_driver_get_name_dev, return, NULL);
- return NULL;
+ return (NULL);
}
int
@@ -180,15 +128,8 @@ linux_driver_get_major_minor(const char *node, int *major, int *minor)
{
struct device_element *de;
- LIN_SDT_PROBE3(util, linux_driver_get_major_minor, entry, node, major,
- minor);
-
- if (node == NULL || major == NULL || minor == NULL) {
- LIN_SDT_PROBE0(util, linux_driver_get_major_minor, nullcall);
- LIN_SDT_PROBE3(util, linux_driver_get_major_minor, return, 1,
- 0, 0);
+ if (node == NULL || major == NULL || minor == NULL)
return 1;
- }
if (strlen(node) > strlen("pts/") &&
strncmp(node, "pts/", strlen("pts/")) == 0) {
@@ -203,25 +144,18 @@ linux_driver_get_major_minor(const char *node, int *major, int *minor)
*major = 136 + (devno / 256);
*minor = devno % 256;
- LIN_SDT_PROBE3(util, linux_driver_get_major_minor, return, 0,
- *major, *minor);
- return 0;
+ return (0);
}
TAILQ_FOREACH(de, &devices, list) {
if (strcmp(node, de->entry.bsd_device_name) == 0) {
*major = de->entry.linux_major;
*minor = de->entry.linux_minor;
-
- LIN_SDT_PROBE3(util, linux_driver_get_major_minor,
- return, 0, *major, *minor);
- return 0;
+ return (0);
}
}
- LIN_SDT_PROBE1(util, linux_driver_get_major_minor, notfound, node);
- LIN_SDT_PROBE3(util, linux_driver_get_major_minor, return, 1, 0, 0);
- return 1;
+ return (1);
}
char *
@@ -232,8 +166,6 @@ linux_get_char_devices()
char formated[256];
int current_size = 0, string_size = 1024;
- LIN_SDT_PROBE0(util, linux_get_char_devices, entry);
-
string = malloc(string_size, M_LINUX, M_WAITOK);
string[0] = '\000';
last = "";
@@ -260,19 +192,14 @@ linux_get_char_devices()
}
}
- LIN_SDT_PROBE1(util, linux_get_char_devices, return, string);
- return string;
+ return (string);
}
void
linux_free_get_char_devices(char *string)
{
- LIN_SDT_PROBE1(util, linux_get_char_devices, entry, string);
-
free(string, M_LINUX);
-
- LIN_SDT_PROBE0(util, linux_get_char_devices, return);
}
static int linux_major_starting = 200;
@@ -282,13 +209,8 @@ linux_device_register_handler(struct linux_device_handler *d)
{
struct device_element *de;
- LIN_SDT_PROBE1(util, linux_device_register_handler, entry, d);
-
- if (d == NULL) {
- LIN_SDT_PROBE1(util, linux_device_register_handler, return,
- EINVAL);
+ if (d == NULL)
return (EINVAL);
- }
de = malloc(sizeof(*de), M_LINUX, M_WAITOK);
if (d->linux_major < 0) {
@@ -299,7 +221,6 @@ linux_device_register_handler(struct linux_device_handler *d)
/* Add the element to the list, sorted on span. */
TAILQ_INSERT_TAIL(&devices, de, list);
- LIN_SDT_PROBE1(util, linux_device_register_handler, return, 0);
return (0);
}
@@ -308,25 +229,17 @@ linux_device_unregister_handler(struct linux_device_handler *d)
{
struct device_element *de;
- LIN_SDT_PROBE1(util, linux_device_unregister_handler, entry, d);
-
- if (d == NULL) {
- LIN_SDT_PROBE1(util, linux_device_unregister_handler, return,
- EINVAL);
+ if (d == NULL)
return (EINVAL);
- }
TAILQ_FOREACH(de, &devices, list) {
if (bcmp(d, &de->entry, sizeof(*d)) == 0) {
TAILQ_REMOVE(&devices, de, list);
free(de, M_LINUX);
- LIN_SDT_PROBE1(util, linux_device_unregister_handler,
- return, 0);
return (0);
}
}
- LIN_SDT_PROBE1(util, linux_device_unregister_handler, return, EINVAL);
return (EINVAL);
}
diff --git a/sys/compat/linux/linux_util.h b/sys/compat/linux/linux_util.h
index 6be0392..a52a7b9 100644
--- a/sys/compat/linux/linux_util.h
+++ b/sys/compat/linux/linux_util.h
@@ -44,6 +44,11 @@
#include <sys/cdefs.h>
#include <sys/uio.h>
+MALLOC_DECLARE(M_LINUX);
+MALLOC_DECLARE(M_EPOLL);
+MALLOC_DECLARE(M_FUTEX);
+MALLOC_DECLARE(M_FUTEX_WP);
+
extern const char linux_emul_path[];
int linux_emul_convpath(struct thread *, const char *, enum uio_seg, char **, int, int);
@@ -115,7 +120,6 @@ void linux_free_get_char_devices(char *string);
#define LINUX_CTRFMT(nm, fmt) #nm"("fmt")"
#define LINUX_CTR6(f, m, p1, p2, p3, p4, p5, p6) do { \
- if (ldebug(f)) \
CTR6(KTR_LINUX, LINUX_CTRFMT(f, m), \
p1, p2, p3, p4, p5, p6); \
} while (0)
diff --git a/sys/compat/linux/linux_vdso.c b/sys/compat/linux/linux_vdso.c
new file mode 100644
index 0000000..5ab0ee6
--- /dev/null
+++ b/sys/compat/linux/linux_vdso.c
@@ -0,0 +1,244 @@
+/*-
+ * Copyright (c) 2013 Dmitry Chagin
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "opt_compat.h"
+
+#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
+#define __ELF_WORD_SIZE 32
+#else
+#define __ELF_WORD_SIZE 64
+#endif
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/elf.h>
+#include <sys/kernel.h>
+#include <sys/lock.h>
+#include <sys/rwlock.h>
+#include <sys/queue.h>
+#include <sys/sysent.h>
+
+#include <vm/vm.h>
+#include <vm/vm_param.h>
+#include <vm/pmap.h>
+#include <vm/vm_extern.h>
+#include <vm/vm_kern.h>
+#include <vm/vm_map.h>
+#include <vm/vm_object.h>
+#include <vm/vm_page.h>
+#include <vm/vm_pager.h>
+
+#include <compat/linux/linux_vdso.h>
+
+SLIST_HEAD(, linux_vdso_sym) __elfN(linux_vdso_syms) =
+ SLIST_HEAD_INITIALIZER(__elfN(linux_vdso_syms));
+
+static int __elfN(symtabindex);
+static int __elfN(symstrindex);
+
+static void
+__elfN(linux_vdso_lookup)(Elf_Ehdr *, struct linux_vdso_sym *);
+
+
+void
+__elfN(linux_vdso_sym_init)(struct linux_vdso_sym *s)
+{
+
+ SLIST_INSERT_HEAD(&__elfN(linux_vdso_syms), s, sym);
+}
+
+vm_object_t
+__elfN(linux_shared_page_init)(char **mapping)
+{
+ vm_page_t m;
+ vm_object_t obj;
+ vm_offset_t addr;
+
+ obj = vm_pager_allocate(OBJT_PHYS, 0, PAGE_SIZE,
+ VM_PROT_DEFAULT, 0, NULL);
+ VM_OBJECT_WLOCK(obj);
+ m = vm_page_grab(obj, 0, VM_ALLOC_NOBUSY | VM_ALLOC_ZERO);
+ m->valid = VM_PAGE_BITS_ALL;
+ VM_OBJECT_WUNLOCK(obj);
+ addr = kva_alloc(PAGE_SIZE);
+ pmap_qenter(addr, &m, 1);
+ *mapping = (char *)addr;
+ return (obj);
+}
+
+void
+__elfN(linux_shared_page_fini)(vm_object_t obj)
+{
+
+ vm_object_deallocate(obj);
+}
+
+void
+__elfN(linux_vdso_fixup)(struct sysentvec *sv)
+{
+ Elf_Ehdr *ehdr;
+ Elf_Shdr *shdr;
+ int i;
+
+ ehdr = (Elf_Ehdr *) sv->sv_sigcode;
+
+ if (!IS_ELF(*ehdr) ||
+ ehdr->e_ident[EI_CLASS] != ELF_TARG_CLASS ||
+ ehdr->e_ident[EI_DATA] != ELF_TARG_DATA ||
+ ehdr->e_ident[EI_VERSION] != EV_CURRENT ||
+ ehdr->e_shoff == 0 ||
+ ehdr->e_shentsize != sizeof(Elf_Shdr))
+ panic("Linux invalid vdso header.\n");
+
+ if (ehdr->e_type != ET_DYN)
+ panic("Linux invalid vdso header.\n");
+
+ shdr = (Elf_Shdr *) ((caddr_t)ehdr + ehdr->e_shoff);
+
+ __elfN(symtabindex) = -1;
+ __elfN(symstrindex) = -1;
+ for (i = 0; i < ehdr->e_shnum; i++) {
+ if (shdr[i].sh_size == 0)
+ continue;
+ if (shdr[i].sh_type == SHT_DYNSYM) {
+ __elfN(symtabindex) = i;
+ __elfN(symstrindex) = shdr[i].sh_link;
+ }
+ }
+
+ if (__elfN(symtabindex) == -1 || __elfN(symstrindex) == -1)
+ panic("Linux invalid vdso header.\n");
+
+ ehdr->e_ident[EI_OSABI] = ELFOSABI_LINUX;
+}
+
+void
+__elfN(linux_vdso_reloc)(struct sysentvec *sv, long vdso_adjust)
+{
+ struct linux_vdso_sym *lsym;
+ Elf_Ehdr *ehdr;
+ Elf_Phdr *phdr;
+ Elf_Shdr *shdr;
+ Elf_Dyn *dyn;
+ Elf_Sym *sym;
+ int i, symcnt;
+
+ ehdr = (Elf_Ehdr *) sv->sv_sigcode;
+
+ /* Adjust our so relative to the sigcode_base */
+ if (vdso_adjust != 0) {
+ ehdr->e_entry += vdso_adjust;
+ phdr = (Elf_Phdr *)((caddr_t)ehdr + ehdr->e_phoff);
+
+ /* phdrs */
+ for (i = 0; i < ehdr->e_phnum; i++) {
+ phdr[i].p_vaddr += vdso_adjust;
+ if (phdr[i].p_type != PT_DYNAMIC)
+ continue;
+ dyn = (Elf_Dyn *)((caddr_t)ehdr + phdr[i].p_offset);
+ for(; dyn->d_tag != DT_NULL; dyn++) {
+ switch (dyn->d_tag) {
+ case DT_PLTGOT:
+ case DT_HASH:
+ case DT_STRTAB:
+ case DT_SYMTAB:
+ case DT_RELA:
+ case DT_INIT:
+ case DT_FINI:
+ case DT_REL:
+ case DT_DEBUG:
+ case DT_JMPREL:
+ case DT_VERSYM:
+ case DT_VERDEF:
+ case DT_VERNEED:
+ case DT_ADDRRNGLO ... DT_ADDRRNGHI:
+ dyn->d_un.d_ptr += vdso_adjust;
+ break;
+ case DT_ENCODING ... DT_LOOS-1:
+ case DT_LOOS ... DT_HIOS:
+ if (dyn->d_tag >= DT_ENCODING &&
+ (dyn->d_tag & 1) == 0)
+ dyn->d_un.d_ptr += vdso_adjust;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ /* sections */
+ shdr = (Elf_Shdr *)((caddr_t)ehdr + ehdr->e_shoff);
+ for(i = 0; i < ehdr->e_shnum; i++) {
+ if (!(shdr[i].sh_flags & SHF_ALLOC))
+ continue;
+ shdr[i].sh_addr += vdso_adjust;
+ if (shdr[i].sh_type != SHT_SYMTAB &&
+ shdr[i].sh_type != SHT_DYNSYM)
+ continue;
+
+ sym = (Elf_Sym *)((caddr_t)ehdr + shdr[i].sh_offset);
+ symcnt = shdr[i].sh_size / sizeof(*sym);
+
+ for(i = 0; i < symcnt; i++, sym++) {
+ if (sym->st_shndx == SHN_UNDEF ||
+ sym->st_shndx == SHN_ABS)
+ continue;
+ sym->st_value += vdso_adjust;
+ }
+ }
+ }
+
+ SLIST_FOREACH(lsym, &__elfN(linux_vdso_syms), sym)
+ __elfN(linux_vdso_lookup)(ehdr, lsym);
+}
+
+static void
+__elfN(linux_vdso_lookup)(Elf_Ehdr *ehdr, struct linux_vdso_sym *vsym)
+{
+ vm_offset_t strtab, symname;
+ uint32_t symcnt;
+ Elf_Shdr *shdr;
+ int i;
+
+ shdr = (Elf_Shdr *) ((caddr_t)ehdr + ehdr->e_shoff);
+
+ strtab = (vm_offset_t)((caddr_t)ehdr +
+ shdr[__elfN(symstrindex)].sh_offset);
+ Elf_Sym *sym = (Elf_Sym *)((caddr_t)ehdr +
+ shdr[__elfN(symtabindex)].sh_offset);
+ symcnt = shdr[__elfN(symtabindex)].sh_size / sizeof(*sym);
+
+ for (i = 0; i < symcnt; ++i, ++sym) {
+ symname = strtab + sym->st_name;
+ if (strncmp(vsym->symname, (char *)symname, vsym->size) == 0) {
+ *vsym->ptr = (uintptr_t)sym->st_value;
+ break;
+ }
+ }
+}
diff --git a/sys/compat/linux/linux_vdso.h b/sys/compat/linux/linux_vdso.h
new file mode 100644
index 0000000..e11ee8a
--- /dev/null
+++ b/sys/compat/linux/linux_vdso.h
@@ -0,0 +1,65 @@
+/*-
+ * Copyright (c) 2013 Dmitry Chagin
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _LINUX_VDSO_H_
+#define _LINUX_VDSO_H_
+
+#include <sys/types.h>
+
+struct linux_vdso_sym {
+ SLIST_ENTRY(linux_vdso_sym) sym;
+ uint32_t size;
+ uintptr_t * ptr;
+ char symname[];
+};
+
+vm_object_t __elfN(linux_shared_page_init)(char **);
+void __elfN(linux_shared_page_fini)(vm_object_t);
+void __elfN(linux_vdso_fixup)(struct sysentvec *);
+void __elfN(linux_vdso_reloc)(struct sysentvec *, long);
+void __elfN(linux_vdso_sym_init)(struct linux_vdso_sym *);
+
+#define LINUX_VDSO_SYM_INTPTR(name) \
+uintptr_t name; \
+LINUX_VDSO_SYM_DEFINE(name)
+
+#define LINUX_VDSO_SYM_CHAR(name) \
+const char * name; \
+LINUX_VDSO_SYM_DEFINE(name)
+
+#define LINUX_VDSO_SYM_DEFINE(name) \
+static struct linux_vdso_sym name ## sym = { \
+ .symname = #name, \
+ .size = sizeof(#name), \
+ .ptr = (uintptr_t *)&name \
+}; \
+SYSINIT(__elfN(name ## _sym_init), SI_SUB_EXEC, \
+ SI_ORDER_FIRST, __elfN(linux_vdso_sym_init), &name ## sym); \
+struct __hack
+
+#endif /* _LINUX_VDSO_H_ */
diff --git a/sys/compat/linux/stats_timing.d b/sys/compat/linux/stats_timing.d
index d0b6f73..1b60dc9 100644
--- a/sys/compat/linux/stats_timing.d
+++ b/sys/compat/linux/stats_timing.d
@@ -39,7 +39,6 @@
* possible for a given application
* - graph of longest running (CPU-time!) function in total
* - may help finding problem cases in the kernel code
- * - timing statistics for the emul_lock
* - graph of longest held (CPU-time!) locks
*/
diff --git a/sys/compat/svr4/imgact_svr4.c b/sys/compat/svr4/imgact_svr4.c
index f3bb09e..e61b49b 100644
--- a/sys/compat/svr4/imgact_svr4.c
+++ b/sys/compat/svr4/imgact_svr4.c
@@ -109,7 +109,7 @@ exec_svr4_imgact(imgp)
*/
PROC_LOCK(imgp->proc);
if (a_out->a_text > maxtsiz ||
- a_out->a_data + bss_size > lim_cur(imgp->proc, RLIMIT_DATA) ||
+ a_out->a_data + bss_size > lim_cur_proc(imgp->proc, RLIMIT_DATA) ||
racct_set(imgp->proc, RACCT_DATA, a_out->a_data + bss_size) != 0) {
PROC_UNLOCK(imgp->proc);
return (ENOMEM);
diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c
index c0da170..1b4a35e 100644
--- a/sys/compat/svr4/svr4_misc.c
+++ b/sys/compat/svr4/svr4_misc.c
@@ -910,9 +910,7 @@ svr4_sys_ulimit(td, uap)
switch (uap->cmd) {
case SVR4_GFILLIM:
- PROC_LOCK(td->td_proc);
- *retval = lim_cur(td->td_proc, RLIMIT_FSIZE) / 512;
- PROC_UNLOCK(td->td_proc);
+ *retval = lim_cur(td, RLIMIT_FSIZE) / 512;
if (*retval == -1)
*retval = 0x7fffffff;
return 0;
@@ -922,17 +920,13 @@ svr4_sys_ulimit(td, uap)
struct rlimit krl;
krl.rlim_cur = uap->newlimit * 512;
- PROC_LOCK(td->td_proc);
- krl.rlim_max = lim_max(td->td_proc, RLIMIT_FSIZE);
- PROC_UNLOCK(td->td_proc);
+ krl.rlim_max = lim_max(td, RLIMIT_FSIZE);
error = kern_setrlimit(td, RLIMIT_FSIZE, &krl);
if (error)
return error;
- PROC_LOCK(td->td_proc);
- *retval = lim_cur(td->td_proc, RLIMIT_FSIZE);
- PROC_UNLOCK(td->td_proc);
+ *retval = lim_cur(td, RLIMIT_FSIZE);
if (*retval == -1)
*retval = 0x7fffffff;
return 0;
@@ -943,9 +937,7 @@ svr4_sys_ulimit(td, uap)
struct vmspace *vm = td->td_proc->p_vmspace;
register_t r;
- PROC_LOCK(td->td_proc);
- r = lim_cur(td->td_proc, RLIMIT_DATA);
- PROC_UNLOCK(td->td_proc);
+ r = lim_cur(td, RLIMIT_DATA);
if (r == -1)
r = 0x7fffffff;
@@ -957,9 +949,7 @@ svr4_sys_ulimit(td, uap)
}
case SVR4_GDESLIM:
- PROC_LOCK(td->td_proc);
- *retval = lim_cur(td->td_proc, RLIMIT_NOFILE);
- PROC_UNLOCK(td->td_proc);
+ *retval = lim_cur(td, RLIMIT_NOFILE);
if (*retval == -1)
*retval = 0x7fffffff;
return 0;
diff --git a/sys/compat/svr4/svr4_resource.c b/sys/compat/svr4/svr4_resource.c
index efa0bcf..667ee88 100644
--- a/sys/compat/svr4/svr4_resource.c
+++ b/sys/compat/svr4/svr4_resource.c
@@ -130,9 +130,7 @@ svr4_sys_getrlimit(td, uap)
if (rl == -1)
return EINVAL;
- PROC_LOCK(td->td_proc);
- lim_rlimit(td->td_proc, rl, &blim);
- PROC_UNLOCK(td->td_proc);
+ lim_rlimit(td, rl, &blim);
/*
* Our infinity, is their maxfiles.
@@ -181,9 +179,7 @@ svr4_sys_setrlimit(td, uap)
if ((error = copyin(uap->rlp, &slim, sizeof(slim))) != 0)
return error;
- PROC_LOCK(td->td_proc);
- lim_rlimit(td->td_proc, rl, &curlim);
- PROC_UNLOCK(td->td_proc);
+ lim_rlimit(td, rl, &curlim);
/*
* if the limit is SVR4_RLIM_INFINITY, then we set it to our
@@ -228,9 +224,7 @@ svr4_sys_getrlimit64(td, uap)
if (rl == -1)
return EINVAL;
- PROC_LOCK(td->td_proc);
- lim_rlimit(td->td_proc, rl, &blim);
- PROC_UNLOCK(td->td_proc);
+ lim_rlimit(td, rl, &blim);
/*
* Our infinity, is their maxfiles.
@@ -279,9 +273,7 @@ svr4_sys_setrlimit64(td, uap)
if ((error = copyin(uap->rlp, &slim, sizeof(slim))) != 0)
return error;
- PROC_LOCK(td->td_proc);
- lim_rlimit(td->td_proc, rl, &curlim);
- PROC_UNLOCK(td->td_proc);
+ lim_rlimit(td, rl, &curlim);
/*
* if the limit is SVR4_RLIM64_INFINITY, then we set it to our
diff --git a/sys/compat/svr4/svr4_sysvec.c b/sys/compat/svr4/svr4_sysvec.c
index 561a838..125a7d8 100644
--- a/sys/compat/svr4/svr4_sysvec.c
+++ b/sys/compat/svr4/svr4_sysvec.c
@@ -196,6 +196,7 @@ struct sysentvec svr4_sysvec = {
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
.sv_syscallnames = NULL,
.sv_schedtail = NULL,
+ .sv_thread_detach = NULL,
};
const char svr4_emul_path[] = "/compat/svr4";
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
index 8f00f59..90fc66e 100644
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -156,6 +156,7 @@ options GEOM_GATE # Userland services.
options GEOM_JOURNAL # Journaling.
options GEOM_LABEL # Providers labelization.
options GEOM_LINUX_LVM # Linux LVM2 volumes
+options GEOM_MAP # Map based partitioning
options GEOM_MBR # DOS/MBR partitioning
options GEOM_MIRROR # Disk mirroring.
options GEOM_MULTIPATH # Disk multipath
@@ -176,6 +177,7 @@ options GEOM_RAID3 # RAID3 functionality.
options GEOM_SHSEC # Shared secret.
options GEOM_STRIPE # Disk striping.
options GEOM_SUNLABEL # Sun/Solaris partitioning
+options GEOM_UNCOMPRESS # Read-only compressed disks (lzma, zip)
options GEOM_UZIP # Read-only compressed disks
options GEOM_VINUM # Vinum logical volume manager
options GEOM_VIRSTOR # Virtual storage.
@@ -2980,6 +2982,9 @@ options RANDOM_DEBUG # Debugging messages
# Module to enable execution of application via emulators like QEMU
options IMAGACT_BINMISC
+# Intel em(4) driver
+options EM_MULTIQUEUE # Activate multiqueue features/disable MSI-X
+
# zlib I/O stream support
# This enables support for compressed core dumps.
options GZIO
diff --git a/sys/conf/files b/sys/conf/files
index 8d51fe5..0217e46 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -104,11 +104,12 @@ cam/scsi/scsi_targ_bh.c optional targbh
cam/scsi/scsi_target.c optional targ
cam/scsi/smp_all.c optional scbus
# shared between zfs and dtrace
-cddl/compat/opensolaris/kern/opensolaris.c optional zfs compile-with "${ZFS_C}"
-cddl/compat/opensolaris/kern/opensolaris_cmn_err.c optional zfs compile-with "${ZFS_C}"
-cddl/compat/opensolaris/kern/opensolaris_kmem.c optional zfs compile-with "${ZFS_C}"
-cddl/compat/opensolaris/kern/opensolaris_misc.c optional zfs compile-with "${ZFS_C}"
-cddl/compat/opensolaris/kern/opensolaris_sunddi.c optional zfs compile-with "${ZFS_C}"
+cddl/compat/opensolaris/kern/opensolaris.c optional zfs | dtrace compile-with "${CDDL_C}"
+cddl/compat/opensolaris/kern/opensolaris_cmn_err.c optional zfs | dtrace compile-with "${CDDL_C}"
+cddl/compat/opensolaris/kern/opensolaris_kmem.c optional zfs | dtrace compile-with "${CDDL_C}"
+cddl/compat/opensolaris/kern/opensolaris_misc.c optional zfs | dtrace compile-with "${CDDL_C}"
+cddl/compat/opensolaris/kern/opensolaris_sunddi.c optional zfs | dtrace compile-with "${CDDL_C}"
+cddl/compat/opensolaris/kern/opensolaris_taskq.c optional zfs | dtrace compile-with "${CDDL_C}"
# zfs specific
cddl/compat/opensolaris/kern/opensolaris_acl.c optional zfs compile-with "${ZFS_C}"
cddl/compat/opensolaris/kern/opensolaris_dtrace.c optional zfs compile-with "${ZFS_C}"
@@ -118,7 +119,6 @@ cddl/compat/opensolaris/kern/opensolaris_lookup.c optional zfs compile-with "$
cddl/compat/opensolaris/kern/opensolaris_policy.c optional zfs compile-with "${ZFS_C}"
cddl/compat/opensolaris/kern/opensolaris_string.c optional zfs compile-with "${ZFS_C}"
cddl/compat/opensolaris/kern/opensolaris_sysevent.c optional zfs compile-with "${ZFS_C}"
-cddl/compat/opensolaris/kern/opensolaris_taskq.c optional zfs compile-with "${ZFS_C}"
cddl/compat/opensolaris/kern/opensolaris_uio.c optional zfs compile-with "${ZFS_C}"
cddl/compat/opensolaris/kern/opensolaris_vfs.c optional zfs compile-with "${ZFS_C}"
cddl/compat/opensolaris/kern/opensolaris_vm.c optional zfs compile-with "${ZFS_C}"
@@ -242,6 +242,17 @@ cddl/contrib/opensolaris/uts/common/zmod/trees.c optional zfs compile-with "${
cddl/contrib/opensolaris/uts/common/zmod/zmod.c optional zfs compile-with "${ZFS_C}"
cddl/contrib/opensolaris/uts/common/zmod/zmod_subr.c optional zfs compile-with "${ZFS_C}"
cddl/contrib/opensolaris/uts/common/zmod/zutil.c optional zfs compile-with "${ZFS_C}"
+# dtrace specific
+cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c optional dtrace compile-with "${DTRACE_C}" \
+ warning "kernel contains CDDL licensed DTRACE"
+cddl/dev/dtmalloc/dtmalloc.c optional dtmalloc | dtraceall compile-with "${CDDL_C}"
+cddl/dev/lockstat/lockstat.c optional dtrace_lockstat | dtraceall compile-with "${CDDL_C}"
+cddl/dev/profile/profile.c optional dtrace_profile | dtraceall compile-with "${CDDL_C}"
+cddl/dev/sdt/sdt.c optional dtrace_sdt | dtraceall compile-with "${CDDL_C}"
+cddl/dev/fbt/fbt.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}"
+cddl/dev/systrace/systrace.c optional dtrace_systrace | dtraceall compile-with "${CDDL_C}"
+cddl/dev/prototype.c optional dtrace_prototype | dtraceall compile-with "${CDDL_C}"
+fs/nfsclient/nfs_clkdtrace.c optional dtnfscl nfscl | dtraceall nfscl compile-with "${CDDL_C}"
compat/freebsd32/freebsd32_capability.c optional compat_freebsd32
compat/freebsd32/freebsd32_ioctl.c optional compat_freebsd32
compat/freebsd32/freebsd32_misc.c optional compat_freebsd32
@@ -1427,6 +1438,8 @@ dev/hptiop/hptiop.c optional hptiop scbus
dev/hwpmc/hwpmc_logging.c optional hwpmc
dev/hwpmc/hwpmc_mod.c optional hwpmc
dev/hwpmc/hwpmc_soft.c optional hwpmc
+dev/ichiic/ig4_iic.c optional ichiic
+dev/ichiic/ig4_pci.c optional ichiic pci
dev/ichsmb/ichsmb.c optional ichsmb
dev/ichsmb/ichsmb_pci.c optional ichsmb pci
dev/ida/ida.c optional ida
@@ -2024,6 +2037,7 @@ dev/pci/isa_pci.c optional pci isa
dev/pci/pci.c optional pci
dev/pci/pci_if.m standard
dev/pci/pci_iov.c optional pci pci_iov
+dev/pci/pci_iov_if.m standard
dev/pci/pci_iov_schema.c optional pci pci_iov
dev/pci/pci_pci.c optional pci
dev/pci/pci_subr.c optional pci
@@ -2156,37 +2170,6 @@ dev/sdhci/sdhci.c optional sdhci
dev/sdhci/sdhci_if.m optional sdhci
dev/sdhci/sdhci_pci.c optional sdhci pci
dev/sf/if_sf.c optional sf pci
-dev/sfxge/common/efx_bootcfg.c optional sfxge pci
-dev/sfxge/common/efx_ev.c optional sfxge pci
-dev/sfxge/common/efx_filter.c optional sfxge pci
-dev/sfxge/common/efx_intr.c optional sfxge pci
-dev/sfxge/common/efx_mac.c optional sfxge pci
-dev/sfxge/common/efx_mcdi.c optional sfxge pci
-dev/sfxge/common/efx_mon.c optional sfxge pci
-dev/sfxge/common/efx_nic.c optional sfxge pci
-dev/sfxge/common/efx_nvram.c optional sfxge pci
-dev/sfxge/common/efx_phy.c optional sfxge pci
-dev/sfxge/common/efx_port.c optional sfxge pci
-dev/sfxge/common/efx_rx.c optional sfxge pci
-dev/sfxge/common/efx_sram.c optional sfxge pci
-dev/sfxge/common/efx_tx.c optional sfxge pci
-dev/sfxge/common/efx_vpd.c optional sfxge pci
-dev/sfxge/common/efx_wol.c optional sfxge pci
-dev/sfxge/common/siena_mac.c optional sfxge pci
-dev/sfxge/common/siena_mon.c optional sfxge pci
-dev/sfxge/common/siena_nic.c optional sfxge pci
-dev/sfxge/common/siena_nvram.c optional sfxge pci
-dev/sfxge/common/siena_phy.c optional sfxge pci
-dev/sfxge/common/siena_sram.c optional sfxge pci
-dev/sfxge/common/siena_vpd.c optional sfxge pci
-dev/sfxge/sfxge.c optional sfxge pci
-dev/sfxge/sfxge_dma.c optional sfxge pci
-dev/sfxge/sfxge_ev.c optional sfxge pci
-dev/sfxge/sfxge_intr.c optional sfxge pci
-dev/sfxge/sfxge_mcdi.c optional sfxge pci
-dev/sfxge/sfxge_port.c optional sfxge pci
-dev/sfxge/sfxge_rx.c optional sfxge pci
-dev/sfxge/sfxge_tx.c optional sfxge pci
dev/sge/if_sge.c optional sge pci
dev/si/si.c optional si
dev/si/si2_z280.c optional si
@@ -2589,6 +2572,7 @@ dev/usb/template/usb_template_msc.c optional usb_template
dev/usb/template/usb_template_mtp.c optional usb_template
dev/usb/template/usb_template_phone.c optional usb_template
dev/usb/template/usb_template_serialnet.c optional usb_template
+dev/usb/template/usb_template_midi.c optional usb_template
#
# USB video drivers
#
diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64
index 8aadcf5..08fb59b 100644
--- a/sys/conf/files.amd64
+++ b/sys/conf/files.amd64
@@ -20,6 +20,18 @@ linux32_assym.h optional compat_linux32 \
no-obj no-implicit-rule before-depend \
clean "linux32_assym.h"
#
+linux32_locore.o optional compat_linux32 \
+ dependency "linux32_assym.h $S/amd64/linux32/linux32_locore.s" \
+ compile-with "${CC} -x assembler-with-cpp -DLOCORE -m32 -shared -s -pipe -I. -I$S -Werror -Wall -fno-common -nostdinc -nostdlib -Wl,-T$S/amd64/linux32/linux32_vdso.lds.s -Wl,-soname=linux32_vdso.so,--eh-frame-hdr,-fPIC,-warn-common ${.IMPSRC} -o ${.TARGET}" \
+ no-obj no-implicit-rule \
+ clean "linux32_locore.o"
+#
+linux32_vdso.so optional compat_linux32 \
+ dependency "linux32_locore.o" \
+ compile-with "${OBJCOPY} --input-target binary --output-target elf64-x86-64-freebsd --binary-architecture i386 linux32_locore.o ${.TARGET}" \
+ no-implicit-rule \
+ clean "linux32_vdso.so"
+#
ia32_genassym.o standard \
dependency "$S/compat/ia32/ia32_genassym.c" \
compile-with "${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}" \
@@ -126,7 +138,12 @@ amd64/amd64/uio_machdep.c standard
amd64/amd64/uma_machdep.c standard
amd64/amd64/vm_machdep.c standard
amd64/pci/pci_cfgreg.c optional pci
-cddl/contrib/opensolaris/common/atomic/amd64/opensolaris_atomic.S optional zfs compile-with "${ZFS_S}"
+cddl/contrib/opensolaris/common/atomic/amd64/opensolaris_atomic.S optional zfs | dtrace compile-with "${ZFS_S}"
+cddl/dev/dtrace/amd64/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}"
+cddl/dev/dtrace/amd64/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}"
+cddl/dev/fbt/x86/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}"
+cddl/dev/dtrace/x86/dis_tables.c optional dtrace_fbt | dtraceall compile-with "${DTRACE_C}"
+cddl/dev/dtrace/amd64/instr_size.c optional dtrace_fbt | dtraceall compile-with "${DTRACE_C}"
crypto/aesni/aeskeys_amd64.S optional aesni
crypto/aesni/aesni.c optional aesni
aesni_ghash.o optional aesni \
@@ -292,37 +309,52 @@ dev/qlxgbe/ql_isr.c optional qlxgbe pci
dev/qlxgbe/ql_misc.c optional qlxgbe pci
dev/qlxgbe/ql_os.c optional qlxgbe pci
dev/qlxgbe/ql_reset.c optional qlxgbe pci
-dev/sfxge/common/efx_bootcfg.c optional sfxge inet pci
-dev/sfxge/common/efx_ev.c optional sfxge inet pci
-dev/sfxge/common/efx_filter.c optional sfxge inet pci
-dev/sfxge/common/efx_intr.c optional sfxge inet pci
-dev/sfxge/common/efx_mac.c optional sfxge inet pci
-dev/sfxge/common/efx_mcdi.c optional sfxge inet pci
-dev/sfxge/common/efx_mon.c optional sfxge inet pci
-dev/sfxge/common/efx_nic.c optional sfxge inet pci
-dev/sfxge/common/efx_nvram.c optional sfxge inet pci
-dev/sfxge/common/efx_phy.c optional sfxge inet pci
-dev/sfxge/common/efx_port.c optional sfxge inet pci
-dev/sfxge/common/efx_rx.c optional sfxge inet pci
-dev/sfxge/common/efx_sram.c optional sfxge inet pci
-dev/sfxge/common/efx_tx.c optional sfxge inet pci
-dev/sfxge/common/efx_vpd.c optional sfxge inet pci
-dev/sfxge/common/efx_wol.c optional sfxge inet pci
-dev/sfxge/common/siena_mac.c optional sfxge inet pci
-dev/sfxge/common/siena_mon.c optional sfxge inet pci
-dev/sfxge/common/siena_nic.c optional sfxge inet pci
-dev/sfxge/common/siena_nvram.c optional sfxge inet pci
-dev/sfxge/common/siena_phy.c optional sfxge inet pci
-dev/sfxge/common/siena_sram.c optional sfxge inet pci
-dev/sfxge/common/siena_vpd.c optional sfxge inet pci
-dev/sfxge/sfxge.c optional sfxge inet pci
-dev/sfxge/sfxge_dma.c optional sfxge inet pci
-dev/sfxge/sfxge_ev.c optional sfxge inet pci
-dev/sfxge/sfxge_intr.c optional sfxge inet pci
-dev/sfxge/sfxge_mcdi.c optional sfxge inet pci
-dev/sfxge/sfxge_port.c optional sfxge inet pci
-dev/sfxge/sfxge_rx.c optional sfxge inet pci
-dev/sfxge/sfxge_tx.c optional sfxge inet pci
+dev/sfxge/common/efx_bootcfg.c optional sfxge pci
+dev/sfxge/common/efx_crc32.c optional sfxge pci
+dev/sfxge/common/efx_ev.c optional sfxge pci
+dev/sfxge/common/efx_filter.c optional sfxge pci
+dev/sfxge/common/efx_hash.c optional sfxge pci
+dev/sfxge/common/efx_intr.c optional sfxge pci
+dev/sfxge/common/efx_mac.c optional sfxge pci
+dev/sfxge/common/efx_mcdi.c optional sfxge pci
+dev/sfxge/common/efx_mon.c optional sfxge pci
+dev/sfxge/common/efx_nic.c optional sfxge pci
+dev/sfxge/common/efx_nvram.c optional sfxge pci
+dev/sfxge/common/efx_phy.c optional sfxge pci
+dev/sfxge/common/efx_port.c optional sfxge pci
+dev/sfxge/common/efx_rx.c optional sfxge pci
+dev/sfxge/common/efx_sram.c optional sfxge pci
+dev/sfxge/common/efx_tx.c optional sfxge pci
+dev/sfxge/common/efx_vpd.c optional sfxge pci
+dev/sfxge/common/efx_wol.c optional sfxge pci
+dev/sfxge/common/hunt_ev.c optional sfxge pci
+dev/sfxge/common/hunt_filter.c optional sfxge pci
+dev/sfxge/common/hunt_intr.c optional sfxge pci
+dev/sfxge/common/hunt_mac.c optional sfxge pci
+dev/sfxge/common/hunt_mcdi.c optional sfxge pci
+dev/sfxge/common/hunt_nic.c optional sfxge pci
+dev/sfxge/common/hunt_nvram.c optional sfxge pci
+dev/sfxge/common/hunt_phy.c optional sfxge pci
+dev/sfxge/common/hunt_rx.c optional sfxge pci
+dev/sfxge/common/hunt_sram.c optional sfxge pci
+dev/sfxge/common/hunt_tx.c optional sfxge pci
+dev/sfxge/common/hunt_vpd.c optional sfxge pci
+dev/sfxge/common/siena_mac.c optional sfxge pci
+dev/sfxge/common/siena_mcdi.c optional sfxge pci
+dev/sfxge/common/siena_nic.c optional sfxge pci
+dev/sfxge/common/siena_nvram.c optional sfxge pci
+dev/sfxge/common/siena_phy.c optional sfxge pci
+dev/sfxge/common/siena_sram.c optional sfxge pci
+dev/sfxge/common/siena_vpd.c optional sfxge pci
+dev/sfxge/sfxge.c optional sfxge pci
+dev/sfxge/sfxge_dma.c optional sfxge pci
+dev/sfxge/sfxge_ev.c optional sfxge pci
+dev/sfxge/sfxge_intr.c optional sfxge pci
+dev/sfxge/sfxge_mcdi.c optional sfxge pci
+dev/sfxge/sfxge_nvram.c optional sfxge pci
+dev/sfxge/sfxge_port.c optional sfxge pci
+dev/sfxge/sfxge_rx.c optional sfxge pci
+dev/sfxge/sfxge_tx.c optional sfxge pci
dev/sio/sio.c optional sio
dev/sio/sio_isa.c optional sio isa
dev/sio/sio_pccard.c optional sio pccard
@@ -473,8 +505,6 @@ compat/linsysfs/linsysfs.c optional linsysfs
# Linux/i386 binary support
#
amd64/linux32/linux32_dummy.c optional compat_linux32
-amd64/linux32/linux32_locore.s optional compat_linux32 \
- dependency "linux32_assym.h"
amd64/linux32/linux32_machdep.c optional compat_linux32
amd64/linux32/linux32_support.s optional compat_linux32 \
dependency "linux32_assym.h"
@@ -497,6 +527,10 @@ compat/linux/linux_time.c optional compat_linux32
compat/linux/linux_timer.c optional compat_linux32
compat/linux/linux_uid16.c optional compat_linux32
compat/linux/linux_util.c optional compat_linux32
+compat/linux/linux_vdso.c optional compat_linux32
+compat/linux/linux_common.c optional compat_linux32
+compat/linux/linux_event.c optional compat_linux32
+compat/linux/linux.c optional compat_linux32
dev/amr/amr_linux.c optional compat_linux32 amr
dev/mfi/mfi_linux.c optional compat_linux32 mfi
#
diff --git a/sys/conf/files.arm b/sys/conf/files.arm
index a406d33..f49f4551 100644
--- a/sys/conf/files.arm
+++ b/sys/conf/files.arm
@@ -78,7 +78,10 @@ board_id.h standard \
compile-with "${AWK} -f $S/arm/conf/genboardid.awk $S/arm/conf/mach-types > board_id.h" \
no-obj no-implicit-rule before-depend \
clean "board_id.h"
-cddl/compat/opensolaris/kern/opensolaris_atomic.c optional zfs compile-with "${ZFS_C}"
+cddl/compat/opensolaris/kern/opensolaris_atomic.c optional zfs | dtrace compile-with "${CDDL_C}"
+cddl/dev/dtrace/arm/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}"
+cddl/dev/dtrace/arm/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}"
+cddl/dev/fbt/arm/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}"
crypto/blowfish/bf_enc.c optional crypto | ipsec
crypto/des/des_enc.c optional crypto | ipsec | netsmb
dev/fb/fb.c optional sc
diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64
index 8bdc93a..a32d8d6 100644
--- a/sys/conf/files.arm64
+++ b/sys/conf/files.arm64
@@ -2,6 +2,9 @@
arm/arm/devmap.c standard
arm/arm/generic_timer.c standard
arm/arm/pmu.c standard
+arm64/acpica/acpi_machdep.c optional acpi
+arm64/acpica/OsdEnvironment.c optional acpi
+arm64/acpica/acpi_wakeup.c optional acpi
arm64/arm64/autoconf.c standard
arm64/arm64/bcopy.c standard
arm64/arm64/bus_machdep.c standard
@@ -20,6 +23,8 @@ arm64/arm64/dump_machdep.c standard
arm64/arm64/elf_machdep.c standard
arm64/arm64/exception.S standard
arm64/arm64/gic.c standard
+arm64/arm64/gic_acpi.c optional acpi
+arm64/arm64/gic_fdt.c optional fdt
arm64/arm64/gic_v3.c standard
arm64/arm64/gic_v3_fdt.c optional fdt
arm64/arm64/identcpu.c standard
@@ -38,12 +43,15 @@ arm64/arm64/swtch.S standard
arm64/arm64/sys_machdep.c standard
arm64/arm64/trap.c standard
arm64/arm64/uio_machdep.c standard
+arm64/arm64/unwind.c optional ddb | kdtrace_hooks
arm64/arm64/vfp.c standard
arm64/arm64/vm_machdep.c standard
+dev/acpica/acpi_if.m optional acpi
dev/fdt/fdt_arm64.c optional fdt
dev/hwpmc/hwpmc_arm64.c optional hwpmc
dev/hwpmc/hwpmc_arm64_md.c optional hwpmc
dev/ofw/ofw_cpu.c optional fdt
+dev/pci/pci_host_generic.c optional pci fdt
dev/psci/psci.c optional psci
dev/psci/psci_arm64.S optional psci
dev/uart/uart_cpu_fdt.c optional uart fdt
diff --git a/sys/conf/files.i386 b/sys/conf/files.i386
index 68dd6a9..ebfce072 100644
--- a/sys/conf/files.i386
+++ b/sys/conf/files.i386
@@ -19,6 +19,18 @@ linux_assym.h optional compat_linux \
no-obj no-implicit-rule before-depend \
clean "linux_assym.h"
#
+linux_locore.o optional compat_linux \
+ dependency "linux_assym.h $S/i386/linux/linux_locore.s" \
+ compile-with "${CC} -x assembler-with-cpp -DLOCORE -shared -s -pipe -I. -I$S -Werror -Wall -fno-common -nostdinc -nostdlib -Wl,-T$S/i386/linux/linux_vdso.lds.s -Wl,-soname=linux_vdso.so,--eh-frame-hdr,-fPIC,-warn-common ${.IMPSRC} -o ${.TARGET}" \
+ no-obj no-implicit-rule \
+ clean "linux_locore.o"
+#
+linux_vdso.so optional compat_linux \
+ dependency "linux_locore.o" \
+ compile-with "${OBJCOPY} --input-target binary --output-target elf32-i386-freebsd --binary-architecture i386 linux_locore.o ${.TARGET}" \
+ no-implicit-rule \
+ clean "linux_vdso.so"
+#
svr4_genassym.o optional compat_svr4 \
dependency "$S/i386/svr4/svr4_genassym.c" \
compile-with "${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}" \
@@ -66,9 +78,15 @@ hptrr_lib.o optional hptrr \
compile-with "uudecode < $S/dev/hptrr/i386-elf.hptrr_lib.o.uu" \
no-implicit-rule
#
-cddl/contrib/opensolaris/common/atomic/i386/opensolaris_atomic.S optional zfs compile-with "${ZFS_S}"
+cddl/contrib/opensolaris/common/atomic/i386/opensolaris_atomic.S optional zfs | dtrace compile-with "${ZFS_S}"
+cddl/dev/dtrace/i386/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}"
+cddl/dev/dtrace/i386/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}"
+cddl/dev/fbt/x86/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}"
+cddl/dev/dtrace/x86/dis_tables.c optional dtrace_fbt | dtraceall compile-with "${DTRACE_C}"
+cddl/dev/dtrace/i386/instr_size.c optional dtrace_fbt | dtraceall compile-with "${DTRACE_C}"
compat/linprocfs/linprocfs.c optional linprocfs
compat/linsysfs/linsysfs.c optional linsysfs
+compat/linux/linux_event.c optional compat_linux
compat/linux/linux_emul.c optional compat_linux
compat/linux/linux_file.c optional compat_linux
compat/linux/linux_fork.c optional compat_linux
@@ -86,6 +104,8 @@ compat/linux/linux_time.c optional compat_linux
compat/linux/linux_timer.c optional compat_linux
compat/linux/linux_uid16.c optional compat_linux
compat/linux/linux_util.c optional compat_linux
+compat/linux/linux_vdso.c optional compat_linux
+compat/linux/linux.c optional compat_linux
compat/ndis/kern_ndis.c optional ndisapi pci
compat/ndis/kern_windrv.c optional ndisapi pci
compat/ndis/subr_hal.c optional ndisapi pci
@@ -490,8 +510,6 @@ i386/isa/prof_machdep.c optional profiling-routine
i386/isa/spic.c optional spic
i386/linux/imgact_linux.c optional compat_linux
i386/linux/linux_dummy.c optional compat_linux
-i386/linux/linux_locore.s optional compat_linux \
- dependency "linux_assym.h"
i386/linux/linux_machdep.c optional compat_linux
i386/linux/linux_ptrace.c optional compat_linux
i386/linux/linux_support.s optional compat_linux \
diff --git a/sys/conf/files.pc98 b/sys/conf/files.pc98
index ae165fc..28a94a8 100644
--- a/sys/conf/files.pc98
+++ b/sys/conf/files.pc98
@@ -21,6 +21,18 @@ linux_assym.h optional compat_linux \
no-obj no-implicit-rule before-depend \
clean "linux_assym.h"
#
+linux_locore.o optional compat_linux \
+ dependency "linux_assym.h $S/i386/linux/linux_locore.s" \
+ compile-with "${CC} -x assembler-with-cpp -DLOCORE -shared -s -pipe -I. -I$S -Werror -Wall -fno-common -nostdinc -nostdlib -Wl,-T$S/i386/linux/linux_vdso.lds.s -Wl,-soname=linux_vdso.so,--eh-frame-hdr,-fPIC,-warn-common ${.IMPSRC} -o ${.TARGET}" \
+ no-obj no-implicit-rule \
+ clean "linux_locore.o"
+#
+linux_vdso.so optional compat_linux \
+ dependency "linux_locore.o" \
+ compile-with "${OBJCOPY} --input-target binary --output-target elf32-i386-freebsd --binary-architecture i386 linux_locore.o ${.TARGET}" \
+ no-implicit-rule \
+ clean "linux_vdso.so"
+#
svr4_genassym.o optional compat_svr4 \
dependency "$S/i386/svr4/svr4_genassym.c" \
compile-with "${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}" \
@@ -41,6 +53,7 @@ ukbdmap.h optional ukbd_dflt_keymap \
cddl/contrib/opensolaris/common/atomic/i386/opensolaris_atomic.S optional zfs compile-with "${ZFS_S}"
compat/linprocfs/linprocfs.c optional linprocfs
compat/linsysfs/linsysfs.c optional linsysfs
+compat/linux/linux_event.c optional compat_linux
compat/linux/linux_emul.c optional compat_linux
compat/linux/linux_file.c optional compat_linux
compat/linux/linux_fork.c optional compat_linux
@@ -58,6 +71,8 @@ compat/linux/linux_time.c optional compat_linux
compat/linux/linux_timer.c optional compat_linux
compat/linux/linux_uid16.c optional compat_linux
compat/linux/linux_util.c optional compat_linux
+compat/linux/linux_vdso.c optional compat_linux
+compat/linux/linux.c optional compat_linux
compat/svr4/imgact_svr4.c optional compat_svr4
compat/svr4/svr4_fcntl.c optional compat_svr4
compat/svr4/svr4_filio.c optional compat_svr4
@@ -192,8 +207,6 @@ i386/isa/pmtimer.c optional pmtimer
i386/isa/prof_machdep.c optional profiling-routine
i386/linux/imgact_linux.c optional compat_linux
i386/linux/linux_dummy.c optional compat_linux
-i386/linux/linux_locore.s optional compat_linux \
- dependency "linux_assym.h"
i386/linux/linux_machdep.c optional compat_linux
i386/linux/linux_ptrace.c optional compat_linux
i386/linux/linux_support.s optional compat_linux \
diff --git a/sys/conf/files.powerpc b/sys/conf/files.powerpc
index 4158f2c..167fa42 100644
--- a/sys/conf/files.powerpc
+++ b/sys/conf/files.powerpc
@@ -15,8 +15,11 @@ font.h optional sc \
clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8"
#
# There is only an asm version on ppc64.
-cddl/compat/opensolaris/kern/opensolaris_atomic.c optional zfs powerpc compile-with "${ZFS_C}"
-cddl/contrib/opensolaris/common/atomic/powerpc64/opensolaris_atomic.S optional zfs powerpc64 compile-with "${ZFS_S}"
+cddl/compat/opensolaris/kern/opensolaris_atomic.c optional zfs powerpc | dtrace powerpc compile-with "${ZFS_C}"
+cddl/contrib/opensolaris/common/atomic/powerpc64/opensolaris_atomic.S optional zfs powerpc64 | dtrace powerpc64 compile-with "${ZFS_S}"
+cddl/dev/dtrace/powerpc/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}"
+cddl/dev/dtrace/powerpc/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}"
+cddl/dev/fbt/powerpc/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}"
crypto/blowfish/bf_enc.c optional crypto | ipsec
crypto/des/des_enc.c optional crypto | ipsec | netsmb
dev/bm/if_bm.c optional bm powermac
diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk
index 8f7abaf..28ea453 100644
--- a/sys/conf/kern.post.mk
+++ b/sys/conf/kern.post.mk
@@ -184,11 +184,11 @@ genassym.o: $S/$M/$M/genassym.c
${SYSTEM_OBJS} genassym.o vers.o: opt_global.h
-# We have "special" -I include paths for opensolaris/zfs files in 'depend'.
-CFILES_NOZFS= ${CFILES:N*/opensolaris/*}
-SFILES_NOZFS= ${SFILES:N*/opensolaris/*}
-CFILES_ZFS= ${CFILES:M*/opensolaris/*}
-SFILES_ZFS= ${SFILES:M*/opensolaris/*}
+# We have "special" -I include paths for zfs/dtrace files in 'depend'.
+CFILES_NOCDDL= ${CFILES:N*/cddl/*:N*fs/nfsclient/nfs_clkdtrace*}
+SFILES_NOCDDL= ${SFILES:N*/cddl/*}
+CFILES_CDDL= ${CFILES:M*/cddl/*}
+SFILES_CDDL= ${SFILES:M*/cddl/*}
kernel-depend: .depend
# The argument list can be very long, so use make -V and xargs to
@@ -198,13 +198,13 @@ SRCS= assym.s vnode_if.h ${BEFORE_DEPEND} ${CFILES} \
${MFILES:T:S/.m$/.h/}
.depend: .PRECIOUS ${SRCS}
rm -f .newdep
- ${MAKE} -V CFILES_NOZFS -V SYSTEM_CFILES -V GEN_CFILES | \
+ ${MAKE} -V CFILES_NOCDDL -V SYSTEM_CFILES -V GEN_CFILES | \
MKDEP_CPP="${CC} -E" CC="${CC}" xargs mkdep -a -f .newdep ${CFLAGS}
- ${MAKE} -V CFILES_ZFS | \
- MKDEP_CPP="${CC} -E" CC="${CC}" xargs mkdep -a -f .newdep ${ZFS_CFLAGS}
- ${MAKE} -V SFILES_NOZFS | \
+ ${MAKE} -V CFILES_CDDL | \
+ MKDEP_CPP="${CC} -E" CC="${CC}" xargs mkdep -a -f .newdep ${ZFS_CFLAGS} ${FBT_CFLAGS} ${DTRACE_CFLAGS}
+ ${MAKE} -V SFILES_NOCDDL | \
MKDEP_CPP="${CC} -E" xargs mkdep -a -f .newdep ${ASM_CFLAGS}
- ${MAKE} -V SFILES_ZFS | \
+ ${MAKE} -V SFILES_CDDL | \
MKDEP_CPP="${CC} -E" xargs mkdep -a -f .newdep ${ZFS_ASM_CFLAGS}
rm -f .depend
mv .newdep .depend
diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
index 8c3b9c6..3081edc 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -139,13 +139,34 @@ NORMAL_FW= uudecode -o ${.TARGET} ${.ALLSRC}
NORMAL_FWO= ${LD} -b binary --no-warn-mismatch -d -warn-common -r \
-o ${.TARGET} ${.ALLSRC:M*.fw}
+# Common for dtrace / zfs
+CDDL_CFLAGS= -DFREEBSD_NAMECACHE -nostdinc -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common -I$S -I$S/cddl/contrib/opensolaris/common ${CFLAGS} -Wno-unknown-pragmas -Wno-missing-prototypes -Wno-undef -Wno-strict-prototypes -Wno-cast-qual -Wno-parentheses -Wno-redundant-decls -Wno-missing-braces -Wno-uninitialized -Wno-unused -Wno-inline -Wno-switch -Wno-pointer-arith -Wno-unknown-pragmas
+CDDL_CFLAGS+= -include $S/cddl/compat/opensolaris/sys/debug_compat.h
+CDDL_C= ${CC} -c ${CDDL_CFLAGS} ${WERROR} ${PROF} ${.IMPSRC}
+
# Special flags for managing the compat compiles for ZFS
-ZFS_CFLAGS= -DFREEBSD_NAMECACHE -DBUILDING_ZFS -nostdinc -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common/fs/zfs -I$S/cddl/contrib/opensolaris/uts/common/zmod -I$S/cddl/contrib/opensolaris/uts/common -I$S -I$S/cddl/contrib/opensolaris/common/zfs -I$S/cddl/contrib/opensolaris/common ${CFLAGS} -Wno-unknown-pragmas -Wno-missing-prototypes -Wno-undef -Wno-strict-prototypes -Wno-cast-qual -Wno-parentheses -Wno-redundant-decls -Wno-missing-braces -Wno-uninitialized -Wno-unused -Wno-inline -Wno-switch -Wno-pointer-arith -Wno-unknown-pragmas
-ZFS_CFLAGS+= -include $S/cddl/compat/opensolaris/sys/debug_compat.h
+ZFS_CFLAGS= -DBUILDING_ZFS -I$S/cddl/contrib/opensolaris/uts/common/fs/zfs -I$S/cddl/contrib/opensolaris/uts/common/zmod -I$S/cddl/contrib/opensolaris/common/zfs ${CDDL_CFLAGS}
ZFS_ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${ZFS_CFLAGS}
ZFS_C= ${CC} -c ${ZFS_CFLAGS} ${WERROR} ${PROF} ${.IMPSRC}
ZFS_S= ${CC} -c ${ZFS_ASM_CFLAGS} ${WERROR} ${.IMPSRC}
+# Special flags for managing the compat compiles for DTrace
+DTRACE_CFLAGS= -DBUILDING_DTRACE ${CDDL_CFLAGS} -I$S/cddl/dev/dtrace -I$S/cddl/dev/dtrace/${MACHINE_CPUARCH}
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
+DTRACE_CFLAGS+= -I$S/cddl/contrib/opensolaris/uts/intel -I$S/cddl/dev/dtrace/x86
+.endif
+DTRACE_CFLAGS+= -I$S/cddl/contrib/opensolaris/common/util -I$S -DDIS_MEM -DSMP
+DTRACE_ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${DTRACE_CFLAGS}
+DTRACE_C= ${CC} -c ${DTRACE_CFLAGS} ${CDDL_CFLAGS} ${WERROR} ${PROF} ${.IMPSRC}
+DTRACE_S= ${CC} -c ${DTRACE_ASM_CFLAGS} ${CDDL_CFLAGS} ${WERROR} ${.IMPSRC}
+
+# Special flags for managing the compat compiles for DTrace/FBT
+FBT_CFLAGS= -DBUILDING_DTRACE -nostdinc -I$S/cddl/dev/fbt/${MACHINE_CPUARCH} -I$S/cddl/dev/fbt -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common -I$S ${CDDL_CFLAGS}
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
+FBT_CFLAGS+= -I$S/cddl/dev/fbt/x86
+.endif
+FBT_C= ${CC} -c ${FBT_CFLAGS} ${CDDL_CFLAGS} ${WERROR} ${PROF} ${.IMPSRC}
+
.if ${MK_CTF} != "no"
NORMAL_CTFCONVERT= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.elif ${MAKE_VERSION} >= 5201111300
diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk
index ea2a628..28b95c5 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -346,7 +346,7 @@ MFILES?= dev/acpica/acpi_if.m dev/acpi_support/acpi_wmi_if.m \
dev/mbox/mbox_if.m dev/mmc/mmcbr_if.m dev/mmc/mmcbus_if.m \
dev/mii/miibus_if.m dev/mvs/mvs_if.m dev/ofw/ofw_bus_if.m \
dev/pccard/card_if.m dev/pccard/power_if.m dev/pci/pci_if.m \
- dev/pci/pcib_if.m dev/ppbus/ppbus_if.m \
+ dev/pci/pci_iov_if.m dev/pci/pcib_if.m dev/ppbus/ppbus_if.m \
dev/sdhci/sdhci_if.m dev/smbus/smbus_if.m dev/spibus/spibus_if.m \
dev/sound/pci/hda/hdac_if.m \
dev/sound/pcm/ac97_if.m dev/sound/pcm/channel_if.m \
diff --git a/sys/conf/options b/sys/conf/options
index eabd73c..511e57c 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -108,6 +108,7 @@ GEOM_JOURNAL opt_geom.h
GEOM_LABEL opt_geom.h
GEOM_LABEL_GPT opt_geom.h
GEOM_LINUX_LVM opt_geom.h
+GEOM_MAP opt_geom.h
GEOM_MBR opt_geom.h
GEOM_MIRROR opt_geom.h
GEOM_MULTIPATH opt_geom.h
@@ -940,3 +941,6 @@ RCTL opt_global.h
RANDOM_YARROW opt_random.h
RANDOM_FORTUNA opt_random.h
RANDOM_DEBUG opt_random.h
+
+# Intel em(4) driver
+EM_MULTIQUEUE opt_em.h
diff --git a/sys/conf/options.arm b/sys/conf/options.arm
index 9926706..57cef6a 100644
--- a/sys/conf/options.arm
+++ b/sys/conf/options.arm
@@ -22,6 +22,7 @@ CPU_XSCALE_IXP425 opt_global.h
CPU_XSCALE_IXP435 opt_global.h
CPU_XSCALE_PXA2X0 opt_global.h
DEV_GIC opt_global.h
+EFI opt_platform.h
FLASHADDR opt_global.h
GIC_DEFAULT_ICFGR_INIT opt_global.h
IPI_IRQ_START opt_smp.h
diff --git a/sys/contrib/dev/acpica/common/ahuuids.c b/sys/contrib/dev/acpica/common/ahuuids.c
index a96ab8f..eeec8b8 100644
--- a/sys/contrib/dev/acpica/common/ahuuids.c
+++ b/sys/contrib/dev/acpica/common/ahuuids.c
@@ -43,6 +43,7 @@
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/acuuid.h>
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("ahuuids")
@@ -52,44 +53,36 @@
*/
const AH_UUID AcpiUuids[] =
{
- {"PCI Host Bridge Device",
- "33db4d5b-1ff7-401c-9657-7441c03dd766"},
-
- {"Platform-wide Capabilities",
- "0811b06e-4a27-44f9-8d60-3cbbc22e7b48"},
-
- {"Dynamic Enumeration",
- "d8c1a3a6-be9b-4c9b-91bf-c3cb81fc5daf"},
-
- {"GPIO Controller",
- "4f248f40-d5e2-499f-834c-27758ea1cd3f"},
-
- {"Battery Thermal Limit",
- "4c2067e3-887d-475c-9720-4af1d3ed602e"},
-
- {"Thermal Extensions",
- "14d399cd-7a27-4b18-8fb4-7cb7b9f4e500"},
-
- {"USB Controller",
- "ce2ee385-00e6-48cb-9f05-2edb927c4899"},
-
- {"HID I2C Device",
- "3cdff6f7-4267-4555-ad05-b30a3d8938de"},
-
- {"Power Button Device",
- "dfbcf3c5-e7a5-44e6-9c1f-29c76f6e059c"},
-
- {"Device Labeling Interface",
- "e5c937d0-3553-4d7a-9117-ea4d19c3434d"},
-
- {"SATA Controller",
- "e4db149b-fcfe-425b-a6d8-92357d78fc7f"},
-
- {"Physical Presence Interface",
- "3dddfaa6-361b-4eb4-a424-8d10089d1653"},
-
- {"Device Properties for _DSD",
- "daffd814-6eba-4d8c-8a91-bc9bbf4aa301"},
+ {"[Controllers]", NULL},
+ {"GPIO Controller", UUID_GPIO_CONTROLLER},
+ {"USB Controller", UUID_USB_CONTROLLER},
+ {"SATA Controller", UUID_SATA_CONTROLLER},
+
+ {"[Devices]", NULL},
+ {"PCI Host Bridge Device", UUID_PCI_HOST_BRIDGE},
+ {"HID I2C Device", UUID_I2C_DEVICE},
+ {"Power Button Device", UUID_POWER_BUTTON},
+
+ {"[Interfaces]", NULL},
+ {"Device Labeling Interface", UUID_DEVICE_LABELING},
+ {"Physical Presence Interface", UUID_PHYSICAL_PRESENCE},
+
+ {"[Non-volatile DIMM and NFIT table]", NULL},
+ {"Volatile Memory Region", UUID_VOLATILE_MEMORY},
+ {"Persistent Memory Region", UUID_PERSISTENT_MEMORY},
+ {"NVDIMM Control Region", UUID_CONTROL_REGION},
+ {"NVDIMM Data Region", UUID_DATA_REGION},
+ {"Volatile Virtual Disk", UUID_VOLATILE_VIRTUAL_DISK},
+ {"Volatile Virtual CD", UUID_VOLATILE_VIRTUAL_CD},
+ {"Persistent Virtual Disk", UUID_PERSISTENT_VIRTUAL_DISK},
+ {"Persistent Virtual CD", UUID_PERSISTENT_VIRTUAL_CD},
+
+ {"[Miscellaneous]", NULL},
+ {"Platform-wide Capabilities", UUID_PLATFORM_CAPABILITIES},
+ {"Dynamic Enumeration", UUID_DYNAMIC_ENUMERATION},
+ {"Battery Thermal Limit", UUID_BATTERY_THERMAL_LIMIT},
+ {"Thermal Extensions", UUID_THERMAL_EXTENSIONS},
+ {"Device Properties for _DSD", UUID_DEVICE_PROPERTIES},
{NULL, NULL}
};
@@ -120,6 +113,13 @@ AcpiAhMatchUuid (
for (Info = AcpiUuids; Info->Description; Info++)
{
+ /* Null string means desciption is a UUID class */
+
+ if (!Info->String)
+ {
+ continue;
+ }
+
AcpiUtConvertStringToUuid (Info->String, UuidBuffer);
if (!ACPI_MEMCMP (Data, UuidBuffer, UUID_BUFFER_LENGTH))
diff --git a/sys/contrib/dev/acpica/include/acuuid.h b/sys/contrib/dev/acpica/include/acuuid.h
index cfc4363..59c1768 100644
--- a/sys/contrib/dev/acpica/include/acuuid.h
+++ b/sys/contrib/dev/acpica/include/acuuid.h
@@ -50,15 +50,41 @@
* Note2: This file is standalone and should remain that way.
*/
-/* NFIT/NVDIMM */
+/* Controllers */
+
+#define UUID_GPIO_CONTROLLER "4f248f40-d5e2-499f-834c-27758ea1cd3f"
+#define UUID_USB_CONTROLLER "ce2ee385-00e6-48cb-9f05-2edb927c4899"
+#define UUID_SATA_CONTROLLER "e4db149b-fcfe-425b-a6d8-92357d78fc7f"
+
+/* Devices */
+
+#define UUID_PCI_HOST_BRIDGE "33db4d5b-1ff7-401c-9657-7441c03dd766"
+#define UUID_I2C_DEVICE "3cdff6f7-4267-4555-ad05-b30a3d8938de"
+#define UUID_POWER_BUTTON "dfbcf3c5-e7a5-44e6-9c1f-29c76f6e059c"
+
+/* Interfaces */
+
+#define UUID_DEVICE_LABELING "e5c937d0-3553-4d7a-9117-ea4d19c3434d"
+#define UUID_PHYSICAL_PRESENCE "3dddfaa6-361b-4eb4-a424-8d10089d1653"
+
+/* NVDIMM - NFIT table */
+
+#define UUID_VOLATILE_MEMORY "7305944f-fdda-44e3-b16c-3f22d252e5d0"
+#define UUID_PERSISTENT_MEMORY "66f0d379-b4f3-4074-ac43-0d3318b78cdb"
+#define UUID_CONTROL_REGION "92f701f6-13b4-405d-910b-299367e8234c"
+#define UUID_DATA_REGION "91af0530-5d86-470e-a6b0-0a2db9408249"
+#define UUID_VOLATILE_VIRTUAL_DISK "77ab535a-45fc-624b-5560-f7b281d1f96e"
+#define UUID_VOLATILE_VIRTUAL_CD "3d5abd30-4175-87ce-6d64-d2ade523c4bb"
+#define UUID_PERSISTENT_VIRTUAL_DISK "5cea02c9-4d07-69d3-269f-4496fbe096f9"
+#define UUID_PERSISTENT_VIRTUAL_CD "08018188-42cd-bb48-100f-5387d53ded3d"
+
+/* Miscellaneous */
+
+#define UUID_PLATFORM_CAPABILITIES "0811b06e-4a27-44f9-8d60-3cbbc22e7b48"
+#define UUID_DYNAMIC_ENUMERATION "d8c1a3a6-be9b-4c9b-91bf-c3cb81fc5daf"
+#define UUID_BATTERY_THERMAL_LIMIT "4c2067e3-887d-475c-9720-4af1d3ed602e"
+#define UUID_THERMAL_EXTENSIONS "14d399cd-7a27-4b18-8fb4-7cb7b9f4e500"
+#define UUID_DEVICE_PROPERTIES "daffd814-6eba-4d8c-8a91-bc9bbf4aa301"
-#define UUID_VOLATILE_MEMORY "4F940573-DAFD-E344-B16C-3F22D252E5D0"
-#define UUID_PERSISTENT_MEMORY "79D3F066-F3B4-7440-AC43-0D3318B78CDB"
-#define UUID_CONTROL_REGION "F601F792-B413-5D40-910B-299367E8234C"
-#define UUID_DATA_REGION "3005AF91-865D-0E47-A6B0-0A2DB9408249"
-#define UUID_VOLATILE_VIRTUAL_DISK "5A53AB77-FC45-4B62-5560-F7B281D1F96E"
-#define UUID_VOLATILE_VIRTUAL_CD "30BD5A3D-7541-CE87-6D64-D2ADE523C4BB"
-#define UUID_PERSISTENT_VIRTUAL_DISK "C902EA5C-074D-69D3-269F-4496FBE096F9"
-#define UUID_PERSISTENT_VIRTUAL_CD "88810108-CD42-48BB-100F-5387D53DED3D"
#endif /* __AUUID_H__ */
diff --git a/sys/dev/acpi_support/acpi_ibm.c b/sys/dev/acpi_support/acpi_ibm.c
index c69f8bf..f8ff1eb 100644
--- a/sys/dev/acpi_support/acpi_ibm.c
+++ b/sys/dev/acpi_support/acpi_ibm.c
@@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
#include "opt_acpi.h"
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/bus.h>
#include <machine/cpufunc.h>
@@ -261,6 +262,37 @@ static struct {
{ NULL, 0, NULL, 0 }
};
+/*
+ * Per-model default list of event mask.
+ */
+#define ACPI_IBM_HKEY_RFKILL_MASK (1 << 4)
+#define ACPI_IBM_HKEY_DSWITCH_MASK (1 << 6)
+#define ACPI_IBM_HKEY_BRIGHTNESS_UP_MASK (1 << 15)
+#define ACPI_IBM_HKEY_BRIGHTNESS_DOWN_MASK (1 << 16)
+#define ACPI_IBM_HKEY_SEARCH_MASK (1 << 18)
+#define ACPI_IBM_HKEY_MICMUTE_MASK (1 << 26)
+#define ACPI_IBM_HKEY_SETTINGS_MASK (1 << 28)
+#define ACPI_IBM_HKEY_VIEWOPEN_MASK (1 << 30)
+#define ACPI_IBM_HKEY_VIEWALL_MASK (1 << 31)
+
+struct acpi_ibm_models {
+ const char *maker;
+ const char *product;
+ uint32_t eventmask;
+} acpi_ibm_models[] = {
+ { "LENOVO", "20BSCTO1WW",
+ ACPI_IBM_HKEY_RFKILL_MASK |
+ ACPI_IBM_HKEY_DSWITCH_MASK |
+ ACPI_IBM_HKEY_BRIGHTNESS_UP_MASK |
+ ACPI_IBM_HKEY_BRIGHTNESS_DOWN_MASK |
+ ACPI_IBM_HKEY_SEARCH_MASK |
+ ACPI_IBM_HKEY_MICMUTE_MASK |
+ ACPI_IBM_HKEY_SETTINGS_MASK |
+ ACPI_IBM_HKEY_VIEWOPEN_MASK |
+ ACPI_IBM_HKEY_VIEWALL_MASK
+ }
+};
+
ACPI_SERIAL_DECL(ibm, "ACPI IBM extras");
static int acpi_ibm_probe(device_t dev);
@@ -354,7 +386,9 @@ acpi_ibm_probe(device_t dev)
static int
acpi_ibm_attach(device_t dev)
{
+ int i;
struct acpi_ibm_softc *sc;
+ char *maker, *product;
devclass_t ec_devclass;
ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__);
@@ -445,7 +479,34 @@ acpi_ibm_attach(device_t dev)
/* Hook up light to led(4) */
if (sc->light_set_supported)
- sc->led_dev = led_create_state(ibm_led, sc, "thinklight", sc->light_val);
+ sc->led_dev = led_create_state(ibm_led, sc, "thinklight",
+ (sc->light_val ? 1 : 0));
+
+ /* Enable per-model events. */
+ maker = kern_getenv("smbios.system.maker");
+ product = kern_getenv("smbios.system.product");
+ if (maker != NULL && product != NULL)
+ goto nosmbios;
+
+ for (i = 0; i < nitems(acpi_ibm_models); i++) {
+ if (strcmp(maker, acpi_ibm_models[i].maker) == 0 &&
+ strcmp(product, acpi_ibm_models[i].product) == 0) {
+ ACPI_SERIAL_BEGIN(ibm);
+ acpi_ibm_sysctl_set(sc, ACPI_IBM_METHOD_EVENTMASK,
+ acpi_ibm_models[i].eventmask);
+ ACPI_SERIAL_END(ibm);
+ }
+ }
+
+nosmbios:
+ freeenv(maker);
+ freeenv(product);
+
+ /* Enable events by default. */
+ ACPI_SERIAL_BEGIN(ibm);
+ acpi_ibm_sysctl_set(sc, ACPI_IBM_METHOD_EVENTS, 1);
+ ACPI_SERIAL_END(ibm);
+
return (0);
}
@@ -769,7 +830,6 @@ acpi_ibm_sysctl_init(struct acpi_ibm_softc *sc, int method)
switch (method) {
case ACPI_IBM_METHOD_EVENTS:
- /* Events are disabled by default */
return (TRUE);
case ACPI_IBM_METHOD_EVENTMASK:
@@ -1228,7 +1288,6 @@ acpi_ibm_notify(ACPI_HANDLE h, UINT32 notify, void *context)
for (;;) {
acpi_GetInteger(acpi_get_handle(dev), IBM_NAME_EVENTS_GET, &event);
-
if (event == 0)
break;
diff --git a/sys/dev/acpica/Osd/OsdHardware.c b/sys/dev/acpica/Osd/OsdHardware.c
index 1761670..8d94e7b 100644
--- a/sys/dev/acpica/Osd/OsdHardware.c
+++ b/sys/dev/acpica/Osd/OsdHardware.c
@@ -89,6 +89,10 @@ AcpiOsReadPciConfiguration(ACPI_PCI_ID *PciId, UINT32 Register, UINT64 *Value,
UINT32 Width)
{
+#ifdef __aarch64__
+ /* ARM64TODO: Add pci support */
+ return (AE_SUPPORT);
+#else
if (Width == 64)
return (AE_SUPPORT);
@@ -99,6 +103,7 @@ AcpiOsReadPciConfiguration(ACPI_PCI_ID *PciId, UINT32 Register, UINT64 *Value,
PciId->Function, Register, Width / 8);
return (AE_OK);
+#endif
}
@@ -107,6 +112,10 @@ AcpiOsWritePciConfiguration (ACPI_PCI_ID *PciId, UINT32 Register,
UINT64 Value, UINT32 Width)
{
+#ifdef __aarch64__
+ /* ARM64TODO: Add pci support */
+ return (AE_SUPPORT);
+#else
if (Width == 64)
return (AE_SUPPORT);
@@ -117,4 +126,5 @@ AcpiOsWritePciConfiguration (ACPI_PCI_ID *PciId, UINT32 Register,
Value, Width / 8);
return (AE_OK);
+#endif
}
diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c
index 21fccca..e3269db 100644
--- a/sys/dev/acpica/acpi_cpu.c
+++ b/sys/dev/acpica/acpi_cpu.c
@@ -183,7 +183,9 @@ static int acpi_cpu_cx_cst(struct acpi_cpu_softc *sc);
static void acpi_cpu_startup(void *arg);
static void acpi_cpu_startup_cx(struct acpi_cpu_softc *sc);
static void acpi_cpu_cx_list(struct acpi_cpu_softc *sc);
+#if defined(__i386__) || defined(__amd64__)
static void acpi_cpu_idle(sbintime_t sbt);
+#endif
static void acpi_cpu_notify(ACPI_HANDLE h, UINT32 notify, void *context);
static void acpi_cpu_quirks(void);
static void acpi_cpu_quirks_piix4(void);
@@ -475,12 +477,14 @@ enable_idle(struct acpi_cpu_softc *sc)
sc->cpu_disable_idle = FALSE;
}
+#if defined(__i386__) || defined(__amd64__)
static int
is_idle_disabled(struct acpi_cpu_softc *sc)
{
return (sc->cpu_disable_idle);
}
+#endif
/*
* Disable any entry to the idle function during suspend and re-enable it
@@ -999,7 +1003,9 @@ acpi_cpu_startup(void *arg)
sc = device_get_softc(cpu_devices[i]);
enable_idle(sc);
}
+#if defined(__i386__) || defined(__amd64__)
cpu_idle_hook = acpi_cpu_idle;
+#endif
}
static void
@@ -1061,6 +1067,7 @@ acpi_cpu_startup_cx(struct acpi_cpu_softc *sc)
}
}
+#if defined(__i386__) || defined(__amd64__)
/*
* Idle the CPU in the lowest state possible. This function is called with
* interrupts disabled. Note that once it re-enables interrupts, a task
@@ -1074,6 +1081,7 @@ acpi_cpu_idle(sbintime_t sbt)
struct acpi_cx *cx_next;
uint64_t cputicks;
uint32_t start_time, end_time;
+ ACPI_STATUS status;
int bm_active, cx_next_idx, i, us;
/*
@@ -1119,8 +1127,8 @@ acpi_cpu_idle(sbintime_t sbt)
*/
if ((cpu_quirks & CPU_QUIRK_NO_BM_CTRL) == 0 &&
cx_next_idx > sc->cpu_non_c3) {
- AcpiReadBitRegister(ACPI_BITREG_BUS_MASTER_STATUS, &bm_active);
- if (bm_active != 0) {
+ status = AcpiReadBitRegister(ACPI_BITREG_BUS_MASTER_STATUS, &bm_active);
+ if (ACPI_SUCCESS(status) && bm_active != 0) {
AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_STATUS, 1);
cx_next_idx = sc->cpu_non_c3;
}
@@ -1207,6 +1215,7 @@ acpi_cpu_idle(sbintime_t sbt)
sc->cpu_prev_sleep = (sc->cpu_prev_sleep * 3 + PM_USEC(end_time)) / 4;
}
+#endif
/*
* Re-evaluate the _CST object when we are notified that it changed.
@@ -1285,6 +1294,7 @@ acpi_cpu_quirks_piix4(void)
#ifdef __i386__
device_t acpi_dev;
uint32_t val;
+ ACPI_STATUS status;
acpi_dev = pci_find_device(PCI_VENDOR_INTEL, PCI_DEVICE_82371AB_3);
if (acpi_dev != NULL) {
@@ -1323,8 +1333,8 @@ acpi_cpu_quirks_piix4(void)
val |= PIIX4_STOP_BREAK_MASK;
pci_write_config(acpi_dev, PIIX4_DEVACTB_REG, val, 4);
}
- AcpiReadBitRegister(ACPI_BITREG_BUS_MASTER_RLD, &val);
- if (val) {
+ status = AcpiReadBitRegister(ACPI_BITREG_BUS_MASTER_RLD, &val);
+ if (ACPI_SUCCESS(status) && val != 0) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"acpi_cpu: PIIX4: reset BRLD_EN_BM\n"));
AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_RLD, 0);
diff --git a/sys/dev/ahci/ahci.h b/sys/dev/ahci/ahci.h
index 33de2f9..6892527 100644
--- a/sys/dev/ahci/ahci.h
+++ b/sys/dev/ahci/ahci.h
@@ -578,7 +578,7 @@ enum ahci_err_type {
#define AHCI_Q_RESTORE_CAP 0x00080000
#define AHCI_Q_BIT_STRING \
- "\021" \
+ "\020" \
"\001NOFORCE" \
"\002NOPMP" \
"\003NONCQ" \
diff --git a/sys/dev/aic7xxx/aic79xx_pci.c b/sys/dev/aic7xxx/aic79xx_pci.c
index cb2dbc3..0b8ca40 100644
--- a/sys/dev/aic7xxx/aic79xx_pci.c
+++ b/sys/dev/aic7xxx/aic79xx_pci.c
@@ -93,6 +93,11 @@ ahd_compose_id(u_int device, u_int vendor, u_int subdevice, u_int subvendor)
#define ID_AIC7902_PCI_REV_A4 0x3
#define ID_AIC7902_PCI_REV_B0 0x10
#define SUBID_HP 0x0E11
+#define DEVICE8081 0x8081
+#define DEVICE8088 0x8088
+#define DEVICE8089 0x8089
+#define ADAPTECVENDORID 0x9005
+#define SUBVENDOR9005 0x9005
#define DEVID_9005_HOSTRAID(id) ((id) & 0x80)
@@ -292,6 +297,15 @@ ahd_find_pci_device(aic_dev_softc_t pci)
device = aic_pci_read_config(pci, PCIR_DEVICE, /*bytes*/2);
subvendor = aic_pci_read_config(pci, PCIR_SUBVEND_0, /*bytes*/2);
subdevice = aic_pci_read_config(pci, PCIR_SUBDEV_0, /*bytes*/2);
+
+ if ((vendor == ADAPTECVENDORID) && (subvendor == SUBVENDOR9005)) {
+ if ((device == DEVICE8081) || (device == DEVICE8088) ||
+ (device == DEVICE8089)) {
+ printf("Controller device ID conflict with PMC Adaptec HBA\n");
+ return (NULL);
+ }
+ }
+
full_id = ahd_compose_id(device,
vendor,
subdevice,
diff --git a/sys/dev/ath/ath_rate/sample/sample.c b/sys/dev/ath/ath_rate/sample/sample.c
index 36cd679..3606e14 100644
--- a/sys/dev/ath/ath_rate/sample/sample.c
+++ b/sys/dev/ath/ath_rate/sample/sample.c
@@ -843,9 +843,11 @@ update_stats(struct ath_softc *sc, struct ath_node *an,
}
static void
-badrate(struct ifnet *ifp, int series, int hwrate, int tries, int status)
+badrate(struct ath_softc *sc, int series, int hwrate, int tries, int status)
{
- if_printf(ifp, "bad series%d hwrate 0x%x, tries %u ts_status 0x%x\n",
+
+ device_printf(sc->sc_dev,
+ "bad series%d hwrate 0x%x, tries %u ts_status 0x%x\n",
series, hwrate, tries, status);
}
@@ -891,9 +893,10 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_node *an,
if (!mrr || ts->ts_finaltsi == 0) {
if (!IS_RATE_DEFINED(sn, final_rix)) {
- device_printf(sc->sc_dev, "%s: ts_rate=%d ts_finaltsi=%d, final_rix=%d\n",
+ device_printf(sc->sc_dev,
+ "%s: ts_rate=%d ts_finaltsi=%d, final_rix=%d\n",
__func__, ts->ts_rate, ts->ts_finaltsi, final_rix);
- badrate(ifp, 0, ts->ts_rate, long_tries, status);
+ badrate(sc, 0, ts->ts_rate, long_tries, status);
return;
}
/*
@@ -945,7 +948,7 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_node *an,
for (i = 0; i < 4; i++) {
if (rc[i].tries && !IS_RATE_DEFINED(sn, rc[i].rix))
- badrate(ifp, 0, rc[i].ratecode, rc[i].tries,
+ badrate(sc, 0, rc[i].ratecode, rc[i].tries,
status);
}
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index 83d9bd2..4aac93b 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -166,9 +166,9 @@ static void ath_bmiss_proc(void *, int);
static void ath_key_update_begin(struct ieee80211vap *);
static void ath_key_update_end(struct ieee80211vap *);
static void ath_update_mcast_hw(struct ath_softc *);
-static void ath_update_mcast(struct ifnet *);
-static void ath_update_promisc(struct ifnet *);
-static void ath_updateslot(struct ifnet *);
+static void ath_update_mcast(struct ieee80211com *);
+static void ath_update_promisc(struct ieee80211com *);
+static void ath_updateslot(struct ieee80211com *);
static void ath_bstuck_proc(void *, int);
static void ath_reset_proc(void *, int);
static int ath_desc_alloc(struct ath_softc *);
@@ -592,8 +592,9 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
goto bad;
}
ic = ifp->if_l2com;
+ ic->ic_softc = sc;
+ ic->ic_name = device_get_nameunit(sc->sc_dev);
- /* set these up early for if_printf use */
if_initname(ifp, device_get_name(sc->sc_dev),
device_get_unit(sc->sc_dev));
CURVNET_RESTORE();
@@ -610,8 +611,8 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
ah = ath_hal_attach(devid, sc, sc->sc_st, sc->sc_sh,
sc->sc_eepromdata, &ah_config, &status);
if (ah == NULL) {
- if_printf(ifp, "unable to attach hardware; HAL status %u\n",
- status);
+ device_printf(sc->sc_dev,
+ "unable to attach hardware; HAL status %u\n", status);
error = ENXIO;
goto bad;
}
@@ -662,8 +663,9 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
*/
sc->sc_keymax = ath_hal_keycachesize(ah);
if (sc->sc_keymax > ATH_KEYMAX) {
- if_printf(ifp, "Warning, using only %u of %u key cache slots\n",
- ATH_KEYMAX, sc->sc_keymax);
+ device_printf(sc->sc_dev,
+ "Warning, using only %u of %u key cache slots\n",
+ ATH_KEYMAX, sc->sc_keymax);
sc->sc_keymax = ATH_KEYMAX;
}
/*
@@ -702,14 +704,14 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
*/
error = ath_desc_alloc(sc);
if (error != 0) {
- if_printf(ifp, "failed to allocate TX descriptors: %d\n",
- error);
+ device_printf(sc->sc_dev,
+ "failed to allocate TX descriptors: %d\n", error);
goto bad;
}
error = ath_txdma_setup(sc);
if (error != 0) {
- if_printf(ifp, "failed to allocate TX descriptors: %d\n",
- error);
+ device_printf(sc->sc_dev,
+ "failed to allocate TX descriptors: %d\n", error);
goto bad;
}
@@ -718,8 +720,8 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
*/
error = ath_rxdma_setup(sc);
if (error != 0) {
- if_printf(ifp, "failed to allocate RX descriptors: %d\n",
- error);
+ device_printf(sc->sc_dev,
+ "failed to allocate RX descriptors: %d\n", error);
goto bad;
}
@@ -750,20 +752,22 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
*/
sc->sc_bhalq = ath_beaconq_setup(sc);
if (sc->sc_bhalq == (u_int) -1) {
- if_printf(ifp, "unable to setup a beacon xmit queue!\n");
+ device_printf(sc->sc_dev,
+ "unable to setup a beacon xmit queue!\n");
error = EIO;
goto bad2;
}
sc->sc_cabq = ath_txq_setup(sc, HAL_TX_QUEUE_CAB, 0);
if (sc->sc_cabq == NULL) {
- if_printf(ifp, "unable to setup CAB xmit queue!\n");
+ device_printf(sc->sc_dev, "unable to setup CAB xmit queue!\n");
error = EIO;
goto bad2;
}
/* NB: insure BK queue is the lowest priority h/w queue */
if (!ath_tx_setup(sc, WME_AC_BK, HAL_WME_AC_BK)) {
- if_printf(ifp, "unable to setup xmit queue for %s traffic!\n",
- ieee80211_wme_acnames[WME_AC_BK]);
+ device_printf(sc->sc_dev,
+ "unable to setup xmit queue for %s traffic!\n",
+ ieee80211_wme_acnames[WME_AC_BK]);
error = EIO;
goto bad2;
}
@@ -1826,8 +1830,8 @@ ath_vap_delete(struct ieee80211vap *vap)
* be reset if we just destroyed the last vap).
*/
if (ath_startrecv(sc) != 0)
- if_printf(ifp, "%s: unable to restart recv logic\n",
- __func__);
+ device_printf(sc->sc_dev,
+ "%s: unable to restart recv logic\n", __func__);
if (sc->sc_beacons) { /* restart beacons */
#ifdef IEEE80211_SUPPORT_TDMA
if (sc->sc_tdma)
@@ -2314,7 +2318,7 @@ ath_fatal_proc(void *arg, int pending)
u_int32_t len;
void *sp;
- if_printf(ifp, "hardware error; resetting\n");
+ device_printf(sc->sc_dev, "hardware error; resetting\n");
/*
* Fatal errors are unrecoverable. Typically these
* are caused by DMA errors. Collect h/w state from
@@ -2323,9 +2327,9 @@ ath_fatal_proc(void *arg, int pending)
if (ath_hal_getfatalstate(sc->sc_ah, &sp, &len)) {
KASSERT(len >= 6*sizeof(u_int32_t), ("len %u bytes", len));
state = sp;
- if_printf(ifp, "0x%08x 0x%08x 0x%08x, 0x%08x 0x%08x 0x%08x\n",
- state[0], state[1] , state[2], state[3],
- state[4], state[5]);
+ device_printf(sc->sc_dev,
+ "0x%08x 0x%08x 0x%08x, 0x%08x 0x%08x 0x%08x\n", state[0],
+ state[1] , state[2], state[3], state[4], state[5]);
}
ath_reset(ifp, ATH_RESET_NOLOSS);
}
@@ -2432,7 +2436,8 @@ ath_bmiss_proc(void *arg, int pending)
*/
if (ath_hal_gethangstate(sc->sc_ah, 0xff, &hangs) && hangs != 0) {
ath_reset(ifp, ATH_RESET_NOLOSS);
- if_printf(ifp, "bb hang detected (0x%x), resetting\n", hangs);
+ device_printf(sc->sc_dev,
+ "bb hang detected (0x%x), resetting\n", hangs);
} else {
ath_reset(ifp, ATH_RESET_NOLOSS);
ieee80211_beacon_miss(ifp->if_l2com);
@@ -2507,9 +2512,10 @@ ath_init(void *arg)
ath_hal_setchainmasks(sc->sc_ah, sc->sc_cur_txchainmask,
sc->sc_cur_rxchainmask);
- if (!ath_hal_reset(ah, sc->sc_opmode, ic->ic_curchan, AH_FALSE, &status)) {
- if_printf(ifp, "unable to reset hardware; hal status %u\n",
- status);
+ if (!ath_hal_reset(ah, sc->sc_opmode, ic->ic_curchan, AH_FALSE,
+ &status)) {
+ device_printf(sc->sc_dev,
+ "unable to reset hardware; hal status %u\n", status);
ATH_UNLOCK(sc);
return;
}
@@ -2567,7 +2573,7 @@ ath_init(void *arg)
* here except setup the interrupt mask.
*/
if (ath_startrecv(sc) != 0) {
- if_printf(ifp, "unable to start recv logic\n");
+ device_printf(sc->sc_dev, "unable to start recv logic\n");
ath_power_restore_power_state(sc);
ATH_UNLOCK(sc);
return;
@@ -2909,8 +2915,9 @@ ath_reset(struct ifnet *ifp, ATH_RESET_TYPE reset_type)
ath_hal_setchainmasks(sc->sc_ah, sc->sc_cur_txchainmask,
sc->sc_cur_rxchainmask);
if (!ath_hal_reset(ah, sc->sc_opmode, ic->ic_curchan, AH_TRUE, &status))
- if_printf(ifp, "%s: unable to reset hardware; hal status %u\n",
- __func__, status);
+ device_printf(sc->sc_dev,
+ "%s: unable to reset hardware; hal status %u\n",
+ __func__, status);
sc->sc_diversity = ath_hal_getdiversity(ah);
ATH_RX_LOCK(sc);
@@ -2939,7 +2946,8 @@ ath_reset(struct ifnet *ifp, ATH_RESET_TYPE reset_type)
ath_hal_setenforcetxop(sc->sc_ah, 0);
if (ath_startrecv(sc) != 0) /* restart recv */
- if_printf(ifp, "%s: unable to start recv logic\n", __func__);
+ device_printf(sc->sc_dev,
+ "%s: unable to start recv logic\n", __func__);
/*
* We may be doing a reset in response to an ioctl
* that changes the channel so update any state that
@@ -3545,9 +3553,9 @@ ath_key_update_end(struct ieee80211vap *vap)
}
static void
-ath_update_promisc(struct ifnet *ifp)
+ath_update_promisc(struct ieee80211com *ic)
{
- struct ath_softc *sc = ifp->if_softc;
+ struct ath_softc *sc = ic->ic_softc;
u_int32_t rfilt;
/* configure rx filter */
@@ -3609,9 +3617,9 @@ ath_update_mcast_hw(struct ath_softc *sc)
* awake before operating.
*/
static void
-ath_update_mcast(struct ifnet *ifp)
+ath_update_mcast(struct ieee80211com *ic)
{
- struct ath_softc *sc = ifp->if_softc;
+ struct ath_softc *sc = ic->ic_softc;
ATH_LOCK(sc);
ath_power_set_power_state(sc, HAL_PM_AWAKE);
@@ -3695,10 +3703,9 @@ ath_setslottime(struct ath_softc *sc)
* slot time based on the current setting.
*/
static void
-ath_updateslot(struct ifnet *ifp)
+ath_updateslot(struct ieee80211com *ic)
{
- struct ath_softc *sc = ifp->if_softc;
- struct ieee80211com *ic = ifp->if_l2com;
+ struct ath_softc *sc = ic->ic_softc;
/*
* When not coordinating the BSS, change the hardware
@@ -3746,7 +3753,7 @@ ath_reset_proc(void *arg, int pending)
struct ifnet *ifp = sc->sc_ifp;
#if 0
- if_printf(ifp, "%s: resetting\n", __func__);
+ device_printf(sc->sc_dev, "%s: resetting\n", __func__);
#endif
ath_reset(ifp, ATH_RESET_NOLOSS);
}
@@ -3762,15 +3769,15 @@ ath_bstuck_proc(void *arg, int pending)
uint32_t hangs = 0;
if (ath_hal_gethangstate(sc->sc_ah, 0xff, &hangs) && hangs != 0)
- if_printf(ifp, "bb hang detected (0x%x)\n", hangs);
+ device_printf(sc->sc_dev, "bb hang detected (0x%x)\n", hangs);
#ifdef ATH_DEBUG_ALQ
if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_STUCK_BEACON))
if_ath_alq_post(&sc->sc_alq, ATH_ALQ_STUCK_BEACON, 0, NULL);
#endif
- if_printf(ifp, "stuck beacon; resetting (bmiss count %u)\n",
- sc->sc_bmisscount);
+ device_printf(sc->sc_dev, "stuck beacon; resetting (bmiss count %u)\n",
+ sc->sc_bmisscount);
sc->sc_stats.ast_bstuck++;
/*
* This assumes that there's no simultaneous channel mode change
@@ -3802,7 +3809,6 @@ ath_descdma_alloc_desc(struct ath_softc *sc,
((_dd)->dd_desc_paddr + ((caddr_t)(_ds) - (caddr_t)(_dd)->dd_desc))
#define ATH_DESC_4KB_BOUND_CHECK(_daddr, _len) \
((((u_int32_t)(_daddr) & 0xFFF) > (0x1000 - (_len))) ? 1 : 0)
- struct ifnet *ifp = sc->sc_ifp;
int error;
dd->dd_descsize = ds_size;
@@ -3843,7 +3849,8 @@ ath_descdma_alloc_desc(struct ath_softc *sc,
NULL, /* lockarg */
&dd->dd_dmat);
if (error != 0) {
- if_printf(ifp, "cannot allocate %s DMA tag\n", dd->dd_name);
+ device_printf(sc->sc_dev,
+ "cannot allocate %s DMA tag\n", dd->dd_name);
return error;
}
@@ -3852,8 +3859,9 @@ ath_descdma_alloc_desc(struct ath_softc *sc,
BUS_DMA_NOWAIT | BUS_DMA_COHERENT,
&dd->dd_dmamap);
if (error != 0) {
- if_printf(ifp, "unable to alloc memory for %u %s descriptors, "
- "error %u\n", ndesc, dd->dd_name, error);
+ device_printf(sc->sc_dev,
+ "unable to alloc memory for %u %s descriptors, error %u\n",
+ ndesc, dd->dd_name, error);
goto fail1;
}
@@ -3862,8 +3870,9 @@ ath_descdma_alloc_desc(struct ath_softc *sc,
ath_load_cb, &dd->dd_desc_paddr,
BUS_DMA_NOWAIT);
if (error != 0) {
- if_printf(ifp, "unable to map %s descriptors, error %u\n",
- dd->dd_name, error);
+ device_printf(sc->sc_dev,
+ "unable to map %s descriptors, error %u\n",
+ dd->dd_name, error);
goto fail2;
}
@@ -3893,7 +3902,6 @@ ath_descdma_setup(struct ath_softc *sc,
((_dd)->dd_desc_paddr + ((caddr_t)(_ds) - (caddr_t)(_dd)->dd_desc))
#define ATH_DESC_4KB_BOUND_CHECK(_daddr, _len) \
((((u_int32_t)(_daddr) & 0xFFF) > (0x1000 - (_len))) ? 1 : 0)
- struct ifnet *ifp = sc->sc_ifp;
uint8_t *ds;
struct ath_buf *bf;
int i, bsize, error;
@@ -3913,8 +3921,9 @@ ath_descdma_setup(struct ath_softc *sc,
bsize = sizeof(struct ath_buf) * nbuf;
bf = malloc(bsize, M_ATHDEV, M_NOWAIT | M_ZERO);
if (bf == NULL) {
- if_printf(ifp, "malloc of %s buffers failed, size %u\n",
- dd->dd_name, bsize);
+ device_printf(sc->sc_dev,
+ "malloc of %s buffers failed, size %u\n",
+ dd->dd_name, bsize);
goto fail3;
}
dd->dd_bufptr = bf;
@@ -3940,8 +3949,9 @@ ath_descdma_setup(struct ath_softc *sc,
error = bus_dmamap_create(sc->sc_dmat, BUS_DMA_NOWAIT,
&bf->bf_dmamap);
if (error != 0) {
- if_printf(ifp, "unable to create dmamap for %s "
- "buffer %u, error %u\n", dd->dd_name, i, error);
+ device_printf(sc->sc_dev, "unable to create dmamap "
+ "for %s buffer %u, error %u\n",
+ dd->dd_name, i, error);
ath_descdma_cleanup(sc, dd, head);
return error;
}
@@ -3977,7 +3987,6 @@ ath_descdma_setup_rx_edma(struct ath_softc *sc,
struct ath_descdma *dd, ath_bufhead *head,
const char *name, int nbuf, int rx_status_len)
{
- struct ifnet *ifp = sc->sc_ifp;
struct ath_buf *bf;
int i, bsize, error;
@@ -4000,8 +4009,9 @@ ath_descdma_setup_rx_edma(struct ath_softc *sc,
bsize = sizeof(struct ath_buf) * nbuf;
bf = malloc(bsize, M_ATHDEV, M_NOWAIT | M_ZERO);
if (bf == NULL) {
- if_printf(ifp, "malloc of %s buffers failed, size %u\n",
- dd->dd_name, bsize);
+ device_printf(sc->sc_dev,
+ "malloc of %s buffers failed, size %u\n",
+ dd->dd_name, bsize);
error = ENOMEM;
goto fail3;
}
@@ -4016,8 +4026,9 @@ ath_descdma_setup_rx_edma(struct ath_softc *sc,
error = bus_dmamap_create(sc->sc_dmat, BUS_DMA_NOWAIT,
&bf->bf_dmamap);
if (error != 0) {
- if_printf(ifp, "unable to create dmamap for %s "
- "buffer %u, error %u\n", dd->dd_name, i, error);
+ device_printf(sc->sc_dev, "unable to create dmamap "
+ "for %s buffer %u, error %u\n",
+ dd->dd_name, i, error);
ath_descdma_cleanup(sc, dd, head);
return error;
}
@@ -4391,9 +4402,8 @@ ath_txq_update(struct ath_softc *sc, int ac)
qi.tqi_aifs, qi.tqi_cwmin, qi.tqi_cwmax, qi.tqi_burstTime);
if (!ath_hal_settxqueueprops(ah, txq->axq_qnum, &qi)) {
- if_printf(ifp, "unable to update hardware queue "
- "parameters for %s traffic!\n",
- ieee80211_wme_acnames[ac]);
+ device_printf(sc->sc_dev, "unable to update hardware queue "
+ "parameters for %s traffic!\n", ieee80211_wme_acnames[ac]);
return 0;
} else {
ath_hal_resettxqueue(ah, txq->axq_qnum); /* push to h/w */
@@ -5559,7 +5569,7 @@ ath_chan_set(struct ath_softc *sc, struct ieee80211_channel *chan)
ath_hal_setchainmasks(sc->sc_ah, sc->sc_cur_txchainmask,
sc->sc_cur_rxchainmask);
if (!ath_hal_reset(ah, sc->sc_opmode, chan, AH_TRUE, &status)) {
- if_printf(ifp, "%s: unable to reset "
+ device_printf(sc->sc_dev, "%s: unable to reset "
"channel %u (%u MHz, flags 0x%x), hal status %u\n",
__func__, ieee80211_chan2ieee(ic, chan),
chan->ic_freq, chan->ic_flags, status);
@@ -5598,8 +5608,8 @@ ath_chan_set(struct ath_softc *sc, struct ieee80211_channel *chan)
* Re-enable rx framework.
*/
if (ath_startrecv(sc) != 0) {
- if_printf(ifp, "%s: unable to restart recv logic\n",
- __func__);
+ device_printf(sc->sc_dev,
+ "%s: unable to restart recv logic\n", __func__);
ret = EIO;
goto finish;
}
@@ -6374,8 +6384,9 @@ ath_getchannels(struct ath_softc *sc)
status = ath_hal_init_channels(ah, ic->ic_channels, IEEE80211_CHAN_MAX,
&ic->ic_nchans, HAL_MODE_ALL, CTRY_DEFAULT, SKU_NONE, AH_TRUE);
if (status != HAL_OK) {
- if_printf(ifp, "%s: unable to collect channel list from hal, "
- "status %d\n", __func__, status);
+ device_printf(sc->sc_dev,
+ "%s: unable to collect channel list from hal, status %d\n",
+ __func__, status);
return EINVAL;
}
(void) ath_hal_getregdomain(ah, &sc->sc_eerd);
@@ -6537,10 +6548,10 @@ ath_watchdog(void *arg)
if (ath_hal_gethangstate(sc->sc_ah, 0xffff, &hangs) &&
hangs != 0) {
- if_printf(ifp, "%s hang detected (0x%x)\n",
+ device_printf(sc->sc_dev, "%s hang detected (0x%x)\n",
hangs & 0xff ? "bb" : "mac", hangs);
} else
- if_printf(ifp, "device timeout\n");
+ device_printf(sc->sc_dev, "device timeout\n");
do_reset = 1;
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
sc->sc_stats.ast_watchdog++;
@@ -6785,31 +6796,32 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
static void
ath_announce(struct ath_softc *sc)
{
- struct ifnet *ifp = sc->sc_ifp;
struct ath_hal *ah = sc->sc_ah;
- if_printf(ifp, "AR%s mac %d.%d RF%s phy %d.%d\n",
+ device_printf(sc->sc_dev, "AR%s mac %d.%d RF%s phy %d.%d\n",
ath_hal_mac_name(ah), ah->ah_macVersion, ah->ah_macRev,
ath_hal_rf_name(ah), ah->ah_phyRev >> 4, ah->ah_phyRev & 0xf);
- if_printf(ifp, "2GHz radio: 0x%.4x; 5GHz radio: 0x%.4x\n",
+ device_printf(sc->sc_dev, "2GHz radio: 0x%.4x; 5GHz radio: 0x%.4x\n",
ah->ah_analog2GhzRev, ah->ah_analog5GhzRev);
if (bootverbose) {
int i;
for (i = 0; i <= WME_AC_VO; i++) {
struct ath_txq *txq = sc->sc_ac2q[i];
- if_printf(ifp, "Use hw queue %u for %s traffic\n",
- txq->axq_qnum, ieee80211_wme_acnames[i]);
+ device_printf(sc->sc_dev,
+ "Use hw queue %u for %s traffic\n",
+ txq->axq_qnum, ieee80211_wme_acnames[i]);
}
- if_printf(ifp, "Use hw queue %u for CAB traffic\n",
- sc->sc_cabq->axq_qnum);
- if_printf(ifp, "Use hw queue %u for beacons\n", sc->sc_bhalq);
+ device_printf(sc->sc_dev, "Use hw queue %u for CAB traffic\n",
+ sc->sc_cabq->axq_qnum);
+ device_printf(sc->sc_dev, "Use hw queue %u for beacons\n",
+ sc->sc_bhalq);
}
if (ath_rxbuf != ATH_RXBUF)
- if_printf(ifp, "using %u rx buffers\n", ath_rxbuf);
+ device_printf(sc->sc_dev, "using %u rx buffers\n", ath_rxbuf);
if (ath_txbuf != ATH_TXBUF)
- if_printf(ifp, "using %u tx buffers\n", ath_txbuf);
+ device_printf(sc->sc_dev, "using %u tx buffers\n", ath_txbuf);
if (sc->sc_mcastkey && bootverbose)
- if_printf(ifp, "using multicast key search\n");
+ device_printf(sc->sc_dev, "using multicast key search\n");
}
static void
diff --git a/sys/dev/ath/if_ath_rx.c b/sys/dev/ath/if_ath_rx.c
index bed9488..2779b7a 100644
--- a/sys/dev/ath/if_ath_rx.c
+++ b/sys/dev/ath/if_ath_rx.c
@@ -327,7 +327,7 @@ ath_legacy_rxbuf_init(struct ath_softc *sc, struct ath_buf *bf)
*/
void
ath_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m,
- int subtype, int rssi, int nf)
+ int subtype, const struct ieee80211_rx_stats *rxs, int rssi, int nf)
{
struct ieee80211vap *vap = ni->ni_vap;
struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc;
@@ -353,7 +353,7 @@ ath_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m,
* Call up first so subsequent work can use information
* potentially stored in the node (e.g. for ibss merge).
*/
- ATH_VAP(vap)->av_recv_mgmt(ni, m, subtype, rssi, nf);
+ ATH_VAP(vap)->av_recv_mgmt(ni, m, subtype, rxs, rssi, nf);
switch (subtype) {
case IEEE80211_FC0_SUBTYPE_BEACON:
/* update rssi statistics for use by the hal */
@@ -1037,7 +1037,7 @@ ath_rx_proc(struct ath_softc *sc, int resched)
bf = TAILQ_FIRST(&sc->sc_rxbuf);
if (sc->sc_rxslink && bf == NULL) { /* NB: shouldn't happen */
- if_printf(ifp, "%s: no buffer!\n", __func__);
+ device_printf(sc->sc_dev, "%s: no buffer!\n", __func__);
break;
} else if (bf == NULL) {
/*
@@ -1054,7 +1054,7 @@ ath_rx_proc(struct ath_softc *sc, int resched)
* will be no mbuf; try again to re-populate it.
*/
/* XXX make debug msg */
- if_printf(ifp, "%s: no mbuf!\n", __func__);
+ device_printf(sc->sc_dev, "%s: no mbuf!\n", __func__);
TAILQ_REMOVE(&sc->sc_rxbuf, bf, bf_list);
goto rx_proc_next;
}
diff --git a/sys/dev/ath/if_ath_rx.h b/sys/dev/ath/if_ath_rx.h
index f831148..62be699 100644
--- a/sys/dev/ath/if_ath_rx.h
+++ b/sys/dev/ath/if_ath_rx.h
@@ -33,7 +33,8 @@
extern u_int32_t ath_calcrxfilter(struct ath_softc *sc);
extern void ath_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m,
- int subtype, int rssi, int nf);
+ int subtype, const struct ieee80211_rx_stats *rxs,
+ int rssi, int nf);
#define ath_stoprecv(_sc, _dodelay) \
(_sc)->sc_rx.recv_stop((_sc), (_dodelay))
diff --git a/sys/dev/ath/if_ath_tdma.c b/sys/dev/ath/if_ath_tdma.c
index de1a91c..fd23db1 100644
--- a/sys/dev/ath/if_ath_tdma.c
+++ b/sys/dev/ath/if_ath_tdma.c
@@ -259,7 +259,7 @@ ath_tdma_config(struct ath_softc *sc, struct ieee80211vap *vap)
if (vap == NULL) {
vap = TAILQ_FIRST(&ic->ic_vaps); /* XXX */
if (vap == NULL) {
- if_printf(ifp, "%s: no vaps?\n", __func__);
+ device_printf(sc->sc_dev, "%s: no vaps?\n", __func__);
return;
}
}
diff --git a/sys/dev/ath/if_ath_tx.c b/sys/dev/ath/if_ath_tx.c
index 096278e..c15b158 100644
--- a/sys/dev/ath/if_ath_tx.c
+++ b/sys/dev/ath/if_ath_tx.c
@@ -1691,8 +1691,8 @@ ath_tx_normal_setup(struct ath_softc *sc, struct ieee80211_node *ni,
flags |= HAL_TXDESC_NOACK;
break;
default:
- if_printf(ifp, "bogus frame type 0x%x (%s)\n",
- wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK, __func__);
+ device_printf(sc->sc_dev, "bogus frame type 0x%x (%s)\n",
+ wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK, __func__);
/* XXX statistic */
/* XXX free tx dmamap */
ath_freetx(m0);
diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h
index e888ca2..5c5e6cd 100644
--- a/sys/dev/ath/if_athvar.h
+++ b/sys/dev/ath/if_athvar.h
@@ -481,7 +481,8 @@ struct ath_vap {
struct ath_txq av_mcastq; /* buffered mcast s/w queue */
void (*av_recv_mgmt)(struct ieee80211_node *,
- struct mbuf *, int, int, int);
+ struct mbuf *, int,
+ const struct ieee80211_rx_stats *, int, int);
int (*av_newstate)(struct ieee80211vap *,
enum ieee80211_state, int);
void (*av_bmiss)(struct ieee80211vap *);
diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c
index 7f3f97d..7ef32a4 100644
--- a/sys/dev/atkbdc/psm.c
+++ b/sys/dev/atkbdc/psm.c
@@ -462,7 +462,8 @@ static int tame_mouse(struct psm_softc *, packetbuf_t *, mousestatus_t *,
u_char *);
/* vendor specific features */
-typedef int probefunc_t(KBDC, struct psm_softc *);
+enum probearg { PROBE, REINIT };
+typedef int probefunc_t(struct psm_softc *, enum probearg);
static int mouse_id_proc1(KBDC, int, int, int *);
static int mouse_ext_command(KBDC, int);
@@ -882,7 +883,7 @@ doinitialize(struct psm_softc *sc, mousemode_t *mode)
/* Re-enable the mouse. */
for (i = 0; vendortype[i].probefunc != NULL; ++i)
if (vendortype[i].model == sc->hw.model)
- (*vendortype[i].probefunc)(sc->kbdc, NULL);
+ (*vendortype[i].probefunc)(sc, REINIT);
/* set mouse parameters */
if (mode != (mousemode_t *)NULL) {
@@ -893,13 +894,6 @@ doinitialize(struct psm_softc *sc, mousemode_t *mode)
set_mouse_resolution(kbdc, mode->resolution);
set_mouse_scaling(kbdc, 1);
set_mouse_mode(kbdc);
-
- /*
- * Trackpoint settings are lost on resume.
- * Restore them here.
- */
- if (sc->tphw > 0)
- set_trackpoint_parameters(sc);
}
/* Record sync on the next data packet we see. */
@@ -1388,7 +1382,7 @@ psmprobe(device_t dev)
/* other parameters */
for (i = 0; vendortype[i].probefunc != NULL; ++i)
- if ((*vendortype[i].probefunc)(sc->kbdc, sc)) {
+ if ((*vendortype[i].probefunc)(sc, PROBE)) {
if (verbose >= 2)
printf("psm%d: found %s\n", unit,
model_name(vendortype[i].model));
@@ -3731,8 +3725,9 @@ mouse_ext_command(KBDC kbdc, int command)
#ifdef notyet
/* Logitech MouseMan Cordless II */
static int
-enable_lcordless(KDBC kbdc, struct psm_softc *sc)
+enable_lcordless(struct psm_softc *sc, enum probearg arg)
{
+ KBDC kbdc = sc->kbdc;
int status[3];
int ch;
@@ -3753,8 +3748,9 @@ enable_lcordless(KDBC kbdc, struct psm_softc *sc)
/* Genius NetScroll Mouse, MouseSystems SmartScroll Mouse */
static int
-enable_groller(KBDC kbdc, struct psm_softc *sc)
+enable_groller(struct psm_softc *sc, enum probearg arg)
{
+ KBDC kbdc = sc->kbdc;
int status[3];
/*
@@ -3783,15 +3779,16 @@ enable_groller(KBDC kbdc, struct psm_softc *sc)
if ((status[1] != '3') || (status[2] != 'D'))
return (FALSE);
/* FIXME: SmartScroll Mouse has 5 buttons! XXX */
- if (sc != NULL)
+ if (arg == PROBE)
sc->hw.buttons = 4;
return (TRUE);
}
/* Genius NetMouse/NetMouse Pro, ASCII Mie Mouse, NetScroll Optical */
static int
-enable_gmouse(KBDC kbdc, struct psm_softc *sc)
+enable_gmouse(struct psm_softc *sc, enum probearg arg)
{
+ KBDC kbdc = sc->kbdc;
int status[3];
/*
@@ -3813,8 +3810,9 @@ enable_gmouse(KBDC kbdc, struct psm_softc *sc)
/* ALPS GlidePoint */
static int
-enable_aglide(KBDC kbdc, struct psm_softc *sc)
+enable_aglide(struct psm_softc *sc, enum probearg arg)
{
+ KBDC kbdc = sc->kbdc;
int status[3];
/*
@@ -3835,9 +3833,10 @@ enable_aglide(KBDC kbdc, struct psm_softc *sc)
/* Kensington ThinkingMouse/Trackball */
static int
-enable_kmouse(KBDC kbdc, struct psm_softc *sc)
+enable_kmouse(struct psm_softc *sc, enum probearg arg)
{
static u_char rate[] = { 20, 60, 40, 20, 20, 60, 40, 20, 20 };
+ KBDC kbdc = sc->kbdc;
int status[3];
int id1;
int id2;
@@ -3888,8 +3887,9 @@ enable_kmouse(KBDC kbdc, struct psm_softc *sc)
/* Logitech MouseMan+/FirstMouse+, IBM ScrollPoint Mouse */
static int
-enable_mmanplus(KBDC kbdc, struct psm_softc *sc)
+enable_mmanplus(struct psm_softc *sc, enum probearg arg)
{
+ KBDC kbdc = sc->kbdc;
int data[3];
/* the special sequence to enable the fourth button and the roller. */
@@ -3930,7 +3930,7 @@ enable_mmanplus(KBDC kbdc, struct psm_softc *sc)
if (MOUSE_PS2PLUS_PACKET_TYPE(data) != 0)
return (FALSE);
- if (sc != NULL) {
+ if (arg == PROBE) {
sc->hw.hwid &= 0x00ff;
sc->hw.hwid |= data[2] << 8; /* save model ID */
}
@@ -3946,8 +3946,9 @@ enable_mmanplus(KBDC kbdc, struct psm_softc *sc)
/* MS IntelliMouse Explorer */
static int
-enable_msexplorer(KBDC kbdc, struct psm_softc *sc)
+enable_msexplorer(struct psm_softc *sc, enum probearg arg)
{
+ KBDC kbdc = sc->kbdc;
static u_char rate0[] = { 200, 100, 80, };
static u_char rate1[] = { 200, 200, 80, };
int id;
@@ -3958,7 +3959,7 @@ enable_msexplorer(KBDC kbdc, struct psm_softc *sc)
* straight to Explorer mode, but need to be set to Intelli mode
* first.
*/
- enable_msintelli(kbdc, sc);
+ enable_msintelli(sc, arg);
/* the special sequence to enable the extra buttons and the roller. */
for (i = 0; i < sizeof(rate1)/sizeof(rate1[0]); ++i)
@@ -3969,7 +3970,7 @@ enable_msexplorer(KBDC kbdc, struct psm_softc *sc)
if (id != PSM_EXPLORER_ID)
return (FALSE);
- if (sc != NULL) {
+ if (arg == PROBE) {
sc->hw.buttons = 5; /* IntelliMouse Explorer XXX */
sc->hw.hwid = id;
}
@@ -3992,15 +3993,15 @@ enable_msexplorer(KBDC kbdc, struct psm_softc *sc)
return (TRUE);
}
-/* MS IntelliMouse */
+/*
+ * MS IntelliMouse
+ * Logitech MouseMan+ and FirstMouse+ will also respond to this
+ * probe routine and act like IntelliMouse.
+ */
static int
-enable_msintelli(KBDC kbdc, struct psm_softc *sc)
+enable_msintelli(struct psm_softc *sc, enum probearg arg)
{
- /*
- * Logitech MouseMan+ and FirstMouse+ will also respond to this
- * probe routine and act like IntelliMouse.
- */
-
+ KBDC kbdc = sc->kbdc;
static u_char rate[] = { 200, 100, 80, };
int id;
int i;
@@ -4014,7 +4015,7 @@ enable_msintelli(KBDC kbdc, struct psm_softc *sc)
if (id != PSM_INTELLI_ID)
return (FALSE);
- if (sc != NULL) {
+ if (arg == PROBE) {
sc->hw.buttons = 3;
sc->hw.hwid = id;
}
@@ -4022,15 +4023,15 @@ enable_msintelli(KBDC kbdc, struct psm_softc *sc)
return (TRUE);
}
-/* A4 Tech 4D Mouse */
+/*
+ * A4 Tech 4D Mouse
+ * Newer wheel mice from A4 Tech may use the 4D+ protocol.
+ */
static int
-enable_4dmouse(KBDC kbdc, struct psm_softc *sc)
+enable_4dmouse(struct psm_softc *sc, enum probearg arg)
{
- /*
- * Newer wheel mice from A4 Tech may use the 4D+ protocol.
- */
-
static u_char rate[] = { 200, 100, 80, 60, 40, 20 };
+ KBDC kbdc = sc->kbdc;
int id;
int i;
@@ -4046,7 +4047,7 @@ enable_4dmouse(KBDC kbdc, struct psm_softc *sc)
if (id != PSM_4DMOUSE_ID)
return (FALSE);
- if (sc != NULL) {
+ if (arg == PROBE) {
sc->hw.buttons = 3; /* XXX some 4D mice have 4? */
sc->hw.hwid = id;
}
@@ -4054,14 +4055,15 @@ enable_4dmouse(KBDC kbdc, struct psm_softc *sc)
return (TRUE);
}
-/* A4 Tech 4D+ Mouse */
+/*
+ * A4 Tech 4D+ Mouse
+ * Newer wheel mice from A4 Tech seem to use this protocol.
+ * Older models are recognized as either 4D Mouse or IntelliMouse.
+ */
static int
-enable_4dplus(KBDC kbdc, struct psm_softc *sc)
+enable_4dplus(struct psm_softc *sc, enum probearg arg)
{
- /*
- * Newer wheel mice from A4 Tech seem to use this protocol.
- * Older models are recognized as either 4D Mouse or IntelliMouse.
- */
+ KBDC kbdc = sc->kbdc;
int id;
/*
@@ -4084,7 +4086,7 @@ enable_4dplus(KBDC kbdc, struct psm_softc *sc)
return (FALSE);
}
- if (sc != NULL) {
+ if (arg == PROBE) {
sc->hw.buttons = (id == PSM_4DPLUS_ID) ? 4 : 3;
sc->hw.hwid = id;
}
@@ -4543,8 +4545,9 @@ synaptics_set_mode(struct psm_softc *sc, int mode_byte) {
}
static int
-enable_synaptics(KBDC kbdc, struct psm_softc *sc)
+enable_synaptics(struct psm_softc *sc, enum probearg arg)
{
+ KBDC kbdc = sc->kbdc;
synapticshw_t synhw;
int status[3];
int buttons;
@@ -4828,20 +4831,22 @@ enable_synaptics(KBDC kbdc, struct psm_softc *sc)
return (FALSE);
}
- if (sc != NULL)
+ if (arg == PROBE)
sc->synhw = synhw;
if (!synaptics_support)
return (FALSE);
+ synaptics_set_mode(sc, synaptics_preferred_mode(sc));
+
+ if (trackpoint_support && synhw.capPassthrough) {
+ synaptics_passthrough_on(sc);
+ enable_trackpoint(sc, arg);
+ synaptics_passthrough_off(sc);
+ }
+
VLOG(3, (LOG_DEBUG, "synaptics: END init (%d buttons)\n", buttons));
- if (sc != NULL) {
- synaptics_set_mode(sc, synaptics_preferred_mode(sc));
- if (trackpoint_support && synhw.capPassthrough) {
- synaptics_passthrough_on(sc);
- enable_trackpoint(kbdc, sc);
- synaptics_passthrough_off(sc);
- }
+ if (arg == PROBE) {
/* Create sysctl tree. */
synaptics_sysctl_create_tree(sc);
sc->hw.buttons = buttons;
@@ -5086,8 +5091,9 @@ set_trackpoint_parameters(struct psm_softc *sc)
}
static int
-enable_trackpoint(KBDC kbdc, struct psm_softc *sc)
+enable_trackpoint(struct psm_softc *sc, enum probearg arg)
{
+ KBDC kbdc = sc->kbdc;
int id;
if (send_aux_command(kbdc, 0xe1) != PSM_ACK ||
@@ -5101,10 +5107,8 @@ enable_trackpoint(KBDC kbdc, struct psm_softc *sc)
if (!trackpoint_support)
return (FALSE);
- if (sc != NULL) {
- /* Create sysctl tree. */
+ if (arg == PROBE) {
trackpoint_sysctl_create_tree(sc);
-
/*
* Don't overwrite hwid and buttons when we are
* a guest device.
@@ -5115,13 +5119,16 @@ enable_trackpoint(KBDC kbdc, struct psm_softc *sc)
}
}
+ set_trackpoint_parameters(sc);
+
return (TRUE);
}
/* Interlink electronics VersaPad */
static int
-enable_versapad(KBDC kbdc, struct psm_softc *sc)
+enable_versapad(struct psm_softc *sc, enum probearg arg)
{
+ KBDC kbdc = sc->kbdc;
int data[3];
set_mouse_resolution(kbdc, PSMD_RES_MEDIUM_HIGH); /* set res. 2 */
diff --git a/sys/dev/bwi/bwimac.c b/sys/dev/bwi/bwimac.c
index 849bf02..f39ef44 100644
--- a/sys/dev/bwi/bwimac.c
+++ b/sys/dev/bwi/bwimac.c
@@ -101,7 +101,6 @@ static void bwi_mac_opmode_init(struct bwi_mac *);
static void bwi_mac_hostflags_init(struct bwi_mac *);
static void bwi_mac_bss_param_init(struct bwi_mac *);
-static int bwi_mac_fw_alloc(struct bwi_mac *);
static void bwi_mac_fw_free(struct bwi_mac *);
static int bwi_mac_fw_load(struct bwi_mac *);
static int bwi_mac_fw_init(struct bwi_mac *);
@@ -325,10 +324,6 @@ bwi_mac_init(struct bwi_mac *mac)
/*
* Load and initialize firmwares
*/
- error = bwi_mac_fw_alloc(mac);
- if (error)
- return error;
-
error = bwi_mac_fw_load(mac);
if (error)
return error;
@@ -879,11 +874,10 @@ bwi_fwimage_is_valid(struct bwi_softc *sc, const struct firmware *fw,
/*
* XXX Error cleanup
*/
-static int
+int
bwi_mac_fw_alloc(struct bwi_mac *mac)
{
struct bwi_softc *sc = mac->mac_sc;
- struct ifnet *ifp = sc->sc_ifp;
char fwname[64];
int idx;
@@ -895,10 +889,8 @@ bwi_mac_fw_alloc(struct bwi_mac *mac)
snprintf(fwname, sizeof(fwname), BWI_FW_STUB_PATH,
sc->sc_fw_version);
mac->mac_stub = firmware_get(fwname);
- if (mac->mac_stub == NULL) {
- if_printf(ifp, "request firmware %s failed\n", fwname);
- return ENOMEM;
- }
+ if (mac->mac_stub == NULL)
+ goto no_firmware;
}
if (mac->mac_ucode == NULL) {
@@ -907,11 +899,8 @@ bwi_mac_fw_alloc(struct bwi_mac *mac)
mac->mac_rev >= 5 ? 5 : mac->mac_rev);
mac->mac_ucode = firmware_get(fwname);
- if (mac->mac_ucode == NULL) {
- if_printf(ifp, "request firmware %s failed\n", fwname);
- return ENOMEM;
- }
-
+ if (mac->mac_ucode == NULL)
+ goto no_firmware;
if (!bwi_fwimage_is_valid(sc, mac->mac_ucode, BWI_FW_T_UCODE))
return EINVAL;
}
@@ -922,11 +911,8 @@ bwi_mac_fw_alloc(struct bwi_mac *mac)
mac->mac_rev < 5 ? 4 : 5);
mac->mac_pcm = firmware_get(fwname);
- if (mac->mac_pcm == NULL) {
- if_printf(ifp, "request firmware %s failed\n", fwname);
- return ENOMEM;
- }
-
+ if (mac->mac_pcm == NULL)
+ goto no_firmware;
if (!bwi_fwimage_is_valid(sc, mac->mac_pcm, BWI_FW_T_PCM))
return EINVAL;
}
@@ -938,8 +924,8 @@ bwi_mac_fw_alloc(struct bwi_mac *mac)
} else if (mac->mac_rev >= 5 && mac->mac_rev <= 10) {
idx = 5;
} else {
- if_printf(ifp, "no suitible IV for MAC rev %d\n",
- mac->mac_rev);
+ device_printf(sc->sc_dev,
+ "no suitible IV for MAC rev %d\n", mac->mac_rev);
return ENODEV;
}
@@ -947,10 +933,8 @@ bwi_mac_fw_alloc(struct bwi_mac *mac)
sc->sc_fw_version, idx);
mac->mac_iv = firmware_get(fwname);
- if (mac->mac_iv == NULL) {
- if_printf(ifp, "request firmware %s failed\n", fwname);
- return ENOMEM;
- }
+ if (mac->mac_iv == NULL)
+ goto no_firmware;
if (!bwi_fwimage_is_valid(sc, mac->mac_iv, BWI_FW_T_IV))
return EINVAL;
}
@@ -960,12 +944,12 @@ bwi_mac_fw_alloc(struct bwi_mac *mac)
if (mac->mac_rev == 2 || mac->mac_rev == 4 ||
mac->mac_rev >= 11) {
/* No extended IV */
- goto back;
+ return (0);
} else if (mac->mac_rev >= 5 && mac->mac_rev <= 10) {
idx = 5;
} else {
- if_printf(ifp, "no suitible ExtIV for MAC rev %d\n",
- mac->mac_rev);
+ device_printf(sc->sc_dev,
+ "no suitible ExtIV for MAC rev %d\n", mac->mac_rev);
return ENODEV;
}
@@ -973,15 +957,16 @@ bwi_mac_fw_alloc(struct bwi_mac *mac)
sc->sc_fw_version, idx);
mac->mac_iv_ext = firmware_get(fwname);
- if (mac->mac_iv_ext == NULL) {
- if_printf(ifp, "request firmware %s failed\n", fwname);
- return ENOMEM;
- }
+ if (mac->mac_iv_ext == NULL)
+ goto no_firmware;
if (!bwi_fwimage_is_valid(sc, mac->mac_iv_ext, BWI_FW_T_IV))
return EINVAL;
}
-back:
- return 0;
+ return (0);
+
+no_firmware:
+ device_printf(sc->sc_dev, "request firmware %s failed\n", fwname);
+ return (ENOENT);
}
static void
diff --git a/sys/dev/bwi/bwimac.h b/sys/dev/bwi/bwimac.h
index 2c5275e..a6d9008 100644
--- a/sys/dev/bwi/bwimac.h
+++ b/sys/dev/bwi/bwimac.h
@@ -57,6 +57,7 @@ void bwi_mac_init_tpctl_11bg(struct bwi_mac *);
void bwi_mac_dummy_xmit(struct bwi_mac *);
void bwi_mac_reset_hwkeys(struct bwi_mac *);
int bwi_mac_config_ps(struct bwi_mac *);
+int bwi_mac_fw_alloc(struct bwi_mac *);
uint16_t bwi_memobj_read_2(struct bwi_mac *, uint16_t, uint16_t);
uint32_t bwi_memobj_read_4(struct bwi_mac *, uint16_t, uint16_t);
diff --git a/sys/dev/bwi/if_bwi.c b/sys/dev/bwi/if_bwi.c
index aa5369a..ad41bc6 100644
--- a/sys/dev/bwi/if_bwi.c
+++ b/sys/dev/bwi/if_bwi.c
@@ -113,7 +113,7 @@ static void bwi_scan_start(struct ieee80211com *);
static void bwi_set_channel(struct ieee80211com *);
static void bwi_scan_end(struct ieee80211com *);
static int bwi_newstate(struct ieee80211vap *, enum ieee80211_state, int);
-static void bwi_updateslot(struct ifnet *);
+static void bwi_updateslot(struct ieee80211com *);
static int bwi_media_change(struct ifnet *);
static void bwi_calibrate(void *);
@@ -446,6 +446,10 @@ bwi_attach(struct bwi_softc *sc)
if (error)
goto fail;
+ error = bwi_mac_fw_alloc(mac);
+ if (error)
+ goto fail;
+
ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211);
if (ifp == NULL) {
device_printf(dev, "can not if_alloc()\n");
@@ -507,6 +511,8 @@ bwi_attach(struct bwi_softc *sc)
ieee80211_init_channels(ic, NULL, &bands);
ic->ic_ifp = ifp;
+ ic->ic_softc = sc;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_caps = IEEE80211_C_STA |
IEEE80211_C_SHSLOT |
IEEE80211_C_SHPREAMBLE |
@@ -1919,7 +1925,7 @@ bwi_dma_alloc(struct bwi_softc *sc)
BUS_SPACE_MAXSIZE, /* maxsize */
BUS_SPACE_UNRESTRICTED, /* nsegments */
BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */
- BUS_DMA_ALLOCNOW, /* flags */
+ 0, /* flags */
NULL, NULL, /* lockfunc, lockarg */
&sc->sc_parent_dtag);
if (error) {
@@ -1939,8 +1945,8 @@ bwi_dma_alloc(struct bwi_softc *sc)
NULL, NULL,
tx_ring_sz,
1,
- BUS_SPACE_MAXSIZE_32BIT,
- BUS_DMA_ALLOCNOW,
+ tx_ring_sz,
+ 0,
NULL, NULL,
&sc->sc_txring_dtag);
if (error) {
@@ -1969,8 +1975,8 @@ bwi_dma_alloc(struct bwi_softc *sc)
NULL, NULL,
rx_ring_sz,
1,
- BUS_SPACE_MAXSIZE_32BIT,
- BUS_DMA_ALLOCNOW,
+ rx_ring_sz,
+ 0,
NULL, NULL,
&sc->sc_rxring_dtag);
if (error) {
@@ -2094,8 +2100,8 @@ bwi_dma_txstats_alloc(struct bwi_softc *sc, uint32_t ctrl_base,
NULL, NULL,
dma_size,
1,
- BUS_SPACE_MAXSIZE_32BIT,
- BUS_DMA_ALLOCNOW,
+ dma_size,
+ 0,
NULL, NULL,
&st->stats_ring_dtag);
if (error) {
@@ -2142,8 +2148,8 @@ bwi_dma_txstats_alloc(struct bwi_softc *sc, uint32_t ctrl_base,
NULL, NULL,
dma_size,
1,
- BUS_SPACE_MAXSIZE_32BIT,
- BUS_DMA_ALLOCNOW,
+ dma_size,
+ 0,
NULL, NULL,
&st->stats_dtag);
if (error) {
@@ -2225,7 +2231,7 @@ bwi_dma_mbuf_create(struct bwi_softc *sc)
NULL, NULL,
MCLBYTES,
1,
- BUS_SPACE_MAXSIZE_32BIT,
+ MCLBYTES,
BUS_DMA_ALLOCNOW,
NULL, NULL,
&sc->sc_buf_dtag);
@@ -3733,14 +3739,13 @@ bwi_set_bssid(struct bwi_softc *sc, const uint8_t *bssid)
}
static void
-bwi_updateslot(struct ifnet *ifp)
+bwi_updateslot(struct ieee80211com *ic)
{
- struct bwi_softc *sc = ifp->if_softc;
- struct ieee80211com *ic = ifp->if_l2com;
+ struct bwi_softc *sc = ic->ic_softc;
struct bwi_mac *mac;
BWI_LOCK(sc);
- if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
+ if (ic->ic_ifp->if_drv_flags & IFF_DRV_RUNNING) {
DPRINTF(sc, BWI_DBG_80211, "%s\n", __func__);
KASSERT(sc->sc_cur_regwin->rw_type == BWI_REGWIN_T_MAC,
diff --git a/sys/dev/bwi/if_bwi_pci.c b/sys/dev/bwi/if_bwi_pci.c
index 1977b93..c2badc5 100644
--- a/sys/dev/bwi/if_bwi_pci.c
+++ b/sys/dev/bwi/if_bwi_pci.c
@@ -161,12 +161,6 @@ bwi_pci_attach(device_t dev)
device_printf(dev, "could not map interrupt\n");
goto bad1;
}
- if (bus_setup_intr(dev, sc->sc_irq_res,
- INTR_TYPE_NET | INTR_MPSAFE,
- NULL, bwi_intr, sc, &sc->sc_irq_handle)) {
- device_printf(dev, "could not establish interrupt\n");
- goto bad2;
- }
/* Get more PCI information */
sc->sc_pci_did = pci_get_device(dev);
@@ -174,11 +168,17 @@ bwi_pci_attach(device_t dev)
sc->sc_pci_subvid = pci_get_subvendor(dev);
sc->sc_pci_subdid = pci_get_subdevice(dev);
- error = bwi_attach(sc);
- if (error == 0) /* success */
- return 0;
+ if ((error = bwi_attach(sc)) != 0)
+ goto bad2;
+
+ if (bus_setup_intr(dev, sc->sc_irq_res,
+ INTR_TYPE_NET | INTR_MPSAFE,
+ NULL, bwi_intr, sc, &sc->sc_irq_handle)) {
+ device_printf(dev, "could not establish interrupt\n");
+ goto bad2;
+ }
+ return (0);
- bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_irq_handle);
bad2:
bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res);
bad1:
diff --git a/sys/dev/bwn/if_bwn.c b/sys/dev/bwn/if_bwn.c
index 959d1f1..823908a 100644
--- a/sys/dev/bwn/if_bwn.c
+++ b/sys/dev/bwn/if_bwn.c
@@ -181,8 +181,8 @@ static void bwn_addchannels(struct ieee80211_channel [], int, int *,
const struct bwn_channelinfo *, int);
static int bwn_raw_xmit(struct ieee80211_node *, struct mbuf *,
const struct ieee80211_bpf_params *);
-static void bwn_updateslot(struct ifnet *);
-static void bwn_update_promisc(struct ifnet *);
+static void bwn_updateslot(struct ieee80211com *);
+static void bwn_update_promisc(struct ieee80211com *);
static void bwn_wme_init(struct bwn_mac *);
static int bwn_wme_update(struct ieee80211com *);
static void bwn_wme_clear(struct bwn_softc *);
@@ -1058,6 +1058,8 @@ bwn_attach_post(struct bwn_softc *sc)
ic = ifp->if_l2com;
ic->ic_ifp = ifp;
+ ic->ic_softc = sc;
+ ic->ic_name = device_get_nameunit(sc->sc_dev);
/* XXX not right but it's not used anywhere important */
ic->ic_phytype = IEEE80211_T_OFDM;
ic->ic_opmode = IEEE80211_M_STA;
@@ -1250,7 +1252,7 @@ bwn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
case SIOCSIFFLAGS:
startall = 0;
if (IS_RUNNING(ifp)) {
- bwn_update_promisc(ifp);
+ bwn_update_promisc(ic);
} else if (ifp->if_flags & IFF_UP) {
if ((sc->sc_flags & BWN_FLAG_INVALID) == 0) {
bwn_init(sc);
@@ -2770,14 +2772,13 @@ bwn_raw_xmit(struct ieee80211_node *ni, struct mbuf *m,
* like slot time and preamble.
*/
static void
-bwn_updateslot(struct ifnet *ifp)
+bwn_updateslot(struct ieee80211com *ic)
{
- struct bwn_softc *sc = ifp->if_softc;
- struct ieee80211com *ic = ifp->if_l2com;
+ struct bwn_softc *sc = ic->ic_softc;
struct bwn_mac *mac;
BWN_LOCK(sc);
- if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
+ if (ic->ic_ifp->if_drv_flags & IFF_DRV_RUNNING) {
mac = (struct bwn_mac *)sc->sc_curmac;
bwn_set_slot_time(mac,
(ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20);
@@ -2793,15 +2794,15 @@ bwn_updateslot(struct ifnet *ifp)
* mode when operating in hostap mode to do ACS).
*/
static void
-bwn_update_promisc(struct ifnet *ifp)
+bwn_update_promisc(struct ieee80211com *ic)
{
- struct bwn_softc *sc = ifp->if_softc;
+ struct bwn_softc *sc = ic->ic_softc;
struct bwn_mac *mac = sc->sc_curmac;
BWN_LOCK(sc);
mac = sc->sc_curmac;
if (mac != NULL && mac->mac_status >= BWN_MAC_STATUS_INITED) {
- if (ifp->if_flags & IFF_PROMISC)
+ if (ic->ic_ifp->if_flags & IFF_PROMISC)
sc->sc_filters |= BWN_MACCTL_PROMISC;
else
sc->sc_filters &= ~BWN_MACCTL_PROMISC;
diff --git a/sys/dev/bxe/bxe.c b/sys/dev/bxe/bxe.c
index 00e367a..f274016 100644
--- a/sys/dev/bxe/bxe.c
+++ b/sys/dev/bxe/bxe.c
@@ -726,7 +726,6 @@ static __noinline int bxe_nic_unload(struct bxe_softc *sc,
uint8_t keep_link);
static void bxe_handle_sp_tq(void *context, int pending);
-static void bxe_handle_rx_mode_tq(void *context, int pending);
static void bxe_handle_fp_tq(void *context, int pending);
@@ -1174,7 +1173,17 @@ bxe_release_hw_lock(struct bxe_softc *sc,
REG_WR(sc, hw_lock_control_reg, resource_bit);
return (0);
}
+static void bxe_acquire_phy_lock(struct bxe_softc *sc)
+{
+ BXE_PHY_LOCK(sc);
+ bxe_acquire_hw_lock(sc,HW_LOCK_RESOURCE_MDIO);
+}
+static void bxe_release_phy_lock(struct bxe_softc *sc)
+{
+ bxe_release_hw_lock(sc,HW_LOCK_RESOURCE_MDIO);
+ BXE_PHY_UNLOCK(sc);
+}
/*
* Per pf misc lock must be acquired before the per port mcp lock. Otherwise,
* had we done things the other way around, if two pfs from the same port
@@ -4764,28 +4773,6 @@ bxe_handle_chip_tq(void *context,
switch (work)
{
- case CHIP_TQ_START:
- if ((if_getflags(sc->ifp) & IFF_UP) &&
- !(if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING)) {
- /* start the interface */
- BLOGD(sc, DBG_LOAD, "Starting the interface...\n");
- BXE_CORE_LOCK(sc);
- bxe_init_locked(sc);
- BXE_CORE_UNLOCK(sc);
- }
- break;
-
- case CHIP_TQ_STOP:
- if (!(if_getflags(sc->ifp) & IFF_UP) &&
- (if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING)) {
- /* bring down the interface */
- BLOGD(sc, DBG_LOAD, "Stopping the interface...\n");
- bxe_periodic_stop(sc);
- BXE_CORE_LOCK(sc);
- bxe_stop_locked(sc);
- BXE_CORE_UNLOCK(sc);
- }
- break;
case CHIP_TQ_REINIT:
if (if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING) {
@@ -4859,21 +4846,22 @@ bxe_ioctl(if_t ifp,
/* toggle the interface state up or down */
BLOGD(sc, DBG_IOCTL, "Received SIOCSIFFLAGS ioctl\n");
+ BXE_CORE_LOCK(sc);
/* check if the interface is up */
if (if_getflags(ifp) & IFF_UP) {
if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
/* set the receive mode flags */
bxe_set_rx_mode(sc);
} else {
- atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_START);
- taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task);
+ bxe_init_locked(sc);
}
} else {
if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
- atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_STOP);
- taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task);
+ bxe_periodic_stop(sc);
+ bxe_stop_locked(sc);
}
}
+ BXE_CORE_UNLOCK(sc);
break;
@@ -4885,7 +4873,9 @@ bxe_ioctl(if_t ifp,
/* check if the interface is up */
if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
/* set the receive mode flags */
+ BXE_CORE_LOCK(sc);
bxe_set_rx_mode(sc);
+ BXE_CORE_UNLOCK(sc);
}
break;
@@ -5044,8 +5034,11 @@ bxe_ioctl(if_t ifp,
if (reinit && (if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING)) {
BLOGD(sc, DBG_LOAD | DBG_IOCTL,
"Re-initializing hardware from IOCTL change\n");
- atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT);
- taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task);
+ bxe_periodic_stop(sc);
+ BXE_CORE_LOCK(sc);
+ bxe_stop_locked(sc);
+ bxe_init_locked(sc);
+ BXE_CORE_UNLOCK(sc);
}
return (error);
@@ -7487,8 +7480,7 @@ bxe_attn_int_asserted(struct bxe_softc *sc,
if (asserted & ATTN_HARD_WIRED_MASK) {
if (asserted & ATTN_NIG_FOR_FUNC) {
- BXE_PHY_LOCK(sc);
-
+ bxe_acquire_phy_lock(sc);
/* save nig interrupt mask */
nig_mask = REG_RD(sc, nig_int_mask_addr);
@@ -7581,7 +7573,7 @@ bxe_attn_int_asserted(struct bxe_softc *sc,
REG_WR(sc, nig_int_mask_addr, nig_mask);
- BXE_PHY_UNLOCK(sc);
+ bxe_release_phy_lock(sc);
}
}
@@ -8339,10 +8331,10 @@ bxe_attn_int_deasserted3(struct bxe_softc *sc,
if (sc->link_vars.periodic_flags &
ELINK_PERIODIC_FLAGS_LINK_EVENT) {
/* sync with link */
- BXE_PHY_LOCK(sc);
+ bxe_acquire_phy_lock(sc);
sc->link_vars.periodic_flags &=
~ELINK_PERIODIC_FLAGS_LINK_EVENT;
- BXE_PHY_UNLOCK(sc);
+ bxe_release_phy_lock(sc);
if (IS_MF(sc))
; // XXX bxe_link_sync_notify(sc);
bxe_link_report(sc);
@@ -8535,9 +8527,9 @@ bxe_attn_int_deasserted0(struct bxe_softc *sc,
}
if ((attn & sc->link_vars.aeu_int_mask) && sc->port.pmf) {
- BXE_PHY_LOCK(sc);
+ bxe_acquire_phy_lock(sc);
elink_handle_module_detect_int(&sc->link_params);
- BXE_PHY_UNLOCK(sc);
+ bxe_release_phy_lock(sc);
}
if (attn & HW_INTERRUT_ASSERT_SET_0) {
@@ -9564,11 +9556,6 @@ bxe_interrupt_detach(struct bxe_softc *sc)
}
}
- if (sc->rx_mode_tq) {
- taskqueue_drain(sc->rx_mode_tq, &sc->rx_mode_tq_task);
- taskqueue_free(sc->rx_mode_tq);
- sc->rx_mode_tq = NULL;
- }
if (sc->sp_tq) {
taskqueue_drain(sc->sp_tq, &sc->sp_tq_task);
@@ -9602,14 +9589,6 @@ bxe_interrupt_attach(struct bxe_softc *sc)
taskqueue_start_threads(&sc->sp_tq, 1, PWAIT, /* lower priority */
"%s", sc->sp_tq_name);
- snprintf(sc->rx_mode_tq_name, sizeof(sc->rx_mode_tq_name),
- "bxe%d_rx_mode_tq", sc->unit);
- TASK_INIT(&sc->rx_mode_tq_task, 0, bxe_handle_rx_mode_tq, sc);
- sc->rx_mode_tq = taskqueue_create_fast(sc->rx_mode_tq_name, M_NOWAIT,
- taskqueue_thread_enqueue,
- &sc->rx_mode_tq);
- taskqueue_start_threads(&sc->rx_mode_tq, 1, PWAIT, /* lower priority */
- "%s", sc->rx_mode_tq_name);
for (i = 0; i < sc->num_queues; i++) {
fp = &sc->fp[i];
@@ -12363,9 +12342,9 @@ bxe_link_report_locked(struct bxe_softc *sc)
static void
bxe_link_report(struct bxe_softc *sc)
{
- BXE_PHY_LOCK(sc);
+ bxe_acquire_phy_lock(sc);
bxe_link_report_locked(sc);
- BXE_PHY_UNLOCK(sc);
+ bxe_release_phy_lock(sc);
}
static void
@@ -12481,7 +12460,7 @@ bxe_initial_phy_init(struct bxe_softc *sc,
sc->link_params.feature_config_flags |= feat;
}
- BXE_PHY_LOCK(sc);
+ bxe_acquire_phy_lock(sc);
if (load_mode == LOAD_DIAG) {
lp->loopback_mode = ELINK_LOOPBACK_XGXS;
@@ -12502,7 +12481,7 @@ bxe_initial_phy_init(struct bxe_softc *sc,
rc = elink_phy_init(&sc->link_params, &sc->link_vars);
- BXE_PHY_UNLOCK(sc);
+ bxe_release_phy_lock(sc);
bxe_calc_fc_adv(sc);
@@ -12694,18 +12673,13 @@ bxe_set_uc_list(struct bxe_softc *sc)
}
static void
-bxe_handle_rx_mode_tq(void *context,
- int pending)
+bxe_set_rx_mode(struct bxe_softc *sc)
{
- struct bxe_softc *sc = (struct bxe_softc *)context;
if_t ifp = sc->ifp;
uint32_t rx_mode = BXE_RX_MODE_NORMAL;
- BXE_CORE_LOCK(sc);
-
if (sc->state != BXE_STATE_OPEN) {
BLOGD(sc, DBG_SP, "state is %x, returning\n", sc->state);
- BXE_CORE_UNLOCK(sc);
return;
}
@@ -12747,7 +12721,6 @@ bxe_handle_rx_mode_tq(void *context,
if (bxe_test_bit(ECORE_FILTER_RX_MODE_PENDING, &sc->sp_state)) {
BLOGD(sc, DBG_LOAD, "Scheduled setting rx_mode with ECORE...\n");
bxe_set_bit(ECORE_FILTER_RX_MODE_SCHED, &sc->sp_state);
- BXE_CORE_UNLOCK(sc);
return;
}
@@ -12767,14 +12740,8 @@ bxe_handle_rx_mode_tq(void *context,
}
#endif
- BXE_CORE_UNLOCK(sc);
}
-static void
-bxe_set_rx_mode(struct bxe_softc *sc)
-{
- taskqueue_enqueue(sc->rx_mode_tq, &sc->rx_mode_tq_task);
-}
/* update flags in shmem */
static void
@@ -12845,13 +12812,13 @@ bxe_periodic_callout_func(void *xsc)
*/
mb();
if (sc->port.pmf) {
- BXE_PHY_LOCK(sc);
+ bxe_acquire_phy_lock(sc);
elink_period_func(&sc->link_params, &sc->link_vars);
- BXE_PHY_UNLOCK(sc);
+ bxe_release_phy_lock(sc);
}
}
- if (IS_PF(sc) && !BXE_NOMCP(sc)) {
+ if (IS_PF(sc) && !(sc->flags & BXE_NO_PULSE)) {
int mb_idx = SC_FW_MB_IDX(sc);
uint32_t drv_pulse;
uint32_t mcp_pulse;
@@ -12995,6 +12962,11 @@ bxe_nic_load(struct bxe_softc *sc,
}
}
+ /* set ALWAYS_ALIVE bit in shmem */
+ sc->fw_drv_pulse_wr_seq |= DRV_PULSE_ALWAYS_ALIVE;
+ bxe_drv_pulse(sc);
+ sc->flags |= BXE_NO_PULSE;
+
/* attach interrupts */
if (bxe_interrupt_attach(sc) != 0) {
sc->state = BXE_STATE_CLOSED;
@@ -16750,10 +16722,10 @@ bxe_common_init_phy(struct bxe_softc *sc)
shmem2_base[1] = SHMEM2_RD(sc, other_shmem2_base_addr);
}
- BXE_PHY_LOCK(sc);
+ bxe_acquire_phy_lock(sc);
elink_common_init_phy(sc, shmem_base, shmem2_base,
sc->devinfo.chip_id, 0);
- BXE_PHY_UNLOCK(sc);
+ bxe_release_phy_lock(sc);
}
static void
@@ -18630,9 +18602,9 @@ static void
bxe_link_reset(struct bxe_softc *sc)
{
if (!BXE_NOMCP(sc)) {
- BXE_PHY_LOCK(sc);
+ bxe_acquire_phy_lock(sc);
elink_lfa_reset(&sc->link_params, &sc->link_vars);
- BXE_PHY_UNLOCK(sc);
+ bxe_release_phy_lock(sc);
} else {
if (!CHIP_REV_IS_SLOW(sc)) {
BLOGW(sc, "Bootcode is missing - cannot reset link\n");
diff --git a/sys/dev/bxe/bxe.h b/sys/dev/bxe/bxe.h
index eb695d0..5fb31a3 100644
--- a/sys/dev/bxe/bxe.h
+++ b/sys/dev/bxe/bxe.h
@@ -1400,6 +1400,7 @@ struct bxe_softc {
//#define BXE_SAFC_TX_FLAG 0x00000400
#define BXE_MF_FUNC_DIS 0x00000800
#define BXE_TX_SWITCHING 0x00001000
+#define BXE_NO_PULSE 0x00002000
unsigned long debug; /* per-instance debug logging config */
@@ -1429,11 +1430,6 @@ struct bxe_softc {
struct taskqueue *sp_tq;
char sp_tq_name[32];
- /* set rx_mode asynchronous taskqueue */
- struct task rx_mode_tq_task;
- struct taskqueue *rx_mode_tq;
- char rx_mode_tq_name[32];
-
struct bxe_fastpath fp[MAX_RSS_CHAINS];
struct bxe_sp_objs sp_objs[MAX_RSS_CHAINS];
diff --git a/sys/dev/bxe/ecore_reg.h b/sys/dev/bxe/ecore_reg.h
index b256e78..850390c 100644
--- a/sys/dev/bxe/ecore_reg.h
+++ b/sys/dev/bxe/ecore_reg.h
@@ -1965,6 +1965,7 @@ __FBSDID("$FreeBSD$");
#define MISC_SPIO_SPIO5 0x20
#define HW_LOCK_MAX_RESOURCE_VALUE 31
#define HW_LOCK_RESOURCE_DRV_FLAGS 10
+#define HW_LOCK_RESOURCE_MDIO 0
#define HW_LOCK_RESOURCE_GPIO 1
#define HW_LOCK_RESOURCE_NVRAM 12
#define HW_LOCK_RESOURCE_PORT0_ATT_MASK 3
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index f5b2644..b164cce 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -582,7 +582,6 @@ t4_attach(device_t dev)
#ifdef DEV_NETMAP
int nm_rqidx, nm_tqidx;
#endif
- const char *pcie_ts;
sc = device_get_softc(dev);
sc->dev = dev;
@@ -905,25 +904,10 @@ t4_attach(device_t dev)
goto done;
}
- switch (sc->params.pci.speed) {
- case 0x1:
- pcie_ts = "2.5";
- break;
- case 0x2:
- pcie_ts = "5.0";
- break;
- case 0x3:
- pcie_ts = "8.0";
- break;
- default:
- pcie_ts = "??";
- break;
- }
device_printf(dev,
- "PCIe x%d (%s GTS/s) (%d), %d ports, %d %s interrupt%s, %d eq, %d iq\n",
- sc->params.pci.width, pcie_ts, sc->params.pci.speed,
- sc->params.nports, sc->intr_count,
- sc->intr_type == INTR_MSIX ? "MSI-X" :
+ "PCIe gen%d x%d, %d ports, %d %s interrupt%s, %d eq, %d iq\n",
+ sc->params.pci.speed, sc->params.pci.width, sc->params.nports,
+ sc->intr_count, sc->intr_type == INTR_MSIX ? "MSI-X" :
(sc->intr_type == INTR_MSI ? "MSI" : "INTx"),
sc->intr_count > 1 ? "s" : "", sc->sge.neq, sc->sge.niq);
diff --git a/sys/dev/cxgbe/t4_netmap.c b/sys/dev/cxgbe/t4_netmap.c
index 7d48603..c739146 100644
--- a/sys/dev/cxgbe/t4_netmap.c
+++ b/sys/dev/cxgbe/t4_netmap.c
@@ -297,7 +297,7 @@ alloc_nm_rxq_hwq(struct port_info *pi, struct sge_nm_rxq *nm_rxq, int cong)
(fl_pad ? F_FW_IQ_CMD_FL0PADEN : 0) |
(black_hole == 2 ? F_FW_IQ_CMD_FL0PACKEN : 0));
c.fl0dcaen_to_fl0cidxfthresh =
- htobe16(V_FW_IQ_CMD_FL0FBMIN(X_FETCHBURSTMIN_64B) |
+ htobe16(V_FW_IQ_CMD_FL0FBMIN(X_FETCHBURSTMIN_128B) |
V_FW_IQ_CMD_FL0FBMAX(X_FETCHBURSTMAX_512B));
c.fl0size = htobe16(na->num_rx_desc / 8 + spg_len / EQ_ESIZE);
c.fl0addr = htobe64(nm_rxq->fl_ba);
diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c
index 9416252..27e1ccf 100644
--- a/sys/dev/cxgbe/t4_sge.c
+++ b/sys/dev/cxgbe/t4_sge.c
@@ -2665,7 +2665,7 @@ alloc_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl,
F_FW_IQ_CMD_FL0CONGEN);
}
c.fl0dcaen_to_fl0cidxfthresh =
- htobe16(V_FW_IQ_CMD_FL0FBMIN(X_FETCHBURSTMIN_64B) |
+ htobe16(V_FW_IQ_CMD_FL0FBMIN(X_FETCHBURSTMIN_128B) |
V_FW_IQ_CMD_FL0FBMAX(X_FETCHBURSTMAX_512B));
c.fl0size = htobe16(fl->qsize);
c.fl0addr = htobe64(fl->ba);
diff --git a/sys/dev/drm/drmP.h b/sys/dev/drm/drmP.h
index bf5feed..7725884 100644
--- a/sys/dev/drm/drmP.h
+++ b/sys/dev/drm/drmP.h
@@ -51,9 +51,7 @@ struct drm_file;
#include <sys/conf.h>
#include <sys/sglist.h>
#include <sys/stat.h>
-#if __FreeBSD_version >= 700000
#include <sys/priv.h>
-#endif
#include <sys/proc.h>
#include <sys/lock.h>
#include <sys/fcntl.h>
@@ -94,11 +92,7 @@ struct drm_file;
#include <sys/mman.h>
#include <sys/rman.h>
#include <sys/memrange.h>
-#if __FreeBSD_version >= 800004
#include <dev/agp/agpvar.h>
-#else /* __FreeBSD_version >= 800004 */
-#include <pci/agpvar.h>
-#endif /* __FreeBSD_version >= 800004 */
#include <sys/agpio.h>
#include <sys/mutex.h>
#include <dev/pci/pcivar.h>
@@ -227,11 +221,7 @@ enum {
#define PAGE_ALIGN(addr) round_page(addr)
/* DRM_SUSER returns true if the user is superuser */
-#if __FreeBSD_version >= 700000
#define DRM_SUSER(p) (priv_check(p, PRIV_DRIVER) == 0)
-#else
-#define DRM_SUSER(p) (suser(p) == 0)
-#endif
#define DRM_AGP_FIND_DEVICE() agp_find_device()
#define DRM_MTRR_WC MDF_WRITECOMBINE
#define jiffies ticks
diff --git a/sys/dev/drm/drm_agpsupport.c b/sys/dev/drm/drm_agpsupport.c
index 6a7ebcf..4bb4e7a 100644
--- a/sys/dev/drm/drm_agpsupport.c
+++ b/sys/dev/drm/drm_agpsupport.c
@@ -38,50 +38,15 @@ __FBSDID("$FreeBSD$");
#include "dev/drm/drmP.h"
-#if __FreeBSD_version >= 800004
#include <dev/agp/agpreg.h>
-#else /* __FreeBSD_version >= 800004 */
-#include <pci/agpreg.h>
-#endif /* __FreeBSD_version >= 800004 */
#include <dev/pci/pcireg.h>
/* Returns 1 if AGP or 0 if not. */
static int
drm_device_find_capability(struct drm_device *dev, int cap)
{
-#if __FreeBSD_version >= 602102
return (pci_find_cap(dev->device, cap, NULL) == 0);
-#else
- /* Code taken from agp.c. IWBNI that was a public interface. */
- u_int32_t status;
- u_int8_t ptr, next;
-
- /*
- * Check the CAP_LIST bit of the PCI status register first.
- */
- status = pci_read_config(dev->device, PCIR_STATUS, 2);
- if (!(status & 0x10))
- return 0;
-
- /*
- * Traverse the capabilities list.
- */
- for (ptr = pci_read_config(dev->device, AGP_CAPPTR, 1);
- ptr != 0;
- ptr = next) {
- u_int32_t capid = pci_read_config(dev->device, ptr, 4);
- next = AGP_CAPID_GET_NEXT_PTR(capid);
-
- /*
- * If this capability entry ID is cap, then we are done.
- */
- if (AGP_CAPID_GET_CAP_ID(capid) == cap)
- return 1;
- }
-
- return 0;
-#endif
}
int drm_device_is_agp(struct drm_device *dev)
diff --git a/sys/dev/drm/drm_bufs.c b/sys/dev/drm/drm_bufs.c
index 2d27cd4..b685a59 100644
--- a/sys/dev/drm/drm_bufs.c
+++ b/sys/dev/drm/drm_bufs.c
@@ -1066,15 +1066,9 @@ int drm_mapbufs(struct drm_device *dev, void *data, struct drm_file *file_priv)
}
vaddr = round_page((vm_offset_t)vms->vm_daddr + MAXDSIZ);
-#if __FreeBSD_version >= 600023
- retcode = vm_mmap(&vms->vm_map, &vaddr, size, PROT_READ | PROT_WRITE,
- VM_PROT_ALL, MAP_SHARED | MAP_NOSYNC, OBJT_DEVICE,
+ retcode = vm_mmap(&vms->vm_map, &vaddr, size, VM_PROT_READ |
+ VM_PROT_WRITE, VM_PROT_ALL, MAP_SHARED | MAP_NOSYNC, OBJT_DEVICE,
dev->devnode, foff);
-#else
- retcode = vm_mmap(&vms->vm_map, &vaddr, size, PROT_READ | PROT_WRITE,
- VM_PROT_ALL, MAP_SHARED | MAP_NOSYNC,
- SLIST_FIRST(&dev->devnode->si_hlist), foff);
-#endif
if (retcode)
goto done;
diff --git a/sys/dev/drm/drm_drv.c b/sys/dev/drm/drm_drv.c
index 7598376..6874d45 100644
--- a/sys/dev/drm/drm_drv.c
+++ b/sys/dev/drm/drm_drv.c
@@ -161,19 +161,8 @@ int drm_probe(device_t kdev, drm_pci_id_list_t *idlist)
{
drm_pci_id_list_t *id_entry;
int vendor, device;
-#if __FreeBSD_version < 700010
- device_t realdev;
-
- if (!strcmp(device_get_name(kdev), "drmsub"))
- realdev = device_get_parent(kdev);
- else
- realdev = kdev;
- vendor = pci_get_vendor(realdev);
- device = pci_get_device(realdev);
-#else
vendor = pci_get_vendor(kdev);
device = pci_get_device(kdev);
-#endif
if (pci_get_class(kdev) != PCIC_DISPLAY
|| pci_get_subclass(kdev) != PCIS_DISPLAY_VGA)
@@ -200,14 +189,7 @@ int drm_attach(device_t kdev, drm_pci_id_list_t *idlist)
unit = device_get_unit(kdev);
dev = device_get_softc(kdev);
-#if __FreeBSD_version < 700010
- if (!strcmp(device_get_name(kdev), "drmsub"))
- dev->device = device_get_parent(kdev);
- else
- dev->device = kdev;
-#else
dev->device = kdev;
-#endif
dev->devnode = make_dev(&drm_cdevsw,
0,
DRM_DEV_UID,
@@ -216,11 +198,7 @@ int drm_attach(device_t kdev, drm_pci_id_list_t *idlist)
"dri/card%d", unit);
dev->devnode->si_drv1 = dev;
-#if __FreeBSD_version >= 700053
dev->pci_domain = pci_get_domain(dev->device);
-#else
- dev->pci_domain = 0;
-#endif
dev->pci_bus = pci_get_bus(dev->device);
dev->pci_slot = pci_get_slot(dev->device);
dev->pci_func = pci_get_function(dev->device);
diff --git a/sys/dev/drm/drm_irq.c b/sys/dev/drm/drm_irq.c
index 8977bcf..5965699 100644
--- a/sys/dev/drm/drm_irq.c
+++ b/sys/dev/drm/drm_irq.c
@@ -175,15 +175,9 @@ int drm_irq_install(struct drm_device *dev)
DRM_UNLOCK();
/* Install handler */
-#if __FreeBSD_version >= 700031
retcode = bus_setup_intr(dev->device, dev->irqr,
INTR_TYPE_TTY | INTR_MPSAFE,
NULL, drm_irq_handler_wrap, dev, &dev->irqh);
-#else
- retcode = bus_setup_intr(dev->device, dev->irqr,
- INTR_TYPE_TTY | INTR_MPSAFE,
- drm_irq_handler_wrap, dev, &dev->irqh);
-#endif
if (retcode != 0)
goto err;
diff --git a/sys/dev/drm/i915_drv.c b/sys/dev/drm/i915_drv.c
index 8638df1..244c7fe 100644
--- a/sys/dev/drm/i915_drv.c
+++ b/sys/dev/drm/i915_drv.c
@@ -147,19 +147,11 @@ static device_method_t i915_methods[] = {
};
static driver_t i915_driver = {
-#if __FreeBSD_version >= 700010
"drm",
-#else
- "drmsub",
-#endif
i915_methods,
sizeof(struct drm_device)
};
extern devclass_t drm_devclass;
-#if __FreeBSD_version >= 700010
DRIVER_MODULE(i915, vgapci, i915_driver, drm_devclass, 0, 0);
-#else
-DRIVER_MODULE(i915, agp, i915_driver, drm_devclass, 0, 0);
-#endif
MODULE_DEPEND(i915, drm, 1, 1, 1);
diff --git a/sys/dev/drm/mach64_drv.c b/sys/dev/drm/mach64_drv.c
index 6f859ec..f4f61cd 100644
--- a/sys/dev/drm/mach64_drv.c
+++ b/sys/dev/drm/mach64_drv.c
@@ -130,9 +130,5 @@ static driver_t mach64_driver = {
};
extern devclass_t drm_devclass;
-#if __FreeBSD_version >= 700010
DRIVER_MODULE(mach64, vgapci, mach64_driver, drm_devclass, 0, 0);
-#else
-DRIVER_MODULE(mach64, pci, mach64_driver, drm_devclass, 0, 0);
-#endif
MODULE_DEPEND(mach64, drm, 1, 1, 1);
diff --git a/sys/dev/drm/mga_drv.c b/sys/dev/drm/mga_drv.c
index 6bb7e2b1..bc585b4 100644
--- a/sys/dev/drm/mga_drv.c
+++ b/sys/dev/drm/mga_drv.c
@@ -74,11 +74,7 @@ static int mga_driver_device_is_agp(struct drm_device * dev)
* device is 0x0021 (HB6 Universal PCI-PCI bridge), we reject the
* device.
*/
-#if __FreeBSD_version >= 700010
bus = device_get_parent(device_get_parent(dev->device));
-#else
- bus = device_get_parent(dev->device);
-#endif
if (pci_get_device(dev->device) == 0x0525 &&
pci_get_vendor(bus) == 0x3388 &&
pci_get_device(bus) == 0x0021)
@@ -167,9 +163,5 @@ static driver_t mga_driver = {
};
extern devclass_t drm_devclass;
-#if __FreeBSD_version >= 700010
DRIVER_MODULE(mga, vgapci, mga_driver, drm_devclass, 0, 0);
-#else
-DRIVER_MODULE(mga, pci, mga_driver, drm_devclass, 0, 0);
-#endif
MODULE_DEPEND(mga, drm, 1, 1, 1);
diff --git a/sys/dev/drm/r128_drv.c b/sys/dev/drm/r128_drv.c
index 8aebb0c..a112aeb 100644
--- a/sys/dev/drm/r128_drv.c
+++ b/sys/dev/drm/r128_drv.c
@@ -128,9 +128,5 @@ static driver_t r128_driver = {
};
extern devclass_t drm_devclass;
-#if __FreeBSD_version >= 700010
DRIVER_MODULE(r128, vgapci, r128_driver, drm_devclass, 0, 0);
-#else
-DRIVER_MODULE(r128, pci, r128_driver, drm_devclass, 0, 0);
-#endif
MODULE_DEPEND(r128, drm, 1, 1, 1);
diff --git a/sys/dev/drm/radeon_drv.c b/sys/dev/drm/radeon_drv.c
index 53443bc..a37c641 100644
--- a/sys/dev/drm/radeon_drv.c
+++ b/sys/dev/drm/radeon_drv.c
@@ -127,9 +127,5 @@ static driver_t radeon_driver = {
};
extern devclass_t drm_devclass;
-#if __FreeBSD_version >= 700010
DRIVER_MODULE(radeon, vgapci, radeon_driver, drm_devclass, 0, 0);
-#else
-DRIVER_MODULE(radeon, pci, radeon_driver, drm_devclass, 0, 0);
-#endif
MODULE_DEPEND(radeon, drm, 1, 1, 1);
diff --git a/sys/dev/drm/savage_drv.c b/sys/dev/drm/savage_drv.c
index 3c5e7c8..f6accae 100644
--- a/sys/dev/drm/savage_drv.c
+++ b/sys/dev/drm/savage_drv.c
@@ -113,9 +113,5 @@ static driver_t savage_driver = {
};
extern devclass_t drm_devclass;
-#if __FreeBSD_version >= 700010
DRIVER_MODULE(savage, vgapci, savage_driver, drm_devclass, 0, 0);
-#else
-DRIVER_MODULE(savage, pci, savage_driver, drm_devclass, 0, 0);
-#endif
MODULE_DEPEND(savage, drm, 1, 1, 1);
diff --git a/sys/dev/drm/sis_drv.c b/sys/dev/drm/sis_drv.c
index 8da88ba..8e82ac0 100644
--- a/sys/dev/drm/sis_drv.c
+++ b/sys/dev/drm/sis_drv.c
@@ -107,9 +107,5 @@ static driver_t sis_driver = {
};
extern devclass_t drm_devclass;
-#if __FreeBSD_version >= 700010
DRIVER_MODULE(sisdrm, vgapci, sis_driver, drm_devclass, 0, 0);
-#else
-DRIVER_MODULE(sisdrm, pci, sis_driver, drm_devclass, 0, 0);
-#endif
MODULE_DEPEND(sisdrm, drm, 1, 1, 1);
diff --git a/sys/dev/drm/tdfx_drv.c b/sys/dev/drm/tdfx_drv.c
index 75b7aca..2fe9eee 100644
--- a/sys/dev/drm/tdfx_drv.c
+++ b/sys/dev/drm/tdfx_drv.c
@@ -109,9 +109,5 @@ static driver_t tdfx_driver = {
};
extern devclass_t drm_devclass;
-#if __FreeBSD_version >= 700010
DRIVER_MODULE(tdfx, vgapci, tdfx_driver, drm_devclass, 0, 0);
-#else
-DRIVER_MODULE(tdfx, pci, tdfx_driver, drm_devclass, 0, 0);
-#endif
MODULE_DEPEND(tdfx, drm, 1, 1, 1);
diff --git a/sys/dev/drm2/drm_bufs.c b/sys/dev/drm2/drm_bufs.c
index 1359466..483ee55e 100644
--- a/sys/dev/drm2/drm_bufs.c
+++ b/sys/dev/drm2/drm_bufs.c
@@ -1635,12 +1635,12 @@ int drm_mapbufs(struct drm_device *dev, void *data,
goto done;
}
retcode = vm_mmap(&vms->vm_map, &virtual, map->size,
- PROT_READ | PROT_WRITE, VM_PROT_ALL,
+ VM_PROT_READ | VM_PROT_WRITE, VM_PROT_ALL,
MAP_SHARED | MAP_NOSYNC, OBJT_DEVICE,
file_priv->minor->device, token);
} else {
retcode = vm_mmap(&vms->vm_map, &virtual, dma->byte_count,
- PROT_READ | PROT_WRITE, VM_PROT_ALL,
+ VM_PROT_READ | VM_PROT_WRITE, VM_PROT_ALL,
MAP_SHARED | MAP_NOSYNC, OBJT_DEVICE,
file_priv->minor->device, 0);
}
diff --git a/sys/dev/drm2/i915/i915_gem.c b/sys/dev/drm2/i915/i915_gem.c
index a473031..356ccc5 100644
--- a/sys/dev/drm2/i915/i915_gem.c
+++ b/sys/dev/drm2/i915/i915_gem.c
@@ -1874,7 +1874,7 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data,
map = &p->p_vmspace->vm_map;
size = round_page(args->size);
PROC_LOCK(p);
- if (map->size + size > lim_cur(p, RLIMIT_VMEM)) {
+ if (map->size + size > lim_cur_proc(p, RLIMIT_VMEM)) {
PROC_UNLOCK(p);
error = -ENOMEM;
goto out;
@@ -3175,9 +3175,6 @@ i915_gem_wire_page(vm_object_t object, vm_pindex_t pindex, bool *fresh)
if (m->valid != VM_PAGE_BITS_ALL) {
if (vm_pager_has_page(object, pindex, NULL, NULL)) {
rv = vm_pager_get_pages(object, &m, 1, 0);
- m = vm_page_lookup(object, pindex);
- if (m == NULL)
- return (NULL);
if (rv != VM_PAGER_OK) {
vm_page_lock(m);
vm_page_free(m);
diff --git a/sys/dev/dwc/if_dwc.c b/sys/dev/dwc/if_dwc.c
index 57e6b44..7ca16ac 100644
--- a/sys/dev/dwc/if_dwc.c
+++ b/sys/dev/dwc/if_dwc.c
@@ -741,9 +741,11 @@ dwc_txfinish_locked(struct dwc_softc *sc)
{
struct dwc_bufmap *bmap;
struct dwc_hwdesc *desc;
+ struct ifnet *ifp;
DWC_ASSERT_LOCKED(sc);
+ ifp = sc->ifp;
while (sc->tx_idx_tail != sc->tx_idx_head) {
desc = &sc->txdesc_ring[sc->tx_idx_tail];
if ((desc->tdes0 & DDESC_TDES0_OWN) != 0)
@@ -756,6 +758,7 @@ dwc_txfinish_locked(struct dwc_softc *sc)
bmap->mbuf = NULL;
dwc_setup_txdesc(sc, sc->tx_idx_tail, 0, 0);
sc->tx_idx_tail = next_txidx(sc, sc->tx_idx_tail);
+ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
}
/* If there are no buffers outstanding, muzzle the watchdog. */
@@ -838,8 +841,10 @@ dwc_intr(void *arg)
if (reg & DMA_STATUS_RI)
dwc_rxfinish_locked(sc);
- if (reg & DMA_STATUS_TI)
+ if (reg & DMA_STATUS_TI) {
dwc_txfinish_locked(sc);
+ dwc_txstart_locked(sc);
+ }
}
if (reg & DMA_STATUS_AIS) {
diff --git a/sys/dev/e1000/e1000_defines.h b/sys/dev/e1000/e1000_defines.h
index 77589ed..5deada2 100644
--- a/sys/dev/e1000/e1000_defines.h
+++ b/sys/dev/e1000/e1000_defines.h
@@ -158,10 +158,12 @@
E1000_RXDEXT_STATERR_CXE | \
E1000_RXDEXT_STATERR_RXE)
+#define E1000_MRQC_RSS_ENABLE_2Q 0x00000001
#define E1000_MRQC_RSS_FIELD_MASK 0xFFFF0000
#define E1000_MRQC_RSS_FIELD_IPV4_TCP 0x00010000
#define E1000_MRQC_RSS_FIELD_IPV4 0x00020000
#define E1000_MRQC_RSS_FIELD_IPV6_TCP_EX 0x00040000
+#define E1000_MRQC_RSS_FIELD_IPV6_EX 0x00080000
#define E1000_MRQC_RSS_FIELD_IPV6 0x00100000
#define E1000_MRQC_RSS_FIELD_IPV6_TCP 0x00200000
diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c
index ab39c43..8032345 100644
--- a/sys/dev/e1000/if_em.c
+++ b/sys/dev/e1000/if_em.c
@@ -1,6 +1,6 @@
/******************************************************************************
- Copyright (c) 2001-2014, Intel Corporation
+ Copyright (c) 2001-2015, Intel Corporation
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -32,6 +32,8 @@
******************************************************************************/
/*$FreeBSD$*/
+#include "opt_em.h"
+#include "opt_ddb.h"
#include "opt_inet.h"
#include "opt_inet6.h"
@@ -41,6 +43,10 @@
#include <sys/param.h>
#include <sys/systm.h>
+#ifdef DDB
+#include <sys/types.h>
+#include <ddb/ddb.h>
+#endif
#if __FreeBSD_version >= 800000
#include <sys/buf_ring.h>
#endif
@@ -52,6 +58,7 @@
#include <sys/mbuf.h>
#include <sys/module.h>
#include <sys/rman.h>
+#include <sys/smp.h>
#include <sys/socket.h>
#include <sys/sockio.h>
#include <sys/sysctl.h>
@@ -208,7 +215,7 @@ static int em_resume(device_t);
#ifdef EM_MULTIQUEUE
static int em_mq_start(if_t, struct mbuf *);
static int em_mq_start_locked(if_t,
- struct tx_ring *, struct mbuf *);
+ struct tx_ring *);
static void em_qflush(if_t);
#else
static void em_start(if_t);
@@ -299,6 +306,10 @@ static void em_handle_tx(void *context, int pending);
static void em_handle_rx(void *context, int pending);
static void em_handle_link(void *context, int pending);
+#ifdef EM_MULTIQUEUE
+static void em_enable_vectors_82574(struct adapter *);
+#endif
+
static void em_set_sysctl_value(struct adapter *, const char *,
const char *, int *, int);
static int em_set_flowcntl(SYSCTL_HANDLER_ARGS);
@@ -388,6 +399,19 @@ static int em_enable_msix = TRUE;
SYSCTL_INT(_hw_em, OID_AUTO, enable_msix, CTLFLAG_RDTUN, &em_enable_msix, 0,
"Enable MSI-X interrupts");
+#ifdef EM_MULTIQUEUE
+static int em_num_queues = 1;
+SYSCTL_INT(_hw_em, OID_AUTO, num_queues, CTLFLAG_RDTUN, &em_num_queues, 0,
+ "82574 only: Number of queues to configure, 0 indicates autoconfigure");
+#endif
+
+/*
+** Global variable to store last used CPU when binding queues
+** to CPUs in igb_allocate_msix. Starts at CPU_FIRST and increments when a
+** queue is bound to a cpu.
+*/
+static int em_last_bind_cpu = -1;
+
/* How many packets rxeof tries to clean at a time */
static int em_rx_process_limit = 100;
SYSCTL_INT(_hw_em, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN,
@@ -420,10 +444,10 @@ static int
em_probe(device_t dev)
{
char adapter_name[60];
- u16 pci_vendor_id = 0;
- u16 pci_device_id = 0;
- u16 pci_subvendor_id = 0;
- u16 pci_subdevice_id = 0;
+ uint16_t pci_vendor_id = 0;
+ uint16_t pci_device_id = 0;
+ uint16_t pci_subvendor_id = 0;
+ uint16_t pci_subdevice_id = 0;
em_vendor_info_t *ent;
INIT_DEBUGOUT("em_probe: begin");
@@ -550,6 +574,11 @@ em_attach(device_t dev)
goto err_pci;
}
+ /*
+ * Setup MSI/X or MSI if PCI Express
+ */
+ adapter->msix = em_setup_msix(adapter);
+
e1000_get_bus_info(hw);
/* Set up some sysctls for the tunable interrupt delays */
@@ -880,7 +909,7 @@ em_resume(device_t dev)
EM_TX_LOCK(txr);
#ifdef EM_MULTIQUEUE
if (!drbr_empty(ifp, txr->br))
- em_mq_start_locked(ifp, txr, NULL);
+ em_mq_start_locked(ifp, txr);
#else
if (!if_sendq_empty(ifp))
em_start_locked(ifp, txr);
@@ -894,107 +923,7 @@ em_resume(device_t dev)
}
-#ifdef EM_MULTIQUEUE
-/*********************************************************************
- * Multiqueue Transmit routines
- *
- * em_mq_start is called by the stack to initiate a transmit.
- * however, if busy the driver can queue the request rather
- * than do an immediate send. It is this that is an advantage
- * in this driver, rather than also having multiple tx queues.
- **********************************************************************/
-static int
-em_mq_start_locked(if_t ifp, struct tx_ring *txr, struct mbuf *m)
-{
- struct adapter *adapter = txr->adapter;
- struct mbuf *next;
- int err = 0, enq = 0;
-
- if ((if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
- IFF_DRV_RUNNING || adapter->link_active == 0) {
- if (m != NULL)
- err = drbr_enqueue(ifp, txr->br, m);
- return (err);
- }
-
- enq = 0;
- if (m != NULL) {
- err = drbr_enqueue(ifp, txr->br, m);
- if (err)
- return (err);
- }
-
- /* Process the queue */
- while ((next = drbr_peek(ifp, txr->br)) != NULL) {
- if ((err = em_xmit(txr, &next)) != 0) {
- if (next == NULL)
- drbr_advance(ifp, txr->br);
- else
- drbr_putback(ifp, txr->br, next);
- break;
- }
- drbr_advance(ifp, txr->br);
- enq++;
- if_inc_counter(ifp, IFCOUNTER_OBYTES, next->m_pkthdr.len);
- if (next->m_flags & M_MCAST)
- if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1);
- if_etherbpfmtap(ifp, next);
- if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0)
- break;
- }
-
- if (enq > 0) {
- /* Set the watchdog */
- txr->queue_status = EM_QUEUE_WORKING;
- txr->watchdog_time = ticks;
- }
-
- if (txr->tx_avail < EM_MAX_SCATTER)
- em_txeof(txr);
- if (txr->tx_avail < EM_MAX_SCATTER)
- if_setdrvflagbits(ifp, IFF_DRV_OACTIVE,0);
- return (err);
-}
-
-/*
-** Multiqueue capable stack interface
-*/
-static int
-em_mq_start(if_t ifp, struct mbuf *m)
-{
- struct adapter *adapter = if_getsoftc(ifp);
- struct tx_ring *txr = adapter->tx_rings;
- int error;
-
- if (EM_TX_TRYLOCK(txr)) {
- error = em_mq_start_locked(ifp, txr, m);
- EM_TX_UNLOCK(txr);
- } else
- error = drbr_enqueue(ifp, txr->br, m);
-
- return (error);
-}
-
-/*
-** Flush all ring buffers
-*/
-static void
-em_qflush(if_t ifp)
-{
- struct adapter *adapter = if_getsoftc(ifp);
- struct tx_ring *txr = adapter->tx_rings;
- struct mbuf *m;
-
- for (int i = 0; i < adapter->num_queues; i++, txr++) {
- EM_TX_LOCK(txr);
- while ((m = buf_ring_dequeue_sc(txr->br)) != NULL)
- m_freem(m);
- EM_TX_UNLOCK(txr);
- }
- if_qflush(ifp);
-}
-#else /* !EM_MULTIQUEUE */
-
+#ifndef EM_MULTIQUEUE
static void
em_start_locked(if_t ifp, struct tx_ring *txr)
{
@@ -1032,12 +961,13 @@ em_start_locked(if_t ifp, struct tx_ring *txr)
break;
}
+ /* Mark the queue as having work */
+ if (txr->busy == EM_TX_IDLE)
+ txr->busy = EM_TX_BUSY;
+
/* Send a copy of the frame to the BPF listener */
- if_etherbpfmtap(ifp, m_head);
+ ETHER_BPF_MTAP(ifp, m_head);
- /* Set timeout in case hardware has problems transmitting. */
- txr->watchdog_time = ticks;
- txr->queue_status = EM_QUEUE_WORKING;
}
return;
@@ -1056,6 +986,115 @@ em_start(if_t ifp)
}
return;
}
+#else /* EM_MULTIQUEUE */
+/*********************************************************************
+ * Multiqueue Transmit routines
+ *
+ * em_mq_start is called by the stack to initiate a transmit.
+ * however, if busy the driver can queue the request rather
+ * than do an immediate send. It is this that is an advantage
+ * in this driver, rather than also having multiple tx queues.
+ **********************************************************************/
+/*
+** Multiqueue capable stack interface
+*/
+static int
+em_mq_start(if_t ifp, struct mbuf *m)
+{
+ struct adapter *adapter = if_getsoftc(ifp);
+ struct tx_ring *txr = adapter->tx_rings;
+ unsigned int i, error;
+
+ if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE)
+ i = m->m_pkthdr.flowid % adapter->num_queues;
+ else
+ i = curcpu % adapter->num_queues;
+
+ txr = &adapter->tx_rings[i];
+
+ error = drbr_enqueue(ifp, txr->br, m);
+ if (error)
+ return (error);
+
+ if (EM_TX_TRYLOCK(txr)) {
+ em_mq_start_locked(ifp, txr);
+ EM_TX_UNLOCK(txr);
+ } else
+ taskqueue_enqueue(txr->tq, &txr->tx_task);
+
+ return (0);
+}
+
+static int
+em_mq_start_locked(if_t ifp, struct tx_ring *txr)
+{
+ struct adapter *adapter = txr->adapter;
+ struct mbuf *next;
+ int err = 0, enq = 0;
+
+ EM_TX_LOCK_ASSERT(txr);
+
+ if (((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) ||
+ adapter->link_active == 0) {
+ return (ENETDOWN);
+ }
+
+ /* Process the queue */
+ while ((next = drbr_peek(ifp, txr->br)) != NULL) {
+ if ((err = em_xmit(txr, &next)) != 0) {
+ if (next == NULL) {
+ /* It was freed, move forward */
+ drbr_advance(ifp, txr->br);
+ } else {
+ /*
+ * Still have one left, it may not be
+ * the same since the transmit function
+ * may have changed it.
+ */
+ drbr_putback(ifp, txr->br, next);
+ }
+ break;
+ }
+ drbr_advance(ifp, txr->br);
+ enq++;
+ if_inc_counter(ifp, IFCOUNTER_OBYTES, next->m_pkthdr.len);
+ if (next->m_flags & M_MCAST)
+ if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1);
+ ETHER_BPF_MTAP(ifp, next);
+ if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0)
+ break;
+ }
+
+ /* Mark the queue as having work */
+ if ((enq > 0) && (txr->busy == EM_TX_IDLE))
+ txr->busy = EM_TX_BUSY;
+
+ if (txr->tx_avail < EM_MAX_SCATTER)
+ em_txeof(txr);
+ if (txr->tx_avail < EM_MAX_SCATTER) {
+ if_setdrvflagbits(ifp, IFF_DRV_OACTIVE,0);
+ }
+ return (err);
+}
+
+/*
+** Flush all ring buffers
+*/
+static void
+em_qflush(if_t ifp)
+{
+ struct adapter *adapter = if_getsoftc(ifp);
+ struct tx_ring *txr = adapter->tx_rings;
+ struct mbuf *m;
+
+ for (int i = 0; i < adapter->num_queues; i++, txr++) {
+ EM_TX_LOCK(txr);
+ while ((m = buf_ring_dequeue_sc(txr->br)) != NULL)
+ m_freem(m);
+ EM_TX_UNLOCK(txr);
+ }
+ if_qflush(ifp);
+}
#endif /* EM_MULTIQUEUE */
/*********************************************************************
@@ -1451,7 +1490,7 @@ em_poll(if_t ifp, enum poll_cmd cmd, int count)
em_txeof(txr);
#ifdef EM_MULTIQUEUE
if (!drbr_empty(ifp, txr->br))
- em_mq_start_locked(ifp, txr, NULL);
+ em_mq_start_locked(ifp, txr);
#else
if (!if_sendq_empty(ifp))
em_start_locked(ifp, txr);
@@ -1518,14 +1557,14 @@ em_handle_que(void *context, int pending)
struct tx_ring *txr = adapter->tx_rings;
struct rx_ring *rxr = adapter->rx_rings;
-
if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
bool more = em_rxeof(rxr, adapter->rx_process_limit, NULL);
+
EM_TX_LOCK(txr);
em_txeof(txr);
#ifdef EM_MULTIQUEUE
if (!drbr_empty(ifp, txr->br))
- em_mq_start_locked(ifp, txr, NULL);
+ em_mq_start_locked(ifp, txr);
#else
if (!if_sendq_empty(ifp))
em_start_locked(ifp, txr);
@@ -1559,11 +1598,12 @@ em_msix_tx(void *arg)
em_txeof(txr);
#ifdef EM_MULTIQUEUE
if (!drbr_empty(ifp, txr->br))
- em_mq_start_locked(ifp, txr, NULL);
+ em_mq_start_locked(ifp, txr);
#else
if (!if_sendq_empty(ifp))
em_start_locked(ifp, txr);
#endif
+
/* Reenable this interrupt */
E1000_WRITE_REG(&adapter->hw, E1000_IMS, txr->ims);
EM_TX_UNLOCK(txr);
@@ -1589,9 +1629,10 @@ em_msix_rx(void *arg)
more = em_rxeof(rxr, adapter->rx_process_limit, NULL);
if (more)
taskqueue_enqueue(rxr->tq, &rxr->rx_task);
- else
+ else {
/* Reenable this interrupt */
E1000_WRITE_REG(&adapter->hw, E1000_IMS, rxr->ims);
+ }
return;
}
@@ -1618,6 +1659,16 @@ em_msix_link(void *arg)
} else
E1000_WRITE_REG(&adapter->hw, E1000_IMS,
EM_MSIX_LINK | E1000_IMS_LSC);
+ /*
+ ** Because we must read the ICR for this interrupt
+ ** it may clear other causes using autoclear, for
+ ** this reason we simply create a soft interrupt
+ ** for all these vectors.
+ */
+ if (reg_icr) {
+ E1000_WRITE_REG(&adapter->hw,
+ E1000_ICS, adapter->ims);
+ }
return;
}
@@ -1631,9 +1682,10 @@ em_handle_rx(void *context, int pending)
more = em_rxeof(rxr, adapter->rx_process_limit, NULL);
if (more)
taskqueue_enqueue(rxr->tq, &rxr->rx_task);
- else
+ else {
/* Reenable this interrupt */
E1000_WRITE_REG(&adapter->hw, E1000_IMS, rxr->ims);
+ }
}
static void
@@ -1647,7 +1699,7 @@ em_handle_tx(void *context, int pending)
em_txeof(txr);
#ifdef EM_MULTIQUEUE
if (!drbr_empty(ifp, txr->br))
- em_mq_start_locked(ifp, txr, NULL);
+ em_mq_start_locked(ifp, txr);
#else
if (!if_sendq_empty(ifp))
em_start_locked(ifp, txr);
@@ -1677,7 +1729,7 @@ em_handle_link(void *context, int pending)
EM_TX_LOCK(txr);
#ifdef EM_MULTIQUEUE
if (!drbr_empty(ifp, txr->br))
- em_mq_start_locked(ifp, txr, NULL);
+ em_mq_start_locked(ifp, txr);
#else
if (if_sendq_empty(ifp))
em_start_locked(ifp, txr);
@@ -2102,8 +2154,6 @@ retry:
*/
tx_buffer = &txr->tx_buffers[first];
tx_buffer->next_eop = last;
- /* Update the watchdog time early and often */
- txr->watchdog_time = ticks;
/*
* Advance the Transmit Descriptor Tail (TDT), this tells the E1000
@@ -2223,7 +2273,7 @@ em_local_timer(void *arg)
if_t ifp = adapter->ifp;
struct tx_ring *txr = adapter->tx_rings;
struct rx_ring *rxr = adapter->rx_rings;
- u32 trigger;
+ u32 trigger = 0;
EM_CORE_LOCK_ASSERT(adapter);
@@ -2236,9 +2286,11 @@ em_local_timer(void *arg)
e1000_rar_set(&adapter->hw, adapter->hw.mac.addr, 0);
/* Mask to use in the irq trigger */
- if (adapter->msix_mem)
- trigger = rxr->ims;
- else
+ if (adapter->msix_mem) {
+ for (int i = 0; i < adapter->num_queues; i++, rxr++)
+ trigger |= rxr->ims;
+ rxr = adapter->rx_rings;
+ } else
trigger = E1000_ICS_RXDMT0;
/*
@@ -2247,15 +2299,15 @@ em_local_timer(void *arg)
** and the HUNG state will be static if set.
*/
for (int i = 0; i < adapter->num_queues; i++, txr++) {
- if ((txr->queue_status == EM_QUEUE_HUNG) &&
- (adapter->pause_frames == 0))
+ if (txr->busy == EM_TX_HUNG)
goto hung;
+ if (txr->busy >= EM_TX_MAXTRIES)
+ txr->busy = EM_TX_HUNG;
/* Schedule a TX tasklet if needed */
if (txr->tx_avail <= EM_MAX_SCATTER)
taskqueue_enqueue(txr->tq, &txr->tx_task);
}
- adapter->pause_frames = 0;
callout_reset(&adapter->timer, hz, em_local_timer, adapter);
#ifndef DEVICE_POLLING
/* Trigger an RX interrupt to guarantee mbuf refresh */
@@ -2264,17 +2316,11 @@ em_local_timer(void *arg)
return;
hung:
/* Looks like we're hung */
- device_printf(adapter->dev, "Watchdog timeout -- resetting\n");
- device_printf(adapter->dev,
- "Queue(%d) tdh = %d, hw tdt = %d\n", txr->me,
- E1000_READ_REG(&adapter->hw, E1000_TDH(txr->me)),
- E1000_READ_REG(&adapter->hw, E1000_TDT(txr->me)));
- device_printf(adapter->dev,"TX(%d) desc avail = %d,"
- "Next TX to Clean = %d\n",
- txr->me, txr->tx_avail, txr->next_to_clean);
+ device_printf(adapter->dev, "Watchdog timeout Queue[%d]-- resetting\n",
+ txr->me);
+ em_print_debug_info(adapter);
if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING);
adapter->watchdog_events++;
- adapter->pause_frames = 0;
em_init_locked(adapter);
}
@@ -2324,7 +2370,7 @@ em_update_link_status(struct adapter *adapter)
(hw->mac.type == e1000_82572))) {
int tarc0;
tarc0 = E1000_READ_REG(hw, E1000_TARC(0));
- tarc0 &= ~SPEED_MODE_BIT;
+ tarc0 &= ~TARC_SPEED_MODE_BIT;
E1000_WRITE_REG(hw, E1000_TARC(0), tarc0);
}
if (bootverbose)
@@ -2343,9 +2389,9 @@ em_update_link_status(struct adapter *adapter)
if (bootverbose)
device_printf(dev, "Link is Down\n");
adapter->link_active = 0;
- /* Link down, disable watchdog */
+ /* Link down, disable hang detection */
for (int i = 0; i < adapter->num_queues; i++, txr++)
- txr->queue_status = EM_QUEUE_IDLE;
+ txr->busy = EM_TX_IDLE;
if_link_state_change(ifp, LINK_STATE_DOWN);
}
}
@@ -2376,10 +2422,10 @@ em_stop(void *arg)
/* Tell the stack that the interface is no longer active */
if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING);
- /* Unarm watchdog timer. */
+ /* Disarm Hang Detection. */
for (int i = 0; i < adapter->num_queues; i++, txr++) {
EM_TX_LOCK(txr);
- txr->queue_status = EM_QUEUE_IDLE;
+ txr->busy = EM_TX_IDLE;
EM_TX_UNLOCK(txr);
}
@@ -2440,14 +2486,6 @@ em_allocate_pci_resources(struct adapter *adapter)
rman_get_bushandle(adapter->memory);
adapter->hw.hw_addr = (u8 *)&adapter->osdep.mem_bus_space_handle;
- /* Default to a single queue */
- adapter->num_queues = 1;
-
- /*
- * Setup MSI/X or MSI if PCI Express
- */
- adapter->msix = em_setup_msix(adapter);
-
adapter->hw.back = &adapter->osdep;
return (0);
@@ -2522,13 +2560,14 @@ em_allocate_msix(struct adapter *adapter)
struct tx_ring *txr = adapter->tx_rings;
struct rx_ring *rxr = adapter->rx_rings;
int error, rid, vector = 0;
+ int cpu_id = 0;
/* Make sure all interrupts are disabled */
E1000_WRITE_REG(&adapter->hw, E1000_IMC, 0xffffffff);
/* First set up ring resources */
- for (int i = 0; i < adapter->num_queues; i++, txr++, rxr++) {
+ for (int i = 0; i < adapter->num_queues; i++, rxr++, vector++) {
/* RX ring */
rid = vector + 1;
@@ -2548,14 +2587,20 @@ em_allocate_msix(struct adapter *adapter)
return (error);
}
#if __FreeBSD_version >= 800504
- bus_describe_intr(dev, rxr->res, rxr->tag, "rx %d", i);
+ bus_describe_intr(dev, rxr->res, rxr->tag, "rx%d", i);
#endif
- rxr->msix = vector++; /* NOTE increment vector for TX */
+ rxr->msix = vector;
+
+ if (em_last_bind_cpu < 0)
+ em_last_bind_cpu = CPU_FIRST();
+ cpu_id = em_last_bind_cpu;
+ bus_bind_intr(dev, rxr->res, cpu_id);
+
TASK_INIT(&rxr->rx_task, 0, em_handle_rx, rxr);
rxr->tq = taskqueue_create_fast("em_rxq", M_NOWAIT,
taskqueue_thread_enqueue, &rxr->tq);
- taskqueue_start_threads(&rxr->tq, 1, PI_NET, "%s rxq",
- device_get_nameunit(adapter->dev));
+ taskqueue_start_threads(&rxr->tq, 1, PI_NET, "%s rxq (cpuid %d)",
+ device_get_nameunit(adapter->dev), cpu_id);
/*
** Set the bit to enable interrupt
** in E1000_IMS -- bits 20 and 21
@@ -2563,8 +2608,13 @@ em_allocate_msix(struct adapter *adapter)
** NOTHING to do with the MSIX vector
*/
rxr->ims = 1 << (20 + i);
+ adapter->ims |= rxr->ims;
adapter->ivars |= (8 | rxr->msix) << (i * 4);
+ em_last_bind_cpu = CPU_NEXT(em_last_bind_cpu);
+ }
+
+ for (int i = 0; i < adapter->num_queues; i++, txr++, vector++) {
/* TX ring */
rid = vector + 1;
txr->res = bus_alloc_resource_any(dev,
@@ -2582,14 +2632,20 @@ em_allocate_msix(struct adapter *adapter)
return (error);
}
#if __FreeBSD_version >= 800504
- bus_describe_intr(dev, txr->res, txr->tag, "tx %d", i);
+ bus_describe_intr(dev, txr->res, txr->tag, "tx%d", i);
#endif
- txr->msix = vector++; /* Increment vector for next pass */
+ txr->msix = vector;
+
+ if (em_last_bind_cpu < 0)
+ em_last_bind_cpu = CPU_FIRST();
+ cpu_id = em_last_bind_cpu;
+ bus_bind_intr(dev, txr->res, cpu_id);
+
TASK_INIT(&txr->tx_task, 0, em_handle_tx, txr);
txr->tq = taskqueue_create_fast("em_txq", M_NOWAIT,
taskqueue_thread_enqueue, &txr->tq);
- taskqueue_start_threads(&txr->tq, 1, PI_NET, "%s txq",
- device_get_nameunit(adapter->dev));
+ taskqueue_start_threads(&txr->tq, 1, PI_NET, "%s txq (cpuid %d)",
+ device_get_nameunit(adapter->dev), cpu_id);
/*
** Set the bit to enable interrupt
** in E1000_IMS -- bits 22 and 23
@@ -2597,13 +2653,16 @@ em_allocate_msix(struct adapter *adapter)
** NOTHING to do with the MSIX vector
*/
txr->ims = 1 << (22 + i);
+ adapter->ims |= txr->ims;
adapter->ivars |= (8 | txr->msix) << (8 + (i * 4));
+
+ em_last_bind_cpu = CPU_NEXT(em_last_bind_cpu);
}
/* Link interrupt */
- ++rid;
+ rid = vector + 1;
adapter->res = bus_alloc_resource_any(dev,
- SYS_RES_IRQ, &rid, RF_ACTIVE);
+ SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE);
if (!adapter->res) {
device_printf(dev,"Unable to allocate "
"bus resource: Link interrupt [%d]\n", rid);
@@ -2619,7 +2678,7 @@ em_allocate_msix(struct adapter *adapter)
return (error);
}
#if __FreeBSD_version >= 800504
- bus_describe_intr(dev, adapter->res, adapter->tag, "link");
+ bus_describe_intr(dev, adapter->res, adapter->tag, "link");
#endif
adapter->linkvec = vector;
adapter->ivars |= (8 | vector) << 16;
@@ -2643,9 +2702,8 @@ em_free_pci_resources(struct adapter *adapter)
*/
for (int i = 0; i < adapter->num_queues; i++) {
txr = &adapter->tx_rings[i];
- rxr = &adapter->rx_rings[i];
/* an early abort? */
- if ((txr == NULL) || (rxr == NULL))
+ if (txr == NULL)
break;
rid = txr->msix +1;
if (txr->tag != NULL) {
@@ -2655,6 +2713,11 @@ em_free_pci_resources(struct adapter *adapter)
if (txr->res != NULL)
bus_release_resource(dev, SYS_RES_IRQ,
rid, txr->res);
+
+ rxr = &adapter->rx_rings[i];
+ /* an early abort? */
+ if (rxr == NULL)
+ break;
rid = rxr->msix +1;
if (rxr->tag != NULL) {
bus_teardown_intr(dev, rxr->res, rxr->tag);
@@ -2704,14 +2767,19 @@ em_setup_msix(struct adapter *adapter)
device_t dev = adapter->dev;
int val;
+ /* Nearly always going to use one queue */
+ adapter->num_queues = 1;
+
/*
- ** Setup MSI/X for Hartwell: tests have shown
- ** use of two queues to be unstable, and to
- ** provide no great gain anyway, so we simply
- ** seperate the interrupts and use a single queue.
+ ** Try using MSI-X for Hartwell adapters
*/
if ((adapter->hw.mac.type == e1000_82574) &&
(em_enable_msix == TRUE)) {
+#ifdef EM_MULTIQUEUE
+ adapter->num_queues = (em_num_queues == 1) ? 1 : 2;
+ if (adapter->num_queues > 1)
+ em_enable_vectors_82574(adapter);
+#endif
/* Map the MSIX BAR */
int rid = PCIR_BAR(EM_MSIX_BAR);
adapter->msix_mem = bus_alloc_resource_any(dev,
@@ -2723,16 +2791,34 @@ em_setup_msix(struct adapter *adapter)
goto msi;
}
val = pci_msix_count(dev);
- /* We only need/want 3 vectors */
- if (val >= 3)
- val = 3;
- else {
- device_printf(adapter->dev,
- "MSIX: insufficient vectors, using MSI\n");
- goto msi;
+
+#ifdef EM_MULTIQUEUE
+ /* We need 5 vectors in the multiqueue case */
+ if (adapter->num_queues > 1 ) {
+ if (val >= 5)
+ val = 5;
+ else {
+ adapter->num_queues = 1;
+ device_printf(adapter->dev,
+ "Insufficient MSIX vectors for >1 queue, "
+ "using single queue...\n");
+ goto msix_one;
+ }
+ } else {
+msix_one:
+#endif
+ if (val >= 3)
+ val = 3;
+ else {
+ device_printf(adapter->dev,
+ "Insufficient MSIX vectors, using MSI\n");
+ goto msi;
+ }
+#ifdef EM_MULTIQUEUE
}
+#endif
- if ((pci_alloc_msix(dev, &val) == 0) && (val == 3)) {
+ if ((pci_alloc_msix(dev, &val) == 0)) {
device_printf(adapter->dev,
"Using MSIX interrupts "
"with %d vectors\n", val);
@@ -2753,7 +2839,7 @@ msi:
}
val = 1;
if (pci_alloc_msi(dev, &val) == 0) {
- device_printf(adapter->dev,"Using an MSI interrupt\n");
+ device_printf(adapter->dev, "Using an MSI interrupt\n");
return (val);
}
/* Should only happen due to manual configuration */
@@ -3358,7 +3444,7 @@ em_setup_transmit_ring(struct tx_ring *txr)
/* Set number of descriptors available */
txr->tx_avail = adapter->num_tx_desc;
- txr->queue_status = EM_QUEUE_IDLE;
+ txr->busy = EM_TX_IDLE;
/* Clear checksum offload context. */
txr->last_hw_offload = 0;
@@ -3398,7 +3484,7 @@ em_initialize_transmit_unit(struct adapter *adapter)
{
struct tx_ring *txr = adapter->tx_rings;
struct e1000_hw *hw = &adapter->hw;
- u32 tctl, tarc, tipg = 0;
+ u32 tctl, txdctl = 0, tarc, tipg = 0;
INIT_DEBUGOUT("em_initialize_transmit_unit: begin");
@@ -3419,7 +3505,16 @@ em_initialize_transmit_unit(struct adapter *adapter)
E1000_READ_REG(&adapter->hw, E1000_TDBAL(i)),
E1000_READ_REG(&adapter->hw, E1000_TDLEN(i)));
- txr->queue_status = EM_QUEUE_IDLE;
+ txr->busy = EM_TX_IDLE;
+ txdctl = 0; /* clear txdctl */
+ txdctl |= 0x1f; /* PTHRESH */
+ txdctl |= 1 << 8; /* HTHRESH */
+ txdctl |= 1 << 16;/* WTHRESH */
+ txdctl |= 1 << 22; /* Reserved bit 22 must always be 1 */
+ txdctl |= E1000_TXDCTL_GRAN;
+ txdctl |= 1 << 25; /* LWTHRESH */
+
+ E1000_WRITE_REG(hw, E1000_TXDCTL(i), txdctl);
}
/* Set the default values for the Tx Inter Packet Gap timer */
@@ -3450,15 +3545,25 @@ em_initialize_transmit_unit(struct adapter *adapter)
if ((adapter->hw.mac.type == e1000_82571) ||
(adapter->hw.mac.type == e1000_82572)) {
tarc = E1000_READ_REG(&adapter->hw, E1000_TARC(0));
- tarc |= SPEED_MODE_BIT;
+ tarc |= TARC_SPEED_MODE_BIT;
E1000_WRITE_REG(&adapter->hw, E1000_TARC(0), tarc);
} else if (adapter->hw.mac.type == e1000_80003es2lan) {
+ /* errata: program both queues to unweighted RR */
tarc = E1000_READ_REG(&adapter->hw, E1000_TARC(0));
tarc |= 1;
E1000_WRITE_REG(&adapter->hw, E1000_TARC(0), tarc);
tarc = E1000_READ_REG(&adapter->hw, E1000_TARC(1));
tarc |= 1;
E1000_WRITE_REG(&adapter->hw, E1000_TARC(1), tarc);
+ } else if (adapter->hw.mac.type == e1000_82574) {
+ tarc = E1000_READ_REG(&adapter->hw, E1000_TARC(0));
+ tarc |= TARC_ERRATA_BIT;
+ if ( adapter->num_queues > 1) {
+ tarc |= (TARC_COMPENSATION_MODE | TARC_MQ_FIX);
+ E1000_WRITE_REG(&adapter->hw, E1000_TARC(0), tarc);
+ E1000_WRITE_REG(&adapter->hw, E1000_TARC(1), tarc);
+ } else
+ E1000_WRITE_REG(&adapter->hw, E1000_TARC(0), tarc);
}
adapter->txd_cmd = E1000_TXD_CMD_IFCS;
@@ -3802,9 +3907,9 @@ em_txeof(struct tx_ring *txr)
return;
#endif /* DEV_NETMAP */
- /* No work, make sure watchdog is off */
+ /* No work, make sure hang detection is disabled */
if (txr->tx_avail == adapter->num_tx_desc) {
- txr->queue_status = EM_QUEUE_IDLE;
+ txr->busy = EM_TX_IDLE;
return;
}
@@ -3847,7 +3952,6 @@ em_txeof(struct tx_ring *txr)
tx_buffer->m_head = NULL;
}
tx_buffer->next_eop = -1;
- txr->watchdog_time = ticks;
if (++first == adapter->num_tx_desc)
first = 0;
@@ -3872,14 +3976,16 @@ em_txeof(struct tx_ring *txr)
txr->next_to_clean = first;
/*
- ** Watchdog calculation, we know there's
- ** work outstanding or the first return
- ** would have been taken, so none processed
- ** for too long indicates a hang. local timer
- ** will examine this and do a reset if needed.
+ ** Hang detection: we know there's work outstanding
+ ** or the entry return would have been taken, so no
+ ** descriptor processed here indicates a potential hang.
+ ** The local timer will examine this and do a reset if needed.
*/
- if ((!processed) && ((ticks - txr->watchdog_time) > EM_WATCHDOG))
- txr->queue_status = EM_QUEUE_HUNG;
+ if (processed == 0) {
+ if (txr->busy != EM_TX_HUNG)
+ ++txr->busy;
+ } else /* At least one descriptor was cleaned */
+ txr->busy = EM_TX_BUSY; /* note this clears HUNG */
/*
* If we have a minimum free, clear IFF_DRV_OACTIVE
@@ -3888,13 +3994,13 @@ em_txeof(struct tx_ring *txr)
* TX lock which, with a single queue, guarantees
* sanity.
*/
- if (txr->tx_avail >= EM_MAX_SCATTER)
+ if (txr->tx_avail >= EM_MAX_SCATTER) {
if_setdrvflagbits(ifp, 0, IFF_DRV_OACTIVE);
+ }
- /* Disable watchdog if all clean */
- if (txr->tx_avail == adapter->num_tx_desc) {
- txr->queue_status = EM_QUEUE_IDLE;
- }
+ /* Disable hang detection if all clean */
+ if (txr->tx_avail == adapter->num_tx_desc)
+ txr->busy = EM_TX_IDLE;
}
@@ -4262,6 +4368,9 @@ em_initialize_receive_unit(struct adapter *adapter)
E1000_WRITE_REG(&adapter->hw, E1000_RADV,
adapter->rx_abs_int_delay.value);
+
+ E1000_WRITE_REG(&adapter->hw, E1000_RDTR,
+ adapter->rx_int_delay.value);
/*
* Set the interrupt throttling rate. Value is calculated
* as DEFAULT_ITR = 1/(MAX_INTS_PER_SEC * 256ns)
@@ -4273,20 +4382,65 @@ em_initialize_receive_unit(struct adapter *adapter)
** using the EITR register (82574 only)
*/
if (hw->mac.type == e1000_82574) {
+ u32 rfctl;
for (int i = 0; i < 4; i++)
E1000_WRITE_REG(hw, E1000_EITR_82574(i),
DEFAULT_ITR);
/* Disable accelerated acknowledge */
- E1000_WRITE_REG(hw, E1000_RFCTL, E1000_RFCTL_ACK_DIS);
+ rfctl = E1000_READ_REG(hw, E1000_RFCTL);
+ rfctl |= E1000_RFCTL_ACK_DIS;
+ E1000_WRITE_REG(hw, E1000_RFCTL, rfctl);
}
rxcsum = E1000_READ_REG(hw, E1000_RXCSUM);
- if (if_getcapenable(ifp) & IFCAP_RXCSUM)
+ if (if_getcapenable(ifp) & IFCAP_RXCSUM) {
+#ifdef EM_MULTIQUEUE
+ rxcsum |= E1000_RXCSUM_TUOFL |
+ E1000_RXCSUM_IPOFL |
+ E1000_RXCSUM_PCSD;
+#else
rxcsum |= E1000_RXCSUM_TUOFL;
- else
+#endif
+ } else
rxcsum &= ~E1000_RXCSUM_TUOFL;
+
E1000_WRITE_REG(hw, E1000_RXCSUM, rxcsum);
+#ifdef EM_MULTIQUEUE
+ if (adapter->num_queues > 1) {
+ uint32_t rss_key[10];
+ uint32_t reta;
+ int i;
+
+ /*
+ * Configure RSS key
+ */
+ arc4rand(rss_key, sizeof(rss_key), 0);
+ for (i = 0; i < 10; ++i)
+ E1000_WRITE_REG_ARRAY(hw,E1000_RSSRK(0), i, rss_key[i]);
+
+ /*
+ * Configure RSS redirect table in following fashion:
+ * (hash & ring_cnt_mask) == rdr_table[(hash & rdr_table_mask)]
+ */
+ reta = 0;
+ for (i = 0; i < 4; ++i) {
+ uint32_t q;
+ q = (i % adapter->num_queues) << 7;
+ reta |= q << (8 * i);
+ }
+ for (i = 0; i < 32; ++i)
+ E1000_WRITE_REG(hw, E1000_RETA(i), reta);
+
+ E1000_WRITE_REG(hw, E1000_MRQC, E1000_MRQC_RSS_ENABLE_2Q |
+ E1000_MRQC_RSS_FIELD_IPV4_TCP |
+ E1000_MRQC_RSS_FIELD_IPV4 |
+ E1000_MRQC_RSS_FIELD_IPV6_TCP_EX |
+ E1000_MRQC_RSS_FIELD_IPV6_EX |
+ E1000_MRQC_RSS_FIELD_IPV6 |
+ E1000_MRQC_RSS_FIELD_IPV6_TCP);
+ }
+#endif
/*
** XXX TEMPORARY WORKAROUND: on some systems with 82573
** long latencies are observed, like Lenovo X60. This
@@ -4321,13 +4475,30 @@ em_initialize_receive_unit(struct adapter *adapter)
E1000_WRITE_REG(hw, E1000_RDT(i), rdt);
}
- /* Set PTHRESH for improved jumbo performance */
+ /*
+ * Set PTHRESH for improved jumbo performance
+ * According to 10.2.5.11 of Intel 82574 Datasheet,
+ * RXDCTL(1) is written whenever RXDCTL(0) is written.
+ * Only write to RXDCTL(1) if there is a need for different
+ * settings.
+ */
if (((adapter->hw.mac.type == e1000_ich9lan) ||
(adapter->hw.mac.type == e1000_pch2lan) ||
(adapter->hw.mac.type == e1000_ich10lan)) &&
(if_getmtu(ifp) > ETHERMTU)) {
u32 rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(0));
E1000_WRITE_REG(hw, E1000_RXDCTL(0), rxdctl | 3);
+ } else if ((adapter->hw.mac.type == e1000_82574) &&
+ (if_getmtu(ifp) > ETHERMTU)) {
+ for (int i = 0; i < adapter->num_queues; i++) {
+ u32 rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(i));
+
+ rxdctl |= 0x20; /* PTHRESH */
+ rxdctl |= 4 << 8; /* HTHRESH */
+ rxdctl |= 4 << 16;/* WTHRESH */
+ rxdctl |= 1 << 24; /* Switch to granularity */
+ E1000_WRITE_REG(hw, E1000_RXDCTL(i), rxdctl);
+ }
}
if (adapter->hw.mac.type >= e1000_pch2lan) {
@@ -4394,6 +4565,11 @@ em_rxeof(struct rx_ring *rxr, int count, int *done)
EM_RX_LOCK(rxr);
+ /* Sync the ring */
+ bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map,
+ BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
+
+
#ifdef DEV_NETMAP
if (netmap_rx_irq(ifp, rxr->me, &processed)) {
EM_RX_UNLOCK(rxr);
@@ -4406,9 +4582,6 @@ em_rxeof(struct rx_ring *rxr, int count, int *done)
if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0)
break;
- bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map,
- BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
-
cur = &rxr->rx_base[i];
status = cur->status;
mp = sendmp = NULL;
@@ -4474,6 +4647,10 @@ skip:
rxr->fmp = rxr->lmp = NULL;
}
next_desc:
+ /* Sync the ring */
+ bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map,
+ BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
+
/* Zero out the receive descriptors status. */
cur->status = 0;
++rxdone; /* cumulative for POLL */
@@ -5130,12 +5307,7 @@ em_update_stats_counters(struct adapter *adapter)
adapter->stats.rlec += E1000_READ_REG(&adapter->hw, E1000_RLEC);
adapter->stats.xonrxc += E1000_READ_REG(&adapter->hw, E1000_XONRXC);
adapter->stats.xontxc += E1000_READ_REG(&adapter->hw, E1000_XONTXC);
- /*
- ** For watchdog management we need to know if we have been
- ** paused during the last interval, so capture that here.
- */
- adapter->pause_frames = E1000_READ_REG(&adapter->hw, E1000_XOFFRXC);
- adapter->stats.xoffrxc += adapter->pause_frames;
+ adapter->stats.xoffrxc += E1000_READ_REG(&adapter->hw, E1000_XOFFRXC);
adapter->stats.xofftxc += E1000_READ_REG(&adapter->hw, E1000_XOFFTXC);
adapter->stats.fcruc += E1000_READ_REG(&adapter->hw, E1000_FCRUC);
adapter->stats.prc64 += E1000_READ_REG(&adapter->hw, E1000_PRC64);
@@ -5300,10 +5472,10 @@ em_add_hw_stats(struct adapter *adapter)
CTLFLAG_RD, &adapter->hw.fc.low_water, 0,
"Flow Control Low Watermark");
- for (int i = 0; i < adapter->num_queues; i++, rxr++, txr++) {
- snprintf(namebuf, QUEUE_NAME_LEN, "queue%d", i);
+ for (int i = 0; i < adapter->num_queues; i++, txr++, rxr++) {
+ snprintf(namebuf, QUEUE_NAME_LEN, "queue_tx_%d", i);
queue_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, namebuf,
- CTLFLAG_RD, NULL, "Queue Name");
+ CTLFLAG_RD, NULL, "TX Queue Name");
queue_list = SYSCTL_CHILDREN(queue_node);
SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_head",
@@ -5322,7 +5494,12 @@ em_add_hw_stats(struct adapter *adapter)
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "no_desc_avail",
CTLFLAG_RD, &txr->no_desc_avail,
"Queue No Descriptor Available");
-
+
+ snprintf(namebuf, QUEUE_NAME_LEN, "queue_rx_%d", i);
+ queue_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, namebuf,
+ CTLFLAG_RD, NULL, "RX Queue Name");
+ queue_list = SYSCTL_CHILDREN(queue_node);
+
SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_head",
CTLTYPE_UINT | CTLFLAG_RD, adapter,
E1000_RDH(rxr->me),
@@ -5756,19 +5933,86 @@ em_print_debug_info(struct adapter *adapter)
else
printf("and ACTIVE\n");
- device_printf(dev, "hw tdh = %d, hw tdt = %d\n",
- E1000_READ_REG(&adapter->hw, E1000_TDH(0)),
- E1000_READ_REG(&adapter->hw, E1000_TDT(0)));
- device_printf(dev, "hw rdh = %d, hw rdt = %d\n",
- E1000_READ_REG(&adapter->hw, E1000_RDH(0)),
- E1000_READ_REG(&adapter->hw, E1000_RDT(0)));
- device_printf(dev, "Tx Queue Status = %d\n", txr->queue_status);
- device_printf(dev, "TX descriptors avail = %d\n",
- txr->tx_avail);
- device_printf(dev, "Tx Descriptors avail failure = %ld\n",
- txr->no_desc_avail);
- device_printf(dev, "RX discarded packets = %ld\n",
- rxr->rx_discarded);
- device_printf(dev, "RX Next to Check = %d\n", rxr->next_to_check);
- device_printf(dev, "RX Next to Refresh = %d\n", rxr->next_to_refresh);
+ for (int i = 0; i < adapter->num_queues; i++, txr++, rxr++) {
+ device_printf(dev, "TX Queue %d ------\n", i);
+ device_printf(dev, "hw tdh = %d, hw tdt = %d\n",
+ E1000_READ_REG(&adapter->hw, E1000_TDH(i)),
+ E1000_READ_REG(&adapter->hw, E1000_TDT(i)));
+ device_printf(dev, "Tx Queue Status = %d\n", txr->busy);
+ device_printf(dev, "TX descriptors avail = %d\n",
+ txr->tx_avail);
+ device_printf(dev, "Tx Descriptors avail failure = %ld\n",
+ txr->no_desc_avail);
+ device_printf(dev, "RX Queue %d ------\n", i);
+ device_printf(dev, "hw rdh = %d, hw rdt = %d\n",
+ E1000_READ_REG(&adapter->hw, E1000_RDH(i)),
+ E1000_READ_REG(&adapter->hw, E1000_RDT(i)));
+ device_printf(dev, "RX discarded packets = %ld\n",
+ rxr->rx_discarded);
+ device_printf(dev, "RX Next to Check = %d\n", rxr->next_to_check);
+ device_printf(dev, "RX Next to Refresh = %d\n", rxr->next_to_refresh);
+ }
+}
+
+#ifdef EM_MULTIQUEUE
+/*
+ * 82574 only:
+ * Write a new value to the EEPROM increasing the number of MSIX
+ * vectors from 3 to 5, for proper multiqueue support.
+ */
+static void
+em_enable_vectors_82574(struct adapter *adapter)
+{
+ struct e1000_hw *hw = &adapter->hw;
+ device_t dev = adapter->dev;
+ u16 edata;
+
+ e1000_read_nvm(hw, EM_NVM_PCIE_CTRL, 1, &edata);
+ printf("Current cap: %#06x\n", edata);
+ if (((edata & EM_NVM_MSIX_N_MASK) >> EM_NVM_MSIX_N_SHIFT) != 4) {
+ device_printf(dev, "Writing to eeprom: increasing "
+ "reported MSIX vectors from 3 to 5...\n");
+ edata &= ~(EM_NVM_MSIX_N_MASK);
+ edata |= 4 << EM_NVM_MSIX_N_SHIFT;
+ e1000_write_nvm(hw, EM_NVM_PCIE_CTRL, 1, &edata);
+ e1000_update_nvm_checksum(hw);
+ device_printf(dev, "Writing to eeprom: done\n");
+ }
+}
+#endif
+
+#ifdef DDB
+DB_COMMAND(em_reset_dev, em_ddb_reset_dev)
+{
+ devclass_t dc;
+ int max_em;
+
+ dc = devclass_find("em");
+ max_em = devclass_get_maxunit(dc);
+
+ for (int index = 0; index < (max_em - 1); index++) {
+ device_t dev;
+ dev = devclass_get_device(dc, index);
+ if (device_get_driver(dev) == &em_driver) {
+ struct adapter *adapter = device_get_softc(dev);
+ em_init_locked(adapter);
+ }
+ }
+}
+DB_COMMAND(em_dump_queue, em_ddb_dump_queue)
+{
+ devclass_t dc;
+ int max_em;
+
+ dc = devclass_find("em");
+ max_em = devclass_get_maxunit(dc);
+
+ for (int index = 0; index < (max_em - 1); index++) {
+ device_t dev;
+ dev = devclass_get_device(dc, index);
+ if (device_get_driver(dev) == &em_driver)
+ em_print_debug_info(device_get_softc(dev));
+ }
+
}
+#endif
diff --git a/sys/dev/e1000/if_em.h b/sys/dev/e1000/if_em.h
index a739815..be18a6c 100644
--- a/sys/dev/e1000/if_em.h
+++ b/sys/dev/e1000/if_em.h
@@ -1,6 +1,6 @@
/******************************************************************************
- Copyright (c) 2001-2011, Intel Corporation
+ Copyright (c) 2001-2015, Intel Corporation
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -53,7 +53,11 @@
*/
#define EM_MIN_TXD 80
#define EM_MAX_TXD 4096
+#ifdef EM_MULTIQUEUE
+#define EM_DEFAULT_TXD 4096
+#else
#define EM_DEFAULT_TXD 1024
+#endif
/*
* EM_RXD - Maximum number of receive Descriptors
@@ -70,7 +74,11 @@
*/
#define EM_MIN_RXD 80
#define EM_MAX_RXD 4096
+#ifdef EM_MULTIQUEUE
+#define EM_DEFAULT_RXD 4096
+#else
#define EM_DEFAULT_RXD 1024
+#endif
/*
* EM_TIDV - Transmit Interrupt Delay Value
@@ -117,7 +125,11 @@
* restoring the network connection. To eliminate the potential
* for the hang ensure that EM_RDTR is set to 0.
*/
+#ifdef EM_MULTIQUEUE
+#define EM_RDTR 64
+#else
#define EM_RDTR 0
+#endif
/*
* Receive Interrupt Absolute Delay Timer (Not valid for 82542/82543/82544)
@@ -130,7 +142,11 @@
* along with EM_RDTR, may improve traffic throughput in specific network
* conditions.
*/
+#ifdef EM_MULTIQUEUE
+#define EM_RADV 128
+#else
#define EM_RADV 64
+#endif
/*
* This parameter controls the max duration of transmit watchdog.
@@ -188,9 +204,19 @@
#define EM_EEPROM_APME 0x400;
#define EM_82544_APME 0x0004;
-#define EM_QUEUE_IDLE 0
-#define EM_QUEUE_WORKING 1
-#define EM_QUEUE_HUNG 2
+/*
+ * Driver state logic for the detection of a hung state
+ * in hardware. Set TX_HUNG whenever a TX packet is used
+ * (data is sent) and clear it when txeof() is invoked if
+ * any descriptors from the ring are cleaned/reclaimed.
+ * Increment internal counter if no descriptors are cleaned
+ * and compare to TX_MAXTRIES. When counter > TX_MAXTRIES,
+ * reset adapter.
+ */
+#define EM_TX_IDLE 0x00000000
+#define EM_TX_BUSY 0x00000001
+#define EM_TX_HUNG 0x80000000
+#define EM_TX_MAXTRIES 10
/*
* TDBA/RDBA should be aligned on 16 byte boundary. But TDLEN/RDLEN should be
@@ -199,7 +225,15 @@
*/
#define EM_DBA_ALIGN 128
-#define SPEED_MODE_BIT (1<<21) /* On PCI-E MACs only */
+/*
+ * See Intel 82574 Driver Programming Interface Manual, Section 10.2.6.9
+ */
+#define TARC_COMPENSATION_MODE (1 << 7) /* Compensation Mode */
+#define TARC_SPEED_MODE_BIT (1 << 21) /* On PCI-E MACs only */
+#define TARC_MQ_FIX (1 << 23) | \
+ (1 << 24) | \
+ (1 << 25) /* Handle errata in MQ mode */
+#define TARC_ERRATA_BIT (1 << 26) /* Note from errata on 82574 */
/* PCI Config defines */
#define EM_BAR_TYPE(v) ((v) & EM_BAR_TYPE_MASK)
@@ -249,6 +283,14 @@
* solve it just using this define.
*/
#define EM_EIAC 0x000DC
+/*
+ * 82574 only reports 3 MSI-X vectors by default;
+ * defines assisting with making it report 5 are
+ * located here.
+ */
+#define EM_NVM_PCIE_CTRL 0x1B
+#define EM_NVM_MSIX_N_MASK (0x7 << EM_NVM_MSIX_N_SHIFT)
+#define EM_NVM_MSIX_N_SHIFT 7
/*
* Bus dma allocation structure used by
@@ -281,8 +323,7 @@ struct tx_ring {
u32 me;
u32 msix;
u32 ims;
- int queue_status;
- int watchdog_time;
+ int busy;
struct em_dma_alloc txdma;
struct e1000_tx_desc *tx_base;
struct task tx_task;
@@ -368,7 +409,6 @@ struct adapter {
int if_flags;
int max_frame_size;
int min_frame_size;
- int pause_frames;
struct mtx core_mtx;
int em_insert_vlan_header;
u32 ims;
@@ -383,7 +423,7 @@ struct adapter {
eventhandler_tag vlan_detach;
u16 num_vlans;
- u16 num_queues;
+ u8 num_queues;
/*
* Transmit rings:
diff --git a/sys/dev/fdt/fdt_common.c b/sys/dev/fdt/fdt_common.c
index 0198d55..f00519e 100644
--- a/sys/dev/fdt/fdt_common.c
+++ b/sys/dev/fdt/fdt_common.c
@@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$");
#define FDT_COMPAT_LEN 255
#define FDT_TYPE_LEN 64
-#define FDT_NAME_LEN 32
#define FDT_REG_CELLS 4
@@ -311,22 +310,6 @@ fdt_find_compatible(phandle_t start, const char *compat, int strict)
}
phandle_t
-fdt_find_child(phandle_t start, const char *child_name)
-{
- char name[FDT_NAME_LEN];
- phandle_t child;
-
- for (child = OF_child(start); child != 0; child = OF_peer(child)) {
- if (OF_getprop(child, "name", name, sizeof(name)) <= 0)
- continue;
- if (strcmp(name, child_name) == 0)
- return (child);
- }
-
- return (0);
-}
-
-phandle_t
fdt_depth_search_compatible(phandle_t start, const char *compat, int strict)
{
phandle_t child, node;
diff --git a/sys/dev/fdt/fdt_common.h b/sys/dev/fdt/fdt_common.h
index 6801297..3d05341 100644
--- a/sys/dev/fdt/fdt_common.h
+++ b/sys/dev/fdt/fdt_common.h
@@ -81,7 +81,6 @@ u_long fdt_data_get(void *, int);
int fdt_data_to_res(pcell_t *, int, int, u_long *, u_long *);
phandle_t fdt_find_compatible(phandle_t, const char *, int);
phandle_t fdt_depth_search_compatible(phandle_t, const char *, int);
-phandle_t fdt_find_child(phandle_t, const char *);
int fdt_get_mem_regions(struct mem_region *, int *, uint32_t *);
int fdt_get_reserved_regions(struct mem_region *, int *);
int fdt_get_phyaddr(phandle_t, device_t, int *, void **);
diff --git a/sys/dev/gpio/gpioled.c b/sys/dev/gpio/gpioled.c
index 5af7373..01710c2 100644
--- a/sys/dev/gpio/gpioled.c
+++ b/sys/dev/gpio/gpioled.c
@@ -166,8 +166,10 @@ static int
gpioled_attach(device_t dev)
{
struct gpioled_softc *sc;
+ int state;
#ifdef FDT
phandle_t node;
+ char *default_state;
char *name;
#else
const char *name;
@@ -177,10 +179,29 @@ gpioled_attach(device_t dev)
sc->sc_dev = dev;
sc->sc_busdev = device_get_parent(dev);
GPIOLED_LOCK_INIT(sc);
+
+ state = 0;
+
#ifdef FDT
- name = NULL;
if ((node = ofw_bus_get_node(dev)) == -1)
return (ENXIO);
+
+ if (OF_getprop_alloc(node, "default-state",
+ sizeof(char), (void **)&default_state) != -1) {
+ if (strcasecmp(default_state, "on") == 0)
+ state = 1;
+ else if (strcasecmp(default_state, "off") == 0)
+ state = 0;
+ else if (strcasecmp(default_state, "keep") == 0)
+ state = -1;
+ else {
+ device_printf(dev,
+ "unknown value for default-state in FDT\n");
+ }
+ free(default_state, M_OFWPROP);
+ }
+
+ name = NULL;
if (OF_getprop_alloc(node, "label", 1, (void **)&name) == -1)
OF_getprop_alloc(node, "name", 1, (void **)&name);
#else
@@ -189,8 +210,8 @@ gpioled_attach(device_t dev)
name = NULL;
#endif
- sc->sc_leddev = led_create(gpioled_control, sc, name ? name :
- device_get_nameunit(dev));
+ sc->sc_leddev = led_create_state(gpioled_control, sc, name ? name :
+ device_get_nameunit(dev), state);
#ifdef FDT
if (name != NULL)
free(name, M_OFWPROP);
diff --git a/sys/dev/hwpmc/hwpmc_armv7.c b/sys/dev/hwpmc/hwpmc_armv7.c
index 66d4971..469eca8 100644
--- a/sys/dev/hwpmc/hwpmc_armv7.c
+++ b/sys/dev/hwpmc/hwpmc_armv7.c
@@ -39,9 +39,6 @@ __FBSDID("$FreeBSD$");
#include <machine/pmc_mdep.h>
#include <machine/cpu.h>
-#define CPU_ID_CORTEX_VER_MASK 0xff
-#define CPU_ID_CORTEX_VER_SHIFT 4
-
static int armv7_npmcs;
struct armv7_event_code_map {
@@ -49,49 +46,11 @@ struct armv7_event_code_map {
uint8_t pe_code;
};
-const struct armv7_event_code_map armv7_event_codes[] = {
- { PMC_EV_ARMV7_PMNC_SW_INCR, 0x00 },
- { PMC_EV_ARMV7_L1_ICACHE_REFILL, 0x01 },
- { PMC_EV_ARMV7_ITLB_REFILL, 0x02 },
- { PMC_EV_ARMV7_L1_DCACHE_REFILL, 0x03 },
- { PMC_EV_ARMV7_L1_DCACHE_ACCESS, 0x04 },
- { PMC_EV_ARMV7_DTLB_REFILL, 0x05 },
- { PMC_EV_ARMV7_MEM_READ, 0x06 },
- { PMC_EV_ARMV7_MEM_WRITE, 0x07 },
- { PMC_EV_ARMV7_INSTR_EXECUTED, 0x08 },
- { PMC_EV_ARMV7_EXC_TAKEN, 0x09 },
- { PMC_EV_ARMV7_EXC_EXECUTED, 0x0A },
- { PMC_EV_ARMV7_CID_WRITE, 0x0B },
- { PMC_EV_ARMV7_PC_WRITE, 0x0C },
- { PMC_EV_ARMV7_PC_IMM_BRANCH, 0x0D },
- { PMC_EV_ARMV7_PC_PROC_RETURN, 0x0E },
- { PMC_EV_ARMV7_MEM_UNALIGNED_ACCESS, 0x0F },
- { PMC_EV_ARMV7_PC_BRANCH_MIS_PRED, 0x10 },
- { PMC_EV_ARMV7_CLOCK_CYCLES, 0x11 },
- { PMC_EV_ARMV7_PC_BRANCH_PRED, 0x12 },
- { PMC_EV_ARMV7_MEM_ACCESS, 0x13 },
- { PMC_EV_ARMV7_L1_ICACHE_ACCESS, 0x14 },
- { PMC_EV_ARMV7_L1_DCACHE_WB, 0x15 },
- { PMC_EV_ARMV7_L2_CACHE_ACCESS, 0x16 },
- { PMC_EV_ARMV7_L2_CACHE_REFILL, 0x17 },
- { PMC_EV_ARMV7_L2_CACHE_WB, 0x18 },
- { PMC_EV_ARMV7_BUS_ACCESS, 0x19 },
- { PMC_EV_ARMV7_MEM_ERROR, 0x1A },
- { PMC_EV_ARMV7_INSTR_SPEC, 0x1B },
- { PMC_EV_ARMV7_TTBR_WRITE, 0x1C },
- { PMC_EV_ARMV7_BUS_CYCLES, 0x1D },
- { PMC_EV_ARMV7_CPU_CYCLES, 0xFF },
-};
-
-const int armv7_event_codes_size =
- sizeof(armv7_event_codes) / sizeof(armv7_event_codes[0]);
-
/*
* Per-processor information.
*/
struct armv7_cpu {
struct pmc_hw *pc_armv7pmcs;
- int cortex_ver;
};
static struct armv7_cpu **armv7_pcpu;
@@ -173,10 +132,10 @@ static int
armv7_allocate_pmc(int cpu, int ri, struct pmc *pm,
const struct pmc_op_pmcallocate *a)
{
- uint32_t caps, config;
struct armv7_cpu *pac;
enum pmc_event pe;
- int i;
+ uint32_t config;
+ uint32_t caps;
KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
("[armv7,%d] illegal CPU value %d", __LINE__, cpu));
@@ -190,18 +149,10 @@ armv7_allocate_pmc(int cpu, int ri, struct pmc *pm,
return (EINVAL);
pe = a->pm_ev;
- for (i = 0; i < armv7_event_codes_size; i++) {
- if (armv7_event_codes[i].pe_ev == pe) {
- config = armv7_event_codes[i].pe_code;
- break;
- }
- }
- if (i == armv7_event_codes_size)
- return EINVAL;
-
+ config = (pe & EVENT_ID_MASK);
pm->pm_md.pm_armv7.pm_armv7_evsel = config;
- PMCDBG2(MDP,ALL,2,"armv7-allocate ri=%d -> config=0x%x", ri, config);
+ PMCDBG2(MDP, ALL, 2, "armv7-allocate ri=%d -> config=0x%x", ri, config);
return 0;
}
@@ -225,7 +176,7 @@ armv7_read_pmc(int cpu, int ri, pmc_value_t *v)
else
tmp = armv7_pmcn_read(ri);
- PMCDBG2(MDP,REA,2,"armv7-read id=%d -> %jd", ri, tmp);
+ PMCDBG2(MDP, REA, 2, "armv7-read id=%d -> %jd", ri, tmp);
if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm)))
*v = ARMV7_PERFCTR_VALUE_TO_RELOAD_COUNT(tmp);
else
@@ -249,7 +200,7 @@ armv7_write_pmc(int cpu, int ri, pmc_value_t v)
if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm)))
v = ARMV7_RELOAD_COUNT_TO_PERFCTR_VALUE(v);
- PMCDBG3(MDP,WRI,1,"armv7-write cpu=%d ri=%d v=%jx", cpu, ri, v);
+ PMCDBG3(MDP, WRI, 1, "armv7-write cpu=%d ri=%d v=%jx", cpu, ri, v);
if (pm->pm_md.pm_armv7.pm_armv7_evsel == 0xFF)
cp15_pmccntr_set(v);
@@ -264,7 +215,7 @@ armv7_config_pmc(int cpu, int ri, struct pmc *pm)
{
struct pmc_hw *phw;
- PMCDBG3(MDP,CFG,1, "cpu=%d ri=%d pm=%p", cpu, ri, pm);
+ PMCDBG3(MDP, CFG, 1, "cpu=%d ri=%d pm=%p", cpu, ri, pm);
KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
("[armv7,%d] illegal CPU value %d", __LINE__, cpu));
@@ -457,20 +408,15 @@ armv7_pcpu_init(struct pmc_mdep *md, int cpu)
struct pmc_cpu *pc;
uint32_t pmnc;
int first_ri;
- int cpuid;
int i;
KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
("[armv7,%d] wrong cpu number %d", __LINE__, cpu));
- PMCDBG1(MDP,INI,1,"armv7-init cpu=%d", cpu);
+ PMCDBG1(MDP, INI, 1, "armv7-init cpu=%d", cpu);
armv7_pcpu[cpu] = pac = malloc(sizeof(struct armv7_cpu), M_PMC,
M_WAITOK|M_ZERO);
- cpuid = cpu_ident();
- pac->cortex_ver = (cpuid >> CPU_ID_CORTEX_VER_SHIFT) & \
- CPU_ID_CORTEX_VER_MASK;
-
pac->pc_armv7pmcs = malloc(sizeof(struct pmc_hw) * armv7_npmcs,
M_PMC, M_WAITOK|M_ZERO);
pc = pmc_pcpu[cpu];
@@ -509,14 +455,15 @@ pmc_armv7_initialize()
{
struct pmc_mdep *pmc_mdep;
struct pmc_classdep *pcd;
+ int idcode;
int reg;
reg = cp15_pmcr_get();
-
armv7_npmcs = (reg >> ARMV7_PMNC_N_SHIFT) & \
ARMV7_PMNC_N_MASK;
+ idcode = (reg & ARMV7_IDCODE_MASK) >> ARMV7_IDCODE_SHIFT;
- PMCDBG1(MDP,INI,1,"armv7-init npmcs=%d", armv7_npmcs);
+ PMCDBG1(MDP, INI, 1, "armv7-init npmcs=%d", armv7_npmcs);
/*
* Allocate space for pointers to PMC HW descriptors and for
@@ -527,7 +474,20 @@ pmc_armv7_initialize()
/* Just one class */
pmc_mdep = pmc_mdep_alloc(1);
- pmc_mdep->pmd_cputype = PMC_CPU_ARMV7;
+
+ switch (idcode) {
+ case ARMV7_IDCODE_CORTEX_A9:
+ pmc_mdep->pmd_cputype = PMC_CPU_ARMV7_CORTEX_A9;
+ break;
+ default:
+ case ARMV7_IDCODE_CORTEX_A8:
+ /*
+ * On A8 we implemented common events only,
+ * so use it for the rest of machines.
+ */
+ pmc_mdep->pmd_cputype = PMC_CPU_ARMV7_CORTEX_A8;
+ break;
+ }
pcd = &pmc_mdep->pmd_classdep[PMC_MDEP_CLASS_INDEX_ARMV7];
pcd->pcd_caps = ARMV7_PMC_CAPS;
diff --git a/sys/dev/hwpmc/hwpmc_armv7.h b/sys/dev/hwpmc/hwpmc_armv7.h
index 35f7d5b..5282345f 100644
--- a/sys/dev/hwpmc/hwpmc_armv7.h
+++ b/sys/dev/hwpmc/hwpmc_armv7.h
@@ -48,9 +48,14 @@
#define ARMV7_PMNC_N_SHIFT 11 /* Number of counters implemented */
#define ARMV7_PMNC_N_MASK 0x1f
#define ARMV7_PMNC_MASK 0x3f /* Writable bits */
+#define ARMV7_IDCODE_SHIFT 16 /* Identification code */
+#define ARMV7_IDCODE_MASK (0xff << ARMV7_IDCODE_SHIFT)
+#define ARMV7_IDCODE_CORTEX_A9 9
+#define ARMV7_IDCODE_CORTEX_A8 8
#define ARMV7_RELOAD_COUNT_TO_PERFCTR_VALUE(R) (-(R))
#define ARMV7_PERFCTR_VALUE_TO_RELOAD_COUNT(P) (-(P))
+#define EVENT_ID_MASK 0xFF
#ifdef _KERNEL
/* MD extension for 'struct pmc' */
diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c
index d1b56f1..131eb35 100644
--- a/sys/dev/hwpmc/hwpmc_mod.c
+++ b/sys/dev/hwpmc/hwpmc_mod.c
@@ -1655,7 +1655,8 @@ pmc_log_process_mappings(struct pmc_owner *po, struct proc *p)
continue;
}
- if (lobj->type != OBJT_VNODE || lobj->handle == NULL) {
+ vp = vm_object_vnode(lobj);
+ if (vp == NULL) {
if (lobj != obj)
VM_OBJECT_RUNLOCK(lobj);
VM_OBJECT_RUNLOCK(obj);
@@ -1667,7 +1668,7 @@ pmc_log_process_mappings(struct pmc_owner *po, struct proc *p)
* vnode, so we don't emit redundant MAP-IN
* directives.
*/
- if (entry->start == last_end && lobj->handle == last_vp) {
+ if (entry->start == last_end && vp == last_vp) {
last_end = entry->end;
if (lobj != obj)
VM_OBJECT_RUNLOCK(lobj);
@@ -1690,7 +1691,6 @@ pmc_log_process_mappings(struct pmc_owner *po, struct proc *p)
last_timestamp = map->timestamp;
vm_map_unlock_read(map);
- vp = lobj->handle;
vref(vp);
if (lobj != obj)
VM_OBJECT_RUNLOCK(lobj);
diff --git a/sys/dev/hwpmc/pmc_events.h b/sys/dev/hwpmc/pmc_events.h
index 467367f..96dc900 100644
--- a/sys/dev/hwpmc/pmc_events.h
+++ b/sys/dev/hwpmc/pmc_events.h
@@ -4766,41 +4766,342 @@ __PMC_EV_ALIAS("IMPC_C0H_TRK_REQUEST.ALL", UCP_EVENT_84H_01H)
* ARMv7 Events
*/
-#define __PMC_EV_ARMV7() \
- __PMC_EV(ARMV7, PMNC_SW_INCR) \
- __PMC_EV(ARMV7, L1_ICACHE_REFILL) \
- __PMC_EV(ARMV7, ITLB_REFILL) \
- __PMC_EV(ARMV7, L1_DCACHE_REFILL) \
- __PMC_EV(ARMV7, L1_DCACHE_ACCESS) \
- __PMC_EV(ARMV7, DTLB_REFILL) \
- __PMC_EV(ARMV7, MEM_READ) \
- __PMC_EV(ARMV7, MEM_WRITE) \
- __PMC_EV(ARMV7, INSTR_EXECUTED) \
- __PMC_EV(ARMV7, EXC_TAKEN) \
- __PMC_EV(ARMV7, EXC_EXECUTED) \
- __PMC_EV(ARMV7, CID_WRITE) \
- __PMC_EV(ARMV7, PC_WRITE) \
- __PMC_EV(ARMV7, PC_IMM_BRANCH) \
- __PMC_EV(ARMV7, PC_PROC_RETURN) \
- __PMC_EV(ARMV7, MEM_UNALIGNED_ACCESS) \
- __PMC_EV(ARMV7, PC_BRANCH_MIS_PRED) \
- __PMC_EV(ARMV7, CLOCK_CYCLES) \
- __PMC_EV(ARMV7, PC_BRANCH_PRED) \
- __PMC_EV(ARMV7, MEM_ACCESS) \
- __PMC_EV(ARMV7, L1_ICACHE_ACCESS) \
- __PMC_EV(ARMV7, L1_DCACHE_WB) \
- __PMC_EV(ARMV7, L2_CACHE_ACCESS) \
- __PMC_EV(ARMV7, L2_CACHE_REFILL) \
- __PMC_EV(ARMV7, L2_CACHE_WB) \
- __PMC_EV(ARMV7, BUS_ACCESS) \
- __PMC_EV(ARMV7, MEM_ERROR) \
- __PMC_EV(ARMV7, INSTR_SPEC) \
- __PMC_EV(ARMV7, TTBR_WRITE) \
- __PMC_EV(ARMV7, BUS_CYCLES) \
- __PMC_EV(ARMV7, CPU_CYCLES)
+#define __PMC_EV_ARMV7() \
+ __PMC_EV(ARMV7, EVENT_00H) \
+ __PMC_EV(ARMV7, EVENT_01H) \
+ __PMC_EV(ARMV7, EVENT_02H) \
+ __PMC_EV(ARMV7, EVENT_03H) \
+ __PMC_EV(ARMV7, EVENT_04H) \
+ __PMC_EV(ARMV7, EVENT_05H) \
+ __PMC_EV(ARMV7, EVENT_06H) \
+ __PMC_EV(ARMV7, EVENT_07H) \
+ __PMC_EV(ARMV7, EVENT_08H) \
+ __PMC_EV(ARMV7, EVENT_09H) \
+ __PMC_EV(ARMV7, EVENT_0AH) \
+ __PMC_EV(ARMV7, EVENT_0BH) \
+ __PMC_EV(ARMV7, EVENT_0CH) \
+ __PMC_EV(ARMV7, EVENT_0DH) \
+ __PMC_EV(ARMV7, EVENT_0EH) \
+ __PMC_EV(ARMV7, EVENT_0FH) \
+ __PMC_EV(ARMV7, EVENT_10H) \
+ __PMC_EV(ARMV7, EVENT_11H) \
+ __PMC_EV(ARMV7, EVENT_12H) \
+ __PMC_EV(ARMV7, EVENT_13H) \
+ __PMC_EV(ARMV7, EVENT_14H) \
+ __PMC_EV(ARMV7, EVENT_15H) \
+ __PMC_EV(ARMV7, EVENT_16H) \
+ __PMC_EV(ARMV7, EVENT_17H) \
+ __PMC_EV(ARMV7, EVENT_18H) \
+ __PMC_EV(ARMV7, EVENT_19H) \
+ __PMC_EV(ARMV7, EVENT_1AH) \
+ __PMC_EV(ARMV7, EVENT_1BH) \
+ __PMC_EV(ARMV7, EVENT_1CH) \
+ __PMC_EV(ARMV7, EVENT_1DH) \
+ __PMC_EV(ARMV7, EVENT_1EH) \
+ __PMC_EV(ARMV7, EVENT_1FH) \
+ __PMC_EV(ARMV7, EVENT_20H) \
+ __PMC_EV(ARMV7, EVENT_21H) \
+ __PMC_EV(ARMV7, EVENT_22H) \
+ __PMC_EV(ARMV7, EVENT_23H) \
+ __PMC_EV(ARMV7, EVENT_24H) \
+ __PMC_EV(ARMV7, EVENT_25H) \
+ __PMC_EV(ARMV7, EVENT_26H) \
+ __PMC_EV(ARMV7, EVENT_27H) \
+ __PMC_EV(ARMV7, EVENT_28H) \
+ __PMC_EV(ARMV7, EVENT_29H) \
+ __PMC_EV(ARMV7, EVENT_2AH) \
+ __PMC_EV(ARMV7, EVENT_2BH) \
+ __PMC_EV(ARMV7, EVENT_2CH) \
+ __PMC_EV(ARMV7, EVENT_2DH) \
+ __PMC_EV(ARMV7, EVENT_2EH) \
+ __PMC_EV(ARMV7, EVENT_2FH) \
+ __PMC_EV(ARMV7, EVENT_30H) \
+ __PMC_EV(ARMV7, EVENT_31H) \
+ __PMC_EV(ARMV7, EVENT_32H) \
+ __PMC_EV(ARMV7, EVENT_33H) \
+ __PMC_EV(ARMV7, EVENT_34H) \
+ __PMC_EV(ARMV7, EVENT_35H) \
+ __PMC_EV(ARMV7, EVENT_36H) \
+ __PMC_EV(ARMV7, EVENT_37H) \
+ __PMC_EV(ARMV7, EVENT_38H) \
+ __PMC_EV(ARMV7, EVENT_39H) \
+ __PMC_EV(ARMV7, EVENT_3AH) \
+ __PMC_EV(ARMV7, EVENT_3BH) \
+ __PMC_EV(ARMV7, EVENT_3CH) \
+ __PMC_EV(ARMV7, EVENT_3DH) \
+ __PMC_EV(ARMV7, EVENT_3EH) \
+ __PMC_EV(ARMV7, EVENT_3FH) \
+ __PMC_EV(ARMV7, EVENT_40H) \
+ __PMC_EV(ARMV7, EVENT_41H) \
+ __PMC_EV(ARMV7, EVENT_42H) \
+ __PMC_EV(ARMV7, EVENT_43H) \
+ __PMC_EV(ARMV7, EVENT_44H) \
+ __PMC_EV(ARMV7, EVENT_45H) \
+ __PMC_EV(ARMV7, EVENT_46H) \
+ __PMC_EV(ARMV7, EVENT_47H) \
+ __PMC_EV(ARMV7, EVENT_48H) \
+ __PMC_EV(ARMV7, EVENT_49H) \
+ __PMC_EV(ARMV7, EVENT_4AH) \
+ __PMC_EV(ARMV7, EVENT_4BH) \
+ __PMC_EV(ARMV7, EVENT_4CH) \
+ __PMC_EV(ARMV7, EVENT_4DH) \
+ __PMC_EV(ARMV7, EVENT_4EH) \
+ __PMC_EV(ARMV7, EVENT_4FH) \
+ __PMC_EV(ARMV7, EVENT_50H) \
+ __PMC_EV(ARMV7, EVENT_51H) \
+ __PMC_EV(ARMV7, EVENT_52H) \
+ __PMC_EV(ARMV7, EVENT_53H) \
+ __PMC_EV(ARMV7, EVENT_54H) \
+ __PMC_EV(ARMV7, EVENT_55H) \
+ __PMC_EV(ARMV7, EVENT_56H) \
+ __PMC_EV(ARMV7, EVENT_57H) \
+ __PMC_EV(ARMV7, EVENT_58H) \
+ __PMC_EV(ARMV7, EVENT_59H) \
+ __PMC_EV(ARMV7, EVENT_5AH) \
+ __PMC_EV(ARMV7, EVENT_5BH) \
+ __PMC_EV(ARMV7, EVENT_5CH) \
+ __PMC_EV(ARMV7, EVENT_5DH) \
+ __PMC_EV(ARMV7, EVENT_5EH) \
+ __PMC_EV(ARMV7, EVENT_5FH) \
+ __PMC_EV(ARMV7, EVENT_60H) \
+ __PMC_EV(ARMV7, EVENT_61H) \
+ __PMC_EV(ARMV7, EVENT_62H) \
+ __PMC_EV(ARMV7, EVENT_63H) \
+ __PMC_EV(ARMV7, EVENT_64H) \
+ __PMC_EV(ARMV7, EVENT_65H) \
+ __PMC_EV(ARMV7, EVENT_66H) \
+ __PMC_EV(ARMV7, EVENT_67H) \
+ __PMC_EV(ARMV7, EVENT_68H) \
+ __PMC_EV(ARMV7, EVENT_69H) \
+ __PMC_EV(ARMV7, EVENT_6AH) \
+ __PMC_EV(ARMV7, EVENT_6BH) \
+ __PMC_EV(ARMV7, EVENT_6CH) \
+ __PMC_EV(ARMV7, EVENT_6DH) \
+ __PMC_EV(ARMV7, EVENT_6EH) \
+ __PMC_EV(ARMV7, EVENT_6FH) \
+ __PMC_EV(ARMV7, EVENT_70H) \
+ __PMC_EV(ARMV7, EVENT_71H) \
+ __PMC_EV(ARMV7, EVENT_72H) \
+ __PMC_EV(ARMV7, EVENT_73H) \
+ __PMC_EV(ARMV7, EVENT_74H) \
+ __PMC_EV(ARMV7, EVENT_75H) \
+ __PMC_EV(ARMV7, EVENT_76H) \
+ __PMC_EV(ARMV7, EVENT_77H) \
+ __PMC_EV(ARMV7, EVENT_78H) \
+ __PMC_EV(ARMV7, EVENT_79H) \
+ __PMC_EV(ARMV7, EVENT_7AH) \
+ __PMC_EV(ARMV7, EVENT_7BH) \
+ __PMC_EV(ARMV7, EVENT_7CH) \
+ __PMC_EV(ARMV7, EVENT_7DH) \
+ __PMC_EV(ARMV7, EVENT_7EH) \
+ __PMC_EV(ARMV7, EVENT_7FH) \
+ __PMC_EV(ARMV7, EVENT_80H) \
+ __PMC_EV(ARMV7, EVENT_81H) \
+ __PMC_EV(ARMV7, EVENT_82H) \
+ __PMC_EV(ARMV7, EVENT_83H) \
+ __PMC_EV(ARMV7, EVENT_84H) \
+ __PMC_EV(ARMV7, EVENT_85H) \
+ __PMC_EV(ARMV7, EVENT_86H) \
+ __PMC_EV(ARMV7, EVENT_87H) \
+ __PMC_EV(ARMV7, EVENT_88H) \
+ __PMC_EV(ARMV7, EVENT_89H) \
+ __PMC_EV(ARMV7, EVENT_8AH) \
+ __PMC_EV(ARMV7, EVENT_8BH) \
+ __PMC_EV(ARMV7, EVENT_8CH) \
+ __PMC_EV(ARMV7, EVENT_8DH) \
+ __PMC_EV(ARMV7, EVENT_8EH) \
+ __PMC_EV(ARMV7, EVENT_8FH) \
+ __PMC_EV(ARMV7, EVENT_90H) \
+ __PMC_EV(ARMV7, EVENT_91H) \
+ __PMC_EV(ARMV7, EVENT_92H) \
+ __PMC_EV(ARMV7, EVENT_93H) \
+ __PMC_EV(ARMV7, EVENT_94H) \
+ __PMC_EV(ARMV7, EVENT_95H) \
+ __PMC_EV(ARMV7, EVENT_96H) \
+ __PMC_EV(ARMV7, EVENT_97H) \
+ __PMC_EV(ARMV7, EVENT_98H) \
+ __PMC_EV(ARMV7, EVENT_99H) \
+ __PMC_EV(ARMV7, EVENT_9AH) \
+ __PMC_EV(ARMV7, EVENT_9BH) \
+ __PMC_EV(ARMV7, EVENT_9CH) \
+ __PMC_EV(ARMV7, EVENT_9DH) \
+ __PMC_EV(ARMV7, EVENT_9EH) \
+ __PMC_EV(ARMV7, EVENT_9FH) \
+ __PMC_EV(ARMV7, EVENT_A0H) \
+ __PMC_EV(ARMV7, EVENT_A1H) \
+ __PMC_EV(ARMV7, EVENT_A2H) \
+ __PMC_EV(ARMV7, EVENT_A3H) \
+ __PMC_EV(ARMV7, EVENT_A4H) \
+ __PMC_EV(ARMV7, EVENT_A5H) \
+ __PMC_EV(ARMV7, EVENT_A6H) \
+ __PMC_EV(ARMV7, EVENT_A7H) \
+ __PMC_EV(ARMV7, EVENT_A8H) \
+ __PMC_EV(ARMV7, EVENT_A9H) \
+ __PMC_EV(ARMV7, EVENT_AAH) \
+ __PMC_EV(ARMV7, EVENT_ABH) \
+ __PMC_EV(ARMV7, EVENT_ACH) \
+ __PMC_EV(ARMV7, EVENT_ADH) \
+ __PMC_EV(ARMV7, EVENT_AEH) \
+ __PMC_EV(ARMV7, EVENT_AFH) \
+ __PMC_EV(ARMV7, EVENT_B0H) \
+ __PMC_EV(ARMV7, EVENT_B1H) \
+ __PMC_EV(ARMV7, EVENT_B2H) \
+ __PMC_EV(ARMV7, EVENT_B3H) \
+ __PMC_EV(ARMV7, EVENT_B4H) \
+ __PMC_EV(ARMV7, EVENT_B5H) \
+ __PMC_EV(ARMV7, EVENT_B6H) \
+ __PMC_EV(ARMV7, EVENT_B7H) \
+ __PMC_EV(ARMV7, EVENT_B8H) \
+ __PMC_EV(ARMV7, EVENT_B9H) \
+ __PMC_EV(ARMV7, EVENT_BAH) \
+ __PMC_EV(ARMV7, EVENT_BBH) \
+ __PMC_EV(ARMV7, EVENT_BCH) \
+ __PMC_EV(ARMV7, EVENT_BDH) \
+ __PMC_EV(ARMV7, EVENT_BEH) \
+ __PMC_EV(ARMV7, EVENT_BFH) \
+ __PMC_EV(ARMV7, EVENT_C0H) \
+ __PMC_EV(ARMV7, EVENT_C1H) \
+ __PMC_EV(ARMV7, EVENT_C2H) \
+ __PMC_EV(ARMV7, EVENT_C3H) \
+ __PMC_EV(ARMV7, EVENT_C4H) \
+ __PMC_EV(ARMV7, EVENT_C5H) \
+ __PMC_EV(ARMV7, EVENT_C6H) \
+ __PMC_EV(ARMV7, EVENT_C7H) \
+ __PMC_EV(ARMV7, EVENT_C8H) \
+ __PMC_EV(ARMV7, EVENT_C9H) \
+ __PMC_EV(ARMV7, EVENT_CAH) \
+ __PMC_EV(ARMV7, EVENT_CBH) \
+ __PMC_EV(ARMV7, EVENT_CCH) \
+ __PMC_EV(ARMV7, EVENT_CDH) \
+ __PMC_EV(ARMV7, EVENT_CEH) \
+ __PMC_EV(ARMV7, EVENT_CFH) \
+ __PMC_EV(ARMV7, EVENT_D0H) \
+ __PMC_EV(ARMV7, EVENT_D1H) \
+ __PMC_EV(ARMV7, EVENT_D2H) \
+ __PMC_EV(ARMV7, EVENT_D3H) \
+ __PMC_EV(ARMV7, EVENT_D4H) \
+ __PMC_EV(ARMV7, EVENT_D5H) \
+ __PMC_EV(ARMV7, EVENT_D6H) \
+ __PMC_EV(ARMV7, EVENT_D7H) \
+ __PMC_EV(ARMV7, EVENT_D8H) \
+ __PMC_EV(ARMV7, EVENT_D9H) \
+ __PMC_EV(ARMV7, EVENT_DAH) \
+ __PMC_EV(ARMV7, EVENT_DBH) \
+ __PMC_EV(ARMV7, EVENT_DCH) \
+ __PMC_EV(ARMV7, EVENT_DDH) \
+ __PMC_EV(ARMV7, EVENT_DEH) \
+ __PMC_EV(ARMV7, EVENT_DFH) \
+ __PMC_EV(ARMV7, EVENT_E0H) \
+ __PMC_EV(ARMV7, EVENT_E1H) \
+ __PMC_EV(ARMV7, EVENT_E2H) \
+ __PMC_EV(ARMV7, EVENT_E3H) \
+ __PMC_EV(ARMV7, EVENT_E4H) \
+ __PMC_EV(ARMV7, EVENT_E5H) \
+ __PMC_EV(ARMV7, EVENT_E6H) \
+ __PMC_EV(ARMV7, EVENT_E7H) \
+ __PMC_EV(ARMV7, EVENT_E8H) \
+ __PMC_EV(ARMV7, EVENT_E9H) \
+ __PMC_EV(ARMV7, EVENT_EAH) \
+ __PMC_EV(ARMV7, EVENT_EBH) \
+ __PMC_EV(ARMV7, EVENT_ECH) \
+ __PMC_EV(ARMV7, EVENT_EDH) \
+ __PMC_EV(ARMV7, EVENT_EEH) \
+ __PMC_EV(ARMV7, EVENT_EFH) \
+ __PMC_EV(ARMV7, EVENT_F0H) \
+ __PMC_EV(ARMV7, EVENT_F1H) \
+ __PMC_EV(ARMV7, EVENT_F2H) \
+ __PMC_EV(ARMV7, EVENT_F3H) \
+ __PMC_EV(ARMV7, EVENT_F4H) \
+ __PMC_EV(ARMV7, EVENT_F5H) \
+ __PMC_EV(ARMV7, EVENT_F6H) \
+ __PMC_EV(ARMV7, EVENT_F7H) \
+ __PMC_EV(ARMV7, EVENT_F8H) \
+ __PMC_EV(ARMV7, EVENT_F9H) \
+ __PMC_EV(ARMV7, EVENT_FAH) \
+ __PMC_EV(ARMV7, EVENT_FBH) \
+ __PMC_EV(ARMV7, EVENT_FCH) \
+ __PMC_EV(ARMV7, EVENT_FDH) \
+ __PMC_EV(ARMV7, EVENT_FEH) \
+ __PMC_EV(ARMV7, EVENT_FFH)
-#define PMC_EV_ARMV7_FIRST PMC_EV_ARMV7_PMNC_SW_INCR
-#define PMC_EV_ARMV7_LAST PMC_EV_ARMV7_CPU_CYCLES
+#define PMC_EV_ARMV7_FIRST PMC_EV_ARMV7_EVENT_00H
+#define PMC_EV_ARMV7_LAST PMC_EV_ARMV7_EVENT_FFH
+
+#define __PMC_EV_ALIAS_ARMV7_COMMON() \
+ __PMC_EV_ALIAS("PMNC_SW_INCR", ARMV7_EVENT_00H) \
+ __PMC_EV_ALIAS("L1_ICACHE_REFILL", ARMV7_EVENT_01H) \
+ __PMC_EV_ALIAS("ITLB_REFILL", ARMV7_EVENT_02H) \
+ __PMC_EV_ALIAS("L1_DCACHE_REFILL", ARMV7_EVENT_03H) \
+ __PMC_EV_ALIAS("L1_DCACHE_ACCESS", ARMV7_EVENT_04H) \
+ __PMC_EV_ALIAS("DTLB_REFILL", ARMV7_EVENT_05H) \
+ __PMC_EV_ALIAS("MEM_READ", ARMV7_EVENT_06H) \
+ __PMC_EV_ALIAS("MEM_WRITE", ARMV7_EVENT_07H) \
+ __PMC_EV_ALIAS("INSTR_EXECUTED", ARMV7_EVENT_08H) \
+ __PMC_EV_ALIAS("EXC_TAKEN", ARMV7_EVENT_09H) \
+ __PMC_EV_ALIAS("EXC_EXECUTED", ARMV7_EVENT_0AH) \
+ __PMC_EV_ALIAS("CID_WRITE", ARMV7_EVENT_0BH) \
+ __PMC_EV_ALIAS("PC_WRITE", ARMV7_EVENT_0CH) \
+ __PMC_EV_ALIAS("PC_IMM_BRANCH", ARMV7_EVENT_0DH) \
+ __PMC_EV_ALIAS("PC_PROC_RETURN", ARMV7_EVENT_0EH) \
+ __PMC_EV_ALIAS("MEM_UNALIGNED_ACCESS", ARMV7_EVENT_0FH) \
+ __PMC_EV_ALIAS("PC_BRANCH_MIS_PRED", ARMV7_EVENT_10H) \
+ __PMC_EV_ALIAS("CLOCK_CYCLES", ARMV7_EVENT_11H) \
+ __PMC_EV_ALIAS("PC_BRANCH_PRED", ARMV7_EVENT_12H) \
+ __PMC_EV_ALIAS("MEM_ACCESS", ARMV7_EVENT_13H) \
+ __PMC_EV_ALIAS("L1_ICACHE_ACCESS", ARMV7_EVENT_14H) \
+ __PMC_EV_ALIAS("L1_DCACHE_WB", ARMV7_EVENT_15H) \
+ __PMC_EV_ALIAS("L2_CACHE_ACCESS", ARMV7_EVENT_16H) \
+ __PMC_EV_ALIAS("L2_CACHE_REFILL", ARMV7_EVENT_17H) \
+ __PMC_EV_ALIAS("L2_CACHE_WB", ARMV7_EVENT_18H) \
+ __PMC_EV_ALIAS("BUS_ACCESS", ARMV7_EVENT_19H) \
+ __PMC_EV_ALIAS("MEM_ERROR", ARMV7_EVENT_1AH) \
+ __PMC_EV_ALIAS("INSTR_SPEC", ARMV7_EVENT_1BH) \
+ __PMC_EV_ALIAS("TTBR_WRITE", ARMV7_EVENT_1CH) \
+ __PMC_EV_ALIAS("BUS_CYCLES", ARMV7_EVENT_1DH) \
+ __PMC_EV_ALIAS("CPU_CYCLES", ARMV7_EVENT_FFH)
+
+#define __PMC_EV_ALIAS_ARMV7_CORTEX_A8() \
+ __PMC_EV_ALIAS_ARMV7_COMMON()
+
+#define __PMC_EV_ALIAS_ARMV7_CORTEX_A9() \
+ __PMC_EV_ALIAS_ARMV7_COMMON() \
+ __PMC_EV_ALIAS("JAVA_BYTECODE", ARMV7_EVENT_40H) \
+ __PMC_EV_ALIAS("SOFTWARE_JAVA_BYTECODE", ARMV7_EVENT_41H) \
+ __PMC_EV_ALIAS("JAZELLE_BACKWARD_BRANCH", ARMV7_EVENT_42H) \
+ __PMC_EV_ALIAS("COHERENT_LINEFILL_MISSC", ARMV7_EVENT_50H) \
+ __PMC_EV_ALIAS("COHERENT_LINEFILL_HITC", ARMV7_EVENT_51H) \
+ __PMC_EV_ALIAS("INSTR_CACHE_DEPENDENT_STALL", ARMV7_EVENT_60H) \
+ __PMC_EV_ALIAS("DATA_CACHE_DEPENDENT_STALL", ARMV7_EVENT_61H) \
+ __PMC_EV_ALIAS("MAIN_TLB_MISS_STALL", ARMV7_EVENT_62H) \
+ __PMC_EV_ALIAS("STREX_PASSED", ARMV7_EVENT_63H) \
+ __PMC_EV_ALIAS("STREX_FAILED", ARMV7_EVENT_64H) \
+ __PMC_EV_ALIAS("DATA_EVICTION", ARMV7_EVENT_65H) \
+ __PMC_EV_ALIAS("ISSUE_DNOT_DISPATCH_ANY_INSTR", ARMV7_EVENT_66H) \
+ __PMC_EV_ALIAS("ISSUE_IS_EMPTY", ARMV7_EVENT_67H) \
+ __PMC_EV_ALIAS("MAIN_EXECUTION_UNIT_PIPE", ARMV7_EVENT_70H) \
+ __PMC_EV_ALIAS("SECOND_EXECUTION_UNIT_PIPE", ARMV7_EVENT_71H) \
+ __PMC_EV_ALIAS("LOAD_STORE_PIPE", ARMV7_EVENT_72H) \
+ __PMC_EV_ALIAS("FLOATING_POINT_INSTR_RENAMED", ARMV7_EVENT_73H) \
+ __PMC_EV_ALIAS("NEON_INSTRS_RENAMED", ARMV7_EVENT_74H) \
+ __PMC_EV_ALIAS("PLD_STALL", ARMV7_EVENT_80H) \
+ __PMC_EV_ALIAS("WRITE_STALL", ARMV7_EVENT_81H) \
+ __PMC_EV_ALIAS("INSTR_MAIN_TLB_MISS_STALL", ARMV7_EVENT_82H) \
+ __PMC_EV_ALIAS("DATA_MAIN_TLB_MISS_STALL", ARMV7_EVENT_83H) \
+ __PMC_EV_ALIAS("INSTR_MICRO_TLB_MISS_STALL", ARMV7_EVENT_84H) \
+ __PMC_EV_ALIAS("DATA_MICRO_TLB_MISS_STALL", ARMV7_EVENT_85H) \
+ __PMC_EV_ALIAS("DMB_STALL", ARMV7_EVENT_86H) \
+ __PMC_EV_ALIAS("INTEGER_CORE_CLOCK_ENABLED", ARMV7_EVENT_8AH) \
+ __PMC_EV_ALIAS("DATA_ENGINE_CLOCK_ENABLED", ARMV7_EVENT_8BH) \
+ __PMC_EV_ALIAS("ISB", ARMV7_EVENT_90H) \
+ __PMC_EV_ALIAS("DSB", ARMV7_EVENT_91H) \
+ __PMC_EV_ALIAS("DMB", ARMV7_EVENT_92H) \
+ __PMC_EV_ALIAS("EXTERNAL_INTERRUPT", ARMV7_EVENT_93H) \
+ __PMC_EV_ALIAS("PLE_CACHE_LINE_REQ_COMPLETED", ARMV7_EVENT_A0H) \
+ __PMC_EV_ALIAS("PLE_CACHE_LINE_REQ_SKIPPED", ARMV7_EVENT_A1H) \
+ __PMC_EV_ALIAS("PLE_FIFO_FLUSH", ARMV7_EVENT_A2H) \
+ __PMC_EV_ALIAS("PLE_REQUEST_COMPLETED", ARMV7_EVENT_A3H) \
+ __PMC_EV_ALIAS("PLE_FIFO_OVERFLOW", ARMV7_EVENT_A4H) \
+ __PMC_EV_ALIAS("PLE_REQUEST_PROGRAMMED", ARMV7_EVENT_A5H)
/*
* ARMv8 Events
diff --git a/sys/dev/ichiic/ig4_iic.c b/sys/dev/ichiic/ig4_iic.c
new file mode 100644
index 0000000..e9081e3
--- /dev/null
+++ b/sys/dev/ichiic/ig4_iic.c
@@ -0,0 +1,966 @@
+/*
+ * Copyright (c) 2014 The DragonFly Project. All rights reserved.
+ *
+ * This code is derived from software contributed to The DragonFly Project
+ * by Matthew Dillon <dillon@backplane.com> and was subsequently ported
+ * to FreeBSD by Michael Gmelin <freebsd@grem.de>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name of The DragonFly Project nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific, prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * Intel fourth generation mobile cpus integrated I2C device, smbus driver.
+ *
+ * See ig4_reg.h for datasheet reference and notes.
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/errno.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/syslog.h>
+#include <sys/bus.h>
+#include <sys/sysctl.h>
+
+#include <machine/bus.h>
+#include <sys/rman.h>
+
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/smbus/smbconf.h>
+
+#include <dev/ichiic/ig4_reg.h>
+#include <dev/ichiic/ig4_var.h>
+
+#define TRANS_NORMAL 1
+#define TRANS_PCALL 2
+#define TRANS_BLOCK 3
+
+static void ig4iic_start(void *xdev);
+static void ig4iic_intr(void *cookie);
+static void ig4iic_dump(ig4iic_softc_t *sc);
+
+static int ig4_dump;
+SYSCTL_INT(_debug, OID_AUTO, ig4_dump, CTLTYPE_INT | CTLFLAG_RW,
+ &ig4_dump, 0, "");
+
+/*
+ * Low-level inline support functions
+ */
+static __inline void
+reg_write(ig4iic_softc_t *sc, uint32_t reg, uint32_t value)
+{
+ bus_write_4(sc->regs_res, reg, value);
+ bus_barrier(sc->regs_res, reg, 4, BUS_SPACE_BARRIER_WRITE);
+}
+
+static __inline uint32_t
+reg_read(ig4iic_softc_t *sc, uint32_t reg)
+{
+ uint32_t value;
+
+ bus_barrier(sc->regs_res, reg, 4, BUS_SPACE_BARRIER_READ);
+ value = bus_read_4(sc->regs_res, reg);
+ return (value);
+}
+
+/*
+ * Enable or disable the controller and wait for the controller to acknowledge
+ * the state change.
+ */
+static int
+set_controller(ig4iic_softc_t *sc, uint32_t ctl)
+{
+ int retry;
+ int error;
+ uint32_t v;
+
+ reg_write(sc, IG4_REG_I2C_EN, ctl);
+ error = SMB_ETIMEOUT;
+
+ for (retry = 100; retry > 0; --retry) {
+ v = reg_read(sc, IG4_REG_ENABLE_STATUS);
+ if (((v ^ ctl) & IG4_I2C_ENABLE) == 0) {
+ error = 0;
+ break;
+ }
+ mtx_sleep(sc, &sc->mutex, 0, "i2cslv", 1);
+ }
+ return (error);
+}
+
+/*
+ * Wait up to 25ms for the requested status using a 25uS polling loop.
+ */
+static int
+wait_status(ig4iic_softc_t *sc, uint32_t status)
+{
+ uint32_t v;
+ int error;
+ int txlvl = -1;
+ u_int count_us = 0;
+ u_int limit_us = 25000; /* 25ms */
+
+ error = SMB_ETIMEOUT;
+
+ for (;;) {
+ /*
+ * Check requested status
+ */
+ v = reg_read(sc, IG4_REG_I2C_STA);
+ if (v & status) {
+ error = 0;
+ break;
+ }
+
+ /*
+ * When waiting for receive data break-out if the interrupt
+ * loaded data into the FIFO.
+ */
+ if (status & IG4_STATUS_RX_NOTEMPTY) {
+ if (sc->rpos != sc->rnext) {
+ error = 0;
+ break;
+ }
+ }
+
+ /*
+ * When waiting for the transmit FIFO to become empty,
+ * reset the timeout if we see a change in the transmit
+ * FIFO level as progress is being made.
+ */
+ if (status & IG4_STATUS_TX_EMPTY) {
+ v = reg_read(sc, IG4_REG_TXFLR) & IG4_FIFOLVL_MASK;
+ if (txlvl != v) {
+ txlvl = v;
+ count_us = 0;
+ }
+ }
+
+ /*
+ * Stop if we've run out of time.
+ */
+ if (count_us >= limit_us)
+ break;
+
+ /*
+ * When waiting for receive data let the interrupt do its
+ * work, otherwise poll with the lock held.
+ */
+ if (status & IG4_STATUS_RX_NOTEMPTY) {
+ mtx_sleep(sc, &sc->mutex, PZERO, "i2cwait",
+ (hz + 99) / 100); /* sleep up to 10ms */
+ count_us += 10000;
+ } else {
+ DELAY(25);
+ count_us += 25;
+ }
+ }
+
+ return (error);
+}
+
+/*
+ * Read I2C data. The data might have already been read by
+ * the interrupt code, otherwise it is sitting in the data
+ * register.
+ */
+static uint8_t
+data_read(ig4iic_softc_t *sc)
+{
+ uint8_t c;
+
+ if (sc->rpos == sc->rnext) {
+ c = (uint8_t)reg_read(sc, IG4_REG_DATA_CMD);
+ } else {
+ c = sc->rbuf[sc->rpos & IG4_RBUFMASK];
+ ++sc->rpos;
+ }
+ return (c);
+}
+
+/*
+ * Set the slave address. The controller must be disabled when
+ * changing the address.
+ *
+ * This operation does not issue anything to the I2C bus but sets
+ * the target address for when the controller later issues a START.
+ */
+static void
+set_slave_addr(ig4iic_softc_t *sc, uint8_t slave, int trans_op)
+{
+ uint32_t tar;
+ uint32_t ctl;
+ int use_10bit;
+
+ use_10bit = sc->use_10bit;
+ if (trans_op & SMB_TRANS_7BIT)
+ use_10bit = 0;
+ if (trans_op & SMB_TRANS_10BIT)
+ use_10bit = 1;
+
+ if (sc->slave_valid && sc->last_slave == slave &&
+ sc->use_10bit == use_10bit) {
+ return;
+ }
+ sc->use_10bit = use_10bit;
+
+ /*
+ * Wait for TXFIFO to drain before disabling the controller.
+ *
+ * If a write message has not been completed it's really a
+ * programming error, but for now in that case issue an extra
+ * byte + STOP.
+ *
+ * If a read message has not been completed it's also a programming
+ * error, for now just ignore it.
+ */
+ wait_status(sc, IG4_STATUS_TX_NOTFULL);
+ if (sc->write_started) {
+ reg_write(sc, IG4_REG_DATA_CMD, IG4_DATA_STOP);
+ sc->write_started = 0;
+ }
+ if (sc->read_started)
+ sc->read_started = 0;
+ wait_status(sc, IG4_STATUS_TX_EMPTY);
+
+ set_controller(sc, 0);
+ ctl = reg_read(sc, IG4_REG_CTL);
+ ctl &= ~IG4_CTL_10BIT;
+ ctl |= IG4_CTL_RESTARTEN;
+
+ tar = slave;
+ if (sc->use_10bit) {
+ tar |= IG4_TAR_10BIT;
+ ctl |= IG4_CTL_10BIT;
+ }
+ reg_write(sc, IG4_REG_CTL, ctl);
+ reg_write(sc, IG4_REG_TAR_ADD, tar);
+ set_controller(sc, IG4_I2C_ENABLE);
+ sc->slave_valid = 1;
+ sc->last_slave = slave;
+}
+
+/*
+ * Issue START with byte command, possible count, and a variable length
+ * read or write buffer, then possible turn-around read. The read also
+ * has a possible count received.
+ *
+ * For SMBUS -
+ *
+ * Quick: START+ADDR+RD/WR STOP
+ *
+ * Normal: START+ADDR+WR CMD DATA..DATA STOP
+ *
+ * START+ADDR+RD CMD
+ * RESTART+ADDR RDATA..RDATA STOP
+ * (can also be used for I2C transactions)
+ *
+ * Process Call: START+ADDR+WR CMD DATAL DATAH
+ * RESTART+ADDR+RD RDATAL RDATAH STOP
+ *
+ * Block: START+ADDR+RD CMD
+ * RESTART+ADDR+RD RCOUNT DATA... STOP
+ *
+ * START+ADDR+WR CMD
+ * RESTART+ADDR+WR WCOUNT DATA... STOP
+ *
+ * For I2C - basically, no *COUNT fields, possibly no *CMD field. If the
+ * sender needs to issue a 2-byte command it will incorporate it
+ * into the write buffer and also set NOCMD.
+ *
+ * Generally speaking, the START+ADDR / RESTART+ADDR is handled automatically
+ * by the controller at the beginning of a command sequence or on a data
+ * direction turn-around, and we only need to tell it when to issue the STOP.
+ */
+static int
+smb_transaction(ig4iic_softc_t *sc, char cmd, int op,
+ char *wbuf, int wcount, char *rbuf, int rcount, int *actualp)
+{
+ int error;
+ int unit;
+ uint32_t last;
+
+ /*
+ * Debugging - dump registers
+ */
+ if (ig4_dump) {
+ unit = device_get_unit(sc->dev);
+ if (ig4_dump & (1 << unit)) {
+ ig4_dump &= ~(1 << unit);
+ ig4iic_dump(sc);
+ }
+ }
+
+ /*
+ * Issue START or RESTART with next data byte, clear any previous
+ * abort condition that may have been holding the txfifo in reset.
+ */
+ last = IG4_DATA_RESTART;
+ reg_read(sc, IG4_REG_CLR_TX_ABORT);
+ if (actualp)
+ *actualp = 0;
+
+ /*
+ * Issue command if not told otherwise (smbus).
+ */
+ if ((op & SMB_TRANS_NOCMD) == 0) {
+ error = wait_status(sc, IG4_STATUS_TX_NOTFULL);
+ if (error)
+ goto done;
+ last |= (u_char)cmd;
+ if (wcount == 0 && rcount == 0 && (op & SMB_TRANS_NOSTOP) == 0)
+ last |= IG4_DATA_STOP;
+ reg_write(sc, IG4_REG_DATA_CMD, last);
+ last = 0;
+ }
+
+ /*
+ * Clean out any previously received data.
+ */
+ if (sc->rpos != sc->rnext &&
+ (op & SMB_TRANS_NOREPORT) == 0) {
+ device_printf(sc->dev,
+ "discarding %d bytes of spurious data\n",
+ sc->rnext - sc->rpos);
+ }
+ sc->rpos = 0;
+ sc->rnext = 0;
+
+ /*
+ * If writing and not told otherwise, issue the write count (smbus).
+ */
+ if (wcount && (op & SMB_TRANS_NOCNT) == 0) {
+ error = wait_status(sc, IG4_STATUS_TX_NOTFULL);
+ if (error)
+ goto done;
+ last |= (u_char)cmd;
+ reg_write(sc, IG4_REG_DATA_CMD, last);
+ last = 0;
+ }
+
+ /*
+ * Bulk write (i2c)
+ */
+ while (wcount) {
+ error = wait_status(sc, IG4_STATUS_TX_NOTFULL);
+ if (error)
+ goto done;
+ last |= (u_char)*wbuf;
+ if (wcount == 1 && rcount == 0 && (op & SMB_TRANS_NOSTOP) == 0)
+ last |= IG4_DATA_STOP;
+ reg_write(sc, IG4_REG_DATA_CMD, last);
+ --wcount;
+ ++wbuf;
+ last = 0;
+ }
+
+ /*
+ * Issue reads to xmit FIFO (strange, I know) to tell the controller
+ * to clock in data. At the moment just issue one read ahead to
+ * pipeline the incoming data.
+ *
+ * NOTE: In the case of NOCMD and wcount == 0 we still issue a
+ * RESTART here, even if the data direction has not changed
+ * from the previous CHAINing call. This we force the RESTART.
+ * (A new START is issued automatically by the controller in
+ * the other nominal cases such as a data direction change or
+ * a previous STOP was issued).
+ *
+ * If this will be the last byte read we must also issue the STOP
+ * at the end of the read.
+ */
+ if (rcount) {
+ last = IG4_DATA_RESTART | IG4_DATA_COMMAND_RD;
+ if (rcount == 1 &&
+ (op & (SMB_TRANS_NOSTOP | SMB_TRANS_NOCNT)) ==
+ SMB_TRANS_NOCNT) {
+ last |= IG4_DATA_STOP;
+ }
+ reg_write(sc, IG4_REG_DATA_CMD, last);
+ last = IG4_DATA_COMMAND_RD;
+ }
+
+ /*
+ * Bulk read (i2c) and count field handling (smbus)
+ */
+ while (rcount) {
+ /*
+ * Maintain a pipeline by queueing the allowance for the next
+ * read before waiting for the current read.
+ */
+ if (rcount > 1) {
+ if (op & SMB_TRANS_NOCNT)
+ last = (rcount == 2) ? IG4_DATA_STOP : 0;
+ else
+ last = 0;
+ reg_write(sc, IG4_REG_DATA_CMD, IG4_DATA_COMMAND_RD |
+ last);
+ }
+ error = wait_status(sc, IG4_STATUS_RX_NOTEMPTY);
+ if (error) {
+ if ((op & SMB_TRANS_NOREPORT) == 0) {
+ device_printf(sc->dev,
+ "rx timeout addr 0x%02x\n",
+ sc->last_slave);
+ }
+ goto done;
+ }
+ last = data_read(sc);
+
+ if (op & SMB_TRANS_NOCNT) {
+ *rbuf = (u_char)last;
+ ++rbuf;
+ --rcount;
+ if (actualp)
+ ++*actualp;
+ } else {
+ /*
+ * Handle count field (smbus), which is not part of
+ * the rcount'ed buffer. The first read data in a
+ * bulk transfer is the count.
+ *
+ * XXX if rcount is loaded as 0 how do I generate a
+ * STOP now without issuing another RD or WR?
+ */
+ if (rcount > (u_char)last)
+ rcount = (u_char)last;
+ op |= SMB_TRANS_NOCNT;
+ }
+ }
+ error = 0;
+done:
+ /* XXX wait for xmit buffer to become empty */
+ last = reg_read(sc, IG4_REG_TX_ABRT_SOURCE);
+
+ return (error);
+}
+
+/*
+ * SMBUS API FUNCTIONS
+ *
+ * Called from ig4iic_pci_attach/detach()
+ */
+int
+ig4iic_attach(ig4iic_softc_t *sc)
+{
+ int error;
+ uint32_t v;
+
+ v = reg_read(sc, IG4_REG_COMP_TYPE);
+ v = reg_read(sc, IG4_REG_COMP_PARAM1);
+ v = reg_read(sc, IG4_REG_GENERAL);
+ if ((v & IG4_GENERAL_SWMODE) == 0) {
+ v |= IG4_GENERAL_SWMODE;
+ reg_write(sc, IG4_REG_GENERAL, v);
+ v = reg_read(sc, IG4_REG_GENERAL);
+ }
+
+ v = reg_read(sc, IG4_REG_SW_LTR_VALUE);
+ v = reg_read(sc, IG4_REG_AUTO_LTR_VALUE);
+
+ v = reg_read(sc, IG4_REG_COMP_VER);
+ if (v != IG4_COMP_VER) {
+ error = ENXIO;
+ goto done;
+ }
+ v = reg_read(sc, IG4_REG_SS_SCL_HCNT);
+ v = reg_read(sc, IG4_REG_SS_SCL_LCNT);
+ v = reg_read(sc, IG4_REG_FS_SCL_HCNT);
+ v = reg_read(sc, IG4_REG_FS_SCL_LCNT);
+ v = reg_read(sc, IG4_REG_SDA_HOLD);
+
+ v = reg_read(sc, IG4_REG_SS_SCL_HCNT);
+ reg_write(sc, IG4_REG_FS_SCL_HCNT, v);
+ v = reg_read(sc, IG4_REG_SS_SCL_LCNT);
+ reg_write(sc, IG4_REG_FS_SCL_LCNT, v);
+
+ /*
+ * Program based on a 25000 Hz clock. This is a bit of a
+ * hack (obviously). The defaults are 400 and 470 for standard
+ * and 60 and 130 for fast. The defaults for standard fail
+ * utterly (presumably cause an abort) because the clock time
+ * is ~18.8ms by default. This brings it down to ~4ms (for now).
+ */
+ reg_write(sc, IG4_REG_SS_SCL_HCNT, 100);
+ reg_write(sc, IG4_REG_SS_SCL_LCNT, 125);
+ reg_write(sc, IG4_REG_FS_SCL_HCNT, 100);
+ reg_write(sc, IG4_REG_FS_SCL_LCNT, 125);
+
+ /*
+ * Use a threshold of 1 so we get interrupted on each character,
+ * allowing us to use mtx_sleep() in our poll code. Not perfect
+ * but this is better than using DELAY() for receiving data.
+ */
+ reg_write(sc, IG4_REG_RX_TL, 1);
+
+ reg_write(sc, IG4_REG_CTL,
+ IG4_CTL_MASTER |
+ IG4_CTL_SLAVE_DISABLE |
+ IG4_CTL_RESTARTEN |
+ IG4_CTL_SPEED_STD);
+
+ sc->smb = device_add_child(sc->dev, "smbus", -1);
+ if (sc->smb == NULL) {
+ device_printf(sc->dev, "smbus driver not found\n");
+ error = ENXIO;
+ goto done;
+ }
+
+#if 0
+ /*
+ * Don't do this, it blows up the PCI config
+ */
+ reg_write(sc, IG4_REG_RESETS, IG4_RESETS_ASSERT);
+ reg_write(sc, IG4_REG_RESETS, IG4_RESETS_DEASSERT);
+#endif
+
+ /*
+ * Interrupt on STOP detect or receive character ready
+ */
+ reg_write(sc, IG4_REG_INTR_MASK, IG4_INTR_STOP_DET |
+ IG4_INTR_RX_FULL);
+ mtx_lock(&sc->mutex);
+ if (set_controller(sc, 0))
+ device_printf(sc->dev, "controller error during attach-1\n");
+ if (set_controller(sc, IG4_I2C_ENABLE))
+ device_printf(sc->dev, "controller error during attach-2\n");
+ mtx_unlock(&sc->mutex);
+ error = bus_setup_intr(sc->dev, sc->intr_res, INTR_TYPE_MISC | INTR_MPSAFE,
+ NULL, ig4iic_intr, sc, &sc->intr_handle);
+ if (error) {
+ device_printf(sc->dev,
+ "Unable to setup irq: error %d\n", error);
+ }
+
+ sc->enum_hook.ich_func = ig4iic_start;
+ sc->enum_hook.ich_arg = sc->dev;
+
+ /* We have to wait until interrupts are enabled. I2C read and write
+ * only works if the interrupts are available.
+ */
+ if (config_intrhook_establish(&sc->enum_hook) != 0)
+ error = ENOMEM;
+ else
+ error = 0;
+
+done:
+ return (error);
+}
+
+void
+ig4iic_start(void *xdev)
+{
+ int error;
+ ig4iic_softc_t *sc;
+ device_t dev = (device_t)xdev;
+
+ sc = device_get_softc(dev);
+
+ config_intrhook_disestablish(&sc->enum_hook);
+
+ /* Attach us to the smbus */
+ error = bus_generic_attach(sc->dev);
+ if (error) {
+ device_printf(sc->dev,
+ "failed to attach child: error %d\n", error);
+ }
+}
+
+
+
+int
+ig4iic_detach(ig4iic_softc_t *sc)
+{
+ int error;
+
+ if (device_is_attached(sc->dev)) {
+ error = bus_generic_detach(sc->dev);
+ if (error)
+ return (error);
+ }
+ if (sc->smb)
+ device_delete_child(sc->dev, sc->smb);
+ if (sc->intr_handle)
+ bus_teardown_intr(sc->dev, sc->intr_res, sc->intr_handle);
+
+ mtx_lock(&sc->mutex);
+
+ sc->smb = NULL;
+ sc->intr_handle = NULL;
+ reg_write(sc, IG4_REG_INTR_MASK, 0);
+ reg_read(sc, IG4_REG_CLR_INTR);
+ set_controller(sc, 0);
+
+ mtx_unlock(&sc->mutex);
+ return (0);
+}
+
+int
+ig4iic_smb_callback(device_t dev, int index, void *data)
+{
+ ig4iic_softc_t *sc = device_get_softc(dev);
+ int error;
+
+ mtx_lock(&sc->mutex);
+
+ switch (index) {
+ case SMB_REQUEST_BUS:
+ error = 0;
+ break;
+ case SMB_RELEASE_BUS:
+ error = 0;
+ break;
+ default:
+ error = SMB_EABORT;
+ break;
+ }
+
+ mtx_unlock(&sc->mutex);
+
+ return (error);
+}
+
+/*
+ * Quick command. i.e. START + cmd + R/W + STOP and no data. It is
+ * unclear to me how I could implement this with the intel i2c controller
+ * because the controler sends STARTs and STOPs automatically with data.
+ */
+int
+ig4iic_smb_quick(device_t dev, u_char slave, int how)
+{
+ ig4iic_softc_t *sc = device_get_softc(dev);
+ int error;
+
+ mtx_lock(&sc->mutex);
+
+ switch (how) {
+ case SMB_QREAD:
+ error = SMB_ENOTSUPP;
+ break;
+ case SMB_QWRITE:
+ error = SMB_ENOTSUPP;
+ break;
+ default:
+ error = SMB_ENOTSUPP;
+ break;
+ }
+ mtx_unlock(&sc->mutex);
+
+ return (error);
+}
+
+/*
+ * Incremental send byte without stop (?). It is unclear why the slave
+ * address is specified if this presumably is used in combination with
+ * ig4iic_smb_quick().
+ *
+ * (Also, how would this work anyway? Issue the last byte with writeb()?)
+ */
+int
+ig4iic_smb_sendb(device_t dev, u_char slave, char byte)
+{
+ ig4iic_softc_t *sc = device_get_softc(dev);
+ uint32_t cmd;
+ int error;
+
+ mtx_lock(&sc->mutex);
+
+ set_slave_addr(sc, slave, 0);
+ cmd = byte;
+ if (wait_status(sc, IG4_STATUS_TX_NOTFULL) == 0) {
+ reg_write(sc, IG4_REG_DATA_CMD, cmd);
+ error = 0;
+ } else {
+ error = SMB_ETIMEOUT;
+ }
+
+ mtx_unlock(&sc->mutex);
+ return (error);
+}
+
+/*
+ * Incremental receive byte without stop (?). It is unclear why the slave
+ * address is specified if this presumably is used in combination with
+ * ig4iic_smb_quick().
+ */
+int
+ig4iic_smb_recvb(device_t dev, u_char slave, char *byte)
+{
+ ig4iic_softc_t *sc = device_get_softc(dev);
+ int error;
+
+ mtx_lock(&sc->mutex);
+
+ set_slave_addr(sc, slave, 0);
+ reg_write(sc, IG4_REG_DATA_CMD, IG4_DATA_COMMAND_RD);
+ if (wait_status(sc, IG4_STATUS_RX_NOTEMPTY) == 0) {
+ *byte = data_read(sc);
+ error = 0;
+ } else {
+ *byte = 0;
+ error = SMB_ETIMEOUT;
+ }
+
+ mtx_unlock(&sc->mutex);
+ return (error);
+}
+
+/*
+ * Write command and single byte in transaction.
+ */
+int
+ig4iic_smb_writeb(device_t dev, u_char slave, char cmd, char byte)
+{
+ ig4iic_softc_t *sc = device_get_softc(dev);
+ int error;
+
+ mtx_lock(&sc->mutex);
+
+ set_slave_addr(sc, slave, 0);
+ error = smb_transaction(sc, cmd, SMB_TRANS_NOCNT,
+ &byte, 1, NULL, 0, NULL);
+
+ mtx_unlock(&sc->mutex);
+ return (error);
+}
+
+/*
+ * Write command and single word in transaction.
+ */
+int
+ig4iic_smb_writew(device_t dev, u_char slave, char cmd, short word)
+{
+ ig4iic_softc_t *sc = device_get_softc(dev);
+ char buf[2];
+ int error;
+
+ mtx_lock(&sc->mutex);
+
+ set_slave_addr(sc, slave, 0);
+ buf[0] = word & 0xFF;
+ buf[1] = word >> 8;
+ error = smb_transaction(sc, cmd, SMB_TRANS_NOCNT,
+ buf, 2, NULL, 0, NULL);
+
+ mtx_unlock(&sc->mutex);
+ return (error);
+}
+
+/*
+ * write command and read single byte in transaction.
+ */
+int
+ig4iic_smb_readb(device_t dev, u_char slave, char cmd, char *byte)
+{
+ ig4iic_softc_t *sc = device_get_softc(dev);
+ int error;
+
+ mtx_lock(&sc->mutex);
+
+ set_slave_addr(sc, slave, 0);
+ error = smb_transaction(sc, cmd, SMB_TRANS_NOCNT,
+ NULL, 0, byte, 1, NULL);
+
+ mtx_unlock(&sc->mutex);
+ return (error);
+}
+
+/*
+ * write command and read word in transaction.
+ */
+int
+ig4iic_smb_readw(device_t dev, u_char slave, char cmd, short *word)
+{
+ ig4iic_softc_t *sc = device_get_softc(dev);
+ char buf[2];
+ int error;
+
+ mtx_lock(&sc->mutex);
+
+ set_slave_addr(sc, slave, 0);
+ if ((error = smb_transaction(sc, cmd, SMB_TRANS_NOCNT,
+ NULL, 0, buf, 2, NULL)) == 0) {
+ *word = (u_char)buf[0] | ((u_char)buf[1] << 8);
+ }
+
+ mtx_unlock(&sc->mutex);
+ return (error);
+}
+
+/*
+ * write command and word and read word in transaction
+ */
+int
+ig4iic_smb_pcall(device_t dev, u_char slave, char cmd,
+ short sdata, short *rdata)
+{
+ ig4iic_softc_t *sc = device_get_softc(dev);
+ char rbuf[2];
+ char wbuf[2];
+ int error;
+
+ mtx_lock(&sc->mutex);
+
+ set_slave_addr(sc, slave, 0);
+ wbuf[0] = sdata & 0xFF;
+ wbuf[1] = sdata >> 8;
+ if ((error = smb_transaction(sc, cmd, SMB_TRANS_NOCNT,
+ wbuf, 2, rbuf, 2, NULL)) == 0) {
+ *rdata = (u_char)rbuf[0] | ((u_char)rbuf[1] << 8);
+ }
+
+ mtx_unlock(&sc->mutex);
+ return (error);
+}
+
+int
+ig4iic_smb_bwrite(device_t dev, u_char slave, char cmd,
+ u_char wcount, char *buf)
+{
+ ig4iic_softc_t *sc = device_get_softc(dev);
+ int error;
+
+ mtx_lock(&sc->mutex);
+
+ set_slave_addr(sc, slave, 0);
+ error = smb_transaction(sc, cmd, 0,
+ buf, wcount, NULL, 0, NULL);
+
+ mtx_unlock(&sc->mutex);
+ return (error);
+}
+
+int
+ig4iic_smb_bread(device_t dev, u_char slave, char cmd,
+ u_char *countp_char, char *buf)
+{
+ ig4iic_softc_t *sc = device_get_softc(dev);
+ int rcount = *countp_char;
+ int error;
+
+ mtx_lock(&sc->mutex);
+
+ set_slave_addr(sc, slave, 0);
+ error = smb_transaction(sc, cmd, 0,
+ NULL, 0, buf, rcount, &rcount);
+ *countp_char = rcount;
+
+ mtx_unlock(&sc->mutex);
+ return (error);
+}
+
+int
+ig4iic_smb_trans(device_t dev, int slave, char cmd, int op,
+ char *wbuf, int wcount, char *rbuf, int rcount,
+ int *actualp)
+{
+ ig4iic_softc_t *sc = device_get_softc(dev);
+ int error;
+
+ mtx_lock(&sc->mutex);
+
+ set_slave_addr(sc, slave, op);
+ error = smb_transaction(sc, cmd, op,
+ wbuf, wcount, rbuf, rcount, actualp);
+
+ mtx_unlock(&sc->mutex);
+ return (error);
+}
+
+/*
+ * Interrupt Operation
+ */
+static void
+ig4iic_intr(void *cookie)
+{
+ ig4iic_softc_t *sc = cookie;
+ uint32_t status;
+
+ mtx_lock(&sc->mutex);
+/* reg_write(sc, IG4_REG_INTR_MASK, IG4_INTR_STOP_DET);*/
+ status = reg_read(sc, IG4_REG_I2C_STA);
+ while (status & IG4_STATUS_RX_NOTEMPTY) {
+ sc->rbuf[sc->rnext & IG4_RBUFMASK] =
+ (uint8_t)reg_read(sc, IG4_REG_DATA_CMD);
+ ++sc->rnext;
+ status = reg_read(sc, IG4_REG_I2C_STA);
+ }
+ reg_read(sc, IG4_REG_CLR_INTR);
+ wakeup(sc);
+ mtx_unlock(&sc->mutex);
+}
+
+#define REGDUMP(sc, reg) \
+ device_printf(sc->dev, " %-23s %08x\n", #reg, reg_read(sc, reg))
+
+static void
+ig4iic_dump(ig4iic_softc_t *sc)
+{
+ device_printf(sc->dev, "ig4iic register dump:\n");
+ REGDUMP(sc, IG4_REG_CTL);
+ REGDUMP(sc, IG4_REG_TAR_ADD);
+ REGDUMP(sc, IG4_REG_SS_SCL_HCNT);
+ REGDUMP(sc, IG4_REG_SS_SCL_LCNT);
+ REGDUMP(sc, IG4_REG_FS_SCL_HCNT);
+ REGDUMP(sc, IG4_REG_FS_SCL_LCNT);
+ REGDUMP(sc, IG4_REG_INTR_STAT);
+ REGDUMP(sc, IG4_REG_INTR_MASK);
+ REGDUMP(sc, IG4_REG_RAW_INTR_STAT);
+ REGDUMP(sc, IG4_REG_RX_TL);
+ REGDUMP(sc, IG4_REG_TX_TL);
+ REGDUMP(sc, IG4_REG_I2C_EN);
+ REGDUMP(sc, IG4_REG_I2C_STA);
+ REGDUMP(sc, IG4_REG_TXFLR);
+ REGDUMP(sc, IG4_REG_RXFLR);
+ REGDUMP(sc, IG4_REG_SDA_HOLD);
+ REGDUMP(sc, IG4_REG_TX_ABRT_SOURCE);
+ REGDUMP(sc, IG4_REG_SLV_DATA_NACK);
+ REGDUMP(sc, IG4_REG_DMA_CTRL);
+ REGDUMP(sc, IG4_REG_DMA_TDLR);
+ REGDUMP(sc, IG4_REG_DMA_RDLR);
+ REGDUMP(sc, IG4_REG_SDA_SETUP);
+ REGDUMP(sc, IG4_REG_ENABLE_STATUS);
+ REGDUMP(sc, IG4_REG_COMP_PARAM1);
+ REGDUMP(sc, IG4_REG_COMP_VER);
+ REGDUMP(sc, IG4_REG_COMP_TYPE);
+ REGDUMP(sc, IG4_REG_CLK_PARMS);
+ REGDUMP(sc, IG4_REG_RESETS);
+ REGDUMP(sc, IG4_REG_GENERAL);
+ REGDUMP(sc, IG4_REG_SW_LTR_VALUE);
+ REGDUMP(sc, IG4_REG_AUTO_LTR_VALUE);
+}
+#undef REGDUMP
+
+DRIVER_MODULE(smbus, ig4iic, smbus_driver, smbus_devclass, NULL, NULL);
diff --git a/sys/dev/ichiic/ig4_pci.c b/sys/dev/ichiic/ig4_pci.c
new file mode 100644
index 0000000..42c3664
--- /dev/null
+++ b/sys/dev/ichiic/ig4_pci.c
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2014 The DragonFly Project. All rights reserved.
+ *
+ * This code is derived from software contributed to The DragonFly Project
+ * by Matthew Dillon <dillon@backplane.com> and was subsequently ported
+ * to FreeBSD by Michael Gmelin <freebsd@grem.de>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name of The DragonFly Project nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific, prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * Intel fourth generation mobile cpus integrated I2C device, smbus driver.
+ *
+ * See ig4_reg.h for datasheet reference and notes.
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/errno.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/syslog.h>
+#include <sys/bus.h>
+
+#include <machine/bus.h>
+#include <sys/rman.h>
+#include <machine/resource.h>
+
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/smbus/smbconf.h>
+
+#include "smbus_if.h"
+
+#include <dev/ichiic/ig4_reg.h>
+#include <dev/ichiic/ig4_var.h>
+
+static int ig4iic_pci_detach(device_t dev);
+
+#define PCI_CHIP_LYNXPT_LP_I2C_1 0x9c618086
+#define PCI_CHIP_LYNXPT_LP_I2C_2 0x9c628086
+
+static int
+ig4iic_pci_probe(device_t dev)
+{
+ switch(pci_get_devid(dev)) {
+ case PCI_CHIP_LYNXPT_LP_I2C_1:
+ device_set_desc(dev, "Intel Lynx Point-LP I2C Controller-1");
+ break;
+ case PCI_CHIP_LYNXPT_LP_I2C_2:
+ device_set_desc(dev, "Intel Lynx Point-LP I2C Controller-2");
+ break;
+ default:
+ return (ENXIO);
+ }
+ return (BUS_PROBE_DEFAULT);
+}
+
+static int
+ig4iic_pci_attach(device_t dev)
+{
+ ig4iic_softc_t *sc = device_get_softc(dev);
+ int error;
+
+ bzero(sc, sizeof(*sc));
+
+ mtx_init(&sc->mutex, device_get_nameunit(dev), "ig4iic", MTX_DEF);
+
+ sc->dev = dev;
+ sc->regs_rid = PCIR_BAR(0);
+ sc->regs_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+ &sc->regs_rid, RF_ACTIVE);
+ if (sc->regs_res == NULL) {
+ device_printf(dev, "unable to map registers\n");
+ ig4iic_pci_detach(dev);
+ return (ENXIO);
+ }
+ sc->intr_rid = 0;
+ if (pci_alloc_msi(dev, &sc->intr_rid)) {
+ device_printf(dev, "Using MSI\n");
+ }
+ sc->intr_res = bus_alloc_resource_any(dev, SYS_RES_IRQ,
+ &sc->intr_rid, RF_SHAREABLE | RF_ACTIVE);
+ if (sc->intr_res == NULL) {
+ device_printf(dev, "unable to map interrupt\n");
+ ig4iic_pci_detach(dev);
+ return (ENXIO);
+ }
+ sc->pci_attached = 1;
+
+ error = ig4iic_attach(sc);
+ if (error)
+ ig4iic_pci_detach(dev);
+
+ return (error);
+}
+
+static int
+ig4iic_pci_detach(device_t dev)
+{
+ ig4iic_softc_t *sc = device_get_softc(dev);
+ int error;
+
+ if (sc->pci_attached) {
+ error = ig4iic_detach(sc);
+ if (error)
+ return (error);
+ sc->pci_attached = 0;
+ }
+
+ if (sc->intr_res) {
+ bus_release_resource(dev, SYS_RES_IRQ,
+ sc->intr_rid, sc->intr_res);
+ sc->intr_res = NULL;
+ }
+ if (sc->intr_rid != 0)
+ pci_release_msi(dev);
+ if (sc->regs_res) {
+ bus_release_resource(dev, SYS_RES_MEMORY,
+ sc->regs_rid, sc->regs_res);
+ sc->regs_res = NULL;
+ }
+ mtx_destroy(&sc->mutex);
+
+ return (0);
+}
+
+static device_method_t ig4iic_pci_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, ig4iic_pci_probe),
+ DEVMETHOD(device_attach, ig4iic_pci_attach),
+ DEVMETHOD(device_detach, ig4iic_pci_detach),
+
+ /* SMBus methods from ig4_smb.c */
+ DEVMETHOD(smbus_callback, ig4iic_smb_callback),
+ DEVMETHOD(smbus_quick, ig4iic_smb_quick),
+ DEVMETHOD(smbus_sendb, ig4iic_smb_sendb),
+ DEVMETHOD(smbus_recvb, ig4iic_smb_recvb),
+ DEVMETHOD(smbus_writeb, ig4iic_smb_writeb),
+ DEVMETHOD(smbus_writew, ig4iic_smb_writew),
+ DEVMETHOD(smbus_readb, ig4iic_smb_readb),
+ DEVMETHOD(smbus_readw, ig4iic_smb_readw),
+ DEVMETHOD(smbus_pcall, ig4iic_smb_pcall),
+ DEVMETHOD(smbus_bwrite, ig4iic_smb_bwrite),
+ DEVMETHOD(smbus_bread, ig4iic_smb_bread),
+ DEVMETHOD(smbus_trans, ig4iic_smb_trans),
+
+ DEVMETHOD_END
+};
+
+static driver_t ig4iic_pci_driver = {
+ "ig4iic",
+ ig4iic_pci_methods,
+ sizeof(struct ig4iic_softc)
+};
+
+static devclass_t ig4iic_pci_devclass;
+
+DRIVER_MODULE(ig4iic, pci, ig4iic_pci_driver, ig4iic_pci_devclass, 0, 0);
+MODULE_DEPEND(ig4iic, pci, 1, 1, 1);
+MODULE_DEPEND(ig4iic, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER);
+MODULE_VERSION(ig4iic, 1);
diff --git a/sys/dev/ichiic/ig4_reg.h b/sys/dev/ichiic/ig4_reg.h
new file mode 100644
index 0000000..c87d1d1
--- /dev/null
+++ b/sys/dev/ichiic/ig4_reg.h
@@ -0,0 +1,622 @@
+/*
+ * Copyright (c) 2014 The DragonFly Project. All rights reserved.
+ *
+ * This code is derived from software contributed to The DragonFly Project
+ * by Matthew Dillon <dillon@backplane.com> and was subsequently ported
+ * to FreeBSD by Michael Gmelin <freebsd@grem.de>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name of The DragonFly Project nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific, prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+/*
+ * Intel fourth generation mobile cpus integrated I2C device.
+ *
+ * Datasheet reference: Section 22.
+ *
+ * http://www.intel.com/content/www/us/en/processors/core/4th-gen-core-family-mobile-i-o-datasheet.html?wapkw=datasheets+4th+generation
+ *
+ * This is a from-scratch driver under the BSD license using the Intel data
+ * sheet and the linux driver for reference. All code is freshly written
+ * without referencing the linux driver code. However, during testing
+ * I am also using the linux driver code as a reference to help resolve any
+ * issues that come. These will be specifically documented in the code.
+ *
+ * Please see protocol notes in section 5.21. This controller is an I2C
+ * master only and cannot act as a slave. The IO voltage should be set by
+ * the BIOS. Standard (100Kb/s) and Fast (400Kb/s) and fast mode plus
+ * (1MB/s) is supported. High speed mode (3.4 MB/s) is NOT supported.
+ */
+
+#ifndef _BUS_SMBUS_INTELGEN4_IG4_REG_H_
+#define _BUS_SMBUS_INTELGEN4_IG4_REG_H_
+
+/*
+ * 22.2 MMIO registers can be accessed through BAR0 in PCI mode or through
+ * BAR1 when in ACPI mode.
+ *
+ * Register width is 32-bits
+ *
+ * 22.2 Default Values on device reset are 0 except as specified here:
+ * TAR_ADD 0x00000055
+ * SS_SCL_HCNT 0x00000264
+ * SS_SCL_LCNT 0x000002C2
+ * FS_SCL_HCNT 0x0000006E
+ * FS_SCL_LCNT 0x000000CF
+ * INTR_MASK 0x000008FF
+ * I2C_STA 0x00000006
+ * SDA_HOLD 0x00000001
+ * SDA_SETUP 0x00000064
+ * COMP_PARAM1 0x00FFFF6E
+ * COMP_VER 0x3131352A
+ */
+
+#define IG4_REG_CTL 0x0000 /* RW Control Register */
+#define IG4_REG_TAR_ADD 0x0004 /* RW Target Address */
+#define IG4_REG_DATA_CMD 0x0010 /* RW Data Buffer and Command */
+#define IG4_REG_SS_SCL_HCNT 0x0014 /* RW Std Speed clock High Count */
+#define IG4_REG_SS_SCL_LCNT 0x0018 /* RW Std Speed clock Low Count */
+#define IG4_REG_FS_SCL_HCNT 0x001C /* RW Fast Speed clock High Count */
+#define IG4_REG_FS_SCL_LCNT 0x0020 /* RW Fast Speed clock Low Count */
+#define IG4_REG_INTR_STAT 0x002C /* RO Interrupt Status */
+#define IG4_REG_INTR_MASK 0x0030 /* RW Interrupt Mask */
+#define IG4_REG_RAW_INTR_STAT 0x0034 /* RO Raw Interrupt Status */
+#define IG4_REG_RX_TL 0x0038 /* RW Receive FIFO Threshold */
+#define IG4_REG_TX_TL 0x003C /* RW Transmit FIFO Threshold */
+#define IG4_REG_CLR_INTR 0x0040 /* RO Clear Interrupt */
+#define IG4_REG_CLR_RX_UNDER 0x0044 /* RO Clear RX_Under Interrupt */
+#define IG4_REG_CLR_RX_OVER 0x0048 /* RO Clear RX_Over Interrupt */
+#define IG4_REG_CLR_TX_OVER 0x004C /* RO Clear TX_Over Interrupt */
+#define IG4_REG_CLR_TX_ABORT 0x0054 /* RO Clear TX_Abort Interrupt */
+#define IG4_REG_CLR_ACTIVITY 0x005C /* RO Clear Activity Interrupt */
+#define IG4_REG_CLR_STOP_DET 0x0060 /* RO Clear STOP Detection Int */
+#define IG4_REG_CLR_START_DET 0x0064 /* RO Clear START Detection Int */
+#define IG4_REG_CLR_GEN_CALL 0x0068 /* RO Clear General Call Interrupt */
+#define IG4_REG_I2C_EN 0x006C /* RW I2C Enable */
+#define IG4_REG_I2C_STA 0x0070 /* RO I2C Status */
+#define IG4_REG_TXFLR 0x0074 /* RO Transmit FIFO Level */
+#define IG4_REG_RXFLR 0x0078 /* RO Receive FIFO Level */
+#define IG4_REG_SDA_HOLD 0x007C /* RW SDA Hold Time Length */
+#define IG4_REG_TX_ABRT_SOURCE 0x0080 /* RO Transmit Abort Source */
+#define IG4_REG_SLV_DATA_NACK 0x0084 /* RW General Slave Data NACK */
+#define IG4_REG_DMA_CTRL 0x0088 /* RW DMA Control */
+#define IG4_REG_DMA_TDLR 0x008C /* RW DMA Transmit Data Level */
+#define IG4_REG_DMA_RDLR 0x0090 /* RW DMA Receive Data Level */
+#define IG4_REG_SDA_SETUP 0x0094 /* RW SDA Setup */
+#define IG4_REG_ENABLE_STATUS 0x009C /* RO Enable Status */
+#define IG4_REG_COMP_PARAM1 0x00F4 /* RO Component Parameter */
+#define IG4_REG_COMP_VER 0x00F8 /* RO Component Version */
+#define IG4_REG_COMP_TYPE 0x00FC /* RO Probe width/endian? (linux) */
+#define IG4_REG_CLK_PARMS 0x0800 /* RW Clock Parameters */
+#define IG4_REG_RESETS 0x0804 /* RW Reset Register */
+#define IG4_REG_GENERAL 0x0808 /* RW General Register */
+#define IG4_REG_SW_LTR_VALUE 0x0810 /* RW SW LTR Value */
+#define IG4_REG_AUTO_LTR_VALUE 0x0814 /* RW Auto LTR Value */
+
+/*
+ * CTL - Control Register 22.2.1
+ * Default Value: 0x0000007F.
+ *
+ * RESTARTEN - RW Restart Enable
+ * 10BIT - RW Controller operates in 10-bit mode, else 7-bit
+ *
+ * NOTE: When restart is disabled the controller is incapable of
+ * performing the following functions:
+ *
+ * Sending a START Byte
+ * Performing any high-speed mode op
+ * Performing direction changes in combined format mode
+ * Performing a read operation with a 10-bit address
+ *
+ * Attempting to perform the above operations will result in the
+ * TX_ABORT bit being set in RAW_INTR_STAT.
+ */
+#define IG4_CTL_SLAVE_DISABLE 0x0040 /* snarfed from linux */
+#define IG4_CTL_RESTARTEN 0x0020 /* Allow Restart when master */
+#define IG4_CTL_10BIT 0x0010 /* ctlr accepts 10-bit addresses */
+#define IG4_CTL_SPEED_FAST 0x0004 /* snarfed from linux */
+#define IG4_CTL_SPEED_STD 0x0002 /* snarfed from linux */
+#define IG4_CTL_MASTER 0x0001 /* snarfed from linux */
+
+/*
+ * TAR_ADD - Target Address Register 22.2.2
+ * Default Value: 0x00000055F
+ *
+ * 10BIT - RW controller starts its transfers in 10-bit
+ * address mode, else 7-bit.
+ *
+ * SPECIAL - RW Indicates whether software performs a General Call
+ * or START BYTE command.
+ *
+ * 0 Ignore GC_OR_START and use TAR address.
+ *
+ * 1 Perform special I2C Command based on GC_OR_START.
+ *
+ * GC_OR_START - RW (only if SPECIAL is set)
+ *
+ * 0 General Call Address. After issuing a General Call,
+ * only writes may be performed. Attempting to issue
+ * a read command results in IX_ABRT in RAW_INTR_STAT.
+ * The controller remains in General Call mode until
+ * bit 11 (SPECIAL) is cleared.
+ *
+ * 1 START BYTE.
+ *
+ *
+ * IC_TAR - RW when transmitting a general call, these bits are
+ * ignored. To generate a START BYTE, the address
+ * needs to be written into these bits once.
+ *
+ * This register should only be updated when the IIC is disabled (I2C_ENABLE=0)
+ */
+#define IG4_TAR_10BIT 0x1000 /* start xfer in 10-bit mode */
+#define IG4_TAR_SPECIAL 0x0800 /* Perform special command */
+#define IG4_TAR_GC_OR_START 0x0400 /* General Call or Start */
+#define IG4_TAR_ADDR_MASK 0x03FF /* Target address */
+
+/*
+ * TAR_DATA_CMD - Data Buffer and Command Register 22.2.3
+ *
+ * RESTART - RW This bit controls whether a forced RESTART is
+ * issued before the byte is sent or received.
+ *
+ * 0 If not set a RESTART is only issued if the tranfer
+ * direction is changing from the previous command.
+ *
+ * 1 A RESTART is issued before the byte is sent or
+ * received, regardless of whether or not the transfer
+ * direction is changing from the previous command.
+ *
+ * STOP - RW This bit controls whether a STOP is issued after
+ * the byte is sent or received.
+ *
+ * 0 STOP is not issued after this byte, regardless
+ * of whether or not the Tx FIFO is empty.
+ *
+ * 1 STOP is issued after this byte, regardless of
+ * whether or not the Tx FIFO is empty. If the
+ * Tx FIFO is not empty the master immediately tries
+ * to start a new transfer by issuing a START and
+ * arbitrating for the bus.
+ *
+ * i.e. the STOP is issued along with this byte,
+ * within the write stream.
+ *
+ * COMMAND - RW Control whether a read or write is performed.
+ *
+ * 0 WRITE
+ *
+ * 1 READ
+ *
+ * DATA (7:0) - RW Contains the data to be transmitted or received
+ * on the I2C bus.
+ *
+ * NOTE: Writing to this register causes a START + slave + RW to be
+ * issued if the direction has changed or the last data byte was
+ * sent with a STOP.
+ *
+ * NOTE: We control termination? so this register must be written
+ * for each byte we wish to receive. We can then drain the
+ * receive FIFO.
+ */
+
+#define IG4_DATA_RESTART 0x0400 /* Force RESTART */
+#define IG4_DATA_STOP 0x0200 /* Force STOP[+START] */
+#define IG4_DATA_COMMAND_RD 0x0100 /* bus direction 0=write 1=read */
+#define IG4_DATA_MASK 0x00FF
+
+/*
+ * SS_SCL_HCNT - Standard Speed Clock High Count Register 22.2.4
+ * SS_SCL_LCNT - Standard Speed Clock Low Count Register 22.2.5
+ * FS_SCL_HCNT - Fast Speed Clock High Count Register 22.2.6
+ * FS_SCL_LCNT - Fast Speed Clock Low Count Register 22.2.7
+ *
+ * COUNT (15:0) - Set the period count to a value between 6 and
+ * 65525.
+ */
+#define IG4_SCL_CLOCK_MASK 0xFFFFU /* count bits in register */
+
+/*
+ * INTR_STAT - (RO) Interrupt Status Register 22.2.8
+ * INTR_MASK - (RW) Interrupt Mask Register 22.2.9
+ * RAW_INTR_STAT- (RO) Raw Interrupt Status Register 22.2.10
+ *
+ * GEN_CALL Set only when a general call (broadcast) address
+ * is received and acknowleged, stays set until
+ * cleared by reading CLR_GEN_CALL.
+ *
+ * START_DET Set when a START or RESTART condition has occurred
+ * on the interface.
+ *
+ * STOP_DET Set when a STOP condition has occurred on the
+ * interface.
+ *
+ * ACTIVITY Set by any activity on the interface. Cleared
+ * by reading CLR_ACTIVITY or CLR_INTR.
+ *
+ * TX_ABRT Indicates the controller as a transmitter is
+ * unable to complete the intended action. When set,
+ * the controller will hold the TX FIFO in a reset
+ * state (flushed) until CLR_TX_ABORT is read to
+ * clear the condition. Once cleared, the TX FIFO
+ * will be available again.
+ *
+ * TX_EMPTY Indicates that the transmitter is at or below
+ * the specified TX_TL threshold. Automatically
+ * cleared by HW when the buffer level goes above
+ * the threshold.
+ *
+ * TX_OVER Indicates that the processer attempted to write
+ * to the TX FIFO while the TX FIFO was full. Cleared
+ * by reading CLR_TX_OVER.
+ *
+ * RX_FULL Indicates that the receive FIFO has reached or
+ * exceeded the specified RX_TL threshold. Cleared
+ * by HW when the cpu drains the FIFO to below the
+ * threshold.
+ *
+ * RX_OVER Indicates that the receive FIFO was unable to
+ * accept new data and data was lost. Cleared by
+ * reading CLR_RX_OVER.
+ *
+ * RX_UNDER Indicates that the cpu attempted to read data
+ * from the receive buffer while the RX FIFO was
+ * empty. Cleared by reading CLR_RX_UNDER.
+ *
+ * NOTES ON RAW_INTR_STAT:
+ *
+ * This register can be used to monitor the GEN_CALL, START_DET,
+ * STOP_DET, ACTIVITY, TX_ABRT, TX_EMPTY, TX_OVER, RX_FULL, RX_OVER,
+ * and RX_UNDER bits. The documentation is a bit unclear but presumably
+ * this is the unlatched version.
+ *
+ * Code should test FIFO conditions using the I2C_STA (status) register,
+ * not the interrupt status registers.
+ */
+
+#define IG4_INTR_GEN_CALL 0x0800
+#define IG4_INTR_START_DET 0x0400
+#define IG4_INTR_STOP_DET 0x0200
+#define IG4_INTR_ACTIVITY 0x0100
+#define IG4_INTR_TX_ABRT 0x0040
+#define IG4_INTR_TX_EMPTY 0x0010
+#define IG4_INTR_TX_OVER 0x0008
+#define IG4_INTR_RX_FULL 0x0004
+#define IG4_INTR_RX_OVER 0x0002
+#define IG4_INTR_RX_UNDER 0x0001
+
+/*
+ * RX_TL - (RW) Receive FIFO Threshold Register 22.2.11
+ * TX_TL - (RW) Transmit FIFO Threshold Register 22.2.12
+ *
+ * Specify the receive and transmit FIFO threshold register. The
+ * FIFOs have 16 elements. The valid range is 0-15. Setting a
+ * value greater than 15 causes the actual value to be the maximum
+ * depth of the FIFO.
+ *
+ * Generally speaking since everything is messaged, we can use a
+ * mid-level setting for both parameters and (e.g.) fully drain the
+ * receive FIFO on the STOP_DET condition to handle loose ends.
+ */
+#define IG4_FIFO_MASK 0x00FF
+#define IG4_FIFO_LIMIT 16
+
+/*
+ * CLR_INTR - (RO) Clear Interrupt Register 22.2.13
+ * CLR_RX_UNDER - (RO) Clear Interrupt Register (specific) 22.2.14
+ * CLR_RX_OVER - (RO) Clear Interrupt Register (specific) 22.2.15
+ * CLR_TX_OVER - (RO) Clear Interrupt Register (specific) 22.2.16
+ * CLR_TX_ABORT - (RO) Clear Interrupt Register (specific) 22.2.17
+ * CLR_ACTIVITY - (RO) Clear Interrupt Register (specific) 22.2.18
+ * CLR_STOP_DET - (RO) Clear Interrupt Register (specific) 22.2.19
+ * CLR_START_DET- (RO) Clear Interrupt Register (specific) 22.2.20
+ * CLR_GEN_CALL - (RO) Clear Interrupt Register (specific) 22.2.21
+ *
+ * CLR_* specific operations clear the appropriate bit in the
+ * RAW_INTR_STAT register. Intel does not really document whether
+ * these operations clear the normal interrupt status register.
+ *
+ * CLR_INTR clears bits in the normal interrupt status register and
+ * presumably also the raw(?) register? Intel is again unclear.
+ *
+ * NOTE: CLR_INTR only clears software-clearable interrupts. Hardware
+ * clearable interrupts are controlled entirely by the hardware.
+ * CLR_INTR also clears the TX_ABRT_SOURCE register.
+ *
+ * NOTE: CLR_TX_ABORT also clears the TX_ABRT_SOURCE register and releases
+ * the TX FIFO from its flushed/reset state, allowing more writes
+ * to the TX FIFO.
+ *
+ * NOTE: CLR_ACTIVITY has no effect if the I2C bus is still active.
+ * Intel documents that the bit is automatically cleared when
+ * there is no further activity on the bus.
+ */
+#define IG4_CLR_BIT 0x0001 /* Reflects source */
+
+/*
+ * I2C_EN - (RW) I2C Enable Register 22.2.22
+ *
+ * ABORT Software can abort an I2C transfer by setting this
+ * bit. Hardware will clear the bit once the STOP has
+ * been detected. This bit can only be set while the
+ * I2C interface is enabled.
+ *
+ * I2C_ENABLE Enable the controller, else disable it.
+ * (Use I2C_ENABLE_STATUS to poll enable status
+ * & wait for changes)
+ */
+#define IG4_I2C_ABORT 0x0002
+#define IG4_I2C_ENABLE 0x0001
+
+/*
+ * I2C_STA - (RO) I2C Status Register 22.2.23
+ */
+#define IG4_STATUS_ACTIVITY 0x0020 /* Controller is active */
+#define IG4_STATUS_RX_FULL 0x0010 /* RX FIFO completely full */
+#define IG4_STATUS_RX_NOTEMPTY 0x0008 /* RX FIFO not empty */
+#define IG4_STATUS_TX_EMPTY 0x0004 /* TX FIFO completely empty */
+#define IG4_STATUS_TX_NOTFULL 0x0002 /* TX FIFO not full */
+#define IG4_STATUS_I2C_ACTIVE 0x0001 /* I2C bus is active */
+
+/*
+ * TXFLR - (RO) Transmit FIFO Level Register 22.2.24
+ * RXFLR - (RO) Receive FIFO Level Register 22.2.25
+ *
+ * Read the number of entries currently in the Transmit or Receive
+ * FIFOs. Note that for some reason the mask is 9 bits instead of
+ * the 8 bits the fill level controls.
+ */
+#define IG4_FIFOLVL_MASK 0x001F
+
+/*
+ * SDA_HOLD - (RW) SDA Hold Time Length Register 22.2.26
+ *
+ * Set the SDA hold time length register in I2C clocks.
+ */
+#define IG4_SDA_HOLD_MASK 0x00FF
+
+/*
+ * TX_ABRT_SOURCE- (RO) Transmit Abort Source Register 22.2.27
+ *
+ * Indicates the cause of a transmit abort. This can indicate a
+ * software programming error or a device expected address width
+ * mismatch or other issues. The NORESTART conditions and GENCALL_NOACK
+ * can only occur if a programming error was made in the driver software.
+ *
+ * In particular, it should be possible to detect whether any devices
+ * are on the bus by observing the GENCALL_READ status, and it might
+ * be possible to detect ADDR7 vs ADDR10 mismatches.
+ */
+#define IG4_ABRTSRC_TRANSFER 0x00010000 /* Abort initiated by user */
+#define IG4_ABRTSRC_ARBLOST 0x00001000 /* Arbitration lost */
+#define IG4_ABRTSRC_NORESTART_10 0x00000400 /* RESTART disabled */
+#define IG4_ABRTSRC_NORESTART_START 0x00000200 /* RESTART disabled */
+#define IG4_ABRTSRC_ACKED_START 0x00000080 /* Improper acked START */
+#define IG4_ABRTSRC_GENCALL_NOACK 0x00000020 /* Improper GENCALL */
+#define IG4_ABRTSRC_GENCALL_READ 0x00000010 /* Nobody acked GENCALL */
+#define IG4_ABRTSRC_TXNOACK_DATA 0x00000008 /* data phase no ACK */
+#define IG4_ABRTSRC_TXNOACK_ADDR10_2 0x00000004 /* addr10/1 phase no ACK */
+#define IG4_ABRTSRC_TXNOACK_ADDR10_1 0x00000002 /* addr10/2 phase no ACK */
+#define IG4_ABRTSRC_TXNOACK_ADDR7 0x00000001 /* addr7 phase no ACK */
+
+/*
+ * SLV_DATA_NACK - (RW) Generate Slave DATA NACK Register 22.2.28
+ *
+ * When the controller is a receiver a NACK can be generated on
+ * receipt of data.
+ *
+ * NACK_GENERATE Set to 0 for normal NACK/ACK generation.
+ * Set to 1 to generate a NACK after next data
+ * byte received.
+ *
+ */
+#define IG4_NACK_GENERATE 0x0001
+
+/*
+ * DMA_CTRL - (RW) DMA Control Register 22.2.29
+ *
+ * Enables DMA on the transmit and/or receive DMA channel.
+ */
+#define IG4_TX_DMA_ENABLE 0x0002
+#define IG4_RX_DMA_ENABLE 0x0001
+
+/*
+ * DMA_TDLR - (RW) DMA Transmit Data Level Register 22.2.30
+ * DMA_RDLR - (RW) DMA Receive Data Level Register 22.2.31
+ *
+ * Similar to RX_TL and TX_TL but controls when a DMA burst occurs
+ * to empty or fill the FIFOs. Use the same IG4_FIFO_MASK and
+ * IG4_FIFO_LIMIT defines for RX_RL and TX_TL.
+ */
+/* empty */
+
+/*
+ * SDA_SETUP - (RW) SDA Setup Time Length Register 22.2.32
+ *
+ * Set the SDA setup time length register in I2C clocks.
+ * The register must be programmed with a value >=2.
+ * (Defaults to 0x64).
+ */
+#define IG4_SDA_SETUP_MASK 0x00FF
+
+/*
+ * ACK_GEN_CALL - (RW) ACK General Call Register 22.2.33
+ *
+ * Control whether the controller responds with a ACK or NACK when
+ * it receives an I2C General Call address.
+ *
+ * If set to 0 a NACK is generated and a General Call interrupt is
+ * NOT generated. Otherwise an ACK + interrupt is generated.
+ */
+#define IG4_ACKGC_ACK 0x0001
+
+/*
+ * ENABLE_STATUS - (RO) Enable Status Registger 22.2.34
+ *
+ * DATA_LOST - Indicates that a slave receiver operation has
+ * been aborted with at least one data byte received
+ * from a transfer due to the I2C controller being
+ * disabled (IG4_I2C_ENABLE -> 0)
+ *
+ * ENABLED - Intel documentation is lacking but I assume this
+ * is a reflection of the IG4_I2C_ENABLE bit in the
+ * I2C_EN register.
+ *
+ */
+#define IG4_ENASTAT_DATA_LOST 0x0004
+#define IG4_ENASTAT_ENABLED 0x0001
+
+/*
+ * COMP_PARAM1 - (RO) Component Parameter Register 22.2.35
+ * Default Value 0x00FFFF6E
+ *
+ * VALID - Intel documentation is unclear but I believe this
+ * must be read as a 1 to indicate that the rest of
+ * the bits in the register are valid.
+ *
+ * HASDMA - Indicates that the chip is DMA-capable. Presumably
+ * in certain virtualization cases the chip might be
+ * set to not be DMA-capable.
+ *
+ * INTR_IO - Indicates that all interrupts are combined to
+ * generate one interrupt. If not set, interrupts
+ * are individual (more virtualization stuff?)
+ *
+ * HCCNT_RO - Indicates that the clock timing registers are
+ * RW. If not set, the registers are RO.
+ * (more virtualization stuff).
+ *
+ * MAXSPEED - Indicates the maximum speed supported.
+ *
+ * DATAW - Indicates the internal bus width in bits.
+ */
+#define IG4_PARAM1_TXFIFO_DEPTH(v) (((v) >> 16) & 0xFF)
+#define IG4_PARAM1_RXFIFO_DEPTH(v) (((v) >> 8) & 0xFF)
+#define IG4_PARAM1_CONFIG_VALID 0x00000080
+#define IG4_PARAM1_CONFIG_HASDMA 0x00000040
+#define IG4_PARAM1_CONFIG_INTR_IO 0x00000020
+#define IG4_PARAM1_CONFIG_HCCNT_RO 0x00000010
+#define IG4_PARAM1_CONFIG_MAXSPEED_MASK 0x0000000C
+#define IG4_PARAM1_CONFIG_DATAW_MASK 0x00000003
+
+#define IG4_CONFIG_MAXSPEED_RESERVED00 0x00000000
+#define IG4_CONFIG_MAXSPEED_STANDARD 0x00000004
+#define IG4_CONFIG_MAXSPEED_FAST 0x00000008
+#define IG4_CONFIG_MAXSPEED_HIGH 0x0000000C
+
+#define IG4_CONFIG_DATAW_8 0x00000000
+#define IG4_CONFIG_DATAW_16 0x00000001
+#define IG4_CONFIG_DATAW_32 0x00000002
+#define IG4_CONFIG_DATAW_RESERVED11 0x00000003
+
+/*
+ * COMP_VER - (RO) Component Version Register 22.2.36
+ * Default Value 0x3131352A
+ *
+ * Contains the chip version number. All 32 bits.
+ */
+#define IG4_COMP_VER 0x3131352A
+
+/*
+ * COMP_TYPE - (RO) (linux) Endian and bus width probe
+ *
+ * Read32 from this register and test against IG4_COMP_TYPE
+ * to determine the bus width. e.g. 01404457 = endian-reversed,
+ * and 00000140 or 00004457 means internal 16-bit bus (?).
+ *
+ * This register is not in the intel documentation, I pulled it
+ * from the linux driver i2c-designware-core.c.
+ */
+#define IG4_COMP_TYPE 0x44570140
+
+/*
+ * RESETS - (RW) Resets Register 22.2.37
+ *
+ * Used to reset the I2C host controller by SW. There is no timing
+ * requirement, software can assert and de-assert in back-to-back
+ * transactions.
+ *
+ * 00 I2C host controller is NOT in reset.
+ * 01 (reserved)
+ * 10 (reserved)
+ * 11 I2C host controller is in reset.
+ */
+#define IG4_RESETS_ASSERT 0x0003
+#define IG4_RESETS_DEASSERT 0x0000
+
+/*
+ * GENERAL - (RW) General Reigster 22.2.38
+ *
+ * IOVOLT 0=1.8V 1=3.3V
+ *
+ * LTR 0=Auto 1=SW
+ *
+ * In Auto mode the BIOS will write to the host controller's
+ * AUTO LTR Value register (offset 0x0814) with the active
+ * state LTR value, and will write to the SW LTR Value register
+ * (offset 0x0810) with the idle state LTR value.
+ *
+ * In SW mode the SW will write to the host controller SW LTR
+ * value (offset 0x0810). It is the SW responsibility to update
+ * the LTR with the appropriate value.
+ */
+#define IG4_GENERAL_IOVOLT3_3 0x0008
+#define IG4_GENERAL_SWMODE 0x0004
+
+/*
+ * SW_LTR_VALUE - (RW) SW LTR Value Register 22.2.39
+ * AUTO_LTR_VALUE - (RW) SW LTR Value Register 22.2.40
+ *
+ * Default value is 0x00000800 which means the best possible
+ * service/response time.
+ *
+ * It isn't quite clear how the snooping works. There are two scale
+ * bits for both sets but two of the four codes are reserved. The
+ * *SNOOP_VALUE() is specified as a 10-bit latency value. If 0, it
+ * indicates that the device cannot tolerate any delay and needs the
+ * best possible service/response time.
+ *
+ * I think this is for snooping (testing) the I2C bus. The lowest
+ * delay (0) probably runs the controller polling at a high, power hungry
+ * rate. But I dunno.
+ */
+#define IG4_SWLTR_NSNOOP_REQ 0x80000000 /* (ro) */
+#define IG4_SWLTR_NSNOOP_SCALE_MASK 0x1C000000 /* (ro) */
+#define IG4_SWLTR_NSNOOP_SCALE_1US 0x08000000 /* (ro) */
+#define IG4_SWLTR_NSNOOP_SCALE_32US 0x0C000000 /* (ro) */
+#define IG4_SWLTR_NSNOOP_VALUE_DECODE(v) (((v) >> 16) & 0x3F)
+#define IG4_SWLTR_NSNOOP_VALUE_ENCODE(v) (((v) & 0x3F) << 16)
+
+#define IG4_SWLTR_SNOOP_REQ 0x00008000 /* (rw) */
+#define IG4_SWLTR_SNOOP_SCALE_MASK 0x00001C00 /* (rw) */
+#define IG4_SWLTR_SNOOP_SCALE_1US 0x00000800 /* (rw) */
+#define IG4_SWLTR_SNOOP_SCALE_32US 0x00000C00 /* (rw) */
+#define IG4_SWLTR_SNOOP_VALUE_DECODE(v) ((v) & 0x3F)
+#define IG4_SWLTR_SNOOP_VALUE_ENCODE(v) ((v) & 0x3F)
+
+#endif
diff --git a/sys/dev/ichiic/ig4_var.h b/sys/dev/ichiic/ig4_var.h
new file mode 100644
index 0000000..6c91055
--- /dev/null
+++ b/sys/dev/ichiic/ig4_var.h
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2014 The DragonFly Project. All rights reserved.
+ *
+ * This code is derived from software contributed to The DragonFly Project
+ * by Matthew Dillon <dillon@backplane.com> and was subsequently ported
+ * to FreeBSD by Michael Gmelin <freebsd@grem.de>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name of The DragonFly Project nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific, prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _BUS_SMBUS_INTELGEN4_IG4_VAR_H_
+#define _BUS_SMBUS_INTELGEN4_IG4_VAR_H_
+
+#include "bus_if.h"
+#include "device_if.h"
+#include "pci_if.h"
+#include "smbus_if.h"
+
+#define IG4_RBUFSIZE 128
+#define IG4_RBUFMASK (IG4_RBUFSIZE - 1)
+
+enum ig4_op { IG4_IDLE, IG4_READ, IG4_WRITE };
+
+struct ig4iic_softc {
+ device_t dev;
+ struct intr_config_hook enum_hook;
+ device_t smb;
+ struct resource *regs_res;
+ int regs_rid;
+ struct resource *intr_res;
+ int intr_rid;
+ void *intr_handle;
+ int intr_type;
+ enum ig4_op op;
+ int cmd;
+ int rnext;
+ int rpos;
+ char rbuf[IG4_RBUFSIZE];
+ int error;
+ uint8_t last_slave;
+ int pci_attached : 1;
+ int use_10bit : 1;
+ int slave_valid : 1;
+ int read_started : 1;
+ int write_started : 1;
+ struct mtx mutex;
+};
+
+typedef struct ig4iic_softc ig4iic_softc_t;
+
+/* Attach/Detach called from ig4iic_pci_*() */
+int ig4iic_attach(ig4iic_softc_t *sc);
+int ig4iic_detach(ig4iic_softc_t *sc);
+
+/* SMBus methods */
+extern smbus_callback_t ig4iic_smb_callback;
+extern smbus_quick_t ig4iic_smb_quick;
+extern smbus_sendb_t ig4iic_smb_sendb;
+extern smbus_recvb_t ig4iic_smb_recvb;
+extern smbus_writeb_t ig4iic_smb_writeb;
+extern smbus_writew_t ig4iic_smb_writew;
+extern smbus_readb_t ig4iic_smb_readb;
+extern smbus_readw_t ig4iic_smb_readw;
+extern smbus_pcall_t ig4iic_smb_pcall;
+extern smbus_bwrite_t ig4iic_smb_bwrite;
+extern smbus_bread_t ig4iic_smb_bread;
+extern smbus_trans_t ig4iic_smb_trans;
+
+#endif
diff --git a/sys/dev/ichsmb/ichsmb_pci.c b/sys/dev/ichsmb/ichsmb_pci.c
index ae8b179..00ba2c3 100644
--- a/sys/dev/ichsmb/ichsmb_pci.c
+++ b/sys/dev/ichsmb/ichsmb_pci.c
@@ -5,7 +5,7 @@
* Copyright (c) 2000 Whistle Communications, Inc.
* All rights reserved.
* Author: Archie Cobbs <archie@freebsd.org>
- *
+ *
* Subject to the following obligations and disclaimer of warranty, use and
* redistribution of this software, in source or object code forms, with or
* without modifications are expressly permitted by Whistle Communications;
@@ -16,7 +16,7 @@
* Communications, Inc. trademarks, including the mark "WHISTLE
* COMMUNICATIONS" on advertising, endorsements, or otherwise except as
* such appears in the above copyright notice or in the software.
- *
+ *
* THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND
* TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO
* REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE,
@@ -91,6 +91,7 @@ __FBSDID("$FreeBSD$");
#define ID_LPTLP 0x9c228086
#define ID_WCPT 0x8ca28086
#define ID_WCPTLP 0x9ca28086
+#define ID_WELLSBURG 0x8d228086
#define PCIS_SERIALBUS_SMBUS_PROGIF 0x00
@@ -212,6 +213,9 @@ ichsmb_pci_probe(device_t dev)
case ID_COLETOCRK:
device_set_desc(dev, "Intel Coleto Creek SMBus controller");
break;
+ case ID_WELLSBURG:
+ device_set_desc(dev, "Intel Wellsburg SMBus controller");
+ break;
default:
return (ENXIO);
}
diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c
index 7ac1dea..9c57aed 100644
--- a/sys/dev/if_ndis/if_ndis.c
+++ b/sys/dev/if_ndis/if_ndis.c
@@ -159,8 +159,8 @@ static void ndis_tick (void *);
static void ndis_ticktask (device_object *, void *);
static int ndis_raw_xmit (struct ieee80211_node *, struct mbuf *,
const struct ieee80211_bpf_params *);
-static void ndis_update_mcast (struct ifnet *ifp);
-static void ndis_update_promisc (struct ifnet *ifp);
+static void ndis_update_mcast (struct ieee80211com *);
+static void ndis_update_promisc (struct ieee80211com *);
static void ndis_start (struct ifnet *);
static void ndis_starttask (device_object *, void *);
static void ndis_resettask (device_object *, void *);
@@ -738,6 +738,8 @@ ndis_attach(dev)
ifp->if_ioctl = ndis_ioctl_80211;
ic->ic_ifp = ifp;
+ ic->ic_softc = sc;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_opmode = IEEE80211_M_STA;
ic->ic_phytype = IEEE80211_T_DS;
ic->ic_caps = IEEE80211_C_8023ENCAP |
@@ -1771,15 +1773,15 @@ ndis_raw_xmit(struct ieee80211_node *ni, struct mbuf *m,
}
static void
-ndis_update_mcast(struct ifnet *ifp)
+ndis_update_mcast(struct ieee80211com *ic)
{
- struct ndis_softc *sc = ifp->if_softc;
+ struct ndis_softc *sc = ic->ic_softc;
ndis_setmulti(sc);
}
static void
-ndis_update_promisc(struct ifnet *ifp)
+ndis_update_promisc(struct ieee80211com *ic)
{
/* not supported */
}
diff --git a/sys/dev/ipw/if_ipw.c b/sys/dev/ipw/if_ipw.c
index 04c3363..d3eb85e 100644
--- a/sys/dev/ipw/if_ipw.c
+++ b/sys/dev/ipw/if_ipw.c
@@ -286,6 +286,8 @@ ipw_attach(device_t dev)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_softc = sc;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_opmode = IEEE80211_M_STA;
ic->ic_phytype = IEEE80211_T_DS;
@@ -751,11 +753,8 @@ ipw_release(struct ipw_softc *sc)
}
if (sc->tbd_dmat != NULL) {
- if (sc->stbd_list != NULL) {
- bus_dmamap_unload(sc->tbd_dmat, sc->tbd_map);
- bus_dmamem_free(sc->tbd_dmat, sc->tbd_list,
- sc->tbd_map);
- }
+ bus_dmamap_unload(sc->tbd_dmat, sc->tbd_map);
+ bus_dmamem_free(sc->tbd_dmat, sc->tbd_list, sc->tbd_map);
bus_dma_tag_destroy(sc->tbd_dmat);
}
diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c
index b6de4b6..fecbe89 100644
--- a/sys/dev/iwi/if_iwi.c
+++ b/sys/dev/iwi/if_iwi.c
@@ -154,7 +154,7 @@ static void iwi_node_free(struct ieee80211_node *);
static void iwi_media_status(struct ifnet *, struct ifmediareq *);
static int iwi_newstate(struct ieee80211vap *, enum ieee80211_state, int);
static void iwi_wme_init(struct iwi_softc *);
-static int iwi_wme_setparams(struct iwi_softc *, struct ieee80211com *);
+static int iwi_wme_setparams(struct iwi_softc *);
static void iwi_update_wme(void *, int);
static int iwi_wme_update(struct ieee80211com *);
static uint16_t iwi_read_prom_word(struct iwi_softc *, uint8_t);
@@ -364,6 +364,8 @@ iwi_attach(device_t dev)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_softc = sc;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_opmode = IEEE80211_M_STA;
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
@@ -1057,8 +1059,9 @@ iwi_wme_init(struct iwi_softc *sc)
}
static int
-iwi_wme_setparams(struct iwi_softc *sc, struct ieee80211com *ic)
+iwi_wme_setparams(struct iwi_softc *sc)
{
+ struct ieee80211com *ic = sc->sc_ifp->if_l2com;
const struct wmeParams *wmep;
int ac;
@@ -1081,12 +1084,11 @@ iwi_wme_setparams(struct iwi_softc *sc, struct ieee80211com *ic)
static void
iwi_update_wme(void *arg, int npending)
{
- struct ieee80211com *ic = arg;
- struct iwi_softc *sc = ic->ic_ifp->if_softc;
+ struct iwi_softc *sc = arg;
IWI_LOCK_DECL;
IWI_LOCK(sc);
- (void) iwi_wme_setparams(sc, ic);
+ (void) iwi_wme_setparams(sc);
IWI_UNLOCK(sc);
}
@@ -2945,7 +2947,7 @@ iwi_auth_and_assoc(struct iwi_softc *sc, struct ieee80211vap *vap)
if ((vap->iv_flags & IEEE80211_F_WME) && ni->ni_ies.wme_ie != NULL) {
/* NB: don't treat WME setup as failure */
- if (iwi_wme_setparams(sc, ic) == 0 && iwi_wme_setie(sc) == 0)
+ if (iwi_wme_setparams(sc) == 0 && iwi_wme_setie(sc) == 0)
assoc->policy |= htole16(IWI_POLICY_WME);
/* XXX complain on failure? */
}
diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c
index ab98204..a04d446 100644
--- a/sys/dev/iwn/if_iwn.c
+++ b/sys/dev/iwn/if_iwn.c
@@ -247,7 +247,7 @@ static int iwn_set_link_quality(struct iwn_softc *,
struct ieee80211_node *);
static int iwn_add_broadcast_node(struct iwn_softc *, int);
static int iwn_updateedca(struct ieee80211com *);
-static void iwn_update_mcast(struct ifnet *);
+static void iwn_update_mcast(struct ieee80211com *);
static void iwn_set_led(struct iwn_softc *, uint8_t, uint8_t, uint8_t);
static int iwn_set_critical_temp(struct iwn_softc *);
static int iwn_set_timing(struct iwn_softc *, struct ieee80211_node *);
@@ -556,6 +556,8 @@ iwn_attach(device_t dev)
ic = ifp->if_l2com;
ic->ic_ifp = ifp;
+ ic->ic_softc = sc;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
ic->ic_opmode = IEEE80211_M_STA; /* default to BSS mode */
@@ -563,7 +565,9 @@ iwn_attach(device_t dev)
ic->ic_caps =
IEEE80211_C_STA /* station mode supported */
| IEEE80211_C_MONITOR /* monitor mode supported */
+#if 0
| IEEE80211_C_BGSCAN /* background scanning */
+#endif
| IEEE80211_C_TXPMGT /* tx power management */
| IEEE80211_C_SHSLOT /* short slot time supported */
| IEEE80211_C_WPA
@@ -1315,10 +1319,10 @@ iwn_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit,
const uint8_t bssid[IEEE80211_ADDR_LEN],
const uint8_t mac[IEEE80211_ADDR_LEN])
{
+ struct iwn_softc *sc = ic->ic_softc;
struct iwn_vap *ivp;
struct ieee80211vap *vap;
uint8_t mac1[IEEE80211_ADDR_LEN];
- struct iwn_softc *sc = ic->ic_ifp->if_softc;
if (!TAILQ_EMPTY(&ic->ic_vaps)) /* only one at a time */
return NULL;
@@ -2525,7 +2529,7 @@ static int
iwn_setregdomain(struct ieee80211com *ic, struct ieee80211_regdomain *rd,
int nchan, struct ieee80211_channel chans[])
{
- struct iwn_softc *sc = ic->ic_ifp->if_softc;
+ struct iwn_softc *sc = ic->ic_softc;
int i;
for (i = 0; i < nchan; i++) {
@@ -2534,8 +2538,7 @@ iwn_setregdomain(struct ieee80211com *ic, struct ieee80211_regdomain *rd,
channel = iwn_find_eeprom_channel(sc, c);
if (channel == NULL) {
- if_printf(ic->ic_ifp,
- "%s: invalid channel %u freq %u/0x%x\n",
+ ic_printf(ic, "%s: invalid channel %u freq %u/0x%x\n",
__func__, c->ic_ieee, c->ic_freq, c->ic_flags);
return EINVAL;
}
@@ -2797,7 +2800,7 @@ iwn_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
{
struct iwn_vap *ivp = IWN_VAP(vap);
struct ieee80211com *ic = vap->iv_ic;
- struct iwn_softc *sc = ic->ic_ifp->if_softc;
+ struct iwn_softc *sc = ic->ic_softc;
int error = 0;
DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);
@@ -4903,7 +4906,7 @@ iwn_watchdog(void *arg)
if (sc->sc_tx_timer > 0) {
if (--sc->sc_tx_timer == 0) {
- if_printf(ifp, "device timeout\n");
+ ic_printf(ic, "device timeout\n");
ieee80211_runtask(ic, &sc->sc_reinit_task);
return;
}
@@ -5247,7 +5250,7 @@ static int
iwn_updateedca(struct ieee80211com *ic)
{
#define IWN_EXP2(x) ((1 << (x)) - 1) /* CWmin = 2^ECWmin - 1 */
- struct iwn_softc *sc = ic->ic_ifp->if_softc;
+ struct iwn_softc *sc = ic->ic_softc;
struct iwn_edca_params cmd;
int aci;
@@ -5277,7 +5280,7 @@ iwn_updateedca(struct ieee80211com *ic)
}
static void
-iwn_update_mcast(struct ifnet *ifp)
+iwn_update_mcast(struct ieee80211com *ic)
{
/* Ignore */
}
@@ -7081,7 +7084,7 @@ iwn_ampdu_rx_start(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap,
int baparamset, int batimeout, int baseqctl)
{
#define MS(_v, _f) (((_v) & _f) >> _f##_S)
- struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc;
+ struct iwn_softc *sc = ni->ni_ic->ic_softc;
struct iwn_ops *ops = &sc->ops;
struct iwn_node *wn = (void *)ni;
struct iwn_node_info node;
@@ -7117,7 +7120,7 @@ static void
iwn_ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap)
{
struct ieee80211com *ic = ni->ni_ic;
- struct iwn_softc *sc = ic->ic_ifp->if_softc;
+ struct iwn_softc *sc = ic->ic_softc;
struct iwn_ops *ops = &sc->ops;
struct iwn_node *wn = (void *)ni;
struct iwn_node_info node;
@@ -7145,7 +7148,7 @@ static int
iwn_addba_request(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap,
int dialogtoken, int baparamset, int batimeout)
{
- struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc;
+ struct iwn_softc *sc = ni->ni_ic->ic_softc;
int qid;
DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);
@@ -7175,7 +7178,7 @@ static int
iwn_addba_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap,
int code, int baparamset, int batimeout)
{
- struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc;
+ struct iwn_softc *sc = ni->ni_ic->ic_softc;
int qid = *(int *)tap->txa_private;
uint8_t tid = tap->txa_tid;
int ret;
@@ -7204,7 +7207,7 @@ iwn_ampdu_tx_start(struct ieee80211com *ic, struct ieee80211_node *ni,
uint8_t tid)
{
struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[tid];
- struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc;
+ struct iwn_softc *sc = ni->ni_ic->ic_softc;
struct iwn_ops *ops = &sc->ops;
struct iwn_node *wn = (void *)ni;
struct iwn_node_info node;
@@ -7238,7 +7241,7 @@ iwn_ampdu_tx_start(struct ieee80211com *ic, struct ieee80211_node *ni,
static void
iwn_ampdu_tx_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap)
{
- struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc;
+ struct iwn_softc *sc = ni->ni_ic->ic_softc;
struct iwn_ops *ops = &sc->ops;
uint8_t tid = tap->txa_tid;
int qid;
@@ -8773,8 +8776,8 @@ static void
iwn_scan_curchan(struct ieee80211_scan_state *ss, unsigned long maxdwell)
{
struct ieee80211vap *vap = ss->ss_vap;
- struct iwn_softc *sc = vap->iv_ic->ic_ifp->if_softc;
struct ieee80211com *ic = vap->iv_ic;
+ struct iwn_softc *sc = ic->ic_softc;
int error;
IWN_LOCK(sc);
diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c
index b9bba31..7755626 100644
--- a/sys/dev/ixgbe/if_ix.c
+++ b/sys/dev/ixgbe/if_ix.c
@@ -54,7 +54,7 @@ int ixgbe_display_debug_stats = 0;
/*********************************************************************
* Driver version
*********************************************************************/
-char ixgbe_driver_version[] = "2.8.3";
+char ixgbe_driver_version[] = "3.1.0";
/*********************************************************************
* PCI Device ID Table
@@ -138,6 +138,7 @@ static int ixgbe_setup_msix(struct adapter *);
static void ixgbe_free_pci_resources(struct adapter *);
static void ixgbe_local_timer(void *);
static int ixgbe_setup_interface(device_t, struct adapter *);
+static void ixgbe_config_gpie(struct adapter *);
static void ixgbe_config_dmac(struct adapter *);
static void ixgbe_config_delay_values(struct adapter *);
static void ixgbe_config_link(struct adapter *);
@@ -204,6 +205,18 @@ static void ixgbe_handle_phy(void *, int);
static void ixgbe_reinit_fdir(void *, int);
#endif
+#ifdef PCI_IOV
+static void ixgbe_ping_all_vfs(struct adapter *);
+static void ixgbe_handle_mbx(void *, int);
+static int ixgbe_init_iov(device_t, u16, const nvlist_t *);
+static void ixgbe_uninit_iov(device_t);
+static int ixgbe_add_vf(device_t, u16, const nvlist_t *);
+static void ixgbe_initialize_iov(struct adapter *);
+static void ixgbe_recalculate_max_frame(struct adapter *);
+static void ixgbe_init_vf(struct adapter *, struct ixgbe_vf *);
+#endif /* PCI_IOV */
+
+
/*********************************************************************
* FreeBSD Device Interface Entry Points
*********************************************************************/
@@ -216,6 +229,11 @@ static device_method_t ix_methods[] = {
DEVMETHOD(device_shutdown, ixgbe_shutdown),
DEVMETHOD(device_suspend, ixgbe_suspend),
DEVMETHOD(device_resume, ixgbe_resume),
+#ifdef PCI_IOV
+ DEVMETHOD(pci_iov_init, ixgbe_init_iov),
+ DEVMETHOD(pci_iov_uninit, ixgbe_uninit_iov),
+ DEVMETHOD(pci_iov_add_vf, ixgbe_add_vf),
+#endif /* PCI_IOV */
DEVMETHOD_END
};
@@ -341,6 +359,8 @@ static int fdir_pballoc = 1;
#include <dev/netmap/ixgbe_netmap.h>
#endif /* DEV_NETMAP */
+static MALLOC_DEFINE(M_IXGBE, "ix", "ix driver allocations");
+
/*********************************************************************
* Device identification routine
*
@@ -472,7 +492,7 @@ ixgbe_attach(device_t dev)
}
/* Allocate multicast array memory. */
- adapter->mta = malloc(sizeof(u8) * IXGBE_ETH_LENGTH_OF_ADDRESS *
+ adapter->mta = malloc(sizeof(*adapter->mta) *
MAX_NUM_MULTICAST_ADDRESSES, M_DEVBUF, M_NOWAIT);
if (adapter->mta == NULL) {
device_printf(dev, "Can not allocate multicast setup array\n");
@@ -558,6 +578,28 @@ ixgbe_attach(device_t dev)
/* Set an initial default flow control value */
adapter->fc = ixgbe_fc_full;
+#ifdef PCI_IOV
+ if ((hw->mac.type != ixgbe_mac_82598EB) && (adapter->msix > 1)) {
+ nvlist_t *pf_schema, *vf_schema;
+
+ hw->mbx.ops.init_params(hw);
+ pf_schema = pci_iov_schema_alloc_node();
+ vf_schema = pci_iov_schema_alloc_node();
+ pci_iov_schema_add_unicast_mac(vf_schema, "mac-addr", 0, NULL);
+ pci_iov_schema_add_bool(vf_schema, "mac-anti-spoof",
+ IOV_SCHEMA_HASDEFAULT, TRUE);
+ pci_iov_schema_add_bool(vf_schema, "allow-set-mac",
+ IOV_SCHEMA_HASDEFAULT, FALSE);
+ pci_iov_schema_add_bool(vf_schema, "allow-promisc",
+ IOV_SCHEMA_HASDEFAULT, FALSE);
+ error = pci_iov_attach(dev, pf_schema, vf_schema);
+ if (error != 0) {
+ device_printf(dev,
+ "Error %d setting up SR-IOV\n", error);
+ }
+ }
+#endif /* PCI_IOV */
+
/* Check for certain supported features */
ixgbe_check_wol_support(adapter);
ixgbe_check_eee_support(adapter);
@@ -614,6 +656,13 @@ ixgbe_detach(device_t dev)
return (EBUSY);
}
+#ifdef PCI_IOV
+ if (pci_iov_detach(dev) != 0) {
+ device_printf(dev, "SR-IOV in use; detach first.\n");
+ return (EBUSY);
+ }
+#endif /* PCI_IOV */
+
/* Stop the adapter */
IXGBE_CORE_LOCK(adapter);
ixgbe_setup_low_power_mode(adapter);
@@ -634,6 +683,9 @@ ixgbe_detach(device_t dev)
taskqueue_drain(adapter->tq, &adapter->link_task);
taskqueue_drain(adapter->tq, &adapter->mod_task);
taskqueue_drain(adapter->tq, &adapter->msf_task);
+#ifdef PCI_IOV
+ taskqueue_drain(adapter->tq, &adapter->mbx_task);
+#endif
taskqueue_drain(adapter->tq, &adapter->phy_task);
#ifdef IXGBE_FDIR
taskqueue_drain(adapter->tq, &adapter->fdir_task);
@@ -810,6 +862,9 @@ ixgbe_ioctl(struct ifnet * ifp, u_long command, caddr_t data)
adapter->max_frame_size =
ifp->if_mtu + IXGBE_MTU_HDR;
ixgbe_init_locked(adapter);
+#ifdef PCI_IOV
+ ixgbe_recalculate_max_frame(adapter);
+#endif
IXGBE_CORE_UNLOCK(adapter);
}
break;
@@ -925,22 +980,36 @@ ixgbe_init_locked(struct adapter *adapter)
struct ifnet *ifp = adapter->ifp;
device_t dev = adapter->dev;
struct ixgbe_hw *hw = &adapter->hw;
- u32 k, txdctl, mhadd, gpie;
+ struct tx_ring *txr;
+ struct rx_ring *rxr;
+ u32 txdctl, mhadd;
u32 rxdctl, rxctrl;
+#ifdef PCI_IOV
+ enum ixgbe_iov_mode mode;
+#endif
mtx_assert(&adapter->core_mtx, MA_OWNED);
INIT_DEBUGOUT("ixgbe_init_locked: begin");
+
hw->adapter_stopped = FALSE;
ixgbe_stop_adapter(hw);
callout_stop(&adapter->timer);
+#ifdef PCI_IOV
+ mode = ixgbe_get_iov_mode(adapter);
+ adapter->pool = ixgbe_max_vfs(mode);
+ /* Queue indices may change with IOV mode */
+ for (int i = 0; i < adapter->num_queues; i++) {
+ adapter->rx_rings[i].me = ixgbe_pf_que_index(mode, i);
+ adapter->tx_rings[i].me = ixgbe_pf_que_index(mode, i);
+ }
+#endif
/* reprogram the RAR[0] in case user changed it. */
- ixgbe_set_rar(hw, 0, adapter->hw.mac.addr, 0, IXGBE_RAH_AV);
+ ixgbe_set_rar(hw, 0, hw->mac.addr, adapter->pool, IXGBE_RAH_AV);
/* Get the latest mac address, User can use a LAA */
- bcopy(IF_LLADDR(adapter->ifp), hw->mac.addr,
- IXGBE_ETH_LENGTH_OF_ADDRESS);
- ixgbe_set_rar(hw, 0, hw->mac.addr, 0, 1);
+ bcopy(IF_LLADDR(ifp), hw->mac.addr, IXGBE_ETH_LENGTH_OF_ADDRESS);
+ ixgbe_set_rar(hw, 0, hw->mac.addr, adapter->pool, 1);
hw->addr_ctrl.rar_used_count = 1;
/* Set the various hardware offload abilities */
@@ -963,6 +1032,9 @@ ixgbe_init_locked(struct adapter *adapter)
}
ixgbe_init_hw(hw);
+#ifdef PCI_IOV
+ ixgbe_initialize_iov(adapter);
+#endif
ixgbe_initialize_transmit_units(adapter);
/* Setup Multicast table */
@@ -972,14 +1044,10 @@ ixgbe_init_locked(struct adapter *adapter)
** Determine the correct mbuf pool
** for doing jumbo frames
*/
- if (adapter->max_frame_size <= 2048)
+ if (adapter->max_frame_size <= MCLBYTES)
adapter->rx_mbuf_sz = MCLBYTES;
- else if (adapter->max_frame_size <= 4096)
- adapter->rx_mbuf_sz = MJUMPAGESIZE;
- else if (adapter->max_frame_size <= 9216)
- adapter->rx_mbuf_sz = MJUM9BYTES;
else
- adapter->rx_mbuf_sz = MJUM16BYTES;
+ adapter->rx_mbuf_sz = MJUMPAGESIZE;
/* Prepare receive descriptors and buffers */
if (ixgbe_setup_receive_structures(adapter)) {
@@ -991,31 +1059,8 @@ ixgbe_init_locked(struct adapter *adapter)
/* Configure RX settings */
ixgbe_initialize_receive_units(adapter);
- gpie = IXGBE_READ_REG(&adapter->hw, IXGBE_GPIE);
-
- /* Enable Fan Failure Interrupt */
- gpie |= IXGBE_SDP1_GPIEN_BY_MAC(hw);
-
- /* Add for Module detection */
- if (hw->mac.type == ixgbe_mac_82599EB)
- gpie |= IXGBE_SDP2_GPIEN;
-
- /*
- * Thermal Failure Detection (X540)
- * Link Detection (X552)
- */
- if (hw->mac.type == ixgbe_mac_X540 ||
- hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP ||
- hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T)
- gpie |= IXGBE_SDP0_GPIEN_X540;
-
- if (adapter->msix > 1) {
- /* Enable Enhanced MSIX mode */
- gpie |= IXGBE_GPIE_MSIX_MODE;
- gpie |= IXGBE_GPIE_EIAME | IXGBE_GPIE_PBA_SUPPORT |
- IXGBE_GPIE_OCD;
- }
- IXGBE_WRITE_REG(hw, IXGBE_GPIE, gpie);
+ /* Enable SDP & MSIX interrupts based on adapter */
+ ixgbe_config_gpie(adapter);
/* Set MTU size */
if (ifp->if_mtu > ETHERMTU) {
@@ -1028,7 +1073,8 @@ ixgbe_init_locked(struct adapter *adapter)
/* Now enable all the queues */
for (int i = 0; i < adapter->num_queues; i++) {
- txdctl = IXGBE_READ_REG(hw, IXGBE_TXDCTL(i));
+ txr = &adapter->tx_rings[i];
+ txdctl = IXGBE_READ_REG(hw, IXGBE_TXDCTL(txr->me));
txdctl |= IXGBE_TXDCTL_ENABLE;
/* Set WTHRESH to 8, burst writeback */
txdctl |= (8 << 16);
@@ -1040,11 +1086,12 @@ ixgbe_init_locked(struct adapter *adapter)
* Prefetching enables tx line rate even with 1 queue.
*/
txdctl |= (32 << 0) | (1 << 8);
- IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(i), txdctl);
+ IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(txr->me), txdctl);
}
- for (int i = 0; i < adapter->num_queues; i++) {
- rxdctl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(i));
+ for (int i = 0, j = 0; i < adapter->num_queues; i++) {
+ rxr = &adapter->rx_rings[i];
+ rxdctl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxr->me));
if (hw->mac.type == ixgbe_mac_82598EB) {
/*
** PTHRESH = 21
@@ -1055,9 +1102,9 @@ ixgbe_init_locked(struct adapter *adapter)
rxdctl |= 0x080420;
}
rxdctl |= IXGBE_RXDCTL_ENABLE;
- IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(i), rxdctl);
- for (k = 0; k < 10; k++) {
- if (IXGBE_READ_REG(hw, IXGBE_RXDCTL(i)) &
+ IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(rxr->me), rxdctl);
+ for (; j < 10; j++) {
+ if (IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxr->me)) &
IXGBE_RXDCTL_ENABLE)
break;
else
@@ -1086,10 +1133,10 @@ ixgbe_init_locked(struct adapter *adapter)
struct netmap_kring *kring = &na->rx_rings[i];
int t = na->num_rx_desc - 1 - nm_kr_rxspace(kring);
- IXGBE_WRITE_REG(hw, IXGBE_RDT(i), t);
+ IXGBE_WRITE_REG(hw, IXGBE_RDT(rxr->me), t);
} else
#endif /* DEV_NETMAP */
- IXGBE_WRITE_REG(hw, IXGBE_RDT(i), adapter->num_rx_desc - 1);
+ IXGBE_WRITE_REG(hw, IXGBE_RDT(rxr->me), adapter->num_rx_desc - 1);
}
/* Enable Receive engine */
@@ -1128,9 +1175,9 @@ ixgbe_init_locked(struct adapter *adapter)
#endif
/*
- ** Check on any SFP devices that
- ** need to be kick-started
- */
+ * Check on any SFP devices that
+ * need to be kick-started
+ */
if (hw->phy.type == ixgbe_phy_none) {
int err = hw->phy.ops.identify(hw);
if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) {
@@ -1144,8 +1191,7 @@ ixgbe_init_locked(struct adapter *adapter)
IXGBE_WRITE_REG(hw, IXGBE_EITR(adapter->vector), IXGBE_LINK_ITR);
/* Configure Energy Efficient Ethernet for supported devices */
- if (adapter->eee_support)
- ixgbe_setup_eee(hw, adapter->eee_enabled);
+ ixgbe_setup_eee(hw, adapter->eee_enabled);
/* Config/Enable Link */
ixgbe_config_link(adapter);
@@ -1165,6 +1211,15 @@ ixgbe_init_locked(struct adapter *adapter)
/* And now turn on interrupts */
ixgbe_enable_intr(adapter);
+#ifdef PCI_IOV
+ /* Enable the use of the MBX by the VF's */
+ {
+ u32 reg = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT);
+ reg |= IXGBE_CTRL_EXT_PFRSTD;
+ IXGBE_WRITE_REG(hw, IXGBE_CTRL_EXT, reg);
+ }
+#endif
+
/* Now inform the stack we're ready */
ifp->if_drv_flags |= IFF_DRV_RUNNING;
@@ -1183,6 +1238,51 @@ ixgbe_init(void *arg)
}
static void
+ixgbe_config_gpie(struct adapter *adapter)
+{
+ struct ixgbe_hw *hw = &adapter->hw;
+ u32 gpie;
+
+ gpie = IXGBE_READ_REG(hw, IXGBE_GPIE);
+
+ /* Fan Failure Interrupt */
+ if (hw->device_id == IXGBE_DEV_ID_82598AT)
+ gpie |= IXGBE_SDP1_GPIEN;
+
+ /*
+ * Module detection (SDP2)
+ * Media ready (SDP1)
+ */
+ if (hw->mac.type == ixgbe_mac_82599EB) {
+ gpie |= IXGBE_SDP2_GPIEN;
+ if (hw->device_id != IXGBE_DEV_ID_82599_QSFP_SF_QP)
+ gpie |= IXGBE_SDP1_GPIEN;
+ }
+
+ /*
+ * Thermal Failure Detection (X540)
+ * Link Detection (X557)
+ */
+ if (hw->mac.type == ixgbe_mac_X540 ||
+ hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP ||
+ hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T)
+ gpie |= IXGBE_SDP0_GPIEN_X540;
+
+ if (adapter->msix > 1) {
+ /* Enable Enhanced MSIX mode */
+ gpie |= IXGBE_GPIE_MSIX_MODE;
+ gpie |= IXGBE_GPIE_EIAME | IXGBE_GPIE_PBA_SUPPORT |
+ IXGBE_GPIE_OCD;
+ }
+
+ IXGBE_WRITE_REG(hw, IXGBE_GPIE, gpie);
+ return;
+}
+
+/*
+ * Requires adapter->max_frame_size to be set.
+ */
+static void
ixgbe_config_delay_values(struct adapter *adapter)
{
struct ixgbe_hw *hw = &adapter->hw;
@@ -1276,10 +1376,9 @@ ixgbe_handle_que(void *context, int pending)
struct adapter *adapter = que->adapter;
struct tx_ring *txr = que->txr;
struct ifnet *ifp = adapter->ifp;
- bool more;
if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
- more = ixgbe_rxeof(que);
+ ixgbe_rxeof(que);
IXGBE_TX_LOCK(txr);
ixgbe_txeof(txr);
#ifndef IXGBE_LEGACY_TX
@@ -1341,8 +1440,8 @@ ixgbe_legacy_irq(void *arg)
IXGBE_TX_UNLOCK(txr);
/* Check for fan failure */
- if ((hw->phy.media_type == ixgbe_media_type_copper) &&
- (reg_eicr & IXGBE_EICR_GPI_SDP1_BY_MAC(hw))) {
+ if ((hw->device_id == IXGBE_DEV_ID_82598AT) &&
+ (reg_eicr & IXGBE_EICR_GPI_SDP1)) {
device_printf(adapter->dev, "\nCRITICAL: FAN FAILURE!! "
"REPLACE IMMEDIATELY!!\n");
IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EICR_GPI_SDP1_BY_MAC(hw));
@@ -1381,6 +1480,7 @@ ixgbe_msix_que(void *arg)
bool more;
u32 newitr = 0;
+
/* Protect against spurious interrupts */
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
return;
@@ -1504,6 +1604,10 @@ ixgbe_msix_link(void *arg)
device_printf(adapter->dev, "System shutdown required!\n");
IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_TS);
}
+#ifdef PCI_IOV
+ if (reg_eicr & IXGBE_EICR_MAILBOX)
+ taskqueue_enqueue(adapter->tq, &adapter->mbx_task);
+#endif
}
/* Pluggable optics-related interrupt */
@@ -1569,7 +1673,7 @@ ixgbe_media_status(struct ifnet * ifp, struct ifmediareq * ifmr)
}
ifmr->ifm_status |= IFM_ACTIVE;
- layer = ixgbe_get_supported_physical_layer(hw);
+ layer = adapter->phy_layer;
if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T ||
layer & IXGBE_PHYSICAL_LAYER_1000BASE_T ||
@@ -1802,18 +1906,17 @@ ixgbe_set_promisc(struct adapter *adapter)
static void
ixgbe_set_multi(struct adapter *adapter)
{
- u32 fctrl;
- u8 *mta;
- u8 *update_ptr;
- struct ifmultiaddr *ifma;
- int mcnt = 0;
- struct ifnet *ifp = adapter->ifp;
+ u32 fctrl;
+ u8 *update_ptr;
+ struct ifmultiaddr *ifma;
+ struct ixgbe_mc_addr *mta;
+ int mcnt = 0;
+ struct ifnet *ifp = adapter->ifp;
IOCTL_DEBUGOUT("ixgbe_set_multi: begin");
mta = adapter->mta;
- bzero(mta, sizeof(u8) * IXGBE_ETH_LENGTH_OF_ADDRESS *
- MAX_NUM_MULTICAST_ADDRESSES);
+ bzero(mta, sizeof(*mta) * MAX_NUM_MULTICAST_ADDRESSES);
#if __FreeBSD_version < 800000
IF_ADDR_LOCK(ifp);
@@ -1826,8 +1929,8 @@ ixgbe_set_multi(struct adapter *adapter)
if (mcnt == MAX_NUM_MULTICAST_ADDRESSES)
break;
bcopy(LLADDR((struct sockaddr_dl *) ifma->ifma_addr),
- &mta[mcnt * IXGBE_ETH_LENGTH_OF_ADDRESS],
- IXGBE_ETH_LENGTH_OF_ADDRESS);
+ mta[mcnt].addr, IXGBE_ETH_LENGTH_OF_ADDRESS);
+ mta[mcnt].vmdq = adapter->pool;
mcnt++;
}
#if __FreeBSD_version < 800000
@@ -1850,7 +1953,7 @@ ixgbe_set_multi(struct adapter *adapter)
IXGBE_WRITE_REG(&adapter->hw, IXGBE_FCTRL, fctrl);
if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) {
- update_ptr = mta;
+ update_ptr = (u8 *)mta;
ixgbe_update_mc_addr_list(&adapter->hw,
update_ptr, mcnt, ixgbe_mc_array_itr, TRUE);
}
@@ -1866,13 +1969,13 @@ ixgbe_set_multi(struct adapter *adapter)
static u8 *
ixgbe_mc_array_itr(struct ixgbe_hw *hw, u8 **update_ptr, u32 *vmdq)
{
- u8 *addr = *update_ptr;
- u8 *newptr;
- *vmdq = 0;
+ struct ixgbe_mc_addr *mta;
- newptr = addr + IXGBE_ETH_LENGTH_OF_ADDRESS;
- *update_ptr = newptr;
- return addr;
+ mta = (struct ixgbe_mc_addr *)*update_ptr;
+ *vmdq = mta->vmdq;
+
+ *update_ptr = (u8*)(mta + 1);;
+ return (mta->addr);
}
@@ -1954,6 +2057,7 @@ watchdog:
ixgbe_init_locked(adapter);
}
+
/*
** Note: this routine updates the OS on the link state
** the real check of the hardware only happens with
@@ -1977,6 +2081,9 @@ ixgbe_update_link_status(struct adapter *adapter)
/* Update DMA coalescing config */
ixgbe_config_dmac(adapter);
if_link_state_change(ifp, LINK_STATE_UP);
+#ifdef PCI_IOV
+ ixgbe_ping_all_vfs(adapter);
+#endif
}
} else { /* Link down */
if (adapter->link_active == TRUE) {
@@ -1984,6 +2091,9 @@ ixgbe_update_link_status(struct adapter *adapter)
device_printf(dev,"Link is Down\n");
if_link_state_change(ifp, LINK_STATE_DOWN);
adapter->link_active = FALSE;
+#ifdef PCI_IOV
+ ixgbe_ping_all_vfs(adapter);
+#endif
}
}
@@ -2083,7 +2193,7 @@ ixgbe_setup_optics(struct adapter *adapter)
struct ixgbe_hw *hw = &adapter->hw;
int layer;
- layer = ixgbe_get_supported_physical_layer(hw);
+ layer = adapter->phy_layer = ixgbe_get_supported_physical_layer(hw);
if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T) {
adapter->optics = IFM_10G_T;
@@ -2281,17 +2391,19 @@ ixgbe_allocate_msix(struct adapter *adapter)
#endif
if (adapter->num_queues > 1)
bus_bind_intr(dev, que->res, cpu_id);
-
+#ifdef IXGBE_DEBUG
#ifdef RSS
device_printf(dev,
"Bound RSS bucket %d to CPU %d\n",
i, cpu_id);
#else
- if (bootverbose)
- device_printf(dev,
- "Bound queue %d to cpu %d\n",
- i, cpu_id);
+ device_printf(dev,
+ "Bound queue %d to cpu %d\n",
+ i, cpu_id);
#endif
+#endif /* IXGBE_DEBUG */
+
+
#ifndef IXGBE_LEGACY_TX
TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr);
#endif
@@ -2337,6 +2449,9 @@ ixgbe_allocate_msix(struct adapter *adapter)
TASK_INIT(&adapter->link_task, 0, ixgbe_handle_link, adapter);
TASK_INIT(&adapter->mod_task, 0, ixgbe_handle_mod, adapter);
TASK_INIT(&adapter->msf_task, 0, ixgbe_handle_msf, adapter);
+#ifdef PCI_IOV
+ TASK_INIT(&adapter->mbx_task, 0, ixgbe_handle_mbx, adapter);
+#endif
TASK_INIT(&adapter->phy_task, 0, ixgbe_handle_phy, adapter);
#ifdef IXGBE_FDIR
TASK_INIT(&adapter->fdir_task, 0, ixgbe_reinit_fdir, adapter);
@@ -2630,7 +2745,7 @@ ixgbe_add_media_types(struct adapter *adapter)
device_t dev = adapter->dev;
int layer;
- layer = ixgbe_get_supported_physical_layer(hw);
+ layer = adapter->phy_layer = ixgbe_get_supported_physical_layer(hw);
/* Media types with matching FreeBSD media defines */
if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T)
@@ -2741,19 +2856,20 @@ ixgbe_initialize_transmit_units(struct adapter *adapter)
for (int i = 0; i < adapter->num_queues; i++, txr++) {
u64 tdba = txr->txdma.dma_paddr;
u32 txctrl = 0;
+ int j = txr->me;
- IXGBE_WRITE_REG(hw, IXGBE_TDBAL(i),
+ IXGBE_WRITE_REG(hw, IXGBE_TDBAL(j),
(tdba & 0x00000000ffffffffULL));
- IXGBE_WRITE_REG(hw, IXGBE_TDBAH(i), (tdba >> 32));
- IXGBE_WRITE_REG(hw, IXGBE_TDLEN(i),
+ IXGBE_WRITE_REG(hw, IXGBE_TDBAH(j), (tdba >> 32));
+ IXGBE_WRITE_REG(hw, IXGBE_TDLEN(j),
adapter->num_tx_desc * sizeof(union ixgbe_adv_tx_desc));
/* Setup the HW Tx Head and Tail descriptor pointers */
- IXGBE_WRITE_REG(hw, IXGBE_TDH(i), 0);
- IXGBE_WRITE_REG(hw, IXGBE_TDT(i), 0);
+ IXGBE_WRITE_REG(hw, IXGBE_TDH(j), 0);
+ IXGBE_WRITE_REG(hw, IXGBE_TDT(j), 0);
/* Cache the tail address */
- txr->tail = IXGBE_TDT(txr->me);
+ txr->tail = IXGBE_TDT(j);
/* Set the processing limit */
txr->process_limit = ixgbe_tx_process_limit;
@@ -2761,23 +2877,23 @@ ixgbe_initialize_transmit_units(struct adapter *adapter)
/* Disable Head Writeback */
switch (hw->mac.type) {
case ixgbe_mac_82598EB:
- txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(i));
+ txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(j));
break;
case ixgbe_mac_82599EB:
case ixgbe_mac_X540:
default:
- txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(i));
+ txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(j));
break;
}
txctrl &= ~IXGBE_DCA_TXCTRL_DESC_WRO_EN;
switch (hw->mac.type) {
case ixgbe_mac_82598EB:
- IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(i), txctrl);
+ IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(j), txctrl);
break;
case ixgbe_mac_82599EB:
case ixgbe_mac_X540:
default:
- IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL_82599(i), txctrl);
+ IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL_82599(j), txctrl);
break;
}
@@ -2785,6 +2901,9 @@ ixgbe_initialize_transmit_units(struct adapter *adapter)
if (hw->mac.type != ixgbe_mac_82598EB) {
u32 dmatxctl, rttdcs;
+#ifdef PCI_IOV
+ enum ixgbe_iov_mode mode = ixgbe_get_iov_mode(adapter);
+#endif
dmatxctl = IXGBE_READ_REG(hw, IXGBE_DMATXCTL);
dmatxctl |= IXGBE_DMATXCTL_TE;
IXGBE_WRITE_REG(hw, IXGBE_DMATXCTL, dmatxctl);
@@ -2792,7 +2911,11 @@ ixgbe_initialize_transmit_units(struct adapter *adapter)
rttdcs = IXGBE_READ_REG(hw, IXGBE_RTTDCS);
rttdcs |= IXGBE_RTTDCS_ARBDIS;
IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, rttdcs);
+#ifdef PCI_IOV
+ IXGBE_WRITE_REG(hw, IXGBE_MTQC, ixgbe_get_mtqc(mode));
+#else
IXGBE_WRITE_REG(hw, IXGBE_MTQC, IXGBE_MTQC_64Q_1PB);
+#endif
rttdcs &= ~IXGBE_RTTDCS_ARBDIS;
IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, rttdcs);
}
@@ -2804,17 +2927,14 @@ static void
ixgbe_initialise_rss_mapping(struct adapter *adapter)
{
struct ixgbe_hw *hw = &adapter->hw;
- uint32_t reta;
- int i, j, queue_id, table_size;
- int index_mult;
- uint32_t rss_key[10];
- uint32_t mrqc;
+ u32 reta = 0, mrqc, rss_key[10];
+ int queue_id, table_size, index_mult;
#ifdef RSS
- uint32_t rss_hash_config;
+ u32 rss_hash_config;
+#endif
+#ifdef PCI_IOV
+ enum ixgbe_iov_mode mode;
#endif
-
- /* Setup RSS */
- reta = 0;
#ifdef RSS
/* Fetch the configured RSS key */
@@ -2840,7 +2960,7 @@ ixgbe_initialise_rss_mapping(struct adapter *adapter)
}
/* Set up the redirection table */
- for (i = 0, j = 0; i < table_size; i++, j++) {
+ for (int i = 0, j = 0; i < table_size; i++, j++) {
if (j == adapter->num_queues) j = 0;
#ifdef RSS
/*
@@ -2907,19 +3027,16 @@ ixgbe_initialise_rss_mapping(struct adapter *adapter)
mrqc = IXGBE_MRQC_RSSEN
| IXGBE_MRQC_RSS_FIELD_IPV4
| IXGBE_MRQC_RSS_FIELD_IPV4_TCP
-#if 0
- | IXGBE_MRQC_RSS_FIELD_IPV4_UDP
-#endif
| IXGBE_MRQC_RSS_FIELD_IPV6_EX_TCP
| IXGBE_MRQC_RSS_FIELD_IPV6_EX
| IXGBE_MRQC_RSS_FIELD_IPV6
| IXGBE_MRQC_RSS_FIELD_IPV6_TCP
-#if 0
- | IXGBE_MRQC_RSS_FIELD_IPV6_UDP
- | IXGBE_MRQC_RSS_FIELD_IPV6_EX_UDP
-#endif
;
#endif /* RSS */
+#ifdef PCI_IOV
+ mode = ixgbe_get_iov_mode(adapter);
+ mrqc |= ixgbe_get_mrqc(mode);
+#endif
IXGBE_WRITE_REG(hw, IXGBE_MRQC, mrqc);
}
@@ -2978,16 +3095,17 @@ ixgbe_initialize_receive_units(struct adapter *adapter)
for (int i = 0; i < adapter->num_queues; i++, rxr++) {
u64 rdba = rxr->rxdma.dma_paddr;
+ int j = rxr->me;
/* Setup the Base and Length of the Rx Descriptor Ring */
- IXGBE_WRITE_REG(hw, IXGBE_RDBAL(i),
+ IXGBE_WRITE_REG(hw, IXGBE_RDBAL(j),
(rdba & 0x00000000ffffffffULL));
- IXGBE_WRITE_REG(hw, IXGBE_RDBAH(i), (rdba >> 32));
- IXGBE_WRITE_REG(hw, IXGBE_RDLEN(i),
+ IXGBE_WRITE_REG(hw, IXGBE_RDBAH(j), (rdba >> 32));
+ IXGBE_WRITE_REG(hw, IXGBE_RDLEN(j),
adapter->num_rx_desc * sizeof(union ixgbe_adv_rx_desc));
/* Set up the SRRCTL register */
- srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(i));
+ srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(j));
srrctl &= ~IXGBE_SRRCTL_BSIZEHDR_MASK;
srrctl &= ~IXGBE_SRRCTL_BSIZEPKT_MASK;
srrctl |= bufsz;
@@ -3006,11 +3124,11 @@ ixgbe_initialize_receive_units(struct adapter *adapter)
srrctl &= ~IXGBE_SRRCTL_DROP_EN;
}
- IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl);
+ IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(j), srrctl);
/* Setup the HW Rx Head and Tail Descriptor Pointers */
- IXGBE_WRITE_REG(hw, IXGBE_RDH(i), 0);
- IXGBE_WRITE_REG(hw, IXGBE_RDT(i), 0);
+ IXGBE_WRITE_REG(hw, IXGBE_RDH(j), 0);
+ IXGBE_WRITE_REG(hw, IXGBE_RDT(j), 0);
/* Set the processing limit */
rxr->process_limit = ixgbe_rx_process_limit;
@@ -3126,9 +3244,9 @@ ixgbe_setup_vlan_hw_support(struct adapter *adapter)
rxr = &adapter->rx_rings[i];
/* On 82599 the VLAN enable is per/queue in RXDCTL */
if (hw->mac.type != ixgbe_mac_82598EB) {
- ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(i));
+ ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxr->me));
ctrl |= IXGBE_RXDCTL_VME;
- IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(i), ctrl);
+ IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(rxr->me), ctrl);
}
rxr->vtag_strip = TRUE;
}
@@ -3178,6 +3296,9 @@ ixgbe_enable_intr(struct adapter *adapter)
#ifdef IXGBE_FDIR
mask |= IXGBE_EIMS_FLOW_DIR;
#endif
+#ifdef PCI_IOV
+ mask |= IXGBE_EIMS_MAILBOX;
+#endif
break;
case ixgbe_mac_X540:
/* Detect if Thermal Sensor is enabled */
@@ -3201,6 +3322,9 @@ ixgbe_enable_intr(struct adapter *adapter)
#ifdef IXGBE_FDIR
mask |= IXGBE_EIMS_FLOW_DIR;
#endif
+#ifdef PCI_IOV
+ mask |= IXGBE_EIMS_MAILBOX;
+#endif
/* falls through */
default:
break;
@@ -3214,6 +3338,9 @@ ixgbe_enable_intr(struct adapter *adapter)
/* Don't autoclear Link */
mask &= ~IXGBE_EIMS_OTHER;
mask &= ~IXGBE_EIMS_LSC;
+#ifdef PCI_IOV
+ mask &= ~IXGBE_EIMS_MAILBOX;
+#endif
IXGBE_WRITE_REG(hw, IXGBE_EIAC, mask);
}
@@ -3412,8 +3539,8 @@ ixgbe_set_ivar(struct adapter *adapter, u8 entry, u8 vector, s8 type)
static void
ixgbe_configure_ivars(struct adapter *adapter)
{
- struct ix_queue *que = adapter->queues;
- u32 newitr;
+ struct ix_queue *que = adapter->queues;
+ u32 newitr;
if (ixgbe_max_interrupt_rate > 0)
newitr = (4000000 / ixgbe_max_interrupt_rate) & 0x0FF8;
@@ -3427,10 +3554,12 @@ ixgbe_configure_ivars(struct adapter *adapter)
}
for (int i = 0; i < adapter->num_queues; i++, que++) {
+ struct rx_ring *rxr = &adapter->rx_rings[i];
+ struct tx_ring *txr = &adapter->tx_rings[i];
/* First the RX queue entry */
- ixgbe_set_ivar(adapter, i, que->msix, 0);
+ ixgbe_set_ivar(adapter, rxr->me, que->msix, 0);
/* ... and the TX */
- ixgbe_set_ivar(adapter, i, que->msix, 1);
+ ixgbe_set_ivar(adapter, txr->me, que->msix, 1);
/* Set an Initial EITR value */
IXGBE_WRITE_REG(&adapter->hw,
IXGBE_EITR(que->msix), newitr);
@@ -3444,7 +3573,8 @@ ixgbe_configure_ivars(struct adapter *adapter)
** ixgbe_sfp_probe - called in the local timer to
** determine if a port had optics inserted.
*/
-static bool ixgbe_sfp_probe(struct adapter *adapter)
+static bool
+ixgbe_sfp_probe(struct adapter *adapter)
{
struct ixgbe_hw *hw = &adapter->hw;
device_t dev = adapter->dev;
@@ -3504,6 +3634,7 @@ ixgbe_handle_mod(void *context, int pending)
"Unsupported SFP+ module type was detected.\n");
return;
}
+
err = hw->mac.ops.setup_sfp(hw);
if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) {
device_printf(dev,
@@ -3626,9 +3757,7 @@ ixgbe_check_eee_support(struct adapter *adapter)
{
struct ixgbe_hw *hw = &adapter->hw;
- adapter->eee_support = adapter->eee_enabled =
- (hw->device_id == IXGBE_DEV_ID_X550T ||
- hw->device_id == IXGBE_DEV_ID_X550EM_X_KR);
+ adapter->eee_enabled = !!(hw->mac.ops.setup_eee);
}
/*
@@ -4004,8 +4133,7 @@ ixgbe_add_device_sysctls(struct adapter *adapter)
ixgbe_sysctl_dmac, "I", "DMA Coalesce");
/* for X550T and X550EM backplane devices */
- if (hw->device_id == IXGBE_DEV_ID_X550T ||
- hw->device_id == IXGBE_DEV_ID_X550EM_X_KR) {
+ if (hw->mac.ops.setup_eee) {
struct sysctl_oid *eee_node;
struct sysctl_oid_list *eee_list;
@@ -4625,6 +4753,7 @@ static int
ixgbe_sysctl_eee_enable(SYSCTL_HANDLER_ARGS)
{
struct adapter *adapter = (struct adapter *) arg1;
+ struct ixgbe_hw *hw = &adapter->hw;
struct ifnet *ifp = adapter->ifp;
int new_eee_enabled, error = 0;
@@ -4635,7 +4764,7 @@ ixgbe_sysctl_eee_enable(SYSCTL_HANDLER_ARGS)
if (new_eee_enabled == adapter->eee_enabled)
return (0);
- if (new_eee_enabled > 0 && !adapter->eee_support)
+ if (new_eee_enabled > 0 && !hw->mac.ops.setup_eee)
return (ENODEV);
else
adapter->eee_enabled = !!(new_eee_enabled);
@@ -4751,10 +4880,19 @@ ixgbe_enable_rx_drop(struct adapter *adapter)
struct ixgbe_hw *hw = &adapter->hw;
for (int i = 0; i < adapter->num_queues; i++) {
- u32 srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(i));
+ struct rx_ring *rxr = &adapter->rx_rings[i];
+ u32 srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(rxr->me));
srrctl |= IXGBE_SRRCTL_DROP_EN;
- IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl);
+ IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(rxr->me), srrctl);
}
+#ifdef PCI_IOV
+ /* enable drop for each vf */
+ for (int i = 0; i < adapter->num_vfs; i++) {
+ IXGBE_WRITE_REG(hw, IXGBE_QDE,
+ (IXGBE_QDE_WRITE | (i << IXGBE_QDE_IDX_SHIFT) |
+ IXGBE_QDE_ENABLE));
+ }
+#endif
}
static void
@@ -4763,10 +4901,18 @@ ixgbe_disable_rx_drop(struct adapter *adapter)
struct ixgbe_hw *hw = &adapter->hw;
for (int i = 0; i < adapter->num_queues; i++) {
- u32 srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(i));
+ struct rx_ring *rxr = &adapter->rx_rings[i];
+ u32 srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(rxr->me));
srrctl &= ~IXGBE_SRRCTL_DROP_EN;
- IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl);
+ IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(rxr->me), srrctl);
}
+#ifdef PCI_IOV
+ /* disable drop for each vf */
+ for (int i = 0; i < adapter->num_vfs; i++) {
+ IXGBE_WRITE_REG(hw, IXGBE_QDE,
+ (IXGBE_QDE_WRITE | (i << IXGBE_QDE_IDX_SHIFT)));
+ }
+#endif
}
static void
@@ -4793,4 +4939,722 @@ ixgbe_rearm_queues(struct adapter *adapter, u64 queues)
}
}
+#ifdef PCI_IOV
+
+/*
+** Support functions for SRIOV/VF management
+*/
+
+static void
+ixgbe_ping_all_vfs(struct adapter *adapter)
+{
+ struct ixgbe_vf *vf;
+
+ for (int i = 0; i < adapter->num_vfs; i++) {
+ vf = &adapter->vfs[i];
+ if (vf->flags & IXGBE_VF_ACTIVE)
+ ixgbe_send_vf_msg(adapter, vf, IXGBE_PF_CONTROL_MSG);
+ }
+}
+
+
+static void
+ixgbe_vf_set_default_vlan(struct adapter *adapter, struct ixgbe_vf *vf,
+ uint16_t tag)
+{
+ struct ixgbe_hw *hw;
+ uint32_t vmolr, vmvir;
+
+ hw = &adapter->hw;
+
+ vf->vlan_tag = tag;
+
+ vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf->pool));
+
+ /* Do not receive packets that pass inexact filters. */
+ vmolr &= ~(IXGBE_VMOLR_ROMPE | IXGBE_VMOLR_ROPE);
+
+ /* Disable Multicast Promicuous Mode. */
+ vmolr &= ~IXGBE_VMOLR_MPE;
+
+ /* Accept broadcasts. */
+ vmolr |= IXGBE_VMOLR_BAM;
+
+ if (tag == 0) {
+ /* Accept non-vlan tagged traffic. */
+ //vmolr |= IXGBE_VMOLR_AUPE;
+
+ /* Allow VM to tag outgoing traffic; no default tag. */
+ vmvir = 0;
+ } else {
+ /* Require vlan-tagged traffic. */
+ vmolr &= ~IXGBE_VMOLR_AUPE;
+
+ /* Tag all traffic with provided vlan tag. */
+ vmvir = (tag | IXGBE_VMVIR_VLANA_DEFAULT);
+ }
+ IXGBE_WRITE_REG(hw, IXGBE_VMOLR(vf->pool), vmolr);
+ IXGBE_WRITE_REG(hw, IXGBE_VMVIR(vf->pool), vmvir);
+}
+
+
+static boolean_t
+ixgbe_vf_frame_size_compatible(struct adapter *adapter, struct ixgbe_vf *vf)
+{
+
+ /*
+ * Frame size compatibility between PF and VF is only a problem on
+ * 82599-based cards. X540 and later support any combination of jumbo
+ * frames on PFs and VFs.
+ */
+ if (adapter->hw.mac.type != ixgbe_mac_82599EB)
+ return (TRUE);
+
+ switch (vf->api_ver) {
+ case IXGBE_API_VER_1_0:
+ case IXGBE_API_VER_UNKNOWN:
+ /*
+ * On legacy (1.0 and older) VF versions, we don't support jumbo
+ * frames on either the PF or the VF.
+ */
+ if (adapter->max_frame_size > ETHER_MAX_LEN ||
+ vf->max_frame_size > ETHER_MAX_LEN)
+ return (FALSE);
+
+ return (TRUE);
+
+ break;
+ case IXGBE_API_VER_1_1:
+ default:
+ /*
+ * 1.1 or later VF versions always work if they aren't using
+ * jumbo frames.
+ */
+ if (vf->max_frame_size <= ETHER_MAX_LEN)
+ return (TRUE);
+
+ /*
+ * Jumbo frames only work with VFs if the PF is also using jumbo
+ * frames.
+ */
+ if (adapter->max_frame_size <= ETHER_MAX_LEN)
+ return (TRUE);
+
+ return (FALSE);
+
+ }
+}
+
+
+static void
+ixgbe_process_vf_reset(struct adapter *adapter, struct ixgbe_vf *vf)
+{
+ ixgbe_vf_set_default_vlan(adapter, vf, vf->default_vlan);
+
+ // XXX clear multicast addresses
+
+ ixgbe_clear_rar(&adapter->hw, vf->rar_index);
+
+ vf->api_ver = IXGBE_API_VER_UNKNOWN;
+}
+
+
+static void
+ixgbe_vf_enable_transmit(struct adapter *adapter, struct ixgbe_vf *vf)
+{
+ struct ixgbe_hw *hw;
+ uint32_t vf_index, vfte;
+
+ hw = &adapter->hw;
+
+ vf_index = IXGBE_VF_INDEX(vf->pool);
+ vfte = IXGBE_READ_REG(hw, IXGBE_VFTE(vf_index));
+ vfte |= IXGBE_VF_BIT(vf->pool);
+ IXGBE_WRITE_REG(hw, IXGBE_VFTE(vf_index), vfte);
+}
+
+
+static void
+ixgbe_vf_enable_receive(struct adapter *adapter, struct ixgbe_vf *vf)
+{
+ struct ixgbe_hw *hw;
+ uint32_t vf_index, vfre;
+
+ hw = &adapter->hw;
+
+ vf_index = IXGBE_VF_INDEX(vf->pool);
+ vfre = IXGBE_READ_REG(hw, IXGBE_VFRE(vf_index));
+ if (ixgbe_vf_frame_size_compatible(adapter, vf))
+ vfre |= IXGBE_VF_BIT(vf->pool);
+ else
+ vfre &= ~IXGBE_VF_BIT(vf->pool);
+ IXGBE_WRITE_REG(hw, IXGBE_VFRE(vf_index), vfre);
+}
+
+
+static void
+ixgbe_vf_reset_msg(struct adapter *adapter, struct ixgbe_vf *vf, uint32_t *msg)
+{
+ struct ixgbe_hw *hw;
+ uint32_t ack;
+ uint32_t resp[IXGBE_VF_PERMADDR_MSG_LEN];
+
+ hw = &adapter->hw;
+
+ ixgbe_process_vf_reset(adapter, vf);
+
+ if (ixgbe_validate_mac_addr(vf->ether_addr) == 0) {
+ ixgbe_set_rar(&adapter->hw, vf->rar_index,
+ vf->ether_addr, vf->pool, TRUE);
+ ack = IXGBE_VT_MSGTYPE_ACK;
+ } else
+ ack = IXGBE_VT_MSGTYPE_NACK;
+
+ ixgbe_vf_enable_transmit(adapter, vf);
+ ixgbe_vf_enable_receive(adapter, vf);
+
+ vf->flags |= IXGBE_VF_CTS;
+
+ resp[0] = IXGBE_VF_RESET | ack | IXGBE_VT_MSGTYPE_CTS;
+ bcopy(vf->ether_addr, &resp[1], ETHER_ADDR_LEN);
+ resp[3] = hw->mac.mc_filter_type;
+ ixgbe_write_mbx(hw, resp, IXGBE_VF_PERMADDR_MSG_LEN, vf->pool);
+}
+
+
+static void
+ixgbe_vf_set_mac(struct adapter *adapter, struct ixgbe_vf *vf, uint32_t *msg)
+{
+ uint8_t *mac;
+
+ mac = (uint8_t*)&msg[1];
+
+ /* Check that the VF has permission to change the MAC address. */
+ if (!(vf->flags & IXGBE_VF_CAP_MAC) && ixgbe_vf_mac_changed(vf, mac)) {
+ ixgbe_send_vf_nack(adapter, vf, msg[0]);
+ return;
+ }
+
+ if (ixgbe_validate_mac_addr(mac) != 0) {
+ ixgbe_send_vf_nack(adapter, vf, msg[0]);
+ return;
+ }
+
+ bcopy(mac, vf->ether_addr, ETHER_ADDR_LEN);
+
+ ixgbe_set_rar(&adapter->hw, vf->rar_index, vf->ether_addr,
+ vf->pool, TRUE);
+
+ ixgbe_send_vf_ack(adapter, vf, msg[0]);
+}
+
+
+/*
+** VF multicast addresses are set by using the appropriate bit in
+** 1 of 128 32 bit addresses (4096 possible).
+*/
+static void
+ixgbe_vf_set_mc_addr(struct adapter *adapter, struct ixgbe_vf *vf, u32 *msg)
+{
+ u16 *list = (u16*)&msg[1];
+ int entries;
+ u32 vmolr, vec_bit, vec_reg, mta_reg;
+
+ entries = (msg[0] & IXGBE_VT_MSGINFO_MASK) >> IXGBE_VT_MSGINFO_SHIFT;
+ entries = min(entries, IXGBE_MAX_VF_MC);
+
+ vmolr = IXGBE_READ_REG(&adapter->hw, IXGBE_VMOLR(vf->pool));
+
+ vf->num_mc_hashes = entries;
+
+ /* Set the appropriate MTA bit */
+ for (int i = 0; i < entries; i++) {
+ vf->mc_hash[i] = list[i];
+ vec_reg = (vf->mc_hash[i] >> 5) & 0x7F;
+ vec_bit = vf->mc_hash[i] & 0x1F;
+ mta_reg = IXGBE_READ_REG(&adapter->hw, IXGBE_MTA(vec_reg));
+ mta_reg |= (1 << vec_bit);
+ IXGBE_WRITE_REG(&adapter->hw, IXGBE_MTA(vec_reg), mta_reg);
+ }
+
+ vmolr |= IXGBE_VMOLR_ROMPE;
+ IXGBE_WRITE_REG(&adapter->hw, IXGBE_VMOLR(vf->pool), vmolr);
+ ixgbe_send_vf_ack(adapter, vf, msg[0]);
+ return;
+}
+
+
+static void
+ixgbe_vf_set_vlan(struct adapter *adapter, struct ixgbe_vf *vf, uint32_t *msg)
+{
+ struct ixgbe_hw *hw;
+ int enable;
+ uint16_t tag;
+
+ hw = &adapter->hw;
+ enable = IXGBE_VT_MSGINFO(msg[0]);
+ tag = msg[1] & IXGBE_VLVF_VLANID_MASK;
+
+ if (!(vf->flags & IXGBE_VF_CAP_VLAN)) {
+ ixgbe_send_vf_nack(adapter, vf, msg[0]);
+ return;
+ }
+
+ /* It is illegal to enable vlan tag 0. */
+ if (tag == 0 && enable != 0){
+ ixgbe_send_vf_nack(adapter, vf, msg[0]);
+ return;
+ }
+
+ ixgbe_set_vfta(hw, tag, vf->pool, enable);
+ ixgbe_send_vf_ack(adapter, vf, msg[0]);
+}
+
+
+static void
+ixgbe_vf_set_lpe(struct adapter *adapter, struct ixgbe_vf *vf, uint32_t *msg)
+{
+ struct ixgbe_hw *hw;
+ uint32_t vf_max_size, pf_max_size, mhadd;
+
+ hw = &adapter->hw;
+ vf_max_size = msg[1];
+
+ if (vf_max_size < ETHER_CRC_LEN) {
+ /* We intentionally ACK invalid LPE requests. */
+ ixgbe_send_vf_ack(adapter, vf, msg[0]);
+ return;
+ }
+
+ vf_max_size -= ETHER_CRC_LEN;
+
+ if (vf_max_size > IXGBE_MAX_FRAME_SIZE) {
+ /* We intentionally ACK invalid LPE requests. */
+ ixgbe_send_vf_ack(adapter, vf, msg[0]);
+ return;
+ }
+
+ vf->max_frame_size = vf_max_size;
+ ixgbe_update_max_frame(adapter, vf->max_frame_size);
+
+ /*
+ * We might have to disable reception to this VF if the frame size is
+ * not compatible with the config on the PF.
+ */
+ ixgbe_vf_enable_receive(adapter, vf);
+
+ mhadd = IXGBE_READ_REG(hw, IXGBE_MHADD);
+ pf_max_size = (mhadd & IXGBE_MHADD_MFS_MASK) >> IXGBE_MHADD_MFS_SHIFT;
+
+ if (pf_max_size < adapter->max_frame_size) {
+ mhadd &= ~IXGBE_MHADD_MFS_MASK;
+ mhadd |= adapter->max_frame_size << IXGBE_MHADD_MFS_SHIFT;
+ IXGBE_WRITE_REG(hw, IXGBE_MHADD, mhadd);
+ }
+
+ ixgbe_send_vf_ack(adapter, vf, msg[0]);
+}
+
+
+static void
+ixgbe_vf_set_macvlan(struct adapter *adapter, struct ixgbe_vf *vf,
+ uint32_t *msg)
+{
+ //XXX implement this
+ ixgbe_send_vf_nack(adapter, vf, msg[0]);
+}
+
+
+static void
+ixgbe_vf_api_negotiate(struct adapter *adapter, struct ixgbe_vf *vf,
+ uint32_t *msg)
+{
+
+ switch (msg[0]) {
+ case IXGBE_API_VER_1_0:
+ case IXGBE_API_VER_1_1:
+ vf->api_ver = msg[0];
+ ixgbe_send_vf_ack(adapter, vf, msg[0]);
+ break;
+ default:
+ vf->api_ver = IXGBE_API_VER_UNKNOWN;
+ ixgbe_send_vf_nack(adapter, vf, msg[0]);
+ break;
+ }
+}
+
+
+static void
+ixgbe_vf_get_queues(struct adapter *adapter, struct ixgbe_vf *vf,
+ uint32_t *msg)
+{
+ struct ixgbe_hw *hw;
+ uint32_t resp[IXGBE_VF_GET_QUEUES_RESP_LEN];
+ int num_queues;
+
+ hw = &adapter->hw;
+
+ /* GET_QUEUES is not supported on pre-1.1 APIs. */
+ switch (msg[0]) {
+ case IXGBE_API_VER_1_0:
+ case IXGBE_API_VER_UNKNOWN:
+ ixgbe_send_vf_nack(adapter, vf, msg[0]);
+ return;
+ }
+
+ resp[0] = IXGBE_VF_GET_QUEUES | IXGBE_VT_MSGTYPE_ACK |
+ IXGBE_VT_MSGTYPE_CTS;
+
+ num_queues = ixgbe_vf_queues(ixgbe_get_iov_mode(adapter));
+ resp[IXGBE_VF_TX_QUEUES] = num_queues;
+ resp[IXGBE_VF_RX_QUEUES] = num_queues;
+ resp[IXGBE_VF_TRANS_VLAN] = (vf->default_vlan != 0);
+ resp[IXGBE_VF_DEF_QUEUE] = 0;
+
+ ixgbe_write_mbx(hw, resp, IXGBE_VF_GET_QUEUES_RESP_LEN, vf->pool);
+}
+
+
+static void
+ixgbe_process_vf_msg(struct adapter *adapter, struct ixgbe_vf *vf)
+{
+ struct ixgbe_hw *hw;
+ uint32_t msg[IXGBE_VFMAILBOX_SIZE];
+ int error;
+
+ hw = &adapter->hw;
+
+ error = ixgbe_read_mbx(hw, msg, IXGBE_VFMAILBOX_SIZE, vf->pool);
+
+ if (error != 0)
+ return;
+
+ CTR3(KTR_MALLOC, "%s: received msg %x from %d",
+ adapter->ifp->if_xname, msg[0], vf->pool);
+ if (msg[0] == IXGBE_VF_RESET) {
+ ixgbe_vf_reset_msg(adapter, vf, msg);
+ return;
+ }
+
+ if (!(vf->flags & IXGBE_VF_CTS)) {
+ ixgbe_send_vf_nack(adapter, vf, msg[0]);
+ return;
+ }
+
+ switch (msg[0] & IXGBE_VT_MSG_MASK) {
+ case IXGBE_VF_SET_MAC_ADDR:
+ ixgbe_vf_set_mac(adapter, vf, msg);
+ break;
+ case IXGBE_VF_SET_MULTICAST:
+ ixgbe_vf_set_mc_addr(adapter, vf, msg);
+ break;
+ case IXGBE_VF_SET_VLAN:
+ ixgbe_vf_set_vlan(adapter, vf, msg);
+ break;
+ case IXGBE_VF_SET_LPE:
+ ixgbe_vf_set_lpe(adapter, vf, msg);
+ break;
+ case IXGBE_VF_SET_MACVLAN:
+ ixgbe_vf_set_macvlan(adapter, vf, msg);
+ break;
+ case IXGBE_VF_API_NEGOTIATE:
+ ixgbe_vf_api_negotiate(adapter, vf, msg);
+ break;
+ case IXGBE_VF_GET_QUEUES:
+ ixgbe_vf_get_queues(adapter, vf, msg);
+ break;
+ default:
+ ixgbe_send_vf_nack(adapter, vf, msg[0]);
+ }
+}
+
+
+/*
+ * Tasklet for handling VF -> PF mailbox messages.
+ */
+static void
+ixgbe_handle_mbx(void *context, int pending)
+{
+ struct adapter *adapter;
+ struct ixgbe_hw *hw;
+ struct ixgbe_vf *vf;
+ int i;
+
+ adapter = context;
+ hw = &adapter->hw;
+
+ IXGBE_CORE_LOCK(adapter);
+ for (i = 0; i < adapter->num_vfs; i++) {
+ vf = &adapter->vfs[i];
+
+ if (vf->flags & IXGBE_VF_ACTIVE) {
+ if (ixgbe_check_for_rst(hw, vf->pool) == 0)
+ ixgbe_process_vf_reset(adapter, vf);
+
+ if (ixgbe_check_for_msg(hw, vf->pool) == 0)
+ ixgbe_process_vf_msg(adapter, vf);
+
+ if (ixgbe_check_for_ack(hw, vf->pool) == 0)
+ ixgbe_process_vf_ack(adapter, vf);
+ }
+ }
+ IXGBE_CORE_UNLOCK(adapter);
+}
+
+
+static int
+ixgbe_init_iov(device_t dev, u16 num_vfs, const nvlist_t *config)
+{
+ struct adapter *adapter;
+ enum ixgbe_iov_mode mode;
+
+ adapter = device_get_softc(dev);
+ adapter->num_vfs = num_vfs;
+ mode = ixgbe_get_iov_mode(adapter);
+
+ if (num_vfs > ixgbe_max_vfs(mode)) {
+ adapter->num_vfs = 0;
+ return (ENOSPC);
+ }
+
+ IXGBE_CORE_LOCK(adapter);
+
+ adapter->vfs = malloc(sizeof(*adapter->vfs) * num_vfs, M_IXGBE,
+ M_NOWAIT | M_ZERO);
+
+ if (adapter->vfs == NULL) {
+ adapter->num_vfs = 0;
+ IXGBE_CORE_UNLOCK(adapter);
+ return (ENOMEM);
+ }
+
+ ixgbe_init_locked(adapter);
+
+ IXGBE_CORE_UNLOCK(adapter);
+
+ return (0);
+}
+
+
+static void
+ixgbe_uninit_iov(device_t dev)
+{
+ struct ixgbe_hw *hw;
+ struct adapter *adapter;
+ uint32_t pf_reg, vf_reg;
+
+ adapter = device_get_softc(dev);
+ hw = &adapter->hw;
+
+ IXGBE_CORE_LOCK(adapter);
+
+ /* Enable rx/tx for the PF and disable it for all VFs. */
+ pf_reg = IXGBE_VF_INDEX(adapter->pool);
+ IXGBE_WRITE_REG(hw, IXGBE_VFRE(pf_reg),
+ IXGBE_VF_BIT(adapter->pool));
+ IXGBE_WRITE_REG(hw, IXGBE_VFTE(pf_reg),
+ IXGBE_VF_BIT(adapter->pool));
+
+ if (pf_reg == 0)
+ vf_reg = 1;
+ else
+ vf_reg = 0;
+ IXGBE_WRITE_REG(hw, IXGBE_VFRE(vf_reg), 0);
+ IXGBE_WRITE_REG(hw, IXGBE_VFTE(vf_reg), 0);
+
+ IXGBE_WRITE_REG(hw, IXGBE_VT_CTL, 0);
+
+ free(adapter->vfs, M_IXGBE);
+ adapter->vfs = NULL;
+ adapter->num_vfs = 0;
+
+ IXGBE_CORE_UNLOCK(adapter);
+}
+
+
+static void
+ixgbe_initialize_iov(struct adapter *adapter)
+{
+ struct ixgbe_hw *hw = &adapter->hw;
+ uint32_t mrqc, mtqc, vt_ctl, vf_reg, gcr_ext, gpie;
+ enum ixgbe_iov_mode mode;
+ int i;
+
+ mode = ixgbe_get_iov_mode(adapter);
+ if (mode == IXGBE_NO_VM)
+ return;
+
+ IXGBE_CORE_LOCK_ASSERT(adapter);
+
+ mrqc = IXGBE_READ_REG(hw, IXGBE_MRQC);
+ mrqc &= ~IXGBE_MRQC_MRQE_MASK;
+
+ switch (mode) {
+ case IXGBE_64_VM:
+ mrqc |= IXGBE_MRQC_VMDQRSS64EN;
+ break;
+ case IXGBE_32_VM:
+ mrqc |= IXGBE_MRQC_VMDQRSS32EN;
+ break;
+ default:
+ panic("Unexpected SR-IOV mode %d", mode);
+ }
+ IXGBE_WRITE_REG(hw, IXGBE_MRQC, mrqc);
+
+ mtqc = IXGBE_MTQC_VT_ENA;
+ switch (mode) {
+ case IXGBE_64_VM:
+ mtqc |= IXGBE_MTQC_64VF;
+ break;
+ case IXGBE_32_VM:
+ mtqc |= IXGBE_MTQC_32VF;
+ break;
+ default:
+ panic("Unexpected SR-IOV mode %d", mode);
+ }
+ IXGBE_WRITE_REG(hw, IXGBE_MTQC, mtqc);
+
+
+ gcr_ext = IXGBE_READ_REG(hw, IXGBE_GCR_EXT);
+ gcr_ext |= IXGBE_GCR_EXT_MSIX_EN;
+ gcr_ext &= ~IXGBE_GCR_EXT_VT_MODE_MASK;
+ switch (mode) {
+ case IXGBE_64_VM:
+ gcr_ext |= IXGBE_GCR_EXT_VT_MODE_64;
+ break;
+ case IXGBE_32_VM:
+ gcr_ext |= IXGBE_GCR_EXT_VT_MODE_32;
+ break;
+ default:
+ panic("Unexpected SR-IOV mode %d", mode);
+ }
+ IXGBE_WRITE_REG(hw, IXGBE_GCR_EXT, gcr_ext);
+
+
+ gpie = IXGBE_READ_REG(hw, IXGBE_GPIE);
+ gcr_ext &= ~IXGBE_GPIE_VTMODE_MASK;
+ switch (mode) {
+ case IXGBE_64_VM:
+ gpie |= IXGBE_GPIE_VTMODE_64;
+ break;
+ case IXGBE_32_VM:
+ gpie |= IXGBE_GPIE_VTMODE_32;
+ break;
+ default:
+ panic("Unexpected SR-IOV mode %d", mode);
+ }
+ IXGBE_WRITE_REG(hw, IXGBE_GPIE, gpie);
+
+ /* Enable rx/tx for the PF. */
+ vf_reg = IXGBE_VF_INDEX(adapter->pool);
+ IXGBE_WRITE_REG(hw, IXGBE_VFRE(vf_reg),
+ IXGBE_VF_BIT(adapter->pool));
+ IXGBE_WRITE_REG(hw, IXGBE_VFTE(vf_reg),
+ IXGBE_VF_BIT(adapter->pool));
+
+ /* Allow VM-to-VM communication. */
+ IXGBE_WRITE_REG(hw, IXGBE_PFDTXGSWC, IXGBE_PFDTXGSWC_VT_LBEN);
+
+ vt_ctl = IXGBE_VT_CTL_VT_ENABLE | IXGBE_VT_CTL_REPLEN;
+ vt_ctl |= (adapter->pool << IXGBE_VT_CTL_POOL_SHIFT);
+ IXGBE_WRITE_REG(hw, IXGBE_VT_CTL, vt_ctl);
+
+ for (i = 0; i < adapter->num_vfs; i++)
+ ixgbe_init_vf(adapter, &adapter->vfs[i]);
+}
+
+
+/*
+** Check the max frame setting of all active VF's
+*/
+static void
+ixgbe_recalculate_max_frame(struct adapter *adapter)
+{
+ struct ixgbe_vf *vf;
+
+ IXGBE_CORE_LOCK_ASSERT(adapter);
+
+ for (int i = 0; i < adapter->num_vfs; i++) {
+ vf = &adapter->vfs[i];
+ if (vf->flags & IXGBE_VF_ACTIVE)
+ ixgbe_update_max_frame(adapter, vf->max_frame_size);
+ }
+}
+
+
+static void
+ixgbe_init_vf(struct adapter *adapter, struct ixgbe_vf *vf)
+{
+ struct ixgbe_hw *hw;
+ uint32_t vf_index, pfmbimr;
+
+ IXGBE_CORE_LOCK_ASSERT(adapter);
+
+ hw = &adapter->hw;
+
+ if (!(vf->flags & IXGBE_VF_ACTIVE))
+ return;
+
+ vf_index = IXGBE_VF_INDEX(vf->pool);
+ pfmbimr = IXGBE_READ_REG(hw, IXGBE_PFMBIMR(vf_index));
+ pfmbimr |= IXGBE_VF_BIT(vf->pool);
+ IXGBE_WRITE_REG(hw, IXGBE_PFMBIMR(vf_index), pfmbimr);
+
+ ixgbe_vf_set_default_vlan(adapter, vf, vf->vlan_tag);
+
+ // XXX multicast addresses
+
+ if (ixgbe_validate_mac_addr(vf->ether_addr) == 0) {
+ ixgbe_set_rar(&adapter->hw, vf->rar_index,
+ vf->ether_addr, vf->pool, TRUE);
+ }
+
+ ixgbe_vf_enable_transmit(adapter, vf);
+ ixgbe_vf_enable_receive(adapter, vf);
+
+ ixgbe_send_vf_msg(adapter, vf, IXGBE_PF_CONTROL_MSG);
+}
+
+static int
+ixgbe_add_vf(device_t dev, u16 vfnum, const nvlist_t *config)
+{
+ struct adapter *adapter;
+ struct ixgbe_vf *vf;
+ const void *mac;
+
+ adapter = device_get_softc(dev);
+
+ KASSERT(vfnum < adapter->num_vfs, ("VF index %d is out of range %d",
+ vfnum, adapter->num_vfs));
+
+ IXGBE_CORE_LOCK(adapter);
+ vf = &adapter->vfs[vfnum];
+ vf->pool= vfnum;
+
+ /* RAR[0] is used by the PF so use vfnum + 1 for VF RAR. */
+ vf->rar_index = vfnum + 1;
+ vf->default_vlan = 0;
+ vf->max_frame_size = ETHER_MAX_LEN;
+ ixgbe_update_max_frame(adapter, vf->max_frame_size);
+
+ if (nvlist_exists_binary(config, "mac-addr")) {
+ mac = nvlist_get_binary(config, "mac-addr", NULL);
+ bcopy(mac, vf->ether_addr, ETHER_ADDR_LEN);
+ if (nvlist_get_bool(config, "allow-set-mac"))
+ vf->flags |= IXGBE_VF_CAP_MAC;
+ } else
+ /*
+ * If the administrator has not specified a MAC address then
+ * we must allow the VF to choose one.
+ */
+ vf->flags |= IXGBE_VF_CAP_MAC;
+
+ vf->flags = IXGBE_VF_ACTIVE;
+
+ ixgbe_init_vf(adapter, vf);
+ IXGBE_CORE_UNLOCK(adapter);
+
+ return (0);
+}
+#endif /* PCI_IOV */
diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c
index a550a85..cc2d63f 100644
--- a/sys/dev/ixgbe/if_ixv.c
+++ b/sys/dev/ixgbe/if_ixv.c
@@ -43,7 +43,7 @@
/*********************************************************************
* Driver version
*********************************************************************/
-char ixv_driver_version[] = "1.2.5";
+char ixv_driver_version[] = "1.4.0";
/*********************************************************************
* PCI Device ID Table
@@ -151,6 +151,10 @@ MODULE_DEPEND(ixv, ether, 1, 1, 1);
** TUNEABLE PARAMETERS:
*/
+/* Number of Queues - do not exceed MSIX vectors - 1 */
+static int ixv_num_queues = 1;
+TUNABLE_INT("hw.ixv.num_queues", &ixv_num_queues);
+
/*
** AIM: Adaptive Interrupt Moderation
** which means that the interrupt rate
@@ -338,6 +342,11 @@ ixv_attach(device_t dev)
ixgbe_reset_hw(hw);
+ /* Get the Mailbox API version */
+ device_printf(dev,"MBX API %d negotiation: %d\n",
+ ixgbe_mbox_api_11,
+ ixgbevf_negotiate_api_version(hw, ixgbe_mbox_api_11));
+
error = ixgbe_init_hw(hw);
if (error) {
device_printf(dev,"Hardware Initialization Failure\n");
@@ -1313,10 +1322,13 @@ static int
ixv_setup_msix(struct adapter *adapter)
{
device_t dev = adapter->dev;
- int rid, want;
+ int rid, want, msgs;
- /* First try MSI/X */
+ /* Must have at least 2 MSIX vectors */
+ msgs = pci_msix_count(dev);
+ if (msgs < 2)
+ goto out;
rid = PCIR_BAR(3);
adapter->msix_mem = bus_alloc_resource_any(dev,
SYS_RES_MEMORY, &rid, RF_ACTIVE);
@@ -1327,11 +1339,16 @@ ixv_setup_msix(struct adapter *adapter)
}
/*
- ** Want two vectors: one for a queue,
+ ** Want vectors for the queues,
** plus an additional for mailbox.
*/
- want = 2;
- if ((pci_alloc_msix(dev, &want) == 0) && (want == 2)) {
+ want = adapter->num_queues + 1;
+ if (want > msgs) {
+ want = msgs;
+ adapter->num_queues = msgs - 1;
+ } else
+ msgs = want;
+ if ((pci_alloc_msix(dev, &msgs) == 0) && (msgs == want)) {
device_printf(adapter->dev,
"Using MSIX interrupts with %d vectors\n", want);
return (want);
@@ -1370,7 +1387,9 @@ ixv_allocate_pci_resources(struct adapter *adapter)
rman_get_bushandle(adapter->pci_mem);
adapter->hw.hw_addr = (u8 *) &adapter->osdep.mem_bus_space_handle;
- adapter->num_queues = 1;
+ /* Pick up the tuneable queues */
+ adapter->num_queues = ixv_num_queues;
+
adapter->hw.back = &adapter->osdep;
/*
@@ -1591,32 +1610,41 @@ ixv_initialize_receive_units(struct adapter *adapter)
{
struct rx_ring *rxr = adapter->rx_rings;
struct ixgbe_hw *hw = &adapter->hw;
- struct ifnet *ifp = adapter->ifp;
- u32 bufsz, fctrl, rxcsum, hlreg;
-
-
- /* Enable broadcasts */
- fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL);
- fctrl |= IXGBE_FCTRL_BAM;
- fctrl |= IXGBE_FCTRL_DPF;
- fctrl |= IXGBE_FCTRL_PMCF;
- IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl);
+ struct ifnet *ifp = adapter->ifp;
+ u32 bufsz, rxcsum, psrtype;
+ int max_frame;
- /* Set for Jumbo Frames? */
- hlreg = IXGBE_READ_REG(hw, IXGBE_HLREG0);
- if (ifp->if_mtu > ETHERMTU) {
- hlreg |= IXGBE_HLREG0_JUMBOEN;
+ if (ifp->if_mtu > ETHERMTU)
bufsz = 4096 >> IXGBE_SRRCTL_BSIZEPKT_SHIFT;
- } else {
- hlreg &= ~IXGBE_HLREG0_JUMBOEN;
+ else
bufsz = 2048 >> IXGBE_SRRCTL_BSIZEPKT_SHIFT;
- }
- IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg);
+
+ psrtype = IXGBE_PSRTYPE_TCPHDR | IXGBE_PSRTYPE_UDPHDR |
+ IXGBE_PSRTYPE_IPV4HDR | IXGBE_PSRTYPE_IPV6HDR |
+ IXGBE_PSRTYPE_L2HDR;
+
+ IXGBE_WRITE_REG(hw, IXGBE_VFPSRTYPE, psrtype);
+
+ /* Tell PF our expected packet-size */
+ max_frame = ifp->if_mtu + IXGBE_MTU_HDR;
+ ixgbevf_rlpml_set_vf(hw, max_frame);
for (int i = 0; i < adapter->num_queues; i++, rxr++) {
u64 rdba = rxr->rxdma.dma_paddr;
u32 reg, rxdctl;
+ /* Disable the queue */
+ rxdctl = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(i));
+ rxdctl &= ~(IXGBE_RXDCTL_ENABLE | IXGBE_RXDCTL_VME);
+ IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(i), rxdctl);
+ for (int j = 0; j < 10; j++) {
+ if (IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(i)) &
+ IXGBE_RXDCTL_ENABLE)
+ msec_delay(1);
+ else
+ break;
+ }
+ wmb();
/* Setup the Base and Length of the Rx Descriptor Ring */
IXGBE_WRITE_REG(hw, IXGBE_VFRDBAL(i),
(rdba & 0x00000000ffffffffULL));
@@ -1625,6 +1653,10 @@ ixv_initialize_receive_units(struct adapter *adapter)
IXGBE_WRITE_REG(hw, IXGBE_VFRDLEN(i),
adapter->num_rx_desc * sizeof(union ixgbe_adv_rx_desc));
+ /* Reset the ring indices */
+ IXGBE_WRITE_REG(hw, IXGBE_VFRDH(rxr->me), 0);
+ IXGBE_WRITE_REG(hw, IXGBE_VFRDT(rxr->me), 0);
+
/* Set up the SRRCTL register */
reg = IXGBE_READ_REG(hw, IXGBE_VFSRRCTL(i));
reg &= ~IXGBE_SRRCTL_BSIZEHDR_MASK;
@@ -1633,14 +1665,14 @@ ixv_initialize_receive_units(struct adapter *adapter)
reg |= IXGBE_SRRCTL_DESCTYPE_ADV_ONEBUF;
IXGBE_WRITE_REG(hw, IXGBE_VFSRRCTL(i), reg);
- /* Setup the HW Rx Head and Tail Descriptor Pointers */
- IXGBE_WRITE_REG(hw, IXGBE_VFRDH(rxr->me), 0);
+ /* Set the Tail Pointer */
IXGBE_WRITE_REG(hw, IXGBE_VFRDT(rxr->me),
adapter->num_rx_desc - 1);
+
/* Set the processing limit */
rxr->process_limit = ixv_rx_process_limit;
- /* Set Rx Tail register */
+ /* Capture Rx Tail index */
rxr->tail = IXGBE_VFRDT(rxr->me);
/* Do the queue enabling last */
@@ -2033,9 +2065,7 @@ ixv_add_stats_sysctls(struct adapter *adapter)
SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "tx_packets",
CTLFLAG_RD, &(txr->total_packets),
"TX Packets");
- SYSCTL_ADD_UINT(ctx, queue_list, OID_AUTO, "tx_bytes",
- CTLFLAG_RD, &(txr->bytes), 0,
- "TX Bytes");
+
SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "tx_no_desc",
CTLFLAG_RD, &(txr->no_desc_avail),
"# of times not enough descriptors were available during TX");
diff --git a/sys/dev/ixgbe/ix_txrx.c b/sys/dev/ixgbe/ix_txrx.c
index bfe1607..c20b24e 100644
--- a/sys/dev/ixgbe/ix_txrx.c
+++ b/sys/dev/ixgbe/ix_txrx.c
@@ -578,7 +578,6 @@ ixgbe_setup_transmit_ring(struct tx_ring *txr)
{
struct adapter *adapter = txr->adapter;
struct ixgbe_tx_buf *txbuf;
- int i;
#ifdef DEV_NETMAP
struct netmap_adapter *na = NA(adapter->ifp);
struct netmap_slot *slot;
@@ -601,7 +600,7 @@ ixgbe_setup_transmit_ring(struct tx_ring *txr)
/* Free any existing tx buffers. */
txbuf = txr->tx_buffers;
- for (i = 0; i < txr->num_desc; i++, txbuf++) {
+ for (int i = 0; i < txr->num_desc; i++, txbuf++) {
if (txbuf->m_head != NULL) {
bus_dmamap_sync(txr->txtag, txbuf->map,
BUS_DMASYNC_POSTWRITE);
@@ -622,7 +621,8 @@ ixgbe_setup_transmit_ring(struct tx_ring *txr)
*/
if (slot) {
int si = netmap_idx_n2k(&na->tx_rings[txr->me], i);
- netmap_load_map(na, txr->txtag, txbuf->map, NMB(na, slot + si));
+ netmap_load_map(na, txr->txtag,
+ txbuf->map, NMB(na, slot + si));
}
#endif /* DEV_NETMAP */
/* Clear the EOP descriptor pointer */
@@ -777,8 +777,7 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp,
if (mp->m_flags & M_VLANTAG) {
vtag = htole16(mp->m_pkthdr.ether_vtag);
vlan_macip_lens |= (vtag << IXGBE_ADVTXD_VLAN_SHIFT);
- }
- else if (!IXGBE_IS_X550VF(adapter) && (offload == FALSE))
+ } else if (!IXGBE_IS_X550VF(adapter) && (offload == FALSE))
return (0);
/*
@@ -1379,7 +1378,7 @@ ixgbe_allocate_receive_buffers(struct rx_ring *rxr)
struct adapter *adapter = rxr->adapter;
device_t dev = adapter->dev;
struct ixgbe_rx_buf *rxbuf;
- int i, bsize, error;
+ int bsize, error;
bsize = sizeof(struct ixgbe_rx_buf) * rxr->num_desc;
if (!(rxr->rx_buffers =
@@ -1406,7 +1405,7 @@ ixgbe_allocate_receive_buffers(struct rx_ring *rxr)
goto fail;
}
- for (i = 0; i < rxr->num_desc; i++, rxbuf++) {
+ for (int i = 0; i < rxr->num_desc; i++, rxbuf++) {
rxbuf = &rxr->rx_buffers[i];
error = bus_dmamap_create(rxr->ptag, 0, &rxbuf->pmap);
if (error) {
@@ -1428,9 +1427,8 @@ static void
ixgbe_free_receive_ring(struct rx_ring *rxr)
{
struct ixgbe_rx_buf *rxbuf;
- int i;
- for (i = 0; i < rxr->num_desc; i++) {
+ for (int i = 0; i < rxr->num_desc; i++) {
rxbuf = &rxr->rx_buffers[i];
if (rxbuf->buf != NULL) {
bus_dmamap_sync(rxr->ptag, rxbuf->pmap,
@@ -2140,6 +2138,9 @@ ixgbe_allocate_queues(struct adapter *adapter)
struct rx_ring *rxr;
int rsize, tsize, error = IXGBE_SUCCESS;
int txconf = 0, rxconf = 0;
+#ifdef PCI_IOV
+ enum ixgbe_iov_mode iov_mode;
+#endif
/* First allocate the top level queue structs */
if (!(adapter->queues =
@@ -2172,6 +2173,12 @@ ixgbe_allocate_queues(struct adapter *adapter)
tsize = roundup2(adapter->num_tx_desc *
sizeof(union ixgbe_adv_tx_desc), DBA_ALIGN);
+#ifdef PCI_IOV
+ iov_mode = ixgbe_get_iov_mode(adapter);
+ adapter->pool = ixgbe_max_vfs(iov_mode);
+#else
+ adapter->pool = 0;
+#endif
/*
* Now set up the TX queues, txconf is needed to handle the
* possibility that things fail midcourse and we need to
@@ -2181,7 +2188,11 @@ ixgbe_allocate_queues(struct adapter *adapter)
/* Set up some basics */
txr = &adapter->tx_rings[i];
txr->adapter = adapter;
+#ifdef PCI_IOV
+ txr->me = ixgbe_pf_que_index(iov_mode, i);
+#else
txr->me = i;
+#endif
txr->num_desc = adapter->num_tx_desc;
/* Initialize the TX side lock */
@@ -2228,7 +2239,11 @@ ixgbe_allocate_queues(struct adapter *adapter)
rxr = &adapter->rx_rings[i];
/* Set up some basics */
rxr->adapter = adapter;
+#ifdef PCI_IOV
+ rxr->me = ixgbe_pf_que_index(iov_mode, i);
+#else
rxr->me = i;
+#endif
rxr->num_desc = adapter->num_rx_desc;
/* Initialize the RX side lock */
diff --git a/sys/dev/ixgbe/ixgbe.h b/sys/dev/ixgbe/ixgbe.h
index 44e7c3c..7f8aac5 100644
--- a/sys/dev/ixgbe/ixgbe.h
+++ b/sys/dev/ixgbe/ixgbe.h
@@ -92,11 +92,22 @@
#include <machine/smp.h>
#include <sys/sbuf.h>
+#ifdef PCI_IOV
+#include <sys/nv.h>
+#include <sys/iov_schema.h>
+#include <dev/pci/pci_iov.h>
+#endif
+
#include "ixgbe_api.h"
#include "ixgbe_common.h"
#include "ixgbe_phy.h"
#include "ixgbe_vf.h"
+#ifdef PCI_IOV
+#include "ixgbe_common.h"
+#include "ixgbe_mbx.h"
+#endif
+
/* Tunables */
/*
@@ -244,6 +255,29 @@
(_adapter->hw.mac.type == ixgbe_mac_X540_vf) || \
(_adapter->hw.mac.type == ixgbe_mac_82599_vf))
+#ifdef PCI_IOV
+#define IXGBE_VF_INDEX(vmdq) ((vmdq) / 32)
+#define IXGBE_VF_BIT(vmdq) (1 << ((vmdq) % 32))
+
+#define IXGBE_VT_MSG_MASK 0xFFFF
+
+#define IXGBE_VT_MSGINFO(msg) \
+ (((msg) & IXGBE_VT_MSGINFO_MASK) >> IXGBE_VT_MSGINFO_SHIFT)
+
+#define IXGBE_VF_GET_QUEUES_RESP_LEN 5
+
+#define IXGBE_API_VER_1_0 0
+#define IXGBE_API_VER_2_0 1 /* Solaris API. Not supported. */
+#define IXGBE_API_VER_1_1 2
+#define IXGBE_API_VER_UNKNOWN UINT16_MAX
+
+enum ixgbe_iov_mode {
+ IXGBE_64_VM,
+ IXGBE_32_VM,
+ IXGBE_NO_VM
+};
+#endif /* PCI_IOV */
+
/*
*****************************************************************************
@@ -262,6 +296,7 @@ typedef struct _ixgbe_vendor_info_t {
unsigned int index;
} ixgbe_vendor_info_t;
+
struct ixgbe_tx_buf {
union ixgbe_adv_tx_desc *eop;
struct mbuf *m_head;
@@ -290,6 +325,11 @@ struct ixgbe_dma_alloc {
int dma_nseg;
};
+struct ixgbe_mc_addr {
+ u8 addr[IXGBE_ETH_LENGTH_OF_ADDRESS];
+ u32 vmdq;
+};
+
/*
** Driver queue struct: this is the interrupt container
** for the associated tx and rx ring.
@@ -387,6 +427,28 @@ struct rx_ring {
#endif
};
+#ifdef PCI_IOV
+#define IXGBE_VF_CTS (1 << 0) /* VF is clear to send. */
+#define IXGBE_VF_CAP_MAC (1 << 1) /* VF is permitted to change MAC. */
+#define IXGBE_VF_CAP_VLAN (1 << 2) /* VF is permitted to join vlans. */
+#define IXGBE_VF_ACTIVE (1 << 3) /* VF is active. */
+
+#define IXGBE_MAX_VF_MC 30 /* Max number of multicast entries */
+
+struct ixgbe_vf {
+ u_int pool;
+ u_int rar_index;
+ u_int max_frame_size;
+ uint32_t flags;
+ uint8_t ether_addr[ETHER_ADDR_LEN];
+ uint16_t mc_hash[IXGBE_MAX_VF_MC];
+ uint16_t num_mc_hashes;
+ uint16_t default_vlan;
+ uint16_t vlan_tag;
+ uint16_t api_ver;
+};
+#endif /* PCI_IOV */
+
/* Our adapter structure */
struct adapter {
struct ifnet *ifp;
@@ -438,8 +500,8 @@ struct adapter {
bool link_up;
u32 vector;
u16 dmac;
- bool eee_support;
bool eee_enabled;
+ u32 phy_layer;
/* Power management-related */
bool wol_support;
@@ -453,6 +515,9 @@ struct adapter {
struct task link_task; /* Link tasklet */
struct task mod_task; /* SFP tasklet */
struct task msf_task; /* Multispeed Fiber */
+#ifdef PCI_IOV
+ struct task mbx_task; /* VF -> PF mailbox interrupt */
+#endif /* PCI_IOV */
#ifdef IXGBE_FDIR
int fdir_reinit;
struct task fdir_task;
@@ -484,8 +549,12 @@ struct adapter {
u32 num_rx_desc;
/* Multicast array memory */
- u8 *mta;
-
+ struct ixgbe_mc_addr *mta;
+ int num_vfs;
+ int pool;
+#ifdef PCI_IOV
+ struct ixgbe_vf *vfs;
+#endif
/* Misc stats maintained by the driver */
unsigned long dropped_pkts;
@@ -671,4 +740,150 @@ bool ixgbe_rxeof(struct ix_queue *);
int ixgbe_dma_malloc(struct adapter *,
bus_size_t, struct ixgbe_dma_alloc *, int);
void ixgbe_dma_free(struct adapter *, struct ixgbe_dma_alloc *);
+
+#ifdef PCI_IOV
+
+static inline boolean_t
+ixgbe_vf_mac_changed(struct ixgbe_vf *vf, const uint8_t *mac)
+{
+ return (bcmp(mac, vf->ether_addr, ETHER_ADDR_LEN) != 0);
+}
+
+static inline void
+ixgbe_send_vf_msg(struct adapter *adapter, struct ixgbe_vf *vf, u32 msg)
+{
+
+ if (vf->flags & IXGBE_VF_CTS)
+ msg |= IXGBE_VT_MSGTYPE_CTS;
+
+ ixgbe_write_mbx(&adapter->hw, &msg, 1, vf->pool);
+}
+
+static inline void
+ixgbe_send_vf_ack(struct adapter *adapter, struct ixgbe_vf *vf, u32 msg)
+{
+ msg &= IXGBE_VT_MSG_MASK;
+ ixgbe_send_vf_msg(adapter, vf, msg | IXGBE_VT_MSGTYPE_ACK);
+}
+
+static inline void
+ixgbe_send_vf_nack(struct adapter *adapter, struct ixgbe_vf *vf, u32 msg)
+{
+ msg &= IXGBE_VT_MSG_MASK;
+ ixgbe_send_vf_msg(adapter, vf, msg | IXGBE_VT_MSGTYPE_NACK);
+}
+
+static inline void
+ixgbe_process_vf_ack(struct adapter *adapter, struct ixgbe_vf *vf)
+{
+ if (!(vf->flags & IXGBE_VF_CTS))
+ ixgbe_send_vf_nack(adapter, vf, 0);
+}
+
+static inline enum ixgbe_iov_mode
+ixgbe_get_iov_mode(struct adapter *adapter)
+{
+ if (adapter->num_vfs == 0)
+ return (IXGBE_NO_VM);
+ if (adapter->num_queues <= 2)
+ return (IXGBE_64_VM);
+ else if (adapter->num_queues <= 4)
+ return (IXGBE_32_VM);
+ else
+ return (IXGBE_NO_VM);
+}
+
+static inline u16
+ixgbe_max_vfs(enum ixgbe_iov_mode mode)
+{
+ /*
+ * We return odd numbers below because we
+ * reserve 1 VM's worth of queues for the PF.
+ */
+ switch (mode) {
+ case IXGBE_64_VM:
+ return (63);
+ case IXGBE_32_VM:
+ return (31);
+ case IXGBE_NO_VM:
+ default:
+ return (0);
+ }
+}
+
+static inline int
+ixgbe_vf_queues(enum ixgbe_iov_mode mode)
+{
+ switch (mode) {
+ case IXGBE_64_VM:
+ return (2);
+ case IXGBE_32_VM:
+ return (4);
+ case IXGBE_NO_VM:
+ default:
+ return (0);
+ }
+}
+
+static inline int
+ixgbe_vf_que_index(enum ixgbe_iov_mode mode, u32 vfnum, int num)
+{
+ return ((vfnum * ixgbe_vf_queues(mode)) + num);
+}
+
+static inline int
+ixgbe_pf_que_index(enum ixgbe_iov_mode mode, int num)
+{
+ return (ixgbe_vf_que_index(mode, ixgbe_max_vfs(mode), num));
+}
+
+static inline void
+ixgbe_update_max_frame(struct adapter * adapter, int max_frame)
+{
+ if (adapter->max_frame_size < max_frame)
+ adapter->max_frame_size = max_frame;
+}
+
+static inline u32
+ixgbe_get_mrqc(enum ixgbe_iov_mode mode)
+{
+ u32 mrqc = 0;
+ switch (mode) {
+ case IXGBE_64_VM:
+ mrqc = IXGBE_MRQC_VMDQRSS64EN;
+ break;
+ case IXGBE_32_VM:
+ mrqc = IXGBE_MRQC_VMDQRSS32EN;
+ break;
+ case IXGBE_NO_VM:
+ mrqc = 0;
+ break;
+ default:
+ panic("Unexpected SR-IOV mode %d", mode);
+ }
+ return(mrqc);
+}
+
+
+static inline u32
+ixgbe_get_mtqc(enum ixgbe_iov_mode mode)
+{
+ uint32_t mtqc = 0;
+ switch (mode) {
+ case IXGBE_64_VM:
+ mtqc |= IXGBE_MTQC_64VF | IXGBE_MTQC_VT_ENA;
+ break;
+ case IXGBE_32_VM:
+ mtqc |= IXGBE_MTQC_32VF | IXGBE_MTQC_VT_ENA;
+ break;
+ case IXGBE_NO_VM:
+ mtqc = IXGBE_MTQC_64Q_1PB;
+ break;
+ default:
+ panic("Unexpected SR-IOV mode %d", mode);
+ }
+ return(mtqc);
+}
+#endif /* PCI_IOV */
+
#endif /* _IXGBE_H_ */
diff --git a/sys/dev/ixgbe/ixgbe_mbx.h b/sys/dev/ixgbe/ixgbe_mbx.h
index ea75cbe..a4a78eb 100644
--- a/sys/dev/ixgbe/ixgbe_mbx.h
+++ b/sys/dev/ixgbe/ixgbe_mbx.h
@@ -80,6 +80,21 @@
/* bits 23:16 are used for extra info for certain messages */
#define IXGBE_VT_MSGINFO_MASK (0xFF << IXGBE_VT_MSGINFO_SHIFT)
+/* definitions to support mailbox API version negotiation */
+
+/*
+ * each element denotes a version of the API; existing numbers may not
+ * change; any additions must go at the end
+ */
+enum ixgbe_pfvf_api_rev {
+ ixgbe_mbox_api_10, /* API version 1.0, linux/freebsd VF driver */
+ ixgbe_mbox_api_20, /* API version 2.0, solaris Phase1 VF driver */
+ ixgbe_mbox_api_11, /* API version 1.1, linux/freebsd VF driver */
+ /* This value should always be last */
+ ixgbe_mbox_api_unknown, /* indicates that API version is not known */
+};
+
+/* mailbox API, legacy requests */
#define IXGBE_VF_RESET 0x01 /* VF requests reset */
#define IXGBE_VF_SET_MAC_ADDR 0x02 /* VF requests PF to set MAC addr */
#define IXGBE_VF_SET_MULTICAST 0x03 /* VF requests PF to set MC addr */
@@ -106,6 +121,18 @@
#define IXGBE_PF_CONTROL_MSG 0x0100 /* PF control message */
+/* mailbox API, version 2.0 VF requests */
+#define IXGBE_VF_API_NEGOTIATE 0x08 /* negotiate API version */
+#define IXGBE_VF_GET_QUEUES 0x09 /* get queue configuration */
+#define IXGBE_VF_ENABLE_MACADDR 0x0A /* enable MAC address */
+#define IXGBE_VF_DISABLE_MACADDR 0x0B /* disable MAC address */
+#define IXGBE_VF_GET_MACADDRS 0x0C /* get all configured MAC addrs */
+#define IXGBE_VF_SET_MCAST_PROMISC 0x0D /* enable multicast promiscuous */
+#define IXGBE_VF_GET_MTU 0x0E /* get bounds on MTU */
+#define IXGBE_VF_SET_MTU 0x0F /* set a specific MTU */
+
+/* mailbox API, version 2.0 PF requests */
+#define IXGBE_PF_TRANSPARENT_VLAN 0x0101 /* enable transparent vlan */
#define IXGBE_VF_MBX_INIT_TIMEOUT 2000 /* number of retries on mailbox */
#define IXGBE_VF_MBX_INIT_DELAY 500 /* microseconds between retries */
diff --git a/sys/dev/ixgbe/ixgbe_vf.c b/sys/dev/ixgbe/ixgbe_vf.c
index c010cf4..2ce4d32 100644
--- a/sys/dev/ixgbe/ixgbe_vf.c
+++ b/sys/dev/ixgbe/ixgbe_vf.c
@@ -185,6 +185,8 @@ s32 ixgbe_reset_hw_vf(struct ixgbe_hw *hw)
/* Call adapter stop to disable tx/rx and clear interrupts */
hw->mac.ops.stop_adapter(hw);
+ /* reset the api version */
+ hw->api_version = ixgbe_mbox_api_10;
DEBUGOUT("Issuing a function level reset to MAC\n");
@@ -666,6 +668,57 @@ int ixgbevf_negotiate_api_version(struct ixgbe_hw *hw, int api)
int ixgbevf_get_queues(struct ixgbe_hw *hw, unsigned int *num_tcs,
unsigned int *default_tc)
{
- UNREFERENCED_3PARAMETER(hw, num_tcs, default_tc);
- return IXGBE_SUCCESS;
+ int err;
+ u32 msg[5];
+
+ /* do nothing if API doesn't support ixgbevf_get_queues */
+ switch (hw->api_version) {
+ case ixgbe_mbox_api_11:
+ break;
+ default:
+ return 0;
+ }
+
+ /* Fetch queue configuration from the PF */
+ msg[0] = IXGBE_VF_GET_QUEUES;
+ msg[1] = msg[2] = msg[3] = msg[4] = 0;
+ err = hw->mbx.ops.write_posted(hw, msg, 5, 0);
+
+ if (!err)
+ err = hw->mbx.ops.read_posted(hw, msg, 5, 0);
+
+ if (!err) {
+ msg[0] &= ~IXGBE_VT_MSGTYPE_CTS;
+
+ /*
+ * if we we didn't get an ACK there must have been
+ * some sort of mailbox error so we should treat it
+ * as such
+ */
+ if (msg[0] != (IXGBE_VF_GET_QUEUES | IXGBE_VT_MSGTYPE_ACK))
+ return IXGBE_ERR_MBX;
+
+ /* record and validate values from message */
+ hw->mac.max_tx_queues = msg[IXGBE_VF_TX_QUEUES];
+ if (hw->mac.max_tx_queues == 0 ||
+ hw->mac.max_tx_queues > IXGBE_VF_MAX_TX_QUEUES)
+ hw->mac.max_tx_queues = IXGBE_VF_MAX_TX_QUEUES;
+
+ hw->mac.max_rx_queues = msg[IXGBE_VF_RX_QUEUES];
+ if (hw->mac.max_rx_queues == 0 ||
+ hw->mac.max_rx_queues > IXGBE_VF_MAX_RX_QUEUES)
+ hw->mac.max_rx_queues = IXGBE_VF_MAX_RX_QUEUES;
+
+ *num_tcs = msg[IXGBE_VF_TRANS_VLAN];
+ /* in case of unknown state assume we cannot tag frames */
+ if (*num_tcs > hw->mac.max_rx_queues)
+ *num_tcs = 1;
+
+ *default_tc = msg[IXGBE_VF_DEF_QUEUE];
+ /* default to queue 0 on out-of-bounds queue number */
+ if (*default_tc >= hw->mac.max_tx_queues)
+ *default_tc = 0;
+ }
+
+ return err;
}
diff --git a/sys/dev/ixl/i40e_adminq.c b/sys/dev/ixl/i40e_adminq.c
index d769c45..5eacdc4 100644
--- a/sys/dev/ixl/i40e_adminq.c
+++ b/sys/dev/ixl/i40e_adminq.c
@@ -315,8 +315,12 @@ static enum i40e_status_code i40e_config_asq_regs(struct i40e_hw *hw)
wr32(hw, hw->aq.asq.tail, 0);
/* set starting point */
- wr32(hw, hw->aq.asq.len, (hw->aq.num_asq_entries |
- I40E_PF_ATQLEN_ATQENABLE_MASK));
+ if (!i40e_is_vf(hw))
+ wr32(hw, hw->aq.asq.len, (hw->aq.num_asq_entries |
+ I40E_PF_ATQLEN_ATQENABLE_MASK));
+ if (i40e_is_vf(hw))
+ wr32(hw, hw->aq.asq.len, (hw->aq.num_asq_entries |
+ I40E_VF_ATQLEN1_ATQENABLE_MASK));
wr32(hw, hw->aq.asq.bal, I40E_LO_DWORD(hw->aq.asq.desc_buf.pa));
wr32(hw, hw->aq.asq.bah, I40E_HI_DWORD(hw->aq.asq.desc_buf.pa));
@@ -344,8 +348,12 @@ static enum i40e_status_code i40e_config_arq_regs(struct i40e_hw *hw)
wr32(hw, hw->aq.arq.tail, 0);
/* set starting point */
- wr32(hw, hw->aq.arq.len, (hw->aq.num_arq_entries |
- I40E_PF_ARQLEN_ARQENABLE_MASK));
+ if (!i40e_is_vf(hw))
+ wr32(hw, hw->aq.arq.len, (hw->aq.num_arq_entries |
+ I40E_PF_ARQLEN_ARQENABLE_MASK));
+ if (i40e_is_vf(hw))
+ wr32(hw, hw->aq.arq.len, (hw->aq.num_arq_entries |
+ I40E_VF_ARQLEN1_ARQENABLE_MASK));
wr32(hw, hw->aq.arq.bal, I40E_LO_DWORD(hw->aq.arq.desc_buf.pa));
wr32(hw, hw->aq.arq.bah, I40E_HI_DWORD(hw->aq.arq.desc_buf.pa));
@@ -559,6 +567,7 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw)
{
enum i40e_status_code ret_code;
u16 eetrack_lo, eetrack_hi;
+ u16 cfg_ptr, oem_hi, oem_lo;
int retry = 0;
/* verify input for valid configuration */
if ((hw->aq.num_arq_entries == 0) ||
@@ -619,6 +628,12 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw)
i40e_read_nvm_word(hw, I40E_SR_NVM_EETRACK_LO, &eetrack_lo);
i40e_read_nvm_word(hw, I40E_SR_NVM_EETRACK_HI, &eetrack_hi);
hw->nvm.eetrack = (eetrack_hi << 16) | eetrack_lo;
+ i40e_read_nvm_word(hw, I40E_SR_BOOT_CONFIG_PTR, &cfg_ptr);
+ i40e_read_nvm_word(hw, (cfg_ptr + I40E_NVM_OEM_VER_OFF),
+ &oem_hi);
+ i40e_read_nvm_word(hw, (cfg_ptr + (I40E_NVM_OEM_VER_OFF + 1)),
+ &oem_lo);
+ hw->nvm.oem_ver = ((u32)oem_hi << 16) | oem_lo;
if (hw->aq.api_maj_ver > I40E_FW_API_VERSION_MAJOR) {
ret_code = I40E_ERR_FIRMWARE_API_VERSION;
@@ -669,6 +684,9 @@ enum i40e_status_code i40e_shutdown_adminq(struct i40e_hw *hw)
i40e_destroy_spinlock(&hw->aq.asq_spinlock);
i40e_destroy_spinlock(&hw->aq.arq_spinlock);
+ if (hw->nvm_buff.va)
+ i40e_free_virt_mem(hw, &hw->nvm_buff);
+
return ret_code;
}
@@ -688,16 +706,16 @@ u16 i40e_clean_asq(struct i40e_hw *hw)
desc = I40E_ADMINQ_DESC(*asq, ntc);
details = I40E_ADMINQ_DETAILS(*asq, ntc);
+
while (rd32(hw, hw->aq.asq.head) != ntc) {
i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
- "%s: ntc %d head %d.\n", __FUNCTION__, ntc,
- rd32(hw, hw->aq.asq.head));
+ "ntc %d head %d.\n", ntc, rd32(hw, hw->aq.asq.head));
if (details->callback) {
I40E_ADMINQ_CALLBACK cb_func =
(I40E_ADMINQ_CALLBACK)details->callback;
- i40e_memcpy(&desc_cb, desc,
- sizeof(struct i40e_aq_desc), I40E_DMA_TO_DMA);
+ i40e_memcpy(&desc_cb, desc, sizeof(struct i40e_aq_desc),
+ I40E_DMA_TO_DMA);
cb_func(hw, &desc_cb);
}
i40e_memset(desc, 0, sizeof(*desc), I40E_DMA_MEM);
@@ -755,6 +773,8 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
u16 retval = 0;
u32 val = 0;
+ hw->aq.asq_last_status = I40E_AQ_RC_OK;
+
val = rd32(hw, hw->aq.asq.head);
if (val >= hw->aq.num_asq_entries) {
i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
@@ -912,6 +932,11 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
"AQTX: desc and buffer writeback:\n");
i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, buff, buff_size);
+ /* save writeback aq if requested */
+ if (details->wb_desc)
+ i40e_memcpy(details->wb_desc, desc_on_ring,
+ sizeof(struct i40e_aq_desc), I40E_DMA_TO_NONDMA);
+
/* update the error if time out occurred */
if ((!cmd_completed) &&
(!details->async && !details->postpone)) {
@@ -971,7 +996,10 @@ enum i40e_status_code i40e_clean_arq_element(struct i40e_hw *hw,
i40e_acquire_spinlock(&hw->aq.arq_spinlock);
/* set next_to_use to head */
- ntu = (rd32(hw, hw->aq.arq.head) & I40E_PF_ARQH_ARQH_MASK);
+ if (!i40e_is_vf(hw))
+ ntu = (rd32(hw, hw->aq.arq.head) & I40E_PF_ARQH_ARQH_MASK);
+ if (i40e_is_vf(hw))
+ ntu = (rd32(hw, hw->aq.arq.head) & I40E_VF_ARQH1_ARQH_MASK);
if (ntu == ntc) {
/* nothing to do - shouldn't need to update ring's values */
ret_code = I40E_ERR_ADMIN_QUEUE_NO_WORK;
@@ -1040,6 +1068,19 @@ clean_arq_element_out:
i40e_release_nvm(hw);
hw->aq.nvm_release_on_done = FALSE;
}
+
+ switch (hw->nvmupd_state) {
+ case I40E_NVMUPD_STATE_INIT_WAIT:
+ hw->nvmupd_state = I40E_NVMUPD_STATE_INIT;
+ break;
+
+ case I40E_NVMUPD_STATE_WRITE_WAIT:
+ hw->nvmupd_state = I40E_NVMUPD_STATE_WRITING;
+ break;
+
+ default:
+ break;
+ }
}
return ret_code;
@@ -1051,9 +1092,6 @@ void i40e_resume_aq(struct i40e_hw *hw)
hw->aq.asq.next_to_use = 0;
hw->aq.asq.next_to_clean = 0;
-#if (I40E_VF_ATQLEN_ATQENABLE_MASK != I40E_PF_ATQLEN_ATQENABLE_MASK)
-#error I40E_VF_ATQLEN_ATQENABLE_MASK != I40E_PF_ATQLEN_ATQENABLE_MASK
-#endif
i40e_config_asq_regs(hw);
hw->aq.arq.next_to_use = 0;
diff --git a/sys/dev/ixl/i40e_adminq.h b/sys/dev/ixl/i40e_adminq.h
index 9db4c9d..76dab8e 100644
--- a/sys/dev/ixl/i40e_adminq.h
+++ b/sys/dev/ixl/i40e_adminq.h
@@ -1,6 +1,6 @@
/******************************************************************************
- Copyright (c) 2013-2014, Intel Corporation
+ Copyright (c) 2013-2015, Intel Corporation
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -77,6 +77,7 @@ struct i40e_asq_cmd_details {
u16 flags_dis;
bool async;
bool postpone;
+ struct i40e_aq_desc *wb_desc;
};
#define I40E_ADMINQ_DETAILS(R, i) \
diff --git a/sys/dev/ixl/i40e_adminq_cmd.h b/sys/dev/ixl/i40e_adminq_cmd.h
index 0d52883..f1f267e 100644
--- a/sys/dev/ixl/i40e_adminq_cmd.h
+++ b/sys/dev/ixl/i40e_adminq_cmd.h
@@ -42,7 +42,11 @@
*/
#define I40E_FW_API_VERSION_MAJOR 0x0001
-#define I40E_FW_API_VERSION_MINOR 0x0002
+#ifdef X722_SUPPORT
+#define I40E_FW_API_VERSION_MINOR 0x0003
+#else
+#define I40E_FW_API_VERSION_MINOR 0x0004
+#endif
struct i40e_aq_desc {
__le16 flags;
@@ -140,12 +144,7 @@ enum i40e_admin_queue_opc {
i40e_aqc_opc_list_func_capabilities = 0x000A,
i40e_aqc_opc_list_dev_capabilities = 0x000B,
- i40e_aqc_opc_set_cppm_configuration = 0x0103,
- i40e_aqc_opc_set_arp_proxy_entry = 0x0104,
- i40e_aqc_opc_set_ns_proxy_entry = 0x0105,
-
/* LAA */
- i40e_aqc_opc_mng_laa = 0x0106, /* AQ obsolete */
i40e_aqc_opc_mac_address_read = 0x0107,
i40e_aqc_opc_mac_address_write = 0x0108,
@@ -240,6 +239,7 @@ enum i40e_admin_queue_opc {
i40e_aqc_opc_nvm_update = 0x0703,
i40e_aqc_opc_nvm_config_read = 0x0704,
i40e_aqc_opc_nvm_config_write = 0x0705,
+ i40e_aqc_opc_oem_post_update = 0x0720,
/* virtualization commands */
i40e_aqc_opc_send_msg_to_pf = 0x0801,
@@ -270,7 +270,12 @@ enum i40e_admin_queue_opc {
/* Tunnel commands */
i40e_aqc_opc_add_udp_tunnel = 0x0B00,
i40e_aqc_opc_del_udp_tunnel = 0x0B01,
- i40e_aqc_opc_tunnel_key_structure = 0x0B10,
+#ifdef X722_SUPPORT
+ i40e_aqc_opc_set_rss_key = 0x0B02,
+ i40e_aqc_opc_set_rss_lut = 0x0B03,
+ i40e_aqc_opc_get_rss_key = 0x0B04,
+ i40e_aqc_opc_get_rss_lut = 0x0B05,
+#endif
/* Async Events */
i40e_aqc_opc_event_lan_overflow = 0x1001,
@@ -282,8 +287,6 @@ enum i40e_admin_queue_opc {
i40e_aqc_opc_oem_ocbb_initialize = 0xFE03,
/* debug commands */
- i40e_aqc_opc_debug_get_deviceid = 0xFF00,
- i40e_aqc_opc_debug_set_mode = 0xFF01,
i40e_aqc_opc_debug_read_reg = 0xFF03,
i40e_aqc_opc_debug_write_reg = 0xFF04,
i40e_aqc_opc_debug_modify_reg = 0xFF07,
@@ -517,7 +520,8 @@ struct i40e_aqc_mac_address_read {
#define I40E_AQC_SAN_ADDR_VALID 0x20
#define I40E_AQC_PORT_ADDR_VALID 0x40
#define I40E_AQC_WOL_ADDR_VALID 0x80
-#define I40E_AQC_ADDR_VALID_MASK 0xf0
+#define I40E_AQC_MC_MAG_EN_VALID 0x100
+#define I40E_AQC_ADDR_VALID_MASK 0x1F0
u8 reserved[6];
__le32 addr_high;
__le32 addr_low;
@@ -540,7 +544,9 @@ struct i40e_aqc_mac_address_write {
#define I40E_AQC_WRITE_TYPE_LAA_ONLY 0x0000
#define I40E_AQC_WRITE_TYPE_LAA_WOL 0x4000
#define I40E_AQC_WRITE_TYPE_PORT 0x8000
-#define I40E_AQC_WRITE_TYPE_MASK 0xc000
+#define I40E_AQC_WRITE_TYPE_UPDATE_MC_MAG 0xC000
+#define I40E_AQC_WRITE_TYPE_MASK 0xC000
+
__le16 mac_sah;
__le32 mac_sal;
u8 reserved[8];
@@ -834,8 +840,16 @@ struct i40e_aqc_vsi_properties_data {
I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT)
/* queueing option section */
u8 queueing_opt_flags;
+#ifdef X722_SUPPORT
+#define I40E_AQ_VSI_QUE_OPT_MULTICAST_UDP_ENA 0x04
+#define I40E_AQ_VSI_QUE_OPT_UNICAST_UDP_ENA 0x08
+#endif
#define I40E_AQ_VSI_QUE_OPT_TCP_ENA 0x10
#define I40E_AQ_VSI_QUE_OPT_FCOE_ENA 0x20
+#ifdef X722_SUPPORT
+#define I40E_AQ_VSI_QUE_OPT_RSS_LUT_PF 0x00
+#define I40E_AQ_VSI_QUE_OPT_RSS_LUT_VSI 0x40
+#endif
u8 queueing_opt_reserved[3];
/* scheduler section */
u8 up_enable_bits;
@@ -1076,6 +1090,7 @@ struct i40e_aqc_set_vsi_promiscuous_modes {
__le16 seid;
#define I40E_AQC_VSI_PROM_CMD_SEID_MASK 0x3FF
__le16 vlan_tag;
+#define I40E_AQC_SET_VSI_VLAN_MASK 0x0FFF
#define I40E_AQC_SET_VSI_VLAN_VALID 0x8000
u8 reserved[8];
};
@@ -1725,11 +1740,13 @@ struct i40e_aqc_get_link_status {
u8 phy_type; /* i40e_aq_phy_type */
u8 link_speed; /* i40e_aq_link_speed */
u8 link_info;
-#define I40E_AQ_LINK_UP 0x01
+#define I40E_AQ_LINK_UP 0x01 /* obsolete */
+#define I40E_AQ_LINK_UP_FUNCTION 0x01
#define I40E_AQ_LINK_FAULT 0x02
#define I40E_AQ_LINK_FAULT_TX 0x04
#define I40E_AQ_LINK_FAULT_RX 0x08
#define I40E_AQ_LINK_FAULT_REMOTE 0x10
+#define I40E_AQ_LINK_UP_PORT 0x20
#define I40E_AQ_MEDIA_AVAILABLE 0x40
#define I40E_AQ_SIGNAL_DETECT 0x80
u8 an_info;
@@ -1891,6 +1908,26 @@ struct i40e_aqc_nvm_config_data_immediate_field {
I40E_CHECK_STRUCT_LEN(0xc, i40e_aqc_nvm_config_data_immediate_field);
+/* OEM Post Update (indirect 0x0720)
+ * no command data struct used
+ */
+ struct i40e_aqc_nvm_oem_post_update {
+#define I40E_AQ_NVM_OEM_POST_UPDATE_EXTERNAL_DATA 0x01
+ u8 sel_data;
+ u8 reserved[7];
+};
+
+I40E_CHECK_STRUCT_LEN(0x8, i40e_aqc_nvm_oem_post_update);
+
+struct i40e_aqc_nvm_oem_post_update_buffer {
+ u8 str_len;
+ u8 dev_addr;
+ __le16 eeprom_addr;
+ u8 data[36];
+};
+
+I40E_CHECK_STRUCT_LEN(0x28, i40e_aqc_nvm_oem_post_update_buffer);
+
/* Send to PF command (indirect 0x0801) id is only used by PF
* Send to VF command (indirect 0x0802) id is only used by PF
* Send to Peer PF command (indirect 0x0803)
@@ -2064,12 +2101,28 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_start);
#define I40E_AQC_CEE_APP_ISCSI_MASK (0x7 << I40E_AQC_CEE_APP_ISCSI_SHIFT)
#define I40E_AQC_CEE_APP_FIP_SHIFT 0x8
#define I40E_AQC_CEE_APP_FIP_MASK (0x7 << I40E_AQC_CEE_APP_FIP_SHIFT)
+
#define I40E_AQC_CEE_PG_STATUS_SHIFT 0x0
#define I40E_AQC_CEE_PG_STATUS_MASK (0x7 << I40E_AQC_CEE_PG_STATUS_SHIFT)
#define I40E_AQC_CEE_PFC_STATUS_SHIFT 0x3
#define I40E_AQC_CEE_PFC_STATUS_MASK (0x7 << I40E_AQC_CEE_PFC_STATUS_SHIFT)
#define I40E_AQC_CEE_APP_STATUS_SHIFT 0x8
#define I40E_AQC_CEE_APP_STATUS_MASK (0x7 << I40E_AQC_CEE_APP_STATUS_SHIFT)
+#define I40E_AQC_CEE_FCOE_STATUS_SHIFT 0x8
+#define I40E_AQC_CEE_FCOE_STATUS_MASK (0x7 << I40E_AQC_CEE_FCOE_STATUS_SHIFT)
+#define I40E_AQC_CEE_ISCSI_STATUS_SHIFT 0xB
+#define I40E_AQC_CEE_ISCSI_STATUS_MASK (0x7 << I40E_AQC_CEE_ISCSI_STATUS_SHIFT)
+#define I40E_AQC_CEE_FIP_STATUS_SHIFT 0x10
+#define I40E_AQC_CEE_FIP_STATUS_MASK (0x7 << I40E_AQC_CEE_FIP_STATUS_SHIFT)
+
+/* struct i40e_aqc_get_cee_dcb_cfg_v1_resp was originally defined with
+ * word boundary layout issues, which the Linux compilers silently deal
+ * with by adding padding, making the actual struct larger than designed.
+ * However, the FW compiler for the NIC is less lenient and complains
+ * about the struct. Hence, the struct defined here has an extra byte in
+ * fields reserved3 and reserved4 to directly acknowledge that padding,
+ * and the new length is used in the length check macro.
+ */
struct i40e_aqc_get_cee_dcb_cfg_v1_resp {
u8 reserved1;
u8 oper_num_tc;
@@ -2077,9 +2130,9 @@ struct i40e_aqc_get_cee_dcb_cfg_v1_resp {
u8 reserved2;
u8 oper_tc_bw[8];
u8 oper_pfc_en;
- u8 reserved3;
+ u8 reserved3[2];
__le16 oper_app_prio;
- u8 reserved4;
+ u8 reserved4[2];
__le16 tlv_status;
};
@@ -2168,6 +2221,48 @@ struct i40e_aqc_del_udp_tunnel_completion {
};
I40E_CHECK_CMD_LENGTH(i40e_aqc_del_udp_tunnel_completion);
+#ifdef X722_SUPPORT
+
+struct i40e_aqc_get_set_rss_key {
+#define I40E_AQC_SET_RSS_KEY_VSI_VALID (0x1 << 15)
+#define I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT 0
+#define I40E_AQC_SET_RSS_KEY_VSI_ID_MASK (0x3FF << \
+ I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT)
+ __le16 vsi_id;
+ u8 reserved[6];
+ __le32 addr_high;
+ __le32 addr_low;
+};
+
+I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_key);
+
+struct i40e_aqc_get_set_rss_key_data {
+ u8 standard_rss_key[0x28];
+ u8 extended_hash_key[0xc];
+};
+
+I40E_CHECK_STRUCT_LEN(0x34, i40e_aqc_get_set_rss_key_data);
+
+struct i40e_aqc_get_set_rss_lut {
+#define I40E_AQC_SET_RSS_LUT_VSI_VALID (0x1 << 15)
+#define I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT 0
+#define I40E_AQC_SET_RSS_LUT_VSI_ID_MASK (0x3FF << \
+ I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT)
+ __le16 vsi_id;
+#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT 0
+#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK (0x1 << \
+ I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT)
+
+#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_VSI 0
+#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_PF 1
+ __le16 flags;
+ u8 reserved[4];
+ __le32 addr_high;
+ __le32 addr_low;
+};
+
+I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_lut);
+#endif
/* tunnel key structure 0x0B10 */
diff --git a/sys/dev/ixl/i40e_common.c b/sys/dev/ixl/i40e_common.c
index 777ecef..2a5f499 100644
--- a/sys/dev/ixl/i40e_common.c
+++ b/sys/dev/ixl/i40e_common.c
@@ -62,9 +62,24 @@ enum i40e_status_code i40e_set_mac_type(struct i40e_hw *hw)
case I40E_DEV_ID_QSFP_B:
case I40E_DEV_ID_QSFP_C:
case I40E_DEV_ID_10G_BASE_T:
+ case I40E_DEV_ID_10G_BASE_T4:
case I40E_DEV_ID_20G_KR2:
+ case I40E_DEV_ID_20G_KR2_A:
hw->mac.type = I40E_MAC_XL710;
break;
+#ifdef X722_SUPPORT
+ case I40E_DEV_ID_SFP_X722:
+ case I40E_DEV_ID_1G_BASE_T_X722:
+ case I40E_DEV_ID_10G_BASE_T_X722:
+ hw->mac.type = I40E_MAC_X722;
+ break;
+#endif
+#ifdef X722_SUPPORT
+ case I40E_DEV_ID_X722_VF:
+ case I40E_DEV_ID_X722_VF_HV:
+ hw->mac.type = I40E_MAC_X722_VF;
+ break;
+#endif
case I40E_DEV_ID_VF:
case I40E_DEV_ID_VF_HV:
hw->mac.type = I40E_MAC_VF;
@@ -83,6 +98,212 @@ enum i40e_status_code i40e_set_mac_type(struct i40e_hw *hw)
}
/**
+ * i40e_aq_str - convert AQ err code to a string
+ * @hw: pointer to the HW structure
+ * @aq_err: the AQ error code to convert
+ **/
+char *i40e_aq_str(struct i40e_hw *hw, enum i40e_admin_queue_err aq_err)
+{
+ switch (aq_err) {
+ case I40E_AQ_RC_OK:
+ return "OK";
+ case I40E_AQ_RC_EPERM:
+ return "I40E_AQ_RC_EPERM";
+ case I40E_AQ_RC_ENOENT:
+ return "I40E_AQ_RC_ENOENT";
+ case I40E_AQ_RC_ESRCH:
+ return "I40E_AQ_RC_ESRCH";
+ case I40E_AQ_RC_EINTR:
+ return "I40E_AQ_RC_EINTR";
+ case I40E_AQ_RC_EIO:
+ return "I40E_AQ_RC_EIO";
+ case I40E_AQ_RC_ENXIO:
+ return "I40E_AQ_RC_ENXIO";
+ case I40E_AQ_RC_E2BIG:
+ return "I40E_AQ_RC_E2BIG";
+ case I40E_AQ_RC_EAGAIN:
+ return "I40E_AQ_RC_EAGAIN";
+ case I40E_AQ_RC_ENOMEM:
+ return "I40E_AQ_RC_ENOMEM";
+ case I40E_AQ_RC_EACCES:
+ return "I40E_AQ_RC_EACCES";
+ case I40E_AQ_RC_EFAULT:
+ return "I40E_AQ_RC_EFAULT";
+ case I40E_AQ_RC_EBUSY:
+ return "I40E_AQ_RC_EBUSY";
+ case I40E_AQ_RC_EEXIST:
+ return "I40E_AQ_RC_EEXIST";
+ case I40E_AQ_RC_EINVAL:
+ return "I40E_AQ_RC_EINVAL";
+ case I40E_AQ_RC_ENOTTY:
+ return "I40E_AQ_RC_ENOTTY";
+ case I40E_AQ_RC_ENOSPC:
+ return "I40E_AQ_RC_ENOSPC";
+ case I40E_AQ_RC_ENOSYS:
+ return "I40E_AQ_RC_ENOSYS";
+ case I40E_AQ_RC_ERANGE:
+ return "I40E_AQ_RC_ERANGE";
+ case I40E_AQ_RC_EFLUSHED:
+ return "I40E_AQ_RC_EFLUSHED";
+ case I40E_AQ_RC_BAD_ADDR:
+ return "I40E_AQ_RC_BAD_ADDR";
+ case I40E_AQ_RC_EMODE:
+ return "I40E_AQ_RC_EMODE";
+ case I40E_AQ_RC_EFBIG:
+ return "I40E_AQ_RC_EFBIG";
+ }
+
+ snprintf(hw->err_str, sizeof(hw->err_str), "%d", aq_err);
+ return hw->err_str;
+}
+
+/**
+ * i40e_stat_str - convert status err code to a string
+ * @hw: pointer to the HW structure
+ * @stat_err: the status error code to convert
+ **/
+char *i40e_stat_str(struct i40e_hw *hw, enum i40e_status_code stat_err)
+{
+ switch (stat_err) {
+ case I40E_SUCCESS:
+ return "OK";
+ case I40E_ERR_NVM:
+ return "I40E_ERR_NVM";
+ case I40E_ERR_NVM_CHECKSUM:
+ return "I40E_ERR_NVM_CHECKSUM";
+ case I40E_ERR_PHY:
+ return "I40E_ERR_PHY";
+ case I40E_ERR_CONFIG:
+ return "I40E_ERR_CONFIG";
+ case I40E_ERR_PARAM:
+ return "I40E_ERR_PARAM";
+ case I40E_ERR_MAC_TYPE:
+ return "I40E_ERR_MAC_TYPE";
+ case I40E_ERR_UNKNOWN_PHY:
+ return "I40E_ERR_UNKNOWN_PHY";
+ case I40E_ERR_LINK_SETUP:
+ return "I40E_ERR_LINK_SETUP";
+ case I40E_ERR_ADAPTER_STOPPED:
+ return "I40E_ERR_ADAPTER_STOPPED";
+ case I40E_ERR_INVALID_MAC_ADDR:
+ return "I40E_ERR_INVALID_MAC_ADDR";
+ case I40E_ERR_DEVICE_NOT_SUPPORTED:
+ return "I40E_ERR_DEVICE_NOT_SUPPORTED";
+ case I40E_ERR_MASTER_REQUESTS_PENDING:
+ return "I40E_ERR_MASTER_REQUESTS_PENDING";
+ case I40E_ERR_INVALID_LINK_SETTINGS:
+ return "I40E_ERR_INVALID_LINK_SETTINGS";
+ case I40E_ERR_AUTONEG_NOT_COMPLETE:
+ return "I40E_ERR_AUTONEG_NOT_COMPLETE";
+ case I40E_ERR_RESET_FAILED:
+ return "I40E_ERR_RESET_FAILED";
+ case I40E_ERR_SWFW_SYNC:
+ return "I40E_ERR_SWFW_SYNC";
+ case I40E_ERR_NO_AVAILABLE_VSI:
+ return "I40E_ERR_NO_AVAILABLE_VSI";
+ case I40E_ERR_NO_MEMORY:
+ return "I40E_ERR_NO_MEMORY";
+ case I40E_ERR_BAD_PTR:
+ return "I40E_ERR_BAD_PTR";
+ case I40E_ERR_RING_FULL:
+ return "I40E_ERR_RING_FULL";
+ case I40E_ERR_INVALID_PD_ID:
+ return "I40E_ERR_INVALID_PD_ID";
+ case I40E_ERR_INVALID_QP_ID:
+ return "I40E_ERR_INVALID_QP_ID";
+ case I40E_ERR_INVALID_CQ_ID:
+ return "I40E_ERR_INVALID_CQ_ID";
+ case I40E_ERR_INVALID_CEQ_ID:
+ return "I40E_ERR_INVALID_CEQ_ID";
+ case I40E_ERR_INVALID_AEQ_ID:
+ return "I40E_ERR_INVALID_AEQ_ID";
+ case I40E_ERR_INVALID_SIZE:
+ return "I40E_ERR_INVALID_SIZE";
+ case I40E_ERR_INVALID_ARP_INDEX:
+ return "I40E_ERR_INVALID_ARP_INDEX";
+ case I40E_ERR_INVALID_FPM_FUNC_ID:
+ return "I40E_ERR_INVALID_FPM_FUNC_ID";
+ case I40E_ERR_QP_INVALID_MSG_SIZE:
+ return "I40E_ERR_QP_INVALID_MSG_SIZE";
+ case I40E_ERR_QP_TOOMANY_WRS_POSTED:
+ return "I40E_ERR_QP_TOOMANY_WRS_POSTED";
+ case I40E_ERR_INVALID_FRAG_COUNT:
+ return "I40E_ERR_INVALID_FRAG_COUNT";
+ case I40E_ERR_QUEUE_EMPTY:
+ return "I40E_ERR_QUEUE_EMPTY";
+ case I40E_ERR_INVALID_ALIGNMENT:
+ return "I40E_ERR_INVALID_ALIGNMENT";
+ case I40E_ERR_FLUSHED_QUEUE:
+ return "I40E_ERR_FLUSHED_QUEUE";
+ case I40E_ERR_INVALID_PUSH_PAGE_INDEX:
+ return "I40E_ERR_INVALID_PUSH_PAGE_INDEX";
+ case I40E_ERR_INVALID_IMM_DATA_SIZE:
+ return "I40E_ERR_INVALID_IMM_DATA_SIZE";
+ case I40E_ERR_TIMEOUT:
+ return "I40E_ERR_TIMEOUT";
+ case I40E_ERR_OPCODE_MISMATCH:
+ return "I40E_ERR_OPCODE_MISMATCH";
+ case I40E_ERR_CQP_COMPL_ERROR:
+ return "I40E_ERR_CQP_COMPL_ERROR";
+ case I40E_ERR_INVALID_VF_ID:
+ return "I40E_ERR_INVALID_VF_ID";
+ case I40E_ERR_INVALID_HMCFN_ID:
+ return "I40E_ERR_INVALID_HMCFN_ID";
+ case I40E_ERR_BACKING_PAGE_ERROR:
+ return "I40E_ERR_BACKING_PAGE_ERROR";
+ case I40E_ERR_NO_PBLCHUNKS_AVAILABLE:
+ return "I40E_ERR_NO_PBLCHUNKS_AVAILABLE";
+ case I40E_ERR_INVALID_PBLE_INDEX:
+ return "I40E_ERR_INVALID_PBLE_INDEX";
+ case I40E_ERR_INVALID_SD_INDEX:
+ return "I40E_ERR_INVALID_SD_INDEX";
+ case I40E_ERR_INVALID_PAGE_DESC_INDEX:
+ return "I40E_ERR_INVALID_PAGE_DESC_INDEX";
+ case I40E_ERR_INVALID_SD_TYPE:
+ return "I40E_ERR_INVALID_SD_TYPE";
+ case I40E_ERR_MEMCPY_FAILED:
+ return "I40E_ERR_MEMCPY_FAILED";
+ case I40E_ERR_INVALID_HMC_OBJ_INDEX:
+ return "I40E_ERR_INVALID_HMC_OBJ_INDEX";
+ case I40E_ERR_INVALID_HMC_OBJ_COUNT:
+ return "I40E_ERR_INVALID_HMC_OBJ_COUNT";
+ case I40E_ERR_INVALID_SRQ_ARM_LIMIT:
+ return "I40E_ERR_INVALID_SRQ_ARM_LIMIT";
+ case I40E_ERR_SRQ_ENABLED:
+ return "I40E_ERR_SRQ_ENABLED";
+ case I40E_ERR_ADMIN_QUEUE_ERROR:
+ return "I40E_ERR_ADMIN_QUEUE_ERROR";
+ case I40E_ERR_ADMIN_QUEUE_TIMEOUT:
+ return "I40E_ERR_ADMIN_QUEUE_TIMEOUT";
+ case I40E_ERR_BUF_TOO_SHORT:
+ return "I40E_ERR_BUF_TOO_SHORT";
+ case I40E_ERR_ADMIN_QUEUE_FULL:
+ return "I40E_ERR_ADMIN_QUEUE_FULL";
+ case I40E_ERR_ADMIN_QUEUE_NO_WORK:
+ return "I40E_ERR_ADMIN_QUEUE_NO_WORK";
+ case I40E_ERR_BAD_IWARP_CQE:
+ return "I40E_ERR_BAD_IWARP_CQE";
+ case I40E_ERR_NVM_BLANK_MODE:
+ return "I40E_ERR_NVM_BLANK_MODE";
+ case I40E_ERR_NOT_IMPLEMENTED:
+ return "I40E_ERR_NOT_IMPLEMENTED";
+ case I40E_ERR_PE_DOORBELL_NOT_ENABLED:
+ return "I40E_ERR_PE_DOORBELL_NOT_ENABLED";
+ case I40E_ERR_DIAG_TEST_FAILED:
+ return "I40E_ERR_DIAG_TEST_FAILED";
+ case I40E_ERR_NOT_READY:
+ return "I40E_ERR_NOT_READY";
+ case I40E_NOT_SUPPORTED:
+ return "I40E_NOT_SUPPORTED";
+ case I40E_ERR_FIRMWARE_API_VERSION:
+ return "I40E_ERR_FIRMWARE_API_VERSION";
+ }
+
+ snprintf(hw->err_str, sizeof(hw->err_str), "%d", stat_err);
+ return hw->err_str;
+}
+
+/**
* i40e_debug_aq
* @hw: debug mask related to admin queue
* @mask: debug mask
@@ -154,9 +375,13 @@ void i40e_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask, void *desc,
bool i40e_check_asq_alive(struct i40e_hw *hw)
{
if (hw->aq.asq.len)
- return !!(rd32(hw, hw->aq.asq.len) & I40E_PF_ATQLEN_ATQENABLE_MASK);
- else
- return FALSE;
+ if (!i40e_is_vf(hw))
+ return !!(rd32(hw, hw->aq.asq.len) &
+ I40E_PF_ATQLEN_ATQENABLE_MASK);
+ if (i40e_is_vf(hw))
+ return !!(rd32(hw, hw->aq.asq.len) &
+ I40E_VF_ATQLEN1_ATQENABLE_MASK);
+ return FALSE;
}
/**
@@ -184,6 +409,171 @@ enum i40e_status_code i40e_aq_queue_shutdown(struct i40e_hw *hw,
return status;
}
+#ifdef X722_SUPPORT
+
+/**
+ * i40e_aq_get_set_rss_lut
+ * @hw: pointer to the hardware structure
+ * @vsi_id: vsi fw index
+ * @pf_lut: for PF table set TRUE, for VSI table set FALSE
+ * @lut: pointer to the lut buffer provided by the caller
+ * @lut_size: size of the lut buffer
+ * @set: set TRUE to set the table, FALSE to get the table
+ *
+ * Internal function to get or set RSS look up table
+ **/
+static enum i40e_status_code i40e_aq_get_set_rss_lut(struct i40e_hw *hw,
+ u16 vsi_id, bool pf_lut,
+ u8 *lut, u16 lut_size,
+ bool set)
+{
+ enum i40e_status_code status;
+ struct i40e_aq_desc desc;
+ struct i40e_aqc_get_set_rss_lut *cmd_resp =
+ (struct i40e_aqc_get_set_rss_lut *)&desc.params.raw;
+
+ if (set)
+ i40e_fill_default_direct_cmd_desc(&desc,
+ i40e_aqc_opc_set_rss_lut);
+ else
+ i40e_fill_default_direct_cmd_desc(&desc,
+ i40e_aqc_opc_get_rss_lut);
+
+ /* Indirect command */
+ desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_BUF);
+ desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_RD);
+
+ cmd_resp->vsi_id =
+ CPU_TO_LE16((u16)((vsi_id <<
+ I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT) &
+ I40E_AQC_SET_RSS_LUT_VSI_ID_MASK));
+ cmd_resp->vsi_id |= CPU_TO_LE16((u16)I40E_AQC_SET_RSS_LUT_VSI_VALID);
+
+ if (pf_lut)
+ cmd_resp->flags |= CPU_TO_LE16((u16)
+ ((I40E_AQC_SET_RSS_LUT_TABLE_TYPE_PF <<
+ I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT) &
+ I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK));
+ else
+ cmd_resp->flags |= CPU_TO_LE16((u16)
+ ((I40E_AQC_SET_RSS_LUT_TABLE_TYPE_VSI <<
+ I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT) &
+ I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK));
+
+ cmd_resp->addr_high = CPU_TO_LE32(I40E_HI_WORD((u64)lut));
+ cmd_resp->addr_low = CPU_TO_LE32(I40E_LO_DWORD((u64)lut));
+
+ status = i40e_asq_send_command(hw, &desc, lut, lut_size, NULL);
+
+ return status;
+}
+
+/**
+ * i40e_aq_get_rss_lut
+ * @hw: pointer to the hardware structure
+ * @vsi_id: vsi fw index
+ * @pf_lut: for PF table set TRUE, for VSI table set FALSE
+ * @lut: pointer to the lut buffer provided by the caller
+ * @lut_size: size of the lut buffer
+ *
+ * get the RSS lookup table, PF or VSI type
+ **/
+enum i40e_status_code i40e_aq_get_rss_lut(struct i40e_hw *hw, u16 vsi_id,
+ bool pf_lut, u8 *lut, u16 lut_size)
+{
+ return i40e_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size,
+ FALSE);
+}
+
+/**
+ * i40e_aq_set_rss_lut
+ * @hw: pointer to the hardware structure
+ * @vsi_id: vsi fw index
+ * @pf_lut: for PF table set TRUE, for VSI table set FALSE
+ * @lut: pointer to the lut buffer provided by the caller
+ * @lut_size: size of the lut buffer
+ *
+ * set the RSS lookup table, PF or VSI type
+ **/
+enum i40e_status_code i40e_aq_set_rss_lut(struct i40e_hw *hw, u16 vsi_id,
+ bool pf_lut, u8 *lut, u16 lut_size)
+{
+ return i40e_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size, TRUE);
+}
+
+/**
+ * i40e_aq_get_set_rss_key
+ * @hw: pointer to the hw struct
+ * @vsi_id: vsi fw index
+ * @key: pointer to key info struct
+ * @set: set TRUE to set the key, FALSE to get the key
+ *
+ * get the RSS key per VSI
+ **/
+static enum i40e_status_code i40e_aq_get_set_rss_key(struct i40e_hw *hw,
+ u16 vsi_id,
+ struct i40e_aqc_get_set_rss_key_data *key,
+ bool set)
+{
+ enum i40e_status_code status;
+ struct i40e_aq_desc desc;
+ struct i40e_aqc_get_set_rss_key *cmd_resp =
+ (struct i40e_aqc_get_set_rss_key *)&desc.params.raw;
+ u16 key_size = sizeof(struct i40e_aqc_get_set_rss_key_data);
+
+ if (set)
+ i40e_fill_default_direct_cmd_desc(&desc,
+ i40e_aqc_opc_set_rss_key);
+ else
+ i40e_fill_default_direct_cmd_desc(&desc,
+ i40e_aqc_opc_get_rss_key);
+
+ /* Indirect command */
+ desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_BUF);
+ desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_RD);
+
+ cmd_resp->vsi_id =
+ CPU_TO_LE16((u16)((vsi_id <<
+ I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT) &
+ I40E_AQC_SET_RSS_KEY_VSI_ID_MASK));
+ cmd_resp->vsi_id |= CPU_TO_LE16((u16)I40E_AQC_SET_RSS_KEY_VSI_VALID);
+ cmd_resp->addr_high = CPU_TO_LE32(I40E_HI_WORD((u64)key));
+ cmd_resp->addr_low = CPU_TO_LE32(I40E_LO_DWORD((u64)key));
+
+ status = i40e_asq_send_command(hw, &desc, key, key_size, NULL);
+
+ return status;
+}
+
+/**
+ * i40e_aq_get_rss_key
+ * @hw: pointer to the hw struct
+ * @vsi_id: vsi fw index
+ * @key: pointer to key info struct
+ *
+ **/
+enum i40e_status_code i40e_aq_get_rss_key(struct i40e_hw *hw,
+ u16 vsi_id,
+ struct i40e_aqc_get_set_rss_key_data *key)
+{
+ return i40e_aq_get_set_rss_key(hw, vsi_id, key, FALSE);
+}
+
+/**
+ * i40e_aq_set_rss_key
+ * @hw: pointer to the hw struct
+ * @vsi_id: vsi fw index
+ * @key: pointer to key info struct
+ *
+ * set the RSS key per VSI
+ **/
+enum i40e_status_code i40e_aq_set_rss_key(struct i40e_hw *hw,
+ u16 vsi_id,
+ struct i40e_aqc_get_set_rss_key_data *key)
+{
+ return i40e_aq_get_set_rss_key(hw, vsi_id, key, TRUE);
+}
+#endif /* X722_SUPPORT */
/* The i40e_ptype_lookup table is used to convert from the 8-bit ptype in the
* hardware to a bit-field that can be used by SW to more easily determine the
@@ -598,6 +988,9 @@ enum i40e_status_code i40e_init_shared_code(struct i40e_hw *hw)
switch (hw->mac.type) {
case I40E_MAC_XL710:
+#ifdef X722_SUPPORT
+ case I40E_MAC_X722:
+#endif
break;
default:
return I40E_ERR_DEVICE_NOT_SUPPORTED;
@@ -888,7 +1281,7 @@ enum i40e_status_code i40e_pf_reset(struct i40e_hw *hw)
grst_del = (rd32(hw, I40E_GLGEN_RSTCTL) &
I40E_GLGEN_RSTCTL_GRSTDEL_MASK) >>
I40E_GLGEN_RSTCTL_GRSTDEL_SHIFT;
- for (cnt = 0; cnt < grst_del + 2; cnt++) {
+ for (cnt = 0; cnt < grst_del + 10; cnt++) {
reg = rd32(hw, I40E_GLGEN_RSTAT);
if (!(reg & I40E_GLGEN_RSTAT_DEVSTATE_MASK))
break;
@@ -1108,9 +1501,11 @@ u32 i40e_led_get(struct i40e_hw *hw)
if (!gpio_val)
continue;
- /* ignore gpio LED src mode entries related to the activity LEDs */
- current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >>
- I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT);
+ /* ignore gpio LED src mode entries related to the activity
+ * LEDs
+ */
+ current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK)
+ >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT);
switch (current_mode) {
case I40E_COMBINED_ACTIVITY:
case I40E_FILTER_ACTIVITY:
@@ -1154,9 +1549,11 @@ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink)
if (!gpio_val)
continue;
- /* ignore gpio LED src mode entries related to the activity LEDs */
- current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >>
- I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT);
+ /* ignore gpio LED src mode entries related to the activity
+ * LEDs
+ */
+ current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK)
+ >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT);
switch (current_mode) {
case I40E_COMBINED_ACTIVITY:
case I40E_FILTER_ACTIVITY:
@@ -1175,9 +1572,9 @@ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink)
blink = FALSE;
if (blink)
- gpio_val |= (1 << I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT);
+ gpio_val |= BIT(I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT);
else
- gpio_val &= ~(1 << I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT);
+ gpio_val &= ~BIT(I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT);
wr32(hw, I40E_GLGEN_GPIO_CTL(i), gpio_val);
break;
@@ -1329,14 +1726,14 @@ enum i40e_status_code i40e_set_fc(struct i40e_hw *hw, u8 *aq_failures,
*aq_failures |= I40E_SET_FC_AQ_FAIL_SET;
}
/* Update the link info */
- status = i40e_aq_get_link_info(hw, TRUE, NULL, NULL);
+ status = i40e_update_link_info(hw);
if (status) {
/* Wait a little bit (on 40G cards it sometimes takes a really
* long time for link to come back from the atomic reset)
* and try once more
*/
i40e_msec_delay(1000);
- status = i40e_aq_get_link_info(hw, TRUE, NULL, NULL);
+ status = i40e_update_link_info(hw);
}
if (status)
*aq_failures |= I40E_SET_FC_AQ_FAIL_UPDATE;
@@ -1525,7 +1922,6 @@ aq_get_link_info_exit:
return status;
}
-
/**
* i40e_aq_set_phy_int_mask
* @hw: pointer to the hw struct
@@ -1837,6 +2233,74 @@ enum i40e_status_code i40e_aq_set_vsi_multicast_promiscuous(struct i40e_hw *hw,
}
/**
+ * i40e_aq_set_vsi_mc_promisc_on_vlan
+ * @hw: pointer to the hw struct
+ * @seid: vsi number
+ * @enable: set MAC L2 layer unicast promiscuous enable/disable for a given VLAN
+ * @vid: The VLAN tag filter - capture any multicast packet with this VLAN tag
+ * @cmd_details: pointer to command details structure or NULL
+ **/
+enum i40e_status_code i40e_aq_set_vsi_mc_promisc_on_vlan(struct i40e_hw *hw,
+ u16 seid, bool enable, u16 vid,
+ struct i40e_asq_cmd_details *cmd_details)
+{
+ struct i40e_aq_desc desc;
+ struct i40e_aqc_set_vsi_promiscuous_modes *cmd =
+ (struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw;
+ enum i40e_status_code status;
+ u16 flags = 0;
+
+ i40e_fill_default_direct_cmd_desc(&desc,
+ i40e_aqc_opc_set_vsi_promiscuous_modes);
+
+ if (enable)
+ flags |= I40E_AQC_SET_VSI_PROMISC_MULTICAST;
+
+ cmd->promiscuous_flags = CPU_TO_LE16(flags);
+ cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_MULTICAST);
+ cmd->seid = CPU_TO_LE16(seid);
+ cmd->vlan_tag = CPU_TO_LE16(vid | I40E_AQC_SET_VSI_VLAN_VALID);
+
+ status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
+
+ return status;
+}
+
+/**
+ * i40e_aq_set_vsi_uc_promisc_on_vlan
+ * @hw: pointer to the hw struct
+ * @seid: vsi number
+ * @enable: set MAC L2 layer unicast promiscuous enable/disable for a given VLAN
+ * @vid: The VLAN tag filter - capture any unicast packet with this VLAN tag
+ * @cmd_details: pointer to command details structure or NULL
+ **/
+enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw,
+ u16 seid, bool enable, u16 vid,
+ struct i40e_asq_cmd_details *cmd_details)
+{
+ struct i40e_aq_desc desc;
+ struct i40e_aqc_set_vsi_promiscuous_modes *cmd =
+ (struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw;
+ enum i40e_status_code status;
+ u16 flags = 0;
+
+ i40e_fill_default_direct_cmd_desc(&desc,
+ i40e_aqc_opc_set_vsi_promiscuous_modes);
+
+ if (enable)
+ flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST;
+
+ cmd->promiscuous_flags = CPU_TO_LE16(flags);
+ cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_UNICAST);
+ cmd->seid = CPU_TO_LE16(seid);
+ cmd->vlan_tag = CPU_TO_LE16(vid | I40E_AQC_SET_VSI_VLAN_VALID);
+
+ status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
+
+ return status;
+}
+
+/**
* i40e_aq_set_vsi_broadcast
* @hw: pointer to the hw struct
* @seid: vsi number
@@ -2067,30 +2531,56 @@ enum i40e_status_code i40e_aq_send_driver_version(struct i40e_hw *hw,
/**
* i40e_get_link_status - get status of the HW network link
* @hw: pointer to the hw struct
+ * @link_up: pointer to bool (TRUE/FALSE = linkup/linkdown)
*
- * Returns TRUE if link is up, FALSE if link is down.
+ * Variable link_up TRUE if link is up, FALSE if link is down.
+ * The variable link_up is invalid if returned value of status != I40E_SUCCESS
*
* Side effect: LinkStatusEvent reporting becomes enabled
**/
-bool i40e_get_link_status(struct i40e_hw *hw)
+enum i40e_status_code i40e_get_link_status(struct i40e_hw *hw, bool *link_up)
{
enum i40e_status_code status = I40E_SUCCESS;
- bool link_status = FALSE;
if (hw->phy.get_link_info) {
- status = i40e_aq_get_link_info(hw, TRUE, NULL, NULL);
+ status = i40e_update_link_info(hw);
if (status != I40E_SUCCESS)
- goto i40e_get_link_status_exit;
+ i40e_debug(hw, I40E_DEBUG_LINK, "get link failed: status %d\n",
+ status);
}
- link_status = hw->phy.link_info.link_info & I40E_AQ_LINK_UP;
+ *link_up = hw->phy.link_info.link_info & I40E_AQ_LINK_UP;
-i40e_get_link_status_exit:
- return link_status;
+ return status;
}
/**
+ * i40e_updatelink_status - update status of the HW network link
+ * @hw: pointer to the hw struct
+ **/
+enum i40e_status_code i40e_update_link_info(struct i40e_hw *hw)
+{
+ struct i40e_aq_get_phy_abilities_resp abilities;
+ enum i40e_status_code status = I40E_SUCCESS;
+
+ status = i40e_aq_get_link_info(hw, TRUE, NULL, NULL);
+ if (status)
+ return status;
+
+ status = i40e_aq_get_phy_capabilities(hw, FALSE, false, &abilities,
+ NULL);
+ if (status)
+ return status;
+
+ memcpy(hw->phy.link_info.module_type, &abilities.module_type,
+ sizeof(hw->phy.link_info.module_type));
+
+ return status;
+}
+
+
+/**
* i40e_get_link_speed
* @hw: pointer to the hw struct
*
@@ -2218,6 +2708,7 @@ enum i40e_status_code i40e_aq_get_veb_parameters(struct i40e_hw *hw,
*vebs_free = LE16_TO_CPU(cmd_resp->vebs_free);
if (floating) {
u16 flags = LE16_TO_CPU(cmd_resp->veb_flags);
+
if (flags & I40E_AQC_ADD_VEB_FLOATING)
*floating = TRUE;
else
@@ -2750,6 +3241,27 @@ enum i40e_status_code i40e_aq_write_nvm_config(struct i40e_hw *hw,
}
/**
+ * i40e_aq_oem_post_update - triggers an OEM specific flow after update
+ * @hw: pointer to the hw struct
+ * @cmd_details: pointer to command details structure or NULL
+ **/
+enum i40e_status_code i40e_aq_oem_post_update(struct i40e_hw *hw,
+ void *buff, u16 buff_size,
+ struct i40e_asq_cmd_details *cmd_details)
+{
+ struct i40e_aq_desc desc;
+ enum i40e_status_code status;
+
+
+ i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_oem_post_update);
+ status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
+ if (status && LE16_TO_CPU(desc.retval) == I40E_AQ_RC_ESRCH)
+ status = I40E_ERR_NOT_IMPLEMENTED;
+
+ return status;
+}
+
+/**
* i40e_aq_erase_nvm
* @hw: pointer to the hw struct
* @module_pointer: module pointer location in words from the NVM beginning
@@ -2813,12 +3325,13 @@ i40e_aq_erase_nvm_exit:
#define I40E_DEV_FUNC_CAP_MSIX_VF 0x44
#define I40E_DEV_FUNC_CAP_FLOW_DIRECTOR 0x45
#define I40E_DEV_FUNC_CAP_IEEE_1588 0x46
-#define I40E_DEV_FUNC_CAP_MFP_MODE_1 0xF1
+#define I40E_DEV_FUNC_CAP_FLEX10 0xF1
#define I40E_DEV_FUNC_CAP_CEM 0xF2
#define I40E_DEV_FUNC_CAP_IWARP 0x51
#define I40E_DEV_FUNC_CAP_LED 0x61
#define I40E_DEV_FUNC_CAP_SDP 0x62
#define I40E_DEV_FUNC_CAP_MDIO 0x63
+#define I40E_DEV_FUNC_CAP_WR_CSR_PROT 0x64
/**
* i40e_parse_discover_capabilities
@@ -2837,6 +3350,7 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
u32 valid_functions, num_functions;
u32 number, logical_id, phys_id;
struct i40e_hw_capabilities *p;
+ u8 major_rev;
u32 i = 0;
u16 id;
@@ -2854,6 +3368,7 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
number = LE32_TO_CPU(cap->number);
logical_id = LE32_TO_CPU(cap->logical_id);
phys_id = LE32_TO_CPU(cap->phys_id);
+ major_rev = cap->major_rev;
switch (id) {
case I40E_DEV_FUNC_CAP_SWITCH_MODE:
@@ -2928,9 +3443,21 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
case I40E_DEV_FUNC_CAP_MSIX_VF:
p->num_msix_vectors_vf = number;
break;
- case I40E_DEV_FUNC_CAP_MFP_MODE_1:
- if (number == 1)
- p->mfp_mode_1 = TRUE;
+ case I40E_DEV_FUNC_CAP_FLEX10:
+ if (major_rev == 1) {
+ if (number == 1) {
+ p->flex10_enable = TRUE;
+ p->flex10_capable = TRUE;
+ }
+ } else {
+ /* Capability revision >= 2 */
+ if (number & 1)
+ p->flex10_enable = TRUE;
+ if (number & 2)
+ p->flex10_capable = TRUE;
+ }
+ p->flex10_mode = logical_id;
+ p->flex10_status = phys_id;
break;
case I40E_DEV_FUNC_CAP_CEM:
if (number == 1)
@@ -2963,11 +3490,18 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
p->fd_filters_guaranteed = number;
p->fd_filters_best_effort = logical_id;
break;
+ case I40E_DEV_FUNC_CAP_WR_CSR_PROT:
+ p->wr_csr_prot = (u64)number;
+ p->wr_csr_prot |= (u64)logical_id << 32;
+ break;
default:
break;
}
}
+ if (p->fcoe)
+ i40e_debug(hw, I40E_DEBUG_ALL, "device is FCoE capable\n");
+
/* Always disable FCoE if compiled without the I40E_FCOE_ENA flag */
p->fcoe = FALSE;
@@ -4923,6 +5457,63 @@ void i40e_set_pci_config_data(struct i40e_hw *hw, u16 link_status)
}
/**
+ * i40e_aq_debug_dump
+ * @hw: pointer to the hardware structure
+ * @cluster_id: specific cluster to dump
+ * @table_id: table id within cluster
+ * @start_index: index of line in the block to read
+ * @buff_size: dump buffer size
+ * @buff: dump buffer
+ * @ret_buff_size: actual buffer size returned
+ * @ret_next_table: next block to read
+ * @ret_next_index: next index to read
+ *
+ * Dump internal FW/HW data for debug purposes.
+ *
+ **/
+enum i40e_status_code i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id,
+ u8 table_id, u32 start_index, u16 buff_size,
+ void *buff, u16 *ret_buff_size,
+ u8 *ret_next_table, u32 *ret_next_index,
+ struct i40e_asq_cmd_details *cmd_details)
+{
+ struct i40e_aq_desc desc;
+ struct i40e_aqc_debug_dump_internals *cmd =
+ (struct i40e_aqc_debug_dump_internals *)&desc.params.raw;
+ struct i40e_aqc_debug_dump_internals *resp =
+ (struct i40e_aqc_debug_dump_internals *)&desc.params.raw;
+ enum i40e_status_code status;
+
+ if (buff_size == 0 || !buff)
+ return I40E_ERR_PARAM;
+
+ i40e_fill_default_direct_cmd_desc(&desc,
+ i40e_aqc_opc_debug_dump_internals);
+ /* Indirect Command */
+ desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_BUF);
+ if (buff_size > I40E_AQ_LARGE_BUF)
+ desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_LB);
+
+ cmd->cluster_id = cluster_id;
+ cmd->table_id = table_id;
+ cmd->idx = CPU_TO_LE32(start_index);
+
+ desc.datalen = CPU_TO_LE16(buff_size);
+
+ status = i40e_asq_send_command(hw, &desc, buff, buff_size, cmd_details);
+ if (!status) {
+ if (ret_buff_size != NULL)
+ *ret_buff_size = LE16_TO_CPU(desc.datalen);
+ if (ret_next_table != NULL)
+ *ret_next_table = resp->table_id;
+ if (ret_next_index != NULL)
+ *ret_next_index = LE32_TO_CPU(resp->idx);
+ }
+
+ return status;
+}
+
+/**
* i40e_read_bw_from_alt_ram
* @hw: pointer to the hardware structure
* @max_bw: pointer for max_bw read
@@ -4941,11 +5532,11 @@ enum i40e_status_code i40e_read_bw_from_alt_ram(struct i40e_hw *hw,
/* Calculate the address of the min/max bw registers */
max_bw_addr = I40E_ALT_STRUCT_FIRST_PF_OFFSET +
- I40E_ALT_STRUCT_MAX_BW_OFFSET +
- (I40E_ALT_STRUCT_DWORDS_PER_PF*hw->pf_id);
+ I40E_ALT_STRUCT_MAX_BW_OFFSET +
+ (I40E_ALT_STRUCT_DWORDS_PER_PF * hw->pf_id);
min_bw_addr = I40E_ALT_STRUCT_FIRST_PF_OFFSET +
- I40E_ALT_STRUCT_MIN_BW_OFFSET +
- (I40E_ALT_STRUCT_DWORDS_PER_PF*hw->pf_id);
+ I40E_ALT_STRUCT_MIN_BW_OFFSET +
+ (I40E_ALT_STRUCT_DWORDS_PER_PF * hw->pf_id);
/* Read the bandwidths from alt ram */
status = i40e_aq_alternate_read(hw, max_bw_addr, max_bw,
diff --git a/sys/dev/ixl/i40e_devids.h b/sys/dev/ixl/i40e_devids.h
new file mode 100644
index 0000000..abd597a
--- /dev/null
+++ b/sys/dev/ixl/i40e_devids.h
@@ -0,0 +1,68 @@
+/******************************************************************************
+
+ Copyright (c) 2013-2015, Intel Corporation
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ 3. Neither the name of the Intel Corporation nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+******************************************************************************/
+/*$FreeBSD$*/
+
+#ifndef _I40E_DEVIDS_H_
+#define _I40E_DEVIDS_H_
+
+/* Vendor ID */
+#define I40E_INTEL_VENDOR_ID 0x8086
+
+/* Device IDs */
+#define I40E_DEV_ID_SFP_XL710 0x1572
+#define I40E_DEV_ID_QEMU 0x1574
+#define I40E_DEV_ID_KX_A 0x157F
+#define I40E_DEV_ID_KX_B 0x1580
+#define I40E_DEV_ID_KX_C 0x1581
+#define I40E_DEV_ID_QSFP_A 0x1583
+#define I40E_DEV_ID_QSFP_B 0x1584
+#define I40E_DEV_ID_QSFP_C 0x1585
+#define I40E_DEV_ID_10G_BASE_T 0x1586
+#define I40E_DEV_ID_20G_KR2 0x1587
+#define I40E_DEV_ID_20G_KR2_A 0x1588
+#define I40E_DEV_ID_10G_BASE_T4 0x1589
+#define I40E_DEV_ID_VF 0x154C
+#define I40E_DEV_ID_VF_HV 0x1571
+#ifdef X722_SUPPORT
+#define I40E_DEV_ID_SFP_X722 0x37D0
+#define I40E_DEV_ID_1G_BASE_T_X722 0x37D1
+#define I40E_DEV_ID_10G_BASE_T_X722 0x37D2
+#define I40E_DEV_ID_X722_VF 0x37CD
+#define I40E_DEV_ID_X722_VF_HV 0x37D9
+#endif /* X722_SUPPORT */
+
+#define i40e_is_40G_device(d) ((d) == I40E_DEV_ID_QSFP_A || \
+ (d) == I40E_DEV_ID_QSFP_B || \
+ (d) == I40E_DEV_ID_QSFP_C)
+
+#endif /* _I40E_DEVIDS_H_ */
diff --git a/sys/dev/ixl/i40e_hmc.c b/sys/dev/ixl/i40e_hmc.c
index 81cb2ae..513f1d5 100644
--- a/sys/dev/ixl/i40e_hmc.c
+++ b/sys/dev/ixl/i40e_hmc.c
@@ -1,6 +1,6 @@
/******************************************************************************
- Copyright (c) 2013-2014, Intel Corporation
+ Copyright (c) 2013-2015, Intel Corporation
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -130,6 +130,7 @@ exit:
* @hw: pointer to our HW structure
* @hmc_info: pointer to the HMC configuration information structure
* @pd_index: which page descriptor index to manipulate
+ * @rsrc_pg: if not NULL, use preallocated page instead of allocating new one.
*
* This function:
* 1. Initializes the pd entry
@@ -143,12 +144,14 @@ exit:
**/
enum i40e_status_code i40e_add_pd_table_entry(struct i40e_hw *hw,
struct i40e_hmc_info *hmc_info,
- u32 pd_index)
+ u32 pd_index,
+ struct i40e_dma_mem *rsrc_pg)
{
enum i40e_status_code ret_code = I40E_SUCCESS;
struct i40e_hmc_pd_table *pd_table;
struct i40e_hmc_pd_entry *pd_entry;
struct i40e_dma_mem mem;
+ struct i40e_dma_mem *page = &mem;
u32 sd_idx, rel_pd_idx;
u64 *pd_addr;
u64 page_desc;
@@ -169,19 +172,25 @@ enum i40e_status_code i40e_add_pd_table_entry(struct i40e_hw *hw,
pd_table = &hmc_info->sd_table.sd_entry[sd_idx].u.pd_table;
pd_entry = &pd_table->pd_entry[rel_pd_idx];
if (!pd_entry->valid) {
- /* allocate a 4K backing page */
- ret_code = i40e_allocate_dma_mem(hw, &mem, i40e_mem_bp,
- I40E_HMC_PAGED_BP_SIZE,
- I40E_HMC_PD_BP_BUF_ALIGNMENT);
- if (ret_code)
- goto exit;
+ if (rsrc_pg) {
+ pd_entry->rsrc_pg = TRUE;
+ page = rsrc_pg;
+ } else {
+ /* allocate a 4K backing page */
+ ret_code = i40e_allocate_dma_mem(hw, page, i40e_mem_bp,
+ I40E_HMC_PAGED_BP_SIZE,
+ I40E_HMC_PD_BP_BUF_ALIGNMENT);
+ if (ret_code)
+ goto exit;
+ pd_entry->rsrc_pg = FALSE;
+ }
- i40e_memcpy(&pd_entry->bp.addr, &mem,
+ i40e_memcpy(&pd_entry->bp.addr, page,
sizeof(struct i40e_dma_mem), I40E_NONDMA_TO_NONDMA);
pd_entry->bp.sd_pd_index = pd_index;
pd_entry->bp.entry_type = I40E_SD_TYPE_PAGED;
/* Set page address and valid bit */
- page_desc = mem.pa | 0x1;
+ page_desc = page->pa | 0x1;
pd_addr = (u64 *)pd_table->pd_page_addr.va;
pd_addr += rel_pd_idx;
@@ -256,7 +265,8 @@ enum i40e_status_code i40e_remove_pd_bp(struct i40e_hw *hw,
I40E_INVALIDATE_PF_HMC_PD(hw, sd_idx, idx);
/* free memory here */
- ret_code = i40e_free_dma_mem(hw, &(pd_entry->bp.addr));
+ if (!pd_entry->rsrc_pg)
+ ret_code = i40e_free_dma_mem(hw, &(pd_entry->bp.addr));
if (I40E_SUCCESS != ret_code)
goto exit;
if (!pd_table->ref_cnt)
@@ -303,21 +313,15 @@ enum i40e_status_code i40e_remove_sd_bp_new(struct i40e_hw *hw,
u32 idx, bool is_pf)
{
struct i40e_hmc_sd_entry *sd_entry;
- enum i40e_status_code ret_code = I40E_SUCCESS;
+
+ if (!is_pf)
+ return I40E_NOT_SUPPORTED;
/* get the entry and decrease its ref counter */
sd_entry = &hmc_info->sd_table.sd_entry[idx];
- if (is_pf) {
- I40E_CLEAR_PF_SD_ENTRY(hw, idx, I40E_SD_TYPE_DIRECT);
- } else {
- ret_code = I40E_NOT_SUPPORTED;
- goto exit;
- }
- ret_code = i40e_free_dma_mem(hw, &(sd_entry->u.bp.addr));
- if (I40E_SUCCESS != ret_code)
- goto exit;
-exit:
- return ret_code;
+ I40E_CLEAR_PF_SD_ENTRY(hw, idx, I40E_SD_TYPE_DIRECT);
+
+ return i40e_free_dma_mem(hw, &(sd_entry->u.bp.addr));
}
/**
@@ -357,20 +361,13 @@ enum i40e_status_code i40e_remove_pd_page_new(struct i40e_hw *hw,
struct i40e_hmc_info *hmc_info,
u32 idx, bool is_pf)
{
- enum i40e_status_code ret_code = I40E_SUCCESS;
struct i40e_hmc_sd_entry *sd_entry;
+ if (!is_pf)
+ return I40E_NOT_SUPPORTED;
+
sd_entry = &hmc_info->sd_table.sd_entry[idx];
- if (is_pf) {
- I40E_CLEAR_PF_SD_ENTRY(hw, idx, I40E_SD_TYPE_PAGED);
- } else {
- ret_code = I40E_NOT_SUPPORTED;
- goto exit;
- }
- /* free memory here */
- ret_code = i40e_free_dma_mem(hw, &(sd_entry->u.pd_table.pd_page_addr));
- if (I40E_SUCCESS != ret_code)
- goto exit;
-exit:
- return ret_code;
+ I40E_CLEAR_PF_SD_ENTRY(hw, idx, I40E_SD_TYPE_PAGED);
+
+ return i40e_free_dma_mem(hw, &(sd_entry->u.pd_table.pd_page_addr));
}
diff --git a/sys/dev/ixl/i40e_hmc.h b/sys/dev/ixl/i40e_hmc.h
index cba325f..1a9995a 100644
--- a/sys/dev/ixl/i40e_hmc.h
+++ b/sys/dev/ixl/i40e_hmc.h
@@ -1,6 +1,6 @@
/******************************************************************************
- Copyright (c) 2013-2014, Intel Corporation
+ Copyright (c) 2013-2015, Intel Corporation
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -70,6 +70,7 @@ struct i40e_hmc_bp {
struct i40e_hmc_pd_entry {
struct i40e_hmc_bp bp;
u32 sd_index;
+ bool rsrc_pg;
bool valid;
};
@@ -134,8 +135,8 @@ struct i40e_hmc_info {
I40E_PFHMC_SDDATALOW_PMSDBPCOUNT_SHIFT) | \
((((type) == I40E_SD_TYPE_PAGED) ? 0 : 1) << \
I40E_PFHMC_SDDATALOW_PMSDTYPE_SHIFT) | \
- (1 << I40E_PFHMC_SDDATALOW_PMSDVALID_SHIFT); \
- val3 = (sd_index) | (1u << I40E_PFHMC_SDCMD_PMSDWR_SHIFT); \
+ BIT(I40E_PFHMC_SDDATALOW_PMSDVALID_SHIFT); \
+ val3 = (sd_index) | BIT_ULL(I40E_PFHMC_SDCMD_PMSDWR_SHIFT); \
wr32((hw), I40E_PFHMC_SDDATAHIGH, val1); \
wr32((hw), I40E_PFHMC_SDDATALOW, val2); \
wr32((hw), I40E_PFHMC_SDCMD, val3); \
@@ -154,7 +155,7 @@ struct i40e_hmc_info {
I40E_PFHMC_SDDATALOW_PMSDBPCOUNT_SHIFT) | \
((((type) == I40E_SD_TYPE_PAGED) ? 0 : 1) << \
I40E_PFHMC_SDDATALOW_PMSDTYPE_SHIFT); \
- val3 = (sd_index) | (1u << I40E_PFHMC_SDCMD_PMSDWR_SHIFT); \
+ val3 = (sd_index) | BIT_ULL(I40E_PFHMC_SDCMD_PMSDWR_SHIFT); \
wr32((hw), I40E_PFHMC_SDDATAHIGH, 0); \
wr32((hw), I40E_PFHMC_SDDATALOW, val2); \
wr32((hw), I40E_PFHMC_SDCMD, val3); \
@@ -226,7 +227,8 @@ enum i40e_status_code i40e_add_sd_table_entry(struct i40e_hw *hw,
enum i40e_status_code i40e_add_pd_table_entry(struct i40e_hw *hw,
struct i40e_hmc_info *hmc_info,
- u32 pd_index);
+ u32 pd_index,
+ struct i40e_dma_mem *rsrc_pg);
enum i40e_status_code i40e_remove_pd_bp(struct i40e_hw *hw,
struct i40e_hmc_info *hmc_info,
u32 idx);
diff --git a/sys/dev/ixl/i40e_lan_hmc.c b/sys/dev/ixl/i40e_lan_hmc.c
index 0866ad1..f6c9514 100644
--- a/sys/dev/ixl/i40e_lan_hmc.c
+++ b/sys/dev/ixl/i40e_lan_hmc.c
@@ -137,7 +137,7 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
obj->cnt = txq_num;
obj->base = 0;
size_exp = rd32(hw, I40E_GLHMC_LANTXOBJSZ);
- obj->size = (u64)1 << size_exp;
+ obj->size = BIT_ULL(size_exp);
/* validate values requested by driver don't exceed HMC capacity */
if (txq_num > obj->max_cnt) {
@@ -160,7 +160,7 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
hw->hmc.hmc_obj[I40E_HMC_LAN_TX].size);
obj->base = i40e_align_l2obj_base(obj->base);
size_exp = rd32(hw, I40E_GLHMC_LANRXOBJSZ);
- obj->size = (u64)1 << size_exp;
+ obj->size = BIT_ULL(size_exp);
/* validate values requested by driver don't exceed HMC capacity */
if (rxq_num > obj->max_cnt) {
@@ -183,7 +183,7 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
hw->hmc.hmc_obj[I40E_HMC_LAN_RX].size);
obj->base = i40e_align_l2obj_base(obj->base);
size_exp = rd32(hw, I40E_GLHMC_FCOEDDPOBJSZ);
- obj->size = (u64)1 << size_exp;
+ obj->size = BIT_ULL(size_exp);
/* validate values requested by driver don't exceed HMC capacity */
if (fcoe_cntx_num > obj->max_cnt) {
@@ -206,7 +206,7 @@ enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
hw->hmc.hmc_obj[I40E_HMC_FCOE_CTX].size);
obj->base = i40e_align_l2obj_base(obj->base);
size_exp = rd32(hw, I40E_GLHMC_FCOEFOBJSZ);
- obj->size = (u64)1 << size_exp;
+ obj->size = BIT_ULL(size_exp);
/* validate values requested by driver don't exceed HMC capacity */
if (fcoe_filt_num > obj->max_cnt) {
@@ -395,7 +395,7 @@ enum i40e_status_code i40e_create_lan_hmc_object(struct i40e_hw *hw,
/* update the pd table entry */
ret_code = i40e_add_pd_table_entry(hw,
info->hmc_info,
- i);
+ i, NULL);
if (I40E_SUCCESS != ret_code) {
pd_error = TRUE;
break;
@@ -439,9 +439,8 @@ exit_sd_error:
pd_idx1 = max(pd_idx,
((j - 1) * I40E_HMC_MAX_BP_COUNT));
pd_lmt1 = min(pd_lmt, (j * I40E_HMC_MAX_BP_COUNT));
- for (i = pd_idx1; i < pd_lmt1; i++) {
+ for (i = pd_idx1; i < pd_lmt1; i++)
i40e_remove_pd_bp(hw, info->hmc_info, i);
- }
i40e_remove_pd_page(hw, info->hmc_info, (j - 1));
break;
case I40E_SD_TYPE_DIRECT:
@@ -771,7 +770,7 @@ static void i40e_write_byte(u8 *hmc_bits,
/* prepare the bits and mask */
shift_width = ce_info->lsb % 8;
- mask = ((u8)1 << ce_info->width) - 1;
+ mask = BIT(ce_info->width) - 1;
src_byte = *from;
src_byte &= mask;
@@ -812,7 +811,7 @@ static void i40e_write_word(u8 *hmc_bits,
/* prepare the bits and mask */
shift_width = ce_info->lsb % 8;
- mask = ((u16)1 << ce_info->width) - 1;
+ mask = BIT(ce_info->width) - 1;
/* don't swizzle the bits until after the mask because the mask bits
* will be in a different bit position on big endian machines
@@ -862,7 +861,7 @@ static void i40e_write_dword(u8 *hmc_bits,
* to 5 bits so the shift will do nothing
*/
if (ce_info->width < 32)
- mask = ((u32)1 << ce_info->width) - 1;
+ mask = BIT(ce_info->width) - 1;
else
mask = ~(u32)0;
@@ -914,7 +913,7 @@ static void i40e_write_qword(u8 *hmc_bits,
* to 6 bits so the shift will do nothing
*/
if (ce_info->width < 64)
- mask = ((u64)1 << ce_info->width) - 1;
+ mask = BIT_ULL(ce_info->width) - 1;
else
mask = ~(u64)0;
@@ -956,7 +955,7 @@ static void i40e_read_byte(u8 *hmc_bits,
/* prepare the bits and mask */
shift_width = ce_info->lsb % 8;
- mask = ((u8)1 << ce_info->width) - 1;
+ mask = BIT(ce_info->width) - 1;
/* shift to correct alignment */
mask <<= shift_width;
@@ -994,7 +993,7 @@ static void i40e_read_word(u8 *hmc_bits,
/* prepare the bits and mask */
shift_width = ce_info->lsb % 8;
- mask = ((u16)1 << ce_info->width) - 1;
+ mask = BIT(ce_info->width) - 1;
/* shift to correct alignment */
mask <<= shift_width;
@@ -1044,7 +1043,7 @@ static void i40e_read_dword(u8 *hmc_bits,
* to 5 bits so the shift will do nothing
*/
if (ce_info->width < 32)
- mask = ((u32)1 << ce_info->width) - 1;
+ mask = BIT(ce_info->width) - 1;
else
mask = ~(u32)0;
@@ -1097,7 +1096,7 @@ static void i40e_read_qword(u8 *hmc_bits,
* to 6 bits so the shift will do nothing
*/
if (ce_info->width < 64)
- mask = ((u64)1 << ce_info->width) - 1;
+ mask = BIT_ULL(ce_info->width) - 1;
else
mask = ~(u64)0;
diff --git a/sys/dev/ixl/i40e_nvm.c b/sys/dev/ixl/i40e_nvm.c
index 35001a5..5ae7515 100644
--- a/sys/dev/ixl/i40e_nvm.c
+++ b/sys/dev/ixl/i40e_nvm.c
@@ -1,6 +1,6 @@
/******************************************************************************
- Copyright (c) 2013-2014, Intel Corporation
+ Copyright (c) 2013-2015, Intel Corporation
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -72,7 +72,7 @@ enum i40e_status_code i40e_init_nvm(struct i40e_hw *hw)
sr_size = ((gens & I40E_GLNVM_GENS_SR_SIZE_MASK) >>
I40E_GLNVM_GENS_SR_SIZE_SHIFT);
/* Switching to words (sr_size contains power of 2KB) */
- nvm->sr_size = (1 << sr_size) * I40E_SR_WORDS_IN_1KB;
+ nvm->sr_size = BIT(sr_size) * I40E_SR_WORDS_IN_1KB;
/* Check if we are in the normal or blank NVM programming mode */
fla = rd32(hw, I40E_GLNVM_FLA);
@@ -158,10 +158,26 @@ i40e_i40e_acquire_nvm_exit:
**/
void i40e_release_nvm(struct i40e_hw *hw)
{
+ enum i40e_status_code ret_code = I40E_SUCCESS;
+ u32 total_delay = 0;
+
DEBUGFUNC("i40e_release_nvm");
- if (!hw->nvm.blank_nvm_mode)
- i40e_aq_release_resource(hw, I40E_NVM_RESOURCE_ID, 0, NULL);
+ if (hw->nvm.blank_nvm_mode)
+ return;
+
+ ret_code = i40e_aq_release_resource(hw, I40E_NVM_RESOURCE_ID, 0, NULL);
+
+ /* there are some rare cases when trying to release the resource
+ * results in an admin Q timeout, so handle them correctly
+ */
+ while ((ret_code == I40E_ERR_ADMIN_QUEUE_TIMEOUT) &&
+ (total_delay < hw->aq.asq_cmd_timeout)) {
+ i40e_msec_delay(1);
+ ret_code = i40e_aq_release_resource(hw,
+ I40E_NVM_RESOURCE_ID, 0, NULL);
+ total_delay++;
+ }
}
/**
@@ -202,6 +218,10 @@ static enum i40e_status_code i40e_poll_sr_srctl_done_bit(struct i40e_hw *hw)
enum i40e_status_code i40e_read_nvm_word(struct i40e_hw *hw, u16 offset,
u16 *data)
{
+#ifdef X722_SUPPORT
+ if (hw->mac.type == I40E_MAC_X722)
+ return i40e_read_nvm_word_aq(hw, offset, data);
+#endif
return i40e_read_nvm_word_srctl(hw, offset, data);
}
@@ -233,8 +253,8 @@ enum i40e_status_code i40e_read_nvm_word_srctl(struct i40e_hw *hw, u16 offset,
ret_code = i40e_poll_sr_srctl_done_bit(hw);
if (ret_code == I40E_SUCCESS) {
/* Write the address and start reading */
- sr_reg = (u32)(offset << I40E_GLNVM_SRCTL_ADDR_SHIFT) |
- (1 << I40E_GLNVM_SRCTL_START_SHIFT);
+ sr_reg = ((u32)offset << I40E_GLNVM_SRCTL_ADDR_SHIFT) |
+ BIT(I40E_GLNVM_SRCTL_START_SHIFT);
wr32(hw, I40E_GLNVM_SRCTL, sr_reg);
/* Poll I40E_GLNVM_SRCTL until the done bit is set */
@@ -290,6 +310,10 @@ enum i40e_status_code i40e_read_nvm_word_aq(struct i40e_hw *hw, u16 offset,
enum i40e_status_code i40e_read_nvm_buffer(struct i40e_hw *hw, u16 offset,
u16 *words, u16 *data)
{
+#ifdef X722_SUPPORT
+ if (hw->mac.type == I40E_MAC_X722)
+ return i40e_read_nvm_buffer_aq(hw, offset, words, data);
+#endif
return i40e_read_nvm_buffer_srctl(hw, offset, words, data);
}
@@ -401,9 +425,13 @@ enum i40e_status_code i40e_read_nvm_aq(struct i40e_hw *hw, u8 module_pointer,
bool last_command)
{
enum i40e_status_code ret_code = I40E_ERR_NVM;
+ struct i40e_asq_cmd_details cmd_details;
DEBUGFUNC("i40e_read_nvm_aq");
+ memset(&cmd_details, 0, sizeof(cmd_details));
+ cmd_details.wb_desc = &hw->nvm_wb_desc;
+
/* Here we are checking the SR limit only for the flat memory model.
* We cannot do it for the module-based model, as we did not acquire
* the NVM resource yet (we cannot get the module pointer value).
@@ -428,7 +456,7 @@ enum i40e_status_code i40e_read_nvm_aq(struct i40e_hw *hw, u8 module_pointer,
ret_code = i40e_aq_read_nvm(hw, module_pointer,
2 * offset, /*bytes*/
2 * words, /*bytes*/
- data, last_command, NULL);
+ data, last_command, &cmd_details);
return ret_code;
}
@@ -449,9 +477,13 @@ enum i40e_status_code i40e_write_nvm_aq(struct i40e_hw *hw, u8 module_pointer,
bool last_command)
{
enum i40e_status_code ret_code = I40E_ERR_NVM;
+ struct i40e_asq_cmd_details cmd_details;
DEBUGFUNC("i40e_write_nvm_aq");
+ memset(&cmd_details, 0, sizeof(cmd_details));
+ cmd_details.wb_desc = &hw->nvm_wb_desc;
+
/* Here we are checking the SR limit only for the flat memory model.
* We cannot do it for the module-based model, as we did not acquire
* the NVM resource yet (we cannot get the module pointer value).
@@ -470,7 +502,7 @@ enum i40e_status_code i40e_write_nvm_aq(struct i40e_hw *hw, u8 module_pointer,
ret_code = i40e_aq_update_nvm(hw, module_pointer,
2 * offset, /*bytes*/
2 * words, /*bytes*/
- data, last_command, NULL);
+ data, last_command, &cmd_details);
return ret_code;
}
@@ -580,6 +612,7 @@ enum i40e_status_code i40e_calc_nvm_checksum(struct i40e_hw *hw, u16 *checksum)
/* Read SR page */
if ((i % I40E_SR_SECTOR_SIZE_IN_WORDS) == 0) {
u16 words = I40E_SR_SECTOR_SIZE_IN_WORDS;
+
ret_code = i40e_read_nvm_buffer(hw, i, &words, data);
if (ret_code != I40E_SUCCESS) {
ret_code = I40E_ERR_NVM_CHECKSUM;
@@ -625,13 +658,15 @@ enum i40e_status_code i40e_update_nvm_checksum(struct i40e_hw *hw)
{
enum i40e_status_code ret_code = I40E_SUCCESS;
u16 checksum;
+ __le16 le_sum;
DEBUGFUNC("i40e_update_nvm_checksum");
ret_code = i40e_calc_nvm_checksum(hw, &checksum);
+ le_sum = CPU_TO_LE16(checksum);
if (ret_code == I40E_SUCCESS)
ret_code = i40e_write_nvm_aq(hw, 0x00, I40E_SR_SW_CHECKSUM_WORD,
- 1, &checksum, TRUE);
+ 1, &le_sum, TRUE);
return ret_code;
}
diff --git a/sys/dev/ixl/i40e_osdep.h b/sys/dev/ixl/i40e_osdep.h
index 83e8922..67a4b18 100644
--- a/sys/dev/ixl/i40e_osdep.h
+++ b/sys/dev/ixl/i40e_osdep.h
@@ -1,6 +1,6 @@
/******************************************************************************
- Copyright (c) 2013-2014, Intel Corporation
+ Copyright (c) 2013-2015, Intel Corporation
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -112,6 +112,9 @@
#define FIELD_SIZEOF(x, y) (sizeof(((x*)0)->y))
+#define BIT(a) (1UL << (a))
+#define BIT_ULL(a) (1ULL << (a))
+
typedef uint8_t u8;
typedef int8_t s8;
typedef uint16_t u16;
@@ -189,7 +192,7 @@ rd32_osdep(struct i40e_osdep *osdep, uint32_t reg)
{
KASSERT(reg < osdep->mem_bus_space_size,
- ("ixl: register offset %#jx too large (max is %#jx",
+ ("ixl: register offset %#jx too large (max is %#jx)",
(uintmax_t)reg, (uintmax_t)osdep->mem_bus_space_size));
return (bus_space_read_4(osdep->mem_bus_space_tag,
@@ -201,7 +204,7 @@ wr32_osdep(struct i40e_osdep *osdep, uint32_t reg, uint32_t value)
{
KASSERT(reg < osdep->mem_bus_space_size,
- ("ixl: register offset %#jx too large (max is %#jx",
+ ("ixl: register offset %#jx too large (max is %#jx)",
(uintmax_t)reg, (uintmax_t)osdep->mem_bus_space_size));
bus_space_write_4(osdep->mem_bus_space_tag,
@@ -211,7 +214,6 @@ wr32_osdep(struct i40e_osdep *osdep, uint32_t reg, uint32_t value)
static __inline void
ixl_flush_osdep(struct i40e_osdep *osdep)
{
-
rd32_osdep(osdep, osdep->flush_reg);
}
diff --git a/sys/dev/ixl/i40e_prototype.h b/sys/dev/ixl/i40e_prototype.h
index d49b52d..c2395d2 100644
--- a/sys/dev/ixl/i40e_prototype.h
+++ b/sys/dev/ixl/i40e_prototype.h
@@ -78,6 +78,21 @@ void i40e_idle_aq(struct i40e_hw *hw);
void i40e_resume_aq(struct i40e_hw *hw);
bool i40e_check_asq_alive(struct i40e_hw *hw);
enum i40e_status_code i40e_aq_queue_shutdown(struct i40e_hw *hw, bool unloading);
+#ifdef X722_SUPPORT
+
+enum i40e_status_code i40e_aq_get_rss_lut(struct i40e_hw *hw, u16 seid,
+ bool pf_lut, u8 *lut, u16 lut_size);
+enum i40e_status_code i40e_aq_set_rss_lut(struct i40e_hw *hw, u16 seid,
+ bool pf_lut, u8 *lut, u16 lut_size);
+enum i40e_status_code i40e_aq_get_rss_key(struct i40e_hw *hw,
+ u16 seid,
+ struct i40e_aqc_get_set_rss_key_data *key);
+enum i40e_status_code i40e_aq_set_rss_key(struct i40e_hw *hw,
+ u16 seid,
+ struct i40e_aqc_get_set_rss_key_data *key);
+#endif
+char *i40e_aq_str(struct i40e_hw *hw, enum i40e_admin_queue_err aq_err);
+char *i40e_stat_str(struct i40e_hw *hw, enum i40e_status_code stat_err);
u32 i40e_led_get(struct i40e_hw *hw);
@@ -145,6 +160,12 @@ enum i40e_status_code i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,
u16 vsi_id, bool set, struct i40e_asq_cmd_details *cmd_details);
enum i40e_status_code i40e_aq_set_vsi_multicast_promiscuous(struct i40e_hw *hw,
u16 vsi_id, bool set, struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code i40e_aq_set_vsi_mc_promisc_on_vlan(struct i40e_hw *hw,
+ u16 seid, bool enable, u16 vid,
+ struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw,
+ u16 seid, bool enable, u16 vid,
+ struct i40e_asq_cmd_details *cmd_details);
enum i40e_status_code i40e_aq_get_vsi_params(struct i40e_hw *hw,
struct i40e_vsi_context *vsi_ctx,
struct i40e_asq_cmd_details *cmd_details);
@@ -204,6 +225,9 @@ enum i40e_status_code i40e_aq_write_nvm_config(struct i40e_hw *hw,
u8 cmd_flags, void *data, u16 buf_size,
u16 element_count,
struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code i40e_aq_oem_post_update(struct i40e_hw *hw,
+ void *buff, u16 buff_size,
+ struct i40e_asq_cmd_details *cmd_details);
enum i40e_status_code i40e_aq_discover_capabilities(struct i40e_hw *hw,
void *buff, u16 buff_size, u16 *data_size,
enum i40e_admin_queue_opc list_type_opc,
@@ -377,7 +401,8 @@ enum i40e_status_code i40e_init_shared_code(struct i40e_hw *hw);
enum i40e_status_code i40e_pf_reset(struct i40e_hw *hw);
void i40e_clear_hw(struct i40e_hw *hw);
void i40e_clear_pxe_mode(struct i40e_hw *hw);
-bool i40e_get_link_status(struct i40e_hw *hw);
+enum i40e_status_code i40e_get_link_status(struct i40e_hw *hw, bool *link_up);
+enum i40e_status_code i40e_update_link_info(struct i40e_hw *hw);
enum i40e_status_code i40e_get_mac_addr(struct i40e_hw *hw, u8 *mac_addr);
enum i40e_status_code i40e_read_bw_from_alt_ram(struct i40e_hw *hw,
u32 *max_bw, u32 *min_bw, bool *min_valid, bool *max_valid);
@@ -445,4 +470,9 @@ enum i40e_status_code i40e_aq_add_rem_control_packet_filter(struct i40e_hw *hw,
u16 vsi_seid, u16 queue, bool is_add,
struct i40e_control_filter_stats *stats,
struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id,
+ u8 table_id, u32 start_index, u16 buff_size,
+ void *buff, u16 *ret_buff_size,
+ u8 *ret_next_table, u32 *ret_next_index,
+ struct i40e_asq_cmd_details *cmd_details);
#endif /* _I40E_PROTOTYPE_H_ */
diff --git a/sys/dev/ixl/i40e_register.h b/sys/dev/ixl/i40e_register.h
index a8e47b3..adfc744 100644
--- a/sys/dev/ixl/i40e_register.h
+++ b/sys/dev/ixl/i40e_register.h
@@ -1,6 +1,6 @@
/******************************************************************************
- Copyright (c) 2013-2014, Intel Corporation
+ Copyright (c) 2013-2015, Intel Corporation
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -882,6 +882,13 @@
#define I40E_PFINT_CEQCTL_CAUSE_ENA_MASK I40E_MASK(0x1, I40E_PFINT_CEQCTL_CAUSE_ENA_SHIFT)
#define I40E_PFINT_CEQCTL_INTEVENT_SHIFT 31
#define I40E_PFINT_CEQCTL_INTEVENT_MASK I40E_MASK(0x1, I40E_PFINT_CEQCTL_INTEVENT_SHIFT)
+#define I40E_GLINT_CTL 0x0003F800 /* Reset: CORER */
+#define I40E_GLINT_CTL_DIS_AUTOMASK_PF0_SHIFT 0
+#define I40E_GLINT_CTL_DIS_AUTOMASK_PF0_MASK I40E_MASK(0x1, I40E_GLINT_CTL_DIS_AUTOMASK_PF0_SHIFT)
+#define I40E_GLINT_CTL_DIS_AUTOMASK_VF0_SHIFT 1
+#define I40E_GLINT_CTL_DIS_AUTOMASK_VF0_MASK I40E_MASK(0x1, I40E_GLINT_CTL_DIS_AUTOMASK_VF0_SHIFT)
+#define I40E_GLINT_CTL_DIS_AUTOMASK_N_SHIFT 2
+#define I40E_GLINT_CTL_DIS_AUTOMASK_N_MASK I40E_MASK(0x1, I40E_GLINT_CTL_DIS_AUTOMASK_N_SHIFT)
#define I40E_PFINT_DYN_CTL0 0x00038480 /* Reset: PFR */
#define I40E_PFINT_DYN_CTL0_INTENA_SHIFT 0
#define I40E_PFINT_DYN_CTL0_INTENA_MASK I40E_MASK(0x1, I40E_PFINT_DYN_CTL0_INTENA_SHIFT)
@@ -3375,4 +3382,1936 @@
#define I40E_VFQF_HREGION_OVERRIDE_ENA_7_MASK I40E_MASK(0x1, I40E_VFQF_HREGION_OVERRIDE_ENA_7_SHIFT)
#define I40E_VFQF_HREGION_REGION_7_SHIFT 29
#define I40E_VFQF_HREGION_REGION_7_MASK I40E_MASK(0x7, I40E_VFQF_HREGION_REGION_7_SHIFT)
+#ifdef X722_SUPPORT
+
+#define I40E_MNGSB_FDCRC 0x000B7050 /* Reset: POR */
+#define I40E_MNGSB_FDCRC_CRC_RES_SHIFT 0
+#define I40E_MNGSB_FDCRC_CRC_RES_MASK I40E_MASK(0xFF, I40E_MNGSB_FDCRC_CRC_RES_SHIFT)
+#define I40E_MNGSB_FDCS 0x000B7040 /* Reset: POR */
+#define I40E_MNGSB_FDCS_CRC_CONT_SHIFT 2
+#define I40E_MNGSB_FDCS_CRC_CONT_MASK I40E_MASK(0x1, I40E_MNGSB_FDCS_CRC_CONT_SHIFT)
+#define I40E_MNGSB_FDCS_CRC_SEED_EN_SHIFT 3
+#define I40E_MNGSB_FDCS_CRC_SEED_EN_MASK I40E_MASK(0x1, I40E_MNGSB_FDCS_CRC_SEED_EN_SHIFT)
+#define I40E_MNGSB_FDCS_CRC_WR_INH_SHIFT 4
+#define I40E_MNGSB_FDCS_CRC_WR_INH_MASK I40E_MASK(0x1, I40E_MNGSB_FDCS_CRC_WR_INH_SHIFT)
+#define I40E_MNGSB_FDCS_CRC_SEED_SHIFT 8
+#define I40E_MNGSB_FDCS_CRC_SEED_MASK I40E_MASK(0xFF, I40E_MNGSB_FDCS_CRC_SEED_SHIFT)
+#define I40E_MNGSB_FDS 0x000B7048 /* Reset: POR */
+#define I40E_MNGSB_FDS_START_BC_SHIFT 0
+#define I40E_MNGSB_FDS_START_BC_MASK I40E_MASK(0xFFF, I40E_MNGSB_FDS_START_BC_SHIFT)
+#define I40E_MNGSB_FDS_LAST_BC_SHIFT 16
+#define I40E_MNGSB_FDS_LAST_BC_MASK I40E_MASK(0xFFF, I40E_MNGSB_FDS_LAST_BC_SHIFT)
+
+#define I40E_GL_VF_CTRL_RX(_VF) (0x00083600 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: EMPR */
+#define I40E_GL_VF_CTRL_RX_MAX_INDEX 127
+#define I40E_GL_VF_CTRL_RX_AQ_RX_EN_SHIFT 0
+#define I40E_GL_VF_CTRL_RX_AQ_RX_EN_MASK I40E_MASK(0x1, I40E_GL_VF_CTRL_RX_AQ_RX_EN_SHIFT)
+#define I40E_GL_VF_CTRL_TX(_VF) (0x00083400 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: EMPR */
+#define I40E_GL_VF_CTRL_TX_MAX_INDEX 127
+#define I40E_GL_VF_CTRL_TX_AQ_TX_EN_SHIFT 0
+#define I40E_GL_VF_CTRL_TX_AQ_TX_EN_MASK I40E_MASK(0x1, I40E_GL_VF_CTRL_TX_AQ_TX_EN_SHIFT)
+
+#define I40E_GLCM_LAN_CACHESIZE 0x0010C4D8 /* Reset: CORER */
+#define I40E_GLCM_LAN_CACHESIZE_WORD_SIZE_SHIFT 0
+#define I40E_GLCM_LAN_CACHESIZE_WORD_SIZE_MASK I40E_MASK(0xFFF, I40E_GLCM_LAN_CACHESIZE_WORD_SIZE_SHIFT)
+#define I40E_GLCM_LAN_CACHESIZE_SETS_SHIFT 12
+#define I40E_GLCM_LAN_CACHESIZE_SETS_MASK I40E_MASK(0xF, I40E_GLCM_LAN_CACHESIZE_SETS_SHIFT)
+#define I40E_GLCM_LAN_CACHESIZE_WAYS_SHIFT 16
+#define I40E_GLCM_LAN_CACHESIZE_WAYS_MASK I40E_MASK(0x3FF, I40E_GLCM_LAN_CACHESIZE_WAYS_SHIFT)
+#define I40E_GLCM_PE_CACHESIZE 0x00138FE4 /* Reset: CORER */
+#define I40E_GLCM_PE_CACHESIZE_WORD_SIZE_SHIFT 0
+#define I40E_GLCM_PE_CACHESIZE_WORD_SIZE_MASK I40E_MASK(0xFFF, I40E_GLCM_PE_CACHESIZE_WORD_SIZE_SHIFT)
+#define I40E_GLCM_PE_CACHESIZE_SETS_SHIFT 12
+#define I40E_GLCM_PE_CACHESIZE_SETS_MASK I40E_MASK(0xF, I40E_GLCM_PE_CACHESIZE_SETS_SHIFT)
+#define I40E_GLCM_PE_CACHESIZE_WAYS_SHIFT 16
+#define I40E_GLCM_PE_CACHESIZE_WAYS_MASK I40E_MASK(0x1FF, I40E_GLCM_PE_CACHESIZE_WAYS_SHIFT)
+#define I40E_PFCM_PE_ERRDATA 0x00138D00 /* Reset: PFR */
+#define I40E_PFCM_PE_ERRDATA_ERROR_CODE_SHIFT 0
+#define I40E_PFCM_PE_ERRDATA_ERROR_CODE_MASK I40E_MASK(0xF, I40E_PFCM_PE_ERRDATA_ERROR_CODE_SHIFT)
+#define I40E_PFCM_PE_ERRDATA_Q_TYPE_SHIFT 4
+#define I40E_PFCM_PE_ERRDATA_Q_TYPE_MASK I40E_MASK(0x7, I40E_PFCM_PE_ERRDATA_Q_TYPE_SHIFT)
+#define I40E_PFCM_PE_ERRDATA_Q_NUM_SHIFT 8
+#define I40E_PFCM_PE_ERRDATA_Q_NUM_MASK I40E_MASK(0x3FFFF, I40E_PFCM_PE_ERRDATA_Q_NUM_SHIFT)
+#define I40E_PFCM_PE_ERRINFO 0x00138C80 /* Reset: PFR */
+#define I40E_PFCM_PE_ERRINFO_ERROR_VALID_SHIFT 0
+#define I40E_PFCM_PE_ERRINFO_ERROR_VALID_MASK I40E_MASK(0x1, I40E_PFCM_PE_ERRINFO_ERROR_VALID_SHIFT)
+#define I40E_PFCM_PE_ERRINFO_ERROR_INST_SHIFT 4
+#define I40E_PFCM_PE_ERRINFO_ERROR_INST_MASK I40E_MASK(0x7, I40E_PFCM_PE_ERRINFO_ERROR_INST_SHIFT)
+#define I40E_PFCM_PE_ERRINFO_DBL_ERROR_CNT_SHIFT 8
+#define I40E_PFCM_PE_ERRINFO_DBL_ERROR_CNT_MASK I40E_MASK(0xFF, I40E_PFCM_PE_ERRINFO_DBL_ERROR_CNT_SHIFT)
+#define I40E_PFCM_PE_ERRINFO_RLU_ERROR_CNT_SHIFT 16
+#define I40E_PFCM_PE_ERRINFO_RLU_ERROR_CNT_MASK I40E_MASK(0xFF, I40E_PFCM_PE_ERRINFO_RLU_ERROR_CNT_SHIFT)
+#define I40E_PFCM_PE_ERRINFO_RLS_ERROR_CNT_SHIFT 24
+#define I40E_PFCM_PE_ERRINFO_RLS_ERROR_CNT_MASK I40E_MASK(0xFF, I40E_PFCM_PE_ERRINFO_RLS_ERROR_CNT_SHIFT)
+
+#define I40E_PRTDCB_TFMSTC(_i) (0x000A0040 + ((_i) * 32)) /* _i=0...7 */ /* Reset: CORER */
+#define I40E_PRTDCB_TFMSTC_MAX_INDEX 7
+#define I40E_PRTDCB_TFMSTC_MSTC_SHIFT 0
+#define I40E_PRTDCB_TFMSTC_MSTC_MASK I40E_MASK(0xFFFFF, I40E_PRTDCB_TFMSTC_MSTC_SHIFT)
+#define I40E_GL_FWSTS_FWROWD_SHIFT 8
+#define I40E_GL_FWSTS_FWROWD_MASK I40E_MASK(0x1, I40E_GL_FWSTS_FWROWD_SHIFT)
+#define I40E_GLFOC_CACHESIZE 0x000AA0DC /* Reset: CORER */
+#define I40E_GLFOC_CACHESIZE_WORD_SIZE_SHIFT 0
+#define I40E_GLFOC_CACHESIZE_WORD_SIZE_MASK I40E_MASK(0xFF, I40E_GLFOC_CACHESIZE_WORD_SIZE_SHIFT)
+#define I40E_GLFOC_CACHESIZE_SETS_SHIFT 8
+#define I40E_GLFOC_CACHESIZE_SETS_MASK I40E_MASK(0xFFF, I40E_GLFOC_CACHESIZE_SETS_SHIFT)
+#define I40E_GLFOC_CACHESIZE_WAYS_SHIFT 20
+#define I40E_GLFOC_CACHESIZE_WAYS_MASK I40E_MASK(0xF, I40E_GLFOC_CACHESIZE_WAYS_SHIFT)
+#define I40E_GLHMC_APBVTINUSEBASE(_i) (0x000C4a00 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_APBVTINUSEBASE_MAX_INDEX 15
+#define I40E_GLHMC_APBVTINUSEBASE_FPMAPBINUSEBASE_SHIFT 0
+#define I40E_GLHMC_APBVTINUSEBASE_FPMAPBINUSEBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_APBVTINUSEBASE_FPMAPBINUSEBASE_SHIFT)
+#define I40E_GLHMC_CEQPART(_i) (0x001312C0 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_CEQPART_MAX_INDEX 15
+#define I40E_GLHMC_CEQPART_PMCEQBASE_SHIFT 0
+#define I40E_GLHMC_CEQPART_PMCEQBASE_MASK I40E_MASK(0xFF, I40E_GLHMC_CEQPART_PMCEQBASE_SHIFT)
+#define I40E_GLHMC_CEQPART_PMCEQSIZE_SHIFT 16
+#define I40E_GLHMC_CEQPART_PMCEQSIZE_MASK I40E_MASK(0x1FF, I40E_GLHMC_CEQPART_PMCEQSIZE_SHIFT)
+#define I40E_GLHMC_DBCQMAX 0x000C20F0 /* Reset: CORER */
+#define I40E_GLHMC_DBCQMAX_GLHMC_DBCQMAX_SHIFT 0
+#define I40E_GLHMC_DBCQMAX_GLHMC_DBCQMAX_MASK I40E_MASK(0x3FFFF, I40E_GLHMC_DBCQMAX_GLHMC_DBCQMAX_SHIFT)
+#define I40E_GLHMC_DBCQPART(_i) (0x00131240 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_DBCQPART_MAX_INDEX 15
+#define I40E_GLHMC_DBCQPART_PMDBCQBASE_SHIFT 0
+#define I40E_GLHMC_DBCQPART_PMDBCQBASE_MASK I40E_MASK(0x3FFF, I40E_GLHMC_DBCQPART_PMDBCQBASE_SHIFT)
+#define I40E_GLHMC_DBCQPART_PMDBCQSIZE_SHIFT 16
+#define I40E_GLHMC_DBCQPART_PMDBCQSIZE_MASK I40E_MASK(0x7FFF, I40E_GLHMC_DBCQPART_PMDBCQSIZE_SHIFT)
+#define I40E_GLHMC_DBQPMAX 0x000C20EC /* Reset: CORER */
+#define I40E_GLHMC_DBQPMAX_GLHMC_DBQPMAX_SHIFT 0
+#define I40E_GLHMC_DBQPMAX_GLHMC_DBQPMAX_MASK I40E_MASK(0x7FFFF, I40E_GLHMC_DBQPMAX_GLHMC_DBQPMAX_SHIFT)
+#define I40E_GLHMC_DBQPPART(_i) (0x00138D80 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_DBQPPART_MAX_INDEX 15
+#define I40E_GLHMC_DBQPPART_PMDBQPBASE_SHIFT 0
+#define I40E_GLHMC_DBQPPART_PMDBQPBASE_MASK I40E_MASK(0x3FFF, I40E_GLHMC_DBQPPART_PMDBQPBASE_SHIFT)
+#define I40E_GLHMC_DBQPPART_PMDBQPSIZE_SHIFT 16
+#define I40E_GLHMC_DBQPPART_PMDBQPSIZE_MASK I40E_MASK(0x7FFF, I40E_GLHMC_DBQPPART_PMDBQPSIZE_SHIFT)
+#define I40E_GLHMC_PEARPBASE(_i) (0x000C4800 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_PEARPBASE_MAX_INDEX 15
+#define I40E_GLHMC_PEARPBASE_FPMPEARPBASE_SHIFT 0
+#define I40E_GLHMC_PEARPBASE_FPMPEARPBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_PEARPBASE_FPMPEARPBASE_SHIFT)
+#define I40E_GLHMC_PEARPCNT(_i) (0x000C4900 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_PEARPCNT_MAX_INDEX 15
+#define I40E_GLHMC_PEARPCNT_FPMPEARPCNT_SHIFT 0
+#define I40E_GLHMC_PEARPCNT_FPMPEARPCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_PEARPCNT_FPMPEARPCNT_SHIFT)
+#define I40E_GLHMC_PEARPMAX 0x000C2038 /* Reset: CORER */
+#define I40E_GLHMC_PEARPMAX_PMPEARPMAX_SHIFT 0
+#define I40E_GLHMC_PEARPMAX_PMPEARPMAX_MASK I40E_MASK(0x1FFFF, I40E_GLHMC_PEARPMAX_PMPEARPMAX_SHIFT)
+#define I40E_GLHMC_PEARPOBJSZ 0x000C2034 /* Reset: CORER */
+#define I40E_GLHMC_PEARPOBJSZ_PMPEARPOBJSZ_SHIFT 0
+#define I40E_GLHMC_PEARPOBJSZ_PMPEARPOBJSZ_MASK I40E_MASK(0x7, I40E_GLHMC_PEARPOBJSZ_PMPEARPOBJSZ_SHIFT)
+#define I40E_GLHMC_PECQBASE(_i) (0x000C4200 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_PECQBASE_MAX_INDEX 15
+#define I40E_GLHMC_PECQBASE_FPMPECQBASE_SHIFT 0
+#define I40E_GLHMC_PECQBASE_FPMPECQBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_PECQBASE_FPMPECQBASE_SHIFT)
+#define I40E_GLHMC_PECQCNT(_i) (0x000C4300 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_PECQCNT_MAX_INDEX 15
+#define I40E_GLHMC_PECQCNT_FPMPECQCNT_SHIFT 0
+#define I40E_GLHMC_PECQCNT_FPMPECQCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_PECQCNT_FPMPECQCNT_SHIFT)
+#define I40E_GLHMC_PECQOBJSZ 0x000C2020 /* Reset: CORER */
+#define I40E_GLHMC_PECQOBJSZ_PMPECQOBJSZ_SHIFT 0
+#define I40E_GLHMC_PECQOBJSZ_PMPECQOBJSZ_MASK I40E_MASK(0xF, I40E_GLHMC_PECQOBJSZ_PMPECQOBJSZ_SHIFT)
+#define I40E_GLHMC_PEHTCNT(_i) (0x000C4700 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_PEHTCNT_MAX_INDEX 15
+#define I40E_GLHMC_PEHTCNT_FPMPEHTCNT_SHIFT 0
+#define I40E_GLHMC_PEHTCNT_FPMPEHTCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_PEHTCNT_FPMPEHTCNT_SHIFT)
+#define I40E_GLHMC_PEHTEBASE(_i) (0x000C4600 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_PEHTEBASE_MAX_INDEX 15
+#define I40E_GLHMC_PEHTEBASE_FPMPEHTEBASE_SHIFT 0
+#define I40E_GLHMC_PEHTEBASE_FPMPEHTEBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_PEHTEBASE_FPMPEHTEBASE_SHIFT)
+#define I40E_GLHMC_PEHTEOBJSZ 0x000C202c /* Reset: CORER */
+#define I40E_GLHMC_PEHTEOBJSZ_PMPEHTEOBJSZ_SHIFT 0
+#define I40E_GLHMC_PEHTEOBJSZ_PMPEHTEOBJSZ_MASK I40E_MASK(0xF, I40E_GLHMC_PEHTEOBJSZ_PMPEHTEOBJSZ_SHIFT)
+#define I40E_GLHMC_PEHTMAX 0x000C2030 /* Reset: CORER */
+#define I40E_GLHMC_PEHTMAX_PMPEHTMAX_SHIFT 0
+#define I40E_GLHMC_PEHTMAX_PMPEHTMAX_MASK I40E_MASK(0x1FFFFF, I40E_GLHMC_PEHTMAX_PMPEHTMAX_SHIFT)
+#define I40E_GLHMC_PEMRBASE(_i) (0x000C4c00 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_PEMRBASE_MAX_INDEX 15
+#define I40E_GLHMC_PEMRBASE_FPMPEMRBASE_SHIFT 0
+#define I40E_GLHMC_PEMRBASE_FPMPEMRBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_PEMRBASE_FPMPEMRBASE_SHIFT)
+#define I40E_GLHMC_PEMRCNT(_i) (0x000C4d00 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_PEMRCNT_MAX_INDEX 15
+#define I40E_GLHMC_PEMRCNT_FPMPEMRSZ_SHIFT 0
+#define I40E_GLHMC_PEMRCNT_FPMPEMRSZ_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_PEMRCNT_FPMPEMRSZ_SHIFT)
+#define I40E_GLHMC_PEMRMAX 0x000C2040 /* Reset: CORER */
+#define I40E_GLHMC_PEMRMAX_PMPEMRMAX_SHIFT 0
+#define I40E_GLHMC_PEMRMAX_PMPEMRMAX_MASK I40E_MASK(0x7FFFFF, I40E_GLHMC_PEMRMAX_PMPEMRMAX_SHIFT)
+#define I40E_GLHMC_PEMROBJSZ 0x000C203c /* Reset: CORER */
+#define I40E_GLHMC_PEMROBJSZ_PMPEMROBJSZ_SHIFT 0
+#define I40E_GLHMC_PEMROBJSZ_PMPEMROBJSZ_MASK I40E_MASK(0xF, I40E_GLHMC_PEMROBJSZ_PMPEMROBJSZ_SHIFT)
+#define I40E_GLHMC_PEPBLBASE(_i) (0x000C5800 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_PEPBLBASE_MAX_INDEX 15
+#define I40E_GLHMC_PEPBLBASE_FPMPEPBLBASE_SHIFT 0
+#define I40E_GLHMC_PEPBLBASE_FPMPEPBLBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_PEPBLBASE_FPMPEPBLBASE_SHIFT)
+#define I40E_GLHMC_PEPBLCNT(_i) (0x000C5900 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_PEPBLCNT_MAX_INDEX 15
+#define I40E_GLHMC_PEPBLCNT_FPMPEPBLCNT_SHIFT 0
+#define I40E_GLHMC_PEPBLCNT_FPMPEPBLCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_PEPBLCNT_FPMPEPBLCNT_SHIFT)
+#define I40E_GLHMC_PEPBLMAX 0x000C206c /* Reset: CORER */
+#define I40E_GLHMC_PEPBLMAX_PMPEPBLMAX_SHIFT 0
+#define I40E_GLHMC_PEPBLMAX_PMPEPBLMAX_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_PEPBLMAX_PMPEPBLMAX_SHIFT)
+#define I40E_GLHMC_PEPFFIRSTSD 0x000C20E4 /* Reset: CORER */
+#define I40E_GLHMC_PEPFFIRSTSD_GLHMC_PEPFFIRSTSD_SHIFT 0
+#define I40E_GLHMC_PEPFFIRSTSD_GLHMC_PEPFFIRSTSD_MASK I40E_MASK(0xFFF, I40E_GLHMC_PEPFFIRSTSD_GLHMC_PEPFFIRSTSD_SHIFT)
+#define I40E_GLHMC_PEQ1BASE(_i) (0x000C5200 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_PEQ1BASE_MAX_INDEX 15
+#define I40E_GLHMC_PEQ1BASE_FPMPEQ1BASE_SHIFT 0
+#define I40E_GLHMC_PEQ1BASE_FPMPEQ1BASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_PEQ1BASE_FPMPEQ1BASE_SHIFT)
+#define I40E_GLHMC_PEQ1CNT(_i) (0x000C5300 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_PEQ1CNT_MAX_INDEX 15
+#define I40E_GLHMC_PEQ1CNT_FPMPEQ1CNT_SHIFT 0
+#define I40E_GLHMC_PEQ1CNT_FPMPEQ1CNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_PEQ1CNT_FPMPEQ1CNT_SHIFT)
+#define I40E_GLHMC_PEQ1FLBASE(_i) (0x000C5400 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_PEQ1FLBASE_MAX_INDEX 15
+#define I40E_GLHMC_PEQ1FLBASE_FPMPEQ1FLBASE_SHIFT 0
+#define I40E_GLHMC_PEQ1FLBASE_FPMPEQ1FLBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_PEQ1FLBASE_FPMPEQ1FLBASE_SHIFT)
+#define I40E_GLHMC_PEQ1FLMAX 0x000C2058 /* Reset: CORER */
+#define I40E_GLHMC_PEQ1FLMAX_PMPEQ1FLMAX_SHIFT 0
+#define I40E_GLHMC_PEQ1FLMAX_PMPEQ1FLMAX_MASK I40E_MASK(0x3FFFFFF, I40E_GLHMC_PEQ1FLMAX_PMPEQ1FLMAX_SHIFT)
+#define I40E_GLHMC_PEQ1MAX 0x000C2054 /* Reset: CORER */
+#define I40E_GLHMC_PEQ1MAX_PMPEQ1MAX_SHIFT 0
+#define I40E_GLHMC_PEQ1MAX_PMPEQ1MAX_MASK I40E_MASK(0x3FFFFFF, I40E_GLHMC_PEQ1MAX_PMPEQ1MAX_SHIFT)
+#define I40E_GLHMC_PEQ1OBJSZ 0x000C2050 /* Reset: CORER */
+#define I40E_GLHMC_PEQ1OBJSZ_PMPEQ1OBJSZ_SHIFT 0
+#define I40E_GLHMC_PEQ1OBJSZ_PMPEQ1OBJSZ_MASK I40E_MASK(0xF, I40E_GLHMC_PEQ1OBJSZ_PMPEQ1OBJSZ_SHIFT)
+#define I40E_GLHMC_PEQPBASE(_i) (0x000C4000 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_PEQPBASE_MAX_INDEX 15
+#define I40E_GLHMC_PEQPBASE_FPMPEQPBASE_SHIFT 0
+#define I40E_GLHMC_PEQPBASE_FPMPEQPBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_PEQPBASE_FPMPEQPBASE_SHIFT)
+#define I40E_GLHMC_PEQPCNT(_i) (0x000C4100 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_PEQPCNT_MAX_INDEX 15
+#define I40E_GLHMC_PEQPCNT_FPMPEQPCNT_SHIFT 0
+#define I40E_GLHMC_PEQPCNT_FPMPEQPCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_PEQPCNT_FPMPEQPCNT_SHIFT)
+#define I40E_GLHMC_PEQPOBJSZ 0x000C201c /* Reset: CORER */
+#define I40E_GLHMC_PEQPOBJSZ_PMPEQPOBJSZ_SHIFT 0
+#define I40E_GLHMC_PEQPOBJSZ_PMPEQPOBJSZ_MASK I40E_MASK(0xF, I40E_GLHMC_PEQPOBJSZ_PMPEQPOBJSZ_SHIFT)
+#define I40E_GLHMC_PESRQBASE(_i) (0x000C4400 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_PESRQBASE_MAX_INDEX 15
+#define I40E_GLHMC_PESRQBASE_FPMPESRQBASE_SHIFT 0
+#define I40E_GLHMC_PESRQBASE_FPMPESRQBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_PESRQBASE_FPMPESRQBASE_SHIFT)
+#define I40E_GLHMC_PESRQCNT(_i) (0x000C4500 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_PESRQCNT_MAX_INDEX 15
+#define I40E_GLHMC_PESRQCNT_FPMPESRQCNT_SHIFT 0
+#define I40E_GLHMC_PESRQCNT_FPMPESRQCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_PESRQCNT_FPMPESRQCNT_SHIFT)
+#define I40E_GLHMC_PESRQMAX 0x000C2028 /* Reset: CORER */
+#define I40E_GLHMC_PESRQMAX_PMPESRQMAX_SHIFT 0
+#define I40E_GLHMC_PESRQMAX_PMPESRQMAX_MASK I40E_MASK(0xFFFF, I40E_GLHMC_PESRQMAX_PMPESRQMAX_SHIFT)
+#define I40E_GLHMC_PESRQOBJSZ 0x000C2024 /* Reset: CORER */
+#define I40E_GLHMC_PESRQOBJSZ_PMPESRQOBJSZ_SHIFT 0
+#define I40E_GLHMC_PESRQOBJSZ_PMPESRQOBJSZ_MASK I40E_MASK(0xF, I40E_GLHMC_PESRQOBJSZ_PMPESRQOBJSZ_SHIFT)
+#define I40E_GLHMC_PETIMERBASE(_i) (0x000C5A00 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_PETIMERBASE_MAX_INDEX 15
+#define I40E_GLHMC_PETIMERBASE_FPMPETIMERBASE_SHIFT 0
+#define I40E_GLHMC_PETIMERBASE_FPMPETIMERBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_PETIMERBASE_FPMPETIMERBASE_SHIFT)
+#define I40E_GLHMC_PETIMERCNT(_i) (0x000C5B00 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_PETIMERCNT_MAX_INDEX 15
+#define I40E_GLHMC_PETIMERCNT_FPMPETIMERCNT_SHIFT 0
+#define I40E_GLHMC_PETIMERCNT_FPMPETIMERCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_PETIMERCNT_FPMPETIMERCNT_SHIFT)
+#define I40E_GLHMC_PETIMERMAX 0x000C2084 /* Reset: CORER */
+#define I40E_GLHMC_PETIMERMAX_PMPETIMERMAX_SHIFT 0
+#define I40E_GLHMC_PETIMERMAX_PMPETIMERMAX_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_PETIMERMAX_PMPETIMERMAX_SHIFT)
+#define I40E_GLHMC_PETIMEROBJSZ 0x000C2080 /* Reset: CORER */
+#define I40E_GLHMC_PETIMEROBJSZ_PMPETIMEROBJSZ_SHIFT 0
+#define I40E_GLHMC_PETIMEROBJSZ_PMPETIMEROBJSZ_MASK I40E_MASK(0xF, I40E_GLHMC_PETIMEROBJSZ_PMPETIMEROBJSZ_SHIFT)
+#define I40E_GLHMC_PEXFBASE(_i) (0x000C4e00 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_PEXFBASE_MAX_INDEX 15
+#define I40E_GLHMC_PEXFBASE_FPMPEXFBASE_SHIFT 0
+#define I40E_GLHMC_PEXFBASE_FPMPEXFBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_PEXFBASE_FPMPEXFBASE_SHIFT)
+#define I40E_GLHMC_PEXFCNT(_i) (0x000C4f00 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_PEXFCNT_MAX_INDEX 15
+#define I40E_GLHMC_PEXFCNT_FPMPEXFCNT_SHIFT 0
+#define I40E_GLHMC_PEXFCNT_FPMPEXFCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_PEXFCNT_FPMPEXFCNT_SHIFT)
+#define I40E_GLHMC_PEXFFLBASE(_i) (0x000C5000 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_PEXFFLBASE_MAX_INDEX 15
+#define I40E_GLHMC_PEXFFLBASE_FPMPEXFFLBASE_SHIFT 0
+#define I40E_GLHMC_PEXFFLBASE_FPMPEXFFLBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_PEXFFLBASE_FPMPEXFFLBASE_SHIFT)
+#define I40E_GLHMC_PEXFFLMAX 0x000C204c /* Reset: CORER */
+#define I40E_GLHMC_PEXFFLMAX_PMPEXFFLMAX_SHIFT 0
+#define I40E_GLHMC_PEXFFLMAX_PMPEXFFLMAX_MASK I40E_MASK(0x1FFFFFF, I40E_GLHMC_PEXFFLMAX_PMPEXFFLMAX_SHIFT)
+#define I40E_GLHMC_PEXFMAX 0x000C2048 /* Reset: CORER */
+#define I40E_GLHMC_PEXFMAX_PMPEXFMAX_SHIFT 0
+#define I40E_GLHMC_PEXFMAX_PMPEXFMAX_MASK I40E_MASK(0x3FFFFFF, I40E_GLHMC_PEXFMAX_PMPEXFMAX_SHIFT)
+#define I40E_GLHMC_PEXFOBJSZ 0x000C2044 /* Reset: CORER */
+#define I40E_GLHMC_PEXFOBJSZ_PMPEXFOBJSZ_SHIFT 0
+#define I40E_GLHMC_PEXFOBJSZ_PMPEXFOBJSZ_MASK I40E_MASK(0xF, I40E_GLHMC_PEXFOBJSZ_PMPEXFOBJSZ_SHIFT)
+#define I40E_GLHMC_PFPESDPART(_i) (0x000C0880 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLHMC_PFPESDPART_MAX_INDEX 15
+#define I40E_GLHMC_PFPESDPART_PMSDBASE_SHIFT 0
+#define I40E_GLHMC_PFPESDPART_PMSDBASE_MASK I40E_MASK(0xFFF, I40E_GLHMC_PFPESDPART_PMSDBASE_SHIFT)
+#define I40E_GLHMC_PFPESDPART_PMSDSIZE_SHIFT 16
+#define I40E_GLHMC_PFPESDPART_PMSDSIZE_MASK I40E_MASK(0x1FFF, I40E_GLHMC_PFPESDPART_PMSDSIZE_SHIFT)
+#define I40E_GLHMC_VFAPBVTINUSEBASE(_i) (0x000Cca00 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFAPBVTINUSEBASE_MAX_INDEX 31
+#define I40E_GLHMC_VFAPBVTINUSEBASE_FPMAPBINUSEBASE_SHIFT 0
+#define I40E_GLHMC_VFAPBVTINUSEBASE_FPMAPBINUSEBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFAPBVTINUSEBASE_FPMAPBINUSEBASE_SHIFT)
+#define I40E_GLHMC_VFCEQPART(_i) (0x00132240 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFCEQPART_MAX_INDEX 31
+#define I40E_GLHMC_VFCEQPART_PMCEQBASE_SHIFT 0
+#define I40E_GLHMC_VFCEQPART_PMCEQBASE_MASK I40E_MASK(0xFF, I40E_GLHMC_VFCEQPART_PMCEQBASE_SHIFT)
+#define I40E_GLHMC_VFCEQPART_PMCEQSIZE_SHIFT 16
+#define I40E_GLHMC_VFCEQPART_PMCEQSIZE_MASK I40E_MASK(0x1FF, I40E_GLHMC_VFCEQPART_PMCEQSIZE_SHIFT)
+#define I40E_GLHMC_VFDBCQPART(_i) (0x00132140 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFDBCQPART_MAX_INDEX 31
+#define I40E_GLHMC_VFDBCQPART_PMDBCQBASE_SHIFT 0
+#define I40E_GLHMC_VFDBCQPART_PMDBCQBASE_MASK I40E_MASK(0x3FFF, I40E_GLHMC_VFDBCQPART_PMDBCQBASE_SHIFT)
+#define I40E_GLHMC_VFDBCQPART_PMDBCQSIZE_SHIFT 16
+#define I40E_GLHMC_VFDBCQPART_PMDBCQSIZE_MASK I40E_MASK(0x7FFF, I40E_GLHMC_VFDBCQPART_PMDBCQSIZE_SHIFT)
+#define I40E_GLHMC_VFDBQPPART(_i) (0x00138E00 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFDBQPPART_MAX_INDEX 31
+#define I40E_GLHMC_VFDBQPPART_PMDBQPBASE_SHIFT 0
+#define I40E_GLHMC_VFDBQPPART_PMDBQPBASE_MASK I40E_MASK(0x3FFF, I40E_GLHMC_VFDBQPPART_PMDBQPBASE_SHIFT)
+#define I40E_GLHMC_VFDBQPPART_PMDBQPSIZE_SHIFT 16
+#define I40E_GLHMC_VFDBQPPART_PMDBQPSIZE_MASK I40E_MASK(0x7FFF, I40E_GLHMC_VFDBQPPART_PMDBQPSIZE_SHIFT)
+#define I40E_GLHMC_VFFSIAVBASE(_i) (0x000Cd600 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFFSIAVBASE_MAX_INDEX 31
+#define I40E_GLHMC_VFFSIAVBASE_FPMFSIAVBASE_SHIFT 0
+#define I40E_GLHMC_VFFSIAVBASE_FPMFSIAVBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFFSIAVBASE_FPMFSIAVBASE_SHIFT)
+#define I40E_GLHMC_VFFSIAVCNT(_i) (0x000Cd700 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFFSIAVCNT_MAX_INDEX 31
+#define I40E_GLHMC_VFFSIAVCNT_FPMFSIAVCNT_SHIFT 0
+#define I40E_GLHMC_VFFSIAVCNT_FPMFSIAVCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_VFFSIAVCNT_FPMFSIAVCNT_SHIFT)
+#define I40E_GLHMC_VFPDINV(_i) (0x000C8300 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFPDINV_MAX_INDEX 31
+#define I40E_GLHMC_VFPDINV_PMSDIDX_SHIFT 0
+#define I40E_GLHMC_VFPDINV_PMSDIDX_MASK I40E_MASK(0xFFF, I40E_GLHMC_VFPDINV_PMSDIDX_SHIFT)
+#define I40E_GLHMC_VFPDINV_PMSDPARTSEL_SHIFT 15
+#define I40E_GLHMC_VFPDINV_PMSDPARTSEL_MASK I40E_MASK(0x1, I40E_GLHMC_VFPDINV_PMSDPARTSEL_SHIFT)
+#define I40E_GLHMC_VFPDINV_PMPDIDX_SHIFT 16
+#define I40E_GLHMC_VFPDINV_PMPDIDX_MASK I40E_MASK(0x1FF, I40E_GLHMC_VFPDINV_PMPDIDX_SHIFT)
+#define I40E_GLHMC_VFPEARPBASE(_i) (0x000Cc800 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFPEARPBASE_MAX_INDEX 31
+#define I40E_GLHMC_VFPEARPBASE_FPMPEARPBASE_SHIFT 0
+#define I40E_GLHMC_VFPEARPBASE_FPMPEARPBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFPEARPBASE_FPMPEARPBASE_SHIFT)
+#define I40E_GLHMC_VFPEARPCNT(_i) (0x000Cc900 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFPEARPCNT_MAX_INDEX 31
+#define I40E_GLHMC_VFPEARPCNT_FPMPEARPCNT_SHIFT 0
+#define I40E_GLHMC_VFPEARPCNT_FPMPEARPCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_VFPEARPCNT_FPMPEARPCNT_SHIFT)
+#define I40E_GLHMC_VFPECQBASE(_i) (0x000Cc200 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFPECQBASE_MAX_INDEX 31
+#define I40E_GLHMC_VFPECQBASE_FPMPECQBASE_SHIFT 0
+#define I40E_GLHMC_VFPECQBASE_FPMPECQBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFPECQBASE_FPMPECQBASE_SHIFT)
+#define I40E_GLHMC_VFPECQCNT(_i) (0x000Cc300 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFPECQCNT_MAX_INDEX 31
+#define I40E_GLHMC_VFPECQCNT_FPMPECQCNT_SHIFT 0
+#define I40E_GLHMC_VFPECQCNT_FPMPECQCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_VFPECQCNT_FPMPECQCNT_SHIFT)
+#define I40E_GLHMC_VFPEHTCNT(_i) (0x000Cc700 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFPEHTCNT_MAX_INDEX 31
+#define I40E_GLHMC_VFPEHTCNT_FPMPEHTCNT_SHIFT 0
+#define I40E_GLHMC_VFPEHTCNT_FPMPEHTCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_VFPEHTCNT_FPMPEHTCNT_SHIFT)
+#define I40E_GLHMC_VFPEHTEBASE(_i) (0x000Cc600 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFPEHTEBASE_MAX_INDEX 31
+#define I40E_GLHMC_VFPEHTEBASE_FPMPEHTEBASE_SHIFT 0
+#define I40E_GLHMC_VFPEHTEBASE_FPMPEHTEBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFPEHTEBASE_FPMPEHTEBASE_SHIFT)
+#define I40E_GLHMC_VFPEMRBASE(_i) (0x000Ccc00 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFPEMRBASE_MAX_INDEX 31
+#define I40E_GLHMC_VFPEMRBASE_FPMPEMRBASE_SHIFT 0
+#define I40E_GLHMC_VFPEMRBASE_FPMPEMRBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFPEMRBASE_FPMPEMRBASE_SHIFT)
+#define I40E_GLHMC_VFPEMRCNT(_i) (0x000Ccd00 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFPEMRCNT_MAX_INDEX 31
+#define I40E_GLHMC_VFPEMRCNT_FPMPEMRSZ_SHIFT 0
+#define I40E_GLHMC_VFPEMRCNT_FPMPEMRSZ_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_VFPEMRCNT_FPMPEMRSZ_SHIFT)
+#define I40E_GLHMC_VFPEPBLBASE(_i) (0x000Cd800 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFPEPBLBASE_MAX_INDEX 31
+#define I40E_GLHMC_VFPEPBLBASE_FPMPEPBLBASE_SHIFT 0
+#define I40E_GLHMC_VFPEPBLBASE_FPMPEPBLBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFPEPBLBASE_FPMPEPBLBASE_SHIFT)
+#define I40E_GLHMC_VFPEPBLCNT(_i) (0x000Cd900 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFPEPBLCNT_MAX_INDEX 31
+#define I40E_GLHMC_VFPEPBLCNT_FPMPEPBLCNT_SHIFT 0
+#define I40E_GLHMC_VFPEPBLCNT_FPMPEPBLCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_VFPEPBLCNT_FPMPEPBLCNT_SHIFT)
+#define I40E_GLHMC_VFPEQ1BASE(_i) (0x000Cd200 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFPEQ1BASE_MAX_INDEX 31
+#define I40E_GLHMC_VFPEQ1BASE_FPMPEQ1BASE_SHIFT 0
+#define I40E_GLHMC_VFPEQ1BASE_FPMPEQ1BASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFPEQ1BASE_FPMPEQ1BASE_SHIFT)
+#define I40E_GLHMC_VFPEQ1CNT(_i) (0x000Cd300 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFPEQ1CNT_MAX_INDEX 31
+#define I40E_GLHMC_VFPEQ1CNT_FPMPEQ1CNT_SHIFT 0
+#define I40E_GLHMC_VFPEQ1CNT_FPMPEQ1CNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_VFPEQ1CNT_FPMPEQ1CNT_SHIFT)
+#define I40E_GLHMC_VFPEQ1FLBASE(_i) (0x000Cd400 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFPEQ1FLBASE_MAX_INDEX 31
+#define I40E_GLHMC_VFPEQ1FLBASE_FPMPEQ1FLBASE_SHIFT 0
+#define I40E_GLHMC_VFPEQ1FLBASE_FPMPEQ1FLBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFPEQ1FLBASE_FPMPEQ1FLBASE_SHIFT)
+#define I40E_GLHMC_VFPEQPBASE(_i) (0x000Cc000 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFPEQPBASE_MAX_INDEX 31
+#define I40E_GLHMC_VFPEQPBASE_FPMPEQPBASE_SHIFT 0
+#define I40E_GLHMC_VFPEQPBASE_FPMPEQPBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFPEQPBASE_FPMPEQPBASE_SHIFT)
+#define I40E_GLHMC_VFPEQPCNT(_i) (0x000Cc100 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFPEQPCNT_MAX_INDEX 31
+#define I40E_GLHMC_VFPEQPCNT_FPMPEQPCNT_SHIFT 0
+#define I40E_GLHMC_VFPEQPCNT_FPMPEQPCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_VFPEQPCNT_FPMPEQPCNT_SHIFT)
+#define I40E_GLHMC_VFPESRQBASE(_i) (0x000Cc400 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFPESRQBASE_MAX_INDEX 31
+#define I40E_GLHMC_VFPESRQBASE_FPMPESRQBASE_SHIFT 0
+#define I40E_GLHMC_VFPESRQBASE_FPMPESRQBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFPESRQBASE_FPMPESRQBASE_SHIFT)
+#define I40E_GLHMC_VFPESRQCNT(_i) (0x000Cc500 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFPESRQCNT_MAX_INDEX 31
+#define I40E_GLHMC_VFPESRQCNT_FPMPESRQCNT_SHIFT 0
+#define I40E_GLHMC_VFPESRQCNT_FPMPESRQCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_VFPESRQCNT_FPMPESRQCNT_SHIFT)
+#define I40E_GLHMC_VFPETIMERBASE(_i) (0x000CDA00 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFPETIMERBASE_MAX_INDEX 31
+#define I40E_GLHMC_VFPETIMERBASE_FPMPETIMERBASE_SHIFT 0
+#define I40E_GLHMC_VFPETIMERBASE_FPMPETIMERBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFPETIMERBASE_FPMPETIMERBASE_SHIFT)
+#define I40E_GLHMC_VFPETIMERCNT(_i) (0x000CDB00 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFPETIMERCNT_MAX_INDEX 31
+#define I40E_GLHMC_VFPETIMERCNT_FPMPETIMERCNT_SHIFT 0
+#define I40E_GLHMC_VFPETIMERCNT_FPMPETIMERCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_VFPETIMERCNT_FPMPETIMERCNT_SHIFT)
+#define I40E_GLHMC_VFPEXFBASE(_i) (0x000Cce00 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFPEXFBASE_MAX_INDEX 31
+#define I40E_GLHMC_VFPEXFBASE_FPMPEXFBASE_SHIFT 0
+#define I40E_GLHMC_VFPEXFBASE_FPMPEXFBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFPEXFBASE_FPMPEXFBASE_SHIFT)
+#define I40E_GLHMC_VFPEXFCNT(_i) (0x000Ccf00 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFPEXFCNT_MAX_INDEX 31
+#define I40E_GLHMC_VFPEXFCNT_FPMPEXFCNT_SHIFT 0
+#define I40E_GLHMC_VFPEXFCNT_FPMPEXFCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_VFPEXFCNT_FPMPEXFCNT_SHIFT)
+#define I40E_GLHMC_VFPEXFFLBASE(_i) (0x000Cd000 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFPEXFFLBASE_MAX_INDEX 31
+#define I40E_GLHMC_VFPEXFFLBASE_FPMPEXFFLBASE_SHIFT 0
+#define I40E_GLHMC_VFPEXFFLBASE_FPMPEXFFLBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFPEXFFLBASE_FPMPEXFFLBASE_SHIFT)
+#define I40E_GLHMC_VFSDPART(_i) (0x000C8800 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLHMC_VFSDPART_MAX_INDEX 31
+#define I40E_GLHMC_VFSDPART_PMSDBASE_SHIFT 0
+#define I40E_GLHMC_VFSDPART_PMSDBASE_MASK I40E_MASK(0xFFF, I40E_GLHMC_VFSDPART_PMSDBASE_SHIFT)
+#define I40E_GLHMC_VFSDPART_PMSDSIZE_SHIFT 16
+#define I40E_GLHMC_VFSDPART_PMSDSIZE_MASK I40E_MASK(0x1FFF, I40E_GLHMC_VFSDPART_PMSDSIZE_SHIFT)
+#define I40E_GLPBLOC_CACHESIZE 0x000A80BC /* Reset: CORER */
+#define I40E_GLPBLOC_CACHESIZE_WORD_SIZE_SHIFT 0
+#define I40E_GLPBLOC_CACHESIZE_WORD_SIZE_MASK I40E_MASK(0xFF, I40E_GLPBLOC_CACHESIZE_WORD_SIZE_SHIFT)
+#define I40E_GLPBLOC_CACHESIZE_SETS_SHIFT 8
+#define I40E_GLPBLOC_CACHESIZE_SETS_MASK I40E_MASK(0xFFF, I40E_GLPBLOC_CACHESIZE_SETS_SHIFT)
+#define I40E_GLPBLOC_CACHESIZE_WAYS_SHIFT 20
+#define I40E_GLPBLOC_CACHESIZE_WAYS_MASK I40E_MASK(0xF, I40E_GLPBLOC_CACHESIZE_WAYS_SHIFT)
+#define I40E_GLPDOC_CACHESIZE 0x000D0088 /* Reset: CORER */
+#define I40E_GLPDOC_CACHESIZE_WORD_SIZE_SHIFT 0
+#define I40E_GLPDOC_CACHESIZE_WORD_SIZE_MASK I40E_MASK(0xFF, I40E_GLPDOC_CACHESIZE_WORD_SIZE_SHIFT)
+#define I40E_GLPDOC_CACHESIZE_SETS_SHIFT 8
+#define I40E_GLPDOC_CACHESIZE_SETS_MASK I40E_MASK(0xFFF, I40E_GLPDOC_CACHESIZE_SETS_SHIFT)
+#define I40E_GLPDOC_CACHESIZE_WAYS_SHIFT 20
+#define I40E_GLPDOC_CACHESIZE_WAYS_MASK I40E_MASK(0xF, I40E_GLPDOC_CACHESIZE_WAYS_SHIFT)
+#define I40E_GLPEOC_CACHESIZE 0x000A60E8 /* Reset: CORER */
+#define I40E_GLPEOC_CACHESIZE_WORD_SIZE_SHIFT 0
+#define I40E_GLPEOC_CACHESIZE_WORD_SIZE_MASK I40E_MASK(0xFF, I40E_GLPEOC_CACHESIZE_WORD_SIZE_SHIFT)
+#define I40E_GLPEOC_CACHESIZE_SETS_SHIFT 8
+#define I40E_GLPEOC_CACHESIZE_SETS_MASK I40E_MASK(0xFFF, I40E_GLPEOC_CACHESIZE_SETS_SHIFT)
+#define I40E_GLPEOC_CACHESIZE_WAYS_SHIFT 20
+#define I40E_GLPEOC_CACHESIZE_WAYS_MASK I40E_MASK(0xF, I40E_GLPEOC_CACHESIZE_WAYS_SHIFT)
+#define I40E_PFHMC_PDINV_PMSDPARTSEL_SHIFT 15
+#define I40E_PFHMC_PDINV_PMSDPARTSEL_MASK I40E_MASK(0x1, I40E_PFHMC_PDINV_PMSDPARTSEL_SHIFT)
+#define I40E_PFHMC_SDCMD_PMSDPARTSEL_SHIFT 15
+#define I40E_PFHMC_SDCMD_PMSDPARTSEL_MASK I40E_MASK(0x1, I40E_PFHMC_SDCMD_PMSDPARTSEL_SHIFT)
+#define I40E_GL_PPRS_SPARE 0x000856E0 /* Reset: CORER */
+#define I40E_GL_PPRS_SPARE_GL_PPRS_SPARE_SHIFT 0
+#define I40E_GL_PPRS_SPARE_GL_PPRS_SPARE_MASK I40E_MASK(0xFFFFFFFF, I40E_GL_PPRS_SPARE_GL_PPRS_SPARE_SHIFT)
+#define I40E_GL_TLAN_SPARE 0x000E64E0 /* Reset: CORER */
+#define I40E_GL_TLAN_SPARE_GL_TLAN_SPARE_SHIFT 0
+#define I40E_GL_TLAN_SPARE_GL_TLAN_SPARE_MASK I40E_MASK(0xFFFFFFFF, I40E_GL_TLAN_SPARE_GL_TLAN_SPARE_SHIFT)
+#define I40E_GL_TUPM_SPARE 0x000a2230 /* Reset: CORER */
+#define I40E_GL_TUPM_SPARE_GL_TUPM_SPARE_SHIFT 0
+#define I40E_GL_TUPM_SPARE_GL_TUPM_SPARE_MASK I40E_MASK(0xFFFFFFFF, I40E_GL_TUPM_SPARE_GL_TUPM_SPARE_SHIFT)
+#define I40E_GLGEN_CAR_DEBUG 0x000B81C0 /* Reset: POR */
+#define I40E_GLGEN_CAR_DEBUG_CAR_UPPER_CORE_CLK_EN_SHIFT 0
+#define I40E_GLGEN_CAR_DEBUG_CAR_UPPER_CORE_CLK_EN_MASK I40E_MASK(0x1, I40E_GLGEN_CAR_DEBUG_CAR_UPPER_CORE_CLK_EN_SHIFT)
+#define I40E_GLGEN_CAR_DEBUG_CAR_PCIE_HIU_CLK_EN_SHIFT 1
+#define I40E_GLGEN_CAR_DEBUG_CAR_PCIE_HIU_CLK_EN_MASK I40E_MASK(0x1, I40E_GLGEN_CAR_DEBUG_CAR_PCIE_HIU_CLK_EN_SHIFT)
+#define I40E_GLGEN_CAR_DEBUG_CAR_PE_CLK_EN_SHIFT 2
+#define I40E_GLGEN_CAR_DEBUG_CAR_PE_CLK_EN_MASK I40E_MASK(0x1, I40E_GLGEN_CAR_DEBUG_CAR_PE_CLK_EN_SHIFT)
+#define I40E_GLGEN_CAR_DEBUG_CAR_PCIE_PRIM_CLK_ACTIVE_SHIFT 3
+#define I40E_GLGEN_CAR_DEBUG_CAR_PCIE_PRIM_CLK_ACTIVE_MASK I40E_MASK(0x1, I40E_GLGEN_CAR_DEBUG_CAR_PCIE_PRIM_CLK_ACTIVE_SHIFT)
+#define I40E_GLGEN_CAR_DEBUG_CDC_PE_ACTIVE_SHIFT 4
+#define I40E_GLGEN_CAR_DEBUG_CDC_PE_ACTIVE_MASK I40E_MASK(0x1, I40E_GLGEN_CAR_DEBUG_CDC_PE_ACTIVE_SHIFT)
+#define I40E_GLGEN_CAR_DEBUG_CAR_PCIE_RAW_PRST_RESET_N_SHIFT 5
+#define I40E_GLGEN_CAR_DEBUG_CAR_PCIE_RAW_PRST_RESET_N_MASK I40E_MASK(0x1, I40E_GLGEN_CAR_DEBUG_CAR_PCIE_RAW_PRST_RESET_N_SHIFT)
+#define I40E_GLGEN_CAR_DEBUG_CAR_PCIE_RAW_SCLR_RESET_N_SHIFT 6
+#define I40E_GLGEN_CAR_DEBUG_CAR_PCIE_RAW_SCLR_RESET_N_MASK I40E_MASK(0x1, I40E_GLGEN_CAR_DEBUG_CAR_PCIE_RAW_SCLR_RESET_N_SHIFT)
+#define I40E_GLGEN_CAR_DEBUG_CAR_PCIE_RAW_IB_RESET_N_SHIFT 7
+#define I40E_GLGEN_CAR_DEBUG_CAR_PCIE_RAW_IB_RESET_N_MASK I40E_MASK(0x1, I40E_GLGEN_CAR_DEBUG_CAR_PCIE_RAW_IB_RESET_N_SHIFT)
+#define I40E_GLGEN_CAR_DEBUG_CAR_PCIE_RAW_IMIB_RESET_N_SHIFT 8
+#define I40E_GLGEN_CAR_DEBUG_CAR_PCIE_RAW_IMIB_RESET_N_MASK I40E_MASK(0x1, I40E_GLGEN_CAR_DEBUG_CAR_PCIE_RAW_IMIB_RESET_N_SHIFT)
+#define I40E_GLGEN_CAR_DEBUG_CAR_RAW_EMP_RESET_N_SHIFT 9
+#define I40E_GLGEN_CAR_DEBUG_CAR_RAW_EMP_RESET_N_MASK I40E_MASK(0x1, I40E_GLGEN_CAR_DEBUG_CAR_RAW_EMP_RESET_N_SHIFT)
+#define I40E_GLGEN_CAR_DEBUG_CAR_RAW_GLOBAL_RESET_N_SHIFT 10
+#define I40E_GLGEN_CAR_DEBUG_CAR_RAW_GLOBAL_RESET_N_MASK I40E_MASK(0x1, I40E_GLGEN_CAR_DEBUG_CAR_RAW_GLOBAL_RESET_N_SHIFT)
+#define I40E_GLGEN_CAR_DEBUG_CAR_RAW_LAN_POWER_GOOD_SHIFT 11
+#define I40E_GLGEN_CAR_DEBUG_CAR_RAW_LAN_POWER_GOOD_MASK I40E_MASK(0x1, I40E_GLGEN_CAR_DEBUG_CAR_RAW_LAN_POWER_GOOD_SHIFT)
+#define I40E_GLGEN_CAR_DEBUG_CDC_IOSF_PRIMERY_RST_B_SHIFT 12
+#define I40E_GLGEN_CAR_DEBUG_CDC_IOSF_PRIMERY_RST_B_MASK I40E_MASK(0x1, I40E_GLGEN_CAR_DEBUG_CDC_IOSF_PRIMERY_RST_B_SHIFT)
+#define I40E_GLGEN_CAR_DEBUG_GBE_GLOBALRST_B_SHIFT 13
+#define I40E_GLGEN_CAR_DEBUG_GBE_GLOBALRST_B_MASK I40E_MASK(0x1, I40E_GLGEN_CAR_DEBUG_GBE_GLOBALRST_B_SHIFT)
+#define I40E_GLGEN_CAR_DEBUG_FLEEP_AL_GLOBR_DONE_SHIFT 14
+#define I40E_GLGEN_CAR_DEBUG_FLEEP_AL_GLOBR_DONE_MASK I40E_MASK(0x1, I40E_GLGEN_CAR_DEBUG_FLEEP_AL_GLOBR_DONE_SHIFT)
+#define I40E_GLGEN_MISC_SPARE 0x000880E0 /* Reset: POR */
+#define I40E_GLGEN_MISC_SPARE_GLGEN_MISC_SPARE_SHIFT 0
+#define I40E_GLGEN_MISC_SPARE_GLGEN_MISC_SPARE_MASK I40E_MASK(0xFFFFFFFF, I40E_GLGEN_MISC_SPARE_GLGEN_MISC_SPARE_SHIFT)
+#define I40E_GL_UFUSE_SOC 0x000BE550 /* Reset: POR */
+#define I40E_GL_UFUSE_SOC_PORT_MODE_SHIFT 0
+#define I40E_GL_UFUSE_SOC_PORT_MODE_MASK I40E_MASK(0x3, I40E_GL_UFUSE_SOC_PORT_MODE_SHIFT)
+#define I40E_GL_UFUSE_SOC_NIC_ID_SHIFT 2
+#define I40E_GL_UFUSE_SOC_NIC_ID_MASK I40E_MASK(0x1, I40E_GL_UFUSE_SOC_NIC_ID_SHIFT)
+#define I40E_GL_UFUSE_SOC_SPARE_FUSES_SHIFT 3
+#define I40E_GL_UFUSE_SOC_SPARE_FUSES_MASK I40E_MASK(0x1FFF, I40E_GL_UFUSE_SOC_SPARE_FUSES_SHIFT)
+#define I40E_PFINT_DYN_CTL0_WB_ON_ITR_SHIFT 30
+#define I40E_PFINT_DYN_CTL0_WB_ON_ITR_MASK I40E_MASK(0x1, I40E_PFINT_DYN_CTL0_WB_ON_ITR_SHIFT)
+#define I40E_PFINT_DYN_CTLN_WB_ON_ITR_SHIFT 30
+#define I40E_PFINT_DYN_CTLN_WB_ON_ITR_MASK I40E_MASK(0x1, I40E_PFINT_DYN_CTLN_WB_ON_ITR_SHIFT)
+#define I40E_VFINT_DYN_CTL0_WB_ON_ITR_SHIFT 30
+#define I40E_VFINT_DYN_CTL0_WB_ON_ITR_MASK I40E_MASK(0x1, I40E_VFINT_DYN_CTL0_WB_ON_ITR_SHIFT)
+#define I40E_VFINT_DYN_CTLN_WB_ON_ITR_SHIFT 30
+#define I40E_VFINT_DYN_CTLN_WB_ON_ITR_MASK I40E_MASK(0x1, I40E_VFINT_DYN_CTLN_WB_ON_ITR_SHIFT)
+#define I40E_VPLAN_QBASE(_VF) (0x00074800 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: VFR */
+#define I40E_VPLAN_QBASE_MAX_INDEX 127
+#define I40E_VPLAN_QBASE_VFFIRSTQ_SHIFT 0
+#define I40E_VPLAN_QBASE_VFFIRSTQ_MASK I40E_MASK(0x7FF, I40E_VPLAN_QBASE_VFFIRSTQ_SHIFT)
+#define I40E_VPLAN_QBASE_VFNUMQ_SHIFT 11
+#define I40E_VPLAN_QBASE_VFNUMQ_MASK I40E_MASK(0xFF, I40E_VPLAN_QBASE_VFNUMQ_SHIFT)
+#define I40E_VPLAN_QBASE_VFQTABLE_ENA_SHIFT 31
+#define I40E_VPLAN_QBASE_VFQTABLE_ENA_MASK I40E_MASK(0x1, I40E_VPLAN_QBASE_VFQTABLE_ENA_SHIFT)
+#define I40E_PRTMAC_LINK_DOWN_COUNTER 0x001E2440 /* Reset: GLOBR */
+#define I40E_PRTMAC_LINK_DOWN_COUNTER_LINK_DOWN_COUNTER_SHIFT 0
+#define I40E_PRTMAC_LINK_DOWN_COUNTER_LINK_DOWN_COUNTER_MASK I40E_MASK(0xFFFF, I40E_PRTMAC_LINK_DOWN_COUNTER_LINK_DOWN_COUNTER_SHIFT)
+#define I40E_GLNVM_AL_REQ 0x000B6164 /* Reset: POR */
+#define I40E_GLNVM_AL_REQ_POR_SHIFT 0
+#define I40E_GLNVM_AL_REQ_POR_MASK I40E_MASK(0x1, I40E_GLNVM_AL_REQ_POR_SHIFT)
+#define I40E_GLNVM_AL_REQ_PCIE_IMIB_SHIFT 1
+#define I40E_GLNVM_AL_REQ_PCIE_IMIB_MASK I40E_MASK(0x1, I40E_GLNVM_AL_REQ_PCIE_IMIB_SHIFT)
+#define I40E_GLNVM_AL_REQ_GLOBR_SHIFT 2
+#define I40E_GLNVM_AL_REQ_GLOBR_MASK I40E_MASK(0x1, I40E_GLNVM_AL_REQ_GLOBR_SHIFT)
+#define I40E_GLNVM_AL_REQ_CORER_SHIFT 3
+#define I40E_GLNVM_AL_REQ_CORER_MASK I40E_MASK(0x1, I40E_GLNVM_AL_REQ_CORER_SHIFT)
+#define I40E_GLNVM_AL_REQ_PE_SHIFT 4
+#define I40E_GLNVM_AL_REQ_PE_MASK I40E_MASK(0x1, I40E_GLNVM_AL_REQ_PE_SHIFT)
+#define I40E_GLNVM_AL_REQ_PCIE_IMIB_ASSERT_SHIFT 5
+#define I40E_GLNVM_AL_REQ_PCIE_IMIB_ASSERT_MASK I40E_MASK(0x1, I40E_GLNVM_AL_REQ_PCIE_IMIB_ASSERT_SHIFT)
+#define I40E_GLNVM_ALTIMERS 0x000B6140 /* Reset: POR */
+#define I40E_GLNVM_ALTIMERS_PCI_ALTIMER_SHIFT 0
+#define I40E_GLNVM_ALTIMERS_PCI_ALTIMER_MASK I40E_MASK(0xFFF, I40E_GLNVM_ALTIMERS_PCI_ALTIMER_SHIFT)
+#define I40E_GLNVM_ALTIMERS_GEN_ALTIMER_SHIFT 12
+#define I40E_GLNVM_ALTIMERS_GEN_ALTIMER_MASK I40E_MASK(0xFFFFF, I40E_GLNVM_ALTIMERS_GEN_ALTIMER_SHIFT)
+#define I40E_GLNVM_FLA 0x000B6108 /* Reset: POR */
+#define I40E_GLNVM_FLA_LOCKED_SHIFT 6
+#define I40E_GLNVM_FLA_LOCKED_MASK I40E_MASK(0x1, I40E_GLNVM_FLA_LOCKED_SHIFT)
+
+#define I40E_GLNVM_ULD 0x000B6008 /* Reset: POR */
+#define I40E_GLNVM_ULD_PCIER_DONE_SHIFT 0
+#define I40E_GLNVM_ULD_PCIER_DONE_MASK I40E_MASK(0x1, I40E_GLNVM_ULD_PCIER_DONE_SHIFT)
+#define I40E_GLNVM_ULD_PCIER_DONE_1_SHIFT 1
+#define I40E_GLNVM_ULD_PCIER_DONE_1_MASK I40E_MASK(0x1, I40E_GLNVM_ULD_PCIER_DONE_1_SHIFT)
+#define I40E_GLNVM_ULD_CORER_DONE_SHIFT 3
+#define I40E_GLNVM_ULD_CORER_DONE_MASK I40E_MASK(0x1, I40E_GLNVM_ULD_CORER_DONE_SHIFT)
+#define I40E_GLNVM_ULD_GLOBR_DONE_SHIFT 4
+#define I40E_GLNVM_ULD_GLOBR_DONE_MASK I40E_MASK(0x1, I40E_GLNVM_ULD_GLOBR_DONE_SHIFT)
+#define I40E_GLNVM_ULD_POR_DONE_SHIFT 5
+#define I40E_GLNVM_ULD_POR_DONE_MASK I40E_MASK(0x1, I40E_GLNVM_ULD_POR_DONE_SHIFT)
+#define I40E_GLNVM_ULD_POR_DONE_1_SHIFT 8
+#define I40E_GLNVM_ULD_POR_DONE_1_MASK I40E_MASK(0x1, I40E_GLNVM_ULD_POR_DONE_1_SHIFT)
+#define I40E_GLNVM_ULD_PCIER_DONE_2_SHIFT 9
+#define I40E_GLNVM_ULD_PCIER_DONE_2_MASK I40E_MASK(0x1, I40E_GLNVM_ULD_PCIER_DONE_2_SHIFT)
+#define I40E_GLNVM_ULD_PE_DONE_SHIFT 10
+#define I40E_GLNVM_ULD_PE_DONE_MASK I40E_MASK(0x1, I40E_GLNVM_ULD_PE_DONE_SHIFT)
+#define I40E_GLNVM_ULT 0x000B6154 /* Reset: POR */
+#define I40E_GLNVM_ULT_CONF_PCIR_AE_SHIFT 0
+#define I40E_GLNVM_ULT_CONF_PCIR_AE_MASK I40E_MASK(0x1, I40E_GLNVM_ULT_CONF_PCIR_AE_SHIFT)
+#define I40E_GLNVM_ULT_CONF_PCIRTL_AE_SHIFT 1
+#define I40E_GLNVM_ULT_CONF_PCIRTL_AE_MASK I40E_MASK(0x1, I40E_GLNVM_ULT_CONF_PCIRTL_AE_SHIFT)
+#define I40E_GLNVM_ULT_RESERVED_1_SHIFT 2
+#define I40E_GLNVM_ULT_RESERVED_1_MASK I40E_MASK(0x1, I40E_GLNVM_ULT_RESERVED_1_SHIFT)
+#define I40E_GLNVM_ULT_CONF_CORE_AE_SHIFT 3
+#define I40E_GLNVM_ULT_CONF_CORE_AE_MASK I40E_MASK(0x1, I40E_GLNVM_ULT_CONF_CORE_AE_SHIFT)
+#define I40E_GLNVM_ULT_CONF_GLOBAL_AE_SHIFT 4
+#define I40E_GLNVM_ULT_CONF_GLOBAL_AE_MASK I40E_MASK(0x1, I40E_GLNVM_ULT_CONF_GLOBAL_AE_SHIFT)
+#define I40E_GLNVM_ULT_CONF_POR_AE_SHIFT 5
+#define I40E_GLNVM_ULT_CONF_POR_AE_MASK I40E_MASK(0x1, I40E_GLNVM_ULT_CONF_POR_AE_SHIFT)
+#define I40E_GLNVM_ULT_RESERVED_2_SHIFT 6
+#define I40E_GLNVM_ULT_RESERVED_2_MASK I40E_MASK(0x1, I40E_GLNVM_ULT_RESERVED_2_SHIFT)
+#define I40E_GLNVM_ULT_RESERVED_3_SHIFT 7
+#define I40E_GLNVM_ULT_RESERVED_3_MASK I40E_MASK(0x1, I40E_GLNVM_ULT_RESERVED_3_SHIFT)
+#define I40E_GLNVM_ULT_CONF_EMP_AE_SHIFT 8
+#define I40E_GLNVM_ULT_CONF_EMP_AE_MASK I40E_MASK(0x1, I40E_GLNVM_ULT_CONF_EMP_AE_SHIFT)
+#define I40E_GLNVM_ULT_CONF_PCIALT_AE_SHIFT 9
+#define I40E_GLNVM_ULT_CONF_PCIALT_AE_MASK I40E_MASK(0x1, I40E_GLNVM_ULT_CONF_PCIALT_AE_SHIFT)
+#define I40E_GLNVM_ULT_RESERVED_4_SHIFT 10
+#define I40E_GLNVM_ULT_RESERVED_4_MASK I40E_MASK(0x3FFFFF, I40E_GLNVM_ULT_RESERVED_4_SHIFT)
+#define I40E_MEM_INIT_DONE_STAT 0x000B615C /* Reset: POR */
+#define I40E_MEM_INIT_DONE_STAT_CMLAN_MEM_INIT_DONE_SHIFT 0
+#define I40E_MEM_INIT_DONE_STAT_CMLAN_MEM_INIT_DONE_MASK I40E_MASK(0x1, I40E_MEM_INIT_DONE_STAT_CMLAN_MEM_INIT_DONE_SHIFT)
+#define I40E_MEM_INIT_DONE_STAT_PMAT_MEM_INIT_DONE_SHIFT 1
+#define I40E_MEM_INIT_DONE_STAT_PMAT_MEM_INIT_DONE_MASK I40E_MASK(0x1, I40E_MEM_INIT_DONE_STAT_PMAT_MEM_INIT_DONE_SHIFT)
+#define I40E_MEM_INIT_DONE_STAT_RCU_MEM_INIT_DONE_SHIFT 2
+#define I40E_MEM_INIT_DONE_STAT_RCU_MEM_INIT_DONE_MASK I40E_MASK(0x1, I40E_MEM_INIT_DONE_STAT_RCU_MEM_INIT_DONE_SHIFT)
+#define I40E_MEM_INIT_DONE_STAT_TDPU_MEM_INIT_DONE_SHIFT 3
+#define I40E_MEM_INIT_DONE_STAT_TDPU_MEM_INIT_DONE_MASK I40E_MASK(0x1, I40E_MEM_INIT_DONE_STAT_TDPU_MEM_INIT_DONE_SHIFT)
+#define I40E_MEM_INIT_DONE_STAT_TLAN_MEM_INIT_DONE_SHIFT 4
+#define I40E_MEM_INIT_DONE_STAT_TLAN_MEM_INIT_DONE_MASK I40E_MASK(0x1, I40E_MEM_INIT_DONE_STAT_TLAN_MEM_INIT_DONE_SHIFT)
+#define I40E_MEM_INIT_DONE_STAT_RLAN_MEM_INIT_DONE_SHIFT 5
+#define I40E_MEM_INIT_DONE_STAT_RLAN_MEM_INIT_DONE_MASK I40E_MASK(0x1, I40E_MEM_INIT_DONE_STAT_RLAN_MEM_INIT_DONE_SHIFT)
+#define I40E_MEM_INIT_DONE_STAT_RDPU_MEM_INIT_DONE_SHIFT 6
+#define I40E_MEM_INIT_DONE_STAT_RDPU_MEM_INIT_DONE_MASK I40E_MASK(0x1, I40E_MEM_INIT_DONE_STAT_RDPU_MEM_INIT_DONE_SHIFT)
+#define I40E_MEM_INIT_DONE_STAT_PPRS_MEM_INIT_DONE_SHIFT 7
+#define I40E_MEM_INIT_DONE_STAT_PPRS_MEM_INIT_DONE_MASK I40E_MASK(0x1, I40E_MEM_INIT_DONE_STAT_PPRS_MEM_INIT_DONE_SHIFT)
+#define I40E_MEM_INIT_DONE_STAT_RPB_MEM_INIT_DONE_SHIFT 8
+#define I40E_MEM_INIT_DONE_STAT_RPB_MEM_INIT_DONE_MASK I40E_MASK(0x1, I40E_MEM_INIT_DONE_STAT_RPB_MEM_INIT_DONE_SHIFT)
+#define I40E_MEM_INIT_DONE_STAT_TPB_MEM_INIT_DONE_SHIFT 9
+#define I40E_MEM_INIT_DONE_STAT_TPB_MEM_INIT_DONE_MASK I40E_MASK(0x1, I40E_MEM_INIT_DONE_STAT_TPB_MEM_INIT_DONE_SHIFT)
+#define I40E_MEM_INIT_DONE_STAT_FOC_MEM_INIT_DONE_SHIFT 10
+#define I40E_MEM_INIT_DONE_STAT_FOC_MEM_INIT_DONE_MASK I40E_MASK(0x1, I40E_MEM_INIT_DONE_STAT_FOC_MEM_INIT_DONE_SHIFT)
+#define I40E_MEM_INIT_DONE_STAT_TSCD_MEM_INIT_DONE_SHIFT 11
+#define I40E_MEM_INIT_DONE_STAT_TSCD_MEM_INIT_DONE_MASK I40E_MASK(0x1, I40E_MEM_INIT_DONE_STAT_TSCD_MEM_INIT_DONE_SHIFT)
+#define I40E_MEM_INIT_DONE_STAT_TCB_MEM_INIT_DONE_SHIFT 12
+#define I40E_MEM_INIT_DONE_STAT_TCB_MEM_INIT_DONE_MASK I40E_MASK(0x1, I40E_MEM_INIT_DONE_STAT_TCB_MEM_INIT_DONE_SHIFT)
+#define I40E_MEM_INIT_DONE_STAT_RCB_MEM_INIT_DONE_SHIFT 13
+#define I40E_MEM_INIT_DONE_STAT_RCB_MEM_INIT_DONE_MASK I40E_MASK(0x1, I40E_MEM_INIT_DONE_STAT_RCB_MEM_INIT_DONE_SHIFT)
+#define I40E_MEM_INIT_DONE_STAT_WUC_MEM_INIT_DONE_SHIFT 14
+#define I40E_MEM_INIT_DONE_STAT_WUC_MEM_INIT_DONE_MASK I40E_MASK(0x1, I40E_MEM_INIT_DONE_STAT_WUC_MEM_INIT_DONE_SHIFT)
+#define I40E_MEM_INIT_DONE_STAT_STAT_MEM_INIT_DONE_SHIFT 15
+#define I40E_MEM_INIT_DONE_STAT_STAT_MEM_INIT_DONE_MASK I40E_MASK(0x1, I40E_MEM_INIT_DONE_STAT_STAT_MEM_INIT_DONE_SHIFT)
+#define I40E_MEM_INIT_DONE_STAT_ITR_MEM_INIT_DONE_SHIFT 16
+#define I40E_MEM_INIT_DONE_STAT_ITR_MEM_INIT_DONE_MASK I40E_MASK(0x1, I40E_MEM_INIT_DONE_STAT_ITR_MEM_INIT_DONE_SHIFT)
+#define I40E_MNGSB_DADD 0x000B7030 /* Reset: POR */
+#define I40E_MNGSB_DADD_ADDR_SHIFT 0
+#define I40E_MNGSB_DADD_ADDR_MASK I40E_MASK(0xFFFFFFFF, I40E_MNGSB_DADD_ADDR_SHIFT)
+#define I40E_MNGSB_DCNT 0x000B7034 /* Reset: POR */
+#define I40E_MNGSB_DCNT_BYTE_CNT_SHIFT 0
+#define I40E_MNGSB_DCNT_BYTE_CNT_MASK I40E_MASK(0xFFFFFFFF, I40E_MNGSB_DCNT_BYTE_CNT_SHIFT)
+#define I40E_MNGSB_MSGCTL 0x000B7020 /* Reset: POR */
+#define I40E_MNGSB_MSGCTL_HDR_DWS_SHIFT 0
+#define I40E_MNGSB_MSGCTL_HDR_DWS_MASK I40E_MASK(0x3, I40E_MNGSB_MSGCTL_HDR_DWS_SHIFT)
+#define I40E_MNGSB_MSGCTL_EXP_RDW_SHIFT 8
+#define I40E_MNGSB_MSGCTL_EXP_RDW_MASK I40E_MASK(0x1FF, I40E_MNGSB_MSGCTL_EXP_RDW_SHIFT)
+#define I40E_MNGSB_MSGCTL_MSG_MODE_SHIFT 26
+#define I40E_MNGSB_MSGCTL_MSG_MODE_MASK I40E_MASK(0x3, I40E_MNGSB_MSGCTL_MSG_MODE_SHIFT)
+#define I40E_MNGSB_MSGCTL_TOKEN_MODE_SHIFT 28
+#define I40E_MNGSB_MSGCTL_TOKEN_MODE_MASK I40E_MASK(0x3, I40E_MNGSB_MSGCTL_TOKEN_MODE_SHIFT)
+#define I40E_MNGSB_MSGCTL_BARCLR_SHIFT 30
+#define I40E_MNGSB_MSGCTL_BARCLR_MASK I40E_MASK(0x1, I40E_MNGSB_MSGCTL_BARCLR_SHIFT)
+#define I40E_MNGSB_MSGCTL_CMDV_SHIFT 31
+#define I40E_MNGSB_MSGCTL_CMDV_MASK I40E_MASK(0x1, I40E_MNGSB_MSGCTL_CMDV_SHIFT)
+#define I40E_MNGSB_RDATA 0x000B7300 /* Reset: POR */
+#define I40E_MNGSB_RDATA_DATA_SHIFT 0
+#define I40E_MNGSB_RDATA_DATA_MASK I40E_MASK(0xFFFFFFFF, I40E_MNGSB_RDATA_DATA_SHIFT)
+#define I40E_MNGSB_RHDR0 0x000B72FC /* Reset: POR */
+#define I40E_MNGSB_RHDR0_DESTINATION_SHIFT 0
+#define I40E_MNGSB_RHDR0_DESTINATION_MASK I40E_MASK(0xFF, I40E_MNGSB_RHDR0_DESTINATION_SHIFT)
+#define I40E_MNGSB_RHDR0_SOURCE_SHIFT 8
+#define I40E_MNGSB_RHDR0_SOURCE_MASK I40E_MASK(0xFF, I40E_MNGSB_RHDR0_SOURCE_SHIFT)
+#define I40E_MNGSB_RHDR0_OPCODE_SHIFT 16
+#define I40E_MNGSB_RHDR0_OPCODE_MASK I40E_MASK(0xFF, I40E_MNGSB_RHDR0_OPCODE_SHIFT)
+#define I40E_MNGSB_RHDR0_TAG_SHIFT 24
+#define I40E_MNGSB_RHDR0_TAG_MASK I40E_MASK(0x7, I40E_MNGSB_RHDR0_TAG_SHIFT)
+#define I40E_MNGSB_RHDR0_RESPONSE_SHIFT 27
+#define I40E_MNGSB_RHDR0_RESPONSE_MASK I40E_MASK(0x7, I40E_MNGSB_RHDR0_RESPONSE_SHIFT)
+#define I40E_MNGSB_RHDR0_EH_SHIFT 31
+#define I40E_MNGSB_RHDR0_EH_MASK I40E_MASK(0x1, I40E_MNGSB_RHDR0_EH_SHIFT)
+#define I40E_MNGSB_RSPCTL 0x000B7024 /* Reset: POR */
+#define I40E_MNGSB_RSPCTL_DMA_MSG_DWORDS_SHIFT 0
+#define I40E_MNGSB_RSPCTL_DMA_MSG_DWORDS_MASK I40E_MASK(0x1FF, I40E_MNGSB_RSPCTL_DMA_MSG_DWORDS_SHIFT)
+#define I40E_MNGSB_RSPCTL_RSP_MODE_SHIFT 26
+#define I40E_MNGSB_RSPCTL_RSP_MODE_MASK I40E_MASK(0x3, I40E_MNGSB_RSPCTL_RSP_MODE_SHIFT)
+#define I40E_MNGSB_RSPCTL_RSP_BAD_LEN_SHIFT 30
+#define I40E_MNGSB_RSPCTL_RSP_BAD_LEN_MASK I40E_MASK(0x1, I40E_MNGSB_RSPCTL_RSP_BAD_LEN_SHIFT)
+#define I40E_MNGSB_RSPCTL_RSP_ERR_SHIFT 31
+#define I40E_MNGSB_RSPCTL_RSP_ERR_MASK I40E_MASK(0x1, I40E_MNGSB_RSPCTL_RSP_ERR_SHIFT)
+#define I40E_MNGSB_WDATA 0x000B7100 /* Reset: POR */
+#define I40E_MNGSB_WDATA_DATA_SHIFT 0
+#define I40E_MNGSB_WDATA_DATA_MASK I40E_MASK(0xFFFFFFFF, I40E_MNGSB_WDATA_DATA_SHIFT)
+#define I40E_MNGSB_WHDR0 0x000B70F4 /* Reset: POR */
+#define I40E_MNGSB_WHDR0_RAW_DEST_SHIFT 0
+#define I40E_MNGSB_WHDR0_RAW_DEST_MASK I40E_MASK(0xFF, I40E_MNGSB_WHDR0_RAW_DEST_SHIFT)
+#define I40E_MNGSB_WHDR0_DEST_SEL_SHIFT 12
+#define I40E_MNGSB_WHDR0_DEST_SEL_MASK I40E_MASK(0xF, I40E_MNGSB_WHDR0_DEST_SEL_SHIFT)
+#define I40E_MNGSB_WHDR0_OPCODE_SEL_SHIFT 16
+#define I40E_MNGSB_WHDR0_OPCODE_SEL_MASK I40E_MASK(0xFF, I40E_MNGSB_WHDR0_OPCODE_SEL_SHIFT)
+#define I40E_MNGSB_WHDR0_TAG_SHIFT 24
+#define I40E_MNGSB_WHDR0_TAG_MASK I40E_MASK(0x7F, I40E_MNGSB_WHDR0_TAG_SHIFT)
+#define I40E_MNGSB_WHDR1 0x000B70F8 /* Reset: POR */
+#define I40E_MNGSB_WHDR1_ADDR_SHIFT 0
+#define I40E_MNGSB_WHDR1_ADDR_MASK I40E_MASK(0xFFFFFFFF, I40E_MNGSB_WHDR1_ADDR_SHIFT)
+#define I40E_MNGSB_WHDR2 0x000B70FC /* Reset: POR */
+#define I40E_MNGSB_WHDR2_LENGTH_SHIFT 0
+#define I40E_MNGSB_WHDR2_LENGTH_MASK I40E_MASK(0xFFFFFFFF, I40E_MNGSB_WHDR2_LENGTH_SHIFT)
+
+#define I40E_GLPCI_CAPSUP_WAKUP_EN_SHIFT 21
+#define I40E_GLPCI_CAPSUP_WAKUP_EN_MASK I40E_MASK(0x1, I40E_GLPCI_CAPSUP_WAKUP_EN_SHIFT)
+
+#define I40E_GLPCI_CUR_CLNT_COMMON 0x0009CA18 /* Reset: PCIR */
+#define I40E_GLPCI_CUR_CLNT_COMMON_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_CUR_CLNT_COMMON_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_CLNT_COMMON_DATA_LINES_SHIFT)
+#define I40E_GLPCI_CUR_CLNT_COMMON_OSR_SHIFT 16
+#define I40E_GLPCI_CUR_CLNT_COMMON_OSR_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_CLNT_COMMON_OSR_SHIFT)
+#define I40E_GLPCI_CUR_CLNT_PIPEMON 0x0009CA20 /* Reset: PCIR */
+#define I40E_GLPCI_CUR_CLNT_PIPEMON_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_CUR_CLNT_PIPEMON_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_CLNT_PIPEMON_DATA_LINES_SHIFT)
+#define I40E_GLPCI_CUR_MNG_ALWD 0x0009c514 /* Reset: PCIR */
+#define I40E_GLPCI_CUR_MNG_ALWD_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_CUR_MNG_ALWD_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_MNG_ALWD_DATA_LINES_SHIFT)
+#define I40E_GLPCI_CUR_MNG_ALWD_OSR_SHIFT 16
+#define I40E_GLPCI_CUR_MNG_ALWD_OSR_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_MNG_ALWD_OSR_SHIFT)
+#define I40E_GLPCI_CUR_MNG_RSVD 0x0009c594 /* Reset: PCIR */
+#define I40E_GLPCI_CUR_MNG_RSVD_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_CUR_MNG_RSVD_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_MNG_RSVD_DATA_LINES_SHIFT)
+#define I40E_GLPCI_CUR_MNG_RSVD_OSR_SHIFT 16
+#define I40E_GLPCI_CUR_MNG_RSVD_OSR_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_MNG_RSVD_OSR_SHIFT)
+#define I40E_GLPCI_CUR_PMAT_ALWD 0x0009c510 /* Reset: PCIR */
+#define I40E_GLPCI_CUR_PMAT_ALWD_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_CUR_PMAT_ALWD_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_PMAT_ALWD_DATA_LINES_SHIFT)
+#define I40E_GLPCI_CUR_PMAT_ALWD_OSR_SHIFT 16
+#define I40E_GLPCI_CUR_PMAT_ALWD_OSR_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_PMAT_ALWD_OSR_SHIFT)
+#define I40E_GLPCI_CUR_PMAT_RSVD 0x0009c590 /* Reset: PCIR */
+#define I40E_GLPCI_CUR_PMAT_RSVD_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_CUR_PMAT_RSVD_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_PMAT_RSVD_DATA_LINES_SHIFT)
+#define I40E_GLPCI_CUR_PMAT_RSVD_OSR_SHIFT 16
+#define I40E_GLPCI_CUR_PMAT_RSVD_OSR_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_PMAT_RSVD_OSR_SHIFT)
+#define I40E_GLPCI_CUR_RLAN_ALWD 0x0009c500 /* Reset: PCIR */
+#define I40E_GLPCI_CUR_RLAN_ALWD_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_CUR_RLAN_ALWD_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_RLAN_ALWD_DATA_LINES_SHIFT)
+#define I40E_GLPCI_CUR_RLAN_ALWD_OSR_SHIFT 16
+#define I40E_GLPCI_CUR_RLAN_ALWD_OSR_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_RLAN_ALWD_OSR_SHIFT)
+#define I40E_GLPCI_CUR_RLAN_RSVD 0x0009c580 /* Reset: PCIR */
+#define I40E_GLPCI_CUR_RLAN_RSVD_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_CUR_RLAN_RSVD_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_RLAN_RSVD_DATA_LINES_SHIFT)
+#define I40E_GLPCI_CUR_RLAN_RSVD_OSR_SHIFT 16
+#define I40E_GLPCI_CUR_RLAN_RSVD_OSR_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_RLAN_RSVD_OSR_SHIFT)
+#define I40E_GLPCI_CUR_RXPE_ALWD 0x0009c508 /* Reset: PCIR */
+#define I40E_GLPCI_CUR_RXPE_ALWD_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_CUR_RXPE_ALWD_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_RXPE_ALWD_DATA_LINES_SHIFT)
+#define I40E_GLPCI_CUR_RXPE_ALWD_OSR_SHIFT 16
+#define I40E_GLPCI_CUR_RXPE_ALWD_OSR_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_RXPE_ALWD_OSR_SHIFT)
+#define I40E_GLPCI_CUR_RXPE_RSVD 0x0009c588 /* Reset: PCIR */
+#define I40E_GLPCI_CUR_RXPE_RSVD_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_CUR_RXPE_RSVD_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_RXPE_RSVD_DATA_LINES_SHIFT)
+#define I40E_GLPCI_CUR_RXPE_RSVD_OSR_SHIFT 16
+#define I40E_GLPCI_CUR_RXPE_RSVD_OSR_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_RXPE_RSVD_OSR_SHIFT)
+#define I40E_GLPCI_CUR_TDPU_ALWD 0x0009c518 /* Reset: PCIR */
+#define I40E_GLPCI_CUR_TDPU_ALWD_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_CUR_TDPU_ALWD_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_TDPU_ALWD_DATA_LINES_SHIFT)
+#define I40E_GLPCI_CUR_TDPU_ALWD_OSR_SHIFT 16
+#define I40E_GLPCI_CUR_TDPU_ALWD_OSR_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_TDPU_ALWD_OSR_SHIFT)
+#define I40E_GLPCI_CUR_TDPU_RSVD 0x0009c598 /* Reset: PCIR */
+#define I40E_GLPCI_CUR_TDPU_RSVD_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_CUR_TDPU_RSVD_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_TDPU_RSVD_DATA_LINES_SHIFT)
+#define I40E_GLPCI_CUR_TDPU_RSVD_OSR_SHIFT 16
+#define I40E_GLPCI_CUR_TDPU_RSVD_OSR_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_TDPU_RSVD_OSR_SHIFT)
+#define I40E_GLPCI_CUR_TLAN_ALWD 0x0009c504 /* Reset: PCIR */
+#define I40E_GLPCI_CUR_TLAN_ALWD_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_CUR_TLAN_ALWD_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_TLAN_ALWD_DATA_LINES_SHIFT)
+#define I40E_GLPCI_CUR_TLAN_ALWD_OSR_SHIFT 16
+#define I40E_GLPCI_CUR_TLAN_ALWD_OSR_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_TLAN_ALWD_OSR_SHIFT)
+#define I40E_GLPCI_CUR_TLAN_RSVD 0x0009c584 /* Reset: PCIR */
+#define I40E_GLPCI_CUR_TLAN_RSVD_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_CUR_TLAN_RSVD_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_TLAN_RSVD_DATA_LINES_SHIFT)
+#define I40E_GLPCI_CUR_TLAN_RSVD_OSR_SHIFT 16
+#define I40E_GLPCI_CUR_TLAN_RSVD_OSR_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_TLAN_RSVD_OSR_SHIFT)
+#define I40E_GLPCI_CUR_TXPE_ALWD 0x0009c50C /* Reset: PCIR */
+#define I40E_GLPCI_CUR_TXPE_ALWD_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_CUR_TXPE_ALWD_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_TXPE_ALWD_DATA_LINES_SHIFT)
+#define I40E_GLPCI_CUR_TXPE_ALWD_OSR_SHIFT 16
+#define I40E_GLPCI_CUR_TXPE_ALWD_OSR_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_TXPE_ALWD_OSR_SHIFT)
+#define I40E_GLPCI_CUR_TXPE_RSVD 0x0009c58c /* Reset: PCIR */
+#define I40E_GLPCI_CUR_TXPE_RSVD_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_CUR_TXPE_RSVD_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_TXPE_RSVD_DATA_LINES_SHIFT)
+#define I40E_GLPCI_CUR_TXPE_RSVD_OSR_SHIFT 16
+#define I40E_GLPCI_CUR_TXPE_RSVD_OSR_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_TXPE_RSVD_OSR_SHIFT)
+#define I40E_GLPCI_CUR_WATMK_CLNT_COMMON 0x0009CA28 /* Reset: PCIR */
+#define I40E_GLPCI_CUR_WATMK_CLNT_COMMON_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_CUR_WATMK_CLNT_COMMON_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_WATMK_CLNT_COMMON_DATA_LINES_SHIFT)
+#define I40E_GLPCI_CUR_WATMK_CLNT_COMMON_OSR_SHIFT 16
+#define I40E_GLPCI_CUR_WATMK_CLNT_COMMON_OSR_MASK I40E_MASK(0xFFFF, I40E_GLPCI_CUR_WATMK_CLNT_COMMON_OSR_SHIFT)
+
+#define I40E_GLPCI_LBARCTRL_PE_DB_SIZE_SHIFT 4
+#define I40E_GLPCI_LBARCTRL_PE_DB_SIZE_MASK I40E_MASK(0x3, I40E_GLPCI_LBARCTRL_PE_DB_SIZE_SHIFT)
+#define I40E_GLPCI_LBARCTRL_VF_PE_DB_SIZE_SHIFT 10
+#define I40E_GLPCI_LBARCTRL_VF_PE_DB_SIZE_MASK I40E_MASK(0x1, I40E_GLPCI_LBARCTRL_VF_PE_DB_SIZE_SHIFT)
+#define I40E_GLPCI_NPQ_CFG 0x0009CA00 /* Reset: PCIR */
+#define I40E_GLPCI_NPQ_CFG_EXTEND_TO_SHIFT 0
+#define I40E_GLPCI_NPQ_CFG_EXTEND_TO_MASK I40E_MASK(0x1, I40E_GLPCI_NPQ_CFG_EXTEND_TO_SHIFT)
+#define I40E_GLPCI_NPQ_CFG_SMALL_TO_SHIFT 1
+#define I40E_GLPCI_NPQ_CFG_SMALL_TO_MASK I40E_MASK(0x1, I40E_GLPCI_NPQ_CFG_SMALL_TO_SHIFT)
+#define I40E_GLPCI_NPQ_CFG_WEIGHT_AVG_SHIFT 2
+#define I40E_GLPCI_NPQ_CFG_WEIGHT_AVG_MASK I40E_MASK(0xF, I40E_GLPCI_NPQ_CFG_WEIGHT_AVG_SHIFT)
+#define I40E_GLPCI_NPQ_CFG_NPQ_SPARE_SHIFT 6
+#define I40E_GLPCI_NPQ_CFG_NPQ_SPARE_MASK I40E_MASK(0x3FF, I40E_GLPCI_NPQ_CFG_NPQ_SPARE_SHIFT)
+#define I40E_GLPCI_NPQ_CFG_NPQ_ERR_STAT_SHIFT 16
+#define I40E_GLPCI_NPQ_CFG_NPQ_ERR_STAT_MASK I40E_MASK(0xF, I40E_GLPCI_NPQ_CFG_NPQ_ERR_STAT_SHIFT)
+#define I40E_GLPCI_WATMK_CLNT_PIPEMON 0x0009CA30 /* Reset: PCIR */
+#define I40E_GLPCI_WATMK_CLNT_PIPEMON_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_WATMK_CLNT_PIPEMON_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_WATMK_CLNT_PIPEMON_DATA_LINES_SHIFT)
+#define I40E_GLPCI_WATMK_MNG_ALWD 0x0009CB14 /* Reset: PCIR */
+#define I40E_GLPCI_WATMK_MNG_ALWD_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_WATMK_MNG_ALWD_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_WATMK_MNG_ALWD_DATA_LINES_SHIFT)
+#define I40E_GLPCI_WATMK_MNG_ALWD_OSR_SHIFT 16
+#define I40E_GLPCI_WATMK_MNG_ALWD_OSR_MASK I40E_MASK(0xFFFF, I40E_GLPCI_WATMK_MNG_ALWD_OSR_SHIFT)
+#define I40E_GLPCI_WATMK_PMAT_ALWD 0x0009CB10 /* Reset: PCIR */
+#define I40E_GLPCI_WATMK_PMAT_ALWD_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_WATMK_PMAT_ALWD_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_WATMK_PMAT_ALWD_DATA_LINES_SHIFT)
+#define I40E_GLPCI_WATMK_PMAT_ALWD_OSR_SHIFT 16
+#define I40E_GLPCI_WATMK_PMAT_ALWD_OSR_MASK I40E_MASK(0xFFFF, I40E_GLPCI_WATMK_PMAT_ALWD_OSR_SHIFT)
+#define I40E_GLPCI_WATMK_RLAN_ALWD 0x0009CB00 /* Reset: PCIR */
+#define I40E_GLPCI_WATMK_RLAN_ALWD_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_WATMK_RLAN_ALWD_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_WATMK_RLAN_ALWD_DATA_LINES_SHIFT)
+#define I40E_GLPCI_WATMK_RLAN_ALWD_OSR_SHIFT 16
+#define I40E_GLPCI_WATMK_RLAN_ALWD_OSR_MASK I40E_MASK(0xFFFF, I40E_GLPCI_WATMK_RLAN_ALWD_OSR_SHIFT)
+#define I40E_GLPCI_WATMK_RXPE_ALWD 0x0009CB08 /* Reset: PCIR */
+#define I40E_GLPCI_WATMK_RXPE_ALWD_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_WATMK_RXPE_ALWD_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_WATMK_RXPE_ALWD_DATA_LINES_SHIFT)
+#define I40E_GLPCI_WATMK_RXPE_ALWD_OSR_SHIFT 16
+#define I40E_GLPCI_WATMK_RXPE_ALWD_OSR_MASK I40E_MASK(0xFFFF, I40E_GLPCI_WATMK_RXPE_ALWD_OSR_SHIFT)
+#define I40E_GLPCI_WATMK_TLAN_ALWD 0x0009CB04 /* Reset: PCIR */
+#define I40E_GLPCI_WATMK_TLAN_ALWD_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_WATMK_TLAN_ALWD_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_WATMK_TLAN_ALWD_DATA_LINES_SHIFT)
+#define I40E_GLPCI_WATMK_TLAN_ALWD_OSR_SHIFT 16
+#define I40E_GLPCI_WATMK_TLAN_ALWD_OSR_MASK I40E_MASK(0xFFFF, I40E_GLPCI_WATMK_TLAN_ALWD_OSR_SHIFT)
+#define I40E_GLPCI_WATMK_TPDU_ALWD 0x0009CB18 /* Reset: PCIR */
+#define I40E_GLPCI_WATMK_TPDU_ALWD_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_WATMK_TPDU_ALWD_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_WATMK_TPDU_ALWD_DATA_LINES_SHIFT)
+#define I40E_GLPCI_WATMK_TPDU_ALWD_OSR_SHIFT 16
+#define I40E_GLPCI_WATMK_TPDU_ALWD_OSR_MASK I40E_MASK(0xFFFF, I40E_GLPCI_WATMK_TPDU_ALWD_OSR_SHIFT)
+#define I40E_GLPCI_WATMK_TXPE_ALWD 0x0009CB0c /* Reset: PCIR */
+#define I40E_GLPCI_WATMK_TXPE_ALWD_DATA_LINES_SHIFT 0
+#define I40E_GLPCI_WATMK_TXPE_ALWD_DATA_LINES_MASK I40E_MASK(0xFFFF, I40E_GLPCI_WATMK_TXPE_ALWD_DATA_LINES_SHIFT)
+#define I40E_GLPCI_WATMK_TXPE_ALWD_OSR_SHIFT 16
+#define I40E_GLPCI_WATMK_TXPE_ALWD_OSR_MASK I40E_MASK(0xFFFF, I40E_GLPCI_WATMK_TXPE_ALWD_OSR_SHIFT)
+#define I40E_GLPE_CPUSTATUS0 0x0000D040 /* Reset: PE_CORER */
+#define I40E_GLPE_CPUSTATUS0_PECPUSTATUS0_SHIFT 0
+#define I40E_GLPE_CPUSTATUS0_PECPUSTATUS0_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPE_CPUSTATUS0_PECPUSTATUS0_SHIFT)
+#define I40E_GLPE_CPUSTATUS1 0x0000D044 /* Reset: PE_CORER */
+#define I40E_GLPE_CPUSTATUS1_PECPUSTATUS1_SHIFT 0
+#define I40E_GLPE_CPUSTATUS1_PECPUSTATUS1_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPE_CPUSTATUS1_PECPUSTATUS1_SHIFT)
+#define I40E_GLPE_CPUSTATUS2 0x0000D048 /* Reset: PE_CORER */
+#define I40E_GLPE_CPUSTATUS2_PECPUSTATUS2_SHIFT 0
+#define I40E_GLPE_CPUSTATUS2_PECPUSTATUS2_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPE_CPUSTATUS2_PECPUSTATUS2_SHIFT)
+#define I40E_GLPE_CPUTRIG0 0x0000D060 /* Reset: PE_CORER */
+#define I40E_GLPE_CPUTRIG0_PECPUTRIG0_SHIFT 0
+#define I40E_GLPE_CPUTRIG0_PECPUTRIG0_MASK I40E_MASK(0xFFFF, I40E_GLPE_CPUTRIG0_PECPUTRIG0_SHIFT)
+#define I40E_GLPE_CPUTRIG0_TEPREQUEST0_SHIFT 17
+#define I40E_GLPE_CPUTRIG0_TEPREQUEST0_MASK I40E_MASK(0x1, I40E_GLPE_CPUTRIG0_TEPREQUEST0_SHIFT)
+#define I40E_GLPE_CPUTRIG0_OOPREQUEST0_SHIFT 18
+#define I40E_GLPE_CPUTRIG0_OOPREQUEST0_MASK I40E_MASK(0x1, I40E_GLPE_CPUTRIG0_OOPREQUEST0_SHIFT)
+#define I40E_GLPE_DUAL40_RUPM 0x0000DA04 /* Reset: PE_CORER */
+#define I40E_GLPE_DUAL40_RUPM_DUAL_40G_MODE_SHIFT 0
+#define I40E_GLPE_DUAL40_RUPM_DUAL_40G_MODE_MASK I40E_MASK(0x1, I40E_GLPE_DUAL40_RUPM_DUAL_40G_MODE_SHIFT)
+#define I40E_GLPE_PFAEQEDROPCNT(_i) (0x00131440 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLPE_PFAEQEDROPCNT_MAX_INDEX 15
+#define I40E_GLPE_PFAEQEDROPCNT_AEQEDROPCNT_SHIFT 0
+#define I40E_GLPE_PFAEQEDROPCNT_AEQEDROPCNT_MASK I40E_MASK(0xFFFF, I40E_GLPE_PFAEQEDROPCNT_AEQEDROPCNT_SHIFT)
+#define I40E_GLPE_PFCEQEDROPCNT(_i) (0x001313C0 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLPE_PFCEQEDROPCNT_MAX_INDEX 15
+#define I40E_GLPE_PFCEQEDROPCNT_CEQEDROPCNT_SHIFT 0
+#define I40E_GLPE_PFCEQEDROPCNT_CEQEDROPCNT_MASK I40E_MASK(0xFFFF, I40E_GLPE_PFCEQEDROPCNT_CEQEDROPCNT_SHIFT)
+#define I40E_GLPE_PFCQEDROPCNT(_i) (0x00131340 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */
+#define I40E_GLPE_PFCQEDROPCNT_MAX_INDEX 15
+#define I40E_GLPE_PFCQEDROPCNT_CQEDROPCNT_SHIFT 0
+#define I40E_GLPE_PFCQEDROPCNT_CQEDROPCNT_MASK I40E_MASK(0xFFFF, I40E_GLPE_PFCQEDROPCNT_CQEDROPCNT_SHIFT)
+#define I40E_GLPE_RUPM_CQPPOOL 0x0000DACC /* Reset: PE_CORER */
+#define I40E_GLPE_RUPM_CQPPOOL_CQPSPADS_SHIFT 0
+#define I40E_GLPE_RUPM_CQPPOOL_CQPSPADS_MASK I40E_MASK(0xFF, I40E_GLPE_RUPM_CQPPOOL_CQPSPADS_SHIFT)
+#define I40E_GLPE_RUPM_FLRPOOL 0x0000DAC4 /* Reset: PE_CORER */
+#define I40E_GLPE_RUPM_FLRPOOL_FLRSPADS_SHIFT 0
+#define I40E_GLPE_RUPM_FLRPOOL_FLRSPADS_MASK I40E_MASK(0xFF, I40E_GLPE_RUPM_FLRPOOL_FLRSPADS_SHIFT)
+#define I40E_GLPE_RUPM_GCTL 0x0000DA00 /* Reset: PE_CORER */
+#define I40E_GLPE_RUPM_GCTL_ALLOFFTH_SHIFT 0
+#define I40E_GLPE_RUPM_GCTL_ALLOFFTH_MASK I40E_MASK(0xFF, I40E_GLPE_RUPM_GCTL_ALLOFFTH_SHIFT)
+#define I40E_GLPE_RUPM_GCTL_RUPM_P0_DIS_SHIFT 26
+#define I40E_GLPE_RUPM_GCTL_RUPM_P0_DIS_MASK I40E_MASK(0x1, I40E_GLPE_RUPM_GCTL_RUPM_P0_DIS_SHIFT)
+#define I40E_GLPE_RUPM_GCTL_RUPM_P1_DIS_SHIFT 27
+#define I40E_GLPE_RUPM_GCTL_RUPM_P1_DIS_MASK I40E_MASK(0x1, I40E_GLPE_RUPM_GCTL_RUPM_P1_DIS_SHIFT)
+#define I40E_GLPE_RUPM_GCTL_RUPM_P2_DIS_SHIFT 28
+#define I40E_GLPE_RUPM_GCTL_RUPM_P2_DIS_MASK I40E_MASK(0x1, I40E_GLPE_RUPM_GCTL_RUPM_P2_DIS_SHIFT)
+#define I40E_GLPE_RUPM_GCTL_RUPM_P3_DIS_SHIFT 29
+#define I40E_GLPE_RUPM_GCTL_RUPM_P3_DIS_MASK I40E_MASK(0x1, I40E_GLPE_RUPM_GCTL_RUPM_P3_DIS_SHIFT)
+#define I40E_GLPE_RUPM_GCTL_RUPM_DIS_SHIFT 30
+#define I40E_GLPE_RUPM_GCTL_RUPM_DIS_MASK I40E_MASK(0x1, I40E_GLPE_RUPM_GCTL_RUPM_DIS_SHIFT)
+#define I40E_GLPE_RUPM_GCTL_SWLB_MODE_SHIFT 31
+#define I40E_GLPE_RUPM_GCTL_SWLB_MODE_MASK I40E_MASK(0x1, I40E_GLPE_RUPM_GCTL_SWLB_MODE_SHIFT)
+#define I40E_GLPE_RUPM_PTXPOOL 0x0000DAC8 /* Reset: PE_CORER */
+#define I40E_GLPE_RUPM_PTXPOOL_PTXSPADS_SHIFT 0
+#define I40E_GLPE_RUPM_PTXPOOL_PTXSPADS_MASK I40E_MASK(0xFF, I40E_GLPE_RUPM_PTXPOOL_PTXSPADS_SHIFT)
+#define I40E_GLPE_RUPM_PUSHPOOL 0x0000DAC0 /* Reset: PE_CORER */
+#define I40E_GLPE_RUPM_PUSHPOOL_PUSHSPADS_SHIFT 0
+#define I40E_GLPE_RUPM_PUSHPOOL_PUSHSPADS_MASK I40E_MASK(0xFF, I40E_GLPE_RUPM_PUSHPOOL_PUSHSPADS_SHIFT)
+#define I40E_GLPE_RUPM_TXHOST_EN 0x0000DA08 /* Reset: PE_CORER */
+#define I40E_GLPE_RUPM_TXHOST_EN_TXHOST_EN_SHIFT 0
+#define I40E_GLPE_RUPM_TXHOST_EN_TXHOST_EN_MASK I40E_MASK(0x1, I40E_GLPE_RUPM_TXHOST_EN_TXHOST_EN_SHIFT)
+#define I40E_GLPE_VFAEQEDROPCNT(_i) (0x00132540 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLPE_VFAEQEDROPCNT_MAX_INDEX 31
+#define I40E_GLPE_VFAEQEDROPCNT_AEQEDROPCNT_SHIFT 0
+#define I40E_GLPE_VFAEQEDROPCNT_AEQEDROPCNT_MASK I40E_MASK(0xFFFF, I40E_GLPE_VFAEQEDROPCNT_AEQEDROPCNT_SHIFT)
+#define I40E_GLPE_VFCEQEDROPCNT(_i) (0x00132440 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLPE_VFCEQEDROPCNT_MAX_INDEX 31
+#define I40E_GLPE_VFCEQEDROPCNT_CEQEDROPCNT_SHIFT 0
+#define I40E_GLPE_VFCEQEDROPCNT_CEQEDROPCNT_MASK I40E_MASK(0xFFFF, I40E_GLPE_VFCEQEDROPCNT_CEQEDROPCNT_SHIFT)
+#define I40E_GLPE_VFCQEDROPCNT(_i) (0x00132340 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */
+#define I40E_GLPE_VFCQEDROPCNT_MAX_INDEX 31
+#define I40E_GLPE_VFCQEDROPCNT_CQEDROPCNT_SHIFT 0
+#define I40E_GLPE_VFCQEDROPCNT_CQEDROPCNT_MASK I40E_MASK(0xFFFF, I40E_GLPE_VFCQEDROPCNT_CQEDROPCNT_SHIFT)
+#define I40E_GLPE_VFFLMOBJCTRL(_i) (0x0000D400 + ((_i) * 4)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPE_VFFLMOBJCTRL_MAX_INDEX 31
+#define I40E_GLPE_VFFLMOBJCTRL_XMIT_BLOCKSIZE_SHIFT 0
+#define I40E_GLPE_VFFLMOBJCTRL_XMIT_BLOCKSIZE_MASK I40E_MASK(0x7, I40E_GLPE_VFFLMOBJCTRL_XMIT_BLOCKSIZE_SHIFT)
+#define I40E_GLPE_VFFLMOBJCTRL_Q1_BLOCKSIZE_SHIFT 8
+#define I40E_GLPE_VFFLMOBJCTRL_Q1_BLOCKSIZE_MASK I40E_MASK(0x7, I40E_GLPE_VFFLMOBJCTRL_Q1_BLOCKSIZE_SHIFT)
+#define I40E_GLPE_VFFLMQ1ALLOCERR(_i) (0x0000C700 + ((_i) * 4)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPE_VFFLMQ1ALLOCERR_MAX_INDEX 31
+#define I40E_GLPE_VFFLMQ1ALLOCERR_ERROR_COUNT_SHIFT 0
+#define I40E_GLPE_VFFLMQ1ALLOCERR_ERROR_COUNT_MASK I40E_MASK(0xFFFF, I40E_GLPE_VFFLMQ1ALLOCERR_ERROR_COUNT_SHIFT)
+#define I40E_GLPE_VFFLMXMITALLOCERR(_i) (0x0000C600 + ((_i) * 4)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPE_VFFLMXMITALLOCERR_MAX_INDEX 31
+#define I40E_GLPE_VFFLMXMITALLOCERR_ERROR_COUNT_SHIFT 0
+#define I40E_GLPE_VFFLMXMITALLOCERR_ERROR_COUNT_MASK I40E_MASK(0xFFFF, I40E_GLPE_VFFLMXMITALLOCERR_ERROR_COUNT_SHIFT)
+#define I40E_GLPE_VFUDACTRL(_i) (0x0000C000 + ((_i) * 4)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPE_VFUDACTRL_MAX_INDEX 31
+#define I40E_GLPE_VFUDACTRL_IPV4MCFRAGRESBP_SHIFT 0
+#define I40E_GLPE_VFUDACTRL_IPV4MCFRAGRESBP_MASK I40E_MASK(0x1, I40E_GLPE_VFUDACTRL_IPV4MCFRAGRESBP_SHIFT)
+#define I40E_GLPE_VFUDACTRL_IPV4UCFRAGRESBP_SHIFT 1
+#define I40E_GLPE_VFUDACTRL_IPV4UCFRAGRESBP_MASK I40E_MASK(0x1, I40E_GLPE_VFUDACTRL_IPV4UCFRAGRESBP_SHIFT)
+#define I40E_GLPE_VFUDACTRL_IPV6MCFRAGRESBP_SHIFT 2
+#define I40E_GLPE_VFUDACTRL_IPV6MCFRAGRESBP_MASK I40E_MASK(0x1, I40E_GLPE_VFUDACTRL_IPV6MCFRAGRESBP_SHIFT)
+#define I40E_GLPE_VFUDACTRL_IPV6UCFRAGRESBP_SHIFT 3
+#define I40E_GLPE_VFUDACTRL_IPV6UCFRAGRESBP_MASK I40E_MASK(0x1, I40E_GLPE_VFUDACTRL_IPV6UCFRAGRESBP_SHIFT)
+#define I40E_GLPE_VFUDACTRL_UDPMCFRAGRESFAIL_SHIFT 4
+#define I40E_GLPE_VFUDACTRL_UDPMCFRAGRESFAIL_MASK I40E_MASK(0x1, I40E_GLPE_VFUDACTRL_UDPMCFRAGRESFAIL_SHIFT)
+#define I40E_GLPE_VFUDAUCFBQPN(_i) (0x0000C100 + ((_i) * 4)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPE_VFUDAUCFBQPN_MAX_INDEX 31
+#define I40E_GLPE_VFUDAUCFBQPN_QPN_SHIFT 0
+#define I40E_GLPE_VFUDAUCFBQPN_QPN_MASK I40E_MASK(0x3FFFF, I40E_GLPE_VFUDAUCFBQPN_QPN_SHIFT)
+#define I40E_GLPE_VFUDAUCFBQPN_VALID_SHIFT 31
+#define I40E_GLPE_VFUDAUCFBQPN_VALID_MASK I40E_MASK(0x1, I40E_GLPE_VFUDAUCFBQPN_VALID_SHIFT)
+#define I40E_PFPE_AEQALLOC 0x00131180 /* Reset: PFR */
+#define I40E_PFPE_AEQALLOC_AECOUNT_SHIFT 0
+#define I40E_PFPE_AEQALLOC_AECOUNT_MASK I40E_MASK(0xFFFFFFFF, I40E_PFPE_AEQALLOC_AECOUNT_SHIFT)
+#define I40E_PFPE_CCQPHIGH 0x00008200 /* Reset: PFR */
+#define I40E_PFPE_CCQPHIGH_PECCQPHIGH_SHIFT 0
+#define I40E_PFPE_CCQPHIGH_PECCQPHIGH_MASK I40E_MASK(0xFFFFFFFF, I40E_PFPE_CCQPHIGH_PECCQPHIGH_SHIFT)
+#define I40E_PFPE_CCQPLOW 0x00008180 /* Reset: PFR */
+#define I40E_PFPE_CCQPLOW_PECCQPLOW_SHIFT 0
+#define I40E_PFPE_CCQPLOW_PECCQPLOW_MASK I40E_MASK(0xFFFFFFFF, I40E_PFPE_CCQPLOW_PECCQPLOW_SHIFT)
+#define I40E_PFPE_CCQPSTATUS 0x00008100 /* Reset: PFR */
+#define I40E_PFPE_CCQPSTATUS_CCQP_DONE_SHIFT 0
+#define I40E_PFPE_CCQPSTATUS_CCQP_DONE_MASK I40E_MASK(0x1, I40E_PFPE_CCQPSTATUS_CCQP_DONE_SHIFT)
+#define I40E_PFPE_CCQPSTATUS_HMC_PROFILE_SHIFT 4
+#define I40E_PFPE_CCQPSTATUS_HMC_PROFILE_MASK I40E_MASK(0x7, I40E_PFPE_CCQPSTATUS_HMC_PROFILE_SHIFT)
+#define I40E_PFPE_CCQPSTATUS_RDMA_EN_VFS_SHIFT 16
+#define I40E_PFPE_CCQPSTATUS_RDMA_EN_VFS_MASK I40E_MASK(0x3F, I40E_PFPE_CCQPSTATUS_RDMA_EN_VFS_SHIFT)
+#define I40E_PFPE_CCQPSTATUS_CCQP_ERR_SHIFT 31
+#define I40E_PFPE_CCQPSTATUS_CCQP_ERR_MASK I40E_MASK(0x1, I40E_PFPE_CCQPSTATUS_CCQP_ERR_SHIFT)
+#define I40E_PFPE_CQACK 0x00131100 /* Reset: PFR */
+#define I40E_PFPE_CQACK_PECQID_SHIFT 0
+#define I40E_PFPE_CQACK_PECQID_MASK I40E_MASK(0x1FFFF, I40E_PFPE_CQACK_PECQID_SHIFT)
+#define I40E_PFPE_CQARM 0x00131080 /* Reset: PFR */
+#define I40E_PFPE_CQARM_PECQID_SHIFT 0
+#define I40E_PFPE_CQARM_PECQID_MASK I40E_MASK(0x1FFFF, I40E_PFPE_CQARM_PECQID_SHIFT)
+#define I40E_PFPE_CQPDB 0x00008000 /* Reset: PFR */
+#define I40E_PFPE_CQPDB_WQHEAD_SHIFT 0
+#define I40E_PFPE_CQPDB_WQHEAD_MASK I40E_MASK(0x7FF, I40E_PFPE_CQPDB_WQHEAD_SHIFT)
+#define I40E_PFPE_CQPERRCODES 0x00008880 /* Reset: PFR */
+#define I40E_PFPE_CQPERRCODES_CQP_MINOR_CODE_SHIFT 0
+#define I40E_PFPE_CQPERRCODES_CQP_MINOR_CODE_MASK I40E_MASK(0xFFFF, I40E_PFPE_CQPERRCODES_CQP_MINOR_CODE_SHIFT)
+#define I40E_PFPE_CQPERRCODES_CQP_MAJOR_CODE_SHIFT 16
+#define I40E_PFPE_CQPERRCODES_CQP_MAJOR_CODE_MASK I40E_MASK(0xFFFF, I40E_PFPE_CQPERRCODES_CQP_MAJOR_CODE_SHIFT)
+#define I40E_PFPE_CQPTAIL 0x00008080 /* Reset: PFR */
+#define I40E_PFPE_CQPTAIL_WQTAIL_SHIFT 0
+#define I40E_PFPE_CQPTAIL_WQTAIL_MASK I40E_MASK(0x7FF, I40E_PFPE_CQPTAIL_WQTAIL_SHIFT)
+#define I40E_PFPE_CQPTAIL_CQP_OP_ERR_SHIFT 31
+#define I40E_PFPE_CQPTAIL_CQP_OP_ERR_MASK I40E_MASK(0x1, I40E_PFPE_CQPTAIL_CQP_OP_ERR_SHIFT)
+#define I40E_PFPE_FLMQ1ALLOCERR 0x00008980 /* Reset: PFR */
+#define I40E_PFPE_FLMQ1ALLOCERR_ERROR_COUNT_SHIFT 0
+#define I40E_PFPE_FLMQ1ALLOCERR_ERROR_COUNT_MASK I40E_MASK(0xFFFF, I40E_PFPE_FLMQ1ALLOCERR_ERROR_COUNT_SHIFT)
+#define I40E_PFPE_FLMXMITALLOCERR 0x00008900 /* Reset: PFR */
+#define I40E_PFPE_FLMXMITALLOCERR_ERROR_COUNT_SHIFT 0
+#define I40E_PFPE_FLMXMITALLOCERR_ERROR_COUNT_MASK I40E_MASK(0xFFFF, I40E_PFPE_FLMXMITALLOCERR_ERROR_COUNT_SHIFT)
+#define I40E_PFPE_IPCONFIG0 0x00008280 /* Reset: PFR */
+#define I40E_PFPE_IPCONFIG0_PEIPID_SHIFT 0
+#define I40E_PFPE_IPCONFIG0_PEIPID_MASK I40E_MASK(0xFFFF, I40E_PFPE_IPCONFIG0_PEIPID_SHIFT)
+#define I40E_PFPE_IPCONFIG0_USEENTIREIDRANGE_SHIFT 16
+#define I40E_PFPE_IPCONFIG0_USEENTIREIDRANGE_MASK I40E_MASK(0x1, I40E_PFPE_IPCONFIG0_USEENTIREIDRANGE_SHIFT)
+#define I40E_PFPE_MRTEIDXMASK 0x00008600 /* Reset: PFR */
+#define I40E_PFPE_MRTEIDXMASK_MRTEIDXMASKBITS_SHIFT 0
+#define I40E_PFPE_MRTEIDXMASK_MRTEIDXMASKBITS_MASK I40E_MASK(0x1F, I40E_PFPE_MRTEIDXMASK_MRTEIDXMASKBITS_SHIFT)
+#define I40E_PFPE_RCVUNEXPECTEDERROR 0x00008680 /* Reset: PFR */
+#define I40E_PFPE_RCVUNEXPECTEDERROR_TCP_RX_UNEXP_ERR_SHIFT 0
+#define I40E_PFPE_RCVUNEXPECTEDERROR_TCP_RX_UNEXP_ERR_MASK I40E_MASK(0xFFFFFF, I40E_PFPE_RCVUNEXPECTEDERROR_TCP_RX_UNEXP_ERR_SHIFT)
+#define I40E_PFPE_TCPNOWTIMER 0x00008580 /* Reset: PFR */
+#define I40E_PFPE_TCPNOWTIMER_TCP_NOW_SHIFT 0
+#define I40E_PFPE_TCPNOWTIMER_TCP_NOW_MASK I40E_MASK(0xFFFFFFFF, I40E_PFPE_TCPNOWTIMER_TCP_NOW_SHIFT)
+#define I40E_PFPE_UDACTRL 0x00008700 /* Reset: PFR */
+#define I40E_PFPE_UDACTRL_IPV4MCFRAGRESBP_SHIFT 0
+#define I40E_PFPE_UDACTRL_IPV4MCFRAGRESBP_MASK I40E_MASK(0x1, I40E_PFPE_UDACTRL_IPV4MCFRAGRESBP_SHIFT)
+#define I40E_PFPE_UDACTRL_IPV4UCFRAGRESBP_SHIFT 1
+#define I40E_PFPE_UDACTRL_IPV4UCFRAGRESBP_MASK I40E_MASK(0x1, I40E_PFPE_UDACTRL_IPV4UCFRAGRESBP_SHIFT)
+#define I40E_PFPE_UDACTRL_IPV6MCFRAGRESBP_SHIFT 2
+#define I40E_PFPE_UDACTRL_IPV6MCFRAGRESBP_MASK I40E_MASK(0x1, I40E_PFPE_UDACTRL_IPV6MCFRAGRESBP_SHIFT)
+#define I40E_PFPE_UDACTRL_IPV6UCFRAGRESBP_SHIFT 3
+#define I40E_PFPE_UDACTRL_IPV6UCFRAGRESBP_MASK I40E_MASK(0x1, I40E_PFPE_UDACTRL_IPV6UCFRAGRESBP_SHIFT)
+#define I40E_PFPE_UDACTRL_UDPMCFRAGRESFAIL_SHIFT 4
+#define I40E_PFPE_UDACTRL_UDPMCFRAGRESFAIL_MASK I40E_MASK(0x1, I40E_PFPE_UDACTRL_UDPMCFRAGRESFAIL_SHIFT)
+#define I40E_PFPE_UDAUCFBQPN 0x00008780 /* Reset: PFR */
+#define I40E_PFPE_UDAUCFBQPN_QPN_SHIFT 0
+#define I40E_PFPE_UDAUCFBQPN_QPN_MASK I40E_MASK(0x3FFFF, I40E_PFPE_UDAUCFBQPN_QPN_SHIFT)
+#define I40E_PFPE_UDAUCFBQPN_VALID_SHIFT 31
+#define I40E_PFPE_UDAUCFBQPN_VALID_MASK I40E_MASK(0x1, I40E_PFPE_UDAUCFBQPN_VALID_SHIFT)
+#define I40E_PFPE_WQEALLOC 0x00138C00 /* Reset: PFR */
+#define I40E_PFPE_WQEALLOC_PEQPID_SHIFT 0
+#define I40E_PFPE_WQEALLOC_PEQPID_MASK I40E_MASK(0x3FFFF, I40E_PFPE_WQEALLOC_PEQPID_SHIFT)
+#define I40E_PFPE_WQEALLOC_WQE_DESC_INDEX_SHIFT 20
+#define I40E_PFPE_WQEALLOC_WQE_DESC_INDEX_MASK I40E_MASK(0xFFF, I40E_PFPE_WQEALLOC_WQE_DESC_INDEX_SHIFT)
+#define I40E_PRTDCB_RLPMC 0x0001F140 /* Reset: PE_CORER */
+#define I40E_PRTDCB_RLPMC_TC2PFC_SHIFT 0
+#define I40E_PRTDCB_RLPMC_TC2PFC_MASK I40E_MASK(0xFF, I40E_PRTDCB_RLPMC_TC2PFC_SHIFT)
+#define I40E_PRTDCB_TCMSTC_RLPM(_i) (0x0001F040 + ((_i) * 32)) /* _i=0...7 */ /* Reset: PE_CORER */
+#define I40E_PRTDCB_TCMSTC_RLPM_MAX_INDEX 7
+#define I40E_PRTDCB_TCMSTC_RLPM_MSTC_SHIFT 0
+#define I40E_PRTDCB_TCMSTC_RLPM_MSTC_MASK I40E_MASK(0xFFFFF, I40E_PRTDCB_TCMSTC_RLPM_MSTC_SHIFT)
+#define I40E_PRTDCB_TCPMC_RLPM 0x0001F1A0 /* Reset: PE_CORER */
+#define I40E_PRTDCB_TCPMC_RLPM_CPM_SHIFT 0
+#define I40E_PRTDCB_TCPMC_RLPM_CPM_MASK I40E_MASK(0x1FFF, I40E_PRTDCB_TCPMC_RLPM_CPM_SHIFT)
+#define I40E_PRTDCB_TCPMC_RLPM_LLTC_SHIFT 13
+#define I40E_PRTDCB_TCPMC_RLPM_LLTC_MASK I40E_MASK(0xFF, I40E_PRTDCB_TCPMC_RLPM_LLTC_SHIFT)
+#define I40E_PRTDCB_TCPMC_RLPM_TCPM_MODE_SHIFT 30
+#define I40E_PRTDCB_TCPMC_RLPM_TCPM_MODE_MASK I40E_MASK(0x1, I40E_PRTDCB_TCPMC_RLPM_TCPM_MODE_SHIFT)
+#define I40E_PRTE_RUPM_TCCNTR03 0x0000DAE0 /* Reset: PE_CORER */
+#define I40E_PRTE_RUPM_TCCNTR03_TC0COUNT_SHIFT 0
+#define I40E_PRTE_RUPM_TCCNTR03_TC0COUNT_MASK I40E_MASK(0xFF, I40E_PRTE_RUPM_TCCNTR03_TC0COUNT_SHIFT)
+#define I40E_PRTE_RUPM_TCCNTR03_TC1COUNT_SHIFT 8
+#define I40E_PRTE_RUPM_TCCNTR03_TC1COUNT_MASK I40E_MASK(0xFF, I40E_PRTE_RUPM_TCCNTR03_TC1COUNT_SHIFT)
+#define I40E_PRTE_RUPM_TCCNTR03_TC2COUNT_SHIFT 16
+#define I40E_PRTE_RUPM_TCCNTR03_TC2COUNT_MASK I40E_MASK(0xFF, I40E_PRTE_RUPM_TCCNTR03_TC2COUNT_SHIFT)
+#define I40E_PRTE_RUPM_TCCNTR03_TC3COUNT_SHIFT 24
+#define I40E_PRTE_RUPM_TCCNTR03_TC3COUNT_MASK I40E_MASK(0xFF, I40E_PRTE_RUPM_TCCNTR03_TC3COUNT_SHIFT)
+#define I40E_PRTPE_RUPM_CNTR 0x0000DB20 /* Reset: PE_CORER */
+#define I40E_PRTPE_RUPM_CNTR_COUNT_SHIFT 0
+#define I40E_PRTPE_RUPM_CNTR_COUNT_MASK I40E_MASK(0xFF, I40E_PRTPE_RUPM_CNTR_COUNT_SHIFT)
+#define I40E_PRTPE_RUPM_CTL 0x0000DA40 /* Reset: PE_CORER */
+#define I40E_PRTPE_RUPM_CTL_LLTC_SHIFT 13
+#define I40E_PRTPE_RUPM_CTL_LLTC_MASK I40E_MASK(0xFF, I40E_PRTPE_RUPM_CTL_LLTC_SHIFT)
+#define I40E_PRTPE_RUPM_CTL_RUPM_MODE_SHIFT 30
+#define I40E_PRTPE_RUPM_CTL_RUPM_MODE_MASK I40E_MASK(0x1, I40E_PRTPE_RUPM_CTL_RUPM_MODE_SHIFT)
+#define I40E_PRTPE_RUPM_PFCCTL 0x0000DA60 /* Reset: PE_CORER */
+#define I40E_PRTPE_RUPM_PFCCTL_TC2PFC_SHIFT 0
+#define I40E_PRTPE_RUPM_PFCCTL_TC2PFC_MASK I40E_MASK(0xFF, I40E_PRTPE_RUPM_PFCCTL_TC2PFC_SHIFT)
+#define I40E_PRTPE_RUPM_PFCPC 0x0000DA80 /* Reset: PE_CORER */
+#define I40E_PRTPE_RUPM_PFCPC_PORTOFFTH_SHIFT 0
+#define I40E_PRTPE_RUPM_PFCPC_PORTOFFTH_MASK I40E_MASK(0xFF, I40E_PRTPE_RUPM_PFCPC_PORTOFFTH_SHIFT)
+#define I40E_PRTPE_RUPM_PFCTCC 0x0000DAA0 /* Reset: PE_CORER */
+#define I40E_PRTPE_RUPM_PFCTCC_TCOFFTH_SHIFT 0
+#define I40E_PRTPE_RUPM_PFCTCC_TCOFFTH_MASK I40E_MASK(0xFF, I40E_PRTPE_RUPM_PFCTCC_TCOFFTH_SHIFT)
+#define I40E_PRTPE_RUPM_PFCTCC_LL_PRI_TH_SHIFT 16
+#define I40E_PRTPE_RUPM_PFCTCC_LL_PRI_TH_MASK I40E_MASK(0xFF, I40E_PRTPE_RUPM_PFCTCC_LL_PRI_TH_SHIFT)
+#define I40E_PRTPE_RUPM_PFCTCC_LL_PRI_EN_SHIFT 31
+#define I40E_PRTPE_RUPM_PFCTCC_LL_PRI_EN_MASK I40E_MASK(0x1, I40E_PRTPE_RUPM_PFCTCC_LL_PRI_EN_SHIFT)
+#define I40E_PRTPE_RUPM_PTCTCCNTR47 0x0000DB60 /* Reset: PE_CORER */
+#define I40E_PRTPE_RUPM_PTCTCCNTR47_TC4COUNT_SHIFT 0
+#define I40E_PRTPE_RUPM_PTCTCCNTR47_TC4COUNT_MASK I40E_MASK(0xFF, I40E_PRTPE_RUPM_PTCTCCNTR47_TC4COUNT_SHIFT)
+#define I40E_PRTPE_RUPM_PTCTCCNTR47_TC5COUNT_SHIFT 8
+#define I40E_PRTPE_RUPM_PTCTCCNTR47_TC5COUNT_MASK I40E_MASK(0xFF, I40E_PRTPE_RUPM_PTCTCCNTR47_TC5COUNT_SHIFT)
+#define I40E_PRTPE_RUPM_PTCTCCNTR47_TC6COUNT_SHIFT 16
+#define I40E_PRTPE_RUPM_PTCTCCNTR47_TC6COUNT_MASK I40E_MASK(0xFF, I40E_PRTPE_RUPM_PTCTCCNTR47_TC6COUNT_SHIFT)
+#define I40E_PRTPE_RUPM_PTCTCCNTR47_TC7COUNT_SHIFT 24
+#define I40E_PRTPE_RUPM_PTCTCCNTR47_TC7COUNT_MASK I40E_MASK(0xFF, I40E_PRTPE_RUPM_PTCTCCNTR47_TC7COUNT_SHIFT)
+#define I40E_PRTPE_RUPM_PTXTCCNTR03 0x0000DB40 /* Reset: PE_CORER */
+#define I40E_PRTPE_RUPM_PTXTCCNTR03_TC0COUNT_SHIFT 0
+#define I40E_PRTPE_RUPM_PTXTCCNTR03_TC0COUNT_MASK I40E_MASK(0xFF, I40E_PRTPE_RUPM_PTXTCCNTR03_TC0COUNT_SHIFT)
+#define I40E_PRTPE_RUPM_PTXTCCNTR03_TC1COUNT_SHIFT 8
+#define I40E_PRTPE_RUPM_PTXTCCNTR03_TC1COUNT_MASK I40E_MASK(0xFF, I40E_PRTPE_RUPM_PTXTCCNTR03_TC1COUNT_SHIFT)
+#define I40E_PRTPE_RUPM_PTXTCCNTR03_TC2COUNT_SHIFT 16
+#define I40E_PRTPE_RUPM_PTXTCCNTR03_TC2COUNT_MASK I40E_MASK(0xFF, I40E_PRTPE_RUPM_PTXTCCNTR03_TC2COUNT_SHIFT)
+#define I40E_PRTPE_RUPM_PTXTCCNTR03_TC3COUNT_SHIFT 24
+#define I40E_PRTPE_RUPM_PTXTCCNTR03_TC3COUNT_MASK I40E_MASK(0xFF, I40E_PRTPE_RUPM_PTXTCCNTR03_TC3COUNT_SHIFT)
+#define I40E_PRTPE_RUPM_TCCNTR47 0x0000DB00 /* Reset: PE_CORER */
+#define I40E_PRTPE_RUPM_TCCNTR47_TC4COUNT_SHIFT 0
+#define I40E_PRTPE_RUPM_TCCNTR47_TC4COUNT_MASK I40E_MASK(0xFF, I40E_PRTPE_RUPM_TCCNTR47_TC4COUNT_SHIFT)
+#define I40E_PRTPE_RUPM_TCCNTR47_TC5COUNT_SHIFT 8
+#define I40E_PRTPE_RUPM_TCCNTR47_TC5COUNT_MASK I40E_MASK(0xFF, I40E_PRTPE_RUPM_TCCNTR47_TC5COUNT_SHIFT)
+#define I40E_PRTPE_RUPM_TCCNTR47_TC6COUNT_SHIFT 16
+#define I40E_PRTPE_RUPM_TCCNTR47_TC6COUNT_MASK I40E_MASK(0xFF, I40E_PRTPE_RUPM_TCCNTR47_TC6COUNT_SHIFT)
+#define I40E_PRTPE_RUPM_TCCNTR47_TC7COUNT_SHIFT 24
+#define I40E_PRTPE_RUPM_TCCNTR47_TC7COUNT_MASK I40E_MASK(0xFF, I40E_PRTPE_RUPM_TCCNTR47_TC7COUNT_SHIFT)
+#define I40E_PRTPE_RUPM_THRES 0x0000DA20 /* Reset: PE_CORER */
+#define I40E_PRTPE_RUPM_THRES_MINSPADSPERTC_SHIFT 0
+#define I40E_PRTPE_RUPM_THRES_MINSPADSPERTC_MASK I40E_MASK(0xFF, I40E_PRTPE_RUPM_THRES_MINSPADSPERTC_SHIFT)
+#define I40E_PRTPE_RUPM_THRES_MAXSPADS_SHIFT 8
+#define I40E_PRTPE_RUPM_THRES_MAXSPADS_MASK I40E_MASK(0xFF, I40E_PRTPE_RUPM_THRES_MAXSPADS_SHIFT)
+#define I40E_PRTPE_RUPM_THRES_MAXSPADSPERTC_SHIFT 16
+#define I40E_PRTPE_RUPM_THRES_MAXSPADSPERTC_MASK I40E_MASK(0xFF, I40E_PRTPE_RUPM_THRES_MAXSPADSPERTC_SHIFT)
+#define I40E_VFPE_AEQALLOC(_VF) (0x00130C00 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: VFR */
+#define I40E_VFPE_AEQALLOC_MAX_INDEX 127
+#define I40E_VFPE_AEQALLOC_AECOUNT_SHIFT 0
+#define I40E_VFPE_AEQALLOC_AECOUNT_MASK I40E_MASK(0xFFFFFFFF, I40E_VFPE_AEQALLOC_AECOUNT_SHIFT)
+#define I40E_VFPE_CCQPHIGH(_VF) (0x00001000 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: VFR */
+#define I40E_VFPE_CCQPHIGH_MAX_INDEX 127
+#define I40E_VFPE_CCQPHIGH_PECCQPHIGH_SHIFT 0
+#define I40E_VFPE_CCQPHIGH_PECCQPHIGH_MASK I40E_MASK(0xFFFFFFFF, I40E_VFPE_CCQPHIGH_PECCQPHIGH_SHIFT)
+#define I40E_VFPE_CCQPLOW(_VF) (0x00000C00 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: VFR */
+#define I40E_VFPE_CCQPLOW_MAX_INDEX 127
+#define I40E_VFPE_CCQPLOW_PECCQPLOW_SHIFT 0
+#define I40E_VFPE_CCQPLOW_PECCQPLOW_MASK I40E_MASK(0xFFFFFFFF, I40E_VFPE_CCQPLOW_PECCQPLOW_SHIFT)
+#define I40E_VFPE_CCQPSTATUS(_VF) (0x00000800 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: VFR */
+#define I40E_VFPE_CCQPSTATUS_MAX_INDEX 127
+#define I40E_VFPE_CCQPSTATUS_CCQP_DONE_SHIFT 0
+#define I40E_VFPE_CCQPSTATUS_CCQP_DONE_MASK I40E_MASK(0x1, I40E_VFPE_CCQPSTATUS_CCQP_DONE_SHIFT)
+#define I40E_VFPE_CCQPSTATUS_HMC_PROFILE_SHIFT 4
+#define I40E_VFPE_CCQPSTATUS_HMC_PROFILE_MASK I40E_MASK(0x7, I40E_VFPE_CCQPSTATUS_HMC_PROFILE_SHIFT)
+#define I40E_VFPE_CCQPSTATUS_RDMA_EN_VFS_SHIFT 16
+#define I40E_VFPE_CCQPSTATUS_RDMA_EN_VFS_MASK I40E_MASK(0x3F, I40E_VFPE_CCQPSTATUS_RDMA_EN_VFS_SHIFT)
+#define I40E_VFPE_CCQPSTATUS_CCQP_ERR_SHIFT 31
+#define I40E_VFPE_CCQPSTATUS_CCQP_ERR_MASK I40E_MASK(0x1, I40E_VFPE_CCQPSTATUS_CCQP_ERR_SHIFT)
+#define I40E_VFPE_CQACK(_VF) (0x00130800 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: VFR */
+#define I40E_VFPE_CQACK_MAX_INDEX 127
+#define I40E_VFPE_CQACK_PECQID_SHIFT 0
+#define I40E_VFPE_CQACK_PECQID_MASK I40E_MASK(0x1FFFF, I40E_VFPE_CQACK_PECQID_SHIFT)
+#define I40E_VFPE_CQARM(_VF) (0x00130400 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: VFR */
+#define I40E_VFPE_CQARM_MAX_INDEX 127
+#define I40E_VFPE_CQARM_PECQID_SHIFT 0
+#define I40E_VFPE_CQARM_PECQID_MASK I40E_MASK(0x1FFFF, I40E_VFPE_CQARM_PECQID_SHIFT)
+#define I40E_VFPE_CQPDB(_VF) (0x00000000 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: VFR */
+#define I40E_VFPE_CQPDB_MAX_INDEX 127
+#define I40E_VFPE_CQPDB_WQHEAD_SHIFT 0
+#define I40E_VFPE_CQPDB_WQHEAD_MASK I40E_MASK(0x7FF, I40E_VFPE_CQPDB_WQHEAD_SHIFT)
+#define I40E_VFPE_CQPERRCODES(_VF) (0x00001800 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: VFR */
+#define I40E_VFPE_CQPERRCODES_MAX_INDEX 127
+#define I40E_VFPE_CQPERRCODES_CQP_MINOR_CODE_SHIFT 0
+#define I40E_VFPE_CQPERRCODES_CQP_MINOR_CODE_MASK I40E_MASK(0xFFFF, I40E_VFPE_CQPERRCODES_CQP_MINOR_CODE_SHIFT)
+#define I40E_VFPE_CQPERRCODES_CQP_MAJOR_CODE_SHIFT 16
+#define I40E_VFPE_CQPERRCODES_CQP_MAJOR_CODE_MASK I40E_MASK(0xFFFF, I40E_VFPE_CQPERRCODES_CQP_MAJOR_CODE_SHIFT)
+#define I40E_VFPE_CQPTAIL(_VF) (0x00000400 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: VFR */
+#define I40E_VFPE_CQPTAIL_MAX_INDEX 127
+#define I40E_VFPE_CQPTAIL_WQTAIL_SHIFT 0
+#define I40E_VFPE_CQPTAIL_WQTAIL_MASK I40E_MASK(0x7FF, I40E_VFPE_CQPTAIL_WQTAIL_SHIFT)
+#define I40E_VFPE_CQPTAIL_CQP_OP_ERR_SHIFT 31
+#define I40E_VFPE_CQPTAIL_CQP_OP_ERR_MASK I40E_MASK(0x1, I40E_VFPE_CQPTAIL_CQP_OP_ERR_SHIFT)
+#define I40E_VFPE_IPCONFIG0(_VF) (0x00001400 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: VFR */
+#define I40E_VFPE_IPCONFIG0_MAX_INDEX 127
+#define I40E_VFPE_IPCONFIG0_PEIPID_SHIFT 0
+#define I40E_VFPE_IPCONFIG0_PEIPID_MASK I40E_MASK(0xFFFF, I40E_VFPE_IPCONFIG0_PEIPID_SHIFT)
+#define I40E_VFPE_IPCONFIG0_USEENTIREIDRANGE_SHIFT 16
+#define I40E_VFPE_IPCONFIG0_USEENTIREIDRANGE_MASK I40E_MASK(0x1, I40E_VFPE_IPCONFIG0_USEENTIREIDRANGE_SHIFT)
+#define I40E_VFPE_MRTEIDXMASK(_VF) (0x00003000 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: VFR */
+#define I40E_VFPE_MRTEIDXMASK_MAX_INDEX 127
+#define I40E_VFPE_MRTEIDXMASK_MRTEIDXMASKBITS_SHIFT 0
+#define I40E_VFPE_MRTEIDXMASK_MRTEIDXMASKBITS_MASK I40E_MASK(0x1F, I40E_VFPE_MRTEIDXMASK_MRTEIDXMASKBITS_SHIFT)
+#define I40E_VFPE_RCVUNEXPECTEDERROR(_VF) (0x00003400 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: VFR */
+#define I40E_VFPE_RCVUNEXPECTEDERROR_MAX_INDEX 127
+#define I40E_VFPE_RCVUNEXPECTEDERROR_TCP_RX_UNEXP_ERR_SHIFT 0
+#define I40E_VFPE_RCVUNEXPECTEDERROR_TCP_RX_UNEXP_ERR_MASK I40E_MASK(0xFFFFFF, I40E_VFPE_RCVUNEXPECTEDERROR_TCP_RX_UNEXP_ERR_SHIFT)
+#define I40E_VFPE_TCPNOWTIMER(_VF) (0x00002C00 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: VFR */
+#define I40E_VFPE_TCPNOWTIMER_MAX_INDEX 127
+#define I40E_VFPE_TCPNOWTIMER_TCP_NOW_SHIFT 0
+#define I40E_VFPE_TCPNOWTIMER_TCP_NOW_MASK I40E_MASK(0xFFFFFFFF, I40E_VFPE_TCPNOWTIMER_TCP_NOW_SHIFT)
+#define I40E_VFPE_WQEALLOC(_VF) (0x00138000 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: VFR */
+#define I40E_VFPE_WQEALLOC_MAX_INDEX 127
+#define I40E_VFPE_WQEALLOC_PEQPID_SHIFT 0
+#define I40E_VFPE_WQEALLOC_PEQPID_MASK I40E_MASK(0x3FFFF, I40E_VFPE_WQEALLOC_PEQPID_SHIFT)
+#define I40E_VFPE_WQEALLOC_WQE_DESC_INDEX_SHIFT 20
+#define I40E_VFPE_WQEALLOC_WQE_DESC_INDEX_MASK I40E_MASK(0xFFF, I40E_VFPE_WQEALLOC_WQE_DESC_INDEX_SHIFT)
+#define I40E_GLPES_PFIP4RXDISCARD(_i) (0x00010600 + ((_i) * 4)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP4RXDISCARD_MAX_INDEX 15
+#define I40E_GLPES_PFIP4RXDISCARD_IP4RXDISCARD_SHIFT 0
+#define I40E_GLPES_PFIP4RXDISCARD_IP4RXDISCARD_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFIP4RXDISCARD_IP4RXDISCARD_SHIFT)
+#define I40E_GLPES_PFIP4RXFRAGSHI(_i) (0x00010804 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP4RXFRAGSHI_MAX_INDEX 15
+#define I40E_GLPES_PFIP4RXFRAGSHI_IP4RXFRAGSHI_SHIFT 0
+#define I40E_GLPES_PFIP4RXFRAGSHI_IP4RXFRAGSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFIP4RXFRAGSHI_IP4RXFRAGSHI_SHIFT)
+#define I40E_GLPES_PFIP4RXFRAGSLO(_i) (0x00010800 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP4RXFRAGSLO_MAX_INDEX 15
+#define I40E_GLPES_PFIP4RXFRAGSLO_IP4RXFRAGSLO_SHIFT 0
+#define I40E_GLPES_PFIP4RXFRAGSLO_IP4RXFRAGSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFIP4RXFRAGSLO_IP4RXFRAGSLO_SHIFT)
+#define I40E_GLPES_PFIP4RXMCOCTSHI(_i) (0x00010A04 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP4RXMCOCTSHI_MAX_INDEX 15
+#define I40E_GLPES_PFIP4RXMCOCTSHI_IP4RXMCOCTSHI_SHIFT 0
+#define I40E_GLPES_PFIP4RXMCOCTSHI_IP4RXMCOCTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFIP4RXMCOCTSHI_IP4RXMCOCTSHI_SHIFT)
+#define I40E_GLPES_PFIP4RXMCOCTSLO(_i) (0x00010A00 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP4RXMCOCTSLO_MAX_INDEX 15
+#define I40E_GLPES_PFIP4RXMCOCTSLO_IP4RXMCOCTSLO_SHIFT 0
+#define I40E_GLPES_PFIP4RXMCOCTSLO_IP4RXMCOCTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFIP4RXMCOCTSLO_IP4RXMCOCTSLO_SHIFT)
+#define I40E_GLPES_PFIP4RXMCPKTSHI(_i) (0x00010C04 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP4RXMCPKTSHI_MAX_INDEX 15
+#define I40E_GLPES_PFIP4RXMCPKTSHI_IP4RXMCPKTSHI_SHIFT 0
+#define I40E_GLPES_PFIP4RXMCPKTSHI_IP4RXMCPKTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFIP4RXMCPKTSHI_IP4RXMCPKTSHI_SHIFT)
+#define I40E_GLPES_PFIP4RXMCPKTSLO(_i) (0x00010C00 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP4RXMCPKTSLO_MAX_INDEX 15
+#define I40E_GLPES_PFIP4RXMCPKTSLO_IP4RXMCPKTSLO_SHIFT 0
+#define I40E_GLPES_PFIP4RXMCPKTSLO_IP4RXMCPKTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFIP4RXMCPKTSLO_IP4RXMCPKTSLO_SHIFT)
+#define I40E_GLPES_PFIP4RXOCTSHI(_i) (0x00010204 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP4RXOCTSHI_MAX_INDEX 15
+#define I40E_GLPES_PFIP4RXOCTSHI_IP4RXOCTSHI_SHIFT 0
+#define I40E_GLPES_PFIP4RXOCTSHI_IP4RXOCTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFIP4RXOCTSHI_IP4RXOCTSHI_SHIFT)
+#define I40E_GLPES_PFIP4RXOCTSLO(_i) (0x00010200 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP4RXOCTSLO_MAX_INDEX 15
+#define I40E_GLPES_PFIP4RXOCTSLO_IP4RXOCTSLO_SHIFT 0
+#define I40E_GLPES_PFIP4RXOCTSLO_IP4RXOCTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFIP4RXOCTSLO_IP4RXOCTSLO_SHIFT)
+#define I40E_GLPES_PFIP4RXPKTSHI(_i) (0x00010404 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP4RXPKTSHI_MAX_INDEX 15
+#define I40E_GLPES_PFIP4RXPKTSHI_IP4RXPKTSHI_SHIFT 0
+#define I40E_GLPES_PFIP4RXPKTSHI_IP4RXPKTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFIP4RXPKTSHI_IP4RXPKTSHI_SHIFT)
+#define I40E_GLPES_PFIP4RXPKTSLO(_i) (0x00010400 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP4RXPKTSLO_MAX_INDEX 15
+#define I40E_GLPES_PFIP4RXPKTSLO_IP4RXPKTSLO_SHIFT 0
+#define I40E_GLPES_PFIP4RXPKTSLO_IP4RXPKTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFIP4RXPKTSLO_IP4RXPKTSLO_SHIFT)
+#define I40E_GLPES_PFIP4RXTRUNC(_i) (0x00010700 + ((_i) * 4)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP4RXTRUNC_MAX_INDEX 15
+#define I40E_GLPES_PFIP4RXTRUNC_IP4RXTRUNC_SHIFT 0
+#define I40E_GLPES_PFIP4RXTRUNC_IP4RXTRUNC_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFIP4RXTRUNC_IP4RXTRUNC_SHIFT)
+#define I40E_GLPES_PFIP4TXFRAGSHI(_i) (0x00011E04 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP4TXFRAGSHI_MAX_INDEX 15
+#define I40E_GLPES_PFIP4TXFRAGSHI_IP4TXFRAGSHI_SHIFT 0
+#define I40E_GLPES_PFIP4TXFRAGSHI_IP4TXFRAGSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFIP4TXFRAGSHI_IP4TXFRAGSHI_SHIFT)
+#define I40E_GLPES_PFIP4TXFRAGSLO(_i) (0x00011E00 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP4TXFRAGSLO_MAX_INDEX 15
+#define I40E_GLPES_PFIP4TXFRAGSLO_IP4TXFRAGSLO_SHIFT 0
+#define I40E_GLPES_PFIP4TXFRAGSLO_IP4TXFRAGSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFIP4TXFRAGSLO_IP4TXFRAGSLO_SHIFT)
+#define I40E_GLPES_PFIP4TXMCOCTSHI(_i) (0x00012004 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP4TXMCOCTSHI_MAX_INDEX 15
+#define I40E_GLPES_PFIP4TXMCOCTSHI_IP4TXMCOCTSHI_SHIFT 0
+#define I40E_GLPES_PFIP4TXMCOCTSHI_IP4TXMCOCTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFIP4TXMCOCTSHI_IP4TXMCOCTSHI_SHIFT)
+#define I40E_GLPES_PFIP4TXMCOCTSLO(_i) (0x00012000 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP4TXMCOCTSLO_MAX_INDEX 15
+#define I40E_GLPES_PFIP4TXMCOCTSLO_IP4TXMCOCTSLO_SHIFT 0
+#define I40E_GLPES_PFIP4TXMCOCTSLO_IP4TXMCOCTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFIP4TXMCOCTSLO_IP4TXMCOCTSLO_SHIFT)
+#define I40E_GLPES_PFIP4TXMCPKTSHI(_i) (0x00012204 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP4TXMCPKTSHI_MAX_INDEX 15
+#define I40E_GLPES_PFIP4TXMCPKTSHI_IP4TXMCPKTSHI_SHIFT 0
+#define I40E_GLPES_PFIP4TXMCPKTSHI_IP4TXMCPKTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFIP4TXMCPKTSHI_IP4TXMCPKTSHI_SHIFT)
+#define I40E_GLPES_PFIP4TXMCPKTSLO(_i) (0x00012200 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP4TXMCPKTSLO_MAX_INDEX 15
+#define I40E_GLPES_PFIP4TXMCPKTSLO_IP4TXMCPKTSLO_SHIFT 0
+#define I40E_GLPES_PFIP4TXMCPKTSLO_IP4TXMCPKTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFIP4TXMCPKTSLO_IP4TXMCPKTSLO_SHIFT)
+#define I40E_GLPES_PFIP4TXNOROUTE(_i) (0x00012E00 + ((_i) * 4)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP4TXNOROUTE_MAX_INDEX 15
+#define I40E_GLPES_PFIP4TXNOROUTE_IP4TXNOROUTE_SHIFT 0
+#define I40E_GLPES_PFIP4TXNOROUTE_IP4TXNOROUTE_MASK I40E_MASK(0xFFFFFF, I40E_GLPES_PFIP4TXNOROUTE_IP4TXNOROUTE_SHIFT)
+#define I40E_GLPES_PFIP4TXOCTSHI(_i) (0x00011A04 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP4TXOCTSHI_MAX_INDEX 15
+#define I40E_GLPES_PFIP4TXOCTSHI_IP4TXOCTSHI_SHIFT 0
+#define I40E_GLPES_PFIP4TXOCTSHI_IP4TXOCTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFIP4TXOCTSHI_IP4TXOCTSHI_SHIFT)
+#define I40E_GLPES_PFIP4TXOCTSLO(_i) (0x00011A00 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP4TXOCTSLO_MAX_INDEX 15
+#define I40E_GLPES_PFIP4TXOCTSLO_IP4TXOCTSLO_SHIFT 0
+#define I40E_GLPES_PFIP4TXOCTSLO_IP4TXOCTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFIP4TXOCTSLO_IP4TXOCTSLO_SHIFT)
+#define I40E_GLPES_PFIP4TXPKTSHI(_i) (0x00011C04 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP4TXPKTSHI_MAX_INDEX 15
+#define I40E_GLPES_PFIP4TXPKTSHI_IP4TXPKTSHI_SHIFT 0
+#define I40E_GLPES_PFIP4TXPKTSHI_IP4TXPKTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFIP4TXPKTSHI_IP4TXPKTSHI_SHIFT)
+#define I40E_GLPES_PFIP4TXPKTSLO(_i) (0x00011C00 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP4TXPKTSLO_MAX_INDEX 15
+#define I40E_GLPES_PFIP4TXPKTSLO_IP4TXPKTSLO_SHIFT 0
+#define I40E_GLPES_PFIP4TXPKTSLO_IP4TXPKTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFIP4TXPKTSLO_IP4TXPKTSLO_SHIFT)
+#define I40E_GLPES_PFIP6RXDISCARD(_i) (0x00011200 + ((_i) * 4)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP6RXDISCARD_MAX_INDEX 15
+#define I40E_GLPES_PFIP6RXDISCARD_IP6RXDISCARD_SHIFT 0
+#define I40E_GLPES_PFIP6RXDISCARD_IP6RXDISCARD_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFIP6RXDISCARD_IP6RXDISCARD_SHIFT)
+#define I40E_GLPES_PFIP6RXFRAGSHI(_i) (0x00011404 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP6RXFRAGSHI_MAX_INDEX 15
+#define I40E_GLPES_PFIP6RXFRAGSHI_IP6RXFRAGSHI_SHIFT 0
+#define I40E_GLPES_PFIP6RXFRAGSHI_IP6RXFRAGSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFIP6RXFRAGSHI_IP6RXFRAGSHI_SHIFT)
+#define I40E_GLPES_PFIP6RXFRAGSLO(_i) (0x00011400 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP6RXFRAGSLO_MAX_INDEX 15
+#define I40E_GLPES_PFIP6RXFRAGSLO_IP6RXFRAGSLO_SHIFT 0
+#define I40E_GLPES_PFIP6RXFRAGSLO_IP6RXFRAGSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFIP6RXFRAGSLO_IP6RXFRAGSLO_SHIFT)
+#define I40E_GLPES_PFIP6RXMCOCTSHI(_i) (0x00011604 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP6RXMCOCTSHI_MAX_INDEX 15
+#define I40E_GLPES_PFIP6RXMCOCTSHI_IP6RXMCOCTSHI_SHIFT 0
+#define I40E_GLPES_PFIP6RXMCOCTSHI_IP6RXMCOCTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFIP6RXMCOCTSHI_IP6RXMCOCTSHI_SHIFT)
+#define I40E_GLPES_PFIP6RXMCOCTSLO(_i) (0x00011600 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP6RXMCOCTSLO_MAX_INDEX 15
+#define I40E_GLPES_PFIP6RXMCOCTSLO_IP6RXMCOCTSLO_SHIFT 0
+#define I40E_GLPES_PFIP6RXMCOCTSLO_IP6RXMCOCTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFIP6RXMCOCTSLO_IP6RXMCOCTSLO_SHIFT)
+#define I40E_GLPES_PFIP6RXMCPKTSHI(_i) (0x00011804 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP6RXMCPKTSHI_MAX_INDEX 15
+#define I40E_GLPES_PFIP6RXMCPKTSHI_IP6RXMCPKTSHI_SHIFT 0
+#define I40E_GLPES_PFIP6RXMCPKTSHI_IP6RXMCPKTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFIP6RXMCPKTSHI_IP6RXMCPKTSHI_SHIFT)
+#define I40E_GLPES_PFIP6RXMCPKTSLO(_i) (0x00011800 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP6RXMCPKTSLO_MAX_INDEX 15
+#define I40E_GLPES_PFIP6RXMCPKTSLO_IP6RXMCPKTSLO_SHIFT 0
+#define I40E_GLPES_PFIP6RXMCPKTSLO_IP6RXMCPKTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFIP6RXMCPKTSLO_IP6RXMCPKTSLO_SHIFT)
+#define I40E_GLPES_PFIP6RXOCTSHI(_i) (0x00010E04 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP6RXOCTSHI_MAX_INDEX 15
+#define I40E_GLPES_PFIP6RXOCTSHI_IP6RXOCTSHI_SHIFT 0
+#define I40E_GLPES_PFIP6RXOCTSHI_IP6RXOCTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFIP6RXOCTSHI_IP6RXOCTSHI_SHIFT)
+#define I40E_GLPES_PFIP6RXOCTSLO(_i) (0x00010E00 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP6RXOCTSLO_MAX_INDEX 15
+#define I40E_GLPES_PFIP6RXOCTSLO_IP6RXOCTSLO_SHIFT 0
+#define I40E_GLPES_PFIP6RXOCTSLO_IP6RXOCTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFIP6RXOCTSLO_IP6RXOCTSLO_SHIFT)
+#define I40E_GLPES_PFIP6RXPKTSHI(_i) (0x00011004 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP6RXPKTSHI_MAX_INDEX 15
+#define I40E_GLPES_PFIP6RXPKTSHI_IP6RXPKTSHI_SHIFT 0
+#define I40E_GLPES_PFIP6RXPKTSHI_IP6RXPKTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFIP6RXPKTSHI_IP6RXPKTSHI_SHIFT)
+#define I40E_GLPES_PFIP6RXPKTSLO(_i) (0x00011000 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP6RXPKTSLO_MAX_INDEX 15
+#define I40E_GLPES_PFIP6RXPKTSLO_IP6RXPKTSLO_SHIFT 0
+#define I40E_GLPES_PFIP6RXPKTSLO_IP6RXPKTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFIP6RXPKTSLO_IP6RXPKTSLO_SHIFT)
+#define I40E_GLPES_PFIP6RXTRUNC(_i) (0x00011300 + ((_i) * 4)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP6RXTRUNC_MAX_INDEX 15
+#define I40E_GLPES_PFIP6RXTRUNC_IP6RXTRUNC_SHIFT 0
+#define I40E_GLPES_PFIP6RXTRUNC_IP6RXTRUNC_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFIP6RXTRUNC_IP6RXTRUNC_SHIFT)
+#define I40E_GLPES_PFIP6TXFRAGSHI(_i) (0x00012804 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP6TXFRAGSHI_MAX_INDEX 15
+#define I40E_GLPES_PFIP6TXFRAGSHI_IP6TXFRAGSHI_SHIFT 0
+#define I40E_GLPES_PFIP6TXFRAGSHI_IP6TXFRAGSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFIP6TXFRAGSHI_IP6TXFRAGSHI_SHIFT)
+#define I40E_GLPES_PFIP6TXFRAGSLO(_i) (0x00012800 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP6TXFRAGSLO_MAX_INDEX 15
+#define I40E_GLPES_PFIP6TXFRAGSLO_IP6TXFRAGSLO_SHIFT 0
+#define I40E_GLPES_PFIP6TXFRAGSLO_IP6TXFRAGSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFIP6TXFRAGSLO_IP6TXFRAGSLO_SHIFT)
+#define I40E_GLPES_PFIP6TXMCOCTSHI(_i) (0x00012A04 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP6TXMCOCTSHI_MAX_INDEX 15
+#define I40E_GLPES_PFIP6TXMCOCTSHI_IP6TXMCOCTSHI_SHIFT 0
+#define I40E_GLPES_PFIP6TXMCOCTSHI_IP6TXMCOCTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFIP6TXMCOCTSHI_IP6TXMCOCTSHI_SHIFT)
+#define I40E_GLPES_PFIP6TXMCOCTSLO(_i) (0x00012A00 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP6TXMCOCTSLO_MAX_INDEX 15
+#define I40E_GLPES_PFIP6TXMCOCTSLO_IP6TXMCOCTSLO_SHIFT 0
+#define I40E_GLPES_PFIP6TXMCOCTSLO_IP6TXMCOCTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFIP6TXMCOCTSLO_IP6TXMCOCTSLO_SHIFT)
+#define I40E_GLPES_PFIP6TXMCPKTSHI(_i) (0x00012C04 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP6TXMCPKTSHI_MAX_INDEX 15
+#define I40E_GLPES_PFIP6TXMCPKTSHI_IP6TXMCPKTSHI_SHIFT 0
+#define I40E_GLPES_PFIP6TXMCPKTSHI_IP6TXMCPKTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFIP6TXMCPKTSHI_IP6TXMCPKTSHI_SHIFT)
+#define I40E_GLPES_PFIP6TXMCPKTSLO(_i) (0x00012C00 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP6TXMCPKTSLO_MAX_INDEX 15
+#define I40E_GLPES_PFIP6TXMCPKTSLO_IP6TXMCPKTSLO_SHIFT 0
+#define I40E_GLPES_PFIP6TXMCPKTSLO_IP6TXMCPKTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFIP6TXMCPKTSLO_IP6TXMCPKTSLO_SHIFT)
+#define I40E_GLPES_PFIP6TXNOROUTE(_i) (0x00012F00 + ((_i) * 4)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP6TXNOROUTE_MAX_INDEX 15
+#define I40E_GLPES_PFIP6TXNOROUTE_IP6TXNOROUTE_SHIFT 0
+#define I40E_GLPES_PFIP6TXNOROUTE_IP6TXNOROUTE_MASK I40E_MASK(0xFFFFFF, I40E_GLPES_PFIP6TXNOROUTE_IP6TXNOROUTE_SHIFT)
+#define I40E_GLPES_PFIP6TXOCTSHI(_i) (0x00012404 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP6TXOCTSHI_MAX_INDEX 15
+#define I40E_GLPES_PFIP6TXOCTSHI_IP6TXOCTSHI_SHIFT 0
+#define I40E_GLPES_PFIP6TXOCTSHI_IP6TXOCTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFIP6TXOCTSHI_IP6TXOCTSHI_SHIFT)
+#define I40E_GLPES_PFIP6TXOCTSLO(_i) (0x00012400 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP6TXOCTSLO_MAX_INDEX 15
+#define I40E_GLPES_PFIP6TXOCTSLO_IP6TXOCTSLO_SHIFT 0
+#define I40E_GLPES_PFIP6TXOCTSLO_IP6TXOCTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFIP6TXOCTSLO_IP6TXOCTSLO_SHIFT)
+#define I40E_GLPES_PFIP6TXPKTSHI(_i) (0x00012604 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP6TXPKTSHI_MAX_INDEX 15
+#define I40E_GLPES_PFIP6TXPKTSHI_IP6TXPKTSHI_SHIFT 0
+#define I40E_GLPES_PFIP6TXPKTSHI_IP6TXPKTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFIP6TXPKTSHI_IP6TXPKTSHI_SHIFT)
+#define I40E_GLPES_PFIP6TXPKTSLO(_i) (0x00012600 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFIP6TXPKTSLO_MAX_INDEX 15
+#define I40E_GLPES_PFIP6TXPKTSLO_IP6TXPKTSLO_SHIFT 0
+#define I40E_GLPES_PFIP6TXPKTSLO_IP6TXPKTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFIP6TXPKTSLO_IP6TXPKTSLO_SHIFT)
+#define I40E_GLPES_PFRDMARXRDSHI(_i) (0x00013E04 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFRDMARXRDSHI_MAX_INDEX 15
+#define I40E_GLPES_PFRDMARXRDSHI_RDMARXRDSHI_SHIFT 0
+#define I40E_GLPES_PFRDMARXRDSHI_RDMARXRDSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFRDMARXRDSHI_RDMARXRDSHI_SHIFT)
+#define I40E_GLPES_PFRDMARXRDSLO(_i) (0x00013E00 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFRDMARXRDSLO_MAX_INDEX 15
+#define I40E_GLPES_PFRDMARXRDSLO_RDMARXRDSLO_SHIFT 0
+#define I40E_GLPES_PFRDMARXRDSLO_RDMARXRDSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFRDMARXRDSLO_RDMARXRDSLO_SHIFT)
+#define I40E_GLPES_PFRDMARXSNDSHI(_i) (0x00014004 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFRDMARXSNDSHI_MAX_INDEX 15
+#define I40E_GLPES_PFRDMARXSNDSHI_RDMARXSNDSHI_SHIFT 0
+#define I40E_GLPES_PFRDMARXSNDSHI_RDMARXSNDSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFRDMARXSNDSHI_RDMARXSNDSHI_SHIFT)
+#define I40E_GLPES_PFRDMARXSNDSLO(_i) (0x00014000 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFRDMARXSNDSLO_MAX_INDEX 15
+#define I40E_GLPES_PFRDMARXSNDSLO_RDMARXSNDSLO_SHIFT 0
+#define I40E_GLPES_PFRDMARXSNDSLO_RDMARXSNDSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFRDMARXSNDSLO_RDMARXSNDSLO_SHIFT)
+#define I40E_GLPES_PFRDMARXWRSHI(_i) (0x00013C04 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFRDMARXWRSHI_MAX_INDEX 15
+#define I40E_GLPES_PFRDMARXWRSHI_RDMARXWRSHI_SHIFT 0
+#define I40E_GLPES_PFRDMARXWRSHI_RDMARXWRSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFRDMARXWRSHI_RDMARXWRSHI_SHIFT)
+#define I40E_GLPES_PFRDMARXWRSLO(_i) (0x00013C00 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFRDMARXWRSLO_MAX_INDEX 15
+#define I40E_GLPES_PFRDMARXWRSLO_RDMARXWRSLO_SHIFT 0
+#define I40E_GLPES_PFRDMARXWRSLO_RDMARXWRSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFRDMARXWRSLO_RDMARXWRSLO_SHIFT)
+#define I40E_GLPES_PFRDMATXRDSHI(_i) (0x00014404 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFRDMATXRDSHI_MAX_INDEX 15
+#define I40E_GLPES_PFRDMATXRDSHI_RDMARXRDSHI_SHIFT 0
+#define I40E_GLPES_PFRDMATXRDSHI_RDMARXRDSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFRDMATXRDSHI_RDMARXRDSHI_SHIFT)
+#define I40E_GLPES_PFRDMATXRDSLO(_i) (0x00014400 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFRDMATXRDSLO_MAX_INDEX 15
+#define I40E_GLPES_PFRDMATXRDSLO_RDMARXRDSLO_SHIFT 0
+#define I40E_GLPES_PFRDMATXRDSLO_RDMARXRDSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFRDMATXRDSLO_RDMARXRDSLO_SHIFT)
+#define I40E_GLPES_PFRDMATXSNDSHI(_i) (0x00014604 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFRDMATXSNDSHI_MAX_INDEX 15
+#define I40E_GLPES_PFRDMATXSNDSHI_RDMARXSNDSHI_SHIFT 0
+#define I40E_GLPES_PFRDMATXSNDSHI_RDMARXSNDSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFRDMATXSNDSHI_RDMARXSNDSHI_SHIFT)
+#define I40E_GLPES_PFRDMATXSNDSLO(_i) (0x00014600 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFRDMATXSNDSLO_MAX_INDEX 15
+#define I40E_GLPES_PFRDMATXSNDSLO_RDMARXSNDSLO_SHIFT 0
+#define I40E_GLPES_PFRDMATXSNDSLO_RDMARXSNDSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFRDMATXSNDSLO_RDMARXSNDSLO_SHIFT)
+#define I40E_GLPES_PFRDMATXWRSHI(_i) (0x00014204 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFRDMATXWRSHI_MAX_INDEX 15
+#define I40E_GLPES_PFRDMATXWRSHI_RDMARXWRSHI_SHIFT 0
+#define I40E_GLPES_PFRDMATXWRSHI_RDMARXWRSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFRDMATXWRSHI_RDMARXWRSHI_SHIFT)
+#define I40E_GLPES_PFRDMATXWRSLO(_i) (0x00014200 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFRDMATXWRSLO_MAX_INDEX 15
+#define I40E_GLPES_PFRDMATXWRSLO_RDMARXWRSLO_SHIFT 0
+#define I40E_GLPES_PFRDMATXWRSLO_RDMARXWRSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFRDMATXWRSLO_RDMARXWRSLO_SHIFT)
+#define I40E_GLPES_PFRDMAVBNDHI(_i) (0x00014804 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFRDMAVBNDHI_MAX_INDEX 15
+#define I40E_GLPES_PFRDMAVBNDHI_RDMAVBNDHI_SHIFT 0
+#define I40E_GLPES_PFRDMAVBNDHI_RDMAVBNDHI_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFRDMAVBNDHI_RDMAVBNDHI_SHIFT)
+#define I40E_GLPES_PFRDMAVBNDLO(_i) (0x00014800 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFRDMAVBNDLO_MAX_INDEX 15
+#define I40E_GLPES_PFRDMAVBNDLO_RDMAVBNDLO_SHIFT 0
+#define I40E_GLPES_PFRDMAVBNDLO_RDMAVBNDLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFRDMAVBNDLO_RDMAVBNDLO_SHIFT)
+#define I40E_GLPES_PFRDMAVINVHI(_i) (0x00014A04 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFRDMAVINVHI_MAX_INDEX 15
+#define I40E_GLPES_PFRDMAVINVHI_RDMAVINVHI_SHIFT 0
+#define I40E_GLPES_PFRDMAVINVHI_RDMAVINVHI_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFRDMAVINVHI_RDMAVINVHI_SHIFT)
+#define I40E_GLPES_PFRDMAVINVLO(_i) (0x00014A00 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFRDMAVINVLO_MAX_INDEX 15
+#define I40E_GLPES_PFRDMAVINVLO_RDMAVINVLO_SHIFT 0
+#define I40E_GLPES_PFRDMAVINVLO_RDMAVINVLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFRDMAVINVLO_RDMAVINVLO_SHIFT)
+#define I40E_GLPES_PFRXVLANERR(_i) (0x00010000 + ((_i) * 4)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFRXVLANERR_MAX_INDEX 15
+#define I40E_GLPES_PFRXVLANERR_RXVLANERR_SHIFT 0
+#define I40E_GLPES_PFRXVLANERR_RXVLANERR_MASK I40E_MASK(0xFFFFFF, I40E_GLPES_PFRXVLANERR_RXVLANERR_SHIFT)
+#define I40E_GLPES_PFTCPRTXSEG(_i) (0x00013600 + ((_i) * 4)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFTCPRTXSEG_MAX_INDEX 15
+#define I40E_GLPES_PFTCPRTXSEG_TCPRTXSEG_SHIFT 0
+#define I40E_GLPES_PFTCPRTXSEG_TCPRTXSEG_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFTCPRTXSEG_TCPRTXSEG_SHIFT)
+#define I40E_GLPES_PFTCPRXOPTERR(_i) (0x00013200 + ((_i) * 4)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFTCPRXOPTERR_MAX_INDEX 15
+#define I40E_GLPES_PFTCPRXOPTERR_TCPRXOPTERR_SHIFT 0
+#define I40E_GLPES_PFTCPRXOPTERR_TCPRXOPTERR_MASK I40E_MASK(0xFFFFFF, I40E_GLPES_PFTCPRXOPTERR_TCPRXOPTERR_SHIFT)
+#define I40E_GLPES_PFTCPRXPROTOERR(_i) (0x00013300 + ((_i) * 4)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFTCPRXPROTOERR_MAX_INDEX 15
+#define I40E_GLPES_PFTCPRXPROTOERR_TCPRXPROTOERR_SHIFT 0
+#define I40E_GLPES_PFTCPRXPROTOERR_TCPRXPROTOERR_MASK I40E_MASK(0xFFFFFF, I40E_GLPES_PFTCPRXPROTOERR_TCPRXPROTOERR_SHIFT)
+#define I40E_GLPES_PFTCPRXSEGSHI(_i) (0x00013004 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFTCPRXSEGSHI_MAX_INDEX 15
+#define I40E_GLPES_PFTCPRXSEGSHI_TCPRXSEGSHI_SHIFT 0
+#define I40E_GLPES_PFTCPRXSEGSHI_TCPRXSEGSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFTCPRXSEGSHI_TCPRXSEGSHI_SHIFT)
+#define I40E_GLPES_PFTCPRXSEGSLO(_i) (0x00013000 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFTCPRXSEGSLO_MAX_INDEX 15
+#define I40E_GLPES_PFTCPRXSEGSLO_TCPRXSEGSLO_SHIFT 0
+#define I40E_GLPES_PFTCPRXSEGSLO_TCPRXSEGSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFTCPRXSEGSLO_TCPRXSEGSLO_SHIFT)
+#define I40E_GLPES_PFTCPTXSEGHI(_i) (0x00013404 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFTCPTXSEGHI_MAX_INDEX 15
+#define I40E_GLPES_PFTCPTXSEGHI_TCPTXSEGHI_SHIFT 0
+#define I40E_GLPES_PFTCPTXSEGHI_TCPTXSEGHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFTCPTXSEGHI_TCPTXSEGHI_SHIFT)
+#define I40E_GLPES_PFTCPTXSEGLO(_i) (0x00013400 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFTCPTXSEGLO_MAX_INDEX 15
+#define I40E_GLPES_PFTCPTXSEGLO_TCPTXSEGLO_SHIFT 0
+#define I40E_GLPES_PFTCPTXSEGLO_TCPTXSEGLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFTCPTXSEGLO_TCPTXSEGLO_SHIFT)
+#define I40E_GLPES_PFUDPRXPKTSHI(_i) (0x00013804 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFUDPRXPKTSHI_MAX_INDEX 15
+#define I40E_GLPES_PFUDPRXPKTSHI_UDPRXPKTSHI_SHIFT 0
+#define I40E_GLPES_PFUDPRXPKTSHI_UDPRXPKTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFUDPRXPKTSHI_UDPRXPKTSHI_SHIFT)
+#define I40E_GLPES_PFUDPRXPKTSLO(_i) (0x00013800 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFUDPRXPKTSLO_MAX_INDEX 15
+#define I40E_GLPES_PFUDPRXPKTSLO_UDPRXPKTSLO_SHIFT 0
+#define I40E_GLPES_PFUDPRXPKTSLO_UDPRXPKTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFUDPRXPKTSLO_UDPRXPKTSLO_SHIFT)
+#define I40E_GLPES_PFUDPTXPKTSHI(_i) (0x00013A04 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFUDPTXPKTSHI_MAX_INDEX 15
+#define I40E_GLPES_PFUDPTXPKTSHI_UDPTXPKTSHI_SHIFT 0
+#define I40E_GLPES_PFUDPTXPKTSHI_UDPTXPKTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_PFUDPTXPKTSHI_UDPTXPKTSHI_SHIFT)
+#define I40E_GLPES_PFUDPTXPKTSLO(_i) (0x00013A00 + ((_i) * 8)) /* _i=0...15 */ /* Reset: PE_CORER */
+#define I40E_GLPES_PFUDPTXPKTSLO_MAX_INDEX 15
+#define I40E_GLPES_PFUDPTXPKTSLO_UDPTXPKTSLO_SHIFT 0
+#define I40E_GLPES_PFUDPTXPKTSLO_UDPTXPKTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_PFUDPTXPKTSLO_UDPTXPKTSLO_SHIFT)
+#define I40E_GLPES_RDMARXMULTFPDUSHI 0x0001E014 /* Reset: PE_CORER */
+#define I40E_GLPES_RDMARXMULTFPDUSHI_RDMARXMULTFPDUSHI_SHIFT 0
+#define I40E_GLPES_RDMARXMULTFPDUSHI_RDMARXMULTFPDUSHI_MASK I40E_MASK(0xFFFFFF, I40E_GLPES_RDMARXMULTFPDUSHI_RDMARXMULTFPDUSHI_SHIFT)
+#define I40E_GLPES_RDMARXMULTFPDUSLO 0x0001E010 /* Reset: PE_CORER */
+#define I40E_GLPES_RDMARXMULTFPDUSLO_RDMARXMULTFPDUSLO_SHIFT 0
+#define I40E_GLPES_RDMARXMULTFPDUSLO_RDMARXMULTFPDUSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_RDMARXMULTFPDUSLO_RDMARXMULTFPDUSLO_SHIFT)
+#define I40E_GLPES_RDMARXOOODDPHI 0x0001E01C /* Reset: PE_CORER */
+#define I40E_GLPES_RDMARXOOODDPHI_RDMARXOOODDPHI_SHIFT 0
+#define I40E_GLPES_RDMARXOOODDPHI_RDMARXOOODDPHI_MASK I40E_MASK(0xFFFFFF, I40E_GLPES_RDMARXOOODDPHI_RDMARXOOODDPHI_SHIFT)
+#define I40E_GLPES_RDMARXOOODDPLO 0x0001E018 /* Reset: PE_CORER */
+#define I40E_GLPES_RDMARXOOODDPLO_RDMARXOOODDPLO_SHIFT 0
+#define I40E_GLPES_RDMARXOOODDPLO_RDMARXOOODDPLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_RDMARXOOODDPLO_RDMARXOOODDPLO_SHIFT)
+#define I40E_GLPES_RDMARXOOONOMARK 0x0001E004 /* Reset: PE_CORER */
+#define I40E_GLPES_RDMARXOOONOMARK_RDMAOOONOMARK_SHIFT 0
+#define I40E_GLPES_RDMARXOOONOMARK_RDMAOOONOMARK_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_RDMARXOOONOMARK_RDMAOOONOMARK_SHIFT)
+#define I40E_GLPES_RDMARXUNALIGN 0x0001E000 /* Reset: PE_CORER */
+#define I40E_GLPES_RDMARXUNALIGN_RDMRXAUNALIGN_SHIFT 0
+#define I40E_GLPES_RDMARXUNALIGN_RDMRXAUNALIGN_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_RDMARXUNALIGN_RDMRXAUNALIGN_SHIFT)
+#define I40E_GLPES_TCPRXFOURHOLEHI 0x0001E044 /* Reset: PE_CORER */
+#define I40E_GLPES_TCPRXFOURHOLEHI_TCPRXFOURHOLEHI_SHIFT 0
+#define I40E_GLPES_TCPRXFOURHOLEHI_TCPRXFOURHOLEHI_MASK I40E_MASK(0xFFFFFF, I40E_GLPES_TCPRXFOURHOLEHI_TCPRXFOURHOLEHI_SHIFT)
+#define I40E_GLPES_TCPRXFOURHOLELO 0x0001E040 /* Reset: PE_CORER */
+#define I40E_GLPES_TCPRXFOURHOLELO_TCPRXFOURHOLELO_SHIFT 0
+#define I40E_GLPES_TCPRXFOURHOLELO_TCPRXFOURHOLELO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_TCPRXFOURHOLELO_TCPRXFOURHOLELO_SHIFT)
+#define I40E_GLPES_TCPRXONEHOLEHI 0x0001E02C /* Reset: PE_CORER */
+#define I40E_GLPES_TCPRXONEHOLEHI_TCPRXONEHOLEHI_SHIFT 0
+#define I40E_GLPES_TCPRXONEHOLEHI_TCPRXONEHOLEHI_MASK I40E_MASK(0xFFFFFF, I40E_GLPES_TCPRXONEHOLEHI_TCPRXONEHOLEHI_SHIFT)
+#define I40E_GLPES_TCPRXONEHOLELO 0x0001E028 /* Reset: PE_CORER */
+#define I40E_GLPES_TCPRXONEHOLELO_TCPRXONEHOLELO_SHIFT 0
+#define I40E_GLPES_TCPRXONEHOLELO_TCPRXONEHOLELO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_TCPRXONEHOLELO_TCPRXONEHOLELO_SHIFT)
+#define I40E_GLPES_TCPRXPUREACKHI 0x0001E024 /* Reset: PE_CORER */
+#define I40E_GLPES_TCPRXPUREACKHI_TCPRXPUREACKSHI_SHIFT 0
+#define I40E_GLPES_TCPRXPUREACKHI_TCPRXPUREACKSHI_MASK I40E_MASK(0xFFFFFF, I40E_GLPES_TCPRXPUREACKHI_TCPRXPUREACKSHI_SHIFT)
+#define I40E_GLPES_TCPRXPUREACKSLO 0x0001E020 /* Reset: PE_CORER */
+#define I40E_GLPES_TCPRXPUREACKSLO_TCPRXPUREACKLO_SHIFT 0
+#define I40E_GLPES_TCPRXPUREACKSLO_TCPRXPUREACKLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_TCPRXPUREACKSLO_TCPRXPUREACKLO_SHIFT)
+#define I40E_GLPES_TCPRXTHREEHOLEHI 0x0001E03C /* Reset: PE_CORER */
+#define I40E_GLPES_TCPRXTHREEHOLEHI_TCPRXTHREEHOLEHI_SHIFT 0
+#define I40E_GLPES_TCPRXTHREEHOLEHI_TCPRXTHREEHOLEHI_MASK I40E_MASK(0xFFFFFF, I40E_GLPES_TCPRXTHREEHOLEHI_TCPRXTHREEHOLEHI_SHIFT)
+#define I40E_GLPES_TCPRXTHREEHOLELO 0x0001E038 /* Reset: PE_CORER */
+#define I40E_GLPES_TCPRXTHREEHOLELO_TCPRXTHREEHOLELO_SHIFT 0
+#define I40E_GLPES_TCPRXTHREEHOLELO_TCPRXTHREEHOLELO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_TCPRXTHREEHOLELO_TCPRXTHREEHOLELO_SHIFT)
+#define I40E_GLPES_TCPRXTWOHOLEHI 0x0001E034 /* Reset: PE_CORER */
+#define I40E_GLPES_TCPRXTWOHOLEHI_TCPRXTWOHOLEHI_SHIFT 0
+#define I40E_GLPES_TCPRXTWOHOLEHI_TCPRXTWOHOLEHI_MASK I40E_MASK(0xFFFFFF, I40E_GLPES_TCPRXTWOHOLEHI_TCPRXTWOHOLEHI_SHIFT)
+#define I40E_GLPES_TCPRXTWOHOLELO 0x0001E030 /* Reset: PE_CORER */
+#define I40E_GLPES_TCPRXTWOHOLELO_TCPRXTWOHOLELO_SHIFT 0
+#define I40E_GLPES_TCPRXTWOHOLELO_TCPRXTWOHOLELO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_TCPRXTWOHOLELO_TCPRXTWOHOLELO_SHIFT)
+#define I40E_GLPES_TCPTXRETRANSFASTHI 0x0001E04C /* Reset: PE_CORER */
+#define I40E_GLPES_TCPTXRETRANSFASTHI_TCPTXRETRANSFASTHI_SHIFT 0
+#define I40E_GLPES_TCPTXRETRANSFASTHI_TCPTXRETRANSFASTHI_MASK I40E_MASK(0xFFFFFF, I40E_GLPES_TCPTXRETRANSFASTHI_TCPTXRETRANSFASTHI_SHIFT)
+#define I40E_GLPES_TCPTXRETRANSFASTLO 0x0001E048 /* Reset: PE_CORER */
+#define I40E_GLPES_TCPTXRETRANSFASTLO_TCPTXRETRANSFASTLO_SHIFT 0
+#define I40E_GLPES_TCPTXRETRANSFASTLO_TCPTXRETRANSFASTLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_TCPTXRETRANSFASTLO_TCPTXRETRANSFASTLO_SHIFT)
+#define I40E_GLPES_TCPTXTOUTSFASTHI 0x0001E054 /* Reset: PE_CORER */
+#define I40E_GLPES_TCPTXTOUTSFASTHI_TCPTXTOUTSFASTHI_SHIFT 0
+#define I40E_GLPES_TCPTXTOUTSFASTHI_TCPTXTOUTSFASTHI_MASK I40E_MASK(0xFFFFFF, I40E_GLPES_TCPTXTOUTSFASTHI_TCPTXTOUTSFASTHI_SHIFT)
+#define I40E_GLPES_TCPTXTOUTSFASTLO 0x0001E050 /* Reset: PE_CORER */
+#define I40E_GLPES_TCPTXTOUTSFASTLO_TCPTXTOUTSFASTLO_SHIFT 0
+#define I40E_GLPES_TCPTXTOUTSFASTLO_TCPTXTOUTSFASTLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_TCPTXTOUTSFASTLO_TCPTXTOUTSFASTLO_SHIFT)
+#define I40E_GLPES_TCPTXTOUTSHI 0x0001E05C /* Reset: PE_CORER */
+#define I40E_GLPES_TCPTXTOUTSHI_TCPTXTOUTSHI_SHIFT 0
+#define I40E_GLPES_TCPTXTOUTSHI_TCPTXTOUTSHI_MASK I40E_MASK(0xFFFFFF, I40E_GLPES_TCPTXTOUTSHI_TCPTXTOUTSHI_SHIFT)
+#define I40E_GLPES_TCPTXTOUTSLO 0x0001E058 /* Reset: PE_CORER */
+#define I40E_GLPES_TCPTXTOUTSLO_TCPTXTOUTSLO_SHIFT 0
+#define I40E_GLPES_TCPTXTOUTSLO_TCPTXTOUTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_TCPTXTOUTSLO_TCPTXTOUTSLO_SHIFT)
+#define I40E_GLPES_VFIP4RXDISCARD(_i) (0x00018600 + ((_i) * 4)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP4RXDISCARD_MAX_INDEX 31
+#define I40E_GLPES_VFIP4RXDISCARD_IP4RXDISCARD_SHIFT 0
+#define I40E_GLPES_VFIP4RXDISCARD_IP4RXDISCARD_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFIP4RXDISCARD_IP4RXDISCARD_SHIFT)
+#define I40E_GLPES_VFIP4RXFRAGSHI(_i) (0x00018804 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP4RXFRAGSHI_MAX_INDEX 31
+#define I40E_GLPES_VFIP4RXFRAGSHI_IP4RXFRAGSHI_SHIFT 0
+#define I40E_GLPES_VFIP4RXFRAGSHI_IP4RXFRAGSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFIP4RXFRAGSHI_IP4RXFRAGSHI_SHIFT)
+#define I40E_GLPES_VFIP4RXFRAGSLO(_i) (0x00018800 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP4RXFRAGSLO_MAX_INDEX 31
+#define I40E_GLPES_VFIP4RXFRAGSLO_IP4RXFRAGSLO_SHIFT 0
+#define I40E_GLPES_VFIP4RXFRAGSLO_IP4RXFRAGSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFIP4RXFRAGSLO_IP4RXFRAGSLO_SHIFT)
+#define I40E_GLPES_VFIP4RXMCOCTSHI(_i) (0x00018A04 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP4RXMCOCTSHI_MAX_INDEX 31
+#define I40E_GLPES_VFIP4RXMCOCTSHI_IP4RXMCOCTSHI_SHIFT 0
+#define I40E_GLPES_VFIP4RXMCOCTSHI_IP4RXMCOCTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFIP4RXMCOCTSHI_IP4RXMCOCTSHI_SHIFT)
+#define I40E_GLPES_VFIP4RXMCOCTSLO(_i) (0x00018A00 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP4RXMCOCTSLO_MAX_INDEX 31
+#define I40E_GLPES_VFIP4RXMCOCTSLO_IP4RXMCOCTSLO_SHIFT 0
+#define I40E_GLPES_VFIP4RXMCOCTSLO_IP4RXMCOCTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFIP4RXMCOCTSLO_IP4RXMCOCTSLO_SHIFT)
+#define I40E_GLPES_VFIP4RXMCPKTSHI(_i) (0x00018C04 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP4RXMCPKTSHI_MAX_INDEX 31
+#define I40E_GLPES_VFIP4RXMCPKTSHI_IP4RXMCPKTSHI_SHIFT 0
+#define I40E_GLPES_VFIP4RXMCPKTSHI_IP4RXMCPKTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFIP4RXMCPKTSHI_IP4RXMCPKTSHI_SHIFT)
+#define I40E_GLPES_VFIP4RXMCPKTSLO(_i) (0x00018C00 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP4RXMCPKTSLO_MAX_INDEX 31
+#define I40E_GLPES_VFIP4RXMCPKTSLO_IP4RXMCPKTSLO_SHIFT 0
+#define I40E_GLPES_VFIP4RXMCPKTSLO_IP4RXMCPKTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFIP4RXMCPKTSLO_IP4RXMCPKTSLO_SHIFT)
+#define I40E_GLPES_VFIP4RXOCTSHI(_i) (0x00018204 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP4RXOCTSHI_MAX_INDEX 31
+#define I40E_GLPES_VFIP4RXOCTSHI_IP4RXOCTSHI_SHIFT 0
+#define I40E_GLPES_VFIP4RXOCTSHI_IP4RXOCTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFIP4RXOCTSHI_IP4RXOCTSHI_SHIFT)
+#define I40E_GLPES_VFIP4RXOCTSLO(_i) (0x00018200 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP4RXOCTSLO_MAX_INDEX 31
+#define I40E_GLPES_VFIP4RXOCTSLO_IP4RXOCTSLO_SHIFT 0
+#define I40E_GLPES_VFIP4RXOCTSLO_IP4RXOCTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFIP4RXOCTSLO_IP4RXOCTSLO_SHIFT)
+#define I40E_GLPES_VFIP4RXPKTSHI(_i) (0x00018404 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP4RXPKTSHI_MAX_INDEX 31
+#define I40E_GLPES_VFIP4RXPKTSHI_IP4RXPKTSHI_SHIFT 0
+#define I40E_GLPES_VFIP4RXPKTSHI_IP4RXPKTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFIP4RXPKTSHI_IP4RXPKTSHI_SHIFT)
+#define I40E_GLPES_VFIP4RXPKTSLO(_i) (0x00018400 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP4RXPKTSLO_MAX_INDEX 31
+#define I40E_GLPES_VFIP4RXPKTSLO_IP4RXPKTSLO_SHIFT 0
+#define I40E_GLPES_VFIP4RXPKTSLO_IP4RXPKTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFIP4RXPKTSLO_IP4RXPKTSLO_SHIFT)
+#define I40E_GLPES_VFIP4RXTRUNC(_i) (0x00018700 + ((_i) * 4)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP4RXTRUNC_MAX_INDEX 31
+#define I40E_GLPES_VFIP4RXTRUNC_IP4RXTRUNC_SHIFT 0
+#define I40E_GLPES_VFIP4RXTRUNC_IP4RXTRUNC_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFIP4RXTRUNC_IP4RXTRUNC_SHIFT)
+#define I40E_GLPES_VFIP4TXFRAGSHI(_i) (0x00019E04 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP4TXFRAGSHI_MAX_INDEX 31
+#define I40E_GLPES_VFIP4TXFRAGSHI_IP4TXFRAGSHI_SHIFT 0
+#define I40E_GLPES_VFIP4TXFRAGSHI_IP4TXFRAGSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFIP4TXFRAGSHI_IP4TXFRAGSHI_SHIFT)
+#define I40E_GLPES_VFIP4TXFRAGSLO(_i) (0x00019E00 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP4TXFRAGSLO_MAX_INDEX 31
+#define I40E_GLPES_VFIP4TXFRAGSLO_IP4TXFRAGSLO_SHIFT 0
+#define I40E_GLPES_VFIP4TXFRAGSLO_IP4TXFRAGSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFIP4TXFRAGSLO_IP4TXFRAGSLO_SHIFT)
+#define I40E_GLPES_VFIP4TXMCOCTSHI(_i) (0x0001A004 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP4TXMCOCTSHI_MAX_INDEX 31
+#define I40E_GLPES_VFIP4TXMCOCTSHI_IP4TXMCOCTSHI_SHIFT 0
+#define I40E_GLPES_VFIP4TXMCOCTSHI_IP4TXMCOCTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFIP4TXMCOCTSHI_IP4TXMCOCTSHI_SHIFT)
+#define I40E_GLPES_VFIP4TXMCOCTSLO(_i) (0x0001A000 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP4TXMCOCTSLO_MAX_INDEX 31
+#define I40E_GLPES_VFIP4TXMCOCTSLO_IP4TXMCOCTSLO_SHIFT 0
+#define I40E_GLPES_VFIP4TXMCOCTSLO_IP4TXMCOCTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFIP4TXMCOCTSLO_IP4TXMCOCTSLO_SHIFT)
+#define I40E_GLPES_VFIP4TXMCPKTSHI(_i) (0x0001A204 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP4TXMCPKTSHI_MAX_INDEX 31
+#define I40E_GLPES_VFIP4TXMCPKTSHI_IP4TXMCPKTSHI_SHIFT 0
+#define I40E_GLPES_VFIP4TXMCPKTSHI_IP4TXMCPKTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFIP4TXMCPKTSHI_IP4TXMCPKTSHI_SHIFT)
+#define I40E_GLPES_VFIP4TXMCPKTSLO(_i) (0x0001A200 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP4TXMCPKTSLO_MAX_INDEX 31
+#define I40E_GLPES_VFIP4TXMCPKTSLO_IP4TXMCPKTSLO_SHIFT 0
+#define I40E_GLPES_VFIP4TXMCPKTSLO_IP4TXMCPKTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFIP4TXMCPKTSLO_IP4TXMCPKTSLO_SHIFT)
+#define I40E_GLPES_VFIP4TXNOROUTE(_i) (0x0001AE00 + ((_i) * 4)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP4TXNOROUTE_MAX_INDEX 31
+#define I40E_GLPES_VFIP4TXNOROUTE_IP4TXNOROUTE_SHIFT 0
+#define I40E_GLPES_VFIP4TXNOROUTE_IP4TXNOROUTE_MASK I40E_MASK(0xFFFFFF, I40E_GLPES_VFIP4TXNOROUTE_IP4TXNOROUTE_SHIFT)
+#define I40E_GLPES_VFIP4TXOCTSHI(_i) (0x00019A04 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP4TXOCTSHI_MAX_INDEX 31
+#define I40E_GLPES_VFIP4TXOCTSHI_IP4TXOCTSHI_SHIFT 0
+#define I40E_GLPES_VFIP4TXOCTSHI_IP4TXOCTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFIP4TXOCTSHI_IP4TXOCTSHI_SHIFT)
+#define I40E_GLPES_VFIP4TXOCTSLO(_i) (0x00019A00 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP4TXOCTSLO_MAX_INDEX 31
+#define I40E_GLPES_VFIP4TXOCTSLO_IP4TXOCTSLO_SHIFT 0
+#define I40E_GLPES_VFIP4TXOCTSLO_IP4TXOCTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFIP4TXOCTSLO_IP4TXOCTSLO_SHIFT)
+#define I40E_GLPES_VFIP4TXPKTSHI(_i) (0x00019C04 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP4TXPKTSHI_MAX_INDEX 31
+#define I40E_GLPES_VFIP4TXPKTSHI_IP4TXPKTSHI_SHIFT 0
+#define I40E_GLPES_VFIP4TXPKTSHI_IP4TXPKTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFIP4TXPKTSHI_IP4TXPKTSHI_SHIFT)
+#define I40E_GLPES_VFIP4TXPKTSLO(_i) (0x00019C00 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP4TXPKTSLO_MAX_INDEX 31
+#define I40E_GLPES_VFIP4TXPKTSLO_IP4TXPKTSLO_SHIFT 0
+#define I40E_GLPES_VFIP4TXPKTSLO_IP4TXPKTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFIP4TXPKTSLO_IP4TXPKTSLO_SHIFT)
+#define I40E_GLPES_VFIP6RXDISCARD(_i) (0x00019200 + ((_i) * 4)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP6RXDISCARD_MAX_INDEX 31
+#define I40E_GLPES_VFIP6RXDISCARD_IP6RXDISCARD_SHIFT 0
+#define I40E_GLPES_VFIP6RXDISCARD_IP6RXDISCARD_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFIP6RXDISCARD_IP6RXDISCARD_SHIFT)
+#define I40E_GLPES_VFIP6RXFRAGSHI(_i) (0x00019404 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP6RXFRAGSHI_MAX_INDEX 31
+#define I40E_GLPES_VFIP6RXFRAGSHI_IP6RXFRAGSHI_SHIFT 0
+#define I40E_GLPES_VFIP6RXFRAGSHI_IP6RXFRAGSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFIP6RXFRAGSHI_IP6RXFRAGSHI_SHIFT)
+#define I40E_GLPES_VFIP6RXFRAGSLO(_i) (0x00019400 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP6RXFRAGSLO_MAX_INDEX 31
+#define I40E_GLPES_VFIP6RXFRAGSLO_IP6RXFRAGSLO_SHIFT 0
+#define I40E_GLPES_VFIP6RXFRAGSLO_IP6RXFRAGSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFIP6RXFRAGSLO_IP6RXFRAGSLO_SHIFT)
+#define I40E_GLPES_VFIP6RXMCOCTSHI(_i) (0x00019604 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP6RXMCOCTSHI_MAX_INDEX 31
+#define I40E_GLPES_VFIP6RXMCOCTSHI_IP6RXMCOCTSHI_SHIFT 0
+#define I40E_GLPES_VFIP6RXMCOCTSHI_IP6RXMCOCTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFIP6RXMCOCTSHI_IP6RXMCOCTSHI_SHIFT)
+#define I40E_GLPES_VFIP6RXMCOCTSLO(_i) (0x00019600 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP6RXMCOCTSLO_MAX_INDEX 31
+#define I40E_GLPES_VFIP6RXMCOCTSLO_IP6RXMCOCTSLO_SHIFT 0
+#define I40E_GLPES_VFIP6RXMCOCTSLO_IP6RXMCOCTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFIP6RXMCOCTSLO_IP6RXMCOCTSLO_SHIFT)
+#define I40E_GLPES_VFIP6RXMCPKTSHI(_i) (0x00019804 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP6RXMCPKTSHI_MAX_INDEX 31
+#define I40E_GLPES_VFIP6RXMCPKTSHI_IP6RXMCPKTSHI_SHIFT 0
+#define I40E_GLPES_VFIP6RXMCPKTSHI_IP6RXMCPKTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFIP6RXMCPKTSHI_IP6RXMCPKTSHI_SHIFT)
+#define I40E_GLPES_VFIP6RXMCPKTSLO(_i) (0x00019800 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP6RXMCPKTSLO_MAX_INDEX 31
+#define I40E_GLPES_VFIP6RXMCPKTSLO_IP6RXMCPKTSLO_SHIFT 0
+#define I40E_GLPES_VFIP6RXMCPKTSLO_IP6RXMCPKTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFIP6RXMCPKTSLO_IP6RXMCPKTSLO_SHIFT)
+#define I40E_GLPES_VFIP6RXOCTSHI(_i) (0x00018E04 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP6RXOCTSHI_MAX_INDEX 31
+#define I40E_GLPES_VFIP6RXOCTSHI_IP6RXOCTSHI_SHIFT 0
+#define I40E_GLPES_VFIP6RXOCTSHI_IP6RXOCTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFIP6RXOCTSHI_IP6RXOCTSHI_SHIFT)
+#define I40E_GLPES_VFIP6RXOCTSLO(_i) (0x00018E00 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP6RXOCTSLO_MAX_INDEX 31
+#define I40E_GLPES_VFIP6RXOCTSLO_IP6RXOCTSLO_SHIFT 0
+#define I40E_GLPES_VFIP6RXOCTSLO_IP6RXOCTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFIP6RXOCTSLO_IP6RXOCTSLO_SHIFT)
+#define I40E_GLPES_VFIP6RXPKTSHI(_i) (0x00019004 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP6RXPKTSHI_MAX_INDEX 31
+#define I40E_GLPES_VFIP6RXPKTSHI_IP6RXPKTSHI_SHIFT 0
+#define I40E_GLPES_VFIP6RXPKTSHI_IP6RXPKTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFIP6RXPKTSHI_IP6RXPKTSHI_SHIFT)
+#define I40E_GLPES_VFIP6RXPKTSLO(_i) (0x00019000 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP6RXPKTSLO_MAX_INDEX 31
+#define I40E_GLPES_VFIP6RXPKTSLO_IP6RXPKTSLO_SHIFT 0
+#define I40E_GLPES_VFIP6RXPKTSLO_IP6RXPKTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFIP6RXPKTSLO_IP6RXPKTSLO_SHIFT)
+#define I40E_GLPES_VFIP6RXTRUNC(_i) (0x00019300 + ((_i) * 4)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP6RXTRUNC_MAX_INDEX 31
+#define I40E_GLPES_VFIP6RXTRUNC_IP6RXTRUNC_SHIFT 0
+#define I40E_GLPES_VFIP6RXTRUNC_IP6RXTRUNC_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFIP6RXTRUNC_IP6RXTRUNC_SHIFT)
+#define I40E_GLPES_VFIP6TXFRAGSHI(_i) (0x0001A804 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP6TXFRAGSHI_MAX_INDEX 31
+#define I40E_GLPES_VFIP6TXFRAGSHI_IP6TXFRAGSHI_SHIFT 0
+#define I40E_GLPES_VFIP6TXFRAGSHI_IP6TXFRAGSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFIP6TXFRAGSHI_IP6TXFRAGSHI_SHIFT)
+#define I40E_GLPES_VFIP6TXFRAGSLO(_i) (0x0001A800 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP6TXFRAGSLO_MAX_INDEX 31
+#define I40E_GLPES_VFIP6TXFRAGSLO_IP6TXFRAGSLO_SHIFT 0
+#define I40E_GLPES_VFIP6TXFRAGSLO_IP6TXFRAGSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFIP6TXFRAGSLO_IP6TXFRAGSLO_SHIFT)
+#define I40E_GLPES_VFIP6TXMCOCTSHI(_i) (0x0001AA04 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP6TXMCOCTSHI_MAX_INDEX 31
+#define I40E_GLPES_VFIP6TXMCOCTSHI_IP6TXMCOCTSHI_SHIFT 0
+#define I40E_GLPES_VFIP6TXMCOCTSHI_IP6TXMCOCTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFIP6TXMCOCTSHI_IP6TXMCOCTSHI_SHIFT)
+#define I40E_GLPES_VFIP6TXMCOCTSLO(_i) (0x0001AA00 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP6TXMCOCTSLO_MAX_INDEX 31
+#define I40E_GLPES_VFIP6TXMCOCTSLO_IP6TXMCOCTSLO_SHIFT 0
+#define I40E_GLPES_VFIP6TXMCOCTSLO_IP6TXMCOCTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFIP6TXMCOCTSLO_IP6TXMCOCTSLO_SHIFT)
+#define I40E_GLPES_VFIP6TXMCPKTSHI(_i) (0x0001AC04 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP6TXMCPKTSHI_MAX_INDEX 31
+#define I40E_GLPES_VFIP6TXMCPKTSHI_IP6TXMCPKTSHI_SHIFT 0
+#define I40E_GLPES_VFIP6TXMCPKTSHI_IP6TXMCPKTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFIP6TXMCPKTSHI_IP6TXMCPKTSHI_SHIFT)
+#define I40E_GLPES_VFIP6TXMCPKTSLO(_i) (0x0001AC00 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP6TXMCPKTSLO_MAX_INDEX 31
+#define I40E_GLPES_VFIP6TXMCPKTSLO_IP6TXMCPKTSLO_SHIFT 0
+#define I40E_GLPES_VFIP6TXMCPKTSLO_IP6TXMCPKTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFIP6TXMCPKTSLO_IP6TXMCPKTSLO_SHIFT)
+#define I40E_GLPES_VFIP6TXNOROUTE(_i) (0x0001AF00 + ((_i) * 4)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP6TXNOROUTE_MAX_INDEX 31
+#define I40E_GLPES_VFIP6TXNOROUTE_IP6TXNOROUTE_SHIFT 0
+#define I40E_GLPES_VFIP6TXNOROUTE_IP6TXNOROUTE_MASK I40E_MASK(0xFFFFFF, I40E_GLPES_VFIP6TXNOROUTE_IP6TXNOROUTE_SHIFT)
+#define I40E_GLPES_VFIP6TXOCTSHI(_i) (0x0001A404 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP6TXOCTSHI_MAX_INDEX 31
+#define I40E_GLPES_VFIP6TXOCTSHI_IP6TXOCTSHI_SHIFT 0
+#define I40E_GLPES_VFIP6TXOCTSHI_IP6TXOCTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFIP6TXOCTSHI_IP6TXOCTSHI_SHIFT)
+#define I40E_GLPES_VFIP6TXOCTSLO(_i) (0x0001A400 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP6TXOCTSLO_MAX_INDEX 31
+#define I40E_GLPES_VFIP6TXOCTSLO_IP6TXOCTSLO_SHIFT 0
+#define I40E_GLPES_VFIP6TXOCTSLO_IP6TXOCTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFIP6TXOCTSLO_IP6TXOCTSLO_SHIFT)
+#define I40E_GLPES_VFIP6TXPKTSHI(_i) (0x0001A604 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP6TXPKTSHI_MAX_INDEX 31
+#define I40E_GLPES_VFIP6TXPKTSHI_IP6TXPKTSHI_SHIFT 0
+#define I40E_GLPES_VFIP6TXPKTSHI_IP6TXPKTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFIP6TXPKTSHI_IP6TXPKTSHI_SHIFT)
+#define I40E_GLPES_VFIP6TXPKTSLO(_i) (0x0001A600 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFIP6TXPKTSLO_MAX_INDEX 31
+#define I40E_GLPES_VFIP6TXPKTSLO_IP6TXPKTSLO_SHIFT 0
+#define I40E_GLPES_VFIP6TXPKTSLO_IP6TXPKTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFIP6TXPKTSLO_IP6TXPKTSLO_SHIFT)
+#define I40E_GLPES_VFRDMARXRDSHI(_i) (0x0001BE04 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFRDMARXRDSHI_MAX_INDEX 31
+#define I40E_GLPES_VFRDMARXRDSHI_RDMARXRDSHI_SHIFT 0
+#define I40E_GLPES_VFRDMARXRDSHI_RDMARXRDSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFRDMARXRDSHI_RDMARXRDSHI_SHIFT)
+#define I40E_GLPES_VFRDMARXRDSLO(_i) (0x0001BE00 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFRDMARXRDSLO_MAX_INDEX 31
+#define I40E_GLPES_VFRDMARXRDSLO_RDMARXRDSLO_SHIFT 0
+#define I40E_GLPES_VFRDMARXRDSLO_RDMARXRDSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFRDMARXRDSLO_RDMARXRDSLO_SHIFT)
+#define I40E_GLPES_VFRDMARXSNDSHI(_i) (0x0001C004 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFRDMARXSNDSHI_MAX_INDEX 31
+#define I40E_GLPES_VFRDMARXSNDSHI_RDMARXSNDSHI_SHIFT 0
+#define I40E_GLPES_VFRDMARXSNDSHI_RDMARXSNDSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFRDMARXSNDSHI_RDMARXSNDSHI_SHIFT)
+#define I40E_GLPES_VFRDMARXSNDSLO(_i) (0x0001C000 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFRDMARXSNDSLO_MAX_INDEX 31
+#define I40E_GLPES_VFRDMARXSNDSLO_RDMARXSNDSLO_SHIFT 0
+#define I40E_GLPES_VFRDMARXSNDSLO_RDMARXSNDSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFRDMARXSNDSLO_RDMARXSNDSLO_SHIFT)
+#define I40E_GLPES_VFRDMARXWRSHI(_i) (0x0001BC04 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFRDMARXWRSHI_MAX_INDEX 31
+#define I40E_GLPES_VFRDMARXWRSHI_RDMARXWRSHI_SHIFT 0
+#define I40E_GLPES_VFRDMARXWRSHI_RDMARXWRSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFRDMARXWRSHI_RDMARXWRSHI_SHIFT)
+#define I40E_GLPES_VFRDMARXWRSLO(_i) (0x0001BC00 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFRDMARXWRSLO_MAX_INDEX 31
+#define I40E_GLPES_VFRDMARXWRSLO_RDMARXWRSLO_SHIFT 0
+#define I40E_GLPES_VFRDMARXWRSLO_RDMARXWRSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFRDMARXWRSLO_RDMARXWRSLO_SHIFT)
+#define I40E_GLPES_VFRDMATXRDSHI(_i) (0x0001C404 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFRDMATXRDSHI_MAX_INDEX 31
+#define I40E_GLPES_VFRDMATXRDSHI_RDMARXRDSHI_SHIFT 0
+#define I40E_GLPES_VFRDMATXRDSHI_RDMARXRDSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFRDMATXRDSHI_RDMARXRDSHI_SHIFT)
+#define I40E_GLPES_VFRDMATXRDSLO(_i) (0x0001C400 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFRDMATXRDSLO_MAX_INDEX 31
+#define I40E_GLPES_VFRDMATXRDSLO_RDMARXRDSLO_SHIFT 0
+#define I40E_GLPES_VFRDMATXRDSLO_RDMARXRDSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFRDMATXRDSLO_RDMARXRDSLO_SHIFT)
+#define I40E_GLPES_VFRDMATXSNDSHI(_i) (0x0001C604 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFRDMATXSNDSHI_MAX_INDEX 31
+#define I40E_GLPES_VFRDMATXSNDSHI_RDMARXSNDSHI_SHIFT 0
+#define I40E_GLPES_VFRDMATXSNDSHI_RDMARXSNDSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFRDMATXSNDSHI_RDMARXSNDSHI_SHIFT)
+#define I40E_GLPES_VFRDMATXSNDSLO(_i) (0x0001C600 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFRDMATXSNDSLO_MAX_INDEX 31
+#define I40E_GLPES_VFRDMATXSNDSLO_RDMARXSNDSLO_SHIFT 0
+#define I40E_GLPES_VFRDMATXSNDSLO_RDMARXSNDSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFRDMATXSNDSLO_RDMARXSNDSLO_SHIFT)
+#define I40E_GLPES_VFRDMATXWRSHI(_i) (0x0001C204 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFRDMATXWRSHI_MAX_INDEX 31
+#define I40E_GLPES_VFRDMATXWRSHI_RDMARXWRSHI_SHIFT 0
+#define I40E_GLPES_VFRDMATXWRSHI_RDMARXWRSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFRDMATXWRSHI_RDMARXWRSHI_SHIFT)
+#define I40E_GLPES_VFRDMATXWRSLO(_i) (0x0001C200 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFRDMATXWRSLO_MAX_INDEX 31
+#define I40E_GLPES_VFRDMATXWRSLO_RDMARXWRSLO_SHIFT 0
+#define I40E_GLPES_VFRDMATXWRSLO_RDMARXWRSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFRDMATXWRSLO_RDMARXWRSLO_SHIFT)
+#define I40E_GLPES_VFRDMAVBNDHI(_i) (0x0001C804 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFRDMAVBNDHI_MAX_INDEX 31
+#define I40E_GLPES_VFRDMAVBNDHI_RDMAVBNDHI_SHIFT 0
+#define I40E_GLPES_VFRDMAVBNDHI_RDMAVBNDHI_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFRDMAVBNDHI_RDMAVBNDHI_SHIFT)
+#define I40E_GLPES_VFRDMAVBNDLO(_i) (0x0001C800 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFRDMAVBNDLO_MAX_INDEX 31
+#define I40E_GLPES_VFRDMAVBNDLO_RDMAVBNDLO_SHIFT 0
+#define I40E_GLPES_VFRDMAVBNDLO_RDMAVBNDLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFRDMAVBNDLO_RDMAVBNDLO_SHIFT)
+#define I40E_GLPES_VFRDMAVINVHI(_i) (0x0001CA04 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFRDMAVINVHI_MAX_INDEX 31
+#define I40E_GLPES_VFRDMAVINVHI_RDMAVINVHI_SHIFT 0
+#define I40E_GLPES_VFRDMAVINVHI_RDMAVINVHI_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFRDMAVINVHI_RDMAVINVHI_SHIFT)
+#define I40E_GLPES_VFRDMAVINVLO(_i) (0x0001CA00 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFRDMAVINVLO_MAX_INDEX 31
+#define I40E_GLPES_VFRDMAVINVLO_RDMAVINVLO_SHIFT 0
+#define I40E_GLPES_VFRDMAVINVLO_RDMAVINVLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFRDMAVINVLO_RDMAVINVLO_SHIFT)
+#define I40E_GLPES_VFRXVLANERR(_i) (0x00018000 + ((_i) * 4)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFRXVLANERR_MAX_INDEX 31
+#define I40E_GLPES_VFRXVLANERR_RXVLANERR_SHIFT 0
+#define I40E_GLPES_VFRXVLANERR_RXVLANERR_MASK I40E_MASK(0xFFFFFF, I40E_GLPES_VFRXVLANERR_RXVLANERR_SHIFT)
+#define I40E_GLPES_VFTCPRTXSEG(_i) (0x0001B600 + ((_i) * 4)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFTCPRTXSEG_MAX_INDEX 31
+#define I40E_GLPES_VFTCPRTXSEG_TCPRTXSEG_SHIFT 0
+#define I40E_GLPES_VFTCPRTXSEG_TCPRTXSEG_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFTCPRTXSEG_TCPRTXSEG_SHIFT)
+#define I40E_GLPES_VFTCPRXOPTERR(_i) (0x0001B200 + ((_i) * 4)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFTCPRXOPTERR_MAX_INDEX 31
+#define I40E_GLPES_VFTCPRXOPTERR_TCPRXOPTERR_SHIFT 0
+#define I40E_GLPES_VFTCPRXOPTERR_TCPRXOPTERR_MASK I40E_MASK(0xFFFFFF, I40E_GLPES_VFTCPRXOPTERR_TCPRXOPTERR_SHIFT)
+#define I40E_GLPES_VFTCPRXPROTOERR(_i) (0x0001B300 + ((_i) * 4)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFTCPRXPROTOERR_MAX_INDEX 31
+#define I40E_GLPES_VFTCPRXPROTOERR_TCPRXPROTOERR_SHIFT 0
+#define I40E_GLPES_VFTCPRXPROTOERR_TCPRXPROTOERR_MASK I40E_MASK(0xFFFFFF, I40E_GLPES_VFTCPRXPROTOERR_TCPRXPROTOERR_SHIFT)
+#define I40E_GLPES_VFTCPRXSEGSHI(_i) (0x0001B004 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFTCPRXSEGSHI_MAX_INDEX 31
+#define I40E_GLPES_VFTCPRXSEGSHI_TCPRXSEGSHI_SHIFT 0
+#define I40E_GLPES_VFTCPRXSEGSHI_TCPRXSEGSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFTCPRXSEGSHI_TCPRXSEGSHI_SHIFT)
+#define I40E_GLPES_VFTCPRXSEGSLO(_i) (0x0001B000 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFTCPRXSEGSLO_MAX_INDEX 31
+#define I40E_GLPES_VFTCPRXSEGSLO_TCPRXSEGSLO_SHIFT 0
+#define I40E_GLPES_VFTCPRXSEGSLO_TCPRXSEGSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFTCPRXSEGSLO_TCPRXSEGSLO_SHIFT)
+#define I40E_GLPES_VFTCPTXSEGHI(_i) (0x0001B404 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFTCPTXSEGHI_MAX_INDEX 31
+#define I40E_GLPES_VFTCPTXSEGHI_TCPTXSEGHI_SHIFT 0
+#define I40E_GLPES_VFTCPTXSEGHI_TCPTXSEGHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFTCPTXSEGHI_TCPTXSEGHI_SHIFT)
+#define I40E_GLPES_VFTCPTXSEGLO(_i) (0x0001B400 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFTCPTXSEGLO_MAX_INDEX 31
+#define I40E_GLPES_VFTCPTXSEGLO_TCPTXSEGLO_SHIFT 0
+#define I40E_GLPES_VFTCPTXSEGLO_TCPTXSEGLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFTCPTXSEGLO_TCPTXSEGLO_SHIFT)
+#define I40E_GLPES_VFUDPRXPKTSHI(_i) (0x0001B804 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFUDPRXPKTSHI_MAX_INDEX 31
+#define I40E_GLPES_VFUDPRXPKTSHI_UDPRXPKTSHI_SHIFT 0
+#define I40E_GLPES_VFUDPRXPKTSHI_UDPRXPKTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFUDPRXPKTSHI_UDPRXPKTSHI_SHIFT)
+#define I40E_GLPES_VFUDPRXPKTSLO(_i) (0x0001B800 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFUDPRXPKTSLO_MAX_INDEX 31
+#define I40E_GLPES_VFUDPRXPKTSLO_UDPRXPKTSLO_SHIFT 0
+#define I40E_GLPES_VFUDPRXPKTSLO_UDPRXPKTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFUDPRXPKTSLO_UDPRXPKTSLO_SHIFT)
+#define I40E_GLPES_VFUDPTXPKTSHI(_i) (0x0001BA04 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFUDPTXPKTSHI_MAX_INDEX 31
+#define I40E_GLPES_VFUDPTXPKTSHI_UDPTXPKTSHI_SHIFT 0
+#define I40E_GLPES_VFUDPTXPKTSHI_UDPTXPKTSHI_MASK I40E_MASK(0xFFFF, I40E_GLPES_VFUDPTXPKTSHI_UDPTXPKTSHI_SHIFT)
+#define I40E_GLPES_VFUDPTXPKTSLO(_i) (0x0001BA00 + ((_i) * 8)) /* _i=0...31 */ /* Reset: PE_CORER */
+#define I40E_GLPES_VFUDPTXPKTSLO_MAX_INDEX 31
+#define I40E_GLPES_VFUDPTXPKTSLO_UDPTXPKTSLO_SHIFT 0
+#define I40E_GLPES_VFUDPTXPKTSLO_UDPTXPKTSLO_MASK I40E_MASK(0xFFFFFFFF, I40E_GLPES_VFUDPTXPKTSLO_UDPTXPKTSLO_SHIFT)
+#define I40E_GLGEN_PME_TO 0x000B81BC /* Reset: POR */
+#define I40E_GLGEN_PME_TO_PME_TO_FOR_PE_SHIFT 0
+#define I40E_GLGEN_PME_TO_PME_TO_FOR_PE_MASK I40E_MASK(0x1, I40E_GLGEN_PME_TO_PME_TO_FOR_PE_SHIFT)
+#define I40E_GLQF_APBVT(_i) (0x00260000 + ((_i) * 4)) /* _i=0...2047 */ /* Reset: CORER */
+#define I40E_GLQF_APBVT_MAX_INDEX 2047
+#define I40E_GLQF_APBVT_APBVT_SHIFT 0
+#define I40E_GLQF_APBVT_APBVT_MASK I40E_MASK(0xFFFFFFFF, I40E_GLQF_APBVT_APBVT_SHIFT)
+#define I40E_GLQF_FD_PCTYPES(_i) (0x00268000 + ((_i) * 4)) /* _i=0...63 */ /* Reset: POR */
+#define I40E_GLQF_FD_PCTYPES_MAX_INDEX 63
+#define I40E_GLQF_FD_PCTYPES_FD_PCTYPE_SHIFT 0
+#define I40E_GLQF_FD_PCTYPES_FD_PCTYPE_MASK I40E_MASK(0x3F, I40E_GLQF_FD_PCTYPES_FD_PCTYPE_SHIFT)
+#define I40E_GLQF_FDEVICTENA(_i) (0x00270384 + ((_i) * 4)) /* _i=0...1 */ /* Reset: CORER */
+#define I40E_GLQF_FDEVICTENA_MAX_INDEX 1
+#define I40E_GLQF_FDEVICTENA_GLQF_FDEVICTENA_SHIFT 0
+#define I40E_GLQF_FDEVICTENA_GLQF_FDEVICTENA_MASK I40E_MASK(0xFFFFFFFF, I40E_GLQF_FDEVICTENA_GLQF_FDEVICTENA_SHIFT)
+#define I40E_GLQF_FDEVICTFLAG 0x00270280 /* Reset: CORER */
+#define I40E_GLQF_FDEVICTFLAG_TX_FLAGS_SHIFT 0
+#define I40E_GLQF_FDEVICTFLAG_TX_FLAGS_MASK I40E_MASK(0xFF, I40E_GLQF_FDEVICTFLAG_TX_FLAGS_SHIFT)
+#define I40E_GLQF_FDEVICTFLAG_RX_FLAGS_SHIFT 8
+#define I40E_GLQF_FDEVICTFLAG_RX_FLAGS_MASK I40E_MASK(0xFF, I40E_GLQF_FDEVICTFLAG_RX_FLAGS_SHIFT)
+#define I40E_PFQF_CTL_2 0x00270300 /* Reset: CORER */
+#define I40E_PFQF_CTL_2_PEHSIZE_SHIFT 0
+#define I40E_PFQF_CTL_2_PEHSIZE_MASK I40E_MASK(0x1F, I40E_PFQF_CTL_2_PEHSIZE_SHIFT)
+#define I40E_PFQF_CTL_2_PEDSIZE_SHIFT 5
+#define I40E_PFQF_CTL_2_PEDSIZE_MASK I40E_MASK(0x1F, I40E_PFQF_CTL_2_PEDSIZE_SHIFT)
+/* Redefined for X722 family */
+#define I40E_X722_PFQF_HLUT(_i) (0x00240000 + ((_i) * 128)) /* _i=0...127 */ /* Reset: CORER */
+#define I40E_X722_PFQF_HLUT_MAX_INDEX 127
+#define I40E_X722_PFQF_HLUT_LUT0_SHIFT 0
+#define I40E_X722_PFQF_HLUT_LUT0_MASK I40E_MASK(0x7F, I40E_X722_PFQF_HLUT_LUT0_SHIFT)
+#define I40E_X722_PFQF_HLUT_LUT1_SHIFT 8
+#define I40E_X722_PFQF_HLUT_LUT1_MASK I40E_MASK(0x7F, I40E_X722_PFQF_HLUT_LUT1_SHIFT)
+#define I40E_X722_PFQF_HLUT_LUT2_SHIFT 16
+#define I40E_X722_PFQF_HLUT_LUT2_MASK I40E_MASK(0x7F, I40E_X722_PFQF_HLUT_LUT2_SHIFT)
+#define I40E_X722_PFQF_HLUT_LUT3_SHIFT 24
+#define I40E_X722_PFQF_HLUT_LUT3_MASK I40E_MASK(0x7F, I40E_X722_PFQF_HLUT_LUT3_SHIFT)
+#define I40E_PFQF_HREGION(_i) (0x00245400 + ((_i) * 128)) /* _i=0...7 */ /* Reset: CORER */
+#define I40E_PFQF_HREGION_MAX_INDEX 7
+#define I40E_PFQF_HREGION_OVERRIDE_ENA_0_SHIFT 0
+#define I40E_PFQF_HREGION_OVERRIDE_ENA_0_MASK I40E_MASK(0x1, I40E_PFQF_HREGION_OVERRIDE_ENA_0_SHIFT)
+#define I40E_PFQF_HREGION_REGION_0_SHIFT 1
+#define I40E_PFQF_HREGION_REGION_0_MASK I40E_MASK(0x7, I40E_PFQF_HREGION_REGION_0_SHIFT)
+#define I40E_PFQF_HREGION_OVERRIDE_ENA_1_SHIFT 4
+#define I40E_PFQF_HREGION_OVERRIDE_ENA_1_MASK I40E_MASK(0x1, I40E_PFQF_HREGION_OVERRIDE_ENA_1_SHIFT)
+#define I40E_PFQF_HREGION_REGION_1_SHIFT 5
+#define I40E_PFQF_HREGION_REGION_1_MASK I40E_MASK(0x7, I40E_PFQF_HREGION_REGION_1_SHIFT)
+#define I40E_PFQF_HREGION_OVERRIDE_ENA_2_SHIFT 8
+#define I40E_PFQF_HREGION_OVERRIDE_ENA_2_MASK I40E_MASK(0x1, I40E_PFQF_HREGION_OVERRIDE_ENA_2_SHIFT)
+#define I40E_PFQF_HREGION_REGION_2_SHIFT 9
+#define I40E_PFQF_HREGION_REGION_2_MASK I40E_MASK(0x7, I40E_PFQF_HREGION_REGION_2_SHIFT)
+#define I40E_PFQF_HREGION_OVERRIDE_ENA_3_SHIFT 12
+#define I40E_PFQF_HREGION_OVERRIDE_ENA_3_MASK I40E_MASK(0x1, I40E_PFQF_HREGION_OVERRIDE_ENA_3_SHIFT)
+#define I40E_PFQF_HREGION_REGION_3_SHIFT 13
+#define I40E_PFQF_HREGION_REGION_3_MASK I40E_MASK(0x7, I40E_PFQF_HREGION_REGION_3_SHIFT)
+#define I40E_PFQF_HREGION_OVERRIDE_ENA_4_SHIFT 16
+#define I40E_PFQF_HREGION_OVERRIDE_ENA_4_MASK I40E_MASK(0x1, I40E_PFQF_HREGION_OVERRIDE_ENA_4_SHIFT)
+#define I40E_PFQF_HREGION_REGION_4_SHIFT 17
+#define I40E_PFQF_HREGION_REGION_4_MASK I40E_MASK(0x7, I40E_PFQF_HREGION_REGION_4_SHIFT)
+#define I40E_PFQF_HREGION_OVERRIDE_ENA_5_SHIFT 20
+#define I40E_PFQF_HREGION_OVERRIDE_ENA_5_MASK I40E_MASK(0x1, I40E_PFQF_HREGION_OVERRIDE_ENA_5_SHIFT)
+#define I40E_PFQF_HREGION_REGION_5_SHIFT 21
+#define I40E_PFQF_HREGION_REGION_5_MASK I40E_MASK(0x7, I40E_PFQF_HREGION_REGION_5_SHIFT)
+#define I40E_PFQF_HREGION_OVERRIDE_ENA_6_SHIFT 24
+#define I40E_PFQF_HREGION_OVERRIDE_ENA_6_MASK I40E_MASK(0x1, I40E_PFQF_HREGION_OVERRIDE_ENA_6_SHIFT)
+#define I40E_PFQF_HREGION_REGION_6_SHIFT 25
+#define I40E_PFQF_HREGION_REGION_6_MASK I40E_MASK(0x7, I40E_PFQF_HREGION_REGION_6_SHIFT)
+#define I40E_PFQF_HREGION_OVERRIDE_ENA_7_SHIFT 28
+#define I40E_PFQF_HREGION_OVERRIDE_ENA_7_MASK I40E_MASK(0x1, I40E_PFQF_HREGION_OVERRIDE_ENA_7_SHIFT)
+#define I40E_PFQF_HREGION_REGION_7_SHIFT 29
+#define I40E_PFQF_HREGION_REGION_7_MASK I40E_MASK(0x7, I40E_PFQF_HREGION_REGION_7_SHIFT)
+#define I40E_VSIQF_CTL_RSS_LUT_TYPE_SHIFT 8
+#define I40E_VSIQF_CTL_RSS_LUT_TYPE_MASK I40E_MASK(0x1, I40E_VSIQF_CTL_RSS_LUT_TYPE_SHIFT)
+#define I40E_VSIQF_HKEY(_i, _VSI) (0x002A0000 + ((_i) * 2048 + (_VSI) * 4)) /* _i=0...12, _VSI=0...383 */ /* Reset: CORER */
+#define I40E_VSIQF_HKEY_MAX_INDEX 12
+#define I40E_VSIQF_HKEY_KEY_0_SHIFT 0
+#define I40E_VSIQF_HKEY_KEY_0_MASK I40E_MASK(0xFF, I40E_VSIQF_HKEY_KEY_0_SHIFT)
+#define I40E_VSIQF_HKEY_KEY_1_SHIFT 8
+#define I40E_VSIQF_HKEY_KEY_1_MASK I40E_MASK(0xFF, I40E_VSIQF_HKEY_KEY_1_SHIFT)
+#define I40E_VSIQF_HKEY_KEY_2_SHIFT 16
+#define I40E_VSIQF_HKEY_KEY_2_MASK I40E_MASK(0xFF, I40E_VSIQF_HKEY_KEY_2_SHIFT)
+#define I40E_VSIQF_HKEY_KEY_3_SHIFT 24
+#define I40E_VSIQF_HKEY_KEY_3_MASK I40E_MASK(0xFF, I40E_VSIQF_HKEY_KEY_3_SHIFT)
+#define I40E_VSIQF_HLUT(_i, _VSI) (0x00220000 + ((_i) * 2048 + (_VSI) * 4)) /* _i=0...15, _VSI=0...383 */ /* Reset: CORER */
+#define I40E_VSIQF_HLUT_MAX_INDEX 15
+#define I40E_VSIQF_HLUT_LUT0_SHIFT 0
+#define I40E_VSIQF_HLUT_LUT0_MASK I40E_MASK(0xF, I40E_VSIQF_HLUT_LUT0_SHIFT)
+#define I40E_VSIQF_HLUT_LUT1_SHIFT 8
+#define I40E_VSIQF_HLUT_LUT1_MASK I40E_MASK(0xF, I40E_VSIQF_HLUT_LUT1_SHIFT)
+#define I40E_VSIQF_HLUT_LUT2_SHIFT 16
+#define I40E_VSIQF_HLUT_LUT2_MASK I40E_MASK(0xF, I40E_VSIQF_HLUT_LUT2_SHIFT)
+#define I40E_VSIQF_HLUT_LUT3_SHIFT 24
+#define I40E_VSIQF_HLUT_LUT3_MASK I40E_MASK(0xF, I40E_VSIQF_HLUT_LUT3_SHIFT)
+#define I40E_GLGEN_STAT_CLEAR 0x00390004 /* Reset: CORER */
+#define I40E_GLGEN_STAT_CLEAR_GLGEN_STAT_CLEAR_SHIFT 0
+#define I40E_GLGEN_STAT_CLEAR_GLGEN_STAT_CLEAR_MASK I40E_MASK(0x1, I40E_GLGEN_STAT_CLEAR_GLGEN_STAT_CLEAR_SHIFT)
+#define I40E_GLGEN_STAT_HALT 0x00390000 /* Reset: CORER */
+#define I40E_GLGEN_STAT_HALT_HALT_CELLS_SHIFT 0
+#define I40E_GLGEN_STAT_HALT_HALT_CELLS_MASK I40E_MASK(0x3FFFFFFF, I40E_GLGEN_STAT_HALT_HALT_CELLS_SHIFT)
+#define I40E_VFINT_DYN_CTL01_WB_ON_ITR_SHIFT 30
+#define I40E_VFINT_DYN_CTL01_WB_ON_ITR_MASK I40E_MASK(0x1, I40E_VFINT_DYN_CTL01_WB_ON_ITR_SHIFT)
+#define I40E_VFINT_DYN_CTLN1_WB_ON_ITR_SHIFT 30
+#define I40E_VFINT_DYN_CTLN1_WB_ON_ITR_MASK I40E_MASK(0x1, I40E_VFINT_DYN_CTLN1_WB_ON_ITR_SHIFT)
+#define I40E_VFPE_AEQALLOC1 0x0000A400 /* Reset: VFR */
+#define I40E_VFPE_AEQALLOC1_AECOUNT_SHIFT 0
+#define I40E_VFPE_AEQALLOC1_AECOUNT_MASK I40E_MASK(0xFFFFFFFF, I40E_VFPE_AEQALLOC1_AECOUNT_SHIFT)
+#define I40E_VFPE_CCQPHIGH1 0x00009800 /* Reset: VFR */
+#define I40E_VFPE_CCQPHIGH1_PECCQPHIGH_SHIFT 0
+#define I40E_VFPE_CCQPHIGH1_PECCQPHIGH_MASK I40E_MASK(0xFFFFFFFF, I40E_VFPE_CCQPHIGH1_PECCQPHIGH_SHIFT)
+#define I40E_VFPE_CCQPLOW1 0x0000AC00 /* Reset: VFR */
+#define I40E_VFPE_CCQPLOW1_PECCQPLOW_SHIFT 0
+#define I40E_VFPE_CCQPLOW1_PECCQPLOW_MASK I40E_MASK(0xFFFFFFFF, I40E_VFPE_CCQPLOW1_PECCQPLOW_SHIFT)
+#define I40E_VFPE_CCQPSTATUS1 0x0000B800 /* Reset: VFR */
+#define I40E_VFPE_CCQPSTATUS1_CCQP_DONE_SHIFT 0
+#define I40E_VFPE_CCQPSTATUS1_CCQP_DONE_MASK I40E_MASK(0x1, I40E_VFPE_CCQPSTATUS1_CCQP_DONE_SHIFT)
+#define I40E_VFPE_CCQPSTATUS1_HMC_PROFILE_SHIFT 4
+#define I40E_VFPE_CCQPSTATUS1_HMC_PROFILE_MASK I40E_MASK(0x7, I40E_VFPE_CCQPSTATUS1_HMC_PROFILE_SHIFT)
+#define I40E_VFPE_CCQPSTATUS1_RDMA_EN_VFS_SHIFT 16
+#define I40E_VFPE_CCQPSTATUS1_RDMA_EN_VFS_MASK I40E_MASK(0x3F, I40E_VFPE_CCQPSTATUS1_RDMA_EN_VFS_SHIFT)
+#define I40E_VFPE_CCQPSTATUS1_CCQP_ERR_SHIFT 31
+#define I40E_VFPE_CCQPSTATUS1_CCQP_ERR_MASK I40E_MASK(0x1, I40E_VFPE_CCQPSTATUS1_CCQP_ERR_SHIFT)
+#define I40E_VFPE_CQACK1 0x0000B000 /* Reset: VFR */
+#define I40E_VFPE_CQACK1_PECQID_SHIFT 0
+#define I40E_VFPE_CQACK1_PECQID_MASK I40E_MASK(0x1FFFF, I40E_VFPE_CQACK1_PECQID_SHIFT)
+#define I40E_VFPE_CQARM1 0x0000B400 /* Reset: VFR */
+#define I40E_VFPE_CQARM1_PECQID_SHIFT 0
+#define I40E_VFPE_CQARM1_PECQID_MASK I40E_MASK(0x1FFFF, I40E_VFPE_CQARM1_PECQID_SHIFT)
+#define I40E_VFPE_CQPDB1 0x0000BC00 /* Reset: VFR */
+#define I40E_VFPE_CQPDB1_WQHEAD_SHIFT 0
+#define I40E_VFPE_CQPDB1_WQHEAD_MASK I40E_MASK(0x7FF, I40E_VFPE_CQPDB1_WQHEAD_SHIFT)
+#define I40E_VFPE_CQPERRCODES1 0x00009C00 /* Reset: VFR */
+#define I40E_VFPE_CQPERRCODES1_CQP_MINOR_CODE_SHIFT 0
+#define I40E_VFPE_CQPERRCODES1_CQP_MINOR_CODE_MASK I40E_MASK(0xFFFF, I40E_VFPE_CQPERRCODES1_CQP_MINOR_CODE_SHIFT)
+#define I40E_VFPE_CQPERRCODES1_CQP_MAJOR_CODE_SHIFT 16
+#define I40E_VFPE_CQPERRCODES1_CQP_MAJOR_CODE_MASK I40E_MASK(0xFFFF, I40E_VFPE_CQPERRCODES1_CQP_MAJOR_CODE_SHIFT)
+#define I40E_VFPE_CQPTAIL1 0x0000A000 /* Reset: VFR */
+#define I40E_VFPE_CQPTAIL1_WQTAIL_SHIFT 0
+#define I40E_VFPE_CQPTAIL1_WQTAIL_MASK I40E_MASK(0x7FF, I40E_VFPE_CQPTAIL1_WQTAIL_SHIFT)
+#define I40E_VFPE_CQPTAIL1_CQP_OP_ERR_SHIFT 31
+#define I40E_VFPE_CQPTAIL1_CQP_OP_ERR_MASK I40E_MASK(0x1, I40E_VFPE_CQPTAIL1_CQP_OP_ERR_SHIFT)
+#define I40E_VFPE_IPCONFIG01 0x00008C00 /* Reset: VFR */
+#define I40E_VFPE_IPCONFIG01_PEIPID_SHIFT 0
+#define I40E_VFPE_IPCONFIG01_PEIPID_MASK I40E_MASK(0xFFFF, I40E_VFPE_IPCONFIG01_PEIPID_SHIFT)
+#define I40E_VFPE_IPCONFIG01_USEENTIREIDRANGE_SHIFT 16
+#define I40E_VFPE_IPCONFIG01_USEENTIREIDRANGE_MASK I40E_MASK(0x1, I40E_VFPE_IPCONFIG01_USEENTIREIDRANGE_SHIFT)
+#define I40E_VFPE_MRTEIDXMASK1 0x00009000 /* Reset: VFR */
+#define I40E_VFPE_MRTEIDXMASK1_MRTEIDXMASKBITS_SHIFT 0
+#define I40E_VFPE_MRTEIDXMASK1_MRTEIDXMASKBITS_MASK I40E_MASK(0x1F, I40E_VFPE_MRTEIDXMASK1_MRTEIDXMASKBITS_SHIFT)
+#define I40E_VFPE_RCVUNEXPECTEDERROR1 0x00009400 /* Reset: VFR */
+#define I40E_VFPE_RCVUNEXPECTEDERROR1_TCP_RX_UNEXP_ERR_SHIFT 0
+#define I40E_VFPE_RCVUNEXPECTEDERROR1_TCP_RX_UNEXP_ERR_MASK I40E_MASK(0xFFFFFF, I40E_VFPE_RCVUNEXPECTEDERROR1_TCP_RX_UNEXP_ERR_SHIFT)
+#define I40E_VFPE_TCPNOWTIMER1 0x0000A800 /* Reset: VFR */
+#define I40E_VFPE_TCPNOWTIMER1_TCP_NOW_SHIFT 0
+#define I40E_VFPE_TCPNOWTIMER1_TCP_NOW_MASK I40E_MASK(0xFFFFFFFF, I40E_VFPE_TCPNOWTIMER1_TCP_NOW_SHIFT)
+#define I40E_VFPE_WQEALLOC1 0x0000C000 /* Reset: VFR */
+#define I40E_VFPE_WQEALLOC1_PEQPID_SHIFT 0
+#define I40E_VFPE_WQEALLOC1_PEQPID_MASK I40E_MASK(0x3FFFF, I40E_VFPE_WQEALLOC1_PEQPID_SHIFT)
+#define I40E_VFPE_WQEALLOC1_WQE_DESC_INDEX_SHIFT 20
+#define I40E_VFPE_WQEALLOC1_WQE_DESC_INDEX_MASK I40E_MASK(0xFFF, I40E_VFPE_WQEALLOC1_WQE_DESC_INDEX_SHIFT)
+
+#endif /* X722_SUPPORT */
#endif /* _I40E_REGISTER_H_ */
diff --git a/sys/dev/ixl/i40e_type.h b/sys/dev/ixl/i40e_type.h
index 1de747d..01762e7 100644
--- a/sys/dev/ixl/i40e_type.h
+++ b/sys/dev/ixl/i40e_type.h
@@ -41,29 +41,12 @@
#include "i40e_adminq.h"
#include "i40e_hmc.h"
#include "i40e_lan_hmc.h"
+#include "i40e_devids.h"
#define UNREFERENCED_XPARAMETER
-/* Vendor ID */
-#define I40E_INTEL_VENDOR_ID 0x8086
-
-/* Device IDs */
-#define I40E_DEV_ID_SFP_XL710 0x1572
-#define I40E_DEV_ID_QEMU 0x1574
-#define I40E_DEV_ID_KX_A 0x157F
-#define I40E_DEV_ID_KX_B 0x1580
-#define I40E_DEV_ID_KX_C 0x1581
-#define I40E_DEV_ID_QSFP_A 0x1583
-#define I40E_DEV_ID_QSFP_B 0x1584
-#define I40E_DEV_ID_QSFP_C 0x1585
-#define I40E_DEV_ID_10G_BASE_T 0x1586
-#define I40E_DEV_ID_20G_KR2 0x1587
-#define I40E_DEV_ID_VF 0x154C
-#define I40E_DEV_ID_VF_HV 0x1571
-
-#define i40e_is_40G_device(d) ((d) == I40E_DEV_ID_QSFP_A || \
- (d) == I40E_DEV_ID_QSFP_B || \
- (d) == I40E_DEV_ID_QSFP_C)
+#define BIT(a) (1UL << (a))
+#define BIT_ULL(a) (1ULL << (a))
#ifndef I40E_MASK
/* I40E_MASK is a macro used on 32 bit registers */
@@ -191,6 +174,10 @@ enum i40e_mac_type {
I40E_MAC_X710,
I40E_MAC_XL710,
I40E_MAC_VF,
+#ifdef X722_SUPPORT
+ I40E_MAC_X722,
+ I40E_MAC_X722_VF,
+#endif
I40E_MAC_GENERIC,
};
@@ -222,14 +209,14 @@ enum i40e_set_fc_aq_failures {
};
enum i40e_vsi_type {
- I40E_VSI_MAIN = 0,
- I40E_VSI_VMDQ1,
- I40E_VSI_VMDQ2,
- I40E_VSI_CTRL,
- I40E_VSI_FCOE,
- I40E_VSI_MIRROR,
- I40E_VSI_SRIOV,
- I40E_VSI_FDIR,
+ I40E_VSI_MAIN = 0,
+ I40E_VSI_VMDQ1 = 1,
+ I40E_VSI_VMDQ2 = 2,
+ I40E_VSI_CTRL = 3,
+ I40E_VSI_FCOE = 4,
+ I40E_VSI_MIRROR = 5,
+ I40E_VSI_SRIOV = 6,
+ I40E_VSI_FDIR = 7,
I40E_VSI_TYPE_UNKNOWN
};
@@ -253,16 +240,64 @@ struct i40e_link_status {
bool crc_enable;
u8 pacing;
u8 requested_speeds;
+ u8 module_type[3];
+ /* 1st byte: module identifier */
+#define I40E_MODULE_TYPE_SFP 0x03
+#define I40E_MODULE_TYPE_QSFP 0x0D
+ /* 2nd byte: ethernet compliance codes for 10/40G */
+#define I40E_MODULE_TYPE_40G_ACTIVE 0x01
+#define I40E_MODULE_TYPE_40G_LR4 0x02
+#define I40E_MODULE_TYPE_40G_SR4 0x04
+#define I40E_MODULE_TYPE_40G_CR4 0x08
+#define I40E_MODULE_TYPE_10G_BASE_SR 0x10
+#define I40E_MODULE_TYPE_10G_BASE_LR 0x20
+#define I40E_MODULE_TYPE_10G_BASE_LRM 0x40
+#define I40E_MODULE_TYPE_10G_BASE_ER 0x80
+ /* 3rd byte: ethernet compliance codes for 1G */
+#define I40E_MODULE_TYPE_1000BASE_SX 0x01
+#define I40E_MODULE_TYPE_1000BASE_LX 0x02
+#define I40E_MODULE_TYPE_1000BASE_CX 0x04
+#define I40E_MODULE_TYPE_1000BASE_T 0x08
+};
+
+enum i40e_aq_capabilities_phy_type {
+ I40E_CAP_PHY_TYPE_SGMII = BIT(I40E_PHY_TYPE_SGMII),
+ I40E_CAP_PHY_TYPE_1000BASE_KX = BIT(I40E_PHY_TYPE_1000BASE_KX),
+ I40E_CAP_PHY_TYPE_10GBASE_KX4 = BIT(I40E_PHY_TYPE_10GBASE_KX4),
+ I40E_CAP_PHY_TYPE_10GBASE_KR = BIT(I40E_PHY_TYPE_10GBASE_KR),
+ I40E_CAP_PHY_TYPE_40GBASE_KR4 = BIT(I40E_PHY_TYPE_40GBASE_KR4),
+ I40E_CAP_PHY_TYPE_XAUI = BIT(I40E_PHY_TYPE_XAUI),
+ I40E_CAP_PHY_TYPE_XFI = BIT(I40E_PHY_TYPE_XFI),
+ I40E_CAP_PHY_TYPE_SFI = BIT(I40E_PHY_TYPE_SFI),
+ I40E_CAP_PHY_TYPE_XLAUI = BIT(I40E_PHY_TYPE_XLAUI),
+ I40E_CAP_PHY_TYPE_XLPPI = BIT(I40E_PHY_TYPE_XLPPI),
+ I40E_CAP_PHY_TYPE_40GBASE_CR4_CU = BIT(I40E_PHY_TYPE_40GBASE_CR4_CU),
+ I40E_CAP_PHY_TYPE_10GBASE_CR1_CU = BIT(I40E_PHY_TYPE_10GBASE_CR1_CU),
+ I40E_CAP_PHY_TYPE_10GBASE_AOC = BIT(I40E_PHY_TYPE_10GBASE_AOC),
+ I40E_CAP_PHY_TYPE_40GBASE_AOC = BIT(I40E_PHY_TYPE_40GBASE_AOC),
+ I40E_CAP_PHY_TYPE_100BASE_TX = BIT(I40E_PHY_TYPE_100BASE_TX),
+ I40E_CAP_PHY_TYPE_1000BASE_T = BIT(I40E_PHY_TYPE_1000BASE_T),
+ I40E_CAP_PHY_TYPE_10GBASE_T = BIT(I40E_PHY_TYPE_10GBASE_T),
+ I40E_CAP_PHY_TYPE_10GBASE_SR = BIT(I40E_PHY_TYPE_10GBASE_SR),
+ I40E_CAP_PHY_TYPE_10GBASE_LR = BIT(I40E_PHY_TYPE_10GBASE_LR),
+ I40E_CAP_PHY_TYPE_10GBASE_SFPP_CU = BIT(I40E_PHY_TYPE_10GBASE_SFPP_CU),
+ I40E_CAP_PHY_TYPE_10GBASE_CR1 = BIT(I40E_PHY_TYPE_10GBASE_CR1),
+ I40E_CAP_PHY_TYPE_40GBASE_CR4 = BIT(I40E_PHY_TYPE_40GBASE_CR4),
+ I40E_CAP_PHY_TYPE_40GBASE_SR4 = BIT(I40E_PHY_TYPE_40GBASE_SR4),
+ I40E_CAP_PHY_TYPE_40GBASE_LR4 = BIT(I40E_PHY_TYPE_40GBASE_LR4),
+ I40E_CAP_PHY_TYPE_1000BASE_SX = BIT(I40E_PHY_TYPE_1000BASE_SX),
+ I40E_CAP_PHY_TYPE_1000BASE_LX = BIT(I40E_PHY_TYPE_1000BASE_LX),
+ I40E_CAP_PHY_TYPE_1000BASE_T_OPTICAL = BIT(I40E_PHY_TYPE_1000BASE_T_OPTICAL),
+ I40E_CAP_PHY_TYPE_20GBASE_KR2 = BIT(I40E_PHY_TYPE_20GBASE_KR2)
};
struct i40e_phy_info {
struct i40e_link_status link_info;
struct i40e_link_status link_info_old;
- u32 autoneg_advertised;
- u32 phy_id;
- u32 module_type;
bool get_link_info;
enum i40e_media_type media_type;
+ /* all the phy types the NVM is capable of */
+ enum i40e_aq_capabilities_phy_type phy_types;
};
#define I40E_HW_CAP_MAX_GPIO 30
@@ -287,7 +322,17 @@ struct i40e_hw_capabilities {
bool dcb;
bool fcoe;
bool iscsi; /* Indicates iSCSI enabled */
- bool mfp_mode_1;
+ bool flex10_enable;
+ bool flex10_capable;
+ u32 flex10_mode;
+#define I40E_FLEX10_MODE_UNKNOWN 0x0
+#define I40E_FLEX10_MODE_DCC 0x1
+#define I40E_FLEX10_MODE_DCI 0x2
+
+ u32 flex10_status;
+#define I40E_FLEX10_STATUS_DCC_ERROR 0x1
+#define I40E_FLEX10_STATUS_VC_MODE 0x2
+
bool mgmt_cem;
bool ieee_1588;
bool iwarp;
@@ -316,6 +361,7 @@ struct i40e_hw_capabilities {
u8 rx_buf_chain_len;
u32 enabled_tcmap;
u32 maxtc;
+ u64 wr_csr_prot;
};
struct i40e_mac_info {
@@ -343,6 +389,7 @@ struct i40e_nvm_info {
bool blank_nvm_mode; /* is NVM empty (no FW present)*/
u16 version; /* NVM package version */
u32 eetrack; /* NVM data version */
+ u32 oem_ver; /* OEM version info */
};
/* definitions used in NVM update support */
@@ -361,12 +408,17 @@ enum i40e_nvmupd_cmd {
I40E_NVMUPD_CSUM_CON,
I40E_NVMUPD_CSUM_SA,
I40E_NVMUPD_CSUM_LCB,
+ I40E_NVMUPD_STATUS,
+ I40E_NVMUPD_EXEC_AQ,
+ I40E_NVMUPD_GET_AQ_RESULT,
};
enum i40e_nvmupd_state {
I40E_NVMUPD_STATE_INIT,
I40E_NVMUPD_STATE_READING,
- I40E_NVMUPD_STATE_WRITING
+ I40E_NVMUPD_STATE_WRITING,
+ I40E_NVMUPD_STATE_INIT_WAIT,
+ I40E_NVMUPD_STATE_WRITE_WAIT,
};
/* nvm_access definition and its masks/shifts need to be accessible to
@@ -385,6 +437,7 @@ enum i40e_nvmupd_state {
#define I40E_NVM_SA (I40E_NVM_SNT | I40E_NVM_LCB)
#define I40E_NVM_ERA 0x4
#define I40E_NVM_CSUM 0x8
+#define I40E_NVM_EXEC 0xf
#define I40E_NVM_ADAPT_SHIFT 16
#define I40E_NVM_ADAPT_MASK (0xffffULL << I40E_NVM_ADAPT_SHIFT)
@@ -465,6 +518,8 @@ struct i40e_fc_info {
#define I40E_APP_PROTOID_FIP 0x8914
#define I40E_APP_SEL_ETHTYPE 0x1
#define I40E_APP_SEL_TCPIP 0x2
+#define I40E_CEE_APP_SEL_ETHTYPE 0x0
+#define I40E_CEE_APP_SEL_TCPIP 0x1
/* CEE or IEEE 802.1Qaz ETS Configuration data */
struct i40e_dcb_ets_config {
@@ -496,6 +551,7 @@ struct i40e_dcbx_config {
#define I40E_DCBX_MODE_CEE 0x1
#define I40E_DCBX_MODE_IEEE 0x2
u32 numapps;
+ u32 tlv_status; /* CEE mode TLV status */
struct i40e_dcb_ets_config etscfg;
struct i40e_dcb_ets_config etsrec;
struct i40e_dcb_pfc_config pfc;
@@ -547,6 +603,8 @@ struct i40e_hw {
/* state of nvm update process */
enum i40e_nvmupd_state nvmupd_state;
+ struct i40e_aq_desc nvm_wb_desc;
+ struct i40e_virt_mem nvm_buff;
/* HMC info */
struct i40e_hmc_info hmc; /* HMC info struct */
@@ -555,16 +613,23 @@ struct i40e_hw {
u16 dcbx_status;
/* DCBX info */
- struct i40e_dcbx_config local_dcbx_config;
- struct i40e_dcbx_config remote_dcbx_config;
+ struct i40e_dcbx_config local_dcbx_config; /* Oper/Local Cfg */
+ struct i40e_dcbx_config remote_dcbx_config; /* Peer Cfg */
+ struct i40e_dcbx_config desired_dcbx_config; /* CEE Desired Cfg */
/* debug mask */
u32 debug_mask;
+ char err_str[16];
};
-static inline bool i40e_is_vf(struct i40e_hw *hw)
+static INLINE bool i40e_is_vf(struct i40e_hw *hw)
{
+#ifdef X722_SUPPORT
+ return (hw->mac.type == I40E_MAC_VF ||
+ hw->mac.type == I40E_MAC_X722_VF);
+#else
return hw->mac.type == I40E_MAC_VF;
+#endif
}
struct i40e_driver_version {
@@ -668,7 +733,11 @@ enum i40e_rx_desc_status_bits {
I40E_RX_DESC_STATUS_CRCP_SHIFT = 4,
I40E_RX_DESC_STATUS_TSYNINDX_SHIFT = 5, /* 2 BITS */
I40E_RX_DESC_STATUS_TSYNVALID_SHIFT = 7,
+#ifdef X722_SUPPORT
+ I40E_RX_DESC_STATUS_EXT_UDP_0_SHIFT = 8,
+#else
I40E_RX_DESC_STATUS_RESERVED1_SHIFT = 8,
+#endif
I40E_RX_DESC_STATUS_UMBCAST_SHIFT = 9, /* 2 BITS */
I40E_RX_DESC_STATUS_FLM_SHIFT = 11,
@@ -676,12 +745,16 @@ enum i40e_rx_desc_status_bits {
I40E_RX_DESC_STATUS_LPBK_SHIFT = 14,
I40E_RX_DESC_STATUS_IPV6EXADD_SHIFT = 15,
I40E_RX_DESC_STATUS_RESERVED2_SHIFT = 16, /* 2 BITS */
+#ifdef X722_SUPPORT
+ I40E_RX_DESC_STATUS_INT_UDP_0_SHIFT = 18,
+#else
I40E_RX_DESC_STATUS_UDP_0_SHIFT = 18,
+#endif
I40E_RX_DESC_STATUS_LAST /* this entry must be last!!! */
};
#define I40E_RXD_QW1_STATUS_SHIFT 0
-#define I40E_RXD_QW1_STATUS_MASK (((1 << I40E_RX_DESC_STATUS_LAST) - 1) << \
+#define I40E_RXD_QW1_STATUS_MASK ((BIT(I40E_RX_DESC_STATUS_LAST) - 1) << \
I40E_RXD_QW1_STATUS_SHIFT)
#define I40E_RXD_QW1_STATUS_TSYNINDX_SHIFT I40E_RX_DESC_STATUS_TSYNINDX_SHIFT
@@ -689,8 +762,7 @@ enum i40e_rx_desc_status_bits {
I40E_RXD_QW1_STATUS_TSYNINDX_SHIFT)
#define I40E_RXD_QW1_STATUS_TSYNVALID_SHIFT I40E_RX_DESC_STATUS_TSYNVALID_SHIFT
-#define I40E_RXD_QW1_STATUS_TSYNVALID_MASK (0x1UL << \
- I40E_RXD_QW1_STATUS_TSYNVALID_SHIFT)
+#define I40E_RXD_QW1_STATUS_TSYNVALID_MASK BIT_ULL(I40E_RXD_QW1_STATUS_TSYNVALID_SHIFT)
#define I40E_RXD_QW1_STATUS_UMBCAST_SHIFT I40E_RX_DESC_STATUS_UMBCAST
#define I40E_RXD_QW1_STATUS_UMBCAST_MASK (0x3UL << \
@@ -836,8 +908,7 @@ enum i40e_rx_ptype_payload_layer {
I40E_RXD_QW1_LENGTH_HBUF_SHIFT)
#define I40E_RXD_QW1_LENGTH_SPH_SHIFT 63
-#define I40E_RXD_QW1_LENGTH_SPH_MASK (0x1ULL << \
- I40E_RXD_QW1_LENGTH_SPH_SHIFT)
+#define I40E_RXD_QW1_LENGTH_SPH_MASK BIT_ULL(I40E_RXD_QW1_LENGTH_SPH_SHIFT)
#define I40E_RXD_QW1_NEXTP_SHIFT 38
#define I40E_RXD_QW1_NEXTP_MASK (0x1FFFULL << I40E_RXD_QW1_NEXTP_SHIFT)
@@ -1040,12 +1111,11 @@ enum i40e_tx_ctx_desc_eipt_offload {
#define I40E_TXD_CTX_QW0_NATT_SHIFT 9
#define I40E_TXD_CTX_QW0_NATT_MASK (0x3ULL << I40E_TXD_CTX_QW0_NATT_SHIFT)
-#define I40E_TXD_CTX_UDP_TUNNELING (0x1ULL << I40E_TXD_CTX_QW0_NATT_SHIFT)
+#define I40E_TXD_CTX_UDP_TUNNELING BIT_ULL(I40E_TXD_CTX_QW0_NATT_SHIFT)
#define I40E_TXD_CTX_GRE_TUNNELING (0x2ULL << I40E_TXD_CTX_QW0_NATT_SHIFT)
#define I40E_TXD_CTX_QW0_EIP_NOINC_SHIFT 11
-#define I40E_TXD_CTX_QW0_EIP_NOINC_MASK (0x1ULL << \
- I40E_TXD_CTX_QW0_EIP_NOINC_SHIFT)
+#define I40E_TXD_CTX_QW0_EIP_NOINC_MASK BIT_ULL(I40E_TXD_CTX_QW0_EIP_NOINC_SHIFT)
#define I40E_TXD_CTX_EIP_NOINC_IPID_CONST I40E_TXD_CTX_QW0_EIP_NOINC_MASK
@@ -1057,6 +1127,10 @@ enum i40e_tx_ctx_desc_eipt_offload {
#define I40E_TXD_CTX_QW0_DECTTL_MASK (0xFULL << \
I40E_TXD_CTX_QW0_DECTTL_SHIFT)
+#ifdef X722_SUPPORT
+#define I40E_TXD_CTX_QW0_L4T_CS_SHIFT 23
+#define I40E_TXD_CTX_QW0_L4T_CS_MASK BIT_ULL(I40E_TXD_CTX_QW0_L4T_CS_SHIFT)
+#endif
struct i40e_nop_desc {
__le64 rsvd;
__le64 dtype_cmd;
@@ -1093,15 +1167,38 @@ struct i40e_filter_program_desc {
/* Packet Classifier Types for filters */
enum i40e_filter_pctype {
+#ifdef X722_SUPPORT
+ /* Note: Values 0-28 are reserved for future use.
+ * Value 29, 30, 32 are not supported on XL710 and X710.
+ */
+ I40E_FILTER_PCTYPE_NONF_UNICAST_IPV4_UDP = 29,
+ I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV4_UDP = 30,
+#else
/* Note: Values 0-30 are reserved for future use */
+#endif
I40E_FILTER_PCTYPE_NONF_IPV4_UDP = 31,
+#ifdef X722_SUPPORT
+ I40E_FILTER_PCTYPE_NONF_IPV4_TCP_SYN_NO_ACK = 32,
+#else
/* Note: Value 32 is reserved for future use */
+#endif
I40E_FILTER_PCTYPE_NONF_IPV4_TCP = 33,
I40E_FILTER_PCTYPE_NONF_IPV4_SCTP = 34,
I40E_FILTER_PCTYPE_NONF_IPV4_OTHER = 35,
I40E_FILTER_PCTYPE_FRAG_IPV4 = 36,
+#ifdef X722_SUPPORT
+ /* Note: Values 37-38 are reserved for future use.
+ * Value 39, 40, 42 are not supported on XL710 and X710.
+ */
+ I40E_FILTER_PCTYPE_NONF_UNICAST_IPV6_UDP = 39,
+ I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV6_UDP = 40,
+#else
/* Note: Values 37-40 are reserved for future use */
+#endif
I40E_FILTER_PCTYPE_NONF_IPV6_UDP = 41,
+#ifdef X722_SUPPORT
+ I40E_FILTER_PCTYPE_NONF_IPV6_TCP_SYN_NO_ACK = 42,
+#endif
I40E_FILTER_PCTYPE_NONF_IPV6_TCP = 43,
I40E_FILTER_PCTYPE_NONF_IPV6_SCTP = 44,
I40E_FILTER_PCTYPE_NONF_IPV6_OTHER = 45,
@@ -1128,8 +1225,7 @@ enum i40e_filter_program_desc_fd_status {
};
#define I40E_TXD_FLTR_QW0_DEST_VSI_SHIFT 23
-#define I40E_TXD_FLTR_QW0_DEST_VSI_MASK (0x1FFUL << \
- I40E_TXD_FLTR_QW0_DEST_VSI_SHIFT)
+#define I40E_TXD_FLTR_QW0_DEST_VSI_MASK BIT_ULL(I40E_TXD_FLTR_QW0_DEST_VSI_SHIFT)
#define I40E_TXD_FLTR_QW1_DTYPE_SHIFT 0
#define I40E_TXD_FLTR_QW1_DTYPE_MASK (0xFUL << I40E_TXD_FLTR_QW1_DTYPE_SHIFT)
@@ -1150,13 +1246,18 @@ enum i40e_filter_program_desc_pcmd {
#define I40E_TXD_FLTR_QW1_DEST_MASK (0x3ULL << I40E_TXD_FLTR_QW1_DEST_SHIFT)
#define I40E_TXD_FLTR_QW1_CNT_ENA_SHIFT (0x7ULL + I40E_TXD_FLTR_QW1_CMD_SHIFT)
-#define I40E_TXD_FLTR_QW1_CNT_ENA_MASK (0x1ULL << \
- I40E_TXD_FLTR_QW1_CNT_ENA_SHIFT)
+#define I40E_TXD_FLTR_QW1_CNT_ENA_MASK BIT_ULL(I40E_TXD_FLTR_QW1_CNT_ENA_SHIFT)
#define I40E_TXD_FLTR_QW1_FD_STATUS_SHIFT (0x9ULL + \
I40E_TXD_FLTR_QW1_CMD_SHIFT)
#define I40E_TXD_FLTR_QW1_FD_STATUS_MASK (0x3ULL << \
I40E_TXD_FLTR_QW1_FD_STATUS_SHIFT)
+#ifdef X722_SUPPORT
+
+#define I40E_TXD_FLTR_QW1_ATR_SHIFT (0xEULL + \
+ I40E_TXD_FLTR_QW1_CMD_SHIFT)
+#define I40E_TXD_FLTR_QW1_ATR_MASK BIT_ULL(I40E_TXD_FLTR_QW1_ATR_SHIFT)
+#endif
#define I40E_TXD_FLTR_QW1_CNTINDEX_SHIFT 20
#define I40E_TXD_FLTR_QW1_CNTINDEX_MASK (0x1FFUL << \
@@ -1263,6 +1364,9 @@ struct i40e_hw_port_stats {
/* flow director stats */
u64 fd_atr_match;
u64 fd_sb_match;
+ u64 fd_atr_tunnel_match;
+ u32 fd_atr_status;
+ u32 fd_sb_status;
/* EEE LPI */
u32 tx_lpi_status;
u32 rx_lpi_status;
@@ -1288,6 +1392,7 @@ struct i40e_hw_port_stats {
#define I40E_SR_PBA_FLAGS 0x15
#define I40E_SR_PBA_BLOCK_PTR 0x16
#define I40E_SR_BOOT_CONFIG_PTR 0x17
+#define I40E_NVM_OEM_VER_OFF 0x83
#define I40E_SR_NVM_DEV_STARTER_VERSION 0x18
#define I40E_SR_NVM_WAKE_ON_LAN 0x19
#define I40E_SR_ALTERNATE_SAN_MAC_ADDRESS_PTR 0x27
diff --git a/sys/dev/ixl/i40e_virtchnl.h b/sys/dev/ixl/i40e_virtchnl.h
index 5a5e8f3..9da33a0 100644
--- a/sys/dev/ixl/i40e_virtchnl.h
+++ b/sys/dev/ixl/i40e_virtchnl.h
@@ -1,6 +1,6 @@
/******************************************************************************
- Copyright (c) 2013-2014, Intel Corporation
+ Copyright (c) 2013-2015, Intel Corporation
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -89,7 +89,6 @@ enum i40e_virtchnl_ops {
I40E_VIRTCHNL_OP_GET_STATS = 15,
I40E_VIRTCHNL_OP_FCOE = 16,
I40E_VIRTCHNL_OP_EVENT = 17,
- I40E_VIRTCHNL_OP_CONFIG_RSS = 18,
};
/* Virtual channel message descriptor. This overlays the admin queue
@@ -118,7 +117,9 @@ struct i40e_virtchnl_msg {
* error regardless of version mismatch.
*/
#define I40E_VIRTCHNL_VERSION_MAJOR 1
-#define I40E_VIRTCHNL_VERSION_MINOR 0
+#define I40E_VIRTCHNL_VERSION_MINOR 1
+#define I40E_VIRTCHNL_VERSION_MINOR_NO_VF_CAPS 0
+
struct i40e_virtchnl_version_info {
u32 major;
u32 minor;
@@ -137,7 +138,8 @@ struct i40e_virtchnl_version_info {
*/
/* I40E_VIRTCHNL_OP_GET_VF_RESOURCES
- * VF sends this request to PF with no parameters
+ * Version 1.0 VF sends this request to PF with no parameters
+ * Version 1.1 VF sends this request to PF with u32 bitmap of its capabilities
* PF responds with an indirect message containing
* i40e_virtchnl_vf_resource and one or more
* i40e_virtchnl_vsi_resource structures.
@@ -151,10 +153,13 @@ struct i40e_virtchnl_vsi_resource {
u8 default_mac_addr[I40E_ETH_LENGTH_OF_ADDRESS];
};
/* VF offload flags */
-#define I40E_VIRTCHNL_VF_OFFLOAD_L2 0x00000001
-#define I40E_VIRTCHNL_VF_OFFLOAD_IWARP 0x00000002
-#define I40E_VIRTCHNL_VF_OFFLOAD_FCOE 0x00000004
-#define I40E_VIRTCHNL_VF_OFFLOAD_VLAN 0x00010000
+#define I40E_VIRTCHNL_VF_OFFLOAD_L2 0x00000001
+#define I40E_VIRTCHNL_VF_OFFLOAD_IWARP 0x00000002
+#define I40E_VIRTCHNL_VF_OFFLOAD_FCOE 0x00000004
+#define I40E_VIRTCHNL_VF_OFFLOAD_RSS_AQ 0x00000008
+#define I40E_VIRTCHNL_VF_OFFLOAD_RSS_REG 0x00000010
+#define I40E_VIRTCHNL_VF_OFFLOAD_VLAN 0x00010000
+#define I40E_VIRTCHNL_VF_OFFLOAD_RX_POLLING 0x00020000
struct i40e_virtchnl_vf_resource {
u16 num_vsis;
diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c
index de4ee24..13a678c 100644
--- a/sys/dev/ixl/if_ixl.c
+++ b/sys/dev/ixl/if_ixl.c
@@ -48,7 +48,7 @@
/*********************************************************************
* Driver version
*********************************************************************/
-char ixl_driver_version[] = "1.4.1";
+char ixl_driver_version[] = "1.4.3";
/*********************************************************************
* PCI Device ID Table
@@ -70,7 +70,14 @@ static ixl_vendor_info_t ixl_vendor_info_array[] =
{I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_B, 0, 0, 0},
{I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_C, 0, 0, 0},
{I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T, 0, 0, 0},
+ {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T4, 0, 0, 0},
{I40E_INTEL_VENDOR_ID, I40E_DEV_ID_20G_KR2, 0, 0, 0},
+ {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_20G_KR2_A, 0, 0, 0},
+#ifdef X722_SUPPORT
+ {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_X722, 0, 0, 0},
+ {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_1G_BASE_T_X722, 0, 0, 0},
+ {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T_X722, 0, 0, 0},
+#endif
/* required last entry */
{0, 0, 0, 0, 0}
};
@@ -199,8 +206,8 @@ static int ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS);
#ifdef PCI_IOV
static int ixl_adminq_err_to_errno(enum i40e_admin_queue_err err);
-static int ixl_init_iov(device_t dev, uint16_t num_vfs, const nvlist_t*);
-static void ixl_uninit_iov(device_t dev);
+static int ixl_iov_init(device_t dev, uint16_t num_vfs, const nvlist_t*);
+static void ixl_iov_uninit(device_t dev);
static int ixl_add_vf(device_t dev, uint16_t vfnum, const nvlist_t*);
static void ixl_handle_vf_msg(struct ixl_pf *,
@@ -222,9 +229,9 @@ static device_method_t ixl_methods[] = {
DEVMETHOD(device_detach, ixl_detach),
DEVMETHOD(device_shutdown, ixl_shutdown),
#ifdef PCI_IOV
- DEVMETHOD(pci_init_iov, ixl_init_iov),
- DEVMETHOD(pci_uninit_iov, ixl_uninit_iov),
- DEVMETHOD(pci_add_vf, ixl_add_vf),
+ DEVMETHOD(pci_iov_init, ixl_iov_init),
+ DEVMETHOD(pci_iov_uninit, ixl_iov_uninit),
+ DEVMETHOD(pci_iov_add_vf, ixl_add_vf),
#endif
{0, 0}
};
@@ -238,12 +245,10 @@ DRIVER_MODULE(ixl, pci, ixl_driver, ixl_devclass, 0, 0);
MODULE_DEPEND(ixl, pci, 1, 1, 1);
MODULE_DEPEND(ixl, ether, 1, 1, 1);
-
#ifdef DEV_NETMAP
MODULE_DEPEND(ixl, netmap, 1, 1, 1);
#endif /* DEV_NETMAP */
-
/*
** Global reset mutex
*/
@@ -480,6 +485,22 @@ ixl_attach(device_t dev)
#ifdef IXL_DEBUG_SYSCTL
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
+ OID_AUTO, "debug", CTLTYPE_INT|CTLFLAG_RW, pf, 0,
+ ixl_debug_info, "I", "Debug Information");
+
+ /* Debug shared-code message level */
+ SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+ SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
+ OID_AUTO, "debug_mask", CTLFLAG_RW,
+ &pf->hw.debug_mask, 0, "Debug Message Level");
+
+ SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+ SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
+ OID_AUTO, "vc_debug_level", CTLFLAG_RW, &pf->vc_debug_lvl,
+ 0, "PF/VF Virtual Channel debug level");
+
+ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
+ SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
OID_AUTO, "link_status", CTLTYPE_STRING | CTLFLAG_RD,
pf, 0, ixl_sysctl_link_status, "A", "Current Link Status");
@@ -525,13 +546,6 @@ ixl_attach(device_t dev)
goto err_out;
}
- /* Create for initial debugging use */
- SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
- SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
- OID_AUTO, "debug", CTLTYPE_INT|CTLFLAG_RW, pf, 0,
- ixl_debug_info, "I", "Debug Information");
-
-
/* Establish a clean starting point */
i40e_clear_hw(hw);
error = i40e_pf_reset(hw);
@@ -642,7 +656,7 @@ ixl_attach(device_t dev)
/* Determine link state */
i40e_aq_get_link_info(hw, TRUE, NULL, NULL);
- pf->link_up = i40e_get_link_status(hw);
+ i40e_get_link_status(hw, &pf->link_up);
/* Setup OS specific network interface */
if (ixl_setup_interface(dev, vsi) != 0) {
@@ -702,7 +716,6 @@ ixl_attach(device_t dev)
#ifdef DEV_NETMAP
ixl_netmap_attach(vsi);
#endif /* DEV_NETMAP */
-
INIT_DEBUGOUT("ixl_attach: end");
return (0);
@@ -1053,6 +1066,9 @@ ixl_ioctl(struct ifnet * ifp, u_long command, caddr_t data)
break;
case SIOCSIFMEDIA:
case SIOCGIFMEDIA:
+#ifdef IFM_ETH_XTYPE
+ case SIOCGIFXMEDIA:
+#endif
IOCTL_DEBUGOUT("ioctl: SIOCxIFMEDIA (Get/Set Interface Media)");
error = ifmedia_ioctl(ifp, ifr, &vsi->media, command);
break;
@@ -1426,7 +1442,7 @@ ixl_media_status(struct ifnet * ifp, struct ifmediareq * ifmr)
IXL_PF_LOCK(pf);
hw->phy.get_link_info = TRUE;
- pf->link_up = i40e_get_link_status(hw);
+ i40e_get_link_status(hw, &pf->link_up);
ixl_update_link_status(pf);
ifmr->ifm_status = IFM_AVALID;
@@ -1457,12 +1473,7 @@ ixl_media_status(struct ifnet * ifp, struct ifmediareq * ifmr)
ifmr->ifm_active |= IFM_1000_LX;
break;
/* 10 G */
- case I40E_PHY_TYPE_10GBASE_CR1:
- case I40E_PHY_TYPE_10GBASE_CR1_CU:
case I40E_PHY_TYPE_10GBASE_SFPP_CU:
- /* Using this until a real KR media type */
- case I40E_PHY_TYPE_10GBASE_KR:
- case I40E_PHY_TYPE_10GBASE_KX4:
ifmr->ifm_active |= IFM_10G_TWINAX;
break;
case I40E_PHY_TYPE_10GBASE_SR:
@@ -1485,16 +1496,49 @@ ixl_media_status(struct ifnet * ifp, struct ifmediareq * ifmr)
case I40E_PHY_TYPE_40GBASE_LR4:
ifmr->ifm_active |= IFM_40G_LR4;
break;
- /*
- ** Set these to CR4 because OS does not
- ** have types available yet.
- */
+#ifndef IFM_ETH_XTYPE
+ case I40E_PHY_TYPE_1000BASE_KX:
+ ifmr->ifm_active |= IFM_1000_CX;
+ break;
+ case I40E_PHY_TYPE_10GBASE_CR1_CU:
+ case I40E_PHY_TYPE_10GBASE_CR1:
+ ifmr->ifm_active |= IFM_10G_TWINAX;
+ break;
+ case I40E_PHY_TYPE_10GBASE_KX4:
+ ifmr->ifm_active |= IFM_10G_CX4;
+ break;
+ case I40E_PHY_TYPE_10GBASE_KR:
+ ifmr->ifm_active |= IFM_10G_SR;
+ break;
case I40E_PHY_TYPE_40GBASE_KR4:
- case I40E_PHY_TYPE_XLAUI:
case I40E_PHY_TYPE_XLPPI:
- case I40E_PHY_TYPE_40GBASE_AOC:
- ifmr->ifm_active |= IFM_40G_CR4;
+ ifmr->ifm_active |= IFM_40G_SR4;
+ break;
+#else
+ case I40E_PHY_TYPE_1000BASE_KX:
+ ifmr->ifm_active |= IFM_1000_KX;
+ break;
+ /* ERJ: What's the difference between these? */
+ case I40E_PHY_TYPE_10GBASE_CR1_CU:
+ case I40E_PHY_TYPE_10GBASE_CR1:
+ ifmr->ifm_active |= IFM_10G_CR1;
+ break;
+ case I40E_PHY_TYPE_10GBASE_KX4:
+ ifmr->ifm_active |= IFM_10G_KX4;
+ break;
+ case I40E_PHY_TYPE_10GBASE_KR:
+ ifmr->ifm_active |= IFM_10G_KR;
+ break;
+ case I40E_PHY_TYPE_20GBASE_KR2:
+ ifmr->ifm_active |= IFM_20G_KR2;
+ break;
+ case I40E_PHY_TYPE_40GBASE_KR4:
+ ifmr->ifm_active |= IFM_40G_KR4;
+ break;
+ case I40E_PHY_TYPE_XLPPI:
+ ifmr->ifm_active |= IFM_40G_XLPPI;
break;
+#endif
default:
ifmr->ifm_active |= IFM_UNKNOWN;
break;
@@ -2417,13 +2461,8 @@ ixl_add_ifmedia(struct ixl_vsi *vsi, u32 phy_type)
if (phy_type & (1 << I40E_PHY_TYPE_1000BASE_LX))
ifmedia_add(&vsi->media, IFM_ETHER | IFM_1000_LX, 0, NULL);
- if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_CR1_CU) ||
- phy_type & (1 << I40E_PHY_TYPE_10GBASE_KX4) ||
- phy_type & (1 << I40E_PHY_TYPE_10GBASE_KR) ||
- phy_type & (1 << I40E_PHY_TYPE_10GBASE_AOC) ||
- phy_type & (1 << I40E_PHY_TYPE_XAUI) ||
+ if (phy_type & (1 << I40E_PHY_TYPE_XAUI) ||
phy_type & (1 << I40E_PHY_TYPE_XFI) ||
- phy_type & (1 << I40E_PHY_TYPE_SFI) ||
phy_type & (1 << I40E_PHY_TYPE_10GBASE_SFPP_CU))
ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_TWINAX, 0, NULL);
@@ -2438,15 +2477,55 @@ ixl_add_ifmedia(struct ixl_vsi *vsi, u32 phy_type)
phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4_CU) ||
phy_type & (1 << I40E_PHY_TYPE_40GBASE_AOC) ||
phy_type & (1 << I40E_PHY_TYPE_XLAUI) ||
- phy_type & (1 << I40E_PHY_TYPE_XLPPI) ||
- /* KR4 uses CR4 until the OS has the real media type */
phy_type & (1 << I40E_PHY_TYPE_40GBASE_KR4))
ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_CR4, 0, NULL);
-
if (phy_type & (1 << I40E_PHY_TYPE_40GBASE_SR4))
ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_SR4, 0, NULL);
if (phy_type & (1 << I40E_PHY_TYPE_40GBASE_LR4))
ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_LR4, 0, NULL);
+
+#ifndef IFM_ETH_XTYPE
+ if (phy_type & (1 << I40E_PHY_TYPE_1000BASE_KX))
+ ifmedia_add(&vsi->media, IFM_ETHER | IFM_1000_CX, 0, NULL);
+
+ if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_CR1_CU) ||
+ phy_type & (1 << I40E_PHY_TYPE_10GBASE_CR1) ||
+ phy_type & (1 << I40E_PHY_TYPE_10GBASE_AOC) ||
+ phy_type & (1 << I40E_PHY_TYPE_SFI))
+ ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_TWINAX, 0, NULL);
+ if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_KX4))
+ ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_CX4, 0, NULL);
+ if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_KR))
+ ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_SR, 0, NULL);
+
+ if (phy_type & (1 << I40E_PHY_TYPE_40GBASE_KR4))
+ ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_SR4, 0, NULL);
+ if (phy_type & (1 << I40E_PHY_TYPE_XLPPI))
+ ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_CR4, 0, NULL);
+#else
+ if (phy_type & (1 << I40E_PHY_TYPE_1000BASE_KX))
+ ifmedia_add(&vsi->media, IFM_ETHER | IFM_1000_KX, 0, NULL);
+
+ if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_CR1_CU)
+ || phy_type & (1 << I40E_PHY_TYPE_10GBASE_CR1))
+ ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_CR1, 0, NULL);
+ if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_AOC))
+ ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_TWINAX_LONG, 0, NULL);
+ if (phy_type & (1 << I40E_PHY_TYPE_SFI))
+ ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_SFI, 0, NULL);
+ if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_KX4))
+ ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_KX4, 0, NULL);
+ if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_KR))
+ ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_KR, 0, NULL);
+
+ if (phy_type & (1 << I40E_PHY_TYPE_20GBASE_KR2))
+ ifmedia_add(&vsi->media, IFM_ETHER | IFM_20G_KR2, 0, NULL);
+
+ if (phy_type & (1 << I40E_PHY_TYPE_40GBASE_KR4))
+ ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_KR4, 0, NULL);
+ if (phy_type & (1 << I40E_PHY_TYPE_XLPPI))
+ ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_XLPPI, 0, NULL);
+#endif
}
/*********************************************************************
@@ -2569,7 +2648,7 @@ ixl_link_event(struct ixl_pf *pf, struct i40e_arq_event_info *e)
bool check;
hw->phy.get_link_info = TRUE;
- check = i40e_get_link_status(hw);
+ i40e_get_link_status(hw, &check);
pf->link_up = check;
#ifdef IXL_DEBUG
printf("Link is %s\n", check ? "up":"down");
@@ -3184,10 +3263,6 @@ ixl_add_hw_stats(struct ixl_pf *pf)
CTLFLAG_RD, &pf->admin_irq,
"Admin Queue IRQ Handled");
- SYSCTL_ADD_INT(ctx, child, OID_AUTO, "vc_debug_level",
- CTLFLAG_RW, &pf->vc_debug_lvl, 0,
- "PF/VF Virtual Channel debug logging level");
-
ixl_add_vsi_sysctls(pf, &pf->vsi, ctx, "pf");
vsi_list = SYSCTL_CHILDREN(pf->vsi.vsi_node);
@@ -3331,6 +3406,7 @@ ixl_add_sysctls_mac_stats(struct sysctl_ctx_list *ctx,
}
}
+
/*
** ixl_config_rss - setup RSS
** - note this is done for the single vsi
@@ -4976,8 +5052,8 @@ static int
ixl_res_alloc_cmp(const void *a, const void *b)
{
const struct i40e_aqc_switch_resource_alloc_element_resp *one, *two;
- one = (struct i40e_aqc_switch_resource_alloc_element_resp *)a;
- two = (struct i40e_aqc_switch_resource_alloc_element_resp *)b;
+ one = (const struct i40e_aqc_switch_resource_alloc_element_resp *)a;
+ two = (const struct i40e_aqc_switch_resource_alloc_element_resp *)b;
return ((int)one->resource_type - (int)two->resource_type);
}
@@ -4994,7 +5070,7 @@ ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS)
u8 num_entries;
struct i40e_aqc_switch_resource_alloc_element_resp resp[IXL_SW_RES_SIZE];
- buf = sbuf_new_for_sysctl(NULL, NULL, 128, req);
+ buf = sbuf_new_for_sysctl(NULL, NULL, 0, req);
if (!buf) {
device_printf(dev, "Could not allocate sbuf for output.\n");
return (ENOMEM);
@@ -5038,7 +5114,13 @@ ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS)
error = sbuf_finish(buf);
if (error) {
device_printf(dev, "Error finishing sbuf: %d\n", error);
+ sbuf_delete(buf);
+ return error;
}
+
+ error = sysctl_handle_string(oidp, sbuf_data(buf), sbuf_len(buf), req);
+ if (error)
+ device_printf(dev, "sysctl error: %d\n", error);
sbuf_delete(buf);
return error;
}
@@ -5096,7 +5178,7 @@ ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS)
struct i40e_aqc_get_switch_config_resp *sw_config;
sw_config = (struct i40e_aqc_get_switch_config_resp *)aq_buf;
- buf = sbuf_new_for_sysctl(NULL, NULL, 128, req);
+ buf = sbuf_new_for_sysctl(NULL, NULL, 0, req);
if (!buf) {
device_printf(dev, "Could not allocate sbuf for sysctl output.\n");
return (ENOMEM);
@@ -5115,7 +5197,6 @@ ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS)
nmbuf = sbuf_new_auto();
if (!nmbuf) {
device_printf(dev, "Could not allocate sbuf for name output.\n");
- sbuf_delete(buf);
return (ENOMEM);
}
@@ -5150,7 +5231,13 @@ ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS)
error = sbuf_finish(buf);
if (error) {
device_printf(dev, "Error finishing sbuf: %d\n", error);
+ sbuf_delete(buf);
+ return error;
}
+
+ error = sysctl_handle_string(oidp, sbuf_data(buf), sbuf_len(buf), req);
+ if (error)
+ device_printf(dev, "sysctl error: %d\n", error);
sbuf_delete(buf);
return (error);
@@ -6456,7 +6543,7 @@ ixl_adminq_err_to_errno(enum i40e_admin_queue_err err)
}
static int
-ixl_init_iov(device_t dev, uint16_t num_vfs, const nvlist_t *params)
+ixl_iov_init(device_t dev, uint16_t num_vfs, const nvlist_t *params)
{
struct ixl_pf *pf;
struct i40e_hw *hw;
@@ -6504,7 +6591,7 @@ fail:
}
static void
-ixl_uninit_iov(device_t dev)
+ixl_iov_uninit(device_t dev)
{
struct ixl_pf *pf;
struct i40e_hw *hw;
diff --git a/sys/dev/ixl/if_ixlv.c b/sys/dev/ixl/if_ixlv.c
index fe4c63f..51d4e95 100644
--- a/sys/dev/ixl/if_ixlv.c
+++ b/sys/dev/ixl/if_ixlv.c
@@ -48,7 +48,7 @@
/*********************************************************************
* Driver version
*********************************************************************/
-char ixlv_driver_version[] = "1.2.4";
+char ixlv_driver_version[] = "1.2.6";
/*********************************************************************
* PCI Device ID Table
@@ -1832,7 +1832,7 @@ ixlv_msix_adminq(void *arg)
mask = rd32(hw, I40E_VFINT_ICR0_ENA1);
reg = rd32(hw, I40E_VFINT_DYN_CTL01);
- reg |= I40E_PFINT_DYN_CTL0_CLEARPBA_MASK;
+ reg |= I40E_VFINT_DYN_CTL01_CLEARPBA_MASK;
wr32(hw, I40E_VFINT_DYN_CTL01, reg);
/* schedule task */
@@ -1879,7 +1879,7 @@ ixlv_enable_adminq_irq(struct i40e_hw *hw)
wr32(hw, I40E_VFINT_DYN_CTL01,
I40E_VFINT_DYN_CTL01_INTENA_MASK |
I40E_VFINT_DYN_CTL01_ITR_INDX_MASK);
- wr32(hw, I40E_VFINT_ICR0_ENA1, I40E_VFINT_ICR0_ENA_ADMINQ_MASK);
+ wr32(hw, I40E_VFINT_ICR0_ENA1, I40E_VFINT_ICR0_ENA1_ADMINQ_MASK);
/* flush */
rd32(hw, I40E_VFGEN_RSTAT);
return;
@@ -1891,7 +1891,7 @@ ixlv_enable_queue_irq(struct i40e_hw *hw, int id)
u32 reg;
reg = I40E_VFINT_DYN_CTLN1_INTENA_MASK |
- I40E_VFINT_DYN_CTLN_CLEARPBA_MASK;
+ I40E_VFINT_DYN_CTLN1_CLEARPBA_MASK;
wr32(hw, I40E_VFINT_DYN_CTLN1(id), reg);
}
@@ -2375,8 +2375,8 @@ ixlv_local_timer(void *arg)
/*
** Check status on the queues for a hang
*/
- mask = (I40E_VFINT_DYN_CTLN_INTENA_MASK |
- I40E_VFINT_DYN_CTLN_SWINT_TRIG_MASK);
+ mask = (I40E_VFINT_DYN_CTLN1_INTENA_MASK |
+ I40E_VFINT_DYN_CTLN1_SWINT_TRIG_MASK);
for (int i = 0; i < vsi->num_queues; i++,que++) {
/* Any queues with outstanding work get a sw irq */
@@ -2742,33 +2742,33 @@ ixlv_do_adminq_locked(struct ixlv_sc *sc)
/* check for Admin queue errors */
oldreg = reg = rd32(hw, hw->aq.arq.len);
- if (reg & I40E_VF_ARQLEN_ARQVFE_MASK) {
+ if (reg & I40E_VF_ARQLEN1_ARQVFE_MASK) {
device_printf(dev, "ARQ VF Error detected\n");
- reg &= ~I40E_VF_ARQLEN_ARQVFE_MASK;
+ reg &= ~I40E_VF_ARQLEN1_ARQVFE_MASK;
}
- if (reg & I40E_VF_ARQLEN_ARQOVFL_MASK) {
+ if (reg & I40E_VF_ARQLEN1_ARQOVFL_MASK) {
device_printf(dev, "ARQ Overflow Error detected\n");
- reg &= ~I40E_VF_ARQLEN_ARQOVFL_MASK;
+ reg &= ~I40E_VF_ARQLEN1_ARQOVFL_MASK;
}
- if (reg & I40E_VF_ARQLEN_ARQCRIT_MASK) {
+ if (reg & I40E_VF_ARQLEN1_ARQCRIT_MASK) {
device_printf(dev, "ARQ Critical Error detected\n");
- reg &= ~I40E_VF_ARQLEN_ARQCRIT_MASK;
+ reg &= ~I40E_VF_ARQLEN1_ARQCRIT_MASK;
}
if (oldreg != reg)
wr32(hw, hw->aq.arq.len, reg);
oldreg = reg = rd32(hw, hw->aq.asq.len);
- if (reg & I40E_VF_ATQLEN_ATQVFE_MASK) {
+ if (reg & I40E_VF_ATQLEN1_ATQVFE_MASK) {
device_printf(dev, "ASQ VF Error detected\n");
- reg &= ~I40E_VF_ATQLEN_ATQVFE_MASK;
+ reg &= ~I40E_VF_ATQLEN1_ATQVFE_MASK;
}
- if (reg & I40E_VF_ATQLEN_ATQOVFL_MASK) {
+ if (reg & I40E_VF_ATQLEN1_ATQOVFL_MASK) {
device_printf(dev, "ASQ Overflow Error detected\n");
- reg &= ~I40E_VF_ATQLEN_ATQOVFL_MASK;
+ reg &= ~I40E_VF_ATQLEN1_ATQOVFL_MASK;
}
- if (reg & I40E_VF_ATQLEN_ATQCRIT_MASK) {
+ if (reg & I40E_VF_ATQLEN1_ATQCRIT_MASK) {
device_printf(dev, "ASQ Critical Error detected\n");
- reg &= ~I40E_VF_ATQLEN_ATQCRIT_MASK;
+ reg &= ~I40E_VF_ATQLEN1_ATQCRIT_MASK;
}
if (oldreg != reg)
wr32(hw, hw->aq.asq.len, reg);
diff --git a/sys/dev/ixl/ixl.h b/sys/dev/ixl/ixl.h
index 1ddfbca3..3348e1a 100644
--- a/sys/dev/ixl/ixl.h
+++ b/sys/dev/ixl/ixl.h
@@ -93,6 +93,7 @@
#ifdef PCI_IOV
#include <sys/nv.h>
#include <sys/iov_schema.h>
+#include <dev/pci/pci_iov.h>
#endif
#include "i40e_type.h"
diff --git a/sys/dev/ixl/ixlv.h b/sys/dev/ixl/ixlv.h
index 840e17a..695b1ef 100644
--- a/sys/dev/ixl/ixlv.h
+++ b/sys/dev/ixl/ixlv.h
@@ -117,6 +117,7 @@ struct ixlv_sc {
struct ifmedia media;
struct callout timer;
int msix;
+ int pf_version;
int if_flags;
bool link_up;
diff --git a/sys/dev/ixl/ixlvc.c b/sys/dev/ixl/ixlvc.c
index 02192f3..9333b60 100644
--- a/sys/dev/ixl/ixlvc.c
+++ b/sys/dev/ixl/ixlvc.c
@@ -249,9 +249,12 @@ ixlv_verify_api_ver(struct ixlv_sc *sc)
}
pf_vvi = (struct i40e_virtchnl_version_info *)event.msg_buf;
- if ((pf_vvi->major != I40E_VIRTCHNL_VERSION_MAJOR) ||
- (pf_vvi->minor != I40E_VIRTCHNL_VERSION_MINOR))
+ if ((pf_vvi->major > I40E_VIRTCHNL_VERSION_MAJOR) ||
+ ((pf_vvi->major == I40E_VIRTCHNL_VERSION_MAJOR) &&
+ (pf_vvi->minor > I40E_VIRTCHNL_VERSION_MINOR)))
err = EIO;
+ else
+ sc->pf_version = pf_vvi->minor;
out_alloc:
free(event.msg_buf, M_DEVBUF);
@@ -269,7 +272,18 @@ out:
int
ixlv_send_vf_config_msg(struct ixlv_sc *sc)
{
- return ixlv_send_pf_msg(sc, I40E_VIRTCHNL_OP_GET_VF_RESOURCES,
+ u32 caps;
+
+ caps = I40E_VIRTCHNL_VF_OFFLOAD_L2 |
+ I40E_VIRTCHNL_VF_OFFLOAD_RSS_AQ |
+ I40E_VIRTCHNL_VF_OFFLOAD_RSS_REG |
+ I40E_VIRTCHNL_VF_OFFLOAD_VLAN;
+
+ if (sc->pf_version)
+ return ixlv_send_pf_msg(sc, I40E_VIRTCHNL_OP_GET_VF_RESOURCES,
+ (u8 *)&caps, sizeof(caps));
+ else
+ return ixlv_send_pf_msg(sc, I40E_VIRTCHNL_OP_GET_VF_RESOURCES,
NULL, 0);
}
diff --git a/sys/dev/led/led.c b/sys/dev/led/led.c
index fe0b66b..c519e22 100644
--- a/sys/dev/led/led.c
+++ b/sys/dev/led/led.c
@@ -293,7 +293,8 @@ led_create_state(led_t *func, void *priv, char const *name, int state)
mtx_lock(&led_mtx);
sc->dev->si_drv1 = sc;
LIST_INSERT_HEAD(&led_list, sc, list);
- sc->func(sc->private, state != 0);
+ if (state != -1)
+ sc->func(sc->private, state != 0);
mtx_unlock(&led_mtx);
return (sc->dev);
diff --git a/sys/dev/malo/if_malo.c b/sys/dev/malo/if_malo.c
index a3aa04e..7418379 100644
--- a/sys/dev/malo/if_malo.c
+++ b/sys/dev/malo/if_malo.c
@@ -133,7 +133,7 @@ static void malo_tx_cleanupq(struct malo_softc *, struct malo_txq *);
static void malo_start(struct ifnet *);
static void malo_watchdog(void *);
static int malo_ioctl(struct ifnet *, u_long, caddr_t);
-static void malo_updateslot(struct ifnet *);
+static void malo_updateslot(struct ieee80211com *);
static int malo_newstate(struct ieee80211vap *, enum ieee80211_state, int);
static void malo_scan_start(struct ieee80211com *);
static void malo_scan_end(struct ieee80211com *);
@@ -276,6 +276,8 @@ malo_attach(uint16_t devid, struct malo_softc *sc)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_softc = sc;
+ ic->ic_name = device_get_nameunit(sc->malo_dev);
/* XXX not right but it's not used anywhere important */
ic->ic_phytype = IEEE80211_T_OFDM;
ic->ic_opmode = IEEE80211_M_STA;
@@ -1764,15 +1766,14 @@ malo_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
* like slot time and preamble.
*/
static void
-malo_updateslot(struct ifnet *ifp)
+malo_updateslot(struct ieee80211com *ic)
{
- struct malo_softc *sc = ifp->if_softc;
- struct ieee80211com *ic = ifp->if_l2com;
+ struct malo_softc *sc = ic->ic_softc;
struct malo_hal *mh = sc->malo_mh;
int error;
/* NB: can be called early; suppress needless cmds */
- if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+ if ((ic->ic_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
return;
DPRINTF(sc, MALO_DEBUG_RESET,
diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c
index a2d604c..ddcc853 100644
--- a/sys/dev/mfi/mfi.c
+++ b/sys/dev/mfi/mfi.c
@@ -369,6 +369,7 @@ mfi_attach(struct mfi_softc *sc)
int error, commsz, framessz, sensesz;
int frames, unit, max_fw_sge, max_fw_cmds;
uint32_t tb_mem_size = 0;
+ struct cdev *dev_t;
if (sc == NULL)
return EINVAL;
@@ -763,7 +764,8 @@ mfi_attach(struct mfi_softc *sc)
sc->mfi_cdev = make_dev(&mfi_cdevsw, unit, UID_ROOT, GID_OPERATOR,
0640, "mfi%d", unit);
if (unit == 0)
- make_dev_alias(sc->mfi_cdev, "megaraid_sas_ioctl_node");
+ make_dev_alias_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, &dev_t,
+ sc->mfi_cdev, "%s", "megaraid_sas_ioctl_node");
if (sc->mfi_cdev != NULL)
sc->mfi_cdev->si_drv1 = sc;
SYSCTL_ADD_INT(device_get_sysctl_ctx(sc->mfi_dev),
diff --git a/sys/dev/mmc/mmcsd.c b/sys/dev/mmc/mmcsd.c
index 3be2158..4ca0c24 100644
--- a/sys/dev/mmc/mmcsd.c
+++ b/sys/dev/mmc/mmcsd.c
@@ -163,33 +163,10 @@ mmcsd_attach(device_t dev)
d->d_sectorsize = mmc_get_sector_size(dev);
d->d_maxsize = mmc_get_max_data(dev) * d->d_sectorsize;
d->d_mediasize = (off_t)mmc_get_media_size(dev) * d->d_sectorsize;
- d->d_stripeoffset = 0;
d->d_stripesize = mmc_get_erase_sector(dev) * d->d_sectorsize;
d->d_unit = device_get_unit(dev);
d->d_flags = DISKFLAG_CANDELETE;
- d->d_delmaxsize = mmc_get_erase_sector(dev) * d->d_sectorsize * 1; /* conservative */
- /*
- * The d_fw* values are fake. However, layout is aided by making the
- * number of fwsectors equal to the erase sectors from the drive since
- * we set the stripe size equal to that. We set fwheads such that there
- * are ~20 cylinder groups since all values are somewhat arbitrary here
- * and this gives good behavior with ffs without wasting too much
- * space. Sadly, geom_part wants to round partitions to these
- * values. While not bad, in and of itself, the values we present here
- * will almost certainly be different then the values that USB SD
- * adapters use and there's too much variation between brands to just
- * use those values here. Also SD to ATA adapters favor traditional
- * ata sizes, which are different again from the USB adapters (which
- * favor SCSI values). This rounding leads to a loss of up to 5% of the
- * usable space (usually much less, but that's why 20 was selected: to
- * limit this effect at a few percent). gpart needs a way to override
- * this behavior for situations like this, but doesn't provide
- * one. Perhaps this behavior should be tunable as well, but maybe that
- * belongs in the disk layer. These values will be much better than
- * the default ones.
- */
- d->d_fwsectors = mmc_get_erase_sector(dev);
- d->d_fwheads = mmc_get_media_size(dev) / (d->d_fwsectors * 20);
+ d->d_delmaxsize = mmc_get_erase_sector(dev) * d->d_sectorsize;
strlcpy(d->d_ident, mmc_get_card_sn_string(dev), sizeof(d->d_ident));
strlcpy(d->d_descr, mmc_get_card_id_string(dev), sizeof(d->d_descr));
diff --git a/sys/dev/mpr/mpi/mpi2.h b/sys/dev/mpr/mpi/mpi2.h
index 10f17ab..42fdec2 100644
--- a/sys/dev/mpr/mpi/mpi2.h
+++ b/sys/dev/mpr/mpi/mpi2.h
@@ -1,5 +1,6 @@
/*-
- * Copyright (c) 2013 LSI Corp.
+ * Copyright (c) 2012-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,13 +27,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
*
* $FreeBSD$
*/
/*
- * Copyright (c) 2000-2013 LSI Corporation.
+ * Copyright (c) 2000-2015 LSI Corporation.
+ * Copyright (c) 2013-2015 Avago Technologies
*
*
* Name: mpi2.h
diff --git a/sys/dev/mpr/mpi/mpi2_cnfg.h b/sys/dev/mpr/mpi/mpi2_cnfg.h
index d82750f..3b0eb63 100644
--- a/sys/dev/mpr/mpi/mpi2_cnfg.h
+++ b/sys/dev/mpr/mpi/mpi2_cnfg.h
@@ -1,5 +1,6 @@
/*-
- * Copyright (c) 2013 LSI Corp.
+ * Copyright (c) 2012-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,13 +27,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
*
* $FreeBSD$
*/
/*
- * Copyright (c) 2000-2013 LSI Corporation.
+ * Copyright (c) 2000-2015 LSI Corporation.
+ * Copyright (c) 2013-2015 Avago Technologies
*
*
* Name: mpi2_cnfg.h
diff --git a/sys/dev/mpr/mpi/mpi2_hbd.h b/sys/dev/mpr/mpi/mpi2_hbd.h
index d0cc09f..520407b 100644
--- a/sys/dev/mpr/mpi/mpi2_hbd.h
+++ b/sys/dev/mpr/mpi/mpi2_hbd.h
@@ -1,5 +1,6 @@
/*-
- * Copyright (c) 2013 LSI Corp.
+ * Copyright (c) 2012-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,13 +27,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
*
* $FreeBSD$
*/
/*
- * Copyright (c) 2009-2011 LSI Corporation.
+ * Copyright (c) 2009-2015 LSI Corporation.
+ * Copyright (c) 2013-2015 Avago Technologies
*
*
* Name: mpi2_hbd.h
diff --git a/sys/dev/mpr/mpi/mpi2_history.txt b/sys/dev/mpr/mpi/mpi2_history.txt
index 296b75b..9fca796 100644
--- a/sys/dev/mpr/mpi/mpi2_history.txt
+++ b/sys/dev/mpr/mpi/mpi2_history.txt
@@ -1,5 +1,6 @@
/*-
- * Copyright (c) 2013 LSI Corp.
+ * Copyright (c) 2012-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,7 +27,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
*
* $FreeBSD$
*/
@@ -35,7 +36,8 @@
Fusion-MPT MPI 2.0 / 2.5 Header File Change History
==============================
- Copyright (c) 2000-2013 LSI Corporation.
+ Copyright (c) 2000-2015 LSI Corporation.
+ Copyright (c) 2013-2015 Avago Technologies
---------------------------------------
Header Set Release Version: 02.00.33
diff --git a/sys/dev/mpr/mpi/mpi2_init.h b/sys/dev/mpr/mpi/mpi2_init.h
index 62b0cfe..5f475c0 100644
--- a/sys/dev/mpr/mpi/mpi2_init.h
+++ b/sys/dev/mpr/mpi/mpi2_init.h
@@ -1,5 +1,6 @@
/*-
- * Copyright (c) 2013 LSI Corp.
+ * Copyright (c) 2012-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,13 +27,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
*
* $FreeBSD$
*/
/*
- * Copyright (c) 2000-2013 LSI Corporation.
+ * Copyright (c) 2000-2015 LSI Corporation.
+ * Copyright (c) 2013-2015 Avago Technologies
*
*
* Name: mpi2_init.h
diff --git a/sys/dev/mpr/mpi/mpi2_ioc.h b/sys/dev/mpr/mpi/mpi2_ioc.h
index 38a46f5..54f39a5 100644
--- a/sys/dev/mpr/mpi/mpi2_ioc.h
+++ b/sys/dev/mpr/mpi/mpi2_ioc.h
@@ -1,5 +1,6 @@
/*-
- * Copyright (c) 2013 LSI Corp.
+ * Copyright (c) 2012-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,13 +27,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
*
* $FreeBSD$
*/
/*
- * Copyright (c) 2000-2013 LSI Corporation.
+ * Copyright (c) 2000-2015 LSI Corporation.
+ * Copyright (c) 2013-2015 Avago Technologies
*
*
* Name: mpi2_ioc.h
diff --git a/sys/dev/mpr/mpi/mpi2_ra.h b/sys/dev/mpr/mpi/mpi2_ra.h
index 76db06b..02304aa 100644
--- a/sys/dev/mpr/mpi/mpi2_ra.h
+++ b/sys/dev/mpr/mpi/mpi2_ra.h
@@ -1,5 +1,6 @@
/*-
- * Copyright (c) 2013 LSI Corp.
+ * Copyright (c) 2012-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,13 +27,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
*
* $FreeBSD$
*/
/*
- * Copyright (c) 2009 LSI Corporation.
+ * Copyright (c) 2012-2015 LSI Corporation.
+ * Copyright (c) 2013-2015 Avago Technologies
*
*
* Name: mpi2_ra.h
diff --git a/sys/dev/mpr/mpi/mpi2_raid.h b/sys/dev/mpr/mpi/mpi2_raid.h
index c6bb598..52ebf07 100644
--- a/sys/dev/mpr/mpi/mpi2_raid.h
+++ b/sys/dev/mpr/mpi/mpi2_raid.h
@@ -1,5 +1,6 @@
/*-
- * Copyright (c) 2013 LSI Corp.
+ * Copyright (c) 2012-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,13 +27,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
*
* $FreeBSD$
*/
/*
- * Copyright (c) 2000-2013 LSI Corporation.
+ * Copyright (c) 2000-2015 LSI Corporation.
+ * Copyright (c) 2013-2015 Avago Technologies
*
*
* Name: mpi2_raid.h
diff --git a/sys/dev/mpr/mpi/mpi2_sas.h b/sys/dev/mpr/mpi/mpi2_sas.h
index 2a107f1..7cae2c3 100644
--- a/sys/dev/mpr/mpi/mpi2_sas.h
+++ b/sys/dev/mpr/mpi/mpi2_sas.h
@@ -1,5 +1,6 @@
/*-
- * Copyright (c) 2013 LSI Corp.
+ * Copyright (c) 2012-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,13 +27,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
*
* $FreeBSD$
*/
/*
- * Copyright (c) 2000-2013 LSI Corporation.
+ * Copyright (c) 2000-2015 LSI Corporation.
+ * Copyright (c) 2013-2015 Avago Technologies
*
*
* Name: mpi2_sas.h
diff --git a/sys/dev/mpr/mpi/mpi2_targ.h b/sys/dev/mpr/mpi/mpi2_targ.h
index 506e64f..85b5ac5 100644
--- a/sys/dev/mpr/mpi/mpi2_targ.h
+++ b/sys/dev/mpr/mpi/mpi2_targ.h
@@ -1,5 +1,6 @@
/*-
- * Copyright (c) 2013 LSI Corp.
+ * Copyright (c) 2012-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,13 +27,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
*
* $FreeBSD$
*/
/*
- * Copyright (c) 2000-2012 LSI Corporation.
+ * Copyright (c) 2000-2015 LSI Corporation.
+ * Copyright (c) 2013-2015 Avago Technologies
*
*
* Name: mpi2_targ.h
diff --git a/sys/dev/mpr/mpi/mpi2_tool.h b/sys/dev/mpr/mpi/mpi2_tool.h
index 94542cc..59917c0 100644
--- a/sys/dev/mpr/mpi/mpi2_tool.h
+++ b/sys/dev/mpr/mpi/mpi2_tool.h
@@ -1,5 +1,6 @@
/*-
- * Copyright (c) 2013 LSI Corp.
+ * Copyright (c) 2012-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,13 +27,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
*
* $FreeBSD$
*/
/*
- * Copyright (c) 2000-2013 LSI Corporation.
+ * Copyright (c) 2000-2015 LSI Corporation.
+ * Copyright (c) 2013-2015 Avago Technologies
*
*
* Name: mpi2_tool.h
diff --git a/sys/dev/mpr/mpi/mpi2_type.h b/sys/dev/mpr/mpi/mpi2_type.h
index da3aefb..b063683 100644
--- a/sys/dev/mpr/mpi/mpi2_type.h
+++ b/sys/dev/mpr/mpi/mpi2_type.h
@@ -1,5 +1,6 @@
/*-
- * Copyright (c) 2013 LSI Corp.
+ * Copyright (c) 2012-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,13 +27,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
*
* $FreeBSD$
*/
/*
- * Copyright (c) 2000-2007 LSI Corporation.
+ * Copyright (c) 2000-2015 LSI Corporation.
+ * Copyright (c) 2013-2015 Avago Technologies
*
*
* Name: mpi2_type.h
diff --git a/sys/dev/mpr/mpr.c b/sys/dev/mpr/mpr.c
index d3fb9a0..07e73c5 100644
--- a/sys/dev/mpr/mpr.c
+++ b/sys/dev/mpr/mpr.c
@@ -1,6 +1,7 @@
/*-
* Copyright (c) 2009 Yahoo! Inc.
- * Copyright (c) 2012-2014 LSI Corp.
+ * Copyright (c) 2011-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -24,12 +25,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
+ *
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* Communications core for LSI MPT2 */
+/* Communications core for Avago Technologies (LSI) MPT3 */
/* TODO Move headers to mprvar */
#include <sys/types.h>
@@ -72,7 +75,6 @@ __FBSDID("$FreeBSD$");
#include <dev/mpr/mpr_ioctl.h>
#include <dev/mpr/mprvar.h>
#include <dev/mpr/mpr_table.h>
-#include <dev/mpr/mpr_sas.h>
static int mpr_diag_reset(struct mpr_softc *sc, int sleep_flag);
static int mpr_init_queues(struct mpr_softc *sc);
@@ -352,11 +354,9 @@ mpr_transition_operational(struct mpr_softc *sc)
static int
mpr_iocfacts_allocate(struct mpr_softc *sc, uint8_t attaching)
{
- int error, i;
+ int error;
Mpi2IOCFactsReply_t saved_facts;
uint8_t saved_mode, reallocating;
- struct mprsas_lun *lun, *lun_tmp;
- struct mprsas_target *targ;
mpr_dprint(sc, MPR_TRACE, "%s\n", __func__);
@@ -513,27 +513,7 @@ mpr_iocfacts_allocate(struct mpr_softc *sc, uint8_t attaching)
*/
if (reallocating) {
mpr_iocfacts_free(sc);
-
- /*
- * The number of targets is based on IOC Facts, so free all of
- * the allocated LUNs for each target and then the target buffer
- * itself.
- */
- for (i=0; i< saved_facts.MaxTargets; i++) {
- targ = &sc->sassc->targets[i];
- SLIST_FOREACH_SAFE(lun, &targ->luns, lun_link,
- lun_tmp) {
- free(lun, M_MPR);
- }
- }
- free(sc->sassc->targets, M_MPR);
-
- sc->sassc->targets = malloc(sizeof(struct mprsas_target) *
- sc->facts->MaxTargets, M_MPR, M_WAITOK|M_ZERO);
- if (!sc->sassc->targets) {
- panic("%s failed to alloc targets with error %d\n",
- __func__, ENOMEM);
- }
+ mprsas_realloc_targets(sc, saved_facts.MaxTargets);
}
/*
@@ -775,7 +755,7 @@ mpr_reinit(struct mpr_softc *sc)
/* the end of discovery will release the simq, so we're done. */
mpr_dprint(sc, MPR_INFO, "%s finished sc %p post %u free %u\n",
__func__, sc, sc->replypostindex, sc->replyfreeindex);
- mprsas_release_simq_reinit(sassc);
+ mprsas_release_simq_reinit(sassc);
return 0;
}
@@ -816,7 +796,8 @@ mpr_wait_db_ack(struct mpr_softc *sc, int timeout, int sleep_flag)
* 0.5 milisecond
*/
if (mtx_owned(&sc->mpr_mtx) && sleep_flag == CAN_SLEEP)
- msleep(&sc->msleep_fake_chan, &sc->mpr_mtx, 0, "mprdba", hz/1000);
+ msleep(&sc->msleep_fake_chan, &sc->mpr_mtx, 0, "mprdba",
+ hz/1000);
else if (sleep_flag == CAN_SLEEP)
pause("mprdba", hz/1000);
else
@@ -982,7 +963,7 @@ mpr_enqueue_request(struct mpr_softc *sc, struct mpr_command *cm)
reply_descriptor rd;
MPR_FUNCTRACE(sc);
- mpr_dprint(sc, MPR_TRACE, "%s SMID %u cm %p ccb %p\n", __func__,
+ mpr_dprint(sc, MPR_TRACE, "SMID %u cm %p ccb %p\n",
cm->cm_desc.Default.SMID, cm, cm->cm_ccb);
if (sc->mpr_flags & MPR_FLAGS_ATTACH_DONE && !(sc->mpr_flags &
@@ -1372,6 +1353,8 @@ mpr_get_tunables(struct mpr_softc *sc)
sc->disable_msix = 0;
sc->disable_msi = 0;
sc->max_chains = MPR_CHAIN_FRAMES;
+ sc->enable_ssu = MPR_SSU_ENABLE_SSD_DISABLE_HDD;
+ sc->spinup_wait_time = DEFAULT_SPINUP_WAIT;
/*
* Grab the global variables.
@@ -1380,6 +1363,8 @@ mpr_get_tunables(struct mpr_softc *sc)
TUNABLE_INT_FETCH("hw.mpr.disable_msix", &sc->disable_msix);
TUNABLE_INT_FETCH("hw.mpr.disable_msi", &sc->disable_msi);
TUNABLE_INT_FETCH("hw.mpr.max_chains", &sc->max_chains);
+ TUNABLE_INT_FETCH("hw.mpr.enable_ssu", &sc->enable_ssu);
+ TUNABLE_INT_FETCH("hw.mpr.spinup_wait_time", &sc->spinup_wait_time);
/* Grab the unit-instance variables */
snprintf(tmpstr, sizeof(tmpstr), "dev.mpr.%d.debug_level",
@@ -1402,6 +1387,14 @@ mpr_get_tunables(struct mpr_softc *sc)
snprintf(tmpstr, sizeof(tmpstr), "dev.mpr.%d.exclude_ids",
device_get_unit(sc->mpr_dev));
TUNABLE_STR_FETCH(tmpstr, sc->exclude_ids, sizeof(sc->exclude_ids));
+
+ snprintf(tmpstr, sizeof(tmpstr), "dev.mpr.%d.enable_ssu",
+ device_get_unit(sc->mpr_dev));
+ TUNABLE_INT_FETCH(tmpstr, &sc->enable_ssu);
+
+ snprintf(tmpstr, sizeof(tmpstr), "dev.mpr.%d.spinup_wait_time",
+ device_get_unit(sc->mpr_dev));
+ TUNABLE_INT_FETCH(tmpstr, &sc->spinup_wait_time);
}
static void
@@ -1474,11 +1467,20 @@ mpr_setup_sysctl(struct mpr_softc *sc)
OID_AUTO, "max_chains", CTLFLAG_RD,
&sc->max_chains, 0,"maximum chain frames that will be allocated");
+ SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree),
+ OID_AUTO, "enable_ssu", CTLFLAG_RW, &sc->enable_ssu, 0,
+ "enable SSU to SATA SSD/HDD at shutdown");
+
#if __FreeBSD_version >= 900030
SYSCTL_ADD_UQUAD(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree),
OID_AUTO, "chain_alloc_fail", CTLFLAG_RD,
&sc->chain_alloc_fail, "chain allocation failures");
#endif //FreeBSD_version >= 900030
+
+ SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree),
+ OID_AUTO, "spinup_wait_time", CTLFLAG_RD,
+ &sc->spinup_wait_time, DEFAULT_SPINUP_WAIT, "seconds to wait for "
+ "spinup after SATA ID error");
}
int
@@ -2096,7 +2098,7 @@ mpr_update_events(struct mpr_softc *sc, struct mpr_event_handle *handle,
(reply->IOCStatus & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS)
error = ENXIO;
- if(reply)
+ if (reply)
mpr_print_event(sc, reply);
mpr_dprint(sc, MPR_TRACE, "%s finished error %d\n", __func__, error);
@@ -2163,8 +2165,8 @@ mpr_deregister_events(struct mpr_softc *sc, struct mpr_event_handle *handle)
* Add a chain element as the next SGE for the specified command.
* Reset cm_sge and cm_sgesize to indicate all the available space. Chains are
* only required for IEEE commands. Therefore there is no code for commands
- * that have the MPR_CM_FLAGS_SGE_SIMPLE flag set (and those commands shouldn't
- * be requesting chains).
+ * that have the MPR_CM_FLAGS_SGE_SIMPLE flag set (and those commands
+ * shouldn't be requesting chains).
*/
static int
mpr_add_chain(struct mpr_command *cm, int segsleft)
@@ -2246,9 +2248,9 @@ mpr_add_chain(struct mpr_command *cm, int segsleft)
/*
* Add one scatter-gather element to the scatter-gather list for a command.
- * Maintain cm_sglsize and cm_sge as the remaining size and pointer to the next
- * SGE to fill in, respectively. In Gen3, the MPI SGL does not have a chain,
- * so don't consider any chain additions.
+ * Maintain cm_sglsize and cm_sge as the remaining size and pointer to the
+ * next SGE to fill in, respectively. In Gen3, the MPI SGL does not have a
+ * chain, so don't consider any chain additions.
*/
int
mpr_push_sge(struct mpr_command *cm, MPI2_SGE_SIMPLE64 *sge, size_t len,
@@ -2660,7 +2662,7 @@ mpr_request_polled(struct mpr_softc *sc, struct mpr_command *cm)
}
}
- if(error) {
+ if (error) {
mpr_dprint(sc, MPR_FAULT, "Calling Reinit from %s\n", __func__);
rc = mpr_reinit(sc);
mpr_dprint(sc, MPR_FAULT, "Reinit %s\n", (rc == 0) ?
@@ -2717,9 +2719,12 @@ mpr_read_config_page(struct mpr_softc *sc, struct mpr_config_params *params)
cm->cm_data = params->buffer;
cm->cm_length = params->length;
- cm->cm_sge = &req->PageBufferSGE;
- cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION);
- cm->cm_flags = MPR_CM_FLAGS_SGE_SIMPLE | MPR_CM_FLAGS_DATAIN;
+ if (cm->cm_data != NULL) {
+ cm->cm_sge = &req->PageBufferSGE;
+ cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION);
+ cm->cm_flags = MPR_CM_FLAGS_SGE_SIMPLE | MPR_CM_FLAGS_DATAIN;
+ } else
+ cm->cm_sge = NULL;
cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
cm->cm_complete_data = params;
@@ -2776,9 +2781,12 @@ mpr_config_complete(struct mpr_softc *sc, struct mpr_command *cm)
goto done;
}
params->status = reply->IOCStatus;
- if (params->hdr.Ext.ExtPageType != 0) {
+ if (params->hdr.Struct.PageType == MPI2_CONFIG_PAGETYPE_EXTENDED) {
params->hdr.Ext.ExtPageType = reply->ExtPageType;
params->hdr.Ext.ExtPageLength = reply->ExtPageLength;
+ params->hdr.Ext.PageType = reply->Header.PageType;
+ params->hdr.Ext.PageNumber = reply->Header.PageNumber;
+ params->hdr.Ext.PageVersion = reply->Header.PageVersion;
} else {
params->hdr.Struct.PageType = reply->Header.PageType;
params->hdr.Struct.PageNumber = reply->Header.PageNumber;
diff --git a/sys/dev/mpr/mpr_config.c b/sys/dev/mpr/mpr_config.c
index 1254516..c0ea3d5 100644
--- a/sys/dev/mpr/mpr_config.c
+++ b/sys/dev/mpr/mpr_config.c
@@ -1,5 +1,6 @@
/*-
- * Copyright (c) 2011-2014 LSI Corp.
+ * Copyright (c) 2011-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
*/
#include <sys/cdefs.h>
diff --git a/sys/dev/mpr/mpr_ioctl.h b/sys/dev/mpr/mpr_ioctl.h
index 5ec482f..aa1a4cb 100644
--- a/sys/dev/mpr/mpr_ioctl.h
+++ b/sys/dev/mpr/mpr_ioctl.h
@@ -27,12 +27,13 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * LSI MPT-Fusion Host Adapter FreeBSD userland interface
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD userland interface
*
* $FreeBSD$
*/
/*-
- * Copyright (c) 2011-2014 LSI Corp.
+ * Copyright (c) 2011-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -56,7 +57,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
*
* $FreeBSD$
*/
diff --git a/sys/dev/mpr/mpr_mapping.c b/sys/dev/mpr/mpr_mapping.c
index 7f0fc00..110e6a3 100644
--- a/sys/dev/mpr/mpr_mapping.c
+++ b/sys/dev/mpr/mpr_mapping.c
@@ -1,5 +1,6 @@
/*-
- * Copyright (c) 2011-2014 LSI Corp.
+ * Copyright (c) 2011-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
*/
#include <sys/cdefs.h>
@@ -326,11 +327,13 @@ _mapping_get_high_missing_mt_idx(struct mpr_softc *sc)
{
u32 map_idx, high_idx = MPR_ENCTABLE_BAD_IDX;
u8 high_missing_count = 0;
- u32 start_idx, end_idx, start_idx_ir = 0, end_idx_ir;
+ u32 start_idx, end_idx, start_idx_ir, end_idx_ir;
struct dev_mapping_table *mt_entry;
u16 ioc_pg8_flags = le16toh(sc->ioc_pg8.Flags);
start_idx = 0;
+ start_idx_ir = 0;
+ end_idx_ir = 0;
end_idx = sc->max_devices;
if (ioc_pg8_flags & MPI2_IOCPAGE8_FLAGS_RESERVED_TARGETID_0)
start_idx = 1;
@@ -887,14 +890,14 @@ _mapping_get_dev_info(struct mpr_softc *sc,
u16 ioc_pg8_flags = le16toh(sc->ioc_pg8.Flags);
Mpi2ConfigReply_t mpi_reply;
Mpi2SasDevicePage0_t sas_device_pg0;
- u8 entry, enc_idx, phy_idx;
+ u8 entry, enc_idx, phy_idx, sata_end_device;
u32 map_idx, index, device_info;
struct _map_phy_change *phy_change, *tmp_phy_change;
uint64_t sas_address;
struct enc_mapping_table *et_entry;
struct dev_mapping_table *mt_entry;
u8 add_code = MPI2_EVENT_SAS_TOPO_RC_TARG_ADDED;
- int rc;
+ int rc = 1;
for (entry = 0; entry < topo_change->num_entries; entry++) {
phy_change = &topo_change->phy_details[entry];
@@ -908,41 +911,36 @@ _mapping_get_dev_info(struct mpr_softc *sc,
continue;
}
+ /*
+ * Always get SATA Identify information because this is used
+ * to determine if Start/Stop Unit should be sent to the drive
+ * when the system is shutdown.
+ */
device_info = le32toh(sas_device_pg0.DeviceInfo);
- if ((ioc_pg8_flags & MPI2_IOCPAGE8_FLAGS_MASK_MAPPING_MODE) ==
- MPI2_IOCPAGE8_FLAGS_DEVICE_PERSISTENCE_MAPPING) {
- if ((device_info & MPI2_SAS_DEVICE_INFO_END_DEVICE) &&
- (device_info & MPI2_SAS_DEVICE_INFO_SATA_DEVICE)) {
- rc = mprsas_get_sas_address_for_sata_disk(sc,
- &sas_address, phy_change->dev_handle,
- device_info);
- if (rc) {
- printf("%s: failed to compute the "
- "hashed SAS Address for SATA "
- "device with handle 0x%04x\n",
- __func__, phy_change->dev_handle);
- sas_address =
- sas_device_pg0.SASAddress.High;
- sas_address = (sas_address << 32) |
- sas_device_pg0.SASAddress.Low;
- }
+ sas_address = sas_device_pg0.SASAddress.High;
+ sas_address = (sas_address << 32) |
+ sas_device_pg0.SASAddress.Low;
+ sata_end_device = 0;
+ if ((device_info & MPI2_SAS_DEVICE_INFO_END_DEVICE) &&
+ (device_info & MPI2_SAS_DEVICE_INFO_SATA_DEVICE)) {
+ sata_end_device = 1;
+ rc = mprsas_get_sas_address_for_sata_disk(sc,
+ &sas_address, phy_change->dev_handle, device_info,
+ &phy_change->is_SATA_SSD);
+ if (rc) {
+ mpr_dprint(sc, MPR_ERROR, "%s: failed to get "
+ "disk type (SSD or HDD) and SAS Address "
+ "for SATA device with handle 0x%04x\n",
+ __func__, phy_change->dev_handle);
+ } else {
mpr_dprint(sc, MPR_INFO, "SAS Address for SATA "
"device = %jx\n", sas_address);
- } else {
- sas_address =
- sas_device_pg0.SASAddress.High;
- sas_address = (sas_address << 32) |
- sas_device_pg0.SASAddress.Low;
}
- } else {
- sas_address = sas_device_pg0.SASAddress.High;
- sas_address = (sas_address << 32) |
- sas_device_pg0.SASAddress.Low;
}
+
phy_change->physical_id = sas_address;
phy_change->slot = le16toh(sas_device_pg0.Slot);
- phy_change->device_info =
- le32toh(sas_device_pg0.DeviceInfo);
+ phy_change->device_info = le32toh(sas_device_pg0.DeviceInfo);
if ((ioc_pg8_flags & MPI2_IOCPAGE8_FLAGS_MASK_MAPPING_MODE) ==
MPI2_IOCPAGE8_FLAGS_ENCLOSURE_SLOT_MAPPING) {
@@ -950,10 +948,10 @@ _mapping_get_dev_info(struct mpr_softc *sc,
topo_change->enc_handle);
if (enc_idx == MPR_ENCTABLE_BAD_IDX) {
phy_change->is_processed = 1;
- printf("%s: failed to add the device with "
- "handle 0x%04x because the enclosure is "
- "not in the mapping table\n", __func__,
- phy_change->dev_handle);
+ mpr_dprint(sc, MPR_MAPPING, "%s: failed to add "
+ "the device with handle 0x%04x because the "
+ "enclosure is not in the mapping table\n",
+ __func__, phy_change->dev_handle);
continue;
}
if (!((phy_change->device_info &
diff --git a/sys/dev/mpr/mpr_mapping.h b/sys/dev/mpr/mpr_mapping.h
index 3250c42..c00a3b7 100644
--- a/sys/dev/mpr/mpr_mapping.h
+++ b/sys/dev/mpr/mpr_mapping.h
@@ -1,5 +1,6 @@
/*-
- * Copyright (c) 2011-2014 LSI Corp.
+ * Copyright (c) 2011-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
*
* $FreeBSD$
*/
@@ -38,6 +39,7 @@
* @dev_handle: device handle for the device pointed by this entry
* @slot: slot ID
* @is_processed: Flag to indicate whether this entry is processed or not
+ * @is_SATA_SSD: 1 if this is a SATA device AND an SSD, 0 otherwise
*/
struct _map_phy_change {
uint64_t physical_id;
@@ -46,6 +48,8 @@ struct _map_phy_change {
uint16_t slot;
uint8_t reason;
uint8_t is_processed;
+ uint8_t is_SATA_SSD;
+ uint8_t reserved;
};
/**
@@ -66,6 +70,6 @@ struct _map_topology_change {
extern int
mprsas_get_sas_address_for_sata_disk(struct mpr_softc *ioc,
- u64 *sas_address, u16 handle, u32 device_info);
+ u64 *sas_address, u16 handle, u32 device_info, u8 *is_SATA_SSD);
#endif
diff --git a/sys/dev/mpr/mpr_pci.c b/sys/dev/mpr/mpr_pci.c
index e19f33a..7430eac 100644
--- a/sys/dev/mpr/mpr_pci.c
+++ b/sys/dev/mpr/mpr_pci.c
@@ -27,7 +27,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* PCI/PCI-X/PCIe bus interface for the LSI MPT2 controllers */
+/* PCI/PCI-X/PCIe bus interface for the Avago Tech (LSI) MPT3 controllers */
/* TODO Move headers to mprvar */
#include <sys/types.h>
@@ -99,17 +99,17 @@ struct mpr_ident {
const char *desc;
} mpr_identifiers[] = {
{ MPI2_MFGPAGE_VENDORID_LSI, MPI25_MFGPAGE_DEVID_SAS3004,
- 0xffff, 0xffff, 0, "LSI SAS3004" },
+ 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS3004" },
{ MPI2_MFGPAGE_VENDORID_LSI, MPI25_MFGPAGE_DEVID_SAS3008,
- 0xffff, 0xffff, 0, "LSI SAS3008" },
+ 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS3008" },
{ MPI2_MFGPAGE_VENDORID_LSI, MPI25_MFGPAGE_DEVID_SAS3108_1,
- 0xffff, 0xffff, 0, "LSI SAS3108_1" },
+ 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS3108_1" },
{ MPI2_MFGPAGE_VENDORID_LSI, MPI25_MFGPAGE_DEVID_SAS3108_2,
- 0xffff, 0xffff, 0, "LSI SAS3108_2" },
+ 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS3108_2" },
{ MPI2_MFGPAGE_VENDORID_LSI, MPI25_MFGPAGE_DEVID_SAS3108_5,
- 0xffff, 0xffff, 0, "LSI SAS3108_5" },
+ 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS3108_5" },
{ MPI2_MFGPAGE_VENDORID_LSI, MPI25_MFGPAGE_DEVID_SAS3108_6,
- 0xffff, 0xffff, 0, "LSI SAS3108_6" },
+ 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS3108_6" },
{ 0, 0, 0, 0, 0, NULL }
};
diff --git a/sys/dev/mpr/mpr_sas.c b/sys/dev/mpr/mpr_sas.c
index 32c3a46..eac3360 100644
--- a/sys/dev/mpr/mpr_sas.c
+++ b/sys/dev/mpr/mpr_sas.c
@@ -1,6 +1,7 @@
/*-
* Copyright (c) 2009 Yahoo! Inc.
- * Copyright (c) 2011-2014 LSI Corp.
+ * Copyright (c) 2011-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,12 +24,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
+ *
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
+ *
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* Communications core for LSI MPT2 */
+/* Communications core for Avago Technologies (LSI) MPT3 */
/* TODO Move headers to mprvar */
#include <sys/types.h>
@@ -122,14 +126,10 @@ static void mprsas_scsiio_complete(struct mpr_softc *, struct mpr_command *);
static void mprsas_action_resetdev(struct mprsas_softc *, union ccb *);
static void mprsas_resetdev_complete(struct mpr_softc *,
struct mpr_command *);
-static int mprsas_send_abort(struct mpr_softc *sc, struct mpr_command *tm,
+static int mprsas_send_abort(struct mpr_softc *sc, struct mpr_command *tm,
struct mpr_command *cm);
-static int mprsas_send_reset(struct mpr_softc *sc, struct mpr_command *tm,
- uint8_t type);
static void mprsas_async(void *callback_arg, uint32_t code,
struct cam_path *path, void *arg);
-static void mprsas_prepare_ssu(struct mpr_softc *sc, struct cam_path *path,
- struct ccb_getdev *cgd);
#if (__FreeBSD_version < 901503) || \
((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000006))
static void mprsas_check_eedp(struct mpr_softc *sc, struct cam_path *path,
@@ -142,13 +142,12 @@ static void mprsas_portenable_complete(struct mpr_softc *sc,
struct mpr_command *cm);
#if __FreeBSD_version >= 900026
-static void
-mprsas_smpio_complete(struct mpr_softc *sc, struct mpr_command *cm);
+static void mprsas_smpio_complete(struct mpr_softc *sc,
+ struct mpr_command *cm);
static void mprsas_send_smpcmd(struct mprsas_softc *sassc,
- union ccb *ccb, uint64_t sasaddr);
-static void
-mprsas_action_smpio(struct mprsas_softc *sassc, union ccb *ccb);
-#endif
+ union ccb *ccb, uint64_t sasaddr);
+static void mprsas_action_smpio(struct mprsas_softc *sassc, union ccb *ccb);
+#endif //FreeBSD_version >= 900026
struct mprsas_target *
mprsas_find_target_by_handle(struct mprsas_softc *sassc, int start,
@@ -230,7 +229,7 @@ mprsas_startup_decrement(struct mprsas_softc *sassc)
}
}
-/* LSI's firmware requires us to stop sending commands when we're doing task
+/* The firmware requires us to stop sending commands when we're doing task
* management, so refcount the TMs and keep the simq frozen when any are in
* use.
*/
@@ -241,35 +240,31 @@ mprsas_alloc_tm(struct mpr_softc *sc)
MPR_FUNCTRACE(sc);
tm = mpr_alloc_high_priority_command(sc);
- if (tm != NULL) {
- if (sc->sassc->tm_count++ == 0) {
- mpr_dprint(sc, MPR_RECOVERY,
- "%s freezing simq\n", __func__);
- xpt_freeze_simq(sc->sassc->sim, 1);
- }
- mpr_dprint(sc, MPR_RECOVERY, "%s tm_count %u\n", __func__,
- sc->sassc->tm_count);
- }
return tm;
}
void
mprsas_free_tm(struct mpr_softc *sc, struct mpr_command *tm)
{
- mpr_dprint(sc, MPR_TRACE, "%s", __func__);
+ MPR_FUNCTRACE(sc);
if (tm == NULL)
return;
- /* if there are no TMs in use, we can release the simq. We use our
- * own refcount so that it's easier for a diag reset to cleanup and
- * release the simq.
+ /*
+ * For TM's the devq is frozen for the device. Unfreeze it here and
+ * free the resources used for freezing the devq. Must clear the
+ * INRESET flag as well or scsi I/O will not work.
*/
- if (--sc->sassc->tm_count == 0) {
- mpr_dprint(sc, MPR_RECOVERY, "%s releasing simq\n", __func__);
- xpt_release_simq(sc->sassc->sim, 1);
+ if (tm->cm_targ != NULL) {
+ tm->cm_targ->flags &= ~MPRSAS_TARGET_INRESET;
+ }
+ if (tm->cm_ccb) {
+ mpr_dprint(sc, MPR_INFO, "Unfreezing devq for target ID %d\n",
+ tm->cm_targ->tid);
+ xpt_release_devq(tm->cm_ccb->ccb_h.path, 1, TRUE);
+ xpt_free_path(tm->cm_ccb->ccb_h.path);
+ xpt_free_ccb(tm->cm_ccb);
}
- mpr_dprint(sc, MPR_RECOVERY, "%s tm_count %u\n", __func__,
- sc->sassc->tm_count);
mpr_free_high_priority_command(sc, tm);
}
@@ -298,8 +293,8 @@ mprsas_rescan_target(struct mpr_softc *sc, struct mprsas_target *targ)
return;
}
- if (xpt_create_path(&ccb->ccb_h.path, NULL, pathid,
- targetid, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
+ if (xpt_create_path(&ccb->ccb_h.path, NULL, pathid, targetid,
+ CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
mpr_dprint(sc, MPR_ERROR, "unable to create path for rescan\n");
xpt_free_ccb(ccb);
return;
@@ -473,11 +468,16 @@ mprsas_prepare_volume_remove(struct mprsas_softc *sassc, uint16_t handle)
MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY;
cm->cm_complete = mprsas_remove_volume;
cm->cm_complete_data = (void *)(uintptr_t)handle;
+
+ mpr_dprint(sc, MPR_INFO, "%s: Sending reset for target ID %d\n",
+ __func__, targ->tid);
+ mprsas_prepare_for_tm(sc, cm, targ, CAM_LUN_WILDCARD);
+
mpr_map_command(sc, cm);
}
/*
- * The MPT2 firmware performs debounce on the link to avoid transient link
+ * The MPT3 firmware performs debounce on the link to avoid transient link
* errors and false removals. When it does decide that link has been lost
* and a device needs to go away, it expects that the host will perform a
* target reset and then an op remove. The reset has the side-effect of
@@ -532,6 +532,11 @@ mprsas_prepare_remove(struct mprsas_softc *sassc, uint16_t handle)
MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY;
cm->cm_complete = mprsas_remove_device;
cm->cm_complete_data = (void *)(uintptr_t)handle;
+
+ mpr_dprint(sc, MPR_INFO, "%s: Sending reset for target ID %d\n",
+ __func__, targ->tid);
+ mprsas_prepare_for_tm(sc, cm, targ, CAM_LUN_WILDCARD);
+
mpr_map_command(sc, cm);
}
@@ -596,10 +601,10 @@ mprsas_remove_device(struct mpr_softc *sc, struct mpr_command *tm)
mpr_map_command(sc, tm);
- mpr_dprint(sc, MPR_XINFO, "clearing target %u handle 0x%04x\n",
+ mpr_dprint(sc, MPR_INFO, "clearing target %u handle 0x%04x\n",
targ->tid, handle);
if (targ->encl_level_valid) {
- mpr_dprint(sc, MPR_XINFO, "At enclosure level %d, slot %d, "
+ mpr_dprint(sc, MPR_INFO, "At enclosure level %d, slot %d, "
"connector name (%4s)\n", targ->encl_level, targ->encl_slot,
targ->connector_name);
}
@@ -608,7 +613,7 @@ mprsas_remove_device(struct mpr_softc *sc, struct mpr_command *tm)
mpr_dprint(sc, MPR_XINFO, "Completing missed command %p\n", tm);
ccb = tm->cm_complete_data;
- ccb->ccb_h.status = CAM_DEV_NOT_THERE;
+ mprsas_set_ccbstatus(ccb, CAM_DEV_NOT_THERE);
mprsas_scsiio_complete(sc, tm);
}
}
@@ -726,7 +731,7 @@ mpr_attach_sas(struct mpr_softc *sc)
}
/*
- * XXX MaxTargets could change during a reinit. since we don't
+ * XXX MaxTargets could change during a reinit. Since we don't
* resize the targets[] array during such an event, cache the value
* of MaxTargets here so that we don't get into trouble later. This
* should move into the reinit logic.
@@ -782,7 +787,7 @@ mpr_attach_sas(struct mpr_softc *sc)
}
/*
- * Assume that discovery events will start right away. Freezing
+ * Assume that discovery events will start right away.
*
* Hold off boot until discovery is complete.
*/
@@ -790,9 +795,7 @@ mpr_attach_sas(struct mpr_softc *sc)
sc->sassc->startup_refcount = 0;
mprsas_startup_increment(sassc);
- callout_init(&sassc->discovery_callout, 1 /*mprafe*/);
-
- sassc->tm_count = 0;
+ callout_init(&sassc->discovery_callout, 1 /*mpsafe*/);
/*
* Register for async events so we can determine the EEDP
@@ -962,7 +965,7 @@ mprsas_action(struct cam_sim *sim, union ccb *ccb)
sassc = cam_sim_softc(sim);
MPR_FUNCTRACE(sassc->sc);
- mpr_dprint(sassc->sc, MPR_TRACE, "%s func 0x%x\n", __func__,
+ mpr_dprint(sassc->sc, MPR_TRACE, "ccb func_code 0x%x\n",
ccb->ccb_h.func_code);
mtx_assert(&sassc->sc->mpr_mtx, MA_OWNED);
@@ -985,7 +988,7 @@ mprsas_action(struct cam_sim *sim, union ccb *ccb)
cpi->max_lun = 255;
cpi->initiator_id = sassc->maxtargets - 1;
strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "LSILogic", HBA_IDLEN);
+ strncpy(cpi->hba_vid, "Avago Tech (LSI)", HBA_IDLEN);
strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->bus_id = cam_sim_bus(sim);
@@ -1005,7 +1008,7 @@ mprsas_action(struct cam_sim *sim, union ccb *ccb)
*/
cpi->maxio = 256 * 1024;
#endif
- cpi->ccb_h.status = CAM_REQ_CMP;
+ mprsas_set_ccbstatus(ccb, CAM_REQ_CMP);
break;
}
case XPT_GET_TRAN_SETTINGS:
@@ -1024,7 +1027,7 @@ mprsas_action(struct cam_sim *sim, union ccb *ccb)
cts->ccb_h.target_id));
targ = &sassc->targets[cts->ccb_h.target_id];
if (targ->handle == 0x0) {
- cts->ccb_h.status = CAM_DEV_NOT_THERE;
+ mprsas_set_ccbstatus(ccb, CAM_DEV_NOT_THERE);
break;
}
@@ -1054,12 +1057,12 @@ mprsas_action(struct cam_sim *sim, union ccb *ccb)
scsi->valid = CTS_SCSI_VALID_TQ;
scsi->flags = CTS_SCSI_FLAGS_TAG_ENB;
- cts->ccb_h.status = CAM_REQ_CMP;
+ mprsas_set_ccbstatus(ccb, CAM_REQ_CMP);
break;
}
case XPT_CALC_GEOMETRY:
cam_calc_geometry(&ccb->ccg, /*extended*/1);
- ccb->ccb_h.status = CAM_REQ_CMP;
+ mprsas_set_ccbstatus(ccb, CAM_REQ_CMP);
break;
case XPT_RESET_DEV:
mpr_dprint(sassc->sc, MPR_XINFO,
@@ -1071,7 +1074,7 @@ mprsas_action(struct cam_sim *sim, union ccb *ccb)
case XPT_TERM_IO:
mpr_dprint(sassc->sc, MPR_XINFO,
"mprsas_action faking success for abort or reset\n");
- ccb->ccb_h.status = CAM_REQ_CMP;
+ mprsas_set_ccbstatus(ccb, CAM_REQ_CMP);
break;
case XPT_SCSI_IO:
mprsas_action_scsiio(sassc, ccb);
@@ -1082,7 +1085,7 @@ mprsas_action(struct cam_sim *sim, union ccb *ccb)
return;
#endif
default:
- ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
+ mprsas_set_ccbstatus(ccb, CAM_FUNC_NOTAVAIL);
break;
}
xpt_done(ccb);
@@ -1102,7 +1105,7 @@ mprsas_announce_reset(struct mpr_softc *sc, uint32_t ac_code,
if (xpt_create_path(&path, NULL,
path_id, target_id, lun_id) != CAM_REQ_CMP) {
mpr_dprint(sc, MPR_ERROR, "unable to create path for reset "
- "notification\n");
+ "notification\n");
return;
}
@@ -1131,8 +1134,8 @@ mprsas_complete_all_commands(struct mpr_softc *sc)
if (cm->cm_complete != NULL) {
mprsas_log_command(cm, MPR_RECOVERY,
- "completing cm %p state %x ccb %p for diag reset\n",
- cm, cm->cm_state, cm->cm_ccb);
+ "completing cm %p state %x ccb %p for diag "
+ "reset\n", cm, cm->cm_state, cm->cm_ccb);
cm->cm_complete(sc, cm);
completed = 1;
}
@@ -1145,6 +1148,14 @@ mprsas_complete_all_commands(struct mpr_softc *sc)
completed = 1;
}
+ if (cm->cm_sc->io_cmds_active != 0) {
+ cm->cm_sc->io_cmds_active--;
+ } else {
+ mpr_dprint(cm->cm_sc, MPR_INFO, "Warning: "
+ "io_cmds_active is out of sync - resynching to "
+ "0\n");
+ }
+
if ((completed == 0) && (cm->cm_state != MPR_CM_STATE_FREE)) {
/* this should never happen, but if it does, log */
mprsas_log_command(cm, MPR_RECOVERY,
@@ -1180,9 +1191,8 @@ mprsas_handle_reinit(struct mpr_softc *sc)
/* complete and cleanup after all outstanding commands */
mprsas_complete_all_commands(sc);
- mpr_dprint(sc, MPR_INIT, "%s startup %u tm %u after command "
- "completion\n", __func__, sc->sassc->startup_refcount,
- sc->sassc->tm_count);
+ mpr_dprint(sc, MPR_INIT, "%s startup %u after command completion\n",
+ __func__, sc->sassc->startup_refcount);
/* zero all the target handles, since they may change after the
* reset, and we have to rediscover all the targets and use the new
@@ -1244,7 +1254,6 @@ mprsas_logical_unit_reset_complete(struct mpr_softc *sc,
"NULL reset reply for tm %p\n", tm);
if ((sc->mpr_flags & MPR_FLAGS_DIAGRESET) != 0) {
/* this completion was due to a reset, just cleanup */
- targ->flags &= ~MPRSAS_TARGET_INRESET;
targ->tm = NULL;
mprsas_free_tm(sc, tm);
}
@@ -1322,8 +1331,8 @@ mprsas_target_reset_complete(struct mpr_softc *sc, struct mpr_command *tm)
* task management commands don't have S/G lists.
*/
if ((tm->cm_flags & MPR_CM_FLAGS_ERROR_MASK) != 0) {
- mpr_dprint(sc, MPR_ERROR,"%s: cm_flags = %#x for target reset! "
- "This should not happen!\n", __func__, tm->cm_flags);
+ mpr_dprint(sc, MPR_ERROR, "%s: cm_flags = %#x for target "
+ "reset! This should not happen!\n", __func__, tm->cm_flags);
mprsas_free_tm(sc, tm);
return;
}
@@ -1333,7 +1342,6 @@ mprsas_target_reset_complete(struct mpr_softc *sc, struct mpr_command *tm)
"NULL reset reply for tm %p\n", tm);
if ((sc->mpr_flags & MPR_FLAGS_DIAGRESET) != 0) {
/* this completion was due to a reset, just cleanup */
- targ->flags &= ~MPRSAS_TARGET_INRESET;
targ->tm = NULL;
mprsas_free_tm(sc, tm);
}
@@ -1349,8 +1357,6 @@ mprsas_target_reset_complete(struct mpr_softc *sc, struct mpr_command *tm)
le16toh(reply->IOCStatus), le32toh(reply->ResponseCode),
le32toh(reply->TerminationCount));
- targ->flags &= ~MPRSAS_TARGET_INRESET;
-
if (targ->outstanding == 0) {
/* we've finished recovery for this target and all
* of its logical units.
@@ -1378,7 +1384,7 @@ mprsas_target_reset_complete(struct mpr_softc *sc, struct mpr_command *tm)
#define MPR_RESET_TIMEOUT 30
-static int
+int
mprsas_send_reset(struct mpr_softc *sc, struct mpr_command *tm, uint8_t type)
{
MPI2_SCSI_TASK_MANAGE_REQUEST *req;
@@ -1387,8 +1393,8 @@ mprsas_send_reset(struct mpr_softc *sc, struct mpr_command *tm, uint8_t type)
target = tm->cm_targ;
if (target->handle == 0) {
- mpr_dprint(sc, MPR_ERROR,"%s null devhandle for target_id %d\n",
- __func__, target->tid);
+ mpr_dprint(sc, MPR_ERROR, "%s null devhandle for target_id "
+ "%d\n", __func__, target->tid);
return -1;
}
@@ -1404,6 +1410,7 @@ mprsas_send_reset(struct mpr_softc *sc, struct mpr_command *tm, uint8_t type)
mprsas_log_command(tm, MPR_RECOVERY|MPR_INFO,
"sending logical unit reset\n");
tm->cm_complete = mprsas_logical_unit_reset_complete;
+ mprsas_prepare_for_tm(sc, tm, target, tm->cm_lun);
}
else if (type == MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET) {
/*
@@ -1412,20 +1419,20 @@ mprsas_send_reset(struct mpr_softc *sc, struct mpr_command *tm, uint8_t type)
*/
req->MsgFlags = MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET;
tm->cm_targ->target_resets++;
- tm->cm_targ->flags |= MPRSAS_TARGET_INRESET;
mprsas_log_command(tm, MPR_RECOVERY|MPR_INFO,
"sending target reset\n");
tm->cm_complete = mprsas_target_reset_complete;
+ mprsas_prepare_for_tm(sc, tm, target, CAM_LUN_WILDCARD);
}
else {
mpr_dprint(sc, MPR_ERROR, "unexpected reset type 0x%x\n", type);
return -1;
}
- mpr_dprint(sc, MPR_XINFO, "to target %u handle 0x%04x\n", target->tid,
+ mpr_dprint(sc, MPR_INFO, "to target %u handle 0x%04x\n", target->tid,
target->handle);
if (target->encl_level_valid) {
- mpr_dprint(sc, MPR_XINFO, "At enclosure level %d, slot %d, "
+ mpr_dprint(sc, MPR_INFO, "At enclosure level %d, slot %d, "
"connector name (%4s)\n", target->encl_level,
target->encl_slot, target->connector_name);
}
@@ -1441,8 +1448,7 @@ mprsas_send_reset(struct mpr_softc *sc, struct mpr_command *tm, uint8_t type)
err = mpr_map_command(sc, tm);
if (err)
mprsas_log_command(tm, MPR_RECOVERY,
- "error %d sending reset type %u\n",
- err, type);
+ "error %d sending reset type %u\n", err, type);
return err;
}
@@ -1573,6 +1579,10 @@ mprsas_send_abort(struct mpr_softc *sc, struct mpr_command *tm,
targ->aborts++;
+ mpr_dprint(sc, MPR_INFO, "Sending reset from %s for target ID %d\n",
+ __func__, targ->tid);
+ mprsas_prepare_for_tm(sc, tm, targ, tm->cm_lun);
+
err = mpr_map_command(sc, tm);
if (err)
mprsas_log_command(tm, MPR_RECOVERY,
@@ -1581,7 +1591,6 @@ mprsas_send_abort(struct mpr_softc *sc, struct mpr_command *tm,
return err;
}
-
static void
mprsas_scsiio_timeout(void *data)
{
@@ -1617,11 +1626,11 @@ mprsas_scsiio_timeout(void *data)
targ = cm->cm_targ;
targ->timeouts++;
- mprsas_log_command(cm, MPR_XINFO, "command timeout cm %p ccb %p "
+ mprsas_log_command(cm, MPR_ERROR, "command timeout cm %p ccb %p "
"target %u, handle(0x%04x)\n", cm, cm->cm_ccb, targ->tid,
targ->handle);
if (targ->encl_level_valid) {
- mpr_dprint(sc, MPR_XINFO, "At enclosure level %d, slot %d, "
+ mpr_dprint(sc, MPR_ERROR, "At enclosure level %d, slot %d, "
"connector name (%4s)\n", targ->encl_level, targ->encl_slot,
targ->connector_name);
}
@@ -1629,8 +1638,7 @@ mprsas_scsiio_timeout(void *data)
/* XXX first, check the firmware state, to see if it's still
* operational. if not, do a diag reset.
*/
-
- cm->cm_ccb->ccb_h.status = CAM_CMD_TIMEOUT;
+ mprsas_set_ccbstatus(cm->cm_ccb, CAM_CMD_TIMEOUT);
cm->cm_state = MPR_CM_STATE_TIMEDOUT;
TAILQ_INSERT_TAIL(&targ->timedout_commands, cm, cm_recovery);
@@ -1681,19 +1689,22 @@ mprsas_action_scsiio(struct mprsas_softc *sassc, union ccb *ccb)
mtx_assert(&sc->mpr_mtx, MA_OWNED);
csio = &ccb->csio;
+ KASSERT(csio->ccb_h.target_id < sassc->maxtargets,
+ ("Target %d out of bounds in XPT_SCSI_IO\n",
+ csio->ccb_h.target_id));
targ = &sassc->targets[csio->ccb_h.target_id];
mpr_dprint(sc, MPR_TRACE, "ccb %p target flag %x\n", ccb, targ->flags);
if (targ->handle == 0x0) {
mpr_dprint(sc, MPR_ERROR, "%s NULL handle for target %u\n",
__func__, csio->ccb_h.target_id);
- csio->ccb_h.status = CAM_DEV_NOT_THERE;
+ mprsas_set_ccbstatus(ccb, CAM_DEV_NOT_THERE);
xpt_done(ccb);
return;
}
if (targ->flags & MPR_TARGET_FLAGS_RAID_COMPONENT) {
- mpr_dprint(sc, MPR_TRACE, "%s Raid component no SCSI IO "
+ mpr_dprint(sc, MPR_ERROR, "%s Raid component no SCSI IO "
"supported %u\n", __func__, csio->ccb_h.target_id);
- csio->ccb_h.status = CAM_DEV_NOT_THERE;
+ mprsas_set_ccbstatus(ccb, CAM_DEV_NOT_THERE);
xpt_done(ccb);
return;
}
@@ -1702,7 +1713,7 @@ mprsas_action_scsiio(struct mprsas_softc *sassc, union ccb *ccb)
* Progress" and was actually aborted by the upper layer. Check for
* this here and complete the command without error.
*/
- if (ccb->ccb_h.status != CAM_REQ_INPROG) {
+ if (mprsas_get_ccbstatus(ccb) != CAM_REQ_INPROG) {
mpr_dprint(sc, MPR_TRACE, "%s Command is not in progress for "
"target %u\n", __func__, csio->ccb_h.target_id);
xpt_done(ccb);
@@ -1715,16 +1726,29 @@ mprsas_action_scsiio(struct mprsas_softc *sassc, union ccb *ccb)
*/
if (targ->flags & MPRSAS_TARGET_INREMOVAL) {
if (targ->devinfo == 0)
- csio->ccb_h.status = CAM_REQ_CMP;
+ mprsas_set_ccbstatus(ccb, CAM_REQ_CMP);
else
- csio->ccb_h.status = CAM_SEL_TIMEOUT;
+ mprsas_set_ccbstatus(ccb, CAM_SEL_TIMEOUT);
xpt_done(ccb);
return;
}
if ((sc->mpr_flags & MPR_FLAGS_SHUTDOWN) != 0) {
- mpr_dprint(sc, MPR_TRACE, "%s shutting down\n", __func__);
- csio->ccb_h.status = CAM_DEV_NOT_THERE;
+ mpr_dprint(sc, MPR_INFO, "%s shutting down\n", __func__);
+ mprsas_set_ccbstatus(ccb, CAM_DEV_NOT_THERE);
+ xpt_done(ccb);
+ return;
+ }
+
+ /*
+ * If target has a reset in progress, freeze the devq and return. The
+ * devq will be released when the TM reset is finished.
+ */
+ if (targ->flags & MPRSAS_TARGET_INRESET) {
+ ccb->ccb_h.status = CAM_BUSY | CAM_DEV_QFRZN;
+ mpr_dprint(sc, MPR_INFO, "%s: Freezing devq for target ID %d\n",
+ __func__, targ->tid);
+ xpt_freeze_devq(ccb->ccb_h.path, 1);
xpt_done(ccb);
return;
}
@@ -1807,7 +1831,7 @@ mprsas_action_scsiio(struct mprsas_softc *sassc, union ccb *ccb)
if (MPR_SET_LUN(req->LUN, csio->ccb_h.target_lun) != 0) {
mpr_free_command(sc, cm);
- ccb->ccb_h.status = CAM_LUN_INVALID;
+ mprsas_set_ccbstatus(ccb, CAM_LUN_INVALID);
xpt_done(ccb);
return;
}
@@ -1904,7 +1928,7 @@ mprsas_action_scsiio(struct mprsas_softc *sassc, union ccb *ccb)
}
callout_reset_sbt(&cm->cm_callout, SBT_1MS * ccb->ccb_h.timeout, 0,
- mprsas_scsiio_timeout, cm, 0);
+ mprsas_scsiio_timeout, cm, 0);
targ->issued++;
targ->outstanding++;
@@ -2102,7 +2126,7 @@ mpr_sc_failed_io_info(struct mpr_softc *sc, struct ccb_scsiio *csio,
desc_scsi_state, scsi_state);
if (sc->mpr_debug & MPR_XINFO &&
- scsi_state & MPI2_SCSI_STATE_AUTOSENSE_VALID) {
+ scsi_state & MPI2_SCSI_STATE_AUTOSENSE_VALID) {
mpr_dprint(sc, MPR_XINFO, "-> Sense Buffer Data : Start :\n");
scsi_sense_print(csio);
mpr_dprint(sc, MPR_XINFO, "-> Sense Buffer Data : End :\n");
@@ -2126,6 +2150,8 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm)
u8 *TLR_bits, TLR_on;
int dir = 0, i;
u16 alloc_len;
+ struct mprsas_target *target;
+ target_id_t target_id;
MPR_FUNCTRACE(sc);
mpr_dprint(sc, MPR_TRACE,
@@ -2139,6 +2165,7 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm)
sassc = sc->sassc;
ccb = cm->cm_complete_data;
csio = &ccb->csio;
+ target_id = csio->ccb_h.target_id;
rep = (MPI2_SCSI_IO_REPLY *)cm->cm_reply;
/*
* XXX KDM if the chain allocation fails, does it matter if we do
@@ -2197,7 +2224,7 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm)
* because there can be no reply when we haven't actually
* gone out to the hardware.
*/
- ccb->ccb_h.status = CAM_REQUEUE_REQ;
+ mprsas_set_ccbstatus(ccb, CAM_REQUEUE_REQ);
/*
* Currently the only error included in the mask is
@@ -2214,7 +2241,7 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm)
xpt_freeze_simq(sassc->sim, 1);
sassc->flags |= MPRSAS_QUEUE_FROZEN;
mpr_dprint(sc, MPR_INFO, "Error sending command, "
- "freezing SIM queue\n");
+ "freezing SIM queue\n");
}
}
@@ -2224,7 +2251,7 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm)
* commands that were sent. All SSU commands should be completed before
* shutdown completes, meaning SSU_refcount will be 0 after SSU_started
* is TRUE.
- */
+ */
if (sc->SSU_started && (csio->cdb_io.cdb_bytes[0] == START_STOP_UNIT)) {
mpr_dprint(sc, MPR_INFO, "Decrementing SSU count.\n");
sc->SSU_refcount--;
@@ -2232,12 +2259,12 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm)
/* Take the fast path to completion */
if (cm->cm_reply == NULL) {
- if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INPROG) {
+ if (mprsas_get_ccbstatus(ccb) == CAM_REQ_INPROG) {
if ((sc->mpr_flags & MPR_FLAGS_DIAGRESET) != 0)
- ccb->ccb_h.status = CAM_SCSI_BUS_RESET;
+ mprsas_set_ccbstatus(ccb, CAM_SCSI_BUS_RESET);
else {
- ccb->ccb_h.status = CAM_REQ_CMP;
- ccb->csio.scsi_status = SCSI_STATUS_OK;
+ mprsas_set_ccbstatus(ccb, CAM_REQ_CMP);
+ csio->scsi_status = SCSI_STATUS_OK;
}
if (sassc->flags & MPRSAS_QUEUE_FROZEN) {
ccb->ccb_h.status |= CAM_RELEASE_SIMQ;
@@ -2252,10 +2279,10 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm)
* CAM_REQ_CMP. The first is if MPR_CM_FLAGS_ERROR_MASK is
* set, the second is in the MPR_FLAGS_DIAGRESET above.
*/
- if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
+ if (mprsas_get_ccbstatus(ccb) != CAM_REQ_CMP) {
/*
* Freeze the dev queue so that commands are
- * executed in the correct order with after error
+ * executed in the correct order after error
* recovery.
*/
ccb->ccb_h.status |= CAM_DEV_QFRZN;
@@ -2285,7 +2312,7 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm)
/* Completion failed at the transport level. */
if (rep->SCSIState & (MPI2_SCSI_STATE_NO_SCSI_STATUS |
MPI2_SCSI_STATE_TERMINATED)) {
- ccb->ccb_h.status = CAM_REQ_CMP_ERR;
+ mprsas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR);
break;
}
@@ -2294,7 +2321,7 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm)
* recover the command.
*/
if (rep->SCSIState & MPI2_SCSI_STATE_AUTOSENSE_FAILED) {
- ccb->ccb_h.status = CAM_AUTOSENSE_FAIL;
+ mprsas_set_ccbstatus(ccb, CAM_AUTOSENSE_FAIL);
break;
}
@@ -2306,7 +2333,7 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm)
if ((rep->SCSIState & MPI2_SCSI_STATE_RESPONSE_INFO_VALID) &&
((le32toh(rep->ResponseInfo) & MPI2_SCSI_RI_MASK_REASONCODE)
== MPR_SCSI_RI_INVALID_FRAME)) {
- sc->mapping_table[csio->ccb_h.target_id].TLR_bits =
+ sc->mapping_table[target_id].TLR_bits =
(u8)MPI2_SCSIIO_CONTROL_NO_TLR;
}
@@ -2318,16 +2345,16 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm)
*/
if ((rep->SCSIStatus == MPI2_SCSI_STATUS_COMMAND_TERMINATED) ||
(rep->SCSIStatus == MPI2_SCSI_STATUS_TASK_ABORTED)) {
- ccb->ccb_h.status = CAM_REQ_ABORTED;
+ mprsas_set_ccbstatus(ccb, CAM_REQ_ABORTED);
break;
}
/* Handle normal status and sense */
csio->scsi_status = rep->SCSIStatus;
if (rep->SCSIStatus == MPI2_SCSI_STATUS_GOOD)
- ccb->ccb_h.status = CAM_REQ_CMP;
+ mprsas_set_ccbstatus(ccb, CAM_REQ_CMP);
else
- ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR;
+ mprsas_set_ccbstatus(ccb, CAM_SCSI_STATUS_ERROR);
if (rep->SCSIState & MPI2_SCSI_STATE_AUTOSENSE_VALID) {
int sense_len, returned_sense_len;
@@ -2362,12 +2389,11 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm)
(csio->data_ptr != NULL) &&
((csio->data_ptr[0] & 0x1f) == T_SEQUENTIAL) &&
(sc->control_TLR) &&
- (sc->mapping_table[csio->ccb_h.target_id].device_info &
+ (sc->mapping_table[target_id].device_info &
MPI2_SAS_DEVICE_INFO_SSP_TARGET)) {
vpd_list = (struct scsi_vpd_supported_page_list *)
csio->data_ptr;
- TLR_bits = &sc->mapping_table[csio->ccb_h.target_id].
- TLR_bits;
+ TLR_bits = &sc->mapping_table[target_id].TLR_bits;
*TLR_bits = (u8)MPI2_SCSIIO_CONTROL_NO_TLR;
TLR_on = (u8)MPI2_SCSIIO_CONTROL_TLR_ON;
alloc_len = ((u16)csio->cdb_io.cdb_bytes[3] << 8) +
@@ -2380,6 +2406,24 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm)
}
}
}
+
+ /*
+ * If this is a SATA direct-access end device, mark it so that
+ * a SCSI StartStopUnit command will be sent to it when the
+ * driver is being shutdown.
+ */
+ if ((csio->cdb_io.cdb_bytes[0] == INQUIRY) &&
+ ((csio->data_ptr[0] & 0x1f) == T_DIRECT) &&
+ (sc->mapping_table[target_id].device_info &
+ MPI2_SAS_DEVICE_INFO_SATA_DEVICE) &&
+ ((sc->mapping_table[target_id].device_info &
+ MPI2_SAS_DEVICE_INFO_MASK_DEVICE_TYPE) ==
+ MPI2_SAS_DEVICE_INFO_END_DEVICE)) {
+ target = &sassc->targets[target_id];
+ target->supports_SSU = TRUE;
+ mpr_dprint(sc, MPR_XINFO, "Target %d supports SSU\n",
+ target_id);
+ }
break;
case MPI2_IOCSTATUS_SCSI_INVALID_DEVHANDLE:
case MPI2_IOCSTATUS_SCSI_DEVICE_NOT_THERE:
@@ -2390,13 +2434,13 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm)
* failed.
*/
if (cm->cm_targ->devinfo == 0)
- ccb->ccb_h.status = CAM_REQ_CMP;
+ mprsas_set_ccbstatus(ccb, CAM_REQ_CMP);
else
- ccb->ccb_h.status = CAM_DEV_NOT_THERE;
+ mprsas_set_ccbstatus(ccb, CAM_DEV_NOT_THERE);
break;
case MPI2_IOCSTATUS_INVALID_SGL:
mpr_print_scsiio_cmd(sc, cm);
- ccb->ccb_h.status = CAM_UNREC_HBA_ERROR;
+ mprsas_set_ccbstatus(ccb, CAM_UNREC_HBA_ERROR);
break;
case MPI2_IOCSTATUS_SCSI_TASK_TERMINATED:
/*
@@ -2409,14 +2453,14 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm)
* on the console.
*/
if (cm->cm_state == MPR_CM_STATE_TIMEDOUT)
- ccb->ccb_h.status = CAM_CMD_TIMEOUT;
+ mprsas_set_ccbstatus(ccb, CAM_CMD_TIMEOUT);
else
- ccb->ccb_h.status = CAM_REQ_ABORTED;
+ mprsas_set_ccbstatus(ccb, CAM_REQ_ABORTED);
break;
case MPI2_IOCSTATUS_SCSI_DATA_OVERRUN:
/* resid is ignored for this condition */
csio->resid = 0;
- ccb->ccb_h.status = CAM_DATA_RUN_ERR;
+ mprsas_set_ccbstatus(ccb, CAM_DATA_RUN_ERR);
break;
case MPI2_IOCSTATUS_SCSI_IOC_TERMINATED:
case MPI2_IOCSTATUS_SCSI_EXT_TERMINATED:
@@ -2425,7 +2469,7 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm)
* transient transport-related) errors, retry these without
* decrementing the retry count.
*/
- ccb->ccb_h.status = CAM_REQUEUE_REQ;
+ mprsas_set_ccbstatus(ccb, CAM_REQUEUE_REQ);
mprsas_log_command(cm, MPR_INFO,
"terminated ioc %x scsi %x state %x xfer %u\n",
le16toh(rep->IOCStatus), rep->SCSIStatus, rep->SCSIState,
@@ -2447,7 +2491,7 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm)
le16toh(rep->IOCStatus), rep->SCSIStatus, rep->SCSIState,
le32toh(rep->TransferCount));
csio->resid = cm->cm_length;
- ccb->ccb_h.status = CAM_REQ_CMP_ERR;
+ mprsas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR);
break;
}
@@ -2460,7 +2504,7 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm)
"queue\n");
}
- if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
+ if (mprsas_get_ccbstatus(ccb) != CAM_REQ_CMP) {
ccb->ccb_h.status |= CAM_DEV_QFRZN;
xpt_freeze_devq(ccb->ccb_h.path, /*count*/ 1);
}
@@ -2487,16 +2531,16 @@ mprsas_smpio_complete(struct mpr_softc *sc, struct mpr_command *cm)
* in the standard request size.
*/
if ((cm->cm_flags & MPR_CM_FLAGS_ERROR_MASK) != 0) {
- mpr_dprint(sc, MPR_ERROR,"%s: cm_flags = %#x on SMP request!\n",
- __func__, cm->cm_flags);
- ccb->ccb_h.status = CAM_REQ_CMP_ERR;
+ mpr_dprint(sc, MPR_ERROR, "%s: cm_flags = %#x on SMP "
+ "request!\n", __func__, cm->cm_flags);
+ mprsas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR);
goto bailout;
}
rpl = (MPI2_SMP_PASSTHROUGH_REPLY *)cm->cm_reply;
if (rpl == NULL) {
mpr_dprint(sc, MPR_ERROR, "%s: NULL cm_reply!\n", __func__);
- ccb->ccb_h.status = CAM_REQ_CMP_ERR;
+ mprsas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR);
goto bailout;
}
@@ -2509,17 +2553,17 @@ mprsas_smpio_complete(struct mpr_softc *sc, struct mpr_command *cm)
rpl->SASStatus != MPI2_SASSTATUS_SUCCESS) {
mpr_dprint(sc, MPR_XINFO, "%s: IOCStatus %04x SASStatus %02x\n",
__func__, le16toh(rpl->IOCStatus), rpl->SASStatus);
- ccb->ccb_h.status = CAM_REQ_CMP_ERR;
+ mprsas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR);
goto bailout;
}
- mpr_dprint(sc, MPR_XINFO, "%s: SMP request to SAS address "
- "%#jx completed successfully\n", __func__, (uintmax_t)sasaddr);
+ mpr_dprint(sc, MPR_XINFO, "%s: SMP request to SAS address %#jx "
+ "completed successfully\n", __func__, (uintmax_t)sasaddr);
if (ccb->smpio.smp_response[2] == SMP_FR_ACCEPTED)
- ccb->ccb_h.status = CAM_REQ_CMP;
+ mprsas_set_ccbstatus(ccb, CAM_REQ_CMP);
else
- ccb->ccb_h.status = CAM_SMP_STATUS_ERROR;
+ mprsas_set_ccbstatus(ccb, CAM_SMP_STATUS_ERROR);
bailout:
/*
@@ -2558,7 +2602,7 @@ mprsas_send_smpcmd(struct mprsas_softc *sassc, union ccb *ccb,
*/
mpr_dprint(sc, MPR_ERROR, "%s: physical addresses not "
"supported\n", __func__);
- ccb->ccb_h.status = CAM_REQ_INVALID;
+ mprsas_set_ccbstatus(ccb, CAM_REQ_INVALID);
xpt_done(ccb);
return;
case CAM_DATA_SG:
@@ -2571,7 +2615,7 @@ mprsas_send_smpcmd(struct mprsas_softc *sassc, union ccb *ccb,
mpr_dprint(sc, MPR_ERROR,
"%s: multiple request or response buffer segments "
"not supported for SMP\n", __func__);
- ccb->ccb_h.status = CAM_REQ_INVALID;
+ mprsas_set_ccbstatus(ccb, CAM_REQ_INVALID);
xpt_done(ccb);
return;
}
@@ -2605,7 +2649,7 @@ mprsas_send_smpcmd(struct mprsas_softc *sassc, union ccb *ccb,
response = ccb->smpio.smp_response;
break;
default:
- ccb->ccb_h.status = CAM_REQ_INVALID;
+ mprsas_set_ccbstatus(ccb, CAM_REQ_INVALID);
xpt_done(ccb);
return;
}
@@ -2614,9 +2658,9 @@ mprsas_send_smpcmd(struct mprsas_softc *sassc, union ccb *ccb,
* XXX We don't yet support physical addresses here.
*/
if (ccb->ccb_h.flags & (CAM_DATA_PHYS|CAM_SG_LIST_PHYS)) {
- mpr_printf(sc, "%s: physical addresses not supported\n",
- __func__);
- ccb->ccb_h.status = CAM_REQ_INVALID;
+ mpr_dprint(sc, MPR_ERROR, "%s: physical addresses not "
+ "supported\n", __func__);
+ mprsas_set_ccbstatus(ccb, CAM_REQ_INVALID);
xpt_done(ccb);
return;
}
@@ -2635,7 +2679,7 @@ mprsas_send_smpcmd(struct mprsas_softc *sassc, union ccb *ccb,
mpr_dprint(sc, MPR_ERROR, "%s: multiple request or "
"response buffer segments not supported for SMP\n",
__func__);
- ccb->ccb_h.status = CAM_REQ_INVALID;
+ mprsas_set_ccbstatus(ccb, CAM_REQ_INVALID);
xpt_done(ccb);
return;
}
@@ -2673,7 +2717,7 @@ mprsas_send_smpcmd(struct mprsas_softc *sassc, union ccb *ccb,
if (cm == NULL) {
mpr_dprint(sc, MPR_ERROR,
"%s: cannot allocate command\n", __func__);
- ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
+ mprsas_set_ccbstatus(ccb, CAM_RESRC_UNAVAIL);
xpt_done(ccb);
return;
}
@@ -2760,7 +2804,7 @@ mprsas_send_smpcmd(struct mprsas_softc *sassc, union ccb *ccb,
bailout_error:
mpr_free_command(sc, cm);
- ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
+ mprsas_set_ccbstatus(ccb, CAM_RESRC_UNAVAIL);
xpt_done(ccb);
return;
}
@@ -2783,7 +2827,7 @@ mprsas_action_smpio(struct mprsas_softc *sassc, union ccb *ccb)
if (targ->handle == 0x0) {
mpr_dprint(sc, MPR_ERROR, "%s: target %d does not exist!\n",
__func__, ccb->ccb_h.target_id);
- ccb->ccb_h.status = CAM_SEL_TIMEOUT;
+ mprsas_set_ccbstatus(ccb, CAM_SEL_TIMEOUT);
xpt_done(ccb);
return;
}
@@ -2831,7 +2875,7 @@ mprsas_action_smpio(struct mprsas_softc *sassc, union ccb *ccb)
if (targ->parent_handle == 0x0) {
mpr_dprint(sc, MPR_ERROR, "%s: handle %d does not have "
"a valid parent handle!\n", __func__, targ->handle);
- ccb->ccb_h.status = CAM_DEV_NOT_THERE;
+ mprsas_set_ccbstatus(ccb, CAM_DEV_NOT_THERE);
goto bailout;
}
#ifdef OLD_MPR_PROBE
@@ -2841,7 +2885,7 @@ mprsas_action_smpio(struct mprsas_softc *sassc, union ccb *ccb)
if (parent_target == NULL) {
mpr_dprint(sc, MPR_ERROR, "%s: handle %d does not have "
"a valid parent target!\n", __func__, targ->handle);
- ccb->ccb_h.status = CAM_DEV_NOT_THERE;
+ mprsas_set_ccbstatus(ccb, CAM_DEV_NOT_THERE);
goto bailout;
}
@@ -2850,9 +2894,8 @@ mprsas_action_smpio(struct mprsas_softc *sassc, union ccb *ccb)
mpr_dprint(sc, MPR_ERROR, "%s: handle %d parent %d "
"does not have an SMP target!\n", __func__,
targ->handle, parent_target->handle);
- ccb->ccb_h.status = CAM_DEV_NOT_THERE;
+ mprsas_set_ccbstatus(ccb, CAM_DEV_NOT_THERE);
goto bailout;
-
}
sasaddr = parent_target->sasaddr;
@@ -2862,7 +2905,7 @@ mprsas_action_smpio(struct mprsas_softc *sassc, union ccb *ccb)
mpr_dprint(sc, MPR_ERROR, "%s: handle %d parent %d "
"does not have an SMP target!\n", __func__,
targ->handle, targ->parent_handle);
- ccb->ccb_h.status = CAM_DEV_NOT_THERE;
+ mprsas_set_ccbstatus(ccb, CAM_DEV_NOT_THERE);
goto bailout;
}
@@ -2870,7 +2913,7 @@ mprsas_action_smpio(struct mprsas_softc *sassc, union ccb *ccb)
mpr_dprint(sc, MPR_ERROR, "%s: handle %d parent handle "
"%d does not have a valid SAS address!\n", __func__,
targ->handle, targ->parent_handle);
- ccb->ccb_h.status = CAM_DEV_NOT_THERE;
+ mprsas_set_ccbstatus(ccb, CAM_DEV_NOT_THERE);
goto bailout;
}
@@ -2882,7 +2925,7 @@ mprsas_action_smpio(struct mprsas_softc *sassc, union ccb *ccb)
if (sasaddr == 0) {
mpr_dprint(sc, MPR_INFO, "%s: unable to find SAS address for "
"handle %d\n", __func__, targ->handle);
- ccb->ccb_h.status = CAM_DEV_NOT_THERE;
+ mprsas_set_ccbstatus(ccb, CAM_DEV_NOT_THERE);
goto bailout;
}
mprsas_send_smpcmd(sassc, ccb, sasaddr);
@@ -2914,7 +2957,7 @@ mprsas_action_resetdev(struct mprsas_softc *sassc, union ccb *ccb)
if (tm == NULL) {
mpr_dprint(sc, MPR_ERROR,
"command alloc failure in mprsas_action_resetdev\n");
- ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
+ mprsas_set_ccbstatus(ccb, CAM_RESRC_UNAVAIL);
xpt_done(ccb);
return;
}
@@ -2933,7 +2976,12 @@ mprsas_action_resetdev(struct mprsas_softc *sassc, union ccb *ccb)
MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY;
tm->cm_complete = mprsas_resetdev_complete;
tm->cm_complete_data = ccb;
+
+ mpr_dprint(sc, MPR_INFO, "%s: Sending reset for target ID %d\n",
+ __func__, targ->tid);
tm->cm_targ = targ;
+ targ->flags |= MPRSAS_TARGET_INRESET;
+
mpr_map_command(sc, tm);
}
@@ -2962,7 +3010,7 @@ mprsas_resetdev_complete(struct mpr_softc *sc, struct mpr_command *tm)
mpr_dprint(sc, MPR_ERROR, "%s: cm_flags = %#x for reset of "
"handle %#04x! This should not happen!\n", __func__,
tm->cm_flags, req->DevHandle);
- ccb->ccb_h.status = CAM_REQ_CMP_ERR;
+ mprsas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR);
goto bailout;
}
@@ -2971,12 +3019,12 @@ mprsas_resetdev_complete(struct mpr_softc *sc, struct mpr_command *tm)
le16toh(resp->IOCStatus), le32toh(resp->ResponseCode));
if (le32toh(resp->ResponseCode) == MPI2_SCSITASKMGMT_RSP_TM_COMPLETE) {
- ccb->ccb_h.status = CAM_REQ_CMP;
+ mprsas_set_ccbstatus(ccb, CAM_REQ_CMP);
mprsas_announce_reset(sc, AC_SENT_BDR, tm->cm_targ->tid,
CAM_LUN_WILDCARD);
}
else
- ccb->ccb_h.status = CAM_REQ_CMP_ERR;
+ mprsas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR);
bailout:
@@ -2995,7 +3043,8 @@ mprsas_poll(struct cam_sim *sim)
/* frequent debug messages during a panic just slow
* everything down too much.
*/
- mpr_printf(sassc->sc, "%s clearing MPR_TRACE\n", __func__);
+ mpr_dprint(sassc->sc, MPR_XINFO, "%s clearing MPR_TRACE\n",
+ __func__);
sassc->sc->mpr_debug &= ~MPR_TRACE;
}
@@ -3094,7 +3143,7 @@ mprsas_async(void *callback_arg, uint32_t code, struct cam_path *path,
if ((cdai.ccb_h.status & CAM_DEV_QFRZN) != 0)
cam_release_devq(cdai.ccb_h.path, 0, 0, 0, FALSE);
- if (((cdai.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP)
+ if ((mprsas_get_ccbstatus((union ccb *)&cdai) == CAM_REQ_CMP)
&& (rcap_buf.prot & SRC16_PROT_EN)) {
lun->eedp_formatted = TRUE;
lun->eedp_block_size = scsi_4btoul(rcap_buf.length);
@@ -3121,8 +3170,6 @@ mprsas_async(void *callback_arg, uint32_t code, struct cam_path *path,
#endif
cgd = arg;
- mprsas_prepare_ssu(sc, path, cgd);
-
#if (__FreeBSD_version < 901503) || \
((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000006))
mprsas_check_eedp(sc, path, cgd);
@@ -3134,64 +3181,6 @@ mprsas_async(void *callback_arg, uint32_t code, struct cam_path *path,
}
}
-static void
-mprsas_prepare_ssu(struct mpr_softc *sc, struct cam_path *path,
- struct ccb_getdev *cgd)
-{
- struct mprsas_softc *sassc = sc->sassc;
- path_id_t pathid;
- target_id_t targetid;
- lun_id_t lunid;
- struct mprsas_target *target;
- struct mprsas_lun *lun;
- uint8_t found_lun;
-
- sassc = sc->sassc;
- pathid = cam_sim_path(sassc->sim);
- targetid = xpt_path_target_id(path);
- lunid = xpt_path_lun_id(path);
-
- KASSERT(targetid < sassc->maxtargets,
- ("Target %d out of bounds in mprsas_prepare_ssu\n", targetid));
- target = &sassc->targets[targetid];
- if (target->handle == 0x0)
- return;
-
- /*
- * If LUN is already in list, don't create a new one.
- */
- found_lun = FALSE;
- SLIST_FOREACH(lun, &target->luns, lun_link) {
- if (lun->lun_id == lunid) {
- found_lun = TRUE;
- break;
- }
- }
- if (!found_lun) {
- lun = malloc(sizeof(struct mprsas_lun), M_MPR,
- M_NOWAIT | M_ZERO);
- if (lun == NULL) {
- mpr_dprint(sc, MPR_ERROR, "Unable to alloc LUN for "
- "preparing SSU.\n");
- return;
- }
- lun->lun_id = lunid;
- SLIST_INSERT_HEAD(&target->luns, lun, lun_link);
- }
-
- /*
- * If this is a SATA direct-access end device, mark it so that a SCSI
- * StartStopUnit command will be sent to it when the driver is being
- * shutdown.
- */
- if (((cgd->inq_data.device & 0x1F) == T_DIRECT) &&
- (target->devinfo & MPI2_SAS_DEVICE_INFO_SATA_DEVICE) &&
- ((target->devinfo & MPI2_SAS_DEVICE_INFO_MASK_DEVICE_TYPE) ==
- MPI2_SAS_DEVICE_INFO_END_DEVICE)) {
- lun->stop_at_shutdown = TRUE;
- }
-}
-
#if (__FreeBSD_version < 901503) || \
((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000006))
static void
@@ -3212,7 +3201,6 @@ mprsas_check_eedp(struct mpr_softc *sc, struct cam_path *path,
uint8_t found_lun;
char path_str[64];
- sassc = sc->sassc;
pathid = cam_sim_path(sassc->sim);
targetid = xpt_path_target_id(path);
lunid = xpt_path_lun_id(path);
@@ -3288,7 +3276,7 @@ mprsas_check_eedp(struct mpr_softc *sc, struct cam_path *path,
rcap_buf = malloc(sizeof(struct scsi_read_capacity_eedp), M_MPR,
M_NOWAIT | M_ZERO);
if (rcap_buf == NULL) {
- mpr_dprint(sc, MPR_FAULT, "Unable to alloc read capacity "
+ mpr_dprint(sc, MPR_ERROR, "Unable to alloc read capacity "
"buffer for EEDP support.\n");
xpt_free_path(ccb->ccb_h.path);
xpt_free_ccb(ccb);
@@ -3341,7 +3329,7 @@ mprsas_read_cap_done(struct cam_periph *periph, union ccb *done_ccb)
xpt_release_devq(done_ccb->ccb_h.path,
/*count*/ 1, /*run_queue*/TRUE);
}
-
+
rcap_buf = (struct scsi_read_capacity_eedp *)done_ccb->csio.data_ptr;
/*
@@ -3359,21 +3347,21 @@ mprsas_read_cap_done(struct cam_periph *periph, union ccb *done_ccb)
/*
* Got the LUN in the target's LUN list. Fill it in with EEDP
- * info. If the READ CAP 16 command had some SCSI error (common
+ * info. If the READ CAP 16 command had some SCSI error (common
* if command is not supported), mark the lun as not supporting
* EEDP and set the block size to 0.
*/
- if (((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)
- || (done_ccb->csio.scsi_status != SCSI_STATUS_OK)) {
+ if ((mprsas_get_ccbstatus(done_ccb) != CAM_REQ_CMP) ||
+ (done_ccb->csio.scsi_status != SCSI_STATUS_OK)) {
lun->eedp_formatted = FALSE;
lun->eedp_block_size = 0;
break;
}
if (rcap_buf->protect & 0x01) {
- mpr_dprint(sassc->sc, MPR_INFO, "LUN %d for "
- "target ID %d is formatted for EEDP "
- "support.\n", done_ccb->ccb_h.target_lun,
+ mpr_dprint(sassc->sc, MPR_INFO, "LUN %d for target ID "
+ "%d is formatted for EEDP support.\n",
+ done_ccb->ccb_h.target_lun,
done_ccb->ccb_h.target_id);
lun->eedp_formatted = TRUE;
lun->eedp_block_size = scsi_4btoul(rcap_buf->length);
@@ -3389,6 +3377,34 @@ mprsas_read_cap_done(struct cam_periph *periph, union ccb *done_ccb)
#endif /* (__FreeBSD_version < 901503) || \
((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000006)) */
+void
+mprsas_prepare_for_tm(struct mpr_softc *sc, struct mpr_command *tm,
+ struct mprsas_target *target, lun_id_t lun_id)
+{
+ union ccb *ccb;
+ path_id_t path_id;
+
+ /*
+ * Set the INRESET flag for this target so that no I/O will be sent to
+ * the target until the reset has completed. If an I/O request does
+ * happen, the devq will be frozen. The CCB holds the path which is
+ * used to release the devq. The devq is released and the CCB is freed
+ * when the TM completes.
+ */
+ ccb = xpt_alloc_ccb_nowait();
+ if (ccb) {
+ path_id = cam_sim_path(sc->sassc->sim);
+ if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, path_id,
+ target->tid, lun_id) != CAM_REQ_CMP) {
+ xpt_free_ccb(ccb);
+ } else {
+ tm->cm_ccb = ccb;
+ tm->cm_targ = target;
+ target->flags |= MPRSAS_TARGET_INRESET;
+ }
+ }
+}
+
int
mprsas_startup(struct mpr_softc *sc)
{
@@ -3489,3 +3505,33 @@ mprsas_check_id(struct mprsas_softc *sassc, int id)
return (0);
}
+
+void
+mprsas_realloc_targets(struct mpr_softc *sc, int maxtargets)
+{
+ struct mprsas_softc *sassc;
+ struct mprsas_lun *lun, *lun_tmp;
+ struct mprsas_target *targ;
+ int i;
+
+ sassc = sc->sassc;
+ /*
+ * The number of targets is based on IOC Facts, so free all of
+ * the allocated LUNs for each target and then the target buffer
+ * itself.
+ */
+ for (i=0; i< maxtargets; i++) {
+ targ = &sassc->targets[i];
+ SLIST_FOREACH_SAFE(lun, &targ->luns, lun_link, lun_tmp) {
+ free(lun, M_MPR);
+ }
+ }
+ free(sassc->targets, M_MPR);
+
+ sassc->targets = malloc(sizeof(struct mprsas_target) * maxtargets,
+ M_MPR, M_WAITOK|M_ZERO);
+ if (!sassc->targets) {
+ panic("%s failed to alloc targets with error %d\n",
+ __func__, ENOMEM);
+ }
+}
diff --git a/sys/dev/mpr/mpr_sas.h b/sys/dev/mpr/mpr_sas.h
index 9d3116a..ebeed30 100644
--- a/sys/dev/mpr/mpr_sas.h
+++ b/sys/dev/mpr/mpr_sas.h
@@ -1,5 +1,6 @@
/*-
- * Copyright (c) 2011-2014 LSI Corp.
+ * Copyright (c) 2011-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
*
* $FreeBSD$
*/
@@ -35,7 +36,6 @@ struct mprsas_lun {
lun_id_t lun_id;
uint8_t eedp_formatted;
uint32_t eedp_block_size;
- uint8_t stop_at_shutdown;
};
struct mprsas_target {
@@ -55,11 +55,10 @@ struct mprsas_target {
#define MPRSAS_TARGET_INREMOVAL (1 << 3)
#define MPR_TARGET_FLAGS_RAID_COMPONENT (1 << 4)
#define MPR_TARGET_FLAGS_VOLUME (1 << 5)
+#define MPR_TARGET_IS_SATA_SSD (1 << 6)
#define MPRSAS_TARGET_INRECOVERY (MPRSAS_TARGET_INABORT | \
MPRSAS_TARGET_INRESET | MPRSAS_TARGET_INCHIPRESET)
-#define MPRSAS_TARGET_ADD (1 << 29)
-#define MPRSAS_TARGET_REMOVE (1 << 30)
uint16_t tid;
SLIST_HEAD(, mprsas_lun) luns;
TAILQ_HEAD(, mpr_command) commands;
@@ -82,6 +81,8 @@ struct mprsas_target {
unsigned int logical_unit_resets;
unsigned int target_resets;
uint8_t scsi_req_desc_type;
+ uint8_t stop_at_shutdown;
+ uint8_t supports_SSU;
};
struct mprsas_softc {
@@ -92,7 +93,6 @@ struct mprsas_softc {
#define MPRSAS_DISCOVERY_TIMEOUT_PENDING (1 << 2)
#define MPRSAS_QUEUE_FROZEN (1 << 3)
#define MPRSAS_SHUTDOWN (1 << 4)
-#define MPRSAS_SCANTHREAD (1 << 5)
u_int maxtargets;
struct mprsas_target *targets;
struct cam_devq *devq;
@@ -103,7 +103,6 @@ struct mprsas_softc {
struct mpr_event_handle *mprsas_eh;
u_int startup_refcount;
- u_int tm_count;
struct proc *sysctl_proc;
struct taskqueue *ev_tq;
@@ -150,6 +149,19 @@ mprsas_set_lun(uint8_t *lun, u_int ccblun)
return (0);
}
+static __inline void
+mprsas_set_ccbstatus(union ccb *ccb, int status)
+{
+ ccb->ccb_h.status &= ~CAM_STATUS_MASK;
+ ccb->ccb_h.status |= status;
+}
+
+static __inline int
+mprsas_get_ccbstatus(union ccb *ccb)
+{
+ return (ccb->ccb_h.status & CAM_STATUS_MASK);
+}
+
#define MPR_SET_SINGLE_LUN(req, lun) \
do { \
bzero((req)->LUN, 8); \
@@ -158,11 +170,10 @@ do { \
void mprsas_rescan_target(struct mpr_softc *sc, struct mprsas_target *targ);
void mprsas_discovery_end(struct mprsas_softc *sassc);
+void mprsas_prepare_for_tm(struct mpr_softc *sc, struct mpr_command *tm,
+ struct mprsas_target *target, lun_id_t lun_id);
void mprsas_startup_increment(struct mprsas_softc *sassc);
void mprsas_startup_decrement(struct mprsas_softc *sassc);
-void mprsas_release_simq_reinit(struct mprsas_softc *sassc);
-struct mpr_command * mprsas_alloc_tm(struct mpr_softc *sc);
-void mprsas_free_tm(struct mpr_softc *sc, struct mpr_command *tm);
void mprsas_firmware_event_work(void *arg, int pending);
int mprsas_check_id(struct mprsas_softc *sassc, int id);
diff --git a/sys/dev/mpr/mpr_sas_lsi.c b/sys/dev/mpr/mpr_sas_lsi.c
index 32e9b3a..7d6ef70 100644
--- a/sys/dev/mpr/mpr_sas_lsi.c
+++ b/sys/dev/mpr/mpr_sas_lsi.c
@@ -1,5 +1,6 @@
/*-
- * Copyright (c) 2011-2014 LSI Corp.
+ * Copyright (c) 2011-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,13 +24,13 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* Communications core for LSI MPT2 */
+/* Communications core for LSI MPT3 */
/* TODO Move headers to mprvar */
#include <sys/types.h>
@@ -105,7 +106,9 @@ struct _ata_identify_device_data {
u16 serial_number[10]; /* 10-19 */
u16 reserved2[7]; /* 20-26 */
u16 model_number[20]; /* 27-46*/
- u16 reserved3[209]; /* 47-255*/
+ u16 reserved3[170]; /* 47-216 */
+ u16 rotational_speed; /* 217 */
+ u16 reserved4[38]; /* 218-255 */
};
static u32 event_count;
static void mprsas_fw_work(struct mpr_softc *sc,
@@ -116,8 +119,9 @@ static int mprsas_add_device(struct mpr_softc *sc, u16 handle, u8 linkrate);
static int mprsas_get_sata_identify(struct mpr_softc *sc, u16 handle,
Mpi2SataPassthroughReply_t *mpi_reply, char *id_buffer, int sz,
u32 devinfo);
+static void mprsas_ata_id_timeout(void *data);
int mprsas_get_sas_address_for_sata_disk(struct mpr_softc *sc,
- u64 *sas_address, u16 handle, u32 device_info);
+ u64 *sas_address, u16 handle, u32 device_info, u8 *is_SATA_SSD);
static int mprsas_volume_add(struct mpr_softc *sc,
u16 handle);
static void mprsas_SSU_to_SATA_devices(struct mpr_softc *sc);
@@ -325,7 +329,7 @@ mprsas_fw_work(struct mpr_softc *sc, struct mpr_fw_event_work *fw_event)
return;
}
- mpr_dprint(sc, MPR_INFO, "Sending FP action "
+ mpr_dprint(sc, MPR_EVENT, "Sending FP action "
"from "
"MPI2_EVENT_IR_CONFIGURATION_CHANGE_LIST "
":\n");
@@ -350,9 +354,9 @@ mprsas_fw_work(struct mpr_softc *sc, struct mpr_fw_event_work *fw_event)
if (reply && (le16toh(reply->IOCStatus) &
MPI2_IOCSTATUS_MASK) !=
MPI2_IOCSTATUS_SUCCESS) {
- mpr_dprint(sc, MPR_INFO, "%s: error "
- "sending RaidActionPage; iocstatus "
- "= 0x%x\n", __func__,
+ mpr_dprint(sc, MPR_ERROR, "%s: error "
+ "sending RaidActionPage; "
+ "iocstatus = 0x%x\n", __func__,
le16toh(reply->IOCStatus));
}
@@ -360,7 +364,7 @@ mprsas_fw_work(struct mpr_softc *sc, struct mpr_fw_event_work *fw_event)
mpr_free_command(sc, cm);
}
skip_fp_send:
- mpr_dprint(sc, MPR_INFO, "Received "
+ mpr_dprint(sc, MPR_EVENT, "Received "
"MPI2_EVENT_IR_CONFIGURATION_CHANGE_LIST Reason "
"code %x:\n", element->ReasonCode);
switch (element->ReasonCode) {
@@ -421,7 +425,6 @@ skip_fp_send:
break;
targ->flags |= MPR_TARGET_FLAGS_RAID_COMPONENT;
mprsas_rescan_target(sc, targ);
-
break;
case MPI2_EVENT_IR_CHANGE_RC_PD_DELETED:
/*
@@ -678,14 +681,13 @@ mprsas_add_device(struct mpr_softc *sc, u16 handle, u8 linkrate){
struct mprsas_target *targ;
Mpi2ConfigReply_t mpi_reply;
Mpi2SasDevicePage0_t config_page;
- uint64_t sas_address, sata_sas_address;
- uint64_t parent_sas_address = 0;
- u16 ioc_pg8_flags = le16toh(sc->ioc_pg8.Flags);
+ uint64_t sas_address, parent_sas_address = 0;
u32 device_info, parent_devinfo = 0;
unsigned int id;
- int ret;
- int error = 0;
+ int ret = 1, error = 0, i;
struct mprsas_lun *lun;
+ u8 is_SATA_SSD = 0;
+ struct mpr_command *cm;
sassc = sc->sassc;
mprsas_startup_increment(sassc);
@@ -717,26 +719,29 @@ mprsas_add_device(struct mpr_softc *sc, u16 handle, u8 linkrate){
}
/* TODO Check proper endianess */
sas_address = config_page.SASAddress.High;
- sas_address = (sas_address << 32) |
- config_page.SASAddress.Low;
-
- if ((ioc_pg8_flags & MPI2_IOCPAGE8_FLAGS_MASK_MAPPING_MODE)
- == MPI2_IOCPAGE8_FLAGS_DEVICE_PERSISTENCE_MAPPING) {
- if (device_info & MPI2_SAS_DEVICE_INFO_SATA_DEVICE) {
- ret = mprsas_get_sas_address_for_sata_disk(sc,
- &sata_sas_address, handle, device_info);
- if (!ret)
- id = mpr_mapping_get_sas_id(sc,
- sata_sas_address, handle);
- else
- id = mpr_mapping_get_sas_id(sc,
- sas_address, handle);
- } else
- id = mpr_mapping_get_sas_id(sc, sas_address,
- handle);
- } else
- id = mpr_mapping_get_sas_id(sc, sas_address, handle);
+ sas_address = (sas_address << 32) | config_page.SASAddress.Low;
+ mpr_dprint(sc, MPR_INFO, "SAS Address from SAS device page0 = %jx\n",
+ sas_address);
+
+ /*
+ * Always get SATA Identify information because this is used to
+ * determine if Start/Stop Unit should be sent to the drive when the
+ * system is shutdown.
+ */
+ if (device_info & MPI2_SAS_DEVICE_INFO_SATA_DEVICE) {
+ ret = mprsas_get_sas_address_for_sata_disk(sc, &sas_address,
+ handle, device_info, &is_SATA_SSD);
+ if (ret) {
+ mpr_dprint(sc, MPR_ERROR, "%s: failed to get disk type "
+ "(SSD or HDD) for SATA device with handle 0x%04x\n",
+ __func__, handle);
+ } else {
+ mpr_dprint(sc, MPR_INFO, "SAS Address from SATA "
+ "device = %jx\n", sas_address);
+ }
+ }
+ id = mpr_mapping_get_sas_id(sc, sas_address, handle);
if (id == MPR_MAP_BAD_ID) {
printf("failure at %s:%d/%s()! Could not get ID for device "
"with handle 0x%04x\n", __FILE__, __LINE__, __func__,
@@ -750,7 +755,7 @@ mprsas_add_device(struct mpr_softc *sc, u16 handle, u8 linkrate){
error = ENXIO;
goto out;
}
-
+
mpr_dprint(sc, MPR_MAPPING, "SAS Address from SAS device page0 = %jx\n",
sas_address);
targ = &sassc->targets[id];
@@ -773,6 +778,9 @@ mprsas_add_device(struct mpr_softc *sc, u16 handle, u8 linkrate){
targ->tid = id;
targ->linkrate = (linkrate>>4);
targ->flags = 0;
+ if (is_SATA_SSD) {
+ targ->flags = MPR_TARGET_IS_SATA_SSD;
+ }
if (le16toh(config_page.Flags) &
MPI25_SAS_DEVICE0_FLAGS_FAST_PATH_CAPABLE) {
targ->scsi_req_desc_type =
@@ -792,12 +800,12 @@ mprsas_add_device(struct mpr_softc *sc, u16 handle, u8 linkrate){
SLIST_INIT(&targ->luns);
mpr_describe_devinfo(targ->devinfo, devstring, 80);
- mpr_dprint(sc, (MPR_XINFO|MPR_MAPPING), "Found device <%s> <%s> "
+ mpr_dprint(sc, (MPR_INFO|MPR_MAPPING), "Found device <%s> <%s> "
"handle<0x%04x> enclosureHandle<0x%04x> slot %d\n", devstring,
mpr_describe_table(mpr_linkrate_names, targ->linkrate),
targ->handle, targ->encl_handle, targ->encl_slot);
if (targ->encl_level_valid) {
- mpr_dprint(sc, (MPR_XINFO|MPR_MAPPING), "At enclosure level %d "
+ mpr_dprint(sc, (MPR_INFO|MPR_MAPPING), "At enclosure level %d "
"and connector name (%4s)\n", targ->encl_level,
targ->connector_name);
}
@@ -807,15 +815,57 @@ mprsas_add_device(struct mpr_softc *sc, u16 handle, u8 linkrate){
#endif
mprsas_rescan_target(sc, targ);
mpr_dprint(sc, MPR_MAPPING, "Target id 0x%x added\n", targ->tid);
+
+ /*
+ * Check all commands to see if the SATA_ID_TIMEOUT flag has been set.
+ * If so, send a Target Reset TM to the target that was just created.
+ * An Abort Task TM should be used instead of a Target Reset, but that
+ * would be much more difficult because targets have not been fully
+ * discovered yet, and LUN's haven't been setup. So, just reset the
+ * target instead of the LUN.
+ */
+ for (i = 1; i < sc->num_reqs; i++) {
+ cm = &sc->commands[i];
+ if (cm->cm_flags & MPR_CM_FLAGS_SATA_ID_TIMEOUT) {
+ targ->timeouts++;
+ cm->cm_state = MPR_CM_STATE_TIMEDOUT;
+
+ if ((targ->tm = mprsas_alloc_tm(sc)) != NULL) {
+ mpr_dprint(sc, MPR_INFO, "%s: sending Target "
+ "Reset for stuck SATA identify command "
+ "(cm = %p)\n", __func__, cm);
+ targ->tm->cm_targ = targ;
+ mprsas_send_reset(sc, targ->tm,
+ MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET);
+ } else {
+ mpr_dprint(sc, MPR_ERROR, "Failed to allocate "
+ "tm for Target Reset after SATA ID "
+ "command timed out (cm %p)\n", cm);
+ }
+ /*
+ * No need to check for more since the target is
+ * already being reset.
+ */
+ break;
+ }
+ }
out:
+ /*
+ * Free the commands that may not have been freed from the SATA ID call
+ */
+ for (i = 1; i < sc->num_reqs; i++) {
+ cm = &sc->commands[i];
+ if (cm->cm_flags & MPR_CM_FLAGS_SATA_ID_TIMEOUT) {
+ mpr_free_command(sc, cm);
+ }
+ }
mprsas_startup_decrement(sassc);
return (error);
-
}
int
mprsas_get_sas_address_for_sata_disk(struct mpr_softc *sc,
- u64 *sas_address, u16 handle, u32 device_info)
+ u64 *sas_address, u16 handle, u32 device_info, u8 *is_SATA_SSD)
{
Mpi2SataPassthroughReply_t mpi_reply;
int i, rc, try_count;
@@ -835,7 +885,16 @@ mprsas_get_sas_address_for_sata_disk(struct mpr_softc *sc,
ioc_status = le16toh(mpi_reply.IOCStatus)
& MPI2_IOCSTATUS_MASK;
sas_status = mpi_reply.SASStatus;
- } while ((rc == -EAGAIN || ioc_status || sas_status) &&
+ if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
+ if (sc->spinup_wait_time > 0) {
+ mpr_dprint(sc, MPR_INFO, "Sleeping %d seconds "
+ "after SATA ID error to wait for spinup\n",
+ sc->spinup_wait_time);
+ msleep(&sc->msleep_fake_chan, &sc->mpr_mtx, 0,
+ "mprid", sc->spinup_wait_time * hz);
+ }
+ }
+ } while (((rc && (rc != EWOULDBLOCK)) || ioc_status || sas_status) &&
(try_count < 5));
if (rc == 0 && !ioc_status && !sas_status) {
@@ -884,6 +943,10 @@ mprsas_get_sas_address_for_sata_disk(struct mpr_softc *sc,
(u64)hash_address.wwid[3] << 32 | (u64)hash_address.wwid[4] << 24 |
(u64)hash_address.wwid[5] << 16 | (u64)hash_address.wwid[6] << 8 |
(u64)hash_address.wwid[7];
+ if (ata_identify.rotational_speed == 1) {
+ *is_SATA_SSD = 1;
+ }
+
return 0;
}
@@ -923,14 +986,29 @@ mprsas_get_sata_identify(struct mpr_softc *sc, u16 handle,
cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
cm->cm_data = buffer;
cm->cm_length = htole32(sz);
+
+ /*
+ * Start a timeout counter specifically for the SATA ID command. This
+ * is used to fix a problem where the FW does not send a reply sometimes
+ * when a bad disk is in the topology. So, this is used to timeout the
+ * command so that processing can continue normally.
+ */
+ mpr_dprint(sc, MPR_XINFO, "%s start timeout counter for SATA ID "
+ "command\n", __func__);
+ callout_reset(&cm->cm_callout, MPR_ATA_ID_TIMEOUT * hz,
+ mprsas_ata_id_timeout, cm);
error = mpr_wait_command(sc, cm, 60, CAN_SLEEP);
+ mpr_dprint(sc, MPR_XINFO, "%s stop timeout counter for SATA ID "
+ "command\n", __func__);
+ callout_stop(&cm->cm_callout);
+
reply = (Mpi2SataPassthroughReply_t *)cm->cm_reply;
if (error || (reply == NULL)) {
/* FIXME */
/*
* If the request returns an error then we need to do a diag
* reset
- */
+ */
printf("%s: request for page completed with error %d",
__func__, error);
error = ENXIO;
@@ -946,11 +1024,66 @@ mprsas_get_sata_identify(struct mpr_softc *sc, u16 handle,
goto out;
}
out:
- mpr_free_command(sc, cm);
- free(buffer, M_MPR);
+ /*
+ * If the SATA_ID_TIMEOUT flag has been set for this command, don't free
+ * it. The command will be freed after sending a target reset TM. If
+ * the command did timeout, use EWOULDBLOCK.
+ */
+ if ((cm->cm_flags & MPR_CM_FLAGS_SATA_ID_TIMEOUT) == 0)
+ mpr_free_command(sc, cm);
+ else if (error == 0)
+ error = EWOULDBLOCK;
+ free(buffer, M_MPR);
return (error);
}
+static void
+mprsas_ata_id_timeout(void *data)
+{
+ struct mpr_softc *sc;
+ struct mpr_command *cm;
+
+ cm = (struct mpr_command *)data;
+ sc = cm->cm_sc;
+ mtx_assert(&sc->mpr_mtx, MA_OWNED);
+
+ mpr_dprint(sc, MPR_INFO, "%s checking ATA ID command %p sc %p\n",
+ __func__, cm, sc);
+ if ((callout_pending(&cm->cm_callout)) ||
+ (!callout_active(&cm->cm_callout))) {
+ mpr_dprint(sc, MPR_INFO, "%s ATA ID command almost timed "
+ "out\n", __func__);
+ return;
+ }
+ callout_deactivate(&cm->cm_callout);
+
+ /*
+ * Run the interrupt handler to make sure it's not pending. This
+ * isn't perfect because the command could have already completed
+ * and been re-used, though this is unlikely.
+ */
+ mpr_intr_locked(sc);
+ if (cm->cm_state == MPR_CM_STATE_FREE) {
+ mpr_dprint(sc, MPR_INFO, "%s ATA ID command almost timed "
+ "out\n", __func__);
+ return;
+ }
+
+ mpr_dprint(sc, MPR_INFO, "ATA ID command timeout cm %p\n", cm);
+
+ /*
+ * Send wakeup() to the sleeping thread that issued this ATA ID
+ * command. wakeup() will cause msleep to return a 0 (not EWOULDBLOCK),
+ * and this will keep reinit() from being called. This way, an Abort
+ * Task TM can be issued so that the timed out command can be cleared.
+ * The Abort Task cannot be sent from here because the driver has not
+ * completed setting up targets. Instead, the command is flagged so
+ * that special handling will be used to send the abort.
+ */
+ cm->cm_flags |= MPR_CM_FLAGS_SATA_ID_TIMEOUT;
+ wakeup(cm);
+}
+
static int
mprsas_volume_add(struct mpr_softc *sc, u16 handle)
{
@@ -1024,15 +1157,13 @@ mprsas_SSU_to_SATA_devices(struct mpr_softc *sc)
path_id_t pathid = cam_sim_path(sassc->sim);
target_id_t targetid;
struct mprsas_target *target;
- struct mprsas_lun *lun;
char path_str[64];
struct timeval cur_time, start_time;
mpr_lock(sc);
/*
- * For each LUN of each target, issue a StartStopUnit command to stop
- * the device.
+ * For each target, issue a StartStopUnit command to stop the device.
*/
sc->SSU_started = TRUE;
sc->SSU_refcount = 0;
@@ -1042,59 +1173,52 @@ mprsas_SSU_to_SATA_devices(struct mpr_softc *sc)
continue;
}
- SLIST_FOREACH(lun, &target->luns, lun_link) {
- ccb = xpt_alloc_ccb_nowait();
- if (ccb == NULL) {
- mpr_unlock(sc);
- mpr_dprint(sc, MPR_FAULT, "Unable to alloc "
- "CCB to stop unit.\n");
+ ccb = xpt_alloc_ccb_nowait();
+ if (ccb == NULL) {
+ mpr_dprint(sc, MPR_FAULT, "Unable to alloc CCB to stop "
+ "unit.\n");
+ return;
+ }
+
+ /*
+ * The stop_at_shutdown flag will be set if this device is
+ * a SATA direct-access end device.
+ */
+ if (target->stop_at_shutdown) {
+ if (xpt_create_path(&ccb->ccb_h.path, xpt_periph,
+ pathid, targetid, CAM_LUN_WILDCARD) !=
+ CAM_REQ_CMP) {
+ mpr_dprint(sc, MPR_ERROR, "Unable to create "
+ "path to stop unit.\n");
+ xpt_free_ccb(ccb);
return;
}
+ xpt_path_string(ccb->ccb_h.path, path_str,
+ sizeof(path_str));
+
+ mpr_dprint(sc, MPR_INFO, "Sending StopUnit: path %s "
+ "handle %d\n", path_str, target->handle);
/*
- * The stop_at_shutdown flag will be set if this LUN is
- * a SATA direct-access end device.
+ * Issue a START STOP UNIT command for the target.
+ * Increment the SSU counter to be used to count the
+ * number of required replies.
*/
- if (lun->stop_at_shutdown) {
- if (xpt_create_path(&ccb->ccb_h.path,
- xpt_periph, pathid, targetid,
- lun->lun_id) != CAM_REQ_CMP) {
- mpr_dprint(sc, MPR_FAULT, "Unable to "
- "create LUN path to stop unit.\n");
- xpt_free_ccb(ccb);
- mpr_unlock(sc);
- return;
- }
- xpt_path_string(ccb->ccb_h.path, path_str,
- sizeof(path_str));
-
- mpr_dprint(sc, MPR_INFO, "Sending StopUnit: "
- "path %s handle %d\n", path_str,
- target->handle);
-
- /*
- * Issue a START STOP UNIT command for the LUN.
- * Increment the SSU counter to be used to
- * count the number of required replies.
- */
- mpr_dprint(sc, MPR_INFO, "Incrementing SSU "
- "count\n");
- sc->SSU_refcount++;
- ccb->ccb_h.target_id =
- xpt_path_target_id(ccb->ccb_h.path);
- ccb->ccb_h.target_lun = lun->lun_id;
- ccb->ccb_h.ppriv_ptr1 = sassc;
- scsi_start_stop(&ccb->csio,
- /*retries*/0,
- mprsas_stop_unit_done,
- MSG_SIMPLE_Q_TAG,
- /*start*/FALSE,
- /*load/eject*/0,
- /*immediate*/FALSE,
- MPR_SENSE_LEN,
- /*timeout*/10000);
- xpt_action(ccb);
- }
+ mpr_dprint(sc, MPR_INFO, "Incrementing SSU count\n");
+ sc->SSU_refcount++;
+ ccb->ccb_h.target_id =
+ xpt_path_target_id(ccb->ccb_h.path);
+ ccb->ccb_h.ppriv_ptr1 = sassc;
+ scsi_start_stop(&ccb->csio,
+ /*retries*/0,
+ mprsas_stop_unit_done,
+ MSG_SIMPLE_Q_TAG,
+ /*start*/FALSE,
+ /*load/eject*/0,
+ /*immediate*/FALSE,
+ MPR_SENSE_LEN,
+ /*timeout*/10000);
+ xpt_action(ccb);
}
}
@@ -1102,7 +1226,7 @@ mprsas_SSU_to_SATA_devices(struct mpr_softc *sc)
/*
* Wait until all of the SSU commands have completed or time has
- * expired (60 seconds). pause for 100ms each time through. If any
+ * expired (60 seconds). Pause for 100ms each time through. If any
* command times out, the target will be reset in the SCSI command
* timeout routine.
*/
@@ -1112,7 +1236,7 @@ mprsas_SSU_to_SATA_devices(struct mpr_softc *sc)
getmicrotime(&cur_time);
if ((cur_time.tv_sec - start_time.tv_sec) > 60) {
- mpr_dprint(sc, MPR_FAULT, "Time has expired waiting "
+ mpr_dprint(sc, MPR_ERROR, "Time has expired waiting "
"for SSU commands to complete.\n");
break;
}
@@ -1162,6 +1286,8 @@ mprsas_ir_shutdown(struct mpr_softc *sc)
unsigned int id, found_volume = 0;
struct mpr_command *cm;
Mpi2RaidActionRequest_t *action;
+ target_id_t targetid;
+ struct mprsas_target *target;
mpr_dprint(sc, MPR_TRACE, "%s\n", __func__);
@@ -1214,5 +1340,47 @@ mprsas_ir_shutdown(struct mpr_softc *sc)
mpr_free_command(sc, cm);
out:
+ /*
+ * All of the targets must have the correct value set for
+ * 'stop_at_shutdown' for the current 'enable_ssu' sysctl variable.
+ *
+ * The possible values for the 'enable_ssu' variable are:
+ * 0: disable to SSD and HDD
+ * 1: disable only to HDD (default)
+ * 2: disable only to SSD
+ * 3: enable to SSD and HDD
+ * anything else will default to 1.
+ */
+ for (targetid = 0; targetid < sc->facts->MaxTargets; targetid++) {
+ target = &sc->sassc->targets[targetid];
+ if (target->handle == 0x0) {
+ continue;
+ }
+
+ if (target->supports_SSU) {
+ switch (sc->enable_ssu) {
+ case MPR_SSU_DISABLE_SSD_DISABLE_HDD:
+ target->stop_at_shutdown = FALSE;
+ break;
+ case MPR_SSU_DISABLE_SSD_ENABLE_HDD:
+ target->stop_at_shutdown = TRUE;
+ if (target->flags & MPR_TARGET_IS_SATA_SSD) {
+ target->stop_at_shutdown = FALSE;
+ }
+ break;
+ case MPR_SSU_ENABLE_SSD_ENABLE_HDD:
+ target->stop_at_shutdown = TRUE;
+ break;
+ case MPR_SSU_ENABLE_SSD_DISABLE_HDD:
+ default:
+ target->stop_at_shutdown = TRUE;
+ if ((target->flags &
+ MPR_TARGET_IS_SATA_SSD) == 0) {
+ target->stop_at_shutdown = FALSE;
+ }
+ break;
+ }
+ }
+ }
mprsas_SSU_to_SATA_devices(sc);
}
diff --git a/sys/dev/mpr/mpr_user.c b/sys/dev/mpr/mpr_user.c
index 60680f5..37d9467 100644
--- a/sys/dev/mpr/mpr_user.c
+++ b/sys/dev/mpr/mpr_user.c
@@ -27,10 +27,11 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * LSI MPT-Fusion Host Adapter FreeBSD userland interface
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD userland interface
*/
/*-
- * Copyright (c) 2011-2014 LSI Corp.
+ * Copyright (c) 2011-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -54,7 +55,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
*
* $FreeBSD$
*/
@@ -90,7 +91,7 @@ __FBSDID("$FreeBSD$");
#include <sys/rman.h>
#include <cam/cam.h>
-#include <cam/scsi/scsi_all.h>
+#include <cam/cam_ccb.h>
#include <dev/mpr/mpi/mpi2_type.h>
#include <dev/mpr/mpi/mpi2.h>
@@ -284,8 +285,7 @@ mpr_user_read_cfg_header(struct mpr_softc *sc,
static int
mpr_user_read_cfg_page(struct mpr_softc *sc,
- struct mpr_cfg_page_req *page_req,
- void *buf)
+ struct mpr_cfg_page_req *page_req, void *buf)
{
MPI2_CONFIG_PAGE_HEADER *reqhdr, *hdr;
struct mpr_config_params params;
@@ -328,6 +328,10 @@ mpr_user_read_extcfg_header(struct mpr_softc *sc,
hdr->PageNumber = ext_page_req->header.PageNumber;
hdr->ExtPageType = ext_page_req->header.ExtPageType;
params.page_address = le32toh(ext_page_req->page_address);
+ params.buffer = NULL;
+ params.length = 0;
+ params.callback = NULL;
+
if ((error = mpr_read_config_page(sc, &params)) != 0) {
/*
* Leave the request. Without resetting the chip, it's
@@ -365,8 +369,8 @@ mpr_user_read_extcfg_page(struct mpr_softc *sc,
params.action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT;
params.page_address = le32toh(ext_page_req->page_address);
hdr->PageVersion = reqhdr->PageVersion;
- hdr->PageNumber = reqhdr->PageNumber;
hdr->PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
+ hdr->PageNumber = reqhdr->PageNumber;
hdr->ExtPageType = reqhdr->ExtPageType;
hdr->ExtPageLength = reqhdr->ExtPageLength;
params.buffer = buf;
@@ -541,6 +545,8 @@ mpi_pre_fw_upload(struct mpr_command *cm, struct mpr_usr_command *cmd)
req->ImageOffset = 0;
req->ImageSize = cmd->len;
+ cm->cm_flags |= MPR_CM_FLAGS_DATAIN;
+
return (mpr_push_ieee_sge(cm, &req->SGL, 0));
}
@@ -834,11 +840,22 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru_t *data)
task->TaskMID = cm->cm_desc.Default.SMID;
cm->cm_data = NULL;
- cm->cm_desc.HighPriority.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY;
+ cm->cm_desc.HighPriority.RequestFlags =
+ MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY;
cm->cm_complete = NULL;
cm->cm_complete_data = NULL;
- err = mpr_wait_command(sc, cm, 30, CAN_SLEEP);
+ targ = mprsas_find_target_by_handle(sc->sassc, 0,
+ task->DevHandle);
+ if (targ == NULL) {
+ mpr_dprint(sc, MPR_INFO,
+ "%s %d : invalid handle for requested TM 0x%x \n",
+ __func__, __LINE__, task->DevHandle);
+ err = 1;
+ } else {
+ mprsas_prepare_for_tm(sc, cm, targ, CAM_LUN_WILDCARD);
+ err = mpr_wait_command(sc, cm, 30, CAN_SLEEP);
+ }
if (err != 0) {
err = EIO;
@@ -1029,7 +1046,7 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru_t *data)
if (cm->cm_flags & MPR_CM_FLAGS_DATAIN)
dir = BUS_DMASYNC_POSTREAD;
else if (cm->cm_flags & MPR_CM_FLAGS_DATAOUT)
- dir = BUS_DMASYNC_POSTWRITE;;
+ dir = BUS_DMASYNC_POSTWRITE;
bus_dmamap_sync(sc->buffer_dmat, cm->cm_dmamap, dir);
bus_dmamap_unload(sc->buffer_dmat, cm->cm_dmamap);
@@ -1351,8 +1368,8 @@ done:
}
static int
-mpr_diag_register(struct mpr_softc *sc,
- mpr_fw_diag_register_t *diag_register, uint32_t *return_code)
+mpr_diag_register(struct mpr_softc *sc, mpr_fw_diag_register_t *diag_register,
+ uint32_t *return_code)
{
mpr_fw_diagnostic_buffer_t *pBuffer;
uint8_t extended_type, buffer_type, i;
diff --git a/sys/dev/mpr/mprvar.h b/sys/dev/mpr/mprvar.h
index 9752dcd..acac44c 100644
--- a/sys/dev/mpr/mprvar.h
+++ b/sys/dev/mpr/mprvar.h
@@ -1,6 +1,7 @@
/*-
* Copyright (c) 2009 Yahoo! Inc.
- * Copyright (c) 2011-2014 LSI Corp.
+ * Copyright (c) 2011-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -24,13 +25,15 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
+ *
* $FreeBSD$
*/
#ifndef _MPRVAR_H
#define _MPRVAR_H
-#define MPR_DRIVER_VERSION "05.255.05.00-fbsd"
+#define MPR_DRIVER_VERSION "09.255.01.00-fbsd"
#define MPR_DB_MAX_WAIT 2500
@@ -47,16 +50,19 @@
#define MPR_FUNCTRACE(sc) \
mpr_dprint((sc), MPR_TRACE, "%s\n", __func__)
-#define CAN_SLEEP 1
-#define NO_SLEEP 0
+#define CAN_SLEEP 1
+#define NO_SLEEP 0
#define MPR_PERIODIC_DELAY 1 /* 1 second heartbeat/watchdog check */
+#define MPR_ATA_ID_TIMEOUT 5 /* 5 second timeout for SATA ID cmd */
#define IFAULT_IOP_OVER_TEMP_THRESHOLD_EXCEEDED 0x2810
#define MPR_SCSI_RI_INVALID_FRAME (0x00000002)
#define MPR_STRING_LENGTH 64
+#define DEFAULT_SPINUP_WAIT 3 /* seconds to wait for spinup */
+
#include <sys/endian.h>
/*
@@ -213,13 +219,14 @@ struct mpr_command {
#define MPR_CM_FLAGS_CHAIN_FAILED (1 << 8)
#define MPR_CM_FLAGS_ERROR_MASK MPR_CM_FLAGS_CHAIN_FAILED
#define MPR_CM_FLAGS_USE_CCB (1 << 9)
+#define MPR_CM_FLAGS_SATA_ID_TIMEOUT (1 << 10)
u_int cm_state;
#define MPR_CM_STATE_FREE 0
#define MPR_CM_STATE_BUSY 1
#define MPR_CM_STATE_TIMEDOUT 2
bus_dmamap_t cm_dmamap;
struct scsi_sense_data *cm_sense;
- TAILQ_HEAD(, mpr_chain) cm_chain_list;
+ TAILQ_HEAD(, mpr_chain) cm_chain_list;
uint32_t cm_req_busaddr;
uint32_t cm_sense_busaddr;
struct callout cm_callout;
@@ -256,6 +263,8 @@ struct mpr_softc {
int chain_free;
int max_chains;
int chain_free_lowwater;
+ u_int enable_ssu;
+ int spinup_wait_time;
#if __FreeBSD_version >= 900030
uint64_t chain_alloc_fail;
#endif
@@ -270,7 +279,7 @@ struct mpr_softc {
char tmp_string[MPR_STRING_LENGTH];
TAILQ_HEAD(, mpr_command) req_list;
TAILQ_HEAD(, mpr_command) high_priority_req_list;
- TAILQ_HEAD(, mpr_chain) chain_list;
+ TAILQ_HEAD(, mpr_chain) chain_list;
TAILQ_HEAD(, mpr_command) tm_list;
int replypostindex;
int replyfreeindex;
@@ -291,7 +300,7 @@ struct mpr_softc {
uint8_t event_mask[16];
TAILQ_HEAD(, mpr_event_handle) event_list;
- struct mpr_event_handle *mpr_log_eh;
+ struct mpr_event_handle *mpr_log_eh;
struct mtx mpr_mtx;
struct intr_config_hook mpr_ich;
@@ -565,6 +574,11 @@ mpr_unlock(struct mpr_softc *sc)
#define MPR_MAPPING (1 << 9) /* Trace device mappings */
#define MPR_TRACE (1 << 10) /* Function-by-function trace */
+#define MPR_SSU_DISABLE_SSD_DISABLE_HDD 0
+#define MPR_SSU_ENABLE_SSD_DISABLE_HDD 1
+#define MPR_SSU_DISABLE_SSD_ENABLE_HDD 2
+#define MPR_SSU_ENABLE_SSD_ENABLE_HDD 3
+
#define mpr_printf(sc, args...) \
device_printf((sc)->mpr_dev, ##args)
@@ -600,9 +614,6 @@ do { \
#define MPR_EVENTFIELD(sc, facts, attr, fmt) \
mpr_dprint_field((sc), MPR_EVENT, #attr ": " #fmt "\n", (facts)->attr)
-#define CAN_SLEEP 1
-#define NO_SLEEP 0
-
static __inline void
mpr_from_u64(uint64_t data, U64 *mpr)
{
@@ -613,7 +624,6 @@ mpr_from_u64(uint64_t data, U64 *mpr)
static __inline uint64_t
mpr_to_u64(U64 *data)
{
-
return (((uint64_t)le32toh(data->High) << 32) | le32toh(data->Low));
}
@@ -727,6 +737,12 @@ void mprsas_prepare_volume_remove(struct mprsas_softc *sassc,
int mprsas_startup(struct mpr_softc *sc);
struct mprsas_target * mprsas_find_target_by_handle(struct mprsas_softc *,
int, uint16_t);
+void mprsas_realloc_targets(struct mpr_softc *sc, int maxtargets);
+struct mpr_command * mprsas_alloc_tm(struct mpr_softc *sc);
+void mprsas_free_tm(struct mpr_softc *sc, struct mpr_command *tm);
+void mprsas_release_simq_reinit(struct mprsas_softc *sassc);
+int mprsas_send_reset(struct mpr_softc *sc, struct mpr_command *tm,
+ uint8_t type);
SYSCTL_DECL(_hw_mpr);
diff --git a/sys/dev/mwl/if_mwl.c b/sys/dev/mwl/if_mwl.c
index 5997dbc..0997500 100644
--- a/sys/dev/mwl/if_mwl.c
+++ b/sys/dev/mwl/if_mwl.c
@@ -113,9 +113,9 @@ static int mwl_key_delete(struct ieee80211vap *,
static int mwl_key_set(struct ieee80211vap *, const struct ieee80211_key *,
const uint8_t mac[IEEE80211_ADDR_LEN]);
static int mwl_mode_init(struct mwl_softc *);
-static void mwl_update_mcast(struct ifnet *);
-static void mwl_update_promisc(struct ifnet *);
-static void mwl_updateslot(struct ifnet *);
+static void mwl_update_mcast(struct ieee80211com *);
+static void mwl_update_promisc(struct ieee80211com *);
+static void mwl_updateslot(struct ieee80211com *);
static int mwl_beacon_setup(struct ieee80211vap *);
static void mwl_beacon_update(struct ieee80211vap *, int);
#ifdef MWL_HOST_PS_SUPPORT
@@ -413,6 +413,8 @@ mwl_attach(uint16_t devid, struct mwl_softc *sc)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_softc = sc;
+ ic->ic_name = device_get_nameunit(sc->sc_dev);
/* XXX not right but it's not used anywhere important */
ic->ic_phytype = IEEE80211_T_OFDM;
ic->ic_opmode = IEEE80211_M_STA;
@@ -1843,9 +1845,9 @@ mwl_mode_init(struct mwl_softc *sc)
* Callback from the 802.11 layer after a multicast state change.
*/
static void
-mwl_update_mcast(struct ifnet *ifp)
+mwl_update_mcast(struct ieee80211com *ic)
{
- struct mwl_softc *sc = ifp->if_softc;
+ struct mwl_softc *sc = ic->ic_softc;
mwl_setmcastfilter(sc);
}
@@ -1858,11 +1860,12 @@ mwl_update_mcast(struct ifnet *ifp)
* mode when operating in hostap mode to do ACS).
*/
static void
-mwl_update_promisc(struct ifnet *ifp)
+mwl_update_promisc(struct ieee80211com *ic)
{
- struct mwl_softc *sc = ifp->if_softc;
+ struct mwl_softc *sc = ic->ic_softc;
- mwl_hal_setpromisc(sc->sc_mh, (ifp->if_flags & IFF_PROMISC) != 0);
+ mwl_hal_setpromisc(sc->sc_mh,
+ (ic->ic_ifp->if_flags & IFF_PROMISC) != 0);
}
/*
@@ -1872,15 +1875,14 @@ mwl_update_promisc(struct ifnet *ifp)
* like slot time and preamble.
*/
static void
-mwl_updateslot(struct ifnet *ifp)
+mwl_updateslot(struct ieee80211com *ic)
{
- struct mwl_softc *sc = ifp->if_softc;
- struct ieee80211com *ic = ifp->if_l2com;
+ struct mwl_softc *sc = ic->ic_softc;
struct mwl_hal *mh = sc->sc_mh;
int prot;
/* NB: can be called early; suppress needless cmds */
- if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+ if ((ic->ic_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
return;
/*
@@ -1938,7 +1940,7 @@ mwl_beacon_update(struct ieee80211vap *vap, int item)
KASSERT(hvap != NULL, ("no beacon"));
switch (item) {
case IEEE80211_BEACON_ERP:
- mwl_updateslot(ic->ic_ifp);
+ mwl_updateslot(ic);
break;
case IEEE80211_BEACON_HTINFO:
mwl_hal_setnprotmode(hvap,
diff --git a/sys/dev/nand/nfc_rb.c b/sys/dev/nand/nfc_rb.c
index 64f888a..20a4026 100644
--- a/sys/dev/nand/nfc_rb.c
+++ b/sys/dev/nand/nfc_rb.c
@@ -49,6 +49,9 @@ __FBSDID("$FreeBSD$");
#include <dev/nand/nand.h>
#include <dev/nand/nandbus.h>
+
+#include <powerpc/mpc85xx/mpc85xx.h>
+
#include "nfc_if.h"
#include "gpio_if.h"
@@ -128,6 +131,7 @@ rb_nand_attach(device_t dev)
struct rb_nand_softc *sc;
phandle_t node;
uint32_t ale[2],cle[2],nce[2],rdy[2];
+ u_long size,start;
int err;
sc = device_get_softc(dev);
@@ -168,6 +172,14 @@ rb_nand_attach(device_t dev)
return (ENXIO);
}
+ start = rman_get_start(sc->sc_mem);
+ size = rman_get_size(sc->sc_mem);
+ if (law_enable(OCP85XX_TGTIF_LBC, start, size) != 0) {
+ bus_release_resource(dev, SYS_RES_MEMORY, sc->rid, sc->sc_mem);
+ device_printf(dev, "could not allocate local address window.\n");
+ return (ENXIO);
+ }
+
nand_init(&sc->nand_dev, dev, NAND_ECC_SOFT, 0, 0, NULL, NULL);
err = nandbus_create(dev);
diff --git a/sys/dev/netmap/if_em_netmap.h b/sys/dev/netmap/if_em_netmap.h
index 15e9be5..99eaa6f 100644
--- a/sys/dev/netmap/if_em_netmap.h
+++ b/sys/dev/netmap/if_em_netmap.h
@@ -70,7 +70,7 @@ em_netmap_unblock_tasks(struct adapter *adapter)
struct rx_ring *rxr = adapter->rx_rings;
int i;
- for (i = 0; i < adapter->num_queues; i++) {
+ for (i = 0; i < adapter->num_queues; i++, txr++, rxr++) {
taskqueue_unblock(txr->tq);
taskqueue_unblock(rxr->tq);
}
diff --git a/sys/dev/ofw/ofw_bus_subr.c b/sys/dev/ofw/ofw_bus_subr.c
index 5063930..a9261ce 100644
--- a/sys/dev/ofw/ofw_bus_subr.c
+++ b/sys/dev/ofw/ofw_bus_subr.c
@@ -503,6 +503,28 @@ ofw_bus_intr_to_rl(device_t dev, phandle_t node,
}
phandle_t
+ofw_bus_find_child(phandle_t start, const char *child_name)
+{
+ char *name;
+ int ret;
+ phandle_t child;
+
+ for (child = OF_child(start); child != 0; child = OF_peer(child)) {
+ ret = OF_getencprop_alloc(child, "name", sizeof(*name), (void **)&name);
+ if (ret == -1)
+ continue;
+ if (strcmp(name, child_name) == 0) {
+ free(name, M_OFWPROP);
+ return (child);
+ }
+
+ free(name, M_OFWPROP);
+ }
+
+ return (0);
+}
+
+phandle_t
ofw_bus_find_compatible(phandle_t node, const char *onecompat)
{
phandle_t child, ret;
diff --git a/sys/dev/ofw/ofw_bus_subr.h b/sys/dev/ofw/ofw_bus_subr.h
index be35711..bbeda7f 100644
--- a/sys/dev/ofw/ofw_bus_subr.h
+++ b/sys/dev/ofw/ofw_bus_subr.h
@@ -104,4 +104,7 @@ int ofw_bus_has_prop(device_t, const char *);
/* Helper to search for a child with a given compat prop */
phandle_t ofw_bus_find_compatible(phandle_t, const char *);
+/* Helper to search for a child with a given name */
+phandle_t ofw_bus_find_child(phandle_t, const char *);
+
#endif /* !_DEV_OFW_OFW_BUS_SUBR_H_ */
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index b4c6151..98b6b53 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -2389,7 +2389,7 @@ pci_set_powerstate_method(device_t dev, device_t child, int state)
struct pci_devinfo *dinfo = device_get_ivars(child);
pcicfgregs *cfg = &dinfo->cfg;
uint16_t status;
- int result, oldstate, highest, delay;
+ int oldstate, highest, delay;
if (cfg->pp.pp_cap == 0)
return (EOPNOTSUPP);
@@ -2424,7 +2424,6 @@ pci_set_powerstate_method(device_t dev, device_t child, int state)
delay = 0;
status = PCI_READ_CONFIG(dev, child, cfg->pp.pp_status, 2)
& ~PCIM_PSTAT_DMASK;
- result = 0;
switch (state) {
case PCI_POWERSTATE_D0:
status |= PCIM_PSTAT_D0;
@@ -2989,7 +2988,6 @@ static void
pci_ata_maps(device_t bus, device_t dev, struct resource_list *rl, int force,
uint32_t prefetchmask)
{
- struct resource *r;
int rid, type, progif;
#if 0
/* if this device supports PCI native addressing use it */
@@ -3012,11 +3010,11 @@ pci_ata_maps(device_t bus, device_t dev, struct resource_list *rl, int force,
} else {
rid = PCIR_BAR(0);
resource_list_add(rl, type, rid, 0x1f0, 0x1f7, 8);
- r = resource_list_reserve(rl, bus, dev, type, &rid, 0x1f0,
+ (void)resource_list_reserve(rl, bus, dev, type, &rid, 0x1f0,
0x1f7, 8, 0);
rid = PCIR_BAR(1);
resource_list_add(rl, type, rid, 0x3f6, 0x3f6, 1);
- r = resource_list_reserve(rl, bus, dev, type, &rid, 0x3f6,
+ (void)resource_list_reserve(rl, bus, dev, type, &rid, 0x3f6,
0x3f6, 1, 0);
}
if (progif & PCIP_STORAGE_IDE_MODESEC) {
@@ -3027,11 +3025,11 @@ pci_ata_maps(device_t bus, device_t dev, struct resource_list *rl, int force,
} else {
rid = PCIR_BAR(2);
resource_list_add(rl, type, rid, 0x170, 0x177, 8);
- r = resource_list_reserve(rl, bus, dev, type, &rid, 0x170,
+ (void)resource_list_reserve(rl, bus, dev, type, &rid, 0x170,
0x177, 8, 0);
rid = PCIR_BAR(3);
resource_list_add(rl, type, rid, 0x376, 0x376, 1);
- r = resource_list_reserve(rl, bus, dev, type, &rid, 0x376,
+ (void)resource_list_reserve(rl, bus, dev, type, &rid, 0x376,
0x376, 1, 0);
}
pci_add_map(bus, dev, PCIR_BAR(4), rl, force,
@@ -3727,7 +3725,6 @@ pci_detach(device_t dev)
static void
pci_set_power_child(device_t dev, device_t child, int state)
{
- struct pci_devinfo *dinfo;
device_t pcib;
int dstate;
@@ -3739,7 +3736,6 @@ pci_set_power_child(device_t dev, device_t child, int state)
* are handled separately.
*/
pcib = device_get_parent(dev);
- dinfo = device_get_ivars(child);
dstate = state;
if (device_is_attached(child) &&
PCIB_POWER_FOR_SLEEP(pcib, child, &dstate) == 0)
diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c
new file mode 100644
index 0000000..04dc8d3
--- /dev/null
+++ b/sys/dev/pci/pci_host_generic.c
@@ -0,0 +1,626 @@
+/*-
+ * Copyright (c) 2015 Ruslan Bukin <br@bsdpad.com>
+ * Copyright (c) 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Semihalf under
+ * the sponsorship of the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/* Generic ECAM PCIe driver */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+#include <sys/rman.h>
+#include <sys/module.h>
+#include <sys/bus.h>
+#include <sys/endian.h>
+#include <sys/cpuset.h>
+#include <sys/rwlock.h>
+#include <dev/ofw/openfirm.h>
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcib_private.h>
+#include <machine/cpu.h>
+#include <machine/bus.h>
+#include <machine/intr.h>
+#include <vm/vm_page.h>
+
+#include "pcib_if.h"
+
+/* Assembling ECAM Configuration Address */
+#define PCIE_BUS_SHIFT 20
+#define PCIE_SLOT_SHIFT 15
+#define PCIE_FUNC_SHIFT 12
+#define PCIE_BUS_MASK 0xFF
+#define PCIE_SLOT_MASK 0x1F
+#define PCIE_FUNC_MASK 0x07
+#define PCIE_REG_MASK 0xFFF
+
+#define PCIE_ADDR_OFFSET(bus, slot, func, reg) \
+ ((((bus) & PCIE_BUS_MASK) << PCIE_BUS_SHIFT) | \
+ (((slot) & PCIE_SLOT_MASK) << PCIE_SLOT_SHIFT) | \
+ (((func) & PCIE_FUNC_MASK) << PCIE_FUNC_SHIFT) | \
+ ((reg) & PCIE_REG_MASK))
+
+#define MAX_RANGES_TUPLES 5
+#define MIN_RANGES_TUPLES 2
+
+#define PCI_IO_WINDOW_OFFSET 0x1000
+#define PCI_IRQ_START 32
+#define PCI_IRQ_END (PCI_IRQ_START + 4)
+
+#define SPACE_CODE_SHIFT 24
+#define SPACE_CODE_MASK 0x3
+#define SPACE_CODE_IO_SPACE 0x1
+#define PROPS_CELL_SIZE 1
+#define PCI_ADDR_CELL_SIZE 2
+
+struct pcie_range {
+ uint64_t pci_base;
+ uint64_t phys_base;
+ uint64_t size;
+ uint64_t flags;
+#define FLAG_IO (1 << 0)
+#define FLAG_MEM (1 << 1)
+};
+
+struct generic_pcie_softc {
+ struct pcie_range ranges[MAX_RANGES_TUPLES];
+ int nranges;
+ struct rman mem_rman;
+ struct rman io_rman;
+ struct rman irq_rman;
+ struct resource *res;
+ struct resource *res1;
+ int ecam;
+ bus_space_tag_t bst;
+ bus_space_handle_t bsh;
+ device_t dev;
+ bus_space_handle_t ioh;
+};
+
+/* Forward prototypes */
+
+static int generic_pcie_probe(device_t dev);
+static int generic_pcie_attach(device_t dev);
+static int parse_pci_mem_ranges(struct generic_pcie_softc *sc);
+static uint32_t generic_pcie_read_config(device_t dev, u_int bus, u_int slot,
+ u_int func, u_int reg, int bytes);
+static void generic_pcie_write_config(device_t dev, u_int bus, u_int slot,
+ u_int func, u_int reg, uint32_t val, int bytes);
+static int generic_pcie_maxslots(device_t dev);
+static int generic_pcie_read_ivar(device_t dev, device_t child, int index,
+ uintptr_t *result);
+static int generic_pcie_write_ivar(device_t dev, device_t child, int index,
+ uintptr_t value);
+static struct resource *generic_pcie_alloc_resource(device_t dev,
+ device_t child, int type, int *rid, u_long start, u_long end,
+ u_long count, u_int flags);
+static int generic_pcie_release_resource(device_t dev, device_t child,
+ int type, int rid, struct resource *res);
+
+static int
+generic_pcie_probe(device_t dev)
+{
+
+ if (!ofw_bus_status_okay(dev))
+ return (ENXIO);
+
+ if (ofw_bus_is_compatible(dev, "pci-host-ecam-generic")) {
+ device_set_desc(dev, "Generic PCI host controller");
+ return (BUS_PROBE_DEFAULT);
+ }
+
+ return (ENXIO);
+}
+
+static int
+generic_pcie_attach(device_t dev)
+{
+ struct generic_pcie_softc *sc;
+ uint64_t phys_base;
+ uint64_t pci_base;
+ uint64_t size;
+ int error;
+ int tuple;
+ int rid;
+
+ sc = device_get_softc(dev);
+ sc->dev = dev;
+
+ rid = 0;
+ sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
+ if (sc->res == NULL) {
+ device_printf(dev, "could not map memory.\n");
+ return (ENXIO);
+ }
+
+ sc->bst = rman_get_bustag(sc->res);
+ sc->bsh = rman_get_bushandle(sc->res);
+
+ sc->mem_rman.rm_type = RMAN_ARRAY;
+ sc->mem_rman.rm_descr = "PCIe Memory";
+ sc->io_rman.rm_type = RMAN_ARRAY;
+ sc->io_rman.rm_descr = "PCIe IO window";
+
+ /* Retrieve 'ranges' property from FDT */
+ if (bootverbose)
+ device_printf(dev, "parsing FDT for ECAM%d:\n",
+ sc->ecam);
+ if (parse_pci_mem_ranges(sc))
+ return (ENXIO);
+
+ /* Initialize rman and allocate memory regions */
+ error = rman_init(&sc->mem_rman);
+ if (error) {
+ device_printf(dev, "rman_init() failed. error = %d\n", error);
+ return (error);
+ }
+
+ error = rman_init(&sc->io_rman);
+ if (error) {
+ device_printf(dev, "rman_init() failed. error = %d\n", error);
+ return (error);
+ }
+
+ for (tuple = 0; tuple < MAX_RANGES_TUPLES; tuple++) {
+ phys_base = sc->ranges[tuple].phys_base;
+ pci_base = sc->ranges[tuple].pci_base;
+ size = sc->ranges[tuple].size;
+ if (phys_base == 0 || size == 0)
+ continue; /* empty range element */
+ if (sc->ranges[tuple].flags & FLAG_MEM) {
+ error = rman_manage_region(&sc->mem_rman,
+ phys_base,
+ phys_base + size);
+ } else if (sc->ranges[tuple].flags & FLAG_IO) {
+ error = rman_manage_region(&sc->io_rman,
+ pci_base + PCI_IO_WINDOW_OFFSET,
+ pci_base + PCI_IO_WINDOW_OFFSET + size);
+ } else
+ continue;
+ if (error) {
+ device_printf(dev, "rman_manage_region() failed."
+ "error = %d\n", error);
+ rman_fini(&sc->mem_rman);
+ return (error);
+ }
+ }
+
+ /* TODO: get IRQ numbers from FDT */
+ sc->irq_rman.rm_type = RMAN_ARRAY;
+ sc->irq_rman.rm_descr = "Generic PCIe IRQs";
+ if (rman_init(&sc->irq_rman) != 0 ||
+ rman_manage_region(&sc->irq_rman, PCI_IRQ_START,
+ PCI_IRQ_END) != 0) {
+ panic("Generic PCI: failed to set up IRQ rman");
+ }
+
+ device_add_child(dev, "pci", -1);
+ return (bus_generic_attach(dev));
+}
+
+static int
+parse_pci_mem_ranges(struct generic_pcie_softc *sc)
+{
+ pcell_t pci_addr_cells, parent_addr_cells;
+ pcell_t attributes, size_cells;
+ cell_t *base_ranges;
+ int nbase_ranges;
+ phandle_t node;
+ int i, j, k;
+ int tuple;
+
+ node = ofw_bus_get_node(sc->dev);
+
+ OF_getencprop(node, "#address-cells", &pci_addr_cells,
+ sizeof(pci_addr_cells));
+ OF_getencprop(node, "#size-cells", &size_cells,
+ sizeof(size_cells));
+ OF_getencprop(OF_parent(node), "#address-cells", &parent_addr_cells,
+ sizeof(parent_addr_cells));
+
+ if (parent_addr_cells != 2 || pci_addr_cells != 3 || size_cells != 2) {
+ device_printf(sc->dev,
+ "Unexpected number of address or size cells in FDT\n");
+ return (ENXIO);
+ }
+
+ nbase_ranges = OF_getproplen(node, "ranges");
+ sc->nranges = nbase_ranges / sizeof(cell_t) /
+ (parent_addr_cells + pci_addr_cells + size_cells);
+ base_ranges = malloc(nbase_ranges, M_DEVBUF, M_WAITOK);
+ OF_getencprop(node, "ranges", base_ranges, nbase_ranges);
+
+ for (i = 0, j = 0; i < sc->nranges; i++) {
+ attributes = (base_ranges[j++] >> SPACE_CODE_SHIFT) & \
+ SPACE_CODE_MASK;
+ if (attributes == SPACE_CODE_IO_SPACE) {
+ sc->ranges[i].flags |= FLAG_IO;
+ } else {
+ sc->ranges[i].flags |= FLAG_MEM;
+ }
+
+ sc->ranges[i].pci_base = 0;
+ for (k = 0; k < (pci_addr_cells - 1); k++) {
+ sc->ranges[i].pci_base <<= 32;
+ sc->ranges[i].pci_base |= base_ranges[j++];
+ }
+ sc->ranges[i].phys_base = 0;
+ for (k = 0; k < parent_addr_cells; k++) {
+ sc->ranges[i].phys_base <<= 32;
+ sc->ranges[i].phys_base |= base_ranges[j++];
+ }
+ sc->ranges[i].size = 0;
+ for (k = 0; k < size_cells; k++) {
+ sc->ranges[i].size <<= 32;
+ sc->ranges[i].size |= base_ranges[j++];
+ }
+ }
+
+ for (; i < MAX_RANGES_TUPLES; i++) {
+ /* zero-fill remaining tuples to mark empty elements in array */
+ sc->ranges[i].pci_base = 0;
+ sc->ranges[i].phys_base = 0;
+ sc->ranges[i].size = 0;
+ }
+
+ if (bootverbose) {
+ for (tuple = 0; tuple < MAX_RANGES_TUPLES; tuple++) {
+ device_printf(sc->dev,
+ "\tPCI addr: 0x%jx, CPU addr: 0x%jx, Size: 0x%jx\n",
+ sc->ranges[tuple].pci_base,
+ sc->ranges[tuple].phys_base,
+ sc->ranges[tuple].size);
+ }
+ }
+
+ free(base_ranges, M_DEVBUF);
+ return (0);
+}
+
+static uint32_t
+generic_pcie_read_config(device_t dev, u_int bus, u_int slot,
+ u_int func, u_int reg, int bytes)
+{
+ struct generic_pcie_softc *sc;
+ bus_space_handle_t h;
+ bus_space_tag_t t;
+ uint64_t offset;
+ uint32_t data;
+
+ if (bus > 255 || slot > 31 || func > 7 || reg > 4095)
+ return (~0U);
+
+ sc = device_get_softc(dev);
+
+ offset = PCIE_ADDR_OFFSET(bus, slot, func, reg);
+ t = sc->bst;
+ h = sc->bsh;
+
+ switch (bytes) {
+ case 1:
+ data = bus_space_read_1(t, h, offset);
+ break;
+ case 2:
+ data = le16toh(bus_space_read_2(t, h, offset));
+ break;
+ case 4:
+ data = le32toh(bus_space_read_4(t, h, offset));
+ break;
+ default:
+ return (~0U);
+ }
+
+ if (reg == PCIR_INTLINE) {
+ data += PCI_IRQ_START;
+ }
+
+ return (data);
+}
+
+static void
+generic_pcie_write_config(device_t dev, u_int bus, u_int slot,
+ u_int func, u_int reg, uint32_t val, int bytes)
+{
+ struct generic_pcie_softc *sc;
+ bus_space_handle_t h;
+ bus_space_tag_t t;
+ uint64_t offset;
+
+ if (bus > 255 || slot > 31 || func > 7 || reg > 4095)
+ return;
+
+ sc = device_get_softc(dev);
+
+ offset = PCIE_ADDR_OFFSET(bus, slot, func, reg);
+
+ t = sc->bst;
+ h = sc->bsh;
+
+ switch (bytes) {
+ case 1:
+ bus_space_write_1(t, h, offset, val);
+ break;
+ case 2:
+ bus_space_write_2(t, h, offset, htole16(val));
+ break;
+ case 4:
+ bus_space_write_4(t, h, offset, htole32(val));
+ break;
+ default:
+ return;
+ }
+}
+
+static int
+generic_pcie_maxslots(device_t dev)
+{
+
+ return (31); /* max slots per bus acc. to standard */
+}
+
+static int
+generic_pcie_read_ivar(device_t dev, device_t child, int index,
+ uintptr_t *result)
+{
+ struct generic_pcie_softc *sc;
+ int secondary_bus;
+
+ sc = device_get_softc(dev);
+
+ if (index == PCIB_IVAR_BUS) {
+ /* this pcib adds only pci bus 0 as child */
+ secondary_bus = 0;
+ *result = secondary_bus;
+ return (0);
+
+ }
+
+ if (index == PCIB_IVAR_DOMAIN) {
+ *result = sc->ecam;
+ return (0);
+ }
+
+ device_printf(dev, "ERROR: Unknown index.\n");
+ return (ENOENT);
+}
+
+static int
+generic_pcie_write_ivar(device_t dev, device_t child, int index,
+ uintptr_t value)
+{
+
+ return (ENOENT);
+}
+
+static struct rman *
+generic_pcie_rman(struct generic_pcie_softc *sc, int type)
+{
+
+ switch (type) {
+ case SYS_RES_IOPORT:
+ return (&sc->io_rman);
+ case SYS_RES_MEMORY:
+ return (&sc->mem_rman);
+ case SYS_RES_IRQ:
+ return (&sc->irq_rman);
+ default:
+ break;
+ }
+
+ return (NULL);
+}
+
+static int
+generic_pcie_release_resource(device_t dev, device_t child, int type,
+ int rid, struct resource *res)
+{
+ struct generic_pcie_softc *sc;
+ struct rman *rm;
+
+ sc = device_get_softc(dev);
+
+ rm = generic_pcie_rman(sc, type);
+ if (rm != NULL) {
+ KASSERT(rman_is_region_manager(res, rm), ("rman mismatch"));
+ rman_release_resource(res);
+ }
+
+ return (bus_generic_release_resource(dev, child, type, rid, res));
+}
+
+static struct resource *
+generic_pcie_alloc_resource(device_t dev, device_t child, int type, int *rid,
+ u_long start, u_long end, u_long count, u_int flags)
+{
+ struct generic_pcie_softc *sc;
+ struct resource *res;
+ struct rman *rm;
+
+ sc = device_get_softc(dev);
+
+ rm = generic_pcie_rman(sc, type);
+ if (rm == NULL)
+ return (BUS_ALLOC_RESOURCE(device_get_parent(dev), dev,
+ type, rid, start, end, count, flags));
+
+ if (bootverbose) {
+ device_printf(dev,
+ "rman_reserve_resource: start=%#lx, end=%#lx, count=%#lx\n",
+ start, end, count);
+ }
+
+ res = rman_reserve_resource(rm, start, end, count, flags, child);
+ if (res == NULL)
+ goto fail;
+
+ rman_set_rid(res, *rid);
+
+ if (flags & RF_ACTIVE)
+ if (bus_activate_resource(child, type, *rid, res)) {
+ rman_release_resource(res);
+ goto fail;
+ }
+
+ return (res);
+
+fail:
+ if (bootverbose) {
+ device_printf(dev, "%s FAIL: type=%d, rid=%d, "
+ "start=%016lx, end=%016lx, count=%016lx, flags=%x\n",
+ __func__, type, *rid, start, end, count, flags);
+ }
+
+ return (NULL);
+}
+
+static int
+generic_pcie_adjust_resource(device_t dev, device_t child, int type,
+ struct resource *res, u_long start, u_long end)
+{
+ struct generic_pcie_softc *sc;
+ struct rman *rm;
+
+ sc = device_get_softc(dev);
+
+ rm = generic_pcie_rman(sc, type);
+ if (rm != NULL)
+ return (rman_adjust_resource(res, start, end));
+ return (bus_generic_adjust_resource(dev, child, type, res, start, end));
+}
+
+static int
+generic_pcie_activate_resource(device_t dev, device_t child, int type, int rid,
+ struct resource *r)
+{
+ struct generic_pcie_softc *sc;
+ uint64_t phys_base;
+ uint64_t pci_base;
+ uint64_t size;
+ int found;
+ int res;
+ int i;
+
+ sc = device_get_softc(dev);
+
+ if ((res = rman_activate_resource(r)) != 0)
+ return (res);
+
+ switch(type) {
+ case SYS_RES_IOPORT:
+ found = 0;
+ for (i = 0; i < MAX_RANGES_TUPLES; i++) {
+ pci_base = sc->ranges[i].pci_base;
+ phys_base = sc->ranges[i].phys_base;
+ size = sc->ranges[i].size;
+
+ if ((rid > pci_base) && (rid < (pci_base + size))) {
+ found = 1;
+ break;
+ }
+ }
+ if (found) {
+ rman_set_start(r, rman_get_start(r) + phys_base);
+ BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child,
+ type, rid, r);
+ } else {
+ device_printf(dev, "Failed to activate IOPORT resource\n");
+ res = 0;
+ }
+ break;
+ case SYS_RES_MEMORY:
+ BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child, type, rid, r);
+ break;
+ default:
+ break;
+ }
+
+ return (res);
+}
+
+static int
+generic_pcie_deactivate_resource(device_t dev, device_t child, int type, int rid,
+ struct resource *r)
+{
+ struct generic_pcie_softc *sc;
+ vm_offset_t vaddr;
+ int res;
+
+ sc = device_get_softc(dev);
+
+ if ((res = rman_deactivate_resource(r)) != 0)
+ return (res);
+
+ switch(type) {
+ case SYS_RES_IOPORT:
+ case SYS_RES_MEMORY:
+ vaddr = (vm_offset_t)rman_get_virtual(r);
+ pmap_unmapdev(vaddr, rman_get_size(r));
+ break;
+ default:
+ break;
+ }
+
+ return (res);
+}
+
+static device_method_t generic_pcie_methods[] = {
+ DEVMETHOD(device_probe, generic_pcie_probe),
+ DEVMETHOD(device_attach, generic_pcie_attach),
+ DEVMETHOD(bus_read_ivar, generic_pcie_read_ivar),
+ DEVMETHOD(bus_write_ivar, generic_pcie_write_ivar),
+ DEVMETHOD(bus_alloc_resource, generic_pcie_alloc_resource),
+ DEVMETHOD(bus_adjust_resource, generic_pcie_adjust_resource),
+ DEVMETHOD(bus_release_resource, generic_pcie_release_resource),
+ DEVMETHOD(bus_activate_resource, generic_pcie_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, generic_pcie_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+ DEVMETHOD(pcib_maxslots, generic_pcie_maxslots),
+ DEVMETHOD(pcib_read_config, generic_pcie_read_config),
+ DEVMETHOD(pcib_write_config, generic_pcie_write_config),
+ DEVMETHOD_END
+};
+
+static driver_t generic_pcie_driver = {
+ "pcib",
+ generic_pcie_methods,
+ sizeof(struct generic_pcie_softc),
+};
+
+static devclass_t generic_pcie_devclass;
+
+DRIVER_MODULE(pcib, simplebus, generic_pcie_driver,
+generic_pcie_devclass, 0, 0);
+DRIVER_MODULE(pcib, ofwbus, generic_pcie_driver,
+generic_pcie_devclass, 0, 0);
diff --git a/sys/dev/pci/pci_if.m b/sys/dev/pci/pci_if.m
index 9f97d9a..aeeff2c 100644
--- a/sys/dev/pci/pci_if.m
+++ b/sys/dev/pci/pci_if.m
@@ -214,22 +214,6 @@ METHOD int iov_detach {
device_t child;
};
-METHOD int init_iov {
- device_t dev;
- uint16_t num_vfs;
- const struct nvlist *config;
-};
-
-METHOD void uninit_iov {
- device_t dev;
-};
-
-METHOD int add_vf {
- device_t dev;
- uint16_t vfnum;
- const struct nvlist *config;
-};
-
METHOD device_t create_iov_child {
device_t bus;
device_t pf;
@@ -237,4 +221,3 @@ METHOD device_t create_iov_child {
uint16_t vid;
uint16_t did;
} DEFAULT null_create_iov_child;
-
diff --git a/sys/dev/pci/pci_iov.c b/sys/dev/pci/pci_iov.c
index 4672e55..58e6926 100644
--- a/sys/dev/pci/pci_iov.c
+++ b/sys/dev/pci/pci_iov.c
@@ -53,11 +53,11 @@ __FBSDID("$FreeBSD$");
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
+#include <dev/pci/pci_iov.h>
#include <dev/pci/pci_private.h>
#include <dev/pci/pci_iov_private.h>
#include <dev/pci/schema_private.h>
-#include "pci_if.h"
#include "pcib_if.h"
static MALLOC_DEFINE(M_SRIOV, "sr_iov", "PCI SR-IOV allocations");
@@ -483,13 +483,13 @@ pci_iov_config_page_size(struct pci_devinfo *dinfo)
}
static int
-pci_init_iov(device_t dev, uint16_t num_vfs, const nvlist_t *config)
+pci_iov_init(device_t dev, uint16_t num_vfs, const nvlist_t *config)
{
const nvlist_t *device, *driver_config;
device = nvlist_get_nvlist(config, PF_CONFIG_NAME);
driver_config = nvlist_get_nvlist(device, DRIVER_CONFIG_NAME);
- return (PCI_INIT_IOV(dev, num_vfs, driver_config));
+ return (PCI_IOV_INIT(dev, num_vfs, driver_config));
}
static int
@@ -595,7 +595,7 @@ pci_iov_enumerate_vfs(struct pci_devinfo *dinfo, const nvlist_t *config,
pci_iov_add_bars(iov, vfinfo);
- error = PCI_ADD_VF(dev, i, driver_config);
+ error = PCI_IOV_ADD_VF(dev, i, driver_config);
if (error != 0) {
device_printf(dev, "Failed to add VF %d\n", i);
pci_delete_child(bus, vf);
@@ -652,7 +652,7 @@ pci_iov_config(struct cdev *cdev, struct pci_iov_arg *arg)
if (error != 0)
goto out;
- error = pci_init_iov(dev, num_vfs, config);
+ error = pci_iov_init(dev, num_vfs, config);
if (error != 0)
goto out;
iov_inited = 1;
@@ -700,7 +700,7 @@ pci_iov_config(struct cdev *cdev, struct pci_iov_arg *arg)
return (0);
out:
if (iov_inited)
- PCI_UNINIT_IOV(dev);
+ PCI_IOV_UNINIT(dev);
for (i = 0; i <= PCIR_MAX_BAR_0; i++) {
if (iov->iov_bar[i].res != NULL) {
@@ -793,7 +793,7 @@ pci_iov_delete(struct cdev *cdev)
if (pci_iov_is_child_vf(iov, vf))
pci_delete_child(bus, vf);
}
- PCI_UNINIT_IOV(dev);
+ PCI_IOV_UNINIT(dev);
iov_ctl = IOV_READ(dinfo, PCIR_SRIOV_CTL, 2);
iov_ctl &= ~(PCIM_SRIOV_VF_EN | PCIM_SRIOV_VF_MSE);
diff --git a/usr.bin/csup/auth.h b/sys/dev/pci/pci_iov.h
index 61052e3..fd2f8fb 100644
--- a/usr.bin/csup/auth.h
+++ b/sys/dev/pci/pci_iov.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2003-2007, Petar Zhivkov Petrov <pesho.petrov@gmail.com>
+ * Copyright (c) 2013-2015 Sandvine Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,14 +25,25 @@
*
* $FreeBSD$
*/
-#ifndef _AUTH_H_
-#define _AUTH_H_
-#define AUTHFILE ".csup/auth" /* user home relative */
+#ifndef _PCI_IOV_H_
+#define _PCI_IOV_H_
-struct config;
+#include "pci_iov_if.h"
-int auth_login(struct config *);
+struct nvlist;
-#endif /* !_AUTH_H_ */
+static __inline int
+pci_iov_attach(device_t dev, struct nvlist *pf_schema, struct nvlist *vf_schema)
+{
+ return (PCI_IOV_ATTACH(device_get_parent(dev), dev, pf_schema,
+ vf_schema));
+}
+static __inline int
+pci_iov_detach(device_t dev)
+{
+ return (PCI_IOV_DETACH(device_get_parent(dev), dev));
+}
+
+#endif /* !_PCI_IOV_H_ */
diff --git a/usr.bin/atf/Makefile b/sys/dev/pci/pci_iov_if.m
index 054cdf2..3b6796b 100644
--- a/usr.bin/atf/Makefile
+++ b/sys/dev/pci/pci_iov_if.m
@@ -1,5 +1,5 @@
#-
-# Copyright (c) 2011 Google, Inc.
+# Copyright (c) 2013-2015 Sandvine Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,29 @@
# SUCH DAMAGE.
#
# $FreeBSD$
+#
+
+#include <sys/bus.h>
+
+INTERFACE pci_iov;
+
+HEADER {
+ struct nvlist;
+}
+
+
+METHOD int init {
+ device_t dev;
+ uint16_t num_vfs;
+ const struct nvlist *config;
+};
-SUBDIR= atf-sh tests
+METHOD void uninit {
+ device_t dev;
+};
-.include <bsd.subdir.mk>
+METHOD int add_vf {
+ device_t dev;
+ uint16_t vfnum;
+ const struct nvlist *config;
+};
diff --git a/sys/dev/pci/pcivar.h b/sys/dev/pci/pcivar.h
index 2fd76b6..7f2e958 100644
--- a/sys/dev/pci/pcivar.h
+++ b/sys/dev/pci/pcivar.h
@@ -39,8 +39,6 @@
typedef uint64_t pci_addr_t;
-struct nvlist;
-
/* Config registers for PCI-PCI and PCI-Cardbus bridges. */
struct pcicfg_bridge {
uint8_t br_seclat;
@@ -536,19 +534,6 @@ pci_child_added(device_t dev)
return (PCI_CHILD_ADDED(device_get_parent(dev), dev));
}
-static __inline int
-pci_iov_attach(device_t dev, struct nvlist *pf_schema, struct nvlist *vf_schema)
-{
- return (PCI_IOV_ATTACH(device_get_parent(dev), dev, pf_schema,
- vf_schema));
-}
-
-static __inline int
-pci_iov_detach(device_t dev)
-{
- return (PCI_IOV_DETACH(device_get_parent(dev), dev));
-}
-
device_t pci_find_bsf(uint8_t, uint8_t, uint8_t);
device_t pci_find_dbsf(uint32_t, uint8_t, uint8_t, uint8_t);
device_t pci_find_device(uint16_t, uint16_t);
diff --git a/sys/dev/pci/vga_pci.c b/sys/dev/pci/vga_pci.c
index 65332c3..0c49ca0 100644
--- a/sys/dev/pci/vga_pci.c
+++ b/sys/dev/pci/vga_pci.c
@@ -126,6 +126,13 @@ vga_pci_is_boot_display(device_t dev)
if ((config & (PCIM_CMD_PORTEN | PCIM_CMD_MEMEN)) == 0)
return (0);
+ /*
+ * Disable interrupts until a chipset driver is loaded for
+ * this PCI device. Else unhandled display adapter interrupts
+ * might freeze the CPU.
+ */
+ pci_write_config(dev, PCIR_COMMAND, config | PCIM_CMD_INTxDIS, 2);
+
/* This video card is the boot display: record its unit number. */
vga_pci_default_unit = unit;
device_set_flags(dev, 1);
diff --git a/sys/dev/proto/proto.h b/sys/dev/proto/proto.h
index db61da5..690d71f 100644
--- a/sys/dev/proto/proto.h
+++ b/sys/dev/proto/proto.h
@@ -33,11 +33,15 @@
#define PROTO_RES_UNUSED 0
#define PROTO_RES_PCICFG 10
+#define PROTO_RES_BUSDMA 11
struct proto_res {
int r_type;
int r_rid;
- struct resource *r_res;
+ union {
+ struct resource *res;
+ void *busdma;
+ } r_d;
u_long r_size;
union {
void *cookie;
diff --git a/sys/dev/proto/proto_bus_pci.c b/sys/dev/proto/proto_bus_pci.c
index 012469a..53ebb5e 100644
--- a/sys/dev/proto/proto_bus_pci.c
+++ b/sys/dev/proto/proto_bus_pci.c
@@ -82,23 +82,27 @@ proto_pci_attach(device_t dev)
{
struct proto_softc *sc;
struct resource *res;
+ uint32_t val;
int bar, rid, type;
sc = device_get_softc(dev);
proto_add_resource(sc, PROTO_RES_PCICFG, 0, NULL);
+ proto_add_resource(sc, PROTO_RES_BUSDMA, 0, NULL);
for (bar = 0; bar < PCIR_MAX_BAR_0; bar++) {
rid = PCIR_BAR(bar);
- type = SYS_RES_MEMORY;
+ val = pci_read_config(dev, rid, 4);
+ type = (PCI_BAR_IO(val)) ? SYS_RES_IOPORT : SYS_RES_MEMORY;
res = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE);
- if (res == NULL) {
- type = SYS_RES_IOPORT;
- res = bus_alloc_resource_any(dev, type, &rid,
- RF_ACTIVE);
- }
- if (res != NULL)
- proto_add_resource(sc, type, rid, res);
+ if (res == NULL)
+ continue;
+ proto_add_resource(sc, type, rid, res);
+ if (type == SYS_RES_IOPORT)
+ continue;
+ /* Skip over adjacent BAR for 64-bit memory BARs. */
+ if ((val & PCIM_BAR_MEM_TYPE) == PCIM_BAR_MEM_64)
+ bar++;
}
rid = 0;
diff --git a/sys/dev/proto/proto_busdma.c b/sys/dev/proto/proto_busdma.c
new file mode 100644
index 0000000..e01e76f
--- /dev/null
+++ b/sys/dev/proto/proto_busdma.c
@@ -0,0 +1,301 @@
+/*-
+ * Copyright (c) 2015 Marcel Moolenaar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <machine/bus.h>
+#include <machine/bus_dma.h>
+#include <machine/resource.h>
+#include <sys/bus.h>
+#include <sys/conf.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/queue.h>
+#include <sys/rman.h>
+#include <sys/sbuf.h>
+#include <vm/vm.h>
+#include <vm/pmap.h>
+
+#include <dev/proto/proto.h>
+#include <dev/proto/proto_dev.h>
+#include <dev/proto/proto_busdma.h>
+
+MALLOC_DEFINE(M_PROTO_BUSDMA, "proto_busdma", "DMA management data");
+
+static int
+proto_busdma_tag_create(struct proto_busdma *busdma, struct proto_tag *parent,
+ struct proto_ioc_busdma *ioc)
+{
+ struct proto_tag *tag;
+
+ /*
+ * If nsegs is 1, ignore maxsegsz. What this means is that if we have
+ * just 1 segment, then maxsz should be equal to maxsegsz. To keep it
+ * simple for us, limit maxsegsz to maxsz in any case.
+ */
+ if (ioc->u.tag.maxsegsz > ioc->u.tag.maxsz || ioc->u.tag.nsegs == 1)
+ ioc->u.tag.maxsegsz = ioc->u.tag.maxsz;
+
+ /* A bndry of 0 really means ~0, or no boundary. */
+ if (ioc->u.tag.bndry == 0)
+ ioc->u.tag.bndry = ~0U;
+
+ tag = malloc(sizeof(*tag), M_PROTO_BUSDMA, M_WAITOK | M_ZERO);
+ if (parent != NULL) {
+ tag->parent = parent;
+ LIST_INSERT_HEAD(&parent->children, tag, peers);
+ tag->align = MAX(ioc->u.tag.align, parent->align);
+ tag->bndry = MIN(ioc->u.tag.bndry, parent->bndry);
+ tag->maxaddr = MIN(ioc->u.tag.maxaddr, parent->maxaddr);
+ tag->maxsz = MIN(ioc->u.tag.maxsz, parent->maxsz);
+ tag->maxsegsz = MIN(ioc->u.tag.maxsegsz, parent->maxsegsz);
+ tag->nsegs = MIN(ioc->u.tag.nsegs, parent->nsegs);
+ tag->datarate = MIN(ioc->u.tag.datarate, parent->datarate);
+ /* Write constraints back */
+ ioc->u.tag.align = tag->align;
+ ioc->u.tag.bndry = tag->bndry;
+ ioc->u.tag.maxaddr = tag->maxaddr;
+ ioc->u.tag.maxsz = tag->maxsz;
+ ioc->u.tag.maxsegsz = tag->maxsegsz;
+ ioc->u.tag.nsegs = tag->nsegs;
+ ioc->u.tag.datarate = tag->datarate;
+ } else {
+ tag->align = ioc->u.tag.align;
+ tag->bndry = ioc->u.tag.bndry;
+ tag->maxaddr = ioc->u.tag.maxaddr;
+ tag->maxsz = ioc->u.tag.maxsz;
+ tag->maxsegsz = ioc->u.tag.maxsegsz;
+ tag->nsegs = ioc->u.tag.nsegs;
+ tag->datarate = ioc->u.tag.datarate;
+ }
+ LIST_INSERT_HEAD(&busdma->tags, tag, tags);
+ ioc->result = (uintptr_t)(void *)tag;
+ return (0);
+}
+
+static int
+proto_busdma_tag_destroy(struct proto_busdma *busdma, struct proto_tag *tag)
+{
+
+ if (!LIST_EMPTY(&tag->mds))
+ return (EBUSY);
+ if (!LIST_EMPTY(&tag->children))
+ return (EBUSY);
+
+ if (tag->parent != NULL) {
+ LIST_REMOVE(tag, peers);
+ tag->parent = NULL;
+ }
+ LIST_REMOVE(tag, tags);
+ free(tag, M_PROTO_BUSDMA);
+ return (0);
+}
+
+static struct proto_tag *
+proto_busdma_tag_lookup(struct proto_busdma *busdma, u_long key)
+{
+ struct proto_tag *tag;
+
+ LIST_FOREACH(tag, &busdma->tags, tags) {
+ if ((void *)tag == (void *)key)
+ return (tag);
+ }
+ return (NULL);
+}
+
+static void
+proto_busdma_mem_alloc_callback(void *arg, bus_dma_segment_t *segs, int nseg,
+ int error)
+{
+ struct proto_ioc_busdma *ioc = arg;
+
+ ioc->u.mem.bus_nsegs = nseg;
+ ioc->u.mem.bus_addr = segs[0].ds_addr;
+}
+
+static int
+proto_busdma_mem_alloc(struct proto_busdma *busdma, struct proto_tag *tag,
+ struct proto_ioc_busdma *ioc)
+{
+ struct proto_md *md;
+ int error;
+
+ md = malloc(sizeof(*md), M_PROTO_BUSDMA, M_WAITOK | M_ZERO);
+ md->tag = tag;
+
+ error = bus_dma_tag_create(busdma->bd_roottag, tag->align, tag->bndry,
+ tag->maxaddr, BUS_SPACE_MAXADDR, NULL, NULL, tag->maxsz,
+ tag->nsegs, tag->maxsegsz, 0, NULL, NULL, &md->bd_tag);
+ if (error) {
+ free(md, M_PROTO_BUSDMA);
+ return (error);
+ }
+ error = bus_dmamem_alloc(md->bd_tag, &md->virtaddr, 0, &md->bd_map);
+ if (error) {
+ bus_dma_tag_destroy(md->bd_tag);
+ free(md, M_PROTO_BUSDMA);
+ return (error);
+ }
+ md->physaddr = pmap_kextract((uintptr_t)(md->virtaddr));
+ error = bus_dmamap_load(md->bd_tag, md->bd_map, md->virtaddr,
+ tag->maxsz, proto_busdma_mem_alloc_callback, ioc, BUS_DMA_NOWAIT);
+ if (error) {
+ bus_dmamem_free(md->bd_tag, md->virtaddr, md->bd_map);
+ bus_dma_tag_destroy(md->bd_tag);
+ free(md, M_PROTO_BUSDMA);
+ return (error);
+ }
+ LIST_INSERT_HEAD(&tag->mds, md, peers);
+ LIST_INSERT_HEAD(&busdma->mds, md, mds);
+ ioc->u.mem.phys_nsegs = 1;
+ ioc->u.mem.phys_addr = md->physaddr;
+ ioc->result = (uintptr_t)(void *)md;
+ return (0);
+}
+
+static int
+proto_busdma_mem_free(struct proto_busdma *busdma, struct proto_md *md)
+{
+
+ LIST_REMOVE(md, mds);
+ LIST_REMOVE(md, peers);
+ bus_dmamem_free(md->bd_tag, md->virtaddr, md->bd_map);
+ bus_dma_tag_destroy(md->bd_tag);
+ free(md, M_PROTO_BUSDMA);
+ return (0);
+}
+
+static struct proto_md *
+proto_busdma_md_lookup(struct proto_busdma *busdma, u_long key)
+{
+ struct proto_md *md;
+
+ LIST_FOREACH(md, &busdma->mds, mds) {
+ if ((void *)md == (void *)key)
+ return (md);
+ }
+ return (NULL);
+}
+
+struct proto_busdma *
+proto_busdma_attach(struct proto_softc *sc)
+{
+ struct proto_busdma *busdma;
+
+ busdma = malloc(sizeof(*busdma), M_PROTO_BUSDMA, M_WAITOK | M_ZERO);
+ return (busdma);
+}
+
+int
+proto_busdma_detach(struct proto_softc *sc, struct proto_busdma *busdma)
+{
+
+ proto_busdma_cleanup(sc, busdma);
+ free(busdma, M_PROTO_BUSDMA);
+ return (0);
+}
+
+int
+proto_busdma_cleanup(struct proto_softc *sc, struct proto_busdma *busdma)
+{
+ struct proto_md *md, *md1;
+ struct proto_tag *tag, *tag1;
+
+ LIST_FOREACH_SAFE(md, &busdma->mds, mds, md1)
+ proto_busdma_mem_free(busdma, md);
+ LIST_FOREACH_SAFE(tag, &busdma->tags, tags, tag1)
+ proto_busdma_tag_destroy(busdma, tag);
+ return (0);
+}
+
+int
+proto_busdma_ioctl(struct proto_softc *sc, struct proto_busdma *busdma,
+ struct proto_ioc_busdma *ioc)
+{
+ struct proto_tag *tag;
+ struct proto_md *md;
+ int error;
+
+ error = 0;
+ switch (ioc->request) {
+ case PROTO_IOC_BUSDMA_TAG_CREATE:
+ busdma->bd_roottag = bus_get_dma_tag(sc->sc_dev);
+ error = proto_busdma_tag_create(busdma, NULL, ioc);
+ break;
+ case PROTO_IOC_BUSDMA_TAG_DERIVE:
+ tag = proto_busdma_tag_lookup(busdma, ioc->key);
+ if (tag == NULL) {
+ error = EINVAL;
+ break;
+ }
+ error = proto_busdma_tag_create(busdma, tag, ioc);
+ break;
+ case PROTO_IOC_BUSDMA_TAG_DESTROY:
+ tag = proto_busdma_tag_lookup(busdma, ioc->key);
+ if (tag == NULL) {
+ error = EINVAL;
+ break;
+ }
+ error = proto_busdma_tag_destroy(busdma, tag);
+ break;
+ case PROTO_IOC_BUSDMA_MEM_ALLOC:
+ tag = proto_busdma_tag_lookup(busdma, ioc->u.mem.tag);
+ if (tag == NULL) {
+ error = EINVAL;
+ break;
+ }
+ error = proto_busdma_mem_alloc(busdma, tag, ioc);
+ break;
+ case PROTO_IOC_BUSDMA_MEM_FREE:
+ md = proto_busdma_md_lookup(busdma, ioc->key);
+ if (md == NULL) {
+ error = EINVAL;
+ break;
+ }
+ error = proto_busdma_mem_free(busdma, md);
+ break;
+ default:
+ error = EINVAL;
+ break;
+ }
+ return (error);
+}
+
+int
+proto_busdma_mmap_allowed(struct proto_busdma *busdma, vm_paddr_t physaddr)
+{
+ struct proto_md *md;
+
+ LIST_FOREACH(md, &busdma->mds, mds) {
+ if (physaddr >= trunc_page(md->physaddr) &&
+ physaddr <= trunc_page(md->physaddr + md->tag->maxsz))
+ return (1);
+ }
+ return (0);
+}
diff --git a/sys/dev/proto/proto_busdma.h b/sys/dev/proto/proto_busdma.h
new file mode 100644
index 0000000..b4957f5
--- /dev/null
+++ b/sys/dev/proto/proto_busdma.h
@@ -0,0 +1,75 @@
+/*-
+ * Copyright (c) 2015 Marcel Moolenaar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _DEV_PROTO_BUSDMA_H_
+#define _DEV_PROTO_BUSDMA_H_
+
+struct proto_md;
+
+struct proto_tag {
+ LIST_ENTRY(proto_tag) tags;
+ struct proto_tag *parent;
+ LIST_ENTRY(proto_tag) peers;
+ LIST_HEAD(,proto_tag) children;
+ LIST_HEAD(,proto_md) mds;
+ bus_addr_t align;
+ bus_addr_t bndry;
+ bus_addr_t maxaddr;
+ bus_size_t maxsz;
+ bus_size_t maxsegsz;
+ u_int nsegs;
+ u_int datarate;
+};
+
+struct proto_md {
+ LIST_ENTRY(proto_md) mds;
+ LIST_ENTRY(proto_md) peers;
+ struct proto_tag *tag;
+ void *virtaddr;
+ vm_paddr_t physaddr;
+ bus_dma_tag_t bd_tag;
+ bus_dmamap_t bd_map;
+};
+
+struct proto_busdma {
+ LIST_HEAD(,proto_tag) tags;
+ LIST_HEAD(,proto_md) mds;
+ bus_dma_tag_t bd_roottag;
+};
+
+struct proto_busdma *proto_busdma_attach(struct proto_softc *);
+int proto_busdma_detach(struct proto_softc *, struct proto_busdma *);
+
+int proto_busdma_cleanup(struct proto_softc *, struct proto_busdma *);
+
+int proto_busdma_ioctl(struct proto_softc *, struct proto_busdma *,
+ struct proto_ioc_busdma *);
+
+int proto_busdma_mmap_allowed(struct proto_busdma *, vm_paddr_t);
+
+#endif /* _DEV_PROTO_BUSDMA_H_ */
diff --git a/sys/dev/proto/proto_core.c b/sys/dev/proto/proto_core.c
index 5ea0a6c..86f08eb 100644
--- a/sys/dev/proto/proto_core.c
+++ b/sys/dev/proto/proto_core.c
@@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
#include <dev/proto/proto.h>
#include <dev/proto/proto_dev.h>
+#include <dev/proto/proto_busdma.h>
CTASSERT(SYS_RES_IRQ != PROTO_RES_UNUSED &&
SYS_RES_MEMORY != PROTO_RES_UNUSED &&
@@ -58,6 +59,9 @@ CTASSERT(SYS_RES_IRQ != PROTO_RES_UNUSED &&
CTASSERT(SYS_RES_IRQ != PROTO_RES_PCICFG &&
SYS_RES_MEMORY != PROTO_RES_PCICFG &&
SYS_RES_IOPORT != PROTO_RES_PCICFG);
+CTASSERT(SYS_RES_IRQ != PROTO_RES_BUSDMA &&
+ SYS_RES_MEMORY != PROTO_RES_BUSDMA &&
+ SYS_RES_IOPORT != PROTO_RES_BUSDMA);
devclass_t proto_devclass;
char proto_driver_name[] = "proto";
@@ -97,7 +101,7 @@ proto_add_resource(struct proto_softc *sc, int type, int rid,
r = sc->sc_res + sc->sc_rescnt++;
r->r_type = type;
r->r_rid = rid;
- r->r_res = res;
+ r->r_d.res = res;
return (0);
}
@@ -130,7 +134,7 @@ proto_attach(device_t dev)
break;
case SYS_RES_MEMORY:
case SYS_RES_IOPORT:
- r->r_size = rman_get_size(r->r_res);
+ r->r_size = rman_get_size(r->r_d.res);
r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0666,
"proto/%s/%02x.%s", device_get_desc(dev), r->r_rid,
(r->r_type == SYS_RES_IOPORT) ? "io" : "mem");
@@ -144,6 +148,14 @@ proto_attach(device_t dev)
r->r_u.cdev->si_drv1 = sc;
r->r_u.cdev->si_drv2 = r;
break;
+ case PROTO_RES_BUSDMA:
+ r->r_d.busdma = proto_busdma_attach(sc);
+ r->r_size = 0; /* no read(2) nor write(2) */
+ r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0666,
+ "proto/%s/busdma", device_get_desc(dev));
+ r->r_u.cdev->si_drv1 = sc;
+ r->r_u.cdev->si_drv2 = r;
+ break;
}
}
return (0);
@@ -158,7 +170,7 @@ proto_detach(device_t dev)
sc = device_get_softc(dev);
- /* Don't detach if we have open device filess. */
+ /* Don't detach if we have open device files. */
for (res = 0; res < sc->sc_rescnt; res++) {
r = sc->sc_res + res;
if (r->r_opened)
@@ -170,17 +182,22 @@ proto_detach(device_t dev)
switch (r->r_type) {
case SYS_RES_IRQ:
/* XXX TODO */
+ bus_release_resource(dev, r->r_type, r->r_rid,
+ r->r_d.res);
break;
case SYS_RES_MEMORY:
case SYS_RES_IOPORT:
+ bus_release_resource(dev, r->r_type, r->r_rid,
+ r->r_d.res);
+ destroy_dev(r->r_u.cdev);
+ break;
case PROTO_RES_PCICFG:
destroy_dev(r->r_u.cdev);
break;
- }
- if (r->r_res != NULL) {
- bus_release_resource(dev, r->r_type, r->r_rid,
- r->r_res);
- r->r_res = NULL;
+ case PROTO_RES_BUSDMA:
+ proto_busdma_detach(sc, r->r_d.busdma);
+ destroy_dev(r->r_u.cdev);
+ break;
}
r->r_type = PROTO_RES_UNUSED;
}
@@ -207,10 +224,14 @@ static int
proto_close(struct cdev *cdev, int fflag, int devtype, struct thread *td)
{
struct proto_res *r;
+ struct proto_softc *sc;
+ sc = cdev->si_drv1;
r = cdev->si_drv2;
if (!atomic_cmpset_acq_ptr(&r->r_opened, (uintptr_t)td->td_proc, 0UL))
return (ENXIO);
+ if (r->r_type == PROTO_RES_BUSDMA)
+ proto_busdma_cleanup(sc, r->r_d.busdma);
return (0);
}
@@ -244,21 +265,21 @@ proto_read(struct cdev *cdev, struct uio *uio, int ioflag)
switch (width) {
case 1:
buf.x1[0] = (r->r_type == PROTO_RES_PCICFG) ?
- pci_read_config(dev, ofs, 1) : bus_read_1(r->r_res, ofs);
+ pci_read_config(dev, ofs, 1) : bus_read_1(r->r_d.res, ofs);
break;
case 2:
buf.x2[0] = (r->r_type == PROTO_RES_PCICFG) ?
- pci_read_config(dev, ofs, 2) : bus_read_2(r->r_res, ofs);
+ pci_read_config(dev, ofs, 2) : bus_read_2(r->r_d.res, ofs);
break;
case 4:
buf.x4[0] = (r->r_type == PROTO_RES_PCICFG) ?
- pci_read_config(dev, ofs, 4) : bus_read_4(r->r_res, ofs);
+ pci_read_config(dev, ofs, 4) : bus_read_4(r->r_d.res, ofs);
break;
#ifndef __i386__
case 8:
if (r->r_type == PROTO_RES_PCICFG)
return (EINVAL);
- buf.x8[0] = bus_read_8(r->r_res, ofs);
+ buf.x8[0] = bus_read_8(r->r_d.res, ofs);
break;
#endif
default:
@@ -305,25 +326,25 @@ proto_write(struct cdev *cdev, struct uio *uio, int ioflag)
if (r->r_type == PROTO_RES_PCICFG)
pci_write_config(dev, ofs, buf.x1[0], 1);
else
- bus_write_1(r->r_res, ofs, buf.x1[0]);
+ bus_write_1(r->r_d.res, ofs, buf.x1[0]);
break;
case 2:
if (r->r_type == PROTO_RES_PCICFG)
pci_write_config(dev, ofs, buf.x2[0], 2);
else
- bus_write_2(r->r_res, ofs, buf.x2[0]);
+ bus_write_2(r->r_d.res, ofs, buf.x2[0]);
break;
case 4:
if (r->r_type == PROTO_RES_PCICFG)
pci_write_config(dev, ofs, buf.x4[0], 4);
else
- bus_write_4(r->r_res, ofs, buf.x4[0]);
+ bus_write_4(r->r_d.res, ofs, buf.x4[0]);
break;
#ifndef __i386__
case 8:
if (r->r_type == PROTO_RES_PCICFG)
return (EINVAL);
- bus_write_8(r->r_res, ofs, buf.x8[0]);
+ bus_write_8(r->r_d.res, ofs, buf.x8[0]);
break;
#endif
default:
@@ -338,20 +359,35 @@ proto_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag,
struct thread *td)
{
struct proto_ioc_region *region;
+ struct proto_ioc_busdma *busdma;
struct proto_res *r;
+ struct proto_softc *sc;
int error;
+ sc = cdev->si_drv1;
r = cdev->si_drv2;
error = 0;
switch (cmd) {
case PROTO_IOC_REGION:
+ if (r->r_type == PROTO_RES_BUSDMA) {
+ error = EINVAL;
+ break;
+ }
region = (struct proto_ioc_region *)data;
region->size = r->r_size;
if (r->r_type == PROTO_RES_PCICFG)
region->address = 0;
else
- region->address = rman_get_start(r->r_res);
+ region->address = rman_get_start(r->r_d.res);
+ break;
+ case PROTO_IOC_BUSDMA:
+ if (r->r_type != PROTO_RES_BUSDMA) {
+ error = EINVAL;
+ break;
+ }
+ busdma = (struct proto_ioc_busdma *)data;
+ error = proto_busdma_ioctl(sc, r->r_d.busdma, busdma);
break;
default:
error = ENOIOCTL;
@@ -366,19 +402,29 @@ proto_mmap(struct cdev *cdev, vm_ooffset_t offset, vm_paddr_t *paddr,
{
struct proto_res *r;
- r = cdev->si_drv2;
-
- if (r->r_type != SYS_RES_MEMORY)
- return (ENXIO);
if (offset & PAGE_MASK)
return (EINVAL);
if (prot & PROT_EXEC)
return (EACCES);
- if (offset >= r->r_size)
- return (EINVAL);
- *paddr = rman_get_start(r->r_res) + offset;
+
+ r = cdev->si_drv2;
+
+ switch (r->r_type) {
+ case SYS_RES_MEMORY:
+ if (offset >= r->r_size)
+ return (EINVAL);
+ *paddr = rman_get_start(r->r_d.res) + offset;
#ifndef __sparc64__
- *memattr = VM_MEMATTR_UNCACHEABLE;
+ *memattr = VM_MEMATTR_UNCACHEABLE;
#endif
+ break;
+ case PROTO_RES_BUSDMA:
+ if (!proto_busdma_mmap_allowed(r->r_d.busdma, offset))
+ return (EINVAL);
+ *paddr = offset;
+ break;
+ default:
+ return (ENXIO);
+ }
return (0);
}
diff --git a/sys/dev/proto/proto_dev.h b/sys/dev/proto/proto_dev.h
index 0ea3749..88a61a7 100644
--- a/sys/dev/proto/proto_dev.h
+++ b/sys/dev/proto/proto_dev.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014 Marcel Moolenaar
+ * Copyright (c) 2014, 2015 Marcel Moolenaar
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -40,4 +40,37 @@ struct proto_ioc_region {
#define PROTO_IOC_REGION _IOWR(PROTO_IOC_CLASS, 1, struct proto_ioc_region)
+struct proto_ioc_busdma {
+ unsigned int request;
+#define PROTO_IOC_BUSDMA_TAG_CREATE 1
+#define PROTO_IOC_BUSDMA_TAG_DERIVE 2
+#define PROTO_IOC_BUSDMA_TAG_DESTROY 3
+#define PROTO_IOC_BUSDMA_MEM_ALLOC 10
+#define PROTO_IOC_BUSDMA_MEM_FREE 11
+ unsigned long key;
+ union {
+ struct {
+ unsigned long align;
+ unsigned long bndry;
+ unsigned long maxaddr;
+ unsigned long maxsz;
+ unsigned long maxsegsz;
+ unsigned int nsegs;
+ unsigned int datarate;
+ unsigned int flags;
+ } tag;
+ struct {
+ unsigned long tag;
+ unsigned int flags;
+ unsigned int phys_nsegs;
+ unsigned long phys_addr;
+ unsigned long bus_addr;
+ unsigned int bus_nsegs;
+ } mem;
+ } u;
+ unsigned long result;
+};
+
+#define PROTO_IOC_BUSDMA _IOWR(PROTO_IOC_CLASS, 2, struct proto_ioc_busdma)
+
#endif /* _DEV_PROTO_H_ */
diff --git a/sys/dev/psci/psci.c b/sys/dev/psci/psci.c
index 67f700a..4554fa6 100644
--- a/sys/dev/psci/psci.c
+++ b/sys/dev/psci/psci.c
@@ -102,6 +102,24 @@ EARLY_DRIVER_MODULE(psci, simplebus, psci_driver, psci_devclass, 0, 0,
EARLY_DRIVER_MODULE(psci, ofwbus, psci_driver, psci_devclass, 0, 0,
BUS_PASS_CPU + BUS_PASS_ORDER_FIRST);
+static psci_callfn_t
+psci_get_callfn(phandle_t node)
+{
+ char method[16];
+
+ if ((OF_getprop(node, "method", method, sizeof(method))) > 0) {
+ if (strcmp(method, "hvc") == 0)
+ return (psci_hvc_despatch);
+ else if (strcmp(method, "smc") == 0)
+ return (psci_smc_despatch);
+ else
+ printf("psci: PSCI conduit \"%s\" invalid\n", method);
+ } else
+ printf("psci: PSCI conduit not supplied in the device tree\n");
+
+ return (NULL);
+}
+
static int
psci_probe(device_t dev)
{
@@ -126,7 +144,6 @@ psci_attach(device_t dev)
const struct ofw_compat_data *ocd;
psci_initfn_t psci_init;
phandle_t node;
- char method[16];
if (psci_softc != NULL)
return (ENXIO);
@@ -136,22 +153,9 @@ psci_attach(device_t dev)
KASSERT(psci_init != NULL, ("PSCI init function cannot be NULL"));
node = ofw_bus_get_node(dev);
- if ((OF_getprop(node, "method", method, sizeof(method))) > 0) {
- if (strcmp(method, "hvc") == 0)
- sc->psci_call = psci_hvc_despatch;
- else if (strcmp(method, "smc") == 0)
- sc->psci_call = psci_smc_despatch;
- else {
- device_printf(dev,
- "psci_attach: PSCI conduit \"%s\" invalid\n",
- method);
- return (ENXIO);
- }
- } else {
- device_printf(dev,
- "psci_attach: PSCI conduit not supplied in the DT\n");
+ sc->psci_call = psci_get_callfn(node);
+ if (sc->psci_call == NULL)
return (ENXIO);
- }
if (psci_init(dev))
return (ENXIO);
@@ -177,10 +181,27 @@ psci_get_version(struct psci_softc *sc)
int
psci_cpu_on(unsigned long cpu, unsigned long entry, unsigned long context_id)
{
+ psci_callfn_t callfn;
+ phandle_t node;
+ uint32_t fnid;
+
+ if (psci_softc == NULL) {
+ node = ofw_bus_find_compatible(OF_peer(0), "arm,psci-0.2");
+ if (node == 0)
+ /* TODO: Handle psci 0.1 */
+ return (PSCI_RETVAL_INTERNAL_FAILURE);
+
+ fnid = PSCI_FNID_CPU_ON;
+ callfn = psci_get_callfn(node);
+ if (callfn == NULL)
+ return (PSCI_RETVAL_INTERNAL_FAILURE);
+ } else {
+ callfn = psci_softc->psci_call;
+ fnid = psci_softc->psci_fnids[PSCI_FN_CPU_ON];
+ }
/* PSCI v0.1 and v0.2 both support cpu_on. */
- return(psci_softc->psci_call(psci_softc->psci_fnids[PSCI_FN_CPU_ON], cpu,
- entry, context_id));
+ return (callfn(fnid, cpu, entry, context_id));
}
static void
diff --git a/sys/dev/ral/rt2560.c b/sys/dev/ral/rt2560.c
index 02c9310..29ce8cb 100644
--- a/sys/dev/ral/rt2560.c
+++ b/sys/dev/ral/rt2560.c
@@ -144,14 +144,14 @@ static void rt2560_disable_rf_tune(struct rt2560_softc *);
static void rt2560_enable_tsf_sync(struct rt2560_softc *);
static void rt2560_enable_tsf(struct rt2560_softc *);
static void rt2560_update_plcp(struct rt2560_softc *);
-static void rt2560_update_slot(struct ifnet *);
+static void rt2560_update_slot(struct ieee80211com *);
static void rt2560_set_basicrates(struct rt2560_softc *,
const struct ieee80211_rateset *);
static void rt2560_update_led(struct rt2560_softc *, int, int);
static void rt2560_set_bssid(struct rt2560_softc *, const uint8_t *);
static void rt2560_set_macaddr(struct rt2560_softc *, uint8_t *);
static void rt2560_get_macaddr(struct rt2560_softc *, uint8_t *);
-static void rt2560_update_promisc(struct ifnet *);
+static void rt2560_update_promisc(struct ieee80211com *);
static const char *rt2560_get_rf(int);
static void rt2560_read_config(struct rt2560_softc *);
static int rt2560_bbp_init(struct rt2560_softc *);
@@ -273,6 +273,8 @@ rt2560_attach(device_t dev, int id)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_softc = sc;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_opmode = IEEE80211_M_STA;
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
@@ -1996,7 +1998,7 @@ rt2560_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
rt2560_init_locked(sc);
startall = 1;
} else
- rt2560_update_promisc(ifp);
+ rt2560_update_promisc(ic);
} else {
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
rt2560_stop_locked(sc);
@@ -2305,10 +2307,9 @@ rt2560_update_plcp(struct rt2560_softc *sc)
* IEEE Std 802.11-1999 pp. 85 to know how these values are computed.
*/
static void
-rt2560_update_slot(struct ifnet *ifp)
+rt2560_update_slot(struct ieee80211com *ic)
{
- struct rt2560_softc *sc = ifp->if_softc;
- struct ieee80211com *ic = ifp->if_l2com;
+ struct rt2560_softc *sc = ic->ic_softc;
uint8_t slottime;
uint16_t tx_sifs, tx_pifs, tx_difs, eifs;
uint32_t tmp;
@@ -2435,21 +2436,21 @@ rt2560_get_macaddr(struct rt2560_softc *sc, uint8_t *addr)
}
static void
-rt2560_update_promisc(struct ifnet *ifp)
+rt2560_update_promisc(struct ieee80211com *ic)
{
- struct rt2560_softc *sc = ifp->if_softc;
+ struct rt2560_softc *sc = ic->ic_softc;
uint32_t tmp;
tmp = RAL_READ(sc, RT2560_RXCSR0);
tmp &= ~RT2560_DROP_NOT_TO_ME;
- if (!(ifp->if_flags & IFF_PROMISC))
+ if (!(ic->ic_ifp->if_flags & IFF_PROMISC))
tmp |= RT2560_DROP_NOT_TO_ME;
RAL_WRITE(sc, RT2560_RXCSR0, tmp);
- DPRINTF(sc, "%s promiscuous mode\n", (ifp->if_flags & IFF_PROMISC) ?
- "entering" : "leaving");
+ DPRINTF(sc, "%s promiscuous mode\n",
+ (ic->ic_ifp->if_flags & IFF_PROMISC) ? "entering" : "leaving");
}
static const char *
@@ -2658,7 +2659,7 @@ rt2560_init_locked(struct rt2560_softc *sc)
/* set basic rate set (will be updated later) */
RAL_WRITE(sc, RT2560_ARSP_PLCP_1, 0x153);
- rt2560_update_slot(ifp);
+ rt2560_update_slot(ic);
rt2560_update_plcp(sc);
rt2560_update_led(sc, 0, 0);
diff --git a/sys/dev/ral/rt2661.c b/sys/dev/ral/rt2661.c
index 448ba57..15a2364 100644
--- a/sys/dev/ral/rt2661.c
+++ b/sys/dev/ral/rt2661.c
@@ -147,9 +147,9 @@ static void rt2661_set_bssid(struct rt2661_softc *,
const uint8_t *);
static void rt2661_set_macaddr(struct rt2661_softc *,
const uint8_t *);
-static void rt2661_update_promisc(struct ifnet *);
+static void rt2661_update_promisc(struct ieee80211com *);
static int rt2661_wme_update(struct ieee80211com *) __unused;
-static void rt2661_update_slot(struct ifnet *);
+static void rt2661_update_slot(struct ieee80211com *);
static const char *rt2661_get_rf(int);
static void rt2661_read_eeprom(struct rt2661_softc *,
uint8_t macaddr[IEEE80211_ADDR_LEN]);
@@ -274,6 +274,8 @@ rt2661_attach(device_t dev, int id)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_softc = sc;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_opmode = IEEE80211_M_STA;
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
@@ -1734,7 +1736,7 @@ rt2661_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
rt2661_init_locked(sc);
startall = 1;
} else
- rt2661_update_promisc(ifp);
+ rt2661_update_promisc(ic);
} else {
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
rt2661_stop_locked(sc);
@@ -2078,21 +2080,21 @@ rt2661_set_macaddr(struct rt2661_softc *sc, const uint8_t *addr)
}
static void
-rt2661_update_promisc(struct ifnet *ifp)
+rt2661_update_promisc(struct ieee80211com *ic)
{
- struct rt2661_softc *sc = ifp->if_softc;
+ struct rt2661_softc *sc = ic->ic_softc;
uint32_t tmp;
tmp = RAL_READ(sc, RT2661_TXRX_CSR0);
tmp &= ~RT2661_DROP_NOT_TO_ME;
- if (!(ifp->if_flags & IFF_PROMISC))
+ if (!(ic->ic_ifp->if_flags & IFF_PROMISC))
tmp |= RT2661_DROP_NOT_TO_ME;
RAL_WRITE(sc, RT2661_TXRX_CSR0, tmp);
- DPRINTF(sc, "%s promiscuous mode\n", (ifp->if_flags & IFF_PROMISC) ?
- "entering" : "leaving");
+ DPRINTF(sc, "%s promiscuous mode\n",
+ (ic->ic_ifp->if_flags & IFF_PROMISC) ? "entering" : "leaving");
}
/*
@@ -2142,10 +2144,9 @@ rt2661_wme_update(struct ieee80211com *ic)
}
static void
-rt2661_update_slot(struct ifnet *ifp)
+rt2661_update_slot(struct ieee80211com *ic)
{
- struct rt2661_softc *sc = ifp->if_softc;
- struct ieee80211com *ic = ifp->if_l2com;
+ struct rt2661_softc *sc = ic->ic_softc;
uint8_t slottime;
uint32_t tmp;
diff --git a/sys/dev/ral/rt2860.c b/sys/dev/ral/rt2860.c
index b29a0eb..782fa1f 100644
--- a/sys/dev/ral/rt2860.c
+++ b/sys/dev/ral/rt2860.c
@@ -154,8 +154,8 @@ static void rt2860_set_leds(struct rt2860_softc *, uint16_t);
static void rt2860_set_gp_timer(struct rt2860_softc *, int);
static void rt2860_set_bssid(struct rt2860_softc *, const uint8_t *);
static void rt2860_set_macaddr(struct rt2860_softc *, const uint8_t *);
-static void rt2860_update_promisc(struct ifnet *);
-static void rt2860_updateslot(struct ifnet *);
+static void rt2860_update_promisc(struct ieee80211com *);
+static void rt2860_updateslot(struct ieee80211com *);
static void rt2860_updateprot(struct ifnet *);
static int rt2860_updateedca(struct ieee80211com *);
#ifdef HW_CRYPTO
@@ -315,6 +315,8 @@ rt2860_attach(device_t dev, int id)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_softc = sc;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_opmode = IEEE80211_M_STA;
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
@@ -2051,7 +2053,7 @@ rt2860_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
rt2860_init_locked(sc);
startall = 1;
} else
- rt2860_update_promisc(ifp);
+ rt2860_update_promisc(ic);
} else {
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
rt2860_stop_locked(sc);
@@ -3099,10 +3101,9 @@ rt2860_set_macaddr(struct rt2860_softc *sc, const uint8_t *addr)
}
static void
-rt2860_updateslot(struct ifnet *ifp)
+rt2860_updateslot(struct ieee80211com *ic)
{
- struct rt2860_softc *sc = ifp->if_softc;
- struct ieee80211com *ic = ifp->if_l2com;
+ struct rt2860_softc *sc = ic->ic_softc;
uint32_t tmp;
tmp = RAL_READ(sc, RT2860_BKOFF_SLOT_CFG);
@@ -3137,14 +3138,14 @@ rt2860_updateprot(struct ifnet *ifp)
}
static void
-rt2860_update_promisc(struct ifnet *ifp)
+rt2860_update_promisc(struct ieee80211com *ic)
{
- struct rt2860_softc *sc = ifp->if_softc;
+ struct rt2860_softc *sc = ic->ic_softc;
uint32_t tmp;
tmp = RAL_READ(sc, RT2860_RX_FILTR_CFG);
tmp &= ~RT2860_DROP_NOT_MYBSS;
- if (!(ifp->if_flags & IFF_PROMISC))
+ if (!(ic->ic_ifp->if_flags & IFF_PROMISC))
tmp |= RT2860_DROP_NOT_MYBSS;
RAL_WRITE(sc, RT2860_RX_FILTR_CFG, tmp);
}
diff --git a/sys/dev/sfxge/common/ef10_tlv_layout.h b/sys/dev/sfxge/common/ef10_tlv_layout.h
new file mode 100644
index 0000000..e413a5d
--- /dev/null
+++ b/sys/dev/sfxge/common/ef10_tlv_layout.h
@@ -0,0 +1,691 @@
+/*-
+ * Copyright (c) 2012-2015 Solarflare Communications Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
+ *
+ * $FreeBSD$
+ */
+
+/* These structures define the layouts for the TLV items stored in static and
+ * dynamic configuration partitions in NVRAM for EF10 (Huntington etc.).
+ *
+ * They contain the same sort of information that was kept in the
+ * siena_mc_static_config_hdr_t and siena_mc_dynamic_config_hdr_t structures
+ * (defined in <ci/mgmt/mc_flash_layout.h> and <ci/mgmt/mc_dynamic_cfg.h>) for
+ * Siena.
+ *
+ * These are used directly by the MC and should also be usable directly on host
+ * systems which are little-endian and do not do strange things with structure
+ * padding. (Big-endian host systems will require some byte-swapping.)
+ *
+ * -----
+ *
+ * Please refer to SF-108797-SW for a general overview of the TLV partition
+ * format.
+ *
+ * -----
+ *
+ * The current tag IDs have a general structure: with the exception of the
+ * special values defined in the document, they are of the form 0xLTTTNNNN,
+ * where:
+ *
+ * - L is a location, indicating where this tag is expected to be found:
+ * 0 for static configuration, or 1 for dynamic configuration. Other
+ * values are reserved.
+ *
+ * - TTT is a type, which is just a unique value. The same type value
+ * might appear in both locations, indicating a relationship between
+ * the items (e.g. static and dynamic VPD below).
+ *
+ * - NNNN is an index of some form. Some item types are per-port, some
+ * are per-PF, some are per-partition-type.
+ *
+ * -----
+ *
+ * As with the previous Siena structures, each structure here is laid out
+ * carefully: values are aligned to their natural boundary, with explicit
+ * padding fields added where necessary. (No, technically this does not
+ * absolutely guarantee portability. But, in practice, compilers are generally
+ * sensible enough not to introduce completely pointless padding, and it works
+ * well enough.)
+ */
+
+
+#ifndef CI_MGMT_TLV_LAYOUT_H
+#define CI_MGMT_TLV_LAYOUT_H
+
+
+/* ----------------------------------------------------------------------------
+ * General structure (defined by SF-108797-SW)
+ * ----------------------------------------------------------------------------
+ */
+
+
+/* The "end" tag.
+ *
+ * (Note that this is *not* followed by length or value fields: anything after
+ * the tag itself is irrelevant.)
+ */
+
+#define TLV_TAG_END (0xEEEEEEEE)
+
+
+/* Other special reserved tag values.
+ */
+
+#define TLV_TAG_SKIP (0x00000000)
+#define TLV_TAG_INVALID (0xFFFFFFFF)
+
+
+/* TLV partition header.
+ *
+ * In a TLV partition, this must be the first item in the sequence, at offset
+ * 0.
+ */
+
+#define TLV_TAG_PARTITION_HEADER (0xEF10DA7A)
+
+struct tlv_partition_header {
+ uint32_t tag;
+ uint32_t length;
+ uint16_t type_id;
+ uint16_t reserved;
+ uint32_t generation;
+ uint32_t total_length;
+};
+
+
+/* TLV partition trailer.
+ *
+ * In a TLV partition, this must be the last item in the sequence, immediately
+ * preceding the TLV_TAG_END word.
+ */
+
+#define TLV_TAG_PARTITION_TRAILER (0xEF101A57)
+
+struct tlv_partition_trailer {
+ uint32_t tag;
+ uint32_t length;
+ uint32_t generation;
+ uint32_t checksum;
+};
+
+
+/* Appendable TLV partition header.
+ *
+ * In an appendable TLV partition, this must be the first item in the sequence,
+ * at offset 0. (Note that, unlike the configuration partitions, there is no
+ * trailer before the TLV_TAG_END word.)
+ */
+
+#define TLV_TAG_APPENDABLE_PARTITION_HEADER (0xEF10ADA7)
+
+struct tlv_appendable_partition_header {
+ uint32_t tag;
+ uint32_t length;
+ uint16_t type_id;
+ uint16_t reserved;
+};
+
+
+/* ----------------------------------------------------------------------------
+ * Configuration items
+ * ----------------------------------------------------------------------------
+ */
+
+
+/* NIC global capabilities.
+ */
+
+#define TLV_TAG_GLOBAL_CAPABILITIES (0x00010000)
+
+struct tlv_global_capabilities {
+ uint32_t tag;
+ uint32_t length;
+ uint32_t flags;
+};
+
+
+/* Siena-style per-port MAC address allocation.
+ *
+ * There are <count> addresses, starting at <base_address> and incrementing
+ * by adding <stride> to the low-order byte(s).
+ *
+ * (See also TLV_TAG_GLOBAL_MAC for an alternative, specifying a global pool
+ * of contiguous MAC addresses for the firmware to allocate as it sees fit.)
+ */
+
+#define TLV_TAG_PORT_MAC(port) (0x00020000 + (port))
+
+struct tlv_port_mac {
+ uint32_t tag;
+ uint32_t length;
+ uint8_t base_address[6];
+ uint16_t reserved;
+ uint16_t count;
+ uint16_t stride;
+};
+
+
+/* Static VPD.
+ *
+ * This is the portion of VPD which is set at manufacturing time and not
+ * expected to change. It is formatted as a standard PCI VPD block.
+ */
+
+#define TLV_TAG_PF_STATIC_VPD(pf) (0x00030000 + (pf))
+
+struct tlv_pf_static_vpd {
+ uint32_t tag;
+ uint32_t length;
+ uint8_t bytes[];
+};
+
+
+/* Dynamic VPD.
+ *
+ * This is the portion of VPD which may be changed (e.g. by firmware updates).
+ * It is formatted as a standard PCI VPD block.
+ */
+
+#define TLV_TAG_PF_DYNAMIC_VPD(pf) (0x10030000 + (pf))
+
+struct tlv_pf_dynamic_vpd {
+ uint32_t tag;
+ uint32_t length;
+ uint8_t bytes[];
+};
+
+
+/* "DBI" PCI config space changes.
+ *
+ * This is a set of edits made to the default PCI config space values before
+ * the device is allowed to enumerate.
+ */
+
+#define TLV_TAG_PF_DBI(pf) (0x00040000 + (pf))
+
+struct tlv_pf_dbi {
+ uint32_t tag;
+ uint32_t length;
+ struct {
+ uint16_t addr;
+ uint16_t byte_enables;
+ uint32_t value;
+ } items[];
+};
+
+
+/* Partition subtype codes.
+ *
+ * A subtype may optionally be stored for each type of partition present in
+ * the NVRAM. For example, this may be used to allow a generic firmware update
+ * utility to select a specific variant of firmware for a specific variant of
+ * board.
+ *
+ * The description[] field is an optional string which is returned in the
+ * MC_CMD_NVRAM_METADATA response if present.
+ */
+
+#define TLV_TAG_PARTITION_SUBTYPE(type) (0x00050000 + (type))
+
+struct tlv_partition_subtype {
+ uint32_t tag;
+ uint32_t length;
+ uint32_t subtype;
+ uint8_t description[];
+};
+
+
+/* Partition version codes.
+ *
+ * A version may optionally be stored for each type of partition present in
+ * the NVRAM. This provides a standard way of tracking the currently stored
+ * version of each of the various component images.
+ */
+
+#define TLV_TAG_PARTITION_VERSION(type) (0x10060000 + (type))
+
+struct tlv_partition_version {
+ uint32_t tag;
+ uint32_t length;
+ uint16_t version_w;
+ uint16_t version_x;
+ uint16_t version_y;
+ uint16_t version_z;
+};
+
+/* Global PCIe configuration */
+
+#define TLV_TAG_GLOBAL_PCIE_CONFIG (0x10070000)
+
+struct tlv_pcie_config {
+ uint32_t tag;
+ uint32_t length;
+ int16_t max_pf_number; /**< Largest PF RID (lower PFs may be hidden) */
+ uint16_t pf_aper; /**< BIU aperture for PF BAR2 */
+ uint16_t vf_aper; /**< BIU aperture for VF BAR0 */
+ uint16_t int_aper; /**< BIU aperture for PF BAR4 and VF BAR2 */
+#define TLV_MAX_PF_DEFAULT (-1) /* Use FW default for largest PF RID */
+#define TLV_APER_DEFAULT (0xFFFF) /* Use FW default for a given aperture */
+};
+
+/* Per-PF configuration. Note that not all these fields are necessarily useful
+ * as the apertures are constrained by the BIU settings (the one case we do
+ * use is to make BAR2 bigger than the BIU thinks to reserve space), but we can
+ * tidy things up later */
+
+#define TLV_TAG_PF_PCIE_CONFIG(pf) (0x10080000 + (pf))
+
+struct tlv_per_pf_pcie_config {
+ uint32_t tag;
+ uint32_t length;
+ uint8_t vfs_total;
+ uint8_t port_allocation;
+ uint16_t vectors_per_pf;
+ uint16_t vectors_per_vf;
+ uint8_t pf_bar0_aperture;
+ uint8_t pf_bar2_aperture;
+ uint8_t vf_bar0_aperture;
+ uint8_t vf_base;
+ uint16_t supp_pagesz;
+ uint16_t msix_vec_base;
+};
+
+
+/* Development ONLY. This is a single TLV tag for all the gubbins
+ * that can be set through the MC command-line other than the PCIe
+ * settings. This is a temporary measure. */
+#define TLV_TAG_TMP_GUBBINS (0x10090000)
+
+struct tlv_tmp_gubbins {
+ uint32_t tag;
+ uint32_t length;
+ /* Consumed by dpcpu.c */
+ uint64_t tx0_tags; /* Bitmap */
+ uint64_t tx1_tags; /* Bitmap */
+ uint64_t dl_tags; /* Bitmap */
+ uint32_t flags;
+#define TLV_DPCPU_TX_STRIPE (1) /* TX striping is on */
+#define TLV_DPCPU_BIU_TAGS (2) /* Use BIU tag manager */
+#define TLV_DPCPU_TX0_TAGS (4) /* tx0_tags is valid */
+#define TLV_DPCPU_TX1_TAGS (8) /* tx1_tags is valid */
+#define TLV_DPCPU_DL_TAGS (16) /* dl_tags is valid */
+ /* Consumed by features.c */
+ uint32_t dut_features; /* All 1s -> leave alone */
+ int8_t with_rmon; /* 0 -> off, 1 -> on, -1 -> leave alone */
+ /* Consumed by clocks_hunt.c */
+ int8_t clk_mode; /* 0 -> off, 1 -> on, -1 -> leave alone */
+ /* Consumed by sram.c */
+ int8_t rx_dc_size; /* -1 -> leave alone */
+ int8_t tx_dc_size;
+ int16_t num_q_allocs;
+};
+
+/* Global port configuration
+ *
+ * This is now deprecated in favour of a platform-provided default
+ * and dynamic config override via tlv_global_port_options.
+ */
+#define TLV_TAG_GLOBAL_PORT_CONFIG (0x000a0000)
+
+struct tlv_global_port_config {
+ uint32_t tag;
+ uint32_t length;
+ uint32_t ports_per_core;
+ uint32_t max_port_speed;
+};
+
+
+/* Firmware options.
+ *
+ * This is intended for user-configurable selection of optional firmware
+ * features and variants.
+ *
+ * Initially, this consists only of the satellite CPU firmware variant
+ * selection, but this tag could be extended in the future (using the
+ * tag length to determine whether additional fields are present).
+ */
+
+#define TLV_TAG_FIRMWARE_OPTIONS (0x100b0000)
+
+struct tlv_firmware_options {
+ uint32_t tag;
+ uint32_t length;
+ uint32_t firmware_variant;
+#define TLV_FIRMWARE_VARIANT_DRIVER_SELECTED (0xffffffff)
+
+/* These are the values for overriding the driver's choice; the definitions
+ * are taken from MCDI so that they don't get out of step. Include
+ * <ci/mgmt/mc_driver_pcol.h> or the equivalent from your driver's tree if
+ * you need to use these constants.
+ */
+#define TLV_FIRMWARE_VARIANT_FULL_FEATURED MC_CMD_FW_FULL_FEATURED
+#define TLV_FIRMWARE_VARIANT_LOW_LATENCY MC_CMD_FW_LOW_LATENCY
+#define TLV_FIRMWARE_VARIANT_PACKED_STREAM MC_CMD_FW_PACKED_STREAM
+#define TLV_FIRMWARE_VARIANT_HIGH_TX_RATE MC_CMD_FW_HIGH_TX_RATE
+#define TLV_FIRMWARE_VARIANT_PACKED_STREAM_HASH_MODE_1 \
+ MC_CMD_FW_PACKED_STREAM_HASH_MODE_1
+};
+
+/* Voltage settings
+ *
+ * Intended for boards with A0 silicon where the core voltage may
+ * need tweaking. Most likely set once when the pass voltage is
+ * determined. */
+
+#define TLV_TAG_0V9_SETTINGS (0x000c0000)
+
+struct tlv_0v9_settings {
+ uint32_t tag;
+ uint32_t length;
+ uint16_t flags; /* Boards with high 0v9 settings may need active cooling */
+#define TLV_TAG_0V9_REQUIRES_FAN (1)
+ uint16_t target_voltage; /* In millivolts */
+ /* Since the limits are meant to be centred to the target (and must at least
+ * contain it) they need setting as well. */
+ uint16_t warn_low; /* In millivolts */
+ uint16_t warn_high; /* In millivolts */
+ uint16_t panic_low; /* In millivolts */
+ uint16_t panic_high; /* In millivolts */
+};
+
+
+/* Clock configuration */
+
+#define TLV_TAG_CLOCK_CONFIG (0x000d0000)
+
+struct tlv_clock_config {
+ uint32_t tag;
+ uint32_t length;
+ uint16_t clk_sys; /* MHz */
+ uint16_t clk_dpcpu; /* MHz */
+ uint16_t clk_icore; /* MHz */
+ uint16_t clk_pcs; /* MHz */
+};
+
+#define TLV_TAG_CLOCK_CONFIG_MEDFORD (0x00100000)
+
+struct tlv_clock_config_medford {
+ uint32_t tag;
+ uint32_t length;
+ uint16_t clk_sys; /* MHz */
+ uint16_t clk_mc; /* MHz */
+ uint16_t clk_rmon; /* MHz */
+ uint16_t clk_vswitch; /* MHz */
+ uint16_t clk_dpcpu; /* MHz */
+ uint16_t clk_pcs; /* MHz */
+};
+
+
+/* EF10-style global pool of MAC addresses.
+ *
+ * There are <count> addresses, starting at <base_address>, which are
+ * contiguous. Firmware is responsible for allocating addresses from this
+ * pool to ports / PFs as appropriate.
+ */
+
+#define TLV_TAG_GLOBAL_MAC (0x000e0000)
+
+struct tlv_global_mac {
+ uint32_t tag;
+ uint32_t length;
+ uint8_t base_address[6];
+ uint16_t reserved1;
+ uint16_t count;
+ uint16_t reserved2;
+};
+
+#define TLV_TAG_ATB_0V9_TARGET (0x000f0000)
+
+/* The target value for the 0v9 power rail measured on-chip at the
+ * analogue test bus */
+struct tlv_0v9_atb_target {
+ uint32_t tag;
+ uint32_t length;
+ uint16_t millivolts;
+ uint16_t reserved;
+};
+
+/* Global PCIe configuration, second revision. This represents the visible PFs
+ * by a bitmap rather than having the number of the highest visible one. As such
+ * it can (for a 16-PF chip) represent a superset of what TLV_TAG_GLOBAL_PCIE_CONFIG
+ * can and it should be used in place of that tag in future (but compatibility with
+ * the old tag will be left in the firmware indefinitely). */
+
+#define TLV_TAG_GLOBAL_PCIE_CONFIG_R2 (0x10100000)
+
+struct tlv_pcie_config_r2 {
+ uint32_t tag;
+ uint32_t length;
+ uint16_t visible_pfs; /**< Bitmap of visible PFs */
+ uint16_t pf_aper; /**< BIU aperture for PF BAR2 */
+ uint16_t vf_aper; /**< BIU aperture for VF BAR0 */
+ uint16_t int_aper; /**< BIU aperture for PF BAR4 and VF BAR2 */
+};
+
+/* Dynamic port mode.
+ *
+ * Allows selecting alternate port configuration for platforms that support it
+ * (e.g. 1x40G vs 2x10G on Milano, 1x40G vs 4x10G on Medford). This affects the
+ * number of externally visible ports (and, hence, PF to port mapping), so must
+ * be done at boot time.
+ *
+ * This tag supercedes tlv_global_port_config.
+ */
+
+#define TLV_TAG_GLOBAL_PORT_MODE (0x10110000)
+
+struct tlv_global_port_mode {
+ uint32_t tag;
+ uint32_t length;
+ uint32_t port_mode;
+#define TLV_PORT_MODE_DEFAULT (0xffffffff) /* Default for given platform */
+#define TLV_PORT_MODE_10G (0) /* 10G, single SFP/10G-KR */
+#define TLV_PORT_MODE_40G (1) /* 40G, single QSFP/40G-KR */
+#define TLV_PORT_MODE_10G_10G (2) /* 2x10G, dual SFP/10G-KR or single QSFP */
+#define TLV_PORT_MODE_40G_40G (3) /* 40G + 40G, dual QSFP/40G-KR (Greenport, Medford) */
+#define TLV_PORT_MODE_10G_10G_10G_10G (4) /* 2x10G + 2x10G, quad SFP/10G-KR or dual QSFP (Greenport, Medford) */
+#define TLV_PORT_MODE_10G_10G_10G_10G_Q (5) /* 4x10G, single QSFP, cage 0 (Medford) */
+#define TLV_PORT_MODE_40G_10G_10G (6) /* 1x40G + 2x10G, dual QSFP (Greenport, Medford) */
+#define TLV_PORT_MODE_10G_10G_40G (7) /* 2x10G + 1x40G, dual QSFP (Greenport, Medford) */
+#define TLV_PORT_MODE_10G_10G_10G_10G_Q2 (8) /* 4x10G, single QSFP, cage 1 (Medford) */
+#define TLV_PORT_MODE_MAX TLV_PORT_MODE_10G_10G_10G_10G_Q2
+};
+
+/* Type of the v-switch created implicitly by the firmware */
+
+#define TLV_TAG_VSWITCH_TYPE(port) (0x10120000 + (port))
+
+struct tlv_vswitch_type {
+ uint32_t tag;
+ uint32_t length;
+ uint32_t vswitch_type;
+#define TLV_VSWITCH_TYPE_DEFAULT (0xffffffff) /* Firmware default; equivalent to no TLV present for a given port */
+#define TLV_VSWITCH_TYPE_NONE (0)
+#define TLV_VSWITCH_TYPE_VLAN (1)
+#define TLV_VSWITCH_TYPE_VEB (2)
+#define TLV_VSWITCH_TYPE_VEPA (3)
+#define TLV_VSWITCH_TYPE_MUX (4)
+#define TLV_VSWITCH_TYPE_TEST (5)
+};
+
+/* A VLAN tag for the v-port created implicitly by the firmware */
+
+#define TLV_TAG_VPORT_VLAN_TAG(pf) (0x10130000 + (pf))
+
+struct tlv_vport_vlan_tag {
+ uint32_t tag;
+ uint32_t length;
+ uint32_t vlan_tag;
+#define TLV_VPORT_NO_VLAN_TAG (0xFFFFFFFF) /* Default in the absence of TLV for a given PF */
+};
+
+/* Offset to be applied to the 0v9 setting, wherever it came from */
+
+#define TLV_TAG_ATB_0V9_OFFSET (0x10140000)
+
+struct tlv_0v9_atb_offset {
+ uint32_t tag;
+ uint32_t length;
+ int16_t offset_millivolts;
+ uint16_t reserved;
+};
+
+/* A privilege mask given on reset to all non-admin PCIe functions (that is other than first-PF-per-port).
+ * The meaning of particular bits is defined in mcdi_ef10.yml under MC_CMD_PRIVILEGE_MASK, see also bug 44583.
+ * TLV_TAG_PRIVILEGE_MASK_ADD specifies bits that should be added (ORed) to firmware default while
+ * TLV_TAG_PRIVILEGE_MASK_REM specifies bits that should be removed (ANDed) from firmware default:
+ * Initial_privilege_mask = (firmware_default_mask | privilege_mask_add) & ~privilege_mask_rem */
+
+#define TLV_TAG_PRIVILEGE_MASK (0x10150000) /* legacy symbol - do not use */
+
+struct tlv_privilege_mask { /* legacy structure - do not use */
+ uint32_t tag;
+ uint32_t length;
+ uint32_t privilege_mask;
+};
+
+#define TLV_TAG_PRIVILEGE_MASK_ADD (0x10150000)
+
+struct tlv_privilege_mask_add {
+ uint32_t tag;
+ uint32_t length;
+ uint32_t privilege_mask_add;
+};
+
+#define TLV_TAG_PRIVILEGE_MASK_REM (0x10160000)
+
+struct tlv_privilege_mask_rem {
+ uint32_t tag;
+ uint32_t length;
+ uint32_t privilege_mask_rem;
+};
+
+/* Additional privileges given to all PFs.
+ * This tag takes precedence over TLV_TAG_PRIVILEGE_MASK_REM. */
+
+#define TLV_TAG_PRIVILEGE_MASK_ADD_ALL_PFS (0x10190000)
+
+struct tlv_privilege_mask_add_all_pfs {
+ uint32_t tag;
+ uint32_t length;
+ uint32_t privilege_mask_add;
+};
+
+/* Additional privileges given to a selected PF.
+ * This tag takes precedence over TLV_TAG_PRIVILEGE_MASK_REM. */
+
+#define TLV_TAG_PRIVILEGE_MASK_ADD_SINGLE_PF(pf) (0x101A0000 + (pf))
+
+struct tlv_privilege_mask_add_single_pf {
+ uint32_t tag;
+ uint32_t length;
+ uint32_t privilege_mask_add;
+};
+
+/* Turning on/off the PFIOV mode.
+ * This tag only takes effect if TLV_TAG_VSWITCH_TYPE is missing or set to DEFAULT. */
+
+#define TLV_TAG_PFIOV(port) (0x10170000 + (port))
+
+struct tlv_pfiov {
+ uint32_t tag;
+ uint32_t length;
+ uint32_t pfiov;
+#define TLV_PFIOV_OFF (0) /* Default */
+#define TLV_PFIOV_ON (1)
+};
+
+/* Multicast filter chaining mode selection.
+ *
+ * When enabled, multicast packets are delivered to all recipients of all
+ * matching multicast filters, with the exception that IP multicast filters
+ * will steal traffic from MAC multicast filters on a per-function basis.
+ * (New behaviour.)
+ *
+ * When disabled, multicast packets will always be delivered only to the
+ * recipients of the highest priority matching multicast filter.
+ * (Legacy behaviour.)
+ *
+ * The DEFAULT mode (which is the same as the tag not being present at all)
+ * is equivalent to ENABLED in production builds, and DISABLED in eftest
+ * builds.
+ *
+ * This option is intended to provide run-time control over this feature
+ * while it is being stabilised and may be withdrawn at some point in the
+ * future; the new behaviour is intended to become the standard behaviour.
+ */
+
+#define TLV_TAG_MCAST_FILTER_CHAINING (0x10180000)
+
+struct tlv_mcast_filter_chaining {
+ uint32_t tag;
+ uint32_t length;
+ uint32_t mode;
+#define TLV_MCAST_FILTER_CHAINING_DEFAULT (0xffffffff)
+#define TLV_MCAST_FILTER_CHAINING_DISABLED (0)
+#define TLV_MCAST_FILTER_CHAINING_ENABLED (1)
+};
+
+
+/* Pacer rate limit per PF */
+#define TLV_TAG_RATE_LIMIT(pf) (0x101b0000 + (pf))
+
+struct tlv_rate_limit {
+ uint32_t tag;
+ uint32_t length;
+ uint32_t rate_mbps;
+};
+
+
+/* OCSD Enable/Disable
+ *
+ * This setting allows OCSD to be disabled. This is a requirement for HP
+ * servers to support PCI passthrough for virtualization.
+ *
+ * The DEFAULT mode (which is the same as the tag not being present) is
+ * equivalent to ENABLED.
+ *
+ * This option is not used by the MCFW, and is entirely handled by the various
+ * drivers that support OCSD, by reading the setting before they attempt
+ * to enable OCSD.
+ *
+ * bit0: OCSD Disabled/Enabled
+ */
+
+#define TLV_TAG_OCSD (0x101C0000)
+
+struct tlv_ocsd {
+ uint32_t tag;
+ uint32_t length;
+ uint32_t mode;
+#define TLV_OCSD_DISABLED 0
+#define TLV_OCSD_ENABLED 1 /* Default */
+};
+
+#endif /* CI_MGMT_TLV_LAYOUT_H */
diff --git a/sys/dev/sfxge/common/efsys.h b/sys/dev/sfxge/common/efsys.h
index d911c43..0a7b1ad 100644
--- a/sys/dev/sfxge/common/efsys.h
+++ b/sys/dev/sfxge/common/efsys.h
@@ -1,30 +1,34 @@
/*-
- * Copyright (c) 2010-2011 Solarflare Communications, Inc.
+ * Copyright (c) 2010-2015 Solarflare Communications Inc.
* All rights reserved.
*
* This software was developed in part by Philip Paeps under contract for
* Solarflare Communications, Inc.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*
* $FreeBSD$
*/
@@ -56,6 +60,7 @@ extern "C" {
#else
#define EFSYS_USE_UINT64 0
#endif
+#define EFSYS_HAS_SSE2_M128 0
#if _BYTE_ORDER == _BIG_ENDIAN
#define EFSYS_IS_BIG_ENDIAN 1
#define EFSYS_IS_LITTLE_ENDIAN 0
@@ -90,6 +95,10 @@ extern "C" {
#define P2ROUNDUP(x, align) (-(-(x) & -(align)))
#endif
+#ifndef P2ALIGN
+#define P2ALIGN(_x, _a) ((_x) & -(_a))
+#endif
+
#ifndef IS2P
#define ISP2(x) (((x) & ((x) - 1)) == 0)
#endif
@@ -176,7 +185,7 @@ prefetch_read_once(void *addr)
#endif
static __inline void
sfxge_map_mbuf_fast(bus_dma_tag_t tag, bus_dmamap_t map,
- struct mbuf *m, bus_dma_segment_t *seg)
+ struct mbuf *m, bus_dma_segment_t *seg)
{
#if defined(__i386__) || defined(__amd64__)
seg->ds_addr = pmap_kextract(mtod(m, vm_offset_t));
@@ -188,10 +197,6 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, bus_dmamap_t map,
#endif
}
-/* Modifiers used for DOS builds */
-#define __cs
-#define __far
-
/* Modifiers used for Windows builds */
#define __in
#define __in_opt
@@ -231,6 +236,7 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, bus_dmamap_t map,
#define EFSYS_OPT_FALCON 0
#define EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE 0
#define EFSYS_OPT_SIENA 1
+#define EFSYS_OPT_HUNTINGTON 1
#ifdef DEBUG
#define EFSYS_OPT_CHECK_REG 1
#else
@@ -248,19 +254,19 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, bus_dmamap_t map,
#define EFSYS_OPT_MON_NULL 0
#define EFSYS_OPT_MON_LM87 0
#define EFSYS_OPT_MON_MAX6647 0
-#define EFSYS_OPT_MON_SIENA 0
+#define EFSYS_OPT_MON_MCDI 0
#define EFSYS_OPT_MON_STATS 0
#define EFSYS_OPT_PHY_NULL 0
#define EFSYS_OPT_PHY_QT2022C2 0
#define EFSYS_OPT_PHY_SFX7101 0
#define EFSYS_OPT_PHY_TXC43128 0
-#define EFSYS_OPT_PHY_PM8358 0
#define EFSYS_OPT_PHY_SFT9001 0
#define EFSYS_OPT_PHY_QT2025C 0
#define EFSYS_OPT_PHY_STATS 1
#define EFSYS_OPT_PHY_PROPS 0
-#define EFSYS_OPT_PHY_BIST 1
+#define EFSYS_OPT_PHY_BIST 0
+#define EFSYS_OPT_BIST 1
#define EFSYS_OPT_PHY_LED_CONTROL 1
#define EFSYS_OPT_PHY_FLAGS 0
@@ -276,7 +282,8 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, bus_dmamap_t map,
#define EFSYS_OPT_WOL 1
#define EFSYS_OPT_RX_SCALE 1
#define EFSYS_OPT_QSTATS 1
-#define EFSYS_OPT_FILTER 0
+#define EFSYS_OPT_FILTER 1
+#define EFSYS_OPT_MCAST_FILTER_LIST 1
#define EFSYS_OPT_RX_SCATTER 0
#define EFSYS_OPT_RX_HDR_SPLIT 0
@@ -618,6 +625,9 @@ typedef struct efsys_mem_s {
#define EFSYS_MEM_ADDR(_esmp) \
((_esmp)->esm_addr)
+#define EFSYS_MEM_IS_NULL(_esmp) \
+ ((_esmp)->esm_base == NULL)
+
/* BAR */
#define SFXGE_LOCK_NAME_MAX 16
@@ -880,6 +890,24 @@ typedef struct efsys_bar_s {
} while (B_FALSE)
#endif
+/*
+ * Guarantees 64bit aligned 64bit writes to write combined BAR mapping
+ * (required by PIO hardware)
+ */
+#define EFSYS_BAR_WC_WRITEQ(_esbp, _offset, _eqp) \
+ do { \
+ _NOTE(CONSTANTCONDITION) \
+ KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)), \
+ ("not power of 2 aligned")); \
+ \
+ (void) (_esbp); \
+ \
+ /* FIXME: Perform a 64-bit write */ \
+ KASSERT(0, ("not implemented")); \
+ \
+ _NOTE(CONSTANTCONDITION) \
+ } while (B_FALSE)
+
#if defined(SFXGE_USE_BUS_SPACE_8)
#define EFSYS_BAR_WRITEO(_esbp, _offset, _eop, _lock) \
do { \
@@ -979,6 +1007,13 @@ typedef struct efsys_bar_s {
} while (B_FALSE)
#endif
+/* Use the standard octo-word write for doorbell writes */
+#define EFSYS_BAR_DOORBELL_WRITEO(_esbp, _offset, _eop) \
+ do { \
+ EFSYS_BAR_WRITEO((_esbp), (_offset), (_eop), B_FALSE); \
+ _NOTE(CONSTANTCONDITION) \
+ } while (B_FALSE)
+
/* SPIN */
#define EFSYS_SPIN(_us) \
@@ -994,6 +1029,23 @@ typedef struct efsys_bar_s {
#define EFSYS_MEM_READ_BARRIER() rmb()
#define EFSYS_PIO_WRITE_BARRIER()
+/* DMA SYNC */
+#define EFSYS_DMA_SYNC_FOR_KERNEL(_esmp, _offset, _size) \
+ do { \
+ bus_dmamap_sync((_esmp)->esm_tag, \
+ (_esmp)->esm_map, \
+ BUS_DMASYNC_POSTREAD); \
+ _NOTE(CONSTANTCONDITION) \
+ } while (B_FALSE)
+
+#define EFSYS_DMA_SYNC_FOR_DEVICE(_esmp, _offset, _size) \
+ do { \
+ bus_dmamap_sync((_esmp)->esm_tag, \
+ (_esmp)->esm_map, \
+ BUS_DMASYNC_PREWRITE); \
+ _NOTE(CONSTANTCONDITION) \
+ } while (B_FALSE)
+
/* TIMESTAMP */
typedef clock_t efsys_timestamp_t;
@@ -1150,7 +1202,7 @@ extern void sfxge_err(efsys_identifier_t *, unsigned int,
#define EFSYS_ASSERT(_exp) do { \
if (!(_exp)) \
- panic(#_exp); \
+ panic("%s", #_exp); \
} while (0)
#define EFSYS_ASSERT3(_x, _op, _y, _t) do { \
@@ -1164,6 +1216,10 @@ extern void sfxge_err(efsys_identifier_t *, unsigned int,
#define EFSYS_ASSERT3S(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, int64_t)
#define EFSYS_ASSERT3P(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, uintptr_t)
+/* ROTATE */
+
+#define EFSYS_HAS_ROTL_DWORD 0
+
#ifdef __cplusplus
}
#endif
diff --git a/sys/dev/sfxge/common/efx.h b/sys/dev/sfxge/common/efx.h
index c5ef448..3435951 100644
--- a/sys/dev/sfxge/common/efx.h
+++ b/sys/dev/sfxge/common/efx.h
@@ -1,26 +1,31 @@
/*-
- * Copyright 2006-2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2006-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*
* $FreeBSD$
*/
@@ -29,6 +34,7 @@
#define _SYS_EFX_H
#include "efsys.h"
+#include "efx_phy_ids.h"
#ifdef __cplusplus
extern "C" {
@@ -38,14 +44,13 @@ extern "C" {
#define EFX_ARRAY_SIZE(_array) (sizeof(_array) / sizeof((_array)[0]))
-#ifndef EFSYS_MEM_IS_NULL
-#define EFSYS_MEM_IS_NULL(_esmp) ((_esmp)->esm_base == NULL)
-#endif
+#define EFX_FIELD_OFFSET(_type, _field) ((size_t) &(((_type *)0)->_field))
typedef enum efx_family_e {
EFX_FAMILY_INVALID,
EFX_FAMILY_FALCON,
EFX_FAMILY_SIENA,
+ EFX_FAMILY_HUNTINGTON,
EFX_FAMILY_NTYPES
} efx_family_t;
@@ -60,11 +65,23 @@ efx_infer_family(
__in efsys_bar_t *esbp,
__out efx_family_t *efp);
-#define EFX_PCI_VENID_SFC 0x1924
-#define EFX_PCI_DEVID_FALCON 0x0710
-#define EFX_PCI_DEVID_BETHPAGE 0x0803
-#define EFX_PCI_DEVID_SIENA 0x0813
-#define EFX_PCI_DEVID_SIENA_F1_UNINIT 0x0810
+#define EFX_PCI_VENID_SFC 0x1924
+
+#define EFX_PCI_DEVID_FALCON 0x0710 /* SFC4000 */
+
+#define EFX_PCI_DEVID_BETHPAGE 0x0803 /* SFC9020 */
+#define EFX_PCI_DEVID_SIENA 0x0813 /* SFL9021 */
+#define EFX_PCI_DEVID_SIENA_F1_UNINIT 0x0810
+
+#define EFX_PCI_DEVID_HUNTINGTON_PF_UNINIT 0x0901
+#define EFX_PCI_DEVID_FARMINGDALE 0x0903 /* SFC9120 PF */
+#define EFX_PCI_DEVID_HUNTINGTON 0x0913 /* SFL9122 PF */
+#define EFX_PCI_DEVID_GREENPORT 0x0923 /* SFC9140 PF */
+
+#define EFX_PCI_DEVID_FARMINGDALE_VF 0x1903 /* SFC9120 VF */
+#define EFX_PCI_DEVID_HUNTINGTON_VF 0x1913 /* SFL9122 VF */
+#define EFX_PCI_DEVID_GREENPORT_VF 0x1923 /* SFC9140 VF */
+
#define EFX_MEM_BAR 2
@@ -86,10 +103,27 @@ enum {
EFX_ERR_NCODES
};
+/* Calculate the IEEE 802.3 CRC32 of a MAC addr */
+extern __checkReturn uint32_t
+efx_crc32_calculate(
+ __in uint32_t crc_init,
+ __in_ecount(length) uint8_t const *input,
+ __in int length);
+
+
+/* Type prototypes */
+
+typedef struct efx_rxq_s efx_rxq_t;
+
/* NIC */
typedef struct efx_nic_s efx_nic_t;
+#define EFX_NIC_FUNC_PRIMARY 0x00000001
+#define EFX_NIC_FUNC_LINKCTRL 0x00000002
+#define EFX_NIC_FUNC_TRUSTED 0x00000004
+
+
extern __checkReturn int
efx_nic_create(
__in efx_family_t family,
@@ -145,6 +179,11 @@ efx_nic_destroy(
#if EFSYS_OPT_MCDI
+#if EFSYS_OPT_HUNTINGTON
+/* Huntington requires MCDIv2 commands */
+#define WITH_MCDI_V2 1
+#endif
+
typedef struct efx_mcdi_req_s efx_mcdi_req_t;
typedef enum efx_mcdi_exception_e {
@@ -154,6 +193,7 @@ typedef enum efx_mcdi_exception_e {
typedef struct efx_mcdi_transport_s {
void *emt_context;
+ efsys_mem_t *emt_dma_mem;
void (*emt_execute)(void *, efx_mcdi_req_t *);
void (*emt_ev_cpl)(void *);
void (*emt_exception)(void *, efx_mcdi_exception_t);
@@ -168,6 +208,10 @@ extern __checkReturn int
efx_mcdi_reboot(
__in efx_nic_t *enp);
+ void
+efx_mcdi_new_epoch(
+ __in efx_nic_t *enp);
+
extern void
efx_mcdi_request_start(
__in efx_nic_t *enp,
@@ -251,7 +295,7 @@ efx_intr_fini(
#if EFSYS_OPT_MAC_STATS
-/* START MKCONFIG GENERATED EfxHeaderMacBlock bb8d39428b6fdcf5 */
+/* START MKCONFIG GENERATED EfxHeaderMacBlock e323546097fd7c65 */
typedef enum efx_mac_stat_e {
EFX_MAC_RX_OCTETS,
EFX_MAC_RX_PKTS,
@@ -304,6 +348,36 @@ typedef enum efx_mac_stat_e {
EFX_MAC_TX_LATE_COL_PKTS,
EFX_MAC_TX_DEF_PKTS,
EFX_MAC_TX_EX_DEF_PKTS,
+ EFX_MAC_PM_TRUNC_BB_OVERFLOW,
+ EFX_MAC_PM_DISCARD_BB_OVERFLOW,
+ EFX_MAC_PM_TRUNC_VFIFO_FULL,
+ EFX_MAC_PM_DISCARD_VFIFO_FULL,
+ EFX_MAC_PM_TRUNC_QBB,
+ EFX_MAC_PM_DISCARD_QBB,
+ EFX_MAC_PM_DISCARD_MAPPING,
+ EFX_MAC_RXDP_Q_DISABLED_PKTS,
+ EFX_MAC_RXDP_DI_DROPPED_PKTS,
+ EFX_MAC_RXDP_STREAMING_PKTS,
+ EFX_MAC_RXDP_HLB_FETCH,
+ EFX_MAC_RXDP_HLB_WAIT,
+ EFX_MAC_VADAPTER_RX_UNICAST_PACKETS,
+ EFX_MAC_VADAPTER_RX_UNICAST_BYTES,
+ EFX_MAC_VADAPTER_RX_MULTICAST_PACKETS,
+ EFX_MAC_VADAPTER_RX_MULTICAST_BYTES,
+ EFX_MAC_VADAPTER_RX_BROADCAST_PACKETS,
+ EFX_MAC_VADAPTER_RX_BROADCAST_BYTES,
+ EFX_MAC_VADAPTER_RX_BAD_PACKETS,
+ EFX_MAC_VADAPTER_RX_BAD_BYTES,
+ EFX_MAC_VADAPTER_RX_OVERFLOW,
+ EFX_MAC_VADAPTER_TX_UNICAST_PACKETS,
+ EFX_MAC_VADAPTER_TX_UNICAST_BYTES,
+ EFX_MAC_VADAPTER_TX_MULTICAST_PACKETS,
+ EFX_MAC_VADAPTER_TX_MULTICAST_BYTES,
+ EFX_MAC_VADAPTER_TX_BROADCAST_PACKETS,
+ EFX_MAC_VADAPTER_TX_BROADCAST_BYTES,
+ EFX_MAC_VADAPTER_TX_BAD_PACKETS,
+ EFX_MAC_VADAPTER_TX_BAD_BYTES,
+ EFX_MAC_VADAPTER_TX_OVERFLOW,
EFX_MAC_NSTATS
} efx_mac_stat_t;
@@ -321,9 +395,16 @@ typedef enum efx_link_mode_e {
EFX_LINK_1000HDX,
EFX_LINK_1000FDX,
EFX_LINK_10000FDX,
+ EFX_LINK_40000FDX,
EFX_LINK_NMODES
} efx_link_mode_t;
+#define EFX_MAC_ADDR_LEN 6
+
+#define EFX_MAC_ADDR_IS_MULTICAST(_address) (((uint8_t*)_address)[0] & 0x01)
+
+#define EFX_MAC_MULTICAST_LIST_MAX 256
+
#define EFX_MAC_SDU_MAX 9202
#define EFX_MAC_PDU(_sdu) \
@@ -347,11 +428,29 @@ efx_mac_addr_set(
__in efx_nic_t *enp,
__in uint8_t *addr);
-extern __checkReturn int
+extern __checkReturn int
efx_mac_filter_set(
+ __in efx_nic_t *enp,
+ __in boolean_t all_unicst,
+ __in boolean_t mulcst,
+ __in boolean_t all_mulcst,
+ __in boolean_t brdcst);
+
+extern __checkReturn int
+efx_mac_multicast_list_set(
+ __in efx_nic_t *enp,
+ __in_ecount(6*count) uint8_t const *addrs,
+ __in int count);
+
+extern __checkReturn int
+efx_mac_filter_default_rxq_set(
__in efx_nic_t *enp,
- __in boolean_t unicst,
- __in boolean_t brdcst);
+ __in efx_rxq_t *erp,
+ __in boolean_t using_rss);
+
+extern void
+efx_mac_filter_default_rxq_clear(
+ __in efx_nic_t *enp);
extern __checkReturn int
efx_mac_drain(
@@ -381,15 +480,41 @@ efx_mac_fcntl_get(
#define EFX_MAC_HASH_BITS (1 << 8)
extern __checkReturn int
+efx_pktfilter_init(
+ __in efx_nic_t *enp);
+
+extern void
+efx_pktfilter_fini(
+ __in efx_nic_t *enp);
+
+extern __checkReturn int
+efx_pktfilter_set(
+ __in efx_nic_t *enp,
+ __in boolean_t unicst,
+ __in boolean_t brdcst);
+
+extern __checkReturn int
efx_mac_hash_set(
__in efx_nic_t *enp,
__in_ecount(EFX_MAC_HASH_BITS) unsigned int const *bucket);
+#if EFSYS_OPT_MCAST_FILTER_LIST
+extern __checkReturn int
+efx_pktfilter_mcast_list_set(
+ __in efx_nic_t *enp,
+ __in uint8_t const *addrs,
+ __in int count);
+#endif /* EFSYS_OPT_MCAST_FILTER_LIST */
+
+extern __checkReturn int
+efx_pktfilter_mcast_all(
+ __in efx_nic_t *enp);
+
#if EFSYS_OPT_MAC_STATS
#if EFSYS_OPT_NAMES
-extern __checkReturn const char __cs *
+extern __checkReturn const char *
efx_mac_stat_name(
__in efx_nic_t *enp,
__in unsigned int id);
@@ -440,12 +565,13 @@ typedef enum efx_mon_type_e {
EFX_MON_LM87,
EFX_MON_MAX6647,
EFX_MON_SFC90X0,
+ EFX_MON_SFC91X0,
EFX_MON_NTYPES
} efx_mon_type_t;
#if EFSYS_OPT_NAMES
-extern const char __cs *
+extern const char *
efx_mon_name(
__in efx_nic_t *enp);
@@ -457,9 +583,10 @@ efx_mon_init(
#if EFSYS_OPT_MON_STATS
-#define EFX_MON_STATS_SIZE 0x100
+#define EFX_MON_STATS_PAGE_SIZE 0x100
+#define EFX_MON_MASK_ELEMENT_SIZE 32
-/* START MKCONFIG GENERATED MonitorHeaderStatsBlock 58706a378332aeee */
+/* START MKCONFIG GENERATED MonitorHeaderStatsBlock c79c86b62a144846 */
typedef enum efx_mon_stat_e {
EFX_MON_STAT_2_5V,
EFX_MON_STAT_VCCP1,
@@ -491,6 +618,45 @@ typedef enum efx_mon_stat_e {
EFX_MON_STAT_VAOE_IN,
EFX_MON_STAT_IAOE,
EFX_MON_STAT_IAOE_IN,
+ EFX_MON_STAT_NIC_POWER,
+ EFX_MON_STAT_0_9V,
+ EFX_MON_STAT_I0_9V,
+ EFX_MON_STAT_I1_2V,
+ EFX_MON_STAT_0_9V_ADC,
+ EFX_MON_STAT_INT_TEMP2,
+ EFX_MON_STAT_VREG_TEMP,
+ EFX_MON_STAT_VREG_0_9V_TEMP,
+ EFX_MON_STAT_VREG_1_2V_TEMP,
+ EFX_MON_STAT_INT_VPTAT,
+ EFX_MON_STAT_INT_ADC_TEMP,
+ EFX_MON_STAT_EXT_VPTAT,
+ EFX_MON_STAT_EXT_ADC_TEMP,
+ EFX_MON_STAT_AMBIENT_TEMP,
+ EFX_MON_STAT_AIRFLOW,
+ EFX_MON_STAT_VDD08D_VSS08D_CSR,
+ EFX_MON_STAT_VDD08D_VSS08D_CSR_EXTADC,
+ EFX_MON_STAT_HOTPOINT_TEMP,
+ EFX_MON_STAT_PHY_POWER_SWITCH_PORT0,
+ EFX_MON_STAT_PHY_POWER_SWITCH_PORT1,
+ EFX_MON_STAT_MUM_VCC,
+ EFX_MON_STAT_0V9_A,
+ EFX_MON_STAT_I0V9_A,
+ EFX_MON_STAT_0V9_A_TEMP,
+ EFX_MON_STAT_0V9_B,
+ EFX_MON_STAT_I0V9_B,
+ EFX_MON_STAT_0V9_B_TEMP,
+ EFX_MON_STAT_CCOM_AVREG_1V2_SUPPLY,
+ EFX_MON_STAT_CCOM_AVREG_1V2_SUPPLY_EXT_ADC,
+ EFX_MON_STAT_CCOM_AVREG_1V8_SUPPLY,
+ EFX_MON_STAT_CCOM_AVREG_1V8_SUPPLY_EXT_ADC,
+ EFX_MON_STAT_CONTROLLER_MASTER_VPTAT,
+ EFX_MON_STAT_CONTROLLER_MASTER_INTERNAL_TEMP,
+ EFX_MON_STAT_CONTROLLER_MASTER_VPTAT_EXT_ADC,
+ EFX_MON_STAT_CONTROLLER_MASTER_INTERNAL_TEMP_EXT_ADC,
+ EFX_MON_STAT_CONTROLLER_SLAVE_VPTAT,
+ EFX_MON_STAT_CONTROLLER_SLAVE_INTERNAL_TEMP,
+ EFX_MON_STAT_CONTROLLER_SLAVE_VPTAT_EXT_ADC,
+ EFX_MON_STAT_CONTROLLER_SLAVE_INTERNAL_TEMP_EXT_ADC,
EFX_MON_NSTATS
} efx_mon_stat_t;
@@ -501,16 +667,17 @@ typedef enum efx_mon_stat_state_e {
EFX_MON_STAT_STATE_WARNING = 1,
EFX_MON_STAT_STATE_FATAL = 2,
EFX_MON_STAT_STATE_BROKEN = 3,
+ EFX_MON_STAT_STATE_NO_READING = 4,
} efx_mon_stat_state_t;
-typedef struct efx_mon_stat_value_t {
+typedef struct efx_mon_stat_value_s {
uint16_t emsv_value;
uint16_t emsv_state;
} efx_mon_stat_value_t;
#if EFSYS_OPT_NAMES
-extern const char __cs *
+extern const char *
efx_mon_stat_name(
__in efx_nic_t *enp,
__in efx_mon_stat_t id);
@@ -540,16 +707,6 @@ efx_mon_fini(
#define MAXMMD ((1 << 5) - 1)
-/* PHY types */
-#define EFX_PHY_NULL 0x0
-#define EFX_PHY_TXC43128 0x1
-#define EFX_PHY_SFX7101 0x3
-#define EFX_PHY_QT2022C2 0x4
-#define EFX_PHY_SFT9001A 0x8
-#define EFX_PHY_QT2025C 0x9
-#define EFX_PHY_SFT9001B 0xa
-#define EFX_PHY_QLX111V 0xc
-
extern __checkReturn int
efx_phy_verify(
__in efx_nic_t *enp);
@@ -596,26 +753,38 @@ typedef enum efx_loopback_type_e {
EFX_LOOPBACK_PHY_XS = 15,
EFX_LOOPBACK_PCS = 16,
EFX_LOOPBACK_PMA_PMD = 17,
+ EFX_LOOPBACK_XPORT = 18,
+ EFX_LOOPBACK_XGMII_WS = 19,
+ EFX_LOOPBACK_XAUI_WS = 20,
+ EFX_LOOPBACK_XAUI_WS_FAR = 21,
+ EFX_LOOPBACK_XAUI_WS_NEAR = 22,
+ EFX_LOOPBACK_GMII_WS = 23,
+ EFX_LOOPBACK_XFI_WS = 24,
+ EFX_LOOPBACK_XFI_WS_FAR = 25,
+ EFX_LOOPBACK_PHYXS_WS = 26,
+ EFX_LOOPBACK_PMA_INT = 27,
+ EFX_LOOPBACK_SD_NEAR = 28,
+ EFX_LOOPBACK_SD_FAR = 29,
+ EFX_LOOPBACK_PMA_INT_WS = 30,
+ EFX_LOOPBACK_SD_FEP2_WS = 31,
+ EFX_LOOPBACK_SD_FEP1_5_WS = 32,
+ EFX_LOOPBACK_SD_FEP_WS = 33,
+ EFX_LOOPBACK_SD_FES_WS = 34,
EFX_LOOPBACK_NTYPES
} efx_loopback_type_t;
-#define EFX_LOOPBACK_MAC_MASK \
- ((1 << EFX_LOOPBACK_DATA) | \
- (1 << EFX_LOOPBACK_GMAC) | \
- (1 << EFX_LOOPBACK_XGMII) | \
- (1 << EFX_LOOPBACK_XGXS) | \
- (1 << EFX_LOOPBACK_XAUI) | \
- (1 << EFX_LOOPBACK_GMII) | \
- (1 << EFX_LOOPBACK_SGMII) | \
- (1 << EFX_LOOPBACK_XGBR) | \
- (1 << EFX_LOOPBACK_XFI) | \
- (1 << EFX_LOOPBACK_XAUI_FAR) | \
- (1 << EFX_LOOPBACK_GMII_FAR) | \
- (1 << EFX_LOOPBACK_SGMII_FAR) | \
- (1 << EFX_LOOPBACK_XFI_FAR))
-
-#define EFX_LOOPBACK_MASK \
- ((1 << EFX_LOOPBACK_NTYPES) - 1)
+typedef enum efx_loopback_kind_e {
+ EFX_LOOPBACK_KIND_OFF = 0,
+ EFX_LOOPBACK_KIND_ALL,
+ EFX_LOOPBACK_KIND_MAC,
+ EFX_LOOPBACK_KIND_PHY,
+ EFX_LOOPBACK_NKINDS
+} efx_loopback_kind_t;
+
+extern void
+efx_loopback_mask(
+ __in efx_loopback_kind_t loopback_kind,
+ __out efx_qword_t *maskp);
extern __checkReturn int
efx_port_loopback_set(
@@ -625,7 +794,7 @@ efx_port_loopback_set(
#if EFSYS_OPT_NAMES
-extern __checkReturn const char __cs *
+extern __checkReturn const char *
efx_loopback_type_name(
__in efx_nic_t *enp,
__in efx_loopback_type_t type);
@@ -637,7 +806,7 @@ efx_loopback_type_name(
extern __checkReturn int
efx_port_poll(
__in efx_nic_t *enp,
- __out efx_link_mode_t *link_modep);
+ __out_opt efx_link_mode_t *link_modep);
extern void
efx_port_fini(
@@ -655,6 +824,7 @@ typedef enum efx_phy_cap_type_e {
EFX_PHY_CAP_PAUSE,
EFX_PHY_CAP_ASYM,
EFX_PHY_CAP_AN,
+ EFX_PHY_CAP_40000FDX,
EFX_PHY_CAP_NTYPES
} efx_phy_cap_type_t;
@@ -692,6 +862,7 @@ typedef enum efx_phy_media_type_e {
EFX_PHY_MEDIA_XFP,
EFX_PHY_MEDIA_SFP_PLUS,
EFX_PHY_MEDIA_BASE_T,
+ EFX_PHY_MEDIA_QSFP_PLUS,
EFX_PHY_MEDIA_NTYPES
} efx_phy_media_type_t;
@@ -762,7 +933,7 @@ typedef enum efx_phy_stat_e {
#if EFSYS_OPT_NAMES
-extern const char __cs *
+extern const char *
efx_phy_stat_name(
__in efx_nic_t *enp,
__in efx_phy_stat_t stat);
@@ -783,7 +954,7 @@ efx_phy_stats_update(
#if EFSYS_OPT_NAMES
-extern const char __cs *
+extern const char *
efx_phy_prop_name(
__in efx_nic_t *enp,
__in unsigned int id);
@@ -807,22 +978,25 @@ efx_phy_prop_set(
#endif /* EFSYS_OPT_PHY_PROPS */
-#if EFSYS_OPT_PHY_BIST
-
-typedef enum efx_phy_bist_type_e {
- EFX_PHY_BIST_TYPE_UNKNOWN,
- EFX_PHY_BIST_TYPE_NORMAL,
- EFX_PHY_BIST_TYPE_CABLE_SHORT,
- EFX_PHY_BIST_TYPE_CABLE_LONG,
- EFX_PHY_BIST_TYPE_NTYPES,
-} efx_phy_bist_type_t;
-
-typedef enum efx_phy_bist_result_e {
- EFX_PHY_BIST_RESULT_UNKNOWN,
- EFX_PHY_BIST_RESULT_RUNNING,
- EFX_PHY_BIST_RESULT_PASSED,
- EFX_PHY_BIST_RESULT_FAILED,
-} efx_phy_bist_result_t;
+#if EFSYS_OPT_BIST
+
+typedef enum efx_bist_type_e {
+ EFX_BIST_TYPE_UNKNOWN,
+ EFX_BIST_TYPE_PHY_NORMAL,
+ EFX_BIST_TYPE_PHY_CABLE_SHORT,
+ EFX_BIST_TYPE_PHY_CABLE_LONG,
+ EFX_BIST_TYPE_MC_MEM, /* Test the MC DMEM and IMEM */
+ EFX_BIST_TYPE_SAT_MEM, /* Test the DMEM and IMEM of satellite cpus*/
+ EFX_BIST_TYPE_REG, /* Test the register memories */
+ EFX_BIST_TYPE_NTYPES,
+} efx_bist_type_t;
+
+typedef enum efx_bist_result_e {
+ EFX_BIST_RESULT_UNKNOWN,
+ EFX_BIST_RESULT_RUNNING,
+ EFX_BIST_RESULT_PASSED,
+ EFX_BIST_RESULT_FAILED,
+} efx_bist_result_t;
typedef enum efx_phy_cable_status_e {
EFX_PHY_CABLE_STATUS_OK,
@@ -833,39 +1007,53 @@ typedef enum efx_phy_cable_status_e {
EFX_PHY_CABLE_STATUS_BUSY,
} efx_phy_cable_status_t;
-typedef enum efx_phy_bist_value_e {
- EFX_PHY_BIST_CABLE_LENGTH_A,
- EFX_PHY_BIST_CABLE_LENGTH_B,
- EFX_PHY_BIST_CABLE_LENGTH_C,
- EFX_PHY_BIST_CABLE_LENGTH_D,
- EFX_PHY_BIST_CABLE_STATUS_A,
- EFX_PHY_BIST_CABLE_STATUS_B,
- EFX_PHY_BIST_CABLE_STATUS_C,
- EFX_PHY_BIST_CABLE_STATUS_D,
- EFX_PHY_BIST_FAULT_CODE,
- EFX_PHY_BIST_NVALUES,
-} efx_phy_bist_value_t;
+typedef enum efx_bist_value_e {
+ EFX_BIST_PHY_CABLE_LENGTH_A,
+ EFX_BIST_PHY_CABLE_LENGTH_B,
+ EFX_BIST_PHY_CABLE_LENGTH_C,
+ EFX_BIST_PHY_CABLE_LENGTH_D,
+ EFX_BIST_PHY_CABLE_STATUS_A,
+ EFX_BIST_PHY_CABLE_STATUS_B,
+ EFX_BIST_PHY_CABLE_STATUS_C,
+ EFX_BIST_PHY_CABLE_STATUS_D,
+ EFX_BIST_FAULT_CODE,
+ /* Memory BIST specific values. These match to the MC_CMD_BIST_POLL
+ * response. */
+ EFX_BIST_MEM_TEST,
+ EFX_BIST_MEM_ADDR,
+ EFX_BIST_MEM_BUS,
+ EFX_BIST_MEM_EXPECT,
+ EFX_BIST_MEM_ACTUAL,
+ EFX_BIST_MEM_ECC,
+ EFX_BIST_MEM_ECC_PARITY,
+ EFX_BIST_MEM_ECC_FATAL,
+ EFX_BIST_NVALUES,
+} efx_bist_value_t;
+
+extern __checkReturn int
+efx_bist_enable_offline(
+ __in efx_nic_t *enp);
extern __checkReturn int
-efx_phy_bist_start(
+efx_bist_start(
__in efx_nic_t *enp,
- __in efx_phy_bist_type_t type);
+ __in efx_bist_type_t type);
extern __checkReturn int
-efx_phy_bist_poll(
+efx_bist_poll(
__in efx_nic_t *enp,
- __in efx_phy_bist_type_t type,
- __out efx_phy_bist_result_t *resultp,
+ __in efx_bist_type_t type,
+ __out efx_bist_result_t *resultp,
__out_opt uint32_t *value_maskp,
__out_ecount_opt(count) unsigned long *valuesp,
__in size_t count);
extern void
-efx_phy_bist_stop(
+efx_bist_stop(
__in efx_nic_t *enp,
- __in efx_phy_bist_type_t type);
+ __in efx_bist_type_t type);
-#endif /* EFSYS_OPT_PHY_BIST */
+#endif /* EFSYS_OPT_BIST */
#define EFX_FEATURE_IPV6 0x00000001
#define EFX_FEATURE_LFSR_HASH_INSERT 0x00000002
@@ -876,6 +1064,10 @@ efx_phy_bist_stop(
#define EFX_FEATURE_LOOKAHEAD_SPLIT 0x00000040
#define EFX_FEATURE_MAC_HEADER_FILTERS 0x00000080
#define EFX_FEATURE_TURBO 0x00000100
+#define EFX_FEATURE_MCDI_DMA 0x00000200
+#define EFX_FEATURE_TX_SRC_FILTERS 0x00000400
+#define EFX_FEATURE_PIO_BUFFERS 0x00000800
+#define EFX_FEATURE_FW_ASSISTED_TSO 0x00001000
typedef struct efx_nic_cfg_s {
uint32_t enc_board_type;
@@ -886,20 +1078,29 @@ typedef struct efx_nic_cfg_s {
char enc_phy_revision[21];
efx_mon_type_t enc_mon_type;
#if EFSYS_OPT_MON_STATS
- uint32_t enc_mon_stat_mask;
+ uint32_t enc_mon_stat_dma_buf_size;
+ uint32_t enc_mon_stat_mask[(EFX_MON_NSTATS + 31) / 32];
#endif
unsigned int enc_features;
uint8_t enc_mac_addr[6];
- uint8_t enc_port;
+ uint8_t enc_port; /* PHY port number */
+ uint32_t enc_func_flags;
+ uint32_t enc_intr_vec_base;
+ uint32_t enc_intr_limit;
uint32_t enc_evq_limit;
uint32_t enc_txq_limit;
uint32_t enc_rxq_limit;
uint32_t enc_buftbl_limit;
+ uint32_t enc_piobuf_limit;
+ uint32_t enc_piobuf_size;
uint32_t enc_evq_timer_quantum_ns;
uint32_t enc_evq_timer_max_us;
uint32_t enc_clk_mult;
+ uint32_t enc_rx_prefix_size;
+ uint32_t enc_rx_buf_align_start;
+ uint32_t enc_rx_buf_align_end;
#if EFSYS_OPT_LOOPBACK
- uint32_t enc_loopback_types[EFX_LINK_NMODES];
+ efx_qword_t enc_loopback_types[EFX_LINK_NMODES];
#endif /* EFSYS_OPT_LOOPBACK */
#if EFSYS_OPT_PHY_FLAGS
uint32_t enc_phy_flags_mask;
@@ -914,23 +1115,100 @@ typedef struct efx_nic_cfg_s {
unsigned int enc_phy_nprops;
#endif /* EFSYS_OPT_PHY_PROPS */
#if EFSYS_OPT_SIENA
- uint8_t enc_siena_channel;
+ uint8_t enc_mcdi_mdio_channel;
#if EFSYS_OPT_PHY_STATS
- uint32_t enc_siena_phy_stat_mask;
+ uint32_t enc_mcdi_phy_stat_mask;
#endif /* EFSYS_OPT_PHY_STATS */
+#endif /* EFSYS_OPT_SIENA */
+#if (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
#if EFSYS_OPT_MON_STATS
- uint32_t enc_siena_mon_stat_mask;
+ uint32_t *enc_mcdi_sensor_maskp;
+ uint32_t enc_mcdi_sensor_mask_size;
#endif /* EFSYS_OPT_MON_STATS */
-#endif /* EFSYS_OPT_SIENA */
-#if EFSYS_OPT_PHY_BIST
+#endif /* (EFSYS_OPT_SIENA | EFSYS_OPT_HUNTINGTON) */
+#if EFSYS_OPT_BIST
uint32_t enc_bist_mask;
-#endif /* EFSYS_OPT_PHY_BIST */
+#endif /* EFSYS_OPT_BIST */
+#if EFSYS_OPT_HUNTINGTON
+ uint32_t enc_pf;
+ uint32_t enc_vf;
+ uint32_t enc_privilege_mask;
+#endif /* EFSYS_OPT_HUNTINGTON */
+ boolean_t enc_bug26807_workaround;
+ boolean_t enc_bug35388_workaround;
+ boolean_t enc_bug41750_workaround;
+ boolean_t enc_rx_batching_enabled;
+ /* Maximum number of descriptors completed in an rx event. */
+ uint32_t enc_rx_batch_max;
+ /* Number of rx descriptors the hardware requires for a push. */
+ uint32_t enc_rx_push_align;
+ /*
+ * Maximum number of bytes into the packet the TCP header can start for
+ * the hardware to apply TSO packet edits.
+ */
+ uint32_t enc_tx_tso_tcp_header_offset_limit;
+ boolean_t enc_fw_assisted_tso_enabled;
+ boolean_t enc_hw_tx_insert_vlan_enabled;
+ /* Datapath firmware vadapter/vport/vswitch support */
+ boolean_t enc_datapath_cap_evb;
+ /* External port identifier */
+ uint8_t enc_external_port;
} efx_nic_cfg_t;
+#define EFX_PCI_FUNCTION_IS_PF(_encp) ((_encp)->enc_vf == 0xffff)
+#define EFX_PCI_FUNCTION_IS_VF(_encp) ((_encp)->enc_vf != 0xffff)
+
+#define EFX_PCI_FUNCTION(_encp) \
+ (EFX_PCI_FUNCTION_IS_PF(_encp) ? (_encp)->enc_pf : (_encp)->enc_vf)
+
+#define EFX_PCI_VF_PARENT(_encp) ((_encp)->enc_pf)
+
extern const efx_nic_cfg_t *
efx_nic_cfg_get(
__in efx_nic_t *enp);
+/* Driver resource limits (minimum required/maximum usable). */
+typedef struct efx_drv_limits_s
+{
+ uint32_t edl_min_evq_count;
+ uint32_t edl_max_evq_count;
+
+ uint32_t edl_min_rxq_count;
+ uint32_t edl_max_rxq_count;
+
+ uint32_t edl_min_txq_count;
+ uint32_t edl_max_txq_count;
+
+ /* PIO blocks (sub-allocated from piobuf) */
+ uint32_t edl_min_pio_alloc_size;
+ uint32_t edl_max_pio_alloc_count;
+} efx_drv_limits_t;
+
+extern __checkReturn int
+efx_nic_set_drv_limits(
+ __inout efx_nic_t *enp,
+ __in efx_drv_limits_t *edlp);
+
+typedef enum efx_nic_region_e {
+ EFX_REGION_VI, /* Memory BAR UC mapping */
+ EFX_REGION_PIO_WRITE_VI, /* Memory BAR WC mapping */
+} efx_nic_region_t;
+
+extern __checkReturn int
+efx_nic_get_bar_region(
+ __in efx_nic_t *enp,
+ __in efx_nic_region_t region,
+ __out uint32_t *offsetp,
+ __out size_t *sizep);
+
+extern __checkReturn int
+efx_nic_get_vi_pool(
+ __in efx_nic_t *enp,
+ __out uint32_t *evq_countp,
+ __out uint32_t *rxq_countp,
+ __out uint32_t *txq_countp);
+
+
#if EFSYS_OPT_VPD
typedef enum efx_vpd_tag_e {
@@ -1029,6 +1307,7 @@ typedef enum efx_nvram_type_e {
EFX_NVRAM_FCFW,
EFX_NVRAM_CPLD,
EFX_NVRAM_FPGA_BACKUP,
+ EFX_NVRAM_DYNAMIC_CFG,
EFX_NVRAM_NTYPES,
} efx_nvram_type_t;
@@ -1080,7 +1359,15 @@ extern __checkReturn int
efx_nvram_set_version(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
- __out uint16_t version[4]);
+ __in_ecount(4) uint16_t version[4]);
+
+/* Validate contents of TLV formatted partition */
+extern __checkReturn int
+efx_nvram_tlv_validate(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __in_bcount(partn_size) caddr_t partn_data,
+ __in size_t partn_size);
extern __checkReturn int
efx_nvram_erase(
@@ -1246,12 +1533,11 @@ typedef struct efx_evq_s efx_evq_t;
#if EFSYS_OPT_QSTATS
-/* START MKCONFIG GENERATED EfxHeaderEventQueueBlock d5614a5d669c8ca3 */
+/* START MKCONFIG GENERATED EfxHeaderEventQueueBlock 6f3843f5fe7cc843 */
typedef enum efx_ev_qstat_e {
EV_ALL,
EV_RX,
EV_RX_OK,
- EV_RX_RECOVERY,
EV_RX_FRM_TRUNC,
EV_RX_TOBE_DISC,
EV_RX_PAUSE_FRM_ERR,
@@ -1269,16 +1555,14 @@ typedef enum efx_ev_qstat_e {
EV_RX_OTHER_IPV4,
EV_RX_OTHER_IPV6,
EV_RX_NON_IP,
- EV_RX_OVERRUN,
+ EV_RX_BATCH,
EV_TX,
EV_TX_WQ_FF_FULL,
EV_TX_PKT_ERR,
EV_TX_PKT_TOO_BIG,
EV_TX_UNEXPECTED,
EV_GLOBAL,
- EV_GLOBAL_PHY,
EV_GLOBAL_MNT,
- EV_GLOBAL_RX_RECOVERY,
EV_DRIVER,
EV_DRIVER_SRM_UPD_DONE,
EV_DRIVER_TX_DESCQ_FLS_DONE,
@@ -1303,13 +1587,9 @@ extern void
efx_ev_fini(
__in efx_nic_t *enp);
-#define EFX_MASK(_max, _min) (-((_max) << 1) ^ -(_min))
-
#define EFX_EVQ_MAXNEVS 32768
#define EFX_EVQ_MINNEVS 512
-#define EFX_EVQ_NEVS_MASK EFX_MASK(EFX_EVQ_MAXNEVS, EFX_EVQ_MINNEVS)
-
#define EFX_EVQ_SIZE(_nevs) ((_nevs) * sizeof (efx_qword_t))
#define EFX_EVQ_NBUFS(_nevs) (EFX_EVQ_SIZE(_nevs) / EFX_BUF_SIZE)
@@ -1345,6 +1625,7 @@ typedef __checkReturn boolean_t
#define EFX_PKT_IPV4 0x0800
#define EFX_PKT_IPV6 0x1000
+#define EFX_PKT_PREFIX_LEN 0x2000
#define EFX_ADDR_MISMATCH 0x4000
#define EFX_DISCARD 0x8000
@@ -1371,6 +1652,9 @@ typedef __checkReturn boolean_t
#define EFX_EXCEPTION_UNKNOWN_SENSOREVT 0x00000004
#define EFX_EXCEPTION_FWALERT_SRAM 0x00000005
#define EFX_EXCEPTION_UNKNOWN_FWALERT 0x00000006
+#define EFX_EXCEPTION_RX_ERROR 0x00000007
+#define EFX_EXCEPTION_TX_ERROR 0x00000008
+#define EFX_EXCEPTION_EV_ERROR 0x00000009
typedef __checkReturn boolean_t
(*efx_exception_ev_t)(
@@ -1460,7 +1744,7 @@ typedef struct efx_ev_callbacks_s {
#endif /* EFSYS_OPT_MON_STATS */
#if EFSYS_OPT_MAC_STATS
efx_mac_stats_ev_t eec_mac_stats;
-#endif /* EFSYS_OPT_MON_STATS */
+#endif /* EFSYS_OPT_MAC_STATS */
} efx_ev_callbacks_t;
extern __checkReturn boolean_t
@@ -1498,7 +1782,7 @@ efx_ev_qprime(
#if EFSYS_OPT_NAMES
-extern const char __cs *
+extern const char *
efx_ev_qstat_name(
__in efx_nic_t *enp,
__in unsigned int id);
@@ -1518,11 +1802,9 @@ efx_ev_qdestroy(
/* RX */
-typedef struct efx_rxq_s efx_rxq_t;
-
extern __checkReturn int
efx_rx_init(
- __in efx_nic_t *enp);
+ __inout efx_nic_t *enp);
extern void
efx_rx_fini(
@@ -1558,10 +1840,32 @@ typedef enum efx_rx_hash_type_e {
EFX_RX_HASH_TCPIPV6,
} efx_rx_hash_type_t;
+typedef enum efx_rx_hash_support_e {
+ EFX_RX_HASH_UNAVAILABLE = 0, /* Hardware hash not inserted */
+ EFX_RX_HASH_AVAILABLE /* Insert hash with/without RSS */
+} efx_rx_hash_support_t;
+
#define EFX_RSS_TBL_SIZE 128 /* Rows in RX indirection table */
#define EFX_MAXRSS 64 /* RX indirection entry range */
#define EFX_MAXRSS_LEGACY 16 /* See bug16611 and bug17213 */
+typedef enum efx_rx_scale_support_e {
+ EFX_RX_SCALE_UNAVAILABLE = 0, /* Not supported */
+ EFX_RX_SCALE_EXCLUSIVE, /* Writable key/indirection table */
+ EFX_RX_SCALE_SHARED /* Read-only key/indirection table */
+} efx_rx_scale_support_t;
+
+ extern __checkReturn int
+efx_rx_hash_support_get(
+ __in efx_nic_t *enp,
+ __out efx_rx_hash_support_t *supportp);
+
+
+extern __checkReturn int
+efx_rx_scale_support_get(
+ __in efx_nic_t *enp,
+ __out efx_rx_scale_support_t *supportp);
+
extern __checkReturn int
efx_rx_scale_mode_set(
__in efx_nic_t *enp,
@@ -1576,54 +1880,28 @@ efx_rx_scale_tbl_set(
__in size_t n);
extern __checkReturn int
-efx_rx_scale_toeplitz_ipv4_key_set(
+efx_rx_scale_key_set(
__in efx_nic_t *enp,
__in_ecount(n) uint8_t *key,
__in size_t n);
-extern __checkReturn int
-efx_rx_scale_toeplitz_ipv6_key_set(
+extern uint32_t
+efx_psuedo_hdr_hash_get(
__in efx_nic_t *enp,
- __in_ecount(n) uint8_t *key,
- __in size_t n);
-
-/*
- * The prefix is a byte array of one of the forms:
- *
- * 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
- * XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.TT.TT.TT.TT
- * XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.LL.LL
- *
- * where:
- *
- * TT.TT.TT.TT is a 32-bit Toeplitz hash
- * LL.LL is a 16-bit LFSR hash
- *
- * Hash values are in network (big-endian) byte order.
- */
-
-#define EFX_RX_PREFIX_SIZE 16
-
-#define EFX_RX_HASH_VALUE(_func, _buffer) \
- (((_func) == EFX_RX_HASHALG_LFSR) ? \
- ((uint16_t)(((_buffer)[14] << 8) | (_buffer)[15])) : \
- ((uint32_t)(((_buffer)[12] << 24) | \
- ((_buffer)[13] << 16) | \
- ((_buffer)[14] << 8) | \
- (_buffer)[15])))
-
-#define EFX_RX_HASH_SIZE(_func) \
- (((_func) == EFX_RX_HASHALG_LFSR) ? \
- sizeof (uint16_t) : \
- sizeof (uint32_t))
+ __in efx_rx_hash_alg_t func,
+ __in uint8_t *buffer);
#endif /* EFSYS_OPT_RX_SCALE */
+extern __checkReturn int
+efx_psuedo_hdr_pkt_length_get(
+ __in efx_nic_t *enp,
+ __in uint8_t *buffer,
+ __out uint16_t *pkt_lengthp);
+
#define EFX_RXQ_MAXNDESCS 4096
#define EFX_RXQ_MINNDESCS 512
-#define EFX_RXQ_NDESCS_MASK EFX_MASK(EFX_RXQ_MAXNDESCS, EFX_RXQ_MINNDESCS)
-
#define EFX_RXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t))
#define EFX_RXQ_NBUFS(_ndescs) (EFX_RXQ_SIZE(_ndescs) / EFX_BUF_SIZE)
#define EFX_RXQ_LIMIT(_ndescs) ((_ndescs) - 16)
@@ -1655,6 +1933,10 @@ typedef struct efx_buffer_s {
boolean_t eb_eop;
} efx_buffer_t;
+typedef struct efx_desc_s {
+ efx_qword_t ed_eq;
+} efx_desc_t;
+
extern void
efx_rx_qpost(
__in efx_rxq_t *erp,
@@ -1667,9 +1949,10 @@ efx_rx_qpost(
extern void
efx_rx_qpush(
__in efx_rxq_t *erp,
- __in unsigned int added);
+ __in unsigned int added,
+ __inout unsigned int *pushedp);
-extern void
+extern __checkReturn int
efx_rx_qflush(
__in efx_rxq_t *erp);
@@ -1687,10 +1970,10 @@ typedef struct efx_txq_s efx_txq_t;
#if EFSYS_OPT_QSTATS
-/* START MKCONFIG GENERATED EfxHeaderTransmitQueueBlock 536c5fa5014944bf */
+/* START MKCONFIG GENERATED EfxHeaderTransmitQueueBlock 12dff8778598b2db */
typedef enum efx_tx_qstat_e {
TX_POST,
- TX_UNALIGNED_SPLIT,
+ TX_POST_PIO,
TX_NQSTATS
} efx_tx_qstat_t;
@@ -1706,16 +1989,21 @@ extern void
efx_tx_fini(
__in efx_nic_t *enp);
-#define EFX_TXQ_MAXNDESCS 4096
-#define EFX_TXQ_MINNDESCS 512
+#define EFX_BUG35388_WORKAROUND(_encp) \
+ (((_encp) == NULL) ? 1 : ((_encp)->enc_bug35388_workaround != 0))
+
+#define EFX_TXQ_MAXNDESCS(_encp) \
+ ((EFX_BUG35388_WORKAROUND(_encp)) ? 2048 : 4096)
-#define EFX_TXQ_NDESCS_MASK EFX_MASK(EFX_TXQ_MAXNDESCS, EFX_TXQ_MINNDESCS)
+#define EFX_TXQ_MINNDESCS 512
#define EFX_TXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t))
#define EFX_TXQ_NBUFS(_ndescs) (EFX_TXQ_SIZE(_ndescs) / EFX_BUF_SIZE)
#define EFX_TXQ_LIMIT(_ndescs) ((_ndescs) - 16)
#define EFX_TXQ_DC_NDESCS(_dcsize) (8 << _dcsize)
+#define EFX_TXQ_MAX_BUFS 8 /* Maximum independent of EFX_BUG35388_WORKAROUND. */
+
extern __checkReturn int
efx_tx_qcreate(
__in efx_nic_t *enp,
@@ -1726,7 +2014,8 @@ efx_tx_qcreate(
__in uint32_t id,
__in uint16_t flags,
__in efx_evq_t *eep,
- __deref_out efx_txq_t **etpp);
+ __deref_out efx_txq_t **etpp,
+ __out unsigned int *addedp);
extern __checkReturn int
efx_tx_qpost(
@@ -1741,24 +2030,77 @@ efx_tx_qpace(
__in efx_txq_t *etp,
__in unsigned int ns);
-extern void
+extern void
efx_tx_qpush(
- __in efx_txq_t *etp,
- __in unsigned int added);
+ __in efx_txq_t *etp,
+ __in unsigned int added,
+ __in unsigned int pushed);
-extern void
+extern __checkReturn int
efx_tx_qflush(
- __in efx_txq_t *etp);
+ __in efx_txq_t *etp);
-extern void
+extern void
efx_tx_qenable(
- __in efx_txq_t *etp);
+ __in efx_txq_t *etp);
+
+extern __checkReturn int
+efx_tx_qpio_enable(
+ __in efx_txq_t *etp);
+
+extern void
+efx_tx_qpio_disable(
+ __in efx_txq_t *etp);
+
+extern __checkReturn int
+efx_tx_qpio_write(
+ __in efx_txq_t *etp,
+ __in_ecount(buf_length) uint8_t *buffer,
+ __in size_t buf_length,
+ __in size_t pio_buf_offset);
+
+extern __checkReturn int
+efx_tx_qpio_post(
+ __in efx_txq_t *etp,
+ __in size_t pkt_length,
+ __in unsigned int completed,
+ __inout unsigned int *addedp);
+
+extern __checkReturn int
+efx_tx_qdesc_post(
+ __in efx_txq_t *etp,
+ __in_ecount(n) efx_desc_t *ed,
+ __in unsigned int n,
+ __in unsigned int completed,
+ __inout unsigned int *addedp);
+
+extern void
+efx_tx_qdesc_dma_create(
+ __in efx_txq_t *etp,
+ __in efsys_dma_addr_t addr,
+ __in size_t size,
+ __in boolean_t eop,
+ __out efx_desc_t *edp);
+
+extern void
+efx_tx_qdesc_tso_create(
+ __in efx_txq_t *etp,
+ __in uint16_t ipv4_id,
+ __in uint32_t tcp_seq,
+ __in uint8_t tcp_flags,
+ __out efx_desc_t *edp);
+
+extern void
+efx_tx_qdesc_vlantci_create(
+ __in efx_txq_t *etp,
+ __in uint16_t tci,
+ __out efx_desc_t *edp);
#if EFSYS_OPT_QSTATS
#if EFSYS_OPT_NAMES
-extern const char __cs *
+extern const char *
efx_tx_qstat_name(
__in efx_nic_t *etp,
__in unsigned int id);
@@ -1781,21 +2123,89 @@ efx_tx_qdestroy(
#if EFSYS_OPT_FILTER
+#define EFX_ETHER_TYPE_IPV4 0x0800
+#define EFX_ETHER_TYPE_IPV6 0x86DD
+
+#define EFX_IPPROTO_TCP 6
+#define EFX_IPPROTO_UDP 17
+
typedef enum efx_filter_flag_e {
EFX_FILTER_FLAG_RX_RSS = 0x01, /* use RSS to spread across
* multiple queues */
EFX_FILTER_FLAG_RX_SCATTER = 0x02, /* enable RX scatter */
- EFX_FILTER_FLAG_RX_OVERRIDE_IP = 0x04, /* MAC filter overrides
- * any matching IP filter */
+ EFX_FILTER_FLAG_RX_OVER_AUTO = 0x04, /* Override an automatic filter
+ * (priority EFX_FILTER_PRI_AUTO).
+ * May only be set by the filter
+ * implementation for each type.
+ * A removal request will
+ * restore the automatic filter
+ * in its place. */
+ EFX_FILTER_FLAG_RX = 0x08, /* Filter is for RX */
+ EFX_FILTER_FLAG_TX = 0x10, /* Filter is for TX */
} efx_filter_flag_t;
+typedef enum efx_filter_match_flags_e {
+ EFX_FILTER_MATCH_REM_HOST = 0x0001, /* Match by remote IP host
+ * address */
+ EFX_FILTER_MATCH_LOC_HOST = 0x0002, /* Match by local IP host
+ * address */
+ EFX_FILTER_MATCH_REM_MAC = 0x0004, /* Match by remote MAC address */
+ EFX_FILTER_MATCH_REM_PORT = 0x0008, /* Match by remote TCP/UDP port */
+ EFX_FILTER_MATCH_LOC_MAC = 0x0010, /* Match by remote TCP/UDP port */
+ EFX_FILTER_MATCH_LOC_PORT = 0x0020, /* Match by local TCP/UDP port */
+ EFX_FILTER_MATCH_ETHER_TYPE = 0x0040, /* Match by Ether-type */
+ EFX_FILTER_MATCH_INNER_VID = 0x0080, /* Match by inner VLAN ID */
+ EFX_FILTER_MATCH_OUTER_VID = 0x0100, /* Match by outer VLAN ID */
+ EFX_FILTER_MATCH_IP_PROTO = 0x0200, /* Match by IP transport
+ * protocol */
+ EFX_FILTER_MATCH_LOC_MAC_IG = 0x0400, /* Match by local MAC address
+ * I/G bit. Used for RX default
+ * unicast and multicast/
+ * broadcast filters. */
+} efx_filter_match_flags_t;
+
+typedef enum efx_filter_priority_s {
+ EFX_FILTER_PRI_HINT = 0, /* Performance hint */
+ EFX_FILTER_PRI_AUTO, /* Automatic filter based on device
+ * address list or hardware
+ * requirements. This may only be used
+ * by the filter implementation for
+ * each NIC type. */
+ EFX_FILTER_PRI_MANUAL, /* Manually configured filter */
+ EFX_FILTER_PRI_REQUIRED, /* Required for correct behaviour of the
+ * client (e.g. SR-IOV, HyperV VMQ etc.)
+ */
+} efx_filter_priority_t;
+
+/*
+ * FIXME: All these fields are assumed to be in little-endian byte order.
+ * It may be better for some to be big-endian. See bug42804.
+ */
+
typedef struct efx_filter_spec_s {
- uint8_t efs_type;
- uint8_t efs_flags;
- uint16_t efs_dmaq_id;
- uint32_t efs_dword[3];
+ uint32_t efs_match_flags:12;
+ uint32_t efs_priority:2;
+ uint32_t efs_flags:6;
+ uint32_t efs_dmaq_id:12;
+ uint32_t efs_rss_context;
+ uint16_t efs_outer_vid;
+ uint16_t efs_inner_vid;
+ uint8_t efs_loc_mac[EFX_MAC_ADDR_LEN];
+ uint8_t efs_rem_mac[EFX_MAC_ADDR_LEN];
+ uint16_t efs_ether_type;
+ uint8_t efs_ip_proto;
+ uint16_t efs_loc_port;
+ uint16_t efs_rem_port;
+ efx_oword_t efs_rem_host;
+ efx_oword_t efs_loc_host;
} efx_filter_spec_t;
+
+/* Default values for use in filter specifications */
+#define EFX_FILTER_SPEC_RSS_CONTEXT_DEFAULT 0xffffffff
+#define EFX_FILTER_SPEC_RX_DMAQ_ID_DROP 0xfff
+#define EFX_FILTER_SPEC_VID_UNSPEC 0xffff
+
extern __checkReturn int
efx_filter_init(
__in efx_nic_t *enp);
@@ -1805,115 +2215,82 @@ efx_filter_fini(
__in efx_nic_t *enp);
extern __checkReturn int
-efx_rx_filter_insert(
- __in efx_rxq_t *erp,
+efx_filter_insert(
+ __in efx_nic_t *enp,
__inout efx_filter_spec_t *spec);
extern __checkReturn int
-efx_rx_filter_remove(
- __in efx_rxq_t *erp,
+efx_filter_remove(
+ __in efx_nic_t *enp,
__inout efx_filter_spec_t *spec);
- void
+extern __checkReturn int
efx_filter_restore(
__in efx_nic_t *enp);
-extern void
-efx_filter_spec_rx_ipv4_tcp_full(
- __inout efx_filter_spec_t *spec,
- __in unsigned int flags,
- __in uint32_t src_ip,
- __in uint16_t src_tcp,
- __in uint32_t dest_ip,
- __in uint16_t dest_tcp);
+extern __checkReturn int
+efx_filter_supported_filters(
+ __in efx_nic_t *enp,
+ __out uint32_t *list,
+ __out size_t *length);
extern void
-efx_filter_spec_rx_ipv4_tcp_wild(
+efx_filter_spec_init_rx(
__inout efx_filter_spec_t *spec,
- __in unsigned int flags,
- __in uint32_t dest_ip,
- __in uint16_t dest_tcp);
+ __in efx_filter_priority_t priority,
+ __in efx_filter_flag_t flags,
+ __in efx_rxq_t *erp);
extern void
-efx_filter_spec_rx_ipv4_udp_full(
+efx_filter_spec_init_tx(
__inout efx_filter_spec_t *spec,
- __in unsigned int flags,
- __in uint32_t src_ip,
- __in uint16_t src_udp,
- __in uint32_t dest_ip,
- __in uint16_t dest_udp);
+ __in efx_txq_t *etp);
-extern void
-efx_filter_spec_rx_ipv4_udp_wild(
+extern __checkReturn int
+efx_filter_spec_set_ipv4_local(
__inout efx_filter_spec_t *spec,
- __in unsigned int flags,
- __in uint32_t dest_ip,
- __in uint16_t dest_udp);
+ __in uint8_t proto,
+ __in uint32_t host,
+ __in uint16_t port);
-extern void
-efx_filter_spec_rx_mac_full(
+extern __checkReturn int
+efx_filter_spec_set_ipv4_full(
__inout efx_filter_spec_t *spec,
- __in unsigned int flags,
- __in uint16_t vlan_id,
- __in uint8_t *dest_mac);
+ __in uint8_t proto,
+ __in uint32_t lhost,
+ __in uint16_t lport,
+ __in uint32_t rhost,
+ __in uint16_t rport);
-extern void
-efx_filter_spec_rx_mac_wild(
+extern __checkReturn int
+efx_filter_spec_set_eth_local(
__inout efx_filter_spec_t *spec,
- __in unsigned int flags,
- __in uint8_t *dest_mac);
-
+ __in uint16_t vid,
+ __in const uint8_t *addr);
extern __checkReturn int
-efx_tx_filter_insert(
- __in efx_txq_t *etp,
+efx_filter_spec_set_uc_def(
__inout efx_filter_spec_t *spec);
extern __checkReturn int
-efx_tx_filter_remove(
- __in efx_txq_t *etp,
+efx_filter_spec_set_mc_def(
__inout efx_filter_spec_t *spec);
-extern void
-efx_filter_spec_tx_ipv4_tcp_full(
- __inout efx_filter_spec_t *spec,
- __in uint32_t src_ip,
- __in uint16_t src_tcp,
- __in uint32_t dest_ip,
- __in uint16_t dest_tcp);
-
-extern void
-efx_filter_spec_tx_ipv4_tcp_wild(
- __inout efx_filter_spec_t *spec,
- __in uint32_t src_ip,
- __in uint16_t src_tcp);
-
-extern void
-efx_filter_spec_tx_ipv4_udp_full(
- __inout efx_filter_spec_t *spec,
- __in uint32_t src_ip,
- __in uint16_t src_udp,
- __in uint32_t dest_ip,
- __in uint16_t dest_udp);
-
-extern void
-efx_filter_spec_tx_ipv4_udp_wild(
- __inout efx_filter_spec_t *spec,
- __in uint32_t src_ip,
- __in uint16_t src_udp);
+#endif /* EFSYS_OPT_FILTER */
-extern void
-efx_filter_spec_tx_mac_full(
- __inout efx_filter_spec_t *spec,
- __in uint16_t vlan_id,
- __in uint8_t *src_mac);
+/* HASH */
-extern void
-efx_filter_spec_tx_mac_wild(
- __inout efx_filter_spec_t *spec,
- __in uint8_t *src_mac);
+extern __checkReturn uint32_t
+efx_hash_dwords(
+ __in_ecount(count) uint32_t const *input,
+ __in size_t count,
+ __in uint32_t init);
-#endif /* EFSYS_OPT_FILTER */
+extern __checkReturn uint32_t
+efx_hash_bytes(
+ __in_ecount(length) uint8_t const *input,
+ __in size_t length,
+ __in uint32_t init);
#ifdef __cplusplus
diff --git a/sys/dev/sfxge/common/efx_bootcfg.c b/sys/dev/sfxge/common/efx_bootcfg.c
index d770a5c..330f69d 100644
--- a/sys/dev/sfxge/common/efx_bootcfg.c
+++ b/sys/dev/sfxge/common/efx_bootcfg.c
@@ -1,26 +1,31 @@
/*-
- * Copyright 2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2009-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -64,7 +69,7 @@ efx_bootcfg_verify(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size,
- __out size_t *usedp)
+ __out_opt size_t *usedp)
{
size_t offset = 0;
size_t used = 0;
diff --git a/sys/dev/sfxge/common/efx_check.h b/sys/dev/sfxge/common/efx_check.h
new file mode 100644
index 0000000..9e590a4
--- /dev/null
+++ b/sys/dev/sfxge/common/efx_check.h
@@ -0,0 +1,388 @@
+/*-
+ * Copyright (c) 2012-2015 Solarflare Communications Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _SYS_EFX_CHECK_H
+#define _SYS_EFX_CHECK_H
+
+#include "efsys.h"
+
+/*
+ * Check that the efsys.h header in client code has a valid combination of
+ * EFSYS_OPT_xxx options.
+ *
+ * NOTE: Keep checks for obsolete options here to ensure that they are removed
+ * from client code (and do not reappear in merges from other branches).
+ */
+
+/* Support NVRAM based boot config */
+#if EFSYS_OPT_BOOTCFG
+# if !EFSYS_OPT_NVRAM
+# error "BOOTCFG requires NVRAM"
+# endif
+#endif /* EFSYS_OPT_BOOTCFG */
+
+/* Verify chip implements accessed registers */
+#if EFSYS_OPT_CHECK_REG
+# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
+# error "CHECK_REG requires FALCON or SIENA or HUNTINGTON"
+# endif
+#endif /* EFSYS_OPT_CHECK_REG */
+
+/* Decode fatal errors */
+#if EFSYS_OPT_DECODE_INTR_FATAL
+# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA)
+# if EFSYS_OPT_HUNTINGTON
+# error "INTR_FATAL not supported on HUNTINGTON"
+# endif
+# error "INTR_FATAL requires FALCON or SIENA"
+# endif
+#endif /* EFSYS_OPT_DECODE_INTR_FATAL */
+
+/* Support diagnostic hardware tests */
+#if EFSYS_OPT_DIAG
+# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
+# error "DIAG requires FALCON or SIENA or HUNTINGTON"
+# endif
+#endif /* EFSYS_OPT_DIAG */
+
+/* Support optimized EVQ data access */
+#if EFSYS_OPT_EV_PREFETCH
+# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
+# error "EV_PREFETCH requires FALCON or SIENA or HUNTINGTON"
+# endif
+#endif /* EFSYS_OPT_EV_PREFETCH */
+
+/* Support overriding the NVRAM and VPD configuration */
+#if EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE
+# if !EFSYS_OPT_FALCON
+# error "FALCON_NIC_CFG_OVERRIDE requires FALCON"
+# endif
+#endif /* EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE */
+
+/* Support hardware packet filters */
+#if EFSYS_OPT_FILTER
+# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
+# error "FILTER requires FALCON or SIENA or HUNTINGTON"
+# endif
+#endif /* EFSYS_OPT_FILTER */
+
+#if EFSYS_OPT_HUNTINGTON
+# if !EFSYS_OPT_FILTER
+# error "HUNTINGTON requires FILTER"
+# endif
+#endif /* EFSYS_OPT_HUNTINGTON */
+
+/* Support hardware loopback modes */
+#if EFSYS_OPT_LOOPBACK
+# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
+# error "LOOPBACK requires FALCON or SIENA or HUNTINGTON"
+# endif
+#endif /* EFSYS_OPT_LOOPBACK */
+
+/* Support Falcon GMAC */
+#if EFSYS_OPT_MAC_FALCON_GMAC
+# if !EFSYS_OPT_FALCON
+# error "MAC_FALCON_GMAC requires FALCON"
+# endif
+#endif /* EFSYS_OPT_MAC_FALCON_GMAC */
+
+/* Support Falcon XMAC */
+#if EFSYS_OPT_MAC_FALCON_XMAC
+# if !EFSYS_OPT_FALCON
+# error "MAC_FALCON_XMAC requires FALCON"
+# endif
+#endif /* EFSYS_OPT_MAC_FALCON_XMAC */
+
+/* Support MAC statistics */
+#if EFSYS_OPT_MAC_STATS
+# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
+# error "MAC_STATS requires FALCON or SIENA or HUNTINGTON"
+# endif
+#endif /* EFSYS_OPT_MAC_STATS */
+
+/* Support management controller messages */
+#if EFSYS_OPT_MCDI
+# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
+# if EFSYS_OPT_FALCON
+# error "MCDI not supported on FALCON"
+# endif
+# error "MCDI requires SIENA or HUNTINGTON"
+# endif
+#endif /* EFSYS_OPT_MCDI */
+
+#if EFSYS_OPT_SIENA && !EFSYS_OPT_MCDI
+# error "SIENA requires MCDI"
+#endif
+#if EFSYS_OPT_HUNTINGTON && !EFSYS_OPT_MCDI
+# error "HUNTINGTON requires MCDI"
+#endif
+
+/* Support LM87 monitor */
+#if EFSYS_OPT_MON_LM87
+# if !EFSYS_OPT_FALCON
+# error "MON_LM87 requires FALCON"
+# endif
+#endif /* EFSYS_OPT_MON_LM87 */
+
+/* Support MAX6647 monitor */
+#if EFSYS_OPT_MON_MAX6647
+# if !EFSYS_OPT_FALCON
+# error "MON_MAX6647 requires FALCON"
+# endif
+#endif /* EFSYS_OPT_MON_MAX6647 */
+
+/* Support null monitor */
+#if EFSYS_OPT_MON_NULL
+# if !EFSYS_OPT_FALCON
+# error "MON_NULL requires FALCON"
+# endif
+#endif /* EFSYS_OPT_MON_NULL */
+
+/* Support Siena monitor */
+#ifdef EFSYS_OPT_MON_SIENA
+# error "MON_SIENA is obsolete use MON_MCDI"
+#endif /* EFSYS_OPT_MON_SIENA*/
+
+/* Support Huntington monitor */
+#ifdef EFSYS_OPT_MON_HUNTINGTON
+# error "MON_HUNTINGTON is obsolete use MON_MCDI"
+#endif /* EFSYS_OPT_MON_HUNTINGTON*/
+
+/* Support monitor statistics (voltage/temperature) */
+#if EFSYS_OPT_MON_STATS
+# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
+# error "MON_STATS requires FALCON or SIENA or HUNTINGTON"
+# endif
+#endif /* EFSYS_OPT_MON_STATS */
+
+/* Support Monitor via mcdi */
+#if EFSYS_OPT_MON_MCDI
+# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
+# error "MON_MCDI requires SIENA or HUNTINGTON"
+# endif
+#endif /* EFSYS_OPT_MON_MCDI*/
+
+/* Support printable names for statistics */
+#if EFSYS_OPT_NAMES
+# if !(EFSYS_OPT_LOOPBACK || EFSYS_OPT_MAC_STATS || EFSYS_OPT_MCDI || \
+ EFSYS_MON_STATS || EFSYS_OPT_PHY_PROPS || EFSYS_OPT_PHY_STATS || \
+ EFSYS_OPT_QSTATS)
+# error "NAMES requires LOOPBACK or xxxSTATS or MCDI or PHY_PROPS"
+# endif
+#endif /* EFSYS_OPT_NAMES */
+
+/* Support non volatile configuration */
+#if EFSYS_OPT_NVRAM
+# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
+# error "NVRAM requires FALCON or SIENA or HUNTINGTON"
+# endif
+#endif /* EFSYS_OPT_NVRAM */
+
+/* Support Falcon bootrom */
+#if EFSYS_OPT_NVRAM_FALCON_BOOTROM
+# if !EFSYS_OPT_NVRAM
+# error "NVRAM_FALCON_BOOTROM requires NVRAM"
+# endif
+# if !EFSYS_OPT_FALCON
+# error "NVRAM_FALCON_BOOTROM requires FALCON"
+# endif
+#endif /* EFSYS_OPT_NVRAM_FALCON_BOOTROM */
+
+/* Support NVRAM config for SFT9001 */
+#if EFSYS_OPT_NVRAM_SFT9001
+# if !EFSYS_OPT_NVRAM
+# error "NVRAM_SFT9001 requires NVRAM"
+# endif
+# if !EFSYS_OPT_FALCON
+# error "NVRAM_SFT9001 requires FALCON"
+# endif
+#endif /* EFSYS_OPT_NVRAM_SFT9001 */
+
+/* Support NVRAM config for SFX7101 */
+#if EFSYS_OPT_NVRAM_SFX7101
+# if !EFSYS_OPT_NVRAM
+# error "NVRAM_SFX7101 requires NVRAM"
+# endif
+# if !EFSYS_OPT_FALCON
+# error "NVRAM_SFX7101 requires FALCON"
+# endif
+#endif /* EFSYS_OPT_NVRAM_SFX7101 */
+
+/* Support PCIe interface tuning */
+#if EFSYS_OPT_PCIE_TUNE
+# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA)
+# error "PCIE_TUNE requires FALCON or SIENA"
+# endif
+#endif /* EFSYS_OPT_PCIE_TUNE */
+
+/* Support PHY BIST diagnostics */
+#if EFSYS_OPT_PHY_BIST
+# error "PHY_BIST is obsolete. It has been replaced by the BIST option."
+#endif /* EFSYS_OPT_PHY_BIST */
+
+/* Support PHY flags */
+#if EFSYS_OPT_PHY_FLAGS
+# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA)
+# error "PHY_FLAGS requires FALCON or SIENA"
+# endif
+#endif /* EFSYS_OPT_PHY_FLAGS */
+
+/* Support for PHY LED control */
+#if EFSYS_OPT_PHY_LED_CONTROL
+# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA)
+# error "PHY_LED_CONTROL requires FALCON or SIENA"
+# endif
+#endif /* EFSYS_OPT_PHY_LED_CONTROL */
+
+/* Support NULL PHY */
+#if EFSYS_OPT_PHY_NULL
+# if !EFSYS_OPT_FALCON
+# error "PHY_NULL requires FALCON"
+# endif
+#endif /* EFSYS_OPT_PHY_NULL */
+
+/* Obsolete option */
+#ifdef EFSYS_OPT_PHY_PM8358
+# error "EFSYS_OPT_PHY_PM8358 is obsolete and is not supported."
+#endif
+
+/* Support PHY properties */
+#if EFSYS_OPT_PHY_PROPS
+# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA)
+# error "PHY_PROPS requires FALCON or SIENA"
+# endif
+#endif /* EFSYS_OPT_PHY_PROPS */
+
+/* Support QT2022C2 PHY */
+#if EFSYS_OPT_PHY_QT2022C2
+# if !EFSYS_OPT_FALCON
+# error "PHY_QT2022C2 requires FALCON"
+# endif
+#endif /* EFSYS_OPT_PHY_QT2022C2 */
+
+/* Support QT2025C PHY (Wakefield NIC) */
+#if EFSYS_OPT_PHY_QT2025C
+# if !EFSYS_OPT_FALCON
+# error "PHY_QT2025C requires FALCON"
+# endif
+#endif /* EFSYS_OPT_PHY_QT2025C */
+
+/* Support SFT9001 PHY (Starbolt NIC) */
+#if EFSYS_OPT_PHY_SFT9001
+# if !EFSYS_OPT_FALCON
+# error "PHY_SFT9001 requires FALCON"
+# endif
+#endif /* EFSYS_OPT_PHY_SFT9001 */
+
+/* Support SFX7101 PHY (SFE4001 NIC) */
+#if EFSYS_OPT_PHY_SFX7101
+# if !EFSYS_OPT_FALCON
+# error "PHY_SFX7101 requires FALCON"
+# endif
+#endif /* EFSYS_OPT_PHY_SFX7101 */
+
+/* Support PHY statistics */
+#if EFSYS_OPT_PHY_STATS
+# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA)
+# error "PHY_STATS requires FALCON or SIENA"
+# endif
+#endif /* EFSYS_OPT_PHY_STATS */
+
+/* Support TXC43128 PHY (SFE4003 NIC) */
+#if EFSYS_OPT_PHY_TXC43128
+# if !EFSYS_OPT_FALCON
+# error "PHY_TXC43128 requires FALCON"
+# endif
+#endif /* EFSYS_OPT_PHY_TXC43128 */
+
+/* Support EVQ/RXQ/TXQ statistics */
+#if EFSYS_OPT_QSTATS
+# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
+# error "QSTATS requires FALCON or SIENA or HUNTINGTON"
+# endif
+#endif /* EFSYS_OPT_QSTATS */
+
+/* Support receive header split */
+#if EFSYS_OPT_RX_HDR_SPLIT
+# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
+# error "RX_HDR_SPLIT requires FALCON or SIENA or HUNTINGTON"
+# endif
+#endif /* EFSYS_OPT_RX_HDR_SPLIT */
+
+/* Support receive scaling (RSS) */
+#if EFSYS_OPT_RX_SCALE
+# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
+# error "RX_SCALE requires FALCON or SIENA or HUNTINGTON"
+# endif
+#endif /* EFSYS_OPT_RX_SCALE */
+
+/* Support receive scatter DMA */
+#if EFSYS_OPT_RX_SCATTER
+# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
+# error "RX_SCATTER requires FALCON or SIENA or HUNTINGTON"
+# endif
+#endif /* EFSYS_OPT_RX_SCATTER */
+
+/* Obsolete option */
+#ifdef EFSYS_OPT_STAT_NAME
+# error "EFSYS_OPT_STAT_NAME is obsolete (replaced by EFSYS_OPT_NAMES)."
+#endif
+
+/* Support PCI Vital Product Data (VPD) */
+#if EFSYS_OPT_VPD
+# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
+# error "VPD requires FALCON or SIENA or HUNTINGTON"
+# endif
+#endif /* EFSYS_OPT_VPD */
+
+/* Support Wake on LAN */
+#if EFSYS_OPT_WOL
+# if !EFSYS_OPT_SIENA
+# error "WOL requires SIENA"
+# endif
+#endif /* EFSYS_OPT_WOL */
+
+/* Support calculating multicast pktfilter in common code */
+#if EFSYS_OPT_MCAST_FILTER_LIST
+# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
+# error "MCAST_FILTER_LIST requires FALCON or SIENA or HUNTINGTON"
+# endif
+#endif /* EFSYS_OPT_MCAST_FILTER_LIST */
+
+/* Support BIST */
+#if EFSYS_OPT_BIST
+# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
+# error "BIST requires FALCON or SIENA or HUNTINGTON"
+# endif
+#endif /* EFSYS_OPT_BIST */
+
+#endif /* _SYS_EFX_CHECK_H */
diff --git a/sys/dev/sfxge/common/efx_crc32.c b/sys/dev/sfxge/common/efx_crc32.c
new file mode 100644
index 0000000..7e4cfc4
--- /dev/null
+++ b/sys/dev/sfxge/common/efx_crc32.c
@@ -0,0 +1,127 @@
+/*-
+ * Copyright (c) 2013-2015 Solarflare Communications Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "efsys.h"
+#include "efx.h"
+#include "efx_types.h"
+#include "efx_impl.h"
+
+/*
+ * Precomputed table for computing IEEE 802.3 CRC32
+ * with polynomial 0x04c11db7 (bit-reversed 0xedb88320)
+ */
+
+static const uint32_t crc32_table[256] = {
+ 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
+ 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
+ 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
+ 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
+ 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
+ 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
+ 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec,
+ 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,
+ 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
+ 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
+ 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940,
+ 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
+ 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116,
+ 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,
+ 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
+ 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,
+ 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a,
+ 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
+ 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818,
+ 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
+ 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
+ 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,
+ 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c,
+ 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
+ 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
+ 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,
+ 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
+ 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,
+ 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086,
+ 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
+ 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4,
+ 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,
+ 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
+ 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,
+ 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
+ 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
+ 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe,
+ 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,
+ 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
+ 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
+ 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252,
+ 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
+ 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60,
+ 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,
+ 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
+ 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,
+ 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04,
+ 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
+ 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a,
+ 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
+ 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
+ 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,
+ 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e,
+ 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
+ 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
+ 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,
+ 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
+ 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,
+ 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0,
+ 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
+ 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6,
+ 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,
+ 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
+ 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
+};
+
+/* Calculate the IEEE 802.3 CRC32 of a MAC addr */
+ __checkReturn uint32_t
+efx_crc32_calculate(
+ __in uint32_t crc_init,
+ __in_ecount(length) uint8_t const *input,
+ __in int length)
+{
+ int index;
+ uint32_t crc = crc_init;
+
+ for (index = 0; index < length; index++) {
+ uint32_t data = *(input++);
+ crc = (crc >> 8) ^ crc32_table[(crc ^ data) & 0xff];
+ }
+
+ return (crc);
+}
diff --git a/sys/dev/sfxge/common/efx_ev.c b/sys/dev/sfxge/common/efx_ev.c
index fff7803..9669fc4 100644
--- a/sys/dev/sfxge/common/efx_ev.c
+++ b/sys/dev/sfxge/common/efx_ev.c
@@ -1,26 +1,31 @@
/*-
- * Copyright 2007-2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2007-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -31,6 +36,7 @@ __FBSDID("$FreeBSD$");
#include "efx_types.h"
#include "efx_regs.h"
#include "efx_impl.h"
+#include "mcdi_mon.h"
#if EFSYS_OPT_QSTATS
#define EFX_EV_QSTAT_INCR(_eep, _stat) \
@@ -42,11 +48,118 @@ __FBSDID("$FreeBSD$");
#define EFX_EV_QSTAT_INCR(_eep, _stat)
#endif
+#define EFX_EV_PRESENT(_qword) \
+ (EFX_QWORD_FIELD((_qword), EFX_DWORD_0) != 0xffffffff && \
+ EFX_QWORD_FIELD((_qword), EFX_DWORD_1) != 0xffffffff)
+
+
+
+#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
+
+static __checkReturn int
+falconsiena_ev_init(
+ __in efx_nic_t *enp);
+
+static void
+falconsiena_ev_fini(
+ __in efx_nic_t *enp);
+
+static __checkReturn int
+falconsiena_ev_qcreate(
+ __in efx_nic_t *enp,
+ __in unsigned int index,
+ __in efsys_mem_t *esmp,
+ __in size_t n,
+ __in uint32_t id,
+ __in efx_evq_t *eep);
+
+static void
+falconsiena_ev_qdestroy(
+ __in efx_evq_t *eep);
+
+static __checkReturn int
+falconsiena_ev_qprime(
+ __in efx_evq_t *eep,
+ __in unsigned int count);
+
+static void
+falconsiena_ev_qpoll(
+ __in efx_evq_t *eep,
+ __inout unsigned int *countp,
+ __in const efx_ev_callbacks_t *eecp,
+ __in_opt void *arg);
+
+static void
+falconsiena_ev_qpost(
+ __in efx_evq_t *eep,
+ __in uint16_t data);
+
+static __checkReturn int
+falconsiena_ev_qmoderate(
+ __in efx_evq_t *eep,
+ __in unsigned int us);
+
+#if EFSYS_OPT_QSTATS
+static void
+falconsiena_ev_qstats_update(
+ __in efx_evq_t *eep,
+ __inout_ecount(EV_NQSTATS) efsys_stat_t *stat);
+
+#endif
+
+#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */
+
+#if EFSYS_OPT_FALCON
+static efx_ev_ops_t __efx_ev_falcon_ops = {
+ falconsiena_ev_init, /* eevo_init */
+ falconsiena_ev_fini, /* eevo_fini */
+ falconsiena_ev_qcreate, /* eevo_qcreate */
+ falconsiena_ev_qdestroy, /* eevo_qdestroy */
+ falconsiena_ev_qprime, /* eevo_qprime */
+ falconsiena_ev_qpost, /* eevo_qpost */
+ falconsiena_ev_qmoderate, /* eevo_qmoderate */
+#if EFSYS_OPT_QSTATS
+ falconsiena_ev_qstats_update, /* eevo_qstats_update */
+#endif
+};
+#endif /* EFSYS_OPT_FALCON */
+
+#if EFSYS_OPT_SIENA
+static efx_ev_ops_t __efx_ev_siena_ops = {
+ falconsiena_ev_init, /* eevo_init */
+ falconsiena_ev_fini, /* eevo_fini */
+ falconsiena_ev_qcreate, /* eevo_qcreate */
+ falconsiena_ev_qdestroy, /* eevo_qdestroy */
+ falconsiena_ev_qprime, /* eevo_qprime */
+ falconsiena_ev_qpost, /* eevo_qpost */
+ falconsiena_ev_qmoderate, /* eevo_qmoderate */
+#if EFSYS_OPT_QSTATS
+ falconsiena_ev_qstats_update, /* eevo_qstats_update */
+#endif
+};
+#endif /* EFSYS_OPT_SIENA */
+
+#if EFSYS_OPT_HUNTINGTON
+static efx_ev_ops_t __efx_ev_hunt_ops = {
+ hunt_ev_init, /* eevo_init */
+ hunt_ev_fini, /* eevo_fini */
+ hunt_ev_qcreate, /* eevo_qcreate */
+ hunt_ev_qdestroy, /* eevo_qdestroy */
+ hunt_ev_qprime, /* eevo_qprime */
+ hunt_ev_qpost, /* eevo_qpost */
+ hunt_ev_qmoderate, /* eevo_qmoderate */
+#if EFSYS_OPT_QSTATS
+ hunt_ev_qstats_update, /* eevo_qstats_update */
+#endif
+};
+#endif /* EFSYS_OPT_HUNTINGTON */
+
+
__checkReturn int
efx_ev_init(
__in efx_nic_t *enp)
{
- efx_oword_t oword;
+ efx_ev_ops_t *eevop;
int rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -57,8 +170,290 @@ efx_ev_init(
goto fail1;
}
+ switch (enp->en_family) {
+#if EFSYS_OPT_FALCON
+ case EFX_FAMILY_FALCON:
+ eevop = (efx_ev_ops_t *)&__efx_ev_falcon_ops;
+ break;
+#endif /* EFSYS_OPT_FALCON */
+
+#if EFSYS_OPT_SIENA
+ case EFX_FAMILY_SIENA:
+ eevop = (efx_ev_ops_t *)&__efx_ev_siena_ops;
+ break;
+#endif /* EFSYS_OPT_SIENA */
+
+#if EFSYS_OPT_HUNTINGTON
+ case EFX_FAMILY_HUNTINGTON:
+ eevop = (efx_ev_ops_t *)&__efx_ev_hunt_ops;
+ break;
+#endif /* EFSYS_OPT_HUNTINGTON */
+
+ default:
+ EFSYS_ASSERT(0);
+ rc = ENOTSUP;
+ goto fail1;
+ }
+
EFSYS_ASSERT3U(enp->en_ev_qcount, ==, 0);
+ if ((rc = eevop->eevo_init(enp)) != 0)
+ goto fail2;
+
+ enp->en_eevop = eevop;
+ enp->en_mod_flags |= EFX_MOD_EV;
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ enp->en_eevop = NULL;
+ enp->en_mod_flags &= ~EFX_MOD_EV;
+ return (rc);
+}
+
+ void
+efx_ev_fini(
+ __in efx_nic_t *enp)
+{
+ efx_ev_ops_t *eevop = enp->en_eevop;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_EV);
+ EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_RX));
+ EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_TX));
+ EFSYS_ASSERT3U(enp->en_ev_qcount, ==, 0);
+
+ eevop->eevo_fini(enp);
+
+ enp->en_eevop = NULL;
+ enp->en_mod_flags &= ~EFX_MOD_EV;
+}
+
+
+ __checkReturn int
+efx_ev_qcreate(
+ __in efx_nic_t *enp,
+ __in unsigned int index,
+ __in efsys_mem_t *esmp,
+ __in size_t n,
+ __in uint32_t id,
+ __deref_out efx_evq_t **eepp)
+{
+ efx_ev_ops_t *eevop = enp->en_eevop;
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+ efx_evq_t *eep;
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_EV);
+
+ EFSYS_ASSERT3U(enp->en_ev_qcount + 1, <, encp->enc_evq_limit);
+
+ /* Allocate an EVQ object */
+ EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (efx_evq_t), eep);
+ if (eep == NULL) {
+ rc = ENOMEM;
+ goto fail1;
+ }
+
+ eep->ee_magic = EFX_EVQ_MAGIC;
+ eep->ee_enp = enp;
+ eep->ee_index = index;
+ eep->ee_mask = n - 1;
+ eep->ee_esmp = esmp;
+
+ if ((rc = eevop->eevo_qcreate(enp, index, esmp, n, id, eep)) != 0)
+ goto fail2;
+
+ enp->en_ev_qcount++;
+ *eepp = eep;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+ EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_evq_t), eep);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+ return (rc);
+}
+
+ void
+efx_ev_qdestroy(
+ __in efx_evq_t *eep)
+{
+ efx_nic_t *enp = eep->ee_enp;
+ efx_ev_ops_t *eevop = enp->en_eevop;
+
+ EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
+
+ EFSYS_ASSERT(enp->en_ev_qcount != 0);
+ --enp->en_ev_qcount;
+
+ eevop->eevo_qdestroy(eep);
+
+ /* Free the EVQ object */
+ EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_evq_t), eep);
+}
+
+ __checkReturn int
+efx_ev_qprime(
+ __in efx_evq_t *eep,
+ __in unsigned int count)
+{
+ efx_nic_t *enp = eep->ee_enp;
+ efx_ev_ops_t *eevop = enp->en_eevop;
+ int rc;
+
+ EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
+
+ if (!(enp->en_mod_flags & EFX_MOD_INTR)) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ if ((rc = eevop->eevo_qprime(eep, count)) != 0)
+ goto fail2;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+ return (rc);
+}
+
+ __checkReturn boolean_t
+efx_ev_qpending(
+ __in efx_evq_t *eep,
+ __in unsigned int count)
+{
+ size_t offset;
+ efx_qword_t qword;
+
+ EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
+
+ offset = (count & eep->ee_mask) * sizeof (efx_qword_t);
+ EFSYS_MEM_READQ(eep->ee_esmp, offset, &qword);
+
+ return (EFX_EV_PRESENT(qword));
+}
+
+#if EFSYS_OPT_EV_PREFETCH
+
+ void
+efx_ev_qprefetch(
+ __in efx_evq_t *eep,
+ __in unsigned int count)
+{
+ efx_nic_t *enp = eep->ee_enp;
+ unsigned int offset;
+
+ EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
+
+ offset = (count & eep->ee_mask) * sizeof (efx_qword_t);
+ EFSYS_MEM_PREFETCH(eep->ee_esmp, offset);
+}
+
+#endif /* EFSYS_OPT_EV_PREFETCH */
+
+ void
+efx_ev_qpoll(
+ __in efx_evq_t *eep,
+ __inout unsigned int *countp,
+ __in const efx_ev_callbacks_t *eecp,
+ __in_opt void *arg)
+{
+ EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
+
+ /*
+ * FIXME: Huntington will require support for hardware event batching
+ * and merging, which will need a different ev_qpoll implementation.
+ *
+ * Without those features the Falcon/Siena code can be used unchanged.
+ */
+ EFX_STATIC_ASSERT(ESF_DZ_EV_CODE_LBN == FSF_AZ_EV_CODE_LBN);
+ EFX_STATIC_ASSERT(ESF_DZ_EV_CODE_WIDTH == FSF_AZ_EV_CODE_WIDTH);
+
+ EFX_STATIC_ASSERT(ESE_DZ_EV_CODE_RX_EV == FSE_AZ_EV_CODE_RX_EV);
+ EFX_STATIC_ASSERT(ESE_DZ_EV_CODE_TX_EV == FSE_AZ_EV_CODE_TX_EV);
+ EFX_STATIC_ASSERT(ESE_DZ_EV_CODE_DRIVER_EV == FSE_AZ_EV_CODE_DRIVER_EV);
+ EFX_STATIC_ASSERT(ESE_DZ_EV_CODE_DRV_GEN_EV ==
+ FSE_AZ_EV_CODE_DRV_GEN_EV);
+#if EFSYS_OPT_MCDI
+ EFX_STATIC_ASSERT(ESE_DZ_EV_CODE_MCDI_EV ==
+ FSE_AZ_EV_CODE_MCDI_EVRESPONSE);
+#endif
+ falconsiena_ev_qpoll(eep, countp, eecp, arg);
+}
+
+ void
+efx_ev_qpost(
+ __in efx_evq_t *eep,
+ __in uint16_t data)
+{
+ efx_nic_t *enp = eep->ee_enp;
+ efx_ev_ops_t *eevop = enp->en_eevop;
+
+ EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
+
+ EFSYS_ASSERT(eevop != NULL &&
+ eevop->eevo_qpost != NULL);
+
+ eevop->eevo_qpost(eep, data);
+}
+
+ __checkReturn int
+efx_ev_qmoderate(
+ __in efx_evq_t *eep,
+ __in unsigned int us)
+{
+ efx_nic_t *enp = eep->ee_enp;
+ efx_ev_ops_t *eevop = enp->en_eevop;
+ int rc;
+
+ EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
+
+ if ((rc = eevop->eevo_qmoderate(eep, us)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+ return (rc);
+}
+
+#if EFSYS_OPT_QSTATS
+ void
+efx_ev_qstats_update(
+ __in efx_evq_t *eep,
+ __inout_ecount(EV_NQSTATS) efsys_stat_t *stat)
+
+{ efx_nic_t *enp = eep->ee_enp;
+ efx_ev_ops_t *eevop = enp->en_eevop;
+
+ EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
+
+ eevop->eevo_qstats_update(eep, stat);
+}
+
+#endif /* EFSYS_OPT_QSTATS */
+
+#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
+
+static __checkReturn int
+falconsiena_ev_init(
+ __in efx_nic_t *enp)
+{
+ efx_oword_t oword;
+
/*
* Program the event queue for receive and transmit queue
* flush events.
@@ -67,17 +462,12 @@ efx_ev_init(
EFX_SET_OWORD_FIELD(oword, FRF_AZ_FLS_EVQ_ID, 0);
EFX_BAR_WRITEO(enp, FR_AZ_DP_CTRL_REG, &oword);
- enp->en_mod_flags |= EFX_MOD_EV;
return (0);
-fail1:
- EFSYS_PROBE1(fail1, int, rc);
-
- return (rc);
}
static __checkReturn boolean_t
-efx_ev_rx_not_ok(
+falconsiena_ev_rx_not_ok(
__in efx_evq_t *eep,
__in efx_qword_t *eqp,
__in uint32_t label,
@@ -167,7 +557,7 @@ efx_ev_rx_not_ok(
}
static __checkReturn boolean_t
-efx_ev_rx(
+falconsiena_ev_rx(
__in efx_evq_t *eep,
__in efx_qword_t *eqp,
__in const efx_ev_callbacks_t *eecp,
@@ -264,7 +654,7 @@ efx_ev_rx(
/* Detect errors included in the FSF_AZ_RX_EV_PKT_OK indication */
if (!ok) {
- ignore = efx_ev_rx_not_ok(eep, eqp, label, id, &flags);
+ ignore = falconsiena_ev_rx_not_ok(eep, eqp, label, id, &flags);
if (ignore) {
EFSYS_PROBE4(rx_complete, uint32_t, label, uint32_t, id,
uint32_t, size, uint16_t, flags);
@@ -323,7 +713,7 @@ efx_ev_rx(
}
static __checkReturn boolean_t
-efx_ev_tx(
+falconsiena_ev_tx(
__in efx_evq_t *eep,
__in efx_qword_t *eqp,
__in const efx_ev_callbacks_t *eecp,
@@ -370,7 +760,7 @@ efx_ev_tx(
}
static __checkReturn boolean_t
-efx_ev_global(
+falconsiena_ev_global(
__in efx_evq_t *eep,
__in efx_qword_t *eqp,
__in const efx_ev_callbacks_t *eecp,
@@ -396,7 +786,7 @@ efx_ev_global(
}
static __checkReturn boolean_t
-efx_ev_driver(
+falconsiena_ev_driver(
__in efx_evq_t *eep,
__in efx_qword_t *eqp,
__in const efx_ev_callbacks_t *eecp,
@@ -437,7 +827,8 @@ efx_ev_driver(
EFSYS_PROBE1(rx_descq_fls_failed, uint32_t, rxq_index);
- should_abort = eecp->eec_rxq_flush_failed(arg, rxq_index);
+ should_abort = eecp->eec_rxq_flush_failed(arg,
+ rxq_index);
} else {
EFX_EV_QSTAT_INCR(eep, EV_DRIVER_RX_DESCQ_FLS_DONE);
@@ -524,7 +915,7 @@ efx_ev_driver(
}
static __checkReturn boolean_t
-efx_ev_drv_gen(
+falconsiena_ev_drv_gen(
__in efx_evq_t *eep,
__in efx_qword_t *eqp,
__in const efx_ev_callbacks_t *eecp,
@@ -552,7 +943,7 @@ efx_ev_drv_gen(
#if EFSYS_OPT_MCDI
static __checkReturn boolean_t
-efx_ev_mcdi(
+falconsiena_ev_mcdi(
__in efx_evq_t *eep,
__in efx_qword_t *eqp,
__in const efx_ev_callbacks_t *eecp,
@@ -583,9 +974,9 @@ efx_ev_mcdi(
case MCDI_EVENT_CODE_CMDDONE:
efx_mcdi_ev_cpl(enp,
- MCDI_EV_FIELD(eqp, CMDDONE_SEQ),
- MCDI_EV_FIELD(eqp, CMDDONE_DATALEN),
- MCDI_EV_FIELD(eqp, CMDDONE_ERRNO));
+ MCDI_EV_FIELD(eqp, CMDDONE_SEQ),
+ MCDI_EV_FIELD(eqp, CMDDONE_DATALEN),
+ MCDI_EV_FIELD(eqp, CMDDONE_ERRNO));
break;
case MCDI_EVENT_CODE_LINKCHANGE: {
@@ -601,7 +992,7 @@ efx_ev_mcdi(
efx_mon_stat_value_t value;
int rc;
- if ((rc = siena_mon_ev(enp, eqp, &id, &value)) == 0)
+ if ((rc = mcdi_mon_ev(enp, eqp, &id, &value)) == 0)
should_abort = eecp->eec_monitor(arg, id, value);
else if (rc == ENOTSUP) {
should_abort = eecp->eec_exception(arg,
@@ -656,22 +1047,14 @@ out:
#endif /* EFSYS_OPT_MCDI */
- __checkReturn int
-efx_ev_qprime(
+static __checkReturn int
+falconsiena_ev_qprime(
__in efx_evq_t *eep,
__in unsigned int count)
{
efx_nic_t *enp = eep->ee_enp;
uint32_t rptr;
efx_dword_t dword;
- int rc;
-
- EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
-
- if (!(enp->en_mod_flags & EFX_MOD_INTR)) {
- rc = EINVAL;
- goto fail1;
- }
rptr = count & eep->ee_mask;
@@ -681,55 +1064,12 @@ efx_ev_qprime(
&dword, B_FALSE);
return (0);
-
-fail1:
- EFSYS_PROBE1(fail1, int, rc);
-
- return (rc);
-}
-
- __checkReturn boolean_t
-efx_ev_qpending(
- __in efx_evq_t *eep,
- __in unsigned int count)
-{
- size_t offset;
- efx_qword_t qword;
-
- EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
-
- offset = (count & eep->ee_mask) * sizeof (efx_qword_t);
- EFSYS_MEM_READQ(eep->ee_esmp, offset, &qword);
-
- return (EFX_QWORD_FIELD(qword, EFX_DWORD_0) != 0xffffffff &&
- EFX_QWORD_FIELD(qword, EFX_DWORD_1) != 0xffffffff);
-}
-
-#if EFSYS_OPT_EV_PREFETCH
-
- void
-efx_ev_qprefetch(
- __in efx_evq_t *eep,
- __in unsigned int count)
-{
- unsigned int offset;
-
- EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
-
- offset = (count & eep->ee_mask) * sizeof (efx_qword_t);
- EFSYS_MEM_PREFETCH(eep->ee_esmp, offset);
}
-#endif /* EFSYS_OPT_EV_PREFETCH */
-
#define EFX_EV_BATCH 8
-#define EFX_EV_PRESENT(_qword) \
- (EFX_QWORD_FIELD((_qword), EFX_DWORD_0) != 0xffffffff && \
- EFX_QWORD_FIELD((_qword), EFX_DWORD_1) != 0xffffffff)
-
- void
-efx_ev_qpoll(
+static void
+falconsiena_ev_qpoll(
__in efx_evq_t *eep,
__inout unsigned int *countp,
__in const efx_ev_callbacks_t *eecp,
@@ -742,7 +1082,6 @@ efx_ev_qpoll(
unsigned int index;
size_t offset;
- EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
EFSYS_ASSERT(countp != NULL);
EFSYS_ASSERT(eecp != NULL);
@@ -778,7 +1117,6 @@ efx_ev_qpoll(
for (index = 0; index < total; ++index) {
boolean_t should_abort;
uint32_t code;
- efx_ev_handler_t handler;
#if EFSYS_OPT_EV_PREFETCH
/* Prefetch if we've now reached the batch period */
@@ -794,9 +1132,49 @@ efx_ev_qpoll(
EFX_EV_QSTAT_INCR(eep, EV_ALL);
code = EFX_QWORD_FIELD(ev[index], FSF_AZ_EV_CODE);
- handler = eep->ee_handler[code];
- EFSYS_ASSERT(handler != NULL);
- should_abort = handler(eep, &(ev[index]), eecp, arg);
+ switch (code) {
+ case FSE_AZ_EV_CODE_RX_EV:
+ should_abort = eep->ee_rx(eep,
+ &(ev[index]), eecp, arg);
+ break;
+ case FSE_AZ_EV_CODE_TX_EV:
+ should_abort = eep->ee_tx(eep,
+ &(ev[index]), eecp, arg);
+ break;
+ case FSE_AZ_EV_CODE_DRIVER_EV:
+ should_abort = eep->ee_driver(eep,
+ &(ev[index]), eecp, arg);
+ break;
+ case FSE_AZ_EV_CODE_DRV_GEN_EV:
+ should_abort = eep->ee_drv_gen(eep,
+ &(ev[index]), eecp, arg);
+ break;
+#if EFSYS_OPT_MCDI
+ case FSE_AZ_EV_CODE_MCDI_EVRESPONSE:
+ should_abort = eep->ee_mcdi(eep,
+ &(ev[index]), eecp, arg);
+ break;
+#endif
+ case FSE_AZ_EV_CODE_GLOBAL_EV:
+ if (eep->ee_global) {
+ should_abort = eep->ee_global(eep,
+ &(ev[index]), eecp, arg);
+ break;
+ }
+ /* else fallthrough */
+ default:
+ EFSYS_PROBE3(bad_event,
+ unsigned int, eep->ee_index,
+ uint32_t,
+ EFX_QWORD_FIELD(ev[index], EFX_DWORD_1),
+ uint32_t,
+ EFX_QWORD_FIELD(ev[index], EFX_DWORD_0));
+
+ EFSYS_ASSERT(eecp->eec_exception != NULL);
+ (void) eecp->eec_exception(arg,
+ EFX_EXCEPTION_EV_ERROR, code);
+ should_abort = B_TRUE;
+ }
if (should_abort) {
/* Ignore subsequent events */
total = index + 1;
@@ -823,8 +1201,8 @@ efx_ev_qpoll(
*countp = count;
}
- void
-efx_ev_qpost(
+static void
+falconsiena_ev_qpost(
__in efx_evq_t *eep,
__in uint16_t data)
{
@@ -832,8 +1210,6 @@ efx_ev_qpost(
efx_qword_t ev;
efx_oword_t oword;
- EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
-
EFX_POPULATE_QWORD_2(ev, FSF_AZ_EV_CODE, FSE_AZ_EV_CODE_DRV_GEN_EV,
FSF_AZ_EV_DATA_DW0, (uint32_t)data);
@@ -844,8 +1220,8 @@ efx_ev_qpost(
EFX_BAR_WRITEO(enp, FR_AZ_DRV_EV_REG, &oword);
}
- __checkReturn int
-efx_ev_qmoderate(
+static __checkReturn int
+falconsiena_ev_qmoderate(
__in efx_evq_t *eep,
__in unsigned int us)
{
@@ -855,8 +1231,6 @@ efx_ev_qmoderate(
efx_dword_t dword;
int rc;
- EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
-
if (us > encp->enc_evq_timer_max_us) {
rc = EINVAL;
goto fail1;
@@ -905,27 +1279,24 @@ fail1:
return (rc);
}
- __checkReturn int
-efx_ev_qcreate(
+static __checkReturn int
+falconsiena_ev_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
__in efsys_mem_t *esmp,
__in size_t n,
__in uint32_t id,
- __deref_out efx_evq_t **eepp)
+ __in efx_evq_t *eep)
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
uint32_t size;
- efx_evq_t *eep;
efx_oword_t oword;
int rc;
- EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_EV);
+ EFX_STATIC_ASSERT(ISP2(EFX_EVQ_MAXNEVS));
+ EFX_STATIC_ASSERT(ISP2(EFX_EVQ_MINNEVS));
- EFSYS_ASSERT3U(enp->en_ev_qcount + 1, <, encp->enc_evq_limit);
-
- if (!ISP2(n) || !(n & EFX_EVQ_NEVS_MASK)) {
+ if (!ISP2(n) || (n < EFX_EVQ_MINNEVS) || (n > EFX_EVQ_MAXNEVS)) {
rc = EINVAL;
goto fail1;
}
@@ -949,46 +1320,29 @@ efx_ev_qcreate(
goto fail4;
}
- /* Allocate an EVQ object */
- EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (efx_evq_t), eep);
- if (eep == NULL) {
- rc = ENOMEM;
- goto fail5;
- }
-
- eep->ee_magic = EFX_EVQ_MAGIC;
- eep->ee_enp = enp;
- eep->ee_index = index;
- eep->ee_mask = n - 1;
- eep->ee_esmp = esmp;
-
/* Set up the handler table */
- eep->ee_handler[FSE_AZ_EV_CODE_RX_EV] = efx_ev_rx;
- eep->ee_handler[FSE_AZ_EV_CODE_TX_EV] = efx_ev_tx;
- eep->ee_handler[FSE_AZ_EV_CODE_DRIVER_EV] = efx_ev_driver;
- eep->ee_handler[FSE_AZ_EV_CODE_GLOBAL_EV] = efx_ev_global;
- eep->ee_handler[FSE_AZ_EV_CODE_DRV_GEN_EV] = efx_ev_drv_gen;
+ eep->ee_rx = falconsiena_ev_rx;
+ eep->ee_tx = falconsiena_ev_tx;
+ eep->ee_driver = falconsiena_ev_driver;
+ eep->ee_global = falconsiena_ev_global;
+ eep->ee_drv_gen = falconsiena_ev_drv_gen;
#if EFSYS_OPT_MCDI
- eep->ee_handler[FSE_AZ_EV_CODE_MCDI_EVRESPONSE] = efx_ev_mcdi;
+ eep->ee_mcdi = falconsiena_ev_mcdi;
#endif /* EFSYS_OPT_MCDI */
/* Set up the new event queue */
if (enp->en_family != EFX_FAMILY_FALCON) {
EFX_POPULATE_OWORD_1(oword, FRF_CZ_TIMER_Q_EN, 1);
- EFX_BAR_TBL_WRITEO(enp, FR_AZ_TIMER_TBL, index, &oword);
+ EFX_BAR_TBL_WRITEO(enp, FR_AZ_TIMER_TBL, index, &oword, B_TRUE);
}
EFX_POPULATE_OWORD_3(oword, FRF_AZ_EVQ_EN, 1, FRF_AZ_EVQ_SIZE, size,
FRF_AZ_EVQ_BUF_BASE_ID, id);
- EFX_BAR_TBL_WRITEO(enp, FR_AZ_EVQ_PTR_TBL, index, &oword);
+ EFX_BAR_TBL_WRITEO(enp, FR_AZ_EVQ_PTR_TBL, index, &oword, B_TRUE);
- enp->en_ev_qcount++;
- *eepp = eep;
return (0);
-fail5:
- EFSYS_PROBE(fail5);
fail4:
EFSYS_PROBE(fail4);
#if EFSYS_OPT_RX_SCALE
@@ -1003,14 +1357,15 @@ fail1:
return (rc);
}
+#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */
+
#if EFSYS_OPT_QSTATS
#if EFSYS_OPT_NAMES
-/* START MKCONFIG GENERATED EfxEventQueueStatNamesBlock 67e9bdcd920059bd */
-static const char __cs * __cs __efx_ev_qstat_name[] = {
+/* START MKCONFIG GENERATED EfxEventQueueStatNamesBlock b693ddf85aee1bfd */
+static const char *__efx_ev_qstat_name[] = {
"all",
"rx",
"rx_ok",
- "rx_recovery",
"rx_frm_trunc",
"rx_tobe_disc",
"rx_pause_frm_err",
@@ -1028,16 +1383,14 @@ static const char __cs * __cs __efx_ev_qstat_name[] = {
"rx_other_ipv4",
"rx_other_ipv6",
"rx_non_ip",
- "rx_overrun",
+ "rx_batch",
"tx",
"tx_wq_ff_full",
"tx_pkt_err",
"tx_pkt_too_big",
"tx_unexpected",
"global",
- "global_phy",
"global_mnt",
- "global_rx_recovery",
"driver",
"driver_srm_upd_done",
"driver_tx_descq_fls_done",
@@ -1050,7 +1403,7 @@ static const char __cs * __cs __efx_ev_qstat_name[] = {
};
/* END MKCONFIG GENERATED EfxEventQueueStatNamesBlock */
- const char __cs *
+ const char *
efx_ev_qstat_name(
__in efx_nic_t *enp,
__in unsigned int id)
@@ -1063,16 +1416,16 @@ efx_ev_qstat_name(
#endif /* EFSYS_OPT_NAMES */
#endif /* EFSYS_OPT_QSTATS */
+#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
+
#if EFSYS_OPT_QSTATS
- void
-efx_ev_qstats_update(
+static void
+falconsiena_ev_qstats_update(
__in efx_evq_t *eep,
__inout_ecount(EV_NQSTATS) efsys_stat_t *stat)
{
unsigned int id;
- EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
-
for (id = 0; id < EV_NQSTATS; id++) {
efsys_stat_t *essp = &stat[id];
@@ -1082,44 +1435,31 @@ efx_ev_qstats_update(
}
#endif /* EFSYS_OPT_QSTATS */
- void
-efx_ev_qdestroy(
+static void
+falconsiena_ev_qdestroy(
__in efx_evq_t *eep)
{
efx_nic_t *enp = eep->ee_enp;
efx_oword_t oword;
- EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
-
- EFSYS_ASSERT(enp->en_ev_qcount != 0);
- --enp->en_ev_qcount;
-
/* Purge event queue */
EFX_ZERO_OWORD(oword);
EFX_BAR_TBL_WRITEO(enp, FR_AZ_EVQ_PTR_TBL,
- eep->ee_index, &oword);
+ eep->ee_index, &oword, B_TRUE);
if (enp->en_family != EFX_FAMILY_FALCON) {
EFX_ZERO_OWORD(oword);
EFX_BAR_TBL_WRITEO(enp, FR_AZ_TIMER_TBL,
- eep->ee_index, &oword);
+ eep->ee_index, &oword, B_TRUE);
}
-
- /* Free the EVQ object */
- EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_evq_t), eep);
}
- void
-efx_ev_fini(
+static void
+falconsiena_ev_fini(
__in efx_nic_t *enp)
{
- EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_EV);
- EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_RX));
- EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_TX));
- EFSYS_ASSERT3U(enp->en_ev_qcount, ==, 0);
-
- enp->en_mod_flags &= ~EFX_MOD_EV;
+ _NOTE(ARGUNUSED(enp))
}
+
+#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */
diff --git a/sys/dev/sfxge/common/efx_filter.c b/sys/dev/sfxge/common/efx_filter.c
index e8455db..7ae7ea5 100644
--- a/sys/dev/sfxge/common/efx_filter.c
+++ b/sys/dev/sfxge/common/efx_filter.c
@@ -1,26 +1,31 @@
/*-
- * Copyright 2007-2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2007-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -35,24 +40,569 @@ __FBSDID("$FreeBSD$");
#if EFSYS_OPT_FILTER
-/* "Fudge factors" - difference between programmed value and actual depth.
+#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
+
+static __checkReturn int
+falconsiena_filter_init(
+ __in efx_nic_t *enp);
+
+static void
+falconsiena_filter_fini(
+ __in efx_nic_t *enp);
+
+static __checkReturn int
+falconsiena_filter_restore(
+ __in efx_nic_t *enp);
+
+static __checkReturn int
+falconsiena_filter_add(
+ __in efx_nic_t *enp,
+ __inout efx_filter_spec_t *spec,
+ __in boolean_t may_replace);
+
+static __checkReturn int
+falconsiena_filter_delete(
+ __in efx_nic_t *enp,
+ __inout efx_filter_spec_t *spec);
+
+static __checkReturn int
+falconsiena_filter_supported_filters(
+ __in efx_nic_t *enp,
+ __out uint32_t *list,
+ __out size_t *length);
+
+#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */
+
+#if EFSYS_OPT_FALCON
+static efx_filter_ops_t __efx_filter_falcon_ops = {
+ falconsiena_filter_init, /* efo_init */
+ falconsiena_filter_fini, /* efo_fini */
+ falconsiena_filter_restore, /* efo_restore */
+ falconsiena_filter_add, /* efo_add */
+ falconsiena_filter_delete, /* efo_delete */
+ falconsiena_filter_supported_filters, /* efo_supported_filters */
+ NULL, /* efo_reconfigure */
+};
+#endif /* EFSYS_OPT_FALCON */
+
+#if EFSYS_OPT_SIENA
+static efx_filter_ops_t __efx_filter_siena_ops = {
+ falconsiena_filter_init, /* efo_init */
+ falconsiena_filter_fini, /* efo_fini */
+ falconsiena_filter_restore, /* efo_restore */
+ falconsiena_filter_add, /* efo_add */
+ falconsiena_filter_delete, /* efo_delete */
+ falconsiena_filter_supported_filters, /* efo_supported_filters */
+ NULL, /* efo_reconfigure */
+};
+#endif /* EFSYS_OPT_SIENA */
+
+#if EFSYS_OPT_HUNTINGTON
+static efx_filter_ops_t __efx_filter_hunt_ops = {
+ hunt_filter_init, /* efo_init */
+ hunt_filter_fini, /* efo_fini */
+ hunt_filter_restore, /* efo_restore */
+ hunt_filter_add, /* efo_add */
+ hunt_filter_delete, /* efo_delete */
+ hunt_filter_supported_filters, /* efo_supported_filters */
+ hunt_filter_reconfigure, /* efo_reconfigure */
+};
+#endif /* EFSYS_OPT_HUNTINGTON */
+
+ __checkReturn int
+efx_filter_insert(
+ __in efx_nic_t *enp,
+ __inout efx_filter_spec_t *spec)
+{
+ efx_filter_ops_t *efop = enp->en_efop;
+
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_FILTER);
+ EFSYS_ASSERT3P(spec, !=, NULL);
+ EFSYS_ASSERT3U(spec->efs_flags, &, EFX_FILTER_FLAG_RX);
+
+ return (efop->efo_add(enp, spec, B_FALSE));
+}
+
+ __checkReturn int
+efx_filter_remove(
+ __in efx_nic_t *enp,
+ __inout efx_filter_spec_t *spec)
+{
+ efx_filter_ops_t *efop = enp->en_efop;
+
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_FILTER);
+ EFSYS_ASSERT3P(spec, !=, NULL);
+ EFSYS_ASSERT3U(spec->efs_flags, &, EFX_FILTER_FLAG_RX);
+
+#if EFSYS_OPT_RX_SCALE
+ spec->efs_rss_context = enp->en_rss_context;
+#endif
+
+ return (efop->efo_delete(enp, spec));
+}
+
+ __checkReturn int
+efx_filter_restore(
+ __in efx_nic_t *enp)
+{
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_FILTER);
+
+ if ((rc = enp->en_efop->efo_restore(enp)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+efx_filter_init(
+ __in efx_nic_t *enp)
+{
+ efx_filter_ops_t *efop;
+ int rc;
+
+ /* Check that efx_filter_spec_t is 64 bytes. */
+ EFX_STATIC_ASSERT(sizeof (efx_filter_spec_t) == 64);
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
+ EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_FILTER));
+
+ switch (enp->en_family) {
+#if EFSYS_OPT_FALCON
+ case EFX_FAMILY_FALCON:
+ efop = (efx_filter_ops_t *)&__efx_filter_falcon_ops;
+ break;
+#endif /* EFSYS_OPT_FALCON */
+
+#if EFSYS_OPT_SIENA
+ case EFX_FAMILY_SIENA:
+ efop = (efx_filter_ops_t *)&__efx_filter_siena_ops;
+ break;
+#endif /* EFSYS_OPT_SIENA */
+
+#if EFSYS_OPT_HUNTINGTON
+ case EFX_FAMILY_HUNTINGTON:
+ efop = (efx_filter_ops_t *)&__efx_filter_hunt_ops;
+ break;
+#endif /* EFSYS_OPT_HUNTINGTON */
+
+ default:
+ EFSYS_ASSERT(0);
+ rc = ENOTSUP;
+ goto fail1;
+ }
+
+ if ((rc = efop->efo_init(enp)) != 0)
+ goto fail2;
+
+ enp->en_efop = efop;
+ enp->en_mod_flags |= EFX_MOD_FILTER;
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ enp->en_efop = NULL;
+ enp->en_mod_flags &= ~EFX_MOD_FILTER;
+ return (rc);
+}
+
+ void
+efx_filter_fini(
+ __in efx_nic_t *enp)
+{
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_FILTER);
+
+ enp->en_efop->efo_fini(enp);
+
+ enp->en_efop = NULL;
+ enp->en_mod_flags &= ~EFX_MOD_FILTER;
+}
+
+ __checkReturn int
+efx_filter_supported_filters(
+ __in efx_nic_t *enp,
+ __out uint32_t *list,
+ __out size_t *length)
+{
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_FILTER);
+ EFSYS_ASSERT(enp->en_efop->efo_supported_filters != NULL);
+
+ if ((rc = enp->en_efop->efo_supported_filters(enp, list, length)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+efx_filter_reconfigure(
+ __in efx_nic_t *enp,
+ __in_ecount(6) uint8_t const *mac_addr,
+ __in boolean_t all_unicst,
+ __in boolean_t mulcst,
+ __in boolean_t all_mulcst,
+ __in boolean_t brdcst,
+ __in_ecount(6*count) uint8_t const *addrs,
+ __in int count)
+{
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_FILTER);
+
+ if (enp->en_efop->efo_reconfigure != NULL) {
+ if ((rc = enp->en_efop->efo_reconfigure(enp, mac_addr,
+ all_unicst, mulcst,
+ all_mulcst, brdcst,
+ addrs, count)) != 0)
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ void
+efx_filter_spec_init_rx(
+ __inout efx_filter_spec_t *spec,
+ __in efx_filter_priority_t priority,
+ __in efx_filter_flag_t flags,
+ __in efx_rxq_t *erp)
+{
+ EFSYS_ASSERT3P(spec, !=, NULL);
+ EFSYS_ASSERT3P(erp, !=, NULL);
+ EFSYS_ASSERT((flags & ~(EFX_FILTER_FLAG_RX_RSS |
+ EFX_FILTER_FLAG_RX_SCATTER)) == 0);
+
+ memset(spec, 0, sizeof (*spec));
+ spec->efs_priority = priority;
+ spec->efs_flags = EFX_FILTER_FLAG_RX | flags;
+ spec->efs_rss_context = EFX_FILTER_SPEC_RSS_CONTEXT_DEFAULT;
+ spec->efs_dmaq_id = (uint16_t)erp->er_index;
+}
+
+ void
+efx_filter_spec_init_tx(
+ __inout efx_filter_spec_t *spec,
+ __in efx_txq_t *etp)
+{
+ EFSYS_ASSERT3P(spec, !=, NULL);
+ EFSYS_ASSERT3P(etp, !=, NULL);
+
+ memset(spec, 0, sizeof (*spec));
+ spec->efs_priority = EFX_FILTER_PRI_REQUIRED;
+ spec->efs_flags = EFX_FILTER_FLAG_TX;
+ spec->efs_dmaq_id = (uint16_t)etp->et_index;
+}
+
+
+/*
+ * Specify IPv4 host, transport protocol and port in a filter specification
+ */
+__checkReturn int
+efx_filter_spec_set_ipv4_local(
+ __inout efx_filter_spec_t *spec,
+ __in uint8_t proto,
+ __in uint32_t host,
+ __in uint16_t port)
+{
+ EFSYS_ASSERT3P(spec, !=, NULL);
+
+ spec->efs_match_flags |=
+ EFX_FILTER_MATCH_ETHER_TYPE | EFX_FILTER_MATCH_IP_PROTO |
+ EFX_FILTER_MATCH_LOC_HOST | EFX_FILTER_MATCH_LOC_PORT;
+ spec->efs_ether_type = EFX_ETHER_TYPE_IPV4;
+ spec->efs_ip_proto = proto;
+ spec->efs_loc_host.eo_u32[0] = host;
+ spec->efs_loc_port = port;
+ return (0);
+}
+
+/*
+ * Specify IPv4 hosts, transport protocol and ports in a filter specification
+ */
+__checkReturn int
+efx_filter_spec_set_ipv4_full(
+ __inout efx_filter_spec_t *spec,
+ __in uint8_t proto,
+ __in uint32_t lhost,
+ __in uint16_t lport,
+ __in uint32_t rhost,
+ __in uint16_t rport)
+{
+ EFSYS_ASSERT3P(spec, !=, NULL);
+
+ spec->efs_match_flags |=
+ EFX_FILTER_MATCH_ETHER_TYPE | EFX_FILTER_MATCH_IP_PROTO |
+ EFX_FILTER_MATCH_LOC_HOST | EFX_FILTER_MATCH_LOC_PORT |
+ EFX_FILTER_MATCH_REM_HOST | EFX_FILTER_MATCH_REM_PORT;
+ spec->efs_ether_type = EFX_ETHER_TYPE_IPV4;
+ spec->efs_ip_proto = proto;
+ spec->efs_loc_host.eo_u32[0] = lhost;
+ spec->efs_loc_port = lport;
+ spec->efs_rem_host.eo_u32[0] = rhost;
+ spec->efs_rem_port = rport;
+ return (0);
+}
+
+/*
+ * Specify local Ethernet address and/or VID in filter specification
+ */
+__checkReturn int
+efx_filter_spec_set_eth_local(
+ __inout efx_filter_spec_t *spec,
+ __in uint16_t vid,
+ __in const uint8_t *addr)
+{
+ EFSYS_ASSERT3P(spec, !=, NULL);
+ EFSYS_ASSERT3P(addr, !=, NULL);
+
+ if (vid == EFX_FILTER_SPEC_VID_UNSPEC && addr == NULL)
+ return (EINVAL);
+
+ if (vid != EFX_FILTER_SPEC_VID_UNSPEC) {
+ spec->efs_match_flags |= EFX_FILTER_MATCH_OUTER_VID;
+ spec->efs_outer_vid = vid;
+ }
+ if (addr != NULL) {
+ spec->efs_match_flags |= EFX_FILTER_MATCH_LOC_MAC;
+ memcpy(spec->efs_loc_mac, addr, EFX_MAC_ADDR_LEN);
+ }
+ return (0);
+}
+
+/*
+ * Specify matching otherwise-unmatched unicast in a filter specification
+ */
+__checkReturn int
+efx_filter_spec_set_uc_def(
+ __inout efx_filter_spec_t *spec)
+{
+ EFSYS_ASSERT3P(spec, !=, NULL);
+
+ spec->efs_match_flags |= EFX_FILTER_MATCH_LOC_MAC_IG;
+ return (0);
+}
+
+/*
+ * Specify matching otherwise-unmatched multicast in a filter specification
+ */
+__checkReturn int
+efx_filter_spec_set_mc_def(
+ __inout efx_filter_spec_t *spec)
+{
+ EFSYS_ASSERT3P(spec, !=, NULL);
+
+ spec->efs_match_flags |= EFX_FILTER_MATCH_LOC_MAC_IG;
+ spec->efs_loc_mac[0] = 1;
+ return (0);
+}
+
+
+
+#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
+
+/*
+ * "Fudge factors" - difference between programmed value and actual depth.
* Due to pipelined implementation we need to program H/W with a value that
* is larger than the hop limit we want.
*/
-#define FILTER_CTL_SRCH_FUDGE_WILD 3
-#define FILTER_CTL_SRCH_FUDGE_FULL 1
+#define FILTER_CTL_SRCH_FUDGE_WILD 3
+#define FILTER_CTL_SRCH_FUDGE_FULL 1
-/* Hard maximum hop limit. Hardware will time-out beyond 200-something.
+/*
+ * Hard maximum hop limit. Hardware will time-out beyond 200-something.
* We also need to avoid infinite loops in efx_filter_search() when the
* table is full.
*/
-#define FILTER_CTL_SRCH_MAX 200
+#define FILTER_CTL_SRCH_MAX 200
-/* The filter hash function is LFSR polynomial x^16 + x^3 + 1 of a 32-bit
- * key derived from the n-tuple. */
+static __checkReturn int
+falconsiena_filter_spec_from_gen_spec(
+ __out falconsiena_filter_spec_t *fs_spec,
+ __in efx_filter_spec_t *gen_spec)
+{
+ int rc;
+ boolean_t is_full = B_FALSE;
+
+ if (gen_spec->efs_flags & EFX_FILTER_FLAG_TX)
+ EFSYS_ASSERT3U(gen_spec->efs_flags, ==, EFX_FILTER_FLAG_TX);
+ else
+ EFSYS_ASSERT3U(gen_spec->efs_flags, &, EFX_FILTER_FLAG_RX);
+
+ /* Falconsiena only has one RSS context */
+ if ((gen_spec->efs_flags & EFX_FILTER_FLAG_RX_RSS) &&
+ gen_spec->efs_rss_context != 0) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ fs_spec->fsfs_flags = gen_spec->efs_flags;
+ fs_spec->fsfs_dmaq_id = gen_spec->efs_dmaq_id;
+
+ switch (gen_spec->efs_match_flags) {
+ case EFX_FILTER_MATCH_ETHER_TYPE | EFX_FILTER_MATCH_IP_PROTO |
+ EFX_FILTER_MATCH_LOC_HOST | EFX_FILTER_MATCH_LOC_PORT |
+ EFX_FILTER_MATCH_REM_HOST | EFX_FILTER_MATCH_REM_PORT:
+ is_full = B_TRUE;
+ /* Fall through */
+ case EFX_FILTER_MATCH_ETHER_TYPE | EFX_FILTER_MATCH_IP_PROTO |
+ EFX_FILTER_MATCH_LOC_HOST | EFX_FILTER_MATCH_LOC_PORT: {
+ uint32_t rhost, host1, host2;
+ uint16_t rport, port1, port2;
+
+ if (gen_spec->efs_ether_type != EFX_ETHER_TYPE_IPV4) {
+ rc = ENOTSUP;
+ goto fail2;
+ }
+ if (gen_spec->efs_loc_port == 0 ||
+ (is_full && gen_spec->efs_rem_port == 0)) {
+ rc = EINVAL;
+ goto fail3;
+ }
+ switch (gen_spec->efs_ip_proto) {
+ case EFX_IPPROTO_TCP:
+ if (gen_spec->efs_flags & EFX_FILTER_FLAG_TX) {
+ fs_spec->fsfs_type = (is_full ?
+ EFX_FS_FILTER_TX_TCP_FULL :
+ EFX_FS_FILTER_TX_TCP_WILD);
+ } else {
+ fs_spec->fsfs_type = (is_full ?
+ EFX_FS_FILTER_RX_TCP_FULL :
+ EFX_FS_FILTER_RX_TCP_WILD);
+ }
+ break;
+ case EFX_IPPROTO_UDP:
+ if (gen_spec->efs_flags & EFX_FILTER_FLAG_TX) {
+ fs_spec->fsfs_type = (is_full ?
+ EFX_FS_FILTER_TX_UDP_FULL :
+ EFX_FS_FILTER_TX_UDP_WILD);
+ } else {
+ fs_spec->fsfs_type = (is_full ?
+ EFX_FS_FILTER_RX_UDP_FULL :
+ EFX_FS_FILTER_RX_UDP_WILD);
+ }
+ break;
+ default:
+ rc = ENOTSUP;
+ goto fail4;
+ }
+ /*
+ * The filter is constructed in terms of source and destination,
+ * with the odd wrinkle that the ports are swapped in a UDP
+ * wildcard filter. We need to convert from local and remote
+ * addresses (zero for a wildcard).
+ */
+ rhost = is_full ? gen_spec->efs_rem_host.eo_u32[0] : 0;
+ rport = is_full ? gen_spec->efs_rem_port : 0;
+ if (gen_spec->efs_flags & EFX_FILTER_FLAG_TX) {
+ host1 = gen_spec->efs_loc_host.eo_u32[0];
+ host2 = rhost;
+ } else {
+ host1 = rhost;
+ host2 = gen_spec->efs_loc_host.eo_u32[0];
+ }
+ if (gen_spec->efs_flags & EFX_FILTER_FLAG_TX) {
+ if (fs_spec->fsfs_type == EFX_FS_FILTER_TX_UDP_WILD) {
+ port1 = rport;
+ port2 = gen_spec->efs_loc_port;
+ } else {
+ port1 = gen_spec->efs_loc_port;
+ port2 = rport;
+ }
+ } else {
+ if (fs_spec->fsfs_type == EFX_FS_FILTER_RX_UDP_WILD) {
+ port1 = gen_spec->efs_loc_port;
+ port2 = rport;
+ } else {
+ port1 = rport;
+ port2 = gen_spec->efs_loc_port;
+ }
+ }
+ fs_spec->fsfs_dword[0] = (host1 << 16) | port1;
+ fs_spec->fsfs_dword[1] = (port2 << 16) | (host1 >> 16);
+ fs_spec->fsfs_dword[2] = host2;
+ break;
+ }
+
+ case EFX_FILTER_MATCH_LOC_MAC | EFX_FILTER_MATCH_OUTER_VID:
+ is_full = B_TRUE;
+ /* Fall through */
+ case EFX_FILTER_MATCH_LOC_MAC:
+ if (gen_spec->efs_flags & EFX_FILTER_FLAG_TX) {
+ fs_spec->fsfs_type = (is_full ?
+ EFX_FS_FILTER_TX_MAC_FULL :
+ EFX_FS_FILTER_TX_MAC_WILD);
+ } else {
+ fs_spec->fsfs_type = (is_full ?
+ EFX_FS_FILTER_RX_MAC_FULL :
+ EFX_FS_FILTER_RX_MAC_WILD);
+ }
+ fs_spec->fsfs_dword[0] = is_full ? gen_spec->efs_outer_vid : 0;
+ fs_spec->fsfs_dword[1] =
+ gen_spec->efs_loc_mac[2] << 24 |
+ gen_spec->efs_loc_mac[3] << 16 |
+ gen_spec->efs_loc_mac[4] << 8 |
+ gen_spec->efs_loc_mac[5];
+ fs_spec->fsfs_dword[2] =
+ gen_spec->efs_loc_mac[0] << 8 |
+ gen_spec->efs_loc_mac[1];
+ break;
+
+ default:
+ EFSYS_ASSERT(B_FALSE);
+ rc = ENOTSUP;
+ goto fail5;
+ }
+
+ return (0);
+
+fail5:
+ EFSYS_PROBE(fail5);
+fail4:
+ EFSYS_PROBE(fail4);
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+/*
+ * The filter hash function is LFSR polynomial x^16 + x^3 + 1 of a 32-bit
+ * key derived from the n-tuple.
+ */
static uint16_t
-efx_filter_tbl_hash(
- __in uint32_t key)
+falconsiena_filter_tbl_hash(
+ __in uint32_t key)
{
uint16_t tmp;
@@ -69,119 +619,119 @@ efx_filter_tbl_hash(
return (tmp);
}
-
-/* To allow for hash collisions, filter search continues at these
- * increments from the first possible entry selected by the hash. */
+/*
+ * To allow for hash collisions, filter search continues at these
+ * increments from the first possible entry selected by the hash.
+ */
static uint16_t
-efx_filter_tbl_increment(
+falconsiena_filter_tbl_increment(
__in uint32_t key)
{
return ((uint16_t)(key * 2 - 1));
}
static __checkReturn boolean_t
-efx_filter_test_used(
- __in efx_filter_tbl_t *eftp,
+falconsiena_filter_test_used(
+ __in falconsiena_filter_tbl_t *fsftp,
__in unsigned int index)
{
- EFSYS_ASSERT3P(eftp->eft_bitmap, !=, NULL);
- return ((eftp->eft_bitmap[index / 32] & (1 << (index % 32))) != 0);
+ EFSYS_ASSERT3P(fsftp->fsft_bitmap, !=, NULL);
+ return ((fsftp->fsft_bitmap[index / 32] & (1 << (index % 32))) != 0);
}
static void
-efx_filter_set_used(
- __in efx_filter_tbl_t *eftp,
+falconsiena_filter_set_used(
+ __in falconsiena_filter_tbl_t *fsftp,
__in unsigned int index)
{
- EFSYS_ASSERT3P(eftp->eft_bitmap, !=, NULL);
- eftp->eft_bitmap[index / 32] |= (1 << (index % 32));
- ++eftp->eft_used;
+ EFSYS_ASSERT3P(fsftp->fsft_bitmap, !=, NULL);
+ fsftp->fsft_bitmap[index / 32] |= (1 << (index % 32));
+ ++fsftp->fsft_used;
}
static void
-efx_filter_clear_used(
- __in efx_filter_tbl_t *eftp,
+falconsiena_filter_clear_used(
+ __in falconsiena_filter_tbl_t *fsftp,
__in unsigned int index)
{
- EFSYS_ASSERT3P(eftp->eft_bitmap, !=, NULL);
- eftp->eft_bitmap[index / 32] &= ~(1 << (index % 32));
+ EFSYS_ASSERT3P(fsftp->fsft_bitmap, !=, NULL);
+ fsftp->fsft_bitmap[index / 32] &= ~(1 << (index % 32));
- --eftp->eft_used;
- EFSYS_ASSERT3U(eftp->eft_used, >=, 0);
+ --fsftp->fsft_used;
+ EFSYS_ASSERT3U(fsftp->fsft_used, >=, 0);
}
-static efx_filter_tbl_id_t
-efx_filter_tbl_id(
- __in efx_filter_type_t type)
+static falconsiena_filter_tbl_id_t
+falconsiena_filter_tbl_id(
+ __in falconsiena_filter_type_t type)
{
- efx_filter_tbl_id_t tbl_id;
-
- switch (type)
- {
- case EFX_FILTER_RX_TCP_FULL:
- case EFX_FILTER_RX_TCP_WILD:
- case EFX_FILTER_RX_UDP_FULL:
- case EFX_FILTER_RX_UDP_WILD:
- tbl_id = EFX_FILTER_TBL_RX_IP;
+ falconsiena_filter_tbl_id_t tbl_id;
+
+ switch (type) {
+ case EFX_FS_FILTER_RX_TCP_FULL:
+ case EFX_FS_FILTER_RX_TCP_WILD:
+ case EFX_FS_FILTER_RX_UDP_FULL:
+ case EFX_FS_FILTER_RX_UDP_WILD:
+ tbl_id = EFX_FS_FILTER_TBL_RX_IP;
break;
#if EFSYS_OPT_SIENA
- case EFX_FILTER_RX_MAC_FULL:
- case EFX_FILTER_RX_MAC_WILD:
- tbl_id = EFX_FILTER_TBL_RX_MAC;
+ case EFX_FS_FILTER_RX_MAC_FULL:
+ case EFX_FS_FILTER_RX_MAC_WILD:
+ tbl_id = EFX_FS_FILTER_TBL_RX_MAC;
break;
- case EFX_FILTER_TX_TCP_FULL:
- case EFX_FILTER_TX_TCP_WILD:
- case EFX_FILTER_TX_UDP_FULL:
- case EFX_FILTER_TX_UDP_WILD:
- tbl_id = EFX_FILTER_TBL_TX_IP;
+ case EFX_FS_FILTER_TX_TCP_FULL:
+ case EFX_FS_FILTER_TX_TCP_WILD:
+ case EFX_FS_FILTER_TX_UDP_FULL:
+ case EFX_FS_FILTER_TX_UDP_WILD:
+ tbl_id = EFX_FS_FILTER_TBL_TX_IP;
break;
- case EFX_FILTER_TX_MAC_FULL:
- case EFX_FILTER_TX_MAC_WILD:
- tbl_id = EFX_FILTER_TBL_RX_MAC;
+ case EFX_FS_FILTER_TX_MAC_FULL:
+ case EFX_FS_FILTER_TX_MAC_WILD:
+ tbl_id = EFX_FS_FILTER_TBL_TX_MAC;
break;
#endif /* EFSYS_OPT_SIENA */
default:
EFSYS_ASSERT(B_FALSE);
+ tbl_id = EFX_FS_FILTER_NTBLS;
break;
}
return (tbl_id);
}
static void
-efx_filter_reset_search_depth(
- __inout efx_filter_t *efp,
- __in efx_filter_tbl_id_t tbl_id)
+falconsiena_filter_reset_search_depth(
+ __inout falconsiena_filter_t *fsfp,
+ __in falconsiena_filter_tbl_id_t tbl_id)
{
- switch (tbl_id)
- {
- case EFX_FILTER_TBL_RX_IP:
- efp->ef_depth[EFX_FILTER_RX_TCP_FULL] = 0;
- efp->ef_depth[EFX_FILTER_RX_TCP_WILD] = 0;
- efp->ef_depth[EFX_FILTER_RX_UDP_FULL] = 0;
- efp->ef_depth[EFX_FILTER_RX_UDP_WILD] = 0;
+ switch (tbl_id) {
+ case EFX_FS_FILTER_TBL_RX_IP:
+ fsfp->fsf_depth[EFX_FS_FILTER_RX_TCP_FULL] = 0;
+ fsfp->fsf_depth[EFX_FS_FILTER_RX_TCP_WILD] = 0;
+ fsfp->fsf_depth[EFX_FS_FILTER_RX_UDP_FULL] = 0;
+ fsfp->fsf_depth[EFX_FS_FILTER_RX_UDP_WILD] = 0;
break;
#if EFSYS_OPT_SIENA
- case EFX_FILTER_TBL_RX_MAC:
- efp->ef_depth[EFX_FILTER_RX_MAC_FULL] = 0;
- efp->ef_depth[EFX_FILTER_RX_MAC_WILD] = 0;
+ case EFX_FS_FILTER_TBL_RX_MAC:
+ fsfp->fsf_depth[EFX_FS_FILTER_RX_MAC_FULL] = 0;
+ fsfp->fsf_depth[EFX_FS_FILTER_RX_MAC_WILD] = 0;
break;
- case EFX_FILTER_TBL_TX_IP:
- efp->ef_depth[EFX_FILTER_TX_TCP_FULL] = 0;
- efp->ef_depth[EFX_FILTER_TX_TCP_WILD] = 0;
- efp->ef_depth[EFX_FILTER_TX_UDP_FULL] = 0;
- efp->ef_depth[EFX_FILTER_TX_UDP_WILD] = 0;
+ case EFX_FS_FILTER_TBL_TX_IP:
+ fsfp->fsf_depth[EFX_FS_FILTER_TX_TCP_FULL] = 0;
+ fsfp->fsf_depth[EFX_FS_FILTER_TX_TCP_WILD] = 0;
+ fsfp->fsf_depth[EFX_FS_FILTER_TX_UDP_FULL] = 0;
+ fsfp->fsf_depth[EFX_FS_FILTER_TX_UDP_WILD] = 0;
break;
- case EFX_FILTER_TBL_TX_MAC:
- efp->ef_depth[EFX_FILTER_TX_MAC_FULL] = 0;
- efp->ef_depth[EFX_FILTER_TX_MAC_WILD] = 0;
+ case EFX_FS_FILTER_TBL_TX_MAC:
+ fsfp->fsf_depth[EFX_FS_FILTER_TX_MAC_FULL] = 0;
+ fsfp->fsf_depth[EFX_FS_FILTER_TX_MAC_WILD] = 0;
break;
#endif /* EFSYS_OPT_SIENA */
@@ -192,36 +742,36 @@ efx_filter_reset_search_depth(
}
static void
-efx_filter_push_rx_limits(
+falconsiena_filter_push_rx_limits(
__in efx_nic_t *enp)
{
- efx_filter_t *efp = &enp->en_filter;
+ falconsiena_filter_t *fsfp = enp->en_filter.ef_falconsiena_filter;
efx_oword_t oword;
EFX_BAR_READO(enp, FR_AZ_RX_FILTER_CTL_REG, &oword);
EFX_SET_OWORD_FIELD(oword, FRF_AZ_TCP_FULL_SRCH_LIMIT,
- efp->ef_depth[EFX_FILTER_RX_TCP_FULL] +
+ fsfp->fsf_depth[EFX_FS_FILTER_RX_TCP_FULL] +
FILTER_CTL_SRCH_FUDGE_FULL);
EFX_SET_OWORD_FIELD(oword, FRF_AZ_TCP_WILD_SRCH_LIMIT,
- efp->ef_depth[EFX_FILTER_RX_TCP_WILD] +
+ fsfp->fsf_depth[EFX_FS_FILTER_RX_TCP_WILD] +
FILTER_CTL_SRCH_FUDGE_WILD);
EFX_SET_OWORD_FIELD(oword, FRF_AZ_UDP_FULL_SRCH_LIMIT,
- efp->ef_depth[EFX_FILTER_RX_UDP_FULL] +
+ fsfp->fsf_depth[EFX_FS_FILTER_RX_UDP_FULL] +
FILTER_CTL_SRCH_FUDGE_FULL);
EFX_SET_OWORD_FIELD(oword, FRF_AZ_UDP_WILD_SRCH_LIMIT,
- efp->ef_depth[EFX_FILTER_RX_UDP_WILD] +
+ fsfp->fsf_depth[EFX_FS_FILTER_RX_UDP_WILD] +
FILTER_CTL_SRCH_FUDGE_WILD);
#if EFSYS_OPT_SIENA
- if (efp->ef_tbl[EFX_FILTER_TBL_RX_MAC].eft_size) {
+ if (fsfp->fsf_tbl[EFX_FS_FILTER_TBL_RX_MAC].fsft_size) {
EFX_SET_OWORD_FIELD(oword,
FRF_CZ_ETHERNET_FULL_SEARCH_LIMIT,
- efp->ef_depth[EFX_FILTER_RX_MAC_FULL] +
+ fsfp->fsf_depth[EFX_FS_FILTER_RX_MAC_FULL] +
FILTER_CTL_SRCH_FUDGE_FULL);
EFX_SET_OWORD_FIELD(oword,
FRF_CZ_ETHERNET_WILDCARD_SEARCH_LIMIT,
- efp->ef_depth[EFX_FILTER_RX_MAC_WILD] +
+ fsfp->fsf_depth[EFX_FS_FILTER_RX_MAC_WILD] +
FILTER_CTL_SRCH_FUDGE_WILD);
}
#endif /* EFSYS_OPT_SIENA */
@@ -230,150 +780,177 @@ efx_filter_push_rx_limits(
}
static void
-efx_filter_push_tx_limits(
+falconsiena_filter_push_tx_limits(
__in efx_nic_t *enp)
{
- efx_filter_t *efp = &enp->en_filter;
+ falconsiena_filter_t *fsfp = enp->en_filter.ef_falconsiena_filter;
efx_oword_t oword;
- if (efp->ef_tbl[EFX_FILTER_TBL_TX_IP].eft_size == 0)
- return;
-
EFX_BAR_READO(enp, FR_AZ_TX_CFG_REG, &oword);
- EFX_SET_OWORD_FIELD(oword, FRF_CZ_TX_TCPIP_FILTER_FULL_SEARCH_RANGE,
- efp->ef_depth[EFX_FILTER_TX_TCP_FULL] +
- FILTER_CTL_SRCH_FUDGE_FULL);
- EFX_SET_OWORD_FIELD(oword, FRF_CZ_TX_TCPIP_FILTER_WILD_SEARCH_RANGE,
- efp->ef_depth[EFX_FILTER_TX_TCP_WILD] +
- FILTER_CTL_SRCH_FUDGE_WILD);
- EFX_SET_OWORD_FIELD(oword, FRF_CZ_TX_UDPIP_FILTER_FULL_SEARCH_RANGE,
- efp->ef_depth[EFX_FILTER_TX_UDP_FULL] +
- FILTER_CTL_SRCH_FUDGE_FULL);
- EFX_SET_OWORD_FIELD(oword, FRF_CZ_TX_UDPIP_FILTER_WILD_SEARCH_RANGE,
- efp->ef_depth[EFX_FILTER_TX_UDP_WILD] +
- FILTER_CTL_SRCH_FUDGE_WILD);
+ if (fsfp->fsf_tbl[EFX_FS_FILTER_TBL_TX_IP].fsft_size != 0) {
+ EFX_SET_OWORD_FIELD(oword,
+ FRF_CZ_TX_TCPIP_FILTER_FULL_SEARCH_RANGE,
+ fsfp->fsf_depth[EFX_FS_FILTER_TX_TCP_FULL] +
+ FILTER_CTL_SRCH_FUDGE_FULL);
+ EFX_SET_OWORD_FIELD(oword,
+ FRF_CZ_TX_TCPIP_FILTER_WILD_SEARCH_RANGE,
+ fsfp->fsf_depth[EFX_FS_FILTER_TX_TCP_WILD] +
+ FILTER_CTL_SRCH_FUDGE_WILD);
+ EFX_SET_OWORD_FIELD(oword,
+ FRF_CZ_TX_UDPIP_FILTER_FULL_SEARCH_RANGE,
+ fsfp->fsf_depth[EFX_FS_FILTER_TX_UDP_FULL] +
+ FILTER_CTL_SRCH_FUDGE_FULL);
+ EFX_SET_OWORD_FIELD(oword,
+ FRF_CZ_TX_UDPIP_FILTER_WILD_SEARCH_RANGE,
+ fsfp->fsf_depth[EFX_FS_FILTER_TX_UDP_WILD] +
+ FILTER_CTL_SRCH_FUDGE_WILD);
+ }
+
+ if (fsfp->fsf_tbl[EFX_FS_FILTER_TBL_TX_MAC].fsft_size != 0) {
+ EFX_SET_OWORD_FIELD(
+ oword, FRF_CZ_TX_ETH_FILTER_FULL_SEARCH_RANGE,
+ fsfp->fsf_depth[EFX_FS_FILTER_TX_MAC_FULL] +
+ FILTER_CTL_SRCH_FUDGE_FULL);
+ EFX_SET_OWORD_FIELD(
+ oword, FRF_CZ_TX_ETH_FILTER_WILD_SEARCH_RANGE,
+ fsfp->fsf_depth[EFX_FS_FILTER_TX_MAC_WILD] +
+ FILTER_CTL_SRCH_FUDGE_WILD);
+ }
EFX_BAR_WRITEO(enp, FR_AZ_TX_CFG_REG, &oword);
}
/* Build a filter entry and return its n-tuple key. */
static __checkReturn uint32_t
-efx_filter_build(
+falconsiena_filter_build(
__out efx_oword_t *filter,
- __in efx_filter_spec_t *spec)
+ __in falconsiena_filter_spec_t *spec)
{
uint32_t dword3;
uint32_t key;
- uint8_t type = spec->efs_type;
- uint8_t flags = spec->efs_flags;
+ uint8_t type = spec->fsfs_type;
+ uint32_t flags = spec->fsfs_flags;
- switch (efx_filter_tbl_id(type)) {
- case EFX_FILTER_TBL_RX_IP: {
- boolean_t is_udp = (type == EFX_FILTER_RX_UDP_FULL ||
- type == EFX_FILTER_RX_UDP_WILD);
+ switch (falconsiena_filter_tbl_id(type)) {
+ case EFX_FS_FILTER_TBL_RX_IP: {
+ boolean_t is_udp = (type == EFX_FS_FILTER_RX_UDP_FULL ||
+ type == EFX_FS_FILTER_RX_UDP_WILD);
EFX_POPULATE_OWORD_7(*filter,
- FRF_BZ_RSS_EN, (flags & EFX_FILTER_FLAG_RX_RSS) ? 1 : 0,
- FRF_BZ_SCATTER_EN, (flags & EFX_FILTER_FLAG_RX_SCATTER) ? 1 : 0,
+ FRF_BZ_RSS_EN,
+ (flags & EFX_FILTER_FLAG_RX_RSS) ? 1 : 0,
+ FRF_BZ_SCATTER_EN,
+ (flags & EFX_FILTER_FLAG_RX_SCATTER) ? 1 : 0,
FRF_AZ_TCP_UDP, is_udp,
- FRF_AZ_RXQ_ID, spec->efs_dmaq_id,
- EFX_DWORD_2, spec->efs_dword[2],
- EFX_DWORD_1, spec->efs_dword[1],
- EFX_DWORD_0, spec->efs_dword[0]);
+ FRF_AZ_RXQ_ID, spec->fsfs_dmaq_id,
+ EFX_DWORD_2, spec->fsfs_dword[2],
+ EFX_DWORD_1, spec->fsfs_dword[1],
+ EFX_DWORD_0, spec->fsfs_dword[0]);
dword3 = is_udp;
break;
}
#if EFSYS_OPT_SIENA
- case EFX_FILTER_TBL_RX_MAC: {
- boolean_t is_wild = (type == EFX_FILTER_RX_MAC_WILD);
- EFX_POPULATE_OWORD_8(*filter,
- FRF_CZ_RMFT_RSS_EN, (flags & EFX_FILTER_FLAG_RX_RSS) ? 1 : 0,
- FRF_CZ_RMFT_SCATTER_EN, (flags & EFX_FILTER_FLAG_RX_SCATTER) ? 1 : 0,
- FRF_CZ_RMFT_IP_OVERRIDE, (flags & EFX_FILTER_FLAG_RX_OVERRIDE_IP) ? 1 : 0,
- FRF_CZ_RMFT_RXQ_ID, spec->efs_dmaq_id,
+ case EFX_FS_FILTER_TBL_RX_MAC: {
+ boolean_t is_wild = (type == EFX_FS_FILTER_RX_MAC_WILD);
+ EFX_POPULATE_OWORD_7(*filter,
+ FRF_CZ_RMFT_RSS_EN,
+ (flags & EFX_FILTER_FLAG_RX_RSS) ? 1 : 0,
+ FRF_CZ_RMFT_SCATTER_EN,
+ (flags & EFX_FILTER_FLAG_RX_SCATTER) ? 1 : 0,
+ FRF_CZ_RMFT_RXQ_ID, spec->fsfs_dmaq_id,
FRF_CZ_RMFT_WILDCARD_MATCH, is_wild,
- FRF_CZ_RMFT_DEST_MAC_DW1, spec->efs_dword[2],
- FRF_CZ_RMFT_DEST_MAC_DW0, spec->efs_dword[1],
- FRF_CZ_RMFT_VLAN_ID, spec->efs_dword[0]);
+ FRF_CZ_RMFT_DEST_MAC_DW1, spec->fsfs_dword[2],
+ FRF_CZ_RMFT_DEST_MAC_DW0, spec->fsfs_dword[1],
+ FRF_CZ_RMFT_VLAN_ID, spec->fsfs_dword[0]);
dword3 = is_wild;
break;
}
#endif /* EFSYS_OPT_SIENA */
- case EFX_FILTER_TBL_TX_IP: {
- boolean_t is_udp = (type == EFX_FILTER_TX_UDP_FULL ||
- type == EFX_FILTER_TX_UDP_WILD);
+ case EFX_FS_FILTER_TBL_TX_IP: {
+ boolean_t is_udp = (type == EFX_FS_FILTER_TX_UDP_FULL ||
+ type == EFX_FS_FILTER_TX_UDP_WILD);
EFX_POPULATE_OWORD_5(*filter,
FRF_CZ_TIFT_TCP_UDP, is_udp,
- FRF_CZ_TIFT_TXQ_ID, spec->efs_dmaq_id,
- EFX_DWORD_2, spec->efs_dword[2],
- EFX_DWORD_1, spec->efs_dword[1],
- EFX_DWORD_0, spec->efs_dword[0]);
- dword3 = is_udp | spec->efs_dmaq_id << 1;
+ FRF_CZ_TIFT_TXQ_ID, spec->fsfs_dmaq_id,
+ EFX_DWORD_2, spec->fsfs_dword[2],
+ EFX_DWORD_1, spec->fsfs_dword[1],
+ EFX_DWORD_0, spec->fsfs_dword[0]);
+ dword3 = is_udp | spec->fsfs_dmaq_id << 1;
break;
}
#if EFSYS_OPT_SIENA
- case EFX_FILTER_TBL_TX_MAC: {
- boolean_t is_wild = (type == EFX_FILTER_TX_MAC_WILD);
+ case EFX_FS_FILTER_TBL_TX_MAC: {
+ boolean_t is_wild = (type == EFX_FS_FILTER_TX_MAC_WILD);
EFX_POPULATE_OWORD_5(*filter,
- FRF_CZ_TMFT_TXQ_ID, spec->efs_dmaq_id,
+ FRF_CZ_TMFT_TXQ_ID, spec->fsfs_dmaq_id,
FRF_CZ_TMFT_WILDCARD_MATCH, is_wild,
- FRF_CZ_TMFT_SRC_MAC_DW1, spec->efs_dword[2],
- FRF_CZ_TMFT_SRC_MAC_DW0, spec->efs_dword[1],
- FRF_CZ_TMFT_VLAN_ID, spec->efs_dword[0]);
- dword3 = is_wild | spec->efs_dmaq_id << 1;
+ FRF_CZ_TMFT_SRC_MAC_DW1, spec->fsfs_dword[2],
+ FRF_CZ_TMFT_SRC_MAC_DW0, spec->fsfs_dword[1],
+ FRF_CZ_TMFT_VLAN_ID, spec->fsfs_dword[0]);
+ dword3 = is_wild | spec->fsfs_dmaq_id << 1;
break;
}
#endif /* EFSYS_OPT_SIENA */
default:
EFSYS_ASSERT(B_FALSE);
+ return (0);
}
- key = spec->efs_dword[0] ^ spec->efs_dword[1] ^ spec->efs_dword[2] ^ dword3;
+ key =
+ spec->fsfs_dword[0] ^
+ spec->fsfs_dword[1] ^
+ spec->fsfs_dword[2] ^
+ dword3;
+
return (key);
}
static __checkReturn int
-efx_filter_push_entry(
+falconsiena_filter_push_entry(
__inout efx_nic_t *enp,
- __in efx_filter_type_t type,
+ __in falconsiena_filter_type_t type,
__in int index,
__in efx_oword_t *eop)
{
int rc;
- switch (type)
- {
- case EFX_FILTER_RX_TCP_FULL:
- case EFX_FILTER_RX_TCP_WILD:
- case EFX_FILTER_RX_UDP_FULL:
- case EFX_FILTER_RX_UDP_WILD:
- EFX_BAR_TBL_WRITEO(enp, FR_AZ_RX_FILTER_TBL0, index, eop);
+ switch (type) {
+ case EFX_FS_FILTER_RX_TCP_FULL:
+ case EFX_FS_FILTER_RX_TCP_WILD:
+ case EFX_FS_FILTER_RX_UDP_FULL:
+ case EFX_FS_FILTER_RX_UDP_WILD:
+ EFX_BAR_TBL_WRITEO(enp, FR_AZ_RX_FILTER_TBL0, index,
+ eop, B_TRUE);
break;
#if EFSYS_OPT_SIENA
- case EFX_FILTER_RX_MAC_FULL:
- case EFX_FILTER_RX_MAC_WILD:
- EFX_BAR_TBL_WRITEO(enp, FR_CZ_RX_MAC_FILTER_TBL0, index, eop);
+ case EFX_FS_FILTER_RX_MAC_FULL:
+ case EFX_FS_FILTER_RX_MAC_WILD:
+ EFX_BAR_TBL_WRITEO(enp, FR_CZ_RX_MAC_FILTER_TBL0, index,
+ eop, B_TRUE);
break;
- case EFX_FILTER_TX_TCP_FULL:
- case EFX_FILTER_TX_TCP_WILD:
- case EFX_FILTER_TX_UDP_FULL:
- case EFX_FILTER_TX_UDP_WILD:
- EFX_BAR_TBL_WRITEO(enp, FR_CZ_TX_FILTER_TBL0, index, eop);
+ case EFX_FS_FILTER_TX_TCP_FULL:
+ case EFX_FS_FILTER_TX_TCP_WILD:
+ case EFX_FS_FILTER_TX_UDP_FULL:
+ case EFX_FS_FILTER_TX_UDP_WILD:
+ EFX_BAR_TBL_WRITEO(enp, FR_CZ_TX_FILTER_TBL0, index,
+ eop, B_TRUE);
break;
- case EFX_FILTER_TX_MAC_FULL:
- case EFX_FILTER_TX_MAC_WILD:
- EFX_BAR_TBL_WRITEO(enp, FR_CZ_TX_MAC_FILTER_TBL0, index, eop);
+ case EFX_FS_FILTER_TX_MAC_FULL:
+ case EFX_FS_FILTER_TX_MAC_WILD:
+ EFX_BAR_TBL_WRITEO(enp, FR_CZ_TX_MAC_FILTER_TBL0, index,
+ eop, B_TRUE);
break;
#endif /* EFSYS_OPT_SIENA */
default:
+ EFSYS_ASSERT(B_FALSE);
rc = ENOTSUP;
goto fail1;
}
@@ -385,30 +962,34 @@ fail1:
static __checkReturn boolean_t
-efx_filter_equal(
- __in const efx_filter_spec_t *left,
- __in const efx_filter_spec_t *right)
+falconsiena_filter_equal(
+ __in const falconsiena_filter_spec_t *left,
+ __in const falconsiena_filter_spec_t *right)
{
- efx_filter_tbl_id_t tbl_id = efx_filter_tbl_id(left->efs_type);
+ falconsiena_filter_tbl_id_t tbl_id;
- if (left->efs_type != right->efs_type)
+ tbl_id = falconsiena_filter_tbl_id(left->fsfs_type);
+
+
+ if (left->fsfs_type != right->fsfs_type)
return (B_FALSE);
- if (memcmp(left->efs_dword, right->efs_dword, sizeof(left->efs_dword)))
+ if (memcmp(left->fsfs_dword, right->fsfs_dword,
+ sizeof (left->fsfs_dword)))
return (B_FALSE);
- if ((tbl_id == EFX_FILTER_TBL_TX_IP ||
- tbl_id == EFX_FILTER_TBL_TX_MAC) &&
- left->efs_dmaq_id != right->efs_dmaq_id)
+ if ((tbl_id == EFX_FS_FILTER_TBL_TX_IP ||
+ tbl_id == EFX_FS_FILTER_TBL_TX_MAC) &&
+ left->fsfs_dmaq_id != right->fsfs_dmaq_id)
return (B_FALSE);
return (B_TRUE);
}
static __checkReturn int
-efx_filter_search(
- __in efx_filter_tbl_t *eftp,
- __in efx_filter_spec_t *spec,
+falconsiena_filter_search(
+ __in falconsiena_filter_tbl_t *fsftp,
+ __in falconsiena_filter_spec_t *spec,
__in uint32_t key,
__in boolean_t for_insert,
__out int *filter_index,
@@ -416,18 +997,20 @@ efx_filter_search(
{
unsigned hash, incr, filter_idx, depth;
- hash = efx_filter_tbl_hash(key);
- incr = efx_filter_tbl_increment(key);
+ hash = falconsiena_filter_tbl_hash(key);
+ incr = falconsiena_filter_tbl_increment(key);
- filter_idx = hash & (eftp->eft_size - 1);
+ filter_idx = hash & (fsftp->fsft_size - 1);
depth = 1;
for (;;) {
- /* Return success if entry is used and matches this spec
+ /*
+ * Return success if entry is used and matches this spec
* or entry is unused and we are trying to insert.
*/
- if (efx_filter_test_used(eftp, filter_idx) ?
- efx_filter_equal(spec, &eftp->eft_spec[filter_idx]) :
+ if (falconsiena_filter_test_used(fsftp, filter_idx) ?
+ falconsiena_filter_equal(spec,
+ &fsftp->fsft_spec[filter_idx]) :
for_insert) {
*filter_index = filter_idx;
*depth_required = depth;
@@ -436,594 +1019,421 @@ efx_filter_search(
/* Return failure if we reached the maximum search depth */
if (depth == FILTER_CTL_SRCH_MAX)
- return for_insert ? EBUSY : ENOENT;
+ return (for_insert ? EBUSY : ENOENT);
- filter_idx = (filter_idx + incr) & (eftp->eft_size - 1);
+ filter_idx = (filter_idx + incr) & (fsftp->fsft_size - 1);
++depth;
}
}
- __checkReturn int
-efx_filter_insert_filter(
- __in efx_nic_t *enp,
- __in efx_filter_spec_t *spec,
- __in boolean_t replace)
-{
- efx_filter_t *efp = &enp->en_filter;
- efx_filter_tbl_id_t tbl_id = efx_filter_tbl_id(spec->efs_type);
- efx_filter_tbl_t *eftp = &efp->ef_tbl[tbl_id];
- efx_filter_spec_t *saved_spec;
- efx_oword_t filter;
- int filter_idx;
- unsigned int depth;
- int state;
- uint32_t key;
- int rc;
-
- if (eftp->eft_size == 0)
- return (EINVAL);
-
- key = efx_filter_build(&filter, spec);
-
- EFSYS_LOCK(enp->en_eslp, state);
-
- rc = efx_filter_search(eftp, spec, key, B_TRUE, &filter_idx, &depth);
- if (rc != 0)
- goto done;
-
- EFSYS_ASSERT3U(filter_idx, <, eftp->eft_size);
- saved_spec = &eftp->eft_spec[filter_idx];
-
- if (efx_filter_test_used(eftp, filter_idx)) {
- if (replace == B_FALSE) {
- rc = EEXIST;
- goto done;
- }
- }
- efx_filter_set_used(eftp, filter_idx);
- *saved_spec = *spec;
-
- if (efp->ef_depth[spec->efs_type] < depth) {
- efp->ef_depth[spec->efs_type] = depth;
- if (tbl_id == EFX_FILTER_TBL_TX_IP ||
- tbl_id == EFX_FILTER_TBL_TX_MAC)
- efx_filter_push_tx_limits(enp);
- else
- efx_filter_push_rx_limits(enp);
- }
-
- efx_filter_push_entry(enp, spec->efs_type, filter_idx, &filter);
-
-done:
- EFSYS_UNLOCK(enp->en_eslp, state);
- return (rc);
-}
-
static void
-efx_filter_clear_entry(
+falconsiena_filter_clear_entry(
__in efx_nic_t *enp,
- __in efx_filter_tbl_t *eftp,
+ __in falconsiena_filter_tbl_t *fsftp,
__in int index)
{
efx_oword_t filter;
- if (efx_filter_test_used(eftp, index)) {
- efx_filter_clear_used(eftp, index);
+ if (falconsiena_filter_test_used(fsftp, index)) {
+ falconsiena_filter_clear_used(fsftp, index);
EFX_ZERO_OWORD(filter);
- efx_filter_push_entry(enp, eftp->eft_spec[index].efs_type,
+ falconsiena_filter_push_entry(enp,
+ fsftp->fsft_spec[index].fsfs_type,
index, &filter);
- memset(&eftp->eft_spec[index], 0, sizeof(eftp->eft_spec[0]));
+ memset(&fsftp->fsft_spec[index],
+ 0, sizeof (fsftp->fsft_spec[0]));
}
}
- __checkReturn int
-efx_filter_remove_filter(
- __in efx_nic_t *enp,
- __in efx_filter_spec_t *spec)
-{
- efx_filter_t *efp = &enp->en_filter;
- efx_filter_tbl_id_t tbl_id = efx_filter_tbl_id(spec->efs_type);
- efx_filter_tbl_t *eftp = &efp->ef_tbl[tbl_id];
- efx_filter_spec_t *saved_spec;
- efx_oword_t filter;
- int filter_idx;
- unsigned int depth;
- int state;
- uint32_t key;
- int rc;
-
- key = efx_filter_build(&filter, spec);
-
- EFSYS_LOCK(enp->en_eslp, state);
-
- rc = efx_filter_search(eftp, spec, key, B_FALSE, &filter_idx, &depth);
- if (rc != 0)
- goto out;
-
- saved_spec = &eftp->eft_spec[filter_idx];
-
- efx_filter_clear_entry(enp, eftp, filter_idx);
- if (eftp->eft_used == 0)
- efx_filter_reset_search_depth(efp, tbl_id);
-
- rc = 0;
-
-out:
- EFSYS_UNLOCK(enp->en_eslp, state);
- return (rc);
-}
-
- void
-efx_filter_remove_index(
- __inout efx_nic_t *enp,
- __in efx_filter_type_t type,
- __in int index)
-{
- efx_filter_t *efp = &enp->en_filter;
- efx_filter_tbl_id_t tbl_id = efx_filter_tbl_id(type);
- efx_filter_tbl_t *eftp = &efp->ef_tbl[tbl_id];
- int state;
-
- if (index < 0)
- return;
-
- EFSYS_LOCK(enp->en_eslp, state);
-
- efx_filter_clear_entry(enp, eftp, index);
- if (eftp->eft_used == 0)
- efx_filter_reset_search_depth(efp, tbl_id);
-
- EFSYS_UNLOCK(enp->en_eslp, state);
-}
-
void
-efx_filter_tbl_clear(
- __inout efx_nic_t *enp,
- __in efx_filter_tbl_id_t tbl_id)
+falconsiena_filter_tbl_clear(
+ __in efx_nic_t *enp,
+ __in falconsiena_filter_tbl_id_t tbl_id)
{
- efx_filter_t *efp = &enp->en_filter;
- efx_filter_tbl_t *eftp = &efp->ef_tbl[tbl_id];
+ falconsiena_filter_t *fsfp = enp->en_filter.ef_falconsiena_filter;
+ falconsiena_filter_tbl_t *fsftp = &fsfp->fsf_tbl[tbl_id];
int index;
int state;
EFSYS_LOCK(enp->en_eslp, state);
- for (index = 0; index < eftp->eft_size; ++index) {
- efx_filter_clear_entry(enp, eftp, index);
+ for (index = 0; index < fsftp->fsft_size; ++index) {
+ falconsiena_filter_clear_entry(enp, fsftp, index);
}
- if (eftp->eft_used == 0)
- efx_filter_reset_search_depth(efp, tbl_id);
+ if (fsftp->fsft_used == 0)
+ falconsiena_filter_reset_search_depth(fsfp, tbl_id);
EFSYS_UNLOCK(enp->en_eslp, state);
}
-/* Restore filter state after a reset */
- void
-efx_filter_restore(
+static __checkReturn int
+falconsiena_filter_init(
__in efx_nic_t *enp)
{
- efx_filter_t *efp = &enp->en_filter;
- efx_filter_tbl_id_t tbl_id;
- efx_filter_tbl_t *eftp;
- efx_filter_spec_t *spec;
- efx_oword_t filter;
- int filter_idx;
- int state;
-
- EFSYS_LOCK(enp->en_eslp, state);
+ falconsiena_filter_t *fsfp;
+ falconsiena_filter_tbl_t *fsftp;
+ int tbl_id;
+ int rc;
- for (tbl_id = 0; tbl_id < EFX_FILTER_NTBLS; tbl_id++) {
- eftp = &efp->ef_tbl[tbl_id];
- for (filter_idx = 0; filter_idx < eftp->eft_size; filter_idx++) {
- if (!efx_filter_test_used(eftp, filter_idx))
- continue;
+ EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (falconsiena_filter_t), fsfp);
- spec = &eftp->eft_spec[filter_idx];
- efx_filter_build(&filter, spec);
- efx_filter_push_entry(enp, spec->efs_type,
- filter_idx, &filter);
- }
+ if (!fsfp) {
+ rc = ENOMEM;
+ goto fail1;
}
- efx_filter_push_rx_limits(enp);
- efx_filter_push_tx_limits(enp);
-
- EFSYS_UNLOCK(enp->en_eslp, state);
-}
-
- void
-efx_filter_redirect_index(
- __inout efx_nic_t *enp,
- __in efx_filter_type_t type,
- __in int filter_index,
- __in int rxq_index)
-{
- efx_filter_t *efp = &enp->en_filter;
- efx_filter_tbl_t *eftp =
- &efp->ef_tbl[efx_filter_tbl_id(type)];
- efx_filter_spec_t *spec;
- efx_oword_t filter;
- int state;
-
- EFSYS_LOCK(enp->en_eslp, state);
+ enp->en_filter.ef_falconsiena_filter = fsfp;
- spec = &eftp->eft_spec[filter_index];
- spec->efs_dmaq_id = (uint16_t)rxq_index;
-
- efx_filter_build(&filter, spec);
- efx_filter_push_entry(enp, spec->efs_type, filter_index, &filter);
-
- EFSYS_UNLOCK(enp->en_eslp, state);
-}
-
- __checkReturn int
-efx_filter_init(
- __in efx_nic_t *enp)
-{
- efx_filter_t *efp = &enp->en_filter;
- efx_filter_tbl_t *eftp;
- int tbl_id;
- int rc;
-
- EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
- EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_FILTER));
-
- switch (enp->en_family)
- {
+ switch (enp->en_family) {
#if EFSYS_OPT_FALCON
case EFX_FAMILY_FALCON:
- eftp = &efp->ef_tbl[EFX_FILTER_TBL_RX_IP];
- eftp->eft_size = FR_AZ_RX_FILTER_TBL0_ROWS;
+ fsftp = &fsfp->fsf_tbl[EFX_FS_FILTER_TBL_RX_IP];
+ fsftp->fsft_size = FR_AZ_RX_FILTER_TBL0_ROWS;
break;
#endif /* EFSYS_OPT_FALCON */
#if EFSYS_OPT_SIENA
case EFX_FAMILY_SIENA:
- eftp = &efp->ef_tbl[EFX_FILTER_TBL_RX_IP];
- eftp->eft_size = FR_AZ_RX_FILTER_TBL0_ROWS;
+ fsftp = &fsfp->fsf_tbl[EFX_FS_FILTER_TBL_RX_IP];
+ fsftp->fsft_size = FR_AZ_RX_FILTER_TBL0_ROWS;
- eftp = &efp->ef_tbl[EFX_FILTER_TBL_RX_MAC];
- eftp->eft_size = FR_CZ_RX_MAC_FILTER_TBL0_ROWS;
+ fsftp = &fsfp->fsf_tbl[EFX_FS_FILTER_TBL_RX_MAC];
+ fsftp->fsft_size = FR_CZ_RX_MAC_FILTER_TBL0_ROWS;
- eftp = &efp->ef_tbl[EFX_FILTER_TBL_TX_IP];
- eftp->eft_size = FR_CZ_TX_FILTER_TBL0_ROWS;
+ fsftp = &fsfp->fsf_tbl[EFX_FS_FILTER_TBL_TX_IP];
+ fsftp->fsft_size = FR_CZ_TX_FILTER_TBL0_ROWS;
- eftp = &efp->ef_tbl[EFX_FILTER_TBL_TX_MAC];
- eftp->eft_size = FR_CZ_TX_MAC_FILTER_TBL0_ROWS;
+ fsftp = &fsfp->fsf_tbl[EFX_FS_FILTER_TBL_TX_MAC];
+ fsftp->fsft_size = FR_CZ_TX_MAC_FILTER_TBL0_ROWS;
break;
#endif /* EFSYS_OPT_SIENA */
default:
rc = ENOTSUP;
- goto fail1;
+ goto fail2;
}
- for (tbl_id = 0; tbl_id < EFX_FILTER_NTBLS; tbl_id++) {
+ for (tbl_id = 0; tbl_id < EFX_FS_FILTER_NTBLS; tbl_id++) {
unsigned int bitmap_size;
- eftp = &efp->ef_tbl[tbl_id];
- if (eftp->eft_size == 0)
+ fsftp = &fsfp->fsf_tbl[tbl_id];
+ if (fsftp->fsft_size == 0)
continue;
- EFX_STATIC_ASSERT(sizeof(eftp->eft_bitmap[0]) == sizeof(uint32_t));
- bitmap_size = (eftp->eft_size + (sizeof(uint32_t) * 8) - 1) / 8;
+ EFX_STATIC_ASSERT(sizeof (fsftp->fsft_bitmap[0]) ==
+ sizeof (uint32_t));
+ bitmap_size =
+ (fsftp->fsft_size + (sizeof (uint32_t) * 8) - 1) / 8;
- EFSYS_KMEM_ALLOC(enp->en_esip, bitmap_size, eftp->eft_bitmap);
- if (!eftp->eft_bitmap) {
+ EFSYS_KMEM_ALLOC(enp->en_esip, bitmap_size, fsftp->fsft_bitmap);
+ if (!fsftp->fsft_bitmap) {
rc = ENOMEM;
- goto fail2;
+ goto fail3;
}
- EFSYS_KMEM_ALLOC(enp->en_esip, eftp->eft_size * sizeof(*eftp->eft_spec),
- eftp->eft_spec);
- if (!eftp->eft_spec) {
+ EFSYS_KMEM_ALLOC(enp->en_esip,
+ fsftp->fsft_size * sizeof (*fsftp->fsft_spec),
+ fsftp->fsft_spec);
+ if (!fsftp->fsft_spec) {
rc = ENOMEM;
- goto fail3;
+ goto fail4;
}
- memset(eftp->eft_spec, 0, eftp->eft_size * sizeof(*eftp->eft_spec));
+ memset(fsftp->fsft_spec, 0,
+ fsftp->fsft_size * sizeof (*fsftp->fsft_spec));
}
- enp->en_mod_flags |= EFX_MOD_FILTER;
return (0);
+fail4:
+ EFSYS_PROBE(fail4);
+
fail3:
EFSYS_PROBE(fail3);
fail2:
EFSYS_PROBE(fail2);
- efx_filter_fini(enp);
+ falconsiena_filter_fini(enp);
fail1:
EFSYS_PROBE1(fail1, int, rc);
return (rc);
}
- void
-efx_filter_fini(
+static void
+falconsiena_filter_fini(
__in efx_nic_t *enp)
{
- efx_filter_t *efp = &enp->en_filter;
- efx_filter_tbl_id_t tbl_id;
+ falconsiena_filter_t *fsfp = enp->en_filter.ef_falconsiena_filter;
+ falconsiena_filter_tbl_id_t tbl_id;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
- for (tbl_id = 0; tbl_id < EFX_FILTER_NTBLS; tbl_id++) {
- efx_filter_tbl_t *eftp = &efp->ef_tbl[tbl_id];
+ if (fsfp == NULL)
+ return;
+
+ for (tbl_id = 0; tbl_id < EFX_FS_FILTER_NTBLS; tbl_id++) {
+ falconsiena_filter_tbl_t *fsftp = &fsfp->fsf_tbl[tbl_id];
unsigned int bitmap_size;
- EFX_STATIC_ASSERT(sizeof(eftp->eft_bitmap[0]) == sizeof(uint32_t));
- bitmap_size = (eftp->eft_size + (sizeof(uint32_t) * 8) - 1) / 8;
+ EFX_STATIC_ASSERT(sizeof (fsftp->fsft_bitmap[0]) ==
+ sizeof (uint32_t));
+ bitmap_size =
+ (fsftp->fsft_size + (sizeof (uint32_t) * 8) - 1) / 8;
- if (eftp->eft_bitmap != NULL) {
+ if (fsftp->fsft_bitmap != NULL) {
EFSYS_KMEM_FREE(enp->en_esip, bitmap_size,
- eftp->eft_bitmap);
- eftp->eft_bitmap = NULL;
+ fsftp->fsft_bitmap);
+ fsftp->fsft_bitmap = NULL;
}
- if (eftp->eft_spec != NULL) {
- EFSYS_KMEM_FREE(enp->en_esip, eftp->eft_size *
- sizeof(*eftp->eft_spec), eftp->eft_spec);
- eftp->eft_spec = NULL;
+ if (fsftp->fsft_spec != NULL) {
+ EFSYS_KMEM_FREE(enp->en_esip, fsftp->fsft_size *
+ sizeof (*fsftp->fsft_spec), fsftp->fsft_spec);
+ fsftp->fsft_spec = NULL;
}
}
- enp->en_mod_flags &= ~EFX_MOD_FILTER;
+ EFSYS_KMEM_FREE(enp->en_esip, sizeof (falconsiena_filter_t),
+ enp->en_filter.ef_falconsiena_filter);
}
-extern void
-efx_filter_spec_rx_ipv4_tcp_full(
- __inout efx_filter_spec_t *spec,
- __in unsigned int flags,
- __in uint32_t src_ip,
- __in uint16_t src_tcp,
- __in uint32_t dest_ip,
- __in uint16_t dest_tcp)
+/* Restore filter state after a reset */
+static __checkReturn int
+falconsiena_filter_restore(
+ __in efx_nic_t *enp)
{
- EFSYS_ASSERT3P(spec, !=, NULL);
- EFSYS_ASSERT((flags & ~(EFX_FILTER_FLAG_RX_RSS |
- EFX_FILTER_FLAG_RX_SCATTER)) == 0);
+ falconsiena_filter_t *fsfp = enp->en_filter.ef_falconsiena_filter;
+ falconsiena_filter_tbl_id_t tbl_id;
+ falconsiena_filter_tbl_t *fsftp;
+ falconsiena_filter_spec_t *spec;
+ efx_oword_t filter;
+ int filter_idx;
+ int state;
+ int rc;
- spec->efs_type = EFX_FILTER_RX_TCP_FULL;
- spec->efs_flags = (uint8_t)flags;
- spec->efs_dword[0] = src_tcp | src_ip << 16;
- spec->efs_dword[1] = dest_tcp << 16 | src_ip >> 16;
- spec->efs_dword[2] = dest_ip;
-}
+ EFSYS_LOCK(enp->en_eslp, state);
-extern void
-efx_filter_spec_rx_ipv4_tcp_wild(
- __inout efx_filter_spec_t *spec,
- __in unsigned int flags,
- __in uint32_t dest_ip,
- __in uint16_t dest_tcp)
-{
- EFSYS_ASSERT3P(spec, !=, NULL);
- EFSYS_ASSERT((flags & ~(EFX_FILTER_FLAG_RX_RSS |
- EFX_FILTER_FLAG_RX_SCATTER)) == 0);
+ for (tbl_id = 0; tbl_id < EFX_FS_FILTER_NTBLS; tbl_id++) {
+ fsftp = &fsfp->fsf_tbl[tbl_id];
+ for (filter_idx = 0;
+ filter_idx < fsftp->fsft_size;
+ filter_idx++) {
+ if (!falconsiena_filter_test_used(fsftp, filter_idx))
+ continue;
- spec->efs_type = EFX_FILTER_RX_TCP_WILD;
- spec->efs_flags = (uint8_t)flags;
- spec->efs_dword[0] = 0;
- spec->efs_dword[1] = dest_tcp << 16;
- spec->efs_dword[2] = dest_ip;
-}
+ spec = &fsftp->fsft_spec[filter_idx];
+ if ((rc = falconsiena_filter_build(&filter, spec)) != 0)
+ goto fail1;
+ if ((rc = falconsiena_filter_push_entry(enp,
+ spec->fsfs_type, filter_idx, &filter)) != 0)
+ goto fail2;
+ }
+ }
-extern void
-efx_filter_spec_rx_ipv4_udp_full(
- __inout efx_filter_spec_t *spec,
- __in unsigned int flags,
- __in uint32_t src_ip,
- __in uint16_t src_udp,
- __in uint32_t dest_ip,
- __in uint16_t dest_udp)
-{
- EFSYS_ASSERT3P(spec, !=, NULL);
- EFSYS_ASSERT((flags & ~(EFX_FILTER_FLAG_RX_RSS |
- EFX_FILTER_FLAG_RX_SCATTER)) == 0);
+ falconsiena_filter_push_rx_limits(enp);
+ falconsiena_filter_push_tx_limits(enp);
- spec->efs_type = EFX_FILTER_RX_UDP_FULL;
- spec->efs_flags = (uint8_t)flags;
- spec->efs_dword[0] = src_udp | src_ip << 16;
- spec->efs_dword[1] = dest_udp << 16 | src_ip >> 16;
- spec->efs_dword[2] = dest_ip;
-}
+ EFSYS_UNLOCK(enp->en_eslp, state);
-extern void
-efx_filter_spec_rx_ipv4_udp_wild(
- __inout efx_filter_spec_t *spec,
- __in unsigned int flags,
- __in uint32_t dest_ip,
- __in uint16_t dest_udp)
-{
- EFSYS_ASSERT3P(spec, !=, NULL);
- EFSYS_ASSERT((flags & ~(EFX_FILTER_FLAG_RX_RSS |
- EFX_FILTER_FLAG_RX_SCATTER)) == 0);
+ return (0);
- spec->efs_type = EFX_FILTER_RX_UDP_WILD;
- spec->efs_flags = (uint8_t)flags;
- spec->efs_dword[0] = dest_udp;
- spec->efs_dword[1] = 0;
- spec->efs_dword[2] = dest_ip;
-}
+fail2:
+ EFSYS_PROBE(fail2);
-#if EFSYS_OPT_SIENA
-extern void
-efx_filter_spec_rx_mac_full(
- __inout efx_filter_spec_t *spec,
- __in unsigned int flags,
- __in uint16_t vlan_id,
- __in uint8_t *dest_mac)
-{
- EFSYS_ASSERT3P(spec, !=, NULL);
- EFSYS_ASSERT3P(dest_mac, !=, NULL);
- EFSYS_ASSERT((flags & ~(EFX_FILTER_FLAG_RX_RSS |
- EFX_FILTER_FLAG_RX_SCATTER |
- EFX_FILTER_FLAG_RX_OVERRIDE_IP)) == 0);
-
- spec->efs_type = EFX_FILTER_RX_MAC_FULL;
- spec->efs_flags = (uint8_t)flags;
- spec->efs_dword[0] = vlan_id;
- spec->efs_dword[1] =
- dest_mac[2] << 24 |
- dest_mac[3] << 16 |
- dest_mac[4] << 8 |
- dest_mac[5];
- spec->efs_dword[2] =
- dest_mac[0] << 8 |
- dest_mac[1];
-}
-#endif /* EFSYS_OPT_SIENA */
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
-#if EFSYS_OPT_SIENA
-extern void
-efx_filter_spec_rx_mac_wild(
- __inout efx_filter_spec_t *spec,
- __in unsigned int flags,
- __in uint8_t *dest_mac)
-{
- EFSYS_ASSERT3P(spec, !=, NULL);
- EFSYS_ASSERT3P(dest_mac, !=, NULL);
- EFSYS_ASSERT((flags & ~(EFX_FILTER_FLAG_RX_RSS |
- EFX_FILTER_FLAG_RX_SCATTER |
- EFX_FILTER_FLAG_RX_OVERRIDE_IP)) == 0);
-
- spec->efs_type = EFX_FILTER_RX_MAC_WILD;
- spec->efs_flags = (uint8_t)flags;
- spec->efs_dword[0] = 0;
- spec->efs_dword[1] =
- dest_mac[2] << 24 |
- dest_mac[3] << 16 |
- dest_mac[4] << 8 |
- dest_mac[5];
- spec->efs_dword[2] =
- dest_mac[0] << 8 |
- dest_mac[1];
+ EFSYS_UNLOCK(enp->en_eslp, state);
+
+ return (rc);
}
-#endif /* EFSYS_OPT_SIENA */
-#if EFSYS_OPT_SIENA
-extern void
-efx_filter_spec_tx_ipv4_tcp_full(
+static __checkReturn int
+falconsiena_filter_add(
+ __in efx_nic_t *enp,
__inout efx_filter_spec_t *spec,
- __in uint32_t src_ip,
- __in uint16_t src_tcp,
- __in uint32_t dest_ip,
- __in uint16_t dest_tcp)
+ __in boolean_t may_replace)
{
- EFSYS_ASSERT3P(spec, !=, NULL);
+ int rc;
+ falconsiena_filter_spec_t fs_spec;
+ falconsiena_filter_t *fsfp = enp->en_filter.ef_falconsiena_filter;
+ falconsiena_filter_tbl_id_t tbl_id;
+ falconsiena_filter_tbl_t *fsftp;
+ falconsiena_filter_spec_t *saved_fs_spec;
+ efx_oword_t filter;
+ int filter_idx;
+ unsigned int depth;
+ int state;
+ uint32_t key;
- spec->efs_type = EFX_FILTER_TX_TCP_FULL;
- spec->efs_flags = 0;
- spec->efs_dword[0] = src_tcp | src_ip << 16;
- spec->efs_dword[1] = dest_tcp << 16 | src_ip >> 16;
- spec->efs_dword[2] = dest_ip;
-}
-#endif /* EFSYS_OPT_SIENA */
-#if EFSYS_OPT_SIENA
-extern void
-efx_filter_spec_tx_ipv4_tcp_wild(
- __inout efx_filter_spec_t *spec,
- __in uint32_t src_ip,
- __in uint16_t src_tcp)
-{
EFSYS_ASSERT3P(spec, !=, NULL);
- spec->efs_type = EFX_FILTER_TX_TCP_WILD;
- spec->efs_flags = 0;
- spec->efs_dword[0] = 0;
- spec->efs_dword[1] = src_tcp << 16;
- spec->efs_dword[2] = src_ip;
-}
-#endif /* EFSYS_OPT_SIENA */
+ if ((rc = falconsiena_filter_spec_from_gen_spec(&fs_spec, spec)) != 0)
+ goto fail1;
-#if EFSYS_OPT_SIENA
-extern void
-efx_filter_spec_tx_ipv4_udp_full(
- __inout efx_filter_spec_t *spec,
- __in uint32_t src_ip,
- __in uint16_t src_udp,
- __in uint32_t dest_ip,
- __in uint16_t dest_udp)
-{
- EFSYS_ASSERT3P(spec, !=, NULL);
+ tbl_id = falconsiena_filter_tbl_id(fs_spec.fsfs_type);
+ fsftp = &fsfp->fsf_tbl[tbl_id];
- spec->efs_type = EFX_FILTER_TX_UDP_FULL;
- spec->efs_flags = 0;
- spec->efs_dword[0] = src_udp | src_ip << 16;
- spec->efs_dword[1] = dest_udp << 16 | src_ip >> 16;
- spec->efs_dword[2] = dest_ip;
-}
-#endif /* EFSYS_OPT_SIENA */
+ if (fsftp->fsft_size == 0) {
+ rc = EINVAL;
+ goto fail2;
+ }
-#if EFSYS_OPT_SIENA
-extern void
-efx_filter_spec_tx_ipv4_udp_wild(
- __inout efx_filter_spec_t *spec,
- __in uint32_t src_ip,
- __in uint16_t src_udp)
-{
- EFSYS_ASSERT3P(spec, !=, NULL);
+ key = falconsiena_filter_build(&filter, &fs_spec);
+
+ EFSYS_LOCK(enp->en_eslp, state);
+
+ rc = falconsiena_filter_search(fsftp, &fs_spec, key, B_TRUE,
+ &filter_idx, &depth);
+ if (rc != 0)
+ goto fail3;
+
+ EFSYS_ASSERT3U(filter_idx, <, fsftp->fsft_size);
+ saved_fs_spec = &fsftp->fsft_spec[filter_idx];
+
+ if (falconsiena_filter_test_used(fsftp, filter_idx)) {
+ if (may_replace == B_FALSE) {
+ rc = EEXIST;
+ goto fail4;
+ }
+ }
+ falconsiena_filter_set_used(fsftp, filter_idx);
+ *saved_fs_spec = fs_spec;
+
+ if (fsfp->fsf_depth[fs_spec.fsfs_type] < depth) {
+ fsfp->fsf_depth[fs_spec.fsfs_type] = depth;
+ if (tbl_id == EFX_FS_FILTER_TBL_TX_IP ||
+ tbl_id == EFX_FS_FILTER_TBL_TX_MAC)
+ falconsiena_filter_push_tx_limits(enp);
+ else
+ falconsiena_filter_push_rx_limits(enp);
+ }
+
+ falconsiena_filter_push_entry(enp, fs_spec.fsfs_type,
+ filter_idx, &filter);
+
+ EFSYS_UNLOCK(enp->en_eslp, state);
+ return (0);
+
+fail4:
+ EFSYS_PROBE(fail4);
- spec->efs_type = EFX_FILTER_TX_UDP_WILD;
- spec->efs_flags = 0;
- spec->efs_dword[0] = src_udp;
- spec->efs_dword[1] = 0;
- spec->efs_dword[2] = src_ip;
+fail3:
+ EFSYS_UNLOCK(enp->en_eslp, state);
+ EFSYS_PROBE(fail3);
+
+fail2:
+ EFSYS_PROBE(fail2);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+ return (rc);
}
-#endif /* EFSYS_OPT_SIENA */
-#if EFSYS_OPT_SIENA
-extern void
-efx_filter_spec_tx_mac_full(
- __inout efx_filter_spec_t *spec,
- __in uint16_t vlan_id,
- __in uint8_t *src_mac)
+static __checkReturn int
+falconsiena_filter_delete(
+ __in efx_nic_t *enp,
+ __inout efx_filter_spec_t *spec)
{
+ int rc;
+ falconsiena_filter_spec_t fs_spec;
+ falconsiena_filter_t *fsfp = enp->en_filter.ef_falconsiena_filter;
+ falconsiena_filter_tbl_id_t tbl_id;
+ falconsiena_filter_tbl_t *fsftp;
+ falconsiena_filter_spec_t *saved_spec;
+ efx_oword_t filter;
+ int filter_idx;
+ unsigned int depth;
+ int state;
+ uint32_t key;
+
EFSYS_ASSERT3P(spec, !=, NULL);
- EFSYS_ASSERT3P(src_mac, !=, NULL);
-
- spec->efs_type = EFX_FILTER_TX_MAC_FULL;
- spec->efs_flags = 0;
- spec->efs_dword[0] = vlan_id;
- spec->efs_dword[1] =
- src_mac[2] << 24 |
- src_mac[3] << 16 |
- src_mac[4] << 8 |
- src_mac[5];
- spec->efs_dword[2] =
- src_mac[0] << 8 |
- src_mac[1];
+
+ if ((rc = falconsiena_filter_spec_from_gen_spec(&fs_spec, spec)) != 0)
+ goto fail1;
+
+ tbl_id = falconsiena_filter_tbl_id(fs_spec.fsfs_type);
+ fsftp = &fsfp->fsf_tbl[tbl_id];
+
+ key = falconsiena_filter_build(&filter, &fs_spec);
+
+ EFSYS_LOCK(enp->en_eslp, state);
+
+ rc = falconsiena_filter_search(fsftp, &fs_spec, key, B_FALSE,
+ &filter_idx, &depth);
+ if (rc != 0)
+ goto fail2;
+
+ saved_spec = &fsftp->fsft_spec[filter_idx];
+
+ falconsiena_filter_clear_entry(enp, fsftp, filter_idx);
+ if (fsftp->fsft_used == 0)
+ falconsiena_filter_reset_search_depth(fsfp, tbl_id);
+
+ EFSYS_UNLOCK(enp->en_eslp, state);
+ return (0);
+
+fail2:
+ EFSYS_UNLOCK(enp->en_eslp, state);
+ EFSYS_PROBE(fail2);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+ return (rc);
}
-#endif /* EFSYS_OPT_SIENA */
-#if EFSYS_OPT_SIENA
-extern void
-efx_filter_spec_tx_mac_wild(
- __inout efx_filter_spec_t *spec,
- __in uint8_t *src_mac)
+#define MAX_SUPPORTED 4
+
+static __checkReturn int
+falconsiena_filter_supported_filters(
+ __in efx_nic_t *enp,
+ __out uint32_t *list,
+ __out size_t *length)
{
- EFSYS_ASSERT3P(spec, !=, NULL);
- EFSYS_ASSERT3P(src_mac, !=, NULL);
-
- spec->efs_type = EFX_FILTER_TX_MAC_WILD;
- spec->efs_flags = 0;
- spec->efs_dword[0] = 0;
- spec->efs_dword[1] =
- src_mac[2] << 24 |
- src_mac[3] << 16 |
- src_mac[4] << 8 |
- src_mac[5];
- spec->efs_dword[2] =
- src_mac[0] << 8 |
- src_mac[1];
+ int index = 0;
+ uint32_t rx_matches[MAX_SUPPORTED];
+ int rc;
+
+ if (list == NULL) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ rx_matches[index++] =
+ EFX_FILTER_MATCH_ETHER_TYPE | EFX_FILTER_MATCH_IP_PROTO |
+ EFX_FILTER_MATCH_LOC_HOST | EFX_FILTER_MATCH_LOC_PORT |
+ EFX_FILTER_MATCH_REM_HOST | EFX_FILTER_MATCH_REM_PORT;
+
+ rx_matches[index++] =
+ EFX_FILTER_MATCH_ETHER_TYPE | EFX_FILTER_MATCH_IP_PROTO |
+ EFX_FILTER_MATCH_LOC_HOST | EFX_FILTER_MATCH_LOC_PORT;
+
+ if (enp->en_features & EFX_FEATURE_MAC_HEADER_FILTERS) {
+ rx_matches[index++] =
+ EFX_FILTER_MATCH_OUTER_VID | EFX_FILTER_MATCH_LOC_MAC;
+
+ rx_matches[index++] = EFX_FILTER_MATCH_LOC_MAC;
+ }
+
+ EFSYS_ASSERT3U(index, <=, MAX_SUPPORTED);
+
+ *length = index;
+ memcpy(list, rx_matches, *length);
+
+ return (0);
+
+fail1:
+
+ return (rc);
}
-#endif /* EFSYS_OPT_SIENA */
+#undef MAX_SUPPORTED
+
+#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */
#endif /* EFSYS_OPT_FILTER */
diff --git a/sys/dev/sfxge/common/efx_hash.c b/sys/dev/sfxge/common/efx_hash.c
new file mode 100644
index 0000000..3005c1b
--- /dev/null
+++ b/sys/dev/sfxge/common/efx_hash.c
@@ -0,0 +1,333 @@
+/*-
+ * Copyright 2006 Bob Jenkins
+ *
+ * Derived from public domain source, see
+ * <http://burtleburtle.net/bob/c/lookup3.c>:
+ *
+ * "lookup3.c, by Bob Jenkins, May 2006, Public Domain.
+ *
+ * These are functions for producing 32-bit hashes for hash table lookup...
+ * ...You can use this free for any purpose. It's in the public domain.
+ * It has no warranty."
+ *
+ * Copyright (c) 2014-2015 Solarflare Communications Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "efsys.h"
+#include "efx.h"
+#include "efx_types.h"
+#include "efx_impl.h"
+
+/* Hash initial value */
+#define EFX_HASH_INITIAL_VALUE 0xdeadbeef
+
+/*
+ * Rotate a 32-bit value left
+ *
+ * Allow platform to provide an intrinsic or optimised routine and
+ * fall-back to a simple shift based implementation.
+ */
+#if EFSYS_HAS_ROTL_DWORD
+
+#define EFX_HASH_ROTATE(_value, _shift) \
+ EFSYS_ROTL_DWORD(_value, _shift)
+
+#else
+
+#define EFX_HASH_ROTATE(_value, _shift) \
+ (((_value) << (_shift)) | ((_value) >> (32 - (_shift))))
+
+#endif
+
+/* Mix three 32-bit values reversibly */
+#define EFX_HASH_MIX(_a, _b, _c) \
+ do { \
+ _a -= _c; \
+ _a ^= EFX_HASH_ROTATE(_c, 4); \
+ _c += _b; \
+ _b -= _a; \
+ _b ^= EFX_HASH_ROTATE(_a, 6); \
+ _a += _c; \
+ _c -= _b; \
+ _c ^= EFX_HASH_ROTATE(_b, 8); \
+ _b += _a; \
+ _a -= _c; \
+ _a ^= EFX_HASH_ROTATE(_c, 16); \
+ _c += _b; \
+ _b -= _a; \
+ _b ^= EFX_HASH_ROTATE(_a, 19); \
+ _a += _c; \
+ _c -= _b; \
+ _c ^= EFX_HASH_ROTATE(_b, 4); \
+ _b += _a; \
+ _NOTE(CONSTANTCONDITION) \
+ } while (B_FALSE)
+
+/* Final mixing of three 32-bit values into one (_c) */
+#define EFX_HASH_FINALISE(_a, _b, _c) \
+ do { \
+ _c ^= _b; \
+ _c -= EFX_HASH_ROTATE(_b, 14); \
+ _a ^= _c; \
+ _a -= EFX_HASH_ROTATE(_c, 11); \
+ _b ^= _a; \
+ _b -= EFX_HASH_ROTATE(_a, 25); \
+ _c ^= _b; \
+ _c -= EFX_HASH_ROTATE(_b, 16); \
+ _a ^= _c; \
+ _a -= EFX_HASH_ROTATE(_c, 4); \
+ _b ^= _a; \
+ _b -= EFX_HASH_ROTATE(_a, 14); \
+ _c ^= _b; \
+ _c -= EFX_HASH_ROTATE(_b, 24); \
+ _NOTE(CONSTANTCONDITION) \
+ } while (B_FALSE)
+
+
+/* Produce a 32-bit hash from 32-bit aligned input */
+ __checkReturn uint32_t
+efx_hash_dwords(
+ __in_ecount(count) uint32_t const *input,
+ __in size_t count,
+ __in uint32_t init)
+{
+ uint32_t a;
+ uint32_t b;
+ uint32_t c;
+
+ /* Set up the initial internal state */
+ a = b = c = EFX_HASH_INITIAL_VALUE +
+ (((uint32_t)count) * sizeof (uint32_t)) + init;
+
+ /* Handle all but the last three dwords of the input */
+ while (count > 3) {
+ a += input[0];
+ b += input[1];
+ c += input[2];
+ EFX_HASH_MIX(a, b, c);
+
+ count -= 3;
+ input += 3;
+ }
+
+ /* Handle the left-overs */
+ switch (count) {
+ case 3:
+ c += input[2];
+ /* Fall-through */
+ case 2:
+ b += input[1];
+ /* Fall-through */
+ case 1:
+ a += input[0];
+ EFX_HASH_FINALISE(a, b, c);
+ break;
+
+ case 0:
+ /* Should only get here if count parameter was zero */
+ break;
+ }
+
+ return (c);
+}
+
+#if EFSYS_IS_BIG_ENDIAN
+
+/* Produce a 32-bit hash from arbitrarily aligned input */
+ __checkReturn uint32_t
+efx_hash_bytes(
+ __in_ecount(length) uint8_t const *input,
+ __in size_t length,
+ __in uint32_t init)
+{
+ uint32_t a;
+ uint32_t b;
+ uint32_t c;
+
+ /* Set up the initial internal state */
+ a = b = c = EFX_HASH_INITIAL_VALUE + (uint32_t)length + init;
+
+ /* Handle all but the last twelve bytes of the input */
+ while (length > 12) {
+ a += ((uint32_t)input[0]) << 24;
+ a += ((uint32_t)input[1]) << 16;
+ a += ((uint32_t)input[2]) << 8;
+ a += ((uint32_t)input[3]);
+ b += ((uint32_t)input[4]) << 24;
+ b += ((uint32_t)input[5]) << 16;
+ b += ((uint32_t)input[6]) << 8;
+ b += ((uint32_t)input[7]);
+ c += ((uint32_t)input[8]) << 24;
+ c += ((uint32_t)input[9]) << 16;
+ c += ((uint32_t)input[10]) << 8;
+ c += ((uint32_t)input[11]);
+ EFX_HASH_MIX(a, b, c);
+ length -= 12;
+ input += 12;
+ }
+
+ /* Handle the left-overs */
+ switch (length) {
+ case 12:
+ c += ((uint32_t)input[11]);
+ /* Fall-through */
+ case 11:
+ c += ((uint32_t)input[10]) << 8;
+ /* Fall-through */
+ case 10:
+ c += ((uint32_t)input[9]) << 16;
+ /* Fall-through */
+ case 9:
+ c += ((uint32_t)input[8]) << 24;
+ /* Fall-through */
+ case 8:
+ b += ((uint32_t)input[7]);
+ /* Fall-through */
+ case 7:
+ b += ((uint32_t)input[6]) << 8;
+ /* Fall-through */
+ case 6:
+ b += ((uint32_t)input[5]) << 16;
+ /* Fall-through */
+ case 5:
+ b += ((uint32_t)input[4]) << 24;
+ /* Fall-through */
+ case 4:
+ a += ((uint32_t)input[3]);
+ /* Fall-through */
+ case 3:
+ a += ((uint32_t)input[2]) << 8;
+ /* Fall-through */
+ case 2:
+ a += ((uint32_t)input[1]) << 16;
+ /* Fall-through */
+ case 1:
+ a += ((uint32_t)input[0]) << 24;
+ EFX_HASH_FINALISE(a, b, c);
+ break;
+
+ case 0:
+ /* Should only get here if length parameter was zero */
+ break;
+ }
+
+ return (c);
+}
+
+#elif EFSYS_IS_LITTLE_ENDIAN
+
+/* Produce a 32-bit hash from arbitrarily aligned input */
+ __checkReturn uint32_t
+efx_hash_bytes(
+ __in_ecount(length) uint8_t const *input,
+ __in size_t length,
+ __in uint32_t init)
+{
+ uint32_t a;
+ uint32_t b;
+ uint32_t c;
+
+ /* Set up the initial internal state */
+ a = b = c = EFX_HASH_INITIAL_VALUE + (uint32_t)length + init;
+
+ /* Handle all but the last twelve bytes of the input */
+ while (length > 12) {
+ a += ((uint32_t)input[0]);
+ a += ((uint32_t)input[1]) << 8;
+ a += ((uint32_t)input[2]) << 16;
+ a += ((uint32_t)input[3]) << 24;
+ b += ((uint32_t)input[4]);
+ b += ((uint32_t)input[5]) << 8;
+ b += ((uint32_t)input[6]) << 16;
+ b += ((uint32_t)input[7]) << 24;
+ c += ((uint32_t)input[8]);
+ c += ((uint32_t)input[9]) << 8;
+ c += ((uint32_t)input[10]) << 16;
+ c += ((uint32_t)input[11]) << 24;
+ EFX_HASH_MIX(a, b, c);
+ length -= 12;
+ input += 12;
+ }
+
+ /* Handle the left-overs */
+ switch (length) {
+ case 12:
+ c += ((uint32_t)input[11]) << 24;
+ /* Fall-through */
+ case 11:
+ c += ((uint32_t)input[10]) << 16;
+ /* Fall-through */
+ case 10:
+ c += ((uint32_t)input[9]) << 8;
+ /* Fall-through */
+ case 9:
+ c += ((uint32_t)input[8]);
+ /* Fall-through */
+ case 8:
+ b += ((uint32_t)input[7]) << 24;
+ /* Fall-through */
+ case 7:
+ b += ((uint32_t)input[6]) << 16;
+ /* Fall-through */
+ case 6:
+ b += ((uint32_t)input[5]) << 8;
+ /* Fall-through */
+ case 5:
+ b += ((uint32_t)input[4]);
+ /* Fall-through */
+ case 4:
+ a += ((uint32_t)input[3]) << 24;
+ /* Fall-through */
+ case 3:
+ a += ((uint32_t)input[2]) << 16;
+ /* Fall-through */
+ case 2:
+ a += ((uint32_t)input[1]) << 8;
+ /* Fall-through */
+ case 1:
+ a += ((uint32_t)input[0]);
+ EFX_HASH_FINALISE(a, b, c);
+ break;
+
+ case 0:
+ /* Should only get here if length parameter was zero */
+ break;
+ }
+
+ return (c);
+}
+
+#else
+
+#error "Neither of EFSYS_IS_{BIG,LITTLE}_ENDIAN is set"
+
+#endif
diff --git a/sys/dev/sfxge/common/efx_impl.h b/sys/dev/sfxge/common/efx_impl.h
index e7c2231..6f72d5f 100644
--- a/sys/dev/sfxge/common/efx_impl.h
+++ b/sys/dev/sfxge/common/efx_impl.h
@@ -1,26 +1,31 @@
/*-
- * Copyright 2007-2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2007-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*
* $FreeBSD$
*/
@@ -31,6 +36,15 @@
#include "efsys.h"
#include "efx.h"
#include "efx_regs.h"
+#include "efx_regs_ef10.h"
+
+/* FIXME: Add definition for driver generated software events */
+#ifndef ESE_DZ_EV_CODE_DRV_GEN_EV
+#define ESE_DZ_EV_CODE_DRV_GEN_EV FSE_AZ_EV_CODE_DRV_GEN_EV
+#endif
+
+#include "efx_check.h"
+
#if EFSYS_OPT_FALCON
#include "falcon_impl.h"
@@ -40,40 +54,138 @@
#include "siena_impl.h"
#endif /* EFSYS_OPT_SIENA */
+#if EFSYS_OPT_HUNTINGTON
+#include "hunt_impl.h"
+#endif /* EFSYS_OPT_HUNTINGTON */
+
#ifdef __cplusplus
extern "C" {
#endif
-#define EFX_MOD_MCDI 0x00000001
-#define EFX_MOD_PROBE 0x00000002
-#define EFX_MOD_NVRAM 0x00000004
-#define EFX_MOD_VPD 0x00000008
-#define EFX_MOD_NIC 0x00000010
-#define EFX_MOD_INTR 0x00000020
-#define EFX_MOD_EV 0x00000040
-#define EFX_MOD_RX 0x00000080
-#define EFX_MOD_TX 0x00000100
-#define EFX_MOD_PORT 0x00000200
-#define EFX_MOD_MON 0x00000400
-#define EFX_MOD_WOL 0x00000800
-#define EFX_MOD_FILTER 0x00001000
-
-#define EFX_RESET_MAC 0x00000001
-#define EFX_RESET_PHY 0x00000002
+#define EFX_MOD_MCDI 0x00000001
+#define EFX_MOD_PROBE 0x00000002
+#define EFX_MOD_NVRAM 0x00000004
+#define EFX_MOD_VPD 0x00000008
+#define EFX_MOD_NIC 0x00000010
+#define EFX_MOD_INTR 0x00000020
+#define EFX_MOD_EV 0x00000040
+#define EFX_MOD_RX 0x00000080
+#define EFX_MOD_TX 0x00000100
+#define EFX_MOD_PORT 0x00000200
+#define EFX_MOD_MON 0x00000400
+#define EFX_MOD_WOL 0x00000800
+#define EFX_MOD_FILTER 0x00001000
+#define EFX_MOD_PKTFILTER 0x00002000
+
+#define EFX_RESET_MAC 0x00000001
+#define EFX_RESET_PHY 0x00000002
+#define EFX_RESET_RXQ_ERR 0x00000004
+#define EFX_RESET_TXQ_ERR 0x00000008
typedef enum efx_mac_type_e {
EFX_MAC_INVALID = 0,
EFX_MAC_FALCON_GMAC,
EFX_MAC_FALCON_XMAC,
EFX_MAC_SIENA,
+ EFX_MAC_HUNTINGTON,
EFX_MAC_NTYPES
} efx_mac_type_t;
+typedef struct efx_ev_ops_s {
+ int (*eevo_init)(efx_nic_t *);
+ void (*eevo_fini)(efx_nic_t *);
+ int (*eevo_qcreate)(efx_nic_t *, unsigned int,
+ efsys_mem_t *, size_t, uint32_t,
+ efx_evq_t *);
+ void (*eevo_qdestroy)(efx_evq_t *);
+ int (*eevo_qprime)(efx_evq_t *, unsigned int);
+ void (*eevo_qpost)(efx_evq_t *, uint16_t);
+ int (*eevo_qmoderate)(efx_evq_t *, unsigned int);
+#if EFSYS_OPT_QSTATS
+ void (*eevo_qstats_update)(efx_evq_t *, efsys_stat_t *);
+#endif
+} efx_ev_ops_t;
+
+typedef struct efx_tx_ops_s {
+ int (*etxo_init)(efx_nic_t *);
+ void (*etxo_fini)(efx_nic_t *);
+ int (*etxo_qcreate)(efx_nic_t *,
+ unsigned int, unsigned int,
+ efsys_mem_t *, size_t,
+ uint32_t, uint16_t,
+ efx_evq_t *, efx_txq_t *,
+ unsigned int *);
+ void (*etxo_qdestroy)(efx_txq_t *);
+ int (*etxo_qpost)(efx_txq_t *, efx_buffer_t *,
+ unsigned int, unsigned int,
+ unsigned int *);
+ void (*etxo_qpush)(efx_txq_t *, unsigned int, unsigned int);
+ int (*etxo_qpace)(efx_txq_t *, unsigned int);
+ int (*etxo_qflush)(efx_txq_t *);
+ void (*etxo_qenable)(efx_txq_t *);
+ int (*etxo_qpio_enable)(efx_txq_t *);
+ void (*etxo_qpio_disable)(efx_txq_t *);
+ int (*etxo_qpio_write)(efx_txq_t *,uint8_t *, size_t,
+ size_t);
+ int (*etxo_qpio_post)(efx_txq_t *, size_t, unsigned int,
+ unsigned int *);
+ int (*etxo_qdesc_post)(efx_txq_t *, efx_desc_t *,
+ unsigned int, unsigned int,
+ unsigned int *);
+ void (*etxo_qdesc_dma_create)(efx_txq_t *, efsys_dma_addr_t,
+ size_t, boolean_t,
+ efx_desc_t *);
+ void (*etxo_qdesc_tso_create)(efx_txq_t *, uint16_t,
+ uint32_t, uint8_t,
+ efx_desc_t *);
+ void (*etxo_qdesc_vlantci_create)(efx_txq_t *, uint16_t,
+ efx_desc_t *);
+#if EFSYS_OPT_QSTATS
+ void (*etxo_qstats_update)(efx_txq_t *,
+ efsys_stat_t *);
+#endif
+} efx_tx_ops_t;
+
+typedef struct efx_rx_ops_s {
+ int (*erxo_init)(efx_nic_t *);
+ void (*erxo_fini)(efx_nic_t *);
+#if EFSYS_OPT_RX_HDR_SPLIT
+ int (*erxo_hdr_split_enable)(efx_nic_t *, unsigned int,
+ unsigned int);
+#endif
+#if EFSYS_OPT_RX_SCATTER
+ int (*erxo_scatter_enable)(efx_nic_t *, unsigned int);
+#endif
+#if EFSYS_OPT_RX_SCALE
+ int (*erxo_scale_mode_set)(efx_nic_t *, efx_rx_hash_alg_t,
+ efx_rx_hash_type_t, boolean_t);
+ int (*erxo_scale_key_set)(efx_nic_t *, uint8_t *, size_t);
+ int (*erxo_scale_tbl_set)(efx_nic_t *, unsigned int *,
+ size_t);
+#endif
+ void (*erxo_qpost)(efx_rxq_t *, efsys_dma_addr_t *, size_t,
+ unsigned int, unsigned int,
+ unsigned int);
+ void (*erxo_qpush)(efx_rxq_t *, unsigned int, unsigned int *);
+ int (*erxo_qflush)(efx_rxq_t *);
+ void (*erxo_qenable)(efx_rxq_t *);
+ int (*erxo_qcreate)(efx_nic_t *enp, unsigned int,
+ unsigned int, efx_rxq_type_t,
+ efsys_mem_t *, size_t, uint32_t,
+ efx_evq_t *, efx_rxq_t *);
+ void (*erxo_qdestroy)(efx_rxq_t *);
+} efx_rx_ops_t;
+
typedef struct efx_mac_ops_s {
int (*emo_reset)(efx_nic_t *); /* optional */
int (*emo_poll)(efx_nic_t *, efx_link_mode_t *);
int (*emo_up)(efx_nic_t *, boolean_t *);
+ int (*emo_addr_set)(efx_nic_t *);
int (*emo_reconfigure)(efx_nic_t *);
+ int (*emo_multicast_list_set)(efx_nic_t *);
+ int (*emo_filter_default_rxq_set)(efx_nic_t *,
+ efx_rxq_t *, boolean_t);
+ void (*emo_filter_default_rxq_clear)(efx_nic_t *);
#if EFSYS_OPT_LOOPBACK
int (*emo_loopback_set)(efx_nic_t *, efx_link_mode_t,
efx_loopback_type_t);
@@ -103,21 +215,59 @@ typedef struct efx_phy_ops_s {
#endif /* EFSYS_OPT_PHY_STATS */
#if EFSYS_OPT_PHY_PROPS
#if EFSYS_OPT_NAMES
- const char __cs *(*epo_prop_name)(efx_nic_t *, unsigned int);
+ const char *(*epo_prop_name)(efx_nic_t *, unsigned int);
#endif /* EFSYS_OPT_PHY_PROPS */
int (*epo_prop_get)(efx_nic_t *, unsigned int, uint32_t,
uint32_t *);
int (*epo_prop_set)(efx_nic_t *, unsigned int, uint32_t);
#endif /* EFSYS_OPT_PHY_PROPS */
-#if EFSYS_OPT_PHY_BIST
- int (*epo_bist_start)(efx_nic_t *, efx_phy_bist_type_t);
- int (*epo_bist_poll)(efx_nic_t *, efx_phy_bist_type_t,
- efx_phy_bist_result_t *, uint32_t *,
+#if EFSYS_OPT_BIST
+ int (*epo_bist_enable_offline)(efx_nic_t *);
+ int (*epo_bist_start)(efx_nic_t *, efx_bist_type_t);
+ int (*epo_bist_poll)(efx_nic_t *, efx_bist_type_t,
+ efx_bist_result_t *, uint32_t *,
unsigned long *, size_t);
- void (*epo_bist_stop)(efx_nic_t *, efx_phy_bist_type_t);
-#endif /* EFSYS_OPT_PHY_BIST */
+ void (*epo_bist_stop)(efx_nic_t *, efx_bist_type_t);
+#endif /* EFSYS_OPT_BIST */
} efx_phy_ops_t;
+#if EFSYS_OPT_FILTER
+typedef struct efx_filter_ops_s {
+ int (*efo_init)(efx_nic_t *);
+ void (*efo_fini)(efx_nic_t *);
+ int (*efo_restore)(efx_nic_t *);
+ int (*efo_add)(efx_nic_t *, efx_filter_spec_t *,
+ boolean_t may_replace);
+ int (*efo_delete)(efx_nic_t *, efx_filter_spec_t *);
+ int (*efo_supported_filters)(efx_nic_t *, uint32_t *, size_t *);
+ int (*efo_reconfigure)(efx_nic_t *, uint8_t const *, boolean_t,
+ boolean_t, boolean_t, boolean_t,
+ uint8_t const *, int);
+} efx_filter_ops_t;
+
+extern __checkReturn int
+efx_filter_reconfigure(
+ __in efx_nic_t *enp,
+ __in_ecount(6) uint8_t const *mac_addr,
+ __in boolean_t all_unicst,
+ __in boolean_t mulcst,
+ __in boolean_t all_mulcst,
+ __in boolean_t brdcst,
+ __in_ecount(6*count) uint8_t const *addrs,
+ __in int count);
+
+#endif /* EFSYS_OPT_FILTER */
+
+typedef struct efx_pktfilter_ops_s {
+ int (*epfo_set)(efx_nic_t *,
+ boolean_t unicst,
+ boolean_t brdcast);
+#if EFSYS_OPT_MCAST_FILTER_LIST
+ int (*epfo_mcast_list_set)(efx_nic_t *, uint8_t const *addrs, int count);
+#endif /* EFSYS_OPT_MCAST_FILTER_LIST */
+ int (*epfo_mcast_all)(efx_nic_t *);
+} efx_pktfilter_ops_t;
+
typedef struct efx_port_s {
efx_mac_type_t ep_mac_type;
uint32_t ep_phy_type;
@@ -125,11 +275,16 @@ typedef struct efx_port_s {
uint32_t ep_mac_pdu;
uint8_t ep_mac_addr[6];
efx_link_mode_t ep_link_mode;
- boolean_t ep_unicst;
+ boolean_t ep_all_unicst;
+ boolean_t ep_mulcst;
+ boolean_t ep_all_mulcst;
boolean_t ep_brdcst;
unsigned int ep_fcntl;
boolean_t ep_fcntl_autoneg;
efx_oword_t ep_multicst_hash[2];
+ uint8_t ep_mulcst_addr_list[EFX_MAC_ADDR_LEN *
+ EFX_MAC_MULTICAST_LIST_MAX];
+ uint32_t ep_mulcst_addr_count;
#if EFSYS_OPT_LOOPBACK
efx_loopback_type_t ep_loopback_type;
efx_link_mode_t ep_loopback_link_mode;
@@ -161,8 +316,8 @@ typedef struct efx_port_s {
uint32_t ep_fwver; /* falcon only */
boolean_t ep_mac_drain;
boolean_t ep_mac_stats_pending;
-#if EFSYS_OPT_PHY_BIST
- efx_phy_bist_type_t ep_current_bist;
+#if EFSYS_OPT_BIST
+ efx_bist_type_t ep_current_bist;
#endif
efx_mac_ops_t *ep_emop;
efx_phy_ops_t *ep_epop;
@@ -182,16 +337,30 @@ typedef struct efx_mon_s {
efx_mon_ops_t *em_emop;
} efx_mon_t;
+typedef struct efx_intr_ops_s {
+ int (*eio_init)(efx_nic_t *, efx_intr_type_t, efsys_mem_t *);
+ void (*eio_enable)(efx_nic_t *);
+ void (*eio_disable)(efx_nic_t *);
+ void (*eio_disable_unlocked)(efx_nic_t *);
+ int (*eio_trigger)(efx_nic_t *, unsigned int);
+ void (*eio_fini)(efx_nic_t *);
+} efx_intr_ops_t;
+
typedef struct efx_intr_s {
- efx_intr_type_t ei_type;
+ efx_intr_ops_t *ei_eiop;
efsys_mem_t *ei_esmp;
+ efx_intr_type_t ei_type;
unsigned int ei_level;
} efx_intr_t;
typedef struct efx_nic_ops_s {
int (*eno_probe)(efx_nic_t *);
+ int (*eno_set_drv_limits)(efx_nic_t *, efx_drv_limits_t*);
int (*eno_reset)(efx_nic_t *);
int (*eno_init)(efx_nic_t *);
+ int (*eno_get_vi_pool)(efx_nic_t *, uint32_t *);
+ int (*eno_get_bar_region)(efx_nic_t *, efx_nic_region_t,
+ uint32_t *, size_t *);
#if EFSYS_OPT_DIAG
int (*eno_sram_test)(efx_nic_t *, efx_sram_pattern_fn_t);
int (*eno_register_test)(efx_nic_t *);
@@ -201,94 +370,107 @@ typedef struct efx_nic_ops_s {
} efx_nic_ops_t;
#ifndef EFX_TXQ_LIMIT_TARGET
-# define EFX_TXQ_LIMIT_TARGET 259
+#define EFX_TXQ_LIMIT_TARGET 259
#endif
#ifndef EFX_RXQ_LIMIT_TARGET
-# define EFX_RXQ_LIMIT_TARGET 512
+#define EFX_RXQ_LIMIT_TARGET 512
#endif
#ifndef EFX_TXQ_DC_SIZE
-#define EFX_TXQ_DC_SIZE 1 /* 16 descriptors */
+#define EFX_TXQ_DC_SIZE 1 /* 16 descriptors */
#endif
#ifndef EFX_RXQ_DC_SIZE
-#define EFX_RXQ_DC_SIZE 3 /* 64 descriptors */
+#define EFX_RXQ_DC_SIZE 3 /* 64 descriptors */
#endif
#if EFSYS_OPT_FILTER
-typedef enum efx_filter_type_e {
- EFX_FILTER_RX_TCP_FULL, /* TCP/IPv4 4-tuple {dIP,dTCP,sIP,sTCP} */
- EFX_FILTER_RX_TCP_WILD, /* TCP/IPv4 dest {dIP,dTCP, -, -} */
- EFX_FILTER_RX_UDP_FULL, /* UDP/IPv4 4-tuple {dIP,dUDP,sIP,sUDP} */
- EFX_FILTER_RX_UDP_WILD, /* UDP/IPv4 dest {dIP,dUDP, -, -} */
+typedef struct falconsiena_filter_spec_s {
+ uint8_t fsfs_type;
+ uint32_t fsfs_flags;
+ uint32_t fsfs_dmaq_id;
+ uint32_t fsfs_dword[3];
+} falconsiena_filter_spec_t;
+
+typedef enum falconsiena_filter_type_e {
+ EFX_FS_FILTER_RX_TCP_FULL, /* TCP/IPv4 4-tuple {dIP,dTCP,sIP,sTCP} */
+ EFX_FS_FILTER_RX_TCP_WILD, /* TCP/IPv4 dest {dIP,dTCP, -, -} */
+ EFX_FS_FILTER_RX_UDP_FULL, /* UDP/IPv4 4-tuple {dIP,dUDP,sIP,sUDP} */
+ EFX_FS_FILTER_RX_UDP_WILD, /* UDP/IPv4 dest {dIP,dUDP, -, -} */
#if EFSYS_OPT_SIENA
- EFX_FILTER_RX_MAC_FULL, /* Ethernet {dMAC,VLAN} */
- EFX_FILTER_RX_MAC_WILD, /* Ethernet {dMAC, -} */
+ EFX_FS_FILTER_RX_MAC_FULL, /* Ethernet {dMAC,VLAN} */
+ EFX_FS_FILTER_RX_MAC_WILD, /* Ethernet {dMAC, -} */
- EFX_FILTER_TX_TCP_FULL, /* TCP/IPv4 {dIP,dTCP,sIP,sTCP} */
- EFX_FILTER_TX_TCP_WILD, /* TCP/IPv4 { -, -,sIP,sTCP} */
- EFX_FILTER_TX_UDP_FULL, /* UDP/IPv4 {dIP,dTCP,sIP,sTCP} */
- EFX_FILTER_TX_UDP_WILD, /* UDP/IPv4 source (host, port) */
+ EFX_FS_FILTER_TX_TCP_FULL, /* TCP/IPv4 {dIP,dTCP,sIP,sTCP} */
+ EFX_FS_FILTER_TX_TCP_WILD, /* TCP/IPv4 { -, -,sIP,sTCP} */
+ EFX_FS_FILTER_TX_UDP_FULL, /* UDP/IPv4 {dIP,dTCP,sIP,sTCP} */
+ EFX_FS_FILTER_TX_UDP_WILD, /* UDP/IPv4 source (host, port) */
- EFX_FILTER_TX_MAC_FULL, /* Ethernet source (MAC address, VLAN ID) */
- EFX_FILTER_TX_MAC_WILD, /* Ethernet source (MAC address) */
+ EFX_FS_FILTER_TX_MAC_FULL, /* Ethernet source (MAC address, VLAN ID) */
+ EFX_FS_FILTER_TX_MAC_WILD, /* Ethernet source (MAC address) */
#endif /* EFSYS_OPT_SIENA */
- EFX_FILTER_NTYPES
-} efx_filter_type_t;
-
-typedef enum efx_filter_tbl_id_e {
- EFX_FILTER_TBL_RX_IP = 0,
- EFX_FILTER_TBL_RX_MAC,
- EFX_FILTER_TBL_TX_IP,
- EFX_FILTER_TBL_TX_MAC,
- EFX_FILTER_NTBLS
-} efx_filter_tbl_id_t;
-
-typedef struct efx_filter_tbl_s {
- int eft_size; /* number of entries */
- int eft_used; /* active count */
- uint32_t *eft_bitmap; /* active bitmap */
- efx_filter_spec_t *eft_spec; /* array of saved specs */
-} efx_filter_tbl_t;
+ EFX_FS_FILTER_NTYPES
+} falconsiena_filter_type_t;
+
+typedef enum falconsiena_filter_tbl_id_e {
+ EFX_FS_FILTER_TBL_RX_IP = 0,
+ EFX_FS_FILTER_TBL_RX_MAC,
+ EFX_FS_FILTER_TBL_TX_IP,
+ EFX_FS_FILTER_TBL_TX_MAC,
+ EFX_FS_FILTER_NTBLS
+} falconsiena_filter_tbl_id_t;
+
+typedef struct falconsiena_filter_tbl_s {
+ int fsft_size; /* number of entries */
+ int fsft_used; /* active count */
+ uint32_t *fsft_bitmap; /* active bitmap */
+ falconsiena_filter_spec_t *fsft_spec; /* array of saved specs */
+} falconsiena_filter_tbl_t;
+
+typedef struct falconsiena_filter_s {
+ falconsiena_filter_tbl_t fsf_tbl[EFX_FS_FILTER_NTBLS];
+ unsigned int fsf_depth[EFX_FS_FILTER_NTYPES];
+} falconsiena_filter_t;
typedef struct efx_filter_s {
- efx_filter_tbl_t ef_tbl[EFX_FILTER_NTBLS];
- unsigned int ef_depth[EFX_FILTER_NTYPES];
+#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
+ falconsiena_filter_t *ef_falconsiena_filter;
+#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */
+#if EFSYS_OPT_HUNTINGTON
+ hunt_filter_table_t *ef_hunt_filter_table;
+#endif /* EFSYS_OPT_HUNTINGTON */
} efx_filter_t;
-
-extern __checkReturn int
-efx_filter_insert_filter(
- __in efx_nic_t *enp,
- __in efx_filter_spec_t *spec,
- __in boolean_t replace);
-
-extern __checkReturn int
-efx_filter_remove_filter(
- __in efx_nic_t *enp,
- __in efx_filter_spec_t *spec);
-
-extern void
-efx_filter_remove_index(
- __inout efx_nic_t *enp,
- __in efx_filter_type_t type,
- __in int filter_idx);
-
extern void
-efx_filter_redirect_index(
- __inout efx_nic_t *enp,
- __in efx_filter_type_t type,
- __in int filter_index,
- __in int rxq_index);
-
-extern __checkReturn int
-efx_filter_clear_tbl(
+falconsiena_filter_tbl_clear(
__in efx_nic_t *enp,
- __in efx_filter_tbl_id_t tbl);
+ __in falconsiena_filter_tbl_id_t tbl);
#endif /* EFSYS_OPT_FILTER */
+#if EFSYS_OPT_MCDI
+
+typedef struct efx_mcdi_ops_s {
+ int (*emco_init)(efx_nic_t *, const efx_mcdi_transport_t *);
+ void (*emco_request_copyin)(efx_nic_t *, efx_mcdi_req_t *,
+ unsigned int, boolean_t, boolean_t);
+ boolean_t (*emco_request_poll)(efx_nic_t *);
+ void (*emco_request_copyout)(efx_nic_t *, efx_mcdi_req_t *);
+ int (*emco_poll_reboot)(efx_nic_t *);
+ void (*emco_fini)(efx_nic_t *);
+ int (*emco_fw_update_supported)(efx_nic_t *, boolean_t *);
+ int (*emco_macaddr_change_supported)(efx_nic_t *, boolean_t *);
+} efx_mcdi_ops_t;
+
+typedef struct efx_mcdi_s {
+ efx_mcdi_ops_t *em_emcop;
+ const efx_mcdi_transport_t *em_emtp;
+ efx_mcdi_iface_t em_emip;
+} efx_mcdi_t;
+
+#endif /* EFSYS_OPT_MCDI */
+
#if EFSYS_OPT_NVRAM
typedef struct efx_nvram_ops_s {
#if EFSYS_OPT_DIAG
@@ -325,6 +507,85 @@ typedef struct efx_vpd_ops_s {
} efx_vpd_ops_t;
#endif /* EFSYS_OPT_VPD */
+#if EFSYS_OPT_VPD || EFSYS_OPT_NVRAM
+
+ __checkReturn int
+efx_mcdi_nvram_partitions(
+ __in efx_nic_t *enp,
+ __out_bcount(size) caddr_t data,
+ __in size_t size,
+ __out unsigned int *npartnp);
+
+ __checkReturn int
+efx_mcdi_nvram_metadata(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __out uint32_t *subtypep,
+ __out_ecount(4) uint16_t version[4],
+ __out_bcount_opt(size) char *descp,
+ __in size_t size);
+
+ __checkReturn int
+efx_mcdi_nvram_info(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __out_opt size_t *sizep,
+ __out_opt uint32_t *addressp,
+ __out_opt uint32_t *erase_sizep);
+
+ __checkReturn int
+efx_mcdi_nvram_update_start(
+ __in efx_nic_t *enp,
+ __in uint32_t partn);
+
+ __checkReturn int
+efx_mcdi_nvram_read(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __in uint32_t offset,
+ __out_bcount(size) caddr_t data,
+ __in size_t size);
+
+ __checkReturn int
+efx_mcdi_nvram_erase(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __in uint32_t offset,
+ __in size_t size);
+
+ __checkReturn int
+efx_mcdi_nvram_write(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __in uint32_t offset,
+ __out_bcount(size) caddr_t data,
+ __in size_t size);
+
+ __checkReturn int
+efx_mcdi_nvram_update_finish(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __in boolean_t reboot);
+
+#if EFSYS_OPT_DIAG
+
+ __checkReturn int
+efx_mcdi_nvram_test(
+ __in efx_nic_t *enp,
+ __in uint32_t partn);
+
+#endif /* EFSYS_OPT_DIAG */
+
+#endif /* EFSYS_OPT_VPD || EFSYS_OPT_NVRAM */
+
+typedef struct efx_drv_cfg_s {
+ uint32_t edc_min_vi_count;
+ uint32_t edc_max_vi_count;
+
+ uint32_t edc_max_piobuf_count;
+ uint32_t edc_pio_alloc_size;
+} efx_drv_cfg_t;
+
struct efx_nic_s {
uint32_t en_magic;
efx_family_t en_family;
@@ -335,6 +596,7 @@ struct efx_nic_s {
unsigned int en_mod_flags;
unsigned int en_reset_flags;
efx_nic_cfg_t en_nic_cfg;
+ efx_drv_cfg_t en_drv_cfg;
efx_port_t en_port;
efx_mon_t en_mon;
efx_intr_t en_intr;
@@ -342,9 +604,17 @@ struct efx_nic_s {
uint32_t en_rx_qcount;
uint32_t en_tx_qcount;
efx_nic_ops_t *en_enop;
+ efx_ev_ops_t *en_eevop;
+ efx_tx_ops_t *en_etxop;
+ efx_rx_ops_t *en_erxop;
#if EFSYS_OPT_FILTER
efx_filter_t en_filter;
+ efx_filter_ops_t *en_efop;
#endif /* EFSYS_OPT_FILTER */
+ efx_pktfilter_ops_t *en_epfop;
+#if EFSYS_OPT_MCDI
+ efx_mcdi_t en_mcdi;
+#endif /* EFSYS_OPT_MCDI */
#if EFSYS_OPT_NVRAM
efx_nvram_type_t en_nvram_locked;
efx_nvram_ops_t *en_envop;
@@ -352,6 +622,12 @@ struct efx_nic_s {
#if EFSYS_OPT_VPD
efx_vpd_ops_t *en_evpdop;
#endif /* EFSYS_OPT_VPD */
+#if EFSYS_OPT_RX_SCALE
+ efx_rx_hash_support_t en_hash_support;
+ efx_rx_scale_support_t en_rss_support;
+ uint32_t en_rss_context;
+#endif /* EFSYS_OPT_RX_SCALE */
+ uint32_t en_vport_id;
union {
#if EFSYS_OPT_FALCON
struct {
@@ -373,9 +649,6 @@ struct efx_nic_s {
#endif /* EFSYS_OPT_FALCON */
#if EFSYS_OPT_SIENA
struct {
-#if EFSYS_OPT_MCDI
- efx_mcdi_iface_t enu_mip;
-#endif /* EFSYS_OPT_MCDI */
#if EFSYS_OPT_NVRAM || EFSYS_OPT_VPD
unsigned int enu_partn_mask;
#endif /* EFSYS_OPT_NVRAM || EFSYS_OPT_VPD */
@@ -383,8 +656,28 @@ struct efx_nic_s {
caddr_t enu_svpd;
size_t enu_svpd_length;
#endif /* EFSYS_OPT_VPD */
+ int enu_unused;
} siena;
#endif /* EFSYS_OPT_SIENA */
+#if EFSYS_OPT_HUNTINGTON
+ struct {
+ int enu_vi_base;
+ int enu_vi_count;
+#if EFSYS_OPT_VPD
+ caddr_t enu_svpd;
+ size_t enu_svpd_length;
+#endif /* EFSYS_OPT_VPD */
+ efx_piobuf_handle_t enu_piobuf_handle[HUNT_PIOBUF_NBUFS];
+ uint32_t enu_piobuf_count;
+ uint32_t enu_pio_alloc_map[HUNT_PIOBUF_NBUFS];
+ uint32_t enu_pio_write_vi_base;
+ /* Memory BAR mapping regions */
+ uint32_t enu_uc_mem_map_offset;
+ size_t enu_uc_mem_map_size;
+ uint32_t enu_wc_mem_map_offset;
+ size_t enu_wc_mem_map_size;
+ } hunt;
+#endif /* EFSYS_OPT_HUNTINGTON */
} en_u;
};
@@ -394,6 +687,11 @@ struct efx_nic_s {
typedef boolean_t (*efx_ev_handler_t)(efx_evq_t *, efx_qword_t *,
const efx_ev_callbacks_t *, void *);
+typedef struct efx_evq_rxq_state_s {
+ unsigned int eers_rx_read_ptr;
+ unsigned int eers_rx_mask;
+} efx_evq_rxq_state_t;
+
struct efx_evq_s {
uint32_t ee_magic;
efx_nic_t *ee_enp;
@@ -403,7 +701,17 @@ struct efx_evq_s {
#if EFSYS_OPT_QSTATS
uint32_t ee_stat[EV_NQSTATS];
#endif /* EFSYS_OPT_QSTATS */
- efx_ev_handler_t ee_handler[1 << FSF_AZ_EV_CODE_WIDTH];
+
+ efx_ev_handler_t ee_rx;
+ efx_ev_handler_t ee_tx;
+ efx_ev_handler_t ee_driver;
+ efx_ev_handler_t ee_global;
+ efx_ev_handler_t ee_drv_gen;
+#if EFSYS_OPT_MCDI
+ efx_ev_handler_t ee_mcdi;
+#endif /* EFSYS_OPT_MCDI */
+
+ efx_evq_rxq_state_t ee_rxq_state[EFX_EV_RX_NLABELS];
};
#define EFX_EVQ_MAGIC 0x08081997
@@ -414,7 +722,9 @@ struct efx_evq_s {
struct efx_rxq_s {
uint32_t er_magic;
efx_nic_t *er_enp;
+ efx_evq_t *er_eep;
unsigned int er_index;
+ unsigned int er_label;
unsigned int er_mask;
efsys_mem_t *er_esmp;
};
@@ -427,6 +737,13 @@ struct efx_txq_s {
unsigned int et_index;
unsigned int et_mask;
efsys_mem_t *et_esmp;
+#if EFSYS_OPT_HUNTINGTON
+ uint32_t et_pio_bufnum;
+ uint32_t et_pio_blknum;
+ uint32_t et_pio_write_offset;
+ uint32_t et_pio_offset;
+ size_t et_pio_size;
+#endif
#if EFSYS_OPT_QSTATS
uint32_t et_stat[TX_NQSTATS];
#endif /* EFSYS_OPT_QSTATS */
@@ -445,10 +762,19 @@ struct efx_txq_s {
_NOTE(CONSTANTCONDITION) \
} while (B_FALSE)
+#define EFX_MAC_BROADCAST_ADDR_SET(_dst) \
+ do { \
+ uint16_t *_d = (uint16_t *)(_dst); \
+ _d[0] = 0xffff; \
+ _d[1] = 0xffff; \
+ _d[2] = 0xffff; \
+ _NOTE(CONSTANTCONDITION) \
+ } while (B_FALSE)
+
#if EFSYS_OPT_CHECK_REG
#define EFX_CHECK_REG(_enp, _reg) \
do { \
- const char __cs *name = #_reg; \
+ const char *name = #_reg; \
char min = name[4]; \
char max = name[5]; \
char rev; \
@@ -462,6 +788,10 @@ struct efx_txq_s {
rev = 'C'; \
break; \
\
+ case EFX_FAMILY_HUNTINGTON: \
+ rev = 'D'; \
+ break; \
+ \
default: \
rev = '?'; \
break; \
@@ -578,6 +908,21 @@ struct efx_txq_s {
_NOTE(CONSTANTCONDITION) \
} while (B_FALSE)
+#define EFX_BAR_TBL_WRITED2(_enp, _reg, _index, _edp, _lock) \
+ do { \
+ EFX_CHECK_REG((_enp), (_reg)); \
+ EFSYS_PROBE4(efx_bar_tbl_writed, const char *, #_reg, \
+ uint32_t, (_index), \
+ uint32_t, _reg ## _OFST, \
+ uint32_t, (_edp)->ed_u32[0]); \
+ EFSYS_BAR_WRITED((_enp)->en_esbp, \
+ (_reg ## _OFST + \
+ (2 * sizeof (efx_dword_t)) + \
+ ((_index) * _reg ## _STEP)), \
+ (_edp), (_lock)); \
+ _NOTE(CONSTANTCONDITION) \
+ } while (B_FALSE)
+
#define EFX_BAR_TBL_WRITED3(_enp, _reg, _index, _edp, _lock) \
do { \
EFX_CHECK_REG((_enp), (_reg)); \
@@ -621,12 +966,12 @@ struct efx_txq_s {
_NOTE(CONSTANTCONDITION) \
} while (B_FALSE)
-#define EFX_BAR_TBL_READO(_enp, _reg, _index, _eop) \
+#define EFX_BAR_TBL_READO(_enp, _reg, _index, _eop, _lock) \
do { \
EFX_CHECK_REG((_enp), (_reg)); \
EFSYS_BAR_READO((_enp)->en_esbp, \
(_reg ## _OFST + ((_index) * _reg ## _STEP)), \
- (_eop), B_TRUE); \
+ (_eop), (_lock)); \
EFSYS_PROBE7(efx_bar_tbl_reado, const char *, #_reg, \
uint32_t, (_index), \
uint32_t, _reg ## _OFST, \
@@ -637,7 +982,7 @@ struct efx_txq_s {
_NOTE(CONSTANTCONDITION) \
} while (B_FALSE)
-#define EFX_BAR_TBL_WRITEO(_enp, _reg, _index, _eop) \
+#define EFX_BAR_TBL_WRITEO(_enp, _reg, _index, _eop, _lock) \
do { \
EFX_CHECK_REG((_enp), (_reg)); \
EFSYS_PROBE7(efx_bar_tbl_writeo, const char *, #_reg, \
@@ -649,14 +994,71 @@ struct efx_txq_s {
uint32_t, (_eop)->eo_u32[0]); \
EFSYS_BAR_WRITEO((_enp)->en_esbp, \
(_reg ## _OFST + ((_index) * _reg ## _STEP)), \
- (_eop), B_TRUE); \
+ (_eop), (_lock)); \
+ _NOTE(CONSTANTCONDITION) \
+ } while (B_FALSE)
+
+/*
+ * Allow drivers to perform optimised 128-bit doorbell writes.
+ * The DMA descriptor pointers (RX_DESC_UPD and TX_DESC_UPD) are
+ * special-cased in the BIU on the Falcon/Siena and EF10 architectures to avoid
+ * the need for locking in the host, and are the only ones known to be safe to
+ * use 128-bites write with.
+ */
+#define EFX_BAR_TBL_DOORBELL_WRITEO(_enp, _reg, _index, _eop) \
+ do { \
+ EFX_CHECK_REG((_enp), (_reg)); \
+ EFSYS_PROBE7(efx_bar_tbl_doorbell_writeo, \
+ const char *, \
+ #_reg, \
+ uint32_t, (_index), \
+ uint32_t, _reg ## _OFST, \
+ uint32_t, (_eop)->eo_u32[3], \
+ uint32_t, (_eop)->eo_u32[2], \
+ uint32_t, (_eop)->eo_u32[1], \
+ uint32_t, (_eop)->eo_u32[0]); \
+ EFSYS_BAR_DOORBELL_WRITEO((_enp)->en_esbp, \
+ (_reg ## _OFST + ((_index) * _reg ## _STEP)), \
+ (_eop)); \
+ _NOTE(CONSTANTCONDITION) \
+ } while (B_FALSE)
+
+#define EFX_DMA_SYNC_QUEUE_FOR_DEVICE(_esmp, _entries, _wptr, _owptr) \
+ do { \
+ unsigned int _new = (_wptr); \
+ unsigned int _old = (_owptr); \
+ \
+ if ((_new) >= (_old)) \
+ EFSYS_DMA_SYNC_FOR_DEVICE((_esmp), \
+ (_old) * sizeof (efx_desc_t), \
+ ((_new) - (_old)) * sizeof (efx_desc_t)); \
+ else \
+ /* \
+ * It is cheaper to sync entire map than sync \
+ * two parts especially when offset/size are \
+ * ignored and entire map is synced in any case.\
+ */ \
+ EFSYS_DMA_SYNC_FOR_DEVICE((_esmp), \
+ 0, \
+ (_entries) * sizeof (efx_desc_t)); \
_NOTE(CONSTANTCONDITION) \
} while (B_FALSE)
extern __checkReturn int
+efx_nic_biu_test(
+ __in efx_nic_t *enp);
+
+extern __checkReturn int
efx_mac_select(
__in efx_nic_t *enp);
+extern void
+efx_mac_multicast_hash_compute(
+ __in_ecount(6*count) uint8_t const *addrs,
+ __in int count,
+ __out efx_oword_t *hash_low,
+ __out efx_oword_t *hash_high);
+
extern __checkReturn int
efx_phy_probe(
__in efx_nic_t *enp);
@@ -683,7 +1085,7 @@ efx_vpd_hunk_verify(
extern __checkReturn int
efx_vpd_hunk_reinit(
- __in caddr_t data,
+ __in_bcount(size) caddr_t data,
__in size_t size,
__in boolean_t wantpid);
@@ -716,7 +1118,7 @@ efx_vpd_hunk_set(
#if EFSYS_OPT_DIAG
-extern efx_sram_pattern_fn_t __cs __efx_sram_pattern_fns[];
+extern efx_sram_pattern_fn_t __efx_sram_pattern_fns[];
typedef struct efx_register_set_s {
unsigned int address;
@@ -740,6 +1142,23 @@ efx_nic_test_tables(
#endif /* EFSYS_OPT_DIAG */
+#if EFSYS_OPT_MCDI
+
+extern __checkReturn int
+efx_mcdi_set_workaround(
+ __in efx_nic_t *enp,
+ __in uint32_t type,
+ __in boolean_t enabled,
+ __out_opt uint32_t *flagsp);
+
+extern __checkReturn int
+efx_mcdi_get_workarounds(
+ __in efx_nic_t *enp,
+ __out_opt uint32_t *implementedp,
+ __out_opt uint32_t *enabledp);
+
+#endif /* EFSYS_OPT_MCDI */
+
#ifdef __cplusplus
}
#endif
diff --git a/sys/dev/sfxge/common/efx_intr.c b/sys/dev/sfxge/common/efx_intr.c
index 556728d..d40f57f 100644
--- a/sys/dev/sfxge/common/efx_intr.c
+++ b/sys/dev/sfxge/common/efx_intr.c
@@ -1,26 +1,31 @@
/*-
- * Copyright 2007-2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2007-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -32,6 +37,82 @@ __FBSDID("$FreeBSD$");
#include "efx_regs.h"
#include "efx_impl.h"
+
+#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
+
+static __checkReturn int
+falconsiena_intr_init(
+ __in efx_nic_t *enp,
+ __in efx_intr_type_t type,
+ __in efsys_mem_t *esmp);
+
+static void
+falconsiena_intr_enable(
+ __in efx_nic_t *enp);
+
+static void
+falconsiena_intr_disable(
+ __in efx_nic_t *enp);
+
+static void
+falconsiena_intr_disable_unlocked(
+ __in efx_nic_t *enp);
+
+static __checkReturn int
+falconsiena_intr_trigger(
+ __in efx_nic_t *enp,
+ __in unsigned int level);
+
+static void
+falconsiena_intr_fini(
+ __in efx_nic_t *enp);
+
+
+static __checkReturn boolean_t
+falconsiena_intr_check_fatal(
+ __in efx_nic_t *enp);
+
+static void
+falconsiena_intr_fatal(
+ __in efx_nic_t *enp);
+
+#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */
+
+
+#if EFSYS_OPT_FALCON
+static efx_intr_ops_t __efx_intr_falcon_ops = {
+ falconsiena_intr_init, /* eio_init */
+ falconsiena_intr_enable, /* eio_enable */
+ falconsiena_intr_disable, /* eio_disable */
+ falconsiena_intr_disable_unlocked, /* eio_disable_unlocked */
+ falconsiena_intr_trigger, /* eio_trigger */
+ falconsiena_intr_fini, /* eio_fini */
+};
+#endif /* EFSYS_OPT_FALCON */
+
+#if EFSYS_OPT_SIENA
+static efx_intr_ops_t __efx_intr_siena_ops = {
+ falconsiena_intr_init, /* eio_init */
+ falconsiena_intr_enable, /* eio_enable */
+ falconsiena_intr_disable, /* eio_disable */
+ falconsiena_intr_disable_unlocked, /* eio_disable_unlocked */
+ falconsiena_intr_trigger, /* eio_trigger */
+ falconsiena_intr_fini, /* eio_fini */
+};
+#endif /* EFSYS_OPT_SIENA */
+
+#if EFSYS_OPT_HUNTINGTON
+static efx_intr_ops_t __efx_intr_hunt_ops = {
+ hunt_intr_init, /* eio_init */
+ hunt_intr_enable, /* eio_enable */
+ hunt_intr_disable, /* eio_disable */
+ hunt_intr_disable_unlocked, /* eio_disable_unlocked */
+ hunt_intr_trigger, /* eio_trigger */
+ hunt_intr_fini, /* eio_fini */
+};
+#endif /* EFSYS_OPT_HUNTINGTON */
+
+
__checkReturn int
efx_intr_init(
__in efx_nic_t *enp,
@@ -39,7 +120,7 @@ efx_intr_init(
__in efsys_mem_t *esmp)
{
efx_intr_t *eip = &(enp->en_intr);
- efx_oword_t oword;
+ efx_intr_ops_t *eiop;
int rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -50,10 +131,219 @@ efx_intr_init(
goto fail1;
}
+ eip->ei_esmp = esmp;
+ eip->ei_type = type;
+ eip->ei_level = 0;
+
enp->en_mod_flags |= EFX_MOD_INTR;
- eip->ei_type = type;
- eip->ei_esmp = esmp;
+ switch (enp->en_family) {
+#if EFSYS_OPT_FALCON
+ case EFX_FAMILY_FALCON:
+ eiop = (efx_intr_ops_t *)&__efx_intr_falcon_ops;
+ break;
+#endif /* EFSYS_OPT_FALCON */
+
+#if EFSYS_OPT_SIENA
+ case EFX_FAMILY_SIENA:
+ eiop = (efx_intr_ops_t *)&__efx_intr_siena_ops;
+ break;
+#endif /* EFSYS_OPT_SIENA */
+
+#if EFSYS_OPT_HUNTINGTON
+ case EFX_FAMILY_HUNTINGTON:
+ eiop = (efx_intr_ops_t *)&__efx_intr_hunt_ops;
+ break;
+#endif /* EFSYS_OPT_HUNTINGTON */
+
+ default:
+ EFSYS_ASSERT(B_FALSE);
+ rc = ENOTSUP;
+ goto fail2;
+ }
+
+ if ((rc = eiop->eio_init(enp, type, esmp)) != 0)
+ goto fail3;
+
+ eip->ei_eiop = eiop;
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ void
+efx_intr_fini(
+ __in efx_nic_t *enp)
+{
+ efx_intr_t *eip = &(enp->en_intr);
+ efx_intr_ops_t *eiop = eip->ei_eiop;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
+
+ eiop->eio_fini(enp);
+
+ enp->en_mod_flags &= ~EFX_MOD_INTR;
+}
+
+ void
+efx_intr_enable(
+ __in efx_nic_t *enp)
+{
+ efx_intr_t *eip = &(enp->en_intr);
+ efx_intr_ops_t *eiop = eip->ei_eiop;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
+
+ eiop->eio_enable(enp);
+}
+
+ void
+efx_intr_disable(
+ __in efx_nic_t *enp)
+{
+ efx_intr_t *eip = &(enp->en_intr);
+ efx_intr_ops_t *eiop = eip->ei_eiop;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
+
+ eiop->eio_disable(enp);
+}
+
+ void
+efx_intr_disable_unlocked(
+ __in efx_nic_t *enp)
+{
+ efx_intr_t *eip = &(enp->en_intr);
+ efx_intr_ops_t *eiop = eip->ei_eiop;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
+
+ eiop->eio_disable_unlocked(enp);
+}
+
+
+ __checkReturn int
+efx_intr_trigger(
+ __in efx_nic_t *enp,
+ __in unsigned int level)
+{
+ efx_intr_t *eip = &(enp->en_intr);
+ efx_intr_ops_t *eiop = eip->ei_eiop;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
+
+ return (eiop->eio_trigger(enp, level));
+}
+
+ void
+efx_intr_status_line(
+ __in efx_nic_t *enp,
+ __out boolean_t *fatalp,
+ __out uint32_t *qmaskp)
+{
+ efx_intr_t *eip = &(enp->en_intr);
+ efx_dword_t dword;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
+
+ /* Ensure Huntington and Falcon/Siena ISR at same location */
+ EFX_STATIC_ASSERT(FR_BZ_INT_ISR0_REG_OFST ==
+ ER_DZ_BIU_INT_ISR_REG_OFST);
+
+ /*
+ * Read the queue mask and implicitly acknowledge the
+ * interrupt.
+ */
+ EFX_BAR_READD(enp, FR_BZ_INT_ISR0_REG, &dword, B_FALSE);
+ *qmaskp = EFX_DWORD_FIELD(dword, EFX_DWORD_0);
+
+ EFSYS_PROBE1(qmask, uint32_t, *qmaskp);
+
+#if EFSYS_OPT_HUNTINGTON
+ if (enp->en_family == EFX_FAMILY_HUNTINGTON) {
+ /* Huntington reports fatal errors via events */
+ *fatalp = B_FALSE;
+ return;
+ }
+#endif
+ if (*qmaskp & (1U << eip->ei_level))
+ *fatalp = falconsiena_intr_check_fatal(enp);
+ else
+ *fatalp = B_FALSE;
+}
+
+ void
+efx_intr_status_message(
+ __in efx_nic_t *enp,
+ __in unsigned int message,
+ __out boolean_t *fatalp)
+{
+ efx_intr_t *eip = &(enp->en_intr);
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
+
+#if EFSYS_OPT_HUNTINGTON
+ if (enp->en_family == EFX_FAMILY_HUNTINGTON) {
+ /* Huntington reports fatal errors via events */
+ *fatalp = B_FALSE;
+ return;
+ }
+#endif
+ if (message == eip->ei_level)
+ *fatalp = falconsiena_intr_check_fatal(enp);
+ else
+ *fatalp = B_FALSE;
+}
+
+ void
+efx_intr_fatal(
+ __in efx_nic_t *enp)
+{
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
+
+#if EFSYS_OPT_HUNTINGTON
+ if (enp->en_family == EFX_FAMILY_HUNTINGTON) {
+ /* Huntington reports fatal errors via events */
+ return;
+ }
+#endif
+#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
+ falconsiena_intr_fatal(enp);
+#endif
+}
+
+
+/* ************************************************************************* */
+/* ************************************************************************* */
+/* ************************************************************************* */
+
+#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
+
+static __checkReturn int
+falconsiena_intr_init(
+ __in efx_nic_t *enp,
+ __in efx_intr_type_t type,
+ __in efsys_mem_t *esmp)
+{
+ efx_intr_t *eip = &(enp->en_intr);
+ efx_oword_t oword;
/*
* bug17213 workaround.
@@ -85,23 +375,15 @@ efx_intr_init(
EFX_BAR_WRITEO(enp, FR_AZ_INT_ADR_REG_KER, &oword);
return (0);
-
-fail1:
- EFSYS_PROBE1(fail1, int, rc);
-
- return (rc);
}
- void
-efx_intr_enable(
+static void
+falconsiena_intr_enable(
__in efx_nic_t *enp)
{
efx_intr_t *eip = &(enp->en_intr);
efx_oword_t oword;
- EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
-
EFX_BAR_READO(enp, FR_AZ_INT_EN_REG_KER, &oword);
EFX_SET_OWORD_FIELD(oword, FRF_AZ_KER_INT_LEVE_SEL, eip->ei_level);
@@ -109,15 +391,12 @@ efx_intr_enable(
EFX_BAR_WRITEO(enp, FR_AZ_INT_EN_REG_KER, &oword);
}
- void
-efx_intr_disable(
+static void
+falconsiena_intr_disable(
__in efx_nic_t *enp)
{
efx_oword_t oword;
- EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
-
EFX_BAR_READO(enp, FR_AZ_INT_EN_REG_KER, &oword);
EFX_SET_OWORD_FIELD(oword, FRF_AZ_DRV_INT_EN_KER, 0);
EFX_BAR_WRITEO(enp, FR_AZ_INT_EN_REG_KER, &oword);
@@ -125,15 +404,12 @@ efx_intr_disable(
EFSYS_SPIN(10);
}
- void
-efx_intr_disable_unlocked(
+static void
+falconsiena_intr_disable_unlocked(
__in efx_nic_t *enp)
{
efx_oword_t oword;
- EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
-
EFSYS_BAR_READO(enp->en_esbp, FR_AZ_INT_EN_REG_KER_OFST,
&oword, B_FALSE);
EFX_SET_OWORD_FIELD(oword, FRF_AZ_DRV_INT_EN_KER, 0);
@@ -141,8 +417,8 @@ efx_intr_disable_unlocked(
&oword, B_FALSE);
}
- __checkReturn int
-efx_intr_trigger(
+static __checkReturn int
+falconsiena_intr_trigger(
__in efx_nic_t *enp,
__in unsigned int level)
{
@@ -152,22 +428,19 @@ efx_intr_trigger(
uint32_t sel;
int rc;
- EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
-
/* bug16757: No event queues can be initialized */
EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_EV));
switch (enp->en_family) {
case EFX_FAMILY_FALCON:
- if (level > EFX_NINTR_FALCON) {
+ if (level >= EFX_NINTR_FALCON) {
rc = EINVAL;
goto fail1;
}
break;
case EFX_FAMILY_SIENA:
- if (level > EFX_NINTR_SIENA) {
+ if (level >= EFX_NINTR_SIENA) {
rc = EINVAL;
goto fail1;
}
@@ -213,7 +486,7 @@ fail1:
}
static __checkReturn boolean_t
-efx_intr_check_fatal(
+falconsiena_intr_check_fatal(
__in efx_nic_t *enp)
{
efx_intr_t *eip = &(enp->en_intr);
@@ -236,61 +509,14 @@ efx_intr_check_fatal(
return (B_FALSE);
}
- void
-efx_intr_status_line(
- __in efx_nic_t *enp,
- __out boolean_t *fatalp,
- __out uint32_t *qmaskp)
-{
- efx_intr_t *eip = &(enp->en_intr);
- efx_dword_t dword;
-
- EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
-
- /*
- * Read the queue mask and implicitly acknowledge the
- * interrupt.
- */
- EFX_BAR_READD(enp, FR_BZ_INT_ISR0_REG, &dword, B_FALSE);
- *qmaskp = EFX_DWORD_FIELD(dword, EFX_DWORD_0);
-
- EFSYS_PROBE1(qmask, uint32_t, *qmaskp);
-
- if (*qmaskp & (1U << eip->ei_level))
- *fatalp = efx_intr_check_fatal(enp);
- else
- *fatalp = B_FALSE;
-}
-
- void
-efx_intr_status_message(
- __in efx_nic_t *enp,
- __in unsigned int message,
- __out boolean_t *fatalp)
-{
- efx_intr_t *eip = &(enp->en_intr);
-
- EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
-
- if (message == eip->ei_level)
- *fatalp = efx_intr_check_fatal(enp);
- else
- *fatalp = B_FALSE;
-}
-
- void
-efx_intr_fatal(
+static void
+falconsiena_intr_fatal(
__in efx_nic_t *enp)
{
#if EFSYS_OPT_DECODE_INTR_FATAL
efx_oword_t fatal;
efx_oword_t mem_per;
- EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
-
EFX_BAR_READO(enp, FR_AZ_FATAL_INTR_REG_KER, &fatal);
EFX_ZERO_OWORD(mem_per);
@@ -339,19 +565,15 @@ efx_intr_fatal(
#endif
}
- void
-efx_intr_fini(
+static void
+falconsiena_intr_fini(
__in efx_nic_t *enp)
{
efx_oword_t oword;
- EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
-
/* Clear the interrupt address register */
EFX_ZERO_OWORD(oword);
EFX_BAR_WRITEO(enp, FR_AZ_INT_ADR_REG_KER, &oword);
-
- enp->en_mod_flags &= ~EFX_MOD_INTR;
}
+
+#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */
diff --git a/sys/dev/sfxge/common/efx_mac.c b/sys/dev/sfxge/common/efx_mac.c
index 3e9449a..a701797 100644
--- a/sys/dev/sfxge/common/efx_mac.c
+++ b/sys/dev/sfxge/common/efx_mac.c
@@ -1,26 +1,31 @@
/*-
- * Copyright 2007-2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2007-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -39,74 +44,126 @@ __FBSDID("$FreeBSD$");
#include "falcon_xmac.h"
#endif
+#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
+
+static __checkReturn int
+falconsiena_mac_multicast_list_set(
+ __in efx_nic_t *enp);
+
+#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */
+
#if EFSYS_OPT_MAC_FALCON_GMAC
-static efx_mac_ops_t __cs __efx_falcon_gmac_ops = {
- falcon_gmac_reset, /* emo_reset */
- falcon_mac_poll, /* emo_poll */
- falcon_mac_up, /* emo_up */
- falcon_gmac_reconfigure, /* emo_reconfigure */
+static efx_mac_ops_t __efx_falcon_gmac_ops = {
+ falcon_gmac_reset, /* emo_reset */
+ falcon_mac_poll, /* emo_poll */
+ falcon_mac_up, /* emo_up */
+ falcon_gmac_reconfigure, /* emo_addr_set */
+ falcon_gmac_reconfigure, /* emo_reconfigure */
+ falconsiena_mac_multicast_list_set, /* emo_multicast_list_set */
+ NULL, /* emo_filter_set_default_rxq */
+ NULL, /* emo_filter_default_rxq_clear */
#if EFSYS_OPT_LOOPBACK
- falcon_mac_loopback_set, /* emo_loopback_set */
+ falcon_mac_loopback_set, /* emo_loopback_set */
#endif /* EFSYS_OPT_LOOPBACK */
#if EFSYS_OPT_MAC_STATS
- falcon_mac_stats_upload, /* emo_stats_upload */
- NULL, /* emo_stats_periodic */
- falcon_gmac_stats_update /* emo_stats_update */
+ falcon_mac_stats_upload, /* emo_stats_upload */
+ NULL, /* emo_stats_periodic */
+ falcon_gmac_stats_update /* emo_stats_update */
#endif /* EFSYS_OPT_MAC_STATS */
};
#endif /* EFSYS_OPT_MAC_FALCON_GMAC */
#if EFSYS_OPT_MAC_FALCON_XMAC
-static efx_mac_ops_t __cs __efx_falcon_xmac_ops = {
- falcon_xmac_reset, /* emo_reset */
- falcon_mac_poll, /* emo_poll */
- falcon_mac_up, /* emo_up */
- falcon_xmac_reconfigure, /* emo_reconfigure */
+static efx_mac_ops_t __efx_falcon_xmac_ops = {
+ falcon_xmac_reset, /* emo_reset */
+ falcon_mac_poll, /* emo_poll */
+ falcon_mac_up, /* emo_up */
+ falcon_xmac_reconfigure, /* emo_addr_set */
+ falcon_xmac_reconfigure, /* emo_reconfigure */
+ falconsiena_mac_multicast_list_set, /* emo_multicast_list_set */
+ NULL, /* emo_filter_set_default_rxq */
+ NULL, /* emo_filter_default_rxq_clear */
#if EFSYS_OPT_LOOPBACK
- falcon_mac_loopback_set, /* emo_loopback_set */
+ falcon_mac_loopback_set, /* emo_loopback_set */
#endif /* EFSYS_OPT_LOOPBACK */
#if EFSYS_OPT_MAC_STATS
- falcon_mac_stats_upload, /* emo_stats_upload */
- NULL, /* emo_stats_periodic */
- falcon_xmac_stats_update /* emo_stats_update */
+ falcon_mac_stats_upload, /* emo_stats_upload */
+ NULL, /* emo_stats_periodic */
+ falcon_xmac_stats_update /* emo_stats_update */
#endif /* EFSYS_OPT_MAC_STATS */
};
#endif /* EFSYS_OPT_MAC_FALCON_XMAC */
#if EFSYS_OPT_SIENA
-static efx_mac_ops_t __cs __efx_siena_mac_ops = {
- NULL, /* emo_reset */
- siena_mac_poll, /* emo_poll */
- siena_mac_up, /* emo_up */
- siena_mac_reconfigure, /* emo_reconfigure */
+static efx_mac_ops_t __efx_siena_mac_ops = {
+ NULL, /* emo_reset */
+ siena_mac_poll, /* emo_poll */
+ siena_mac_up, /* emo_up */
+ siena_mac_reconfigure, /* emo_addr_set */
+ siena_mac_reconfigure, /* emo_reconfigure */
+ falconsiena_mac_multicast_list_set, /* emo_multicast_list_set */
+ NULL, /* emo_filter_set_default_rxq */
+ NULL, /* emo_filter_default_rxq_clear */
#if EFSYS_OPT_LOOPBACK
- siena_mac_loopback_set, /* emo_loopback_set */
+ siena_mac_loopback_set, /* emo_loopback_set */
#endif /* EFSYS_OPT_LOOPBACK */
#if EFSYS_OPT_MAC_STATS
- siena_mac_stats_upload, /* emo_stats_upload */
- siena_mac_stats_periodic, /* emo_stats_periodic */
- siena_mac_stats_update /* emo_stats_update */
+ efx_mcdi_mac_stats_upload, /* emo_stats_upload */
+ efx_mcdi_mac_stats_periodic, /* emo_stats_periodic */
+ siena_mac_stats_update /* emo_stats_update */
#endif /* EFSYS_OPT_MAC_STATS */
};
#endif /* EFSYS_OPT_SIENA */
-static efx_mac_ops_t __cs * __cs __efx_mac_ops[] = {
+#if EFSYS_OPT_HUNTINGTON
+static efx_mac_ops_t __efx_hunt_mac_ops = {
+ NULL, /* emo_reset */
+ hunt_mac_poll, /* emo_poll */
+ hunt_mac_up, /* emo_up */
+ hunt_mac_addr_set, /* emo_addr_set */
+ hunt_mac_reconfigure, /* emo_reconfigure */
+ hunt_mac_multicast_list_set, /* emo_multicast_list_set */
+ hunt_mac_filter_default_rxq_set, /* emo_filter_default_rxq_set */
+ hunt_mac_filter_default_rxq_clear,
+ /* emo_filter_default_rxq_clear */
+#if EFSYS_OPT_LOOPBACK
+ hunt_mac_loopback_set, /* emo_loopback_set */
+#endif /* EFSYS_OPT_LOOPBACK */
+#if EFSYS_OPT_MAC_STATS
+ efx_mcdi_mac_stats_upload, /* emo_stats_upload */
+ efx_mcdi_mac_stats_periodic, /* emo_stats_periodic */
+ hunt_mac_stats_update /* emo_stats_update */
+#endif /* EFSYS_OPT_MAC_STATS */
+};
+#endif /* EFSYS_OPT_HUNTINGTON */
+
+static efx_mac_ops_t *__efx_mac_ops[] = {
+ /* [EFX_MAC_INVALID] */
NULL,
+ /* [EFX_MAC_FALCON_GMAC] */
#if EFSYS_OPT_MAC_FALCON_GMAC
&__efx_falcon_gmac_ops,
#else
NULL,
-#endif /* EFSYS_OPT_MAC_FALCON_GMAC */
+#endif
+ /* [EFX_MAC_FALCON_XMAC] */
#if EFSYS_OPT_MAC_FALCON_XMAC
&__efx_falcon_xmac_ops,
#else
NULL,
-#endif /* EFSYS_OPT_MAC_FALCON_XMAC */
+#endif
+ /* [EFX_MAC_SIENA] */
#if EFSYS_OPT_SIENA
&__efx_siena_mac_ops,
#else
NULL,
-#endif /* EFSYS_OPT_SIENA */
+#endif
+ /* [EFX_MAC_HUNTINGTON] */
+#if EFSYS_OPT_HUNTINGTON
+ &__efx_hunt_mac_ops,
+#else
+ NULL,
+#endif
};
__checkReturn int
@@ -167,7 +224,7 @@ efx_mac_addr_set(
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
- if (addr[0] & 0x01) {
+ if (EFX_MAC_ADDR_IS_MULTICAST(addr)) {
rc = EINVAL;
goto fail1;
}
@@ -180,7 +237,7 @@ efx_mac_addr_set(
EFX_MAC_ADDR_COPY(old_addr, epp->ep_mac_addr);
EFX_MAC_ADDR_COPY(epp->ep_mac_addr, addr);
- if ((rc = emop->emo_reconfigure(enp)) != 0)
+ if ((rc = emop->emo_addr_set(enp)) != 0)
goto fail3;
return (0);
@@ -201,22 +258,30 @@ fail1:
__checkReturn int
efx_mac_filter_set(
__in efx_nic_t *enp,
- __in boolean_t unicst,
+ __in boolean_t all_unicst,
+ __in boolean_t mulcst,
+ __in boolean_t all_mulcst,
__in boolean_t brdcst)
{
efx_port_t *epp = &(enp->en_port);
efx_mac_ops_t *emop = epp->ep_emop;
- boolean_t old_unicst;
+ boolean_t old_all_unicst;
+ boolean_t old_mulcst;
+ boolean_t old_all_mulcst;
boolean_t old_brdcst;
int rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
- old_unicst = unicst;
- old_brdcst = brdcst;
+ old_all_unicst = epp->ep_all_unicst;
+ old_mulcst = epp->ep_mulcst;
+ old_all_mulcst = epp->ep_all_mulcst;
+ old_brdcst = epp->ep_brdcst;
- epp->ep_unicst = unicst;
+ epp->ep_all_unicst = all_unicst;
+ epp->ep_mulcst = mulcst;
+ epp->ep_all_mulcst = all_mulcst;
epp->ep_brdcst = brdcst;
if ((rc = emop->emo_reconfigure(enp)) != 0)
@@ -227,7 +292,9 @@ efx_mac_filter_set(
fail1:
EFSYS_PROBE1(fail1, int, rc);
- epp->ep_unicst = old_unicst;
+ epp->ep_all_unicst = old_all_unicst;
+ epp->ep_mulcst = old_mulcst;
+ epp->ep_all_mulcst = old_all_mulcst;
epp->ep_brdcst = old_brdcst;
return (rc);
@@ -318,45 +385,45 @@ efx_mac_fcntl_set(
}
/*
- * Ignore a request to set flow control autonegotiation
+ * Ignore a request to set flow control auto-negotiation
* if the PHY doesn't support it.
*/
if (~epp->ep_phy_cap_mask & (1 << EFX_PHY_CAP_AN))
autoneg = B_FALSE;
old_fcntl = epp->ep_fcntl;
- old_autoneg = autoneg;
+ old_autoneg = epp->ep_fcntl_autoneg;
old_adv_cap = epp->ep_adv_cap_mask;
epp->ep_fcntl = fcntl;
epp->ep_fcntl_autoneg = autoneg;
/*
- * If the PHY supports autonegotiation, then encode the flow control
- * settings in the advertised capabilities, and restart AN. Otherwise,
- * just push the new settings directly to the MAC.
+ * Always encode the flow control settings in the advertised
+ * capabilities even if we are not trying to auto-negotiate
+ * them and reconfigure both the PHY and the MAC.
*/
- if (epp->ep_phy_cap_mask & (1 << EFX_PHY_CAP_AN)) {
- if (fcntl & EFX_FCNTL_RESPOND)
- epp->ep_adv_cap_mask |= (1 << EFX_PHY_CAP_PAUSE |
- 1 << EFX_PHY_CAP_ASYM);
- else
- epp->ep_adv_cap_mask &= ~(1 << EFX_PHY_CAP_PAUSE |
- 1 << EFX_PHY_CAP_ASYM);
+ if (fcntl & EFX_FCNTL_RESPOND)
+ epp->ep_adv_cap_mask |= (1 << EFX_PHY_CAP_PAUSE |
+ 1 << EFX_PHY_CAP_ASYM);
+ else
+ epp->ep_adv_cap_mask &= ~(1 << EFX_PHY_CAP_PAUSE |
+ 1 << EFX_PHY_CAP_ASYM);
- if (fcntl & EFX_FCNTL_GENERATE)
- epp->ep_adv_cap_mask ^= (1 << EFX_PHY_CAP_ASYM);
+ if (fcntl & EFX_FCNTL_GENERATE)
+ epp->ep_adv_cap_mask ^= (1 << EFX_PHY_CAP_ASYM);
- if ((rc = epop->epo_reconfigure(enp)) != 0)
- goto fail2;
+ if ((rc = epop->epo_reconfigure(enp)) != 0)
+ goto fail2;
- } else {
- if ((rc = emop->emo_reconfigure(enp)) != 0)
- goto fail2;
- }
+ if ((rc = emop->emo_reconfigure(enp)) != 0)
+ goto fail3;
return (0);
+fail3:
+ EFSYS_PROBE(fail3);
+
fail2:
EFSYS_PROBE(fail2);
@@ -377,29 +444,30 @@ efx_mac_fcntl_get(
__out unsigned int *fcntl_linkp)
{
efx_port_t *epp = &(enp->en_port);
- unsigned int wanted;
+ unsigned int wanted = 0;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
/*
- * If the PHY supports auto negotiation, then the requested flow
- * control settings are encoded in the advertised capabilities.
+ * Decode the requested flow control settings from the PHY
+ * advertised capabilities.
*/
- if (epp->ep_phy_cap_mask & (1 << EFX_PHY_CAP_AN)) {
- wanted = 0;
-
- if (epp->ep_adv_cap_mask & (1 << EFX_PHY_CAP_PAUSE))
- wanted = EFX_FCNTL_RESPOND | EFX_FCNTL_GENERATE;
- if (epp->ep_adv_cap_mask & (1 << EFX_PHY_CAP_ASYM))
- wanted ^= EFX_FCNTL_GENERATE;
- } else
- wanted = epp->ep_fcntl;
+ if (epp->ep_adv_cap_mask & (1 << EFX_PHY_CAP_PAUSE))
+ wanted = EFX_FCNTL_RESPOND | EFX_FCNTL_GENERATE;
+ if (epp->ep_adv_cap_mask & (1 << EFX_PHY_CAP_ASYM))
+ wanted ^= EFX_FCNTL_GENERATE;
*fcntl_linkp = epp->ep_fcntl;
*fcntl_wantedp = wanted;
}
+/*
+ * FIXME: efx_mac_hash_set() should be deleted once all its callers have been
+ * updated to use efx_mac_multicast_list_set().
+ * Then efx_port_t.ep_multicst_hash could be made Falcon/Siena specific as
+ * well.
+ */
__checkReturn int
efx_mac_hash_set(
__in efx_nic_t *enp,
@@ -443,12 +511,130 @@ fail1:
return (rc);
}
+ __checkReturn int
+efx_mac_multicast_list_set(
+ __in efx_nic_t *enp,
+ __in_ecount(6*count) uint8_t const *addrs,
+ __in int count)
+{
+ efx_port_t *epp = &(enp->en_port);
+ efx_mac_ops_t *emop = epp->ep_emop;
+ uint8_t *old_mulcst_addr_list = NULL;
+ uint32_t old_mulcst_addr_count;
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
+
+ if (count > EFX_MAC_MULTICAST_LIST_MAX) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ old_mulcst_addr_count = epp->ep_mulcst_addr_count;
+ if (old_mulcst_addr_count > 0) {
+ /* Allocate memory to store old list (instead of using stack) */
+ EFSYS_KMEM_ALLOC(enp->en_esip,
+ old_mulcst_addr_count * EFX_MAC_ADDR_LEN,
+ old_mulcst_addr_list);
+ if (old_mulcst_addr_list == NULL) {
+ rc = ENOMEM;
+ goto fail2;
+ }
+
+ /* Save the old list in case we need to rollback */
+ memcpy(old_mulcst_addr_list, epp->ep_mulcst_addr_list,
+ old_mulcst_addr_count * EFX_MAC_ADDR_LEN);
+ }
+
+ /* Store the new list */
+ memcpy(epp->ep_mulcst_addr_list, addrs,
+ count * EFX_MAC_ADDR_LEN);
+ epp->ep_mulcst_addr_count = count;
+
+ if ((rc = emop->emo_multicast_list_set(enp)) != 0)
+ goto fail3;
+
+ if (old_mulcst_addr_count > 0) {
+ EFSYS_KMEM_FREE(enp->en_esip,
+ old_mulcst_addr_count * EFX_MAC_ADDR_LEN,
+ old_mulcst_addr_list);
+ }
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+
+ /* Restore original list on failure */
+ epp->ep_mulcst_addr_count = old_mulcst_addr_count;
+ if (old_mulcst_addr_count > 0) {
+ memcpy(epp->ep_mulcst_addr_list, old_mulcst_addr_list,
+ old_mulcst_addr_count * EFX_MAC_ADDR_LEN);
+
+ EFSYS_KMEM_FREE(enp->en_esip,
+ old_mulcst_addr_count * EFX_MAC_ADDR_LEN,
+ old_mulcst_addr_list);
+ }
+
+fail2:
+ EFSYS_PROBE(fail2);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+
+}
+
+ __checkReturn int
+efx_mac_filter_default_rxq_set(
+ __in efx_nic_t *enp,
+ __in efx_rxq_t *erp,
+ __in boolean_t using_rss)
+{
+ efx_port_t *epp = &(enp->en_port);
+ efx_mac_ops_t *emop = epp->ep_emop;
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
+
+ if (emop->emo_filter_default_rxq_set != NULL) {
+ rc = emop->emo_filter_default_rxq_set(enp, erp, using_rss);
+ if (rc != 0)
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ void
+efx_mac_filter_default_rxq_clear(
+ __in efx_nic_t *enp)
+{
+ efx_port_t *epp = &(enp->en_port);
+ efx_mac_ops_t *emop = epp->ep_emop;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
+
+ if (emop->emo_filter_default_rxq_clear != NULL)
+ emop->emo_filter_default_rxq_clear(enp);
+}
+
+
#if EFSYS_OPT_MAC_STATS
#if EFSYS_OPT_NAMES
-/* START MKCONFIG GENERATED EfxMacStatNamesBlock adf707adba80813e */
-static const char __cs * __cs __efx_mac_stat_name[] = {
+/* START MKCONFIG GENERATED EfxMacStatNamesBlock 054d43a31d2d7a45 */
+static const char *__efx_mac_stat_name[] = {
"rx_octets",
"rx_pkts",
"rx_unicst_pkts",
@@ -500,10 +686,40 @@ static const char __cs * __cs __efx_mac_stat_name[] = {
"tx_late_col_pkts",
"tx_def_pkts",
"tx_ex_def_pkts",
+ "pm_trunc_bb_overflow",
+ "pm_discard_bb_overflow",
+ "pm_trunc_vfifo_full",
+ "pm_discard_vfifo_full",
+ "pm_trunc_qbb",
+ "pm_discard_qbb",
+ "pm_discard_mapping",
+ "rxdp_q_disabled_pkts",
+ "rxdp_di_dropped_pkts",
+ "rxdp_streaming_pkts",
+ "rxdp_hlb_fetch",
+ "rxdp_hlb_wait",
+ "vadapter_rx_unicast_packets",
+ "vadapter_rx_unicast_bytes",
+ "vadapter_rx_multicast_packets",
+ "vadapter_rx_multicast_bytes",
+ "vadapter_rx_broadcast_packets",
+ "vadapter_rx_broadcast_bytes",
+ "vadapter_rx_bad_packets",
+ "vadapter_rx_bad_bytes",
+ "vadapter_rx_overflow",
+ "vadapter_tx_unicast_packets",
+ "vadapter_tx_unicast_bytes",
+ "vadapter_tx_multicast_packets",
+ "vadapter_tx_multicast_bytes",
+ "vadapter_tx_broadcast_packets",
+ "vadapter_tx_broadcast_bytes",
+ "vadapter_tx_bad_packets",
+ "vadapter_tx_bad_bytes",
+ "vadapter_tx_overflow",
};
/* END MKCONFIG GENERATED EfxMacStatNamesBlock */
- __checkReturn const char __cs *
+ __checkReturn const char *
efx_mac_stat_name(
__in efx_nic_t *enp,
__in unsigned int id)
@@ -515,7 +731,7 @@ efx_mac_stat_name(
return (__efx_mac_stat_name[id]);
}
-#endif /* EFSYS_OPT_STAT_NAME */
+#endif /* EFSYS_OPT_NAMES */
__checkReturn int
efx_mac_stats_upload(
@@ -588,7 +804,7 @@ efx_mac_stats_update(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
__inout_ecount(EFX_MAC_NSTATS) efsys_stat_t *essp,
- __in uint32_t *generationp)
+ __out_opt uint32_t *generationp)
{
efx_port_t *epp = &(enp->en_port);
efx_mac_ops_t *emop = epp->ep_emop;
@@ -616,6 +832,13 @@ efx_mac_select(
efx_mac_ops_t *emop;
int rc = EINVAL;
+#if EFSYS_OPT_HUNTINGTON
+ if (enp->en_family == EFX_FAMILY_HUNTINGTON) {
+ type = EFX_MAC_HUNTINGTON;
+ goto chosen;
+ }
+#endif
+
#if EFSYS_OPT_SIENA
if (enp->en_family == EFX_FAMILY_SIENA) {
type = EFX_MAC_SIENA;
@@ -685,3 +908,71 @@ fail1:
return (rc);
}
+
+
+#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
+
+/* Compute the multicast hash as used on Falcon and Siena. */
+static void
+falconsiena_mac_multicast_hash_compute(
+ __in_ecount(6*count) uint8_t const *addrs,
+ __in int count,
+ __out efx_oword_t *hash_low,
+ __out efx_oword_t *hash_high)
+{
+ uint32_t crc, index;
+ int i;
+
+ EFSYS_ASSERT(hash_low != NULL);
+ EFSYS_ASSERT(hash_high != NULL);
+
+ EFX_ZERO_OWORD(*hash_low);
+ EFX_ZERO_OWORD(*hash_high);
+
+ for (i = 0; i < count; i++) {
+ /* Calculate hash bucket (IEEE 802.3 CRC32 of the MAC addr) */
+ crc = efx_crc32_calculate(0xffffffff, addrs, EFX_MAC_ADDR_LEN);
+ index = crc % EFX_MAC_HASH_BITS;
+ if (index < 128) {
+ EFX_SET_OWORD_BIT(*hash_low, index);
+ } else {
+ EFX_SET_OWORD_BIT(*hash_high, index - 128);
+ }
+
+ addrs += EFX_MAC_ADDR_LEN;
+ }
+}
+
+static __checkReturn int
+falconsiena_mac_multicast_list_set(
+ __in efx_nic_t *enp)
+{
+ efx_port_t *epp = &(enp->en_port);
+ efx_mac_ops_t *emop = epp->ep_emop;
+ efx_oword_t old_hash[2];
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
+
+ memcpy(old_hash, epp->ep_multicst_hash, sizeof (old_hash));
+
+ falconsiena_mac_multicast_hash_compute(epp->ep_mulcst_addr_list,
+ epp->ep_mulcst_addr_count,
+ &epp->ep_multicst_hash[0],
+ &epp->ep_multicst_hash[1]);
+
+ if ((rc = emop->emo_reconfigure(enp)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ memcpy(epp->ep_multicst_hash, old_hash, sizeof (old_hash));
+
+ return (rc);
+}
+
+#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */
diff --git a/sys/dev/sfxge/common/efx_mcdi.c b/sys/dev/sfxge/common/efx_mcdi.c
index f389d57..e1c4b45 100644
--- a/sys/dev/sfxge/common/efx_mcdi.c
+++ b/sys/dev/sfxge/common/efx_mcdi.c
@@ -1,26 +1,31 @@
/*-
- * Copyright 2008-2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2008-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -35,12 +40,144 @@ __FBSDID("$FreeBSD$");
#if EFSYS_OPT_MCDI
-/*
- * A reboot/assertion causes the MCDI status word to be set after the
- * command word is set or a REBOOT event is sent. If we notice a reboot
- * via these mechanisms then wait 10ms for the status word to be set.
- */
-#define MCDI_STATUS_SLEEP_US 10000
+
+#if EFSYS_OPT_SIENA
+
+static efx_mcdi_ops_t __efx_mcdi_siena_ops = {
+ siena_mcdi_init, /* emco_init */
+ siena_mcdi_request_copyin, /* emco_request_copyin */
+ siena_mcdi_request_poll, /* emco_request_poll */
+ siena_mcdi_request_copyout, /* emco_request_copyout */
+ siena_mcdi_poll_reboot, /* emco_poll_reboot */
+ siena_mcdi_fini, /* emco_fini */
+ siena_mcdi_fw_update_supported, /* emco_fw_update_supported */
+ siena_mcdi_macaddr_change_supported,
+ /* emco_macaddr_change_supported */
+};
+
+#endif /* EFSYS_OPT_SIENA */
+
+#if EFSYS_OPT_HUNTINGTON
+
+static efx_mcdi_ops_t __efx_mcdi_hunt_ops = {
+ hunt_mcdi_init, /* emco_init */
+ hunt_mcdi_request_copyin, /* emco_request_copyin */
+ hunt_mcdi_request_poll, /* emco_request_poll */
+ hunt_mcdi_request_copyout, /* emco_request_copyout */
+ hunt_mcdi_poll_reboot, /* emco_poll_reboot */
+ hunt_mcdi_fini, /* emco_fini */
+ hunt_mcdi_fw_update_supported, /* emco_fw_update_supported */
+ hunt_mcdi_macaddr_change_supported,
+ /* emco_macaddr_change_supported */
+};
+
+#endif /* EFSYS_OPT_HUNTINGTON */
+
+
+
+ __checkReturn int
+efx_mcdi_init(
+ __in efx_nic_t *enp,
+ __in const efx_mcdi_transport_t *emtp)
+{
+ efx_mcdi_ops_t *emcop;
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, ==, 0);
+
+ switch (enp->en_family) {
+#if EFSYS_OPT_FALCON
+ case EFX_FAMILY_FALCON:
+ emcop = NULL;
+ emtp = NULL;
+ break;
+#endif /* EFSYS_OPT_FALCON */
+
+#if EFSYS_OPT_SIENA
+ case EFX_FAMILY_SIENA:
+ emcop = (efx_mcdi_ops_t *)&__efx_mcdi_siena_ops;
+ break;
+#endif /* EFSYS_OPT_SIENA */
+
+#if EFSYS_OPT_HUNTINGTON
+ case EFX_FAMILY_HUNTINGTON:
+ emcop = (efx_mcdi_ops_t *)&__efx_mcdi_hunt_ops;
+ break;
+#endif /* EFSYS_OPT_HUNTINGTON */
+
+ default:
+ EFSYS_ASSERT(0);
+ rc = ENOTSUP;
+ goto fail1;
+ }
+
+ if (enp->en_features & EFX_FEATURE_MCDI_DMA) {
+ /* MCDI requires a DMA buffer in host memory */
+ if ((emtp == NULL) || (emtp->emt_dma_mem) == NULL) {
+ rc = EINVAL;
+ goto fail2;
+ }
+ }
+ enp->en_mcdi.em_emtp = emtp;
+
+ if (emcop != NULL && emcop->emco_init != NULL) {
+ if ((rc = emcop->emco_init(enp, emtp)) != 0)
+ goto fail3;
+ }
+
+ enp->en_mcdi.em_emcop = emcop;
+ enp->en_mod_flags |= EFX_MOD_MCDI;
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ enp->en_mcdi.em_emcop = NULL;
+ enp->en_mcdi.em_emtp = NULL;
+ enp->en_mod_flags &= ~EFX_MOD_MCDI;
+
+ return (rc);
+}
+
+ void
+efx_mcdi_fini(
+ __in efx_nic_t *enp)
+{
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+ efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, ==, EFX_MOD_MCDI);
+
+ if (emcop != NULL && emcop->emco_fini != NULL)
+ emcop->emco_fini(enp);
+
+ emip->emi_port = 0;
+ emip->emi_aborted = 0;
+
+ enp->en_mcdi.em_emcop = NULL;
+ enp->en_mod_flags &= ~EFX_MOD_MCDI;
+}
+
+ void
+efx_mcdi_new_epoch(
+ __in efx_nic_t *enp)
+{
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+ int state;
+
+ /* Start a new epoch (allow fresh MCDI requests to succeed) */
+ EFSYS_LOCK(enp->en_eslp, state);
+ emip->emi_new_epoch = B_TRUE;
+ EFSYS_UNLOCK(enp->en_eslp, state);
+}
+
void
efx_mcdi_request_start(
@@ -48,32 +185,18 @@ efx_mcdi_request_start(
__in efx_mcdi_req_t *emrp,
__in boolean_t ev_cpl)
{
- efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip);
- efx_dword_t dword;
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+ efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
unsigned int seq;
- unsigned int xflags;
- unsigned int pdur;
- unsigned int dbr;
- unsigned int pos;
+ boolean_t new_epoch;
int state;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MCDI);
EFSYS_ASSERT3U(enp->en_features, &, EFX_FEATURE_MCDI);
- switch (emip->emi_port) {
- case 1:
- pdur = MC_SMEM_P0_PDU_OFST >> 2;
- dbr = MC_SMEM_P0_DOORBELL_OFST >> 2;
- break;
- case 2:
- pdur = MC_SMEM_P1_PDU_OFST >> 2;
- dbr = MC_SMEM_P1_DOORBELL_OFST >> 2;
- break;
- default:
- EFSYS_ASSERT(0);
- pdur = dbr = 0;
- };
+ if (emcop == NULL || emcop->emco_request_copyin == NULL)
+ return;
/*
* efx_mcdi_request_start() is naturally serialised against both
@@ -92,68 +215,85 @@ efx_mcdi_request_start(
emip->emi_pending_req = emrp;
emip->emi_ev_cpl = ev_cpl;
emip->emi_poll_cnt = 0;
- seq = emip->emi_seq++ & 0xf;
+ seq = emip->emi_seq++ & EFX_MASK32(MCDI_HEADER_SEQ);
+ new_epoch = emip->emi_new_epoch;
EFSYS_UNLOCK(enp->en_eslp, state);
- xflags = 0;
- if (ev_cpl)
- xflags |= MCDI_HEADER_XFLAGS_EVREQ;
+ emcop->emco_request_copyin(enp, emrp, seq, ev_cpl, new_epoch);
+}
+
+ __checkReturn boolean_t
+efx_mcdi_request_poll(
+ __in efx_nic_t *enp)
+{
+ efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
+ boolean_t completed;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MCDI);
+ EFSYS_ASSERT3U(enp->en_features, &, EFX_FEATURE_MCDI);
- /* Construct the header in shared memory */
- EFX_POPULATE_DWORD_6(dword,
- MCDI_HEADER_CODE, emrp->emr_cmd,
- MCDI_HEADER_RESYNC, 1,
- MCDI_HEADER_DATALEN, emrp->emr_in_length,
- MCDI_HEADER_SEQ, seq,
- MCDI_HEADER_RESPONSE, 0,
- MCDI_HEADER_XFLAGS, xflags);
- EFX_BAR_TBL_WRITED(enp, FR_CZ_MC_TREG_SMEM, pdur, &dword, B_TRUE);
+ completed = B_FALSE;
- for (pos = 0; pos < emrp->emr_in_length; pos += sizeof (efx_dword_t)) {
- memcpy(&dword, MCDI_IN(*emrp, efx_dword_t, pos),
- MIN(sizeof (dword), emrp->emr_in_length - pos));
- EFX_BAR_TBL_WRITED(enp, FR_CZ_MC_TREG_SMEM,
- pdur + 1 + (pos >> 2), &dword, B_FALSE);
- }
+ if (emcop != NULL && emcop->emco_request_poll != NULL)
+ completed = emcop->emco_request_poll(enp);
- /* Ring the doorbell */
- EFX_POPULATE_DWORD_1(dword, EFX_DWORD_0, 0xd004be11);
- EFX_BAR_TBL_WRITED(enp, FR_CZ_MC_TREG_SMEM, dbr, &dword, B_FALSE);
+ return (completed);
}
-static void
-efx_mcdi_request_copyout(
- __in efx_nic_t *enp,
- __in efx_mcdi_req_t *emrp)
-{
- efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip);
- unsigned int pos;
- unsigned int pdur;
- efx_dword_t data;
-
- pdur = (emip->emi_port == 1)
- ? MC_SMEM_P0_PDU_OFST >> 2
- : MC_SMEM_P1_PDU_OFST >> 2;
-
- /* Copy payload out if caller supplied buffer */
- if (emrp->emr_out_buf != NULL) {
- size_t bytes = MIN(emrp->emr_out_length_used,
- emrp->emr_out_length);
- for (pos = 0; pos < bytes; pos += sizeof (efx_dword_t)) {
- EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM,
- pdur + 1 + (pos >> 2), &data, B_FALSE);
- memcpy(MCDI_OUT(*emrp, efx_dword_t, pos), &data,
- MIN(sizeof (data), bytes - pos));
- }
+ __checkReturn boolean_t
+efx_mcdi_request_abort(
+ __in efx_nic_t *enp)
+{
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+ efx_mcdi_req_t *emrp;
+ boolean_t aborted;
+ int state;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MCDI);
+ EFSYS_ASSERT3U(enp->en_features, &, EFX_FEATURE_MCDI);
+
+ /*
+ * efx_mcdi_ev_* may have already completed this event, and be
+ * spinning/blocked on the upper layer lock. So it *is* legitimate
+ * to for emi_pending_req to be NULL. If there is a pending event
+ * completed request, then provide a "credit" to allow
+ * efx_mcdi_ev_cpl() to accept a single spurious completion.
+ */
+ EFSYS_LOCK(enp->en_eslp, state);
+ emrp = emip->emi_pending_req;
+ aborted = (emrp != NULL);
+ if (aborted) {
+ emip->emi_pending_req = NULL;
+
+ /* Error the request */
+ emrp->emr_out_length_used = 0;
+ emrp->emr_rc = ETIMEDOUT;
+
+ /* Provide a credit for seqno/emr_pending_req mismatches */
+ if (emip->emi_ev_cpl)
+ ++emip->emi_aborted;
+
+ /*
+ * The upper layer has called us, so we don't
+ * need to complete the request.
+ */
}
+ EFSYS_UNLOCK(enp->en_eslp, state);
+
+ return (aborted);
}
-static int
+ __checkReturn int
efx_mcdi_request_errcode(
__in unsigned int err)
{
switch (err) {
+ /* MCDI v1 */
+ case MC_CMD_ERR_EPERM:
+ return (EACCES);
case MC_CMD_ERR_ENOENT:
return (ENOENT);
case MC_CMD_ERR_EINTR:
@@ -170,26 +310,55 @@ efx_mcdi_request_errcode(
return (ENOTSUP);
case MC_CMD_ERR_ETIME:
return (ETIMEDOUT);
-#ifdef WITH_MCDI_V2
+ case MC_CMD_ERR_ENOTSUP:
+ return (ENOTSUP);
+ case MC_CMD_ERR_EALREADY:
+ return (EALREADY);
+
+ /* MCDI v2 */
+#ifdef MC_CMD_ERR_EAGAIN
case MC_CMD_ERR_EAGAIN:
return (EAGAIN);
+#endif
+#ifdef MC_CMD_ERR_ENOSPC
case MC_CMD_ERR_ENOSPC:
return (ENOSPC);
#endif
+
+ case MC_CMD_ERR_ALLOC_FAIL:
+ return (ENOMEM);
+ case MC_CMD_ERR_NO_VADAPTOR:
+ return (ENOENT);
+ case MC_CMD_ERR_NO_EVB_PORT:
+ return (ENOENT);
+ case MC_CMD_ERR_NO_VSWITCH:
+ return (ENODEV);
+ case MC_CMD_ERR_VLAN_LIMIT:
+ return (EINVAL);
+ case MC_CMD_ERR_BAD_PCI_FUNC:
+ return (ENODEV);
+ case MC_CMD_ERR_BAD_VLAN_MODE:
+ return (EINVAL);
+ case MC_CMD_ERR_BAD_VSWITCH_TYPE:
+ return (EINVAL);
+ case MC_CMD_ERR_BAD_VPORT_TYPE:
+ return (EINVAL);
+ case MC_CMD_ERR_MAC_EXIST:
+ return (EEXIST);
+
default:
EFSYS_PROBE1(mc_pcol_error, int, err);
return (EIO);
}
}
-static void
+ void
efx_mcdi_raise_exception(
__in efx_nic_t *enp,
__in_opt efx_mcdi_req_t *emrp,
__in int rc)
{
- efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip);
- const efx_mcdi_transport_t *emtp = emip->emi_mtp;
+ const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp;
efx_mcdi_exception_t exception;
/* Reboot or Assertion failure only */
@@ -213,167 +382,37 @@ static int
efx_mcdi_poll_reboot(
__in efx_nic_t *enp)
{
-#ifndef EFX_GRACEFUL_MC_REBOOT
- /*
- * This function is not being used properly.
- * Until its callers are fixed, it should always return 0.
- */
- _NOTE(ARGUNUSED(enp))
- return (0);
-#else
- efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip);
- unsigned int rebootr;
- efx_dword_t dword;
- uint32_t value;
-
- EFSYS_ASSERT(emip->emi_port == 1 || emip->emi_port == 2);
- rebootr = ((emip->emi_port == 1)
- ? MC_SMEM_P0_STATUS_OFST >> 2
- : MC_SMEM_P1_STATUS_OFST >> 2);
-
- EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, rebootr, &dword, B_FALSE);
- value = EFX_DWORD_FIELD(dword, EFX_DWORD_0);
-
- if (value == 0)
- return (0);
+ efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
- EFX_ZERO_DWORD(dword);
- EFX_BAR_TBL_WRITED(enp, FR_CZ_MC_TREG_SMEM, rebootr, &dword, B_FALSE);
-
- if (value == MC_STATUS_DWORD_ASSERT)
- return (EINTR);
- else
- return (EIO);
-#endif
+ return (emcop->emco_poll_reboot(enp));
}
- __checkReturn boolean_t
-efx_mcdi_request_poll(
- __in efx_nic_t *enp)
+
+ void
+efx_mcdi_execute(
+ __in efx_nic_t *enp,
+ __inout efx_mcdi_req_t *emrp)
{
- efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip);
- efx_mcdi_req_t *emrp;
- efx_dword_t dword;
- unsigned int pdur;
- unsigned int seq;
- unsigned int length;
- int state;
- int rc;
+ const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp;
- EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MCDI);
- EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA);
EFSYS_ASSERT3U(enp->en_features, &, EFX_FEATURE_MCDI);
- /* Serialise against post-watchdog efx_mcdi_ev* */
- EFSYS_LOCK(enp->en_eslp, state);
-
- EFSYS_ASSERT(emip->emi_pending_req != NULL);
- EFSYS_ASSERT(!emip->emi_ev_cpl);
- emrp = emip->emi_pending_req;
-
- /* Check for reboot atomically w.r.t efx_mcdi_request_start */
- if (emip->emi_poll_cnt++ == 0) {
- if ((rc = efx_mcdi_poll_reboot(enp)) != 0) {
- emip->emi_pending_req = NULL;
- EFSYS_UNLOCK(enp->en_eslp, state);
-
- goto fail1;
- }
- }
-
- EFSYS_ASSERT(emip->emi_port == 1 || emip->emi_port == 2);
- pdur = (emip->emi_port == 1)
- ? MC_SMEM_P0_PDU_OFST >> 2
- : MC_SMEM_P1_PDU_OFST >> 2;
-
- /* Read the command header */
- EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, pdur, &dword, B_FALSE);
- if (EFX_DWORD_FIELD(dword, MCDI_HEADER_RESPONSE) == 0) {
- EFSYS_UNLOCK(enp->en_eslp, state);
- return (B_FALSE);
- }
-
- /* Request complete */
- emip->emi_pending_req = NULL;
- seq = (emip->emi_seq - 1) & 0xf;
-
- /* Check for synchronous reboot */
- if (EFX_DWORD_FIELD(dword, MCDI_HEADER_ERROR) != 0 &&
- EFX_DWORD_FIELD(dword, MCDI_HEADER_DATALEN) == 0) {
- /* Consume status word */
- EFSYS_SPIN(MCDI_STATUS_SLEEP_US);
- efx_mcdi_poll_reboot(enp);
- EFSYS_UNLOCK(enp->en_eslp, state);
- rc = EIO;
- goto fail2;
- }
-
- EFSYS_UNLOCK(enp->en_eslp, state);
-
- /* Check that the returned data is consistent */
- if (EFX_DWORD_FIELD(dword, MCDI_HEADER_CODE) != emrp->emr_cmd ||
- EFX_DWORD_FIELD(dword, MCDI_HEADER_SEQ) != seq) {
- /* Response is for a different request */
- rc = EIO;
- goto fail3;
- }
-
- length = EFX_DWORD_FIELD(dword, MCDI_HEADER_DATALEN);
- if (EFX_DWORD_FIELD(dword, MCDI_HEADER_ERROR)) {
- efx_dword_t errdword;
- int errcode;
-
- EFSYS_ASSERT3U(length, ==, 4);
- EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM,
- pdur + 1 + (MC_CMD_ERR_CODE_OFST >> 2),
- &errdword, B_FALSE);
- errcode = EFX_DWORD_FIELD(errdword, EFX_DWORD_0);
- rc = efx_mcdi_request_errcode(errcode);
- EFSYS_PROBE2(mcdi_err, int, emrp->emr_cmd, int, errcode);
- goto fail4;
-
- } else {
- emrp->emr_out_length_used = length;
- emrp->emr_rc = 0;
- efx_mcdi_request_copyout(enp, emrp);
- }
-
- goto out;
-
-fail4:
- EFSYS_PROBE(fail4);
-fail3:
- EFSYS_PROBE(fail3);
-fail2:
- EFSYS_PROBE(fail2);
-fail1:
- EFSYS_PROBE1(fail1, int, rc);
-
- /* Fill out error state */
- emrp->emr_rc = rc;
- emrp->emr_out_length_used = 0;
-
- /* Reboot/Assertion */
- if (rc == EIO || rc == EINTR)
- efx_mcdi_raise_exception(enp, emrp, rc);
-
-out:
- return (B_TRUE);
+ emrp->emr_quiet = B_FALSE;
+ emtp->emt_execute(emtp->emt_context, emrp);
}
void
-efx_mcdi_execute(
+efx_mcdi_execute_quiet(
__in efx_nic_t *enp,
- __in efx_mcdi_req_t *emrp)
+ __inout efx_mcdi_req_t *emrp)
{
- efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip);
- const efx_mcdi_transport_t *emtp = emip->emi_mtp;
+ const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp;
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MCDI);
- EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA);
EFSYS_ASSERT3U(enp->en_features, &, EFX_FEATURE_MCDI);
+ emrp->emr_quiet = B_TRUE;
emtp->emt_execute(emtp->emt_context, emrp);
}
@@ -384,13 +423,13 @@ efx_mcdi_ev_cpl(
__in unsigned int outlen,
__in int errcode)
{
- efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip);
- const efx_mcdi_transport_t *emtp = emip->emi_mtp;
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+ const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp;
+ efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
efx_mcdi_req_t *emrp;
int state;
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MCDI);
- EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA);
EFSYS_ASSERT3U(enp->en_features, &, EFX_FEATURE_MCDI);
/*
@@ -399,7 +438,7 @@ efx_mcdi_ev_cpl(
*/
EFSYS_LOCK(enp->en_eslp, state);
if (emip->emi_pending_req == NULL || !emip->emi_ev_cpl ||
- (seq != ((emip->emi_seq - 1) & 0xf))) {
+ (seq != ((emip->emi_seq - 1) & EFX_MASK32(MCDI_HEADER_SEQ)))) {
EFSYS_ASSERT(emip->emi_aborted > 0);
if (emip->emi_aborted > 0)
--emip->emi_aborted;
@@ -416,14 +455,17 @@ efx_mcdi_ev_cpl(
* if the user supplied an output buffer.
*/
if (errcode != 0) {
- EFSYS_PROBE2(mcdi_err, int, emrp->emr_cmd,
- int, errcode);
+ if (!emrp->emr_quiet) {
+ EFSYS_PROBE2(mcdi_err, int, emrp->emr_cmd,
+ int, errcode);
+ }
emrp->emr_out_length_used = 0;
emrp->emr_rc = efx_mcdi_request_errcode(errcode);
} else {
emrp->emr_out_length_used = outlen;
emrp->emr_rc = 0;
- efx_mcdi_request_copyout(enp, emrp);
+
+ emcop->emco_request_copyout(enp, emrp);
}
emtp->emt_ev_cpl(emtp->emt_context);
@@ -434,8 +476,8 @@ efx_mcdi_ev_death(
__in efx_nic_t *enp,
__in int rc)
{
- efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip);
- const efx_mcdi_transport_t *emtp = emip->emi_mtp;
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+ const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp;
efx_mcdi_req_t *emrp = NULL;
boolean_t ev_cpl;
int state;
@@ -469,8 +511,9 @@ efx_mcdi_ev_death(
* status word before dropping the lock.
*/
if (rc == EIO || rc == EINTR) {
- EFSYS_SPIN(MCDI_STATUS_SLEEP_US);
+ EFSYS_SPIN(EFX_MCDI_STATUS_SLEEP_US);
(void) efx_mcdi_poll_reboot(enp);
+ emip->emi_new_epoch = B_TRUE;
}
EFSYS_UNLOCK(enp->en_eslp, state);
@@ -488,23 +531,24 @@ efx_mcdi_version(
__out_opt uint32_t *buildp,
__out_opt efx_mcdi_boot_t *statusp)
{
- uint8_t outbuf[MAX(MC_CMD_GET_VERSION_OUT_LEN,
- MC_CMD_GET_BOOT_STATUS_OUT_LEN)];
efx_mcdi_req_t req;
+ uint8_t payload[MAX(MAX(MC_CMD_GET_VERSION_IN_LEN,
+ MC_CMD_GET_VERSION_OUT_LEN),
+ MAX(MC_CMD_GET_BOOT_STATUS_IN_LEN,
+ MC_CMD_GET_BOOT_STATUS_OUT_LEN))];
efx_word_t *ver_words;
uint16_t version[4];
uint32_t build;
efx_mcdi_boot_t status;
int rc;
- EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA);
EFSYS_ASSERT3U(enp->en_features, &, EFX_FEATURE_MCDI);
- EFX_STATIC_ASSERT(MC_CMD_GET_VERSION_IN_LEN == 0);
+ (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_GET_VERSION;
- req.emr_in_buf = NULL;
- req.emr_in_length = 0;
- req.emr_out_buf = outbuf;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_GET_VERSION_IN_LEN;
+ req.emr_out_buf = payload;
req.emr_out_length = MC_CMD_GET_VERSION_OUT_LEN;
efx_mcdi_execute(enp, &req);
@@ -536,19 +580,27 @@ efx_mcdi_version(
version:
/* The bootrom doesn't understand BOOT_STATUS */
- if (build == MC_CMD_GET_VERSION_OUT_FIRMWARE_SIENA_BOOTROM) {
+ if (MC_FW_VERSION_IS_BOOTLOADER(build)) {
status = EFX_MCDI_BOOT_ROM;
goto out;
}
+ (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_GET_BOOT_STATUS;
- EFX_STATIC_ASSERT(MC_CMD_GET_BOOT_STATUS_IN_LEN == 0);
- req.emr_in_buf = NULL;
- req.emr_in_length = 0;
- req.emr_out_buf = outbuf;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_GET_BOOT_STATUS_IN_LEN;
+ req.emr_out_buf = payload;
req.emr_out_length = MC_CMD_GET_BOOT_STATUS_OUT_LEN;
- efx_mcdi_execute(enp, &req);
+ efx_mcdi_execute_quiet(enp, &req);
+
+ if (req.emr_rc == EACCES) {
+ /* Unprivileged functions cannot access BOOT_STATUS */
+ status = EFX_MCDI_BOOT_PRIMARY;
+ version[0] = version[1] = version[2] = version[3] = 0;
+ build = 0;
+ goto out;
+ }
if (req.emr_rc != 0) {
rc = req.emr_rc;
@@ -588,86 +640,624 @@ fail1:
return (rc);
}
- __checkReturn int
-efx_mcdi_init(
+static __checkReturn int
+efx_mcdi_do_reboot(
__in efx_nic_t *enp,
- __in const efx_mcdi_transport_t *mtp)
+ __in boolean_t after_assertion)
{
- efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip);
- efx_oword_t oword;
- unsigned int portnum;
+ uint8_t payload[MAX(MC_CMD_REBOOT_IN_LEN, MC_CMD_REBOOT_OUT_LEN)];
+ efx_mcdi_req_t req;
int rc;
- EFSYS_ASSERT3U(enp->en_mod_flags, ==, 0);
- enp->en_mod_flags |= EFX_MOD_MCDI;
+ /*
+ * We could require the caller to have caused en_mod_flags=0 to
+ * call this function. This doesn't help the other port though,
+ * who's about to get the MC ripped out from underneath them.
+ * Since they have to cope with the subsequent fallout of MCDI
+ * failures, we should as well.
+ */
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- if (enp->en_family == EFX_FAMILY_FALCON)
- return (0);
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_REBOOT;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_REBOOT_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_REBOOT_OUT_LEN;
- emip->emi_mtp = mtp;
+ MCDI_IN_SET_DWORD(req, REBOOT_IN_FLAGS,
+ (after_assertion ? MC_CMD_REBOOT_FLAGS_AFTER_ASSERTION : 0));
- /* Determine the port number to use for MCDI */
- EFX_BAR_READO(enp, FR_AZ_CS_DEBUG_REG, &oword);
- portnum = EFX_OWORD_FIELD(oword, FRF_CZ_CS_PORT_NUM);
+ efx_mcdi_execute_quiet(enp, &req);
- if (portnum == 0) {
- /* Presumably booted from ROM; only MCDI port 1 will work */
- emip->emi_port = 1;
- } else if (portnum <= 2) {
- emip->emi_port = portnum;
- } else {
- rc = EINVAL;
+ if (req.emr_rc == EACCES) {
+ /* Unprivileged functions cannot reboot the MC. */
+ goto out;
+ }
+
+ /* A successful reboot request returns EIO. */
+ if (req.emr_rc != 0 && req.emr_rc != EIO) {
+ rc = req.emr_rc;
goto fail1;
}
+out:
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+efx_mcdi_reboot(
+ __in efx_nic_t *enp)
+{
+ return (efx_mcdi_do_reboot(enp, B_FALSE));
+}
+
+ __checkReturn int
+efx_mcdi_exit_assertion_handler(
+ __in efx_nic_t *enp)
+{
+ return (efx_mcdi_do_reboot(enp, B_TRUE));
+}
+
+ __checkReturn int
+efx_mcdi_read_assertion(
+ __in efx_nic_t *enp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_GET_ASSERTS_IN_LEN,
+ MC_CMD_GET_ASSERTS_OUT_LEN)];
+ const char *reason;
+ unsigned int flags;
+ unsigned int index;
+ unsigned int ofst;
+ int retry;
+ int rc;
+
/*
- * Wipe the atomic reboot status so subsequent MCDI requests succeed.
- * BOOT_STATUS is preserved so eno_nic_probe() can boot out of the
- * assertion handler.
+ * Before we attempt to chat to the MC, we should verify that the MC
+ * isn't in it's assertion handler, either due to a previous reboot,
+ * or because we're reinitializing due to an eec_exception().
+ *
+ * Use GET_ASSERTS to read any assertion state that may be present.
+ * Retry this command twice. Once because a boot-time assertion failure
+ * might cause the 1st MCDI request to fail. And once again because
+ * we might race with efx_mcdi_exit_assertion_handler() running on
+ * partner port(s) on the same NIC.
*/
- (void) efx_mcdi_poll_reboot(enp);
+ retry = 2;
+ do {
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_GET_ASSERTS;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_GET_ASSERTS_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_GET_ASSERTS_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, GET_ASSERTS_IN_CLEAR, 1);
+ efx_mcdi_execute_quiet(enp, &req);
+
+ } while ((req.emr_rc == EINTR || req.emr_rc == EIO) && retry-- > 0);
+
+ if (req.emr_rc != 0) {
+ if (req.emr_rc == EACCES) {
+ /* Unprivileged functions cannot clear assertions. */
+ goto out;
+ }
+ rc = req.emr_rc;
+ goto fail1;
+ }
+ if (req.emr_out_length_used < MC_CMD_GET_ASSERTS_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ /* Print out any assertion state recorded */
+ flags = MCDI_OUT_DWORD(req, GET_ASSERTS_OUT_GLOBAL_FLAGS);
+ if (flags == MC_CMD_GET_ASSERTS_FLAGS_NO_FAILS)
+ return (0);
+
+ reason = (flags == MC_CMD_GET_ASSERTS_FLAGS_SYS_FAIL)
+ ? "system-level assertion"
+ : (flags == MC_CMD_GET_ASSERTS_FLAGS_THR_FAIL)
+ ? "thread-level assertion"
+ : (flags == MC_CMD_GET_ASSERTS_FLAGS_WDOG_FIRED)
+ ? "watchdog reset"
+ : (flags == MC_CMD_GET_ASSERTS_FLAGS_ADDR_TRAP)
+ ? "illegal address trap"
+ : "unknown assertion";
+ EFSYS_PROBE3(mcpu_assertion,
+ const char *, reason, unsigned int,
+ MCDI_OUT_DWORD(req, GET_ASSERTS_OUT_SAVED_PC_OFFS),
+ unsigned int,
+ MCDI_OUT_DWORD(req, GET_ASSERTS_OUT_THREAD_OFFS));
+
+ /* Print out the registers (r1 ... r31) */
+ ofst = MC_CMD_GET_ASSERTS_OUT_GP_REGS_OFFS_OFST;
+ for (index = 1;
+ index < 1 + MC_CMD_GET_ASSERTS_OUT_GP_REGS_OFFS_NUM;
+ index++) {
+ EFSYS_PROBE2(mcpu_register, unsigned int, index, unsigned int,
+ EFX_DWORD_FIELD(*MCDI_OUT(req, efx_dword_t, ofst),
+ EFX_DWORD_0));
+ ofst += sizeof (efx_dword_t);
+ }
+ EFSYS_ASSERT(ofst <= MC_CMD_GET_ASSERTS_OUT_LEN);
+
+out:
return (0);
+fail2:
+ EFSYS_PROBE(fail2);
fail1:
EFSYS_PROBE1(fail1, int, rc);
- enp->en_mod_flags &= ~EFX_MOD_MCDI;
-
return (rc);
}
+/*
+ * Internal routines for for specific MCDI requests.
+ */
+
__checkReturn int
-efx_mcdi_reboot(
- __in efx_nic_t *enp)
+efx_mcdi_drv_attach(
+ __in efx_nic_t *enp,
+ __in boolean_t attach)
{
- uint8_t payload[MC_CMD_REBOOT_IN_LEN];
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_DRV_ATTACH_IN_LEN,
+ MC_CMD_DRV_ATTACH_EXT_OUT_LEN)];
+ uint32_t flags;
int rc;
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_DRV_ATTACH;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_DRV_ATTACH_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_DRV_ATTACH_EXT_OUT_LEN;
+
/*
- * We could require the caller to have caused en_mod_flags=0 to
- * call this function. This doesn't help the other port though,
- * who's about to get the MC ripped out from underneath them.
- * Since they have to cope with the subsequent fallout of MCDI
- * failures, we should as well.
+ * Use DONT_CARE for the datapath firmware type to ensure that the
+ * driver can attach to an unprivileged function. The datapath firmware
+ * type to use is controlled by the 'sfboot' utility.
*/
- EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ MCDI_IN_SET_DWORD(req, DRV_ATTACH_IN_NEW_STATE, attach ? 1 : 0);
+ MCDI_IN_SET_DWORD(req, DRV_ATTACH_IN_UPDATE, 1);
+ MCDI_IN_SET_DWORD(req, DRV_ATTACH_IN_FIRMWARE_ID, MC_CMD_FW_DONT_CARE);
- req.emr_cmd = MC_CMD_REBOOT;
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_DRV_ATTACH_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ if (attach == B_FALSE) {
+ flags = 0;
+ } else if (enp->en_family == EFX_FAMILY_SIENA) {
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+
+ /* Create synthetic privileges for Siena functions */
+ flags = EFX_NIC_FUNC_LINKCTRL | EFX_NIC_FUNC_TRUSTED;
+ if (emip->emi_port == 1)
+ flags |= EFX_NIC_FUNC_PRIMARY;
+ } else {
+ EFX_STATIC_ASSERT(EFX_NIC_FUNC_PRIMARY ==
+ (1u << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_PRIMARY));
+ EFX_STATIC_ASSERT(EFX_NIC_FUNC_LINKCTRL ==
+ (1u << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_LINKCTRL));
+ EFX_STATIC_ASSERT(EFX_NIC_FUNC_TRUSTED ==
+ (1u << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_TRUSTED));
+
+ /* Save function privilege flags (EF10 and later) */
+ if (req.emr_out_length_used < MC_CMD_DRV_ATTACH_EXT_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail3;
+ }
+ flags = MCDI_OUT_DWORD(req, DRV_ATTACH_EXT_OUT_FUNC_FLAGS);
+ }
+ encp->enc_func_flags = flags;
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+efx_mcdi_get_board_cfg(
+ __in efx_nic_t *enp,
+ __out_opt uint32_t *board_typep,
+ __out_opt efx_dword_t *capabilitiesp,
+ __out_ecount_opt(6) uint8_t mac_addrp[6])
+{
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_GET_BOARD_CFG_IN_LEN,
+ MC_CMD_GET_BOARD_CFG_OUT_LENMIN)];
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_GET_BOARD_CFG;
req.emr_in_buf = payload;
- req.emr_in_length = MC_CMD_REBOOT_IN_LEN;
+ req.emr_in_length = MC_CMD_GET_BOARD_CFG_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_GET_BOARD_CFG_OUT_LENMIN;
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_GET_BOARD_CFG_OUT_LENMIN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ if (mac_addrp != NULL) {
+ uint8_t *addrp;
+
+ if (emip->emi_port == 1) {
+ addrp = MCDI_OUT2(req, uint8_t,
+ GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT0);
+ } else if (emip->emi_port == 2) {
+ addrp = MCDI_OUT2(req, uint8_t,
+ GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT1);
+ } else {
+ rc = EINVAL;
+ goto fail3;
+ }
+
+ EFX_MAC_ADDR_COPY(mac_addrp, addrp);
+ }
+
+ if (capabilitiesp != NULL) {
+ if (emip->emi_port == 1) {
+ *capabilitiesp = *MCDI_OUT2(req, efx_dword_t,
+ GET_BOARD_CFG_OUT_CAPABILITIES_PORT0);
+ } else if (emip->emi_port == 2) {
+ *capabilitiesp = *MCDI_OUT2(req, efx_dword_t,
+ GET_BOARD_CFG_OUT_CAPABILITIES_PORT1);
+ } else {
+ rc = EINVAL;
+ goto fail4;
+ }
+ }
+
+ if (board_typep != NULL) {
+ *board_typep = MCDI_OUT_DWORD(req,
+ GET_BOARD_CFG_OUT_BOARD_TYPE);
+ }
+
+ return (0);
+
+fail4:
+ EFSYS_PROBE(fail4);
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+efx_mcdi_get_resource_limits(
+ __in efx_nic_t *enp,
+ __out_opt uint32_t *nevqp,
+ __out_opt uint32_t *nrxqp,
+ __out_opt uint32_t *ntxqp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_GET_RESOURCE_LIMITS_IN_LEN,
+ MC_CMD_GET_RESOURCE_LIMITS_OUT_LEN)];
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_GET_RESOURCE_LIMITS;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_GET_RESOURCE_LIMITS_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_GET_RESOURCE_LIMITS_OUT_LEN;
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_GET_RESOURCE_LIMITS_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ if (nevqp != NULL)
+ *nevqp = MCDI_OUT_DWORD(req, GET_RESOURCE_LIMITS_OUT_EVQ);
+ if (nrxqp != NULL)
+ *nrxqp = MCDI_OUT_DWORD(req, GET_RESOURCE_LIMITS_OUT_RXQ);
+ if (ntxqp != NULL)
+ *ntxqp = MCDI_OUT_DWORD(req, GET_RESOURCE_LIMITS_OUT_TXQ);
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+efx_mcdi_get_phy_cfg(
+ __in efx_nic_t *enp)
+{
+ efx_port_t *epp = &(enp->en_port);
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_GET_PHY_CFG_IN_LEN,
+ MC_CMD_GET_PHY_CFG_OUT_LEN)];
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_GET_PHY_CFG;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_GET_PHY_CFG_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_GET_PHY_CFG_OUT_LEN;
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_GET_PHY_CFG_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ encp->enc_phy_type = MCDI_OUT_DWORD(req, GET_PHY_CFG_OUT_TYPE);
+#if EFSYS_OPT_NAMES
+ (void) strncpy(encp->enc_phy_name,
+ MCDI_OUT2(req, char, GET_PHY_CFG_OUT_NAME),
+ MIN(sizeof (encp->enc_phy_name) - 1,
+ MC_CMD_GET_PHY_CFG_OUT_NAME_LEN));
+#endif /* EFSYS_OPT_NAMES */
+ (void) memset(encp->enc_phy_revision, 0,
+ sizeof (encp->enc_phy_revision));
+ memcpy(encp->enc_phy_revision,
+ MCDI_OUT2(req, char, GET_PHY_CFG_OUT_REVISION),
+ MIN(sizeof (encp->enc_phy_revision) - 1,
+ MC_CMD_GET_PHY_CFG_OUT_REVISION_LEN));
+#if EFSYS_OPT_PHY_LED_CONTROL
+ encp->enc_led_mask = ((1 << EFX_PHY_LED_DEFAULT) |
+ (1 << EFX_PHY_LED_OFF) |
+ (1 << EFX_PHY_LED_ON));
+#endif /* EFSYS_OPT_PHY_LED_CONTROL */
+
+#if EFSYS_OPT_PHY_PROPS
+ encp->enc_phy_nprops = 0;
+#endif /* EFSYS_OPT_PHY_PROPS */
+
+ /* Get the media type of the fixed port, if recognised. */
+ EFX_STATIC_ASSERT(MC_CMD_MEDIA_XAUI == EFX_PHY_MEDIA_XAUI);
+ EFX_STATIC_ASSERT(MC_CMD_MEDIA_CX4 == EFX_PHY_MEDIA_CX4);
+ EFX_STATIC_ASSERT(MC_CMD_MEDIA_KX4 == EFX_PHY_MEDIA_KX4);
+ EFX_STATIC_ASSERT(MC_CMD_MEDIA_XFP == EFX_PHY_MEDIA_XFP);
+ EFX_STATIC_ASSERT(MC_CMD_MEDIA_SFP_PLUS == EFX_PHY_MEDIA_SFP_PLUS);
+ EFX_STATIC_ASSERT(MC_CMD_MEDIA_BASE_T == EFX_PHY_MEDIA_BASE_T);
+ EFX_STATIC_ASSERT(MC_CMD_MEDIA_QSFP_PLUS == EFX_PHY_MEDIA_QSFP_PLUS);
+ epp->ep_fixed_port_type =
+ MCDI_OUT_DWORD(req, GET_PHY_CFG_OUT_MEDIA_TYPE);
+ if (epp->ep_fixed_port_type >= EFX_PHY_MEDIA_NTYPES)
+ epp->ep_fixed_port_type = EFX_PHY_MEDIA_INVALID;
+
+ epp->ep_phy_cap_mask =
+ MCDI_OUT_DWORD(req, GET_PHY_CFG_OUT_SUPPORTED_CAP);
+#if EFSYS_OPT_PHY_FLAGS
+ encp->enc_phy_flags_mask = MCDI_OUT_DWORD(req, GET_PHY_CFG_OUT_FLAGS);
+#endif /* EFSYS_OPT_PHY_FLAGS */
+
+ encp->enc_port = (uint8_t)MCDI_OUT_DWORD(req, GET_PHY_CFG_OUT_PRT);
+
+ /* Populate internal state */
+ encp->enc_mcdi_mdio_channel =
+ (uint8_t)MCDI_OUT_DWORD(req, GET_PHY_CFG_OUT_CHANNEL);
+
+#if EFSYS_OPT_PHY_STATS
+ encp->enc_mcdi_phy_stat_mask =
+ MCDI_OUT_DWORD(req, GET_PHY_CFG_OUT_STATS_MASK);
+#endif /* EFSYS_OPT_PHY_STATS */
+
+#if EFSYS_OPT_BIST
+ encp->enc_bist_mask = 0;
+ if (MCDI_OUT_DWORD_FIELD(req, GET_PHY_CFG_OUT_FLAGS,
+ GET_PHY_CFG_OUT_BIST_CABLE_SHORT))
+ encp->enc_bist_mask |= (1 << EFX_BIST_TYPE_PHY_CABLE_SHORT);
+ if (MCDI_OUT_DWORD_FIELD(req, GET_PHY_CFG_OUT_FLAGS,
+ GET_PHY_CFG_OUT_BIST_CABLE_LONG))
+ encp->enc_bist_mask |= (1 << EFX_BIST_TYPE_PHY_CABLE_LONG);
+ if (MCDI_OUT_DWORD_FIELD(req, GET_PHY_CFG_OUT_FLAGS,
+ GET_PHY_CFG_OUT_BIST))
+ encp->enc_bist_mask |= (1 << EFX_BIST_TYPE_PHY_NORMAL);
+#endif /* EFSYS_OPT_BIST */
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+
+ __checkReturn int
+efx_mcdi_firmware_update_supported(
+ __in efx_nic_t *enp,
+ __out boolean_t *supportedp)
+{
+ efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
+ int rc;
+
+ if (emcop != NULL && emcop->emco_fw_update_supported != NULL) {
+ if ((rc = emcop->emco_fw_update_supported(enp, supportedp))
+ != 0)
+ goto fail1;
+ } else {
+ /* Earlier devices always supported updates */
+ *supportedp = B_TRUE;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+efx_mcdi_macaddr_change_supported(
+ __in efx_nic_t *enp,
+ __out boolean_t *supportedp)
+{
+ efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
+ int rc;
+
+ if (emcop != NULL && emcop->emco_macaddr_change_supported != NULL) {
+ if ((rc = emcop->emco_macaddr_change_supported(enp, supportedp))
+ != 0)
+ goto fail1;
+ } else {
+ /* Earlier devices always supported MAC changes */
+ *supportedp = B_TRUE;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+#if EFSYS_OPT_BIST
+
+#if EFSYS_OPT_HUNTINGTON
+/*
+ * Enter bist offline mode. This is a fw mode which puts the NIC into a state
+ * where memory BIST tests can be run and not much else can interfere or happen.
+ * A reboot is required to exit this mode.
+ */
+ __checkReturn int
+efx_mcdi_bist_enable_offline(
+ __in efx_nic_t *enp)
+{
+ efx_mcdi_req_t req;
+ int rc;
+
+ EFX_STATIC_ASSERT(MC_CMD_ENABLE_OFFLINE_BIST_IN_LEN == 0);
+ EFX_STATIC_ASSERT(MC_CMD_ENABLE_OFFLINE_BIST_OUT_LEN == 0);
+
+ req.emr_cmd = MC_CMD_ENABLE_OFFLINE_BIST;
+ req.emr_in_buf = NULL;
+ req.emr_in_length = 0;
req.emr_out_buf = NULL;
req.emr_out_length = 0;
- MCDI_IN_SET_DWORD(req, REBOOT_IN_FLAGS, 0);
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+#endif /* EFSYS_OPT_HUNTINGTON */
+
+ __checkReturn int
+efx_mcdi_bist_start(
+ __in efx_nic_t *enp,
+ __in efx_bist_type_t type)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_START_BIST_IN_LEN,
+ MC_CMD_START_BIST_OUT_LEN)];
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_START_BIST;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_START_BIST_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_START_BIST_OUT_LEN;
+
+ switch (type) {
+ case EFX_BIST_TYPE_PHY_NORMAL:
+ MCDI_IN_SET_DWORD(req, START_BIST_IN_TYPE, MC_CMD_PHY_BIST);
+ break;
+ case EFX_BIST_TYPE_PHY_CABLE_SHORT:
+ MCDI_IN_SET_DWORD(req, START_BIST_IN_TYPE,
+ MC_CMD_PHY_BIST_CABLE_SHORT);
+ break;
+ case EFX_BIST_TYPE_PHY_CABLE_LONG:
+ MCDI_IN_SET_DWORD(req, START_BIST_IN_TYPE,
+ MC_CMD_PHY_BIST_CABLE_LONG);
+ break;
+ case EFX_BIST_TYPE_MC_MEM:
+ MCDI_IN_SET_DWORD(req, START_BIST_IN_TYPE,
+ MC_CMD_MC_MEM_BIST);
+ break;
+ case EFX_BIST_TYPE_SAT_MEM:
+ MCDI_IN_SET_DWORD(req, START_BIST_IN_TYPE,
+ MC_CMD_PORT_MEM_BIST);
+ break;
+ case EFX_BIST_TYPE_REG:
+ MCDI_IN_SET_DWORD(req, START_BIST_IN_TYPE,
+ MC_CMD_REG_BIST);
+ break;
+ default:
+ EFSYS_ASSERT(0);
+ }
efx_mcdi_execute(enp, &req);
- /* Invert EIO */
- if (req.emr_rc != EIO) {
- rc = EIO;
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
goto fail1;
}
@@ -679,64 +1269,391 @@ fail1:
return (rc);
}
- __checkReturn boolean_t
-efx_mcdi_request_abort(
+#endif /* EFSYS_OPT_BIST */
+
+
+/* Enable logging of some events (e.g. link state changes) */
+ __checkReturn int
+efx_mcdi_log_ctrl(
__in efx_nic_t *enp)
{
- efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip);
- efx_mcdi_req_t *emrp;
- boolean_t aborted;
- int state;
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_LOG_CTRL_IN_LEN,
+ MC_CMD_LOG_CTRL_OUT_LEN)];
+ int rc;
- EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA);
- EFSYS_ASSERT3U(enp->en_features, &, EFX_FEATURE_MCDI);
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_LOG_CTRL;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_LOG_CTRL_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_LOG_CTRL_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, LOG_CTRL_IN_LOG_DEST,
+ MC_CMD_LOG_CTRL_IN_LOG_DEST_EVQ);
+ MCDI_IN_SET_DWORD(req, LOG_CTRL_IN_LOG_DEST_EVQ, 0);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+
+#if EFSYS_OPT_MAC_STATS
+
+typedef enum efx_stats_action_e
+{
+ EFX_STATS_CLEAR,
+ EFX_STATS_UPLOAD,
+ EFX_STATS_ENABLE_NOEVENTS,
+ EFX_STATS_ENABLE_EVENTS,
+ EFX_STATS_DISABLE,
+} efx_stats_action_t;
+
+static __checkReturn int
+efx_mcdi_mac_stats(
+ __in efx_nic_t *enp,
+ __in_opt efsys_mem_t *esmp,
+ __in efx_stats_action_t action)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_MAC_STATS_IN_LEN,
+ MC_CMD_MAC_STATS_OUT_DMA_LEN)];
+ int clear = (action == EFX_STATS_CLEAR);
+ int upload = (action == EFX_STATS_UPLOAD);
+ int enable = (action == EFX_STATS_ENABLE_NOEVENTS);
+ int events = (action == EFX_STATS_ENABLE_EVENTS);
+ int disable = (action == EFX_STATS_DISABLE);
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_MAC_STATS;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_MAC_STATS_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_MAC_STATS_OUT_DMA_LEN;
+
+ MCDI_IN_POPULATE_DWORD_6(req, MAC_STATS_IN_CMD,
+ MAC_STATS_IN_DMA, upload,
+ MAC_STATS_IN_CLEAR, clear,
+ MAC_STATS_IN_PERIODIC_CHANGE, enable | events | disable,
+ MAC_STATS_IN_PERIODIC_ENABLE, enable | events,
+ MAC_STATS_IN_PERIODIC_NOEVENT, !events,
+ MAC_STATS_IN_PERIOD_MS, (enable | events) ? 1000: 0);
+
+ if (esmp != NULL) {
+ int bytes = MC_CMD_MAC_NSTATS * sizeof (uint64_t);
+
+ EFX_STATIC_ASSERT(MC_CMD_MAC_NSTATS * sizeof (uint64_t) <=
+ EFX_MAC_STATS_SIZE);
+
+ MCDI_IN_SET_DWORD(req, MAC_STATS_IN_DMA_ADDR_LO,
+ EFSYS_MEM_ADDR(esmp) & 0xffffffff);
+ MCDI_IN_SET_DWORD(req, MAC_STATS_IN_DMA_ADDR_HI,
+ EFSYS_MEM_ADDR(esmp) >> 32);
+ MCDI_IN_SET_DWORD(req, MAC_STATS_IN_DMA_LEN, bytes);
+ } else {
+ EFSYS_ASSERT(!upload && !enable && !events);
+ }
/*
- * efx_mcdi_ev_* may have already completed this event, and be
- * spinning/blocked on the upper layer lock. So it *is* legitimate
- * to for emi_pending_req to be NULL. If there is a pending event
- * completed request, then provide a "credit" to allow
- * efx_mcdi_ev_cpl() to accept a single spurious completion.
+ * NOTE: Do not use EVB_PORT_ID_ASSIGNED when disabling periodic stats,
+ * as this may fail (and leave periodic DMA enabled) if the
+ * vadapter has already been deleted.
*/
- EFSYS_LOCK(enp->en_eslp, state);
- emrp = emip->emi_pending_req;
- aborted = (emrp != NULL);
- if (aborted) {
- emip->emi_pending_req = NULL;
+ MCDI_IN_SET_DWORD(req, MAC_STATS_IN_PORT_ID,
+ (disable ? EVB_PORT_ID_NULL : enp->en_vport_id));
- /* Error the request */
- emrp->emr_out_length_used = 0;
- emrp->emr_rc = ETIMEDOUT;
-
- /* Provide a credit for seqno/emr_pending_req mismatches */
- if (emip->emi_ev_cpl)
- ++emip->emi_aborted;
+ efx_mcdi_execute(enp, &req);
- /*
- * The upper layer has called us, so we don't
- * need to complete the request.
- */
+ if (req.emr_rc != 0) {
+ /* EF10: Expect ENOENT if no DMA queues are initialised */
+ if ((req.emr_rc != ENOENT) ||
+ (enp->en_rx_qcount + enp->en_tx_qcount != 0)) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
}
- EFSYS_UNLOCK(enp->en_eslp, state);
- return (aborted);
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
}
- void
-efx_mcdi_fini(
+ __checkReturn int
+efx_mcdi_mac_stats_clear(
__in efx_nic_t *enp)
{
- efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip);
+ int rc;
- EFSYS_ASSERT3U(enp->en_mod_flags, ==, EFX_MOD_MCDI);
- enp->en_mod_flags &= ~EFX_MOD_MCDI;
+ if ((rc = efx_mcdi_mac_stats(enp, NULL, EFX_STATS_CLEAR)) != 0)
+ goto fail1;
- if (~(enp->en_features) & EFX_FEATURE_MCDI)
- return;
+ return (0);
- emip->emi_mtp = NULL;
- emip->emi_port = 0;
- emip->emi_aborted = 0;
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
}
+ __checkReturn int
+efx_mcdi_mac_stats_upload(
+ __in efx_nic_t *enp,
+ __in efsys_mem_t *esmp)
+{
+ int rc;
+
+ /*
+ * The MC DMAs aggregate statistics for our convenience, so we can
+ * avoid having to pull the statistics buffer into the cache to
+ * maintain cumulative statistics.
+ */
+ if ((rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_UPLOAD)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+efx_mcdi_mac_stats_periodic(
+ __in efx_nic_t *enp,
+ __in efsys_mem_t *esmp,
+ __in uint16_t period,
+ __in boolean_t events)
+{
+ int rc;
+
+ /*
+ * The MC DMAs aggregate statistics for our convenience, so we can
+ * avoid having to pull the statistics buffer into the cache to
+ * maintain cumulative statistics.
+ * Huntington uses a fixed 1sec period, so use that on Siena too.
+ */
+ if (period == 0)
+ rc = efx_mcdi_mac_stats(enp, NULL, EFX_STATS_DISABLE);
+ else if (events)
+ rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_ENABLE_EVENTS);
+ else
+ rc = efx_mcdi_mac_stats(enp, esmp, EFX_STATS_ENABLE_NOEVENTS);
+
+ if (rc != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+#endif /* EFSYS_OPT_MAC_STATS */
+
+#if EFSYS_OPT_HUNTINGTON
+
+/*
+ * This function returns the pf and vf number of a function. If it is a pf the
+ * vf number is 0xffff. The vf number is the index of the vf on that
+ * function. So if you have 3 vfs on pf 0 the 3 vfs will return (pf=0,vf=0),
+ * (pf=0,vf=1), (pf=0,vf=2) aand the pf will return (pf=0, vf=0xffff).
+ */
+ __checkReturn int
+efx_mcdi_get_function_info(
+ __in efx_nic_t *enp,
+ __out uint32_t *pfp,
+ __out_opt uint32_t *vfp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_GET_FUNCTION_INFO_IN_LEN,
+ MC_CMD_GET_FUNCTION_INFO_OUT_LEN)];
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_GET_FUNCTION_INFO;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_GET_FUNCTION_INFO_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_GET_FUNCTION_INFO_OUT_LEN;
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_GET_FUNCTION_INFO_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ *pfp = MCDI_OUT_DWORD(req, GET_FUNCTION_INFO_OUT_PF);
+ if (vfp != NULL)
+ *vfp = MCDI_OUT_DWORD(req, GET_FUNCTION_INFO_OUT_VF);
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+efx_mcdi_privilege_mask(
+ __in efx_nic_t *enp,
+ __in uint32_t pf,
+ __in uint32_t vf,
+ __out uint32_t *maskp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_PRIVILEGE_MASK_IN_LEN,
+ MC_CMD_PRIVILEGE_MASK_OUT_LEN)];
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_PRIVILEGE_MASK;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_PRIVILEGE_MASK_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_PRIVILEGE_MASK_OUT_LEN;
+
+ MCDI_IN_POPULATE_DWORD_2(req, PRIVILEGE_MASK_IN_FUNCTION,
+ PRIVILEGE_MASK_IN_FUNCTION_PF, pf,
+ PRIVILEGE_MASK_IN_FUNCTION_VF, vf);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_PRIVILEGE_MASK_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ *maskp = MCDI_OUT_DWORD(req, PRIVILEGE_MASK_OUT_OLD_MASK);
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+#endif /* EFSYS_OPT_HUNTINGTON */
+
+ __checkReturn int
+efx_mcdi_set_workaround(
+ __in efx_nic_t *enp,
+ __in uint32_t type,
+ __in boolean_t enabled,
+ __out_opt uint32_t *flagsp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_WORKAROUND_IN_LEN,
+ MC_CMD_WORKAROUND_EXT_OUT_LEN)];
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_WORKAROUND;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_WORKAROUND_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_WORKAROUND_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, WORKAROUND_IN_TYPE, type);
+ MCDI_IN_SET_DWORD(req, WORKAROUND_IN_ENABLED, enabled ? 1 : 0);
+
+ efx_mcdi_execute_quiet(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (flagsp != NULL) {
+ if (req.emr_out_length_used >= MC_CMD_WORKAROUND_EXT_OUT_LEN)
+ *flagsp = MCDI_OUT_DWORD(req, WORKAROUND_EXT_OUT_FLAGS);
+ else
+ *flagsp = 0;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+
+ __checkReturn int
+efx_mcdi_get_workarounds(
+ __in efx_nic_t *enp,
+ __out_opt uint32_t *implementedp,
+ __out_opt uint32_t *enabledp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MC_CMD_GET_WORKAROUNDS_OUT_LEN];
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_GET_WORKAROUNDS;
+ req.emr_in_buf = NULL;
+ req.emr_in_length = 0;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_GET_WORKAROUNDS_OUT_LEN;
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (implementedp != NULL) {
+ *implementedp =
+ MCDI_OUT_DWORD(req, GET_WORKAROUNDS_OUT_IMPLEMENTED);
+ }
+
+ if (enabledp != NULL) {
+ *enabledp = MCDI_OUT_DWORD(req, GET_WORKAROUNDS_OUT_ENABLED);
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+
#endif /* EFSYS_OPT_MCDI */
diff --git a/sys/dev/sfxge/common/efx_mcdi.h b/sys/dev/sfxge/common/efx_mcdi.h
index b115746..ea02248 100644
--- a/sys/dev/sfxge/common/efx_mcdi.h
+++ b/sys/dev/sfxge/common/efx_mcdi.h
@@ -1,26 +1,31 @@
/*-
- * Copyright 2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2009-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*
* $FreeBSD$
*/
@@ -36,10 +41,15 @@
extern "C" {
#endif
-/* Number of retries attempted for init code */
-#define EFX_MCDI_REQ_RETRY_INIT 2
+/*
+ * A reboot/assertion causes the MCDI status word to be set after the
+ * command word is set or a REBOOT event is sent. If we notice a reboot
+ * via these mechanisms then wait 10ms for the status word to be set.
+ */
+#define EFX_MCDI_STATUS_SLEEP_US 10000
struct efx_mcdi_req_s {
+ boolean_t emr_quiet;
/* Inputs: Command #, input buffer and length */
unsigned int emr_cmd;
uint8_t *emr_in_buf;
@@ -52,19 +62,25 @@ struct efx_mcdi_req_s {
};
typedef struct efx_mcdi_iface_s {
- const efx_mcdi_transport_t *emi_mtp;
unsigned int emi_port;
unsigned int emi_seq;
efx_mcdi_req_t *emi_pending_req;
boolean_t emi_ev_cpl;
+ boolean_t emi_new_epoch;
int emi_aborted;
uint32_t emi_poll_cnt;
+ uint32_t emi_mc_reboot_status;
} efx_mcdi_iface_t;
extern void
efx_mcdi_execute(
__in efx_nic_t *enp,
- __in efx_mcdi_req_t *emrp);
+ __inout efx_mcdi_req_t *emrp);
+
+extern void
+efx_mcdi_execute_quiet(
+ __in efx_nic_t *enp,
+ __inout efx_mcdi_req_t *emrp);
extern void
efx_mcdi_ev_cpl(
@@ -78,6 +94,16 @@ efx_mcdi_ev_death(
__in efx_nic_t *enp,
__in int rc);
+extern __checkReturn int
+efx_mcdi_request_errcode(
+ __in unsigned int err);
+
+extern void
+efx_mcdi_raise_exception(
+ __in efx_nic_t *enp,
+ __in_opt efx_mcdi_req_t *emrp,
+ __in int rc);
+
typedef enum efx_mcdi_boot_e {
EFX_MCDI_BOOT_PRIMARY,
EFX_MCDI_BOOT_SECONDARY,
@@ -91,6 +117,86 @@ efx_mcdi_version(
__out_opt uint32_t *buildp,
__out_opt efx_mcdi_boot_t *statusp);
+extern __checkReturn int
+efx_mcdi_read_assertion(
+ __in efx_nic_t *enp);
+
+extern __checkReturn int
+efx_mcdi_exit_assertion_handler(
+ __in efx_nic_t *enp);
+
+extern __checkReturn int
+efx_mcdi_drv_attach(
+ __in efx_nic_t *enp,
+ __in boolean_t attach);
+
+extern __checkReturn int
+efx_mcdi_get_board_cfg(
+ __in efx_nic_t *enp,
+ __out_opt uint32_t *board_typep,
+ __out_opt efx_dword_t *capabilitiesp,
+ __out_ecount_opt(6) uint8_t mac_addrp[6]);
+
+extern __checkReturn int
+efx_mcdi_get_phy_cfg(
+ __in efx_nic_t *enp);
+
+extern __checkReturn int
+efx_mcdi_firmware_update_supported(
+ __in efx_nic_t *enp,
+ __out boolean_t *supportedp);
+
+extern __checkReturn int
+efx_mcdi_macaddr_change_supported(
+ __in efx_nic_t *enp,
+ __out boolean_t *supportedp);
+
+#if EFSYS_OPT_BIST
+#if EFSYS_OPT_HUNTINGTON
+extern __checkReturn int
+efx_mcdi_bist_enable_offline(
+ __in efx_nic_t *enp);
+#endif /* EFSYS_OPT_HUNTINGTON */
+extern __checkReturn int
+efx_mcdi_bist_start(
+ __in efx_nic_t *enp,
+ __in efx_bist_type_t type);
+#endif /* EFSYS_OPT_BIST */
+
+extern __checkReturn int
+efx_mcdi_get_resource_limits(
+ __in efx_nic_t *enp,
+ __out_opt uint32_t *nevqp,
+ __out_opt uint32_t *nrxqp,
+ __out_opt uint32_t *ntxqp);
+
+extern __checkReturn int
+efx_mcdi_log_ctrl(
+ __in efx_nic_t *enp);
+
+extern __checkReturn int
+efx_mcdi_mac_stats_clear(
+ __in efx_nic_t *enp);
+
+extern __checkReturn int
+efx_mcdi_mac_stats_upload(
+ __in efx_nic_t *enp,
+ __in efsys_mem_t *esmp);
+
+extern __checkReturn int
+efx_mcdi_mac_stats_periodic(
+ __in efx_nic_t *enp,
+ __in efsys_mem_t *esmp,
+ __in uint16_t period,
+ __in boolean_t events);
+
+
+#if EFSYS_OPT_LOOPBACK
+extern __checkReturn int
+efx_mcdi_get_loopback_modes(
+ __in efx_nic_t *enp);
+#endif /* EFSYS_OPT_LOOPBACK */
+
#define MCDI_IN(_emr, _type, _ofst) \
((_type *)((_emr).emr_in_buf + (_ofst)))
@@ -101,10 +207,18 @@ efx_mcdi_version(
EFX_POPULATE_BYTE_1(*MCDI_IN2(_emr, efx_byte_t, _ofst), \
EFX_BYTE_0, _value)
+#define MCDI_IN_SET_WORD(_emr, _ofst, _value) \
+ EFX_POPULATE_WORD_1(*MCDI_IN2(_emr, efx_word_t, _ofst), \
+ EFX_WORD_0, _value)
+
#define MCDI_IN_SET_DWORD(_emr, _ofst, _value) \
EFX_POPULATE_DWORD_1(*MCDI_IN2(_emr, efx_dword_t, _ofst), \
EFX_DWORD_0, _value)
+#define MCDI_IN_SET_DWORD_FIELD(_emr, _ofst, _field, _value) \
+ EFX_SET_DWORD_FIELD(*MCDI_IN2(_emr, efx_dword_t, _ofst), \
+ MC_CMD_ ## _field, _value)
+
#define MCDI_IN_POPULATE_DWORD_1(_emr, _ofst, _field1, _value1) \
EFX_POPULATE_DWORD_1(*MCDI_IN2(_emr, efx_dword_t, _ofst), \
MC_CMD_ ## _field1, _value1)
@@ -154,7 +268,7 @@ efx_mcdi_version(
#define MCDI_IN_POPULATE_DWORD_7(_emr, _ofst, _field1, _value1, \
_field2, _value2, _field3, _value3, _field4, _value4, \
_field5, _value5, _field6, _value6, _field7, _value7) \
- EFX_POPULATE_DWORD_7(MCDI_IN2(_emr, efx_dword_t, _ofst), \
+ EFX_POPULATE_DWORD_7(*MCDI_IN2(_emr, efx_dword_t, _ofst), \
MC_CMD_ ## _field1, _value1, \
MC_CMD_ ## _field2, _value2, \
MC_CMD_ ## _field3, _value3, \
@@ -233,7 +347,7 @@ efx_mcdi_version(
#define MCDI_EV_FIELD(_eqp, _field) \
EFX_QWORD_FIELD(*_eqp, MCDI_EVENT_ ## _field)
-#define MCDI_CMD_DWORD_FIELD(_edp, _field) \
+#define MCDI_CMD_DWORD_FIELD(_edp, _field) \
EFX_DWORD_FIELD(*_edp, MC_CMD_ ## _field)
#ifdef __cplusplus
diff --git a/sys/dev/sfxge/common/efx_mon.c b/sys/dev/sfxge/common/efx_mon.c
index dc2e256..c5b356d 100644
--- a/sys/dev/sfxge/common/efx_mon.c
+++ b/sys/dev/sfxge/common/efx_mon.c
@@ -1,26 +1,31 @@
/*-
- * Copyright 2007-2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2007-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -44,17 +49,22 @@ __FBSDID("$FreeBSD$");
#include "max6647.h"
#endif
+#if EFSYS_OPT_MON_MCDI
+#include "mcdi_mon.h"
+#endif
+
#if EFSYS_OPT_NAMES
-static const char __cs * __cs __efx_mon_name[] = {
+static const char *__efx_mon_name[] = {
"",
"nullmon",
"lm87",
"max6647",
- "sfx90x0"
+ "sfx90x0",
+ "sfx91x0"
};
- const char __cs *
+ const char *
efx_mon_name(
__in efx_nic_t *enp)
{
@@ -70,47 +80,46 @@ efx_mon_name(
#endif /* EFSYS_OPT_NAMES */
#if EFSYS_OPT_MON_NULL
-static efx_mon_ops_t __cs __efx_mon_null_ops = {
+static efx_mon_ops_t __efx_mon_null_ops = {
nullmon_reset, /* emo_reset */
nullmon_reconfigure, /* emo_reconfigure */
#if EFSYS_OPT_MON_STATS
- nullmon_stats_update /* emo_stat_update */
+ nullmon_stats_update /* emo_stats_update */
#endif /* EFSYS_OPT_MON_STATS */
};
#endif
#if EFSYS_OPT_MON_LM87
-static efx_mon_ops_t __cs __efx_mon_lm87_ops = {
+static efx_mon_ops_t __efx_mon_lm87_ops = {
lm87_reset, /* emo_reset */
lm87_reconfigure, /* emo_reconfigure */
#if EFSYS_OPT_MON_STATS
- lm87_stats_update /* emo_stat_update */
+ lm87_stats_update /* emo_stats_update */
#endif /* EFSYS_OPT_MON_STATS */
};
#endif
#if EFSYS_OPT_MON_MAX6647
-static efx_mon_ops_t __cs __efx_mon_max6647_ops = {
+static efx_mon_ops_t __efx_mon_max6647_ops = {
max6647_reset, /* emo_reset */
max6647_reconfigure, /* emo_reconfigure */
#if EFSYS_OPT_MON_STATS
- max6647_stats_update /* emo_stat_update */
+ max6647_stats_update /* emo_stats_update */
#endif /* EFSYS_OPT_MON_STATS */
};
#endif
-#if EFSYS_OPT_MON_SIENA
-static efx_mon_ops_t __cs __efx_mon_siena_ops = {
- siena_mon_reset, /* emo_reset */
- siena_mon_reconfigure, /* emo_reconfigure */
+#if EFSYS_OPT_MON_MCDI
+static efx_mon_ops_t __efx_mon_mcdi_ops = {
+ NULL, /* emo_reset */
+ NULL, /* emo_reconfigure */
#if EFSYS_OPT_MON_STATS
- siena_mon_stats_update /* emo_stat_update */
+ mcdi_mon_stats_update /* emo_stats_update */
#endif /* EFSYS_OPT_MON_STATS */
};
#endif
-
-static efx_mon_ops_t __cs * __cs __efx_mon_ops[] = {
+static efx_mon_ops_t *__efx_mon_ops[] = {
NULL,
#if EFSYS_OPT_MON_NULL
&__efx_mon_null_ops,
@@ -127,8 +136,13 @@ static efx_mon_ops_t __cs * __cs __efx_mon_ops[] = {
#else
NULL,
#endif
-#if EFSYS_OPT_MON_SIENA
- &__efx_mon_siena_ops
+#if EFSYS_OPT_MON_MCDI
+ &__efx_mon_mcdi_ops,
+#else
+ NULL,
+#endif
+#if EFSYS_OPT_MON_MCDI
+ &__efx_mon_mcdi_ops
#else
NULL
#endif
@@ -162,11 +176,15 @@ efx_mon_init(
goto fail2;
}
- if ((rc = emop->emo_reset(enp)) != 0)
- goto fail3;
+ if (emop->emo_reset != NULL) {
+ if ((rc = emop->emo_reset(enp)) != 0)
+ goto fail3;
+ }
- if ((rc = emop->emo_reconfigure(enp)) != 0)
- goto fail4;
+ if (emop->emo_reconfigure != NULL) {
+ if ((rc = emop->emo_reconfigure(enp)) != 0)
+ goto fail4;
+ }
emp->em_emop = emop;
return (0);
@@ -174,7 +192,8 @@ efx_mon_init(
fail4:
EFSYS_PROBE(fail5);
- (void) emop->emo_reset(enp);
+ if (emop->emo_reset != NULL)
+ (void) emop->emo_reset(enp);
fail3:
EFSYS_PROBE(fail4);
@@ -195,8 +214,8 @@ fail1:
#if EFSYS_OPT_NAMES
-/* START MKCONFIG GENERATED MonitorStatNamesBlock 89ff37f1d74ad8b3 */
-static const char __cs * __cs __mon_stat_name[] = {
+/* START MKCONFIG GENERATED MonitorStatNamesBlock b9328f15438c4d01 */
+static const char *__mon_stat_name[] = {
"value_2_5v",
"value_vccp1",
"value_vcc",
@@ -227,11 +246,50 @@ static const char __cs * __cs __mon_stat_name[] = {
"vaoe_in",
"iaoe",
"iaoe_in",
+ "nic_power",
+ "0_9v",
+ "i0_9v",
+ "i1_2v",
+ "0_9v_adc",
+ "controller_temperature2",
+ "vreg_temperature",
+ "vreg_0_9v_temperature",
+ "vreg_1_2v_temperature",
+ "int_vptat",
+ "controller_internal_adc_temperature",
+ "ext_vptat",
+ "controller_external_adc_temperature",
+ "ambient_temperature",
+ "airflow",
+ "vdd08d_vss08d_csr",
+ "vdd08d_vss08d_csr_extadc",
+ "hotpoint_temperature",
+ "phy_power_switch_port0",
+ "phy_power_switch_port1",
+ "mum_vcc",
+ "0v9_a",
+ "i0v9_a",
+ "0v9_a_temp",
+ "0v9_b",
+ "i0v9_b",
+ "0v9_b_temp",
+ "ccom_avreg_1v2_supply",
+ "ccom_avreg_1v2_supply_ext_adc",
+ "ccom_avreg_1v8_supply",
+ "ccom_avreg_1v8_supply_ext_adc",
+ "controller_master_vptat",
+ "controller_master_internal_temp",
+ "controller_master_vptat_ext_adc",
+ "controller_master_internal_temp_ext_adc",
+ "controller_slave_vptat",
+ "controller_slave_internal_temp",
+ "controller_slave_vptat_ext_adc",
+ "controller_slave_internal_temp_ext_adc",
};
/* END MKCONFIG GENERATED MonitorStatNamesBlock */
-extern const char __cs *
+extern const char *
efx_mon_stat_name(
__in efx_nic_t *enp,
__in efx_mon_stat_t id)
@@ -276,9 +334,11 @@ efx_mon_fini(
emp->em_emop = NULL;
- rc = emop->emo_reset(enp);
- if (rc != 0)
- EFSYS_PROBE1(fail1, int, rc);
+ if (emop->emo_reset != NULL) {
+ rc = emop->emo_reset(enp);
+ if (rc != 0)
+ EFSYS_PROBE1(fail1, int, rc);
+ }
emp->em_type = EFX_MON_INVALID;
diff --git a/sys/dev/sfxge/common/efx_nic.c b/sys/dev/sfxge/common/efx_nic.c
index b0ba58c..b5ad65e 100644
--- a/sys/dev/sfxge/common/efx_nic.c
+++ b/sys/dev/sfxge/common/efx_nic.c
@@ -1,26 +1,31 @@
/*-
- * Copyright 2007-2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2007-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -38,27 +43,55 @@ efx_family(
__in uint16_t devid,
__out efx_family_t *efp)
{
+ if (venid == EFX_PCI_VENID_SFC) {
+ switch (devid) {
#if EFSYS_OPT_FALCON
- if (venid == EFX_PCI_VENID_SFC && devid == EFX_PCI_DEVID_FALCON) {
- *efp = EFX_FAMILY_FALCON;
- return (0);
- }
+ case EFX_PCI_DEVID_FALCON:
+ *efp = EFX_FAMILY_FALCON;
+ return (0);
#endif
#if EFSYS_OPT_SIENA
- if (venid == EFX_PCI_VENID_SFC && devid == EFX_PCI_DEVID_BETHPAGE) {
- *efp = EFX_FAMILY_SIENA;
- return (0);
- }
- if (venid == EFX_PCI_VENID_SFC && devid == EFX_PCI_DEVID_SIENA) {
- *efp = EFX_FAMILY_SIENA;
- return (0);
- }
- if (venid == EFX_PCI_VENID_SFC &&
- devid == EFX_PCI_DEVID_SIENA_F1_UNINIT) {
- *efp = EFX_FAMILY_SIENA;
- return (0);
- }
+ case EFX_PCI_DEVID_SIENA_F1_UNINIT:
+ /*
+ * Hardware default for PF0 of uninitialised Siena.
+ * manftest must be able to cope with this device id.
+ */
+ *efp = EFX_FAMILY_SIENA;
+ return (0);
+
+ case EFX_PCI_DEVID_BETHPAGE:
+ case EFX_PCI_DEVID_SIENA:
+ *efp = EFX_FAMILY_SIENA;
+ return (0);
+#endif
+
+#if EFSYS_OPT_HUNTINGTON
+ case EFX_PCI_DEVID_HUNTINGTON_PF_UNINIT:
+ /*
+ * Hardware default for PF0 of uninitialised Huntington.
+ * manftest must be able to cope with this device id.
+ */
+ *efp = EFX_FAMILY_HUNTINGTON;
+ return (0);
+
+ case EFX_PCI_DEVID_FARMINGDALE:
+ case EFX_PCI_DEVID_GREENPORT:
+ case EFX_PCI_DEVID_HUNTINGTON:
+ *efp = EFX_FAMILY_HUNTINGTON;
+ return (0);
+
+ case EFX_PCI_DEVID_FARMINGDALE_VF:
+ case EFX_PCI_DEVID_GREENPORT_VF:
+ case EFX_PCI_DEVID_HUNTINGTON_VF:
+ *efp = EFX_FAMILY_HUNTINGTON;
+ return (0);
#endif
+ default:
+ break;
+ }
+ }
+
+ *efp = EFX_FAMILY_INVALID;
return (ENOTSUP);
}
@@ -80,11 +113,28 @@ efx_infer_family(
EFSYS_BAR_READO(esbp, FR_AZ_CS_DEBUG_REG_OFST, &oword, B_TRUE);
portnum = EFX_OWORD_FIELD(oword, FRF_CZ_CS_PORT_NUM);
switch (portnum) {
+ case 0: {
+ efx_dword_t dword;
+ uint32_t hw_rev;
+
+ EFSYS_BAR_READD(esbp, ER_DZ_BIU_HW_REV_ID_REG_OFST, &dword,
+ B_TRUE);
+ hw_rev = EFX_DWORD_FIELD(dword, ERF_DZ_HW_REV_ID);
+ if (hw_rev == ER_DZ_BIU_HW_REV_ID_REG_RESET) {
+#if EFSYS_OPT_HUNTINGTON
+ family = EFX_FAMILY_HUNTINGTON;
+ break;
+#endif
+ } else {
#if EFSYS_OPT_FALCON
- case 0:
- family = EFX_FAMILY_FALCON;
- break;
+ family = EFX_FAMILY_FALCON;
+ break;
#endif
+ }
+ rc = ENOTSUP;
+ goto fail1;
+ }
+
#if EFSYS_OPT_SIENA
case 1:
case 2:
@@ -106,15 +156,10 @@ fail1:
return (rc);
}
-/*
- * The built-in default value device id for port 1 of Siena is 0x0810.
- * manftest needs to be able to cope with that.
- */
-
#define EFX_BIU_MAGIC0 0x01234567
#define EFX_BIU_MAGIC1 0xfedcba98
-static __checkReturn int
+ __checkReturn int
efx_nic_biu_test(
__in efx_nic_t *enp)
{
@@ -128,18 +173,18 @@ efx_nic_biu_test(
* back the cached value that was last written.
*/
EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC0);
- EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword);
+ EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE);
EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC1);
- EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 1, &oword);
+ EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE);
- EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 0, &oword);
+ EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE);
if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC0) {
rc = EIO;
goto fail1;
}
- EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 1, &oword);
+ EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE);
if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC1) {
rc = EIO;
goto fail2;
@@ -151,18 +196,18 @@ efx_nic_biu_test(
* values already written into the scratch registers.
*/
EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC1);
- EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword);
+ EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE);
EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC0);
- EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 1, &oword);
+ EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE);
- EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 0, &oword);
+ EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE);
if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC1) {
rc = EIO;
goto fail3;
}
- EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 1, &oword);
+ EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE);
if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC0) {
rc = EIO;
goto fail4;
@@ -184,10 +229,13 @@ fail1:
#if EFSYS_OPT_FALCON
-static efx_nic_ops_t __cs __efx_nic_falcon_ops = {
+static efx_nic_ops_t __efx_nic_falcon_ops = {
falcon_nic_probe, /* eno_probe */
+ NULL, /* eno_set_drv_limits */
falcon_nic_reset, /* eno_reset */
falcon_nic_init, /* eno_init */
+ NULL, /* eno_get_vi_pool */
+ NULL, /* eno_get_bar_region */
#if EFSYS_OPT_DIAG
falcon_sram_test, /* eno_sram_test */
falcon_nic_register_test, /* eno_register_test */
@@ -200,10 +248,13 @@ static efx_nic_ops_t __cs __efx_nic_falcon_ops = {
#if EFSYS_OPT_SIENA
-static efx_nic_ops_t __cs __efx_nic_siena_ops = {
+static efx_nic_ops_t __efx_nic_siena_ops = {
siena_nic_probe, /* eno_probe */
+ NULL, /* eno_set_drv_limits */
siena_nic_reset, /* eno_reset */
siena_nic_init, /* eno_init */
+ NULL, /* eno_get_vi_pool */
+ NULL, /* eno_get_bar_region */
#if EFSYS_OPT_DIAG
siena_sram_test, /* eno_sram_test */
siena_nic_register_test, /* eno_register_test */
@@ -214,6 +265,25 @@ static efx_nic_ops_t __cs __efx_nic_siena_ops = {
#endif /* EFSYS_OPT_SIENA */
+#if EFSYS_OPT_HUNTINGTON
+
+static efx_nic_ops_t __efx_nic_hunt_ops = {
+ hunt_nic_probe, /* eno_probe */
+ hunt_nic_set_drv_limits, /* eno_set_drv_limits */
+ hunt_nic_reset, /* eno_reset */
+ hunt_nic_init, /* eno_init */
+ hunt_nic_get_vi_pool, /* eno_get_vi_pool */
+ hunt_nic_get_bar_region, /* eno_get_bar_region */
+#if EFSYS_OPT_DIAG
+ hunt_sram_test, /* eno_sram_test */
+ hunt_nic_register_test, /* eno_register_test */
+#endif /* EFSYS_OPT_DIAG */
+ hunt_nic_fini, /* eno_fini */
+ hunt_nic_unprobe, /* eno_unprobe */
+};
+
+#endif /* EFSYS_OPT_HUNTINGTON */
+
__checkReturn int
efx_nic_create(
__in efx_family_t family,
@@ -257,10 +327,27 @@ efx_nic_create(
EFX_FEATURE_WOL |
EFX_FEATURE_MCDI |
EFX_FEATURE_LOOKAHEAD_SPLIT |
- EFX_FEATURE_MAC_HEADER_FILTERS;
+ EFX_FEATURE_MAC_HEADER_FILTERS |
+ EFX_FEATURE_TX_SRC_FILTERS;
break;
#endif /* EFSYS_OPT_SIENA */
+#if EFSYS_OPT_HUNTINGTON
+ case EFX_FAMILY_HUNTINGTON:
+ enp->en_enop = (efx_nic_ops_t *)&__efx_nic_hunt_ops;
+ /* FIXME: Add WOL support */
+ enp->en_features =
+ EFX_FEATURE_IPV6 |
+ EFX_FEATURE_LINK_EVENTS |
+ EFX_FEATURE_PERIODIC_MAC_STATS |
+ EFX_FEATURE_MCDI |
+ EFX_FEATURE_MAC_HEADER_FILTERS |
+ EFX_FEATURE_MCDI_DMA |
+ EFX_FEATURE_PIO_BUFFERS |
+ EFX_FEATURE_FW_ASSISTED_TSO;
+ break;
+#endif /* EFSYS_OPT_HUNTINGTON */
+
default:
rc = ENOTSUP;
goto fail2;
@@ -276,7 +363,7 @@ efx_nic_create(
return (0);
fail2:
- EFSYS_PROBE(fail3);
+ EFSYS_PROBE(fail2);
enp->en_magic = 0;
@@ -294,7 +381,6 @@ efx_nic_probe(
__in efx_nic_t *enp)
{
efx_nic_ops_t *enop;
- efx_oword_t oword;
int rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -303,36 +389,22 @@ efx_nic_probe(
#endif /* EFSYS_OPT_MCDI */
EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_PROBE));
- /* Test BIU */
- if ((rc = efx_nic_biu_test(enp)) != 0)
- goto fail1;
-
- /* Clear the region register */
- EFX_POPULATE_OWORD_4(oword,
- FRF_AZ_ADR_REGION0, 0,
- FRF_AZ_ADR_REGION1, (1 << 16),
- FRF_AZ_ADR_REGION2, (2 << 16),
- FRF_AZ_ADR_REGION3, (3 << 16));
- EFX_BAR_WRITEO(enp, FR_AZ_ADR_REGION_REG, &oword);
-
enop = enp->en_enop;
if ((rc = enop->eno_probe(enp)) != 0)
- goto fail2;
+ goto fail1;
if ((rc = efx_phy_probe(enp)) != 0)
- goto fail3;
+ goto fail2;
enp->en_mod_flags |= EFX_MOD_PROBE;
return (0);
-fail3:
- EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
enop->eno_unprobe(enp);
-fail2:
- EFSYS_PROBE(fail2);
fail1:
EFSYS_PROBE1(fail1, int, rc);
@@ -376,6 +448,105 @@ efx_nic_pcie_extended_sync(
#endif /* EFSYS_OPT_PCIE_TUNE */
__checkReturn int
+efx_nic_set_drv_limits(
+ __inout efx_nic_t *enp,
+ __in efx_drv_limits_t *edlp)
+{
+ efx_nic_ops_t *enop = enp->en_enop;
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
+
+ if (enop->eno_set_drv_limits != NULL) {
+ if ((rc = enop->eno_set_drv_limits(enp, edlp)) != 0)
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+efx_nic_get_bar_region(
+ __in efx_nic_t *enp,
+ __in efx_nic_region_t region,
+ __out uint32_t *offsetp,
+ __out size_t *sizep)
+{
+ efx_nic_ops_t *enop = enp->en_enop;
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC);
+
+ if (enop->eno_get_bar_region == NULL) {
+ rc = ENOTSUP;
+ goto fail1;
+ }
+ if ((rc = (enop->eno_get_bar_region)(enp,
+ region, offsetp, sizep)) != 0) {
+ goto fail2;
+ }
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+
+ __checkReturn int
+efx_nic_get_vi_pool(
+ __in efx_nic_t *enp,
+ __out uint32_t *evq_countp,
+ __out uint32_t *rxq_countp,
+ __out uint32_t *txq_countp)
+{
+ efx_nic_ops_t *enop = enp->en_enop;
+ efx_nic_cfg_t *encp = &enp->en_nic_cfg;
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC);
+
+ if (enop->eno_get_vi_pool != NULL) {
+ uint32_t vi_count = 0;
+
+ if ((rc = (enop->eno_get_vi_pool)(enp, &vi_count)) != 0)
+ goto fail1;
+
+ *evq_countp = vi_count;
+ *rxq_countp = vi_count;
+ *txq_countp = vi_count;
+ } else {
+ /* Use NIC limits as default value */
+ *evq_countp = encp->enc_evq_limit;
+ *rxq_countp = encp->enc_rxq_limit;
+ *txq_countp = encp->enc_txq_limit;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+
+ __checkReturn int
efx_nic_init(
__in efx_nic_t *enp)
{
@@ -679,3 +850,191 @@ fail1:
}
#endif /* EFSYS_OPT_DIAG */
+
+#if EFSYS_OPT_LOOPBACK
+
+extern void
+efx_loopback_mask(
+ __in efx_loopback_kind_t loopback_kind,
+ __out efx_qword_t *maskp)
+{
+ efx_qword_t mask;
+
+ EFSYS_ASSERT3U(loopback_kind, <, EFX_LOOPBACK_NKINDS);
+ EFSYS_ASSERT(maskp != NULL);
+
+ /* Assert the MC_CMD_LOOPBACK and EFX_LOOPBACK namespace agree */
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_NONE == EFX_LOOPBACK_OFF);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_DATA == EFX_LOOPBACK_DATA);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_GMAC == EFX_LOOPBACK_GMAC);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XGMII == EFX_LOOPBACK_XGMII);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XGXS == EFX_LOOPBACK_XGXS);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XAUI == EFX_LOOPBACK_XAUI);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_GMII == EFX_LOOPBACK_GMII);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_SGMII == EFX_LOOPBACK_SGMII);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XGBR == EFX_LOOPBACK_XGBR);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XFI == EFX_LOOPBACK_XFI);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XAUI_FAR == EFX_LOOPBACK_XAUI_FAR);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_GMII_FAR == EFX_LOOPBACK_GMII_FAR);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_SGMII_FAR == EFX_LOOPBACK_SGMII_FAR);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XFI_FAR == EFX_LOOPBACK_XFI_FAR);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_GPHY == EFX_LOOPBACK_GPHY);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PHYXS == EFX_LOOPBACK_PHY_XS);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PCS == EFX_LOOPBACK_PCS);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PMAPMD == EFX_LOOPBACK_PMA_PMD);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XPORT == EFX_LOOPBACK_XPORT);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XGMII_WS == EFX_LOOPBACK_XGMII_WS);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XAUI_WS == EFX_LOOPBACK_XAUI_WS);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XAUI_WS_FAR ==
+ EFX_LOOPBACK_XAUI_WS_FAR);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XAUI_WS_NEAR ==
+ EFX_LOOPBACK_XAUI_WS_NEAR);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_GMII_WS == EFX_LOOPBACK_GMII_WS);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XFI_WS == EFX_LOOPBACK_XFI_WS);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XFI_WS_FAR ==
+ EFX_LOOPBACK_XFI_WS_FAR);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PHYXS_WS == EFX_LOOPBACK_PHYXS_WS);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PMA_INT == EFX_LOOPBACK_PMA_INT);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_SD_NEAR == EFX_LOOPBACK_SD_NEAR);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_SD_FAR == EFX_LOOPBACK_SD_FAR);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PMA_INT_WS ==
+ EFX_LOOPBACK_PMA_INT_WS);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_SD_FEP2_WS ==
+ EFX_LOOPBACK_SD_FEP2_WS);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_SD_FEP1_5_WS ==
+ EFX_LOOPBACK_SD_FEP1_5_WS);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_SD_FEP_WS == EFX_LOOPBACK_SD_FEP_WS);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_SD_FES_WS == EFX_LOOPBACK_SD_FES_WS);
+
+ /* Build bitmask of possible loopback types */
+ EFX_ZERO_QWORD(mask);
+
+ if ((loopback_kind == EFX_LOOPBACK_KIND_OFF) ||
+ (loopback_kind == EFX_LOOPBACK_KIND_ALL)) {
+ EFX_SET_QWORD_BIT(mask, EFX_LOOPBACK_OFF);
+ }
+
+ if ((loopback_kind == EFX_LOOPBACK_KIND_MAC) ||
+ (loopback_kind == EFX_LOOPBACK_KIND_ALL)) {
+ /*
+ * The "MAC" grouping has historically been used by drivers to
+ * mean loopbacks supported by on-chip hardware. Keep that
+ * meaning here, and include on-chip PHY layer loopbacks.
+ */
+ EFX_SET_QWORD_BIT(mask, EFX_LOOPBACK_DATA);
+ EFX_SET_QWORD_BIT(mask, EFX_LOOPBACK_GMAC);
+ EFX_SET_QWORD_BIT(mask, EFX_LOOPBACK_XGMII);
+ EFX_SET_QWORD_BIT(mask, EFX_LOOPBACK_XGXS);
+ EFX_SET_QWORD_BIT(mask, EFX_LOOPBACK_XAUI);
+ EFX_SET_QWORD_BIT(mask, EFX_LOOPBACK_GMII);
+ EFX_SET_QWORD_BIT(mask, EFX_LOOPBACK_SGMII);
+ EFX_SET_QWORD_BIT(mask, EFX_LOOPBACK_XGBR);
+ EFX_SET_QWORD_BIT(mask, EFX_LOOPBACK_XFI);
+ EFX_SET_QWORD_BIT(mask, EFX_LOOPBACK_XAUI_FAR);
+ EFX_SET_QWORD_BIT(mask, EFX_LOOPBACK_GMII_FAR);
+ EFX_SET_QWORD_BIT(mask, EFX_LOOPBACK_SGMII_FAR);
+ EFX_SET_QWORD_BIT(mask, EFX_LOOPBACK_XFI_FAR);
+ EFX_SET_QWORD_BIT(mask, EFX_LOOPBACK_PMA_INT);
+ EFX_SET_QWORD_BIT(mask, EFX_LOOPBACK_SD_NEAR);
+ EFX_SET_QWORD_BIT(mask, EFX_LOOPBACK_SD_FAR);
+ }
+
+ if ((loopback_kind == EFX_LOOPBACK_KIND_PHY) ||
+ (loopback_kind == EFX_LOOPBACK_KIND_ALL)) {
+ /*
+ * The "PHY" grouping has historically been used by drivers to
+ * mean loopbacks supported by off-chip hardware. Keep that
+ * meaning here.
+ */
+ EFX_SET_QWORD_BIT(mask, EFX_LOOPBACK_GPHY);
+ EFX_SET_QWORD_BIT(mask, EFX_LOOPBACK_PHY_XS);
+ EFX_SET_QWORD_BIT(mask, EFX_LOOPBACK_PCS);
+ EFX_SET_QWORD_BIT(mask, EFX_LOOPBACK_PMA_PMD);
+ }
+
+ *maskp = mask;
+}
+
+__checkReturn int
+efx_mcdi_get_loopback_modes(
+ __in efx_nic_t *enp)
+{
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_GET_LOOPBACK_MODES_IN_LEN,
+ MC_CMD_GET_LOOPBACK_MODES_OUT_LEN)];
+ efx_qword_t mask;
+ efx_qword_t modes;
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_GET_LOOPBACK_MODES;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_GET_LOOPBACK_MODES_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_GET_LOOPBACK_MODES_OUT_LEN;
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used <
+ MC_CMD_GET_LOOPBACK_MODES_OUT_SUGGESTED_OFST +
+ MC_CMD_GET_LOOPBACK_MODES_OUT_SUGGESTED_LEN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ /*
+ * We assert the MC_CMD_LOOPBACK and EFX_LOOPBACK namespaces agree
+ * in efx_loopback_mask() and in siena_phy.c:siena_phy_get_link().
+ */
+ efx_loopback_mask(EFX_LOOPBACK_KIND_ALL, &mask);
+
+ EFX_AND_QWORD(mask,
+ *MCDI_OUT2(req, efx_qword_t, GET_LOOPBACK_MODES_OUT_SUGGESTED));
+
+ modes = *MCDI_OUT2(req, efx_qword_t, GET_LOOPBACK_MODES_OUT_100M);
+ EFX_AND_QWORD(modes, mask);
+ encp->enc_loopback_types[EFX_LINK_100FDX] = modes;
+
+ modes = *MCDI_OUT2(req, efx_qword_t, GET_LOOPBACK_MODES_OUT_1G);
+ EFX_AND_QWORD(modes, mask);
+ encp->enc_loopback_types[EFX_LINK_1000FDX] = modes;
+
+ modes = *MCDI_OUT2(req, efx_qword_t, GET_LOOPBACK_MODES_OUT_10G);
+ EFX_AND_QWORD(modes, mask);
+ encp->enc_loopback_types[EFX_LINK_10000FDX] = modes;
+
+ if (req.emr_out_length_used >=
+ MC_CMD_GET_LOOPBACK_MODES_OUT_40G_OFST +
+ MC_CMD_GET_LOOPBACK_MODES_OUT_40G_LEN) {
+ /* Response includes 40G loopback modes */
+ modes =
+ *MCDI_OUT2(req, efx_qword_t, GET_LOOPBACK_MODES_OUT_40G);
+ EFX_AND_QWORD(modes, mask);
+ encp->enc_loopback_types[EFX_LINK_40000FDX] = modes;
+ }
+
+ EFX_ZERO_QWORD(modes);
+ EFX_SET_QWORD_BIT(modes, EFX_LOOPBACK_OFF);
+ EFX_OR_QWORD(modes, encp->enc_loopback_types[EFX_LINK_100FDX]);
+ EFX_OR_QWORD(modes, encp->enc_loopback_types[EFX_LINK_1000FDX]);
+ EFX_OR_QWORD(modes, encp->enc_loopback_types[EFX_LINK_10000FDX]);
+ EFX_OR_QWORD(modes, encp->enc_loopback_types[EFX_LINK_40000FDX]);
+ encp->enc_loopback_types[EFX_LINK_UNKNOWN] = modes;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+#endif /* EFSYS_OPT_LOOPBACK */
diff --git a/sys/dev/sfxge/common/efx_nvram.c b/sys/dev/sfxge/common/efx_nvram.c
index 2df9bb9..82bb1d9 100644
--- a/sys/dev/sfxge/common/efx_nvram.c
+++ b/sys/dev/sfxge/common/efx_nvram.c
@@ -1,26 +1,31 @@
/*-
- * Copyright 2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2009-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -36,7 +41,7 @@ __FBSDID("$FreeBSD$");
#if EFSYS_OPT_FALCON
-static efx_nvram_ops_t __cs __efx_nvram_falcon_ops = {
+static efx_nvram_ops_t __efx_nvram_falcon_ops = {
#if EFSYS_OPT_DIAG
falcon_nvram_test, /* envo_test */
#endif /* EFSYS_OPT_DIAG */
@@ -54,7 +59,7 @@ static efx_nvram_ops_t __cs __efx_nvram_falcon_ops = {
#if EFSYS_OPT_SIENA
-static efx_nvram_ops_t __cs __efx_nvram_siena_ops = {
+static efx_nvram_ops_t __efx_nvram_siena_ops = {
#if EFSYS_OPT_DIAG
siena_nvram_test, /* envo_test */
#endif /* EFSYS_OPT_DIAG */
@@ -70,6 +75,24 @@ static efx_nvram_ops_t __cs __efx_nvram_siena_ops = {
#endif /* EFSYS_OPT_SIENA */
+#if EFSYS_OPT_HUNTINGTON
+
+static efx_nvram_ops_t __efx_nvram_hunt_ops = {
+#if EFSYS_OPT_DIAG
+ hunt_nvram_test, /* envo_test */
+#endif /* EFSYS_OPT_DIAG */
+ hunt_nvram_size, /* envo_size */
+ hunt_nvram_get_version, /* envo_get_version */
+ hunt_nvram_rw_start, /* envo_rw_start */
+ hunt_nvram_read_chunk, /* envo_read_chunk */
+ hunt_nvram_erase, /* envo_erase */
+ hunt_nvram_write_chunk, /* envo_write_chunk */
+ hunt_nvram_rw_finish, /* envo_rw_finish */
+ hunt_nvram_set_version, /* envo_set_version */
+};
+
+#endif /* EFSYS_OPT_HUNTINGTON */
+
__checkReturn int
efx_nvram_init(
__in efx_nic_t *enp)
@@ -94,6 +117,12 @@ efx_nvram_init(
break;
#endif /* EFSYS_OPT_SIENA */
+#if EFSYS_OPT_HUNTINGTON
+ case EFX_FAMILY_HUNTINGTON:
+ envop = (efx_nvram_ops_t *)&__efx_nvram_hunt_ops;
+ break;
+#endif /* EFSYS_OPT_HUNTINGTON */
+
default:
EFSYS_ASSERT(0);
rc = ENOTSUP;
@@ -329,7 +358,7 @@ efx_nvram_rw_finish(
efx_nvram_set_version(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
- __out uint16_t version[4])
+ __in_ecount(4) uint16_t version[4])
{
efx_nvram_ops_t *envop = enp->en_envop;
int rc;
@@ -373,3 +402,486 @@ efx_nvram_fini(
}
#endif /* EFSYS_OPT_NVRAM */
+
+#if EFSYS_OPT_NVRAM || EFSYS_OPT_VPD
+
+/*
+ * Internal MCDI request handling
+ */
+
+ __checkReturn int
+efx_mcdi_nvram_partitions(
+ __in efx_nic_t *enp,
+ __out_bcount(size) caddr_t data,
+ __in size_t size,
+ __out unsigned int *npartnp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_NVRAM_PARTITIONS_IN_LEN,
+ MC_CMD_NVRAM_PARTITIONS_OUT_LENMAX)];
+ unsigned int npartn;
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_NVRAM_PARTITIONS;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_NVRAM_PARTITIONS_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_NVRAM_PARTITIONS_OUT_LENMAX;
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_NVRAM_PARTITIONS_OUT_LENMIN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+ npartn = MCDI_OUT_DWORD(req, NVRAM_PARTITIONS_OUT_NUM_PARTITIONS);
+
+ if (req.emr_out_length_used < MC_CMD_NVRAM_PARTITIONS_OUT_LEN(npartn)) {
+ rc = ENOENT;
+ goto fail3;
+ }
+
+ if (size < npartn * sizeof (uint32_t)) {
+ rc = ENOSPC;
+ goto fail3;
+ }
+
+ *npartnp = npartn;
+
+ memcpy(data,
+ MCDI_OUT2(req, uint32_t, NVRAM_PARTITIONS_OUT_TYPE_ID),
+ (npartn * sizeof (uint32_t)));
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+efx_mcdi_nvram_metadata(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __out uint32_t *subtypep,
+ __out_ecount(4) uint16_t version[4],
+ __out_bcount_opt(size) char *descp,
+ __in size_t size)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_NVRAM_METADATA_IN_LEN,
+ MC_CMD_NVRAM_METADATA_OUT_LENMAX)];
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_NVRAM_METADATA;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_NVRAM_METADATA_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_NVRAM_METADATA_OUT_LENMAX;
+
+ MCDI_IN_SET_DWORD(req, NVRAM_METADATA_IN_TYPE, partn);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_NVRAM_METADATA_OUT_LENMIN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ if (MCDI_OUT_DWORD_FIELD(req, NVRAM_METADATA_OUT_FLAGS,
+ NVRAM_METADATA_OUT_SUBTYPE_VALID)) {
+ *subtypep = MCDI_OUT_DWORD(req, NVRAM_METADATA_OUT_SUBTYPE);
+ } else {
+ *subtypep = 0;
+ }
+
+ if (MCDI_OUT_DWORD_FIELD(req, NVRAM_METADATA_OUT_FLAGS,
+ NVRAM_METADATA_OUT_VERSION_VALID)) {
+ version[0] = MCDI_OUT_WORD(req, NVRAM_METADATA_OUT_VERSION_W);
+ version[1] = MCDI_OUT_WORD(req, NVRAM_METADATA_OUT_VERSION_X);
+ version[2] = MCDI_OUT_WORD(req, NVRAM_METADATA_OUT_VERSION_Y);
+ version[3] = MCDI_OUT_WORD(req, NVRAM_METADATA_OUT_VERSION_Z);
+ } else {
+ version[0] = version[1] = version[2] = version[3] = 0;
+ }
+
+ if (MCDI_OUT_DWORD_FIELD(req, NVRAM_METADATA_OUT_FLAGS,
+ NVRAM_METADATA_OUT_DESCRIPTION_VALID)) {
+ /* Return optional descrition string */
+ if ((descp != NULL) && (size > 0)) {
+ size_t desclen;
+
+ descp[0] = '\0';
+ desclen = (req.emr_out_length_used
+ - MC_CMD_NVRAM_METADATA_OUT_LEN(0));
+
+ EFSYS_ASSERT3U(desclen, <=,
+ MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_MAXNUM);
+
+ if (size < desclen) {
+ rc = ENOSPC;
+ goto fail3;
+ }
+
+ memcpy(descp, MCDI_OUT2(req, char,
+ NVRAM_METADATA_OUT_DESCRIPTION),
+ desclen);
+
+ /* Ensure string is NUL terminated */
+ descp[desclen] = '\0';
+ }
+ }
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+efx_mcdi_nvram_info(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __out_opt size_t *sizep,
+ __out_opt uint32_t *addressp,
+ __out_opt uint32_t *erase_sizep)
+{
+ uint8_t payload[MAX(MC_CMD_NVRAM_INFO_IN_LEN,
+ MC_CMD_NVRAM_INFO_OUT_LEN)];
+ efx_mcdi_req_t req;
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_NVRAM_INFO;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_NVRAM_INFO_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_NVRAM_INFO_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, NVRAM_INFO_IN_TYPE, partn);
+
+ efx_mcdi_execute_quiet(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_NVRAM_INFO_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ if (sizep)
+ *sizep = MCDI_OUT_DWORD(req, NVRAM_INFO_OUT_SIZE);
+
+ if (addressp)
+ *addressp = MCDI_OUT_DWORD(req, NVRAM_INFO_OUT_PHYSADDR);
+
+ if (erase_sizep)
+ *erase_sizep = MCDI_OUT_DWORD(req, NVRAM_INFO_OUT_ERASESIZE);
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+efx_mcdi_nvram_update_start(
+ __in efx_nic_t *enp,
+ __in uint32_t partn)
+{
+ uint8_t payload[MAX(MC_CMD_NVRAM_UPDATE_START_IN_LEN,
+ MC_CMD_NVRAM_UPDATE_START_OUT_LEN)];
+ efx_mcdi_req_t req;
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_NVRAM_UPDATE_START;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_NVRAM_UPDATE_START_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_NVRAM_UPDATE_START_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, NVRAM_UPDATE_START_IN_TYPE, partn);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+efx_mcdi_nvram_read(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __in uint32_t offset,
+ __out_bcount(size) caddr_t data,
+ __in size_t size)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_NVRAM_READ_IN_LEN,
+ MC_CMD_NVRAM_READ_OUT_LENMAX)];
+ int rc;
+
+ if (size > MC_CMD_NVRAM_READ_OUT_LENMAX) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_NVRAM_READ;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_NVRAM_READ_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_NVRAM_READ_OUT_LENMAX;
+
+ MCDI_IN_SET_DWORD(req, NVRAM_READ_IN_TYPE, partn);
+ MCDI_IN_SET_DWORD(req, NVRAM_READ_IN_OFFSET, offset);
+ MCDI_IN_SET_DWORD(req, NVRAM_READ_IN_LENGTH, size);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_NVRAM_READ_OUT_LEN(size)) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ memcpy(data,
+ MCDI_OUT2(req, uint8_t, NVRAM_READ_OUT_READ_BUFFER),
+ size);
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+efx_mcdi_nvram_erase(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __in uint32_t offset,
+ __in size_t size)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_NVRAM_ERASE_IN_LEN,
+ MC_CMD_NVRAM_ERASE_OUT_LEN)];
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_NVRAM_ERASE;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_NVRAM_ERASE_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_NVRAM_ERASE_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, NVRAM_ERASE_IN_TYPE, partn);
+ MCDI_IN_SET_DWORD(req, NVRAM_ERASE_IN_OFFSET, offset);
+ MCDI_IN_SET_DWORD(req, NVRAM_ERASE_IN_LENGTH, size);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+efx_mcdi_nvram_write(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __in uint32_t offset,
+ __out_bcount(size) caddr_t data,
+ __in size_t size)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_NVRAM_WRITE_IN_LENMAX,
+ MC_CMD_NVRAM_WRITE_OUT_LEN)];
+ int rc;
+
+ if (size > MC_CMD_NVRAM_WRITE_IN_LENMAX) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_NVRAM_WRITE;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_NVRAM_WRITE_IN_LEN(size);
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_NVRAM_WRITE_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, NVRAM_WRITE_IN_TYPE, partn);
+ MCDI_IN_SET_DWORD(req, NVRAM_WRITE_IN_OFFSET, offset);
+ MCDI_IN_SET_DWORD(req, NVRAM_WRITE_IN_LENGTH, size);
+
+ memcpy(MCDI_IN2(req, uint8_t, NVRAM_WRITE_IN_WRITE_BUFFER),
+ data, size);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail2;
+ }
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+efx_mcdi_nvram_update_finish(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __in boolean_t reboot)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_NVRAM_UPDATE_FINISH_IN_LEN,
+ MC_CMD_NVRAM_UPDATE_FINISH_OUT_LEN)];
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_NVRAM_UPDATE_FINISH;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_NVRAM_UPDATE_FINISH_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_NVRAM_UPDATE_FINISH_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, NVRAM_UPDATE_FINISH_IN_TYPE, partn);
+ MCDI_IN_SET_DWORD(req, NVRAM_UPDATE_FINISH_IN_REBOOT, reboot);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+#if EFSYS_OPT_DIAG
+
+ __checkReturn int
+efx_mcdi_nvram_test(
+ __in efx_nic_t *enp,
+ __in uint32_t partn)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_NVRAM_TEST_IN_LEN,
+ MC_CMD_NVRAM_TEST_OUT_LEN)];
+ int result;
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_NVRAM_TEST;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_NVRAM_TEST_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_NVRAM_TEST_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, NVRAM_TEST_IN_TYPE, partn);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_NVRAM_TEST_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ result = MCDI_OUT_DWORD(req, NVRAM_TEST_OUT_RESULT);
+ if (result == MC_CMD_NVRAM_TEST_FAIL) {
+
+ EFSYS_PROBE1(nvram_test_failure, int, partn);
+
+ rc = (EINVAL);
+ goto fail3;
+ }
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+#endif /* EFSYS_OPT_DIAG */
+
+
+#endif /* EFSYS_OPT_NVRAM || EFSYS_OPT_VPD */
diff --git a/sys/dev/sfxge/common/efx_phy.c b/sys/dev/sfxge/common/efx_phy.c
index bb34ea7..5d18dc7 100644
--- a/sys/dev/sfxge/common/efx_phy.c
+++ b/sys/dev/sfxge/common/efx_phy.c
@@ -1,26 +1,31 @@
/*-
- * Copyright 2007-2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2007-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -68,7 +73,7 @@ __FBSDID("$FreeBSD$");
#endif
#if EFSYS_OPT_PHY_NULL
-static efx_phy_ops_t __cs __efx_phy_null_ops = {
+static efx_phy_ops_t __efx_phy_null_ops = {
NULL, /* epo_power */
nullphy_reset, /* epo_reset */
nullphy_reconfigure, /* epo_reconfigure */
@@ -86,16 +91,17 @@ static efx_phy_ops_t __cs __efx_phy_null_ops = {
nullphy_prop_get, /* epo_prop_get */
nullphy_prop_set, /* epo_prop_set */
#endif /* EFSYS_OPT_PHY_PROPS */
-#if EFSYS_OPT_PHY_BIST
+#if EFSYS_OPT_BIST
+ NULL, /* epo_bist_enable_offline */
NULL, /* epo_bist_start */
NULL, /* epo_bist_poll */
NULL, /* epo_bist_stop */
-#endif /* EFSYS_OPT_PHY_BIST */
+#endif /* EFSYS_OPT_BIST */
};
#endif /* EFSYS_OPT_PHY_NULL */
#if EFSYS_OPT_PHY_QT2022C2
-static efx_phy_ops_t __cs __efx_phy_qt2022c2_ops = {
+static efx_phy_ops_t __efx_phy_qt2022c2_ops = {
NULL, /* epo_power */
qt2022c2_reset, /* epo_reset */
qt2022c2_reconfigure, /* epo_reconfigure */
@@ -113,16 +119,17 @@ static efx_phy_ops_t __cs __efx_phy_qt2022c2_ops = {
qt2022c2_prop_get, /* epo_prop_get */
qt2022c2_prop_set, /* epo_prop_set */
#endif /* EFSYS_OPT_PHY_PROPS */
-#if EFSYS_OPT_PHY_BIST
+#if EFSYS_OPT_BIST
+ NULL, /* epo_bist_enable_offline */
NULL, /* epo_bist_start */
NULL, /* epo_bist_poll */
NULL, /* epo_bist_stop */
-#endif /* EFSYS_OPT_PHY_BIST */
+#endif /* EFSYS_OPT_BIST */
};
#endif /* EFSYS_OPT_PHY_QT2022C2 */
#if EFSYS_OPT_PHY_SFX7101
-static efx_phy_ops_t __cs __efx_phy_sfx7101_ops = {
+static efx_phy_ops_t __efx_phy_sfx7101_ops = {
sfx7101_power, /* epo_power */
sfx7101_reset, /* epo_reset */
sfx7101_reconfigure, /* epo_reconfigure */
@@ -140,16 +147,17 @@ static efx_phy_ops_t __cs __efx_phy_sfx7101_ops = {
sfx7101_prop_get, /* epo_prop_get */
sfx7101_prop_set, /* epo_prop_set */
#endif /* EFSYS_OPT_PHY_PROPS */
-#if EFSYS_OPT_PHY_BIST
+#if EFSYS_OPT_BIST
+ NULL, /* epo_bist_enable_offline */
NULL, /* epo_bist_start */
NULL, /* epo_bist_poll */
NULL, /* epo_bist_stop */
-#endif /* EFSYS_OPT_PHY_BIST */
+#endif /* EFSYS_OPT_BIST */
};
#endif /* EFSYS_OPT_PHY_SFX7101 */
#if EFSYS_OPT_PHY_TXC43128
-static efx_phy_ops_t __cs __efx_phy_txc43128_ops = {
+static efx_phy_ops_t __efx_phy_txc43128_ops = {
NULL, /* epo_power */
txc43128_reset, /* epo_reset */
txc43128_reconfigure, /* epo_reconfigure */
@@ -167,16 +175,17 @@ static efx_phy_ops_t __cs __efx_phy_txc43128_ops = {
txc43128_prop_get, /* epo_prop_get */
txc43128_prop_set, /* epo_prop_set */
#endif /* EFSYS_OPT_PHY_PROPS */
-#if EFSYS_OPT_PHY_BIST
+#if EFSYS_OPT_BIST
+ NULL, /* epo_bist_enable_offline */
NULL, /* epo_bist_start */
NULL, /* epo_bist_poll */
NULL, /* epo_bist_stop */
-#endif /* EFSYS_OPT_PHY_BIST */
+#endif /* EFSYS_OPT_BIST */
};
#endif /* EFSYS_OPT_PHY_TXC43128 */
#if EFSYS_OPT_PHY_SFT9001
-static efx_phy_ops_t __cs __efx_phy_sft9001_ops = {
+static efx_phy_ops_t __efx_phy_sft9001_ops = {
NULL, /* epo_power */
sft9001_reset, /* epo_reset */
sft9001_reconfigure, /* epo_reconfigure */
@@ -194,16 +203,17 @@ static efx_phy_ops_t __cs __efx_phy_sft9001_ops = {
sft9001_prop_get, /* epo_prop_get */
sft9001_prop_set, /* epo_prop_set */
#endif /* EFSYS_OPT_PHY_PROPS */
-#if EFSYS_OPT_PHY_BIST
+#if EFSYS_OPT_BIST
+ NULL, /* epo_bist_enable_offline */
sft9001_bist_start, /* epo_bist_start */
sft9001_bist_poll, /* epo_bist_poll */
sft9001_bist_stop, /* epo_bist_stop */
-#endif /* EFSYS_OPT_PHY_BIST */
+#endif /* EFSYS_OPT_BIST */
};
#endif /* EFSYS_OPT_PHY_SFT9001 */
#if EFSYS_OPT_PHY_QT2025C
-static efx_phy_ops_t __cs __efx_phy_qt2025c_ops = {
+static efx_phy_ops_t __efx_phy_qt2025c_ops = {
NULL, /* epo_power */
qt2025c_reset, /* epo_reset */
qt2025c_reconfigure, /* epo_reconfigure */
@@ -221,16 +231,17 @@ static efx_phy_ops_t __cs __efx_phy_qt2025c_ops = {
qt2025c_prop_get, /* epo_prop_get */
qt2025c_prop_set, /* epo_prop_set */
#endif /* EFSYS_OPT_PHY_PROPS */
-#if EFSYS_OPT_PHY_BIST
+#if EFSYS_OPT_BIST
+ NULL, /* epo_bist_enable_offline */
NULL, /* epo_bist_start */
NULL, /* epo_bist_poll */
NULL, /* epo_bist_stop */
-#endif /* EFSYS_OPT_PHY_BIST */
+#endif /* EFSYS_OPT_BIST */
};
#endif /* EFSYS_OPT_PHY_QT2025C */
#if EFSYS_OPT_SIENA
-static efx_phy_ops_t __cs __efx_phy_siena_ops = {
+static efx_phy_ops_t __efx_phy_siena_ops = {
siena_phy_power, /* epo_power */
NULL, /* epo_reset */
siena_phy_reconfigure, /* epo_reconfigure */
@@ -248,14 +259,43 @@ static efx_phy_ops_t __cs __efx_phy_siena_ops = {
siena_phy_prop_get, /* epo_prop_get */
siena_phy_prop_set, /* epo_prop_set */
#endif /* EFSYS_OPT_PHY_PROPS */
-#if EFSYS_OPT_PHY_BIST
+#if EFSYS_OPT_BIST
+ NULL, /* epo_bist_enable_offline */
siena_phy_bist_start, /* epo_bist_start */
siena_phy_bist_poll, /* epo_bist_poll */
siena_phy_bist_stop, /* epo_bist_stop */
-#endif /* EFSYS_OPT_PHY_BIST */
+#endif /* EFSYS_OPT_BIST */
};
#endif /* EFSYS_OPT_SIENA */
+#if EFSYS_OPT_HUNTINGTON
+static efx_phy_ops_t __efx_phy_hunt_ops = {
+ hunt_phy_power, /* epo_power */
+ NULL, /* epo_reset */
+ hunt_phy_reconfigure, /* epo_reconfigure */
+ hunt_phy_verify, /* epo_verify */
+ NULL, /* epo_uplink_check */
+ NULL, /* epo_downlink_check */
+ hunt_phy_oui_get, /* epo_oui_get */
+#if EFSYS_OPT_PHY_STATS
+ hunt_phy_stats_update, /* epo_stats_update */
+#endif /* EFSYS_OPT_PHY_STATS */
+#if EFSYS_OPT_PHY_PROPS
+#if EFSYS_OPT_NAMES
+ hunt_phy_prop_name, /* epo_prop_name */
+#endif
+ hunt_phy_prop_get, /* epo_prop_get */
+ hunt_phy_prop_set, /* epo_prop_set */
+#endif /* EFSYS_OPT_PHY_PROPS */
+#if EFSYS_OPT_BIST
+ hunt_bist_enable_offline, /* epo_bist_enable_offline */
+ hunt_bist_start, /* epo_bist_start */
+ hunt_bist_poll, /* epo_bist_poll */
+ hunt_bist_stop, /* epo_bist_stop */
+#endif /* EFSYS_OPT_BIST */
+};
+#endif /* EFSYS_OPT_HUNTINGTON */
+
__checkReturn int
efx_phy_probe(
__in efx_nic_t *enp)
@@ -317,6 +357,11 @@ efx_phy_probe(
epop = (efx_phy_ops_t *)&__efx_phy_siena_ops;
break;
#endif /* EFSYS_OPT_SIENA */
+#if EFSYS_OPT_HUNTINGTON
+ case EFX_FAMILY_HUNTINGTON:
+ epop = (efx_phy_ops_t *)&__efx_phy_hunt_ops;
+ break;
+#endif /* EFSYS_OPT_HUNTINGTON */
default:
rc = ENOTSUP;
goto fail1;
@@ -516,8 +561,8 @@ efx_phy_media_type_get(
#if EFSYS_OPT_NAMES
-/* START MKCONFIG GENERATED PhyStatNamesBlock 271268f3da0e804f */
-static const char __cs * __cs __efx_phy_stat_name[] = {
+/* START MKCONFIG GENERATED PhyStatNamesBlock d5f79b4bc2c050fe */
+static const char *__efx_phy_stat_name[] = {
"oui",
"pma_pmd_link_up",
"pma_pmd_rx_fault",
@@ -568,7 +613,7 @@ static const char __cs * __cs __efx_phy_stat_name[] = {
/* END MKCONFIG GENERATED PhyStatNamesBlock */
- const char __cs *
+ const char *
efx_phy_stat_name(
__in efx_nic_t *enp,
__in efx_phy_stat_t type)
@@ -602,7 +647,7 @@ efx_phy_stats_update(
#if EFSYS_OPT_PHY_PROPS
#if EFSYS_OPT_NAMES
- const char __cs *
+ const char *
efx_phy_prop_name(
__in efx_nic_t *enp,
__in unsigned int id)
@@ -649,23 +694,51 @@ efx_phy_prop_set(
}
#endif /* EFSYS_OPT_PHY_STATS */
-#if EFSYS_OPT_PHY_BIST
+#if EFSYS_OPT_BIST
+
+ __checkReturn int
+efx_bist_enable_offline(
+ __in efx_nic_t *enp)
+{
+ efx_port_t *epp = &(enp->en_port);
+ efx_phy_ops_t *epop = epp->ep_epop;
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+
+ if (epop->epo_bist_enable_offline == NULL) {
+ rc = ENOTSUP;
+ goto fail1;
+ }
+
+ if ((rc = epop->epo_bist_enable_offline(enp)) != 0)
+ goto fail2;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+
+}
__checkReturn int
-efx_phy_bist_start(
+efx_bist_start(
__in efx_nic_t *enp,
- __in efx_phy_bist_type_t type)
+ __in efx_bist_type_t type)
{
efx_port_t *epp = &(enp->en_port);
efx_phy_ops_t *epop = epp->ep_epop;
int rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
- EFSYS_ASSERT3U(type, !=, EFX_PHY_BIST_TYPE_UNKNOWN);
- EFSYS_ASSERT3U(type, <, EFX_PHY_BIST_TYPE_NTYPES);
- EFSYS_ASSERT3U(epp->ep_current_bist, ==, EFX_PHY_BIST_TYPE_UNKNOWN);
+ EFSYS_ASSERT3U(type, !=, EFX_BIST_TYPE_UNKNOWN);
+ EFSYS_ASSERT3U(type, <, EFX_BIST_TYPE_NTYPES);
+ EFSYS_ASSERT3U(epp->ep_current_bist, ==, EFX_BIST_TYPE_UNKNOWN);
if (epop->epo_bist_start == NULL) {
rc = ENOTSUP;
@@ -688,10 +761,10 @@ fail1:
}
__checkReturn int
-efx_phy_bist_poll(
+efx_bist_poll(
__in efx_nic_t *enp,
- __in efx_phy_bist_type_t type,
- __out efx_phy_bist_result_t *resultp,
+ __in efx_bist_type_t type,
+ __out efx_bist_result_t *resultp,
__out_opt uint32_t *value_maskp,
__out_ecount_opt(count) unsigned long *valuesp,
__in size_t count)
@@ -701,10 +774,9 @@ efx_phy_bist_poll(
int rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
- EFSYS_ASSERT3U(type, !=, EFX_PHY_BIST_TYPE_UNKNOWN);
- EFSYS_ASSERT3U(type, <, EFX_PHY_BIST_TYPE_NTYPES);
+ EFSYS_ASSERT3U(type, !=, EFX_BIST_TYPE_UNKNOWN);
+ EFSYS_ASSERT3U(type, <, EFX_BIST_TYPE_NTYPES);
EFSYS_ASSERT3U(epp->ep_current_bist, ==, type);
EFSYS_ASSERT(epop->epo_bist_poll != NULL);
@@ -728,18 +800,17 @@ fail1:
}
void
-efx_phy_bist_stop(
+efx_bist_stop(
__in efx_nic_t *enp,
- __in efx_phy_bist_type_t type)
+ __in efx_bist_type_t type)
{
efx_port_t *epp = &(enp->en_port);
efx_phy_ops_t *epop = epp->ep_epop;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
- EFSYS_ASSERT3U(type, !=, EFX_PHY_BIST_TYPE_UNKNOWN);
- EFSYS_ASSERT3U(type, <, EFX_PHY_BIST_TYPE_NTYPES);
+ EFSYS_ASSERT3U(type, !=, EFX_BIST_TYPE_UNKNOWN);
+ EFSYS_ASSERT3U(type, <, EFX_BIST_TYPE_NTYPES);
EFSYS_ASSERT3U(epp->ep_current_bist, ==, type);
EFSYS_ASSERT(epop->epo_bist_stop != NULL);
@@ -747,10 +818,10 @@ efx_phy_bist_stop(
if (epop->epo_bist_stop != NULL)
epop->epo_bist_stop(enp, type);
- epp->ep_current_bist = EFX_PHY_BIST_TYPE_UNKNOWN;
+ epp->ep_current_bist = EFX_BIST_TYPE_UNKNOWN;
}
-#endif /* EFSYS_OPT_PHY_BIST */
+#endif /* EFSYS_OPT_BIST */
void
efx_phy_unprobe(
__in efx_nic_t *enp)
diff --git a/sys/dev/sfxge/common/efx_phy_ids.h b/sys/dev/sfxge/common/efx_phy_ids.h
new file mode 100644
index 0000000..e062519
--- /dev/null
+++ b/sys/dev/sfxge/common/efx_phy_ids.h
@@ -0,0 +1,53 @@
+/*-
+ * Copyright (c) 2013-2015 Solarflare Communications Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _SYS_EFX_PHY_IDS_H
+#define _SYS_EFX_PHY_IDS_H
+
+#define EFX_PHY_NULL 0
+
+typedef enum efx_phy_type_e { /* GENERATED BY scripts/genfwdef */
+ EFX_PHY_TXC43128 = 1,
+ EFX_PHY_SFX7101 = 3,
+ EFX_PHY_QT2022C2 = 4,
+ EFX_PHY_PM8358 = 6,
+ EFX_PHY_SFT9001A = 8,
+ EFX_PHY_QT2025C = 9,
+ EFX_PHY_SFT9001B = 10,
+ EFX_PHY_QLX111V = 12,
+ EFX_PHY_QT2025_KR = 17,
+ EFX_PHY_AEL3020 = 18,
+ EFX_PHY_XFI_FARMI = 19,
+} efx_phy_type_t;
+
+
+#endif /* _SYS_EFX_PHY_IDS_H */
diff --git a/sys/dev/sfxge/common/efx_port.c b/sys/dev/sfxge/common/efx_port.c
index 0b67d06..a750c15 100644
--- a/sys/dev/sfxge/common/efx_port.c
+++ b/sys/dev/sfxge/common/efx_port.c
@@ -1,26 +1,31 @@
/*-
- * Copyright 2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2009-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -61,6 +66,9 @@ efx_port_init(
epp->ep_emop->emo_reconfigure(enp);
+ /* Pick up current phy capababilities */
+ efx_port_poll(enp, NULL);
+
/*
* Turn on the PHY if available, otherwise reset it, and
* reconfigure it with the current configuration.
@@ -96,7 +104,7 @@ fail1:
__checkReturn int
efx_port_poll(
__in efx_nic_t *enp,
- __out efx_link_mode_t *link_modep)
+ __out_opt efx_link_mode_t *link_modep)
{
efx_port_t *epp = &(enp->en_port);
efx_mac_ops_t *emop = epp->ep_emop;
@@ -141,7 +149,9 @@ efx_port_loopback_set(
EFSYS_ASSERT(emop != NULL);
EFSYS_ASSERT(link_mode < EFX_LINK_NMODES);
- if ((1 << loopback_type) & ~encp->enc_loopback_types[link_mode]) {
+
+ if (EFX_TEST_QWORD_BIT(encp->enc_loopback_types[link_mode],
+ loopback_type) == 0) {
rc = ENOTSUP;
goto fail1;
}
@@ -165,7 +175,7 @@ fail1:
#if EFSYS_OPT_NAMES
-static const char __cs * __cs __efx_loopback_type_name[] = {
+static const char *__efx_loopback_type_name[] = {
"OFF",
"DATA",
"GMAC",
@@ -184,13 +194,33 @@ static const char __cs * __cs __efx_loopback_type_name[] = {
"PHY_XS",
"PCS",
"PMA_PMD",
+ "XPORT",
+ "XGMII_WS",
+ "XAUI_WS",
+ "XAUI_WS_FAR",
+ "XAUI_WS_NEAR",
+ "GMII_WS",
+ "XFI_WS",
+ "XFI_WS_FAR",
+ "PHYXS_WS",
+ "PMA_INT",
+ "SD_NEAR",
+ "SD_FAR",
+ "PMA_INT_WS",
+ "SD_FEP2_WS",
+ "SD_FEP1_5_WS",
+ "SD_FEP_WS",
+ "SD_FES_WS",
};
- __checkReturn const char __cs *
+ __checkReturn const char *
efx_loopback_type_name(
__in efx_nic_t *enp,
__in efx_loopback_type_t type)
{
+ EFX_STATIC_ASSERT(EFX_ARRAY_SIZE(__efx_loopback_type_name) ==
+ EFX_LOOPBACK_NTYPES);
+
_NOTE(ARGUNUSED(enp))
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(type, <, EFX_LOOPBACK_NTYPES);
diff --git a/sys/dev/sfxge/common/efx_regs.h b/sys/dev/sfxge/common/efx_regs.h
index 4019663..5ece431 100644
--- a/sys/dev/sfxge/common/efx_regs.h
+++ b/sys/dev/sfxge/common/efx_regs.h
@@ -1,26 +1,31 @@
/*-
- * Copyright 2007-2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2007-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*
* $FreeBSD$
*/
@@ -3854,7 +3859,7 @@ extern "C" {
*/
-#define FR_AZ_TX_PACE_TBL_OFST FR_BZ_TX_PACE_TBL_OFST
+#define FR_AZ_TX_PACE_TBL_OFST FR_BZ_TX_PACE_TBL_OFST
#ifdef __cplusplus
diff --git a/sys/dev/sfxge/common/efx_regs_ef10.h b/sys/dev/sfxge/common/efx_regs_ef10.h
index c4a6d0e..8401726 100644
--- a/sys/dev/sfxge/common/efx_regs_ef10.h
+++ b/sys/dev/sfxge/common/efx_regs_ef10.h
@@ -1,26 +1,31 @@
/*-
- * Copyright 2007-2010 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2007-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*
* $FreeBSD$
*/
@@ -34,11 +39,13 @@ extern "C" {
/*
* BIU_HW_REV_ID_REG(32bit):
- *
+ *
*/
-#define ER_DZ_BIU_HW_REV_ID_REG 0x00000000
+#define ER_DZ_BIU_HW_REV_ID_REG_OFST 0x00000000
/* hunta0=pcie_pf_bar2 */
+#define ER_DZ_BIU_HW_REV_ID_REG_RESET 0xeb14face
+
#define ERF_DZ_HW_REV_ID_LBN 0
#define ERF_DZ_HW_REV_ID_WIDTH 32
@@ -46,13 +53,15 @@ extern "C" {
/*
* BIU_MC_SFT_STATUS_REG(32bit):
- *
+ *
*/
-#define ER_DZ_BIU_MC_SFT_STATUS_REG 0x00000010
+#define ER_DZ_BIU_MC_SFT_STATUS_REG_OFST 0x00000010
/* hunta0=pcie_pf_bar2 */
#define ER_DZ_BIU_MC_SFT_STATUS_REG_STEP 4
#define ER_DZ_BIU_MC_SFT_STATUS_REG_ROWS 8
+#define ER_DZ_BIU_MC_SFT_STATUS_REG_RESET 0x1111face
+
#define ERF_DZ_MC_SFT_STATUS_LBN 0
#define ERF_DZ_MC_SFT_STATUS_WIDTH 32
@@ -60,11 +69,13 @@ extern "C" {
/*
* BIU_INT_ISR_REG(32bit):
- *
+ *
*/
-#define ER_DZ_BIU_INT_ISR_REG 0x00000090
+#define ER_DZ_BIU_INT_ISR_REG_OFST 0x00000090
/* hunta0=pcie_pf_bar2 */
+#define ER_DZ_BIU_INT_ISR_REG_RESET 0x0
+
#define ERF_DZ_ISR_REG_LBN 0
#define ERF_DZ_ISR_REG_WIDTH 32
@@ -72,11 +83,13 @@ extern "C" {
/*
* MC_DB_LWRD_REG(32bit):
- *
+ *
*/
-#define ER_DZ_MC_DB_LWRD_REG 0x00000200
+#define ER_DZ_MC_DB_LWRD_REG_OFST 0x00000200
/* hunta0=pcie_pf_bar2 */
+#define ER_DZ_MC_DB_LWRD_REG_RESET 0x0
+
#define ERF_DZ_MC_DOORBELL_L_LBN 0
#define ERF_DZ_MC_DOORBELL_L_WIDTH 32
@@ -84,11 +97,13 @@ extern "C" {
/*
* MC_DB_HWRD_REG(32bit):
- *
+ *
*/
-#define ER_DZ_MC_DB_HWRD_REG 0x00000204
+#define ER_DZ_MC_DB_HWRD_REG_OFST 0x00000204
/* hunta0=pcie_pf_bar2 */
+#define ER_DZ_MC_DB_HWRD_REG_RESET 0x0
+
#define ERF_DZ_MC_DOORBELL_H_LBN 0
#define ERF_DZ_MC_DOORBELL_H_WIDTH 32
@@ -96,13 +111,15 @@ extern "C" {
/*
* EVQ_RPTR_REG(32bit):
- *
+ *
*/
-#define ER_DZ_EVQ_RPTR_REG 0x00000400
+#define ER_DZ_EVQ_RPTR_REG_OFST 0x00000400
/* hunta0=pcie_pf_bar2 */
-#define ER_DZ_EVQ_RPTR_REG_STEP 4096
+#define ER_DZ_EVQ_RPTR_REG_STEP 8192
#define ER_DZ_EVQ_RPTR_REG_ROWS 2048
+#define ER_DZ_EVQ_RPTR_REG_RESET 0x0
+
#define ERF_DZ_EVQ_RPTR_VLD_LBN 15
#define ERF_DZ_EVQ_RPTR_VLD_WIDTH 1
@@ -112,13 +129,15 @@ extern "C" {
/*
* EVQ_TMR_REG(32bit):
- *
+ *
*/
-#define ER_DZ_EVQ_TMR_REG 0x00000420
+#define ER_DZ_EVQ_TMR_REG_OFST 0x00000420
/* hunta0=pcie_pf_bar2 */
-#define ER_DZ_EVQ_TMR_REG_STEP 4096
+#define ER_DZ_EVQ_TMR_REG_STEP 8192
#define ER_DZ_EVQ_TMR_REG_ROWS 2048
+#define ER_DZ_EVQ_TMR_REG_RESET 0x0
+
#define ERF_DZ_TC_TIMER_MODE_LBN 14
#define ERF_DZ_TC_TIMER_MODE_WIDTH 2
@@ -128,28 +147,34 @@ extern "C" {
/*
* RX_DESC_UPD_REG(32bit):
- *
+ *
*/
-#define ER_DZ_RX_DESC_UPD_REG 0x00000830
+#define ER_DZ_RX_DESC_UPD_REG_OFST 0x00000830
/* hunta0=pcie_pf_bar2 */
-#define ER_DZ_RX_DESC_UPD_REG_STEP 4096
+#define ER_DZ_RX_DESC_UPD_REG_STEP 8192
#define ER_DZ_RX_DESC_UPD_REG_ROWS 2048
+#define ER_DZ_RX_DESC_UPD_REG_RESET 0x0
+
#define ERF_DZ_RX_DESC_WPTR_LBN 0
#define ERF_DZ_RX_DESC_WPTR_WIDTH 12
/*
- * TX_DESC_UPD_REG(76bit):
- *
+ * TX_DESC_UPD_REG(96bit):
+ *
*/
-#define ER_DZ_TX_DESC_UPD_REG 0x00000a10
+#define ER_DZ_TX_DESC_UPD_REG_OFST 0x00000a10
/* hunta0=pcie_pf_bar2 */
-#define ER_DZ_TX_DESC_UPD_REG_STEP 4096
+#define ER_DZ_TX_DESC_UPD_REG_STEP 8192
#define ER_DZ_TX_DESC_UPD_REG_ROWS 2048
+#define ER_DZ_TX_DESC_UPD_REG_RESET 0x0
+
+#define ERF_DZ_RSVD_LBN 76
+#define ERF_DZ_RSVD_WIDTH 20
#define ERF_DZ_TX_DESC_WPTR_LBN 64
#define ERF_DZ_TX_DESC_WPTR_WIDTH 12
#define ERF_DZ_TX_DESC_HWORD_LBN 32
@@ -157,14 +182,38 @@ extern "C" {
#define ERF_DZ_TX_DESC_LWORD_LBN 0
#define ERF_DZ_TX_DESC_LWORD_WIDTH 32
+/*
+ * The workaround for bug 35388 requires multiplexing writes through
+ * the ERF_DZ_TX_DESC_WPTR address.
+ * TX_DESC_UPD: 0ppppppppppp (bit 11 lost)
+ * EVQ_RPTR: 1000hhhhhhhh, 1001llllllll (split into high and low bits)
+ * EVQ_TMR: 11mmvvvvvvvv (bits 8:13 of value lost)
+ */
+#define ER_DD_EVQ_INDIRECT_OFST (ER_DZ_TX_DESC_UPD_REG_OFST + 2 * 4)
+#define ER_DD_EVQ_INDIRECT_STEP ER_DZ_TX_DESC_UPD_REG_STEP
+#define ERF_DD_EVQ_IND_RPTR_FLAGS_LBN 8
+#define ERF_DD_EVQ_IND_RPTR_FLAGS_WIDTH 4
+#define EFE_DD_EVQ_IND_RPTR_FLAGS_HIGH 8
+#define EFE_DD_EVQ_IND_RPTR_FLAGS_LOW 9
+#define ERF_DD_EVQ_IND_RPTR_LBN 0
+#define ERF_DD_EVQ_IND_RPTR_WIDTH 8
+#define ERF_DD_EVQ_IND_TIMER_FLAGS_LBN 10
+#define ERF_DD_EVQ_IND_TIMER_FLAGS_WIDTH 2
+#define EFE_DD_EVQ_IND_TIMER_FLAGS 3
+#define ERF_DD_EVQ_IND_TIMER_MODE_LBN 8
+#define ERF_DD_EVQ_IND_TIMER_MODE_WIDTH 2
+#define ERF_DD_EVQ_IND_TIMER_VAL_LBN 0
+#define ERF_DD_EVQ_IND_TIMER_VAL_WIDTH 8
+
/* ES_DRIVER_EV */
#define ESF_DZ_DRV_CODE_LBN 60
#define ESF_DZ_DRV_CODE_WIDTH 4
#define ESF_DZ_DRV_SUB_CODE_LBN 56
#define ESF_DZ_DRV_SUB_CODE_WIDTH 4
-#define ESE_DZ_DRV_TIMER_EV 10
-#define ESE_DZ_DRV_WAKE_UP_EV 6
+#define ESE_DZ_DRV_TIMER_EV 3
+#define ESE_DZ_DRV_START_UP_EV 2
+#define ESE_DZ_DRV_WAKE_UP_EV 1
#define ESF_DZ_DRV_SUB_DATA_DW0_LBN 0
#define ESF_DZ_DRV_SUB_DATA_DW0_WIDTH 32
#define ESF_DZ_DRV_SUB_DATA_DW1_LBN 32
@@ -194,9 +243,9 @@ extern "C" {
/* ES_FF_UMSG_CPU2DL_DESC_FETCH */
-#define ESF_DZ_C2DDF_DSCR_CACHE_RPTR_LBN 112
+#define ESF_DZ_C2DDF_DSCR_CACHE_RPTR_LBN 208
#define ESF_DZ_C2DDF_DSCR_CACHE_RPTR_WIDTH 6
-#define ESF_DZ_C2DDF_QID_LBN 96
+#define ESF_DZ_C2DDF_QID_LBN 160
#define ESF_DZ_C2DDF_QID_WIDTH 11
#define ESF_DZ_C2DDF_DSCR_BASE_PAGE_ID_LBN 64
#define ESF_DZ_C2DDF_DSCR_BASE_PAGE_ID_WIDTH 18
@@ -217,16 +266,16 @@ extern "C" {
/* ES_FF_UMSG_CPU2DL_DESC_PUSH */
+#define ESF_DZ_C2DDP_DSCR_HW_RPTR_LBN 224
+#define ESF_DZ_C2DDP_DSCR_HW_RPTR_WIDTH 12
#define ESF_DZ_C2DDP_DESC_DW0_LBN 128
#define ESF_DZ_C2DDP_DESC_DW0_WIDTH 32
#define ESF_DZ_C2DDP_DESC_DW1_LBN 160
#define ESF_DZ_C2DDP_DESC_DW1_WIDTH 32
#define ESF_DZ_C2DDP_DESC_LBN 128
#define ESF_DZ_C2DDP_DESC_WIDTH 64
-#define ESF_DZ_C2DDP_QID_LBN 96
+#define ESF_DZ_C2DDP_QID_LBN 64
#define ESF_DZ_C2DDP_QID_WIDTH 11
-#define ESF_DZ_C2DDP_DSCR_HW_RPTR_LBN 48
-#define ESF_DZ_C2DDP_DSCR_HW_RPTR_WIDTH 12
#define ESF_DZ_C2DDP_DSCR_HW_WPTR_LBN 32
#define ESF_DZ_C2DDP_DSCR_HW_WPTR_WIDTH 12
#define ESF_DZ_C2DDP_OID_LBN 16
@@ -258,8 +307,18 @@ extern "C" {
/* ES_FF_UMSG_CPU2EV_TXCMPLT */
-#define ESF_DZ_C2ET_EV_SOFT0_LBN 32
-#define ESF_DZ_C2ET_EV_SOFT0_WIDTH 16
+#define ESF_DZ_C2ET_EV_SOFT2_LBN 48
+#define ESF_DZ_C2ET_EV_SOFT2_WIDTH 16
+#define ESF_DZ_C2ET_EV_CODE_LBN 42
+#define ESF_DZ_C2ET_EV_CODE_WIDTH 4
+#define ESF_DZ_C2ET_EV_OVERRIDE_HOLDOFF_LBN 41
+#define ESF_DZ_C2ET_EV_OVERRIDE_HOLDOFF_WIDTH 1
+#define ESF_DZ_C2ET_EV_DROP_EVENT_LBN 40
+#define ESF_DZ_C2ET_EV_DROP_EVENT_WIDTH 1
+#define ESF_DZ_C2ET_EV_CAN_MERGE_LBN 39
+#define ESF_DZ_C2ET_EV_CAN_MERGE_WIDTH 1
+#define ESF_DZ_C2ET_EV_SOFT1_LBN 32
+#define ESF_DZ_C2ET_EV_SOFT1_WIDTH 7
#define ESF_DZ_C2ET_DSCR_IDX_LBN 16
#define ESF_DZ_C2ET_DSCR_IDX_WIDTH 16
#define ESF_DZ_C2ET_EV_QID_LBN 5
@@ -310,7 +369,6 @@ extern "C" {
#define ESF_DZ_C2RIP_EV_ARG1_WIDTH 16
#define ESF_DZ_C2RIP_UPD_CRC_MODE_LBN 157
#define ESF_DZ_C2RIP_UPD_CRC_MODE_WIDTH 3
-#define ESE_DZ_C2RIP_FCOIP_MPA 5
#define ESE_DZ_C2RIP_FCOIP_FCOE 4
#define ESE_DZ_C2RIP_ISCSI_HDR_AND_PYLD 3
#define ESE_DZ_C2RIP_ISCSI_HDR 2
@@ -379,7 +437,7 @@ extern "C" {
#define ESF_DZ_C2SD_ENCODED_HOST_ADDR_DW1_WIDTH 16
#define ESF_DZ_C2SD_ENCODED_HOST_ADDR_LBN 64
#define ESF_DZ_C2SD_ENCODED_HOST_ADDR_WIDTH 48
-#define ESF_DZ_C2SD_OFFSET_LBN 48
+#define ESF_DZ_C2SD_OFFSET_LBN 80
#define ESF_DZ_C2SD_OFFSET_WIDTH 8
#define ESF_DZ_C2SD_QID_LBN 32
#define ESF_DZ_C2SD_QID_WIDTH 11
@@ -419,7 +477,6 @@ extern "C" {
#define ESF_DZ_C2TDB_DESC_IDX_WIDTH 16
#define ESF_DZ_C2TDB_UPD_CRC_MODE_LBN 93
#define ESF_DZ_C2TDB_UPD_CRC_MODE_WIDTH 3
-#define ESE_DZ_C2RIP_FCOIP_MPA 5
#define ESE_DZ_C2RIP_FCOIP_FCOE 4
#define ESE_DZ_C2RIP_ISCSI_HDR_AND_PYLD 3
#define ESE_DZ_C2RIP_ISCSI_HDR 2
@@ -460,6 +517,14 @@ extern "C" {
/* ES_FF_UMSG_CPU2TXDP_EGR */
+#define ESF_DZ_C2TE_RMON_SOFT_LBN 240
+#define ESF_DZ_C2TE_RMON_SOFT_WIDTH 1
+#define ESF_DZ_C2TE_VLAN_PRIO_LBN 224
+#define ESF_DZ_C2TE_VLAN_PRIO_WIDTH 3
+#define ESF_DZ_C2TE_VLAN_LBN 208
+#define ESF_DZ_C2TE_VLAN_WIDTH 1
+#define ESF_DZ_C2TE_QID_LBN 192
+#define ESF_DZ_C2TE_QID_WIDTH 11
#define ESF_DZ_C2TE_PEDIT_DELTA_LBN 168
#define ESF_DZ_C2TE_PEDIT_DELTA_WIDTH 8
#define ESF_DZ_C2TE_PYLOAD_OFST_LBN 160
@@ -480,20 +545,19 @@ extern "C" {
#define ESF_DZ_C2TE_IS_FCOE_WIDTH 1
#define ESF_DZ_C2TE_PARSE_INCOMP_LBN 128
#define ESF_DZ_C2TE_PARSE_INCOMP_WIDTH 1
-#define ESF_DZ_C2TE_PKT_LEN_LBN 112
-#define ESF_DZ_C2TE_PKT_LEN_WIDTH 16
-#define ESF_DZ_C2TE_UPD_TCPUDPCSUM_MODE_LBN 97
-#define ESF_DZ_C2TE_UPD_TCPUDPCSUM_MODE_WIDTH 1
-#define ESF_DZ_C2TE_UPD_IPCSUM_MODE_LBN 96
-#define ESF_DZ_C2TE_UPD_IPCSUM_MODE_WIDTH 1
-#define ESF_DZ_C2TE_UPD_CRC_MODE_LBN 93
+#define ESF_DZ_C2TE_UPD_CRC_MODE_LBN 98
#define ESF_DZ_C2TE_UPD_CRC_MODE_WIDTH 3
-#define ESE_DZ_C2RIP_FCOIP_MPA 5
#define ESE_DZ_C2RIP_FCOIP_FCOE 4
#define ESE_DZ_C2RIP_ISCSI_HDR_AND_PYLD 3
#define ESE_DZ_C2RIP_ISCSI_HDR 2
#define ESE_DZ_C2RIP_FCOE 1
#define ESE_DZ_C2RIP_OFF 0
+#define ESF_DZ_C2TE_UPD_TCPUDPCSUM_MODE_LBN 97
+#define ESF_DZ_C2TE_UPD_TCPUDPCSUM_MODE_WIDTH 1
+#define ESF_DZ_C2TE_UPD_IPCSUM_MODE_LBN 96
+#define ESF_DZ_C2TE_UPD_IPCSUM_MODE_WIDTH 1
+#define ESF_DZ_C2TE_PKT_LEN_LBN 64
+#define ESF_DZ_C2TE_PKT_LEN_WIDTH 16
#define ESF_DZ_C2TE_FINFO_WRD3_LBN 48
#define ESF_DZ_C2TE_FINFO_WRD3_WIDTH 16
#define ESF_DZ_C2TE_FINFO_WRD2_LBN 32
@@ -542,7 +606,7 @@ extern "C" {
/* ES_FF_UMSG_PACER_BKT_TBL_RD_REQ */
#define ESF_DZ_BKT_ID_LBN 0
-#define ESF_DZ_BKT_ID_WIDTH 9
+#define ESF_DZ_BKT_ID_WIDTH 10
/* ES_FF_UMSG_PACER_BKT_TBL_RD_RSP */
@@ -563,7 +627,7 @@ extern "C" {
#define ESF_DZ_MAX_FILL_REG_LBN 12
#define ESF_DZ_MAX_FILL_REG_WIDTH 2
#define ESF_DZ_BKT_ID_LBN 0
-#define ESF_DZ_BKT_ID_WIDTH 9
+#define ESF_DZ_BKT_ID_WIDTH 10
/* ES_FF_UMSG_PACER_BKT_TBL_WR_REQ */
@@ -580,7 +644,7 @@ extern "C" {
#define ESF_DZ_MAX_FILL_REG_LBN 12
#define ESF_DZ_MAX_FILL_REG_WIDTH 2
#define ESF_DZ_BKT_ID_LBN 0
-#define ESF_DZ_BKT_ID_WIDTH 9
+#define ESF_DZ_BKT_ID_WIDTH 10
/* ES_FF_UMSG_PACER_TXQ_TBL_RD_REQ */
@@ -590,13 +654,13 @@ extern "C" {
/* ES_FF_UMSG_PACER_TXQ_TBL_RD_RSP */
#define ESF_DZ_MAX_BKT2_LBN 112
-#define ESF_DZ_MAX_BKT2_WIDTH 9
+#define ESF_DZ_MAX_BKT2_WIDTH 10
#define ESF_DZ_MAX_BKT1_LBN 96
-#define ESF_DZ_MAX_BKT1_WIDTH 9
+#define ESF_DZ_MAX_BKT1_WIDTH 10
#define ESF_DZ_MAX_BKT0_LBN 80
-#define ESF_DZ_MAX_BKT0_WIDTH 9
+#define ESF_DZ_MAX_BKT0_WIDTH 10
#define ESF_DZ_MIN_BKT_LBN 64
-#define ESF_DZ_MIN_BKT_WIDTH 9
+#define ESF_DZ_MIN_BKT_WIDTH 10
#define ESF_DZ_LABEL_LBN 48
#define ESF_DZ_LABEL_WIDTH 4
#define ESF_DZ_PQ_FLAGS_LBN 32
@@ -609,13 +673,13 @@ extern "C" {
/* ES_FF_UMSG_PACER_TXQ_TBL_WR_REQ */
#define ESF_DZ_MAX_BKT2_LBN 112
-#define ESF_DZ_MAX_BKT2_WIDTH 9
+#define ESF_DZ_MAX_BKT2_WIDTH 10
#define ESF_DZ_MAX_BKT1_LBN 96
-#define ESF_DZ_MAX_BKT1_WIDTH 9
+#define ESF_DZ_MAX_BKT1_WIDTH 10
#define ESF_DZ_MAX_BKT0_LBN 80
-#define ESF_DZ_MAX_BKT0_WIDTH 9
+#define ESF_DZ_MAX_BKT0_WIDTH 10
#define ESF_DZ_MIN_BKT_LBN 64
-#define ESF_DZ_MIN_BKT_WIDTH 9
+#define ESF_DZ_MIN_BKT_WIDTH 10
#define ESF_DZ_LABEL_LBN 48
#define ESF_DZ_LABEL_WIDTH 4
#define ESF_DZ_PQ_FLAGS_LBN 32
@@ -663,17 +727,19 @@ extern "C" {
/* ES_FF_UMSG_RXDP_INGR2CPU */
+#define ESF_DZ_RI2C_QUEUE_ID_LBN 224
+#define ESF_DZ_RI2C_QUEUE_ID_WIDTH 11
#define ESF_DZ_RI2C_LEN_LBN 208
#define ESF_DZ_RI2C_LEN_WIDTH 16
-#define ESF_DZ_RI2C_L4_CLASS_LBN 202
+#define ESF_DZ_RI2C_L4_CLASS_LBN 205
#define ESF_DZ_RI2C_L4_CLASS_WIDTH 3
-#define ESF_DZ_RI2C_L3_CLASS_LBN 199
+#define ESF_DZ_RI2C_L3_CLASS_LBN 202
#define ESF_DZ_RI2C_L3_CLASS_WIDTH 3
-#define ESF_DZ_RI2C_ETHTAG_CLASS_LBN 196
+#define ESF_DZ_RI2C_ETHTAG_CLASS_LBN 199
#define ESF_DZ_RI2C_ETHTAG_CLASS_WIDTH 3
-#define ESF_DZ_RI2C_ETHBASE_CLASS_LBN 193
+#define ESF_DZ_RI2C_ETHBASE_CLASS_LBN 196
#define ESF_DZ_RI2C_ETHBASE_CLASS_WIDTH 3
-#define ESF_DZ_RI2C_MAC_CLASS_LBN 192
+#define ESF_DZ_RI2C_MAC_CLASS_LBN 195
#define ESF_DZ_RI2C_MAC_CLASS_WIDTH 1
#define ESF_DZ_RI2C_PKT_OFST_LBN 176
#define ESF_DZ_RI2C_PKT_OFST_WIDTH 16
@@ -765,12 +831,12 @@ extern "C" {
#define ESF_DZ_TD2CP_ETHBASE_CLASS_WIDTH 3
#define ESF_DZ_TD2CP_MAC_CLASS_LBN 240
#define ESF_DZ_TD2CP_MAC_CLASS_WIDTH 1
-#define ESF_DZ_TD2CP_SOFT_LBN 226
-#define ESF_DZ_TD2CP_SOFT_WIDTH 14
-#define ESF_DZ_TD2CP_PKT_ABORT_LBN 225
+#define ESF_DZ_TD2CP_PCIE_ERR_OR_ABORT_LBN 239
+#define ESF_DZ_TD2CP_PCIE_ERR_OR_ABORT_WIDTH 1
+#define ESF_DZ_TD2CP_PKT_ABORT_LBN 238
#define ESF_DZ_TD2CP_PKT_ABORT_WIDTH 1
-#define ESF_DZ_TD2CP_PCIE_ERR_LBN 224
-#define ESF_DZ_TD2CP_PCIE_ERR_WIDTH 1
+#define ESF_DZ_TD2CP_SOFT_LBN 224
+#define ESF_DZ_TD2CP_SOFT_WIDTH 14
#define ESF_DZ_TD2CP_DESC_IDX_LBN 208
#define ESF_DZ_TD2CP_DESC_IDX_WIDTH 16
#define ESF_DZ_TD2CP_PKT_LEN_LBN 192
@@ -854,7 +920,7 @@ extern "C" {
/* ES_LUE_DB_MATCH_ENTRY */
#define ESF_DZ_LUE_DSCRMNTR_LBN 140
-#define ESF_DZ_LUE_DSCRMNTR_WIDTH 4
+#define ESF_DZ_LUE_DSCRMNTR_WIDTH 6
#define ESF_DZ_LUE_MATCH_VAL_DW0_LBN 44
#define ESF_DZ_LUE_MATCH_VAL_DW0_WIDTH 32
#define ESF_DZ_LUE_MATCH_VAL_DW1_LBN 76
@@ -875,13 +941,11 @@ extern "C" {
#define ESE_DZ_LUE_SINGLE 0
#define ESF_DZ_LUE_RCPNTR_LBN 0
#define ESF_DZ_LUE_RCPNTR_WIDTH 24
-#define ESF_DZ_LUE_RCPNTR_ME_PTR_LBN 0
-#define ESF_DZ_LUE_RCPNTR_ME_PTR_WIDTH 14
/* ES_LUE_DB_NONMATCH_ENTRY */
#define ESF_DZ_LUE_DSCRMNTR_LBN 140
-#define ESF_DZ_LUE_DSCRMNTR_WIDTH 4
+#define ESF_DZ_LUE_DSCRMNTR_WIDTH 6
#define ESF_DZ_LUE_TERMINAL_LBN 139
#define ESF_DZ_LUE_TERMINAL_WIDTH 1
#define ESF_DZ_LUE_LAST_LBN 138
@@ -914,9 +978,9 @@ extern "C" {
#define ESF_DZ_MC2L_DR_PAD_DW3_LBN 118
#define ESF_DZ_MC2L_DR_PAD_DW3_WIDTH 32
#define ESF_DZ_MC2L_DR_PAD_DW4_LBN 150
-#define ESF_DZ_MC2L_DR_PAD_DW4_WIDTH 16
+#define ESF_DZ_MC2L_DR_PAD_DW4_WIDTH 18
#define ESF_DZ_MC2L_DR_PAD_LBN 22
-#define ESF_DZ_MC2L_DR_PAD_WIDTH 144
+#define ESF_DZ_MC2L_DR_PAD_WIDTH 146
#define ESF_DZ_MC2L_DR_ADDR_LBN 8
#define ESF_DZ_MC2L_DR_ADDR_WIDTH 14
#define ESF_DZ_MC2L_DR_THREAD_ID_LBN 5
@@ -933,7 +997,7 @@ extern "C" {
/* ES_LUE_MC_DIRECT_RESPONSE_MSG */
#define ESF_DZ_L2MC_DR_PAD_LBN 146
-#define ESF_DZ_L2MC_DR_PAD_WIDTH 6
+#define ESF_DZ_L2MC_DR_PAD_WIDTH 8
#define ESF_DZ_L2MC_DR_RCPNT_PTR_LBN 132
#define ESF_DZ_L2MC_DR_RCPNT_PTR_WIDTH 14
#define ESF_DZ_L2MC_DR_RCPNT4_LBN 108
@@ -972,9 +1036,9 @@ extern "C" {
#define ESF_DZ_MC2L_GPR_PAD_DW3_LBN 118
#define ESF_DZ_MC2L_GPR_PAD_DW3_WIDTH 32
#define ESF_DZ_MC2L_GPR_PAD_DW4_LBN 150
-#define ESF_DZ_MC2L_GPR_PAD_DW4_WIDTH 16
+#define ESF_DZ_MC2L_GPR_PAD_DW4_WIDTH 18
#define ESF_DZ_MC2L_GPR_PAD_LBN 22
-#define ESF_DZ_MC2L_GPR_PAD_WIDTH 144
+#define ESF_DZ_MC2L_GPR_PAD_WIDTH 146
#define ESF_DZ_MC2L_GPR_ADDR_LBN 8
#define ESF_DZ_MC2L_GPR_ADDR_WIDTH 14
#define ESF_DZ_MC2L_GPR_THREAD_ID_LBN 5
@@ -999,9 +1063,9 @@ extern "C" {
#define ESF_DZ_L2MC_GPR_DATA_DW3_LBN 104
#define ESF_DZ_L2MC_GPR_DATA_DW3_WIDTH 32
#define ESF_DZ_L2MC_GPR_DATA_DW4_LBN 136
-#define ESF_DZ_L2MC_GPR_DATA_DW4_WIDTH 16
+#define ESF_DZ_L2MC_GPR_DATA_DW4_WIDTH 18
#define ESF_DZ_L2MC_GPR_DATA_LBN 8
-#define ESF_DZ_L2MC_GPR_DATA_WIDTH 144
+#define ESF_DZ_L2MC_GPR_DATA_WIDTH 146
#define ESF_DZ_L2MC_GPR_THREAD_ID_LBN 5
#define ESF_DZ_L2MC_GPR_THREAD_ID_WIDTH 3
#define ESF_DZ_L2MC_GPR_CLIENT_ID_LBN 2
@@ -1024,9 +1088,9 @@ extern "C" {
#define ESF_DZ_MC2L_GPW_DATA_DW3_LBN 118
#define ESF_DZ_MC2L_GPW_DATA_DW3_WIDTH 32
#define ESF_DZ_MC2L_GPW_DATA_DW4_LBN 150
-#define ESF_DZ_MC2L_GPW_DATA_DW4_WIDTH 16
+#define ESF_DZ_MC2L_GPW_DATA_DW4_WIDTH 18
#define ESF_DZ_MC2L_GPW_DATA_LBN 22
-#define ESF_DZ_MC2L_GPW_DATA_WIDTH 144
+#define ESF_DZ_MC2L_GPW_DATA_WIDTH 146
#define ESF_DZ_MC2L_GPW_ADDR_LBN 8
#define ESF_DZ_MC2L_GPW_ADDR_WIDTH 14
#define ESF_DZ_MC2L_GPW_THREAD_ID_LBN 5
@@ -1042,22 +1106,22 @@ extern "C" {
/* ES_LUE_MC_MATCH_REQUEST_MSG */
-#define ESF_DZ_MC2L_MR_PAD_LBN 135
+#define ESF_DZ_MC2L_MR_PAD_LBN 137
#define ESF_DZ_MC2L_MR_PAD_WIDTH 31
-#define ESF_DZ_MC2L_MR_HASH2_LBN 122
+#define ESF_DZ_MC2L_MR_HASH2_LBN 124
#define ESF_DZ_MC2L_MR_HASH2_WIDTH 13
-#define ESF_DZ_MC2L_MR_HASH1_LBN 108
+#define ESF_DZ_MC2L_MR_HASH1_LBN 110
#define ESF_DZ_MC2L_MR_HASH1_WIDTH 14
-#define ESF_DZ_MC2L_MR_MATCH_BITS_DW0_LBN 12
+#define ESF_DZ_MC2L_MR_MATCH_BITS_DW0_LBN 14
#define ESF_DZ_MC2L_MR_MATCH_BITS_DW0_WIDTH 32
-#define ESF_DZ_MC2L_MR_MATCH_BITS_DW1_LBN 44
+#define ESF_DZ_MC2L_MR_MATCH_BITS_DW1_LBN 46
#define ESF_DZ_MC2L_MR_MATCH_BITS_DW1_WIDTH 32
-#define ESF_DZ_MC2L_MR_MATCH_BITS_DW2_LBN 76
+#define ESF_DZ_MC2L_MR_MATCH_BITS_DW2_LBN 78
#define ESF_DZ_MC2L_MR_MATCH_BITS_DW2_WIDTH 32
-#define ESF_DZ_MC2L_MR_MATCH_BITS_LBN 12
+#define ESF_DZ_MC2L_MR_MATCH_BITS_LBN 14
#define ESF_DZ_MC2L_MR_MATCH_BITS_WIDTH 96
#define ESF_DZ_MC2L_MR_DSCRMNTR_LBN 8
-#define ESF_DZ_MC2L_MR_DSCRMNTR_WIDTH 4
+#define ESF_DZ_MC2L_MR_DSCRMNTR_WIDTH 6
#define ESF_DZ_MC2L_MR_THREAD_ID_LBN 5
#define ESF_DZ_MC2L_MR_THREAD_ID_WIDTH 3
#define ESF_DZ_MC2L_MR_CLIENT_ID_LBN 2
@@ -1078,9 +1142,9 @@ extern "C" {
#define ESF_DZ_L2MC_MR_PAD_DW2_LBN 117
#define ESF_DZ_L2MC_MR_PAD_DW2_WIDTH 32
#define ESF_DZ_L2MC_MR_PAD_DW3_LBN 149
-#define ESF_DZ_L2MC_MR_PAD_DW3_WIDTH 3
+#define ESF_DZ_L2MC_MR_PAD_DW3_WIDTH 5
#define ESF_DZ_L2MC_MR_PAD_LBN 53
-#define ESF_DZ_L2MC_MR_PAD_WIDTH 99
+#define ESF_DZ_L2MC_MR_PAD_WIDTH 101
#define ESF_DZ_L2MC_MR_LUE_RCPNT_LBN 29
#define ESF_DZ_L2MC_MR_LUE_RCPNT_WIDTH 24
#define ESF_DZ_L2MC_MR_RX_MCAST_LBN 28
@@ -1115,9 +1179,9 @@ extern "C" {
#define ESF_DZ_LUE_HW_REQ_BASE_REQ_MSG_DATA_DW3_LBN 104
#define ESF_DZ_LUE_HW_REQ_BASE_REQ_MSG_DATA_DW3_WIDTH 32
#define ESF_DZ_LUE_HW_REQ_BASE_REQ_MSG_DATA_DW4_LBN 136
-#define ESF_DZ_LUE_HW_REQ_BASE_REQ_MSG_DATA_DW4_WIDTH 30
+#define ESF_DZ_LUE_HW_REQ_BASE_REQ_MSG_DATA_DW4_WIDTH 32
#define ESF_DZ_LUE_HW_REQ_BASE_REQ_MSG_DATA_LBN 8
-#define ESF_DZ_LUE_HW_REQ_BASE_REQ_MSG_DATA_WIDTH 158
+#define ESF_DZ_LUE_HW_REQ_BASE_REQ_MSG_DATA_WIDTH 160
#define ESF_DZ_LUE_HW_REQ_BASE_THREAD_ID_LBN 5
#define ESF_DZ_LUE_HW_REQ_BASE_THREAD_ID_WIDTH 3
#define ESF_DZ_LUE_HW_REQ_BASE_CLIENT_ID_LBN 2
@@ -1144,9 +1208,9 @@ extern "C" {
#define ESF_DZ_LUE_HW_RSP_BASE_RSP_DATA_DW3_LBN 104
#define ESF_DZ_LUE_HW_RSP_BASE_RSP_DATA_DW3_WIDTH 32
#define ESF_DZ_LUE_HW_RSP_BASE_RSP_DATA_DW4_LBN 136
-#define ESF_DZ_LUE_HW_RSP_BASE_RSP_DATA_DW4_WIDTH 16
+#define ESF_DZ_LUE_HW_RSP_BASE_RSP_DATA_DW4_WIDTH 18
#define ESF_DZ_LUE_HW_RSP_BASE_RSP_DATA_LBN 8
-#define ESF_DZ_LUE_HW_RSP_BASE_RSP_DATA_WIDTH 144
+#define ESF_DZ_LUE_HW_RSP_BASE_RSP_DATA_WIDTH 146
#define ESF_DZ_LUE_HW_RSP_BASE_THREAD_ID_LBN 5
#define ESF_DZ_LUE_HW_RSP_BASE_THREAD_ID_WIDTH 3
#define ESF_DZ_LUE_HW_RSP_BASE_CLIENT_ID_LBN 2
@@ -1244,9 +1308,9 @@ extern "C" {
#define ESF_DZ_LUE_HW_RSP_GPRD_LUE_DATA_DW3_LBN 104
#define ESF_DZ_LUE_HW_RSP_GPRD_LUE_DATA_DW3_WIDTH 32
#define ESF_DZ_LUE_HW_RSP_GPRD_LUE_DATA_DW4_LBN 136
-#define ESF_DZ_LUE_HW_RSP_GPRD_LUE_DATA_DW4_WIDTH 16
+#define ESF_DZ_LUE_HW_RSP_GPRD_LUE_DATA_DW4_WIDTH 18
#define ESF_DZ_LUE_HW_RSP_GPRD_LUE_DATA_LBN 8
-#define ESF_DZ_LUE_HW_RSP_GPRD_LUE_DATA_WIDTH 144
+#define ESF_DZ_LUE_HW_RSP_GPRD_LUE_DATA_WIDTH 146
#define ESF_DZ_LUE_HW_RSP_GPRD_THREAD_ID_LBN 5
#define ESF_DZ_LUE_HW_RSP_GPRD_THREAD_ID_WIDTH 3
#define ESF_DZ_LUE_HW_RSP_GPRD_CLIENT_ID_LBN 2
@@ -1273,9 +1337,9 @@ extern "C" {
#define ESF_DZ_LUE_HW_REQ_GPWR_LUE_DATA_DW3_LBN 118
#define ESF_DZ_LUE_HW_REQ_GPWR_LUE_DATA_DW3_WIDTH 32
#define ESF_DZ_LUE_HW_REQ_GPWR_LUE_DATA_DW4_LBN 150
-#define ESF_DZ_LUE_HW_REQ_GPWR_LUE_DATA_DW4_WIDTH 16
+#define ESF_DZ_LUE_HW_REQ_GPWR_LUE_DATA_DW4_WIDTH 18
#define ESF_DZ_LUE_HW_REQ_GPWR_LUE_DATA_LBN 22
-#define ESF_DZ_LUE_HW_REQ_GPWR_LUE_DATA_WIDTH 144
+#define ESF_DZ_LUE_HW_REQ_GPWR_LUE_DATA_WIDTH 146
#define ESF_DZ_LUE_HW_REQ_GPWR_ADDR_LBN 8
#define ESF_DZ_LUE_HW_REQ_GPWR_ADDR_WIDTH 14
#define ESF_DZ_LUE_HW_REQ_GPWR_THREAD_ID_LBN 5
@@ -1295,22 +1359,22 @@ extern "C" {
/* ES_LUE_MSG_MATCH_REQ */
-#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_REQ_COUNT_LBN 135
-#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_REQ_COUNT_WIDTH 6
-#define ESF_DZ_LUE_HW_REQ_MATCH_HASH2_LBN 122
+#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_REQ_COUNT_LBN 137
+#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_REQ_COUNT_WIDTH 8
+#define ESF_DZ_LUE_HW_REQ_MATCH_HASH2_LBN 124
#define ESF_DZ_LUE_HW_REQ_MATCH_HASH2_WIDTH 13
-#define ESF_DZ_LUE_HW_REQ_MATCH_HASH1_LBN 108
+#define ESF_DZ_LUE_HW_REQ_MATCH_HASH1_LBN 110
#define ESF_DZ_LUE_HW_REQ_MATCH_HASH1_WIDTH 14
-#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_BITS_DW0_LBN 12
+#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_BITS_DW0_LBN 14
#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_BITS_DW0_WIDTH 32
-#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_BITS_DW1_LBN 44
+#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_BITS_DW1_LBN 46
#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_BITS_DW1_WIDTH 32
-#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_BITS_DW2_LBN 76
+#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_BITS_DW2_LBN 78
#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_BITS_DW2_WIDTH 32
-#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_BITS_LBN 12
+#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_BITS_LBN 14
#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_BITS_WIDTH 96
#define ESF_DZ_LUE_HW_REQ_MATCH_DSCRMNTR_LBN 8
-#define ESF_DZ_LUE_HW_REQ_MATCH_DSCRMNTR_WIDTH 4
+#define ESF_DZ_LUE_HW_REQ_MATCH_DSCRMNTR_WIDTH 6
#define ESF_DZ_LUE_HW_REQ_MATCH_THREAD_ID_LBN 5
#define ESF_DZ_LUE_HW_REQ_MATCH_THREAD_ID_WIDTH 3
#define ESF_DZ_LUE_HW_REQ_MATCH_CLIENT_ID_LBN 2
@@ -1543,10 +1607,10 @@ extern "C" {
#define ESF_DZ_RX_OVERRIDE_HOLDOFF_WIDTH 1
#define ESF_DZ_RX_DROP_EVENT_LBN 58
#define ESF_DZ_RX_DROP_EVENT_WIDTH 1
-#define ESF_DZ_RX_EV_RSVD2_LBN 55
-#define ESF_DZ_RX_EV_RSVD2_WIDTH 3
+#define ESF_DZ_RX_EV_RSVD2_LBN 54
+#define ESF_DZ_RX_EV_RSVD2_WIDTH 4
#define ESF_DZ_RX_EV_SOFT2_LBN 52
-#define ESF_DZ_RX_EV_SOFT2_WIDTH 3
+#define ESF_DZ_RX_EV_SOFT2_WIDTH 2
#define ESF_DZ_RX_DSC_PTR_LBITS_LBN 48
#define ESF_DZ_RX_DSC_PTR_LBITS_WIDTH 4
#define ESF_DZ_RX_L4_CLASS_LBN 45
@@ -1590,8 +1654,10 @@ extern "C" {
#define ESE_DZ_MAC_CLASS_UCAST 0
#define ESF_DZ_RX_EV_SOFT1_LBN 32
#define ESF_DZ_RX_EV_SOFT1_WIDTH 3
-#define ESF_DZ_RX_EV_RSVD1_LBN 30
-#define ESF_DZ_RX_EV_RSVD1_WIDTH 2
+#define ESF_DZ_RX_EV_RSVD1_LBN 31
+#define ESF_DZ_RX_EV_RSVD1_WIDTH 1
+#define ESF_DZ_RX_ABORT_LBN 30
+#define ESF_DZ_RX_ABORT_WIDTH 1
#define ESF_DZ_RX_ECC_ERR_LBN 29
#define ESF_DZ_RX_ECC_ERR_WIDTH 1
#define ESF_DZ_RX_CRC1_ERR_LBN 28
@@ -1605,7 +1671,7 @@ extern "C" {
#define ESF_DZ_RX_ECRC_ERR_LBN 24
#define ESF_DZ_RX_ECRC_ERR_WIDTH 1
#define ESF_DZ_RX_QLABEL_LBN 16
-#define ESF_DZ_RX_QLABEL_WIDTH 8
+#define ESF_DZ_RX_QLABEL_WIDTH 5
#define ESF_DZ_RX_PARSE_INCOMPLETE_LBN 15
#define ESF_DZ_RX_PARSE_INCOMPLETE_WIDTH 1
#define ESF_DZ_RX_CONT_LBN 14
@@ -1687,16 +1753,16 @@ extern "C" {
#define ESF_DZ_RX_U_FAST_PATH_WIDTH 1
#define ESF_DZ_RX_U_SOFT1_B1R0_4_LBN 68
#define ESF_DZ_RX_U_SOFT1_B1R0_4_WIDTH 1
-#define ESF_DZ_RX_U_NO_FLUSH_LBN 67
-#define ESF_DZ_RX_U_NO_FLUSH_WIDTH 1
+#define ESF_DZ_RX_U_CHAIN_LBN 67
+#define ESF_DZ_RX_U_CHAIN_WIDTH 1
#define ESF_DZ_RX_U_SOFT1_B1R0_3_LBN 67
#define ESF_DZ_RX_U_SOFT1_B1R0_3_WIDTH 1
#define ESF_DZ_RX_U_DESC_ACTIVE_LBN 66
#define ESF_DZ_RX_U_DESC_ACTIVE_WIDTH 1
#define ESF_DZ_RX_U_SOFT1_B1R0_2_LBN 66
#define ESF_DZ_RX_U_SOFT1_B1R0_2_WIDTH 1
-#define ESF_DZ_RX_U_HDR_SPLIT_LBN 65
-#define ESF_DZ_RX_U_HDR_SPLIT_WIDTH 1
+#define ESF_DZ_RX_U_TIMESTAMP_LBN 65
+#define ESF_DZ_RX_U_TIMESTAMP_WIDTH 1
#define ESF_DZ_RX_U_SOFT1_B1R0_1_LBN 65
#define ESF_DZ_RX_U_SOFT1_B1R0_1_WIDTH 1
#define ESF_DZ_RX_U_Q_ENABLE_LBN 64
@@ -1728,12 +1794,14 @@ extern "C" {
#define ESF_DZ_RX_U_DSCR_BASE_PAGE_ID_WIDTH 18
#define ESF_DZ_RX_U_SOFT18_B1R0_0_LBN 64
#define ESF_DZ_RX_U_SOFT18_B1R0_0_WIDTH 18
-#define ESF_DZ_RX_U_QST1_SPARE_LBN 52
-#define ESF_DZ_RX_U_QST1_SPARE_WIDTH 12
+#define ESF_DZ_RX_U_QST1_SPARE_LBN 53
+#define ESF_DZ_RX_U_QST1_SPARE_WIDTH 11
#define ESF_DZ_RX_U_SOFT16_B0R3_0_LBN 48
#define ESF_DZ_RX_U_SOFT16_B0R3_0_WIDTH 16
-#define ESF_DZ_RX_U_TIMESTAMP_LBN 51
-#define ESF_DZ_RX_U_TIMESTAMP_WIDTH 1
+#define ESF_DZ_RX_U_NO_FLUSH_LBN 52
+#define ESF_DZ_RX_U_NO_FLUSH_WIDTH 1
+#define ESF_DZ_RX_U_HDR_SPLIT_LBN 51
+#define ESF_DZ_RX_U_HDR_SPLIT_WIDTH 1
#define ESF_DZ_RX_U_DOORBELL_ENABLED_LBN 50
#define ESF_DZ_RX_U_DOORBELL_ENABLED_WIDTH 1
#define ESF_DZ_RX_U_WORK_PENDING_LBN 49
@@ -1758,6 +1826,39 @@ extern "C" {
#define ESF_DZ_RX_U_SOFT3_B0R0_0_WIDTH 3
+/* ES_SGMII_DEV_PTNR_ABILITY_1000BX_MD */
+#define ESF_DZ_SGMII_DPA_NXT_PG_LBN 15
+#define ESF_DZ_SGMII_DPA_NXT_PG_WIDTH 1
+#define ESF_DZ_SGMII_DPA_ACK_LBN 14
+#define ESF_DZ_SGMII_DPA_ACK_WIDTH 1
+#define ESF_DZ_SGMII_DPA_REMOTE_FLT_LBN 12
+#define ESF_DZ_SGMII_DPA_REMOTE_FLT_WIDTH 2
+#define ESE_DZ_SGMII_DPA_RF_AN_ERR 3
+#define ESE_DZ_SGMII_DPA_RF_OFFLINE 2
+#define ESE_DZ_SGMII_DPA_RF_LINK_FAIL 1
+#define ESE_DZ_SGMII_DPA_RF_NONE 0
+#define ESF_DZ_SGMII_DPA_PS_LBN 7
+#define ESF_DZ_SGMII_DPA_PS_WIDTH 2
+#define ESF_DZ_SGMII_DPA_HD_LBN 6
+#define ESF_DZ_SGMII_DPA_HD_WIDTH 1
+#define ESF_DZ_SGMII_DPA_FD_LBN 5
+#define ESF_DZ_SGMII_DPA_FD_WIDTH 1
+
+
+/* ES_SGMII_DEV_PTNR_ABILITY_SGMII_MD */
+#define ESF_DZ_SGMII_DPA_CPR_LINK_STATE_LBN 15
+#define ESF_DZ_SGMII_DPA_CPR_LINK_STATE_WIDTH 1
+#define ESF_DZ_SGMII_DPA_ACK_LBN 14
+#define ESF_DZ_SGMII_DPA_ACK_WIDTH 1
+#define ESF_DZ_SGMII_CPR_BPLX_STS_LBN 12
+#define ESF_DZ_SGMII_CPR_BPLX_STS_WIDTH 1
+#define ESF_DZ_SGMII_DPA_COPPER_SPEED_LBN 10
+#define ESF_DZ_SGMII_DPA_COPPER_SPEED_WIDTH 2
+#define ESE_DZ_SGMII_DPA_CPR_1GBS 2
+#define ESE_DZ_SGMII_DPA_CPR_100MBS 1
+#define ESE_DZ_SGMII_DPA_CPR_10MBS 0
+
+
/* ES_SMC_BUFTBL_CNTRL_ENTRY */
#define ESF_DZ_SMC_SW_CNTXT_DW0_LBN 16
#define ESF_DZ_SMC_SW_CNTXT_DW0_WIDTH 32
@@ -2187,6 +2288,30 @@ extern "C" {
#define ESE_DZ_SMC_REQ_BUFTBL_LOOKUP 0
+/* ES_TX_CSUM_TSTAMP_DESC */
+#define ESF_DZ_TX_DESC_IS_OPT_LBN 63
+#define ESF_DZ_TX_DESC_IS_OPT_WIDTH 1
+#define ESF_DZ_TX_OPTION_TYPE_LBN 60
+#define ESF_DZ_TX_OPTION_TYPE_WIDTH 3
+#define ESE_DZ_TX_OPTION_DESC_TSO 7
+#define ESE_DZ_TX_OPTION_DESC_VLAN 6
+#define ESE_DZ_TX_OPTION_DESC_CRC_CSUM 0
+#define ESF_DZ_TX_TIMESTAMP_LBN 5
+#define ESF_DZ_TX_TIMESTAMP_WIDTH 1
+#define ESF_DZ_TX_OPTION_CRC_MODE_LBN 2
+#define ESF_DZ_TX_OPTION_CRC_MODE_WIDTH 3
+#define ESE_DZ_TX_OPTION_CRC_FCOIP_MPA 5
+#define ESE_DZ_TX_OPTION_CRC_FCOIP_FCOE 4
+#define ESE_DZ_TX_OPTION_CRC_ISCSI_HDR_AND_PYLD 3
+#define ESE_DZ_TX_OPTION_CRC_ISCSI_HDR 2
+#define ESE_DZ_TX_OPTION_CRC_FCOE 1
+#define ESE_DZ_TX_OPTION_CRC_OFF 0
+#define ESF_DZ_TX_OPTION_UDP_TCP_CSUM_LBN 1
+#define ESF_DZ_TX_OPTION_UDP_TCP_CSUM_WIDTH 1
+#define ESF_DZ_TX_OPTION_IP_CSUM_LBN 0
+#define ESF_DZ_TX_OPTION_IP_CSUM_WIDTH 1
+
+
/* ES_TX_EVENT */
#define ESF_DZ_TX_CODE_LBN 60
#define ESF_DZ_TX_CODE_WIDTH 4
@@ -2198,10 +2323,12 @@ extern "C" {
#define ESF_DZ_TX_EV_RSVD_WIDTH 10
#define ESF_DZ_TX_SOFT2_LBN 32
#define ESF_DZ_TX_SOFT2_WIDTH 16
+#define ESF_DZ_TX_CAN_MERGE_LBN 31
+#define ESF_DZ_TX_CAN_MERGE_WIDTH 1
#define ESF_DZ_TX_SOFT1_LBN 24
-#define ESF_DZ_TX_SOFT1_WIDTH 8
+#define ESF_DZ_TX_SOFT1_WIDTH 7
#define ESF_DZ_TX_QLABEL_LBN 16
-#define ESF_DZ_TX_QLABEL_WIDTH 8
+#define ESF_DZ_TX_QLABEL_WIDTH 5
#define ESF_DZ_TX_DESCR_INDX_LBN 0
#define ESF_DZ_TX_DESCR_INDX_WIDTH 16
@@ -2221,305 +2348,33 @@ extern "C" {
#define ESF_DZ_TX_KER_BUF_ADDR_WIDTH 48
-/* ES_TX_OPTION_DESC */
+/* ES_TX_PIO_DESC */
+#define ESF_DZ_TX_PIO_TYPE_LBN 63
+#define ESF_DZ_TX_PIO_TYPE_WIDTH 1
+#define ESF_DZ_TX_PIO_OPT_LBN 60
+#define ESF_DZ_TX_PIO_OPT_WIDTH 3
+#define ESF_DZ_TX_PIO_CONT_LBN 59
+#define ESF_DZ_TX_PIO_CONT_WIDTH 1
+#define ESF_DZ_TX_PIO_BYTE_CNT_LBN 32
+#define ESF_DZ_TX_PIO_BYTE_CNT_WIDTH 12
+#define ESF_DZ_TX_PIO_BUF_ADDR_LBN 0
+#define ESF_DZ_TX_PIO_BUF_ADDR_WIDTH 12
+
+
+/* ES_TX_TSO_DESC */
#define ESF_DZ_TX_DESC_IS_OPT_LBN 63
#define ESF_DZ_TX_DESC_IS_OPT_WIDTH 1
#define ESF_DZ_TX_OPTION_TYPE_LBN 60
#define ESF_DZ_TX_OPTION_TYPE_WIDTH 3
-#define ESE_DZ_TX_OPTION_DESC_TSO 4
+#define ESE_DZ_TX_OPTION_DESC_TSO 7
+#define ESE_DZ_TX_OPTION_DESC_VLAN 6
#define ESE_DZ_TX_OPTION_DESC_CRC_CSUM 0
#define ESF_DZ_TX_TSO_TCP_FLAGS_LBN 48
#define ESF_DZ_TX_TSO_TCP_FLAGS_WIDTH 8
-#define ESF_DZ_TX_TSO_TCP_MSS_LBN 32
-#define ESF_DZ_TX_TSO_TCP_MSS_WIDTH 16
+#define ESF_DZ_TX_TSO_IP_ID_LBN 32
+#define ESF_DZ_TX_TSO_IP_ID_WIDTH 16
#define ESF_DZ_TX_TSO_TCP_SEQNO_LBN 0
#define ESF_DZ_TX_TSO_TCP_SEQNO_WIDTH 32
-#define ESF_DZ_TX_OPTION_CRC_MODE_LBN 2
-#define ESF_DZ_TX_OPTION_CRC_MODE_WIDTH 3
-#define ESE_DZ_TX_OPTION_CRC_FCOIP_MPA 5
-#define ESE_DZ_TX_OPTION_CRC_FCOIP_FCOE 4
-#define ESE_DZ_TX_OPTION_CRC_ISCSI_HDR_AND_PYLD 3
-#define ESE_DZ_TX_OPTION_CRC_ISCSI_HDR 2
-#define ESE_DZ_TX_OPTION_CRC_FCOE 1
-#define ESE_DZ_TX_OPTION_CRC_OFF 0
-#define ESF_DZ_TX_OPTION_UDP_TCP_CSUM_LBN 1
-#define ESF_DZ_TX_OPTION_UDP_TCP_CSUM_WIDTH 1
-#define ESF_DZ_TX_OPTION_IP_CSUM_LBN 0
-#define ESF_DZ_TX_OPTION_IP_CSUM_WIDTH 1
-
-
-/* ES_TX_PACER_BASE_MSG */
-#define ESF_DZ_TXP_BASE_REQ_MSG_DATA_DW0_LBN 11
-#define ESF_DZ_TXP_BASE_REQ_MSG_DATA_DW0_WIDTH 32
-#define ESF_DZ_TXP_BASE_REQ_MSG_DATA_DW1_LBN 43
-#define ESF_DZ_TXP_BASE_REQ_MSG_DATA_DW1_WIDTH 32
-#define ESF_DZ_TXP_BASE_REQ_MSG_DATA_DW2_LBN 75
-#define ESF_DZ_TXP_BASE_REQ_MSG_DATA_DW2_WIDTH 23
-#define ESF_DZ_TXP_BASE_REQ_MSG_DATA_LBN 11
-#define ESF_DZ_TXP_BASE_REQ_MSG_DATA_WIDTH 87
-#define ESF_DZ_TXP_BASE_OP_LBN 2
-#define ESF_DZ_TXP_BASE_OP_WIDTH 3
-#define ESE_DZ_DPCPU_PACER_BKT_TBL_RD 7
-#define ESE_DZ_DPCPU_PACER_BKT_TBL_WR 6
-#define ESE_DZ_DPCPU_PACER_TXQ_TBL_RD 5
-#define ESE_DZ_DPCPU_PACER_TXQ_TBL_WR 4
-#define ESE_DZ_DPCPU_PACER_TXQ_D_R_NI 3
-#define ESE_DZ_DPCPU_PACER_TXQ_D_R_I 2
-#define ESE_DZ_DPCPU_PACER_BKT_D_R_RD 1
-#define ESE_DZ_DPCPU_PACER_BKT_D_RD 0
-#define ESF_DZ_TXP_BASE_CLIENT_ID_LBN 0
-#define ESF_DZ_TXP_BASE_CLIENT_ID_WIDTH 2
-#define ESE_DZ_DPCPU_PACER_CPU_CLIENT 2
-#define ESE_DZ_DPCPU_PACER_CMD_CTL_CLIENT 1
-#define ESE_DZ_DPCPU_PACER_ALRT_CTL_CLIENT 0
-
-
-/* ES_TX_PACER_BKT_D_R_REQ */
-#define ESF_DZ_TXP_BKT_D_R_REQ_FRM_LEN_LBN 45
-#define ESF_DZ_TXP_BKT_D_R_REQ_FRM_LEN_WIDTH 14
-#define ESF_DZ_TXP_BKT_D_R_REQ_MAX_BKT2_LBN 35
-#define ESF_DZ_TXP_BKT_D_R_REQ_MAX_BKT2_WIDTH 10
-#define ESF_DZ_TXP_BKT_D_R_REQ_MAX_BKT1_LBN 25
-#define ESF_DZ_TXP_BKT_D_R_REQ_MAX_BKT1_WIDTH 10
-#define ESF_DZ_TXP_BKT_D_R_REQ_MAX_BKT0_LBN 15
-#define ESF_DZ_TXP_BKT_D_R_REQ_MAX_BKT0_WIDTH 10
-#define ESF_DZ_TXP_BKT_D_R_REQ_MIN_BKT_LBN 5
-#define ESF_DZ_TXP_BKT_D_R_REQ_MIN_BKT_WIDTH 10
-#define ESF_DZ_TXP_BKT_D_R_REQ_OP_LBN 2
-#define ESF_DZ_TXP_BKT_D_R_REQ_OP_WIDTH 3
-#define ESE_DZ_DPCPU_PACER_BKT_TBL_RD 7
-#define ESE_DZ_DPCPU_PACER_BKT_TBL_WR 6
-#define ESE_DZ_DPCPU_PACER_TXQ_TBL_RD 5
-#define ESE_DZ_DPCPU_PACER_TXQ_TBL_WR 4
-#define ESE_DZ_DPCPU_PACER_TXQ_D_R_NI 3
-#define ESE_DZ_DPCPU_PACER_TXQ_D_R_I 2
-#define ESE_DZ_DPCPU_PACER_BKT_D_R_RD 1
-#define ESE_DZ_DPCPU_PACER_BKT_D_RD 0
-#define ESF_DZ_TXP_BKT_D_R_REQ_CLIENT_ID_LBN 0
-#define ESF_DZ_TXP_BKT_D_R_REQ_CLIENT_ID_WIDTH 2
-#define ESE_DZ_DPCPU_PACER_CPU_CLIENT 2
-#define ESE_DZ_DPCPU_PACER_CMD_CTL_CLIENT 1
-#define ESE_DZ_DPCPU_PACER_ALRT_CTL_CLIENT 0
-
-
-/* ES_TX_PACER_BKT_TBL_D_R_RSP */
-#define ESF_DZ_TXP_BKT_TBL_D_R_RSP_DUE_TIME_WITH_MIN_BKT_LBN 21
-#define ESF_DZ_TXP_BKT_TBL_D_R_RSP_DUE_TIME_WITH_MIN_BKT_WIDTH 26
-#define ESF_DZ_TXP_BKT_TBL_D_R_RSP_DUE_TIME_LBN 5
-#define ESF_DZ_TXP_BKT_TBL_D_R_RSP_DUE_TIME_WIDTH 16
-#define ESF_DZ_TXP_BKT_TBL_D_R_RSP_OP_LBN 2
-#define ESF_DZ_TXP_BKT_TBL_D_R_RSP_OP_WIDTH 3
-#define ESE_DZ_DPCPU_PACER_BKT_TBL_RD 7
-#define ESE_DZ_DPCPU_PACER_BKT_TBL_WR 6
-#define ESE_DZ_DPCPU_PACER_TXQ_TBL_RD 5
-#define ESE_DZ_DPCPU_PACER_TXQ_TBL_WR 4
-#define ESE_DZ_DPCPU_PACER_TXQ_D_R_NI 3
-#define ESE_DZ_DPCPU_PACER_TXQ_D_R_I 2
-#define ESE_DZ_DPCPU_PACER_BKT_D_R_RD 1
-#define ESE_DZ_DPCPU_PACER_BKT_D_RD 0
-#define ESF_DZ_TXP_BKT_TBL_D_R_RSP_CLIENT_ID_LBN 0
-#define ESF_DZ_TXP_BKT_TBL_D_R_RSP_CLIENT_ID_WIDTH 2
-#define ESE_DZ_DPCPU_PACER_CPU_CLIENT 2
-#define ESE_DZ_DPCPU_PACER_CMD_CTL_CLIENT 1
-#define ESE_DZ_DPCPU_PACER_ALRT_CTL_CLIENT 0
-
-
-/* ES_TX_PACER_BKT_TBL_RD_REQ */
-#define ESF_DZ_TXP_BKT_TBL_RD_REQ_BKT_ID_LBN 5
-#define ESF_DZ_TXP_BKT_TBL_RD_REQ_BKT_ID_WIDTH 10
-#define ESF_DZ_TXP_BKT_TBL_RD_REQ_OP_LBN 2
-#define ESF_DZ_TXP_BKT_TBL_RD_REQ_OP_WIDTH 3
-#define ESE_DZ_DPCPU_PACER_BKT_TBL_RD 7
-#define ESE_DZ_DPCPU_PACER_BKT_TBL_WR 6
-#define ESE_DZ_DPCPU_PACER_TXQ_TBL_RD 5
-#define ESE_DZ_DPCPU_PACER_TXQ_TBL_WR 4
-#define ESE_DZ_DPCPU_PACER_TXQ_D_R_NI 3
-#define ESE_DZ_DPCPU_PACER_TXQ_D_R_I 2
-#define ESE_DZ_DPCPU_PACER_BKT_D_R_RD 1
-#define ESE_DZ_DPCPU_PACER_BKT_D_RD 0
-#define ESF_DZ_TXP_BKT_TBL_RD_REQ_CLIENT_ID_LBN 0
-#define ESF_DZ_TXP_BKT_TBL_RD_REQ_CLIENT_ID_WIDTH 2
-#define ESE_DZ_DPCPU_PACER_CPU_CLIENT 2
-#define ESE_DZ_DPCPU_PACER_CMD_CTL_CLIENT 1
-#define ESE_DZ_DPCPU_PACER_ALRT_CTL_CLIENT 0
-
-
-/* ES_TX_PACER_BKT_TBL_RD_RSP */
-#define ESF_DZ_TXP_BKT_TBL_RD_RSP_IDLE_LBN 97
-#define ESF_DZ_TXP_BKT_TBL_RD_RSP_IDLE_WIDTH 1
-#define ESF_DZ_TXP_BKT_TBL_RD_RSP_USED_LBN 96
-#define ESF_DZ_TXP_BKT_TBL_RD_RSP_USED_WIDTH 1
-#define ESF_DZ_TXP_BKT_TBL_RD_RSP_MAX_FILL_REG_LBN 94
-#define ESF_DZ_TXP_BKT_TBL_RD_RSP_MAX_FILL_REG_WIDTH 2
-#define ESF_DZ_TXP_BKT_TBL_RD_RSP_RATE_REC_LBN 78
-#define ESF_DZ_TXP_BKT_TBL_RD_RSP_RATE_REC_WIDTH 16
-#define ESF_DZ_TXP_BKT_TBL_RD_RSP_RATE_LBN 62
-#define ESF_DZ_TXP_BKT_TBL_RD_RSP_RATE_WIDTH 16
-#define ESF_DZ_TXP_BKT_TBL_RD_RSP_FILL_LEVEL_LBN 47
-#define ESF_DZ_TXP_BKT_TBL_RD_RSP_FILL_LEVEL_WIDTH 15
-#define ESF_DZ_TXP_BKT_TBL_RD_RSP_DUE_TIME_LBN 31
-#define ESF_DZ_TXP_BKT_TBL_RD_RSP_DUE_TIME_WIDTH 16
-#define ESF_DZ_TXP_BKT_TBL_RD_RSP_LAST_FILL_TIME_LBN 15
-#define ESF_DZ_TXP_BKT_TBL_RD_RSP_LAST_FILL_TIME_WIDTH 16
-#define ESF_DZ_TXP_BKT_TBL_RD_RSP_BKT_ID_LBN 5
-#define ESF_DZ_TXP_BKT_TBL_RD_RSP_BKT_ID_WIDTH 10
-#define ESF_DZ_TXP_BKT_TBL_RD_RSP_OP_LBN 2
-#define ESF_DZ_TXP_BKT_TBL_RD_RSP_OP_WIDTH 3
-#define ESE_DZ_DPCPU_PACER_BKT_TBL_RD 7
-#define ESE_DZ_DPCPU_PACER_BKT_TBL_WR 6
-#define ESE_DZ_DPCPU_PACER_TXQ_TBL_RD 5
-#define ESE_DZ_DPCPU_PACER_TXQ_TBL_WR 4
-#define ESE_DZ_DPCPU_PACER_TXQ_D_R_NI 3
-#define ESE_DZ_DPCPU_PACER_TXQ_D_R_I 2
-#define ESE_DZ_DPCPU_PACER_BKT_D_R_RD 1
-#define ESE_DZ_DPCPU_PACER_BKT_D_RD 0
-#define ESF_DZ_TXP_BKT_TBL_RD_RSP_CLIENT_ID_LBN 0
-#define ESF_DZ_TXP_BKT_TBL_RD_RSP_CLIENT_ID_WIDTH 2
-#define ESE_DZ_DPCPU_PACER_CPU_CLIENT 2
-#define ESE_DZ_DPCPU_PACER_CMD_CTL_CLIENT 1
-#define ESE_DZ_DPCPU_PACER_ALRT_CTL_CLIENT 0
-
-
-/* ES_TX_PACER_BKT_TBL_WR_REQ */
-#define ESF_DZ_TXP_BKT_TBL_WR_REQ_IDLE_LBN 65
-#define ESF_DZ_TXP_BKT_TBL_WR_REQ_IDLE_WIDTH 1
-#define ESF_DZ_TXP_BKT_TBL_WR_REQ_USED_LBN 64
-#define ESF_DZ_TXP_BKT_TBL_WR_REQ_USED_WIDTH 1
-#define ESF_DZ_TXP_BKT_TBL_WR_REQ_MAX_FILL_REG_LBN 62
-#define ESF_DZ_TXP_BKT_TBL_WR_REQ_MAX_FILL_REG_WIDTH 2
-#define ESF_DZ_TXP_BKT_TBL_WR_REQ_RATE_REC_LBN 46
-#define ESF_DZ_TXP_BKT_TBL_WR_REQ_RATE_REC_WIDTH 16
-#define ESF_DZ_TXP_BKT_TBL_WR_REQ_RATE_LBN 30
-#define ESF_DZ_TXP_BKT_TBL_WR_REQ_RATE_WIDTH 16
-#define ESF_DZ_TXP_BKT_TBL_WR_REQ_FILL_LEVEL_LBN 15
-#define ESF_DZ_TXP_BKT_TBL_WR_REQ_FILL_LEVEL_WIDTH 15
-#define ESF_DZ_TXP_BKT_TBL_WR_REQ_BKT_ID_LBN 5
-#define ESF_DZ_TXP_BKT_TBL_WR_REQ_BKT_ID_WIDTH 10
-#define ESF_DZ_TXP_BKT_TBL_WR_REQ_OP_LBN 2
-#define ESF_DZ_TXP_BKT_TBL_WR_REQ_OP_WIDTH 3
-#define ESE_DZ_DPCPU_PACER_BKT_TBL_RD 7
-#define ESE_DZ_DPCPU_PACER_BKT_TBL_WR 6
-#define ESE_DZ_DPCPU_PACER_TXQ_TBL_RD 5
-#define ESE_DZ_DPCPU_PACER_TXQ_TBL_WR 4
-#define ESE_DZ_DPCPU_PACER_TXQ_D_R_NI 3
-#define ESE_DZ_DPCPU_PACER_TXQ_D_R_I 2
-#define ESE_DZ_DPCPU_PACER_BKT_D_R_RD 1
-#define ESE_DZ_DPCPU_PACER_BKT_D_RD 0
-#define ESF_DZ_TXP_BKT_TBL_WR_REQ_CLIENT_ID_LBN 0
-#define ESF_DZ_TXP_BKT_TBL_WR_REQ_CLIENT_ID_WIDTH 2
-#define ESE_DZ_DPCPU_PACER_CPU_CLIENT 2
-#define ESE_DZ_DPCPU_PACER_CMD_CTL_CLIENT 1
-#define ESE_DZ_DPCPU_PACER_ALRT_CTL_CLIENT 0
-
-
-/* ES_TX_PACER_TXQ_D_R_I_REQ */
-#define ESF_DZ_TXP_TXQ_D_R_I_REQ_FRM_LEN_LBN 15
-#define ESF_DZ_TXP_TXQ_D_R_I_REQ_FRM_LEN_WIDTH 14
-#define ESF_DZ_TXP_TXQ_D_R_I_REQ_TXQ_ID_LBN 5
-#define ESF_DZ_TXP_TXQ_D_R_I_REQ_TXQ_ID_WIDTH 10
-#define ESF_DZ_TXP_TXQ_D_R_I_REQ_OP_LBN 2
-#define ESF_DZ_TXP_TXQ_D_R_I_REQ_OP_WIDTH 3
-#define ESE_DZ_DPCPU_PACER_BKT_TBL_RD 7
-#define ESE_DZ_DPCPU_PACER_BKT_TBL_WR 6
-#define ESE_DZ_DPCPU_PACER_TXQ_TBL_RD 5
-#define ESE_DZ_DPCPU_PACER_TXQ_TBL_WR 4
-#define ESE_DZ_DPCPU_PACER_TXQ_D_R_NI 3
-#define ESE_DZ_DPCPU_PACER_TXQ_D_R_I 2
-#define ESE_DZ_DPCPU_PACER_BKT_D_R_RD 1
-#define ESE_DZ_DPCPU_PACER_BKT_D_RD 0
-#define ESF_DZ_TXP_TXQ_D_R_I_REQ_CLIENT_ID_LBN 0
-#define ESF_DZ_TXP_TXQ_D_R_I_REQ_CLIENT_ID_WIDTH 2
-#define ESE_DZ_DPCPU_PACER_CPU_CLIENT 2
-#define ESE_DZ_DPCPU_PACER_CMD_CTL_CLIENT 1
-#define ESE_DZ_DPCPU_PACER_ALRT_CTL_CLIENT 0
-
-
-/* ES_TX_PACER_TXQ_TBL_RD_REQ */
-#define ESF_DZ_TXP_TXQ_TBL_RD_REQ_TXQ_ID_LBN 5
-#define ESF_DZ_TXP_TXQ_TBL_RD_REQ_TXQ_ID_WIDTH 10
-#define ESF_DZ_TXP_TXQ_TBL_RD_REQ_OP_LBN 2
-#define ESF_DZ_TXP_TXQ_TBL_RD_REQ_OP_WIDTH 3
-#define ESE_DZ_DPCPU_PACER_BKT_TBL_RD 7
-#define ESE_DZ_DPCPU_PACER_BKT_TBL_WR 6
-#define ESE_DZ_DPCPU_PACER_TXQ_TBL_RD 5
-#define ESE_DZ_DPCPU_PACER_TXQ_TBL_WR 4
-#define ESE_DZ_DPCPU_PACER_TXQ_D_R_NI 3
-#define ESE_DZ_DPCPU_PACER_TXQ_D_R_I 2
-#define ESE_DZ_DPCPU_PACER_BKT_D_R_RD 1
-#define ESE_DZ_DPCPU_PACER_BKT_D_RD 0
-#define ESF_DZ_TXP_TXQ_TBL_RD_REQ_CLIENT_ID_LBN 0
-#define ESF_DZ_TXP_TXQ_TBL_RD_REQ_CLIENT_ID_WIDTH 2
-#define ESE_DZ_DPCPU_PACER_CPU_CLIENT 2
-#define ESE_DZ_DPCPU_PACER_CMD_CTL_CLIENT 1
-#define ESE_DZ_DPCPU_PACER_ALRT_CTL_CLIENT 0
-
-
-/* ES_TX_PACER_TXQ_TBL_RD_RSP */
-#define ESF_DZ_TXP_TXQ_TBL_RD_RSP_MAX_BKT2_LBN 53
-#define ESF_DZ_TXP_TXQ_TBL_RD_RSP_MAX_BKT2_WIDTH 10
-#define ESF_DZ_TXP_TXQ_TBL_RD_RSP_MAX_BKT1_LBN 43
-#define ESF_DZ_TXP_TXQ_TBL_RD_RSP_MAX_BKT1_WIDTH 10
-#define ESF_DZ_TXP_TXQ_TBL_RD_RSP_MAX_BKT0_LBN 33
-#define ESF_DZ_TXP_TXQ_TBL_RD_RSP_MAX_BKT0_WIDTH 10
-#define ESF_DZ_TXP_TXQ_TBL_RD_RSP_MIN_BKT_LBN 23
-#define ESF_DZ_TXP_TXQ_TBL_RD_RSP_MIN_BKT_WIDTH 10
-#define ESF_DZ_TXP_TXQ_TBL_RD_RSP_LABEL_LBN 19
-#define ESF_DZ_TXP_TXQ_TBL_RD_RSP_LABEL_WIDTH 4
-#define ESF_DZ_TXP_TXQ_TBL_RD_RSP_PQ_FLAGS_LBN 16
-#define ESF_DZ_TXP_TXQ_TBL_RD_RSP_PQ_FLAGS_WIDTH 3
-#define ESF_DZ_TXP_TXQ_TBL_RD_RSP_DSBL_LBN 15
-#define ESF_DZ_TXP_TXQ_TBL_RD_RSP_DSBL_WIDTH 1
-#define ESF_DZ_TXP_TXQ_TBL_RD_RSP_TXQ_ID_LBN 5
-#define ESF_DZ_TXP_TXQ_TBL_RD_RSP_TXQ_ID_WIDTH 10
-#define ESF_DZ_TXP_TXQ_TBL_RD_RSP_OP_LBN 2
-#define ESF_DZ_TXP_TXQ_TBL_RD_RSP_OP_WIDTH 3
-#define ESE_DZ_DPCPU_PACER_BKT_TBL_RD 7
-#define ESE_DZ_DPCPU_PACER_BKT_TBL_WR 6
-#define ESE_DZ_DPCPU_PACER_TXQ_TBL_RD 5
-#define ESE_DZ_DPCPU_PACER_TXQ_TBL_WR 4
-#define ESE_DZ_DPCPU_PACER_TXQ_D_R_NI 3
-#define ESE_DZ_DPCPU_PACER_TXQ_D_R_I 2
-#define ESE_DZ_DPCPU_PACER_BKT_D_R_RD 1
-#define ESE_DZ_DPCPU_PACER_BKT_D_RD 0
-#define ESF_DZ_TXP_TXQ_TBL_RD_RSP_CLIENT_ID_LBN 0
-#define ESF_DZ_TXP_TXQ_TBL_RD_RSP_CLIENT_ID_WIDTH 2
-#define ESE_DZ_DPCPU_PACER_CPU_CLIENT 2
-#define ESE_DZ_DPCPU_PACER_CMD_CTL_CLIENT 1
-#define ESE_DZ_DPCPU_PACER_ALRT_CTL_CLIENT 0
-
-
-/* ES_TX_PACER_TXQ_TBL_WR_REQ */
-#define ESF_DZ_TXP_TXQ_TBL_WR_REQ_MAX_BKT2_LBN 53
-#define ESF_DZ_TXP_TXQ_TBL_WR_REQ_MAX_BKT2_WIDTH 10
-#define ESF_DZ_TXP_TXQ_TBL_WR_REQ_MAX_BKT1_LBN 43
-#define ESF_DZ_TXP_TXQ_TBL_WR_REQ_MAX_BKT1_WIDTH 10
-#define ESF_DZ_TXP_TXQ_TBL_WR_REQ_MAX_BKT0_LBN 33
-#define ESF_DZ_TXP_TXQ_TBL_WR_REQ_MAX_BKT0_WIDTH 10
-#define ESF_DZ_TXP_TXQ_TBL_WR_REQ_MIN_BKT_LBN 23
-#define ESF_DZ_TXP_TXQ_TBL_WR_REQ_MIN_BKT_WIDTH 10
-#define ESF_DZ_TXP_TXQ_TBL_WR_REQ_LABEL_LBN 19
-#define ESF_DZ_TXP_TXQ_TBL_WR_REQ_LABEL_WIDTH 4
-#define ESF_DZ_TXP_TXQ_TBL_WR_REQ_PQ_FLAGS_LBN 16
-#define ESF_DZ_TXP_TXQ_TBL_WR_REQ_PQ_FLAGS_WIDTH 3
-#define ESF_DZ_TXP_TXQ_TBL_WR_REQ_DSBL_LBN 15
-#define ESF_DZ_TXP_TXQ_TBL_WR_REQ_DSBL_WIDTH 1
-#define ESF_DZ_TXP_TXQ_TBL_WR_REQ_TXQ_ID_LBN 5
-#define ESF_DZ_TXP_TXQ_TBL_WR_REQ_TXQ_ID_WIDTH 10
-#define ESF_DZ_TXP_TXQ_TBL_WR_REQ_OP_LBN 2
-#define ESF_DZ_TXP_TXQ_TBL_WR_REQ_OP_WIDTH 3
-#define ESE_DZ_DPCPU_PACER_BKT_TBL_RD 7
-#define ESE_DZ_DPCPU_PACER_BKT_TBL_WR 6
-#define ESE_DZ_DPCPU_PACER_TXQ_TBL_RD 5
-#define ESE_DZ_DPCPU_PACER_TXQ_TBL_WR 4
-#define ESE_DZ_DPCPU_PACER_TXQ_D_R_NI 3
-#define ESE_DZ_DPCPU_PACER_TXQ_D_R_I 2
-#define ESE_DZ_DPCPU_PACER_BKT_D_R_RD 1
-#define ESE_DZ_DPCPU_PACER_BKT_D_RD 0
-#define ESF_DZ_TXP_TXQ_TBL_WR_REQ_CLIENT_ID_LBN 0
-#define ESF_DZ_TXP_TXQ_TBL_WR_REQ_CLIENT_ID_WIDTH 2
-#define ESE_DZ_DPCPU_PACER_CPU_CLIENT 2
-#define ESE_DZ_DPCPU_PACER_CMD_CTL_CLIENT 1
-#define ESE_DZ_DPCPU_PACER_ALRT_CTL_CLIENT 0
/* ES_TX_USER_DESC */
@@ -2572,8 +2427,12 @@ extern "C" {
#define ESF_DZ_TX_U_DC_RPTR_WIDTH 6
#define ESF_DZ_TX_U_SOFT6_B1R1_LBN 80
#define ESF_DZ_TX_U_SOFT6_B1R1_WIDTH 6
+#define ESF_DZ_TX_U_CNTAG_LBN 68
+#define ESF_DZ_TX_U_CNTAG_WIDTH 1
#define ESF_DZ_TX_U_SOFT5_B1R0_LBN 64
#define ESF_DZ_TX_U_SOFT5_B1R0_WIDTH 5
+#define ESF_DZ_TX_U_TIMESTAMP_LBN 67
+#define ESF_DZ_TX_U_TIMESTAMP_WIDTH 1
#define ESF_DZ_TX_U_PREFETCH_ACTIVE_LBN 66
#define ESF_DZ_TX_U_PREFETCH_ACTIVE_WIDTH 1
#define ESF_DZ_TX_U_PREFETCH_PENDING_LBN 65
@@ -2613,6 +2472,18 @@ extern "C" {
#define ESF_DZ_TX_U_SOFT18_B1R0_WIDTH 18
#define ESF_DZ_TX_U_SOFT16_B0R3_LBN 48
#define ESF_DZ_TX_U_SOFT16_B0R3_WIDTH 16
+#define ESF_DZ_TX_U_EMERGENCY_FETCH_FAILED_LBN 56
+#define ESF_DZ_TX_U_EMERGENCY_FETCH_FAILED_WIDTH 1
+#define ESF_DZ_TX_U_PACER_BYPASS_OK_LBN 55
+#define ESF_DZ_TX_U_PACER_BYPASS_OK_WIDTH 1
+#define ESF_DZ_TX_U_STALE_DL_FETCH_LBN 54
+#define ESF_DZ_TX_U_STALE_DL_FETCH_WIDTH 1
+#define ESF_DZ_TX_U_ROLLBACK_IDX_REACHED_LBN 52
+#define ESF_DZ_TX_U_ROLLBACK_IDX_REACHED_WIDTH 1
+#define ESF_DZ_TX_U_ROLLBACK_ACTIVE_LBN 51
+#define ESF_DZ_TX_U_ROLLBACK_ACTIVE_WIDTH 1
+#define ESF_DZ_TX_U_QUEUE_PAUSED_LBN 50
+#define ESF_DZ_TX_U_QUEUE_PAUSED_WIDTH 1
#define ESF_DZ_TX_U_QUEUE_ENABLED_LBN 49
#define ESF_DZ_TX_U_QUEUE_ENABLED_WIDTH 1
#define ESF_DZ_TX_U_FLUSH_PENDING_LBN 48
@@ -2625,7 +2496,7 @@ extern "C" {
#define ESF_DZ_TX_U_OWNER_ID_WIDTH 12
#define ESF_DZ_TX_U_SOFT12_B0R1_LBN 16
#define ESF_DZ_TX_U_SOFT12_B0R1_WIDTH 12
-#define ESF_DZ_TX_U_DSCR_SIZE_LBN 0
+#define ESF_DZ_TX_U_DSCR_SIZE_LBN 13
#define ESF_DZ_TX_U_DSCR_SIZE_WIDTH 3
#define ESF_DZ_TX_U_SOFT3_B0R0_LBN 0
#define ESF_DZ_TX_U_SOFT3_B0R0_WIDTH 3
@@ -2642,9 +2513,27 @@ extern "C" {
#define ESF_DZ_TX_FINFO_SRCDST_WIDTH 16
+/* ES_TX_VLAN_DESC */
+#define ESF_DZ_TX_DESC_IS_OPT_LBN 63
+#define ESF_DZ_TX_DESC_IS_OPT_WIDTH 1
+#define ESF_DZ_TX_OPTION_TYPE_LBN 60
+#define ESF_DZ_TX_OPTION_TYPE_WIDTH 3
+#define ESE_DZ_TX_OPTION_DESC_TSO 7
+#define ESE_DZ_TX_OPTION_DESC_VLAN 6
+#define ESE_DZ_TX_OPTION_DESC_CRC_CSUM 0
+#define ESF_DZ_TX_VLAN_OP_LBN 32
+#define ESF_DZ_TX_VLAN_OP_WIDTH 2
+#define ESF_DZ_TX_VLAN_TAG2_LBN 16
+#define ESF_DZ_TX_VLAN_TAG2_WIDTH 16
+#define ESF_DZ_TX_VLAN_TAG1_LBN 0
+#define ESF_DZ_TX_VLAN_TAG1_WIDTH 16
+
+
/* ES_b2t_cpl_rsp */
-#define ESF_DZ_B2T_CPL_RSP_CPL_ECC_LBN 268
+#define ESF_DZ_B2T_CPL_RSP_CPL_ECC_LBN 284
#define ESF_DZ_B2T_CPL_RSP_CPL_ECC_WIDTH 32
+#define ESF_DZ_B2T_CPL_RSP_CPL_EOT_LBN 283
+#define ESF_DZ_B2T_CPL_RSP_CPL_EOT_WIDTH 1
#define ESF_DZ_B2T_CPL_RSP_CPL_DATA_DW0_LBN 27
#define ESF_DZ_B2T_CPL_RSP_CPL_DATA_DW0_WIDTH 32
#define ESF_DZ_B2T_CPL_RSP_CPL_DATA_DW1_LBN 59
@@ -2663,8 +2552,6 @@ extern "C" {
#define ESF_DZ_B2T_CPL_RSP_CPL_DATA_DW7_WIDTH 32
#define ESF_DZ_B2T_CPL_RSP_CPL_DATA_LBN 27
#define ESF_DZ_B2T_CPL_RSP_CPL_DATA_WIDTH 256
-#define ESF_DZ_B2T_CPL_RSP_CPL_EOT_LBN 283
-#define ESF_DZ_B2T_CPL_RSP_CPL_EOT_WIDTH -15
#define ESF_DZ_B2T_CPL_RSP_CPL_ERROR_LBN 26
#define ESF_DZ_B2T_CPL_RSP_CPL_ERROR_WIDTH 1
#define ESF_DZ_B2T_CPL_RSP_CPL_LAST_LBN 25
@@ -2677,95 +2564,321 @@ extern "C" {
#define ESF_DZ_B2T_CPL_RSP_CPL_ADRS_WIDTH 7
+/* ES_fltr_info_wrd_mac_to_rx */
+#define ESF_DZ_FLTR_INFO_MAC_TO_RX_RESERVED2_LBN 112
+#define ESF_DZ_FLTR_INFO_MAC_TO_RX_RESERVED2_WIDTH 16
+#define ESF_DZ_FLTR_INFO_MAC_TO_RX_TIMESTAMP2_LBN 96
+#define ESF_DZ_FLTR_INFO_MAC_TO_RX_TIMESTAMP2_WIDTH 16
+#define ESF_DZ_FLTR_INFO_MAC_TO_RX_TIMESTAMP1_LBN 80
+#define ESF_DZ_FLTR_INFO_MAC_TO_RX_TIMESTAMP1_WIDTH 16
+#define ESF_DZ_FLTR_INFO_MAC_TO_RX_TIMESTAMP0_LBN 64
+#define ESF_DZ_FLTR_INFO_MAC_TO_RX_TIMESTAMP0_WIDTH 16
+#define ESF_DZ_FLTR_INFO_MAC_TO_RX_RESERVED1_LBN 48
+#define ESF_DZ_FLTR_INFO_MAC_TO_RX_RESERVED1_WIDTH 16
+#define ESF_DZ_FLTR_INFO_MAC_TO_RX_IPSEC_SA_LBN 32
+#define ESF_DZ_FLTR_INFO_MAC_TO_RX_IPSEC_SA_WIDTH 16
+#define ESF_DZ_FLTR_INFO_MAC_TO_RX_RESERVED0_LBN 8
+#define ESF_DZ_FLTR_INFO_MAC_TO_RX_RESERVED0_WIDTH 24
+#define ESF_DZ_FLTR_INFO_MAC_TO_RX_IPSEC_LBN 7
+#define ESF_DZ_FLTR_INFO_MAC_TO_RX_IPSEC_WIDTH 1
+#define ESF_DZ_FLTR_INFO_MAC_TO_RX_PRIORITY_LBN 4
+#define ESF_DZ_FLTR_INFO_MAC_TO_RX_PRIORITY_WIDTH 3
+#define ESF_DZ_FLTR_INFO_MAC_TO_RX_SRC_LBN 0
+#define ESF_DZ_FLTR_INFO_MAC_TO_RX_SRC_WIDTH 4
+
+
+/* ES_fltr_info_wrd_mc_pdma */
+#define ESF_DZ_FLTR_INFO_MC_PDMA_FLTR_OUT_LBN 64
+#define ESF_DZ_FLTR_INFO_MC_PDMA_FLTR_OUT_WIDTH 16
+#define ESE_DZ_FLTR_MULTICAST_VLAN 512
+#define ESE_DZ_FLTR_MAC_VLAN 256
+#define ESE_DZ_FLTR_STRUCTURED7 128
+#define ESE_DZ_FLTR_STRUCTURED6 64
+#define ESE_DZ_FLTR_STRUCTURED5 32
+#define ESE_DZ_FLTR_STRUCTURED4 16
+#define ESE_DZ_FLTR_STRUCTURED3 8
+#define ESE_DZ_FLTR_STRUCTURED2 4
+#define ESE_DZ_FLTR_STRUCTURED1 2
+#define ESE_DZ_FLTR_STRUCTURED0 1
+#define ESF_DZ_FLTR_INFO_MC_PDMA_TIMESTAMP_DW0_LBN 16
+#define ESF_DZ_FLTR_INFO_MC_PDMA_TIMESTAMP_DW0_WIDTH 32
+#define ESF_DZ_FLTR_INFO_MC_PDMA_TIMESTAMP_DW1_LBN 48
+#define ESF_DZ_FLTR_INFO_MC_PDMA_TIMESTAMP_DW1_WIDTH 16
+#define ESF_DZ_FLTR_INFO_MC_PDMA_TIMESTAMP_LBN 16
+#define ESF_DZ_FLTR_INFO_MC_PDMA_TIMESTAMP_WIDTH 48
+#define ESF_DZ_FLTR_INFO_MC_PDMA_DST_LBN 8
+#define ESF_DZ_FLTR_INFO_MC_PDMA_DST_WIDTH 8
+#define ESE_DZ_DST_NCSI 64
+#define ESE_DZ_DST_PORT0 32
+#define ESE_DZ_DST_PORT1 16
+#define ESE_DZ_DST_PORT0_IPSEC 8
+#define ESE_DZ_DST_PORT1_IPSEC 4
+#define ESE_DZ_DST_PM 2
+#define ESE_DZ_DST_TIMESTAMP 1
+#define ESF_DZ_FLTR_INFO_MC_PDMA_PRIORITY_LBN 4
+#define ESF_DZ_FLTR_INFO_MC_PDMA_PRIORITY_WIDTH 4
+#define ESF_DZ_FLTR_INFO_MC_PDMA_SRC_LBN 0
+#define ESF_DZ_FLTR_INFO_MC_PDMA_SRC_WIDTH 4
+
+
+/* ES_fltr_info_wrd_rxdi_to_rxdp */
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_INNER_VLAN_LBN 112
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_INNER_VLAN_WIDTH 16
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_OUTER_VLAN_LBN 96
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_OUTER_VLAN_WIDTH 16
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_THASH1_LBN 80
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_THASH1_WIDTH 16
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_THASH0_LBN 64
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_THASH0_WIDTH 16
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_TIMESTAMP1_LBN 48
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_TIMESTAMP1_WIDTH 16
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_TIMESTAMP0_LBN 32
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_TIMESTAMP0_WIDTH 16
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_CNP_LBN 31
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_CNP_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_IVP_LBN 30
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_IVP_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_OVP_LBN 29
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_OVP_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_ST2_LBN 28
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_ST2_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_ST1_LBN 27
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_ST1_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_ST0_LBN 26
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_ST0_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_RX_QID_LBN 16
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_RX_QID_WIDTH 10
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_DST_HOST_LBN 15
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_DST_HOST_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_DST_MC_LBN 14
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_DST_MC_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_DST_P0_LBN 13
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_DST_P0_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_DST_P1_LBN 12
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_DST_P1_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_RESERVED1_LBN 11
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_RESERVED1_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_DST_CRF_LBN 10
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_DST_CRF_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_RESERVED0_LBN 9
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_RESERVED0_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_REPLAY_LBN 8
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_REPLAY_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_IPSEC_LBN 7
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_IPSEC_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_PRIORITY_LBN 4
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_PRIORITY_WIDTH 3
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_SRC_LBN 0
+#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_SRC_WIDTH 4
+
+
+/* ES_fltr_info_wrd_rxdp_to_host */
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_RESERVED3_LBN 33
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_RESERVED3_WIDTH 31
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_RMON_SOFT_LBN 32
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_RMON_SOFT_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_RESERVED2_LBN 27
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_RESERVED2_WIDTH 5
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_RX_QID_LBN 16
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_RX_QID_WIDTH 11
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_DST_HOST_LBN 15
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_DST_HOST_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_DST_MC_LBN 14
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_DST_MC_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_DST_P0_LBN 13
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_DST_P0_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_DST_P1_LBN 12
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_DST_P1_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_RESERVED1_LBN 11
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_RESERVED1_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_DST_CRF_LBN 10
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_DST_CRF_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_RESERVED0_LBN 9
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_RESERVED0_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_REPLAY_LBN 8
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_REPLAY_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_IPSEC_LBN 7
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_IPSEC_WIDTH 1
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_PRIORITY_LBN 4
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_PRIORITY_WIDTH 3
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_SRC_LBN 0
+#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_SRC_WIDTH 4
+
+
+/* ES_fltr_info_wrd_tx_to_mac */
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_PRV_LBN 63
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_PRV_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_LB_LBN 62
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_LB_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_MS0_LBN 61
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_MS0_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_MS1_LBN 60
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_MS1_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_NDI_LBN 59
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_NDI_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_RESERVED2_LBN 48
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_RESERVED2_WIDTH 11
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_IPSEC_SA_LBN 32
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_IPSEC_SA_WIDTH 16
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_TX_STACK_ID_LBN 24
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_TX_STACK_ID_WIDTH 8
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_TX_DOMAIN_LBN 16
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_TX_DOMAIN_WIDTH 8
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_RESERVED1_LBN 14
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_RESERVED1_WIDTH 2
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_DST_P0_LBN 13
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_DST_P0_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_DST_P1_LBN 12
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_DST_P1_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_DST_IP0_LBN 11
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_DST_IP0_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_DST_IP1_LBN 10
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_DST_IP1_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_DST_PM_LBN 9
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_DST_PM_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_RESERVED0_LBN 8
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_RESERVED0_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_IPSEC_LBN 7
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_IPSEC_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_PRIORITY_LBN 4
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_PRIORITY_WIDTH 3
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_SRC_LBN 0
+#define ESF_DZ_FLTR_INFO_TX_TO_MAC_SRC_WIDTH 4
+
+
+/* ES_fltr_info_wrd_txdi_to_txdp */
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_INNER_VLAN_LBN 112
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_INNER_VLAN_WIDTH 16
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_OUTER_VLAN_LBN 96
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_OUTER_VLAN_WIDTH 16
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_CNP_LBN 95
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_CNP_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_IVP_LBN 94
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_IVP_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_OVP_LBN 93
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_OVP_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_RESERVED4_LBN 90
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_RESERVED4_WIDTH 3
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_QID_LBN 80
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_QID_WIDTH 10
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_VRI_LBN 79
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_VRI_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_RESERVED3_LBN 78
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_RESERVED3_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_MTU_DIV4_LBN 66
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_MTU_DIV4_WIDTH 12
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_VRI_OP_LBN 64
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_VRI_OP_WIDTH 2
+#define ESE_DZ_VRI_OP_INSERT_REPLACE 3
+#define ESE_DZ_VRI_OP_INSERT_INSERT 2
+#define ESE_DZ_VRI_OP_REPLACE 1
+#define ESE_DZ_VRI_OP_INSERT 0
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_PRV_LBN 63
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_PRV_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_LB_LBN 62
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_LB_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_MS0_LBN 61
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_MS0_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_MS1_LBN 60
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_MS1_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_NDI_LBN 59
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_NDI_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_TXDP_CONTEXT_OUT_LBN 48
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_TXDP_CONTEXT_OUT_WIDTH 11
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_IPSEC_SA_LBN 32
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_IPSEC_SA_WIDTH 16
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_TX_STACK_ID_LBN 24
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_TX_STACK_ID_WIDTH 8
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_TX_DOMAIN_LBN 16
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_TX_DOMAIN_WIDTH 8
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_RESERVED1_LBN 14
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_RESERVED1_WIDTH 2
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_DST_P0_LBN 13
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_DST_P0_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_DST_P1_LBN 12
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_DST_P1_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_DST_IP0_LBN 11
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_DST_IP0_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_DST_IP1_LBN 10
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_DST_IP1_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_DST_PM_LBN 9
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_DST_PM_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_RESERVED0_LBN 8
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_RESERVED0_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_IPSEC_LBN 7
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_IPSEC_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_PRIORITY_LBN 4
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_PRIORITY_WIDTH 3
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_SRC_LBN 0
+#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_SRC_WIDTH 4
+
+
+/* ES_fltr_info_wrd_txdp_to_txdi */
+#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_VLAN_OP_LBN 62
+#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_VLAN_OP_WIDTH 2
+#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_RESERVED1_LBN 58
+#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_RESERVED1_WIDTH 4
+#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_TX_QID_LBN 48
+#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_TX_QID_WIDTH 10
+#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_INNER_VLAN_LBN 32
+#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_INNER_VLAN_WIDTH 16
+#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_OUTER_VLAN_LBN 16
+#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_OUTER_VLAN_WIDTH 16
+#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_TXDP_CONTEXT_IN_LBN 5
+#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_TXDP_CONTEXT_IN_WIDTH 11
+#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_RESERVED0_LBN 4
+#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_RESERVED0_WIDTH 1
+#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_SRC_LBN 0
+#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_SRC_WIDTH 4
+
+
+/* ES_nwk_ev_merge_blk_cmd */
+#define ESF_DZ_EV_MERGE_BLK_COMMAND_OP_LBN 28
+#define ESF_DZ_EV_MERGE_BLK_COMMAND_OP_WIDTH 4
+#define ESE_DZ_EV_MERGE_BLK_COMMAND_OP_FLUSH 2
+#define ESE_DZ_EV_MERGE_BLK_COMMAND_OP_ENABLE 1
+#define ESE_DZ_EV_MERGE_BLK_COMMAND_OP_DISABLE 0
+#define ESF_DZ_EV_MERGE_BLK_COMMAND_BUSY_LBN 31
+#define ESF_DZ_EV_MERGE_BLK_COMMAND_BUSY_WIDTH 1
+#define ESF_DZ_EV_MERGE_BLK_COMMAND_EVQ_IDX_LBN 0
+#define ESF_DZ_EV_MERGE_BLK_COMMAND_EVQ_IDX_WIDTH 11
+
+
+/* ES_txpm2ini_cpl_rsp */
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_ECC_LBN 284
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_ECC_WIDTH 32
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_EOT_LBN 283
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_EOT_WIDTH 1
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW0_LBN 27
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW0_WIDTH 32
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW1_LBN 59
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW1_WIDTH 32
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW2_LBN 91
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW2_WIDTH 32
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW3_LBN 123
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW3_WIDTH 32
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW4_LBN 155
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW4_WIDTH 32
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW5_LBN 187
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW5_WIDTH 32
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW6_LBN 219
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW6_WIDTH 32
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW7_LBN 251
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW7_WIDTH 32
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_LBN 27
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_WIDTH 256
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_ERROR_LBN 26
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_ERROR_WIDTH 1
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_LAST_LBN 25
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_LAST_WIDTH 1
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_TAG_LBN 19
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_TAG_WIDTH 6
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_LEN_LBN 7
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_LEN_WIDTH 12
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_ADRS_LBN 0
+#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_ADRS_WIDTH 7
+
-/* Enum DPCPU_INSTR_BRTYPE */
-#define ESE_DZ_BNEZAL 19
-#define ESE_DZ_BEQZAL 18
-#define ESE_DZ_BGEZAL 17
-#define ESE_DZ_BLTZAL 16
-#define ESE_DZ_BNEZ 3
-#define ESE_DZ_BEQZ 2
-#define ESE_DZ_BGEZ 1
-#define ESE_DZ_BLTZ 0
-
-/* Enum DPCPU_INSTR_FUNCT */
-#define ESE_DZ_MASKMOD 44
-#define ESE_DZ_SLTU 43
-#define ESE_DZ_SLT 42
-#define ESE_DZ_INCMOD 40
-#define ESE_DZ_NOR 39
-#define ESE_DZ_XOR 38
-#define ESE_DZ_OR 37
-#define ESE_DZ_AND 36
-#define ESE_DZ_SUBU 35
-#define ESE_DZ_SUB 34
-#define ESE_DZ_ADDU 33
-#define ESE_DZ_ADD 32
-#define ESE_DZ_MULT 25
-#define ESE_DZ_MFLO 18
-#define ESE_DZ_MFHI 16
-#define ESE_DZ_JALR 9
-#define ESE_DZ_JR 8
-#define ESE_DZ_SRAV 7
-#define ESE_DZ_SRLV 6
-#define ESE_DZ_SLLV 4
-#define ESE_DZ_SRA 3
-#define ESE_DZ_SRL 2
-#define ESE_DZ_SLL 0
-
-/* Enum DPCPU_INSTR_OP */
-#define ESE_DZ_LM_MSG 49
-#define ESE_DZ_MSG 48
-#define ESE_DZ_SHA 43
-#define ESE_DZ_SBA 42
-#define ESE_DZ_SH 41
-#define ESE_DZ_SB 40
-#define ESE_DZ_LHUA 39
-#define ESE_DZ_LBUA 38
-#define ESE_DZ_LHU 37
-#define ESE_DZ_LBU 36
-#define ESE_DZ_LHA 35
-#define ESE_DZ_LBA 34
-#define ESE_DZ_LH 33
-#define ESE_DZ_LB 32
-#define ESE_DZ_BGTU 31
-#define ESE_DZ_BLEU 30
-#define ESE_DZ_MODI 28
-#define ESE_DZ_NEGU 27
-#define ESE_DZ_NEG 26
-#define ESE_DZ_LI 25
-#define ESE_DZ_INCMODI 24
-#define ESE_DZ_BGT 23
-#define ESE_DZ_BLE 22
-#define ESE_DZ_BBS 21
-#define ESE_DZ_BBC 20
-#define ESE_DZ_JAL_EVT 19
-#define ESE_DZ_J_EVT 18
-#define ESE_DZ_HALT 16
-#define ESE_DZ_NORI 15
-#define ESE_DZ_XORI 14
-#define ESE_DZ_ORI 13
-#define ESE_DZ_ANDI 12
-#define ESE_DZ_SLTIU 11
-#define ESE_DZ_SLTI 10
-#define ESE_DZ_ADDIU 9
-#define ESE_DZ_ADDI 8
-#define ESE_DZ_BGTZ 7
-#define ESE_DZ_BLEZ 6
-#define ESE_DZ_BNE 5
-#define ESE_DZ_BEQ 4
-#define ESE_DZ_JAL 3
-#define ESE_DZ_J 2
-#define ESE_DZ_BRANCH 1
-#define ESE_DZ_REG2REG 0
-
-/* Enum DPCPU_MSG_DIR */
-#define ESE_DPCPU_MSG_DZ_OUTB 0x1
-#define ESE_DPCPU_MSG_DZ_INB 0x0
-
-/* Enum DPCPU_PDBUS_OP */
-#define ESE_DPCPU_PDBUS_DZ_RD 0x1
-#define ESE_DPCPU_PDBUS_DZ_WR 0x0
/* Enum INI_OP */
#define ESE_DZ_RD_COMPL 0x3
@@ -2778,6 +2891,19 @@ extern "C" {
#define ESE_DZ_MSI 0x1
#define ESE_DZ_MSIX 0x0
+/* Enum MC_PDMA_BUFFER_ID */
+#define ESE_DZ_MC_PDMA_BUFFER_ALL 4
+#define ESE_DZ_MC_PDMA_BUFFER_RXDP 3
+#define ESE_DZ_MC_PDMA_BUFFER_NCSI 2
+#define ESE_DZ_MC_PDMA_BUFFER_NWPORT1 1
+#define ESE_DZ_MC_PDMA_BUFFER_NWPORT0 0
+
+/* Enum MC_PDMA_INTERFACE_ID */
+#define ESE_DZ_MC_PDMA_INTERFACE_RXDP 3
+#define ESE_DZ_MC_PDMA_INTERFACE_NCSI 2
+#define ESE_DZ_MC_PDMA_INTERFACE_NWPORT1 1
+#define ESE_DZ_MC_PDMA_INTERFACE_NWPORT0 0
+
/* Enum PKT_STRM_CTL */
#define ESE_DZ_EOP_TRUNC 0x3
#define ESE_DZ_EOP_CRC_ERR 0x2
diff --git a/sys/dev/sfxge/common/efx_regs_mcdi.h b/sys/dev/sfxge/common/efx_regs_mcdi.h
index 9016ca9..bd35970 100644
--- a/sys/dev/sfxge/common/efx_regs_mcdi.h
+++ b/sys/dev/sfxge/common/efx_regs_mcdi.h
@@ -1,5 +1,5 @@
/*-
- * Copyright 2008-2011 Solarflare Communications Inc. All rights reserved.
+ * Copyright 2008-2013 Solarflare Communications Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -39,6 +39,17 @@
#define MC_FW_STATE_BOOTING (4)
/* The Scheduler has started. */
#define MC_FW_STATE_SCHED (8)
+/* If this is set in MC_RESET_STATE_REG then it should be
+ * possible to jump into IMEM without loading code from flash.
+ * Unlike a warm boot, assume DMEM has been reloaded, so that
+ * the MC persistent data must be reinitialised. */
+#define MC_FW_TEPID_BOOT_OK (16)
+/* We have entered the main firmware via recovery mode. This
+ * means that MC persistent data must be reinitialised, but that
+ * we shouldn't touch PCIe config. */
+#define MC_FW_RECOVERY_MODE_PCIE_INIT_OK (32)
+/* BIST state has been initialized */
+#define MC_FW_BIST_INIT_OK (128)
/* Siena MC shared memmory offsets */
/* The 'doorbell' addresses are hard-wired to alert the MC when written */
@@ -57,6 +68,9 @@
#define MC_STATUS_DWORD_REBOOT (0xb007b007)
#define MC_STATUS_DWORD_ASSERT (0xdeaddead)
+/* Check whether an mcfw version (in host order) belongs to a bootloader */
+#define MC_FW_VERSION_IS_BOOTLOADER(_v) (((_v) >> 16) == 0xb007)
+
/* The current version of the MCDI protocol.
*
* Note that the ROM burnt into the card only talks V0, so at the very
@@ -72,7 +86,7 @@
/* MCDI version 1
*
- * Each MCDI request starts with an MCDI_HEADER, which is a 32byte
+ * Each MCDI request starts with an MCDI_HEADER, which is a 32bit
* structure, filled in by the client.
*
* 0 7 8 16 20 22 23 24 31
@@ -109,9 +123,11 @@
#define MCDI_HEADER_DATALEN_LBN 8
#define MCDI_HEADER_DATALEN_WIDTH 8
#define MCDI_HEADER_SEQ_LBN 16
-#define MCDI_HEADER_RSVD_LBN 20
-#define MCDI_HEADER_RSVD_WIDTH 2
#define MCDI_HEADER_SEQ_WIDTH 4
+#define MCDI_HEADER_RSVD_LBN 20
+#define MCDI_HEADER_RSVD_WIDTH 1
+#define MCDI_HEADER_NOT_EPOCH_LBN 21
+#define MCDI_HEADER_NOT_EPOCH_WIDTH 1
#define MCDI_HEADER_ERROR_LBN 22
#define MCDI_HEADER_ERROR_WIDTH 1
#define MCDI_HEADER_RESPONSE_LBN 23
@@ -122,12 +138,16 @@
#define MCDI_HEADER_XFLAGS_EVREQ 0x01
/* Maximum number of payload bytes */
+#define MCDI_CTL_SDU_LEN_MAX_V1 0xfc
+#define MCDI_CTL_SDU_LEN_MAX_V2 0x400
+
#ifdef WITH_MCDI_V2
-#define MCDI_CTL_SDU_LEN_MAX 0x400
+#define MCDI_CTL_SDU_LEN_MAX MCDI_CTL_SDU_LEN_MAX_V2
#else
-#define MCDI_CTL_SDU_LEN_MAX 0xfc
+#define MCDI_CTL_SDU_LEN_MAX MCDI_CTL_SDU_LEN_MAX_V1
#endif
+
/* The MC can generate events for two reasons:
* - To complete a shared memory request if XFLAGS_EVREQ was set
* - As a notification (link state, i2c event), controlled
@@ -171,22 +191,114 @@
#define FSE_AZ_EV_CODE_MCDI_EVRESPONSE 0xc
+/* Operation not permitted. */
+#define MC_CMD_ERR_EPERM 1
/* Non-existent command target */
#define MC_CMD_ERR_ENOENT 2
/* assert() has killed the MC */
#define MC_CMD_ERR_EINTR 4
+/* I/O failure */
+#define MC_CMD_ERR_EIO 5
+/* Already exists */
+#define MC_CMD_ERR_EEXIST 6
+/* Try again */
+#define MC_CMD_ERR_EAGAIN 11
+/* Out of memory */
+#define MC_CMD_ERR_ENOMEM 12
/* Caller does not hold required locks */
#define MC_CMD_ERR_EACCES 13
/* Resource is currently unavailable (e.g. lock contention) */
#define MC_CMD_ERR_EBUSY 16
+/* No such device */
+#define MC_CMD_ERR_ENODEV 19
/* Invalid argument to target */
#define MC_CMD_ERR_EINVAL 22
+/* Broken pipe */
+#define MC_CMD_ERR_EPIPE 32
+/* Read-only */
+#define MC_CMD_ERR_EROFS 30
+/* Out of range */
+#define MC_CMD_ERR_ERANGE 34
/* Non-recursive resource is already acquired */
#define MC_CMD_ERR_EDEADLK 35
/* Operation not implemented */
#define MC_CMD_ERR_ENOSYS 38
/* Operation timed out */
#define MC_CMD_ERR_ETIME 62
+/* Link has been severed */
+#define MC_CMD_ERR_ENOLINK 67
+/* Protocol error */
+#define MC_CMD_ERR_EPROTO 71
+/* Operation not supported */
+#define MC_CMD_ERR_ENOTSUP 95
+/* Address not available */
+#define MC_CMD_ERR_EADDRNOTAVAIL 99
+/* Not connected */
+#define MC_CMD_ERR_ENOTCONN 107
+/* Operation already in progress */
+#define MC_CMD_ERR_EALREADY 114
+
+/* Resource allocation failed. */
+#define MC_CMD_ERR_ALLOC_FAIL 0x1000
+/* V-adaptor not found. */
+#define MC_CMD_ERR_NO_VADAPTOR 0x1001
+/* EVB port not found. */
+#define MC_CMD_ERR_NO_EVB_PORT 0x1002
+/* V-switch not found. */
+#define MC_CMD_ERR_NO_VSWITCH 0x1003
+/* Too many VLAN tags. */
+#define MC_CMD_ERR_VLAN_LIMIT 0x1004
+/* Bad PCI function number. */
+#define MC_CMD_ERR_BAD_PCI_FUNC 0x1005
+/* Invalid VLAN mode. */
+#define MC_CMD_ERR_BAD_VLAN_MODE 0x1006
+/* Invalid v-switch type. */
+#define MC_CMD_ERR_BAD_VSWITCH_TYPE 0x1007
+/* Invalid v-port type. */
+#define MC_CMD_ERR_BAD_VPORT_TYPE 0x1008
+/* MAC address exists. */
+#define MC_CMD_ERR_MAC_EXIST 0x1009
+/* Slave core not present */
+#define MC_CMD_ERR_SLAVE_NOT_PRESENT 0x100a
+/* The datapath is disabled. */
+#define MC_CMD_ERR_DATAPATH_DISABLED 0x100b
+/* The requesting client is not a function */
+#define MC_CMD_ERR_CLIENT_NOT_FN 0x100c
+/* The requested operation might require the
+ command to be passed between MCs, and the
+ transport doesn't support that. Should
+ only ever been seen over the UART. */
+#define MC_CMD_ERR_TRANSPORT_NOPROXY 0x100d
+/* VLAN tag(s) exists */
+#define MC_CMD_ERR_VLAN_EXIST 0x100e
+/* No MAC address assigned to an EVB port */
+#define MC_CMD_ERR_NO_MAC_ADDR 0x100f
+/* Notifies the driver that the request has been relayed
+ * to an admin function for authorization. The driver should
+ * wait for a PROXY_RESPONSE event and then resend its request.
+ * This error code is followed by a 32-bit handle that
+ * helps matching it with the respective PROXY_RESPONSE event. */
+#define MC_CMD_ERR_PROXY_PENDING 0x1010
+#define MC_CMD_ERR_PROXY_PENDING_HANDLE_OFST 4
+/* The request cannot be passed for authorization because
+ * another request from the same function is currently being
+ * authorized. The drvier should try again later. */
+#define MC_CMD_ERR_PROXY_INPROGRESS 0x1011
+/* Returned by MC_CMD_PROXY_COMPLETE if the caller is not the function
+ * that has enabled proxying or BLOCK_INDEX points to a function that
+ * doesn't await an authorization. */
+#define MC_CMD_ERR_PROXY_UNEXPECTED 0x1012
+/* This code is currently only used internally in FW. Its meaning is that
+ * an operation failed due to lack of SR-IOV privilege.
+ * Normally it is translated to EPERM by send_cmd_err(),
+ * but it may also be used to trigger some special mechanism
+ * for handling such case, e.g. to relay the failed request
+ * to a designated admin function for authorization. */
+#define MC_CMD_ERR_NO_PRIVILEGE 0x1013
+/* Workaround 26807 could not be turned on/off because some functions
+ * have already installed filters. See the comment at
+ * MC_CMD_WORKAROUND_BUG26807. */
+#define MC_CMD_ERR_FILTERS_PRESENT 0x1014
#define MC_CMD_ERR_CODE_OFST 0
@@ -204,9 +316,11 @@
/* Vectors in the boot ROM */
/* Point to the copycode entry point. */
-#define MC_BOOTROM_COPYCODE_VEC (0x7f4)
+#define SIENA_MC_BOOTROM_COPYCODE_VEC (0x800 - 3 * 0x4)
+#define HUNT_MC_BOOTROM_COPYCODE_VEC (0x8000 - 3 * 0x4)
/* Points to the recovery mode entry point. */
-#define MC_BOOTROM_NOFLASH_VEC (0x7f8)
+#define SIENA_MC_BOOTROM_NOFLASH_VEC (0x800 - 2 * 0x4)
+#define HUNT_MC_BOOTROM_NOFLASH_VEC (0x8000 - 2 * 0x4)
/* The command set exported by the boot ROM (MCDI v0) */
#define MC_CMD_GET_VERSION_V0_SUPPORTED_FUNCS { \
@@ -216,23 +330,28 @@
(1 << MC_CMD_GET_VERSION), \
0, 0, 0 }
-#define MC_CMD_SENSOR_INFO_OUT_OFFSET_OFST(_x) \
+#define MC_CMD_SENSOR_INFO_OUT_OFFSET_OFST(_x) \
(MC_CMD_SENSOR_ENTRY_OFST + (_x))
-#define MC_CMD_DBI_WRITE_IN_ADDRESS_OFST(n) ( \
- (MC_CMD_DBI_WRITE_IN_DBIWROP_OFST+ \
- MC_CMD_DBIWROP_TYPEDEF_ADDRESS_OFST)+ \
- ((n)*MC_CMD_DBIWROP_TYPEDEF_LEN))
+#define MC_CMD_DBI_WRITE_IN_ADDRESS_OFST(n) \
+ (MC_CMD_DBI_WRITE_IN_DBIWROP_OFST + \
+ MC_CMD_DBIWROP_TYPEDEF_ADDRESS_OFST + \
+ (n) * MC_CMD_DBIWROP_TYPEDEF_LEN)
-#define MC_CMD_DBI_WRITE_IN_BYTE_MASK_OFST(n) ( \
- (MC_CMD_DBI_WRITE_IN_DBIWROP_OFST+ \
- MC_CMD_DBIWROP_TYPEDEF_BYTE_MASK_OFST)+ \
- ((n)*MC_CMD_DBIWROP_TYPEDEF_LEN))
+#define MC_CMD_DBI_WRITE_IN_BYTE_MASK_OFST(n) \
+ (MC_CMD_DBI_WRITE_IN_DBIWROP_OFST + \
+ MC_CMD_DBIWROP_TYPEDEF_BYTE_MASK_OFST + \
+ (n) * MC_CMD_DBIWROP_TYPEDEF_LEN)
-#define MC_CMD_DBI_WRITE_IN_VALUE_OFST(n) ( \
- (MC_CMD_DBI_WRITE_IN_DBIWROP_OFST+ \
- MC_CMD_DBIWROP_TYPEDEF_VALUE_OFST)+ \
- ((n)*MC_CMD_DBIWROP_TYPEDEF_LEN))
+#define MC_CMD_DBI_WRITE_IN_VALUE_OFST(n) \
+ (MC_CMD_DBI_WRITE_IN_DBIWROP_OFST + \
+ MC_CMD_DBIWROP_TYPEDEF_VALUE_OFST + \
+ (n) * MC_CMD_DBIWROP_TYPEDEF_LEN)
+
+/* This may be ORed with an EVB_PORT_ID_xxx constant to pass a non-default
+ * stack ID (which must be in the range 1-255) along with an EVB port ID.
+ */
+#define EVB_STACK_ID(n) (((n) & 0xff) << 16)
#ifdef WITH_MCDI_V2
@@ -243,8 +362,6 @@
*/
#define MC_CMD_ERR_ARG_OFST 4
-/* Try again */
-#define MC_CMD_ERR_EAGAIN 11
/* No space */
#define MC_CMD_ERR_ENOSPC 28
@@ -256,10 +373,14 @@
#define MCDI_EVENT_CONT_WIDTH 1
#define MCDI_EVENT_LEVEL_LBN 33
#define MCDI_EVENT_LEVEL_WIDTH 3
-#define MCDI_EVENT_LEVEL_INFO 0x0 /* enum */
-#define MCDI_EVENT_LEVEL_WARN 0x1 /* enum */
-#define MCDI_EVENT_LEVEL_ERR 0x2 /* enum */
-#define MCDI_EVENT_LEVEL_FATAL 0x3 /* enum */
+/* enum: Info. */
+#define MCDI_EVENT_LEVEL_INFO 0x0
+/* enum: Warning. */
+#define MCDI_EVENT_LEVEL_WARN 0x1
+/* enum: Error. */
+#define MCDI_EVENT_LEVEL_ERR 0x2
+/* enum: Fatal. */
+#define MCDI_EVENT_LEVEL_FATAL 0x3
#define MCDI_EVENT_DATA_OFST 0
#define MCDI_EVENT_CMDDONE_SEQ_LBN 0
#define MCDI_EVENT_CMDDONE_SEQ_WIDTH 8
@@ -271,9 +392,14 @@
#define MCDI_EVENT_LINKCHANGE_LP_CAP_WIDTH 16
#define MCDI_EVENT_LINKCHANGE_SPEED_LBN 16
#define MCDI_EVENT_LINKCHANGE_SPEED_WIDTH 4
-#define MCDI_EVENT_LINKCHANGE_SPEED_100M 0x1 /* enum */
-#define MCDI_EVENT_LINKCHANGE_SPEED_1G 0x2 /* enum */
-#define MCDI_EVENT_LINKCHANGE_SPEED_10G 0x3 /* enum */
+/* enum: 100Mbs */
+#define MCDI_EVENT_LINKCHANGE_SPEED_100M 0x1
+/* enum: 1Gbs */
+#define MCDI_EVENT_LINKCHANGE_SPEED_1G 0x2
+/* enum: 10Gbs */
+#define MCDI_EVENT_LINKCHANGE_SPEED_10G 0x3
+/* enum: 40Gbs */
+#define MCDI_EVENT_LINKCHANGE_SPEED_40G 0x4
#define MCDI_EVENT_LINKCHANGE_FCNTL_LBN 20
#define MCDI_EVENT_LINKCHANGE_FCNTL_WIDTH 4
#define MCDI_EVENT_LINKCHANGE_LINK_FLAGS_LBN 24
@@ -288,41 +414,94 @@
#define MCDI_EVENT_FWALERT_DATA_WIDTH 24
#define MCDI_EVENT_FWALERT_REASON_LBN 0
#define MCDI_EVENT_FWALERT_REASON_WIDTH 8
-#define MCDI_EVENT_FWALERT_REASON_SRAM_ACCESS 0x1 /* enum */
+/* enum: SRAM Access. */
+#define MCDI_EVENT_FWALERT_REASON_SRAM_ACCESS 0x1
#define MCDI_EVENT_FLR_VF_LBN 0
#define MCDI_EVENT_FLR_VF_WIDTH 8
#define MCDI_EVENT_TX_ERR_TXQ_LBN 0
#define MCDI_EVENT_TX_ERR_TXQ_WIDTH 12
#define MCDI_EVENT_TX_ERR_TYPE_LBN 12
#define MCDI_EVENT_TX_ERR_TYPE_WIDTH 4
-#define MCDI_EVENT_TX_ERR_DL_FAIL 0x1 /* enum */
-#define MCDI_EVENT_TX_ERR_NO_EOP 0x2 /* enum */
-#define MCDI_EVENT_TX_ERR_2BIG 0x3 /* enum */
+/* enum: Descriptor loader reported failure */
+#define MCDI_EVENT_TX_ERR_DL_FAIL 0x1
+/* enum: Descriptor ring empty and no EOP seen for packet */
+#define MCDI_EVENT_TX_ERR_NO_EOP 0x2
+/* enum: Overlength packet */
+#define MCDI_EVENT_TX_ERR_2BIG 0x3
+/* enum: Malformed option descriptor */
+#define MCDI_EVENT_TX_BAD_OPTDESC 0x5
+/* enum: Option descriptor part way through a packet */
+#define MCDI_EVENT_TX_OPT_IN_PKT 0x8
+/* enum: DMA or PIO data access error */
+#define MCDI_EVENT_TX_ERR_BAD_DMA_OR_PIO 0x9
#define MCDI_EVENT_TX_ERR_INFO_LBN 16
#define MCDI_EVENT_TX_ERR_INFO_WIDTH 16
+#define MCDI_EVENT_TX_FLUSH_TO_DRIVER_LBN 12
+#define MCDI_EVENT_TX_FLUSH_TO_DRIVER_WIDTH 1
#define MCDI_EVENT_TX_FLUSH_TXQ_LBN 0
#define MCDI_EVENT_TX_FLUSH_TXQ_WIDTH 12
#define MCDI_EVENT_PTP_ERR_TYPE_LBN 0
#define MCDI_EVENT_PTP_ERR_TYPE_WIDTH 8
-#define MCDI_EVENT_PTP_ERR_PLL_LOST 0x1 /* enum */
-#define MCDI_EVENT_PTP_ERR_FILTER 0x2 /* enum */
-#define MCDI_EVENT_PTP_ERR_FIFO 0x3 /* enum */
-#define MCDI_EVENT_PTP_ERR_QUEUE 0x4 /* enum */
+/* enum: PLL lost lock */
+#define MCDI_EVENT_PTP_ERR_PLL_LOST 0x1
+/* enum: Filter overflow (PDMA) */
+#define MCDI_EVENT_PTP_ERR_FILTER 0x2
+/* enum: FIFO overflow (FPGA) */
+#define MCDI_EVENT_PTP_ERR_FIFO 0x3
+/* enum: Merge queue overflow */
+#define MCDI_EVENT_PTP_ERR_QUEUE 0x4
#define MCDI_EVENT_AOE_ERR_TYPE_LBN 0
#define MCDI_EVENT_AOE_ERR_TYPE_WIDTH 8
-#define MCDI_EVENT_AOE_NO_LOAD 0x1 /* enum */
-#define MCDI_EVENT_AOE_FC_ASSERT 0x2 /* enum */
-#define MCDI_EVENT_AOE_FC_WATCHDOG 0x3 /* enum */
-#define MCDI_EVENT_AOE_FC_NO_START 0x4 /* enum */
-#define MCDI_EVENT_AOE_FAULT 0x5 /* enum */
-#define MCDI_EVENT_AOE_CPLD_REPROGRAMMED 0x6 /* enum */
-#define MCDI_EVENT_AOE_LOAD 0x7 /* enum */
-#define MCDI_EVENT_AOE_DMA 0x8 /* enum */
-#define MCDI_EVENT_AOE_BYTEBLASTER 0x9 /* enum */
-#define MCDI_EVENT_AOE_DDR_ECC_STATUS 0xa /* enum */
-#define MCDI_EVENT_AOE_PTP_STATUS 0xb /* enum */
+/* enum: AOE failed to load - no valid image? */
+#define MCDI_EVENT_AOE_NO_LOAD 0x1
+/* enum: AOE FC reported an exception */
+#define MCDI_EVENT_AOE_FC_ASSERT 0x2
+/* enum: AOE FC watchdogged */
+#define MCDI_EVENT_AOE_FC_WATCHDOG 0x3
+/* enum: AOE FC failed to start */
+#define MCDI_EVENT_AOE_FC_NO_START 0x4
+/* enum: Generic AOE fault - likely to have been reported via other means too
+ * but intended for use by aoex driver.
+ */
+#define MCDI_EVENT_AOE_FAULT 0x5
+/* enum: Results of reprogramming the CPLD (status in AOE_ERR_DATA) */
+#define MCDI_EVENT_AOE_CPLD_REPROGRAMMED 0x6
+/* enum: AOE loaded successfully */
+#define MCDI_EVENT_AOE_LOAD 0x7
+/* enum: AOE DMA operation completed (LSB of HOST_HANDLE in AOE_ERR_DATA) */
+#define MCDI_EVENT_AOE_DMA 0x8
+/* enum: AOE byteblaster connected/disconnected (Connection status in
+ * AOE_ERR_DATA)
+ */
+#define MCDI_EVENT_AOE_BYTEBLASTER 0x9
+/* enum: DDR ECC status update */
+#define MCDI_EVENT_AOE_DDR_ECC_STATUS 0xa
+/* enum: PTP status update */
+#define MCDI_EVENT_AOE_PTP_STATUS 0xb
#define MCDI_EVENT_AOE_ERR_DATA_LBN 8
#define MCDI_EVENT_AOE_ERR_DATA_WIDTH 8
+#define MCDI_EVENT_RX_ERR_RXQ_LBN 0
+#define MCDI_EVENT_RX_ERR_RXQ_WIDTH 12
+#define MCDI_EVENT_RX_ERR_TYPE_LBN 12
+#define MCDI_EVENT_RX_ERR_TYPE_WIDTH 4
+#define MCDI_EVENT_RX_ERR_INFO_LBN 16
+#define MCDI_EVENT_RX_ERR_INFO_WIDTH 16
+#define MCDI_EVENT_RX_FLUSH_TO_DRIVER_LBN 12
+#define MCDI_EVENT_RX_FLUSH_TO_DRIVER_WIDTH 1
+#define MCDI_EVENT_RX_FLUSH_RXQ_LBN 0
+#define MCDI_EVENT_RX_FLUSH_RXQ_WIDTH 12
+#define MCDI_EVENT_MC_REBOOT_COUNT_LBN 0
+#define MCDI_EVENT_MC_REBOOT_COUNT_WIDTH 16
+#define MCDI_EVENT_MUM_ERR_TYPE_LBN 0
+#define MCDI_EVENT_MUM_ERR_TYPE_WIDTH 8
+/* enum: MUM failed to load - no valid image? */
+#define MCDI_EVENT_MUM_NO_LOAD 0x1
+/* enum: MUM f/w reported an exception */
+#define MCDI_EVENT_MUM_ASSERT 0x2
+/* enum: MUM not kicking watchdog */
+#define MCDI_EVENT_MUM_WATCHDOG 0x3
+#define MCDI_EVENT_MUM_ERR_DATA_LBN 8
+#define MCDI_EVENT_MUM_ERR_DATA_WIDTH 8
#define MCDI_EVENT_DATA_LBN 0
#define MCDI_EVENT_DATA_WIDTH 32
#define MCDI_EVENT_SRC_LBN 36
@@ -331,24 +510,74 @@
#define MCDI_EVENT_EV_CODE_WIDTH 4
#define MCDI_EVENT_CODE_LBN 44
#define MCDI_EVENT_CODE_WIDTH 8
-#define MCDI_EVENT_CODE_BADSSERT 0x1 /* enum */
-#define MCDI_EVENT_CODE_PMNOTICE 0x2 /* enum */
-#define MCDI_EVENT_CODE_CMDDONE 0x3 /* enum */
-#define MCDI_EVENT_CODE_LINKCHANGE 0x4 /* enum */
-#define MCDI_EVENT_CODE_SENSOREVT 0x5 /* enum */
-#define MCDI_EVENT_CODE_SCHEDERR 0x6 /* enum */
-#define MCDI_EVENT_CODE_REBOOT 0x7 /* enum */
-#define MCDI_EVENT_CODE_MAC_STATS_DMA 0x8 /* enum */
-#define MCDI_EVENT_CODE_FWALERT 0x9 /* enum */
-#define MCDI_EVENT_CODE_FLR 0xa /* enum */
-#define MCDI_EVENT_CODE_TX_ERR 0xb /* enum */
-#define MCDI_EVENT_CODE_TX_FLUSH 0xc /* enum */
-#define MCDI_EVENT_CODE_PTP_RX 0xd /* enum */
-#define MCDI_EVENT_CODE_PTP_FAULT 0xe /* enum */
-#define MCDI_EVENT_CODE_PTP_PPS 0xf /* enum */
-#define MCDI_EVENT_CODE_AOE 0x12 /* enum */
-#define MCDI_EVENT_CODE_VCAL_FAIL 0x13 /* enum */
-#define MCDI_EVENT_CODE_HW_PPS 0x14 /* enum */
+/* enum: Event generated by host software */
+#define MCDI_EVENT_SW_EVENT 0x0
+/* enum: Bad assert. */
+#define MCDI_EVENT_CODE_BADSSERT 0x1
+/* enum: PM Notice. */
+#define MCDI_EVENT_CODE_PMNOTICE 0x2
+/* enum: Command done. */
+#define MCDI_EVENT_CODE_CMDDONE 0x3
+/* enum: Link change. */
+#define MCDI_EVENT_CODE_LINKCHANGE 0x4
+/* enum: Sensor Event. */
+#define MCDI_EVENT_CODE_SENSOREVT 0x5
+/* enum: Schedule error. */
+#define MCDI_EVENT_CODE_SCHEDERR 0x6
+/* enum: Reboot. */
+#define MCDI_EVENT_CODE_REBOOT 0x7
+/* enum: Mac stats DMA. */
+#define MCDI_EVENT_CODE_MAC_STATS_DMA 0x8
+/* enum: Firmware alert. */
+#define MCDI_EVENT_CODE_FWALERT 0x9
+/* enum: Function level reset. */
+#define MCDI_EVENT_CODE_FLR 0xa
+/* enum: Transmit error */
+#define MCDI_EVENT_CODE_TX_ERR 0xb
+/* enum: Tx flush has completed */
+#define MCDI_EVENT_CODE_TX_FLUSH 0xc
+/* enum: PTP packet received timestamp */
+#define MCDI_EVENT_CODE_PTP_RX 0xd
+/* enum: PTP NIC failure */
+#define MCDI_EVENT_CODE_PTP_FAULT 0xe
+/* enum: PTP PPS event */
+#define MCDI_EVENT_CODE_PTP_PPS 0xf
+/* enum: Rx flush has completed */
+#define MCDI_EVENT_CODE_RX_FLUSH 0x10
+/* enum: Receive error */
+#define MCDI_EVENT_CODE_RX_ERR 0x11
+/* enum: AOE fault */
+#define MCDI_EVENT_CODE_AOE 0x12
+/* enum: Network port calibration failed (VCAL). */
+#define MCDI_EVENT_CODE_VCAL_FAIL 0x13
+/* enum: HW PPS event */
+#define MCDI_EVENT_CODE_HW_PPS 0x14
+/* enum: The MC has rebooted (huntington and later, siena uses CODE_REBOOT and
+ * a different format)
+ */
+#define MCDI_EVENT_CODE_MC_REBOOT 0x15
+/* enum: the MC has detected a parity error */
+#define MCDI_EVENT_CODE_PAR_ERR 0x16
+/* enum: the MC has detected a correctable error */
+#define MCDI_EVENT_CODE_ECC_CORR_ERR 0x17
+/* enum: the MC has detected an uncorrectable error */
+#define MCDI_EVENT_CODE_ECC_FATAL_ERR 0x18
+/* enum: The MC has entered offline BIST mode */
+#define MCDI_EVENT_CODE_MC_BIST 0x19
+/* enum: PTP tick event providing current NIC time */
+#define MCDI_EVENT_CODE_PTP_TIME 0x1a
+/* enum: MUM fault */
+#define MCDI_EVENT_CODE_MUM 0x1b
+/* enum: notify the designated PF of a new authorization request */
+#define MCDI_EVENT_CODE_PROXY_REQUEST 0x1c
+/* enum: notify a function that awaits an authorization that its request has
+ * been processed and it may now resend the command
+ */
+#define MCDI_EVENT_CODE_PROXY_RESPONSE 0x1d
+/* enum: Artificial event generated by host and posted via MC for test
+ * purposes.
+ */
+#define MCDI_EVENT_CODE_TESTGEN 0xfa
#define MCDI_EVENT_CMDDONE_DATA_OFST 0
#define MCDI_EVENT_CMDDONE_DATA_LBN 0
#define MCDI_EVENT_CMDDONE_DATA_WIDTH 32
@@ -364,15 +593,81 @@
#define MCDI_EVENT_TX_ERR_DATA_OFST 0
#define MCDI_EVENT_TX_ERR_DATA_LBN 0
#define MCDI_EVENT_TX_ERR_DATA_WIDTH 32
+/* For CODE_PTP_RX, CODE_PTP_PPS and CODE_HW_PPS events the seconds field of
+ * timestamp
+ */
#define MCDI_EVENT_PTP_SECONDS_OFST 0
#define MCDI_EVENT_PTP_SECONDS_LBN 0
#define MCDI_EVENT_PTP_SECONDS_WIDTH 32
+/* For CODE_PTP_RX, CODE_PTP_PPS and CODE_HW_PPS events the major field of
+ * timestamp
+ */
+#define MCDI_EVENT_PTP_MAJOR_OFST 0
+#define MCDI_EVENT_PTP_MAJOR_LBN 0
+#define MCDI_EVENT_PTP_MAJOR_WIDTH 32
+/* For CODE_PTP_RX, CODE_PTP_PPS and CODE_HW_PPS events the nanoseconds field
+ * of timestamp
+ */
#define MCDI_EVENT_PTP_NANOSECONDS_OFST 0
#define MCDI_EVENT_PTP_NANOSECONDS_LBN 0
#define MCDI_EVENT_PTP_NANOSECONDS_WIDTH 32
+/* For CODE_PTP_RX, CODE_PTP_PPS and CODE_HW_PPS events the minor field of
+ * timestamp
+ */
+#define MCDI_EVENT_PTP_MINOR_OFST 0
+#define MCDI_EVENT_PTP_MINOR_LBN 0
+#define MCDI_EVENT_PTP_MINOR_WIDTH 32
+/* For CODE_PTP_RX events, the lowest four bytes of sourceUUID from PTP packet
+ */
#define MCDI_EVENT_PTP_UUID_OFST 0
#define MCDI_EVENT_PTP_UUID_LBN 0
#define MCDI_EVENT_PTP_UUID_WIDTH 32
+#define MCDI_EVENT_RX_ERR_DATA_OFST 0
+#define MCDI_EVENT_RX_ERR_DATA_LBN 0
+#define MCDI_EVENT_RX_ERR_DATA_WIDTH 32
+#define MCDI_EVENT_PAR_ERR_DATA_OFST 0
+#define MCDI_EVENT_PAR_ERR_DATA_LBN 0
+#define MCDI_EVENT_PAR_ERR_DATA_WIDTH 32
+#define MCDI_EVENT_ECC_CORR_ERR_DATA_OFST 0
+#define MCDI_EVENT_ECC_CORR_ERR_DATA_LBN 0
+#define MCDI_EVENT_ECC_CORR_ERR_DATA_WIDTH 32
+#define MCDI_EVENT_ECC_FATAL_ERR_DATA_OFST 0
+#define MCDI_EVENT_ECC_FATAL_ERR_DATA_LBN 0
+#define MCDI_EVENT_ECC_FATAL_ERR_DATA_WIDTH 32
+/* For CODE_PTP_TIME events, the major value of the PTP clock */
+#define MCDI_EVENT_PTP_TIME_MAJOR_OFST 0
+#define MCDI_EVENT_PTP_TIME_MAJOR_LBN 0
+#define MCDI_EVENT_PTP_TIME_MAJOR_WIDTH 32
+/* For CODE_PTP_TIME events, bits 19-26 of the minor value of the PTP clock */
+#define MCDI_EVENT_PTP_TIME_MINOR_26_19_LBN 36
+#define MCDI_EVENT_PTP_TIME_MINOR_26_19_WIDTH 8
+/* For CODE_PTP_TIME events where report sync status is enabled, indicates
+ * whether the NIC clock has ever been set
+ */
+#define MCDI_EVENT_PTP_TIME_NIC_CLOCK_VALID_LBN 36
+#define MCDI_EVENT_PTP_TIME_NIC_CLOCK_VALID_WIDTH 1
+/* For CODE_PTP_TIME events where report sync status is enabled, indicates
+ * whether the NIC and System clocks are in sync
+ */
+#define MCDI_EVENT_PTP_TIME_HOST_NIC_IN_SYNC_LBN 37
+#define MCDI_EVENT_PTP_TIME_HOST_NIC_IN_SYNC_WIDTH 1
+/* For CODE_PTP_TIME events where report sync status is enabled, bits 21-26 of
+ * the minor value of the PTP clock
+ */
+#define MCDI_EVENT_PTP_TIME_MINOR_26_21_LBN 38
+#define MCDI_EVENT_PTP_TIME_MINOR_26_21_WIDTH 6
+#define MCDI_EVENT_PROXY_REQUEST_BUFF_INDEX_OFST 0
+#define MCDI_EVENT_PROXY_REQUEST_BUFF_INDEX_LBN 0
+#define MCDI_EVENT_PROXY_REQUEST_BUFF_INDEX_WIDTH 32
+#define MCDI_EVENT_PROXY_RESPONSE_HANDLE_OFST 0
+#define MCDI_EVENT_PROXY_RESPONSE_HANDLE_LBN 0
+#define MCDI_EVENT_PROXY_RESPONSE_HANDLE_WIDTH 32
+/* Zero means that the request has been completed or authorized, and the driver
+ * should resend it. A non-zero value means that the authorization has been
+ * denied, and gives the reason. Typically it will be EPERM.
+ */
+#define MCDI_EVENT_PROXY_RESPONSE_RC_LBN 36
+#define MCDI_EVENT_PROXY_RESPONSE_RC_WIDTH 8
/* FCDI_EVENT structuredef */
#define FCDI_EVENT_LEN 8
@@ -380,10 +675,14 @@
#define FCDI_EVENT_CONT_WIDTH 1
#define FCDI_EVENT_LEVEL_LBN 33
#define FCDI_EVENT_LEVEL_WIDTH 3
-#define FCDI_EVENT_LEVEL_INFO 0x0 /* enum */
-#define FCDI_EVENT_LEVEL_WARN 0x1 /* enum */
-#define FCDI_EVENT_LEVEL_ERR 0x2 /* enum */
-#define FCDI_EVENT_LEVEL_FATAL 0x3 /* enum */
+/* enum: Info. */
+#define FCDI_EVENT_LEVEL_INFO 0x0
+/* enum: Warning. */
+#define FCDI_EVENT_LEVEL_WARN 0x1
+/* enum: Error. */
+#define FCDI_EVENT_LEVEL_ERR 0x2
+/* enum: Fatal. */
+#define FCDI_EVENT_LEVEL_FATAL 0x3
#define FCDI_EVENT_DATA_OFST 0
#define FCDI_EVENT_LINK_STATE_STATUS_LBN 0
#define FCDI_EVENT_LINK_STATE_STATUS_WIDTH 1
@@ -397,15 +696,26 @@
#define FCDI_EVENT_EV_CODE_WIDTH 4
#define FCDI_EVENT_CODE_LBN 44
#define FCDI_EVENT_CODE_WIDTH 8
-#define FCDI_EVENT_CODE_REBOOT 0x1 /* enum */
-#define FCDI_EVENT_CODE_ASSERT 0x2 /* enum */
-#define FCDI_EVENT_CODE_DDR_TEST_RESULT 0x3 /* enum */
-#define FCDI_EVENT_CODE_LINK_STATE 0x4 /* enum */
-#define FCDI_EVENT_CODE_TIMED_READ 0x5 /* enum */
-#define FCDI_EVENT_CODE_PPS_IN 0x6 /* enum */
-#define FCDI_EVENT_CODE_PTP_TICK 0x7 /* enum */
-#define FCDI_EVENT_CODE_DDR_ECC_STATUS 0x8 /* enum */
-#define FCDI_EVENT_CODE_PTP_STATUS 0x9 /* enum */
+/* enum: The FC was rebooted. */
+#define FCDI_EVENT_CODE_REBOOT 0x1
+/* enum: Bad assert. */
+#define FCDI_EVENT_CODE_ASSERT 0x2
+/* enum: DDR3 test result. */
+#define FCDI_EVENT_CODE_DDR_TEST_RESULT 0x3
+/* enum: Link status. */
+#define FCDI_EVENT_CODE_LINK_STATE 0x4
+/* enum: A timed read is ready to be serviced. */
+#define FCDI_EVENT_CODE_TIMED_READ 0x5
+/* enum: One or more PPS IN events */
+#define FCDI_EVENT_CODE_PPS_IN 0x6
+/* enum: Tick event from PTP clock */
+#define FCDI_EVENT_CODE_PTP_TICK 0x7
+/* enum: ECC error counters */
+#define FCDI_EVENT_CODE_DDR_ECC_STATUS 0x8
+/* enum: Current status of PTP */
+#define FCDI_EVENT_CODE_PTP_STATUS 0x9
+/* enum: Port id config to map MC-FC port idx */
+#define FCDI_EVENT_CODE_PORT_CONFIG 0xa
#define FCDI_EVENT_ASSERT_INSTR_ADDRESS_OFST 0
#define FCDI_EVENT_ASSERT_INSTR_ADDRESS_LBN 0
#define FCDI_EVENT_ASSERT_INSTR_ADDRESS_WIDTH 32
@@ -430,20 +740,36 @@
#define FCDI_EVENT_DDR_ECC_STATUS_STATUS_OFST 0
#define FCDI_EVENT_DDR_ECC_STATUS_STATUS_LBN 0
#define FCDI_EVENT_DDR_ECC_STATUS_STATUS_WIDTH 32
-
-/* FCDI_EXTENDED_EVENT_PPS structuredef */
+/* Index of MC port being referred to */
+#define FCDI_EVENT_PORT_CONFIG_SRC_LBN 36
+#define FCDI_EVENT_PORT_CONFIG_SRC_WIDTH 8
+/* FC Port index that matches the MC port index in SRC */
+#define FCDI_EVENT_PORT_CONFIG_DATA_OFST 0
+#define FCDI_EVENT_PORT_CONFIG_DATA_LBN 0
+#define FCDI_EVENT_PORT_CONFIG_DATA_WIDTH 32
+
+/* FCDI_EXTENDED_EVENT_PPS structuredef: Extended FCDI event to send PPS events
+ * to the MC. Note that this structure | is overlayed over a normal FCDI event
+ * such that bits 32-63 containing | event code, level, source etc remain the
+ * same. In this case the data | field of the header is defined to be the
+ * number of timestamps
+ */
#define FCDI_EXTENDED_EVENT_PPS_LENMIN 16
#define FCDI_EXTENDED_EVENT_PPS_LENMAX 248
#define FCDI_EXTENDED_EVENT_PPS_LEN(num) (8+8*(num))
+/* Number of timestamps following */
#define FCDI_EXTENDED_EVENT_PPS_COUNT_OFST 0
#define FCDI_EXTENDED_EVENT_PPS_COUNT_LBN 0
#define FCDI_EXTENDED_EVENT_PPS_COUNT_WIDTH 32
+/* Seconds field of a timestamp record */
#define FCDI_EXTENDED_EVENT_PPS_SECONDS_OFST 8
#define FCDI_EXTENDED_EVENT_PPS_SECONDS_LBN 64
#define FCDI_EXTENDED_EVENT_PPS_SECONDS_WIDTH 32
+/* Nanoseconds field of a timestamp record */
#define FCDI_EXTENDED_EVENT_PPS_NANOSECONDS_OFST 12
#define FCDI_EXTENDED_EVENT_PPS_NANOSECONDS_LBN 96
#define FCDI_EXTENDED_EVENT_PPS_NANOSECONDS_WIDTH 32
+/* Timestamp records comprising the event */
#define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_OFST 8
#define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_LEN 8
#define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_LO_OFST 8
@@ -453,12 +779,99 @@
#define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_LBN 64
#define FCDI_EXTENDED_EVENT_PPS_TIMESTAMPS_WIDTH 64
+/* MUM_EVENT structuredef */
+#define MUM_EVENT_LEN 8
+#define MUM_EVENT_CONT_LBN 32
+#define MUM_EVENT_CONT_WIDTH 1
+#define MUM_EVENT_LEVEL_LBN 33
+#define MUM_EVENT_LEVEL_WIDTH 3
+/* enum: Info. */
+#define MUM_EVENT_LEVEL_INFO 0x0
+/* enum: Warning. */
+#define MUM_EVENT_LEVEL_WARN 0x1
+/* enum: Error. */
+#define MUM_EVENT_LEVEL_ERR 0x2
+/* enum: Fatal. */
+#define MUM_EVENT_LEVEL_FATAL 0x3
+#define MUM_EVENT_DATA_OFST 0
+#define MUM_EVENT_SENSOR_ID_LBN 0
+#define MUM_EVENT_SENSOR_ID_WIDTH 8
+/* Enum values, see field(s): */
+/* MC_CMD_SENSOR_INFO/MC_CMD_SENSOR_INFO_OUT/MASK */
+#define MUM_EVENT_SENSOR_STATE_LBN 8
+#define MUM_EVENT_SENSOR_STATE_WIDTH 8
+#define MUM_EVENT_PORT_PHY_READY_LBN 0
+#define MUM_EVENT_PORT_PHY_READY_WIDTH 1
+#define MUM_EVENT_PORT_PHY_LINK_UP_LBN 1
+#define MUM_EVENT_PORT_PHY_LINK_UP_WIDTH 1
+#define MUM_EVENT_PORT_PHY_TX_LOL_LBN 2
+#define MUM_EVENT_PORT_PHY_TX_LOL_WIDTH 1
+#define MUM_EVENT_PORT_PHY_RX_LOL_LBN 3
+#define MUM_EVENT_PORT_PHY_RX_LOL_WIDTH 1
+#define MUM_EVENT_PORT_PHY_TX_LOS_LBN 4
+#define MUM_EVENT_PORT_PHY_TX_LOS_WIDTH 1
+#define MUM_EVENT_PORT_PHY_RX_LOS_LBN 5
+#define MUM_EVENT_PORT_PHY_RX_LOS_WIDTH 1
+#define MUM_EVENT_PORT_PHY_TX_FAULT_LBN 6
+#define MUM_EVENT_PORT_PHY_TX_FAULT_WIDTH 1
+#define MUM_EVENT_DATA_LBN 0
+#define MUM_EVENT_DATA_WIDTH 32
+#define MUM_EVENT_SRC_LBN 36
+#define MUM_EVENT_SRC_WIDTH 8
+#define MUM_EVENT_EV_CODE_LBN 60
+#define MUM_EVENT_EV_CODE_WIDTH 4
+#define MUM_EVENT_CODE_LBN 44
+#define MUM_EVENT_CODE_WIDTH 8
+/* enum: The MUM was rebooted. */
+#define MUM_EVENT_CODE_REBOOT 0x1
+/* enum: Bad assert. */
+#define MUM_EVENT_CODE_ASSERT 0x2
+/* enum: Sensor failure. */
+#define MUM_EVENT_CODE_SENSOR 0x3
+/* enum: Link fault has been asserted, or has cleared. */
+#define MUM_EVENT_CODE_QSFP_LASI_INTERRUPT 0x4
+#define MUM_EVENT_SENSOR_DATA_OFST 0
+#define MUM_EVENT_SENSOR_DATA_LBN 0
+#define MUM_EVENT_SENSOR_DATA_WIDTH 32
+#define MUM_EVENT_PORT_PHY_FLAGS_OFST 0
+#define MUM_EVENT_PORT_PHY_FLAGS_LBN 0
+#define MUM_EVENT_PORT_PHY_FLAGS_WIDTH 32
+#define MUM_EVENT_PORT_PHY_COPPER_LEN_OFST 0
+#define MUM_EVENT_PORT_PHY_COPPER_LEN_LBN 0
+#define MUM_EVENT_PORT_PHY_COPPER_LEN_WIDTH 32
+#define MUM_EVENT_PORT_PHY_CAPS_OFST 0
+#define MUM_EVENT_PORT_PHY_CAPS_LBN 0
+#define MUM_EVENT_PORT_PHY_CAPS_WIDTH 32
+#define MUM_EVENT_PORT_PHY_TECH_OFST 0
+#define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_UNKNOWN 0x0 /* enum */
+#define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_OPTICAL 0x1 /* enum */
+#define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_COPPER_PASSIVE 0x2 /* enum */
+#define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_COPPER_PASSIVE_EQUALIZED 0x3 /* enum */
+#define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_COPPER_ACTIVE_LIMITING 0x4 /* enum */
+#define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_COPPER_ACTIVE_LINEAR 0x5 /* enum */
+#define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_BASE_T 0x6 /* enum */
+#define MUM_EVENT_PORT_PHY_STATE_QSFP_MODULE_TECH_LOOPBACK_PASSIVE 0x7 /* enum */
+#define MUM_EVENT_PORT_PHY_TECH_LBN 0
+#define MUM_EVENT_PORT_PHY_TECH_WIDTH 32
+#define MUM_EVENT_PORT_PHY_SRC_DATA_ID_LBN 36
+#define MUM_EVENT_PORT_PHY_SRC_DATA_ID_WIDTH 4
+#define MUM_EVENT_PORT_PHY_SRC_DATA_ID_FLAGS 0x0 /* enum */
+#define MUM_EVENT_PORT_PHY_SRC_DATA_ID_COPPER_LEN 0x1 /* enum */
+#define MUM_EVENT_PORT_PHY_SRC_DATA_ID_CAPS 0x2 /* enum */
+#define MUM_EVENT_PORT_PHY_SRC_DATA_ID_TECH 0x3 /* enum */
+#define MUM_EVENT_PORT_PHY_SRC_DATA_ID_MAX 0x4 /* enum */
+#define MUM_EVENT_PORT_PHY_SRC_PORT_NO_LBN 40
+#define MUM_EVENT_PORT_PHY_SRC_PORT_NO_WIDTH 4
+
/***********************************/
/* MC_CMD_READ32
* Read multiple 32byte words from MC memory.
*/
#define MC_CMD_READ32 0x1
+#undef MC_CMD_0x1_PRIVILEGE_CTG
+
+#define MC_CMD_0x1_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_READ32_IN msgrequest */
#define MC_CMD_READ32_IN_LEN 8
@@ -480,6 +893,9 @@
* Write multiple 32byte words to MC memory.
*/
#define MC_CMD_WRITE32 0x2
+#undef MC_CMD_0x2_PRIVILEGE_CTG
+
+#define MC_CMD_0x2_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_WRITE32_IN msgrequest */
#define MC_CMD_WRITE32_IN_LENMIN 8
@@ -500,26 +916,64 @@
* Copy MC code between two locations and jump.
*/
#define MC_CMD_COPYCODE 0x3
+#undef MC_CMD_0x3_PRIVILEGE_CTG
+
+#define MC_CMD_0x3_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_COPYCODE_IN msgrequest */
#define MC_CMD_COPYCODE_IN_LEN 16
+/* Source address
+ *
+ * The main image should be entered via a copy of a single word from and to a
+ * magic address, which controls various aspects of the boot. The magic address
+ * is a bitfield, with each bit as documented below.
+ */
#define MC_CMD_COPYCODE_IN_SRC_ADDR_OFST 0
+/* enum: Deprecated; equivalent to setting BOOT_MAGIC_PRESENT (see below) */
+#define MC_CMD_COPYCODE_HUNT_NO_MAGIC_ADDR 0x10000
+/* enum: Deprecated; equivalent to setting BOOT_MAGIC_PRESENT and
+ * BOOT_MAGIC_SATELLITE_CPUS_NOT_LOADED (see below)
+ */
+#define MC_CMD_COPYCODE_HUNT_NO_DATAPATH_MAGIC_ADDR 0x1d0d0
+/* enum: Deprecated; equivalent to setting BOOT_MAGIC_PRESENT,
+ * BOOT_MAGIC_SATELLITE_CPUS_NOT_LOADED and BOOT_MAGIC_IGNORE_CONFIG (see
+ * below)
+ */
+#define MC_CMD_COPYCODE_HUNT_IGNORE_CONFIG_MAGIC_ADDR 0x1badc
+#define MC_CMD_COPYCODE_IN_BOOT_MAGIC_PRESENT_LBN 17
+#define MC_CMD_COPYCODE_IN_BOOT_MAGIC_PRESENT_WIDTH 1
+#define MC_CMD_COPYCODE_IN_BOOT_MAGIC_SATELLITE_CPUS_NOT_LOADED_LBN 2
+#define MC_CMD_COPYCODE_IN_BOOT_MAGIC_SATELLITE_CPUS_NOT_LOADED_WIDTH 1
+#define MC_CMD_COPYCODE_IN_BOOT_MAGIC_IGNORE_CONFIG_LBN 3
+#define MC_CMD_COPYCODE_IN_BOOT_MAGIC_IGNORE_CONFIG_WIDTH 1
+#define MC_CMD_COPYCODE_IN_BOOT_MAGIC_SKIP_BOOT_ICORE_SYNC_LBN 4
+#define MC_CMD_COPYCODE_IN_BOOT_MAGIC_SKIP_BOOT_ICORE_SYNC_WIDTH 1
+#define MC_CMD_COPYCODE_IN_BOOT_MAGIC_FORCE_STANDALONE_LBN 5
+#define MC_CMD_COPYCODE_IN_BOOT_MAGIC_FORCE_STANDALONE_WIDTH 1
+/* Destination address */
#define MC_CMD_COPYCODE_IN_DEST_ADDR_OFST 4
#define MC_CMD_COPYCODE_IN_NUMWORDS_OFST 8
+/* Address of where to jump after copy. */
#define MC_CMD_COPYCODE_IN_JUMP_OFST 12
-#define MC_CMD_COPYCODE_JUMP_NONE 0x1 /* enum */
+/* enum: Control should return to the caller rather than jumping */
+#define MC_CMD_COPYCODE_JUMP_NONE 0x1
/* MC_CMD_COPYCODE_OUT msgresponse */
#define MC_CMD_COPYCODE_OUT_LEN 0
/***********************************/
-/* MC_CMD_SET_FUNC
+/* MC_CMD_SET_FUNC
+ * Select function for function-specific commands.
*/
-#define MC_CMD_SET_FUNC 0x4
+#define MC_CMD_SET_FUNC 0x4
+#undef MC_CMD_0x4_PRIVILEGE_CTG
+
+#define MC_CMD_0x4_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_SET_FUNC_IN msgrequest */
#define MC_CMD_SET_FUNC_IN_LEN 4
+/* Set function */
#define MC_CMD_SET_FUNC_IN_FUNC_OFST 0
/* MC_CMD_SET_FUNC_OUT msgresponse */
@@ -528,15 +982,22 @@
/***********************************/
/* MC_CMD_GET_BOOT_STATUS
+ * Get the instruction address from which the MC booted.
*/
#define MC_CMD_GET_BOOT_STATUS 0x5
+#undef MC_CMD_0x5_PRIVILEGE_CTG
+
+#define MC_CMD_0x5_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_GET_BOOT_STATUS_IN msgrequest */
#define MC_CMD_GET_BOOT_STATUS_IN_LEN 0
/* MC_CMD_GET_BOOT_STATUS_OUT msgresponse */
#define MC_CMD_GET_BOOT_STATUS_OUT_LEN 8
+/* ?? */
#define MC_CMD_GET_BOOT_STATUS_OUT_BOOT_OFFSET_OFST 0
+/* enum: indicates that the MC wasn't flash booted */
+#define MC_CMD_GET_BOOT_STATUS_OUT_BOOT_OFFSET_NULL 0xdeadbeef
#define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_OFST 4
#define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_WATCHDOG_LBN 0
#define MC_CMD_GET_BOOT_STATUS_OUT_FLAGS_WATCHDOG_WIDTH 1
@@ -547,41 +1008,69 @@
/***********************************/
-/* MC_CMD_GET_ASSERTS
- * Get and clear any assertion status.
+/* MC_CMD_GET_ASSERTS
+ * Get (and optionally clear) the current assertion status. Only
+ * OUT.GLOBAL_FLAGS is guaranteed to exist in the completion payload. The other
+ * fields will only be present if OUT.GLOBAL_FLAGS != NO_FAILS
*/
-#define MC_CMD_GET_ASSERTS 0x6
+#define MC_CMD_GET_ASSERTS 0x6
+#undef MC_CMD_0x6_PRIVILEGE_CTG
+
+#define MC_CMD_0x6_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_GET_ASSERTS_IN msgrequest */
#define MC_CMD_GET_ASSERTS_IN_LEN 4
+/* Set to clear assertion */
#define MC_CMD_GET_ASSERTS_IN_CLEAR_OFST 0
/* MC_CMD_GET_ASSERTS_OUT msgresponse */
#define MC_CMD_GET_ASSERTS_OUT_LEN 140
+/* Assertion status flag. */
#define MC_CMD_GET_ASSERTS_OUT_GLOBAL_FLAGS_OFST 0
-#define MC_CMD_GET_ASSERTS_FLAGS_NO_FAILS 0x1 /* enum */
-#define MC_CMD_GET_ASSERTS_FLAGS_SYS_FAIL 0x2 /* enum */
-#define MC_CMD_GET_ASSERTS_FLAGS_THR_FAIL 0x3 /* enum */
-#define MC_CMD_GET_ASSERTS_FLAGS_WDOG_FIRED 0x4 /* enum */
+/* enum: No assertions have failed. */
+#define MC_CMD_GET_ASSERTS_FLAGS_NO_FAILS 0x1
+/* enum: A system-level assertion has failed. */
+#define MC_CMD_GET_ASSERTS_FLAGS_SYS_FAIL 0x2
+/* enum: A thread-level assertion has failed. */
+#define MC_CMD_GET_ASSERTS_FLAGS_THR_FAIL 0x3
+/* enum: The system was reset by the watchdog. */
+#define MC_CMD_GET_ASSERTS_FLAGS_WDOG_FIRED 0x4
+/* enum: An illegal address trap stopped the system (huntington and later) */
+#define MC_CMD_GET_ASSERTS_FLAGS_ADDR_TRAP 0x5
+/* Failing PC value */
#define MC_CMD_GET_ASSERTS_OUT_SAVED_PC_OFFS_OFST 4
+/* Saved GP regs */
#define MC_CMD_GET_ASSERTS_OUT_GP_REGS_OFFS_OFST 8
#define MC_CMD_GET_ASSERTS_OUT_GP_REGS_OFFS_LEN 4
#define MC_CMD_GET_ASSERTS_OUT_GP_REGS_OFFS_NUM 31
+/* enum: A magic value hinting that the value in this register at the time of
+ * the failure has likely been lost.
+ */
+#define MC_CMD_GET_ASSERTS_REG_NO_DATA 0xda7a1057
+/* Failing thread address */
#define MC_CMD_GET_ASSERTS_OUT_THREAD_OFFS_OFST 132
#define MC_CMD_GET_ASSERTS_OUT_RESERVED_OFST 136
/***********************************/
-/* MC_CMD_LOG_CTRL
- * Configure the output stream for various events and messages.
+/* MC_CMD_LOG_CTRL
+ * Configure the output stream for log events such as link state changes,
+ * sensor notifications and MCDI completions
*/
-#define MC_CMD_LOG_CTRL 0x7
+#define MC_CMD_LOG_CTRL 0x7
+#undef MC_CMD_0x7_PRIVILEGE_CTG
+
+#define MC_CMD_0x7_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_LOG_CTRL_IN msgrequest */
#define MC_CMD_LOG_CTRL_IN_LEN 8
+/* Log destination */
#define MC_CMD_LOG_CTRL_IN_LOG_DEST_OFST 0
-#define MC_CMD_LOG_CTRL_IN_LOG_DEST_UART 0x1 /* enum */
-#define MC_CMD_LOG_CTRL_IN_LOG_DEST_EVQ 0x2 /* enum */
+/* enum: UART. */
+#define MC_CMD_LOG_CTRL_IN_LOG_DEST_UART 0x1
+/* enum: Event queue. */
+#define MC_CMD_LOG_CTRL_IN_LOG_DEST_EVQ 0x2
+/* Legacy argument. Must be zero. */
#define MC_CMD_LOG_CTRL_IN_LOG_DEST_EVQ_OFST 4
/* MC_CMD_LOG_CTRL_OUT msgresponse */
@@ -589,21 +1078,31 @@
/***********************************/
-/* MC_CMD_GET_VERSION
+/* MC_CMD_GET_VERSION
* Get version information about the MC firmware.
*/
-#define MC_CMD_GET_VERSION 0x8
+#define MC_CMD_GET_VERSION 0x8
+#undef MC_CMD_0x8_PRIVILEGE_CTG
+
+#define MC_CMD_0x8_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_GET_VERSION_IN msgrequest */
#define MC_CMD_GET_VERSION_IN_LEN 0
-/* MC_CMD_GET_VERSION_V0_OUT msgresponse */
+/* MC_CMD_GET_VERSION_EXT_IN msgrequest: Asks for the extended version */
+#define MC_CMD_GET_VERSION_EXT_IN_LEN 4
+/* placeholder, set to 0 */
+#define MC_CMD_GET_VERSION_EXT_IN_EXT_FLAGS_OFST 0
+
+/* MC_CMD_GET_VERSION_V0_OUT msgresponse: deprecated version format */
#define MC_CMD_GET_VERSION_V0_OUT_LEN 4
#define MC_CMD_GET_VERSION_OUT_FIRMWARE_OFST 0
-#define MC_CMD_GET_VERSION_OUT_FIRMWARE_ANY 0xffffffff /* enum */
-#define MC_CMD_GET_VERSION_OUT_FIRMWARE_BOOTROM 0xb0070000 /* enum */
-#define MC_CMD_GET_VERSION_OUT_FIRMWARE_SIENA_BOOTROM 0xb0070000 /* enum */
-#define MC_CMD_GET_VERSION_OUT_FIRMWARE_HUNT_BOOTROM 0xb0070001 /* enum */
+/* enum: Reserved version number to indicate "any" version. */
+#define MC_CMD_GET_VERSION_OUT_FIRMWARE_ANY 0xffffffff
+/* enum: Bootrom version value for Siena. */
+#define MC_CMD_GET_VERSION_OUT_FIRMWARE_SIENA_BOOTROM 0xb0070000
+/* enum: Bootrom version value for Huntington. */
+#define MC_CMD_GET_VERSION_OUT_FIRMWARE_HUNT_BOOTROM 0xb0070001
/* MC_CMD_GET_VERSION_OUT msgresponse */
#define MC_CMD_GET_VERSION_OUT_LEN 32
@@ -611,6 +1110,7 @@
/* Enum values, see field(s): */
/* MC_CMD_GET_VERSION_V0_OUT/MC_CMD_GET_VERSION_OUT_FIRMWARE */
#define MC_CMD_GET_VERSION_OUT_PCOL_OFST 4
+/* 128bit mask of functions supported by the current firmware */
#define MC_CMD_GET_VERSION_OUT_SUPPORTED_FUNCS_OFST 8
#define MC_CMD_GET_VERSION_OUT_SUPPORTED_FUNCS_LEN 16
#define MC_CMD_GET_VERSION_OUT_VERSION_OFST 24
@@ -618,77 +1118,187 @@
#define MC_CMD_GET_VERSION_OUT_VERSION_LO_OFST 24
#define MC_CMD_GET_VERSION_OUT_VERSION_HI_OFST 28
+/* MC_CMD_GET_VERSION_EXT_OUT msgresponse */
+#define MC_CMD_GET_VERSION_EXT_OUT_LEN 48
+/* MC_CMD_GET_VERSION_OUT_FIRMWARE_OFST 0 */
+/* Enum values, see field(s): */
+/* MC_CMD_GET_VERSION_V0_OUT/MC_CMD_GET_VERSION_OUT_FIRMWARE */
+#define MC_CMD_GET_VERSION_EXT_OUT_PCOL_OFST 4
+/* 128bit mask of functions supported by the current firmware */
+#define MC_CMD_GET_VERSION_EXT_OUT_SUPPORTED_FUNCS_OFST 8
+#define MC_CMD_GET_VERSION_EXT_OUT_SUPPORTED_FUNCS_LEN 16
+#define MC_CMD_GET_VERSION_EXT_OUT_VERSION_OFST 24
+#define MC_CMD_GET_VERSION_EXT_OUT_VERSION_LEN 8
+#define MC_CMD_GET_VERSION_EXT_OUT_VERSION_LO_OFST 24
+#define MC_CMD_GET_VERSION_EXT_OUT_VERSION_HI_OFST 28
+/* extra info */
+#define MC_CMD_GET_VERSION_EXT_OUT_EXTRA_OFST 32
+#define MC_CMD_GET_VERSION_EXT_OUT_EXTRA_LEN 16
+
/***********************************/
-/* MC_CMD_FC
+/* MC_CMD_FC
* Perform an FC operation
*/
-#define MC_CMD_FC 0x9
+#define MC_CMD_FC 0x9
/* MC_CMD_FC_IN msgrequest */
#define MC_CMD_FC_IN_LEN 4
#define MC_CMD_FC_IN_OP_HDR_OFST 0
#define MC_CMD_FC_IN_OP_LBN 0
#define MC_CMD_FC_IN_OP_WIDTH 8
-#define MC_CMD_FC_OP_NULL 0x1 /* enum */
-#define MC_CMD_FC_OP_UNUSED 0x2 /* enum */
-#define MC_CMD_FC_OP_MAC 0x3 /* enum */
-#define MC_CMD_FC_OP_READ32 0x4 /* enum */
-#define MC_CMD_FC_OP_WRITE32 0x5 /* enum */
-#define MC_CMD_FC_OP_TRC_READ 0x6 /* enum */
-#define MC_CMD_FC_OP_TRC_WRITE 0x7 /* enum */
-#define MC_CMD_FC_OP_GET_VERSION 0x8 /* enum */
-#define MC_CMD_FC_OP_TRC_RX_READ 0x9 /* enum */
-#define MC_CMD_FC_OP_TRC_RX_WRITE 0xa /* enum */
-#define MC_CMD_FC_OP_SFP 0xb /* enum */
-#define MC_CMD_FC_OP_DDR_TEST 0xc /* enum */
-#define MC_CMD_FC_OP_GET_ASSERT 0xd /* enum */
-#define MC_CMD_FC_OP_FPGA_BUILD 0xe /* enum */
-#define MC_CMD_FC_OP_READ_MAP 0xf /* enum */
-#define MC_CMD_FC_OP_CAPABILITIES 0x10 /* enum */
-#define MC_CMD_FC_OP_GLOBAL_FLAGS 0x11 /* enum */
-#define MC_CMD_FC_OP_IO_REL 0x12 /* enum */
-#define MC_CMD_FC_OP_UHLINK 0x13 /* enum */
-#define MC_CMD_FC_OP_SET_LINK 0x14 /* enum */
-#define MC_CMD_FC_OP_LICENSE 0x15 /* enum */
-#define MC_CMD_FC_OP_STARTUP 0x16 /* enum */
-#define MC_CMD_FC_OP_DMA 0x17 /* enum */
-#define MC_CMD_FC_OP_TIMED_READ 0x18 /* enum */
-#define MC_CMD_FC_OP_LOG 0x19 /* enum */
-#define MC_CMD_FC_OP_CLOCK 0x1a /* enum */
-#define MC_CMD_FC_OP_DDR 0x1b /* enum */
-#define MC_CMD_FC_OP_TIMESTAMP 0x1c /* enum */
-#define MC_CMD_FC_OP_SPI 0x1d /* enum */
-#define MC_CMD_FC_OP_DIAG 0x1e /* enum */
-#define MC_CMD_FC_IN_PORT_EXT_OFST 0x0 /* enum */
-#define MC_CMD_FC_IN_PORT_INT_OFST 0x40 /* enum */
+/* enum: NULL MCDI command to FC. */
+#define MC_CMD_FC_OP_NULL 0x1
+/* enum: Unused opcode */
+#define MC_CMD_FC_OP_UNUSED 0x2
+/* enum: MAC driver commands */
+#define MC_CMD_FC_OP_MAC 0x3
+/* enum: Read FC memory */
+#define MC_CMD_FC_OP_READ32 0x4
+/* enum: Write to FC memory */
+#define MC_CMD_FC_OP_WRITE32 0x5
+/* enum: Read FC memory */
+#define MC_CMD_FC_OP_TRC_READ 0x6
+/* enum: Write to FC memory */
+#define MC_CMD_FC_OP_TRC_WRITE 0x7
+/* enum: FC firmware Version */
+#define MC_CMD_FC_OP_GET_VERSION 0x8
+/* enum: Read FC memory */
+#define MC_CMD_FC_OP_TRC_RX_READ 0x9
+/* enum: Write to FC memory */
+#define MC_CMD_FC_OP_TRC_RX_WRITE 0xa
+/* enum: SFP parameters */
+#define MC_CMD_FC_OP_SFP 0xb
+/* enum: DDR3 test */
+#define MC_CMD_FC_OP_DDR_TEST 0xc
+/* enum: Get Crash context from FC */
+#define MC_CMD_FC_OP_GET_ASSERT 0xd
+/* enum: Get FPGA Build registers */
+#define MC_CMD_FC_OP_FPGA_BUILD 0xe
+/* enum: Read map support commands */
+#define MC_CMD_FC_OP_READ_MAP 0xf
+/* enum: FC Capabilities */
+#define MC_CMD_FC_OP_CAPABILITIES 0x10
+/* enum: FC Global flags */
+#define MC_CMD_FC_OP_GLOBAL_FLAGS 0x11
+/* enum: FC IO using relative addressing modes */
+#define MC_CMD_FC_OP_IO_REL 0x12
+/* enum: FPGA link information */
+#define MC_CMD_FC_OP_UHLINK 0x13
+/* enum: Configure loopbacks and link on FPGA ports */
+#define MC_CMD_FC_OP_SET_LINK 0x14
+/* enum: Licensing operations relating to AOE */
+#define MC_CMD_FC_OP_LICENSE 0x15
+/* enum: Startup information to the FC */
+#define MC_CMD_FC_OP_STARTUP 0x16
+/* enum: Configure a DMA read */
+#define MC_CMD_FC_OP_DMA 0x17
+/* enum: Configure a timed read */
+#define MC_CMD_FC_OP_TIMED_READ 0x18
+/* enum: Control UART logging */
+#define MC_CMD_FC_OP_LOG 0x19
+/* enum: Get the value of a given clock_id */
+#define MC_CMD_FC_OP_CLOCK 0x1a
+/* enum: DDR3/QDR3 parameters */
+#define MC_CMD_FC_OP_DDR 0x1b
+/* enum: PTP and timestamp control */
+#define MC_CMD_FC_OP_TIMESTAMP 0x1c
+/* enum: Commands for SPI Flash interface */
+#define MC_CMD_FC_OP_SPI 0x1d
+/* enum: Commands for diagnostic components */
+#define MC_CMD_FC_OP_DIAG 0x1e
+/* enum: External AOE port. */
+#define MC_CMD_FC_IN_PORT_EXT_OFST 0x0
+/* enum: Internal AOE port. */
+#define MC_CMD_FC_IN_PORT_INT_OFST 0x40
/* MC_CMD_FC_IN_NULL msgrequest */
#define MC_CMD_FC_IN_NULL_LEN 4
#define MC_CMD_FC_IN_CMD_OFST 0
+/* MC_CMD_FC_IN_PHY msgrequest */
+#define MC_CMD_FC_IN_PHY_LEN 5
+/* MC_CMD_FC_IN_CMD_OFST 0 */
+/* FC PHY driver operation code */
+#define MC_CMD_FC_IN_PHY_OP_OFST 4
+#define MC_CMD_FC_IN_PHY_OP_LEN 1
+/* enum: PHY init handler */
+#define MC_CMD_FC_OP_PHY_OP_INIT 0x1
+/* enum: PHY reconfigure handler */
+#define MC_CMD_FC_OP_PHY_OP_RECONFIGURE 0x2
+/* enum: PHY reboot handler */
+#define MC_CMD_FC_OP_PHY_OP_REBOOT 0x3
+/* enum: PHY get_supported_cap handler */
+#define MC_CMD_FC_OP_PHY_OP_GET_SUPPORTED_CAP 0x4
+/* enum: PHY get_config handler */
+#define MC_CMD_FC_OP_PHY_OP_GET_CONFIG 0x5
+/* enum: PHY get_media_info handler */
+#define MC_CMD_FC_OP_PHY_OP_GET_MEDIA_INFO 0x6
+/* enum: PHY set_led handler */
+#define MC_CMD_FC_OP_PHY_OP_SET_LED 0x7
+/* enum: PHY lasi_interrupt handler */
+#define MC_CMD_FC_OP_PHY_OP_LASI_INTERRUPT 0x8
+/* enum: PHY check_link handler */
+#define MC_CMD_FC_OP_PHY_OP_CHECK_LINK 0x9
+/* enum: PHY fill_stats handler */
+#define MC_CMD_FC_OP_PHY_OP_FILL_STATS 0xa
+/* enum: PHY bpx_link_state_changed handler */
+#define MC_CMD_FC_OP_PHY_OP_BPX_LINK_STATE_CHANGED 0xb
+/* enum: PHY get_state handler */
+#define MC_CMD_FC_OP_PHY_OP_GET_STATE 0xc
+/* enum: PHY start_bist handler */
+#define MC_CMD_FC_OP_PHY_OP_START_BIST 0xd
+/* enum: PHY poll_bist handler */
+#define MC_CMD_FC_OP_PHY_OP_POLL_BIST 0xe
+/* enum: PHY nvram_test handler */
+#define MC_CMD_FC_OP_PHY_OP_NVRAM_TEST 0xf
+/* enum: PHY relinquish handler */
+#define MC_CMD_FC_OP_PHY_OP_RELINQUISH_SPI 0x10
+/* enum: PHY read connection from FC - may be not required */
+#define MC_CMD_FC_OP_PHY_OP_GET_CONNECTION 0x11
+/* enum: PHY read flags from FC - may be not required */
+#define MC_CMD_FC_OP_PHY_OP_GET_FLAGS 0x12
+
+/* MC_CMD_FC_IN_PHY_INIT msgrequest */
+#define MC_CMD_FC_IN_PHY_INIT_LEN 4
+#define MC_CMD_FC_IN_PHY_CMD_OFST 0
+
/* MC_CMD_FC_IN_MAC msgrequest */
#define MC_CMD_FC_IN_MAC_LEN 8
/* MC_CMD_FC_IN_CMD_OFST 0 */
#define MC_CMD_FC_IN_MAC_HEADER_OFST 4
#define MC_CMD_FC_IN_MAC_OP_LBN 0
#define MC_CMD_FC_IN_MAC_OP_WIDTH 8
-#define MC_CMD_FC_OP_MAC_OP_RECONFIGURE 0x1 /* enum */
-#define MC_CMD_FC_OP_MAC_OP_SET_LINK 0x2 /* enum */
-#define MC_CMD_FC_OP_MAC_OP_GET_STATS 0x3 /* enum */
-#define MC_CMD_FC_OP_MAC_OP_GET_RX_STATS 0x6 /* enum */
-#define MC_CMD_FC_OP_MAC_OP_GET_TX_STATS 0x7 /* enum */
-#define MC_CMD_FC_OP_MAC_OP_READ_STATUS 0x8 /* enum */
+/* enum: MAC reconfigure handler */
+#define MC_CMD_FC_OP_MAC_OP_RECONFIGURE 0x1
+/* enum: MAC Set command - same as MC_CMD_SET_MAC */
+#define MC_CMD_FC_OP_MAC_OP_SET_LINK 0x2
+/* enum: MAC statistics */
+#define MC_CMD_FC_OP_MAC_OP_GET_STATS 0x3
+/* enum: MAC RX statistics */
+#define MC_CMD_FC_OP_MAC_OP_GET_RX_STATS 0x6
+/* enum: MAC TX statistics */
+#define MC_CMD_FC_OP_MAC_OP_GET_TX_STATS 0x7
+/* enum: MAC Read status */
+#define MC_CMD_FC_OP_MAC_OP_READ_STATUS 0x8
#define MC_CMD_FC_IN_MAC_PORT_TYPE_LBN 8
#define MC_CMD_FC_IN_MAC_PORT_TYPE_WIDTH 8
-#define MC_CMD_FC_PORT_EXT 0x0 /* enum */
-#define MC_CMD_FC_PORT_INT 0x1 /* enum */
+/* enum: External FPGA port. */
+#define MC_CMD_FC_PORT_EXT 0x0
+/* enum: Internal Siena-facing FPGA ports. */
+#define MC_CMD_FC_PORT_INT 0x1
#define MC_CMD_FC_IN_MAC_PORT_IDX_LBN 16
#define MC_CMD_FC_IN_MAC_PORT_IDX_WIDTH 8
#define MC_CMD_FC_IN_MAC_CMD_FORMAT_LBN 24
#define MC_CMD_FC_IN_MAC_CMD_FORMAT_WIDTH 8
-#define MC_CMD_FC_OP_MAC_CMD_FORMAT_DEFAULT 0x0 /* enum */
-#define MC_CMD_FC_OP_MAC_CMD_FORMAT_PORT_OVERRIDE 0x1 /* enum */
+/* enum: Default FC command format; the fields PORT_TYPE and PORT_IDX are
+ * irrelevant. Port number is derived from pci_fn; passed in FC header.
+ */
+#define MC_CMD_FC_OP_MAC_CMD_FORMAT_DEFAULT 0x0
+/* enum: Override default port number. Port number determined by fields
+ * PORT_TYPE and PORT_IDX.
+ */
+#define MC_CMD_FC_OP_MAC_CMD_FORMAT_PORT_OVERRIDE 0x1
/* MC_CMD_FC_IN_MAC_RECONFIGURE msgrequest */
#define MC_CMD_FC_IN_MAC_RECONFIGURE_LEN 8
@@ -699,7 +1309,9 @@
#define MC_CMD_FC_IN_MAC_SET_LINK_LEN 32
/* MC_CMD_FC_IN_CMD_OFST 0 */
/* MC_CMD_FC_IN_MAC_HEADER_OFST 4 */
+/* MTU size */
#define MC_CMD_FC_IN_MAC_SET_LINK_MTU_OFST 8
+/* Drain Tx FIFO */
#define MC_CMD_FC_IN_MAC_SET_LINK_DRAIN_OFST 12
#define MC_CMD_FC_IN_MAC_SET_LINK_ADDR_OFST 16
#define MC_CMD_FC_IN_MAC_SET_LINK_ADDR_LEN 8
@@ -731,6 +1343,7 @@
#define MC_CMD_FC_IN_MAC_GET_STATS_LEN 20
/* MC_CMD_FC_IN_CMD_OFST 0 */
/* MC_CMD_FC_IN_MAC_HEADER_OFST 4 */
+/* MC Statistics index */
#define MC_CMD_FC_IN_MAC_GET_STATS_STATS_INDEX_OFST 8
#define MC_CMD_FC_IN_MAC_GET_STATS_FLAGS_OFST 12
#define MC_CMD_FC_IN_MAC_GET_STATS_CLEAR_ALL_LBN 0
@@ -739,6 +1352,7 @@
#define MC_CMD_FC_IN_MAC_GET_STATS_CLEAR_WIDTH 1
#define MC_CMD_FC_IN_MAC_GET_STATS_UPDATE_LBN 2
#define MC_CMD_FC_IN_MAC_GET_STATS_UPDATE_WIDTH 1
+/* Number of statistics to read */
#define MC_CMD_FC_IN_MAC_GET_STATS_NUM_OFST 16
#define MC_CMD_FC_MAC_NSTATS_PER_BLOCK 0x1e /* enum */
#define MC_CMD_FC_MAC_NBYTES_PER_STAT 0x8 /* enum */
@@ -797,13 +1411,24 @@
#define MC_CMD_FC_IN_TRC_RX_WRITE_DATA_NUM 2
/* MC_CMD_FC_IN_SFP msgrequest */
-#define MC_CMD_FC_IN_SFP_LEN 24
+#define MC_CMD_FC_IN_SFP_LEN 28
/* MC_CMD_FC_IN_CMD_OFST 0 */
+/* Link speed is 100, 1000, 10000, 40000 */
#define MC_CMD_FC_IN_SFP_SPEED_OFST 4
+/* Length of copper cable - zero when not relevant (e.g. if cable is fibre) */
#define MC_CMD_FC_IN_SFP_COPPER_LEN_OFST 8
+/* Not relevant for cards with QSFP modules. For older cards, true if module is
+ * a dual speed SFP+ module.
+ */
#define MC_CMD_FC_IN_SFP_DUAL_SPEED_OFST 12
+/* True if an SFP Module is present (other fields valid when true) */
#define MC_CMD_FC_IN_SFP_PRESENT_OFST 16
+/* The type of the SFP+ Module. For later cards with QSFP modules, this field
+ * is unused and the type is communicated by other means.
+ */
#define MC_CMD_FC_IN_SFP_TYPE_OFST 20
+/* Capabilities corresponding to 1 bits. */
+#define MC_CMD_FC_IN_SFP_CAPS_OFST 24
/* MC_CMD_FC_IN_DDR_TEST msgrequest */
#define MC_CMD_FC_IN_DDR_TEST_LEN 8
@@ -811,8 +1436,10 @@
#define MC_CMD_FC_IN_DDR_TEST_HEADER_OFST 4
#define MC_CMD_FC_IN_DDR_TEST_OP_LBN 0
#define MC_CMD_FC_IN_DDR_TEST_OP_WIDTH 8
-#define MC_CMD_FC_OP_DDR_TEST_START 0x1 /* enum */
-#define MC_CMD_FC_OP_DDR_TEST_POLL 0x2 /* enum */
+/* enum: DRAM Test Start */
+#define MC_CMD_FC_OP_DDR_TEST_START 0x1
+/* enum: DRAM Test Poll */
+#define MC_CMD_FC_OP_DDR_TEST_POLL 0x2
/* MC_CMD_FC_IN_DDR_TEST_START msgrequest */
#define MC_CMD_FC_IN_DDR_TEST_START_LEN 12
@@ -840,10 +1467,14 @@
/* MC_CMD_FC_IN_FPGA_BUILD msgrequest */
#define MC_CMD_FC_IN_FPGA_BUILD_LEN 8
/* MC_CMD_FC_IN_CMD_OFST 0 */
+/* FPGA build info operation code */
#define MC_CMD_FC_IN_FPGA_BUILD_OP_OFST 4
-#define MC_CMD_FC_IN_FPGA_BUILD_BUILD 0x1 /* enum */
-#define MC_CMD_FC_IN_FPGA_BUILD_SERVICES 0x2 /* enum */
-#define MC_CMD_FC_IN_FPGA_BUILD_BSP_VERSION 0x3 /* enum */
+/* enum: Get the build registers */
+#define MC_CMD_FC_IN_FPGA_BUILD_BUILD 0x1
+/* enum: Get the services registers */
+#define MC_CMD_FC_IN_FPGA_BUILD_SERVICES 0x2
+/* enum: Get the BSP version */
+#define MC_CMD_FC_IN_FPGA_BUILD_BSP_VERSION 0x3
/* MC_CMD_FC_IN_READ_MAP msgrequest */
#define MC_CMD_FC_IN_READ_MAP_LEN 8
@@ -851,8 +1482,10 @@
#define MC_CMD_FC_IN_READ_MAP_HEADER_OFST 4
#define MC_CMD_FC_IN_READ_MAP_OP_LBN 0
#define MC_CMD_FC_IN_READ_MAP_OP_WIDTH 8
-#define MC_CMD_FC_OP_READ_MAP_COUNT 0x1 /* enum */
-#define MC_CMD_FC_OP_READ_MAP_INDEX 0x2 /* enum */
+/* enum: Get the number of map regions */
+#define MC_CMD_FC_OP_READ_MAP_COUNT 0x1
+/* enum: Get the specified map */
+#define MC_CMD_FC_OP_READ_MAP_INDEX 0x2
/* MC_CMD_FC_IN_READ_MAP_COUNT msgrequest */
#define MC_CMD_FC_IN_READ_MAP_COUNT_LEN 8
@@ -892,13 +1525,18 @@
#define MC_CMD_FC_IN_IO_REL_HEADER_OFST 4
#define MC_CMD_FC_IN_IO_REL_OP_LBN 0
#define MC_CMD_FC_IN_IO_REL_OP_WIDTH 8
-#define MC_CMD_FC_IN_IO_REL_GET_ADDR 0x1 /* enum */
-#define MC_CMD_FC_IN_IO_REL_READ32 0x2 /* enum */
-#define MC_CMD_FC_IN_IO_REL_WRITE32 0x3 /* enum */
+/* enum: Get the base address that the FC applies to relative commands */
+#define MC_CMD_FC_IN_IO_REL_GET_ADDR 0x1
+/* enum: Read data */
+#define MC_CMD_FC_IN_IO_REL_READ32 0x2
+/* enum: Write data */
+#define MC_CMD_FC_IN_IO_REL_WRITE32 0x3
#define MC_CMD_FC_IN_IO_REL_COMP_TYPE_LBN 8
#define MC_CMD_FC_IN_IO_REL_COMP_TYPE_WIDTH 8
-#define MC_CMD_FC_COMP_TYPE_APP_ADDR_SPACE 0x1 /* enum */
-#define MC_CMD_FC_COMP_TYPE_FLASH 0x2 /* enum */
+/* enum: Application address space */
+#define MC_CMD_FC_COMP_TYPE_APP_ADDR_SPACE 0x1
+/* enum: Flash address space */
+#define MC_CMD_FC_COMP_TYPE_FLASH 0x2
/* MC_CMD_FC_IN_IO_REL_GET_ADDR msgrequest */
#define MC_CMD_FC_IN_IO_REL_GET_ADDR_LEN 8
@@ -932,22 +1570,36 @@
#define MC_CMD_FC_IN_UHLINK_HEADER_OFST 4
#define MC_CMD_FC_IN_UHLINK_OP_LBN 0
#define MC_CMD_FC_IN_UHLINK_OP_WIDTH 8
-#define MC_CMD_FC_OP_UHLINK_PHY 0x1 /* enum */
-#define MC_CMD_FC_OP_UHLINK_MAC 0x2 /* enum */
-#define MC_CMD_FC_OP_UHLINK_RX_EYE 0x3 /* enum */
-#define MC_CMD_FC_OP_UHLINK_DUMP_RX_EYE_PLOT 0x4 /* enum */
-#define MC_CMD_FC_OP_UHLINK_READ_RX_EYE_PLOT 0x5 /* enum */
-#define MC_CMD_FC_OP_UHLINK_RX_TUNE 0x6 /* enum */
-#define MC_CMD_FC_OP_UHLINK_LOOPBACK_SET 0x7 /* enum */
-#define MC_CMD_FC_OP_UHLINK_LOOPBACK_GET 0x8 /* enum */
+/* enum: Get PHY configuration info */
+#define MC_CMD_FC_OP_UHLINK_PHY 0x1
+/* enum: Get MAC configuration info */
+#define MC_CMD_FC_OP_UHLINK_MAC 0x2
+/* enum: Get Rx eye table */
+#define MC_CMD_FC_OP_UHLINK_RX_EYE 0x3
+/* enum: Get Rx eye plot */
+#define MC_CMD_FC_OP_UHLINK_DUMP_RX_EYE_PLOT 0x4
+/* enum: Get Rx eye plot */
+#define MC_CMD_FC_OP_UHLINK_READ_RX_EYE_PLOT 0x5
+/* enum: Retune Rx settings */
+#define MC_CMD_FC_OP_UHLINK_RX_TUNE 0x6
+/* enum: Set loopback mode on fpga port */
+#define MC_CMD_FC_OP_UHLINK_LOOPBACK_SET 0x7
+/* enum: Get loopback mode config state on fpga port */
+#define MC_CMD_FC_OP_UHLINK_LOOPBACK_GET 0x8
#define MC_CMD_FC_IN_UHLINK_PORT_TYPE_LBN 8
#define MC_CMD_FC_IN_UHLINK_PORT_TYPE_WIDTH 8
#define MC_CMD_FC_IN_UHLINK_PORT_IDX_LBN 16
#define MC_CMD_FC_IN_UHLINK_PORT_IDX_WIDTH 8
#define MC_CMD_FC_IN_UHLINK_CMD_FORMAT_LBN 24
#define MC_CMD_FC_IN_UHLINK_CMD_FORMAT_WIDTH 8
-#define MC_CMD_FC_OP_UHLINK_CMD_FORMAT_DEFAULT 0x0 /* enum */
-#define MC_CMD_FC_OP_UHLINK_CMD_FORMAT_PORT_OVERRIDE 0x1 /* enum */
+/* enum: Default FC command format; the fields PORT_TYPE and PORT_IDX are
+ * irrelevant. Port number is derived from pci_fn; passed in FC header.
+ */
+#define MC_CMD_FC_OP_UHLINK_CMD_FORMAT_DEFAULT 0x0
+/* enum: Override default port number. Port number determined by fields
+ * PORT_TYPE and PORT_IDX.
+ */
+#define MC_CMD_FC_OP_UHLINK_CMD_FORMAT_PORT_OVERRIDE 0x1
/* MC_CMD_FC_OP_UHLINK_PHY msgrequest */
#define MC_CMD_FC_OP_UHLINK_PHY_LEN 8
@@ -1006,6 +1658,7 @@
/* MC_CMD_FC_IN_SET_LINK msgrequest */
#define MC_CMD_FC_IN_SET_LINK_LEN 16
/* MC_CMD_FC_IN_CMD_OFST 0 */
+/* See MC_CMD_GET_LOOPBACK_MODES/MC_CMD_GET_LOOPBACK_MODES_OUT/100M */
#define MC_CMD_FC_IN_SET_LINK_MODE_OFST 4
#define MC_CMD_FC_IN_SET_LINK_SPEED_OFST 8
#define MC_CMD_FC_IN_SET_LINK_FLAGS_OFST 12
@@ -1028,7 +1681,9 @@
/* MC_CMD_FC_IN_CMD_OFST 0 */
#define MC_CMD_FC_IN_STARTUP_BASE_OFST 4
#define MC_CMD_FC_IN_STARTUP_LENGTH_OFST 8
+/* Length of identifier */
#define MC_CMD_FC_IN_STARTUP_IDLENGTH_OFST 12
+/* Identifier for AOE FPGA */
#define MC_CMD_FC_IN_STARTUP_ID_OFST 16
#define MC_CMD_FC_IN_STARTUP_ID_LEN 1
#define MC_CMD_FC_IN_STARTUP_ID_NUM 24
@@ -1044,6 +1699,7 @@
#define MC_CMD_FC_IN_DMA_STOP_LEN 12
/* MC_CMD_FC_IN_CMD_OFST 0 */
/* MC_CMD_FC_IN_DMA_OP_OFST 4 */
+/* FC supplied handle */
#define MC_CMD_FC_IN_DMA_STOP_FC_HANDLE_OFST 8
/* MC_CMD_FC_IN_DMA_READ msgrequest */
@@ -1065,18 +1721,25 @@
#define MC_CMD_FC_IN_TIMED_READ_SET_LEN 52
/* MC_CMD_FC_IN_CMD_OFST 0 */
/* MC_CMD_FC_IN_TIMED_READ_OP_OFST 4 */
+/* Host supplied handle (unique) */
#define MC_CMD_FC_IN_TIMED_READ_SET_HOST_HANDLE_OFST 8
+/* Address into which to transfer data in host */
#define MC_CMD_FC_IN_TIMED_READ_SET_HOST_DMA_ADDRESS_OFST 12
#define MC_CMD_FC_IN_TIMED_READ_SET_HOST_DMA_ADDRESS_LEN 8
#define MC_CMD_FC_IN_TIMED_READ_SET_HOST_DMA_ADDRESS_LO_OFST 12
#define MC_CMD_FC_IN_TIMED_READ_SET_HOST_DMA_ADDRESS_HI_OFST 16
+/* AOE address from which to transfer data */
#define MC_CMD_FC_IN_TIMED_READ_SET_AOE_ADDRESS_OFST 20
#define MC_CMD_FC_IN_TIMED_READ_SET_AOE_ADDRESS_LEN 8
#define MC_CMD_FC_IN_TIMED_READ_SET_AOE_ADDRESS_LO_OFST 20
#define MC_CMD_FC_IN_TIMED_READ_SET_AOE_ADDRESS_HI_OFST 24
+/* Length of AOE transfer (total) */
#define MC_CMD_FC_IN_TIMED_READ_SET_AOE_LENGTH_OFST 28
+/* Length of host transfer (total) */
#define MC_CMD_FC_IN_TIMED_READ_SET_HOST_LENGTH_OFST 32
+/* Offset back from aoe_address to apply operation to */
#define MC_CMD_FC_IN_TIMED_READ_SET_OFFSET_OFST 36
+/* Data to apply at offset */
#define MC_CMD_FC_IN_TIMED_READ_SET_DATA_OFST 40
#define MC_CMD_FC_IN_TIMED_READ_SET_FLAGS_OFST 44
#define MC_CMD_FC_IN_TIMED_READ_SET_INDIRECT_LBN 0
@@ -1091,18 +1754,21 @@
#define MC_CMD_FC_IN_TIMED_READ_SET_READ 0x1 /* enum */
#define MC_CMD_FC_IN_TIMED_READ_SET_WRITE 0x2 /* enum */
#define MC_CMD_FC_IN_TIMED_READ_SET_READWRITE 0x3 /* enum */
+/* Period at which reads are performed (100ms units) */
#define MC_CMD_FC_IN_TIMED_READ_SET_PERIOD_OFST 48
/* MC_CMD_FC_IN_TIMED_READ_GET msgrequest */
#define MC_CMD_FC_IN_TIMED_READ_GET_LEN 12
/* MC_CMD_FC_IN_CMD_OFST 0 */
/* MC_CMD_FC_IN_TIMED_READ_OP_OFST 4 */
+/* FC supplied handle */
#define MC_CMD_FC_IN_TIMED_READ_GET_FC_HANDLE_OFST 8
/* MC_CMD_FC_IN_TIMED_READ_CLEAR msgrequest */
#define MC_CMD_FC_IN_TIMED_READ_CLEAR_LEN 12
/* MC_CMD_FC_IN_CMD_OFST 0 */
/* MC_CMD_FC_IN_TIMED_READ_OP_OFST 4 */
+/* FC supplied handle */
#define MC_CMD_FC_IN_TIMED_READ_CLEAR_FC_HANDLE_OFST 8
/* MC_CMD_FC_IN_LOG msgrequest */
@@ -1116,14 +1782,18 @@
#define MC_CMD_FC_IN_LOG_ADDR_RANGE_LEN 20
/* MC_CMD_FC_IN_CMD_OFST 0 */
/* MC_CMD_FC_IN_LOG_OP_OFST 4 */
+/* Partition offset into flash */
#define MC_CMD_FC_IN_LOG_ADDR_RANGE_OFFSET_OFST 8
+/* Partition length */
#define MC_CMD_FC_IN_LOG_ADDR_RANGE_LENGTH_OFST 12
+/* Partition erase size */
#define MC_CMD_FC_IN_LOG_ADDR_RANGE_ERASE_SIZE_OFST 16
/* MC_CMD_FC_IN_LOG_JTAG_UART msgrequest */
#define MC_CMD_FC_IN_LOG_JTAG_UART_LEN 12
/* MC_CMD_FC_IN_CMD_OFST 0 */
/* MC_CMD_FC_IN_LOG_OP_OFST 4 */
+/* Enable/disable printing to JTAG UART */
#define MC_CMD_FC_IN_LOG_JTAG_UART_ENABLE_OFST 8
/* MC_CMD_FC_IN_CLOCK msgrequest */
@@ -1132,6 +1802,7 @@
#define MC_CMD_FC_IN_CLOCK_OP_OFST 4
#define MC_CMD_FC_IN_CLOCK_GET_TIME 0x0 /* enum */
#define MC_CMD_FC_IN_CLOCK_SET_TIME 0x1 /* enum */
+/* Perform a clock operation */
#define MC_CMD_FC_IN_CLOCK_ID_OFST 8
#define MC_CMD_FC_IN_CLOCK_STATS 0x0 /* enum */
#define MC_CMD_FC_IN_CLOCK_MAC 0x1 /* enum */
@@ -1140,6 +1811,7 @@
#define MC_CMD_FC_IN_CLOCK_GET_TIME_LEN 12
/* MC_CMD_FC_IN_CMD_OFST 0 */
/* MC_CMD_FC_IN_CLOCK_OP_OFST 4 */
+/* Retrieve the clock value of the specified clock */
/* MC_CMD_FC_IN_CLOCK_ID_OFST 8 */
/* MC_CMD_FC_IN_CLOCK_SET_TIME msgrequest */
@@ -1151,6 +1823,7 @@
#define MC_CMD_FC_IN_CLOCK_SET_TIME_SECONDS_LEN 8
#define MC_CMD_FC_IN_CLOCK_SET_TIME_SECONDS_LO_OFST 12
#define MC_CMD_FC_IN_CLOCK_SET_TIME_SECONDS_HI_OFST 16
+/* Set the clock value of the specified clock */
#define MC_CMD_FC_IN_CLOCK_SET_TIME_NANOSECONDS_OFST 20
/* MC_CMD_FC_IN_DDR msgrequest */
@@ -1170,40 +1843,59 @@
#define MC_CMD_FC_IN_DDR_SET_SPD_LEN 148
/* MC_CMD_FC_IN_CMD_OFST 0 */
/* MC_CMD_FC_IN_DDR_OP_OFST 4 */
+/* Affected bank */
/* MC_CMD_FC_IN_DDR_BANK_OFST 8 */
+/* Flags */
#define MC_CMD_FC_IN_DDR_FLAGS_OFST 12
#define MC_CMD_FC_IN_DDR_SET_SPD_ACTIVE 0x1 /* enum */
+/* 128-byte page of serial presence detect data read from module's EEPROM */
#define MC_CMD_FC_IN_DDR_SPD_OFST 16
#define MC_CMD_FC_IN_DDR_SPD_LEN 1
#define MC_CMD_FC_IN_DDR_SPD_NUM 128
+/* Page index of the spd data copied into MC_CMD_FC_IN_DDR_SPD */
#define MC_CMD_FC_IN_DDR_SPD_PAGE_ID_OFST 144
/* MC_CMD_FC_IN_DDR_GET_STATUS msgrequest */
#define MC_CMD_FC_IN_DDR_GET_STATUS_LEN 12
/* MC_CMD_FC_IN_CMD_OFST 0 */
/* MC_CMD_FC_IN_DDR_OP_OFST 4 */
+/* Affected bank */
/* MC_CMD_FC_IN_DDR_BANK_OFST 8 */
/* MC_CMD_FC_IN_TIMESTAMP msgrequest */
#define MC_CMD_FC_IN_TIMESTAMP_LEN 8
/* MC_CMD_FC_IN_CMD_OFST 0 */
+/* FC timestamp operation code */
#define MC_CMD_FC_IN_TIMESTAMP_OP_OFST 4
-#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT 0x0 /* enum */
-#define MC_CMD_FC_IN_TIMESTAMP_READ_SNAPSHOT 0x1 /* enum */
-#define MC_CMD_FC_IN_TIMESTAMP_CLEAR_TRANSMIT 0x2 /* enum */
+/* enum: Read transmit timestamp(s) */
+#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT 0x0
+/* enum: Read snapshot timestamps */
+#define MC_CMD_FC_IN_TIMESTAMP_READ_SNAPSHOT 0x1
+/* enum: Clear all transmit timestamps */
+#define MC_CMD_FC_IN_TIMESTAMP_CLEAR_TRANSMIT 0x2
/* MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT msgrequest */
#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_LEN 28
/* MC_CMD_FC_IN_CMD_OFST 0 */
#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_OP_OFST 4
+/* Control filtering of the returned timestamp and sequence number specified
+ * here
+ */
#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_FILTER_OFST 8
-#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_LATEST 0x0 /* enum */
-#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_MATCH 0x1 /* enum */
+/* enum: Return most recent timestamp. No filtering */
+#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_LATEST 0x0
+/* enum: Match timestamp against the PTP clock ID, port number and sequence
+ * number specified
+ */
+#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_MATCH 0x1
+/* Clock identity of PTP packet for which timestamp required */
#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_CLOCK_ID_OFST 12
#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_CLOCK_ID_LEN 8
#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_CLOCK_ID_LO_OFST 12
#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_CLOCK_ID_HI_OFST 16
+/* Port number of PTP packet for which timestamp required */
#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_PORT_NUM_OFST 20
+/* Sequence number of PTP packet for which timestamp required */
#define MC_CMD_FC_IN_TIMESTAMP_READ_TRANSMIT_SEQ_NUM_OFST 24
/* MC_CMD_FC_IN_TIMESTAMP_READ_SNAPSHOT msgrequest */
@@ -1219,10 +1911,14 @@
/* MC_CMD_FC_IN_SPI msgrequest */
#define MC_CMD_FC_IN_SPI_LEN 8
/* MC_CMD_FC_IN_CMD_OFST 0 */
+/* Basic commands for SPI Flash. */
#define MC_CMD_FC_IN_SPI_OP_OFST 4
-#define MC_CMD_FC_IN_SPI_READ 0x0 /* enum */
-#define MC_CMD_FC_IN_SPI_WRITE 0x1 /* enum */
-#define MC_CMD_FC_IN_SPI_ERASE 0x2 /* enum */
+/* enum: SPI Flash read */
+#define MC_CMD_FC_IN_SPI_READ 0x0
+/* enum: SPI Flash write */
+#define MC_CMD_FC_IN_SPI_WRITE 0x1
+/* enum: SPI Flash erase */
+#define MC_CMD_FC_IN_SPI_ERASE 0x2
/* MC_CMD_FC_IN_SPI_READ msgrequest */
#define MC_CMD_FC_IN_SPI_READ_LEN 16
@@ -1253,18 +1949,29 @@
/* MC_CMD_FC_IN_DIAG msgrequest */
#define MC_CMD_FC_IN_DIAG_LEN 8
/* MC_CMD_FC_IN_CMD_OFST 0 */
+/* Operation code indicating component type */
#define MC_CMD_FC_IN_DIAG_OP_OFST 4
-#define MC_CMD_FC_IN_DIAG_POWER_NOISE 0x0 /* enum */
-#define MC_CMD_FC_IN_DIAG_DDR_SOAK 0x1 /* enum */
-#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL 0x2 /* enum */
+/* enum: Power noise generator. */
+#define MC_CMD_FC_IN_DIAG_POWER_NOISE 0x0
+/* enum: DDR soak test component. */
+#define MC_CMD_FC_IN_DIAG_DDR_SOAK 0x1
+/* enum: Diagnostics datapath control component. */
+#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL 0x2
/* MC_CMD_FC_IN_DIAG_POWER_NOISE msgrequest */
#define MC_CMD_FC_IN_DIAG_POWER_NOISE_LEN 12
/* MC_CMD_FC_IN_CMD_OFST 0 */
#define MC_CMD_FC_IN_DIAG_POWER_NOISE_OP_OFST 4
+/* Sub-opcode describing the operation to be carried out */
#define MC_CMD_FC_IN_DIAG_POWER_NOISE_SUB_OP_OFST 8
-#define MC_CMD_FC_IN_DIAG_POWER_NOISE_READ_CONFIG 0x0 /* enum */
-#define MC_CMD_FC_IN_DIAG_POWER_NOISE_WRITE_CONFIG 0x1 /* enum */
+/* enum: Read the configuration (the 32-bit values in each of the clock enable
+ * count and toggle count registers)
+ */
+#define MC_CMD_FC_IN_DIAG_POWER_NOISE_READ_CONFIG 0x0
+/* enum: Write a new configuration to the clock enable count and toggle count
+ * registers
+ */
+#define MC_CMD_FC_IN_DIAG_POWER_NOISE_WRITE_CONFIG 0x1
/* MC_CMD_FC_IN_DIAG_POWER_NOISE_READ_CONFIG msgrequest */
#define MC_CMD_FC_IN_DIAG_POWER_NOISE_READ_CONFIG_LEN 12
@@ -1277,28 +1984,42 @@
/* MC_CMD_FC_IN_CMD_OFST 0 */
#define MC_CMD_FC_IN_DIAG_POWER_NOISE_WRITE_CONFIG_OP_OFST 4
#define MC_CMD_FC_IN_DIAG_POWER_NOISE_WRITE_CONFIG_SUB_OP_OFST 8
+/* The 32-bit value to be written to the toggle count register */
#define MC_CMD_FC_IN_DIAG_POWER_NOISE_WRITE_CONFIG_TOGGLE_COUNT_OFST 12
+/* The 32-bit value to be written to the clock enable count register */
#define MC_CMD_FC_IN_DIAG_POWER_NOISE_WRITE_CONFIG_CLKEN_COUNT_OFST 16
/* MC_CMD_FC_IN_DIAG_DDR_SOAK msgrequest */
#define MC_CMD_FC_IN_DIAG_DDR_SOAK_LEN 12
/* MC_CMD_FC_IN_CMD_OFST 0 */
#define MC_CMD_FC_IN_DIAG_DDR_SOAK_OP_OFST 4
+/* Sub-opcode describing the operation to be carried out */
#define MC_CMD_FC_IN_DIAG_DDR_SOAK_SUB_OP_OFST 8
-#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START 0x0 /* enum */
-#define MC_CMD_FC_IN_DIAG_DDR_SOAK_RESULT 0x1 /* enum */
-#define MC_CMD_FC_IN_DIAG_DDR_SOAK_STOP 0x2 /* enum */
-#define MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR 0x3 /* enum */
+/* enum: Starts DDR soak test on selected banks */
+#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START 0x0
+/* enum: Read status of DDR soak test */
+#define MC_CMD_FC_IN_DIAG_DDR_SOAK_RESULT 0x1
+/* enum: Stop test */
+#define MC_CMD_FC_IN_DIAG_DDR_SOAK_STOP 0x2
+/* enum: Set or clear bit that triggers fake errors. These cause subsequent
+ * tests to fail until the bit is cleared.
+ */
+#define MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR 0x3
/* MC_CMD_FC_IN_DIAG_DDR_SOAK_START msgrequest */
#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_LEN 24
/* MC_CMD_FC_IN_CMD_OFST 0 */
#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_OP_OFST 4
#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_SUB_OP_OFST 8
+/* Mask of DDR banks to be tested */
#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_BANK_MASK_OFST 12
+/* Pattern to use in the soak test */
#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_TEST_PATTERN_OFST 16
#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_ZEROS 0x0 /* enum */
#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_ONES 0x1 /* enum */
+/* Either multiple automatic tests until a STOP command is issued, or one
+ * single test
+ */
#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_TEST_TYPE_OFST 20
#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_ONGOING_TEST 0x0 /* enum */
#define MC_CMD_FC_IN_DIAG_DDR_SOAK_START_SINGLE_TEST 0x1 /* enum */
@@ -1308,6 +2029,7 @@
/* MC_CMD_FC_IN_CMD_OFST 0 */
#define MC_CMD_FC_IN_DIAG_DDR_SOAK_RESULT_OP_OFST 4
#define MC_CMD_FC_IN_DIAG_DDR_SOAK_RESULT_SUB_OP_OFST 8
+/* DDR bank to read status from */
#define MC_CMD_FC_IN_DIAG_DDR_SOAK_RESULT_BANK_ID_OFST 12
#define MC_CMD_FC_DDR_BANK0 0x0 /* enum */
#define MC_CMD_FC_DDR_BANK1 0x1 /* enum */
@@ -1320,6 +2042,7 @@
/* MC_CMD_FC_IN_CMD_OFST 0 */
#define MC_CMD_FC_IN_DIAG_DDR_SOAK_STOP_OP_OFST 4
#define MC_CMD_FC_IN_DIAG_DDR_SOAK_STOP_SUB_OP_OFST 8
+/* Mask of DDR banks to be tested */
#define MC_CMD_FC_IN_DIAG_DDR_SOAK_STOP_BANK_MASK_OFST 12
/* MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR msgrequest */
@@ -1327,6 +2050,7 @@
/* MC_CMD_FC_IN_CMD_OFST 0 */
#define MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR_OP_OFST 4
#define MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR_SUB_OP_OFST 8
+/* Mask of DDR banks to set/clear error flag on */
#define MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR_BANK_MASK_OFST 12
#define MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR_FLAG_ACTION_OFST 16
#define MC_CMD_FC_IN_DIAG_DDR_SOAK_ERROR_CLEAR 0x0 /* enum */
@@ -1336,15 +2060,19 @@
#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_LEN 12
/* MC_CMD_FC_IN_CMD_OFST 0 */
#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_OP_OFST 4
+/* Sub-opcode describing the operation to be carried out */
#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SUB_OP_OFST 8
-#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE 0x0 /* enum */
-#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_RAW_CONFIG 0x1 /* enum */
+/* enum: Set a known datapath configuration */
+#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE 0x0
+/* enum: Apply raw config to datapath control registers */
+#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_RAW_CONFIG 0x1
/* MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE msgrequest */
#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE_LEN 16
/* MC_CMD_FC_IN_CMD_OFST 0 */
#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE_OP_OFST 4
#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE_SUB_OP_OFST 8
+/* Datapath configuration identifier */
#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE_MODE_OFST 12
#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE_PASSTHROUGH 0x0 /* enum */
#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_SET_MODE_SNAKE 0x1 /* enum */
@@ -1354,8 +2082,11 @@
/* MC_CMD_FC_IN_CMD_OFST 0 */
#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_RAW_CONFIG_OP_OFST 4
#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_RAW_CONFIG_SUB_OP_OFST 8
+/* Value to write into control register 1 */
#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_RAW_CONFIG_CONTROL1_OFST 12
+/* Value to write into control register 2 */
#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_RAW_CONFIG_CONTROL2_OFST 16
+/* Value to write into control register 3 */
#define MC_CMD_FC_IN_DIAG_DATAPATH_CTRL_RAW_CONFIG_CONTROL3_OFST 20
/* MC_CMD_FC_OUT msgresponse */
@@ -1444,7 +2175,8 @@
#define MC_CMD_FC_MAC_RX_STATS_JABBERS 0x16 /* enum */
#define MC_CMD_FC_MAC_RX_STATS_FRAGMENTS 0x17 /* enum */
#define MC_CMD_FC_MAC_RX_MAC_CONTROL_FRAMES 0x18 /* enum */
-#define MC_CMD_FC_MAC_RX_NSTATS 0x19 /* enum */
+/* enum: (Last entry) */
+#define MC_CMD_FC_MAC_RX_NSTATS 0x19
/* MC_CMD_FC_OUT_MAC_GET_TX_STATS msgresponse */
#define MC_CMD_FC_OUT_MAC_GET_TX_STATS_LEN ((((0-1+(64*MC_CMD_FC_MAC_TX_NSTATS))+1))>>3)
@@ -1475,10 +2207,12 @@
#define MC_CMD_FC_MAC_TX_STATS_PKTS_1024_1518 0x13 /* enum */
#define MC_CMD_FC_MAC_TX_STATS_PKTS_1519_TX_MTU 0x14 /* enum */
#define MC_CMD_FC_MAC_TX_MAC_CONTROL_FRAMES 0x15 /* enum */
-#define MC_CMD_FC_MAC_TX_NSTATS 0x16 /* enum */
+/* enum: (Last entry) */
+#define MC_CMD_FC_MAC_TX_NSTATS 0x16
/* MC_CMD_FC_OUT_MAC_GET_STATS msgresponse */
#define MC_CMD_FC_OUT_MAC_GET_STATS_LEN ((((0-1+(64*MC_CMD_FC_MAC_NSTATS_PER_BLOCK))+1))>>3)
+/* MAC Statistics */
#define MC_CMD_FC_OUT_MAC_GET_STATS_STATISTICS_OFST 0
#define MC_CMD_FC_OUT_MAC_GET_STATS_STATISTICS_LEN 8
#define MC_CMD_FC_OUT_MAC_GET_STATS_STATISTICS_LO_OFST 0
@@ -1499,10 +2233,14 @@
#define MC_CMD_FC_OUT_DDR_TEST_POLL_STATUS_OFST 0
#define MC_CMD_FC_OUT_DDR_TEST_POLL_CODE_LBN 0
#define MC_CMD_FC_OUT_DDR_TEST_POLL_CODE_WIDTH 8
-#define MC_CMD_FC_OP_DDR_TEST_NONE 0x0 /* enum */
-#define MC_CMD_FC_OP_DDR_TEST_INPROGRESS 0x1 /* enum */
-#define MC_CMD_FC_OP_DDR_TEST_SUCCESS 0x2 /* enum */
-#define MC_CMD_FC_OP_DDR_TEST_TIMER_EXPIRED 0x3 /* enum */
+/* enum: Test not yet initiated */
+#define MC_CMD_FC_OP_DDR_TEST_NONE 0x0
+/* enum: Test is in progress */
+#define MC_CMD_FC_OP_DDR_TEST_INPROGRESS 0x1
+/* enum: Timed completed */
+#define MC_CMD_FC_OP_DDR_TEST_SUCCESS 0x2
+/* enum: Test did not complete in specified time */
+#define MC_CMD_FC_OP_DDR_TEST_TIMER_EXPIRED 0x3
#define MC_CMD_FC_OUT_DDR_TEST_POLL_PRESENT_T0_LBN 11
#define MC_CMD_FC_OUT_DDR_TEST_POLL_PRESENT_T0_WIDTH 1
#define MC_CMD_FC_OUT_DDR_TEST_POLL_PRESENT_T1_LBN 10
@@ -1511,6 +2249,7 @@
#define MC_CMD_FC_OUT_DDR_TEST_POLL_PRESENT_B0_WIDTH 1
#define MC_CMD_FC_OUT_DDR_TEST_POLL_PRESENT_B1_LBN 8
#define MC_CMD_FC_OUT_DDR_TEST_POLL_PRESENT_B1_WIDTH 1
+/* Test result from FPGA */
#define MC_CMD_FC_OUT_DDR_TEST_POLL_RESULT_OFST 4
#define MC_CMD_FC_OUT_DDR_TEST_POLL_FPGA_SUPPORTS_T0_LBN 31
#define MC_CMD_FC_OUT_DDR_TEST_POLL_FPGA_SUPPORTS_T0_WIDTH 1
@@ -1539,23 +2278,35 @@
/* MC_CMD_FC_OUT_GET_ASSERT msgresponse */
#define MC_CMD_FC_OUT_GET_ASSERT_LEN 144
+/* Assertion status flag. */
#define MC_CMD_FC_OUT_GET_ASSERT_GLOBAL_FLAGS_OFST 0
#define MC_CMD_FC_OUT_GET_ASSERT_STATE_LBN 8
#define MC_CMD_FC_OUT_GET_ASSERT_STATE_WIDTH 8
-#define MC_CMD_FC_GET_ASSERT_FLAGS_STATE_CLEAR 0x0 /* enum */
-#define MC_CMD_FC_GET_ASSERT_FLAGS_STATE_NEW 0x1 /* enum */
-#define MC_CMD_FC_GET_ASSERT_FLAGS_STATE_NOTIFIED 0x2 /* enum */
+/* enum: No crash data available */
+#define MC_CMD_FC_GET_ASSERT_FLAGS_STATE_CLEAR 0x0
+/* enum: New crash data available */
+#define MC_CMD_FC_GET_ASSERT_FLAGS_STATE_NEW 0x1
+/* enum: Crash data has been sent */
+#define MC_CMD_FC_GET_ASSERT_FLAGS_STATE_NOTIFIED 0x2
#define MC_CMD_FC_OUT_GET_ASSERT_TYPE_LBN 0
#define MC_CMD_FC_OUT_GET_ASSERT_TYPE_WIDTH 8
-#define MC_CMD_FC_GET_ASSERT_FLAGS_TYPE_NONE 0x0 /* enum */
-#define MC_CMD_FC_GET_ASSERT_FLAGS_TYPE_EXCEPTION 0x1 /* enum */
-#define MC_CMD_FC_GET_ASSERT_FLAGS_TYPE_ASSERTION 0x2 /* enum */
+/* enum: No crash has been recorded. */
+#define MC_CMD_FC_GET_ASSERT_FLAGS_TYPE_NONE 0x0
+/* enum: Crash due to exception. */
+#define MC_CMD_FC_GET_ASSERT_FLAGS_TYPE_EXCEPTION 0x1
+/* enum: Crash due to assertion. */
+#define MC_CMD_FC_GET_ASSERT_FLAGS_TYPE_ASSERTION 0x2
+/* Failing PC value */
#define MC_CMD_FC_OUT_GET_ASSERT_SAVED_PC_OFFS_OFST 4
+/* Saved GP regs */
#define MC_CMD_FC_OUT_GET_ASSERT_GP_REGS_OFFS_OFST 8
#define MC_CMD_FC_OUT_GET_ASSERT_GP_REGS_OFFS_LEN 4
#define MC_CMD_FC_OUT_GET_ASSERT_GP_REGS_OFFS_NUM 31
+/* Exception Type */
#define MC_CMD_FC_OUT_GET_ASSERT_EXCEPTION_TYPE_OFFS_OFST 132
+/* Instruction at which exception occurred */
#define MC_CMD_FC_OUT_GET_ASSERT_EXCEPTION_PC_ADDR_OFFS_OFST 136
+/* BAD Address that triggered address-based exception */
#define MC_CMD_FC_OUT_GET_ASSERT_EXCEPTION_BAD_ADDR_OFFS_OFST 140
/* MC_CMD_FC_OUT_FPGA_BUILD msgresponse */
@@ -1573,6 +2324,7 @@
#define MC_CMD_FC_OUT_FPGA_BUILD_VERSION_MINOR_WIDTH 8
#define MC_CMD_FC_OUT_FPGA_BUILD_BUILD_NUM_LBN 0
#define MC_CMD_FC_OUT_FPGA_BUILD_BUILD_NUM_WIDTH 4
+/* Build timestamp (seconds since epoch) */
#define MC_CMD_FC_OUT_FPGA_BUILD_TIMESTAMP_OFST 4
#define MC_CMD_FC_OUT_FPGA_BUILD_PARAMETERS_OFST 8
#define MC_CMD_FC_OUT_FPGA_BUILD_FPGA_TYPE_LBN 0
@@ -1650,6 +2402,7 @@
#define MC_CMD_FC_OUT_FPGA_SERVICES_VERSION_MINOR_WIDTH 8
#define MC_CMD_FC_OUT_FPGA_SERVICES_BUILD_NUM_LBN 0
#define MC_CMD_FC_OUT_FPGA_SERVICES_BUILD_NUM_WIDTH 4
+/* Build timestamp (seconds since epoch) */
#define MC_CMD_FC_OUT_FPGA_SERVICES_TIMESTAMP_OFST 4
#define MC_CMD_FC_OUT_FPGA_SERVICES_PARAMETERS_OFST 8
#define MC_CMD_FC_OUT_FPGA_SERVICES_FC_FLASH_BOOTED_LBN 8
@@ -1686,6 +2439,7 @@
/* MC_CMD_FC_OUT_BSP_VERSION msgresponse */
#define MC_CMD_FC_OUT_BSP_VERSION_LEN 4
+/* Qsys system ID */
#define MC_CMD_FC_OUT_BSP_VERSION_SYSID_OFST 0
#define MC_CMD_FC_OUT_BSP_VERSION_VERSION_MAJOR_LBN 12
#define MC_CMD_FC_OUT_BSP_VERSION_VERSION_MAJOR_WIDTH 4
@@ -1696,11 +2450,14 @@
/* MC_CMD_FC_OUT_READ_MAP_COUNT msgresponse */
#define MC_CMD_FC_OUT_READ_MAP_COUNT_LEN 4
+/* Number of maps */
#define MC_CMD_FC_OUT_READ_MAP_COUNT_NUM_MAPS_OFST 0
/* MC_CMD_FC_OUT_READ_MAP_INDEX msgresponse */
#define MC_CMD_FC_OUT_READ_MAP_INDEX_LEN 164
+/* Index of the map */
#define MC_CMD_FC_OUT_READ_MAP_INDEX_INDEX_OFST 0
+/* Options for the map */
#define MC_CMD_FC_OUT_READ_MAP_INDEX_OPTIONS_OFST 4
#define MC_CMD_FC_OUT_READ_MAP_INDEX_ALIGN_8 0x0 /* enum */
#define MC_CMD_FC_OUT_READ_MAP_INDEX_ALIGN_16 0x1 /* enum */
@@ -1713,19 +2470,24 @@
#define MC_CMD_FC_OUT_READ_MAP_INDEX_PERM_WRITE 0x20 /* enum */
#define MC_CMD_FC_OUT_READ_MAP_INDEX_LICENSE_FREE 0x0 /* enum */
#define MC_CMD_FC_OUT_READ_MAP_INDEX_LICENSE_LICENSED 0x40 /* enum */
+/* Address of start of map */
#define MC_CMD_FC_OUT_READ_MAP_INDEX_ADDRESS_OFST 8
#define MC_CMD_FC_OUT_READ_MAP_INDEX_ADDRESS_LEN 8
#define MC_CMD_FC_OUT_READ_MAP_INDEX_ADDRESS_LO_OFST 8
#define MC_CMD_FC_OUT_READ_MAP_INDEX_ADDRESS_HI_OFST 12
+/* Length of address map */
#define MC_CMD_FC_OUT_READ_MAP_INDEX_LEN_OFST 16
#define MC_CMD_FC_OUT_READ_MAP_INDEX_LEN_LEN 8
#define MC_CMD_FC_OUT_READ_MAP_INDEX_LEN_LO_OFST 16
#define MC_CMD_FC_OUT_READ_MAP_INDEX_LEN_HI_OFST 20
+/* Component information field */
#define MC_CMD_FC_OUT_READ_MAP_INDEX_COMP_INFO_OFST 24
+/* License expiry data for map */
#define MC_CMD_FC_OUT_READ_MAP_INDEX_LICENSE_DATE_OFST 28
#define MC_CMD_FC_OUT_READ_MAP_INDEX_LICENSE_DATE_LEN 8
#define MC_CMD_FC_OUT_READ_MAP_INDEX_LICENSE_DATE_LO_OFST 28
#define MC_CMD_FC_OUT_READ_MAP_INDEX_LICENSE_DATE_HI_OFST 32
+/* Name of the component */
#define MC_CMD_FC_OUT_READ_MAP_INDEX_NAME_OFST 36
#define MC_CMD_FC_OUT_READ_MAP_INDEX_NAME_LEN 1
#define MC_CMD_FC_OUT_READ_MAP_INDEX_NAME_NUM 128
@@ -1735,7 +2497,9 @@
/* MC_CMD_FC_OUT_CAPABILITIES msgresponse */
#define MC_CMD_FC_OUT_CAPABILITIES_LEN 8
+/* Number of internal ports */
#define MC_CMD_FC_OUT_CAPABILITIES_INTERNAL_OFST 0
+/* Number of external ports */
#define MC_CMD_FC_OUT_CAPABILITIES_EXTERNAL_OFST 4
/* MC_CMD_FC_OUT_GLOBAL_FLAGS msgresponse */
@@ -1769,34 +2533,46 @@
#define MC_CMD_FC_OUT_UHLINK_PHY_TRC_TX_VOD_WIDTH 16
#define MC_CMD_FC_OUT_UHLINK_PHY_TRC_TX_PREEMP_1STPOSTTAP_LBN 16
#define MC_CMD_FC_OUT_UHLINK_PHY_TRC_TX_PREEMP_1STPOSTTAP_WIDTH 16
+/* Transceiver Transmit settings */
#define MC_CMD_FC_OUT_UHLINK_PHY_TRC_TX_SETTINGS_1_OFST 4
#define MC_CMD_FC_OUT_UHLINK_PHY_TRC_TX_PREEMP_PRETAP_LBN 0
#define MC_CMD_FC_OUT_UHLINK_PHY_TRC_TX_PREEMP_PRETAP_WIDTH 16
#define MC_CMD_FC_OUT_UHLINK_PHY_TRC_TX_PREEMP_2NDPOSTTAP_LBN 16
#define MC_CMD_FC_OUT_UHLINK_PHY_TRC_TX_PREEMP_2NDPOSTTAP_WIDTH 16
+/* Transceiver Receive settings */
#define MC_CMD_FC_OUT_UHLINK_PHY_TRC_RX_SETTINGS_OFST 8
#define MC_CMD_FC_OUT_UHLINK_PHY_TRC_RX_DC_GAIN_LBN 0
#define MC_CMD_FC_OUT_UHLINK_PHY_TRC_RX_DC_GAIN_WIDTH 16
#define MC_CMD_FC_OUT_UHLINK_PHY_TRC_RX_EQ_CONTROL_LBN 16
#define MC_CMD_FC_OUT_UHLINK_PHY_TRC_RX_EQ_CONTROL_WIDTH 16
+/* Rx eye opening */
#define MC_CMD_FC_OUT_UHLINK_PHY_RX_EYE_OFST 12
#define MC_CMD_FC_OUT_UHLINK_PHY_RX_EYE_WIDTH_LBN 0
#define MC_CMD_FC_OUT_UHLINK_PHY_RX_EYE_WIDTH_WIDTH 16
#define MC_CMD_FC_OUT_UHLINK_PHY_RX_EYE_HEIGHT_LBN 16
#define MC_CMD_FC_OUT_UHLINK_PHY_RX_EYE_HEIGHT_WIDTH 16
+/* PCS status word */
#define MC_CMD_FC_OUT_UHLINK_PHY_PCS_STATUS_OFST 16
+/* Link status word */
#define MC_CMD_FC_OUT_UHLINK_PHY_LINK_STATE_WORD_OFST 20
#define MC_CMD_FC_OUT_UHLINK_PHY_LINK_STATE_LBN 0
#define MC_CMD_FC_OUT_UHLINK_PHY_LINK_STATE_WIDTH 1
#define MC_CMD_FC_OUT_UHLINK_PHY_LINK_CONFIGURED_LBN 1
#define MC_CMD_FC_OUT_UHLINK_PHY_LINK_CONFIGURED_WIDTH 1
+/* Current SFp parameters applied */
#define MC_CMD_FC_OUT_UHLINK_PHY_SFP_PARAMS_OFST 24
#define MC_CMD_FC_OUT_UHLINK_PHY_SFP_PARAMS_LEN 20
+/* Link speed is 100, 1000, 10000 */
#define MC_CMD_FC_OUT_UHLINK_PHY_SFP_SPEED_OFST 24
+/* Length of copper cable - zero when not relevant */
#define MC_CMD_FC_OUT_UHLINK_PHY_SFP_COPPER_LEN_OFST 28
+/* True if a dual speed SFP+ module */
#define MC_CMD_FC_OUT_UHLINK_PHY_SFP_DUAL_SPEED_OFST 32
+/* True if an SFP Module is present (other fields valid when true) */
#define MC_CMD_FC_OUT_UHLINK_PHY_SFP_PRESENT_OFST 36
+/* The type of the SFP+ Module */
#define MC_CMD_FC_OUT_UHLINK_PHY_SFP_TYPE_OFST 40
+/* PHY config flags */
#define MC_CMD_FC_OUT_UHLINK_PHY_PHY_CFG_OFST 44
#define MC_CMD_FC_OUT_UHLINK_PHY_PHY_CFG_DFE_LBN 0
#define MC_CMD_FC_OUT_UHLINK_PHY_PHY_CFG_DFE_WIDTH 1
@@ -1807,9 +2583,13 @@
/* MC_CMD_FC_OUT_UHLINK_MAC msgresponse */
#define MC_CMD_FC_OUT_UHLINK_MAC_LEN 20
+/* MAC configuration applied */
#define MC_CMD_FC_OUT_UHLINK_MAC_CONFIG_OFST 0
+/* MTU size */
#define MC_CMD_FC_OUT_UHLINK_MAC_MTU_OFST 4
+/* IF Mode status */
#define MC_CMD_FC_OUT_UHLINK_MAC_IF_STATUS_OFST 8
+/* MAC address configured */
#define MC_CMD_FC_OUT_UHLINK_MAC_ADDR_OFST 12
#define MC_CMD_FC_OUT_UHLINK_MAC_ADDR_LEN 8
#define MC_CMD_FC_OUT_UHLINK_MAC_ADDR_LO_OFST 12
@@ -1817,6 +2597,7 @@
/* MC_CMD_FC_OUT_UHLINK_RX_EYE msgresponse */
#define MC_CMD_FC_OUT_UHLINK_RX_EYE_LEN ((((0-1+(32*MC_CMD_FC_UHLINK_RX_EYE_PER_BLOCK))+1))>>3)
+/* Rx Eye measurements */
#define MC_CMD_FC_OUT_UHLINK_RX_EYE_RX_EYE_OFST 0
#define MC_CMD_FC_OUT_UHLINK_RX_EYE_RX_EYE_LEN 4
#define MC_CMD_FC_OUT_UHLINK_RX_EYE_RX_EYE_NUM MC_CMD_FC_UHLINK_RX_EYE_PER_BLOCK
@@ -1826,7 +2607,9 @@
/* MC_CMD_FC_OUT_UHLINK_READ_RX_EYE_PLOT msgresponse */
#define MC_CMD_FC_OUT_UHLINK_READ_RX_EYE_PLOT_LEN ((((32-1+(64*MC_CMD_FC_UHLINK_RX_EYE_PLOT_ROWS_PER_BLOCK))+1))>>3)
+/* Has the eye plot dump completed and data returned is valid? */
#define MC_CMD_FC_OUT_UHLINK_READ_RX_EYE_PLOT_VALID_OFST 0
+/* Rx Eye binary plot */
#define MC_CMD_FC_OUT_UHLINK_READ_RX_EYE_PLOT_ROWS_OFST 4
#define MC_CMD_FC_OUT_UHLINK_READ_RX_EYE_PLOT_ROWS_LEN 8
#define MC_CMD_FC_OUT_UHLINK_READ_RX_EYE_PLOT_ROWS_LO_OFST 4
@@ -1851,12 +2634,16 @@
/* MC_CMD_FC_OUT_LICENSE msgresponse */
#define MC_CMD_FC_OUT_LICENSE_LEN 12
+/* Count of valid keys */
#define MC_CMD_FC_OUT_LICENSE_VALID_KEYS_OFST 0
+/* Count of invalid keys */
#define MC_CMD_FC_OUT_LICENSE_INVALID_KEYS_OFST 4
+/* Count of blacklisted keys */
#define MC_CMD_FC_OUT_LICENSE_BLACKLISTED_KEYS_OFST 8
/* MC_CMD_FC_OUT_STARTUP msgresponse */
#define MC_CMD_FC_OUT_STARTUP_LEN 4
+/* Capabilities of the FPGA/FC */
#define MC_CMD_FC_OUT_STARTUP_CAPABILITIES_OFST 0
#define MC_CMD_FC_OUT_STARTUP_CAN_ACCESS_FLASH_LBN 0
#define MC_CMD_FC_OUT_STARTUP_CAN_ACCESS_FLASH_WIDTH 1
@@ -1865,6 +2652,7 @@
#define MC_CMD_FC_OUT_DMA_READ_LENMIN 1
#define MC_CMD_FC_OUT_DMA_READ_LENMAX 252
#define MC_CMD_FC_OUT_DMA_READ_LEN(num) (0+1*(num))
+/* The data read */
#define MC_CMD_FC_OUT_DMA_READ_DATA_OFST 0
#define MC_CMD_FC_OUT_DMA_READ_DATA_LEN 1
#define MC_CMD_FC_OUT_DMA_READ_DATA_MINNUM 1
@@ -1872,27 +2660,36 @@
/* MC_CMD_FC_OUT_TIMED_READ_SET msgresponse */
#define MC_CMD_FC_OUT_TIMED_READ_SET_LEN 4
+/* Timer handle */
#define MC_CMD_FC_OUT_TIMED_READ_SET_FC_HANDLE_OFST 0
/* MC_CMD_FC_OUT_TIMED_READ_GET msgresponse */
#define MC_CMD_FC_OUT_TIMED_READ_GET_LEN 52
+/* Host supplied handle (unique) */
#define MC_CMD_FC_OUT_TIMED_READ_GET_HOST_HANDLE_OFST 0
+/* Address into which to transfer data in host */
#define MC_CMD_FC_OUT_TIMED_READ_GET_HOST_DMA_ADDRESS_OFST 4
#define MC_CMD_FC_OUT_TIMED_READ_GET_HOST_DMA_ADDRESS_LEN 8
#define MC_CMD_FC_OUT_TIMED_READ_GET_HOST_DMA_ADDRESS_LO_OFST 4
#define MC_CMD_FC_OUT_TIMED_READ_GET_HOST_DMA_ADDRESS_HI_OFST 8
+/* AOE address from which to transfer data */
#define MC_CMD_FC_OUT_TIMED_READ_GET_AOE_ADDRESS_OFST 12
#define MC_CMD_FC_OUT_TIMED_READ_GET_AOE_ADDRESS_LEN 8
#define MC_CMD_FC_OUT_TIMED_READ_GET_AOE_ADDRESS_LO_OFST 12
#define MC_CMD_FC_OUT_TIMED_READ_GET_AOE_ADDRESS_HI_OFST 16
+/* Length of AOE transfer (total) */
#define MC_CMD_FC_OUT_TIMED_READ_GET_AOE_LENGTH_OFST 20
+/* Length of host transfer (total) */
#define MC_CMD_FC_OUT_TIMED_READ_GET_HOST_LENGTH_OFST 24
+/* See FLAGS entry for MC_CMD_FC_IN_TIMED_READ_SET */
#define MC_CMD_FC_OUT_TIMED_READ_GET_FLAGS_OFST 28
#define MC_CMD_FC_OUT_TIMED_READ_GET_PERIOD_OFST 32
+/* When active, start read time */
#define MC_CMD_FC_OUT_TIMED_READ_GET_CLOCK_START_OFST 36
#define MC_CMD_FC_OUT_TIMED_READ_GET_CLOCK_START_LEN 8
#define MC_CMD_FC_OUT_TIMED_READ_GET_CLOCK_START_LO_OFST 36
#define MC_CMD_FC_OUT_TIMED_READ_GET_CLOCK_START_HI_OFST 40
+/* When active, end read time */
#define MC_CMD_FC_OUT_TIMED_READ_GET_CLOCK_END_OFST 44
#define MC_CMD_FC_OUT_TIMED_READ_GET_CLOCK_END_LEN 8
#define MC_CMD_FC_OUT_TIMED_READ_GET_CLOCK_END_LO_OFST 44
@@ -1964,7 +2761,9 @@
/* MC_CMD_FC_OUT_DIAG_POWER_NOISE_READ_CONFIG msgresponse */
#define MC_CMD_FC_OUT_DIAG_POWER_NOISE_READ_CONFIG_LEN 8
+/* The 32-bit value read from the toggle count register */
#define MC_CMD_FC_OUT_DIAG_POWER_NOISE_READ_CONFIG_TOGGLE_COUNT_OFST 0
+/* The 32-bit value read from the clock enable count register */
#define MC_CMD_FC_OUT_DIAG_POWER_NOISE_READ_CONFIG_CLKEN_COUNT_OFST 4
/* MC_CMD_FC_OUT_DIAG_POWER_NOISE_WRITE_CONFIG msgresponse */
@@ -1975,6 +2774,7 @@
/* MC_CMD_FC_OUT_DIAG_DDR_SOAK_RESULT msgresponse */
#define MC_CMD_FC_OUT_DIAG_DDR_SOAK_RESULT_LEN 8
+/* DDR soak test status word; bits [4:0] are relevant. */
#define MC_CMD_FC_OUT_DIAG_DDR_SOAK_RESULT_STATUS_OFST 0
#define MC_CMD_FC_OUT_DIAG_DDR_SOAK_RESULT_PASSED_LBN 0
#define MC_CMD_FC_OUT_DIAG_DDR_SOAK_RESULT_PASSED_WIDTH 1
@@ -1986,6 +2786,7 @@
#define MC_CMD_FC_OUT_DIAG_DDR_SOAK_RESULT_TIMEOUT_WIDTH 1
#define MC_CMD_FC_OUT_DIAG_DDR_SOAK_RESULT_PNF_LBN 4
#define MC_CMD_FC_OUT_DIAG_DDR_SOAK_RESULT_PNF_WIDTH 1
+/* DDR soak test error count */
#define MC_CMD_FC_OUT_DIAG_DDR_SOAK_RESULT_ERR_COUNT_OFST 4
/* MC_CMD_FC_OUT_DIAG_DDR_SOAK_STOP msgresponse */
@@ -2002,39 +2803,70 @@
/***********************************/
-/* MC_CMD_AOE
- * AOE operations (on MC rather than FC)
+/* MC_CMD_AOE
+ * AOE operations on MC
*/
-#define MC_CMD_AOE 0xa
+#define MC_CMD_AOE 0xa
/* MC_CMD_AOE_IN msgrequest */
#define MC_CMD_AOE_IN_LEN 4
#define MC_CMD_AOE_IN_OP_HDR_OFST 0
#define MC_CMD_AOE_IN_OP_LBN 0
#define MC_CMD_AOE_IN_OP_WIDTH 8
-#define MC_CMD_AOE_OP_INFO 0x1 /* enum */
-#define MC_CMD_AOE_OP_CURRENTS 0x2 /* enum */
-#define MC_CMD_AOE_OP_TEMPERATURES 0x3 /* enum */
-#define MC_CMD_AOE_OP_CPLD_IDLE 0x4 /* enum */
-#define MC_CMD_AOE_OP_CPLD_READ 0x5 /* enum */
-#define MC_CMD_AOE_OP_CPLD_WRITE 0x6 /* enum */
-#define MC_CMD_AOE_OP_CPLD_INSTRUCTION 0x7 /* enum */
-#define MC_CMD_AOE_OP_CPLD_REPROGRAM 0x8 /* enum */
-#define MC_CMD_AOE_OP_POWER 0x9 /* enum */
-#define MC_CMD_AOE_OP_LOAD 0xa /* enum */
-#define MC_CMD_AOE_OP_FAN_CONTROL 0xb /* enum */
-#define MC_CMD_AOE_OP_FAN_FAILURES 0xc /* enum */
-#define MC_CMD_AOE_OP_MAC_STATS 0xd /* enum */
-#define MC_CMD_AOE_OP_GET_PHY_MEDIA_INFO 0xe /* enum */
-#define MC_CMD_AOE_OP_JTAG_WRITE 0xf /* enum */
-#define MC_CMD_AOE_OP_FPGA_ACCESS 0x10 /* enum */
-#define MC_CMD_AOE_OP_SET_MTU_OFFSET 0x11 /* enum */
-#define MC_CMD_AOE_OP_LINK_STATE 0x12 /* enum */
-#define MC_CMD_AOE_OP_SIENA_STATS 0x13 /* enum */
-#define MC_CMD_AOE_OP_DDR 0x14 /* enum */
-#define MC_CMD_AOE_OP_FC 0x15 /* enum */
-#define MC_CMD_AOE_OP_DDR_ECC_STATUS 0x16 /* enum */
-#define MC_CMD_AOE_OP_MC_SPI_MASTER 0x17 /* enum */
+/* enum: FPGA and CPLD information */
+#define MC_CMD_AOE_OP_INFO 0x1
+/* enum: Currents and voltages read from MCP3424s; DEBUG */
+#define MC_CMD_AOE_OP_CURRENTS 0x2
+/* enum: Temperatures at locations around the PCB; DEBUG */
+#define MC_CMD_AOE_OP_TEMPERATURES 0x3
+/* enum: Set CPLD to idle */
+#define MC_CMD_AOE_OP_CPLD_IDLE 0x4
+/* enum: Read from CPLD register */
+#define MC_CMD_AOE_OP_CPLD_READ 0x5
+/* enum: Write to CPLD register */
+#define MC_CMD_AOE_OP_CPLD_WRITE 0x6
+/* enum: Execute CPLD instruction */
+#define MC_CMD_AOE_OP_CPLD_INSTRUCTION 0x7
+/* enum: Reprogram the CPLD on the AOE device */
+#define MC_CMD_AOE_OP_CPLD_REPROGRAM 0x8
+/* enum: AOE power control */
+#define MC_CMD_AOE_OP_POWER 0x9
+/* enum: AOE image loading */
+#define MC_CMD_AOE_OP_LOAD 0xa
+/* enum: Fan monitoring */
+#define MC_CMD_AOE_OP_FAN_CONTROL 0xb
+/* enum: Fan failures since last reset */
+#define MC_CMD_AOE_OP_FAN_FAILURES 0xc
+/* enum: Get generic AOE MAC statistics */
+#define MC_CMD_AOE_OP_MAC_STATS 0xd
+/* enum: Retrieve PHY specific information */
+#define MC_CMD_AOE_OP_GET_PHY_MEDIA_INFO 0xe
+/* enum: Write a number of JTAG primitive commands, return will give data */
+#define MC_CMD_AOE_OP_JTAG_WRITE 0xf
+/* enum: Control access to the FPGA via the Siena JTAG Chain */
+#define MC_CMD_AOE_OP_FPGA_ACCESS 0x10
+/* enum: Set the MTU offset between Siena and AOE MACs */
+#define MC_CMD_AOE_OP_SET_MTU_OFFSET 0x11
+/* enum: How link state is handled */
+#define MC_CMD_AOE_OP_LINK_STATE 0x12
+/* enum: How Siena MAC statistics are reported (deprecated - use
+ * MC_CMD_AOE_OP_ASIC_STATS)
+ */
+#define MC_CMD_AOE_OP_SIENA_STATS 0x13
+/* enum: How native ASIC MAC statistics are reported - replaces the deprecated
+ * command MC_CMD_AOE_OP_SIENA_STATS
+ */
+#define MC_CMD_AOE_OP_ASIC_STATS 0x13
+/* enum: DDR memory information */
+#define MC_CMD_AOE_OP_DDR 0x14
+/* enum: FC control */
+#define MC_CMD_AOE_OP_FC 0x15
+/* enum: DDR ECC status reads */
+#define MC_CMD_AOE_OP_DDR_ECC_STATUS 0x16
+/* enum: Commands for MC-SPI Master emulation */
+#define MC_CMD_AOE_OP_MC_SPI_MASTER 0x17
+/* enum: Commands for FC boot control */
+#define MC_CMD_AOE_OP_FC_BOOT 0x18
/* MC_CMD_AOE_OUT msgresponse */
#define MC_CMD_AOE_OUT_LEN 0
@@ -2077,31 +2909,46 @@
#define MC_CMD_AOE_IN_CPLD_REPROGRAM_LEN 8
/* MC_CMD_AOE_IN_CMD_OFST 0 */
#define MC_CMD_AOE_IN_CPLD_REPROGRAM_OP_OFST 4
-#define MC_CMD_AOE_IN_CPLD_REPROGRAM_REPROGRAM 0x1 /* enum */
-#define MC_CMD_AOE_IN_CPLD_REPROGRAM_REPROGRAM_EVENT 0x3 /* enum */
-#define MC_CMD_AOE_IN_CPLD_REPROGRAM_STATUS 0x4 /* enum */
+/* enum: Reprogram CPLD, poll for completion */
+#define MC_CMD_AOE_IN_CPLD_REPROGRAM_REPROGRAM 0x1
+/* enum: Reprogram CPLD, send event on completion */
+#define MC_CMD_AOE_IN_CPLD_REPROGRAM_REPROGRAM_EVENT 0x3
+/* enum: Get status of reprogramming operation */
+#define MC_CMD_AOE_IN_CPLD_REPROGRAM_STATUS 0x4
/* MC_CMD_AOE_IN_POWER msgrequest */
#define MC_CMD_AOE_IN_POWER_LEN 8
/* MC_CMD_AOE_IN_CMD_OFST 0 */
+/* Turn on or off AOE power */
#define MC_CMD_AOE_IN_POWER_OP_OFST 4
-#define MC_CMD_AOE_IN_POWER_OFF 0x0 /* enum */
-#define MC_CMD_AOE_IN_POWER_ON 0x1 /* enum */
-#define MC_CMD_AOE_IN_POWER_CLEAR 0x2 /* enum */
-#define MC_CMD_AOE_IN_POWER_SHOW_CURRENT 0x3 /* enum */
-#define MC_CMD_AOE_IN_POWER_SHOW_PEAK 0x4 /* enum */
-#define MC_CMD_AOE_IN_POWER_DDR_LAST 0x5 /* enum */
-#define MC_CMD_AOE_IN_POWER_DDR_PEAK 0x6 /* enum */
-#define MC_CMD_AOE_IN_POWER_DDR_CLEAR 0x7 /* enum */
+/* enum: Turn off FPGA power */
+#define MC_CMD_AOE_IN_POWER_OFF 0x0
+/* enum: Turn on FPGA power */
+#define MC_CMD_AOE_IN_POWER_ON 0x1
+/* enum: Clear peak power measurement */
+#define MC_CMD_AOE_IN_POWER_CLEAR 0x2
+/* enum: Show current power in sensors output */
+#define MC_CMD_AOE_IN_POWER_SHOW_CURRENT 0x3
+/* enum: Show peak power in sensors output */
+#define MC_CMD_AOE_IN_POWER_SHOW_PEAK 0x4
+/* enum: Show current DDR current */
+#define MC_CMD_AOE_IN_POWER_DDR_LAST 0x5
+/* enum: Show peak DDR current */
+#define MC_CMD_AOE_IN_POWER_DDR_PEAK 0x6
+/* enum: Clear peak DDR current */
+#define MC_CMD_AOE_IN_POWER_DDR_CLEAR 0x7
/* MC_CMD_AOE_IN_LOAD msgrequest */
#define MC_CMD_AOE_IN_LOAD_LEN 8
/* MC_CMD_AOE_IN_CMD_OFST 0 */
+/* Image to be loaded (0 - main or 1 - diagnostic) to load in normal sequence
+ */
#define MC_CMD_AOE_IN_LOAD_IMAGE_OFST 4
/* MC_CMD_AOE_IN_FAN_CONTROL msgrequest */
#define MC_CMD_AOE_IN_FAN_CONTROL_LEN 8
/* MC_CMD_AOE_IN_CMD_OFST 0 */
+/* If non zero report measured fan RPM rather than nominal */
#define MC_CMD_AOE_IN_FAN_CONTROL_REAL_RPM_OFST 4
/* MC_CMD_AOE_IN_FAN_FAILURES msgrequest */
@@ -2111,7 +2958,9 @@
/* MC_CMD_AOE_IN_MAC_STATS msgrequest */
#define MC_CMD_AOE_IN_MAC_STATS_LEN 24
/* MC_CMD_AOE_IN_CMD_OFST 0 */
+/* AOE port */
#define MC_CMD_AOE_IN_MAC_STATS_PORT_OFST 4
+/* Host memory address for statistics */
#define MC_CMD_AOE_IN_MAC_STATS_DMA_ADDR_OFST 8
#define MC_CMD_AOE_IN_MAC_STATS_DMA_ADDR_LEN 8
#define MC_CMD_AOE_IN_MAC_STATS_DMA_ADDR_LO_OFST 8
@@ -2131,11 +2980,13 @@
#define MC_CMD_AOE_IN_MAC_STATS_PERIODIC_NOEVENT_WIDTH 1
#define MC_CMD_AOE_IN_MAC_STATS_PERIOD_MS_LBN 16
#define MC_CMD_AOE_IN_MAC_STATS_PERIOD_MS_WIDTH 16
+/* Length of DMA data (optional) */
#define MC_CMD_AOE_IN_MAC_STATS_DMA_LEN_OFST 20
/* MC_CMD_AOE_IN_GET_PHY_MEDIA_INFO msgrequest */
#define MC_CMD_AOE_IN_GET_PHY_MEDIA_INFO_LEN 12
/* MC_CMD_AOE_IN_CMD_OFST 0 */
+/* AOE port */
#define MC_CMD_AOE_IN_GET_PHY_MEDIA_INFO_PORT_OFST 4
#define MC_CMD_AOE_IN_GET_PHY_MEDIA_INFO_PAGE_OFST 8
@@ -2153,16 +3004,23 @@
/* MC_CMD_AOE_IN_FPGA_ACCESS msgrequest */
#define MC_CMD_AOE_IN_FPGA_ACCESS_LEN 8
/* MC_CMD_AOE_IN_CMD_OFST 0 */
+/* Enable or disable access */
#define MC_CMD_AOE_IN_FPGA_ACCESS_OP_OFST 4
-#define MC_CMD_AOE_IN_FPGA_ACCESS_ENABLE 0x1 /* enum */
-#define MC_CMD_AOE_IN_FPGA_ACCESS_DISABLE 0x2 /* enum */
+/* enum: Enable access */
+#define MC_CMD_AOE_IN_FPGA_ACCESS_ENABLE 0x1
+/* enum: Disable access */
+#define MC_CMD_AOE_IN_FPGA_ACCESS_DISABLE 0x2
/* MC_CMD_AOE_IN_SET_MTU_OFFSET msgrequest */
#define MC_CMD_AOE_IN_SET_MTU_OFFSET_LEN 12
/* MC_CMD_AOE_IN_CMD_OFST 0 */
+/* AOE port - when not ALL_EXTERNAL or ALL_INTERNAL specifies port number */
#define MC_CMD_AOE_IN_SET_MTU_OFFSET_PORT_OFST 4
-#define MC_CMD_AOE_IN_SET_MTU_OFFSET_ALL_EXTERNAL 0x8000 /* enum */
-#define MC_CMD_AOE_IN_SET_MTU_OFFSET_ALL_INTERNAL 0x4000 /* enum */
+/* enum: Apply to all external ports */
+#define MC_CMD_AOE_IN_SET_MTU_OFFSET_ALL_EXTERNAL 0x8000
+/* enum: Apply to all internal ports */
+#define MC_CMD_AOE_IN_SET_MTU_OFFSET_ALL_INTERNAL 0x4000
+/* The MTU offset to be applied to the external ports */
#define MC_CMD_AOE_IN_SET_MTU_OFFSET_OFFSET_OFST 8
/* MC_CMD_AOE_IN_LINK_STATE msgrequest */
@@ -2171,31 +3029,52 @@
#define MC_CMD_AOE_IN_LINK_STATE_MODE_OFST 4
#define MC_CMD_AOE_IN_LINK_STATE_CONFIG_MODE_LBN 0
#define MC_CMD_AOE_IN_LINK_STATE_CONFIG_MODE_WIDTH 8
-#define MC_CMD_AOE_IN_LINK_STATE_SIMPLE_SEPARATE 0x0 /* enum */
-#define MC_CMD_AOE_IN_LINK_STATE_SIMPLE_COMBINED 0x1 /* enum */
-#define MC_CMD_AOE_IN_LINK_STATE_DIAGNOSTIC 0x2 /* enum */
-#define MC_CMD_AOE_IN_LINK_STATE_CUSTOM 0x3 /* enum */
+/* enum: AOE and associated external port */
+#define MC_CMD_AOE_IN_LINK_STATE_SIMPLE_SEPARATE 0x0
+/* enum: AOE and OR of all external ports */
+#define MC_CMD_AOE_IN_LINK_STATE_SIMPLE_COMBINED 0x1
+/* enum: Individual ports */
+#define MC_CMD_AOE_IN_LINK_STATE_DIAGNOSTIC 0x2
+/* enum: Configure link state mode on given AOE port */
+#define MC_CMD_AOE_IN_LINK_STATE_CUSTOM 0x3
#define MC_CMD_AOE_IN_LINK_STATE_OPERATION_LBN 8
#define MC_CMD_AOE_IN_LINK_STATE_OPERATION_WIDTH 8
-#define MC_CMD_AOE_IN_LINK_STATE_OP_NONE 0x0 /* enum */
-#define MC_CMD_AOE_IN_LINK_STATE_OP_OR 0x1 /* enum */
-#define MC_CMD_AOE_IN_LINK_STATE_OP_AND 0x2 /* enum */
+/* enum: No-op */
+#define MC_CMD_AOE_IN_LINK_STATE_OP_NONE 0x0
+/* enum: logical OR of all SFP ports link status */
+#define MC_CMD_AOE_IN_LINK_STATE_OP_OR 0x1
+/* enum: logical AND of all SFP ports link status */
+#define MC_CMD_AOE_IN_LINK_STATE_OP_AND 0x2
#define MC_CMD_AOE_IN_LINK_STATE_SFP_MASK_LBN 16
#define MC_CMD_AOE_IN_LINK_STATE_SFP_MASK_WIDTH 16
/* MC_CMD_AOE_IN_SIENA_STATS msgrequest */
#define MC_CMD_AOE_IN_SIENA_STATS_LEN 8
/* MC_CMD_AOE_IN_CMD_OFST 0 */
+/* How MAC statistics are reported */
#define MC_CMD_AOE_IN_SIENA_STATS_MODE_OFST 4
-#define MC_CMD_AOE_IN_SIENA_STATS_STATS_SIENA 0x0 /* enum */
-#define MC_CMD_AOE_IN_SIENA_STATS_STATS_AOE 0x1 /* enum */
+/* enum: Statistics from Siena (default) */
+#define MC_CMD_AOE_IN_SIENA_STATS_STATS_SIENA 0x0
+/* enum: Statistics from AOE external ports */
+#define MC_CMD_AOE_IN_SIENA_STATS_STATS_AOE 0x1
+
+/* MC_CMD_AOE_IN_ASIC_STATS msgrequest */
+#define MC_CMD_AOE_IN_ASIC_STATS_LEN 8
+/* MC_CMD_AOE_IN_CMD_OFST 0 */
+/* How MAC statistics are reported */
+#define MC_CMD_AOE_IN_ASIC_STATS_MODE_OFST 4
+/* enum: Statistics from the ASIC (default) */
+#define MC_CMD_AOE_IN_ASIC_STATS_STATS_ASIC 0x0
+/* enum: Statistics from AOE external ports */
+#define MC_CMD_AOE_IN_ASIC_STATS_STATS_AOE 0x1
/* MC_CMD_AOE_IN_DDR msgrequest */
#define MC_CMD_AOE_IN_DDR_LEN 12
/* MC_CMD_AOE_IN_CMD_OFST 0 */
#define MC_CMD_AOE_IN_DDR_BANK_OFST 4
/* Enum values, see field(s): */
-/* MC_CMD_FC_IN_DDR_BANK */
+/* MC_CMD_FC/MC_CMD_FC_IN_DDR/MC_CMD_FC_IN_DDR_BANK */
+/* Page index of SPD data */
#define MC_CMD_AOE_IN_DDR_SPD_PAGE_ID_OFST 8
/* MC_CMD_AOE_IN_FC msgrequest */
@@ -2207,14 +3086,17 @@
/* MC_CMD_AOE_IN_CMD_OFST 0 */
#define MC_CMD_AOE_IN_DDR_ECC_STATUS_BANK_OFST 4
/* Enum values, see field(s): */
-/* MC_CMD_FC_IN_DDR_BANK */
+/* MC_CMD_FC/MC_CMD_FC_IN_DDR/MC_CMD_FC_IN_DDR_BANK */
/* MC_CMD_AOE_IN_MC_SPI_MASTER msgrequest */
#define MC_CMD_AOE_IN_MC_SPI_MASTER_LEN 8
/* MC_CMD_AOE_IN_CMD_OFST 0 */
+/* Basic commands for MC SPI Master emulation. */
#define MC_CMD_AOE_IN_MC_SPI_MASTER_OP_OFST 4
-#define MC_CMD_AOE_IN_MC_SPI_MASTER_READ 0x0 /* enum */
-#define MC_CMD_AOE_IN_MC_SPI_MASTER_WRITE 0x1 /* enum */
+/* enum: MC SPI read */
+#define MC_CMD_AOE_IN_MC_SPI_MASTER_READ 0x0
+/* enum: MC SPI write */
+#define MC_CMD_AOE_IN_MC_SPI_MASTER_WRITE 0x1
/* MC_CMD_AOE_IN_MC_SPI_MASTER_READ msgrequest */
#define MC_CMD_AOE_IN_MC_SPI_MASTER_READ_LEN 12
@@ -2229,42 +3111,80 @@
#define MC_CMD_AOE_IN_MC_SPI_MASTER_WRITE_OFFSET_OFST 8
#define MC_CMD_AOE_IN_MC_SPI_MASTER_WRITE_DATA_OFST 12
+/* MC_CMD_AOE_IN_FC_BOOT msgrequest */
+#define MC_CMD_AOE_IN_FC_BOOT_LEN 8
+/* MC_CMD_AOE_IN_CMD_OFST 0 */
+/* FC boot control flags */
+#define MC_CMD_AOE_IN_FC_BOOT_CONTROL_OFST 4
+#define MC_CMD_AOE_IN_FC_BOOT_CONTROL_BOOT_ENABLE_LBN 0
+#define MC_CMD_AOE_IN_FC_BOOT_CONTROL_BOOT_ENABLE_WIDTH 1
+
/* MC_CMD_AOE_OUT_INFO msgresponse */
#define MC_CMD_AOE_OUT_INFO_LEN 44
+/* JTAG IDCODE of CPLD */
#define MC_CMD_AOE_OUT_INFO_CPLD_IDCODE_OFST 0
+/* Version of CPLD */
#define MC_CMD_AOE_OUT_INFO_CPLD_VERSION_OFST 4
+/* JTAG IDCODE of FPGA */
#define MC_CMD_AOE_OUT_INFO_FPGA_IDCODE_OFST 8
+/* JTAG USERCODE of FPGA */
#define MC_CMD_AOE_OUT_INFO_FPGA_VERSION_OFST 12
+/* FPGA type - read from CPLD straps */
#define MC_CMD_AOE_OUT_INFO_FPGA_TYPE_OFST 16
+/* FPGA state (debug) */
#define MC_CMD_AOE_OUT_INFO_FPGA_STATE_OFST 20
+/* FPGA image - partition from which loaded */
#define MC_CMD_AOE_OUT_INFO_FPGA_IMAGE_OFST 24
+/* FC state */
#define MC_CMD_AOE_OUT_INFO_FC_STATE_OFST 28
-#define MC_CMD_AOE_OUT_INFO_WATCHDOG 0x1 /* enum */
-#define MC_CMD_AOE_OUT_INFO_COMMS 0x2 /* enum */
+/* enum: Set if watchdog working */
+#define MC_CMD_AOE_OUT_INFO_WATCHDOG 0x1
+/* enum: Set if MC-FC communications working */
+#define MC_CMD_AOE_OUT_INFO_COMMS 0x2
+/* Random pieces of information */
#define MC_CMD_AOE_OUT_INFO_FLAGS_OFST 32
-#define MC_CMD_AOE_OUT_INFO_PEG_POWER 0x1 /* enum */
-#define MC_CMD_AOE_OUT_INFO_CPLD_GOOD 0x2 /* enum */
-#define MC_CMD_AOE_OUT_INFO_FPGA_GOOD 0x4 /* enum */
-#define MC_CMD_AOE_OUT_INFO_FPGA_POWER 0x8 /* enum */
-#define MC_CMD_AOE_OUT_INFO_BAD_SODIMM 0x10 /* enum */
-#define MC_CMD_AOE_OUT_INFO_HAS_BYTEBLASTER 0x20 /* enum */
+/* enum: Power to FPGA supplied by PEG connector, not PCIe bus */
+#define MC_CMD_AOE_OUT_INFO_PEG_POWER 0x1
+/* enum: CPLD apparently good */
+#define MC_CMD_AOE_OUT_INFO_CPLD_GOOD 0x2
+/* enum: FPGA working normally */
+#define MC_CMD_AOE_OUT_INFO_FPGA_GOOD 0x4
+/* enum: FPGA is powered */
+#define MC_CMD_AOE_OUT_INFO_FPGA_POWER 0x8
+/* enum: Board has incompatible SODIMMs fitted */
+#define MC_CMD_AOE_OUT_INFO_BAD_SODIMM 0x10
+/* enum: Board has ByteBlaster connected */
+#define MC_CMD_AOE_OUT_INFO_HAS_BYTEBLASTER 0x20
+/* Revision of Modena board */
#define MC_CMD_AOE_OUT_INFO_BOARD_REVISION_OFST 36
#define MC_CMD_AOE_OUT_INFO_UNKNOWN 0x0 /* enum */
#define MC_CMD_AOE_OUT_INFO_R1_0 0x10 /* enum */
#define MC_CMD_AOE_OUT_INFO_R1_1 0x11 /* enum */
#define MC_CMD_AOE_OUT_INFO_R1_2 0x12 /* enum */
+/* Result of FC booting - not valid while a ByteBlaster is connected. */
#define MC_CMD_AOE_OUT_INFO_FC_BOOT_RESULT_OFST 40
-#define MC_CMD_AOE_OUT_INFO_FC_BOOT_FAIL_NO_ERROR 0x0 /* enum */
-#define MC_CMD_AOE_OUT_INFO_FC_BOOT_FAIL_BAD_ADDRESS 0x1 /* enum */
-#define MC_CMD_AOE_OUT_INFO_FC_BOOT_FAIL_BAD_MAGIC 0x2 /* enum */
-#define MC_CMD_AOE_OUT_INFO_FC_BOOT_FAIL_BAD_TEXT 0x3 /* enum */
-#define MC_CMD_AOE_OUT_INFO_FC_BOOT_FAIL_BAD_CHECKSUM 0x4 /* enum */
-#define MC_CMD_AOE_OUT_INFO_FC_BOOT_FAIL_BAD_BSP 0x5 /* enum */
-#define MC_CMD_AOE_OUT_INFO_FC_BOOT_APP_EXECUTE 0x80 /* enum */
-#define MC_CMD_AOE_OUT_INFO_FC_BOOT_NO_BOOTROM 0xff /* enum */
+/* enum: No error */
+#define MC_CMD_AOE_OUT_INFO_FC_BOOT_FAIL_NO_ERROR 0x0
+/* enum: Bad address set in CPLD */
+#define MC_CMD_AOE_OUT_INFO_FC_BOOT_FAIL_BAD_ADDRESS 0x1
+/* enum: Bad header */
+#define MC_CMD_AOE_OUT_INFO_FC_BOOT_FAIL_BAD_MAGIC 0x2
+/* enum: Bad text section details */
+#define MC_CMD_AOE_OUT_INFO_FC_BOOT_FAIL_BAD_TEXT 0x3
+/* enum: Bad checksum */
+#define MC_CMD_AOE_OUT_INFO_FC_BOOT_FAIL_BAD_CHECKSUM 0x4
+/* enum: Bad BSP */
+#define MC_CMD_AOE_OUT_INFO_FC_BOOT_FAIL_BAD_BSP 0x5
+/* enum: FC application loaded and execution attempted */
+#define MC_CMD_AOE_OUT_INFO_FC_BOOT_APP_EXECUTE 0x80
+/* enum: FC application Started */
+#define MC_CMD_AOE_OUT_INFO_FC_BOOT_APP_STARTED 0x81
+/* enum: No bootrom in FPGA */
+#define MC_CMD_AOE_OUT_INFO_FC_BOOT_NO_BOOTROM 0xff
/* MC_CMD_AOE_OUT_CURRENTS msgresponse */
#define MC_CMD_AOE_OUT_CURRENTS_LEN 68
+/* Set of currents and voltages (mA or mV as appropriate) */
#define MC_CMD_AOE_OUT_CURRENTS_VALUES_OFST 0
#define MC_CMD_AOE_OUT_CURRENTS_VALUES_LEN 4
#define MC_CMD_AOE_OUT_CURRENTS_VALUES_NUM 17
@@ -2288,10 +3208,12 @@
/* MC_CMD_AOE_OUT_TEMPERATURES msgresponse */
#define MC_CMD_AOE_OUT_TEMPERATURES_LEN 40
+/* Set of temperatures */
#define MC_CMD_AOE_OUT_TEMPERATURES_VALUES_OFST 0
#define MC_CMD_AOE_OUT_TEMPERATURES_VALUES_LEN 4
#define MC_CMD_AOE_OUT_TEMPERATURES_VALUES_NUM 10
-#define MC_CMD_AOE_OUT_TEMPERATURES_MAIN_0 0x0 /* enum */
+/* enum: The first set of enum values are for Modena code. */
+#define MC_CMD_AOE_OUT_TEMPERATURES_MAIN_0 0x0
#define MC_CMD_AOE_OUT_TEMPERATURES_MAIN_1 0x1 /* enum */
#define MC_CMD_AOE_OUT_TEMPERATURES_IND_0 0x2 /* enum */
#define MC_CMD_AOE_OUT_TEMPERATURES_IND_1 0x3 /* enum */
@@ -2301,15 +3223,27 @@
#define MC_CMD_AOE_OUT_TEMPERATURES_PSU 0x7 /* enum */
#define MC_CMD_AOE_OUT_TEMPERATURES_FPGA 0x8 /* enum */
#define MC_CMD_AOE_OUT_TEMPERATURES_SIENA 0x9 /* enum */
+/* enum: The second set of enum values are for Sorrento code. */
+#define MC_CMD_AOE_OUT_TEMPERATURES_SORRENTO_MAIN_0 0x0
+#define MC_CMD_AOE_OUT_TEMPERATURES_SORRENTO_MAIN_1 0x1 /* enum */
+#define MC_CMD_AOE_OUT_TEMPERATURES_SORRENTO_IND_0 0x2 /* enum */
+#define MC_CMD_AOE_OUT_TEMPERATURES_SORRENTO_IND_1 0x3 /* enum */
+#define MC_CMD_AOE_OUT_TEMPERATURES_SORRENTO_SODIMM_0 0x4 /* enum */
+#define MC_CMD_AOE_OUT_TEMPERATURES_SORRENTO_SODIMM_1 0x5 /* enum */
+#define MC_CMD_AOE_OUT_TEMPERATURES_SORRENTO_FPGA 0x6 /* enum */
+#define MC_CMD_AOE_OUT_TEMPERATURES_SORRENTO_PHY0 0x7 /* enum */
+#define MC_CMD_AOE_OUT_TEMPERATURES_SORRENTO_PHY1 0x8 /* enum */
/* MC_CMD_AOE_OUT_CPLD_READ msgresponse */
#define MC_CMD_AOE_OUT_CPLD_READ_LEN 4
+/* The value read from the CPLD */
#define MC_CMD_AOE_OUT_CPLD_READ_VALUE_OFST 0
/* MC_CMD_AOE_OUT_FAN_FAILURES msgresponse */
#define MC_CMD_AOE_OUT_FAN_FAILURES_LENMIN 4
#define MC_CMD_AOE_OUT_FAN_FAILURES_LENMAX 252
#define MC_CMD_AOE_OUT_FAN_FAILURES_LEN(num) (0+4*(num))
+/* Failure counts for each fan */
#define MC_CMD_AOE_OUT_FAN_FAILURES_COUNT_OFST 0
#define MC_CMD_AOE_OUT_FAN_FAILURES_COUNT_LEN 4
#define MC_CMD_AOE_OUT_FAN_FAILURES_COUNT_MINNUM 1
@@ -2317,12 +3251,24 @@
/* MC_CMD_AOE_OUT_CPLD_REPROGRAM msgresponse */
#define MC_CMD_AOE_OUT_CPLD_REPROGRAM_LEN 4
+/* Results of status command (only) */
#define MC_CMD_AOE_OUT_CPLD_REPROGRAM_STATUS_OFST 0
+/* MC_CMD_AOE_OUT_POWER_OFF msgresponse */
+#define MC_CMD_AOE_OUT_POWER_OFF_LEN 0
+
+/* MC_CMD_AOE_OUT_POWER_ON msgresponse */
+#define MC_CMD_AOE_OUT_POWER_ON_LEN 0
+
+/* MC_CMD_AOE_OUT_LOAD msgresponse */
+#define MC_CMD_AOE_OUT_LOAD_LEN 0
+
/* MC_CMD_AOE_OUT_MAC_STATS_DMA msgresponse */
#define MC_CMD_AOE_OUT_MAC_STATS_DMA_LEN 0
-/* MC_CMD_AOE_OUT_MAC_STATS_NO_DMA msgresponse */
+/* MC_CMD_AOE_OUT_MAC_STATS_NO_DMA msgresponse: See MC_CMD_MAC_STATS_OUT_NO_DMA
+ * for details
+ */
#define MC_CMD_AOE_OUT_MAC_STATS_NO_DMA_LEN (((MC_CMD_MAC_NSTATS*64))>>3)
#define MC_CMD_AOE_OUT_MAC_STATS_NO_DMA_STATISTICS_OFST 0
#define MC_CMD_AOE_OUT_MAC_STATS_NO_DMA_STATISTICS_LEN 8
@@ -2334,6 +3280,7 @@
#define MC_CMD_AOE_OUT_GET_PHY_MEDIA_INFO_LENMIN 5
#define MC_CMD_AOE_OUT_GET_PHY_MEDIA_INFO_LENMAX 252
#define MC_CMD_AOE_OUT_GET_PHY_MEDIA_INFO_LEN(num) (4+1*(num))
+/* in bytes */
#define MC_CMD_AOE_OUT_GET_PHY_MEDIA_INFO_DATALEN_OFST 0
#define MC_CMD_AOE_OUT_GET_PHY_MEDIA_INFO_DATA_OFST 4
#define MC_CMD_AOE_OUT_GET_PHY_MEDIA_INFO_DATA_LEN 1
@@ -2344,7 +3291,9 @@
#define MC_CMD_AOE_OUT_JTAG_WRITE_LENMIN 12
#define MC_CMD_AOE_OUT_JTAG_WRITE_LENMAX 252
#define MC_CMD_AOE_OUT_JTAG_WRITE_LEN(num) (8+4*(num))
+/* Used to align the in and out data blocks so the MC can re-use the cmd */
#define MC_CMD_AOE_OUT_JTAG_WRITE_DATALEN_OFST 0
+/* out bytes */
#define MC_CMD_AOE_OUT_JTAG_WRITE_PAD_OFST 4
#define MC_CMD_AOE_OUT_JTAG_WRITE_DATA_OFST 8
#define MC_CMD_AOE_OUT_JTAG_WRITE_DATA_LEN 4
@@ -2358,6 +3307,7 @@
#define MC_CMD_AOE_OUT_DDR_LENMIN 17
#define MC_CMD_AOE_OUT_DDR_LENMAX 252
#define MC_CMD_AOE_OUT_DDR_LEN(num) (16+1*(num))
+/* Information on the module. */
#define MC_CMD_AOE_OUT_DDR_FLAGS_OFST 0
#define MC_CMD_AOE_OUT_DDR_PRESENT_LBN 0
#define MC_CMD_AOE_OUT_DDR_PRESENT_WIDTH 1
@@ -2365,25 +3315,42 @@
#define MC_CMD_AOE_OUT_DDR_POWERED_WIDTH 1
#define MC_CMD_AOE_OUT_DDR_OPERATIONAL_LBN 2
#define MC_CMD_AOE_OUT_DDR_OPERATIONAL_WIDTH 1
+#define MC_CMD_AOE_OUT_DDR_NOT_REACHABLE_LBN 3
+#define MC_CMD_AOE_OUT_DDR_NOT_REACHABLE_WIDTH 1
+/* Memory size, in MB. */
#define MC_CMD_AOE_OUT_DDR_CAPACITY_OFST 4
+/* The memory type, as reported from SPD information */
#define MC_CMD_AOE_OUT_DDR_TYPE_OFST 8
+/* Nominal voltage of the module (as applied) */
#define MC_CMD_AOE_OUT_DDR_VOLTAGE_OFST 12
+/* SPD data read from the module */
#define MC_CMD_AOE_OUT_DDR_SPD_OFST 16
#define MC_CMD_AOE_OUT_DDR_SPD_LEN 1
#define MC_CMD_AOE_OUT_DDR_SPD_MINNUM 1
#define MC_CMD_AOE_OUT_DDR_SPD_MAXNUM 236
+/* MC_CMD_AOE_OUT_SET_MTU_OFFSET msgresponse */
+#define MC_CMD_AOE_OUT_SET_MTU_OFFSET_LEN 0
+
/* MC_CMD_AOE_OUT_LINK_STATE msgresponse */
#define MC_CMD_AOE_OUT_LINK_STATE_LEN 0
+/* MC_CMD_AOE_OUT_SIENA_STATS msgresponse */
+#define MC_CMD_AOE_OUT_SIENA_STATS_LEN 0
+
+/* MC_CMD_AOE_OUT_ASIC_STATS msgresponse */
+#define MC_CMD_AOE_OUT_ASIC_STATS_LEN 0
+
/* MC_CMD_AOE_OUT_FC msgresponse */
#define MC_CMD_AOE_OUT_FC_LEN 0
/* MC_CMD_AOE_OUT_DDR_ECC_STATUS msgresponse */
#define MC_CMD_AOE_OUT_DDR_ECC_STATUS_LEN 8
+/* Flags describing status info on the module. */
#define MC_CMD_AOE_OUT_DDR_ECC_STATUS_FLAGS_OFST 0
#define MC_CMD_AOE_OUT_DDR_ECC_STATUS_VALID_LBN 0
#define MC_CMD_AOE_OUT_DDR_ECC_STATUS_VALID_WIDTH 1
+/* DDR ECC status on the module. */
#define MC_CMD_AOE_OUT_DDR_ECC_STATUS_STATUS_OFST 4
#define MC_CMD_AOE_OUT_DDR_ECC_STATUS_SBE_LBN 0
#define MC_CMD_AOE_OUT_DDR_ECC_STATUS_SBE_WIDTH 1
@@ -2408,51 +3375,113 @@
/* MC_CMD_AOE_OUT_MC_SPI_MASTER msgresponse */
#define MC_CMD_AOE_OUT_MC_SPI_MASTER_LEN 0
+/* MC_CMD_AOE_OUT_FC_BOOT msgresponse */
+#define MC_CMD_AOE_OUT_FC_BOOT_LEN 0
+
/***********************************/
-/* MC_CMD_PTP
+/* MC_CMD_PTP
* Perform PTP operation
*/
-#define MC_CMD_PTP 0xb
+#define MC_CMD_PTP 0xb
+#undef MC_CMD_0xb_PRIVILEGE_CTG
+
+#define MC_CMD_0xb_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_PTP_IN msgrequest */
#define MC_CMD_PTP_IN_LEN 1
+/* PTP operation code */
#define MC_CMD_PTP_IN_OP_OFST 0
#define MC_CMD_PTP_IN_OP_LEN 1
-#define MC_CMD_PTP_OP_ENABLE 0x1 /* enum */
-#define MC_CMD_PTP_OP_DISABLE 0x2 /* enum */
-#define MC_CMD_PTP_OP_TRANSMIT 0x3 /* enum */
-#define MC_CMD_PTP_OP_READ_NIC_TIME 0x4 /* enum */
-#define MC_CMD_PTP_OP_STATUS 0x5 /* enum */
-#define MC_CMD_PTP_OP_ADJUST 0x6 /* enum */
-#define MC_CMD_PTP_OP_SYNCHRONIZE 0x7 /* enum */
-#define MC_CMD_PTP_OP_MANFTEST_BASIC 0x8 /* enum */
-#define MC_CMD_PTP_OP_MANFTEST_PACKET 0x9 /* enum */
-#define MC_CMD_PTP_OP_RESET_STATS 0xa /* enum */
-#define MC_CMD_PTP_OP_DEBUG 0xb /* enum */
-#define MC_CMD_PTP_OP_FPGAREAD 0xc /* enum */
-#define MC_CMD_PTP_OP_FPGAWRITE 0xd /* enum */
-#define MC_CMD_PTP_OP_CLOCK_OFFSET_ADJUST 0xe /* enum */
-#define MC_CMD_PTP_OP_CLOCK_FREQ_ADJUST 0xf /* enum */
-#define MC_CMD_PTP_OP_RX_SET_VLAN_FILTER 0x10 /* enum */
-#define MC_CMD_PTP_OP_RX_SET_UUID_FILTER 0x11 /* enum */
-#define MC_CMD_PTP_OP_RX_SET_DOMAIN_FILTER 0x12 /* enum */
-#define MC_CMD_PTP_OP_SET_CLK_SRC 0x13 /* enum */
-#define MC_CMD_PTP_OP_RST_CLK 0x14 /* enum */
-#define MC_CMD_PTP_OP_PPS_ENABLE 0x15 /* enum */
-#define MC_CMD_PTP_OP_MAX 0x16 /* enum */
+/* enum: Enable PTP packet timestamping operation. */
+#define MC_CMD_PTP_OP_ENABLE 0x1
+/* enum: Disable PTP packet timestamping operation. */
+#define MC_CMD_PTP_OP_DISABLE 0x2
+/* enum: Send a PTP packet. */
+#define MC_CMD_PTP_OP_TRANSMIT 0x3
+/* enum: Read the current NIC time. */
+#define MC_CMD_PTP_OP_READ_NIC_TIME 0x4
+/* enum: Get the current PTP status. */
+#define MC_CMD_PTP_OP_STATUS 0x5
+/* enum: Adjust the PTP NIC's time. */
+#define MC_CMD_PTP_OP_ADJUST 0x6
+/* enum: Synchronize host and NIC time. */
+#define MC_CMD_PTP_OP_SYNCHRONIZE 0x7
+/* enum: Basic manufacturing tests. */
+#define MC_CMD_PTP_OP_MANFTEST_BASIC 0x8
+/* enum: Packet based manufacturing tests. */
+#define MC_CMD_PTP_OP_MANFTEST_PACKET 0x9
+/* enum: Reset some of the PTP related statistics */
+#define MC_CMD_PTP_OP_RESET_STATS 0xa
+/* enum: Debug operations to MC. */
+#define MC_CMD_PTP_OP_DEBUG 0xb
+/* enum: Read an FPGA register */
+#define MC_CMD_PTP_OP_FPGAREAD 0xc
+/* enum: Write an FPGA register */
+#define MC_CMD_PTP_OP_FPGAWRITE 0xd
+/* enum: Apply an offset to the NIC clock */
+#define MC_CMD_PTP_OP_CLOCK_OFFSET_ADJUST 0xe
+/* enum: Change Apply an offset to the NIC clock */
+#define MC_CMD_PTP_OP_CLOCK_FREQ_ADJUST 0xf
+/* enum: Set the MC packet filter VLAN tags for received PTP packets */
+#define MC_CMD_PTP_OP_RX_SET_VLAN_FILTER 0x10
+/* enum: Set the MC packet filter UUID for received PTP packets */
+#define MC_CMD_PTP_OP_RX_SET_UUID_FILTER 0x11
+/* enum: Set the MC packet filter Domain for received PTP packets */
+#define MC_CMD_PTP_OP_RX_SET_DOMAIN_FILTER 0x12
+/* enum: Set the clock source */
+#define MC_CMD_PTP_OP_SET_CLK_SRC 0x13
+/* enum: Reset value of Timer Reg. */
+#define MC_CMD_PTP_OP_RST_CLK 0x14
+/* enum: Enable the forwarding of PPS events to the host */
+#define MC_CMD_PTP_OP_PPS_ENABLE 0x15
+/* enum: Get the time format used by this NIC for PTP operations */
+#define MC_CMD_PTP_OP_GET_TIME_FORMAT 0x16
+/* enum: Get the clock attributes. NOTE- extended version of
+ * MC_CMD_PTP_OP_GET_TIME_FORMAT
+ */
+#define MC_CMD_PTP_OP_GET_ATTRIBUTES 0x16
+/* enum: Get corrections that should be applied to the various different
+ * timestamps
+ */
+#define MC_CMD_PTP_OP_GET_TIMESTAMP_CORRECTIONS 0x17
+/* enum: Subscribe to receive periodic time events indicating the current NIC
+ * time
+ */
+#define MC_CMD_PTP_OP_TIME_EVENT_SUBSCRIBE 0x18
+/* enum: Unsubscribe to stop receiving time events */
+#define MC_CMD_PTP_OP_TIME_EVENT_UNSUBSCRIBE 0x19
+/* enum: PPS based manfacturing tests. Requires PPS output to be looped to PPS
+ * input on the same NIC.
+ */
+#define MC_CMD_PTP_OP_MANFTEST_PPS 0x1a
+/* enum: Set the PTP sync status. Status is used by firmware to report to event
+ * subscribers.
+ */
+#define MC_CMD_PTP_OP_SET_SYNC_STATUS 0x1b
+/* enum: Above this for future use. */
+#define MC_CMD_PTP_OP_MAX 0x1c
/* MC_CMD_PTP_IN_ENABLE msgrequest */
#define MC_CMD_PTP_IN_ENABLE_LEN 16
#define MC_CMD_PTP_IN_CMD_OFST 0
#define MC_CMD_PTP_IN_PERIPH_ID_OFST 4
+/* Event queue for PTP events */
#define MC_CMD_PTP_IN_ENABLE_QUEUE_OFST 8
+/* PTP timestamping mode */
#define MC_CMD_PTP_IN_ENABLE_MODE_OFST 12
-#define MC_CMD_PTP_MODE_V1 0x0 /* enum */
-#define MC_CMD_PTP_MODE_V1_VLAN 0x1 /* enum */
-#define MC_CMD_PTP_MODE_V2 0x2 /* enum */
-#define MC_CMD_PTP_MODE_V2_VLAN 0x3 /* enum */
-#define MC_CMD_PTP_MODE_V2_ENHANCED 0x4 /* enum */
+/* enum: PTP, version 1 */
+#define MC_CMD_PTP_MODE_V1 0x0
+/* enum: PTP, version 1, with VLAN headers - deprecated */
+#define MC_CMD_PTP_MODE_V1_VLAN 0x1
+/* enum: PTP, version 2 */
+#define MC_CMD_PTP_MODE_V2 0x2
+/* enum: PTP, version 2, with VLAN headers - deprecated */
+#define MC_CMD_PTP_MODE_V2_VLAN 0x3
+/* enum: PTP, version 2, with improved UUID filtering */
+#define MC_CMD_PTP_MODE_V2_ENHANCED 0x4
+/* enum: FCoE (seconds and microseconds) */
+#define MC_CMD_PTP_MODE_FCOE 0x5
/* MC_CMD_PTP_IN_DISABLE msgrequest */
#define MC_CMD_PTP_IN_DISABLE_LEN 8
@@ -2465,7 +3494,9 @@
#define MC_CMD_PTP_IN_TRANSMIT_LEN(num) (12+1*(num))
/* MC_CMD_PTP_IN_CMD_OFST 0 */
/* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
+/* Transmit packet length */
#define MC_CMD_PTP_IN_TRANSMIT_LENGTH_OFST 8
+/* Transmit packet data */
#define MC_CMD_PTP_IN_TRANSMIT_PACKET_OFST 12
#define MC_CMD_PTP_IN_TRANSMIT_PACKET_LEN 1
#define MC_CMD_PTP_IN_TRANSMIT_PACKET_MINNUM 1
@@ -2485,19 +3516,31 @@
#define MC_CMD_PTP_IN_ADJUST_LEN 24
/* MC_CMD_PTP_IN_CMD_OFST 0 */
/* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
+/* Frequency adjustment 40 bit fixed point ns */
#define MC_CMD_PTP_IN_ADJUST_FREQ_OFST 8
#define MC_CMD_PTP_IN_ADJUST_FREQ_LEN 8
#define MC_CMD_PTP_IN_ADJUST_FREQ_LO_OFST 8
#define MC_CMD_PTP_IN_ADJUST_FREQ_HI_OFST 12
-#define MC_CMD_PTP_IN_ADJUST_BITS 0x28 /* enum */
+/* enum: Number of fractional bits in frequency adjustment */
+#define MC_CMD_PTP_IN_ADJUST_BITS 0x28
+/* Time adjustment in seconds */
#define MC_CMD_PTP_IN_ADJUST_SECONDS_OFST 16
+/* Time adjustment major value */
+#define MC_CMD_PTP_IN_ADJUST_MAJOR_OFST 16
+/* Time adjustment in nanoseconds */
#define MC_CMD_PTP_IN_ADJUST_NANOSECONDS_OFST 20
+/* Time adjustment minor value */
+#define MC_CMD_PTP_IN_ADJUST_MINOR_OFST 20
/* MC_CMD_PTP_IN_SYNCHRONIZE msgrequest */
#define MC_CMD_PTP_IN_SYNCHRONIZE_LEN 20
/* MC_CMD_PTP_IN_CMD_OFST 0 */
/* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
+/* Number of time readings to capture */
#define MC_CMD_PTP_IN_SYNCHRONIZE_NUMTIMESETS_OFST 8
+/* Host address in which to write "synchronization started" indication (64
+ * bits)
+ */
#define MC_CMD_PTP_IN_SYNCHRONIZE_START_ADDR_OFST 12
#define MC_CMD_PTP_IN_SYNCHRONIZE_START_ADDR_LEN 8
#define MC_CMD_PTP_IN_SYNCHRONIZE_START_ADDR_LO_OFST 12
@@ -2512,17 +3555,20 @@
#define MC_CMD_PTP_IN_MANFTEST_PACKET_LEN 12
/* MC_CMD_PTP_IN_CMD_OFST 0 */
/* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
+/* Enable or disable packet testing */
#define MC_CMD_PTP_IN_MANFTEST_PACKET_TEST_ENABLE_OFST 8
/* MC_CMD_PTP_IN_RESET_STATS msgrequest */
#define MC_CMD_PTP_IN_RESET_STATS_LEN 8
/* MC_CMD_PTP_IN_CMD_OFST 0 */
+/* Reset PTP statistics */
/* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
/* MC_CMD_PTP_IN_DEBUG msgrequest */
#define MC_CMD_PTP_IN_DEBUG_LEN 12
/* MC_CMD_PTP_IN_CMD_OFST 0 */
/* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
+/* Debug operations */
#define MC_CMD_PTP_IN_DEBUG_DEBUG_PARAM_OFST 8
/* MC_CMD_PTP_IN_FPGAREAD msgrequest */
@@ -2548,24 +3594,34 @@
#define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_LEN 16
/* MC_CMD_PTP_IN_CMD_OFST 0 */
/* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
+/* Time adjustment in seconds */
#define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_SECONDS_OFST 8
+/* Time adjustment major value */
+#define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_MAJOR_OFST 8
+/* Time adjustment in nanoseconds */
#define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_NANOSECONDS_OFST 12
+/* Time adjustment minor value */
+#define MC_CMD_PTP_IN_CLOCK_OFFSET_ADJUST_MINOR_OFST 12
/* MC_CMD_PTP_IN_CLOCK_FREQ_ADJUST msgrequest */
#define MC_CMD_PTP_IN_CLOCK_FREQ_ADJUST_LEN 16
/* MC_CMD_PTP_IN_CMD_OFST 0 */
/* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
+/* Frequency adjustment 40 bit fixed point ns */
#define MC_CMD_PTP_IN_CLOCK_FREQ_ADJUST_FREQ_OFST 8
#define MC_CMD_PTP_IN_CLOCK_FREQ_ADJUST_FREQ_LEN 8
#define MC_CMD_PTP_IN_CLOCK_FREQ_ADJUST_FREQ_LO_OFST 8
#define MC_CMD_PTP_IN_CLOCK_FREQ_ADJUST_FREQ_HI_OFST 12
+/* enum: Number of fractional bits in frequency adjustment */
/* MC_CMD_PTP_IN_ADJUST_BITS 0x28 */
/* MC_CMD_PTP_IN_RX_SET_VLAN_FILTER msgrequest */
#define MC_CMD_PTP_IN_RX_SET_VLAN_FILTER_LEN 24
/* MC_CMD_PTP_IN_CMD_OFST 0 */
/* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
+/* Number of VLAN tags, 0 if not VLAN */
#define MC_CMD_PTP_IN_RX_SET_VLAN_FILTER_NUM_VLAN_TAGS_OFST 8
+/* Set of VLAN tags to filter against */
#define MC_CMD_PTP_IN_RX_SET_VLAN_FILTER_VLAN_TAG_OFST 12
#define MC_CMD_PTP_IN_RX_SET_VLAN_FILTER_VLAN_TAG_LEN 4
#define MC_CMD_PTP_IN_RX_SET_VLAN_FILTER_VLAN_TAG_NUM 3
@@ -2574,7 +3630,9 @@
#define MC_CMD_PTP_IN_RX_SET_UUID_FILTER_LEN 20
/* MC_CMD_PTP_IN_CMD_OFST 0 */
/* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
+/* 1 to enable UUID filtering, 0 to disable */
#define MC_CMD_PTP_IN_RX_SET_UUID_FILTER_ENABLE_OFST 8
+/* UUID to filter against */
#define MC_CMD_PTP_IN_RX_SET_UUID_FILTER_UUID_OFST 12
#define MC_CMD_PTP_IN_RX_SET_UUID_FILTER_UUID_LEN 8
#define MC_CMD_PTP_IN_RX_SET_UUID_FILTER_UUID_LO_OFST 12
@@ -2584,82 +3642,237 @@
#define MC_CMD_PTP_IN_RX_SET_DOMAIN_FILTER_LEN 16
/* MC_CMD_PTP_IN_CMD_OFST 0 */
/* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
+/* 1 to enable Domain filtering, 0 to disable */
#define MC_CMD_PTP_IN_RX_SET_DOMAIN_FILTER_ENABLE_OFST 8
+/* Domain number to filter against */
#define MC_CMD_PTP_IN_RX_SET_DOMAIN_FILTER_DOMAIN_OFST 12
+/* MC_CMD_PTP_IN_SET_CLK_SRC msgrequest */
+#define MC_CMD_PTP_IN_SET_CLK_SRC_LEN 12
+/* MC_CMD_PTP_IN_CMD_OFST 0 */
+/* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
+/* Set the clock source. */
+#define MC_CMD_PTP_IN_SET_CLK_SRC_CLK_OFST 8
+/* enum: Internal. */
+#define MC_CMD_PTP_CLK_SRC_INTERNAL 0x0
+/* enum: External. */
+#define MC_CMD_PTP_CLK_SRC_EXTERNAL 0x1
+
+/* MC_CMD_PTP_IN_RST_CLK msgrequest */
+#define MC_CMD_PTP_IN_RST_CLK_LEN 8
+/* MC_CMD_PTP_IN_CMD_OFST 0 */
+/* Reset value of Timer Reg. */
+/* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
+
/* MC_CMD_PTP_IN_PPS_ENABLE msgrequest */
#define MC_CMD_PTP_IN_PPS_ENABLE_LEN 12
/* MC_CMD_PTP_IN_CMD_OFST 0 */
+/* Enable or disable */
#define MC_CMD_PTP_IN_PPS_ENABLE_OP_OFST 4
-#define MC_CMD_PTP_ENABLE_PPS 0x0 /* enum */
-#define MC_CMD_PTP_DISABLE_PPS 0x1 /* enum */
+/* enum: Enable */
+#define MC_CMD_PTP_ENABLE_PPS 0x0
+/* enum: Disable */
+#define MC_CMD_PTP_DISABLE_PPS 0x1
+/* Queue id to send events back */
#define MC_CMD_PTP_IN_PPS_ENABLE_QUEUE_ID_OFST 8
+/* MC_CMD_PTP_IN_GET_TIME_FORMAT msgrequest */
+#define MC_CMD_PTP_IN_GET_TIME_FORMAT_LEN 8
+/* MC_CMD_PTP_IN_CMD_OFST 0 */
+/* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
+
+/* MC_CMD_PTP_IN_GET_ATTRIBUTES msgrequest */
+#define MC_CMD_PTP_IN_GET_ATTRIBUTES_LEN 8
+/* MC_CMD_PTP_IN_CMD_OFST 0 */
+/* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
+
+/* MC_CMD_PTP_IN_GET_TIMESTAMP_CORRECTIONS msgrequest */
+#define MC_CMD_PTP_IN_GET_TIMESTAMP_CORRECTIONS_LEN 8
+/* MC_CMD_PTP_IN_CMD_OFST 0 */
+/* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
+
+/* MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE msgrequest */
+#define MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE_LEN 12
+/* MC_CMD_PTP_IN_CMD_OFST 0 */
+/* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
+/* Original field containing queue ID. Now extended to include flags. */
+#define MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE_QUEUE_OFST 8
+#define MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE_QUEUE_ID_LBN 0
+#define MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE_QUEUE_ID_WIDTH 16
+#define MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE_REPORT_SYNC_STATUS_LBN 31
+#define MC_CMD_PTP_IN_TIME_EVENT_SUBSCRIBE_REPORT_SYNC_STATUS_WIDTH 1
+
+/* MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE msgrequest */
+#define MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE_LEN 16
+/* MC_CMD_PTP_IN_CMD_OFST 0 */
+/* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
+/* Unsubscribe options */
+#define MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE_CONTROL_OFST 8
+/* enum: Unsubscribe a single queue */
+#define MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE_SINGLE 0x0
+/* enum: Unsubscribe all queues */
+#define MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE_ALL 0x1
+/* Event queue ID */
+#define MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE_QUEUE_OFST 12
+
+/* MC_CMD_PTP_IN_MANFTEST_PPS msgrequest */
+#define MC_CMD_PTP_IN_MANFTEST_PPS_LEN 12
+/* MC_CMD_PTP_IN_CMD_OFST 0 */
+/* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
+/* 1 to enable PPS test mode, 0 to disable and return result. */
+#define MC_CMD_PTP_IN_MANFTEST_PPS_TEST_ENABLE_OFST 8
+
+/* MC_CMD_PTP_IN_SET_SYNC_STATUS msgrequest */
+#define MC_CMD_PTP_IN_SET_SYNC_STATUS_LEN 24
+/* MC_CMD_PTP_IN_CMD_OFST 0 */
+/* MC_CMD_PTP_IN_PERIPH_ID_OFST 4 */
+/* NIC - Host System Clock Synchronization status */
+#define MC_CMD_PTP_IN_SET_SYNC_STATUS_STATUS_OFST 8
+/* enum: Host System clock and NIC clock are not in sync */
+#define MC_CMD_PTP_IN_SET_SYNC_STATUS_NOT_IN_SYNC 0x0
+/* enum: Host System clock and NIC clock are synchronized */
+#define MC_CMD_PTP_IN_SET_SYNC_STATUS_IN_SYNC 0x1
+/* If synchronized, number of seconds until clocks should be considered to be
+ * no longer in sync.
+ */
+#define MC_CMD_PTP_IN_SET_SYNC_STATUS_TIMEOUT_OFST 12
+#define MC_CMD_PTP_IN_SET_SYNC_STATUS_RESERVED0_OFST 16
+#define MC_CMD_PTP_IN_SET_SYNC_STATUS_RESERVED1_OFST 20
+
/* MC_CMD_PTP_OUT msgresponse */
#define MC_CMD_PTP_OUT_LEN 0
/* MC_CMD_PTP_OUT_TRANSMIT msgresponse */
#define MC_CMD_PTP_OUT_TRANSMIT_LEN 8
+/* Value of seconds timestamp */
#define MC_CMD_PTP_OUT_TRANSMIT_SECONDS_OFST 0
+/* Timestamp major value */
+#define MC_CMD_PTP_OUT_TRANSMIT_MAJOR_OFST 0
+/* Value of nanoseconds timestamp */
#define MC_CMD_PTP_OUT_TRANSMIT_NANOSECONDS_OFST 4
+/* Timestamp minor value */
+#define MC_CMD_PTP_OUT_TRANSMIT_MINOR_OFST 4
+
+/* MC_CMD_PTP_OUT_TIME_EVENT_SUBSCRIBE msgresponse */
+#define MC_CMD_PTP_OUT_TIME_EVENT_SUBSCRIBE_LEN 0
+
+/* MC_CMD_PTP_OUT_TIME_EVENT_UNSUBSCRIBE msgresponse */
+#define MC_CMD_PTP_OUT_TIME_EVENT_UNSUBSCRIBE_LEN 0
/* MC_CMD_PTP_OUT_READ_NIC_TIME msgresponse */
#define MC_CMD_PTP_OUT_READ_NIC_TIME_LEN 8
+/* Value of seconds timestamp */
#define MC_CMD_PTP_OUT_READ_NIC_TIME_SECONDS_OFST 0
+/* Timestamp major value */
+#define MC_CMD_PTP_OUT_READ_NIC_TIME_MAJOR_OFST 0
+/* Value of nanoseconds timestamp */
#define MC_CMD_PTP_OUT_READ_NIC_TIME_NANOSECONDS_OFST 4
+/* Timestamp minor value */
+#define MC_CMD_PTP_OUT_READ_NIC_TIME_MINOR_OFST 4
/* MC_CMD_PTP_OUT_STATUS msgresponse */
#define MC_CMD_PTP_OUT_STATUS_LEN 64
+/* Frequency of NIC's hardware clock */
#define MC_CMD_PTP_OUT_STATUS_CLOCK_FREQ_OFST 0
+/* Number of packets transmitted and timestamped */
#define MC_CMD_PTP_OUT_STATUS_STATS_TX_OFST 4
+/* Number of packets received and timestamped */
#define MC_CMD_PTP_OUT_STATUS_STATS_RX_OFST 8
+/* Number of packets timestamped by the FPGA */
#define MC_CMD_PTP_OUT_STATUS_STATS_TS_OFST 12
+/* Number of packets filter matched */
#define MC_CMD_PTP_OUT_STATUS_STATS_FM_OFST 16
+/* Number of packets not filter matched */
#define MC_CMD_PTP_OUT_STATUS_STATS_NFM_OFST 20
+/* Number of PPS overflows (noise on input?) */
#define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFLOW_OFST 24
+/* Number of PPS bad periods */
#define MC_CMD_PTP_OUT_STATUS_STATS_PPS_BAD_OFST 28
+/* Minimum period of PPS pulse in nanoseconds */
#define MC_CMD_PTP_OUT_STATUS_STATS_PPS_PER_MIN_OFST 32
+/* Maximum period of PPS pulse in nanoseconds */
#define MC_CMD_PTP_OUT_STATUS_STATS_PPS_PER_MAX_OFST 36
+/* Last period of PPS pulse in nanoseconds */
#define MC_CMD_PTP_OUT_STATUS_STATS_PPS_PER_LAST_OFST 40
+/* Mean period of PPS pulse in nanoseconds */
#define MC_CMD_PTP_OUT_STATUS_STATS_PPS_PER_MEAN_OFST 44
+/* Minimum offset of PPS pulse in nanoseconds (signed) */
#define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFF_MIN_OFST 48
+/* Maximum offset of PPS pulse in nanoseconds (signed) */
#define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFF_MAX_OFST 52
+/* Last offset of PPS pulse in nanoseconds (signed) */
#define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFF_LAST_OFST 56
+/* Mean offset of PPS pulse in nanoseconds (signed) */
#define MC_CMD_PTP_OUT_STATUS_STATS_PPS_OFF_MEAN_OFST 60
/* MC_CMD_PTP_OUT_SYNCHRONIZE msgresponse */
#define MC_CMD_PTP_OUT_SYNCHRONIZE_LENMIN 20
#define MC_CMD_PTP_OUT_SYNCHRONIZE_LENMAX 240
#define MC_CMD_PTP_OUT_SYNCHRONIZE_LEN(num) (0+20*(num))
+/* A set of host and NIC times */
#define MC_CMD_PTP_OUT_SYNCHRONIZE_TIMESET_OFST 0
#define MC_CMD_PTP_OUT_SYNCHRONIZE_TIMESET_LEN 20
#define MC_CMD_PTP_OUT_SYNCHRONIZE_TIMESET_MINNUM 1
#define MC_CMD_PTP_OUT_SYNCHRONIZE_TIMESET_MAXNUM 12
+/* Host time immediately before NIC's hardware clock read */
#define MC_CMD_PTP_OUT_SYNCHRONIZE_HOSTSTART_OFST 0
+/* Value of seconds timestamp */
#define MC_CMD_PTP_OUT_SYNCHRONIZE_SECONDS_OFST 4
+/* Timestamp major value */
+#define MC_CMD_PTP_OUT_SYNCHRONIZE_MAJOR_OFST 4
+/* Value of nanoseconds timestamp */
#define MC_CMD_PTP_OUT_SYNCHRONIZE_NANOSECONDS_OFST 8
+/* Timestamp minor value */
+#define MC_CMD_PTP_OUT_SYNCHRONIZE_MINOR_OFST 8
+/* Host time immediately after NIC's hardware clock read */
#define MC_CMD_PTP_OUT_SYNCHRONIZE_HOSTEND_OFST 12
+/* Number of nanoseconds waited after reading NIC's hardware clock */
#define MC_CMD_PTP_OUT_SYNCHRONIZE_WAITNS_OFST 16
/* MC_CMD_PTP_OUT_MANFTEST_BASIC msgresponse */
#define MC_CMD_PTP_OUT_MANFTEST_BASIC_LEN 8
+/* Results of testing */
#define MC_CMD_PTP_OUT_MANFTEST_BASIC_TEST_RESULT_OFST 0
-#define MC_CMD_PTP_MANF_SUCCESS 0x0 /* enum */
-#define MC_CMD_PTP_MANF_FPGA_LOAD 0x1 /* enum */
-#define MC_CMD_PTP_MANF_FPGA_VERSION 0x2 /* enum */
-#define MC_CMD_PTP_MANF_FPGA_REGISTERS 0x3 /* enum */
-#define MC_CMD_PTP_MANF_OSCILLATOR 0x4 /* enum */
-#define MC_CMD_PTP_MANF_TIMESTAMPS 0x5 /* enum */
-#define MC_CMD_PTP_MANF_PACKET_COUNT 0x6 /* enum */
-#define MC_CMD_PTP_MANF_FILTER_COUNT 0x7 /* enum */
-#define MC_CMD_PTP_MANF_PACKET_ENOUGH 0x8 /* enum */
-#define MC_CMD_PTP_MANF_GPIO_TRIGGER 0x9 /* enum */
+/* enum: Successful test */
+#define MC_CMD_PTP_MANF_SUCCESS 0x0
+/* enum: FPGA load failed */
+#define MC_CMD_PTP_MANF_FPGA_LOAD 0x1
+/* enum: FPGA version invalid */
+#define MC_CMD_PTP_MANF_FPGA_VERSION 0x2
+/* enum: FPGA registers incorrect */
+#define MC_CMD_PTP_MANF_FPGA_REGISTERS 0x3
+/* enum: Oscillator possibly not working? */
+#define MC_CMD_PTP_MANF_OSCILLATOR 0x4
+/* enum: Timestamps not increasing */
+#define MC_CMD_PTP_MANF_TIMESTAMPS 0x5
+/* enum: Mismatched packet count */
+#define MC_CMD_PTP_MANF_PACKET_COUNT 0x6
+/* enum: Mismatched packet count (Siena filter and FPGA) */
+#define MC_CMD_PTP_MANF_FILTER_COUNT 0x7
+/* enum: Not enough packets to perform timestamp check */
+#define MC_CMD_PTP_MANF_PACKET_ENOUGH 0x8
+/* enum: Timestamp trigger GPIO not working */
+#define MC_CMD_PTP_MANF_GPIO_TRIGGER 0x9
+/* enum: Insufficient PPS events to perform checks */
+#define MC_CMD_PTP_MANF_PPS_ENOUGH 0xa
+/* enum: PPS time event period not sufficiently close to 1s. */
+#define MC_CMD_PTP_MANF_PPS_PERIOD 0xb
+/* enum: PPS time event nS reading not sufficiently close to zero. */
+#define MC_CMD_PTP_MANF_PPS_NS 0xc
+/* enum: PTP peripheral registers incorrect */
+#define MC_CMD_PTP_MANF_REGISTERS 0xd
+/* enum: Failed to read time from PTP peripheral */
+#define MC_CMD_PTP_MANF_CLOCK_READ 0xe
+/* Presence of external oscillator */
#define MC_CMD_PTP_OUT_MANFTEST_BASIC_TEST_EXTOSC_OFST 4
/* MC_CMD_PTP_OUT_MANFTEST_PACKET msgresponse */
#define MC_CMD_PTP_OUT_MANFTEST_PACKET_LEN 12
+/* Results of testing */
#define MC_CMD_PTP_OUT_MANFTEST_PACKET_TEST_RESULT_OFST 0
+/* Number of packets received by FPGA */
#define MC_CMD_PTP_OUT_MANFTEST_PACKET_TEST_FPGACOUNT_OFST 4
+/* Number of packets received by Siena filters */
#define MC_CMD_PTP_OUT_MANFTEST_PACKET_TEST_FILTERCOUNT_OFST 8
/* MC_CMD_PTP_OUT_FPGAREAD msgresponse */
@@ -2671,15 +3884,85 @@
#define MC_CMD_PTP_OUT_FPGAREAD_BUFFER_MINNUM 1
#define MC_CMD_PTP_OUT_FPGAREAD_BUFFER_MAXNUM 252
+/* MC_CMD_PTP_OUT_GET_TIME_FORMAT msgresponse */
+#define MC_CMD_PTP_OUT_GET_TIME_FORMAT_LEN 4
+/* Time format required/used by for this NIC. Applies to all PTP MCDI
+ * operations that pass times between the host and firmware. If this operation
+ * is not supported (older firmware) a format of seconds and nanoseconds should
+ * be assumed.
+ */
+#define MC_CMD_PTP_OUT_GET_TIME_FORMAT_FORMAT_OFST 0
+/* enum: Times are in seconds and nanoseconds */
+#define MC_CMD_PTP_OUT_GET_TIME_FORMAT_SECONDS_NANOSECONDS 0x0
+/* enum: Major register has units of 16 second per tick, minor 8 ns per tick */
+#define MC_CMD_PTP_OUT_GET_TIME_FORMAT_16SECONDS_8NANOSECONDS 0x1
+/* enum: Major register has units of seconds, minor 2^-27s per tick */
+#define MC_CMD_PTP_OUT_GET_TIME_FORMAT_SECONDS_27FRACTION 0x2
+
+/* MC_CMD_PTP_OUT_GET_ATTRIBUTES msgresponse */
+#define MC_CMD_PTP_OUT_GET_ATTRIBUTES_LEN 24
+/* Time format required/used by for this NIC. Applies to all PTP MCDI
+ * operations that pass times between the host and firmware. If this operation
+ * is not supported (older firmware) a format of seconds and nanoseconds should
+ * be assumed.
+ */
+#define MC_CMD_PTP_OUT_GET_ATTRIBUTES_TIME_FORMAT_OFST 0
+/* enum: Times are in seconds and nanoseconds */
+#define MC_CMD_PTP_OUT_GET_ATTRIBUTES_SECONDS_NANOSECONDS 0x0
+/* enum: Major register has units of 16 second per tick, minor 8 ns per tick */
+#define MC_CMD_PTP_OUT_GET_ATTRIBUTES_16SECONDS_8NANOSECONDS 0x1
+/* enum: Major register has units of seconds, minor 2^-27s per tick */
+#define MC_CMD_PTP_OUT_GET_ATTRIBUTES_SECONDS_27FRACTION 0x2
+/* Minimum acceptable value for a corrected synchronization timeset. When
+ * comparing host and NIC clock times, the MC returns a set of samples that
+ * contain the host start and end time, the MC time when the host start was
+ * detected and the time the MC waited between reading the time and detecting
+ * the host end. The corrected sync window is the difference between the host
+ * end and start times minus the time that the MC waited for host end.
+ */
+#define MC_CMD_PTP_OUT_GET_ATTRIBUTES_SYNC_WINDOW_MIN_OFST 4
+/* Various PTP capabilities */
+#define MC_CMD_PTP_OUT_GET_ATTRIBUTES_CAPABILITIES_OFST 8
+#define MC_CMD_PTP_OUT_GET_ATTRIBUTES_REPORT_SYNC_STATUS_LBN 0
+#define MC_CMD_PTP_OUT_GET_ATTRIBUTES_REPORT_SYNC_STATUS_WIDTH 1
+#define MC_CMD_PTP_OUT_GET_ATTRIBUTES_RESERVED0_OFST 12
+#define MC_CMD_PTP_OUT_GET_ATTRIBUTES_RESERVED1_OFST 16
+#define MC_CMD_PTP_OUT_GET_ATTRIBUTES_RESERVED2_OFST 20
+
+/* MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS msgresponse */
+#define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_LEN 16
+/* Uncorrected error on transmit timestamps in NIC clock format */
+#define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_TRANSMIT_OFST 0
+/* Uncorrected error on receive timestamps in NIC clock format */
+#define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_RECEIVE_OFST 4
+/* Uncorrected error on PPS output in NIC clock format */
+#define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_PPS_OUT_OFST 8
+/* Uncorrected error on PPS input in NIC clock format */
+#define MC_CMD_PTP_OUT_GET_TIMESTAMP_CORRECTIONS_PPS_IN_OFST 12
+
+/* MC_CMD_PTP_OUT_MANFTEST_PPS msgresponse */
+#define MC_CMD_PTP_OUT_MANFTEST_PPS_LEN 4
+/* Results of testing */
+#define MC_CMD_PTP_OUT_MANFTEST_PPS_TEST_RESULT_OFST 0
+/* Enum values, see field(s): */
+/* MC_CMD_PTP_OUT_MANFTEST_BASIC/TEST_RESULT */
+
+/* MC_CMD_PTP_OUT_SET_SYNC_STATUS msgresponse */
+#define MC_CMD_PTP_OUT_SET_SYNC_STATUS_LEN 0
+
/***********************************/
-/* MC_CMD_CSR_READ32
+/* MC_CMD_CSR_READ32
* Read 32bit words from the indirect memory map.
*/
-#define MC_CMD_CSR_READ32 0xc
+#define MC_CMD_CSR_READ32 0xc
+#undef MC_CMD_0xc_PRIVILEGE_CTG
+
+#define MC_CMD_0xc_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_CSR_READ32_IN msgrequest */
#define MC_CMD_CSR_READ32_IN_LEN 12
+/* Address */
#define MC_CMD_CSR_READ32_IN_ADDR_OFST 0
#define MC_CMD_CSR_READ32_IN_STEP_OFST 4
#define MC_CMD_CSR_READ32_IN_NUMWORDS_OFST 8
@@ -2688,6 +3971,7 @@
#define MC_CMD_CSR_READ32_OUT_LENMIN 4
#define MC_CMD_CSR_READ32_OUT_LENMAX 252
#define MC_CMD_CSR_READ32_OUT_LEN(num) (0+4*(num))
+/* The last dword is the status, not a value read */
#define MC_CMD_CSR_READ32_OUT_BUFFER_OFST 0
#define MC_CMD_CSR_READ32_OUT_BUFFER_LEN 4
#define MC_CMD_CSR_READ32_OUT_BUFFER_MINNUM 1
@@ -2695,15 +3979,19 @@
/***********************************/
-/* MC_CMD_CSR_WRITE32
+/* MC_CMD_CSR_WRITE32
* Write 32bit dwords to the indirect memory map.
*/
-#define MC_CMD_CSR_WRITE32 0xd
+#define MC_CMD_CSR_WRITE32 0xd
+#undef MC_CMD_0xd_PRIVILEGE_CTG
+
+#define MC_CMD_0xd_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_CSR_WRITE32_IN msgrequest */
#define MC_CMD_CSR_WRITE32_IN_LENMIN 12
#define MC_CMD_CSR_WRITE32_IN_LENMAX 252
#define MC_CMD_CSR_WRITE32_IN_LEN(num) (8+4*(num))
+/* Address */
#define MC_CMD_CSR_WRITE32_IN_ADDR_OFST 0
#define MC_CMD_CSR_WRITE32_IN_STEP_OFST 4
#define MC_CMD_CSR_WRITE32_IN_BUFFER_OFST 8
@@ -2717,35 +4005,58 @@
/***********************************/
-/* MC_CMD_HP
- * HP specific commands.
+/* MC_CMD_HP
+ * These commands are used for HP related features. They are grouped under one
+ * MCDI command to avoid creating too many MCDI commands.
*/
-#define MC_CMD_HP 0x54
+#define MC_CMD_HP 0x54
+#undef MC_CMD_0x54_PRIVILEGE_CTG
+
+#define MC_CMD_0x54_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_HP_IN msgrequest */
#define MC_CMD_HP_IN_LEN 16
+/* HP OCSD sub-command. When address is not NULL, request activation of OCSD at
+ * the specified address with the specified interval.When address is NULL,
+ * INTERVAL is interpreted as a command: 0: stop OCSD / 1: Report OCSD current
+ * state / 2: (debug) Show temperature reported by one of the supported
+ * sensors.
+ */
#define MC_CMD_HP_IN_SUBCMD_OFST 0
-#define MC_CMD_HP_IN_OCSD_SUBCMD 0x0 /* enum */
-#define MC_CMD_HP_IN_LAST_SUBCMD 0x0 /* enum */
+/* enum: OCSD (Option Card Sensor Data) sub-command. */
+#define MC_CMD_HP_IN_OCSD_SUBCMD 0x0
+/* enum: Last known valid HP sub-command. */
+#define MC_CMD_HP_IN_LAST_SUBCMD 0x0
+/* The address to the array of sensor fields. (Or NULL to use a sub-command.)
+ */
#define MC_CMD_HP_IN_OCSD_ADDR_OFST 4
#define MC_CMD_HP_IN_OCSD_ADDR_LEN 8
#define MC_CMD_HP_IN_OCSD_ADDR_LO_OFST 4
#define MC_CMD_HP_IN_OCSD_ADDR_HI_OFST 8
+/* The requested update interval, in seconds. (Or the sub-command if ADDR is
+ * NULL.)
+ */
#define MC_CMD_HP_IN_OCSD_INTERVAL_OFST 12
/* MC_CMD_HP_OUT msgresponse */
#define MC_CMD_HP_OUT_LEN 4
#define MC_CMD_HP_OUT_OCSD_STATUS_OFST 0
-#define MC_CMD_HP_OUT_OCSD_STOPPED 0x1 /* enum */
-#define MC_CMD_HP_OUT_OCSD_STARTED 0x2 /* enum */
-#define MC_CMD_HP_OUT_OCSD_ALREADY_STARTED 0x3 /* enum */
+/* enum: OCSD stopped for this card. */
+#define MC_CMD_HP_OUT_OCSD_STOPPED 0x1
+/* enum: OCSD was successfully started with the address provided. */
+#define MC_CMD_HP_OUT_OCSD_STARTED 0x2
+/* enum: OCSD was already started for this card. */
+#define MC_CMD_HP_OUT_OCSD_ALREADY_STARTED 0x3
/***********************************/
-/* MC_CMD_STACKINFO
+/* MC_CMD_STACKINFO
* Get stack information.
*/
-#define MC_CMD_STACKINFO 0xf
+#define MC_CMD_STACKINFO 0xf
+#undef MC_CMD_0xf_PRIVILEGE_CTG
+
+#define MC_CMD_0xf_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_STACKINFO_IN msgrequest */
#define MC_CMD_STACKINFO_IN_LEN 0
@@ -2754,6 +4065,7 @@
#define MC_CMD_STACKINFO_OUT_LENMIN 12
#define MC_CMD_STACKINFO_OUT_LENMAX 252
#define MC_CMD_STACKINFO_OUT_LEN(num) (0+12*(num))
+/* (thread ptr, stack size, free space) for each thread in system */
#define MC_CMD_STACKINFO_OUT_THREAD_INFO_OFST 0
#define MC_CMD_STACKINFO_OUT_THREAD_INFO_LEN 12
#define MC_CMD_STACKINFO_OUT_THREAD_INFO_MINNUM 1
@@ -2761,61 +4073,105 @@
/***********************************/
-/* MC_CMD_MDIO_READ
+/* MC_CMD_MDIO_READ
* MDIO register read.
*/
-#define MC_CMD_MDIO_READ 0x10
+#define MC_CMD_MDIO_READ 0x10
+#undef MC_CMD_0x10_PRIVILEGE_CTG
+
+#define MC_CMD_0x10_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_MDIO_READ_IN msgrequest */
#define MC_CMD_MDIO_READ_IN_LEN 16
+/* Bus number; there are two MDIO buses: one for the internal PHY, and one for
+ * external devices.
+ */
#define MC_CMD_MDIO_READ_IN_BUS_OFST 0
-#define MC_CMD_MDIO_BUS_INTERNAL 0x0 /* enum */
-#define MC_CMD_MDIO_BUS_EXTERNAL 0x1 /* enum */
+/* enum: Internal. */
+#define MC_CMD_MDIO_BUS_INTERNAL 0x0
+/* enum: External. */
+#define MC_CMD_MDIO_BUS_EXTERNAL 0x1
+/* Port address */
#define MC_CMD_MDIO_READ_IN_PRTAD_OFST 4
+/* Device Address or clause 22. */
#define MC_CMD_MDIO_READ_IN_DEVAD_OFST 8
-#define MC_CMD_MDIO_CLAUSE22 0x20 /* enum */
+/* enum: By default all the MCDI MDIO operations perform clause45 mode. If you
+ * want to use clause22 then set DEVAD = MC_CMD_MDIO_CLAUSE22.
+ */
+#define MC_CMD_MDIO_CLAUSE22 0x20
+/* Address */
#define MC_CMD_MDIO_READ_IN_ADDR_OFST 12
/* MC_CMD_MDIO_READ_OUT msgresponse */
#define MC_CMD_MDIO_READ_OUT_LEN 8
+/* Value */
#define MC_CMD_MDIO_READ_OUT_VALUE_OFST 0
+/* Status the MDIO commands return the raw status bits from the MDIO block. A
+ * "good" transaction should have the DONE bit set and all other bits clear.
+ */
#define MC_CMD_MDIO_READ_OUT_STATUS_OFST 4
-#define MC_CMD_MDIO_STATUS_GOOD 0x8 /* enum */
+/* enum: Good. */
+#define MC_CMD_MDIO_STATUS_GOOD 0x8
/***********************************/
-/* MC_CMD_MDIO_WRITE
+/* MC_CMD_MDIO_WRITE
* MDIO register write.
*/
-#define MC_CMD_MDIO_WRITE 0x11
+#define MC_CMD_MDIO_WRITE 0x11
+#undef MC_CMD_0x11_PRIVILEGE_CTG
+
+#define MC_CMD_0x11_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_MDIO_WRITE_IN msgrequest */
#define MC_CMD_MDIO_WRITE_IN_LEN 20
+/* Bus number; there are two MDIO buses: one for the internal PHY, and one for
+ * external devices.
+ */
#define MC_CMD_MDIO_WRITE_IN_BUS_OFST 0
+/* enum: Internal. */
/* MC_CMD_MDIO_BUS_INTERNAL 0x0 */
+/* enum: External. */
/* MC_CMD_MDIO_BUS_EXTERNAL 0x1 */
+/* Port address */
#define MC_CMD_MDIO_WRITE_IN_PRTAD_OFST 4
+/* Device Address or clause 22. */
#define MC_CMD_MDIO_WRITE_IN_DEVAD_OFST 8
+/* enum: By default all the MCDI MDIO operations perform clause45 mode. If you
+ * want to use clause22 then set DEVAD = MC_CMD_MDIO_CLAUSE22.
+ */
/* MC_CMD_MDIO_CLAUSE22 0x20 */
+/* Address */
#define MC_CMD_MDIO_WRITE_IN_ADDR_OFST 12
+/* Value */
#define MC_CMD_MDIO_WRITE_IN_VALUE_OFST 16
/* MC_CMD_MDIO_WRITE_OUT msgresponse */
#define MC_CMD_MDIO_WRITE_OUT_LEN 4
+/* Status; the MDIO commands return the raw status bits from the MDIO block. A
+ * "good" transaction should have the DONE bit set and all other bits clear.
+ */
#define MC_CMD_MDIO_WRITE_OUT_STATUS_OFST 0
+/* enum: Good. */
/* MC_CMD_MDIO_STATUS_GOOD 0x8 */
/***********************************/
-/* MC_CMD_DBI_WRITE
+/* MC_CMD_DBI_WRITE
* Write DBI register(s).
*/
-#define MC_CMD_DBI_WRITE 0x12
+#define MC_CMD_DBI_WRITE 0x12
+#undef MC_CMD_0x12_PRIVILEGE_CTG
+
+#define MC_CMD_0x12_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_DBI_WRITE_IN msgrequest */
#define MC_CMD_DBI_WRITE_IN_LENMIN 12
#define MC_CMD_DBI_WRITE_IN_LENMAX 252
#define MC_CMD_DBI_WRITE_IN_LEN(num) (0+12*(num))
+/* Each write op consists of an address (offset 0), byte enable/VF/CS2 (offset
+ * 32) and value (offset 64). See MC_CMD_DBIWROP_TYPEDEF.
+ */
#define MC_CMD_DBI_WRITE_IN_DBIWROP_OFST 0
#define MC_CMD_DBI_WRITE_IN_DBIWROP_LEN 12
#define MC_CMD_DBI_WRITE_IN_DBIWROP_MINNUM 1
@@ -2829,85 +4185,136 @@
#define MC_CMD_DBIWROP_TYPEDEF_ADDRESS_OFST 0
#define MC_CMD_DBIWROP_TYPEDEF_ADDRESS_LBN 0
#define MC_CMD_DBIWROP_TYPEDEF_ADDRESS_WIDTH 32
-#define MC_CMD_DBIWROP_TYPEDEF_BYTE_MASK_OFST 4
-#define MC_CMD_DBIWROP_TYPEDEF_BYTE_MASK_LBN 32
-#define MC_CMD_DBIWROP_TYPEDEF_BYTE_MASK_WIDTH 32
+#define MC_CMD_DBIWROP_TYPEDEF_PARMS_OFST 4
+#define MC_CMD_DBIWROP_TYPEDEF_VF_NUM_LBN 16
+#define MC_CMD_DBIWROP_TYPEDEF_VF_NUM_WIDTH 16
+#define MC_CMD_DBIWROP_TYPEDEF_VF_ACTIVE_LBN 15
+#define MC_CMD_DBIWROP_TYPEDEF_VF_ACTIVE_WIDTH 1
+#define MC_CMD_DBIWROP_TYPEDEF_CS2_LBN 14
+#define MC_CMD_DBIWROP_TYPEDEF_CS2_WIDTH 1
+#define MC_CMD_DBIWROP_TYPEDEF_PARMS_LBN 32
+#define MC_CMD_DBIWROP_TYPEDEF_PARMS_WIDTH 32
#define MC_CMD_DBIWROP_TYPEDEF_VALUE_OFST 8
#define MC_CMD_DBIWROP_TYPEDEF_VALUE_LBN 64
#define MC_CMD_DBIWROP_TYPEDEF_VALUE_WIDTH 32
/***********************************/
-/* MC_CMD_PORT_READ32
- * Read a 32-bit register from the indirect port register map.
+/* MC_CMD_PORT_READ32
+ * Read a 32-bit register from the indirect port register map. The port to
+ * access is implied by the Shared memory channel used.
*/
-#define MC_CMD_PORT_READ32 0x14
+#define MC_CMD_PORT_READ32 0x14
/* MC_CMD_PORT_READ32_IN msgrequest */
#define MC_CMD_PORT_READ32_IN_LEN 4
+/* Address */
#define MC_CMD_PORT_READ32_IN_ADDR_OFST 0
/* MC_CMD_PORT_READ32_OUT msgresponse */
#define MC_CMD_PORT_READ32_OUT_LEN 8
+/* Value */
#define MC_CMD_PORT_READ32_OUT_VALUE_OFST 0
+/* Status */
#define MC_CMD_PORT_READ32_OUT_STATUS_OFST 4
/***********************************/
-/* MC_CMD_PORT_WRITE32
- * Write a 32-bit register to the indirect port register map.
+/* MC_CMD_PORT_WRITE32
+ * Write a 32-bit register to the indirect port register map. The port to
+ * access is implied by the Shared memory channel used.
*/
-#define MC_CMD_PORT_WRITE32 0x15
+#define MC_CMD_PORT_WRITE32 0x15
/* MC_CMD_PORT_WRITE32_IN msgrequest */
#define MC_CMD_PORT_WRITE32_IN_LEN 8
+/* Address */
#define MC_CMD_PORT_WRITE32_IN_ADDR_OFST 0
+/* Value */
#define MC_CMD_PORT_WRITE32_IN_VALUE_OFST 4
/* MC_CMD_PORT_WRITE32_OUT msgresponse */
#define MC_CMD_PORT_WRITE32_OUT_LEN 4
+/* Status */
#define MC_CMD_PORT_WRITE32_OUT_STATUS_OFST 0
/***********************************/
-/* MC_CMD_PORT_READ128
- * Read a 128-bit register from the indirect port register map.
+/* MC_CMD_PORT_READ128
+ * Read a 128-bit register from the indirect port register map. The port to
+ * access is implied by the Shared memory channel used.
*/
-#define MC_CMD_PORT_READ128 0x16
+#define MC_CMD_PORT_READ128 0x16
/* MC_CMD_PORT_READ128_IN msgrequest */
#define MC_CMD_PORT_READ128_IN_LEN 4
+/* Address */
#define MC_CMD_PORT_READ128_IN_ADDR_OFST 0
/* MC_CMD_PORT_READ128_OUT msgresponse */
#define MC_CMD_PORT_READ128_OUT_LEN 20
+/* Value */
#define MC_CMD_PORT_READ128_OUT_VALUE_OFST 0
#define MC_CMD_PORT_READ128_OUT_VALUE_LEN 16
+/* Status */
#define MC_CMD_PORT_READ128_OUT_STATUS_OFST 16
/***********************************/
-/* MC_CMD_PORT_WRITE128
- * Write a 128-bit register to the indirect port register map.
+/* MC_CMD_PORT_WRITE128
+ * Write a 128-bit register to the indirect port register map. The port to
+ * access is implied by the Shared memory channel used.
*/
-#define MC_CMD_PORT_WRITE128 0x17
+#define MC_CMD_PORT_WRITE128 0x17
/* MC_CMD_PORT_WRITE128_IN msgrequest */
#define MC_CMD_PORT_WRITE128_IN_LEN 20
+/* Address */
#define MC_CMD_PORT_WRITE128_IN_ADDR_OFST 0
+/* Value */
#define MC_CMD_PORT_WRITE128_IN_VALUE_OFST 4
#define MC_CMD_PORT_WRITE128_IN_VALUE_LEN 16
/* MC_CMD_PORT_WRITE128_OUT msgresponse */
#define MC_CMD_PORT_WRITE128_OUT_LEN 4
+/* Status */
#define MC_CMD_PORT_WRITE128_OUT_STATUS_OFST 0
+/* MC_CMD_CAPABILITIES structuredef */
+#define MC_CMD_CAPABILITIES_LEN 4
+/* Small buf table. */
+#define MC_CMD_CAPABILITIES_SMALL_BUF_TBL_LBN 0
+#define MC_CMD_CAPABILITIES_SMALL_BUF_TBL_WIDTH 1
+/* Turbo mode (for Maranello). */
+#define MC_CMD_CAPABILITIES_TURBO_LBN 1
+#define MC_CMD_CAPABILITIES_TURBO_WIDTH 1
+/* Turbo mode active (for Maranello). */
+#define MC_CMD_CAPABILITIES_TURBO_ACTIVE_LBN 2
+#define MC_CMD_CAPABILITIES_TURBO_ACTIVE_WIDTH 1
+/* PTP offload. */
+#define MC_CMD_CAPABILITIES_PTP_LBN 3
+#define MC_CMD_CAPABILITIES_PTP_WIDTH 1
+/* AOE mode. */
+#define MC_CMD_CAPABILITIES_AOE_LBN 4
+#define MC_CMD_CAPABILITIES_AOE_WIDTH 1
+/* AOE mode active. */
+#define MC_CMD_CAPABILITIES_AOE_ACTIVE_LBN 5
+#define MC_CMD_CAPABILITIES_AOE_ACTIVE_WIDTH 1
+/* AOE mode active. */
+#define MC_CMD_CAPABILITIES_FC_ACTIVE_LBN 6
+#define MC_CMD_CAPABILITIES_FC_ACTIVE_WIDTH 1
+#define MC_CMD_CAPABILITIES_RESERVED_LBN 7
+#define MC_CMD_CAPABILITIES_RESERVED_WIDTH 25
+
/***********************************/
-/* MC_CMD_GET_BOARD_CFG
+/* MC_CMD_GET_BOARD_CFG
* Returns the MC firmware configuration structure.
*/
-#define MC_CMD_GET_BOARD_CFG 0x18
+#define MC_CMD_GET_BOARD_CFG 0x18
+#undef MC_CMD_0x18_PRIVILEGE_CTG
+
+#define MC_CMD_0x18_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_GET_BOARD_CFG_IN msgrequest */
#define MC_CMD_GET_BOARD_CFG_IN_LEN 0
@@ -2919,24 +4326,10 @@
#define MC_CMD_GET_BOARD_CFG_OUT_BOARD_TYPE_OFST 0
#define MC_CMD_GET_BOARD_CFG_OUT_BOARD_NAME_OFST 4
#define MC_CMD_GET_BOARD_CFG_OUT_BOARD_NAME_LEN 32
+/* See MC_CMD_CAPABILITIES */
#define MC_CMD_GET_BOARD_CFG_OUT_CAPABILITIES_PORT0_OFST 36
-#define MC_CMD_CAPABILITIES_SMALL_BUF_TBL_LBN 0x0 /* enum */
-#define MC_CMD_CAPABILITIES_SMALL_BUF_TBL_WIDTH 0x1 /* enum */
-#define MC_CMD_CAPABILITIES_TURBO_LBN 0x1 /* enum */
-#define MC_CMD_CAPABILITIES_TURBO_WIDTH 0x1 /* enum */
-#define MC_CMD_CAPABILITIES_TURBO_ACTIVE_LBN 0x2 /* enum */
-#define MC_CMD_CAPABILITIES_TURBO_ACTIVE_WIDTH 0x1 /* enum */
-#define MC_CMD_CAPABILITIES_PTP_LBN 0x3 /* enum */
-#define MC_CMD_CAPABILITIES_PTP_WIDTH 0x1 /* enum */
-#define MC_CMD_CAPABILITIES_AOE_LBN 0x4 /* enum */
-#define MC_CMD_CAPABILITIES_AOE_WIDTH 0x1 /* enum */
-#define MC_CMD_CAPABILITIES_AOE_ACTIVE_LBN 0x5 /* enum */
-#define MC_CMD_CAPABILITIES_AOE_ACTIVE_WIDTH 0x1 /* enum */
-#define MC_CMD_CAPABILITIES_FC_ACTIVE_LBN 0x6 /* enum */
-#define MC_CMD_CAPABILITIES_FC_ACTIVE_WIDTH 0x1 /* enum */
+/* See MC_CMD_CAPABILITIES */
#define MC_CMD_GET_BOARD_CFG_OUT_CAPABILITIES_PORT1_OFST 40
-/* Enum values, see field(s): */
-/* CAPABILITIES_PORT0 */
#define MC_CMD_GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT0_OFST 44
#define MC_CMD_GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT0_LEN 6
#define MC_CMD_GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT1_OFST 50
@@ -2945,6 +4338,11 @@
#define MC_CMD_GET_BOARD_CFG_OUT_MAC_COUNT_PORT1_OFST 60
#define MC_CMD_GET_BOARD_CFG_OUT_MAC_STRIDE_PORT0_OFST 64
#define MC_CMD_GET_BOARD_CFG_OUT_MAC_STRIDE_PORT1_OFST 68
+/* This field contains a 16-bit value for each of the types of NVRAM area. The
+ * values are defined in the firmware/mc/platform/.c file for a specific board
+ * type, but otherwise have no meaning to the MC; they are used by the driver
+ * to manage selection of appropriate firmware updates.
+ */
#define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_OFST 72
#define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_LEN 2
#define MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_MINNUM 12
@@ -2952,15 +4350,19 @@
/***********************************/
-/* MC_CMD_DBI_READX
- * Read DBI register(s).
+/* MC_CMD_DBI_READX
+ * Read DBI register(s) -- extended functionality
*/
-#define MC_CMD_DBI_READX 0x19
+#define MC_CMD_DBI_READX 0x19
+#undef MC_CMD_0x19_PRIVILEGE_CTG
+
+#define MC_CMD_0x19_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_DBI_READX_IN msgrequest */
#define MC_CMD_DBI_READX_IN_LENMIN 8
#define MC_CMD_DBI_READX_IN_LENMAX 248
#define MC_CMD_DBI_READX_IN_LEN(num) (0+8*(num))
+/* Each Read op consists of an address (offset 0), VF/CS2) */
#define MC_CMD_DBI_READX_IN_DBIRDOP_OFST 0
#define MC_CMD_DBI_READX_IN_DBIRDOP_LEN 8
#define MC_CMD_DBI_READX_IN_DBIRDOP_LO_OFST 0
@@ -2972,20 +4374,40 @@
#define MC_CMD_DBI_READX_OUT_LENMIN 4
#define MC_CMD_DBI_READX_OUT_LENMAX 252
#define MC_CMD_DBI_READX_OUT_LEN(num) (0+4*(num))
+/* Value */
#define MC_CMD_DBI_READX_OUT_VALUE_OFST 0
#define MC_CMD_DBI_READX_OUT_VALUE_LEN 4
#define MC_CMD_DBI_READX_OUT_VALUE_MINNUM 1
#define MC_CMD_DBI_READX_OUT_VALUE_MAXNUM 63
+/* MC_CMD_DBIRDOP_TYPEDEF structuredef */
+#define MC_CMD_DBIRDOP_TYPEDEF_LEN 8
+#define MC_CMD_DBIRDOP_TYPEDEF_ADDRESS_OFST 0
+#define MC_CMD_DBIRDOP_TYPEDEF_ADDRESS_LBN 0
+#define MC_CMD_DBIRDOP_TYPEDEF_ADDRESS_WIDTH 32
+#define MC_CMD_DBIRDOP_TYPEDEF_PARMS_OFST 4
+#define MC_CMD_DBIRDOP_TYPEDEF_VF_NUM_LBN 16
+#define MC_CMD_DBIRDOP_TYPEDEF_VF_NUM_WIDTH 16
+#define MC_CMD_DBIRDOP_TYPEDEF_VF_ACTIVE_LBN 15
+#define MC_CMD_DBIRDOP_TYPEDEF_VF_ACTIVE_WIDTH 1
+#define MC_CMD_DBIRDOP_TYPEDEF_CS2_LBN 14
+#define MC_CMD_DBIRDOP_TYPEDEF_CS2_WIDTH 1
+#define MC_CMD_DBIRDOP_TYPEDEF_PARMS_LBN 32
+#define MC_CMD_DBIRDOP_TYPEDEF_PARMS_WIDTH 32
+
/***********************************/
-/* MC_CMD_SET_RAND_SEED
+/* MC_CMD_SET_RAND_SEED
* Set the 16byte seed for the MC pseudo-random generator.
*/
-#define MC_CMD_SET_RAND_SEED 0x1a
+#define MC_CMD_SET_RAND_SEED 0x1a
+#undef MC_CMD_0x1a_PRIVILEGE_CTG
+
+#define MC_CMD_0x1a_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_SET_RAND_SEED_IN msgrequest */
#define MC_CMD_SET_RAND_SEED_IN_LEN 16
+/* Seed value. */
#define MC_CMD_SET_RAND_SEED_IN_SEED_OFST 0
#define MC_CMD_SET_RAND_SEED_IN_SEED_LEN 16
@@ -2994,10 +4416,10 @@
/***********************************/
-/* MC_CMD_LTSSM_HIST
- * Retrieve the history of the PCIE LTSSM.
+/* MC_CMD_LTSSM_HIST
+ * Retrieve the history of the LTSSM, if the build supports it.
*/
-#define MC_CMD_LTSSM_HIST 0x1b
+#define MC_CMD_LTSSM_HIST 0x1b
/* MC_CMD_LTSSM_HIST_IN msgrequest */
#define MC_CMD_LTSSM_HIST_IN_LEN 0
@@ -3006,6 +4428,7 @@
#define MC_CMD_LTSSM_HIST_OUT_LENMIN 0
#define MC_CMD_LTSSM_HIST_OUT_LENMAX 252
#define MC_CMD_LTSSM_HIST_OUT_LEN(num) (0+4*(num))
+/* variable number of LTSSM values, as bytes. The history is read-to-clear. */
#define MC_CMD_LTSSM_HIST_OUT_DATA_OFST 0
#define MC_CMD_LTSSM_HIST_OUT_DATA_LEN 4
#define MC_CMD_LTSSM_HIST_OUT_DATA_MINNUM 0
@@ -3013,29 +4436,72 @@
/***********************************/
-/* MC_CMD_DRV_ATTACH
- * Inform MCPU that this port is managed on the host.
+/* MC_CMD_DRV_ATTACH
+ * Inform MCPU that this port is managed on the host (i.e. driver active). For
+ * Huntington, also request the preferred datapath firmware to use if possible
+ * (it may not be possible for this request to be fulfilled; the driver must
+ * issue a subsequent MC_CMD_GET_CAPABILITIES command to determine which
+ * features are actually available). The FIRMWARE_ID field is ignored by older
+ * platforms.
*/
-#define MC_CMD_DRV_ATTACH 0x1c
+#define MC_CMD_DRV_ATTACH 0x1c
+#undef MC_CMD_0x1c_PRIVILEGE_CTG
+
+#define MC_CMD_0x1c_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_DRV_ATTACH_IN msgrequest */
-#define MC_CMD_DRV_ATTACH_IN_LEN 8
+#define MC_CMD_DRV_ATTACH_IN_LEN 12
+/* new state (0=detached, 1=attached) to set if UPDATE=1 */
#define MC_CMD_DRV_ATTACH_IN_NEW_STATE_OFST 0
+/* 1 to set new state, or 0 to just report the existing state */
#define MC_CMD_DRV_ATTACH_IN_UPDATE_OFST 4
+/* preferred datapath firmware (for Huntington; ignored for Siena) */
+#define MC_CMD_DRV_ATTACH_IN_FIRMWARE_ID_OFST 8
+/* enum: Prefer to use full featured firmware */
+#define MC_CMD_FW_FULL_FEATURED 0x0
+/* enum: Prefer to use firmware with fewer features but lower latency */
+#define MC_CMD_FW_LOW_LATENCY 0x1
+/* enum: Prefer to use firmware for SolarCapture packed stream mode */
+#define MC_CMD_FW_PACKED_STREAM 0x2
+/* enum: Prefer to use firmware with fewer features and simpler TX event
+ * batching but higher TX packet rate
+ */
+#define MC_CMD_FW_HIGH_TX_RATE 0x3
+/* enum: Reserved value */
+#define MC_CMD_FW_PACKED_STREAM_HASH_MODE_1 0x4
+/* enum: Only this option is allowed for non-admin functions */
+#define MC_CMD_FW_DONT_CARE 0xffffffff
/* MC_CMD_DRV_ATTACH_OUT msgresponse */
#define MC_CMD_DRV_ATTACH_OUT_LEN 4
+/* previous or existing state (0=detached, 1=attached) */
#define MC_CMD_DRV_ATTACH_OUT_OLD_STATE_OFST 0
+/* MC_CMD_DRV_ATTACH_EXT_OUT msgresponse */
+#define MC_CMD_DRV_ATTACH_EXT_OUT_LEN 8
+/* previous or existing state (0=detached, 1=attached) */
+#define MC_CMD_DRV_ATTACH_EXT_OUT_OLD_STATE_OFST 0
+/* Flags associated with this function */
+#define MC_CMD_DRV_ATTACH_EXT_OUT_FUNC_FLAGS_OFST 4
+/* enum: Labels the lowest-numbered function visible to the OS */
+#define MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_PRIMARY 0x0
+/* enum: The function can control the link state of the physical port it is
+ * bound to.
+ */
+#define MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_LINKCTRL 0x1
+/* enum: The function can perform privileged operations */
+#define MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_TRUSTED 0x2
+
/***********************************/
-/* MC_CMD_SHMUART
+/* MC_CMD_SHMUART
* Route UART output to circular buffer in shared memory instead.
*/
-#define MC_CMD_SHMUART 0x1f
+#define MC_CMD_SHMUART 0x1f
/* MC_CMD_SHMUART_IN msgrequest */
#define MC_CMD_SHMUART_IN_LEN 4
+/* ??? */
#define MC_CMD_SHMUART_IN_FLAG_OFST 0
/* MC_CMD_SHMUART_OUT msgresponse */
@@ -3043,10 +4509,15 @@
/***********************************/
-/* MC_CMD_PORT_RESET
- * Generic per-port reset.
+/* MC_CMD_PORT_RESET
+ * Generic per-port reset. There is no equivalent for per-board reset. Locks
+ * required: None; Return code: 0, ETIME. NOTE: This command is deprecated -
+ * use MC_CMD_ENTITY_RESET instead.
*/
-#define MC_CMD_PORT_RESET 0x20
+#define MC_CMD_PORT_RESET 0x20
+#undef MC_CMD_0x20_PRIVILEGE_CTG
+
+#define MC_CMD_0x20_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_PORT_RESET_IN msgrequest */
#define MC_CMD_PORT_RESET_IN_LEN 0
@@ -3056,14 +4527,38 @@
/***********************************/
-/* MC_CMD_PCIE_CREDITS
+/* MC_CMD_ENTITY_RESET
+ * Generic per-resource reset. There is no equivalent for per-board reset.
+ * Locks required: None; Return code: 0, ETIME. NOTE: This command is an
+ * extended version of the deprecated MC_CMD_PORT_RESET with added fields.
+ */
+#define MC_CMD_ENTITY_RESET 0x20
+/* MC_CMD_0x20_PRIVILEGE_CTG SRIOV_CTG_GENERAL */
+
+/* MC_CMD_ENTITY_RESET_IN msgrequest */
+#define MC_CMD_ENTITY_RESET_IN_LEN 4
+/* Optional flags field. Omitting this will perform a "legacy" reset action
+ * (TBD).
+ */
+#define MC_CMD_ENTITY_RESET_IN_FLAG_OFST 0
+#define MC_CMD_ENTITY_RESET_IN_FUNCTION_RESOURCE_RESET_LBN 0
+#define MC_CMD_ENTITY_RESET_IN_FUNCTION_RESOURCE_RESET_WIDTH 1
+
+/* MC_CMD_ENTITY_RESET_OUT msgresponse */
+#define MC_CMD_ENTITY_RESET_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_PCIE_CREDITS
* Read instantaneous and minimum flow control thresholds.
*/
-#define MC_CMD_PCIE_CREDITS 0x21
+#define MC_CMD_PCIE_CREDITS 0x21
/* MC_CMD_PCIE_CREDITS_IN msgrequest */
#define MC_CMD_PCIE_CREDITS_IN_LEN 8
+/* poll period. 0 is disabled */
#define MC_CMD_PCIE_CREDITS_IN_POLL_PERIOD_OFST 0
+/* wipe statistics */
#define MC_CMD_PCIE_CREDITS_IN_WIPE_OFST 4
/* MC_CMD_PCIE_CREDITS_OUT msgresponse */
@@ -3087,10 +4582,10 @@
/***********************************/
-/* MC_CMD_RXD_MONITOR
+/* MC_CMD_RXD_MONITOR
* Get histogram of RX queue fill level.
*/
-#define MC_CMD_RXD_MONITOR 0x22
+#define MC_CMD_RXD_MONITOR 0x22
/* MC_CMD_RXD_MONITOR_IN msgrequest */
#define MC_CMD_RXD_MONITOR_IN_LEN 12
@@ -3123,10 +4618,13 @@
/***********************************/
-/* MC_CMD_PUTS
- * puts(3) implementation over MCDI
+/* MC_CMD_PUTS
+ * Copy the given ASCII string out onto UART and/or out of the network port.
*/
-#define MC_CMD_PUTS 0x23
+#define MC_CMD_PUTS 0x23
+#undef MC_CMD_0x23_PRIVILEGE_CTG
+
+#define MC_CMD_0x23_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_PUTS_IN msgrequest */
#define MC_CMD_PUTS_IN_LENMIN 13
@@ -3149,16 +4647,21 @@
/***********************************/
-/* MC_CMD_GET_PHY_CFG
- * Report PHY configuration.
+/* MC_CMD_GET_PHY_CFG
+ * Report PHY configuration. This guarantees to succeed even if the PHY is in a
+ * 'zombie' state. Locks required: None
*/
-#define MC_CMD_GET_PHY_CFG 0x24
+#define MC_CMD_GET_PHY_CFG 0x24
+#undef MC_CMD_0x24_PRIVILEGE_CTG
+
+#define MC_CMD_0x24_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_GET_PHY_CFG_IN msgrequest */
#define MC_CMD_GET_PHY_CFG_IN_LEN 0
/* MC_CMD_GET_PHY_CFG_OUT msgresponse */
#define MC_CMD_GET_PHY_CFG_OUT_LEN 72
+/* flags */
#define MC_CMD_GET_PHY_CFG_OUT_FLAGS_OFST 0
#define MC_CMD_GET_PHY_CFG_OUT_PRESENT_LBN 0
#define MC_CMD_GET_PHY_CFG_OUT_PRESENT_WIDTH 1
@@ -3174,7 +4677,9 @@
#define MC_CMD_GET_PHY_CFG_OUT_TXDIS_WIDTH 1
#define MC_CMD_GET_PHY_CFG_OUT_BIST_LBN 6
#define MC_CMD_GET_PHY_CFG_OUT_BIST_WIDTH 1
+/* ?? */
#define MC_CMD_GET_PHY_CFG_OUT_TYPE_OFST 4
+/* Bitmask of supported capabilities */
#define MC_CMD_GET_PHY_CFG_OUT_SUPPORTED_CAP_OFST 8
#define MC_CMD_PHY_CAP_10HDX_LBN 1
#define MC_CMD_PHY_CAP_10HDX_WIDTH 1
@@ -3196,22 +4701,38 @@
#define MC_CMD_PHY_CAP_ASYM_WIDTH 1
#define MC_CMD_PHY_CAP_AN_LBN 10
#define MC_CMD_PHY_CAP_AN_WIDTH 1
+#define MC_CMD_PHY_CAP_40000FDX_LBN 11
+#define MC_CMD_PHY_CAP_40000FDX_WIDTH 1
#define MC_CMD_PHY_CAP_DDM_LBN 12
#define MC_CMD_PHY_CAP_DDM_WIDTH 1
+/* ?? */
#define MC_CMD_GET_PHY_CFG_OUT_CHANNEL_OFST 12
+/* ?? */
#define MC_CMD_GET_PHY_CFG_OUT_PRT_OFST 16
+/* ?? */
#define MC_CMD_GET_PHY_CFG_OUT_STATS_MASK_OFST 20
+/* ?? */
#define MC_CMD_GET_PHY_CFG_OUT_NAME_OFST 24
#define MC_CMD_GET_PHY_CFG_OUT_NAME_LEN 20
+/* ?? */
#define MC_CMD_GET_PHY_CFG_OUT_MEDIA_TYPE_OFST 44
-#define MC_CMD_MEDIA_XAUI 0x1 /* enum */
-#define MC_CMD_MEDIA_CX4 0x2 /* enum */
-#define MC_CMD_MEDIA_KX4 0x3 /* enum */
-#define MC_CMD_MEDIA_XFP 0x4 /* enum */
-#define MC_CMD_MEDIA_SFP_PLUS 0x5 /* enum */
-#define MC_CMD_MEDIA_BASE_T 0x6 /* enum */
+/* enum: Xaui. */
+#define MC_CMD_MEDIA_XAUI 0x1
+/* enum: CX4. */
+#define MC_CMD_MEDIA_CX4 0x2
+/* enum: KX4. */
+#define MC_CMD_MEDIA_KX4 0x3
+/* enum: XFP Far. */
+#define MC_CMD_MEDIA_XFP 0x4
+/* enum: SFP+. */
+#define MC_CMD_MEDIA_SFP_PLUS 0x5
+/* enum: 10GBaseT. */
+#define MC_CMD_MEDIA_BASE_T 0x6
+/* enum: QSFP+. */
+#define MC_CMD_MEDIA_QSFP_PLUS 0x7
#define MC_CMD_GET_PHY_CFG_OUT_MMD_MASK_OFST 48
-#define MC_CMD_MMD_CLAUSE22 0x0 /* enum */
+/* enum: Native clause 22 */
+#define MC_CMD_MMD_CLAUSE22 0x0
#define MC_CMD_MMD_CLAUSE45_PMAPMD 0x1 /* enum */
#define MC_CMD_MMD_CLAUSE45_WIS 0x2 /* enum */
#define MC_CMD_MMD_CLAUSE45_PCS 0x3 /* enum */
@@ -3219,7 +4740,8 @@
#define MC_CMD_MMD_CLAUSE45_DTEXS 0x5 /* enum */
#define MC_CMD_MMD_CLAUSE45_TC 0x6 /* enum */
#define MC_CMD_MMD_CLAUSE45_AN 0x7 /* enum */
-#define MC_CMD_MMD_CLAUSE45_C22EXT 0x1d /* enum */
+/* enum: Clause22 proxied over clause45 by PHY. */
+#define MC_CMD_MMD_CLAUSE45_C22EXT 0x1d
#define MC_CMD_MMD_CLAUSE45_VEND1 0x1e /* enum */
#define MC_CMD_MMD_CLAUSE45_VEND2 0x1f /* enum */
#define MC_CMD_GET_PHY_CFG_OUT_REVISION_OFST 52
@@ -3227,44 +4749,74 @@
/***********************************/
-/* MC_CMD_START_BIST
- * Start a BIST test on the PHY.
+/* MC_CMD_START_BIST
+ * Start a BIST test on the PHY. Locks required: PHY_LOCK if doing a PHY BIST
+ * Return code: 0, EINVAL, EACCES (if PHY_LOCK is not held)
*/
-#define MC_CMD_START_BIST 0x25
+#define MC_CMD_START_BIST 0x25
+#undef MC_CMD_0x25_PRIVILEGE_CTG
+
+#define MC_CMD_0x25_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_START_BIST_IN msgrequest */
#define MC_CMD_START_BIST_IN_LEN 4
+/* Type of test. */
#define MC_CMD_START_BIST_IN_TYPE_OFST 0
-#define MC_CMD_PHY_BIST_CABLE_SHORT 0x1 /* enum */
-#define MC_CMD_PHY_BIST_CABLE_LONG 0x2 /* enum */
-#define MC_CMD_BPX_SERDES_BIST 0x3 /* enum */
-#define MC_CMD_MC_LOOPBACK_BIST 0x4 /* enum */
-#define MC_CMD_PHY_BIST 0x5 /* enum */
+/* enum: Run the PHY's short cable BIST. */
+#define MC_CMD_PHY_BIST_CABLE_SHORT 0x1
+/* enum: Run the PHY's long cable BIST. */
+#define MC_CMD_PHY_BIST_CABLE_LONG 0x2
+/* enum: Run BIST on the currently selected BPX Serdes (XAUI or XFI) . */
+#define MC_CMD_BPX_SERDES_BIST 0x3
+/* enum: Run the MC loopback tests. */
+#define MC_CMD_MC_LOOPBACK_BIST 0x4
+/* enum: Run the PHY's standard BIST. */
+#define MC_CMD_PHY_BIST 0x5
+/* enum: Run MC RAM test. */
+#define MC_CMD_MC_MEM_BIST 0x6
+/* enum: Run Port RAM test. */
+#define MC_CMD_PORT_MEM_BIST 0x7
+/* enum: Run register test. */
+#define MC_CMD_REG_BIST 0x8
/* MC_CMD_START_BIST_OUT msgresponse */
#define MC_CMD_START_BIST_OUT_LEN 0
/***********************************/
-/* MC_CMD_POLL_BIST
- * Poll for BIST completion.
+/* MC_CMD_POLL_BIST
+ * Poll for BIST completion. Returns a single status code, and optionally some
+ * PHY specific bist output. The driver should only consume the BIST output
+ * after validating OUTLEN and MC_CMD_GET_PHY_CFG.TYPE. If a driver can't
+ * successfully parse the BIST output, it should still respect the pass/Fail in
+ * OUT.RESULT. Locks required: PHY_LOCK if doing a PHY BIST. Return code: 0,
+ * EACCES (if PHY_LOCK is not held).
*/
-#define MC_CMD_POLL_BIST 0x26
+#define MC_CMD_POLL_BIST 0x26
+#undef MC_CMD_0x26_PRIVILEGE_CTG
+
+#define MC_CMD_0x26_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_POLL_BIST_IN msgrequest */
#define MC_CMD_POLL_BIST_IN_LEN 0
/* MC_CMD_POLL_BIST_OUT msgresponse */
#define MC_CMD_POLL_BIST_OUT_LEN 8
+/* result */
#define MC_CMD_POLL_BIST_OUT_RESULT_OFST 0
-#define MC_CMD_POLL_BIST_RUNNING 0x1 /* enum */
-#define MC_CMD_POLL_BIST_PASSED 0x2 /* enum */
-#define MC_CMD_POLL_BIST_FAILED 0x3 /* enum */
-#define MC_CMD_POLL_BIST_TIMEOUT 0x4 /* enum */
+/* enum: Running. */
+#define MC_CMD_POLL_BIST_RUNNING 0x1
+/* enum: Passed. */
+#define MC_CMD_POLL_BIST_PASSED 0x2
+/* enum: Failed. */
+#define MC_CMD_POLL_BIST_FAILED 0x3
+/* enum: Timed-out. */
+#define MC_CMD_POLL_BIST_TIMEOUT 0x4
#define MC_CMD_POLL_BIST_OUT_PRIVATE_OFST 4
/* MC_CMD_POLL_BIST_OUT_SFT9001 msgresponse */
#define MC_CMD_POLL_BIST_OUT_SFT9001_LEN 36
+/* result */
/* MC_CMD_POLL_BIST_OUT_RESULT_OFST 0 */
/* Enum values, see field(s): */
/* MC_CMD_POLL_BIST_OUT/MC_CMD_POLL_BIST_OUT_RESULT */
@@ -3272,44 +4824,118 @@
#define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_LENGTH_B_OFST 8
#define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_LENGTH_C_OFST 12
#define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_LENGTH_D_OFST 16
+/* Status of each channel A */
#define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_STATUS_A_OFST 20
-#define MC_CMD_POLL_BIST_SFT9001_PAIR_OK 0x1 /* enum */
-#define MC_CMD_POLL_BIST_SFT9001_PAIR_OPEN 0x2 /* enum */
-#define MC_CMD_POLL_BIST_SFT9001_INTRA_PAIR_SHORT 0x3 /* enum */
-#define MC_CMD_POLL_BIST_SFT9001_INTER_PAIR_SHORT 0x4 /* enum */
-#define MC_CMD_POLL_BIST_SFT9001_PAIR_BUSY 0x9 /* enum */
+/* enum: Ok. */
+#define MC_CMD_POLL_BIST_SFT9001_PAIR_OK 0x1
+/* enum: Open. */
+#define MC_CMD_POLL_BIST_SFT9001_PAIR_OPEN 0x2
+/* enum: Intra-pair short. */
+#define MC_CMD_POLL_BIST_SFT9001_INTRA_PAIR_SHORT 0x3
+/* enum: Inter-pair short. */
+#define MC_CMD_POLL_BIST_SFT9001_INTER_PAIR_SHORT 0x4
+/* enum: Busy. */
+#define MC_CMD_POLL_BIST_SFT9001_PAIR_BUSY 0x9
+/* Status of each channel B */
#define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_STATUS_B_OFST 24
/* Enum values, see field(s): */
/* CABLE_STATUS_A */
+/* Status of each channel C */
#define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_STATUS_C_OFST 28
/* Enum values, see field(s): */
/* CABLE_STATUS_A */
+/* Status of each channel D */
#define MC_CMD_POLL_BIST_OUT_SFT9001_CABLE_STATUS_D_OFST 32
/* Enum values, see field(s): */
/* CABLE_STATUS_A */
/* MC_CMD_POLL_BIST_OUT_MRSFP msgresponse */
#define MC_CMD_POLL_BIST_OUT_MRSFP_LEN 8
+/* result */
/* MC_CMD_POLL_BIST_OUT_RESULT_OFST 0 */
/* Enum values, see field(s): */
/* MC_CMD_POLL_BIST_OUT/MC_CMD_POLL_BIST_OUT_RESULT */
#define MC_CMD_POLL_BIST_OUT_MRSFP_TEST_OFST 4
-#define MC_CMD_POLL_BIST_MRSFP_TEST_COMPLETE 0x0 /* enum */
-#define MC_CMD_POLL_BIST_MRSFP_TEST_BUS_SWITCH_OFF_I2C_WRITE 0x1 /* enum */
-#define MC_CMD_POLL_BIST_MRSFP_TEST_BUS_SWITCH_OFF_I2C_NO_ACCESS_IO_EXP 0x2 /* enum */
-#define MC_CMD_POLL_BIST_MRSFP_TEST_BUS_SWITCH_OFF_I2C_NO_ACCESS_MODULE 0x3 /* enum */
-#define MC_CMD_POLL_BIST_MRSFP_TEST_IO_EXP_I2C_CONFIGURE 0x4 /* enum */
-#define MC_CMD_POLL_BIST_MRSFP_TEST_BUS_SWITCH_I2C_NO_CROSSTALK 0x5 /* enum */
-#define MC_CMD_POLL_BIST_MRSFP_TEST_MODULE_PRESENCE 0x6 /* enum */
-#define MC_CMD_POLL_BIST_MRSFP_TEST_MODULE_ID_I2C_ACCESS 0x7 /* enum */
-#define MC_CMD_POLL_BIST_MRSFP_TEST_MODULE_ID_SANE_VALUE 0x8 /* enum */
+/* enum: Complete. */
+#define MC_CMD_POLL_BIST_MRSFP_TEST_COMPLETE 0x0
+/* enum: Bus switch off I2C write. */
+#define MC_CMD_POLL_BIST_MRSFP_TEST_BUS_SWITCH_OFF_I2C_WRITE 0x1
+/* enum: Bus switch off I2C no access IO exp. */
+#define MC_CMD_POLL_BIST_MRSFP_TEST_BUS_SWITCH_OFF_I2C_NO_ACCESS_IO_EXP 0x2
+/* enum: Bus switch off I2C no access module. */
+#define MC_CMD_POLL_BIST_MRSFP_TEST_BUS_SWITCH_OFF_I2C_NO_ACCESS_MODULE 0x3
+/* enum: IO exp I2C configure. */
+#define MC_CMD_POLL_BIST_MRSFP_TEST_IO_EXP_I2C_CONFIGURE 0x4
+/* enum: Bus switch I2C no cross talk. */
+#define MC_CMD_POLL_BIST_MRSFP_TEST_BUS_SWITCH_I2C_NO_CROSSTALK 0x5
+/* enum: Module presence. */
+#define MC_CMD_POLL_BIST_MRSFP_TEST_MODULE_PRESENCE 0x6
+/* enum: Module ID I2C access. */
+#define MC_CMD_POLL_BIST_MRSFP_TEST_MODULE_ID_I2C_ACCESS 0x7
+/* enum: Module ID sane value. */
+#define MC_CMD_POLL_BIST_MRSFP_TEST_MODULE_ID_SANE_VALUE 0x8
+
+/* MC_CMD_POLL_BIST_OUT_MEM msgresponse */
+#define MC_CMD_POLL_BIST_OUT_MEM_LEN 36
+/* result */
+/* MC_CMD_POLL_BIST_OUT_RESULT_OFST 0 */
+/* Enum values, see field(s): */
+/* MC_CMD_POLL_BIST_OUT/MC_CMD_POLL_BIST_OUT_RESULT */
+#define MC_CMD_POLL_BIST_OUT_MEM_TEST_OFST 4
+/* enum: Test has completed. */
+#define MC_CMD_POLL_BIST_MEM_COMPLETE 0x0
+/* enum: RAM test - walk ones. */
+#define MC_CMD_POLL_BIST_MEM_MEM_WALK_ONES 0x1
+/* enum: RAM test - walk zeros. */
+#define MC_CMD_POLL_BIST_MEM_MEM_WALK_ZEROS 0x2
+/* enum: RAM test - walking inversions zeros/ones. */
+#define MC_CMD_POLL_BIST_MEM_MEM_INV_ZERO_ONE 0x3
+/* enum: RAM test - walking inversions checkerboard. */
+#define MC_CMD_POLL_BIST_MEM_MEM_INV_CHKBOARD 0x4
+/* enum: Register test - set / clear individual bits. */
+#define MC_CMD_POLL_BIST_MEM_REG 0x5
+/* enum: ECC error detected. */
+#define MC_CMD_POLL_BIST_MEM_ECC 0x6
+/* Failure address, only valid if result is POLL_BIST_FAILED */
+#define MC_CMD_POLL_BIST_OUT_MEM_ADDR_OFST 8
+/* Bus or address space to which the failure address corresponds */
+#define MC_CMD_POLL_BIST_OUT_MEM_BUS_OFST 12
+/* enum: MC MIPS bus. */
+#define MC_CMD_POLL_BIST_MEM_BUS_MC 0x0
+/* enum: CSR IREG bus. */
+#define MC_CMD_POLL_BIST_MEM_BUS_CSR 0x1
+/* enum: RX DPCPU bus. */
+#define MC_CMD_POLL_BIST_MEM_BUS_DPCPU_RX 0x2
+/* enum: TX0 DPCPU bus. */
+#define MC_CMD_POLL_BIST_MEM_BUS_DPCPU_TX0 0x3
+/* enum: TX1 DPCPU bus. */
+#define MC_CMD_POLL_BIST_MEM_BUS_DPCPU_TX1 0x4
+/* enum: RX DICPU bus. */
+#define MC_CMD_POLL_BIST_MEM_BUS_DICPU_RX 0x5
+/* enum: TX DICPU bus. */
+#define MC_CMD_POLL_BIST_MEM_BUS_DICPU_TX 0x6
+/* Pattern written to RAM / register */
+#define MC_CMD_POLL_BIST_OUT_MEM_EXPECT_OFST 16
+/* Actual value read from RAM / register */
+#define MC_CMD_POLL_BIST_OUT_MEM_ACTUAL_OFST 20
+/* ECC error mask */
+#define MC_CMD_POLL_BIST_OUT_MEM_ECC_OFST 24
+/* ECC parity error mask */
+#define MC_CMD_POLL_BIST_OUT_MEM_ECC_PARITY_OFST 28
+/* ECC fatal error mask */
+#define MC_CMD_POLL_BIST_OUT_MEM_ECC_FATAL_OFST 32
/***********************************/
-/* MC_CMD_FLUSH_RX_QUEUES
- * Flush receive queue(s).
+/* MC_CMD_FLUSH_RX_QUEUES
+ * Flush receive queue(s). If SRIOV is enabled (via MC_CMD_SRIOV), then RXQ
+ * flushes should be initiated via this MCDI operation, rather than via
+ * directly writing FLUSH_CMD.
+ *
+ * The flush is completed (either done/fail) asynchronously (after this command
+ * returns). The driver must still wait for flush done/failure events as usual.
*/
-#define MC_CMD_FLUSH_RX_QUEUES 0x27
+#define MC_CMD_FLUSH_RX_QUEUES 0x27
/* MC_CMD_FLUSH_RX_QUEUES_IN msgrequest */
#define MC_CMD_FLUSH_RX_QUEUES_IN_LENMIN 4
@@ -3325,82 +4951,156 @@
/***********************************/
-/* MC_CMD_GET_LOOPBACK_MODES
- * Get port's loopback modes.
+/* MC_CMD_GET_LOOPBACK_MODES
+ * Returns a bitmask of loopback modes available at each speed.
*/
-#define MC_CMD_GET_LOOPBACK_MODES 0x28
+#define MC_CMD_GET_LOOPBACK_MODES 0x28
+#undef MC_CMD_0x28_PRIVILEGE_CTG
+
+#define MC_CMD_0x28_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_GET_LOOPBACK_MODES_IN msgrequest */
#define MC_CMD_GET_LOOPBACK_MODES_IN_LEN 0
/* MC_CMD_GET_LOOPBACK_MODES_OUT msgresponse */
-#define MC_CMD_GET_LOOPBACK_MODES_OUT_LEN 32
+#define MC_CMD_GET_LOOPBACK_MODES_OUT_LEN 40
+/* Supported loopbacks. */
#define MC_CMD_GET_LOOPBACK_MODES_OUT_100M_OFST 0
#define MC_CMD_GET_LOOPBACK_MODES_OUT_100M_LEN 8
#define MC_CMD_GET_LOOPBACK_MODES_OUT_100M_LO_OFST 0
#define MC_CMD_GET_LOOPBACK_MODES_OUT_100M_HI_OFST 4
-#define MC_CMD_LOOPBACK_NONE 0x0 /* enum */
-#define MC_CMD_LOOPBACK_DATA 0x1 /* enum */
-#define MC_CMD_LOOPBACK_GMAC 0x2 /* enum */
-#define MC_CMD_LOOPBACK_XGMII 0x3 /* enum */
-#define MC_CMD_LOOPBACK_XGXS 0x4 /* enum */
-#define MC_CMD_LOOPBACK_XAUI 0x5 /* enum */
-#define MC_CMD_LOOPBACK_GMII 0x6 /* enum */
-#define MC_CMD_LOOPBACK_SGMII 0x7 /* enum */
-#define MC_CMD_LOOPBACK_XGBR 0x8 /* enum */
-#define MC_CMD_LOOPBACK_XFI 0x9 /* enum */
-#define MC_CMD_LOOPBACK_XAUI_FAR 0xa /* enum */
-#define MC_CMD_LOOPBACK_GMII_FAR 0xb /* enum */
-#define MC_CMD_LOOPBACK_SGMII_FAR 0xc /* enum */
-#define MC_CMD_LOOPBACK_XFI_FAR 0xd /* enum */
-#define MC_CMD_LOOPBACK_GPHY 0xe /* enum */
-#define MC_CMD_LOOPBACK_PHYXS 0xf /* enum */
-#define MC_CMD_LOOPBACK_PCS 0x10 /* enum */
-#define MC_CMD_LOOPBACK_PMAPMD 0x11 /* enum */
-#define MC_CMD_LOOPBACK_XPORT 0x12 /* enum */
-#define MC_CMD_LOOPBACK_XGMII_WS 0x13 /* enum */
-#define MC_CMD_LOOPBACK_XAUI_WS 0x14 /* enum */
-#define MC_CMD_LOOPBACK_XAUI_WS_FAR 0x15 /* enum */
-#define MC_CMD_LOOPBACK_XAUI_WS_NEAR 0x16 /* enum */
-#define MC_CMD_LOOPBACK_GMII_WS 0x17 /* enum */
-#define MC_CMD_LOOPBACK_XFI_WS 0x18 /* enum */
-#define MC_CMD_LOOPBACK_XFI_WS_FAR 0x19 /* enum */
-#define MC_CMD_LOOPBACK_PHYXS_WS 0x1a /* enum */
-#define MC_CMD_LOOPBACK_AOE_INT_NEAR 0x23 /* enum */
+/* enum: None. */
+#define MC_CMD_LOOPBACK_NONE 0x0
+/* enum: Data. */
+#define MC_CMD_LOOPBACK_DATA 0x1
+/* enum: GMAC. */
+#define MC_CMD_LOOPBACK_GMAC 0x2
+/* enum: XGMII. */
+#define MC_CMD_LOOPBACK_XGMII 0x3
+/* enum: XGXS. */
+#define MC_CMD_LOOPBACK_XGXS 0x4
+/* enum: XAUI. */
+#define MC_CMD_LOOPBACK_XAUI 0x5
+/* enum: GMII. */
+#define MC_CMD_LOOPBACK_GMII 0x6
+/* enum: SGMII. */
+#define MC_CMD_LOOPBACK_SGMII 0x7
+/* enum: XGBR. */
+#define MC_CMD_LOOPBACK_XGBR 0x8
+/* enum: XFI. */
+#define MC_CMD_LOOPBACK_XFI 0x9
+/* enum: XAUI Far. */
+#define MC_CMD_LOOPBACK_XAUI_FAR 0xa
+/* enum: GMII Far. */
+#define MC_CMD_LOOPBACK_GMII_FAR 0xb
+/* enum: SGMII Far. */
+#define MC_CMD_LOOPBACK_SGMII_FAR 0xc
+/* enum: XFI Far. */
+#define MC_CMD_LOOPBACK_XFI_FAR 0xd
+/* enum: GPhy. */
+#define MC_CMD_LOOPBACK_GPHY 0xe
+/* enum: PhyXS. */
+#define MC_CMD_LOOPBACK_PHYXS 0xf
+/* enum: PCS. */
+#define MC_CMD_LOOPBACK_PCS 0x10
+/* enum: PMA-PMD. */
+#define MC_CMD_LOOPBACK_PMAPMD 0x11
+/* enum: Cross-Port. */
+#define MC_CMD_LOOPBACK_XPORT 0x12
+/* enum: XGMII-Wireside. */
+#define MC_CMD_LOOPBACK_XGMII_WS 0x13
+/* enum: XAUI Wireside. */
+#define MC_CMD_LOOPBACK_XAUI_WS 0x14
+/* enum: XAUI Wireside Far. */
+#define MC_CMD_LOOPBACK_XAUI_WS_FAR 0x15
+/* enum: XAUI Wireside near. */
+#define MC_CMD_LOOPBACK_XAUI_WS_NEAR 0x16
+/* enum: GMII Wireside. */
+#define MC_CMD_LOOPBACK_GMII_WS 0x17
+/* enum: XFI Wireside. */
+#define MC_CMD_LOOPBACK_XFI_WS 0x18
+/* enum: XFI Wireside Far. */
+#define MC_CMD_LOOPBACK_XFI_WS_FAR 0x19
+/* enum: PhyXS Wireside. */
+#define MC_CMD_LOOPBACK_PHYXS_WS 0x1a
+/* enum: PMA lanes MAC-Serdes. */
+#define MC_CMD_LOOPBACK_PMA_INT 0x1b
+/* enum: KR Serdes Parallel (Encoder). */
+#define MC_CMD_LOOPBACK_SD_NEAR 0x1c
+/* enum: KR Serdes Serial. */
+#define MC_CMD_LOOPBACK_SD_FAR 0x1d
+/* enum: PMA lanes MAC-Serdes Wireside. */
+#define MC_CMD_LOOPBACK_PMA_INT_WS 0x1e
+/* enum: KR Serdes Parallel Wireside (Full PCS). */
+#define MC_CMD_LOOPBACK_SD_FEP2_WS 0x1f
+/* enum: KR Serdes Parallel Wireside (Sym Aligner to TX). */
+#define MC_CMD_LOOPBACK_SD_FEP1_5_WS 0x20
+/* enum: KR Serdes Parallel Wireside (Deserializer to Serializer). */
+#define MC_CMD_LOOPBACK_SD_FEP_WS 0x21
+/* enum: KR Serdes Serial Wireside. */
+#define MC_CMD_LOOPBACK_SD_FES_WS 0x22
+/* enum: Near side of AOE Siena side port */
+#define MC_CMD_LOOPBACK_AOE_INT_NEAR 0x23
+/* enum: Medford Wireside datapath loopback */
+#define MC_CMD_LOOPBACK_DATA_WS 0x24
+/* enum: Force link up without setting up any physical loopback (snapper use
+ * only)
+ */
+#define MC_CMD_LOOPBACK_FORCE_EXT_LINK 0x25
+/* Supported loopbacks. */
#define MC_CMD_GET_LOOPBACK_MODES_OUT_1G_OFST 8
#define MC_CMD_GET_LOOPBACK_MODES_OUT_1G_LEN 8
#define MC_CMD_GET_LOOPBACK_MODES_OUT_1G_LO_OFST 8
#define MC_CMD_GET_LOOPBACK_MODES_OUT_1G_HI_OFST 12
/* Enum values, see field(s): */
/* 100M */
+/* Supported loopbacks. */
#define MC_CMD_GET_LOOPBACK_MODES_OUT_10G_OFST 16
#define MC_CMD_GET_LOOPBACK_MODES_OUT_10G_LEN 8
#define MC_CMD_GET_LOOPBACK_MODES_OUT_10G_LO_OFST 16
#define MC_CMD_GET_LOOPBACK_MODES_OUT_10G_HI_OFST 20
/* Enum values, see field(s): */
/* 100M */
+/* Supported loopbacks. */
#define MC_CMD_GET_LOOPBACK_MODES_OUT_SUGGESTED_OFST 24
#define MC_CMD_GET_LOOPBACK_MODES_OUT_SUGGESTED_LEN 8
#define MC_CMD_GET_LOOPBACK_MODES_OUT_SUGGESTED_LO_OFST 24
#define MC_CMD_GET_LOOPBACK_MODES_OUT_SUGGESTED_HI_OFST 28
/* Enum values, see field(s): */
/* 100M */
+/* Supported loopbacks. */
+#define MC_CMD_GET_LOOPBACK_MODES_OUT_40G_OFST 32
+#define MC_CMD_GET_LOOPBACK_MODES_OUT_40G_LEN 8
+#define MC_CMD_GET_LOOPBACK_MODES_OUT_40G_LO_OFST 32
+#define MC_CMD_GET_LOOPBACK_MODES_OUT_40G_HI_OFST 36
+/* Enum values, see field(s): */
+/* 100M */
/***********************************/
-/* MC_CMD_GET_LINK
- * Read the unified MAC/PHY link state.
+/* MC_CMD_GET_LINK
+ * Read the unified MAC/PHY link state. Locks required: None Return code: 0,
+ * ETIME.
*/
-#define MC_CMD_GET_LINK 0x29
+#define MC_CMD_GET_LINK 0x29
+#undef MC_CMD_0x29_PRIVILEGE_CTG
+
+#define MC_CMD_0x29_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_GET_LINK_IN msgrequest */
#define MC_CMD_GET_LINK_IN_LEN 0
/* MC_CMD_GET_LINK_OUT msgresponse */
#define MC_CMD_GET_LINK_OUT_LEN 28
+/* near-side advertised capabilities */
#define MC_CMD_GET_LINK_OUT_CAP_OFST 0
+/* link-partner advertised capabilities */
#define MC_CMD_GET_LINK_OUT_LP_CAP_OFST 4
+/* Autonegotiated speed in mbit/s. The link may still be down even if this
+ * reads non-zero.
+ */
#define MC_CMD_GET_LINK_OUT_LINK_SPEED_OFST 8
+/* Current loopback setting. */
#define MC_CMD_GET_LINK_OUT_LOOPBACK_MODE_OFST 12
/* Enum values, see field(s): */
/* MC_CMD_GET_LOOPBACK_MODES/MC_CMD_GET_LOOPBACK_MODES_OUT/100M */
@@ -3417,10 +5117,10 @@
#define MC_CMD_GET_LINK_OUT_LINK_FAULT_RX_WIDTH 1
#define MC_CMD_GET_LINK_OUT_LINK_FAULT_TX_LBN 7
#define MC_CMD_GET_LINK_OUT_LINK_FAULT_TX_WIDTH 1
+/* This returns the negotiated flow control value. */
#define MC_CMD_GET_LINK_OUT_FCNTL_OFST 20
-#define MC_CMD_FCNTL_OFF 0x0 /* enum */
-#define MC_CMD_FCNTL_RESPOND 0x1 /* enum */
-#define MC_CMD_FCNTL_BIDIR 0x2 /* enum */
+/* Enum values, see field(s): */
+/* MC_CMD_SET_MAC/MC_CMD_SET_MAC_IN/FCNTL */
#define MC_CMD_GET_LINK_OUT_MAC_FAULT_OFST 24
#define MC_CMD_MAC_FAULT_XGMII_LOCAL_LBN 0
#define MC_CMD_MAC_FAULT_XGMII_LOCAL_WIDTH 1
@@ -3433,14 +5133,20 @@
/***********************************/
-/* MC_CMD_SET_LINK
- * Write the unified MAC/PHY link configuration.
+/* MC_CMD_SET_LINK
+ * Write the unified MAC/PHY link configuration. Locks required: None. Return
+ * code: 0, EINVAL, ETIME
*/
-#define MC_CMD_SET_LINK 0x2a
+#define MC_CMD_SET_LINK 0x2a
+#undef MC_CMD_0x2a_PRIVILEGE_CTG
+
+#define MC_CMD_0x2a_PRIVILEGE_CTG SRIOV_CTG_LINK
/* MC_CMD_SET_LINK_IN msgrequest */
#define MC_CMD_SET_LINK_IN_LEN 16
+/* ??? */
#define MC_CMD_SET_LINK_IN_CAP_OFST 0
+/* Flags */
#define MC_CMD_SET_LINK_IN_FLAGS_OFST 4
#define MC_CMD_SET_LINK_IN_LOWPOWER_LBN 0
#define MC_CMD_SET_LINK_IN_LOWPOWER_WIDTH 1
@@ -3448,9 +5154,13 @@
#define MC_CMD_SET_LINK_IN_POWEROFF_WIDTH 1
#define MC_CMD_SET_LINK_IN_TXDIS_LBN 2
#define MC_CMD_SET_LINK_IN_TXDIS_WIDTH 1
+/* Loopback mode. */
#define MC_CMD_SET_LINK_IN_LOOPBACK_MODE_OFST 8
/* Enum values, see field(s): */
/* MC_CMD_GET_LOOPBACK_MODES/MC_CMD_GET_LOOPBACK_MODES_OUT/100M */
+/* A loopback speed of "0" is supported, and means (choose any available
+ * speed).
+ */
#define MC_CMD_SET_LINK_IN_LOOPBACK_SPEED_OFST 12
/* MC_CMD_SET_LINK_OUT msgresponse */
@@ -3458,13 +5168,17 @@
/***********************************/
-/* MC_CMD_SET_ID_LED
- * Set indentification LED state.
+/* MC_CMD_SET_ID_LED
+ * Set identification LED state. Locks required: None. Return code: 0, EINVAL
*/
-#define MC_CMD_SET_ID_LED 0x2b
+#define MC_CMD_SET_ID_LED 0x2b
+#undef MC_CMD_0x2b_PRIVILEGE_CTG
+
+#define MC_CMD_0x2b_PRIVILEGE_CTG SRIOV_CTG_LINK
/* MC_CMD_SET_ID_LED_IN msgrequest */
#define MC_CMD_SET_ID_LED_IN_LEN 4
+/* Set LED state. */
#define MC_CMD_SET_ID_LED_IN_STATE_OFST 0
#define MC_CMD_LED_OFF 0x0 /* enum */
#define MC_CMD_LED_ON 0x1 /* enum */
@@ -3475,13 +5189,19 @@
/***********************************/
-/* MC_CMD_SET_MAC
- * Set MAC configuration.
+/* MC_CMD_SET_MAC
+ * Set MAC configuration. Locks required: None. Return code: 0, EINVAL
*/
-#define MC_CMD_SET_MAC 0x2c
+#define MC_CMD_SET_MAC 0x2c
+#undef MC_CMD_0x2c_PRIVILEGE_CTG
+
+#define MC_CMD_0x2c_PRIVILEGE_CTG SRIOV_CTG_LINK
/* MC_CMD_SET_MAC_IN msgrequest */
-#define MC_CMD_SET_MAC_IN_LEN 24
+#define MC_CMD_SET_MAC_IN_LEN 28
+/* The MTU is the MTU programmed directly into the XMAC/GMAC (inclusive of
+ * EtherII, VLAN, bug16011 padding).
+ */
#define MC_CMD_SET_MAC_IN_MTU_OFST 0
#define MC_CMD_SET_MAC_IN_DRAIN_OFST 4
#define MC_CMD_SET_MAC_IN_ADDR_OFST 8
@@ -3494,23 +5214,43 @@
#define MC_CMD_SET_MAC_IN_REJECT_BRDCST_LBN 1
#define MC_CMD_SET_MAC_IN_REJECT_BRDCST_WIDTH 1
#define MC_CMD_SET_MAC_IN_FCNTL_OFST 20
-/* MC_CMD_FCNTL_OFF 0x0 */
-/* MC_CMD_FCNTL_RESPOND 0x1 */
-/* MC_CMD_FCNTL_BIDIR 0x2 */
-#define MC_CMD_FCNTL_AUTO 0x3 /* enum */
+/* enum: Flow control is off. */
+#define MC_CMD_FCNTL_OFF 0x0
+/* enum: Respond to flow control. */
+#define MC_CMD_FCNTL_RESPOND 0x1
+/* enum: Respond to and Issue flow control. */
+#define MC_CMD_FCNTL_BIDIR 0x2
+/* enum: Auto neg flow control. */
+#define MC_CMD_FCNTL_AUTO 0x3
+/* enum: Priority flow control (eftest builds only). */
+#define MC_CMD_FCNTL_QBB 0x4
+/* enum: Issue flow control. */
+#define MC_CMD_FCNTL_GENERATE 0x5
+#define MC_CMD_SET_MAC_IN_FLAGS_OFST 24
+#define MC_CMD_SET_MAC_IN_FLAG_INCLUDE_FCS_LBN 0
+#define MC_CMD_SET_MAC_IN_FLAG_INCLUDE_FCS_WIDTH 1
/* MC_CMD_SET_MAC_OUT msgresponse */
#define MC_CMD_SET_MAC_OUT_LEN 0
/***********************************/
-/* MC_CMD_PHY_STATS
- * Get generic PHY statistics.
+/* MC_CMD_PHY_STATS
+ * Get generic PHY statistics. This call returns the statistics for a generic
+ * PHY in a sparse array (indexed by the enumerate). Each value is represented
+ * by a 32bit number. If the DMA_ADDR is 0, then no DMA is performed, and the
+ * statistics may be read from the message response. If DMA_ADDR != 0, then the
+ * statistics are dmad to that (page-aligned location). Locks required: None.
+ * Returns: 0, ETIME
*/
-#define MC_CMD_PHY_STATS 0x2d
+#define MC_CMD_PHY_STATS 0x2d
+#undef MC_CMD_0x2d_PRIVILEGE_CTG
+
+#define MC_CMD_0x2d_PRIVILEGE_CTG SRIOV_CTG_LINK
/* MC_CMD_PHY_STATS_IN msgrequest */
#define MC_CMD_PHY_STATS_IN_LEN 8
+/* ??? */
#define MC_CMD_PHY_STATS_IN_DMA_ADDR_OFST 0
#define MC_CMD_PHY_STATS_IN_DMA_ADDR_LEN 8
#define MC_CMD_PHY_STATS_IN_DMA_ADDR_LO_OFST 0
@@ -3524,40 +5264,75 @@
#define MC_CMD_PHY_STATS_OUT_NO_DMA_STATISTICS_OFST 0
#define MC_CMD_PHY_STATS_OUT_NO_DMA_STATISTICS_LEN 4
#define MC_CMD_PHY_STATS_OUT_NO_DMA_STATISTICS_NUM MC_CMD_PHY_NSTATS
-#define MC_CMD_OUI 0x0 /* enum */
-#define MC_CMD_PMA_PMD_LINK_UP 0x1 /* enum */
-#define MC_CMD_PMA_PMD_RX_FAULT 0x2 /* enum */
-#define MC_CMD_PMA_PMD_TX_FAULT 0x3 /* enum */
-#define MC_CMD_PMA_PMD_SIGNAL 0x4 /* enum */
-#define MC_CMD_PMA_PMD_SNR_A 0x5 /* enum */
-#define MC_CMD_PMA_PMD_SNR_B 0x6 /* enum */
-#define MC_CMD_PMA_PMD_SNR_C 0x7 /* enum */
-#define MC_CMD_PMA_PMD_SNR_D 0x8 /* enum */
-#define MC_CMD_PCS_LINK_UP 0x9 /* enum */
-#define MC_CMD_PCS_RX_FAULT 0xa /* enum */
-#define MC_CMD_PCS_TX_FAULT 0xb /* enum */
-#define MC_CMD_PCS_BER 0xc /* enum */
-#define MC_CMD_PCS_BLOCK_ERRORS 0xd /* enum */
-#define MC_CMD_PHYXS_LINK_UP 0xe /* enum */
-#define MC_CMD_PHYXS_RX_FAULT 0xf /* enum */
-#define MC_CMD_PHYXS_TX_FAULT 0x10 /* enum */
-#define MC_CMD_PHYXS_ALIGN 0x11 /* enum */
-#define MC_CMD_PHYXS_SYNC 0x12 /* enum */
-#define MC_CMD_AN_LINK_UP 0x13 /* enum */
-#define MC_CMD_AN_COMPLETE 0x14 /* enum */
-#define MC_CMD_AN_10GBT_STATUS 0x15 /* enum */
-#define MC_CMD_CL22_LINK_UP 0x16 /* enum */
-#define MC_CMD_PHY_NSTATS 0x17 /* enum */
-
-
-/***********************************/
-/* MC_CMD_MAC_STATS
- * Get generic MAC statistics.
- */
-#define MC_CMD_MAC_STATS 0x2e
+/* enum: OUI. */
+#define MC_CMD_OUI 0x0
+/* enum: PMA-PMD Link Up. */
+#define MC_CMD_PMA_PMD_LINK_UP 0x1
+/* enum: PMA-PMD RX Fault. */
+#define MC_CMD_PMA_PMD_RX_FAULT 0x2
+/* enum: PMA-PMD TX Fault. */
+#define MC_CMD_PMA_PMD_TX_FAULT 0x3
+/* enum: PMA-PMD Signal */
+#define MC_CMD_PMA_PMD_SIGNAL 0x4
+/* enum: PMA-PMD SNR A. */
+#define MC_CMD_PMA_PMD_SNR_A 0x5
+/* enum: PMA-PMD SNR B. */
+#define MC_CMD_PMA_PMD_SNR_B 0x6
+/* enum: PMA-PMD SNR C. */
+#define MC_CMD_PMA_PMD_SNR_C 0x7
+/* enum: PMA-PMD SNR D. */
+#define MC_CMD_PMA_PMD_SNR_D 0x8
+/* enum: PCS Link Up. */
+#define MC_CMD_PCS_LINK_UP 0x9
+/* enum: PCS RX Fault. */
+#define MC_CMD_PCS_RX_FAULT 0xa
+/* enum: PCS TX Fault. */
+#define MC_CMD_PCS_TX_FAULT 0xb
+/* enum: PCS BER. */
+#define MC_CMD_PCS_BER 0xc
+/* enum: PCS Block Errors. */
+#define MC_CMD_PCS_BLOCK_ERRORS 0xd
+/* enum: PhyXS Link Up. */
+#define MC_CMD_PHYXS_LINK_UP 0xe
+/* enum: PhyXS RX Fault. */
+#define MC_CMD_PHYXS_RX_FAULT 0xf
+/* enum: PhyXS TX Fault. */
+#define MC_CMD_PHYXS_TX_FAULT 0x10
+/* enum: PhyXS Align. */
+#define MC_CMD_PHYXS_ALIGN 0x11
+/* enum: PhyXS Sync. */
+#define MC_CMD_PHYXS_SYNC 0x12
+/* enum: AN link-up. */
+#define MC_CMD_AN_LINK_UP 0x13
+/* enum: AN Complete. */
+#define MC_CMD_AN_COMPLETE 0x14
+/* enum: AN 10GBaseT Status. */
+#define MC_CMD_AN_10GBT_STATUS 0x15
+/* enum: Clause 22 Link-Up. */
+#define MC_CMD_CL22_LINK_UP 0x16
+/* enum: (Last entry) */
+#define MC_CMD_PHY_NSTATS 0x17
+
+
+/***********************************/
+/* MC_CMD_MAC_STATS
+ * Get generic MAC statistics. This call returns unified statistics maintained
+ * by the MC as it switches between the GMAC and XMAC. The MC will write out
+ * all supported stats. The driver should zero initialise the buffer to
+ * guarantee consistent results. If the DMA_ADDR is 0, then no DMA is
+ * performed, and the statistics may be read from the message response. If
+ * DMA_ADDR != 0, then the statistics are dmad to that (page-aligned location).
+ * Locks required: None. The PERIODIC_CLEAR option is not used and now has no
+ * effect. Returns: 0, ETIME
+ */
+#define MC_CMD_MAC_STATS 0x2e
+#undef MC_CMD_0x2e_PRIVILEGE_CTG
+
+#define MC_CMD_0x2e_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_MAC_STATS_IN msgrequest */
-#define MC_CMD_MAC_STATS_IN_LEN 16
+#define MC_CMD_MAC_STATS_IN_LEN 20
+/* ??? */
#define MC_CMD_MAC_STATS_IN_DMA_ADDR_OFST 0
#define MC_CMD_MAC_STATS_IN_DMA_ADDR_LEN 8
#define MC_CMD_MAC_STATS_IN_DMA_ADDR_LO_OFST 0
@@ -3578,6 +5353,8 @@
#define MC_CMD_MAC_STATS_IN_PERIOD_MS_LBN 16
#define MC_CMD_MAC_STATS_IN_PERIOD_MS_WIDTH 16
#define MC_CMD_MAC_STATS_IN_DMA_LEN_OFST 12
+/* port id so vadapter stats can be provided */
+#define MC_CMD_MAC_STATS_IN_PORT_ID_OFST 16
/* MC_CMD_MAC_STATS_OUT_DMA msgresponse */
#define MC_CMD_MAC_STATS_OUT_DMA_LEN 0
@@ -3590,6 +5367,7 @@
#define MC_CMD_MAC_STATS_OUT_NO_DMA_STATISTICS_HI_OFST 4
#define MC_CMD_MAC_STATS_OUT_NO_DMA_STATISTICS_NUM MC_CMD_MAC_NSTATS
#define MC_CMD_MAC_GENERATION_START 0x0 /* enum */
+#define MC_CMD_MAC_DMABUF_START 0x1 /* enum */
#define MC_CMD_MAC_TX_PKTS 0x1 /* enum */
#define MC_CMD_MAC_TX_PAUSE_PKTS 0x2 /* enum */
#define MC_CMD_MAC_TX_CONTROL_PKTS 0x3 /* enum */
@@ -3649,17 +5427,87 @@
#define MC_CMD_MAC_RX_LANES01_DISP_ERR 0x39 /* enum */
#define MC_CMD_MAC_RX_LANES23_DISP_ERR 0x3a /* enum */
#define MC_CMD_MAC_RX_MATCH_FAULT 0x3b /* enum */
-#define MC_CMD_GMAC_DMABUF_START 0x40 /* enum */
-#define MC_CMD_GMAC_DMABUF_END 0x5f /* enum */
+/* enum: PM trunc_bb_overflow counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
+ * capability only.
+ */
+#define MC_CMD_MAC_PM_TRUNC_BB_OVERFLOW 0x3c
+/* enum: PM discard_bb_overflow counter. Valid for EF10 with
+ * PM_AND_RXDP_COUNTERS capability only.
+ */
+#define MC_CMD_MAC_PM_DISCARD_BB_OVERFLOW 0x3d
+/* enum: PM trunc_vfifo_full counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
+ * capability only.
+ */
+#define MC_CMD_MAC_PM_TRUNC_VFIFO_FULL 0x3e
+/* enum: PM discard_vfifo_full counter. Valid for EF10 with
+ * PM_AND_RXDP_COUNTERS capability only.
+ */
+#define MC_CMD_MAC_PM_DISCARD_VFIFO_FULL 0x3f
+/* enum: PM trunc_qbb counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
+ * capability only.
+ */
+#define MC_CMD_MAC_PM_TRUNC_QBB 0x40
+/* enum: PM discard_qbb counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
+ * capability only.
+ */
+#define MC_CMD_MAC_PM_DISCARD_QBB 0x41
+/* enum: PM discard_mapping counter. Valid for EF10 with PM_AND_RXDP_COUNTERS
+ * capability only.
+ */
+#define MC_CMD_MAC_PM_DISCARD_MAPPING 0x42
+/* enum: RXDP counter: Number of packets dropped due to the queue being
+ * disabled. Valid for EF10 with PM_AND_RXDP_COUNTERS capability only.
+ */
+#define MC_CMD_MAC_RXDP_Q_DISABLED_PKTS 0x43
+/* enum: RXDP counter: Number of packets dropped by the DICPU. Valid for EF10
+ * with PM_AND_RXDP_COUNTERS capability only.
+ */
+#define MC_CMD_MAC_RXDP_DI_DROPPED_PKTS 0x45
+/* enum: RXDP counter: Number of non-host packets. Valid for EF10 with
+ * PM_AND_RXDP_COUNTERS capability only.
+ */
+#define MC_CMD_MAC_RXDP_STREAMING_PKTS 0x46
+/* enum: RXDP counter: Number of times an hlb descriptor fetch was performed.
+ * Valid for EF10 with PM_AND_RXDP_COUNTERS capability only.
+ */
+#define MC_CMD_MAC_RXDP_HLB_FETCH_CONDITIONS 0x47
+/* enum: RXDP counter: Number of times the DPCPU waited for an existing
+ * descriptor fetch. Valid for EF10 with PM_AND_RXDP_COUNTERS capability only.
+ */
+#define MC_CMD_MAC_RXDP_HLB_WAIT_CONDITIONS 0x48
+#define MC_CMD_MAC_VADAPTER_RX_DMABUF_START 0x4c /* enum */
+#define MC_CMD_MAC_VADAPTER_RX_UNICAST_PACKETS 0x4c /* enum */
+#define MC_CMD_MAC_VADAPTER_RX_UNICAST_BYTES 0x4d /* enum */
+#define MC_CMD_MAC_VADAPTER_RX_MULTICAST_PACKETS 0x4e /* enum */
+#define MC_CMD_MAC_VADAPTER_RX_MULTICAST_BYTES 0x4f /* enum */
+#define MC_CMD_MAC_VADAPTER_RX_BROADCAST_PACKETS 0x50 /* enum */
+#define MC_CMD_MAC_VADAPTER_RX_BROADCAST_BYTES 0x51 /* enum */
+#define MC_CMD_MAC_VADAPTER_RX_BAD_PACKETS 0x52 /* enum */
+#define MC_CMD_MAC_VADAPTER_RX_BAD_BYTES 0x53 /* enum */
+#define MC_CMD_MAC_VADAPTER_RX_OVERFLOW 0x54 /* enum */
+#define MC_CMD_MAC_VADAPTER_TX_DMABUF_START 0x57 /* enum */
+#define MC_CMD_MAC_VADAPTER_TX_UNICAST_PACKETS 0x57 /* enum */
+#define MC_CMD_MAC_VADAPTER_TX_UNICAST_BYTES 0x58 /* enum */
+#define MC_CMD_MAC_VADAPTER_TX_MULTICAST_PACKETS 0x59 /* enum */
+#define MC_CMD_MAC_VADAPTER_TX_MULTICAST_BYTES 0x5a /* enum */
+#define MC_CMD_MAC_VADAPTER_TX_BROADCAST_PACKETS 0x5b /* enum */
+#define MC_CMD_MAC_VADAPTER_TX_BROADCAST_BYTES 0x5c /* enum */
+#define MC_CMD_MAC_VADAPTER_TX_BAD_PACKETS 0x5d /* enum */
+#define MC_CMD_MAC_VADAPTER_TX_BAD_BYTES 0x5e /* enum */
+#define MC_CMD_MAC_VADAPTER_TX_OVERFLOW 0x5f /* enum */
+/* enum: Start of GMAC stats buffer space, for Siena only. */
+#define MC_CMD_GMAC_DMABUF_START 0x40
+/* enum: End of GMAC stats buffer space, for Siena only. */
+#define MC_CMD_GMAC_DMABUF_END 0x5f
#define MC_CMD_MAC_GENERATION_END 0x60 /* enum */
#define MC_CMD_MAC_NSTATS 0x61 /* enum */
/***********************************/
-/* MC_CMD_SRIOV
+/* MC_CMD_SRIOV
* to be documented
*/
-#define MC_CMD_SRIOV 0x30
+#define MC_CMD_SRIOV 0x30
/* MC_CMD_SRIOV_IN msgrequest */
#define MC_CMD_SRIOV_IN_LEN 12
@@ -3674,6 +5522,7 @@
/* MC_CMD_MEMCPY_RECORD_TYPEDEF structuredef */
#define MC_CMD_MEMCPY_RECORD_TYPEDEF_LEN 32
+/* this is only used for the first record */
#define MC_CMD_MEMCPY_RECORD_TYPEDEF_NUM_RECORDS_OFST 0
#define MC_CMD_MEMCPY_RECORD_TYPEDEF_NUM_RECORDS_LBN 0
#define MC_CMD_MEMCPY_RECORD_TYPEDEF_NUM_RECORDS_WIDTH 32
@@ -3702,15 +5551,32 @@
/***********************************/
-/* MC_CMD_MEMCPY
- * Perform memory copy operation.
+/* MC_CMD_MEMCPY
+ * DMA write data into (Rid,Addr), either by dma reading (Rid,Addr), or by data
+ * embedded directly in the command.
+ *
+ * A common pattern is for a client to use generation counts to signal a dma
+ * update of a datastructure. To facilitate this, this MCDI operation can
+ * contain multiple requests which are executed in strict order. Requests take
+ * the form of duplicating the entire MCDI request continuously (including the
+ * requests record, which is ignored in all but the first structure)
+ *
+ * The source data can either come from a DMA from the host, or it can be
+ * embedded within the request directly, thereby eliminating a DMA read. To
+ * indicate this, the client sets FROM_RID=%RID_INLINE, ADDR_HI=0, and
+ * ADDR_LO=offset, and inserts the data at %offset from the start of the
+ * payload. It's the callers responsibility to ensure that the embedded data
+ * doesn't overlap the records.
+ *
+ * Returns: 0, EINVAL (invalid RID)
*/
-#define MC_CMD_MEMCPY 0x31
+#define MC_CMD_MEMCPY 0x31
/* MC_CMD_MEMCPY_IN msgrequest */
#define MC_CMD_MEMCPY_IN_LENMIN 32
#define MC_CMD_MEMCPY_IN_LENMAX 224
#define MC_CMD_MEMCPY_IN_LEN(num) (0+32*(num))
+/* see MC_CMD_MEMCPY_RECORD_TYPEDEF */
#define MC_CMD_MEMCPY_IN_RECORD_OFST 0
#define MC_CMD_MEMCPY_IN_RECORD_LEN 32
#define MC_CMD_MEMCPY_IN_RECORD_MINNUM 1
@@ -3721,24 +5587,35 @@
/***********************************/
-/* MC_CMD_WOL_FILTER_SET
+/* MC_CMD_WOL_FILTER_SET
* Set a WoL filter.
*/
-#define MC_CMD_WOL_FILTER_SET 0x32
+#define MC_CMD_WOL_FILTER_SET 0x32
+#undef MC_CMD_0x32_PRIVILEGE_CTG
+
+#define MC_CMD_0x32_PRIVILEGE_CTG SRIOV_CTG_LINK
/* MC_CMD_WOL_FILTER_SET_IN msgrequest */
#define MC_CMD_WOL_FILTER_SET_IN_LEN 192
#define MC_CMD_WOL_FILTER_SET_IN_FILTER_MODE_OFST 0
#define MC_CMD_FILTER_MODE_SIMPLE 0x0 /* enum */
#define MC_CMD_FILTER_MODE_STRUCTURED 0xffffffff /* enum */
+/* A type value of 1 is unused. */
#define MC_CMD_WOL_FILTER_SET_IN_WOL_TYPE_OFST 4
-#define MC_CMD_WOL_TYPE_MAGIC 0x0 /* enum */
-#define MC_CMD_WOL_TYPE_WIN_MAGIC 0x2 /* enum */
-#define MC_CMD_WOL_TYPE_IPV4_SYN 0x3 /* enum */
-#define MC_CMD_WOL_TYPE_IPV6_SYN 0x4 /* enum */
-#define MC_CMD_WOL_TYPE_BITMAP 0x5 /* enum */
-#define MC_CMD_WOL_TYPE_LINK 0x6 /* enum */
-#define MC_CMD_WOL_TYPE_MAX 0x7 /* enum */
+/* enum: Magic */
+#define MC_CMD_WOL_TYPE_MAGIC 0x0
+/* enum: MS Windows Magic */
+#define MC_CMD_WOL_TYPE_WIN_MAGIC 0x2
+/* enum: IPv4 Syn */
+#define MC_CMD_WOL_TYPE_IPV4_SYN 0x3
+/* enum: IPv6 Syn */
+#define MC_CMD_WOL_TYPE_IPV6_SYN 0x4
+/* enum: Bitmap */
+#define MC_CMD_WOL_TYPE_BITMAP 0x5
+/* enum: Link */
+#define MC_CMD_WOL_TYPE_LINK 0x6
+/* enum: (Above this for future use) */
+#define MC_CMD_WOL_TYPE_MAX 0x7
#define MC_CMD_WOL_FILTER_SET_IN_DATA_OFST 8
#define MC_CMD_WOL_FILTER_SET_IN_DATA_LEN 4
#define MC_CMD_WOL_FILTER_SET_IN_DATA_NUM 46
@@ -3807,10 +5684,13 @@
/***********************************/
-/* MC_CMD_WOL_FILTER_REMOVE
- * Remove a WoL filter.
+/* MC_CMD_WOL_FILTER_REMOVE
+ * Remove a WoL filter. Locks required: None. Returns: 0, EINVAL, ENOSYS
*/
-#define MC_CMD_WOL_FILTER_REMOVE 0x33
+#define MC_CMD_WOL_FILTER_REMOVE 0x33
+#undef MC_CMD_0x33_PRIVILEGE_CTG
+
+#define MC_CMD_0x33_PRIVILEGE_CTG SRIOV_CTG_LINK
/* MC_CMD_WOL_FILTER_REMOVE_IN msgrequest */
#define MC_CMD_WOL_FILTER_REMOVE_IN_LEN 4
@@ -3821,10 +5701,14 @@
/***********************************/
-/* MC_CMD_WOL_FILTER_RESET
- * Reset (i.e. remove all) WoL filters.
+/* MC_CMD_WOL_FILTER_RESET
+ * Reset (i.e. remove all) WoL filters. Locks required: None. Returns: 0,
+ * ENOSYS
*/
-#define MC_CMD_WOL_FILTER_RESET 0x34
+#define MC_CMD_WOL_FILTER_RESET 0x34
+#undef MC_CMD_0x34_PRIVILEGE_CTG
+
+#define MC_CMD_0x34_PRIVILEGE_CTG SRIOV_CTG_LINK
/* MC_CMD_WOL_FILTER_RESET_IN msgrequest */
#define MC_CMD_WOL_FILTER_RESET_IN_LEN 4
@@ -3837,10 +5721,10 @@
/***********************************/
-/* MC_CMD_SET_MCAST_HASH
- * Set the MCASH hash value.
+/* MC_CMD_SET_MCAST_HASH
+ * Set the MCAST hash value without otherwise reconfiguring the MAC
*/
-#define MC_CMD_SET_MCAST_HASH 0x35
+#define MC_CMD_SET_MCAST_HASH 0x35
/* MC_CMD_SET_MCAST_HASH_IN msgrequest */
#define MC_CMD_SET_MCAST_HASH_IN_LEN 32
@@ -3854,45 +5738,75 @@
/***********************************/
-/* MC_CMD_NVRAM_TYPES
- * Get virtual NVRAM partitions information.
+/* MC_CMD_NVRAM_TYPES
+ * Return bitfield indicating available types of virtual NVRAM partitions.
+ * Locks required: none. Returns: 0
*/
-#define MC_CMD_NVRAM_TYPES 0x36
+#define MC_CMD_NVRAM_TYPES 0x36
+#undef MC_CMD_0x36_PRIVILEGE_CTG
+
+#define MC_CMD_0x36_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_NVRAM_TYPES_IN msgrequest */
#define MC_CMD_NVRAM_TYPES_IN_LEN 0
/* MC_CMD_NVRAM_TYPES_OUT msgresponse */
#define MC_CMD_NVRAM_TYPES_OUT_LEN 4
+/* Bit mask of supported types. */
#define MC_CMD_NVRAM_TYPES_OUT_TYPES_OFST 0
-#define MC_CMD_NVRAM_TYPE_DISABLED_CALLISTO 0x0 /* enum */
-#define MC_CMD_NVRAM_TYPE_MC_FW 0x1 /* enum */
-#define MC_CMD_NVRAM_TYPE_MC_FW_BACKUP 0x2 /* enum */
-#define MC_CMD_NVRAM_TYPE_STATIC_CFG_PORT0 0x3 /* enum */
-#define MC_CMD_NVRAM_TYPE_STATIC_CFG_PORT1 0x4 /* enum */
-#define MC_CMD_NVRAM_TYPE_DYNAMIC_CFG_PORT0 0x5 /* enum */
-#define MC_CMD_NVRAM_TYPE_DYNAMIC_CFG_PORT1 0x6 /* enum */
-#define MC_CMD_NVRAM_TYPE_EXP_ROM 0x7 /* enum */
-#define MC_CMD_NVRAM_TYPE_EXP_ROM_CFG_PORT0 0x8 /* enum */
-#define MC_CMD_NVRAM_TYPE_EXP_ROM_CFG_PORT1 0x9 /* enum */
-#define MC_CMD_NVRAM_TYPE_PHY_PORT0 0xa /* enum */
-#define MC_CMD_NVRAM_TYPE_PHY_PORT1 0xb /* enum */
-#define MC_CMD_NVRAM_TYPE_LOG 0xc /* enum */
-#define MC_CMD_NVRAM_TYPE_FPGA 0xd /* enum */
-#define MC_CMD_NVRAM_TYPE_FPGA_BACKUP 0xe /* enum */
-#define MC_CMD_NVRAM_TYPE_FC_FW 0xf /* enum */
-#define MC_CMD_NVRAM_TYPE_FC_FW_BACKUP 0x10 /* enum */
-#define MC_CMD_NVRAM_TYPE_CPLD 0x11 /* enum */
-#define MC_CMD_NVRAM_TYPE_LICENSE 0x12 /* enum */
-#define MC_CMD_NVRAM_TYPE_FC_LOG 0x13 /* enum */
-#define MC_CMD_NVRAM_TYPE_FC_EXTRA 0x14 /* enum */
-
-
-/***********************************/
-/* MC_CMD_NVRAM_INFO
- * Read info about a virtual NVRAM partition.
- */
-#define MC_CMD_NVRAM_INFO 0x37
+/* enum: Disabled callisto. */
+#define MC_CMD_NVRAM_TYPE_DISABLED_CALLISTO 0x0
+/* enum: MC firmware. */
+#define MC_CMD_NVRAM_TYPE_MC_FW 0x1
+/* enum: MC backup firmware. */
+#define MC_CMD_NVRAM_TYPE_MC_FW_BACKUP 0x2
+/* enum: Static configuration Port0. */
+#define MC_CMD_NVRAM_TYPE_STATIC_CFG_PORT0 0x3
+/* enum: Static configuration Port1. */
+#define MC_CMD_NVRAM_TYPE_STATIC_CFG_PORT1 0x4
+/* enum: Dynamic configuration Port0. */
+#define MC_CMD_NVRAM_TYPE_DYNAMIC_CFG_PORT0 0x5
+/* enum: Dynamic configuration Port1. */
+#define MC_CMD_NVRAM_TYPE_DYNAMIC_CFG_PORT1 0x6
+/* enum: Expansion Rom. */
+#define MC_CMD_NVRAM_TYPE_EXP_ROM 0x7
+/* enum: Expansion Rom Configuration Port0. */
+#define MC_CMD_NVRAM_TYPE_EXP_ROM_CFG_PORT0 0x8
+/* enum: Expansion Rom Configuration Port1. */
+#define MC_CMD_NVRAM_TYPE_EXP_ROM_CFG_PORT1 0x9
+/* enum: Phy Configuration Port0. */
+#define MC_CMD_NVRAM_TYPE_PHY_PORT0 0xa
+/* enum: Phy Configuration Port1. */
+#define MC_CMD_NVRAM_TYPE_PHY_PORT1 0xb
+/* enum: Log. */
+#define MC_CMD_NVRAM_TYPE_LOG 0xc
+/* enum: FPGA image. */
+#define MC_CMD_NVRAM_TYPE_FPGA 0xd
+/* enum: FPGA backup image */
+#define MC_CMD_NVRAM_TYPE_FPGA_BACKUP 0xe
+/* enum: FC firmware. */
+#define MC_CMD_NVRAM_TYPE_FC_FW 0xf
+/* enum: FC backup firmware. */
+#define MC_CMD_NVRAM_TYPE_FC_FW_BACKUP 0x10
+/* enum: CPLD image. */
+#define MC_CMD_NVRAM_TYPE_CPLD 0x11
+/* enum: Licensing information. */
+#define MC_CMD_NVRAM_TYPE_LICENSE 0x12
+/* enum: FC Log. */
+#define MC_CMD_NVRAM_TYPE_FC_LOG 0x13
+/* enum: Additional flash on FPGA. */
+#define MC_CMD_NVRAM_TYPE_FC_EXTRA 0x14
+
+
+/***********************************/
+/* MC_CMD_NVRAM_INFO
+ * Read info about a virtual NVRAM partition. Locks required: none. Returns: 0,
+ * EINVAL (bad type).
+ */
+#define MC_CMD_NVRAM_INFO 0x37
+#undef MC_CMD_0x37_PRIVILEGE_CTG
+
+#define MC_CMD_0x37_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_NVRAM_INFO_IN msgrequest */
#define MC_CMD_NVRAM_INFO_IN_LEN 4
@@ -3910,15 +5824,24 @@
#define MC_CMD_NVRAM_INFO_OUT_FLAGS_OFST 12
#define MC_CMD_NVRAM_INFO_OUT_PROTECTED_LBN 0
#define MC_CMD_NVRAM_INFO_OUT_PROTECTED_WIDTH 1
+#define MC_CMD_NVRAM_INFO_OUT_TLV_LBN 1
+#define MC_CMD_NVRAM_INFO_OUT_TLV_WIDTH 1
+#define MC_CMD_NVRAM_INFO_OUT_A_B_LBN 7
+#define MC_CMD_NVRAM_INFO_OUT_A_B_WIDTH 1
#define MC_CMD_NVRAM_INFO_OUT_PHYSDEV_OFST 16
#define MC_CMD_NVRAM_INFO_OUT_PHYSADDR_OFST 20
/***********************************/
-/* MC_CMD_NVRAM_UPDATE_START
- * Start a group of update operations on a virtual NVRAM partition.
+/* MC_CMD_NVRAM_UPDATE_START
+ * Start a group of update operations on a virtual NVRAM partition. Locks
+ * required: PHY_LOCK if type==*PHY*. Returns: 0, EINVAL (bad type), EACCES (if
+ * PHY_LOCK required and not held).
*/
-#define MC_CMD_NVRAM_UPDATE_START 0x38
+#define MC_CMD_NVRAM_UPDATE_START 0x38
+#undef MC_CMD_0x38_PRIVILEGE_CTG
+
+#define MC_CMD_0x38_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_NVRAM_UPDATE_START_IN msgrequest */
#define MC_CMD_NVRAM_UPDATE_START_IN_LEN 4
@@ -3931,10 +5854,15 @@
/***********************************/
-/* MC_CMD_NVRAM_READ
- * Read data from a virtual NVRAM partition.
+/* MC_CMD_NVRAM_READ
+ * Read data from a virtual NVRAM partition. Locks required: PHY_LOCK if
+ * type==*PHY*. Returns: 0, EINVAL (bad type/offset/length), EACCES (if
+ * PHY_LOCK required and not held)
*/
-#define MC_CMD_NVRAM_READ 0x39
+#define MC_CMD_NVRAM_READ 0x39
+#undef MC_CMD_0x39_PRIVILEGE_CTG
+
+#define MC_CMD_0x39_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_NVRAM_READ_IN msgrequest */
#define MC_CMD_NVRAM_READ_IN_LEN 12
@@ -3942,6 +5870,7 @@
/* Enum values, see field(s): */
/* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
#define MC_CMD_NVRAM_READ_IN_OFFSET_OFST 4
+/* amount to read in bytes */
#define MC_CMD_NVRAM_READ_IN_LENGTH_OFST 8
/* MC_CMD_NVRAM_READ_OUT msgresponse */
@@ -3955,10 +5884,15 @@
/***********************************/
-/* MC_CMD_NVRAM_WRITE
- * Write data to a virtual NVRAM partition.
+/* MC_CMD_NVRAM_WRITE
+ * Write data to a virtual NVRAM partition. Locks required: PHY_LOCK if
+ * type==*PHY*. Returns: 0, EINVAL (bad type/offset/length), EACCES (if
+ * PHY_LOCK required and not held)
*/
-#define MC_CMD_NVRAM_WRITE 0x3a
+#define MC_CMD_NVRAM_WRITE 0x3a
+#undef MC_CMD_0x3a_PRIVILEGE_CTG
+
+#define MC_CMD_0x3a_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_NVRAM_WRITE_IN msgrequest */
#define MC_CMD_NVRAM_WRITE_IN_LENMIN 13
@@ -3979,10 +5913,15 @@
/***********************************/
-/* MC_CMD_NVRAM_ERASE
- * Erase sector(s) from a virtual NVRAM partition.
+/* MC_CMD_NVRAM_ERASE
+ * Erase sector(s) from a virtual NVRAM partition. Locks required: PHY_LOCK if
+ * type==*PHY*. Returns: 0, EINVAL (bad type/offset/length), EACCES (if
+ * PHY_LOCK required and not held)
*/
-#define MC_CMD_NVRAM_ERASE 0x3b
+#define MC_CMD_NVRAM_ERASE 0x3b
+#undef MC_CMD_0x3b_PRIVILEGE_CTG
+
+#define MC_CMD_0x3b_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_NVRAM_ERASE_IN msgrequest */
#define MC_CMD_NVRAM_ERASE_IN_LEN 12
@@ -3997,10 +5936,15 @@
/***********************************/
-/* MC_CMD_NVRAM_UPDATE_FINISH
- * Finish a group of update operations on a virtual NVRAM partition.
+/* MC_CMD_NVRAM_UPDATE_FINISH
+ * Finish a group of update operations on a virtual NVRAM partition. Locks
+ * required: PHY_LOCK if type==*PHY*. Returns: 0, EINVAL (bad
+ * type/offset/length), EACCES (if PHY_LOCK required and not held)
*/
-#define MC_CMD_NVRAM_UPDATE_FINISH 0x3c
+#define MC_CMD_NVRAM_UPDATE_FINISH 0x3c
+#undef MC_CMD_0x3c_PRIVILEGE_CTG
+
+#define MC_CMD_0x3c_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_NVRAM_UPDATE_FINISH_IN msgrequest */
#define MC_CMD_NVRAM_UPDATE_FINISH_IN_LEN 8
@@ -4014,10 +5958,27 @@
/***********************************/
-/* MC_CMD_REBOOT
+/* MC_CMD_REBOOT
* Reboot the MC.
+ *
+ * The AFTER_ASSERTION flag is intended to be used when the driver notices an
+ * assertion failure (at which point it is expected to perform a complete tear
+ * down and reinitialise), to allow both ports to reset the MC once in an
+ * atomic fashion.
+ *
+ * Production mc firmwares are generally compiled with REBOOT_ON_ASSERT=1,
+ * which means that they will automatically reboot out of the assertion
+ * handler, so this is in practise an optional operation. It is still
+ * recommended that drivers execute this to support custom firmwares with
+ * REBOOT_ON_ASSERT=0.
+ *
+ * Locks required: NONE Returns: Nothing. You get back a response with ERR=1,
+ * DATALEN=0
*/
-#define MC_CMD_REBOOT 0x3d
+#define MC_CMD_REBOOT 0x3d
+#undef MC_CMD_0x3d_PRIVILEGE_CTG
+
+#define MC_CMD_0x3d_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_REBOOT_IN msgrequest */
#define MC_CMD_REBOOT_IN_LEN 4
@@ -4029,10 +5990,15 @@
/***********************************/
-/* MC_CMD_SCHEDINFO
- * Request scheduler info.
+/* MC_CMD_SCHEDINFO
+ * Request scheduler info. Locks required: NONE. Returns: An array of
+ * (timeslice,maximum overrun), one for each thread, in ascending order of
+ * thread address.
*/
-#define MC_CMD_SCHEDINFO 0x3e
+#define MC_CMD_SCHEDINFO 0x3e
+#undef MC_CMD_0x3e_PRIVILEGE_CTG
+
+#define MC_CMD_0x3e_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_SCHEDINFO_IN msgrequest */
#define MC_CMD_SCHEDINFO_IN_LEN 0
@@ -4048,15 +6014,28 @@
/***********************************/
-/* MC_CMD_REBOOT_MODE
+/* MC_CMD_REBOOT_MODE
+ * Set the mode for the next MC reboot. Locks required: NONE. Sets the reboot
+ * mode to the specified value. Returns the old mode.
*/
-#define MC_CMD_REBOOT_MODE 0x3f
+#define MC_CMD_REBOOT_MODE 0x3f
+#undef MC_CMD_0x3f_PRIVILEGE_CTG
+
+#define MC_CMD_0x3f_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_REBOOT_MODE_IN msgrequest */
#define MC_CMD_REBOOT_MODE_IN_LEN 4
#define MC_CMD_REBOOT_MODE_IN_VALUE_OFST 0
-#define MC_CMD_REBOOT_MODE_NORMAL 0x0 /* enum */
-#define MC_CMD_REBOOT_MODE_SNAPPER 0x3 /* enum */
+/* enum: Normal. */
+#define MC_CMD_REBOOT_MODE_NORMAL 0x0
+/* enum: Power-on Reset. */
+#define MC_CMD_REBOOT_MODE_POR 0x2
+/* enum: Snapper. */
+#define MC_CMD_REBOOT_MODE_SNAPPER 0x3
+/* enum: snapper fake POR */
+#define MC_CMD_REBOOT_MODE_SNAPPER_POR 0x4
+#define MC_CMD_REBOOT_MODE_IN_FAKE_LBN 7
+#define MC_CMD_REBOOT_MODE_IN_FAKE_WIDTH 1
/* MC_CMD_REBOOT_MODE_OUT msgresponse */
#define MC_CMD_REBOOT_MODE_OUT_LEN 4
@@ -4064,54 +6043,238 @@
/***********************************/
-/* MC_CMD_SENSOR_INFO
+/* MC_CMD_SENSOR_INFO
* Returns information about every available sensor.
+ *
+ * Each sensor has a single (16bit) value, and a corresponding state. The
+ * mapping between value and state is nominally determined by the MC, but may
+ * be implemented using up to 2 ranges per sensor.
+ *
+ * This call returns a mask (32bit) of the sensors that are supported by this
+ * platform, then an array of sensor information structures, in order of sensor
+ * type (but without gaps for unimplemented sensors). Each structure defines
+ * the ranges for the corresponding sensor. An unused range is indicated by
+ * equal limit values. If one range is used, a value outside that range results
+ * in STATE_FATAL. If two ranges are used, a value outside the second range
+ * results in STATE_FATAL while a value outside the first and inside the second
+ * range results in STATE_WARNING.
+ *
+ * Sensor masks and sensor information arrays are organised into pages. For
+ * backward compatibility, older host software can only use sensors in page 0.
+ * Bit 32 in the sensor mask was previously unused, and is no reserved for use
+ * as the next page flag.
+ *
+ * If the request does not contain a PAGE value then firmware will only return
+ * page 0 of sensor information, with bit 31 in the sensor mask cleared.
+ *
+ * If the request contains a PAGE value then firmware responds with the sensor
+ * mask and sensor information array for that page of sensors. In this case bit
+ * 31 in the mask is set if another page exists.
+ *
+ * Locks required: None Returns: 0
*/
-#define MC_CMD_SENSOR_INFO 0x41
+#define MC_CMD_SENSOR_INFO 0x41
+#undef MC_CMD_0x41_PRIVILEGE_CTG
+
+#define MC_CMD_0x41_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_SENSOR_INFO_IN msgrequest */
#define MC_CMD_SENSOR_INFO_IN_LEN 0
+/* MC_CMD_SENSOR_INFO_EXT_IN msgrequest */
+#define MC_CMD_SENSOR_INFO_EXT_IN_LEN 4
+/* Which page of sensors to report.
+ *
+ * Page 0 contains sensors 0 to 30 (sensor 31 is the next page bit).
+ *
+ * Page 1 contains sensors 32 to 62 (sensor 63 is the next page bit). etc.
+ */
+#define MC_CMD_SENSOR_INFO_EXT_IN_PAGE_OFST 0
+
/* MC_CMD_SENSOR_INFO_OUT msgresponse */
-#define MC_CMD_SENSOR_INFO_OUT_LENMIN 12
+#define MC_CMD_SENSOR_INFO_OUT_LENMIN 4
#define MC_CMD_SENSOR_INFO_OUT_LENMAX 252
#define MC_CMD_SENSOR_INFO_OUT_LEN(num) (4+8*(num))
#define MC_CMD_SENSOR_INFO_OUT_MASK_OFST 0
-#define MC_CMD_SENSOR_CONTROLLER_TEMP 0x0 /* enum */
-#define MC_CMD_SENSOR_PHY_COMMON_TEMP 0x1 /* enum */
-#define MC_CMD_SENSOR_CONTROLLER_COOLING 0x2 /* enum */
-#define MC_CMD_SENSOR_PHY0_TEMP 0x3 /* enum */
-#define MC_CMD_SENSOR_PHY0_COOLING 0x4 /* enum */
-#define MC_CMD_SENSOR_PHY1_TEMP 0x5 /* enum */
-#define MC_CMD_SENSOR_PHY1_COOLING 0x6 /* enum */
-#define MC_CMD_SENSOR_IN_1V0 0x7 /* enum */
-#define MC_CMD_SENSOR_IN_1V2 0x8 /* enum */
-#define MC_CMD_SENSOR_IN_1V8 0x9 /* enum */
-#define MC_CMD_SENSOR_IN_2V5 0xa /* enum */
-#define MC_CMD_SENSOR_IN_3V3 0xb /* enum */
-#define MC_CMD_SENSOR_IN_12V0 0xc /* enum */
-#define MC_CMD_SENSOR_IN_1V2A 0xd /* enum */
-#define MC_CMD_SENSOR_IN_VREF 0xe /* enum */
-#define MC_CMD_SENSOR_OUT_VAOE 0xf /* enum */
-#define MC_CMD_SENSOR_AOE_TEMP 0x10 /* enum */
-#define MC_CMD_SENSOR_PSU_AOE_TEMP 0x11 /* enum */
-#define MC_CMD_SENSOR_PSU_TEMP 0x12 /* enum */
-#define MC_CMD_SENSOR_FAN_0 0x13 /* enum */
-#define MC_CMD_SENSOR_FAN_1 0x14 /* enum */
-#define MC_CMD_SENSOR_FAN_2 0x15 /* enum */
-#define MC_CMD_SENSOR_FAN_3 0x16 /* enum */
-#define MC_CMD_SENSOR_FAN_4 0x17 /* enum */
-#define MC_CMD_SENSOR_IN_VAOE 0x18 /* enum */
-#define MC_CMD_SENSOR_OUT_IAOE 0x19 /* enum */
-#define MC_CMD_SENSOR_IN_IAOE 0x1a /* enum */
-#define MC_CMD_SENSOR_NIC_POWER 0x1b /* enum */
+/* enum: Controller temperature: degC */
+#define MC_CMD_SENSOR_CONTROLLER_TEMP 0x0
+/* enum: Phy common temperature: degC */
+#define MC_CMD_SENSOR_PHY_COMMON_TEMP 0x1
+/* enum: Controller cooling: bool */
+#define MC_CMD_SENSOR_CONTROLLER_COOLING 0x2
+/* enum: Phy 0 temperature: degC */
+#define MC_CMD_SENSOR_PHY0_TEMP 0x3
+/* enum: Phy 0 cooling: bool */
+#define MC_CMD_SENSOR_PHY0_COOLING 0x4
+/* enum: Phy 1 temperature: degC */
+#define MC_CMD_SENSOR_PHY1_TEMP 0x5
+/* enum: Phy 1 cooling: bool */
+#define MC_CMD_SENSOR_PHY1_COOLING 0x6
+/* enum: 1.0v power: mV */
+#define MC_CMD_SENSOR_IN_1V0 0x7
+/* enum: 1.2v power: mV */
+#define MC_CMD_SENSOR_IN_1V2 0x8
+/* enum: 1.8v power: mV */
+#define MC_CMD_SENSOR_IN_1V8 0x9
+/* enum: 2.5v power: mV */
+#define MC_CMD_SENSOR_IN_2V5 0xa
+/* enum: 3.3v power: mV */
+#define MC_CMD_SENSOR_IN_3V3 0xb
+/* enum: 12v power: mV */
+#define MC_CMD_SENSOR_IN_12V0 0xc
+/* enum: 1.2v analogue power: mV */
+#define MC_CMD_SENSOR_IN_1V2A 0xd
+/* enum: reference voltage: mV */
+#define MC_CMD_SENSOR_IN_VREF 0xe
+/* enum: AOE FPGA power: mV */
+#define MC_CMD_SENSOR_OUT_VAOE 0xf
+/* enum: AOE FPGA temperature: degC */
+#define MC_CMD_SENSOR_AOE_TEMP 0x10
+/* enum: AOE FPGA PSU temperature: degC */
+#define MC_CMD_SENSOR_PSU_AOE_TEMP 0x11
+/* enum: AOE PSU temperature: degC */
+#define MC_CMD_SENSOR_PSU_TEMP 0x12
+/* enum: Fan 0 speed: RPM */
+#define MC_CMD_SENSOR_FAN_0 0x13
+/* enum: Fan 1 speed: RPM */
+#define MC_CMD_SENSOR_FAN_1 0x14
+/* enum: Fan 2 speed: RPM */
+#define MC_CMD_SENSOR_FAN_2 0x15
+/* enum: Fan 3 speed: RPM */
+#define MC_CMD_SENSOR_FAN_3 0x16
+/* enum: Fan 4 speed: RPM */
+#define MC_CMD_SENSOR_FAN_4 0x17
+/* enum: AOE FPGA input power: mV */
+#define MC_CMD_SENSOR_IN_VAOE 0x18
+/* enum: AOE FPGA current: mA */
+#define MC_CMD_SENSOR_OUT_IAOE 0x19
+/* enum: AOE FPGA input current: mA */
+#define MC_CMD_SENSOR_IN_IAOE 0x1a
+/* enum: NIC power consumption: W */
+#define MC_CMD_SENSOR_NIC_POWER 0x1b
+/* enum: 0.9v power voltage: mV */
+#define MC_CMD_SENSOR_IN_0V9 0x1c
+/* enum: 0.9v power current: mA */
+#define MC_CMD_SENSOR_IN_I0V9 0x1d
+/* enum: 1.2v power current: mA */
+#define MC_CMD_SENSOR_IN_I1V2 0x1e
+/* enum: Not a sensor: reserved for the next page flag */
+#define MC_CMD_SENSOR_PAGE0_NEXT 0x1f
+/* enum: 0.9v power voltage (at ADC): mV */
+#define MC_CMD_SENSOR_IN_0V9_ADC 0x20
+/* enum: Controller temperature 2: degC */
+#define MC_CMD_SENSOR_CONTROLLER_2_TEMP 0x21
+/* enum: Voltage regulator internal temperature: degC */
+#define MC_CMD_SENSOR_VREG_INTERNAL_TEMP 0x22
+/* enum: 0.9V voltage regulator temperature: degC */
+#define MC_CMD_SENSOR_VREG_0V9_TEMP 0x23
+/* enum: 1.2V voltage regulator temperature: degC */
+#define MC_CMD_SENSOR_VREG_1V2_TEMP 0x24
+/* enum: controller internal temperature sensor voltage (internal ADC): mV */
+#define MC_CMD_SENSOR_CONTROLLER_VPTAT 0x25
+/* enum: controller internal temperature (internal ADC): degC */
+#define MC_CMD_SENSOR_CONTROLLER_INTERNAL_TEMP 0x26
+/* enum: controller internal temperature sensor voltage (external ADC): mV */
+#define MC_CMD_SENSOR_CONTROLLER_VPTAT_EXTADC 0x27
+/* enum: controller internal temperature (external ADC): degC */
+#define MC_CMD_SENSOR_CONTROLLER_INTERNAL_TEMP_EXTADC 0x28
+/* enum: ambient temperature: degC */
+#define MC_CMD_SENSOR_AMBIENT_TEMP 0x29
+/* enum: air flow: bool */
+#define MC_CMD_SENSOR_AIRFLOW 0x2a
+/* enum: voltage between VSS08D and VSS08D at CSR: mV */
+#define MC_CMD_SENSOR_VDD08D_VSS08D_CSR 0x2b
+/* enum: voltage between VSS08D and VSS08D at CSR (external ADC): mV */
+#define MC_CMD_SENSOR_VDD08D_VSS08D_CSR_EXTADC 0x2c
+/* enum: Hotpoint temperature: degC */
+#define MC_CMD_SENSOR_HOTPOINT_TEMP 0x2d
+/* enum: Port 0 PHY power switch over-current: bool */
+#define MC_CMD_SENSOR_PHY_POWER_PORT0 0x2e
+/* enum: Port 1 PHY power switch over-current: bool */
+#define MC_CMD_SENSOR_PHY_POWER_PORT1 0x2f
+/* enum: Mop-up microcontroller reference voltage (millivolts) */
+#define MC_CMD_SENSOR_MUM_VCC 0x30
+/* enum: 0.9v power phase A voltage: mV */
+#define MC_CMD_SENSOR_IN_0V9_A 0x31
+/* enum: 0.9v power phase A current: mA */
+#define MC_CMD_SENSOR_IN_I0V9_A 0x32
+/* enum: 0.9V voltage regulator phase A temperature: degC */
+#define MC_CMD_SENSOR_VREG_0V9_A_TEMP 0x33
+/* enum: 0.9v power phase B voltage: mV */
+#define MC_CMD_SENSOR_IN_0V9_B 0x34
+/* enum: 0.9v power phase B current: mA */
+#define MC_CMD_SENSOR_IN_I0V9_B 0x35
+/* enum: 0.9V voltage regulator phase B temperature: degC */
+#define MC_CMD_SENSOR_VREG_0V9_B_TEMP 0x36
+/* enum: CCOM AVREG 1v2 supply (interval ADC): mV */
+#define MC_CMD_SENSOR_CCOM_AVREG_1V2_SUPPLY 0x37
+/* enum: CCOM AVREG 1v2 supply (external ADC): mV */
+#define MC_CMD_SENSOR_CCOM_AVREG_1V2_SUPPLY_EXTADC 0x38
+/* enum: CCOM AVREG 1v8 supply (interval ADC): mV */
+#define MC_CMD_SENSOR_CCOM_AVREG_1V8_SUPPLY 0x39
+/* enum: CCOM AVREG 1v8 supply (external ADC): mV */
+#define MC_CMD_SENSOR_CCOM_AVREG_1V8_SUPPLY_EXTADC 0x3a
+/* enum: Not a sensor: reserved for the next page flag */
+#define MC_CMD_SENSOR_PAGE1_NEXT 0x3f
+/* enum: controller internal temperature sensor voltage on master core
+ * (internal ADC): mV
+ */
+#define MC_CMD_SENSOR_CONTROLLER_MASTER_VPTAT 0x40
+/* enum: controller internal temperature on master core (internal ADC): degC */
+#define MC_CMD_SENSOR_CONTROLLER_MASTER_INTERNAL_TEMP 0x41
+/* enum: controller internal temperature sensor voltage on master core
+ * (external ADC): mV
+ */
+#define MC_CMD_SENSOR_CONTROLLER_MASTER_VPTAT_EXTADC 0x42
+/* enum: controller internal temperature on master core (external ADC): degC */
+#define MC_CMD_SENSOR_CONTROLLER_MASTER_INTERNAL_TEMP_EXTADC 0x43
+/* enum: controller internal temperature on slave core sensor voltage (internal
+ * ADC): mV
+ */
+#define MC_CMD_SENSOR_CONTROLLER_SLAVE_VPTAT 0x44
+/* enum: controller internal temperature on slave core (internal ADC): degC */
+#define MC_CMD_SENSOR_CONTROLLER_SLAVE_INTERNAL_TEMP 0x45
+/* enum: controller internal temperature on slave core sensor voltage (external
+ * ADC): mV
+ */
+#define MC_CMD_SENSOR_CONTROLLER_SLAVE_VPTAT_EXTADC 0x46
+/* enum: controller internal temperature on slave core (external ADC): degC */
+#define MC_CMD_SENSOR_CONTROLLER_SLAVE_INTERNAL_TEMP_EXTADC 0x47
+/* enum: Voltage supplied to the SODIMMs from their power supply: mV */
+#define MC_CMD_SENSOR_SODIMM_VOUT 0x49
+/* enum: Temperature of SODIMM 0 (if installed): degC */
+#define MC_CMD_SENSOR_SODIMM_0_TEMP 0x4a
+/* enum: Temperature of SODIMM 1 (if installed): degC */
+#define MC_CMD_SENSOR_SODIMM_1_TEMP 0x4b
+/* enum: Voltage supplied to the QSFP #0 from their power supply: mV */
+#define MC_CMD_SENSOR_PHY0_VCC 0x4c
+/* enum: Voltage supplied to the QSFP #1 from their power supply: mV */
+#define MC_CMD_SENSOR_PHY1_VCC 0x4d
+/* MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF */
#define MC_CMD_SENSOR_ENTRY_OFST 4
#define MC_CMD_SENSOR_ENTRY_LEN 8
#define MC_CMD_SENSOR_ENTRY_LO_OFST 4
#define MC_CMD_SENSOR_ENTRY_HI_OFST 8
-#define MC_CMD_SENSOR_ENTRY_MINNUM 1
+#define MC_CMD_SENSOR_ENTRY_MINNUM 0
#define MC_CMD_SENSOR_ENTRY_MAXNUM 31
+/* MC_CMD_SENSOR_INFO_EXT_OUT msgresponse */
+#define MC_CMD_SENSOR_INFO_EXT_OUT_LENMIN 4
+#define MC_CMD_SENSOR_INFO_EXT_OUT_LENMAX 252
+#define MC_CMD_SENSOR_INFO_EXT_OUT_LEN(num) (4+8*(num))
+#define MC_CMD_SENSOR_INFO_EXT_OUT_MASK_OFST 0
+/* Enum values, see field(s): */
+/* MC_CMD_SENSOR_INFO_OUT */
+#define MC_CMD_SENSOR_INFO_EXT_OUT_NEXT_PAGE_LBN 31
+#define MC_CMD_SENSOR_INFO_EXT_OUT_NEXT_PAGE_WIDTH 1
+/* MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF */
+/* MC_CMD_SENSOR_ENTRY_OFST 4 */
+/* MC_CMD_SENSOR_ENTRY_LEN 8 */
+/* MC_CMD_SENSOR_ENTRY_LO_OFST 4 */
+/* MC_CMD_SENSOR_ENTRY_HI_OFST 8 */
+/* MC_CMD_SENSOR_ENTRY_MINNUM 0 */
+/* MC_CMD_SENSOR_ENTRY_MAXNUM 31 */
+
/* MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF structuredef */
#define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_LEN 8
#define MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN1_OFST 0
@@ -4133,42 +6296,91 @@
/***********************************/
-/* MC_CMD_READ_SENSORS
- * Returns the current reading from each sensor.
+/* MC_CMD_READ_SENSORS
+ * Returns the current reading from each sensor. DMAs an array of sensor
+ * readings, in order of sensor type (but without gaps for unimplemented
+ * sensors), into host memory. Each array element is a
+ * MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF dword.
+ *
+ * If the request does not contain the LENGTH field then only sensors 0 to 30
+ * are reported, to avoid DMA buffer overflow in older host software. If the
+ * sensor reading require more space than the LENGTH allows, then return
+ * EINVAL.
+ *
+ * The MC will send a SENSOREVT event every time any sensor changes state. The
+ * driver is responsible for ensuring that it doesn't miss any events. The
+ * board will function normally if all sensors are in STATE_OK or
+ * STATE_WARNING. Otherwise the board should not be expected to function.
*/
-#define MC_CMD_READ_SENSORS 0x42
+#define MC_CMD_READ_SENSORS 0x42
+#undef MC_CMD_0x42_PRIVILEGE_CTG
+
+#define MC_CMD_0x42_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_READ_SENSORS_IN msgrequest */
#define MC_CMD_READ_SENSORS_IN_LEN 8
+/* DMA address of host buffer for sensor readings (must be 4Kbyte aligned). */
#define MC_CMD_READ_SENSORS_IN_DMA_ADDR_OFST 0
#define MC_CMD_READ_SENSORS_IN_DMA_ADDR_LEN 8
#define MC_CMD_READ_SENSORS_IN_DMA_ADDR_LO_OFST 0
#define MC_CMD_READ_SENSORS_IN_DMA_ADDR_HI_OFST 4
+/* MC_CMD_READ_SENSORS_EXT_IN msgrequest */
+#define MC_CMD_READ_SENSORS_EXT_IN_LEN 12
+/* DMA address of host buffer for sensor readings */
+#define MC_CMD_READ_SENSORS_EXT_IN_DMA_ADDR_OFST 0
+#define MC_CMD_READ_SENSORS_EXT_IN_DMA_ADDR_LEN 8
+#define MC_CMD_READ_SENSORS_EXT_IN_DMA_ADDR_LO_OFST 0
+#define MC_CMD_READ_SENSORS_EXT_IN_DMA_ADDR_HI_OFST 4
+/* Size in bytes of host buffer. */
+#define MC_CMD_READ_SENSORS_EXT_IN_LENGTH_OFST 8
+
/* MC_CMD_READ_SENSORS_OUT msgresponse */
#define MC_CMD_READ_SENSORS_OUT_LEN 0
+/* MC_CMD_READ_SENSORS_EXT_OUT msgresponse */
+#define MC_CMD_READ_SENSORS_EXT_OUT_LEN 0
+
/* MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF structuredef */
-#define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_LEN 3
+#define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_LEN 4
#define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_VALUE_OFST 0
#define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_VALUE_LEN 2
#define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_VALUE_LBN 0
#define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_VALUE_WIDTH 16
#define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_STATE_OFST 2
#define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_STATE_LEN 1
-#define MC_CMD_SENSOR_STATE_OK 0x0 /* enum */
-#define MC_CMD_SENSOR_STATE_WARNING 0x1 /* enum */
-#define MC_CMD_SENSOR_STATE_FATAL 0x2 /* enum */
-#define MC_CMD_SENSOR_STATE_BROKEN 0x3 /* enum */
+/* enum: Ok. */
+#define MC_CMD_SENSOR_STATE_OK 0x0
+/* enum: Breached warning threshold. */
+#define MC_CMD_SENSOR_STATE_WARNING 0x1
+/* enum: Breached fatal threshold. */
+#define MC_CMD_SENSOR_STATE_FATAL 0x2
+/* enum: Fault with sensor. */
+#define MC_CMD_SENSOR_STATE_BROKEN 0x3
+/* enum: Sensor is working but does not currently have a reading. */
+#define MC_CMD_SENSOR_STATE_NO_READING 0x4
+/* enum: Sensor initialisation failed. */
+#define MC_CMD_SENSOR_STATE_INIT_FAILED 0x5
#define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_STATE_LBN 16
#define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_STATE_WIDTH 8
+#define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_TYPE_OFST 3
+#define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_TYPE_LEN 1
+/* Enum values, see field(s): */
+/* MC_CMD_SENSOR_INFO/MC_CMD_SENSOR_INFO_OUT/MASK */
+#define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_TYPE_LBN 24
+#define MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_TYPE_WIDTH 8
/***********************************/
-/* MC_CMD_GET_PHY_STATE
- * Report current state of PHY.
+/* MC_CMD_GET_PHY_STATE
+ * Report current state of PHY. A 'zombie' PHY is a PHY that has failed to boot
+ * (e.g. due to missing or corrupted firmware). Locks required: None. Return
+ * code: 0
*/
-#define MC_CMD_GET_PHY_STATE 0x43
+#define MC_CMD_GET_PHY_STATE 0x43
+#undef MC_CMD_0x43_PRIVILEGE_CTG
+
+#define MC_CMD_0x43_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_GET_PHY_STATE_IN msgrequest */
#define MC_CMD_GET_PHY_STATE_IN_LEN 0
@@ -4176,15 +6388,18 @@
/* MC_CMD_GET_PHY_STATE_OUT msgresponse */
#define MC_CMD_GET_PHY_STATE_OUT_LEN 4
#define MC_CMD_GET_PHY_STATE_OUT_STATE_OFST 0
-#define MC_CMD_PHY_STATE_OK 0x1 /* enum */
-#define MC_CMD_PHY_STATE_ZOMBIE 0x2 /* enum */
+/* enum: Ok. */
+#define MC_CMD_PHY_STATE_OK 0x1
+/* enum: Faulty. */
+#define MC_CMD_PHY_STATE_ZOMBIE 0x2
/***********************************/
-/* MC_CMD_SETUP_8021QBB
- * 802.1Qbb control.
+/* MC_CMD_SETUP_8021QBB
+ * 802.1Qbb control. 8 Tx queues that map to priorities 0 - 7. Use all 1s to
+ * disable 802.Qbb for a given priority.
*/
-#define MC_CMD_SETUP_8021QBB 0x44
+#define MC_CMD_SETUP_8021QBB 0x44
/* MC_CMD_SETUP_8021QBB_IN msgrequest */
#define MC_CMD_SETUP_8021QBB_IN_LEN 32
@@ -4196,10 +6411,13 @@
/***********************************/
-/* MC_CMD_WOL_FILTER_GET
- * Retrieve ID of any WoL filters.
+/* MC_CMD_WOL_FILTER_GET
+ * Retrieve ID of any WoL filters. Locks required: None. Returns: 0, ENOSYS
*/
-#define MC_CMD_WOL_FILTER_GET 0x45
+#define MC_CMD_WOL_FILTER_GET 0x45
+#undef MC_CMD_0x45_PRIVILEGE_CTG
+
+#define MC_CMD_0x45_PRIVILEGE_CTG SRIOV_CTG_LINK
/* MC_CMD_WOL_FILTER_GET_IN msgrequest */
#define MC_CMD_WOL_FILTER_GET_IN_LEN 0
@@ -4210,10 +6428,14 @@
/***********************************/
-/* MC_CMD_ADD_LIGHTSOUT_OFFLOAD
- * Add a protocol offload to NIC for lights-out state.
+/* MC_CMD_ADD_LIGHTSOUT_OFFLOAD
+ * Add a protocol offload to NIC for lights-out state. Locks required: None.
+ * Returns: 0, ENOSYS
*/
-#define MC_CMD_ADD_LIGHTSOUT_OFFLOAD 0x46
+#define MC_CMD_ADD_LIGHTSOUT_OFFLOAD 0x46
+#undef MC_CMD_0x46_PRIVILEGE_CTG
+
+#define MC_CMD_0x46_PRIVILEGE_CTG SRIOV_CTG_LINK
/* MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN msgrequest */
#define MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_LENMIN 8
@@ -4250,10 +6472,14 @@
/***********************************/
-/* MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD
- * Remove a protocol offload from NIC for lights-out state.
+/* MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD
+ * Remove a protocol offload from NIC for lights-out state. Locks required:
+ * None. Returns: 0, ENOSYS
*/
-#define MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD 0x47
+#define MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD 0x47
+#undef MC_CMD_0x47_PRIVILEGE_CTG
+
+#define MC_CMD_0x47_PRIVILEGE_CTG SRIOV_CTG_LINK
/* MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_IN msgrequest */
#define MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_IN_LEN 8
@@ -4265,10 +6491,10 @@
/***********************************/
-/* MC_CMD_MAC_RESET_RESTORE
- * Restore MAC after block reset.
+/* MC_CMD_MAC_RESET_RESTORE
+ * Restore MAC after block reset. Locks required: None. Returns: 0.
*/
-#define MC_CMD_MAC_RESET_RESTORE 0x48
+#define MC_CMD_MAC_RESET_RESTORE 0x48
/* MC_CMD_MAC_RESET_RESTORE_IN msgrequest */
#define MC_CMD_MAC_RESET_RESTORE_IN_LEN 0
@@ -4278,9 +6504,15 @@
/***********************************/
-/* MC_CMD_TESTASSERT
+/* MC_CMD_TESTASSERT
+ * Deliberately trigger an assert-detonation in the firmware for testing
+ * purposes (i.e. to allow tests that the driver copes gracefully). Locks
+ * required: None Returns: 0
*/
-#define MC_CMD_TESTASSERT 0x49
+#define MC_CMD_TESTASSERT 0x49
+#undef MC_CMD_0x49_PRIVILEGE_CTG
+
+#define MC_CMD_0x49_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_TESTASSERT_IN msgrequest */
#define MC_CMD_TESTASSERT_IN_LEN 0
@@ -4290,26 +6522,74 @@
/***********************************/
-/* MC_CMD_WORKAROUND
- * Enable/Disable a given workaround.
+/* MC_CMD_WORKAROUND
+ * Enable/Disable a given workaround. The mcfw will return EINVAL if it doesn't
+ * understand the given workaround number - which should not be treated as a
+ * hard error by client code. This op does not imply any semantics about each
+ * workaround, that's between the driver and the mcfw on a per-workaround
+ * basis. Locks required: None. Returns: 0, EINVAL .
*/
-#define MC_CMD_WORKAROUND 0x4a
+#define MC_CMD_WORKAROUND 0x4a
+#undef MC_CMD_0x4a_PRIVILEGE_CTG
+
+#define MC_CMD_0x4a_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_WORKAROUND_IN msgrequest */
#define MC_CMD_WORKAROUND_IN_LEN 8
+/* The enums here must correspond with those in MC_CMD_GET_WORKAROUND. */
#define MC_CMD_WORKAROUND_IN_TYPE_OFST 0
-#define MC_CMD_WORKAROUND_BUG17230 0x1 /* enum */
+/* enum: Bug 17230 work around. */
+#define MC_CMD_WORKAROUND_BUG17230 0x1
+/* enum: Bug 35388 work around (unsafe EVQ writes). */
+#define MC_CMD_WORKAROUND_BUG35388 0x2
+/* enum: Bug35017 workaround (A64 tables must be identity map) */
+#define MC_CMD_WORKAROUND_BUG35017 0x3
+/* enum: Bug 41750 present (MC_CMD_TRIGGER_INTERRUPT won't work) */
+#define MC_CMD_WORKAROUND_BUG41750 0x4
+/* enum: Bug 42008 present (Interrupts can overtake associated events). Caution
+ * - before adding code that queries this workaround, remember that there's
+ * released Monza firmware that doesn't understand MC_CMD_WORKAROUND_BUG42008,
+ * and will hence (incorrectly) report that the bug doesn't exist.
+ */
+#define MC_CMD_WORKAROUND_BUG42008 0x5
+/* enum: Bug 26807 features present in firmware (multicast filter chaining)
+ * This feature cannot be turned on/off while there are any filters already
+ * present. The behaviour in such case depends on the acting client's privilege
+ * level. If the client has the admin privilege, then all functions that have
+ * filters installed will be FLRed and the FLR_DONE flag will be set. Otherwise
+ * the command will fail with MC_CMD_ERR_FILTERS_PRESENT.
+ */
+#define MC_CMD_WORKAROUND_BUG26807 0x6
+/* 0 = disable the workaround indicated by TYPE; any non-zero value = enable
+ * the workaround
+ */
#define MC_CMD_WORKAROUND_IN_ENABLED_OFST 4
/* MC_CMD_WORKAROUND_OUT msgresponse */
#define MC_CMD_WORKAROUND_OUT_LEN 0
+/* MC_CMD_WORKAROUND_EXT_OUT msgresponse: This response format will be used
+ * when (TYPE == MC_CMD_WORKAROUND_BUG26807)
+ */
+#define MC_CMD_WORKAROUND_EXT_OUT_LEN 4
+#define MC_CMD_WORKAROUND_EXT_OUT_FLAGS_OFST 0
+#define MC_CMD_WORKAROUND_EXT_OUT_FLR_DONE_LBN 0
+#define MC_CMD_WORKAROUND_EXT_OUT_FLR_DONE_WIDTH 1
+
/***********************************/
-/* MC_CMD_GET_PHY_MEDIA_INFO
- * Read media-specific data from PHY.
+/* MC_CMD_GET_PHY_MEDIA_INFO
+ * Read media-specific data from PHY (e.g. SFP/SFP+ module ID information for
+ * SFP+ PHYs). The 'media type' can be found via GET_PHY_CFG
+ * (GET_PHY_CFG_OUT_MEDIA_TYPE); the valid 'page number' input values, and the
+ * output data, are interpreted on a per-type basis. For SFP+: PAGE=0 or 1
+ * returns a 128-byte block read from module I2C address 0xA0 offset 0 or 0x80.
+ * Anything else: currently undefined. Locks required: None. Return code: 0.
*/
-#define MC_CMD_GET_PHY_MEDIA_INFO 0x4b
+#define MC_CMD_GET_PHY_MEDIA_INFO 0x4b
+#undef MC_CMD_0x4b_PRIVILEGE_CTG
+
+#define MC_CMD_0x4b_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_GET_PHY_MEDIA_INFO_IN msgrequest */
#define MC_CMD_GET_PHY_MEDIA_INFO_IN_LEN 4
@@ -4319,6 +6599,7 @@
#define MC_CMD_GET_PHY_MEDIA_INFO_OUT_LENMIN 5
#define MC_CMD_GET_PHY_MEDIA_INFO_OUT_LENMAX 252
#define MC_CMD_GET_PHY_MEDIA_INFO_OUT_LEN(num) (4+1*(num))
+/* in bytes */
#define MC_CMD_GET_PHY_MEDIA_INFO_OUT_DATALEN_OFST 0
#define MC_CMD_GET_PHY_MEDIA_INFO_OUT_DATA_OFST 4
#define MC_CMD_GET_PHY_MEDIA_INFO_OUT_DATA_LEN 1
@@ -4327,10 +6608,14 @@
/***********************************/
-/* MC_CMD_NVRAM_TEST
- * Test a particular NVRAM partition.
+/* MC_CMD_NVRAM_TEST
+ * Test a particular NVRAM partition for valid contents (where "valid" depends
+ * on the type of partition).
*/
-#define MC_CMD_NVRAM_TEST 0x4c
+#define MC_CMD_NVRAM_TEST 0x4c
+#undef MC_CMD_0x4c_PRIVILEGE_CTG
+
+#define MC_CMD_0x4c_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_NVRAM_TEST_IN msgrequest */
#define MC_CMD_NVRAM_TEST_IN_LEN 4
@@ -4341,22 +6626,31 @@
/* MC_CMD_NVRAM_TEST_OUT msgresponse */
#define MC_CMD_NVRAM_TEST_OUT_LEN 4
#define MC_CMD_NVRAM_TEST_OUT_RESULT_OFST 0
-#define MC_CMD_NVRAM_TEST_PASS 0x0 /* enum */
-#define MC_CMD_NVRAM_TEST_FAIL 0x1 /* enum */
-#define MC_CMD_NVRAM_TEST_NOTSUPP 0x2 /* enum */
+/* enum: Passed. */
+#define MC_CMD_NVRAM_TEST_PASS 0x0
+/* enum: Failed. */
+#define MC_CMD_NVRAM_TEST_FAIL 0x1
+/* enum: Not supported. */
+#define MC_CMD_NVRAM_TEST_NOTSUPP 0x2
/***********************************/
-/* MC_CMD_MRSFP_TWEAK
- * Read status and/or set parameters for the 'mrsfp' driver.
+/* MC_CMD_MRSFP_TWEAK
+ * Read status and/or set parameters for the 'mrsfp' driver in mr_rusty builds.
+ * I2C I/O expander bits are always read; if equaliser parameters are supplied,
+ * they are configured first. Locks required: None. Return code: 0, EINVAL.
*/
-#define MC_CMD_MRSFP_TWEAK 0x4d
+#define MC_CMD_MRSFP_TWEAK 0x4d
/* MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG msgrequest */
#define MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG_LEN 16
+/* 0-6 low->high de-emph. */
#define MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG_TXEQ_LEVEL_OFST 0
+/* 0-8 low->high ref.V */
#define MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG_TXEQ_DT_CFG_OFST 4
+/* 0-8 0-8 low->high boost */
#define MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG_RXEQ_BOOST_OFST 8
+/* 0-8 low->high ref.V */
#define MC_CMD_MRSFP_TWEAK_IN_EQ_CONFIG_RXEQ_DT_CFG_OFST 12
/* MC_CMD_MRSFP_TWEAK_IN_READ_ONLY msgrequest */
@@ -4364,27 +6658,41 @@
/* MC_CMD_MRSFP_TWEAK_OUT msgresponse */
#define MC_CMD_MRSFP_TWEAK_OUT_LEN 12
+/* input bits */
#define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_INPUTS_OFST 0
+/* output bits */
#define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_OUTPUTS_OFST 4
+/* direction */
#define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_DIRECTION_OFST 8
-#define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_DIRECTION_OUT 0x0 /* enum */
-#define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_DIRECTION_IN 0x1 /* enum */
+/* enum: Out. */
+#define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_DIRECTION_OUT 0x0
+/* enum: In. */
+#define MC_CMD_MRSFP_TWEAK_OUT_IOEXP_DIRECTION_IN 0x1
/***********************************/
-/* MC_CMD_SENSOR_SET_LIMS
- * Adjusts the sensor limits.
+/* MC_CMD_SENSOR_SET_LIMS
+ * Adjusts the sensor limits. This is a warranty-voiding operation. Returns:
+ * ENOENT if the sensor specified does not exist, EINVAL if the limits are out
+ * of range.
*/
-#define MC_CMD_SENSOR_SET_LIMS 0x4e
+#define MC_CMD_SENSOR_SET_LIMS 0x4e
+#undef MC_CMD_0x4e_PRIVILEGE_CTG
+
+#define MC_CMD_0x4e_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_SENSOR_SET_LIMS_IN msgrequest */
#define MC_CMD_SENSOR_SET_LIMS_IN_LEN 20
#define MC_CMD_SENSOR_SET_LIMS_IN_SENSOR_OFST 0
/* Enum values, see field(s): */
/* MC_CMD_SENSOR_INFO/MC_CMD_SENSOR_INFO_OUT/MASK */
+/* interpretation is is sensor-specific. */
#define MC_CMD_SENSOR_SET_LIMS_IN_LOW0_OFST 4
+/* interpretation is is sensor-specific. */
#define MC_CMD_SENSOR_SET_LIMS_IN_HI0_OFST 8
+/* interpretation is is sensor-specific. */
#define MC_CMD_SENSOR_SET_LIMS_IN_LOW1_OFST 12
+/* interpretation is is sensor-specific. */
#define MC_CMD_SENSOR_SET_LIMS_IN_HI1_OFST 16
/* MC_CMD_SENSOR_SET_LIMS_OUT msgresponse */
@@ -4392,9 +6700,9 @@
/***********************************/
-/* MC_CMD_GET_RESOURCE_LIMITS
+/* MC_CMD_GET_RESOURCE_LIMITS
*/
-#define MC_CMD_GET_RESOURCE_LIMITS 0x4f
+#define MC_CMD_GET_RESOURCE_LIMITS 0x4f
/* MC_CMD_GET_RESOURCE_LIMITS_IN msgrequest */
#define MC_CMD_GET_RESOURCE_LIMITS_IN_LEN 0
@@ -4408,19 +6716,129 @@
/***********************************/
-/* MC_CMD_CLP
- * CLP support operations
+/* MC_CMD_NVRAM_PARTITIONS
+ * Reads the list of available virtual NVRAM partition types. Locks required:
+ * none. Returns: 0, EINVAL (bad type).
+ */
+#define MC_CMD_NVRAM_PARTITIONS 0x51
+#undef MC_CMD_0x51_PRIVILEGE_CTG
+
+#define MC_CMD_0x51_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_NVRAM_PARTITIONS_IN msgrequest */
+#define MC_CMD_NVRAM_PARTITIONS_IN_LEN 0
+
+/* MC_CMD_NVRAM_PARTITIONS_OUT msgresponse */
+#define MC_CMD_NVRAM_PARTITIONS_OUT_LENMIN 4
+#define MC_CMD_NVRAM_PARTITIONS_OUT_LENMAX 252
+#define MC_CMD_NVRAM_PARTITIONS_OUT_LEN(num) (4+4*(num))
+/* total number of partitions */
+#define MC_CMD_NVRAM_PARTITIONS_OUT_NUM_PARTITIONS_OFST 0
+/* type ID code for each of NUM_PARTITIONS partitions */
+#define MC_CMD_NVRAM_PARTITIONS_OUT_TYPE_ID_OFST 4
+#define MC_CMD_NVRAM_PARTITIONS_OUT_TYPE_ID_LEN 4
+#define MC_CMD_NVRAM_PARTITIONS_OUT_TYPE_ID_MINNUM 0
+#define MC_CMD_NVRAM_PARTITIONS_OUT_TYPE_ID_MAXNUM 62
+
+
+/***********************************/
+/* MC_CMD_NVRAM_METADATA
+ * Reads soft metadata for a virtual NVRAM partition type. Locks required:
+ * none. Returns: 0, EINVAL (bad type).
+ */
+#define MC_CMD_NVRAM_METADATA 0x52
+#undef MC_CMD_0x52_PRIVILEGE_CTG
+
+#define MC_CMD_0x52_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_NVRAM_METADATA_IN msgrequest */
+#define MC_CMD_NVRAM_METADATA_IN_LEN 4
+/* Partition type ID code */
+#define MC_CMD_NVRAM_METADATA_IN_TYPE_OFST 0
+
+/* MC_CMD_NVRAM_METADATA_OUT msgresponse */
+#define MC_CMD_NVRAM_METADATA_OUT_LENMIN 20
+#define MC_CMD_NVRAM_METADATA_OUT_LENMAX 252
+#define MC_CMD_NVRAM_METADATA_OUT_LEN(num) (20+1*(num))
+/* Partition type ID code */
+#define MC_CMD_NVRAM_METADATA_OUT_TYPE_OFST 0
+#define MC_CMD_NVRAM_METADATA_OUT_FLAGS_OFST 4
+#define MC_CMD_NVRAM_METADATA_OUT_SUBTYPE_VALID_LBN 0
+#define MC_CMD_NVRAM_METADATA_OUT_SUBTYPE_VALID_WIDTH 1
+#define MC_CMD_NVRAM_METADATA_OUT_VERSION_VALID_LBN 1
+#define MC_CMD_NVRAM_METADATA_OUT_VERSION_VALID_WIDTH 1
+#define MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_VALID_LBN 2
+#define MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_VALID_WIDTH 1
+/* Subtype ID code for content of this partition */
+#define MC_CMD_NVRAM_METADATA_OUT_SUBTYPE_OFST 8
+/* 1st component of W.X.Y.Z version number for content of this partition */
+#define MC_CMD_NVRAM_METADATA_OUT_VERSION_W_OFST 12
+#define MC_CMD_NVRAM_METADATA_OUT_VERSION_W_LEN 2
+/* 2nd component of W.X.Y.Z version number for content of this partition */
+#define MC_CMD_NVRAM_METADATA_OUT_VERSION_X_OFST 14
+#define MC_CMD_NVRAM_METADATA_OUT_VERSION_X_LEN 2
+/* 3rd component of W.X.Y.Z version number for content of this partition */
+#define MC_CMD_NVRAM_METADATA_OUT_VERSION_Y_OFST 16
+#define MC_CMD_NVRAM_METADATA_OUT_VERSION_Y_LEN 2
+/* 4th component of W.X.Y.Z version number for content of this partition */
+#define MC_CMD_NVRAM_METADATA_OUT_VERSION_Z_OFST 18
+#define MC_CMD_NVRAM_METADATA_OUT_VERSION_Z_LEN 2
+/* Zero-terminated string describing the content of this partition */
+#define MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_OFST 20
+#define MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_LEN 1
+#define MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_MINNUM 0
+#define MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_MAXNUM 232
+
+
+/***********************************/
+/* MC_CMD_GET_MAC_ADDRESSES
+ * Returns the base MAC, count and stride for the requesting function
*/
-#define MC_CMD_CLP 0x56
+#define MC_CMD_GET_MAC_ADDRESSES 0x55
+#undef MC_CMD_0x55_PRIVILEGE_CTG
+
+#define MC_CMD_0x55_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_GET_MAC_ADDRESSES_IN msgrequest */
+#define MC_CMD_GET_MAC_ADDRESSES_IN_LEN 0
+
+/* MC_CMD_GET_MAC_ADDRESSES_OUT msgresponse */
+#define MC_CMD_GET_MAC_ADDRESSES_OUT_LEN 16
+/* Base MAC address */
+#define MC_CMD_GET_MAC_ADDRESSES_OUT_MAC_ADDR_BASE_OFST 0
+#define MC_CMD_GET_MAC_ADDRESSES_OUT_MAC_ADDR_BASE_LEN 6
+/* Padding */
+#define MC_CMD_GET_MAC_ADDRESSES_OUT_RESERVED_OFST 6
+#define MC_CMD_GET_MAC_ADDRESSES_OUT_RESERVED_LEN 2
+/* Number of allocated MAC addresses */
+#define MC_CMD_GET_MAC_ADDRESSES_OUT_MAC_COUNT_OFST 8
+/* Spacing of allocated MAC addresses */
+#define MC_CMD_GET_MAC_ADDRESSES_OUT_MAC_STRIDE_OFST 12
+
+
+/***********************************/
+/* MC_CMD_CLP
+ * Perform a CLP related operation
+ */
+#define MC_CMD_CLP 0x56
+#undef MC_CMD_0x56_PRIVILEGE_CTG
+
+#define MC_CMD_0x56_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_CLP_IN msgrequest */
#define MC_CMD_CLP_IN_LEN 4
+/* Sub operation */
#define MC_CMD_CLP_IN_OP_OFST 0
-#define MC_CMD_CLP_OP_DEFAULT 0x1 /* enum */
-#define MC_CMD_CLP_OP_SET_MAC 0x2 /* enum */
-#define MC_CMD_CLP_OP_GET_MAC 0x3 /* enum */
-#define MC_CMD_CLP_OP_SET_BOOT 0x4 /* enum */
-#define MC_CMD_CLP_OP_GET_BOOT 0x5 /* enum */
+/* enum: Return to factory default settings */
+#define MC_CMD_CLP_OP_DEFAULT 0x1
+/* enum: Set MAC address */
+#define MC_CMD_CLP_OP_SET_MAC 0x2
+/* enum: Get MAC address */
+#define MC_CMD_CLP_OP_GET_MAC 0x3
+/* enum: Set UEFI/GPXE boot mode */
+#define MC_CMD_CLP_OP_SET_BOOT 0x4
+/* enum: Get UEFI/GPXE boot mode */
+#define MC_CMD_CLP_OP_GET_BOOT 0x5
/* MC_CMD_CLP_OUT msgresponse */
#define MC_CMD_CLP_OUT_LEN 0
@@ -4435,8 +6853,10 @@
/* MC_CMD_CLP_IN_SET_MAC msgrequest */
#define MC_CMD_CLP_IN_SET_MAC_LEN 12
/* MC_CMD_CLP_IN_OP_OFST 0 */
+/* MAC address assigned to port */
#define MC_CMD_CLP_IN_SET_MAC_ADDR_OFST 4
#define MC_CMD_CLP_IN_SET_MAC_ADDR_LEN 6
+/* Padding */
#define MC_CMD_CLP_IN_SET_MAC_RESERVED_OFST 10
#define MC_CMD_CLP_IN_SET_MAC_RESERVED_LEN 2
@@ -4449,14 +6869,17 @@
/* MC_CMD_CLP_OUT_GET_MAC msgresponse */
#define MC_CMD_CLP_OUT_GET_MAC_LEN 8
+/* MAC address assigned to port */
#define MC_CMD_CLP_OUT_GET_MAC_ADDR_OFST 0
#define MC_CMD_CLP_OUT_GET_MAC_ADDR_LEN 6
+/* Padding */
#define MC_CMD_CLP_OUT_GET_MAC_RESERVED_OFST 6
#define MC_CMD_CLP_OUT_GET_MAC_RESERVED_LEN 2
/* MC_CMD_CLP_IN_SET_BOOT msgrequest */
#define MC_CMD_CLP_IN_SET_BOOT_LEN 5
/* MC_CMD_CLP_IN_OP_OFST 0 */
+/* Boot flag */
#define MC_CMD_CLP_IN_SET_BOOT_FLAG_OFST 4
#define MC_CMD_CLP_IN_SET_BOOT_FLAG_LEN 1
@@ -4469,113 +6892,920 @@
/* MC_CMD_CLP_OUT_GET_BOOT msgresponse */
#define MC_CMD_CLP_OUT_GET_BOOT_LEN 4
+/* Boot flag */
#define MC_CMD_CLP_OUT_GET_BOOT_FLAG_OFST 0
#define MC_CMD_CLP_OUT_GET_BOOT_FLAG_LEN 1
+/* Padding */
#define MC_CMD_CLP_OUT_GET_BOOT_RESERVED_OFST 1
#define MC_CMD_CLP_OUT_GET_BOOT_RESERVED_LEN 3
+
+/***********************************/
+/* MC_CMD_MUM
+ * Perform a MUM operation
+ */
+#define MC_CMD_MUM 0x57
+#undef MC_CMD_0x57_PRIVILEGE_CTG
+
+#define MC_CMD_0x57_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_MUM_IN msgrequest */
+#define MC_CMD_MUM_IN_LEN 4
+#define MC_CMD_MUM_IN_OP_HDR_OFST 0
+#define MC_CMD_MUM_IN_OP_LBN 0
+#define MC_CMD_MUM_IN_OP_WIDTH 8
+/* enum: NULL MCDI command to MUM */
+#define MC_CMD_MUM_OP_NULL 0x1
+/* enum: Get MUM version */
+#define MC_CMD_MUM_OP_GET_VERSION 0x2
+/* enum: Issue raw I2C command to MUM */
+#define MC_CMD_MUM_OP_RAW_CMD 0x3
+/* enum: Read from registers on devices connected to MUM. */
+#define MC_CMD_MUM_OP_READ 0x4
+/* enum: Write to registers on devices connected to MUM. */
+#define MC_CMD_MUM_OP_WRITE 0x5
+/* enum: Control UART logging. */
+#define MC_CMD_MUM_OP_LOG 0x6
+/* enum: Operations on MUM GPIO lines */
+#define MC_CMD_MUM_OP_GPIO 0x7
+/* enum: Get sensor readings from MUM */
+#define MC_CMD_MUM_OP_READ_SENSORS 0x8
+/* enum: Initiate clock programming on the MUM */
+#define MC_CMD_MUM_OP_PROGRAM_CLOCKS 0x9
+/* enum: Initiate FPGA load from flash on the MUM */
+#define MC_CMD_MUM_OP_FPGA_LOAD 0xa
+/* enum: Request sensor reading from MUM ADC resulting from earlier request via
+ * MUM ATB
+ */
+#define MC_CMD_MUM_OP_READ_ATB_SENSOR 0xb
+/* enum: Send commands relating to the QSFP ports via the MUM for PHY
+ * operations
+ */
+#define MC_CMD_MUM_OP_QSFP 0xc
+
+/* MC_CMD_MUM_IN_NULL msgrequest */
+#define MC_CMD_MUM_IN_NULL_LEN 4
+/* MUM cmd header */
+#define MC_CMD_MUM_IN_CMD_OFST 0
+
+/* MC_CMD_MUM_IN_GET_VERSION msgrequest */
+#define MC_CMD_MUM_IN_GET_VERSION_LEN 4
+/* MUM cmd header */
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+
+/* MC_CMD_MUM_IN_READ msgrequest */
+#define MC_CMD_MUM_IN_READ_LEN 16
+/* MUM cmd header */
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+/* ID of (device connected to MUM) to read from registers of */
+#define MC_CMD_MUM_IN_READ_DEVICE_OFST 4
+/* enum: Hittite HMC1035 clock generator on Sorrento board */
+#define MC_CMD_MUM_DEV_HITTITE 0x1
+/* enum: Hittite HMC1035 clock generator for NIC-side on Sorrento board */
+#define MC_CMD_MUM_DEV_HITTITE_NIC 0x2
+/* 32-bit address to read from */
+#define MC_CMD_MUM_IN_READ_ADDR_OFST 8
+/* Number of words to read. */
+#define MC_CMD_MUM_IN_READ_NUMWORDS_OFST 12
+
+/* MC_CMD_MUM_IN_WRITE msgrequest */
+#define MC_CMD_MUM_IN_WRITE_LENMIN 16
+#define MC_CMD_MUM_IN_WRITE_LENMAX 252
+#define MC_CMD_MUM_IN_WRITE_LEN(num) (12+4*(num))
+/* MUM cmd header */
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+/* ID of (device connected to MUM) to write to registers of */
+#define MC_CMD_MUM_IN_WRITE_DEVICE_OFST 4
+/* enum: Hittite HMC1035 clock generator on Sorrento board */
+/* MC_CMD_MUM_DEV_HITTITE 0x1 */
+/* 32-bit address to write to */
+#define MC_CMD_MUM_IN_WRITE_ADDR_OFST 8
+/* Words to write */
+#define MC_CMD_MUM_IN_WRITE_BUFFER_OFST 12
+#define MC_CMD_MUM_IN_WRITE_BUFFER_LEN 4
+#define MC_CMD_MUM_IN_WRITE_BUFFER_MINNUM 1
+#define MC_CMD_MUM_IN_WRITE_BUFFER_MAXNUM 60
+
+/* MC_CMD_MUM_IN_RAW_CMD msgrequest */
+#define MC_CMD_MUM_IN_RAW_CMD_LENMIN 17
+#define MC_CMD_MUM_IN_RAW_CMD_LENMAX 252
+#define MC_CMD_MUM_IN_RAW_CMD_LEN(num) (16+1*(num))
+/* MUM cmd header */
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+/* MUM I2C cmd code */
+#define MC_CMD_MUM_IN_RAW_CMD_CMD_CODE_OFST 4
+/* Number of bytes to write */
+#define MC_CMD_MUM_IN_RAW_CMD_NUM_WRITE_OFST 8
+/* Number of bytes to read */
+#define MC_CMD_MUM_IN_RAW_CMD_NUM_READ_OFST 12
+/* Bytes to write */
+#define MC_CMD_MUM_IN_RAW_CMD_WRITE_DATA_OFST 16
+#define MC_CMD_MUM_IN_RAW_CMD_WRITE_DATA_LEN 1
+#define MC_CMD_MUM_IN_RAW_CMD_WRITE_DATA_MINNUM 1
+#define MC_CMD_MUM_IN_RAW_CMD_WRITE_DATA_MAXNUM 236
+
+/* MC_CMD_MUM_IN_LOG msgrequest */
+#define MC_CMD_MUM_IN_LOG_LEN 8
+/* MUM cmd header */
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+#define MC_CMD_MUM_IN_LOG_OP_OFST 4
+#define MC_CMD_MUM_IN_LOG_OP_UART 0x1 /* enum */
+
+/* MC_CMD_MUM_IN_LOG_OP_UART msgrequest */
+#define MC_CMD_MUM_IN_LOG_OP_UART_LEN 12
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+/* MC_CMD_MUM_IN_LOG_OP_OFST 4 */
+/* Enable/disable debug output to UART */
+#define MC_CMD_MUM_IN_LOG_OP_UART_ENABLE_OFST 8
+
+/* MC_CMD_MUM_IN_GPIO msgrequest */
+#define MC_CMD_MUM_IN_GPIO_LEN 8
+/* MUM cmd header */
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+#define MC_CMD_MUM_IN_GPIO_HDR_OFST 4
+#define MC_CMD_MUM_IN_GPIO_OPCODE_LBN 0
+#define MC_CMD_MUM_IN_GPIO_OPCODE_WIDTH 8
+#define MC_CMD_MUM_IN_GPIO_IN_READ 0x0 /* enum */
+#define MC_CMD_MUM_IN_GPIO_OUT_WRITE 0x1 /* enum */
+#define MC_CMD_MUM_IN_GPIO_OUT_READ 0x2 /* enum */
+#define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_WRITE 0x3 /* enum */
+#define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_READ 0x4 /* enum */
+#define MC_CMD_MUM_IN_GPIO_OP 0x5 /* enum */
+
+/* MC_CMD_MUM_IN_GPIO_IN_READ msgrequest */
+#define MC_CMD_MUM_IN_GPIO_IN_READ_LEN 8
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+#define MC_CMD_MUM_IN_GPIO_IN_READ_HDR_OFST 4
+
+/* MC_CMD_MUM_IN_GPIO_OUT_WRITE msgrequest */
+#define MC_CMD_MUM_IN_GPIO_OUT_WRITE_LEN 16
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+#define MC_CMD_MUM_IN_GPIO_OUT_WRITE_HDR_OFST 4
+/* The first 32-bit word to be written to the GPIO OUT register. */
+#define MC_CMD_MUM_IN_GPIO_OUT_WRITE_GPIOMASK1_OFST 8
+/* The second 32-bit word to be written to the GPIO OUT register. */
+#define MC_CMD_MUM_IN_GPIO_OUT_WRITE_GPIOMASK2_OFST 12
+
+/* MC_CMD_MUM_IN_GPIO_OUT_READ msgrequest */
+#define MC_CMD_MUM_IN_GPIO_OUT_READ_LEN 8
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+#define MC_CMD_MUM_IN_GPIO_OUT_READ_HDR_OFST 4
+
+/* MC_CMD_MUM_IN_GPIO_OUT_ENABLE_WRITE msgrequest */
+#define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_WRITE_LEN 16
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+#define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_WRITE_HDR_OFST 4
+/* The first 32-bit word to be written to the GPIO OUT ENABLE register. */
+#define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_WRITE_GPIOMASK1_OFST 8
+/* The second 32-bit word to be written to the GPIO OUT ENABLE register. */
+#define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_WRITE_GPIOMASK2_OFST 12
+
+/* MC_CMD_MUM_IN_GPIO_OUT_ENABLE_READ msgrequest */
+#define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_READ_LEN 8
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+#define MC_CMD_MUM_IN_GPIO_OUT_ENABLE_READ_HDR_OFST 4
+
+/* MC_CMD_MUM_IN_GPIO_OP msgrequest */
+#define MC_CMD_MUM_IN_GPIO_OP_LEN 8
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+#define MC_CMD_MUM_IN_GPIO_OP_HDR_OFST 4
+#define MC_CMD_MUM_IN_GPIO_OP_BITWISE_OP_LBN 8
+#define MC_CMD_MUM_IN_GPIO_OP_BITWISE_OP_WIDTH 8
+#define MC_CMD_MUM_IN_GPIO_OP_OUT_READ 0x0 /* enum */
+#define MC_CMD_MUM_IN_GPIO_OP_OUT_WRITE 0x1 /* enum */
+#define MC_CMD_MUM_IN_GPIO_OP_OUT_CONFIG 0x2 /* enum */
+#define MC_CMD_MUM_IN_GPIO_OP_OUT_ENABLE 0x3 /* enum */
+#define MC_CMD_MUM_IN_GPIO_OP_GPIO_NUMBER_LBN 16
+#define MC_CMD_MUM_IN_GPIO_OP_GPIO_NUMBER_WIDTH 8
+
+/* MC_CMD_MUM_IN_GPIO_OP_OUT_READ msgrequest */
+#define MC_CMD_MUM_IN_GPIO_OP_OUT_READ_LEN 8
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+#define MC_CMD_MUM_IN_GPIO_OP_OUT_READ_HDR_OFST 4
+
+/* MC_CMD_MUM_IN_GPIO_OP_OUT_WRITE msgrequest */
+#define MC_CMD_MUM_IN_GPIO_OP_OUT_WRITE_LEN 8
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+#define MC_CMD_MUM_IN_GPIO_OP_OUT_WRITE_HDR_OFST 4
+#define MC_CMD_MUM_IN_GPIO_OP_OUT_WRITE_WRITEBIT_LBN 24
+#define MC_CMD_MUM_IN_GPIO_OP_OUT_WRITE_WRITEBIT_WIDTH 8
+
+/* MC_CMD_MUM_IN_GPIO_OP_OUT_CONFIG msgrequest */
+#define MC_CMD_MUM_IN_GPIO_OP_OUT_CONFIG_LEN 8
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+#define MC_CMD_MUM_IN_GPIO_OP_OUT_CONFIG_HDR_OFST 4
+#define MC_CMD_MUM_IN_GPIO_OP_OUT_CONFIG_CFG_LBN 24
+#define MC_CMD_MUM_IN_GPIO_OP_OUT_CONFIG_CFG_WIDTH 8
+
+/* MC_CMD_MUM_IN_GPIO_OP_OUT_ENABLE msgrequest */
+#define MC_CMD_MUM_IN_GPIO_OP_OUT_ENABLE_LEN 8
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+#define MC_CMD_MUM_IN_GPIO_OP_OUT_ENABLE_HDR_OFST 4
+#define MC_CMD_MUM_IN_GPIO_OP_OUT_ENABLE_ENABLEBIT_LBN 24
+#define MC_CMD_MUM_IN_GPIO_OP_OUT_ENABLE_ENABLEBIT_WIDTH 8
+
+/* MC_CMD_MUM_IN_READ_SENSORS msgrequest */
+#define MC_CMD_MUM_IN_READ_SENSORS_LEN 8
+/* MUM cmd header */
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+#define MC_CMD_MUM_IN_READ_SENSORS_PARAMS_OFST 4
+#define MC_CMD_MUM_IN_READ_SENSORS_SENSOR_ID_LBN 0
+#define MC_CMD_MUM_IN_READ_SENSORS_SENSOR_ID_WIDTH 8
+#define MC_CMD_MUM_IN_READ_SENSORS_NUM_SENSORS_LBN 8
+#define MC_CMD_MUM_IN_READ_SENSORS_NUM_SENSORS_WIDTH 8
+
+/* MC_CMD_MUM_IN_PROGRAM_CLOCKS msgrequest */
+#define MC_CMD_MUM_IN_PROGRAM_CLOCKS_LEN 12
+/* MUM cmd header */
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+/* Bit-mask of clocks to be programmed */
+#define MC_CMD_MUM_IN_PROGRAM_CLOCKS_MASK_OFST 4
+#define MC_CMD_MUM_CLOCK_ID_FPGA 0x0 /* enum */
+#define MC_CMD_MUM_CLOCK_ID_DDR 0x1 /* enum */
+#define MC_CMD_MUM_CLOCK_ID_NIC 0x2 /* enum */
+/* Control flags for clock programming */
+#define MC_CMD_MUM_IN_PROGRAM_CLOCKS_FLAGS_OFST 8
+#define MC_CMD_MUM_IN_PROGRAM_CLOCKS_OVERCLOCK_110_LBN 0
+#define MC_CMD_MUM_IN_PROGRAM_CLOCKS_OVERCLOCK_110_WIDTH 1
+
+/* MC_CMD_MUM_IN_FPGA_LOAD msgrequest */
+#define MC_CMD_MUM_IN_FPGA_LOAD_LEN 8
+/* MUM cmd header */
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+/* Enable/Disable FPGA config from flash */
+#define MC_CMD_MUM_IN_FPGA_LOAD_ENABLE_OFST 4
+
+/* MC_CMD_MUM_IN_READ_ATB_SENSOR msgrequest */
+#define MC_CMD_MUM_IN_READ_ATB_SENSOR_LEN 4
+/* MUM cmd header */
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+
+/* MC_CMD_MUM_IN_QSFP msgrequest */
+#define MC_CMD_MUM_IN_QSFP_LEN 12
+/* MUM cmd header */
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+#define MC_CMD_MUM_IN_QSFP_HDR_OFST 4
+#define MC_CMD_MUM_IN_QSFP_OPCODE_LBN 0
+#define MC_CMD_MUM_IN_QSFP_OPCODE_WIDTH 4
+#define MC_CMD_MUM_IN_QSFP_INIT 0x0 /* enum */
+#define MC_CMD_MUM_IN_QSFP_RECONFIGURE 0x1 /* enum */
+#define MC_CMD_MUM_IN_QSFP_GET_SUPPORTED_CAP 0x2 /* enum */
+#define MC_CMD_MUM_IN_QSFP_GET_MEDIA_INFO 0x3 /* enum */
+#define MC_CMD_MUM_IN_QSFP_FILL_STATS 0x4 /* enum */
+#define MC_CMD_MUM_IN_QSFP_POLL_BIST 0x5 /* enum */
+#define MC_CMD_MUM_IN_QSFP_IDX_OFST 8
+
+/* MC_CMD_MUM_IN_QSFP_INIT msgrequest */
+#define MC_CMD_MUM_IN_QSFP_INIT_LEN 16
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+#define MC_CMD_MUM_IN_QSFP_INIT_HDR_OFST 4
+#define MC_CMD_MUM_IN_QSFP_INIT_IDX_OFST 8
+#define MC_CMD_MUM_IN_QSFP_INIT_CAGE_OFST 12
+
+/* MC_CMD_MUM_IN_QSFP_RECONFIGURE msgrequest */
+#define MC_CMD_MUM_IN_QSFP_RECONFIGURE_LEN 24
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+#define MC_CMD_MUM_IN_QSFP_RECONFIGURE_HDR_OFST 4
+#define MC_CMD_MUM_IN_QSFP_RECONFIGURE_IDX_OFST 8
+#define MC_CMD_MUM_IN_QSFP_RECONFIGURE_TX_DISABLE_OFST 12
+#define MC_CMD_MUM_IN_QSFP_RECONFIGURE_PORT_LANES_OFST 16
+#define MC_CMD_MUM_IN_QSFP_RECONFIGURE_PORT_LINK_SPEED_OFST 20
+
+/* MC_CMD_MUM_IN_QSFP_GET_SUPPORTED_CAP msgrequest */
+#define MC_CMD_MUM_IN_QSFP_GET_SUPPORTED_CAP_LEN 12
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+#define MC_CMD_MUM_IN_QSFP_GET_SUPPORTED_CAP_HDR_OFST 4
+#define MC_CMD_MUM_IN_QSFP_GET_SUPPORTED_CAP_IDX_OFST 8
+
+/* MC_CMD_MUM_IN_QSFP_GET_MEDIA_INFO msgrequest */
+#define MC_CMD_MUM_IN_QSFP_GET_MEDIA_INFO_LEN 16
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+#define MC_CMD_MUM_IN_QSFP_GET_MEDIA_INFO_HDR_OFST 4
+#define MC_CMD_MUM_IN_QSFP_GET_MEDIA_INFO_IDX_OFST 8
+#define MC_CMD_MUM_IN_QSFP_GET_MEDIA_INFO_PAGE_OFST 12
+
+/* MC_CMD_MUM_IN_QSFP_FILL_STATS msgrequest */
+#define MC_CMD_MUM_IN_QSFP_FILL_STATS_LEN 12
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+#define MC_CMD_MUM_IN_QSFP_FILL_STATS_HDR_OFST 4
+#define MC_CMD_MUM_IN_QSFP_FILL_STATS_IDX_OFST 8
+
+/* MC_CMD_MUM_IN_QSFP_POLL_BIST msgrequest */
+#define MC_CMD_MUM_IN_QSFP_POLL_BIST_LEN 12
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+#define MC_CMD_MUM_IN_QSFP_POLL_BIST_HDR_OFST 4
+#define MC_CMD_MUM_IN_QSFP_POLL_BIST_IDX_OFST 8
+
+/* MC_CMD_MUM_OUT msgresponse */
+#define MC_CMD_MUM_OUT_LEN 0
+
+/* MC_CMD_MUM_OUT_NULL msgresponse */
+#define MC_CMD_MUM_OUT_NULL_LEN 0
+
+/* MC_CMD_MUM_OUT_GET_VERSION msgresponse */
+#define MC_CMD_MUM_OUT_GET_VERSION_LEN 12
+#define MC_CMD_MUM_OUT_GET_VERSION_FIRMWARE_OFST 0
+#define MC_CMD_MUM_OUT_GET_VERSION_VERSION_OFST 4
+#define MC_CMD_MUM_OUT_GET_VERSION_VERSION_LEN 8
+#define MC_CMD_MUM_OUT_GET_VERSION_VERSION_LO_OFST 4
+#define MC_CMD_MUM_OUT_GET_VERSION_VERSION_HI_OFST 8
+
+/* MC_CMD_MUM_OUT_RAW_CMD msgresponse */
+#define MC_CMD_MUM_OUT_RAW_CMD_LENMIN 1
+#define MC_CMD_MUM_OUT_RAW_CMD_LENMAX 252
+#define MC_CMD_MUM_OUT_RAW_CMD_LEN(num) (0+1*(num))
+/* returned data */
+#define MC_CMD_MUM_OUT_RAW_CMD_DATA_OFST 0
+#define MC_CMD_MUM_OUT_RAW_CMD_DATA_LEN 1
+#define MC_CMD_MUM_OUT_RAW_CMD_DATA_MINNUM 1
+#define MC_CMD_MUM_OUT_RAW_CMD_DATA_MAXNUM 252
+
+/* MC_CMD_MUM_OUT_READ msgresponse */
+#define MC_CMD_MUM_OUT_READ_LENMIN 4
+#define MC_CMD_MUM_OUT_READ_LENMAX 252
+#define MC_CMD_MUM_OUT_READ_LEN(num) (0+4*(num))
+#define MC_CMD_MUM_OUT_READ_BUFFER_OFST 0
+#define MC_CMD_MUM_OUT_READ_BUFFER_LEN 4
+#define MC_CMD_MUM_OUT_READ_BUFFER_MINNUM 1
+#define MC_CMD_MUM_OUT_READ_BUFFER_MAXNUM 63
+
+/* MC_CMD_MUM_OUT_WRITE msgresponse */
+#define MC_CMD_MUM_OUT_WRITE_LEN 0
+
+/* MC_CMD_MUM_OUT_LOG msgresponse */
+#define MC_CMD_MUM_OUT_LOG_LEN 0
+
+/* MC_CMD_MUM_OUT_LOG_OP_UART msgresponse */
+#define MC_CMD_MUM_OUT_LOG_OP_UART_LEN 0
+
+/* MC_CMD_MUM_OUT_GPIO_IN_READ msgresponse */
+#define MC_CMD_MUM_OUT_GPIO_IN_READ_LEN 8
+/* The first 32-bit word read from the GPIO IN register. */
+#define MC_CMD_MUM_OUT_GPIO_IN_READ_GPIOMASK1_OFST 0
+/* The second 32-bit word read from the GPIO IN register. */
+#define MC_CMD_MUM_OUT_GPIO_IN_READ_GPIOMASK2_OFST 4
+
+/* MC_CMD_MUM_OUT_GPIO_OUT_WRITE msgresponse */
+#define MC_CMD_MUM_OUT_GPIO_OUT_WRITE_LEN 0
+
+/* MC_CMD_MUM_OUT_GPIO_OUT_READ msgresponse */
+#define MC_CMD_MUM_OUT_GPIO_OUT_READ_LEN 8
+/* The first 32-bit word read from the GPIO OUT register. */
+#define MC_CMD_MUM_OUT_GPIO_OUT_READ_GPIOMASK1_OFST 0
+/* The second 32-bit word read from the GPIO OUT register. */
+#define MC_CMD_MUM_OUT_GPIO_OUT_READ_GPIOMASK2_OFST 4
+
+/* MC_CMD_MUM_OUT_GPIO_OUT_ENABLE_WRITE msgresponse */
+#define MC_CMD_MUM_OUT_GPIO_OUT_ENABLE_WRITE_LEN 0
+
+/* MC_CMD_MUM_OUT_GPIO_OUT_ENABLE_READ msgresponse */
+#define MC_CMD_MUM_OUT_GPIO_OUT_ENABLE_READ_LEN 8
+#define MC_CMD_MUM_OUT_GPIO_OUT_ENABLE_READ_GPIOMASK1_OFST 0
+#define MC_CMD_MUM_OUT_GPIO_OUT_ENABLE_READ_GPIOMASK2_OFST 4
+
+/* MC_CMD_MUM_OUT_GPIO_OP_OUT_READ msgresponse */
+#define MC_CMD_MUM_OUT_GPIO_OP_OUT_READ_LEN 4
+#define MC_CMD_MUM_OUT_GPIO_OP_OUT_READ_BIT_READ_OFST 0
+
+/* MC_CMD_MUM_OUT_GPIO_OP_OUT_WRITE msgresponse */
+#define MC_CMD_MUM_OUT_GPIO_OP_OUT_WRITE_LEN 0
+
+/* MC_CMD_MUM_OUT_GPIO_OP_OUT_CONFIG msgresponse */
+#define MC_CMD_MUM_OUT_GPIO_OP_OUT_CONFIG_LEN 0
+
+/* MC_CMD_MUM_OUT_GPIO_OP_OUT_ENABLE msgresponse */
+#define MC_CMD_MUM_OUT_GPIO_OP_OUT_ENABLE_LEN 0
+
+/* MC_CMD_MUM_OUT_READ_SENSORS msgresponse */
+#define MC_CMD_MUM_OUT_READ_SENSORS_LENMIN 4
+#define MC_CMD_MUM_OUT_READ_SENSORS_LENMAX 252
+#define MC_CMD_MUM_OUT_READ_SENSORS_LEN(num) (0+4*(num))
+#define MC_CMD_MUM_OUT_READ_SENSORS_DATA_OFST 0
+#define MC_CMD_MUM_OUT_READ_SENSORS_DATA_LEN 4
+#define MC_CMD_MUM_OUT_READ_SENSORS_DATA_MINNUM 1
+#define MC_CMD_MUM_OUT_READ_SENSORS_DATA_MAXNUM 63
+#define MC_CMD_MUM_OUT_READ_SENSORS_READING_LBN 0
+#define MC_CMD_MUM_OUT_READ_SENSORS_READING_WIDTH 16
+#define MC_CMD_MUM_OUT_READ_SENSORS_STATE_LBN 16
+#define MC_CMD_MUM_OUT_READ_SENSORS_STATE_WIDTH 8
+#define MC_CMD_MUM_OUT_READ_SENSORS_TYPE_LBN 24
+#define MC_CMD_MUM_OUT_READ_SENSORS_TYPE_WIDTH 8
+
+/* MC_CMD_MUM_OUT_PROGRAM_CLOCKS msgresponse */
+#define MC_CMD_MUM_OUT_PROGRAM_CLOCKS_LEN 4
+#define MC_CMD_MUM_OUT_PROGRAM_CLOCKS_OK_MASK_OFST 0
+
+/* MC_CMD_MUM_OUT_FPGA_LOAD msgresponse */
+#define MC_CMD_MUM_OUT_FPGA_LOAD_LEN 0
+
+/* MC_CMD_MUM_OUT_READ_ATB_SENSOR msgresponse */
+#define MC_CMD_MUM_OUT_READ_ATB_SENSOR_LEN 4
+#define MC_CMD_MUM_OUT_READ_ATB_SENSOR_RESULT_OFST 0
+
+/* MC_CMD_MUM_OUT_QSFP_INIT msgresponse */
+#define MC_CMD_MUM_OUT_QSFP_INIT_LEN 0
+
+/* MC_CMD_MUM_OUT_QSFP_RECONFIGURE msgresponse */
+#define MC_CMD_MUM_OUT_QSFP_RECONFIGURE_LEN 8
+#define MC_CMD_MUM_OUT_QSFP_RECONFIGURE_PORT_PHY_LP_CAP_OFST 0
+#define MC_CMD_MUM_OUT_QSFP_RECONFIGURE_PORT_PHY_FLAGS_OFST 4
+#define MC_CMD_MUM_OUT_QSFP_RECONFIGURE_PORT_PHY_READY_LBN 0
+#define MC_CMD_MUM_OUT_QSFP_RECONFIGURE_PORT_PHY_READY_WIDTH 1
+#define MC_CMD_MUM_OUT_QSFP_RECONFIGURE_PORT_PHY_LINK_UP_LBN 1
+#define MC_CMD_MUM_OUT_QSFP_RECONFIGURE_PORT_PHY_LINK_UP_WIDTH 1
+
+/* MC_CMD_MUM_OUT_QSFP_GET_SUPPORTED_CAP msgresponse */
+#define MC_CMD_MUM_OUT_QSFP_GET_SUPPORTED_CAP_LEN 4
+#define MC_CMD_MUM_OUT_QSFP_GET_SUPPORTED_CAP_PORT_PHY_LP_CAP_OFST 0
+
+/* MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO msgresponse */
+#define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_LENMIN 5
+#define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_LENMAX 252
+#define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_LEN(num) (4+1*(num))
+/* in bytes */
+#define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_DATALEN_OFST 0
+#define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_DATA_OFST 4
+#define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_DATA_LEN 1
+#define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_DATA_MINNUM 1
+#define MC_CMD_MUM_OUT_QSFP_GET_MEDIA_INFO_DATA_MAXNUM 248
+
+/* MC_CMD_MUM_OUT_QSFP_FILL_STATS msgresponse */
+#define MC_CMD_MUM_OUT_QSFP_FILL_STATS_LEN 8
+#define MC_CMD_MUM_OUT_QSFP_FILL_STATS_PORT_PHY_STATS_PMA_PMD_LINK_UP_OFST 0
+#define MC_CMD_MUM_OUT_QSFP_FILL_STATS_PORT_PHY_STATS_PCS_LINK_UP_OFST 4
+
+/* MC_CMD_MUM_OUT_QSFP_POLL_BIST msgresponse */
+#define MC_CMD_MUM_OUT_QSFP_POLL_BIST_LEN 4
+#define MC_CMD_MUM_OUT_QSFP_POLL_BIST_TEST_OFST 0
+
/* MC_CMD_RESOURCE_SPECIFIER enum */
-#define MC_CMD_RESOURCE_INSTANCE_ANY 0xffffffff /* enum */
-#define MC_CMD_RESOURCE_INSTANCE_NONE 0xfffffffe /* enum */
+/* enum: Any */
+#define MC_CMD_RESOURCE_INSTANCE_ANY 0xffffffff
+/* enum: None */
+#define MC_CMD_RESOURCE_INSTANCE_NONE 0xfffffffe
+
+/* EVB_PORT_ID structuredef */
+#define EVB_PORT_ID_LEN 4
+#define EVB_PORT_ID_PORT_ID_OFST 0
+/* enum: An invalid port handle. */
+#define EVB_PORT_ID_NULL 0x0
+/* enum: The port assigned to this function.. */
+#define EVB_PORT_ID_ASSIGNED 0x1000000
+/* enum: External network port 0 */
+#define EVB_PORT_ID_MAC0 0x2000000
+/* enum: External network port 1 */
+#define EVB_PORT_ID_MAC1 0x2000001
+/* enum: External network port 2 */
+#define EVB_PORT_ID_MAC2 0x2000002
+/* enum: External network port 3 */
+#define EVB_PORT_ID_MAC3 0x2000003
+#define EVB_PORT_ID_PORT_ID_LBN 0
+#define EVB_PORT_ID_PORT_ID_WIDTH 32
+
+/* EVB_VLAN_TAG structuredef */
+#define EVB_VLAN_TAG_LEN 2
+/* The VLAN tag value */
+#define EVB_VLAN_TAG_VLAN_ID_LBN 0
+#define EVB_VLAN_TAG_VLAN_ID_WIDTH 12
+#define EVB_VLAN_TAG_MODE_LBN 12
+#define EVB_VLAN_TAG_MODE_WIDTH 4
+/* enum: Insert the VLAN. */
+#define EVB_VLAN_TAG_INSERT 0x0
+/* enum: Replace the VLAN if already present. */
+#define EVB_VLAN_TAG_REPLACE 0x1
+
+/* BUFTBL_ENTRY structuredef */
+#define BUFTBL_ENTRY_LEN 12
+/* the owner ID */
+#define BUFTBL_ENTRY_OID_OFST 0
+#define BUFTBL_ENTRY_OID_LEN 2
+#define BUFTBL_ENTRY_OID_LBN 0
+#define BUFTBL_ENTRY_OID_WIDTH 16
+/* the page parameter as one of ESE_DZ_SMC_PAGE_SIZE_ */
+#define BUFTBL_ENTRY_PGSZ_OFST 2
+#define BUFTBL_ENTRY_PGSZ_LEN 2
+#define BUFTBL_ENTRY_PGSZ_LBN 16
+#define BUFTBL_ENTRY_PGSZ_WIDTH 16
+/* the raw 64-bit address field from the SMC, not adjusted for page size */
+#define BUFTBL_ENTRY_RAWADDR_OFST 4
+#define BUFTBL_ENTRY_RAWADDR_LEN 8
+#define BUFTBL_ENTRY_RAWADDR_LO_OFST 4
+#define BUFTBL_ENTRY_RAWADDR_HI_OFST 8
+#define BUFTBL_ENTRY_RAWADDR_LBN 32
+#define BUFTBL_ENTRY_RAWADDR_WIDTH 64
+
+/* NVRAM_PARTITION_TYPE structuredef */
+#define NVRAM_PARTITION_TYPE_LEN 2
+#define NVRAM_PARTITION_TYPE_ID_OFST 0
+#define NVRAM_PARTITION_TYPE_ID_LEN 2
+/* enum: Primary MC firmware partition */
+#define NVRAM_PARTITION_TYPE_MC_FIRMWARE 0x100
+/* enum: Secondary MC firmware partition */
+#define NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP 0x200
+/* enum: Expansion ROM partition */
+#define NVRAM_PARTITION_TYPE_EXPANSION_ROM 0x300
+/* enum: Static configuration TLV partition */
+#define NVRAM_PARTITION_TYPE_STATIC_CONFIG 0x400
+/* enum: Dynamic configuration TLV partition */
+#define NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG 0x500
+/* enum: Expansion ROM configuration data for port 0 */
+#define NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT0 0x600
+/* enum: Expansion ROM configuration data for port 1 */
+#define NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT1 0x601
+/* enum: Expansion ROM configuration data for port 2 */
+#define NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT2 0x602
+/* enum: Expansion ROM configuration data for port 3 */
+#define NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT3 0x603
+/* enum: Non-volatile log output partition */
+#define NVRAM_PARTITION_TYPE_LOG 0x700
+/* enum: Device state dump output partition */
+#define NVRAM_PARTITION_TYPE_DUMP 0x800
+/* enum: Application license key storage partition */
+#define NVRAM_PARTITION_TYPE_LICENSE 0x900
+/* enum: Start of range used for PHY partitions (low 8 bits are the PHY ID) */
+#define NVRAM_PARTITION_TYPE_PHY_MIN 0xa00
+/* enum: End of range used for PHY partitions (low 8 bits are the PHY ID) */
+#define NVRAM_PARTITION_TYPE_PHY_MAX 0xaff
+/* enum: Primary FPGA partition */
+#define NVRAM_PARTITION_TYPE_FPGA 0xb00
+/* enum: Secondary FPGA partition */
+#define NVRAM_PARTITION_TYPE_FPGA_BACKUP 0xb01
+/* enum: FC firmware partition */
+#define NVRAM_PARTITION_TYPE_FC_FIRMWARE 0xb02
+/* enum: FC License partition */
+#define NVRAM_PARTITION_TYPE_FC_LICENSE 0xb03
+/* enum: Non-volatile log output partition for FC */
+#define NVRAM_PARTITION_TYPE_FC_LOG 0xb04
+/* enum: MUM firmware partition */
+#define NVRAM_PARTITION_TYPE_MUM_FIRMWARE 0xc00
+/* enum: MUM Non-volatile log output partition. */
+#define NVRAM_PARTITION_TYPE_MUM_LOG 0xc01
+/* enum: MUM Application table partition. */
+#define NVRAM_PARTITION_TYPE_MUM_APPTABLE 0xc02
+/* enum: MUM boot rom partition. */
+#define NVRAM_PARTITION_TYPE_MUM_BOOT_ROM 0xc03
+/* enum: MUM production signatures & calibration rom partition. */
+#define NVRAM_PARTITION_TYPE_MUM_PROD_ROM 0xc04
+/* enum: MUM user signatures & calibration rom partition. */
+#define NVRAM_PARTITION_TYPE_MUM_USER_ROM 0xc05
+/* enum: MUM fuses and lockbits partition. */
+#define NVRAM_PARTITION_TYPE_MUM_FUSELOCK 0xc06
+/* enum: Start of reserved value range (firmware may use for any purpose) */
+#define NVRAM_PARTITION_TYPE_RESERVED_VALUES_MIN 0xff00
+/* enum: End of reserved value range (firmware may use for any purpose) */
+#define NVRAM_PARTITION_TYPE_RESERVED_VALUES_MAX 0xfffd
+/* enum: Recovery partition map (provided if real map is missing or corrupt) */
+#define NVRAM_PARTITION_TYPE_RECOVERY_MAP 0xfffe
+/* enum: Partition map (real map as stored in flash) */
+#define NVRAM_PARTITION_TYPE_PARTITION_MAP 0xffff
+#define NVRAM_PARTITION_TYPE_ID_LBN 0
+#define NVRAM_PARTITION_TYPE_ID_WIDTH 16
+
+/* LICENSED_APP_ID structuredef */
+#define LICENSED_APP_ID_LEN 4
+#define LICENSED_APP_ID_ID_OFST 0
+/* enum: OpenOnload */
+#define LICENSED_APP_ID_ONLOAD 0x1
+/* enum: PTP timestamping */
+#define LICENSED_APP_ID_PTP 0x2
+/* enum: SolarCapture Pro */
+#define LICENSED_APP_ID_SOLARCAPTURE_PRO 0x4
+/* enum: SolarSecure filter engine */
+#define LICENSED_APP_ID_SOLARSECURE 0x8
+/* enum: Performance monitor */
+#define LICENSED_APP_ID_PERF_MONITOR 0x10
+/* enum: SolarCapture Live */
+#define LICENSED_APP_ID_SOLARCAPTURE_LIVE 0x20
+/* enum: Capture SolarSystem */
+#define LICENSED_APP_ID_CAPTURE_SOLARSYSTEM 0x40
+/* enum: Network Access Control */
+#define LICENSED_APP_ID_NETWORK_ACCESS_CONTROL 0x80
+#define LICENSED_APP_ID_ID_LBN 0
+#define LICENSED_APP_ID_ID_WIDTH 32
+
+/* TX_TIMESTAMP_EVENT structuredef */
+#define TX_TIMESTAMP_EVENT_LEN 6
+/* lower 16 bits of timestamp data */
+#define TX_TIMESTAMP_EVENT_TSTAMP_DATA_LO_OFST 0
+#define TX_TIMESTAMP_EVENT_TSTAMP_DATA_LO_LEN 2
+#define TX_TIMESTAMP_EVENT_TSTAMP_DATA_LO_LBN 0
+#define TX_TIMESTAMP_EVENT_TSTAMP_DATA_LO_WIDTH 16
+/* Type of TX event, ordinary TX completion, low or high part of TX timestamp
+ */
+#define TX_TIMESTAMP_EVENT_TX_EV_TYPE_OFST 3
+#define TX_TIMESTAMP_EVENT_TX_EV_TYPE_LEN 1
+/* enum: This is a TX completion event, not a timestamp */
+#define TX_TIMESTAMP_EVENT_TX_EV_COMPLETION 0x0
+/* enum: This is the low part of a TX timestamp event */
+#define TX_TIMESTAMP_EVENT_TX_EV_TSTAMP_LO 0x51
+/* enum: This is the high part of a TX timestamp event */
+#define TX_TIMESTAMP_EVENT_TX_EV_TSTAMP_HI 0x52
+#define TX_TIMESTAMP_EVENT_TX_EV_TYPE_LBN 24
+#define TX_TIMESTAMP_EVENT_TX_EV_TYPE_WIDTH 8
+/* upper 16 bits of timestamp data */
+#define TX_TIMESTAMP_EVENT_TSTAMP_DATA_HI_OFST 4
+#define TX_TIMESTAMP_EVENT_TSTAMP_DATA_HI_LEN 2
+#define TX_TIMESTAMP_EVENT_TSTAMP_DATA_HI_LBN 32
+#define TX_TIMESTAMP_EVENT_TSTAMP_DATA_HI_WIDTH 16
+
+/* RSS_MODE structuredef */
+#define RSS_MODE_LEN 1
+/* The RSS mode for a particular packet type is a value from 0 - 15 which can
+ * be considered as 4 bits selecting which fields are included in the hash. (A
+ * value 0 effectively disables RSS spreading for the packet type.) The YAML
+ * generation tools require this structure to be a whole number of bytes wide,
+ * but only 4 bits are relevant.
+ */
+#define RSS_MODE_HASH_SELECTOR_OFST 0
+#define RSS_MODE_HASH_SELECTOR_LEN 1
+#define RSS_MODE_HASH_SRC_ADDR_LBN 0
+#define RSS_MODE_HASH_SRC_ADDR_WIDTH 1
+#define RSS_MODE_HASH_DST_ADDR_LBN 1
+#define RSS_MODE_HASH_DST_ADDR_WIDTH 1
+#define RSS_MODE_HASH_SRC_PORT_LBN 2
+#define RSS_MODE_HASH_SRC_PORT_WIDTH 1
+#define RSS_MODE_HASH_DST_PORT_LBN 3
+#define RSS_MODE_HASH_DST_PORT_WIDTH 1
+#define RSS_MODE_HASH_SELECTOR_LBN 0
+#define RSS_MODE_HASH_SELECTOR_WIDTH 8
/***********************************/
-/* MC_CMD_INIT_EVQ
+/* MC_CMD_READ_REGS
+ * Get a dump of the MCPU registers
*/
-#define MC_CMD_INIT_EVQ 0x50
+#define MC_CMD_READ_REGS 0x50
+#undef MC_CMD_0x50_PRIVILEGE_CTG
+
+#define MC_CMD_0x50_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_READ_REGS_IN msgrequest */
+#define MC_CMD_READ_REGS_IN_LEN 0
+
+/* MC_CMD_READ_REGS_OUT msgresponse */
+#define MC_CMD_READ_REGS_OUT_LEN 308
+/* Whether the corresponding register entry contains a valid value */
+#define MC_CMD_READ_REGS_OUT_MASK_OFST 0
+#define MC_CMD_READ_REGS_OUT_MASK_LEN 16
+/* Same order as MIPS GDB (r0-r31, sr, lo, hi, bad, cause, 32 x float, fsr,
+ * fir, fp)
+ */
+#define MC_CMD_READ_REGS_OUT_REGS_OFST 16
+#define MC_CMD_READ_REGS_OUT_REGS_LEN 4
+#define MC_CMD_READ_REGS_OUT_REGS_NUM 73
+
+
+/***********************************/
+/* MC_CMD_INIT_EVQ
+ * Set up an event queue according to the supplied parameters. The IN arguments
+ * end with an address for each 4k of host memory required to back the EVQ.
+ */
+#define MC_CMD_INIT_EVQ 0x80
+#undef MC_CMD_0x80_PRIVILEGE_CTG
+
+#define MC_CMD_0x80_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_INIT_EVQ_IN msgrequest */
-#define MC_CMD_INIT_EVQ_IN_LENMIN 36
-#define MC_CMD_INIT_EVQ_IN_LENMAX 540
-#define MC_CMD_INIT_EVQ_IN_LEN(num) (28+8*(num))
+#define MC_CMD_INIT_EVQ_IN_LENMIN 44
+#define MC_CMD_INIT_EVQ_IN_LENMAX 548
+#define MC_CMD_INIT_EVQ_IN_LEN(num) (36+8*(num))
+/* Size, in entries */
#define MC_CMD_INIT_EVQ_IN_SIZE_OFST 0
+/* Desired instance. Must be set to a specific instance, which is a function
+ * local queue index.
+ */
#define MC_CMD_INIT_EVQ_IN_INSTANCE_OFST 4
+/* The initial timer value. The load value is ignored if the timer mode is DIS.
+ */
#define MC_CMD_INIT_EVQ_IN_TMR_LOAD_OFST 8
+/* The reload value is ignored in one-shot modes */
#define MC_CMD_INIT_EVQ_IN_TMR_RELOAD_OFST 12
+/* tbd */
#define MC_CMD_INIT_EVQ_IN_FLAGS_OFST 16
#define MC_CMD_INIT_EVQ_IN_FLAG_INTERRUPTING_LBN 0
#define MC_CMD_INIT_EVQ_IN_FLAG_INTERRUPTING_WIDTH 1
#define MC_CMD_INIT_EVQ_IN_FLAG_RPTR_DOS_LBN 1
#define MC_CMD_INIT_EVQ_IN_FLAG_RPTR_DOS_WIDTH 1
+#define MC_CMD_INIT_EVQ_IN_FLAG_INT_ARMD_LBN 2
+#define MC_CMD_INIT_EVQ_IN_FLAG_INT_ARMD_WIDTH 1
+#define MC_CMD_INIT_EVQ_IN_FLAG_CUT_THRU_LBN 3
+#define MC_CMD_INIT_EVQ_IN_FLAG_CUT_THRU_WIDTH 1
+#define MC_CMD_INIT_EVQ_IN_FLAG_RX_MERGE_LBN 4
+#define MC_CMD_INIT_EVQ_IN_FLAG_RX_MERGE_WIDTH 1
+#define MC_CMD_INIT_EVQ_IN_FLAG_TX_MERGE_LBN 5
+#define MC_CMD_INIT_EVQ_IN_FLAG_TX_MERGE_WIDTH 1
#define MC_CMD_INIT_EVQ_IN_TMR_MODE_OFST 20
-#define MC_CMD_INIT_EVQ_IN_TMR_MODE_DIS 0x0 /* enum */
-#define MC_CMD_INIT_EVQ_IN_TMR_IMMED_START 0x1 /* enum */
-#define MC_CMD_INIT_EVQ_IN_TMR_TRIG_START 0x2 /* enum */
-#define MC_CMD_INIT_EVQ_IN_TMR_INT_HLDOFF 0x3 /* enum */
+/* enum: Disabled */
+#define MC_CMD_INIT_EVQ_IN_TMR_MODE_DIS 0x0
+/* enum: Immediate */
+#define MC_CMD_INIT_EVQ_IN_TMR_IMMED_START 0x1
+/* enum: Triggered */
+#define MC_CMD_INIT_EVQ_IN_TMR_TRIG_START 0x2
+/* enum: Hold-off */
+#define MC_CMD_INIT_EVQ_IN_TMR_INT_HLDOFF 0x3
+/* Target EVQ for wakeups if in wakeup mode. */
#define MC_CMD_INIT_EVQ_IN_TARGET_EVQ_OFST 24
+/* Target interrupt if in interrupting mode (note union with target EVQ). Use
+ * MC_CMD_RESOURCE_INSTANCE_ANY unless a specific one required for test
+ * purposes.
+ */
#define MC_CMD_INIT_EVQ_IN_IRQ_NUM_OFST 24
-#define MC_CMD_INIT_EVQ_IN_DMA_ADDR_OFST 28
+/* Event Counter Mode. */
+#define MC_CMD_INIT_EVQ_IN_COUNT_MODE_OFST 28
+/* enum: Disabled */
+#define MC_CMD_INIT_EVQ_IN_COUNT_MODE_DIS 0x0
+/* enum: Disabled */
+#define MC_CMD_INIT_EVQ_IN_COUNT_MODE_RX 0x1
+/* enum: Disabled */
+#define MC_CMD_INIT_EVQ_IN_COUNT_MODE_TX 0x2
+/* enum: Disabled */
+#define MC_CMD_INIT_EVQ_IN_COUNT_MODE_RXTX 0x3
+/* Event queue packet count threshold. */
+#define MC_CMD_INIT_EVQ_IN_COUNT_THRSHLD_OFST 32
+/* 64-bit address of 4k of 4k-aligned host memory buffer */
+#define MC_CMD_INIT_EVQ_IN_DMA_ADDR_OFST 36
#define MC_CMD_INIT_EVQ_IN_DMA_ADDR_LEN 8
-#define MC_CMD_INIT_EVQ_IN_DMA_ADDR_LO_OFST 28
-#define MC_CMD_INIT_EVQ_IN_DMA_ADDR_HI_OFST 32
+#define MC_CMD_INIT_EVQ_IN_DMA_ADDR_LO_OFST 36
+#define MC_CMD_INIT_EVQ_IN_DMA_ADDR_HI_OFST 40
#define MC_CMD_INIT_EVQ_IN_DMA_ADDR_MINNUM 1
#define MC_CMD_INIT_EVQ_IN_DMA_ADDR_MAXNUM 64
/* MC_CMD_INIT_EVQ_OUT msgresponse */
#define MC_CMD_INIT_EVQ_OUT_LEN 4
+/* Only valid if INTRFLAG was true */
#define MC_CMD_INIT_EVQ_OUT_IRQ_OFST 0
/* QUEUE_CRC_MODE structuredef */
#define QUEUE_CRC_MODE_LEN 1
#define QUEUE_CRC_MODE_MODE_LBN 0
#define QUEUE_CRC_MODE_MODE_WIDTH 4
-#define QUEUE_CRC_MODE_NONE 0x0 /* enum */
-#define QUEUE_CRC_MODE_FCOE 0x1 /* enum */
-#define QUEUE_CRC_MODE_ISCSI_HDR 0x2 /* enum */
-#define QUEUE_CRC_MODE_ISCSI 0x3 /* enum */
-#define QUEUE_CRC_MODE_FCOIPOE 0x4 /* enum */
-#define QUEUE_CRC_MODE_MPA 0x5 /* enum */
+/* enum: No CRC. */
+#define QUEUE_CRC_MODE_NONE 0x0
+/* enum: CRC Fiber channel over ethernet. */
+#define QUEUE_CRC_MODE_FCOE 0x1
+/* enum: CRC (digest) iSCSI header only. */
+#define QUEUE_CRC_MODE_ISCSI_HDR 0x2
+/* enum: CRC (digest) iSCSI header and payload. */
+#define QUEUE_CRC_MODE_ISCSI 0x3
+/* enum: CRC Fiber channel over IP over ethernet. */
+#define QUEUE_CRC_MODE_FCOIPOE 0x4
+/* enum: CRC MPA. */
+#define QUEUE_CRC_MODE_MPA 0x5
#define QUEUE_CRC_MODE_SPARE_LBN 4
#define QUEUE_CRC_MODE_SPARE_WIDTH 4
/***********************************/
-/* MC_CMD_INIT_RXQ
+/* MC_CMD_INIT_RXQ
+ * set up a receive queue according to the supplied parameters. The IN
+ * arguments end with an address for each 4k of host memory required to back
+ * the RXQ.
*/
-#define MC_CMD_INIT_RXQ 0x51
+#define MC_CMD_INIT_RXQ 0x81
+#undef MC_CMD_0x81_PRIVILEGE_CTG
+
+#define MC_CMD_0x81_PRIVILEGE_CTG SRIOV_CTG_GENERAL
-/* MC_CMD_INIT_RXQ_IN msgrequest */
-#define MC_CMD_INIT_RXQ_IN_LENMIN 32
-#define MC_CMD_INIT_RXQ_IN_LENMAX 248
-#define MC_CMD_INIT_RXQ_IN_LEN(num) (24+8*(num))
+/* MC_CMD_INIT_RXQ_IN msgrequest: Legacy RXQ_INIT request. Use extended version
+ * in new code.
+ */
+#define MC_CMD_INIT_RXQ_IN_LENMIN 36
+#define MC_CMD_INIT_RXQ_IN_LENMAX 252
+#define MC_CMD_INIT_RXQ_IN_LEN(num) (28+8*(num))
+/* Size, in entries */
#define MC_CMD_INIT_RXQ_IN_SIZE_OFST 0
+/* The EVQ to send events to. This is an index originally specified to INIT_EVQ
+ */
#define MC_CMD_INIT_RXQ_IN_TARGET_EVQ_OFST 4
+/* The value to put in the event data. Check hardware spec. for valid range. */
#define MC_CMD_INIT_RXQ_IN_LABEL_OFST 8
+/* Desired instance. Must be set to a specific instance, which is a function
+ * local queue index.
+ */
#define MC_CMD_INIT_RXQ_IN_INSTANCE_OFST 12
+/* There will be more flags here. */
#define MC_CMD_INIT_RXQ_IN_FLAGS_OFST 16
#define MC_CMD_INIT_RXQ_IN_FLAG_BUFF_MODE_LBN 0
#define MC_CMD_INIT_RXQ_IN_FLAG_BUFF_MODE_WIDTH 1
#define MC_CMD_INIT_RXQ_IN_FLAG_HDR_SPLIT_LBN 1
#define MC_CMD_INIT_RXQ_IN_FLAG_HDR_SPLIT_WIDTH 1
-#define MC_CMD_INIT_RXQ_IN_FLAG_PKT_EDIT_LBN 2
-#define MC_CMD_INIT_RXQ_IN_FLAG_PKT_EDIT_WIDTH 1
+#define MC_CMD_INIT_RXQ_IN_FLAG_TIMESTAMP_LBN 2
+#define MC_CMD_INIT_RXQ_IN_FLAG_TIMESTAMP_WIDTH 1
#define MC_CMD_INIT_RXQ_IN_CRC_MODE_LBN 3
#define MC_CMD_INIT_RXQ_IN_CRC_MODE_WIDTH 4
+#define MC_CMD_INIT_RXQ_IN_FLAG_CHAIN_LBN 7
+#define MC_CMD_INIT_RXQ_IN_FLAG_CHAIN_WIDTH 1
+#define MC_CMD_INIT_RXQ_IN_FLAG_PREFIX_LBN 8
+#define MC_CMD_INIT_RXQ_IN_FLAG_PREFIX_WIDTH 1
+#define MC_CMD_INIT_RXQ_IN_FLAG_DISABLE_SCATTER_LBN 9
+#define MC_CMD_INIT_RXQ_IN_FLAG_DISABLE_SCATTER_WIDTH 1
+/* Owner ID to use if in buffer mode (zero if physical) */
#define MC_CMD_INIT_RXQ_IN_OWNER_ID_OFST 20
-#define MC_CMD_INIT_RXQ_IN_DMA_ADDR_OFST 24
+/* The port ID associated with the v-adaptor which should contain this DMAQ. */
+#define MC_CMD_INIT_RXQ_IN_PORT_ID_OFST 24
+/* 64-bit address of 4k of 4k-aligned host memory buffer */
+#define MC_CMD_INIT_RXQ_IN_DMA_ADDR_OFST 28
#define MC_CMD_INIT_RXQ_IN_DMA_ADDR_LEN 8
-#define MC_CMD_INIT_RXQ_IN_DMA_ADDR_LO_OFST 24
-#define MC_CMD_INIT_RXQ_IN_DMA_ADDR_HI_OFST 28
+#define MC_CMD_INIT_RXQ_IN_DMA_ADDR_LO_OFST 28
+#define MC_CMD_INIT_RXQ_IN_DMA_ADDR_HI_OFST 32
#define MC_CMD_INIT_RXQ_IN_DMA_ADDR_MINNUM 1
#define MC_CMD_INIT_RXQ_IN_DMA_ADDR_MAXNUM 28
+/* MC_CMD_INIT_RXQ_EXT_IN msgrequest: Extended RXQ_INIT with additional mode
+ * flags
+ */
+#define MC_CMD_INIT_RXQ_EXT_IN_LEN 544
+/* Size, in entries */
+#define MC_CMD_INIT_RXQ_EXT_IN_SIZE_OFST 0
+/* The EVQ to send events to. This is an index originally specified to INIT_EVQ
+ */
+#define MC_CMD_INIT_RXQ_EXT_IN_TARGET_EVQ_OFST 4
+/* The value to put in the event data. Check hardware spec. for valid range. */
+#define MC_CMD_INIT_RXQ_EXT_IN_LABEL_OFST 8
+/* Desired instance. Must be set to a specific instance, which is a function
+ * local queue index.
+ */
+#define MC_CMD_INIT_RXQ_EXT_IN_INSTANCE_OFST 12
+/* There will be more flags here. */
+#define MC_CMD_INIT_RXQ_EXT_IN_FLAGS_OFST 16
+#define MC_CMD_INIT_RXQ_EXT_IN_FLAG_BUFF_MODE_LBN 0
+#define MC_CMD_INIT_RXQ_EXT_IN_FLAG_BUFF_MODE_WIDTH 1
+#define MC_CMD_INIT_RXQ_EXT_IN_FLAG_HDR_SPLIT_LBN 1
+#define MC_CMD_INIT_RXQ_EXT_IN_FLAG_HDR_SPLIT_WIDTH 1
+#define MC_CMD_INIT_RXQ_EXT_IN_FLAG_TIMESTAMP_LBN 2
+#define MC_CMD_INIT_RXQ_EXT_IN_FLAG_TIMESTAMP_WIDTH 1
+#define MC_CMD_INIT_RXQ_EXT_IN_CRC_MODE_LBN 3
+#define MC_CMD_INIT_RXQ_EXT_IN_CRC_MODE_WIDTH 4
+#define MC_CMD_INIT_RXQ_EXT_IN_FLAG_CHAIN_LBN 7
+#define MC_CMD_INIT_RXQ_EXT_IN_FLAG_CHAIN_WIDTH 1
+#define MC_CMD_INIT_RXQ_EXT_IN_FLAG_PREFIX_LBN 8
+#define MC_CMD_INIT_RXQ_EXT_IN_FLAG_PREFIX_WIDTH 1
+#define MC_CMD_INIT_RXQ_EXT_IN_FLAG_DISABLE_SCATTER_LBN 9
+#define MC_CMD_INIT_RXQ_EXT_IN_FLAG_DISABLE_SCATTER_WIDTH 1
+#define MC_CMD_INIT_RXQ_EXT_IN_DMA_MODE_LBN 10
+#define MC_CMD_INIT_RXQ_EXT_IN_DMA_MODE_WIDTH 4
+/* enum: One packet per descriptor (for normal networking) */
+#define MC_CMD_INIT_RXQ_EXT_IN_SINGLE_PACKET 0x0
+/* enum: Pack multiple packets into large descriptors (for SolarCapture) */
+#define MC_CMD_INIT_RXQ_EXT_IN_PACKED_STREAM 0x1
+#define MC_CMD_INIT_RXQ_EXT_IN_FLAG_SNAPSHOT_MODE_LBN 14
+#define MC_CMD_INIT_RXQ_EXT_IN_FLAG_SNAPSHOT_MODE_WIDTH 1
+#define MC_CMD_INIT_RXQ_EXT_IN_PACKED_STREAM_BUFF_SIZE_LBN 15
+#define MC_CMD_INIT_RXQ_EXT_IN_PACKED_STREAM_BUFF_SIZE_WIDTH 3
+#define MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_1M 0x0 /* enum */
+#define MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_512K 0x1 /* enum */
+#define MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_256K 0x2 /* enum */
+#define MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_128K 0x3 /* enum */
+#define MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_64K 0x4 /* enum */
+#define MC_CMD_INIT_RXQ_EXT_IN_FLAG_WANT_OUTER_CLASSES_LBN 18
+#define MC_CMD_INIT_RXQ_EXT_IN_FLAG_WANT_OUTER_CLASSES_WIDTH 1
+/* Owner ID to use if in buffer mode (zero if physical) */
+#define MC_CMD_INIT_RXQ_EXT_IN_OWNER_ID_OFST 20
+/* The port ID associated with the v-adaptor which should contain this DMAQ. */
+#define MC_CMD_INIT_RXQ_EXT_IN_PORT_ID_OFST 24
+/* 64-bit address of 4k of 4k-aligned host memory buffer */
+#define MC_CMD_INIT_RXQ_EXT_IN_DMA_ADDR_OFST 28
+#define MC_CMD_INIT_RXQ_EXT_IN_DMA_ADDR_LEN 8
+#define MC_CMD_INIT_RXQ_EXT_IN_DMA_ADDR_LO_OFST 28
+#define MC_CMD_INIT_RXQ_EXT_IN_DMA_ADDR_HI_OFST 32
+#define MC_CMD_INIT_RXQ_EXT_IN_DMA_ADDR_NUM 64
+/* Maximum length of packet to receive, if SNAPSHOT_MODE flag is set */
+#define MC_CMD_INIT_RXQ_EXT_IN_SNAPSHOT_LENGTH_OFST 540
+
/* MC_CMD_INIT_RXQ_OUT msgresponse */
#define MC_CMD_INIT_RXQ_OUT_LEN 0
+/* MC_CMD_INIT_RXQ_EXT_OUT msgresponse */
+#define MC_CMD_INIT_RXQ_EXT_OUT_LEN 0
+
/***********************************/
-/* MC_CMD_INIT_TXQ
+/* MC_CMD_INIT_TXQ
*/
-#define MC_CMD_INIT_TXQ 0x52
+#define MC_CMD_INIT_TXQ 0x82
+#undef MC_CMD_0x82_PRIVILEGE_CTG
+
+#define MC_CMD_0x82_PRIVILEGE_CTG SRIOV_CTG_GENERAL
-/* MC_CMD_INIT_TXQ_IN msgrequest */
-#define MC_CMD_INIT_TXQ_IN_LENMIN 32
-#define MC_CMD_INIT_TXQ_IN_LENMAX 248
-#define MC_CMD_INIT_TXQ_IN_LEN(num) (24+8*(num))
+/* MC_CMD_INIT_TXQ_IN msgrequest: Legacy INIT_TXQ request. Use extended version
+ * in new code.
+ */
+#define MC_CMD_INIT_TXQ_IN_LENMIN 36
+#define MC_CMD_INIT_TXQ_IN_LENMAX 252
+#define MC_CMD_INIT_TXQ_IN_LEN(num) (28+8*(num))
+/* Size, in entries */
#define MC_CMD_INIT_TXQ_IN_SIZE_OFST 0
+/* The EVQ to send events to. This is an index originally specified to
+ * INIT_EVQ.
+ */
#define MC_CMD_INIT_TXQ_IN_TARGET_EVQ_OFST 4
+/* The value to put in the event data. Check hardware spec. for valid range. */
#define MC_CMD_INIT_TXQ_IN_LABEL_OFST 8
+/* Desired instance. Must be set to a specific instance, which is a function
+ * local queue index.
+ */
#define MC_CMD_INIT_TXQ_IN_INSTANCE_OFST 12
+/* There will be more flags here. */
#define MC_CMD_INIT_TXQ_IN_FLAGS_OFST 16
#define MC_CMD_INIT_TXQ_IN_FLAG_BUFF_MODE_LBN 0
#define MC_CMD_INIT_TXQ_IN_FLAG_BUFF_MODE_WIDTH 1
@@ -4587,25 +7817,101 @@
#define MC_CMD_INIT_TXQ_IN_FLAG_TCP_UDP_ONLY_WIDTH 1
#define MC_CMD_INIT_TXQ_IN_CRC_MODE_LBN 4
#define MC_CMD_INIT_TXQ_IN_CRC_MODE_WIDTH 4
+#define MC_CMD_INIT_TXQ_IN_FLAG_TIMESTAMP_LBN 8
+#define MC_CMD_INIT_TXQ_IN_FLAG_TIMESTAMP_WIDTH 1
+#define MC_CMD_INIT_TXQ_IN_FLAG_PACER_BYPASS_LBN 9
+#define MC_CMD_INIT_TXQ_IN_FLAG_PACER_BYPASS_WIDTH 1
+#define MC_CMD_INIT_TXQ_IN_FLAG_INNER_IP_CSUM_EN_LBN 10
+#define MC_CMD_INIT_TXQ_IN_FLAG_INNER_IP_CSUM_EN_WIDTH 1
+#define MC_CMD_INIT_TXQ_IN_FLAG_INNER_TCP_CSUM_EN_LBN 11
+#define MC_CMD_INIT_TXQ_IN_FLAG_INNER_TCP_CSUM_EN_WIDTH 1
+/* Owner ID to use if in buffer mode (zero if physical) */
#define MC_CMD_INIT_TXQ_IN_OWNER_ID_OFST 20
-#define MC_CMD_INIT_TXQ_IN_DMA_ADDR_OFST 24
+/* The port ID associated with the v-adaptor which should contain this DMAQ. */
+#define MC_CMD_INIT_TXQ_IN_PORT_ID_OFST 24
+/* 64-bit address of 4k of 4k-aligned host memory buffer */
+#define MC_CMD_INIT_TXQ_IN_DMA_ADDR_OFST 28
#define MC_CMD_INIT_TXQ_IN_DMA_ADDR_LEN 8
-#define MC_CMD_INIT_TXQ_IN_DMA_ADDR_LO_OFST 24
-#define MC_CMD_INIT_TXQ_IN_DMA_ADDR_HI_OFST 28
+#define MC_CMD_INIT_TXQ_IN_DMA_ADDR_LO_OFST 28
+#define MC_CMD_INIT_TXQ_IN_DMA_ADDR_HI_OFST 32
#define MC_CMD_INIT_TXQ_IN_DMA_ADDR_MINNUM 1
#define MC_CMD_INIT_TXQ_IN_DMA_ADDR_MAXNUM 28
+/* MC_CMD_INIT_TXQ_EXT_IN msgrequest: Extended INIT_TXQ with additional mode
+ * flags
+ */
+#define MC_CMD_INIT_TXQ_EXT_IN_LEN 544
+/* Size, in entries */
+#define MC_CMD_INIT_TXQ_EXT_IN_SIZE_OFST 0
+/* The EVQ to send events to. This is an index originally specified to
+ * INIT_EVQ.
+ */
+#define MC_CMD_INIT_TXQ_EXT_IN_TARGET_EVQ_OFST 4
+/* The value to put in the event data. Check hardware spec. for valid range. */
+#define MC_CMD_INIT_TXQ_EXT_IN_LABEL_OFST 8
+/* Desired instance. Must be set to a specific instance, which is a function
+ * local queue index.
+ */
+#define MC_CMD_INIT_TXQ_EXT_IN_INSTANCE_OFST 12
+/* There will be more flags here. */
+#define MC_CMD_INIT_TXQ_EXT_IN_FLAGS_OFST 16
+#define MC_CMD_INIT_TXQ_EXT_IN_FLAG_BUFF_MODE_LBN 0
+#define MC_CMD_INIT_TXQ_EXT_IN_FLAG_BUFF_MODE_WIDTH 1
+#define MC_CMD_INIT_TXQ_EXT_IN_FLAG_IP_CSUM_DIS_LBN 1
+#define MC_CMD_INIT_TXQ_EXT_IN_FLAG_IP_CSUM_DIS_WIDTH 1
+#define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TCP_CSUM_DIS_LBN 2
+#define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TCP_CSUM_DIS_WIDTH 1
+#define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TCP_UDP_ONLY_LBN 3
+#define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TCP_UDP_ONLY_WIDTH 1
+#define MC_CMD_INIT_TXQ_EXT_IN_CRC_MODE_LBN 4
+#define MC_CMD_INIT_TXQ_EXT_IN_CRC_MODE_WIDTH 4
+#define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TIMESTAMP_LBN 8
+#define MC_CMD_INIT_TXQ_EXT_IN_FLAG_TIMESTAMP_WIDTH 1
+#define MC_CMD_INIT_TXQ_EXT_IN_FLAG_PACER_BYPASS_LBN 9
+#define MC_CMD_INIT_TXQ_EXT_IN_FLAG_PACER_BYPASS_WIDTH 1
+#define MC_CMD_INIT_TXQ_EXT_IN_FLAG_INNER_IP_CSUM_EN_LBN 10
+#define MC_CMD_INIT_TXQ_EXT_IN_FLAG_INNER_IP_CSUM_EN_WIDTH 1
+#define MC_CMD_INIT_TXQ_EXT_IN_FLAG_INNER_TCP_CSUM_EN_LBN 11
+#define MC_CMD_INIT_TXQ_EXT_IN_FLAG_INNER_TCP_CSUM_EN_WIDTH 1
+/* Owner ID to use if in buffer mode (zero if physical) */
+#define MC_CMD_INIT_TXQ_EXT_IN_OWNER_ID_OFST 20
+/* The port ID associated with the v-adaptor which should contain this DMAQ. */
+#define MC_CMD_INIT_TXQ_EXT_IN_PORT_ID_OFST 24
+/* 64-bit address of 4k of 4k-aligned host memory buffer */
+#define MC_CMD_INIT_TXQ_EXT_IN_DMA_ADDR_OFST 28
+#define MC_CMD_INIT_TXQ_EXT_IN_DMA_ADDR_LEN 8
+#define MC_CMD_INIT_TXQ_EXT_IN_DMA_ADDR_LO_OFST 28
+#define MC_CMD_INIT_TXQ_EXT_IN_DMA_ADDR_HI_OFST 32
+#define MC_CMD_INIT_TXQ_EXT_IN_DMA_ADDR_MINNUM 1
+#define MC_CMD_INIT_TXQ_EXT_IN_DMA_ADDR_MAXNUM 64
+/* Flags related to Qbb flow control mode. */
+#define MC_CMD_INIT_TXQ_EXT_IN_QBB_FLAGS_OFST 540
+#define MC_CMD_INIT_TXQ_EXT_IN_QBB_ENABLE_LBN 0
+#define MC_CMD_INIT_TXQ_EXT_IN_QBB_ENABLE_WIDTH 1
+#define MC_CMD_INIT_TXQ_EXT_IN_QBB_PRIORITY_LBN 1
+#define MC_CMD_INIT_TXQ_EXT_IN_QBB_PRIORITY_WIDTH 3
+
/* MC_CMD_INIT_TXQ_OUT msgresponse */
#define MC_CMD_INIT_TXQ_OUT_LEN 0
/***********************************/
-/* MC_CMD_FINI_EVQ
+/* MC_CMD_FINI_EVQ
+ * Teardown an EVQ.
+ *
+ * All DMAQs or EVQs that point to the EVQ to tear down must be torn down first
+ * or the operation will fail with EBUSY
*/
-#define MC_CMD_FINI_EVQ 0x55
+#define MC_CMD_FINI_EVQ 0x83
+#undef MC_CMD_0x83_PRIVILEGE_CTG
+
+#define MC_CMD_0x83_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_FINI_EVQ_IN msgrequest */
#define MC_CMD_FINI_EVQ_IN_LEN 4
+/* Instance of EVQ to destroy. Should be the same instance as that previously
+ * passed to INIT_EVQ
+ */
#define MC_CMD_FINI_EVQ_IN_INSTANCE_OFST 0
/* MC_CMD_FINI_EVQ_OUT msgresponse */
@@ -4613,12 +7919,17 @@
/***********************************/
-/* MC_CMD_FINI_RXQ
+/* MC_CMD_FINI_RXQ
+ * Teardown a RXQ.
*/
-#define MC_CMD_FINI_RXQ 0x56
+#define MC_CMD_FINI_RXQ 0x84
+#undef MC_CMD_0x84_PRIVILEGE_CTG
+
+#define MC_CMD_0x84_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_FINI_RXQ_IN msgrequest */
#define MC_CMD_FINI_RXQ_IN_LEN 4
+/* Instance of RXQ to destroy */
#define MC_CMD_FINI_RXQ_IN_INSTANCE_OFST 0
/* MC_CMD_FINI_RXQ_OUT msgresponse */
@@ -4626,12 +7937,17 @@
/***********************************/
-/* MC_CMD_FINI_TXQ
+/* MC_CMD_FINI_TXQ
+ * Teardown a TXQ.
*/
-#define MC_CMD_FINI_TXQ 0x57
+#define MC_CMD_FINI_TXQ 0x85
+#undef MC_CMD_0x85_PRIVILEGE_CTG
+
+#define MC_CMD_0x85_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_FINI_TXQ_IN msgrequest */
#define MC_CMD_FINI_TXQ_IN_LEN 4
+/* Instance of TXQ to destroy */
#define MC_CMD_FINI_TXQ_IN_INSTANCE_OFST 0
/* MC_CMD_FINI_TXQ_OUT msgresponse */
@@ -4639,102 +7955,247 @@
/***********************************/
-/* MC_CMD_DRIVER_EVENT
+/* MC_CMD_DRIVER_EVENT
+ * Generate an event on an EVQ belonging to the function issuing the command.
*/
-#define MC_CMD_DRIVER_EVENT 0x5a
+#define MC_CMD_DRIVER_EVENT 0x86
+#undef MC_CMD_0x86_PRIVILEGE_CTG
+
+#define MC_CMD_0x86_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_DRIVER_EVENT_IN msgrequest */
#define MC_CMD_DRIVER_EVENT_IN_LEN 12
+/* Handle of target EVQ */
#define MC_CMD_DRIVER_EVENT_IN_EVQ_OFST 0
+/* Bits 0 - 63 of event */
#define MC_CMD_DRIVER_EVENT_IN_DATA_OFST 4
#define MC_CMD_DRIVER_EVENT_IN_DATA_LEN 8
#define MC_CMD_DRIVER_EVENT_IN_DATA_LO_OFST 4
#define MC_CMD_DRIVER_EVENT_IN_DATA_HI_OFST 8
+/* MC_CMD_DRIVER_EVENT_OUT msgresponse */
+#define MC_CMD_DRIVER_EVENT_OUT_LEN 0
+
/***********************************/
-/* MC_CMD_PROXY_CMD
+/* MC_CMD_PROXY_CMD
+ * Execute an arbitrary MCDI command on behalf of a different function, subject
+ * to security restrictions. The command to be proxied follows immediately
+ * afterward in the host buffer (or on the UART). This command supercedes
+ * MC_CMD_SET_FUNC, which remains available for Siena but now deprecated.
*/
-#define MC_CMD_PROXY_CMD 0x5b
+#define MC_CMD_PROXY_CMD 0x5b
+#undef MC_CMD_0x5b_PRIVILEGE_CTG
+
+#define MC_CMD_0x5b_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_PROXY_CMD_IN msgrequest */
#define MC_CMD_PROXY_CMD_IN_LEN 4
+/* The handle of the target function. */
#define MC_CMD_PROXY_CMD_IN_TARGET_OFST 0
+#define MC_CMD_PROXY_CMD_IN_TARGET_PF_LBN 0
+#define MC_CMD_PROXY_CMD_IN_TARGET_PF_WIDTH 16
+#define MC_CMD_PROXY_CMD_IN_TARGET_VF_LBN 16
+#define MC_CMD_PROXY_CMD_IN_TARGET_VF_WIDTH 16
+#define MC_CMD_PROXY_CMD_IN_VF_NULL 0xffff /* enum */
+/* MC_CMD_PROXY_CMD_OUT msgresponse */
+#define MC_CMD_PROXY_CMD_OUT_LEN 0
-/***********************************/
-/* MC_CMD_ALLOC_OWNER_IDS
+/* MC_PROXY_STATUS_BUFFER structuredef: Host memory status buffer used to
+ * manage proxied requests
*/
-#define MC_CMD_ALLOC_OWNER_IDS 0x54
+#define MC_PROXY_STATUS_BUFFER_LEN 16
+/* Handle allocated by the firmware for this proxy transaction */
+#define MC_PROXY_STATUS_BUFFER_HANDLE_OFST 0
+/* enum: An invalid handle. */
+#define MC_PROXY_STATUS_BUFFER_HANDLE_INVALID 0x0
+#define MC_PROXY_STATUS_BUFFER_HANDLE_LBN 0
+#define MC_PROXY_STATUS_BUFFER_HANDLE_WIDTH 32
+/* The requesting physical function number */
+#define MC_PROXY_STATUS_BUFFER_PF_OFST 4
+#define MC_PROXY_STATUS_BUFFER_PF_LEN 2
+#define MC_PROXY_STATUS_BUFFER_PF_LBN 32
+#define MC_PROXY_STATUS_BUFFER_PF_WIDTH 16
+/* The requesting virtual function number. Set to VF_NULL if the target is a
+ * PF.
+ */
+#define MC_PROXY_STATUS_BUFFER_VF_OFST 6
+#define MC_PROXY_STATUS_BUFFER_VF_LEN 2
+#define MC_PROXY_STATUS_BUFFER_VF_LBN 48
+#define MC_PROXY_STATUS_BUFFER_VF_WIDTH 16
+/* The target function RID. */
+#define MC_PROXY_STATUS_BUFFER_RID_OFST 8
+#define MC_PROXY_STATUS_BUFFER_RID_LEN 2
+#define MC_PROXY_STATUS_BUFFER_RID_LBN 64
+#define MC_PROXY_STATUS_BUFFER_RID_WIDTH 16
+/* The status of the proxy as described in MC_CMD_PROXY_COMPLETE. */
+#define MC_PROXY_STATUS_BUFFER_STATUS_OFST 10
+#define MC_PROXY_STATUS_BUFFER_STATUS_LEN 2
+#define MC_PROXY_STATUS_BUFFER_STATUS_LBN 80
+#define MC_PROXY_STATUS_BUFFER_STATUS_WIDTH 16
+/* If a request is authorized rather than carried out by the host, this is the
+ * elevated privilege mask granted to the requesting function.
+ */
+#define MC_PROXY_STATUS_BUFFER_GRANTED_PRIVILEGES_OFST 12
+#define MC_PROXY_STATUS_BUFFER_GRANTED_PRIVILEGES_LBN 96
+#define MC_PROXY_STATUS_BUFFER_GRANTED_PRIVILEGES_WIDTH 32
-/* MC_CMD_ALLOC_OWNER_IDS_IN msgrequest */
-#define MC_CMD_ALLOC_OWNER_IDS_IN_LEN 4
-#define MC_CMD_ALLOC_OWNER_IDS_IN_NIDS_OFST 0
-/* MC_CMD_ALLOC_OWNER_IDS_OUT msgresponse */
-#define MC_CMD_ALLOC_OWNER_IDS_OUT_LEN 12
-#define MC_CMD_ALLOC_OWNER_IDS_OUT_HANDLE_OFST 0
-#define MC_CMD_ALLOC_OWNER_IDS_OUT_NIDS_OFST 4
-#define MC_CMD_ALLOC_OWNER_IDS_OUT_BASE_OFST 8
+/***********************************/
+/* MC_CMD_PROXY_CONFIGURE
+ * Enable/disable authorization of MCDI requests from unprivileged functions by
+ * a designated admin function
+ */
+#define MC_CMD_PROXY_CONFIGURE 0x58
+#undef MC_CMD_0x58_PRIVILEGE_CTG
+
+#define MC_CMD_0x58_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_PROXY_CONFIGURE_IN msgrequest */
+#define MC_CMD_PROXY_CONFIGURE_IN_LEN 108
+#define MC_CMD_PROXY_CONFIGURE_IN_FLAGS_OFST 0
+#define MC_CMD_PROXY_CONFIGURE_IN_ENABLE_LBN 0
+#define MC_CMD_PROXY_CONFIGURE_IN_ENABLE_WIDTH 1
+/* Host provides a contiguous memory buffer that contains at least NUM_BLOCKS
+ * of blocks, each of the size REQUEST_BLOCK_SIZE.
+ */
+#define MC_CMD_PROXY_CONFIGURE_IN_STATUS_BUFF_ADDR_OFST 4
+#define MC_CMD_PROXY_CONFIGURE_IN_STATUS_BUFF_ADDR_LEN 8
+#define MC_CMD_PROXY_CONFIGURE_IN_STATUS_BUFF_ADDR_LO_OFST 4
+#define MC_CMD_PROXY_CONFIGURE_IN_STATUS_BUFF_ADDR_HI_OFST 8
+/* Must be a power of 2 */
+#define MC_CMD_PROXY_CONFIGURE_IN_STATUS_BLOCK_SIZE_OFST 12
+/* Host provides a contiguous memory buffer that contains at least NUM_BLOCKS
+ * of blocks, each of the size REPLY_BLOCK_SIZE.
+ */
+#define MC_CMD_PROXY_CONFIGURE_IN_REQUEST_BUFF_ADDR_OFST 16
+#define MC_CMD_PROXY_CONFIGURE_IN_REQUEST_BUFF_ADDR_LEN 8
+#define MC_CMD_PROXY_CONFIGURE_IN_REQUEST_BUFF_ADDR_LO_OFST 16
+#define MC_CMD_PROXY_CONFIGURE_IN_REQUEST_BUFF_ADDR_HI_OFST 20
+/* Must be a power of 2 */
+#define MC_CMD_PROXY_CONFIGURE_IN_REQUEST_BLOCK_SIZE_OFST 24
+/* Host provides a contiguous memory buffer that contains at least NUM_BLOCKS
+ * of blocks, each of the size STATUS_BLOCK_SIZE. This buffer is only needed if
+ * host intends to complete proxied operations by using MC_CMD_PROXY_CMD.
+ */
+#define MC_CMD_PROXY_CONFIGURE_IN_REPLY_BUFF_ADDR_OFST 28
+#define MC_CMD_PROXY_CONFIGURE_IN_REPLY_BUFF_ADDR_LEN 8
+#define MC_CMD_PROXY_CONFIGURE_IN_REPLY_BUFF_ADDR_LO_OFST 28
+#define MC_CMD_PROXY_CONFIGURE_IN_REPLY_BUFF_ADDR_HI_OFST 32
+/* Must be a power of 2, or zero if this buffer is not provided */
+#define MC_CMD_PROXY_CONFIGURE_IN_REPLY_BLOCK_SIZE_OFST 36
+/* Applies to all three buffers */
+#define MC_CMD_PROXY_CONFIGURE_IN_NUM_BLOCKS_OFST 40
+/* A bit mask defining which MCDI operations may be proxied */
+#define MC_CMD_PROXY_CONFIGURE_IN_ALLOWED_MCDI_MASK_OFST 44
+#define MC_CMD_PROXY_CONFIGURE_IN_ALLOWED_MCDI_MASK_LEN 64
+
+/* MC_CMD_PROXY_CONFIGURE_OUT msgresponse */
+#define MC_CMD_PROXY_CONFIGURE_OUT_LEN 0
/***********************************/
-/* MC_CMD_FREE_OWNER_IDS
+/* MC_CMD_PROXY_COMPLETE
+ * Tells FW that a requested proxy operation has either been completed (by
+ * using MC_CMD_PROXY_CMD) or authorized/declined. May only be sent by the
+ * function that enabled proxying/authorization (by using
+ * MC_CMD_PROXY_CONFIGURE).
*/
-#define MC_CMD_FREE_OWNER_IDS 0x59
+#define MC_CMD_PROXY_COMPLETE 0x5f
+#undef MC_CMD_0x5f_PRIVILEGE_CTG
+
+#define MC_CMD_0x5f_PRIVILEGE_CTG SRIOV_CTG_ADMIN
-/* MC_CMD_FREE_OWNER_IDS_IN msgrequest */
-#define MC_CMD_FREE_OWNER_IDS_IN_LEN 4
-#define MC_CMD_FREE_OWNER_IDS_IN_HANDLE_OFST 0
+/* MC_CMD_PROXY_COMPLETE_IN msgrequest */
+#define MC_CMD_PROXY_COMPLETE_IN_LEN 12
+#define MC_CMD_PROXY_COMPLETE_IN_BLOCK_INDEX_OFST 0
+#define MC_CMD_PROXY_COMPLETE_IN_STATUS_OFST 4
+/* enum: The operation has been completed by using MC_CMD_PROXY_CMD, the reply
+ * is stored in the REPLY_BUFF.
+ */
+#define MC_CMD_PROXY_COMPLETE_IN_COMPLETE 0x0
+/* enum: The operation has been authorized. The originating function may now
+ * try again.
+ */
+#define MC_CMD_PROXY_COMPLETE_IN_AUTHORIZED 0x1
+/* enum: The operation has been declined. */
+#define MC_CMD_PROXY_COMPLETE_IN_DECLINED 0x2
+/* enum: The authorization failed because the relevant application did not
+ * respond in time.
+ */
+#define MC_CMD_PROXY_COMPLETE_IN_TIMEDOUT 0x3
+#define MC_CMD_PROXY_COMPLETE_IN_HANDLE_OFST 8
-/* MC_CMD_FREE_OWNER_IDS_OUT msgresponse */
-#define MC_CMD_FREE_OWNER_IDS_OUT_LEN 0
+/* MC_CMD_PROXY_COMPLETE_OUT msgresponse */
+#define MC_CMD_PROXY_COMPLETE_OUT_LEN 0
/***********************************/
-/* MC_CMD_ALLOC_BUFTBL_CHUNK
+/* MC_CMD_ALLOC_BUFTBL_CHUNK
+ * Allocate a set of buffer table entries using the specified owner ID. This
+ * operation allocates the required buffer table entries (and fails if it
+ * cannot do so). The buffer table entries will initially be zeroed.
*/
-#define MC_CMD_ALLOC_BUFTBL_CHUNK 0x5c
+#define MC_CMD_ALLOC_BUFTBL_CHUNK 0x87
+#undef MC_CMD_0x87_PRIVILEGE_CTG
+
+#define MC_CMD_0x87_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
/* MC_CMD_ALLOC_BUFTBL_CHUNK_IN msgrequest */
#define MC_CMD_ALLOC_BUFTBL_CHUNK_IN_LEN 8
+/* Owner ID to use */
#define MC_CMD_ALLOC_BUFTBL_CHUNK_IN_OWNER_OFST 0
+/* Size of buffer table pages to use, in bytes (note that only a few values are
+ * legal on any specific hardware).
+ */
#define MC_CMD_ALLOC_BUFTBL_CHUNK_IN_PAGE_SIZE_OFST 4
/* MC_CMD_ALLOC_BUFTBL_CHUNK_OUT msgresponse */
#define MC_CMD_ALLOC_BUFTBL_CHUNK_OUT_LEN 12
#define MC_CMD_ALLOC_BUFTBL_CHUNK_OUT_HANDLE_OFST 0
#define MC_CMD_ALLOC_BUFTBL_CHUNK_OUT_NUMENTRIES_OFST 4
+/* Buffer table IDs for use in DMA descriptors. */
#define MC_CMD_ALLOC_BUFTBL_CHUNK_OUT_ID_OFST 8
/***********************************/
-/* MC_CMD_PROGRAM_BUFTBL_ENTRIES
+/* MC_CMD_PROGRAM_BUFTBL_ENTRIES
+ * Reprogram a set of buffer table entries in the specified chunk.
*/
-#define MC_CMD_PROGRAM_BUFTBL_ENTRIES 0x5d
+#define MC_CMD_PROGRAM_BUFTBL_ENTRIES 0x88
+#undef MC_CMD_0x88_PRIVILEGE_CTG
+
+#define MC_CMD_0x88_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
/* MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN msgrequest */
#define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_LENMIN 20
-#define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_LENMAX 252
+#define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_LENMAX 268
#define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_LEN(num) (12+8*(num))
#define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_HANDLE_OFST 0
+/* ID */
#define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_FIRSTID_OFST 4
+/* Num entries */
#define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_NUMENTRIES_OFST 8
+/* Buffer table entry address */
#define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_OFST 12
#define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_LEN 8
#define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_LO_OFST 12
#define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_HI_OFST 16
#define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_MINNUM 1
-#define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_MAXNUM 30
+#define MC_CMD_PROGRAM_BUFTBL_ENTRIES_IN_ENTRY_MAXNUM 32
/* MC_CMD_PROGRAM_BUFTBL_ENTRIES_OUT msgresponse */
#define MC_CMD_PROGRAM_BUFTBL_ENTRIES_OUT_LEN 0
/***********************************/
-/* MC_CMD_FREE_BUFTBL_CHUNK
+/* MC_CMD_FREE_BUFTBL_CHUNK
*/
-#define MC_CMD_FREE_BUFTBL_CHUNK 0x5e
+#define MC_CMD_FREE_BUFTBL_CHUNK 0x89
+#undef MC_CMD_0x89_PRIVILEGE_CTG
+
+#define MC_CMD_0x89_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
/* MC_CMD_FREE_BUFTBL_CHUNK_IN msgrequest */
#define MC_CMD_FREE_BUFTBL_CHUNK_IN_LEN 4
@@ -4743,35 +8204,80 @@
/* MC_CMD_FREE_BUFTBL_CHUNK_OUT msgresponse */
#define MC_CMD_FREE_BUFTBL_CHUNK_OUT_LEN 0
-
-/***********************************/
-/* MC_CMD_GET_PF_COUNT
- */
-#define MC_CMD_GET_PF_COUNT 0x60
-
-/* MC_CMD_GET_PF_COUNT_IN msgrequest */
-#define MC_CMD_GET_PF_COUNT_IN_LEN 0
-
-/* MC_CMD_GET_PF_COUNT_OUT msgresponse */
-#define MC_CMD_GET_PF_COUNT_OUT_LEN 1
-#define MC_CMD_GET_PF_COUNT_OUT_PF_COUNT_OFST 0
-#define MC_CMD_GET_PF_COUNT_OUT_PF_COUNT_LEN 1
+/* PORT_CONFIG_ENTRY structuredef */
+#define PORT_CONFIG_ENTRY_LEN 16
+/* External port number (label) */
+#define PORT_CONFIG_ENTRY_EXT_NUMBER_OFST 0
+#define PORT_CONFIG_ENTRY_EXT_NUMBER_LEN 1
+#define PORT_CONFIG_ENTRY_EXT_NUMBER_LBN 0
+#define PORT_CONFIG_ENTRY_EXT_NUMBER_WIDTH 8
+/* Port core location */
+#define PORT_CONFIG_ENTRY_CORE_OFST 1
+#define PORT_CONFIG_ENTRY_CORE_LEN 1
+#define PORT_CONFIG_ENTRY_STANDALONE 0x0 /* enum */
+#define PORT_CONFIG_ENTRY_MASTER 0x1 /* enum */
+#define PORT_CONFIG_ENTRY_SLAVE 0x2 /* enum */
+#define PORT_CONFIG_ENTRY_CORE_LBN 8
+#define PORT_CONFIG_ENTRY_CORE_WIDTH 8
+/* Internal number (HW resource) relative to the core */
+#define PORT_CONFIG_ENTRY_INT_NUMBER_OFST 2
+#define PORT_CONFIG_ENTRY_INT_NUMBER_LEN 1
+#define PORT_CONFIG_ENTRY_INT_NUMBER_LBN 16
+#define PORT_CONFIG_ENTRY_INT_NUMBER_WIDTH 8
+/* Reserved */
+#define PORT_CONFIG_ENTRY_RSVD_OFST 3
+#define PORT_CONFIG_ENTRY_RSVD_LEN 1
+#define PORT_CONFIG_ENTRY_RSVD_LBN 24
+#define PORT_CONFIG_ENTRY_RSVD_WIDTH 8
+/* Bitmask of KR lanes used by the port */
+#define PORT_CONFIG_ENTRY_LANES_OFST 4
+#define PORT_CONFIG_ENTRY_LANES_LBN 32
+#define PORT_CONFIG_ENTRY_LANES_WIDTH 32
+/* Port capabilities (MC_CMD_PHY_CAP_*) */
+#define PORT_CONFIG_ENTRY_SUPPORTED_CAPS_OFST 8
+#define PORT_CONFIG_ENTRY_SUPPORTED_CAPS_LBN 64
+#define PORT_CONFIG_ENTRY_SUPPORTED_CAPS_WIDTH 32
+/* Reserved (align to 16 bytes) */
+#define PORT_CONFIG_ENTRY_RSVD2_OFST 12
+#define PORT_CONFIG_ENTRY_RSVD2_LBN 96
+#define PORT_CONFIG_ENTRY_RSVD2_WIDTH 32
/***********************************/
-/* MC_CMD_FILTER_OP
+/* MC_CMD_FILTER_OP
+ * Multiplexed MCDI call for filter operations
*/
-#define MC_CMD_FILTER_OP 0x61
+#define MC_CMD_FILTER_OP 0x8a
+#undef MC_CMD_0x8a_PRIVILEGE_CTG
+
+#define MC_CMD_0x8a_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_FILTER_OP_IN msgrequest */
-#define MC_CMD_FILTER_OP_IN_LEN 100
+#define MC_CMD_FILTER_OP_IN_LEN 108
+/* identifies the type of operation requested */
#define MC_CMD_FILTER_OP_IN_OP_OFST 0
-#define MC_CMD_FILTER_OP_IN_OP_INSERT 0x0 /* enum */
-#define MC_CMD_FILTER_OP_IN_OP_REMOVE 0x1 /* enum */
-#define MC_CMD_FILTER_OP_IN_OP_SUBSCRIBE 0x2 /* enum */
-#define MC_CMD_FILTER_OP_IN_OP_UNSUBSCRIBE 0x3 /* enum */
+/* enum: single-recipient filter insert */
+#define MC_CMD_FILTER_OP_IN_OP_INSERT 0x0
+/* enum: single-recipient filter remove */
+#define MC_CMD_FILTER_OP_IN_OP_REMOVE 0x1
+/* enum: multi-recipient filter subscribe */
+#define MC_CMD_FILTER_OP_IN_OP_SUBSCRIBE 0x2
+/* enum: multi-recipient filter unsubscribe */
+#define MC_CMD_FILTER_OP_IN_OP_UNSUBSCRIBE 0x3
+/* enum: replace one recipient with another (warning - the filter handle may
+ * change)
+ */
+#define MC_CMD_FILTER_OP_IN_OP_REPLACE 0x4
+/* filter handle (for remove / unsubscribe operations) */
#define MC_CMD_FILTER_OP_IN_HANDLE_OFST 4
-#define MC_CMD_FILTER_OP_IN_MATCH_FIELDS_OFST 8
+#define MC_CMD_FILTER_OP_IN_HANDLE_LEN 8
+#define MC_CMD_FILTER_OP_IN_HANDLE_LO_OFST 4
+#define MC_CMD_FILTER_OP_IN_HANDLE_HI_OFST 8
+/* The port ID associated with the v-adaptor which should contain this filter.
+ */
+#define MC_CMD_FILTER_OP_IN_PORT_ID_OFST 12
+/* fields to include in match criteria */
+#define MC_CMD_FILTER_OP_IN_MATCH_FIELDS_OFST 16
#define MC_CMD_FILTER_OP_IN_MATCH_SRC_IP_LBN 0
#define MC_CMD_FILTER_OP_IN_MATCH_SRC_IP_WIDTH 1
#define MC_CMD_FILTER_OP_IN_MATCH_DST_IP_LBN 1
@@ -4796,63 +8302,493 @@
#define MC_CMD_FILTER_OP_IN_MATCH_FWDEF0_WIDTH 1
#define MC_CMD_FILTER_OP_IN_MATCH_FWDEF1_LBN 11
#define MC_CMD_FILTER_OP_IN_MATCH_FWDEF1_WIDTH 1
-#define MC_CMD_FILTER_OP_IN_RX_DEST_OFST 12
-#define MC_CMD_FILTER_OP_IN_RX_DEST_DROP 0x0 /* enum */
-#define MC_CMD_FILTER_OP_IN_RX_DEST_HOST 0x1 /* enum */
-#define MC_CMD_FILTER_OP_IN_RX_DEST_MC 0x2 /* enum */
-#define MC_CMD_FILTER_OP_IN_RX_DEST_TX0 0x3 /* enum */
-#define MC_CMD_FILTER_OP_IN_RX_DEST_TX1 0x4 /* enum */
-#define MC_CMD_FILTER_OP_IN_RX_QUEUE_OFST 16
-#define MC_CMD_FILTER_OP_IN_RX_FLAGS_OFST 20
-#define MC_CMD_FILTER_OP_IN_RX_FLAG_RSS_LBN 0
-#define MC_CMD_FILTER_OP_IN_RX_FLAG_RSS_WIDTH 1
-#define MC_CMD_FILTER_OP_IN_RSS_CONTEXT_OFST 24
-#define MC_CMD_FILTER_OP_IN_TX_DOMAIN_OFST 28
-#define MC_CMD_FILTER_OP_IN_TX_DEST_OFST 32
+#define MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_MCAST_DST_LBN 30
+#define MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_MCAST_DST_WIDTH 1
+#define MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_UCAST_DST_LBN 31
+#define MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_UCAST_DST_WIDTH 1
+/* receive destination */
+#define MC_CMD_FILTER_OP_IN_RX_DEST_OFST 20
+/* enum: drop packets */
+#define MC_CMD_FILTER_OP_IN_RX_DEST_DROP 0x0
+/* enum: receive to host */
+#define MC_CMD_FILTER_OP_IN_RX_DEST_HOST 0x1
+/* enum: receive to MC */
+#define MC_CMD_FILTER_OP_IN_RX_DEST_MC 0x2
+/* enum: loop back to TXDP 0 */
+#define MC_CMD_FILTER_OP_IN_RX_DEST_TX0 0x3
+/* enum: loop back to TXDP 1 */
+#define MC_CMD_FILTER_OP_IN_RX_DEST_TX1 0x4
+/* receive queue handle (for multiple queue modes, this is the base queue) */
+#define MC_CMD_FILTER_OP_IN_RX_QUEUE_OFST 24
+/* receive mode */
+#define MC_CMD_FILTER_OP_IN_RX_MODE_OFST 28
+/* enum: receive to just the specified queue */
+#define MC_CMD_FILTER_OP_IN_RX_MODE_SIMPLE 0x0
+/* enum: receive to multiple queues using RSS context */
+#define MC_CMD_FILTER_OP_IN_RX_MODE_RSS 0x1
+/* enum: receive to multiple queues using .1p mapping */
+#define MC_CMD_FILTER_OP_IN_RX_MODE_DOT1P_MAPPING 0x2
+/* enum: install a filter entry that will never match; for test purposes only
+ */
+#define MC_CMD_FILTER_OP_IN_RX_MODE_TEST_NEVER_MATCH 0x80000000
+/* RSS context (for RX_MODE_RSS) or .1p mapping handle (for
+ * RX_MODE_DOT1P_MAPPING), as returned by MC_CMD_RSS_CONTEXT_ALLOC or
+ * MC_CMD_DOT1P_MAPPING_ALLOC.
+ */
+#define MC_CMD_FILTER_OP_IN_RX_CONTEXT_OFST 32
+/* transmit domain (reserved; set to 0) */
+#define MC_CMD_FILTER_OP_IN_TX_DOMAIN_OFST 36
+/* transmit destination (either set the MAC and/or PM bits for explicit
+ * control, or set this field to TX_DEST_DEFAULT for sensible default
+ * behaviour)
+ */
+#define MC_CMD_FILTER_OP_IN_TX_DEST_OFST 40
+/* enum: request default behaviour (based on filter type) */
+#define MC_CMD_FILTER_OP_IN_TX_DEST_DEFAULT 0xffffffff
#define MC_CMD_FILTER_OP_IN_TX_DEST_MAC_LBN 0
#define MC_CMD_FILTER_OP_IN_TX_DEST_MAC_WIDTH 1
#define MC_CMD_FILTER_OP_IN_TX_DEST_PM_LBN 1
#define MC_CMD_FILTER_OP_IN_TX_DEST_PM_WIDTH 1
-#define MC_CMD_FILTER_OP_IN_SRC_MAC_OFST 36
+/* source MAC address to match (as bytes in network order) */
+#define MC_CMD_FILTER_OP_IN_SRC_MAC_OFST 44
#define MC_CMD_FILTER_OP_IN_SRC_MAC_LEN 6
-#define MC_CMD_FILTER_OP_IN_SRC_PORT_OFST 42
+/* source port to match (as bytes in network order) */
+#define MC_CMD_FILTER_OP_IN_SRC_PORT_OFST 50
#define MC_CMD_FILTER_OP_IN_SRC_PORT_LEN 2
-#define MC_CMD_FILTER_OP_IN_DST_MAC_OFST 44
+/* destination MAC address to match (as bytes in network order) */
+#define MC_CMD_FILTER_OP_IN_DST_MAC_OFST 52
#define MC_CMD_FILTER_OP_IN_DST_MAC_LEN 6
-#define MC_CMD_FILTER_OP_IN_DST_PORT_OFST 50
+/* destination port to match (as bytes in network order) */
+#define MC_CMD_FILTER_OP_IN_DST_PORT_OFST 58
#define MC_CMD_FILTER_OP_IN_DST_PORT_LEN 2
-#define MC_CMD_FILTER_OP_IN_ETHER_TYPE_OFST 52
+/* Ethernet type to match (as bytes in network order) */
+#define MC_CMD_FILTER_OP_IN_ETHER_TYPE_OFST 60
#define MC_CMD_FILTER_OP_IN_ETHER_TYPE_LEN 2
-#define MC_CMD_FILTER_OP_IN_INNER_VLAN_OFST 54
+/* Inner VLAN tag to match (as bytes in network order) */
+#define MC_CMD_FILTER_OP_IN_INNER_VLAN_OFST 62
#define MC_CMD_FILTER_OP_IN_INNER_VLAN_LEN 2
-#define MC_CMD_FILTER_OP_IN_OUTER_VLAN_OFST 56
+/* Outer VLAN tag to match (as bytes in network order) */
+#define MC_CMD_FILTER_OP_IN_OUTER_VLAN_OFST 64
#define MC_CMD_FILTER_OP_IN_OUTER_VLAN_LEN 2
-#define MC_CMD_FILTER_OP_IN_IP_PROTO_OFST 58
+/* IP protocol to match (in low byte; set high byte to 0) */
+#define MC_CMD_FILTER_OP_IN_IP_PROTO_OFST 66
#define MC_CMD_FILTER_OP_IN_IP_PROTO_LEN 2
-#define MC_CMD_FILTER_OP_IN_FWDEF0_OFST 60
-#define MC_CMD_FILTER_OP_IN_FWDEF1_OFST 64
-#define MC_CMD_FILTER_OP_IN_SRC_IP_OFST 68
+/* Firmware defined register 0 to match (reserved; set to 0) */
+#define MC_CMD_FILTER_OP_IN_FWDEF0_OFST 68
+/* Firmware defined register 1 to match (reserved; set to 0) */
+#define MC_CMD_FILTER_OP_IN_FWDEF1_OFST 72
+/* source IP address to match (as bytes in network order; set last 12 bytes to
+ * 0 for IPv4 address)
+ */
+#define MC_CMD_FILTER_OP_IN_SRC_IP_OFST 76
#define MC_CMD_FILTER_OP_IN_SRC_IP_LEN 16
-#define MC_CMD_FILTER_OP_IN_DST_IP_OFST 84
+/* destination IP address to match (as bytes in network order; set last 12
+ * bytes to 0 for IPv4 address)
+ */
+#define MC_CMD_FILTER_OP_IN_DST_IP_OFST 92
#define MC_CMD_FILTER_OP_IN_DST_IP_LEN 16
+/* MC_CMD_FILTER_OP_EXT_IN msgrequest: Extension to MC_CMD_FILTER_OP_IN to
+ * include handling of VXLAN/NVGRE encapsulated frame filtering (which is
+ * supported on Medford only).
+ */
+#define MC_CMD_FILTER_OP_EXT_IN_LEN 172
+/* identifies the type of operation requested */
+#define MC_CMD_FILTER_OP_EXT_IN_OP_OFST 0
+/* Enum values, see field(s): */
+/* MC_CMD_FILTER_OP_IN/OP */
+/* filter handle (for remove / unsubscribe operations) */
+#define MC_CMD_FILTER_OP_EXT_IN_HANDLE_OFST 4
+#define MC_CMD_FILTER_OP_EXT_IN_HANDLE_LEN 8
+#define MC_CMD_FILTER_OP_EXT_IN_HANDLE_LO_OFST 4
+#define MC_CMD_FILTER_OP_EXT_IN_HANDLE_HI_OFST 8
+/* The port ID associated with the v-adaptor which should contain this filter.
+ */
+#define MC_CMD_FILTER_OP_EXT_IN_PORT_ID_OFST 12
+/* fields to include in match criteria */
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_FIELDS_OFST 16
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_IP_LBN 0
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_IP_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_IP_LBN 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_IP_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_MAC_LBN 2
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_MAC_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_PORT_LBN 3
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_PORT_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_MAC_LBN 4
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_MAC_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_PORT_LBN 5
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_PORT_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_ETHER_TYPE_LBN 6
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_ETHER_TYPE_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_INNER_VLAN_LBN 7
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_INNER_VLAN_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_OUTER_VLAN_LBN 8
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_OUTER_VLAN_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IP_PROTO_LBN 9
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IP_PROTO_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_FWDEF0_LBN 10
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_FWDEF0_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_VNI_OR_VSID_LBN 11
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_VNI_OR_VSID_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_SRC_IP_LBN 12
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_SRC_IP_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_DST_IP_LBN 13
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_DST_IP_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_SRC_MAC_LBN 14
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_SRC_MAC_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_SRC_PORT_LBN 15
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_SRC_PORT_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_DST_MAC_LBN 16
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_DST_MAC_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_DST_PORT_LBN 17
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_DST_PORT_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_ETHER_TYPE_LBN 18
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_ETHER_TYPE_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_INNER_VLAN_LBN 19
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_INNER_VLAN_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_OUTER_VLAN_LBN 20
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_OUTER_VLAN_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_IP_PROTO_LBN 21
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_IP_PROTO_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_FWDEF0_LBN 22
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_FWDEF0_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_FWDEF1_LBN 23
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_FWDEF1_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_UNKNOWN_MCAST_DST_LBN 24
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_UNKNOWN_MCAST_DST_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_UNKNOWN_UCAST_DST_LBN 25
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_UNKNOWN_UCAST_DST_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_MCAST_DST_LBN 30
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_MCAST_DST_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_UCAST_DST_LBN 31
+#define MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_UCAST_DST_WIDTH 1
+/* receive destination */
+#define MC_CMD_FILTER_OP_EXT_IN_RX_DEST_OFST 20
+/* enum: drop packets */
+#define MC_CMD_FILTER_OP_EXT_IN_RX_DEST_DROP 0x0
+/* enum: receive to host */
+#define MC_CMD_FILTER_OP_EXT_IN_RX_DEST_HOST 0x1
+/* enum: receive to MC */
+#define MC_CMD_FILTER_OP_EXT_IN_RX_DEST_MC 0x2
+/* enum: loop back to TXDP 0 */
+#define MC_CMD_FILTER_OP_EXT_IN_RX_DEST_TX0 0x3
+/* enum: loop back to TXDP 1 */
+#define MC_CMD_FILTER_OP_EXT_IN_RX_DEST_TX1 0x4
+/* receive queue handle (for multiple queue modes, this is the base queue) */
+#define MC_CMD_FILTER_OP_EXT_IN_RX_QUEUE_OFST 24
+/* receive mode */
+#define MC_CMD_FILTER_OP_EXT_IN_RX_MODE_OFST 28
+/* enum: receive to just the specified queue */
+#define MC_CMD_FILTER_OP_EXT_IN_RX_MODE_SIMPLE 0x0
+/* enum: receive to multiple queues using RSS context */
+#define MC_CMD_FILTER_OP_EXT_IN_RX_MODE_RSS 0x1
+/* enum: receive to multiple queues using .1p mapping */
+#define MC_CMD_FILTER_OP_EXT_IN_RX_MODE_DOT1P_MAPPING 0x2
+/* enum: install a filter entry that will never match; for test purposes only
+ */
+#define MC_CMD_FILTER_OP_EXT_IN_RX_MODE_TEST_NEVER_MATCH 0x80000000
+/* RSS context (for RX_MODE_RSS) or .1p mapping handle (for
+ * RX_MODE_DOT1P_MAPPING), as returned by MC_CMD_RSS_CONTEXT_ALLOC or
+ * MC_CMD_DOT1P_MAPPING_ALLOC.
+ */
+#define MC_CMD_FILTER_OP_EXT_IN_RX_CONTEXT_OFST 32
+/* transmit domain (reserved; set to 0) */
+#define MC_CMD_FILTER_OP_EXT_IN_TX_DOMAIN_OFST 36
+/* transmit destination (either set the MAC and/or PM bits for explicit
+ * control, or set this field to TX_DEST_DEFAULT for sensible default
+ * behaviour)
+ */
+#define MC_CMD_FILTER_OP_EXT_IN_TX_DEST_OFST 40
+/* enum: request default behaviour (based on filter type) */
+#define MC_CMD_FILTER_OP_EXT_IN_TX_DEST_DEFAULT 0xffffffff
+#define MC_CMD_FILTER_OP_EXT_IN_TX_DEST_MAC_LBN 0
+#define MC_CMD_FILTER_OP_EXT_IN_TX_DEST_MAC_WIDTH 1
+#define MC_CMD_FILTER_OP_EXT_IN_TX_DEST_PM_LBN 1
+#define MC_CMD_FILTER_OP_EXT_IN_TX_DEST_PM_WIDTH 1
+/* source MAC address to match (as bytes in network order) */
+#define MC_CMD_FILTER_OP_EXT_IN_SRC_MAC_OFST 44
+#define MC_CMD_FILTER_OP_EXT_IN_SRC_MAC_LEN 6
+/* source port to match (as bytes in network order) */
+#define MC_CMD_FILTER_OP_EXT_IN_SRC_PORT_OFST 50
+#define MC_CMD_FILTER_OP_EXT_IN_SRC_PORT_LEN 2
+/* destination MAC address to match (as bytes in network order) */
+#define MC_CMD_FILTER_OP_EXT_IN_DST_MAC_OFST 52
+#define MC_CMD_FILTER_OP_EXT_IN_DST_MAC_LEN 6
+/* destination port to match (as bytes in network order) */
+#define MC_CMD_FILTER_OP_EXT_IN_DST_PORT_OFST 58
+#define MC_CMD_FILTER_OP_EXT_IN_DST_PORT_LEN 2
+/* Ethernet type to match (as bytes in network order) */
+#define MC_CMD_FILTER_OP_EXT_IN_ETHER_TYPE_OFST 60
+#define MC_CMD_FILTER_OP_EXT_IN_ETHER_TYPE_LEN 2
+/* Inner VLAN tag to match (as bytes in network order) */
+#define MC_CMD_FILTER_OP_EXT_IN_INNER_VLAN_OFST 62
+#define MC_CMD_FILTER_OP_EXT_IN_INNER_VLAN_LEN 2
+/* Outer VLAN tag to match (as bytes in network order) */
+#define MC_CMD_FILTER_OP_EXT_IN_OUTER_VLAN_OFST 64
+#define MC_CMD_FILTER_OP_EXT_IN_OUTER_VLAN_LEN 2
+/* IP protocol to match (in low byte; set high byte to 0) */
+#define MC_CMD_FILTER_OP_EXT_IN_IP_PROTO_OFST 66
+#define MC_CMD_FILTER_OP_EXT_IN_IP_PROTO_LEN 2
+/* Firmware defined register 0 to match (reserved; set to 0) */
+#define MC_CMD_FILTER_OP_EXT_IN_FWDEF0_OFST 68
+/* VNI (for VXLAN/Geneve, when IP protocol is UDP) or VSID (for NVGRE, when IP
+ * protocol is GRE) to match (as bytes in network order; set last byte to 0 for
+ * VXLAN/NVGRE, or 1 for Geneve)
+ */
+#define MC_CMD_FILTER_OP_EXT_IN_VNI_OR_VSID_OFST 72
+#define MC_CMD_FILTER_OP_EXT_IN_VNI_VALUE_LBN 0
+#define MC_CMD_FILTER_OP_EXT_IN_VNI_VALUE_WIDTH 24
+#define MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_LBN 24
+#define MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_WIDTH 8
+/* enum: Match VXLAN traffic with this VNI */
+#define MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_VXLAN 0x0
+/* enum: Match Geneve traffic with this VNI */
+#define MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_GENEVE 0x1
+/* enum: Reserved for experimental development use */
+#define MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_EXPERIMENTAL 0xfe
+#define MC_CMD_FILTER_OP_EXT_IN_VSID_VALUE_LBN 0
+#define MC_CMD_FILTER_OP_EXT_IN_VSID_VALUE_WIDTH 24
+#define MC_CMD_FILTER_OP_EXT_IN_VSID_TYPE_LBN 24
+#define MC_CMD_FILTER_OP_EXT_IN_VSID_TYPE_WIDTH 8
+/* enum: Match NVGRE traffic with this VSID */
+#define MC_CMD_FILTER_OP_EXT_IN_VSID_TYPE_NVGRE 0x0
+/* source IP address to match (as bytes in network order; set last 12 bytes to
+ * 0 for IPv4 address)
+ */
+#define MC_CMD_FILTER_OP_EXT_IN_SRC_IP_OFST 76
+#define MC_CMD_FILTER_OP_EXT_IN_SRC_IP_LEN 16
+/* destination IP address to match (as bytes in network order; set last 12
+ * bytes to 0 for IPv4 address)
+ */
+#define MC_CMD_FILTER_OP_EXT_IN_DST_IP_OFST 92
+#define MC_CMD_FILTER_OP_EXT_IN_DST_IP_LEN 16
+/* VXLAN/NVGRE inner frame source MAC address to match (as bytes in network
+ * order)
+ */
+#define MC_CMD_FILTER_OP_EXT_IN_IFRM_SRC_MAC_OFST 108
+#define MC_CMD_FILTER_OP_EXT_IN_IFRM_SRC_MAC_LEN 6
+/* VXLAN/NVGRE inner frame source port to match (as bytes in network order) */
+#define MC_CMD_FILTER_OP_EXT_IN_IFRM_SRC_PORT_OFST 114
+#define MC_CMD_FILTER_OP_EXT_IN_IFRM_SRC_PORT_LEN 2
+/* VXLAN/NVGRE inner frame destination MAC address to match (as bytes in
+ * network order)
+ */
+#define MC_CMD_FILTER_OP_EXT_IN_IFRM_DST_MAC_OFST 116
+#define MC_CMD_FILTER_OP_EXT_IN_IFRM_DST_MAC_LEN 6
+/* VXLAN/NVGRE inner frame destination port to match (as bytes in network
+ * order)
+ */
+#define MC_CMD_FILTER_OP_EXT_IN_IFRM_DST_PORT_OFST 122
+#define MC_CMD_FILTER_OP_EXT_IN_IFRM_DST_PORT_LEN 2
+/* VXLAN/NVGRE inner frame Ethernet type to match (as bytes in network order)
+ */
+#define MC_CMD_FILTER_OP_EXT_IN_IFRM_ETHER_TYPE_OFST 124
+#define MC_CMD_FILTER_OP_EXT_IN_IFRM_ETHER_TYPE_LEN 2
+/* VXLAN/NVGRE inner frame Inner VLAN tag to match (as bytes in network order)
+ */
+#define MC_CMD_FILTER_OP_EXT_IN_IFRM_INNER_VLAN_OFST 126
+#define MC_CMD_FILTER_OP_EXT_IN_IFRM_INNER_VLAN_LEN 2
+/* VXLAN/NVGRE inner frame Outer VLAN tag to match (as bytes in network order)
+ */
+#define MC_CMD_FILTER_OP_EXT_IN_IFRM_OUTER_VLAN_OFST 128
+#define MC_CMD_FILTER_OP_EXT_IN_IFRM_OUTER_VLAN_LEN 2
+/* VXLAN/NVGRE inner frame IP protocol to match (in low byte; set high byte to
+ * 0)
+ */
+#define MC_CMD_FILTER_OP_EXT_IN_IFRM_IP_PROTO_OFST 130
+#define MC_CMD_FILTER_OP_EXT_IN_IFRM_IP_PROTO_LEN 2
+/* VXLAN/NVGRE inner frame Firmware defined register 0 to match (reserved; set
+ * to 0)
+ */
+#define MC_CMD_FILTER_OP_EXT_IN_IFRM_FWDEF0_OFST 132
+/* VXLAN/NVGRE inner frame Firmware defined register 1 to match (reserved; set
+ * to 0)
+ */
+#define MC_CMD_FILTER_OP_EXT_IN_IFRM_FWDEF1_OFST 136
+/* VXLAN/NVGRE inner frame source IP address to match (as bytes in network
+ * order; set last 12 bytes to 0 for IPv4 address)
+ */
+#define MC_CMD_FILTER_OP_EXT_IN_IFRM_SRC_IP_OFST 140
+#define MC_CMD_FILTER_OP_EXT_IN_IFRM_SRC_IP_LEN 16
+/* VXLAN/NVGRE inner frame destination IP address to match (as bytes in network
+ * order; set last 12 bytes to 0 for IPv4 address)
+ */
+#define MC_CMD_FILTER_OP_EXT_IN_IFRM_DST_IP_OFST 156
+#define MC_CMD_FILTER_OP_EXT_IN_IFRM_DST_IP_LEN 16
+
/* MC_CMD_FILTER_OP_OUT msgresponse */
-#define MC_CMD_FILTER_OP_OUT_LEN 8
+#define MC_CMD_FILTER_OP_OUT_LEN 12
+/* identifies the type of operation requested */
#define MC_CMD_FILTER_OP_OUT_OP_OFST 0
-#define MC_CMD_FILTER_OP_OUT_OP_INSERT 0x0 /* enum */
-#define MC_CMD_FILTER_OP_OUT_OP_REMOVE 0x1 /* enum */
-#define MC_CMD_FILTER_OP_OUT_OP_SUBSCRIBE 0x2 /* enum */
-#define MC_CMD_FILTER_OP_OUT_OP_UNSUBSCRIBE 0x3 /* enum */
+/* Enum values, see field(s): */
+/* MC_CMD_FILTER_OP_IN/OP */
+/* Returned filter handle (for insert / subscribe operations). Note that these
+ * handles should be considered opaque to the host, although a value of
+ * 0xFFFFFFFF_FFFFFFFF is guaranteed never to be a valid handle.
+ */
#define MC_CMD_FILTER_OP_OUT_HANDLE_OFST 4
+#define MC_CMD_FILTER_OP_OUT_HANDLE_LEN 8
+#define MC_CMD_FILTER_OP_OUT_HANDLE_LO_OFST 4
+#define MC_CMD_FILTER_OP_OUT_HANDLE_HI_OFST 8
+/* enum: guaranteed invalid filter handle (low 32 bits) */
+#define MC_CMD_FILTER_OP_OUT_HANDLE_LO_INVALID 0xffffffff
+/* enum: guaranteed invalid filter handle (high 32 bits) */
+#define MC_CMD_FILTER_OP_OUT_HANDLE_HI_INVALID 0xffffffff
+
+/* MC_CMD_FILTER_OP_EXT_OUT msgresponse */
+#define MC_CMD_FILTER_OP_EXT_OUT_LEN 12
+/* identifies the type of operation requested */
+#define MC_CMD_FILTER_OP_EXT_OUT_OP_OFST 0
+/* Enum values, see field(s): */
+/* MC_CMD_FILTER_OP_EXT_IN/OP */
+/* Returned filter handle (for insert / subscribe operations). Note that these
+ * handles should be considered opaque to the host, although a value of
+ * 0xFFFFFFFF_FFFFFFFF is guaranteed never to be a valid handle.
+ */
+#define MC_CMD_FILTER_OP_EXT_OUT_HANDLE_OFST 4
+#define MC_CMD_FILTER_OP_EXT_OUT_HANDLE_LEN 8
+#define MC_CMD_FILTER_OP_EXT_OUT_HANDLE_LO_OFST 4
+#define MC_CMD_FILTER_OP_EXT_OUT_HANDLE_HI_OFST 8
+/* Enum values, see field(s): */
+/* MC_CMD_FILTER_OP_OUT/HANDLE */
+
+
+/***********************************/
+/* MC_CMD_GET_PARSER_DISP_INFO
+ * Get information related to the parser-dispatcher subsystem
+ */
+#define MC_CMD_GET_PARSER_DISP_INFO 0xe4
+#undef MC_CMD_0xe4_PRIVILEGE_CTG
+
+#define MC_CMD_0xe4_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_GET_PARSER_DISP_INFO_IN msgrequest */
+#define MC_CMD_GET_PARSER_DISP_INFO_IN_LEN 4
+/* identifies the type of operation requested */
+#define MC_CMD_GET_PARSER_DISP_INFO_IN_OP_OFST 0
+/* enum: read the list of supported RX filter matches */
+#define MC_CMD_GET_PARSER_DISP_INFO_IN_OP_GET_SUPPORTED_RX_MATCHES 0x1
+/* enum: read flags indicating restrictions on filter insertion for the calling
+ * client
+ */
+#define MC_CMD_GET_PARSER_DISP_INFO_IN_OP_GET_RESTRICTIONS 0x2
+
+/* MC_CMD_GET_PARSER_DISP_INFO_OUT msgresponse */
+#define MC_CMD_GET_PARSER_DISP_INFO_OUT_LENMIN 8
+#define MC_CMD_GET_PARSER_DISP_INFO_OUT_LENMAX 252
+#define MC_CMD_GET_PARSER_DISP_INFO_OUT_LEN(num) (8+4*(num))
+/* identifies the type of operation requested */
+#define MC_CMD_GET_PARSER_DISP_INFO_OUT_OP_OFST 0
+/* Enum values, see field(s): */
+/* MC_CMD_GET_PARSER_DISP_INFO_IN/OP */
+/* number of supported match types */
+#define MC_CMD_GET_PARSER_DISP_INFO_OUT_NUM_SUPPORTED_MATCHES_OFST 4
+/* array of supported match types (valid MATCH_FIELDS values for
+ * MC_CMD_FILTER_OP) sorted in decreasing priority order
+ */
+#define MC_CMD_GET_PARSER_DISP_INFO_OUT_SUPPORTED_MATCHES_OFST 8
+#define MC_CMD_GET_PARSER_DISP_INFO_OUT_SUPPORTED_MATCHES_LEN 4
+#define MC_CMD_GET_PARSER_DISP_INFO_OUT_SUPPORTED_MATCHES_MINNUM 0
+#define MC_CMD_GET_PARSER_DISP_INFO_OUT_SUPPORTED_MATCHES_MAXNUM 61
+
+/* MC_CMD_GET_PARSER_DISP_RESTRICTIONS_OUT msgresponse */
+#define MC_CMD_GET_PARSER_DISP_RESTRICTIONS_OUT_LEN 8
+/* identifies the type of operation requested */
+#define MC_CMD_GET_PARSER_DISP_RESTRICTIONS_OUT_OP_OFST 0
+/* Enum values, see field(s): */
+/* MC_CMD_GET_PARSER_DISP_INFO_IN/OP */
+/* bitfield of filter insertion restrictions */
+#define MC_CMD_GET_PARSER_DISP_RESTRICTIONS_OUT_RESTRICTION_FLAGS_OFST 4
+#define MC_CMD_GET_PARSER_DISP_RESTRICTIONS_OUT_DST_IP_MCAST_ONLY_LBN 0
+#define MC_CMD_GET_PARSER_DISP_RESTRICTIONS_OUT_DST_IP_MCAST_ONLY_WIDTH 1
+
+
+/***********************************/
+/* MC_CMD_PARSER_DISP_RW
+ * Direct read/write of parser-dispatcher state (DICPUs and LUE) for debugging
+ */
+#define MC_CMD_PARSER_DISP_RW 0xe5
+#undef MC_CMD_0xe5_PRIVILEGE_CTG
+
+#define MC_CMD_0xe5_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_PARSER_DISP_RW_IN msgrequest */
+#define MC_CMD_PARSER_DISP_RW_IN_LEN 32
+/* identifies the target of the operation */
+#define MC_CMD_PARSER_DISP_RW_IN_TARGET_OFST 0
+/* enum: RX dispatcher CPU */
+#define MC_CMD_PARSER_DISP_RW_IN_RX_DICPU 0x0
+/* enum: TX dispatcher CPU */
+#define MC_CMD_PARSER_DISP_RW_IN_TX_DICPU 0x1
+/* enum: Lookup engine (with original metadata format) */
+#define MC_CMD_PARSER_DISP_RW_IN_LUE 0x2
+/* enum: Lookup engine (with requested metadata format) */
+#define MC_CMD_PARSER_DISP_RW_IN_LUE_VERSIONED_METADATA 0x3
+/* identifies the type of operation requested */
+#define MC_CMD_PARSER_DISP_RW_IN_OP_OFST 4
+/* enum: read a word of DICPU DMEM or a LUE entry */
+#define MC_CMD_PARSER_DISP_RW_IN_READ 0x0
+/* enum: write a word of DICPU DMEM or a LUE entry */
+#define MC_CMD_PARSER_DISP_RW_IN_WRITE 0x1
+/* enum: read-modify-write a word of DICPU DMEM (not valid for LUE) */
+#define MC_CMD_PARSER_DISP_RW_IN_RMW 0x2
+/* data memory address or LUE index */
+#define MC_CMD_PARSER_DISP_RW_IN_ADDRESS_OFST 8
+/* value to write (for DMEM writes) */
+#define MC_CMD_PARSER_DISP_RW_IN_DMEM_WRITE_VALUE_OFST 12
+/* XOR value (for DMEM read-modify-writes: new = (old & mask) ^ value) */
+#define MC_CMD_PARSER_DISP_RW_IN_DMEM_RMW_XOR_VALUE_OFST 12
+/* AND mask (for DMEM read-modify-writes: new = (old & mask) ^ value) */
+#define MC_CMD_PARSER_DISP_RW_IN_DMEM_RMW_AND_MASK_OFST 16
+/* metadata format (for LUE reads using LUE_VERSIONED_METADATA) */
+#define MC_CMD_PARSER_DISP_RW_IN_LUE_READ_METADATA_VERSION_OFST 12
+/* value to write (for LUE writes) */
+#define MC_CMD_PARSER_DISP_RW_IN_LUE_WRITE_VALUE_OFST 12
+#define MC_CMD_PARSER_DISP_RW_IN_LUE_WRITE_VALUE_LEN 20
+
+/* MC_CMD_PARSER_DISP_RW_OUT msgresponse */
+#define MC_CMD_PARSER_DISP_RW_OUT_LEN 52
+/* value read (for DMEM reads) */
+#define MC_CMD_PARSER_DISP_RW_OUT_DMEM_READ_VALUE_OFST 0
+/* value read (for LUE reads) */
+#define MC_CMD_PARSER_DISP_RW_OUT_LUE_READ_VALUE_OFST 0
+#define MC_CMD_PARSER_DISP_RW_OUT_LUE_READ_VALUE_LEN 20
+/* up to 8 32-bit words of additional soft state from the LUE manager (the
+ * exact content is firmware-dependent and intended only for debug use)
+ */
+#define MC_CMD_PARSER_DISP_RW_OUT_LUE_MGR_STATE_OFST 20
+#define MC_CMD_PARSER_DISP_RW_OUT_LUE_MGR_STATE_LEN 32
/***********************************/
-/* MC_CMD_SET_PF_COUNT
+/* MC_CMD_GET_PF_COUNT
+ * Get number of PFs on the device.
*/
-#define MC_CMD_SET_PF_COUNT 0x62
+#define MC_CMD_GET_PF_COUNT 0xb6
+#undef MC_CMD_0xb6_PRIVILEGE_CTG
+
+#define MC_CMD_0xb6_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_GET_PF_COUNT_IN msgrequest */
+#define MC_CMD_GET_PF_COUNT_IN_LEN 0
+
+/* MC_CMD_GET_PF_COUNT_OUT msgresponse */
+#define MC_CMD_GET_PF_COUNT_OUT_LEN 1
+/* Identifies the number of PFs on the device. */
+#define MC_CMD_GET_PF_COUNT_OUT_PF_COUNT_OFST 0
+#define MC_CMD_GET_PF_COUNT_OUT_PF_COUNT_LEN 1
+
+
+/***********************************/
+/* MC_CMD_SET_PF_COUNT
+ * Set number of PFs on the device.
+ */
+#define MC_CMD_SET_PF_COUNT 0xb7
/* MC_CMD_SET_PF_COUNT_IN msgrequest */
#define MC_CMD_SET_PF_COUNT_IN_LEN 4
+/* New number of PFs on the device. */
#define MC_CMD_SET_PF_COUNT_IN_PF_COUNT_OFST 0
/* MC_CMD_SET_PF_COUNT_OUT msgresponse */
@@ -4860,25 +8796,35 @@
/***********************************/
-/* MC_CMD_GET_PORT_ASSIGNMENT
+/* MC_CMD_GET_PORT_ASSIGNMENT
+ * Get port assignment for current PCI function.
*/
-#define MC_CMD_GET_PORT_ASSIGNMENT 0x63
+#define MC_CMD_GET_PORT_ASSIGNMENT 0xb8
+#undef MC_CMD_0xb8_PRIVILEGE_CTG
+
+#define MC_CMD_0xb8_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_GET_PORT_ASSIGNMENT_IN msgrequest */
#define MC_CMD_GET_PORT_ASSIGNMENT_IN_LEN 0
/* MC_CMD_GET_PORT_ASSIGNMENT_OUT msgresponse */
#define MC_CMD_GET_PORT_ASSIGNMENT_OUT_LEN 4
+/* Identifies the port assignment for this function. */
#define MC_CMD_GET_PORT_ASSIGNMENT_OUT_PORT_OFST 0
/***********************************/
-/* MC_CMD_SET_PORT_ASSIGNMENT
+/* MC_CMD_SET_PORT_ASSIGNMENT
+ * Set port assignment for current PCI function.
*/
-#define MC_CMD_SET_PORT_ASSIGNMENT 0x64
+#define MC_CMD_SET_PORT_ASSIGNMENT 0xb9
+#undef MC_CMD_0xb9_PRIVILEGE_CTG
+
+#define MC_CMD_0xb9_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_SET_PORT_ASSIGNMENT_IN msgrequest */
#define MC_CMD_SET_PORT_ASSIGNMENT_IN_LEN 4
+/* Identifies the port assignment for this function. */
#define MC_CMD_SET_PORT_ASSIGNMENT_IN_PORT_OFST 0
/* MC_CMD_SET_PORT_ASSIGNMENT_OUT msgresponse */
@@ -4886,22 +8832,53 @@
/***********************************/
-/* MC_CMD_ALLOC_VIS
+/* MC_CMD_ALLOC_VIS
+ * Allocate VIs for current PCI function.
*/
-#define MC_CMD_ALLOC_VIS 0x65
+#define MC_CMD_ALLOC_VIS 0x8b
+#undef MC_CMD_0x8b_PRIVILEGE_CTG
-/* MC_CMD_ALLOC_VIS_IN msgrequest */
-#define MC_CMD_ALLOC_VIS_IN_LEN 4
-#define MC_CMD_ALLOC_VIS_IN_VI_COUNT_OFST 0
+#define MC_CMD_0x8b_PRIVILEGE_CTG SRIOV_CTG_GENERAL
-/* MC_CMD_ALLOC_VIS_OUT msgresponse */
-#define MC_CMD_ALLOC_VIS_OUT_LEN 0
+/* MC_CMD_ALLOC_VIS_IN msgrequest */
+#define MC_CMD_ALLOC_VIS_IN_LEN 8
+/* The minimum number of VIs that is acceptable */
+#define MC_CMD_ALLOC_VIS_IN_MIN_VI_COUNT_OFST 0
+/* The maximum number of VIs that would be useful */
+#define MC_CMD_ALLOC_VIS_IN_MAX_VI_COUNT_OFST 4
+
+/* MC_CMD_ALLOC_VIS_OUT msgresponse: Huntington-compatible VI_ALLOC request.
+ * Use extended version in new code.
+ */
+#define MC_CMD_ALLOC_VIS_OUT_LEN 8
+/* The number of VIs allocated on this function */
+#define MC_CMD_ALLOC_VIS_OUT_VI_COUNT_OFST 0
+/* The base absolute VI number allocated to this function. Required to
+ * correctly interpret wakeup events.
+ */
+#define MC_CMD_ALLOC_VIS_OUT_VI_BASE_OFST 4
+
+/* MC_CMD_ALLOC_VIS_EXT_OUT msgresponse */
+#define MC_CMD_ALLOC_VIS_EXT_OUT_LEN 12
+/* The number of VIs allocated on this function */
+#define MC_CMD_ALLOC_VIS_EXT_OUT_VI_COUNT_OFST 0
+/* The base absolute VI number allocated to this function. Required to
+ * correctly interpret wakeup events.
+ */
+#define MC_CMD_ALLOC_VIS_EXT_OUT_VI_BASE_OFST 4
+/* Function's port vi_shift value (always 0 on Huntington) */
+#define MC_CMD_ALLOC_VIS_EXT_OUT_VI_SHIFT_OFST 8
/***********************************/
-/* MC_CMD_FREE_VIS
+/* MC_CMD_FREE_VIS
+ * Free VIs for current PCI function. Any linked PIO buffers will be unlinked,
+ * but not freed.
*/
-#define MC_CMD_FREE_VIS 0x66
+#define MC_CMD_FREE_VIS 0x8c
+#undef MC_CMD_0x8c_PRIVILEGE_CTG
+
+#define MC_CMD_0x8c_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_FREE_VIS_IN msgrequest */
#define MC_CMD_FREE_VIS_IN_LEN 0
@@ -4911,37 +8888,57 @@
/***********************************/
-/* MC_CMD_GET_SRIOV_CFG
+/* MC_CMD_GET_SRIOV_CFG
+ * Get SRIOV config for this PF.
*/
-#define MC_CMD_GET_SRIOV_CFG 0x67
+#define MC_CMD_GET_SRIOV_CFG 0xba
+#undef MC_CMD_0xba_PRIVILEGE_CTG
+
+#define MC_CMD_0xba_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_GET_SRIOV_CFG_IN msgrequest */
#define MC_CMD_GET_SRIOV_CFG_IN_LEN 0
/* MC_CMD_GET_SRIOV_CFG_OUT msgresponse */
#define MC_CMD_GET_SRIOV_CFG_OUT_LEN 20
+/* Number of VFs currently enabled. */
#define MC_CMD_GET_SRIOV_CFG_OUT_VF_CURRENT_OFST 0
+/* Max number of VFs before sriov stride and offset may need to be changed. */
#define MC_CMD_GET_SRIOV_CFG_OUT_VF_MAX_OFST 4
#define MC_CMD_GET_SRIOV_CFG_OUT_FLAGS_OFST 8
#define MC_CMD_GET_SRIOV_CFG_OUT_VF_ENABLED_LBN 0
#define MC_CMD_GET_SRIOV_CFG_OUT_VF_ENABLED_WIDTH 1
+/* RID offset of first VF from PF. */
#define MC_CMD_GET_SRIOV_CFG_OUT_VF_OFFSET_OFST 12
+/* RID offset of each subsequent VF from the previous. */
#define MC_CMD_GET_SRIOV_CFG_OUT_VF_STRIDE_OFST 16
/***********************************/
-/* MC_CMD_SET_SRIOV_CFG
+/* MC_CMD_SET_SRIOV_CFG
+ * Set SRIOV config for this PF.
*/
-#define MC_CMD_SET_SRIOV_CFG 0x68
+#define MC_CMD_SET_SRIOV_CFG 0xbb
+#undef MC_CMD_0xbb_PRIVILEGE_CTG
+
+#define MC_CMD_0xbb_PRIVILEGE_CTG SRIOV_CTG_ADMIN
/* MC_CMD_SET_SRIOV_CFG_IN msgrequest */
#define MC_CMD_SET_SRIOV_CFG_IN_LEN 20
+/* Number of VFs currently enabled. */
#define MC_CMD_SET_SRIOV_CFG_IN_VF_CURRENT_OFST 0
+/* Max number of VFs before sriov stride and offset may need to be changed. */
#define MC_CMD_SET_SRIOV_CFG_IN_VF_MAX_OFST 4
#define MC_CMD_SET_SRIOV_CFG_IN_FLAGS_OFST 8
#define MC_CMD_SET_SRIOV_CFG_IN_VF_ENABLED_LBN 0
#define MC_CMD_SET_SRIOV_CFG_IN_VF_ENABLED_WIDTH 1
+/* RID offset of first VF from PF, or 0 for no change, or
+ * MC_CMD_RESOURCE_INSTANCE_ANY to allow the system to allocate an offset.
+ */
#define MC_CMD_SET_SRIOV_CFG_IN_VF_OFFSET_OFST 12
+/* RID offset of each subsequent VF from the previous, 0 for no change, or
+ * MC_CMD_RESOURCE_INSTANCE_ANY to allow the system to allocate a stride.
+ */
#define MC_CMD_SET_SRIOV_CFG_IN_VF_STRIDE_OFST 16
/* MC_CMD_SET_SRIOV_CFG_OUT msgresponse */
@@ -4949,68 +8946,172 @@
/***********************************/
-/* MC_CMD_GET_VI_COUNT
+/* MC_CMD_GET_VI_ALLOC_INFO
+ * Get information about number of VI's and base VI number allocated to this
+ * function.
*/
-#define MC_CMD_GET_VI_COUNT 0x69
+#define MC_CMD_GET_VI_ALLOC_INFO 0x8d
+#undef MC_CMD_0x8d_PRIVILEGE_CTG
-/* MC_CMD_GET_VI_COUNT_IN msgrequest */
-#define MC_CMD_GET_VI_COUNT_IN_LEN 0
+#define MC_CMD_0x8d_PRIVILEGE_CTG SRIOV_CTG_GENERAL
-/* MC_CMD_GET_VI_COUNT_OUT msgresponse */
-#define MC_CMD_GET_VI_COUNT_OUT_LEN 4
-#define MC_CMD_GET_VI_COUNT_OUT_VI_COUNT_OFST 0
+/* MC_CMD_GET_VI_ALLOC_INFO_IN msgrequest */
+#define MC_CMD_GET_VI_ALLOC_INFO_IN_LEN 0
-
-/***********************************/
-/* MC_CMD_GET_VECTOR_CFG
+/* MC_CMD_GET_VI_ALLOC_INFO_OUT msgresponse */
+#define MC_CMD_GET_VI_ALLOC_INFO_OUT_LEN 12
+/* The number of VIs allocated on this function */
+#define MC_CMD_GET_VI_ALLOC_INFO_OUT_VI_COUNT_OFST 0
+/* The base absolute VI number allocated to this function. Required to
+ * correctly interpret wakeup events.
*/
-#define MC_CMD_GET_VECTOR_CFG 0x70
-
-/* MC_CMD_GET_VECTOR_CFG_IN msgrequest */
-#define MC_CMD_GET_VECTOR_CFG_IN_LEN 0
-
-/* MC_CMD_GET_VECTOR_CFG_OUT msgresponse */
-#define MC_CMD_GET_VECTOR_CFG_OUT_LEN 12
-#define MC_CMD_GET_VECTOR_CFG_OUT_VEC_BASE_OFST 0
-#define MC_CMD_GET_VECTOR_CFG_OUT_VECS_PER_PF_OFST 4
-#define MC_CMD_GET_VECTOR_CFG_OUT_VECS_PER_VF_OFST 8
+#define MC_CMD_GET_VI_ALLOC_INFO_OUT_VI_BASE_OFST 4
+/* Function's port vi_shift value (always 0 on Huntington) */
+#define MC_CMD_GET_VI_ALLOC_INFO_OUT_VI_SHIFT_OFST 8
/***********************************/
-/* MC_CMD_SET_VECTOR_CFG
+/* MC_CMD_DUMP_VI_STATE
+ * For CmdClient use. Dump pertinent information on a specific absolute VI.
*/
-#define MC_CMD_SET_VECTOR_CFG 0x71
-
-/* MC_CMD_SET_VECTOR_CFG_IN msgrequest */
-#define MC_CMD_SET_VECTOR_CFG_IN_LEN 12
-#define MC_CMD_SET_VECTOR_CFG_IN_VEC_BASE_OFST 0
-#define MC_CMD_SET_VECTOR_CFG_IN_VECS_PER_PF_OFST 4
-#define MC_CMD_SET_VECTOR_CFG_IN_VECS_PER_VF_OFST 8
-
-/* MC_CMD_SET_VECTOR_CFG_OUT msgresponse */
-#define MC_CMD_SET_VECTOR_CFG_OUT_LEN 0
+#define MC_CMD_DUMP_VI_STATE 0x8e
+#undef MC_CMD_0x8e_PRIVILEGE_CTG
+
+#define MC_CMD_0x8e_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_DUMP_VI_STATE_IN msgrequest */
+#define MC_CMD_DUMP_VI_STATE_IN_LEN 4
+/* The VI number to query. */
+#define MC_CMD_DUMP_VI_STATE_IN_VI_NUMBER_OFST 0
+
+/* MC_CMD_DUMP_VI_STATE_OUT msgresponse */
+#define MC_CMD_DUMP_VI_STATE_OUT_LEN 96
+/* The PF part of the function owning this VI. */
+#define MC_CMD_DUMP_VI_STATE_OUT_OWNER_PF_OFST 0
+#define MC_CMD_DUMP_VI_STATE_OUT_OWNER_PF_LEN 2
+/* The VF part of the function owning this VI. */
+#define MC_CMD_DUMP_VI_STATE_OUT_OWNER_VF_OFST 2
+#define MC_CMD_DUMP_VI_STATE_OUT_OWNER_VF_LEN 2
+/* Base of VIs allocated to this function. */
+#define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VI_BASE_OFST 4
+#define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VI_BASE_LEN 2
+/* Count of VIs allocated to the owner function. */
+#define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VI_COUNT_OFST 6
+#define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VI_COUNT_LEN 2
+/* Base interrupt vector allocated to this function. */
+#define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VECTOR_BASE_OFST 8
+#define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VECTOR_BASE_LEN 2
+/* Number of interrupt vectors allocated to this function. */
+#define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VECTOR_COUNT_OFST 10
+#define MC_CMD_DUMP_VI_STATE_OUT_FUNC_VECTOR_COUNT_LEN 2
+/* Raw evq ptr table data. */
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_EVQ_PTR_RAW_OFST 12
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_EVQ_PTR_RAW_LEN 8
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_EVQ_PTR_RAW_LO_OFST 12
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_EVQ_PTR_RAW_HI_OFST 16
+/* Raw evq timer table data. */
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_TIMER_RAW_OFST 20
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_TIMER_RAW_LEN 8
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_TIMER_RAW_LO_OFST 20
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_TIMER_RAW_HI_OFST 24
+/* Combined metadata field. */
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_OFST 28
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_BUFS_BASE_LBN 0
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_BUFS_BASE_WIDTH 16
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_BUFS_NPAGES_LBN 16
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_BUFS_NPAGES_WIDTH 8
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_WKUP_REF_LBN 24
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_EV_META_WKUP_REF_WIDTH 8
+/* TXDPCPU raw table data for queue. */
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_0_OFST 32
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_0_LEN 8
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_0_LO_OFST 32
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_0_HI_OFST 36
+/* TXDPCPU raw table data for queue. */
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_1_OFST 40
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_1_LEN 8
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_1_LO_OFST 40
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_1_HI_OFST 44
+/* TXDPCPU raw table data for queue. */
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_2_OFST 48
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_2_LEN 8
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_2_LO_OFST 48
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_RAW_TBL_2_HI_OFST 52
+/* Combined metadata field. */
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_OFST 56
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_LEN 8
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_LO_OFST 56
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_HI_OFST 60
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_BUFS_BASE_LBN 0
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_BUFS_BASE_WIDTH 16
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_BUFS_NPAGES_LBN 16
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_BUFS_NPAGES_WIDTH 8
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_QSTATE_LBN 24
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_QSTATE_WIDTH 8
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_WAITCOUNT_LBN 32
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_TX_META_WAITCOUNT_WIDTH 8
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_PADDING_LBN 40
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_PADDING_WIDTH 24
+/* RXDPCPU raw table data for queue. */
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_0_OFST 64
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_0_LEN 8
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_0_LO_OFST 64
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_0_HI_OFST 68
+/* RXDPCPU raw table data for queue. */
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_1_OFST 72
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_1_LEN 8
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_1_LO_OFST 72
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_1_HI_OFST 76
+/* Reserved, currently 0. */
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_2_OFST 80
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_2_LEN 8
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_2_LO_OFST 80
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_RAW_TBL_2_HI_OFST 84
+/* Combined metadata field. */
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_OFST 88
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_LEN 8
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_LO_OFST 88
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_HI_OFST 92
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_BUFS_BASE_LBN 0
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_BUFS_BASE_WIDTH 16
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_BUFS_NPAGES_LBN 16
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_BUFS_NPAGES_WIDTH 8
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_QSTATE_LBN 24
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_QSTATE_WIDTH 8
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_WAITCOUNT_LBN 32
+#define MC_CMD_DUMP_VI_STATE_OUT_VI_RX_META_WAITCOUNT_WIDTH 8
/***********************************/
-/* MC_CMD_ALLOC_PIOBUF
+/* MC_CMD_ALLOC_PIOBUF
+ * Allocate a push I/O buffer for later use with a tx queue.
*/
-#define MC_CMD_ALLOC_PIOBUF 0x72
+#define MC_CMD_ALLOC_PIOBUF 0x8f
+#undef MC_CMD_0x8f_PRIVILEGE_CTG
+
+#define MC_CMD_0x8f_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
/* MC_CMD_ALLOC_PIOBUF_IN msgrequest */
#define MC_CMD_ALLOC_PIOBUF_IN_LEN 0
/* MC_CMD_ALLOC_PIOBUF_OUT msgresponse */
#define MC_CMD_ALLOC_PIOBUF_OUT_LEN 4
+/* Handle for allocated push I/O buffer. */
#define MC_CMD_ALLOC_PIOBUF_OUT_PIOBUF_HANDLE_OFST 0
/***********************************/
-/* MC_CMD_FREE_PIOBUF
+/* MC_CMD_FREE_PIOBUF
+ * Free a push I/O buffer.
*/
-#define MC_CMD_FREE_PIOBUF 0x73
+#define MC_CMD_FREE_PIOBUF 0x90
+#undef MC_CMD_0x90_PRIVILEGE_CTG
+
+#define MC_CMD_0x90_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
/* MC_CMD_FREE_PIOBUF_IN msgrequest */
#define MC_CMD_FREE_PIOBUF_IN_LEN 4
+/* Handle for allocated push I/O buffer. */
#define MC_CMD_FREE_PIOBUF_IN_PIOBUF_HANDLE_OFST 0
/* MC_CMD_FREE_PIOBUF_OUT msgresponse */
@@ -5018,16 +9119,499 @@
/***********************************/
-/* MC_CMD_V2_EXTN
+/* MC_CMD_GET_VI_TLP_PROCESSING
+ * Get TLP steering and ordering information for a VI.
+ */
+#define MC_CMD_GET_VI_TLP_PROCESSING 0xb0
+#undef MC_CMD_0xb0_PRIVILEGE_CTG
+
+#define MC_CMD_0xb0_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_GET_VI_TLP_PROCESSING_IN msgrequest */
+#define MC_CMD_GET_VI_TLP_PROCESSING_IN_LEN 4
+/* VI number to get information for. */
+#define MC_CMD_GET_VI_TLP_PROCESSING_IN_INSTANCE_OFST 0
+
+/* MC_CMD_GET_VI_TLP_PROCESSING_OUT msgresponse */
+#define MC_CMD_GET_VI_TLP_PROCESSING_OUT_LEN 4
+/* Transaction processing steering hint 1 for use with the Rx Queue. */
+#define MC_CMD_GET_VI_TLP_PROCESSING_OUT_TPH_TAG1_RX_OFST 0
+#define MC_CMD_GET_VI_TLP_PROCESSING_OUT_TPH_TAG1_RX_LEN 1
+/* Transaction processing steering hint 2 for use with the Ev Queue. */
+#define MC_CMD_GET_VI_TLP_PROCESSING_OUT_TPH_TAG2_EV_OFST 1
+#define MC_CMD_GET_VI_TLP_PROCESSING_OUT_TPH_TAG2_EV_LEN 1
+/* Use Relaxed ordering model for TLPs on this VI. */
+#define MC_CMD_GET_VI_TLP_PROCESSING_OUT_RELAXED_ORDERING_LBN 16
+#define MC_CMD_GET_VI_TLP_PROCESSING_OUT_RELAXED_ORDERING_WIDTH 1
+/* Use ID based ordering for TLPs on this VI. */
+#define MC_CMD_GET_VI_TLP_PROCESSING_OUT_ID_BASED_ORDERING_LBN 17
+#define MC_CMD_GET_VI_TLP_PROCESSING_OUT_ID_BASED_ORDERING_WIDTH 1
+/* Set no snoop bit for TLPs on this VI. */
+#define MC_CMD_GET_VI_TLP_PROCESSING_OUT_NO_SNOOP_LBN 18
+#define MC_CMD_GET_VI_TLP_PROCESSING_OUT_NO_SNOOP_WIDTH 1
+/* Enable TPH for TLPs on this VI. */
+#define MC_CMD_GET_VI_TLP_PROCESSING_OUT_TPH_ON_LBN 19
+#define MC_CMD_GET_VI_TLP_PROCESSING_OUT_TPH_ON_WIDTH 1
+#define MC_CMD_GET_VI_TLP_PROCESSING_OUT_DATA_OFST 0
+
+
+/***********************************/
+/* MC_CMD_SET_VI_TLP_PROCESSING
+ * Set TLP steering and ordering information for a VI.
+ */
+#define MC_CMD_SET_VI_TLP_PROCESSING 0xb1
+#undef MC_CMD_0xb1_PRIVILEGE_CTG
+
+#define MC_CMD_0xb1_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_SET_VI_TLP_PROCESSING_IN msgrequest */
+#define MC_CMD_SET_VI_TLP_PROCESSING_IN_LEN 8
+/* VI number to set information for. */
+#define MC_CMD_SET_VI_TLP_PROCESSING_IN_INSTANCE_OFST 0
+/* Transaction processing steering hint 1 for use with the Rx Queue. */
+#define MC_CMD_SET_VI_TLP_PROCESSING_IN_TPH_TAG1_RX_OFST 4
+#define MC_CMD_SET_VI_TLP_PROCESSING_IN_TPH_TAG1_RX_LEN 1
+/* Transaction processing steering hint 2 for use with the Ev Queue. */
+#define MC_CMD_SET_VI_TLP_PROCESSING_IN_TPH_TAG2_EV_OFST 5
+#define MC_CMD_SET_VI_TLP_PROCESSING_IN_TPH_TAG2_EV_LEN 1
+/* Use Relaxed ordering model for TLPs on this VI. */
+#define MC_CMD_SET_VI_TLP_PROCESSING_IN_RELAXED_ORDERING_LBN 48
+#define MC_CMD_SET_VI_TLP_PROCESSING_IN_RELAXED_ORDERING_WIDTH 1
+/* Use ID based ordering for TLPs on this VI. */
+#define MC_CMD_SET_VI_TLP_PROCESSING_IN_ID_BASED_ORDERING_LBN 49
+#define MC_CMD_SET_VI_TLP_PROCESSING_IN_ID_BASED_ORDERING_WIDTH 1
+/* Set the no snoop bit for TLPs on this VI. */
+#define MC_CMD_SET_VI_TLP_PROCESSING_IN_NO_SNOOP_LBN 50
+#define MC_CMD_SET_VI_TLP_PROCESSING_IN_NO_SNOOP_WIDTH 1
+/* Enable TPH for TLPs on this VI. */
+#define MC_CMD_SET_VI_TLP_PROCESSING_IN_TPH_ON_LBN 51
+#define MC_CMD_SET_VI_TLP_PROCESSING_IN_TPH_ON_WIDTH 1
+#define MC_CMD_SET_VI_TLP_PROCESSING_IN_DATA_OFST 4
+
+/* MC_CMD_SET_VI_TLP_PROCESSING_OUT msgresponse */
+#define MC_CMD_SET_VI_TLP_PROCESSING_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_GET_TLP_PROCESSING_GLOBALS
+ * Get global PCIe steering and transaction processing configuration.
+ */
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS 0xbc
+#undef MC_CMD_0xbc_PRIVILEGE_CTG
+
+#define MC_CMD_0xbc_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN msgrequest */
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_LEN 4
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_OFST 0
+/* enum: MISC. */
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_MISC 0x0
+/* enum: IDO. */
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_IDO 0x1
+/* enum: RO. */
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_RO 0x2
+/* enum: TPH Type. */
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_TPH_TYPE 0x3
+
+/* MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT msgresponse */
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_LEN 8
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_GLOBAL_CATEGORY_OFST 0
+/* Enum values, see field(s): */
+/* MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN/TLP_GLOBAL_CATEGORY */
+/* Amalgamated TLP info word. */
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_WORD_OFST 4
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_MISC_WTAG_EN_LBN 0
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_MISC_WTAG_EN_WIDTH 1
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_MISC_SPARE_LBN 1
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_MISC_SPARE_WIDTH 31
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_DL_EN_LBN 0
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_DL_EN_WIDTH 1
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_TX_EN_LBN 1
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_TX_EN_WIDTH 1
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_EV_EN_LBN 2
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_EV_EN_WIDTH 1
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_RX_EN_LBN 3
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_RX_EN_WIDTH 1
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_SPARE_LBN 4
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_IDO_SPARE_WIDTH 28
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_RXDMA_EN_LBN 0
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_RXDMA_EN_WIDTH 1
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_TXDMA_EN_LBN 1
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_TXDMA_EN_WIDTH 1
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_DL_EN_LBN 2
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_DL_EN_WIDTH 1
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_SPARE_LBN 3
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_RO_SPARE_WIDTH 29
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_MSIX_LBN 0
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_MSIX_WIDTH 2
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_DL_LBN 2
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_DL_WIDTH 2
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_TX_LBN 4
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_TX_WIDTH 2
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_EV_LBN 6
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_EV_WIDTH 2
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_RX_LBN 8
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TPH_TYPE_RX_WIDTH 2
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TLP_TYPE_SPARE_LBN 9
+#define MC_CMD_GET_TLP_PROCESSING_GLOBALS_OUT_TLP_INFO_TLP_TYPE_SPARE_WIDTH 23
+
+
+/***********************************/
+/* MC_CMD_SET_TLP_PROCESSING_GLOBALS
+ * Set global PCIe steering and transaction processing configuration.
+ */
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS 0xbd
+#undef MC_CMD_0xbd_PRIVILEGE_CTG
+
+#define MC_CMD_0xbd_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN msgrequest */
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_LEN 8
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_GLOBAL_CATEGORY_OFST 0
+/* Enum values, see field(s): */
+/* MC_CMD_GET_TLP_PROCESSING_GLOBALS/MC_CMD_GET_TLP_PROCESSING_GLOBALS_IN/TLP_GLOBAL_CATEGORY */
+/* Amalgamated TLP info word. */
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_WORD_OFST 4
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_MISC_WTAG_EN_LBN 0
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_MISC_WTAG_EN_WIDTH 1
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_DL_EN_LBN 0
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_DL_EN_WIDTH 1
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_TX_EN_LBN 1
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_TX_EN_WIDTH 1
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_EV_EN_LBN 2
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_EV_EN_WIDTH 1
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_RX_EN_LBN 3
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_IDO_RX_EN_WIDTH 1
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_RO_RXDMA_EN_LBN 0
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_RO_RXDMA_EN_WIDTH 1
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_RO_TXDMA_EN_LBN 1
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_RO_TXDMA_EN_WIDTH 1
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_RO_DL_EN_LBN 2
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_RO_DL_EN_WIDTH 1
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_MSIX_LBN 0
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_MSIX_WIDTH 2
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_DL_LBN 2
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_DL_WIDTH 2
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_TX_LBN 4
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_TX_WIDTH 2
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_EV_LBN 6
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_EV_WIDTH 2
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_RX_LBN 8
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_TPH_TYPE_RX_WIDTH 2
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_SPARE_LBN 10
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_IN_TLP_INFO_SPARE_WIDTH 22
+
+/* MC_CMD_SET_TLP_PROCESSING_GLOBALS_OUT msgresponse */
+#define MC_CMD_SET_TLP_PROCESSING_GLOBALS_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_SATELLITE_DOWNLOAD
+ * Download a new set of images to the satellite CPUs from the host.
+ */
+#define MC_CMD_SATELLITE_DOWNLOAD 0x91
+#undef MC_CMD_0x91_PRIVILEGE_CTG
+
+#define MC_CMD_0x91_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_SATELLITE_DOWNLOAD_IN msgrequest: The reset requirements for the CPUs
+ * are subtle, and so downloads must proceed in a number of phases.
+ *
+ * 1) PHASE_RESET with a target of TARGET_ALL and chunk ID/length of 0.
+ *
+ * 2) PHASE_IMEMS for each of the IMEM targets (target IDs 0-11). Each download
+ * may consist of multiple chunks. The final chunk (with CHUNK_ID_LAST) should
+ * be a checksum (a simple 32-bit sum) of the transferred data. An individual
+ * download may be aborted using CHUNK_ID_ABORT.
+ *
+ * 3) PHASE_VECTORS for each of the vector table targets (target IDs 12-15),
+ * similar to PHASE_IMEMS.
+ *
+ * 4) PHASE_READY with a target of TARGET_ALL and chunk ID/length of 0.
+ *
+ * After any error (a requested abort is not considered to be an error) the
+ * sequence must be restarted from PHASE_RESET.
+ */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_LENMIN 20
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_LENMAX 252
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_LEN(num) (16+4*(num))
+/* Download phase. (Note: the IDLE phase is used internally and is never valid
+ * in a command from the host.)
+ */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_OFST 0
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_IDLE 0x0 /* enum */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_RESET 0x1 /* enum */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_IMEMS 0x2 /* enum */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_VECTORS 0x3 /* enum */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_PHASE_READY 0x4 /* enum */
+/* Target for download. (These match the blob numbers defined in
+ * mc_flash_layout.h.)
+ */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_OFST 4
+/* enum: Valid in phase 2 (PHASE_IMEMS) only */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXDI_TEXT 0x0
+/* enum: Valid in phase 2 (PHASE_IMEMS) only */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXDI_TEXT 0x1
+/* enum: Valid in phase 2 (PHASE_IMEMS) only */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXDP_TEXT 0x2
+/* enum: Valid in phase 2 (PHASE_IMEMS) only */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXDP_TEXT 0x3
+/* enum: Valid in phase 2 (PHASE_IMEMS) only */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXHRSL_HR_LUT 0x4
+/* enum: Valid in phase 2 (PHASE_IMEMS) only */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXHRSL_HR_LUT_CFG 0x5
+/* enum: Valid in phase 2 (PHASE_IMEMS) only */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXHRSL_HR_LUT 0x6
+/* enum: Valid in phase 2 (PHASE_IMEMS) only */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXHRSL_HR_LUT_CFG 0x7
+/* enum: Valid in phase 2 (PHASE_IMEMS) only */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXHRSL_HR_PGM 0x8
+/* enum: Valid in phase 2 (PHASE_IMEMS) only */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXHRSL_SL_PGM 0x9
+/* enum: Valid in phase 2 (PHASE_IMEMS) only */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXHRSL_HR_PGM 0xa
+/* enum: Valid in phase 2 (PHASE_IMEMS) only */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXHRSL_SL_PGM 0xb
+/* enum: Valid in phase 3 (PHASE_VECTORS) only */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXDI_VTBL0 0xc
+/* enum: Valid in phase 3 (PHASE_VECTORS) only */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXDI_VTBL0 0xd
+/* enum: Valid in phase 3 (PHASE_VECTORS) only */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_RXDI_VTBL1 0xe
+/* enum: Valid in phase 3 (PHASE_VECTORS) only */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_TXDI_VTBL1 0xf
+/* enum: Valid in phases 1 (PHASE_RESET) and 4 (PHASE_READY) only */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_TARGET_ALL 0xffffffff
+/* Chunk ID, or CHUNK_ID_LAST or CHUNK_ID_ABORT */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_ID_OFST 8
+/* enum: Last chunk, containing checksum rather than data */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_ID_LAST 0xffffffff
+/* enum: Abort download of this item */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_ID_ABORT 0xfffffffe
+/* Length of this chunk in bytes */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_LEN_OFST 12
+/* Data for this chunk */
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_DATA_OFST 16
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_DATA_LEN 4
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_DATA_MINNUM 1
+#define MC_CMD_SATELLITE_DOWNLOAD_IN_CHUNK_DATA_MAXNUM 59
+
+/* MC_CMD_SATELLITE_DOWNLOAD_OUT msgresponse */
+#define MC_CMD_SATELLITE_DOWNLOAD_OUT_LEN 8
+/* Same as MC_CMD_ERR field, but included as 0 in success cases */
+#define MC_CMD_SATELLITE_DOWNLOAD_OUT_RESULT_OFST 0
+/* Extra status information */
+#define MC_CMD_SATELLITE_DOWNLOAD_OUT_INFO_OFST 4
+/* enum: Code download OK, completed. */
+#define MC_CMD_SATELLITE_DOWNLOAD_OUT_OK_COMPLETE 0x0
+/* enum: Code download aborted as requested. */
+#define MC_CMD_SATELLITE_DOWNLOAD_OUT_OK_ABORTED 0x1
+/* enum: Code download OK so far, send next chunk. */
+#define MC_CMD_SATELLITE_DOWNLOAD_OUT_OK_NEXT_CHUNK 0x2
+/* enum: Download phases out of sequence */
+#define MC_CMD_SATELLITE_DOWNLOAD_OUT_ERR_BAD_PHASE 0x100
+/* enum: Bad target for this phase */
+#define MC_CMD_SATELLITE_DOWNLOAD_OUT_ERR_BAD_TARGET 0x101
+/* enum: Chunk ID out of sequence */
+#define MC_CMD_SATELLITE_DOWNLOAD_OUT_ERR_BAD_CHUNK_ID 0x200
+/* enum: Chunk length zero or too large */
+#define MC_CMD_SATELLITE_DOWNLOAD_OUT_ERR_BAD_CHUNK_LEN 0x201
+/* enum: Checksum was incorrect */
+#define MC_CMD_SATELLITE_DOWNLOAD_OUT_ERR_BAD_CHECKSUM 0x300
+
+
+/***********************************/
+/* MC_CMD_GET_CAPABILITIES
+ * Get device capabilities.
+ *
+ * This is supplementary to the MC_CMD_GET_BOARD_CFG command, and intended to
+ * reference inherent device capabilities as opposed to current NVRAM config.
+ */
+#define MC_CMD_GET_CAPABILITIES 0xbe
+#undef MC_CMD_0xbe_PRIVILEGE_CTG
+
+#define MC_CMD_0xbe_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_GET_CAPABILITIES_IN msgrequest */
+#define MC_CMD_GET_CAPABILITIES_IN_LEN 0
+
+/* MC_CMD_GET_CAPABILITIES_OUT msgresponse */
+#define MC_CMD_GET_CAPABILITIES_OUT_LEN 20
+/* First word of flags. */
+#define MC_CMD_GET_CAPABILITIES_OUT_FLAGS1_OFST 0
+#define MC_CMD_GET_CAPABILITIES_OUT_TX_MAC_SECURITY_FILTERING_LBN 12
+#define MC_CMD_GET_CAPABILITIES_OUT_TX_MAC_SECURITY_FILTERING_WIDTH 1
+#define MC_CMD_GET_CAPABILITIES_OUT_ADDITIONAL_RSS_MODES_LBN 13
+#define MC_CMD_GET_CAPABILITIES_OUT_ADDITIONAL_RSS_MODES_WIDTH 1
+#define MC_CMD_GET_CAPABILITIES_OUT_QBB_LBN 14
+#define MC_CMD_GET_CAPABILITIES_OUT_QBB_WIDTH 1
+#define MC_CMD_GET_CAPABILITIES_OUT_RX_PACKED_STREAM_VAR_BUFFERS_LBN 15
+#define MC_CMD_GET_CAPABILITIES_OUT_RX_PACKED_STREAM_VAR_BUFFERS_WIDTH 1
+#define MC_CMD_GET_CAPABILITIES_OUT_RX_RSS_LIMITED_LBN 16
+#define MC_CMD_GET_CAPABILITIES_OUT_RX_RSS_LIMITED_WIDTH 1
+#define MC_CMD_GET_CAPABILITIES_OUT_RX_PACKED_STREAM_LBN 17
+#define MC_CMD_GET_CAPABILITIES_OUT_RX_PACKED_STREAM_WIDTH 1
+#define MC_CMD_GET_CAPABILITIES_OUT_RX_INCLUDE_FCS_LBN 18
+#define MC_CMD_GET_CAPABILITIES_OUT_RX_INCLUDE_FCS_WIDTH 1
+#define MC_CMD_GET_CAPABILITIES_OUT_TX_VLAN_INSERTION_LBN 19
+#define MC_CMD_GET_CAPABILITIES_OUT_TX_VLAN_INSERTION_WIDTH 1
+#define MC_CMD_GET_CAPABILITIES_OUT_RX_VLAN_STRIPPING_LBN 20
+#define MC_CMD_GET_CAPABILITIES_OUT_RX_VLAN_STRIPPING_WIDTH 1
+#define MC_CMD_GET_CAPABILITIES_OUT_TX_TSO_LBN 21
+#define MC_CMD_GET_CAPABILITIES_OUT_TX_TSO_WIDTH 1
+#define MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_0_LBN 22
+#define MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_0_WIDTH 1
+#define MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_14_LBN 23
+#define MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_14_WIDTH 1
+#define MC_CMD_GET_CAPABILITIES_OUT_RX_TIMESTAMP_LBN 24
+#define MC_CMD_GET_CAPABILITIES_OUT_RX_TIMESTAMP_WIDTH 1
+#define MC_CMD_GET_CAPABILITIES_OUT_RX_BATCHING_LBN 25
+#define MC_CMD_GET_CAPABILITIES_OUT_RX_BATCHING_WIDTH 1
+#define MC_CMD_GET_CAPABILITIES_OUT_MCAST_FILTER_CHAINING_LBN 26
+#define MC_CMD_GET_CAPABILITIES_OUT_MCAST_FILTER_CHAINING_WIDTH 1
+#define MC_CMD_GET_CAPABILITIES_OUT_PM_AND_RXDP_COUNTERS_LBN 27
+#define MC_CMD_GET_CAPABILITIES_OUT_PM_AND_RXDP_COUNTERS_WIDTH 1
+#define MC_CMD_GET_CAPABILITIES_OUT_RX_DISABLE_SCATTER_LBN 28
+#define MC_CMD_GET_CAPABILITIES_OUT_RX_DISABLE_SCATTER_WIDTH 1
+#define MC_CMD_GET_CAPABILITIES_OUT_TX_MCAST_UDP_LOOPBACK_LBN 29
+#define MC_CMD_GET_CAPABILITIES_OUT_TX_MCAST_UDP_LOOPBACK_WIDTH 1
+#define MC_CMD_GET_CAPABILITIES_OUT_EVB_LBN 30
+#define MC_CMD_GET_CAPABILITIES_OUT_EVB_WIDTH 1
+#define MC_CMD_GET_CAPABILITIES_OUT_VXLAN_NVGRE_LBN 31
+#define MC_CMD_GET_CAPABILITIES_OUT_VXLAN_NVGRE_WIDTH 1
+/* RxDPCPU firmware id. */
+#define MC_CMD_GET_CAPABILITIES_OUT_RX_DPCPU_FW_ID_OFST 4
+#define MC_CMD_GET_CAPABILITIES_OUT_RX_DPCPU_FW_ID_LEN 2
+/* enum: Standard RXDP firmware */
+#define MC_CMD_GET_CAPABILITIES_OUT_RXDP 0x0
+/* enum: Low latency RXDP firmware */
+#define MC_CMD_GET_CAPABILITIES_OUT_RXDP_LOW_LATENCY 0x1
+/* enum: Packed stream RXDP firmware */
+#define MC_CMD_GET_CAPABILITIES_OUT_RXDP_PACKED_STREAM 0x2
+/* enum: BIST RXDP firmware */
+#define MC_CMD_GET_CAPABILITIES_OUT_RXDP_BIST 0x10a
+/* enum: RXDP Test firmware image 1 */
+#define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_TO_MC_CUT_THROUGH 0x101
+/* enum: RXDP Test firmware image 2 */
+#define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_TO_MC_STORE_FORWARD 0x102
+/* enum: RXDP Test firmware image 3 */
+#define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_TO_MC_STORE_FORWARD_FIRST 0x103
+/* enum: RXDP Test firmware image 4 */
+#define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_EVERY_EVENT_BATCHABLE 0x104
+/* enum: RXDP Test firmware image 5 */
+#define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_BACKPRESSURE 0x105
+/* enum: RXDP Test firmware image 6 */
+#define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_PACKET_EDITS 0x106
+/* enum: RXDP Test firmware image 7 */
+#define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_RX_HDR_SPLIT 0x107
+/* enum: RXDP Test firmware image 8 */
+#define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_DISABLE_DL 0x108
+/* TxDPCPU firmware id. */
+#define MC_CMD_GET_CAPABILITIES_OUT_TX_DPCPU_FW_ID_OFST 6
+#define MC_CMD_GET_CAPABILITIES_OUT_TX_DPCPU_FW_ID_LEN 2
+/* enum: Standard TXDP firmware */
+#define MC_CMD_GET_CAPABILITIES_OUT_TXDP 0x0
+/* enum: Low latency TXDP firmware */
+#define MC_CMD_GET_CAPABILITIES_OUT_TXDP_LOW_LATENCY 0x1
+/* enum: High packet rate TXDP firmware */
+#define MC_CMD_GET_CAPABILITIES_OUT_TXDP_HIGH_PACKET_RATE 0x3
+/* enum: BIST TXDP firmware */
+#define MC_CMD_GET_CAPABILITIES_OUT_TXDP_BIST 0x12d
+/* enum: TXDP Test firmware image 1 */
+#define MC_CMD_GET_CAPABILITIES_OUT_TXDP_TEST_FW_TSO_EDIT 0x101
+/* enum: TXDP Test firmware image 2 */
+#define MC_CMD_GET_CAPABILITIES_OUT_TXDP_TEST_FW_PACKET_EDITS 0x102
+#define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_OFST 8
+#define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_LEN 2
+#define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_REV_LBN 0
+#define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_REV_WIDTH 12
+#define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_TYPE_LBN 12
+#define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_VERSION_TYPE_WIDTH 4
+/* enum: reserved value - do not use (may indicate alternative interpretation
+ * of REV field in future)
+ */
+#define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_RESERVED 0x0
+/* enum: Trivial RX PD firmware for early Huntington development (Huntington
+ * development only)
+ */
+#define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_FIRST_PKT 0x1
+/* enum: RX PD firmware with approximately Siena-compatible behaviour
+ * (Huntington development only)
+ */
+#define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_SIENA_COMPAT 0x2
+/* enum: Virtual switching (full feature) RX PD production firmware */
+#define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_VSWITCH 0x3
+/* enum: siena_compat variant RX PD firmware using PM rather than MAC
+ * (Huntington development only)
*/
-#define MC_CMD_V2_EXTN 0x7f
+#define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_SIENA_COMPAT_PM 0x4
+/* enum: Low latency RX PD production firmware */
+#define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_LOW_LATENCY 0x5
+/* enum: Packed stream RX PD production firmware */
+#define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_PACKED_STREAM 0x6
+/* enum: RX PD firmware handling layer 2 only for high packet rate performance
+ * tests (Medford development only)
+ */
+#define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_LAYER2_PERF 0x7
+/* enum: RX PD firmware for GUE parsing prototype (Medford development only) */
+#define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe
+/* enum: RX PD firmware parsing but not filtering network overlay tunnel
+ * encapsulations (Medford development only)
+ */
+#define MC_CMD_GET_CAPABILITIES_OUT_RXPD_FW_TYPE_TESTFW_ENCAP_PARSING_ONLY 0xf
+#define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_VERSION_OFST 10
+#define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_VERSION_LEN 2
+#define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_VERSION_REV_LBN 0
+#define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_VERSION_REV_WIDTH 12
+#define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_VERSION_TYPE_LBN 12
+#define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_VERSION_TYPE_WIDTH 4
+/* enum: reserved value - do not use (may indicate alternative interpretation
+ * of REV field in future)
+ */
+#define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_RESERVED 0x0
+/* enum: Trivial TX PD firmware for early Huntington development (Huntington
+ * development only)
+ */
+#define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_FIRST_PKT 0x1
+/* enum: TX PD firmware with approximately Siena-compatible behaviour
+ * (Huntington development only)
+ */
+#define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_SIENA_COMPAT 0x2
+/* enum: Virtual switching (full feature) TX PD production firmware */
+#define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_VSWITCH 0x3
+/* enum: siena_compat variant TX PD firmware using PM rather than MAC
+ * (Huntington development only)
+ */
+#define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_SIENA_COMPAT_PM 0x4
+#define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_LOW_LATENCY 0x5 /* enum */
+/* enum: TX PD firmware handling layer 2 only for high packet rate performance
+ * tests (Medford development only)
+ */
+#define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_LAYER2_PERF 0x7
+/* enum: RX PD firmware for GUE parsing prototype (Medford development only) */
+#define MC_CMD_GET_CAPABILITIES_OUT_TXPD_FW_TYPE_TESTFW_GUE_PROTOTYPE 0xe
+/* Hardware capabilities of NIC */
+#define MC_CMD_GET_CAPABILITIES_OUT_HW_CAPABILITIES_OFST 12
+/* Licensed capabilities */
+#define MC_CMD_GET_CAPABILITIES_OUT_LICENSE_CAPABILITIES_OFST 16
+
+
+/***********************************/
+/* MC_CMD_V2_EXTN
+ * Encapsulation for a v2 extended command
+ */
+#define MC_CMD_V2_EXTN 0x7f
/* MC_CMD_V2_EXTN_IN msgrequest */
#define MC_CMD_V2_EXTN_IN_LEN 4
+/* the extended command number */
#define MC_CMD_V2_EXTN_IN_EXTENDED_CMD_LBN 0
#define MC_CMD_V2_EXTN_IN_EXTENDED_CMD_WIDTH 15
#define MC_CMD_V2_EXTN_IN_UNUSED_LBN 15
#define MC_CMD_V2_EXTN_IN_UNUSED_WIDTH 1
+/* the actual length of the encapsulated command (which is not in the v1
+ * header)
+ */
#define MC_CMD_V2_EXTN_IN_ACTUAL_LEN_LBN 16
#define MC_CMD_V2_EXTN_IN_ACTUAL_LEN_WIDTH 10
#define MC_CMD_V2_EXTN_IN_UNUSED2_LBN 26
@@ -5035,25 +9619,35 @@
/***********************************/
-/* MC_CMD_TCM_BUCKET_ALLOC
+/* MC_CMD_TCM_BUCKET_ALLOC
+ * Allocate a pacer bucket (for qau rp or a snapper test)
*/
-#define MC_CMD_TCM_BUCKET_ALLOC 0x80
+#define MC_CMD_TCM_BUCKET_ALLOC 0xb2
+#undef MC_CMD_0xb2_PRIVILEGE_CTG
+
+#define MC_CMD_0xb2_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_TCM_BUCKET_ALLOC_IN msgrequest */
#define MC_CMD_TCM_BUCKET_ALLOC_IN_LEN 0
/* MC_CMD_TCM_BUCKET_ALLOC_OUT msgresponse */
#define MC_CMD_TCM_BUCKET_ALLOC_OUT_LEN 4
+/* the bucket id */
#define MC_CMD_TCM_BUCKET_ALLOC_OUT_BUCKET_OFST 0
/***********************************/
-/* MC_CMD_TCM_BUCKET_FREE
+/* MC_CMD_TCM_BUCKET_FREE
+ * Free a pacer bucket
*/
-#define MC_CMD_TCM_BUCKET_FREE 0x81
+#define MC_CMD_TCM_BUCKET_FREE 0xb3
+#undef MC_CMD_0xb3_PRIVILEGE_CTG
+
+#define MC_CMD_0xb3_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_TCM_BUCKET_FREE_IN msgrequest */
#define MC_CMD_TCM_BUCKET_FREE_IN_LEN 4
+/* the bucket id */
#define MC_CMD_TCM_BUCKET_FREE_IN_BUCKET_OFST 0
/* MC_CMD_TCM_BUCKET_FREE_OUT msgresponse */
@@ -5061,35 +9655,2865 @@
/***********************************/
-/* MC_CMD_TCM_BUCKET_INIT
+/* MC_CMD_TCM_BUCKET_INIT
+ * Initialise pacer bucket with a given rate
*/
-#define MC_CMD_TCM_BUCKET_INIT 0x82
+#define MC_CMD_TCM_BUCKET_INIT 0xb4
+#undef MC_CMD_0xb4_PRIVILEGE_CTG
+
+#define MC_CMD_0xb4_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_TCM_BUCKET_INIT_IN msgrequest */
#define MC_CMD_TCM_BUCKET_INIT_IN_LEN 8
+/* the bucket id */
#define MC_CMD_TCM_BUCKET_INIT_IN_BUCKET_OFST 0
+/* the rate in mbps */
#define MC_CMD_TCM_BUCKET_INIT_IN_RATE_OFST 4
+/* MC_CMD_TCM_BUCKET_INIT_EXT_IN msgrequest */
+#define MC_CMD_TCM_BUCKET_INIT_EXT_IN_LEN 12
+/* the bucket id */
+#define MC_CMD_TCM_BUCKET_INIT_EXT_IN_BUCKET_OFST 0
+/* the rate in mbps */
+#define MC_CMD_TCM_BUCKET_INIT_EXT_IN_RATE_OFST 4
+/* the desired maximum fill level */
+#define MC_CMD_TCM_BUCKET_INIT_EXT_IN_MAX_FILL_OFST 8
+
/* MC_CMD_TCM_BUCKET_INIT_OUT msgresponse */
#define MC_CMD_TCM_BUCKET_INIT_OUT_LEN 0
/***********************************/
-/* MC_CMD_TCM_TXQ_INIT
+/* MC_CMD_TCM_TXQ_INIT
+ * Initialise txq in pacer with given options or set options
*/
-#define MC_CMD_TCM_TXQ_INIT 0x83
+#define MC_CMD_TCM_TXQ_INIT 0xb5
+#undef MC_CMD_0xb5_PRIVILEGE_CTG
+
+#define MC_CMD_0xb5_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_TCM_TXQ_INIT_IN msgrequest */
#define MC_CMD_TCM_TXQ_INIT_IN_LEN 28
+/* the txq id */
#define MC_CMD_TCM_TXQ_INIT_IN_QID_OFST 0
+/* the static priority associated with the txq */
#define MC_CMD_TCM_TXQ_INIT_IN_LABEL_OFST 4
+/* bitmask of the priority queues this txq is inserted into when inserted. */
#define MC_CMD_TCM_TXQ_INIT_IN_PQ_FLAGS_OFST 8
+#define MC_CMD_TCM_TXQ_INIT_IN_PQ_FLAG_GUARANTEED_LBN 0
+#define MC_CMD_TCM_TXQ_INIT_IN_PQ_FLAG_GUARANTEED_WIDTH 1
+#define MC_CMD_TCM_TXQ_INIT_IN_PQ_FLAG_NORMAL_LBN 1
+#define MC_CMD_TCM_TXQ_INIT_IN_PQ_FLAG_NORMAL_WIDTH 1
+#define MC_CMD_TCM_TXQ_INIT_IN_PQ_FLAG_LOW_LBN 2
+#define MC_CMD_TCM_TXQ_INIT_IN_PQ_FLAG_LOW_WIDTH 1
+/* the reaction point (RP) bucket */
#define MC_CMD_TCM_TXQ_INIT_IN_RP_BKT_OFST 12
+/* an already reserved bucket (typically set to bucket associated with outer
+ * vswitch)
+ */
#define MC_CMD_TCM_TXQ_INIT_IN_MAX_BKT1_OFST 16
+/* an already reserved bucket (typically set to bucket associated with inner
+ * vswitch)
+ */
#define MC_CMD_TCM_TXQ_INIT_IN_MAX_BKT2_OFST 20
+/* the min bucket (typically for ETS/minimum bandwidth) */
#define MC_CMD_TCM_TXQ_INIT_IN_MIN_BKT_OFST 24
+/* MC_CMD_TCM_TXQ_INIT_EXT_IN msgrequest */
+#define MC_CMD_TCM_TXQ_INIT_EXT_IN_LEN 32
+/* the txq id */
+#define MC_CMD_TCM_TXQ_INIT_EXT_IN_QID_OFST 0
+/* the static priority associated with the txq */
+#define MC_CMD_TCM_TXQ_INIT_EXT_IN_LABEL_NORMAL_OFST 4
+/* bitmask of the priority queues this txq is inserted into when inserted. */
+#define MC_CMD_TCM_TXQ_INIT_EXT_IN_PQ_FLAGS_OFST 8
+#define MC_CMD_TCM_TXQ_INIT_EXT_IN_PQ_FLAG_GUARANTEED_LBN 0
+#define MC_CMD_TCM_TXQ_INIT_EXT_IN_PQ_FLAG_GUARANTEED_WIDTH 1
+#define MC_CMD_TCM_TXQ_INIT_EXT_IN_PQ_FLAG_NORMAL_LBN 1
+#define MC_CMD_TCM_TXQ_INIT_EXT_IN_PQ_FLAG_NORMAL_WIDTH 1
+#define MC_CMD_TCM_TXQ_INIT_EXT_IN_PQ_FLAG_LOW_LBN 2
+#define MC_CMD_TCM_TXQ_INIT_EXT_IN_PQ_FLAG_LOW_WIDTH 1
+/* the reaction point (RP) bucket */
+#define MC_CMD_TCM_TXQ_INIT_EXT_IN_RP_BKT_OFST 12
+/* an already reserved bucket (typically set to bucket associated with outer
+ * vswitch)
+ */
+#define MC_CMD_TCM_TXQ_INIT_EXT_IN_MAX_BKT1_OFST 16
+/* an already reserved bucket (typically set to bucket associated with inner
+ * vswitch)
+ */
+#define MC_CMD_TCM_TXQ_INIT_EXT_IN_MAX_BKT2_OFST 20
+/* the min bucket (typically for ETS/minimum bandwidth) */
+#define MC_CMD_TCM_TXQ_INIT_EXT_IN_MIN_BKT_OFST 24
+/* the static priority associated with the txq */
+#define MC_CMD_TCM_TXQ_INIT_EXT_IN_LABEL_GUARANTEED_OFST 28
+
/* MC_CMD_TCM_TXQ_INIT_OUT msgresponse */
#define MC_CMD_TCM_TXQ_INIT_OUT_LEN 0
+
+/***********************************/
+/* MC_CMD_LINK_PIOBUF
+ * Link a push I/O buffer to a TxQ
+ */
+#define MC_CMD_LINK_PIOBUF 0x92
+#undef MC_CMD_0x92_PRIVILEGE_CTG
+
+#define MC_CMD_0x92_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
+
+/* MC_CMD_LINK_PIOBUF_IN msgrequest */
+#define MC_CMD_LINK_PIOBUF_IN_LEN 8
+/* Handle for allocated push I/O buffer. */
+#define MC_CMD_LINK_PIOBUF_IN_PIOBUF_HANDLE_OFST 0
+/* Function Local Instance (VI) number. */
+#define MC_CMD_LINK_PIOBUF_IN_TXQ_INSTANCE_OFST 4
+
+/* MC_CMD_LINK_PIOBUF_OUT msgresponse */
+#define MC_CMD_LINK_PIOBUF_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_UNLINK_PIOBUF
+ * Unlink a push I/O buffer from a TxQ
+ */
+#define MC_CMD_UNLINK_PIOBUF 0x93
+#undef MC_CMD_0x93_PRIVILEGE_CTG
+
+#define MC_CMD_0x93_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
+
+/* MC_CMD_UNLINK_PIOBUF_IN msgrequest */
+#define MC_CMD_UNLINK_PIOBUF_IN_LEN 4
+/* Function Local Instance (VI) number. */
+#define MC_CMD_UNLINK_PIOBUF_IN_TXQ_INSTANCE_OFST 0
+
+/* MC_CMD_UNLINK_PIOBUF_OUT msgresponse */
+#define MC_CMD_UNLINK_PIOBUF_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_VSWITCH_ALLOC
+ * allocate and initialise a v-switch.
+ */
+#define MC_CMD_VSWITCH_ALLOC 0x94
+#undef MC_CMD_0x94_PRIVILEGE_CTG
+
+#define MC_CMD_0x94_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_VSWITCH_ALLOC_IN msgrequest */
+#define MC_CMD_VSWITCH_ALLOC_IN_LEN 16
+/* The port to connect to the v-switch's upstream port. */
+#define MC_CMD_VSWITCH_ALLOC_IN_UPSTREAM_PORT_ID_OFST 0
+/* The type of v-switch to create. */
+#define MC_CMD_VSWITCH_ALLOC_IN_TYPE_OFST 4
+/* enum: VLAN */
+#define MC_CMD_VSWITCH_ALLOC_IN_VSWITCH_TYPE_VLAN 0x1
+/* enum: VEB */
+#define MC_CMD_VSWITCH_ALLOC_IN_VSWITCH_TYPE_VEB 0x2
+/* enum: VEPA (obsolete) */
+#define MC_CMD_VSWITCH_ALLOC_IN_VSWITCH_TYPE_VEPA 0x3
+/* enum: MUX */
+#define MC_CMD_VSWITCH_ALLOC_IN_VSWITCH_TYPE_MUX 0x4
+/* enum: Snapper specific; semantics TBD */
+#define MC_CMD_VSWITCH_ALLOC_IN_VSWITCH_TYPE_TEST 0x5
+/* Flags controlling v-port creation */
+#define MC_CMD_VSWITCH_ALLOC_IN_FLAGS_OFST 8
+#define MC_CMD_VSWITCH_ALLOC_IN_FLAG_AUTO_PORT_LBN 0
+#define MC_CMD_VSWITCH_ALLOC_IN_FLAG_AUTO_PORT_WIDTH 1
+/* The number of VLAN tags to allow for attached v-ports. For VLAN aggregators,
+ * this must be one or greated, and the attached v-ports must have exactly this
+ * number of tags. For other v-switch types, this must be zero of greater, and
+ * is an upper limit on the number of VLAN tags for attached v-ports. An error
+ * will be returned if existing configuration means we can't support attached
+ * v-ports with this number of tags.
+ */
+#define MC_CMD_VSWITCH_ALLOC_IN_NUM_VLAN_TAGS_OFST 12
+
+/* MC_CMD_VSWITCH_ALLOC_OUT msgresponse */
+#define MC_CMD_VSWITCH_ALLOC_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_VSWITCH_FREE
+ * de-allocate a v-switch.
+ */
+#define MC_CMD_VSWITCH_FREE 0x95
+#undef MC_CMD_0x95_PRIVILEGE_CTG
+
+#define MC_CMD_0x95_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_VSWITCH_FREE_IN msgrequest */
+#define MC_CMD_VSWITCH_FREE_IN_LEN 4
+/* The port to which the v-switch is connected. */
+#define MC_CMD_VSWITCH_FREE_IN_UPSTREAM_PORT_ID_OFST 0
+
+/* MC_CMD_VSWITCH_FREE_OUT msgresponse */
+#define MC_CMD_VSWITCH_FREE_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_VPORT_ALLOC
+ * allocate a v-port.
+ */
+#define MC_CMD_VPORT_ALLOC 0x96
+#undef MC_CMD_0x96_PRIVILEGE_CTG
+
+#define MC_CMD_0x96_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_VPORT_ALLOC_IN msgrequest */
+#define MC_CMD_VPORT_ALLOC_IN_LEN 20
+/* The port to which the v-switch is connected. */
+#define MC_CMD_VPORT_ALLOC_IN_UPSTREAM_PORT_ID_OFST 0
+/* The type of the new v-port. */
+#define MC_CMD_VPORT_ALLOC_IN_TYPE_OFST 4
+/* enum: VLAN (obsolete) */
+#define MC_CMD_VPORT_ALLOC_IN_VPORT_TYPE_VLAN 0x1
+/* enum: VEB (obsolete) */
+#define MC_CMD_VPORT_ALLOC_IN_VPORT_TYPE_VEB 0x2
+/* enum: VEPA (obsolete) */
+#define MC_CMD_VPORT_ALLOC_IN_VPORT_TYPE_VEPA 0x3
+/* enum: A normal v-port receives packets which match a specified MAC and/or
+ * VLAN.
+ */
+#define MC_CMD_VPORT_ALLOC_IN_VPORT_TYPE_NORMAL 0x4
+/* enum: An expansion v-port packets traffic which don't match any other
+ * v-port.
+ */
+#define MC_CMD_VPORT_ALLOC_IN_VPORT_TYPE_EXPANSION 0x5
+/* enum: An test v-port receives packets which match any filters installed by
+ * its downstream components.
+ */
+#define MC_CMD_VPORT_ALLOC_IN_VPORT_TYPE_TEST 0x6
+/* Flags controlling v-port creation */
+#define MC_CMD_VPORT_ALLOC_IN_FLAGS_OFST 8
+#define MC_CMD_VPORT_ALLOC_IN_FLAG_AUTO_PORT_LBN 0
+#define MC_CMD_VPORT_ALLOC_IN_FLAG_AUTO_PORT_WIDTH 1
+/* The number of VLAN tags to insert/remove. An error will be returned if
+ * incompatible with the number of VLAN tags specified for the upstream
+ * v-switch.
+ */
+#define MC_CMD_VPORT_ALLOC_IN_NUM_VLAN_TAGS_OFST 12
+/* The actual VLAN tags to insert/remove */
+#define MC_CMD_VPORT_ALLOC_IN_VLAN_TAGS_OFST 16
+#define MC_CMD_VPORT_ALLOC_IN_VLAN_TAG_0_LBN 0
+#define MC_CMD_VPORT_ALLOC_IN_VLAN_TAG_0_WIDTH 16
+#define MC_CMD_VPORT_ALLOC_IN_VLAN_TAG_1_LBN 16
+#define MC_CMD_VPORT_ALLOC_IN_VLAN_TAG_1_WIDTH 16
+
+/* MC_CMD_VPORT_ALLOC_OUT msgresponse */
+#define MC_CMD_VPORT_ALLOC_OUT_LEN 4
+/* The handle of the new v-port */
+#define MC_CMD_VPORT_ALLOC_OUT_VPORT_ID_OFST 0
+
+
+/***********************************/
+/* MC_CMD_VPORT_FREE
+ * de-allocate a v-port.
+ */
+#define MC_CMD_VPORT_FREE 0x97
+#undef MC_CMD_0x97_PRIVILEGE_CTG
+
+#define MC_CMD_0x97_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_VPORT_FREE_IN msgrequest */
+#define MC_CMD_VPORT_FREE_IN_LEN 4
+/* The handle of the v-port */
+#define MC_CMD_VPORT_FREE_IN_VPORT_ID_OFST 0
+
+/* MC_CMD_VPORT_FREE_OUT msgresponse */
+#define MC_CMD_VPORT_FREE_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_VADAPTOR_ALLOC
+ * allocate a v-adaptor.
+ */
+#define MC_CMD_VADAPTOR_ALLOC 0x98
+#undef MC_CMD_0x98_PRIVILEGE_CTG
+
+#define MC_CMD_0x98_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_VADAPTOR_ALLOC_IN msgrequest */
+#define MC_CMD_VADAPTOR_ALLOC_IN_LEN 30
+/* The port to connect to the v-adaptor's port. */
+#define MC_CMD_VADAPTOR_ALLOC_IN_UPSTREAM_PORT_ID_OFST 0
+/* Flags controlling v-adaptor creation */
+#define MC_CMD_VADAPTOR_ALLOC_IN_FLAGS_OFST 8
+#define MC_CMD_VADAPTOR_ALLOC_IN_FLAG_AUTO_VADAPTOR_LBN 0
+#define MC_CMD_VADAPTOR_ALLOC_IN_FLAG_AUTO_VADAPTOR_WIDTH 1
+/* The number of VLAN tags to strip on receive */
+#define MC_CMD_VADAPTOR_ALLOC_IN_NUM_VLANS_OFST 12
+/* The number of VLAN tags to transparently insert/remove. */
+#define MC_CMD_VADAPTOR_ALLOC_IN_NUM_VLAN_TAGS_OFST 16
+/* The actual VLAN tags to insert/remove */
+#define MC_CMD_VADAPTOR_ALLOC_IN_VLAN_TAGS_OFST 20
+#define MC_CMD_VADAPTOR_ALLOC_IN_VLAN_TAG_0_LBN 0
+#define MC_CMD_VADAPTOR_ALLOC_IN_VLAN_TAG_0_WIDTH 16
+#define MC_CMD_VADAPTOR_ALLOC_IN_VLAN_TAG_1_LBN 16
+#define MC_CMD_VADAPTOR_ALLOC_IN_VLAN_TAG_1_WIDTH 16
+/* The MAC address to assign to this v-adaptor */
+#define MC_CMD_VADAPTOR_ALLOC_IN_MACADDR_OFST 24
+#define MC_CMD_VADAPTOR_ALLOC_IN_MACADDR_LEN 6
+/* enum: Derive the MAC address from the upstream port */
+#define MC_CMD_VADAPTOR_ALLOC_IN_AUTO_MAC 0x0
+
+/* MC_CMD_VADAPTOR_ALLOC_OUT msgresponse */
+#define MC_CMD_VADAPTOR_ALLOC_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_VADAPTOR_FREE
+ * de-allocate a v-adaptor.
+ */
+#define MC_CMD_VADAPTOR_FREE 0x99
+#undef MC_CMD_0x99_PRIVILEGE_CTG
+
+#define MC_CMD_0x99_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_VADAPTOR_FREE_IN msgrequest */
+#define MC_CMD_VADAPTOR_FREE_IN_LEN 4
+/* The port to which the v-adaptor is connected. */
+#define MC_CMD_VADAPTOR_FREE_IN_UPSTREAM_PORT_ID_OFST 0
+
+/* MC_CMD_VADAPTOR_FREE_OUT msgresponse */
+#define MC_CMD_VADAPTOR_FREE_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_VADAPTOR_SET_MAC
+ * assign a new MAC address to a v-adaptor.
+ */
+#define MC_CMD_VADAPTOR_SET_MAC 0x5d
+#undef MC_CMD_0x5d_PRIVILEGE_CTG
+
+#define MC_CMD_0x5d_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_VADAPTOR_SET_MAC_IN msgrequest */
+#define MC_CMD_VADAPTOR_SET_MAC_IN_LEN 10
+/* The port to which the v-adaptor is connected. */
+#define MC_CMD_VADAPTOR_SET_MAC_IN_UPSTREAM_PORT_ID_OFST 0
+/* The new MAC address to assign to this v-adaptor */
+#define MC_CMD_VADAPTOR_SET_MAC_IN_MACADDR_OFST 4
+#define MC_CMD_VADAPTOR_SET_MAC_IN_MACADDR_LEN 6
+
+/* MC_CMD_VADAPTOR_SET_MAC_OUT msgresponse */
+#define MC_CMD_VADAPTOR_SET_MAC_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_VADAPTOR_GET_MAC
+ * read the MAC address assigned to a v-adaptor.
+ */
+#define MC_CMD_VADAPTOR_GET_MAC 0x5e
+#undef MC_CMD_0x5e_PRIVILEGE_CTG
+
+#define MC_CMD_0x5e_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_VADAPTOR_GET_MAC_IN msgrequest */
+#define MC_CMD_VADAPTOR_GET_MAC_IN_LEN 4
+/* The port to which the v-adaptor is connected. */
+#define MC_CMD_VADAPTOR_GET_MAC_IN_UPSTREAM_PORT_ID_OFST 0
+
+/* MC_CMD_VADAPTOR_GET_MAC_OUT msgresponse */
+#define MC_CMD_VADAPTOR_GET_MAC_OUT_LEN 6
+/* The MAC address assigned to this v-adaptor */
+#define MC_CMD_VADAPTOR_GET_MAC_OUT_MACADDR_OFST 0
+#define MC_CMD_VADAPTOR_GET_MAC_OUT_MACADDR_LEN 6
+
+
+/***********************************/
+/* MC_CMD_EVB_PORT_ASSIGN
+ * assign a port to a PCI function.
+ */
+#define MC_CMD_EVB_PORT_ASSIGN 0x9a
+#undef MC_CMD_0x9a_PRIVILEGE_CTG
+
+#define MC_CMD_0x9a_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_EVB_PORT_ASSIGN_IN msgrequest */
+#define MC_CMD_EVB_PORT_ASSIGN_IN_LEN 8
+/* The port to assign. */
+#define MC_CMD_EVB_PORT_ASSIGN_IN_PORT_ID_OFST 0
+/* The target function to modify. */
+#define MC_CMD_EVB_PORT_ASSIGN_IN_FUNCTION_OFST 4
+#define MC_CMD_EVB_PORT_ASSIGN_IN_PF_LBN 0
+#define MC_CMD_EVB_PORT_ASSIGN_IN_PF_WIDTH 16
+#define MC_CMD_EVB_PORT_ASSIGN_IN_VF_LBN 16
+#define MC_CMD_EVB_PORT_ASSIGN_IN_VF_WIDTH 16
+
+/* MC_CMD_EVB_PORT_ASSIGN_OUT msgresponse */
+#define MC_CMD_EVB_PORT_ASSIGN_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_RDWR_A64_REGIONS
+ * Assign the 64 bit region addresses.
+ */
+#define MC_CMD_RDWR_A64_REGIONS 0x9b
+#undef MC_CMD_0x9b_PRIVILEGE_CTG
+
+#define MC_CMD_0x9b_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_RDWR_A64_REGIONS_IN msgrequest */
+#define MC_CMD_RDWR_A64_REGIONS_IN_LEN 17
+#define MC_CMD_RDWR_A64_REGIONS_IN_REGION0_OFST 0
+#define MC_CMD_RDWR_A64_REGIONS_IN_REGION1_OFST 4
+#define MC_CMD_RDWR_A64_REGIONS_IN_REGION2_OFST 8
+#define MC_CMD_RDWR_A64_REGIONS_IN_REGION3_OFST 12
+/* Write enable bits 0-3, set to write, clear to read. */
+#define MC_CMD_RDWR_A64_REGIONS_IN_WRITE_MASK_LBN 128
+#define MC_CMD_RDWR_A64_REGIONS_IN_WRITE_MASK_WIDTH 4
+#define MC_CMD_RDWR_A64_REGIONS_IN_WRITE_MASK_BYTE_OFST 16
+#define MC_CMD_RDWR_A64_REGIONS_IN_WRITE_MASK_BYTE_LEN 1
+
+/* MC_CMD_RDWR_A64_REGIONS_OUT msgresponse: This data always included
+ * regardless of state of write bits in the request.
+ */
+#define MC_CMD_RDWR_A64_REGIONS_OUT_LEN 16
+#define MC_CMD_RDWR_A64_REGIONS_OUT_REGION0_OFST 0
+#define MC_CMD_RDWR_A64_REGIONS_OUT_REGION1_OFST 4
+#define MC_CMD_RDWR_A64_REGIONS_OUT_REGION2_OFST 8
+#define MC_CMD_RDWR_A64_REGIONS_OUT_REGION3_OFST 12
+
+
+/***********************************/
+/* MC_CMD_ONLOAD_STACK_ALLOC
+ * Allocate an Onload stack ID.
+ */
+#define MC_CMD_ONLOAD_STACK_ALLOC 0x9c
+#undef MC_CMD_0x9c_PRIVILEGE_CTG
+
+#define MC_CMD_0x9c_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
+
+/* MC_CMD_ONLOAD_STACK_ALLOC_IN msgrequest */
+#define MC_CMD_ONLOAD_STACK_ALLOC_IN_LEN 4
+/* The handle of the owning upstream port */
+#define MC_CMD_ONLOAD_STACK_ALLOC_IN_UPSTREAM_PORT_ID_OFST 0
+
+/* MC_CMD_ONLOAD_STACK_ALLOC_OUT msgresponse */
+#define MC_CMD_ONLOAD_STACK_ALLOC_OUT_LEN 4
+/* The handle of the new Onload stack */
+#define MC_CMD_ONLOAD_STACK_ALLOC_OUT_ONLOAD_STACK_ID_OFST 0
+
+
+/***********************************/
+/* MC_CMD_ONLOAD_STACK_FREE
+ * Free an Onload stack ID.
+ */
+#define MC_CMD_ONLOAD_STACK_FREE 0x9d
+#undef MC_CMD_0x9d_PRIVILEGE_CTG
+
+#define MC_CMD_0x9d_PRIVILEGE_CTG SRIOV_CTG_ONLOAD
+
+/* MC_CMD_ONLOAD_STACK_FREE_IN msgrequest */
+#define MC_CMD_ONLOAD_STACK_FREE_IN_LEN 4
+/* The handle of the Onload stack */
+#define MC_CMD_ONLOAD_STACK_FREE_IN_ONLOAD_STACK_ID_OFST 0
+
+/* MC_CMD_ONLOAD_STACK_FREE_OUT msgresponse */
+#define MC_CMD_ONLOAD_STACK_FREE_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_RSS_CONTEXT_ALLOC
+ * Allocate an RSS context.
+ */
+#define MC_CMD_RSS_CONTEXT_ALLOC 0x9e
+#undef MC_CMD_0x9e_PRIVILEGE_CTG
+
+#define MC_CMD_0x9e_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_RSS_CONTEXT_ALLOC_IN msgrequest */
+#define MC_CMD_RSS_CONTEXT_ALLOC_IN_LEN 12
+/* The handle of the owning upstream port */
+#define MC_CMD_RSS_CONTEXT_ALLOC_IN_UPSTREAM_PORT_ID_OFST 0
+/* The type of context to allocate */
+#define MC_CMD_RSS_CONTEXT_ALLOC_IN_TYPE_OFST 4
+/* enum: Allocate a context for exclusive use. The key and indirection table
+ * must be explicitly configured.
+ */
+#define MC_CMD_RSS_CONTEXT_ALLOC_IN_TYPE_EXCLUSIVE 0x0
+/* enum: Allocate a context for shared use; this will spread across a range of
+ * queues, but the key and indirection table are pre-configured and may not be
+ * changed. For this mode, NUM_QUEUES must 2, 4, 8, 16, 32 or 64.
+ */
+#define MC_CMD_RSS_CONTEXT_ALLOC_IN_TYPE_SHARED 0x1
+/* Number of queues spanned by this context, in the range 1-64; valid offsets
+ * in the indirection table will be in the range 0 to NUM_QUEUES-1.
+ */
+#define MC_CMD_RSS_CONTEXT_ALLOC_IN_NUM_QUEUES_OFST 8
+
+/* MC_CMD_RSS_CONTEXT_ALLOC_OUT msgresponse */
+#define MC_CMD_RSS_CONTEXT_ALLOC_OUT_LEN 4
+/* The handle of the new RSS context. This should be considered opaque to the
+ * host, although a value of 0xFFFFFFFF is guaranteed never to be a valid
+ * handle.
+ */
+#define MC_CMD_RSS_CONTEXT_ALLOC_OUT_RSS_CONTEXT_ID_OFST 0
+/* enum: guaranteed invalid RSS context handle value */
+#define MC_CMD_RSS_CONTEXT_ALLOC_OUT_RSS_CONTEXT_ID_INVALID 0xffffffff
+
+
+/***********************************/
+/* MC_CMD_RSS_CONTEXT_FREE
+ * Free an RSS context.
+ */
+#define MC_CMD_RSS_CONTEXT_FREE 0x9f
+#undef MC_CMD_0x9f_PRIVILEGE_CTG
+
+#define MC_CMD_0x9f_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_RSS_CONTEXT_FREE_IN msgrequest */
+#define MC_CMD_RSS_CONTEXT_FREE_IN_LEN 4
+/* The handle of the RSS context */
+#define MC_CMD_RSS_CONTEXT_FREE_IN_RSS_CONTEXT_ID_OFST 0
+
+/* MC_CMD_RSS_CONTEXT_FREE_OUT msgresponse */
+#define MC_CMD_RSS_CONTEXT_FREE_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_RSS_CONTEXT_SET_KEY
+ * Set the Toeplitz hash key for an RSS context.
+ */
+#define MC_CMD_RSS_CONTEXT_SET_KEY 0xa0
+#undef MC_CMD_0xa0_PRIVILEGE_CTG
+
+#define MC_CMD_0xa0_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_RSS_CONTEXT_SET_KEY_IN msgrequest */
+#define MC_CMD_RSS_CONTEXT_SET_KEY_IN_LEN 44
+/* The handle of the RSS context */
+#define MC_CMD_RSS_CONTEXT_SET_KEY_IN_RSS_CONTEXT_ID_OFST 0
+/* The 40-byte Toeplitz hash key (TBD endianness issues?) */
+#define MC_CMD_RSS_CONTEXT_SET_KEY_IN_TOEPLITZ_KEY_OFST 4
+#define MC_CMD_RSS_CONTEXT_SET_KEY_IN_TOEPLITZ_KEY_LEN 40
+
+/* MC_CMD_RSS_CONTEXT_SET_KEY_OUT msgresponse */
+#define MC_CMD_RSS_CONTEXT_SET_KEY_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_RSS_CONTEXT_GET_KEY
+ * Get the Toeplitz hash key for an RSS context.
+ */
+#define MC_CMD_RSS_CONTEXT_GET_KEY 0xa1
+#undef MC_CMD_0xa1_PRIVILEGE_CTG
+
+#define MC_CMD_0xa1_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_RSS_CONTEXT_GET_KEY_IN msgrequest */
+#define MC_CMD_RSS_CONTEXT_GET_KEY_IN_LEN 4
+/* The handle of the RSS context */
+#define MC_CMD_RSS_CONTEXT_GET_KEY_IN_RSS_CONTEXT_ID_OFST 0
+
+/* MC_CMD_RSS_CONTEXT_GET_KEY_OUT msgresponse */
+#define MC_CMD_RSS_CONTEXT_GET_KEY_OUT_LEN 44
+/* The 40-byte Toeplitz hash key (TBD endianness issues?) */
+#define MC_CMD_RSS_CONTEXT_GET_KEY_OUT_TOEPLITZ_KEY_OFST 4
+#define MC_CMD_RSS_CONTEXT_GET_KEY_OUT_TOEPLITZ_KEY_LEN 40
+
+
+/***********************************/
+/* MC_CMD_RSS_CONTEXT_SET_TABLE
+ * Set the indirection table for an RSS context.
+ */
+#define MC_CMD_RSS_CONTEXT_SET_TABLE 0xa2
+#undef MC_CMD_0xa2_PRIVILEGE_CTG
+
+#define MC_CMD_0xa2_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_RSS_CONTEXT_SET_TABLE_IN msgrequest */
+#define MC_CMD_RSS_CONTEXT_SET_TABLE_IN_LEN 132
+/* The handle of the RSS context */
+#define MC_CMD_RSS_CONTEXT_SET_TABLE_IN_RSS_CONTEXT_ID_OFST 0
+/* The 128-byte indirection table (1 byte per entry) */
+#define MC_CMD_RSS_CONTEXT_SET_TABLE_IN_INDIRECTION_TABLE_OFST 4
+#define MC_CMD_RSS_CONTEXT_SET_TABLE_IN_INDIRECTION_TABLE_LEN 128
+
+/* MC_CMD_RSS_CONTEXT_SET_TABLE_OUT msgresponse */
+#define MC_CMD_RSS_CONTEXT_SET_TABLE_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_RSS_CONTEXT_GET_TABLE
+ * Get the indirection table for an RSS context.
+ */
+#define MC_CMD_RSS_CONTEXT_GET_TABLE 0xa3
+#undef MC_CMD_0xa3_PRIVILEGE_CTG
+
+#define MC_CMD_0xa3_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_RSS_CONTEXT_GET_TABLE_IN msgrequest */
+#define MC_CMD_RSS_CONTEXT_GET_TABLE_IN_LEN 4
+/* The handle of the RSS context */
+#define MC_CMD_RSS_CONTEXT_GET_TABLE_IN_RSS_CONTEXT_ID_OFST 0
+
+/* MC_CMD_RSS_CONTEXT_GET_TABLE_OUT msgresponse */
+#define MC_CMD_RSS_CONTEXT_GET_TABLE_OUT_LEN 132
+/* The 128-byte indirection table (1 byte per entry) */
+#define MC_CMD_RSS_CONTEXT_GET_TABLE_OUT_INDIRECTION_TABLE_OFST 4
+#define MC_CMD_RSS_CONTEXT_GET_TABLE_OUT_INDIRECTION_TABLE_LEN 128
+
+
+/***********************************/
+/* MC_CMD_RSS_CONTEXT_SET_FLAGS
+ * Set various control flags for an RSS context.
+ */
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS 0xe1
+#undef MC_CMD_0xe1_PRIVILEGE_CTG
+
+#define MC_CMD_0xe1_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_RSS_CONTEXT_SET_FLAGS_IN msgrequest */
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_LEN 8
+/* The handle of the RSS context */
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_RSS_CONTEXT_ID_OFST 0
+/* Hash control flags. The _EN bits are always supported. The _MODE bits only
+ * work when the firmware reports ADDITIONAL_RSS_MODES in
+ * MC_CMD_GET_CAPABILITIES and override the _EN bits if any of them are not 0.
+ * See the RSS_MODE structure for the meaning of the mode bits.
+ */
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_FLAGS_OFST 4
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV4_EN_LBN 0
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV4_EN_WIDTH 1
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV4_EN_LBN 1
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV4_EN_WIDTH 1
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV6_EN_LBN 2
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV6_EN_WIDTH 1
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV6_EN_LBN 3
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV6_EN_WIDTH 1
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_RESERVED_LBN 4
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_RESERVED_WIDTH 4
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV4_RSS_MODE_LBN 8
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV4_RSS_MODE_WIDTH 4
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_UDP_IPV4_RSS_MODE_LBN 12
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_UDP_IPV4_RSS_MODE_WIDTH 4
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_OTHER_IPV4_RSS_MODE_LBN 16
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_OTHER_IPV4_RSS_MODE_WIDTH 4
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV6_RSS_MODE_LBN 20
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV6_RSS_MODE_WIDTH 4
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_UDP_IPV6_RSS_MODE_LBN 24
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_UDP_IPV6_RSS_MODE_WIDTH 4
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_OTHER_IPV6_RSS_MODE_LBN 28
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_OTHER_IPV6_RSS_MODE_WIDTH 4
+
+/* MC_CMD_RSS_CONTEXT_SET_FLAGS_OUT msgresponse */
+#define MC_CMD_RSS_CONTEXT_SET_FLAGS_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_RSS_CONTEXT_GET_FLAGS
+ * Get various control flags for an RSS context.
+ */
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS 0xe2
+#undef MC_CMD_0xe2_PRIVILEGE_CTG
+
+#define MC_CMD_0xe2_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_RSS_CONTEXT_GET_FLAGS_IN msgrequest */
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_IN_LEN 4
+/* The handle of the RSS context */
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_IN_RSS_CONTEXT_ID_OFST 0
+
+/* MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT msgresponse */
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_LEN 8
+/* Hash control flags. If any _MODE bits are non-zero (which will only be true
+ * when the firmware reports ADDITIONAL_RSS_MODES) then the _EN bits should be
+ * disregarded (but are guaranteed to be consistent with the _MODE bits if
+ * RSS_CONTEXT_SET_FLAGS has never been called for this context since it was
+ * allocated).
+ */
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_FLAGS_OFST 4
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_IPV4_EN_LBN 0
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_IPV4_EN_WIDTH 1
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_TCPV4_EN_LBN 1
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_TCPV4_EN_WIDTH 1
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_IPV6_EN_LBN 2
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_IPV6_EN_WIDTH 1
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_TCPV6_EN_LBN 3
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TOEPLITZ_TCPV6_EN_WIDTH 1
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_RESERVED_LBN 4
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_RESERVED_WIDTH 4
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TCP_IPV4_RSS_MODE_LBN 8
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TCP_IPV4_RSS_MODE_WIDTH 4
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_UDP_IPV4_RSS_MODE_LBN 12
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_UDP_IPV4_RSS_MODE_WIDTH 4
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_OTHER_IPV4_RSS_MODE_LBN 16
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_OTHER_IPV4_RSS_MODE_WIDTH 4
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TCP_IPV6_RSS_MODE_LBN 20
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_TCP_IPV6_RSS_MODE_WIDTH 4
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_UDP_IPV6_RSS_MODE_LBN 24
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_UDP_IPV6_RSS_MODE_WIDTH 4
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_OTHER_IPV6_RSS_MODE_LBN 28
+#define MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_OTHER_IPV6_RSS_MODE_WIDTH 4
+
+
+/***********************************/
+/* MC_CMD_DOT1P_MAPPING_ALLOC
+ * Allocate a .1p mapping.
+ */
+#define MC_CMD_DOT1P_MAPPING_ALLOC 0xa4
+#undef MC_CMD_0xa4_PRIVILEGE_CTG
+
+#define MC_CMD_0xa4_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_DOT1P_MAPPING_ALLOC_IN msgrequest */
+#define MC_CMD_DOT1P_MAPPING_ALLOC_IN_LEN 8
+/* The handle of the owning upstream port */
+#define MC_CMD_DOT1P_MAPPING_ALLOC_IN_UPSTREAM_PORT_ID_OFST 0
+/* Number of queues spanned by this mapping, in the range 1-64; valid fixed
+ * offsets in the mapping table will be in the range 0 to NUM_QUEUES-1, and
+ * referenced RSS contexts must span no more than this number.
+ */
+#define MC_CMD_DOT1P_MAPPING_ALLOC_IN_NUM_QUEUES_OFST 4
+
+/* MC_CMD_DOT1P_MAPPING_ALLOC_OUT msgresponse */
+#define MC_CMD_DOT1P_MAPPING_ALLOC_OUT_LEN 4
+/* The handle of the new .1p mapping. This should be considered opaque to the
+ * host, although a value of 0xFFFFFFFF is guaranteed never to be a valid
+ * handle.
+ */
+#define MC_CMD_DOT1P_MAPPING_ALLOC_OUT_DOT1P_MAPPING_ID_OFST 0
+/* enum: guaranteed invalid .1p mapping handle value */
+#define MC_CMD_DOT1P_MAPPING_ALLOC_OUT_DOT1P_MAPPING_ID_INVALID 0xffffffff
+
+
+/***********************************/
+/* MC_CMD_DOT1P_MAPPING_FREE
+ * Free a .1p mapping.
+ */
+#define MC_CMD_DOT1P_MAPPING_FREE 0xa5
+#undef MC_CMD_0xa5_PRIVILEGE_CTG
+
+#define MC_CMD_0xa5_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_DOT1P_MAPPING_FREE_IN msgrequest */
+#define MC_CMD_DOT1P_MAPPING_FREE_IN_LEN 4
+/* The handle of the .1p mapping */
+#define MC_CMD_DOT1P_MAPPING_FREE_IN_DOT1P_MAPPING_ID_OFST 0
+
+/* MC_CMD_DOT1P_MAPPING_FREE_OUT msgresponse */
+#define MC_CMD_DOT1P_MAPPING_FREE_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_DOT1P_MAPPING_SET_TABLE
+ * Set the mapping table for a .1p mapping.
+ */
+#define MC_CMD_DOT1P_MAPPING_SET_TABLE 0xa6
+#undef MC_CMD_0xa6_PRIVILEGE_CTG
+
+#define MC_CMD_0xa6_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_DOT1P_MAPPING_SET_TABLE_IN msgrequest */
+#define MC_CMD_DOT1P_MAPPING_SET_TABLE_IN_LEN 36
+/* The handle of the .1p mapping */
+#define MC_CMD_DOT1P_MAPPING_SET_TABLE_IN_DOT1P_MAPPING_ID_OFST 0
+/* Per-priority mappings (1 32-bit word per entry - an offset or RSS context
+ * handle)
+ */
+#define MC_CMD_DOT1P_MAPPING_SET_TABLE_IN_MAPPING_TABLE_OFST 4
+#define MC_CMD_DOT1P_MAPPING_SET_TABLE_IN_MAPPING_TABLE_LEN 32
+
+/* MC_CMD_DOT1P_MAPPING_SET_TABLE_OUT msgresponse */
+#define MC_CMD_DOT1P_MAPPING_SET_TABLE_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_DOT1P_MAPPING_GET_TABLE
+ * Get the mapping table for a .1p mapping.
+ */
+#define MC_CMD_DOT1P_MAPPING_GET_TABLE 0xa7
+#undef MC_CMD_0xa7_PRIVILEGE_CTG
+
+#define MC_CMD_0xa7_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_DOT1P_MAPPING_GET_TABLE_IN msgrequest */
+#define MC_CMD_DOT1P_MAPPING_GET_TABLE_IN_LEN 4
+/* The handle of the .1p mapping */
+#define MC_CMD_DOT1P_MAPPING_GET_TABLE_IN_DOT1P_MAPPING_ID_OFST 0
+
+/* MC_CMD_DOT1P_MAPPING_GET_TABLE_OUT msgresponse */
+#define MC_CMD_DOT1P_MAPPING_GET_TABLE_OUT_LEN 36
+/* Per-priority mappings (1 32-bit word per entry - an offset or RSS context
+ * handle)
+ */
+#define MC_CMD_DOT1P_MAPPING_GET_TABLE_OUT_MAPPING_TABLE_OFST 4
+#define MC_CMD_DOT1P_MAPPING_GET_TABLE_OUT_MAPPING_TABLE_LEN 32
+
+
+/***********************************/
+/* MC_CMD_GET_VECTOR_CFG
+ * Get Interrupt Vector config for this PF.
+ */
+#define MC_CMD_GET_VECTOR_CFG 0xbf
+#undef MC_CMD_0xbf_PRIVILEGE_CTG
+
+#define MC_CMD_0xbf_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_GET_VECTOR_CFG_IN msgrequest */
+#define MC_CMD_GET_VECTOR_CFG_IN_LEN 0
+
+/* MC_CMD_GET_VECTOR_CFG_OUT msgresponse */
+#define MC_CMD_GET_VECTOR_CFG_OUT_LEN 12
+/* Base absolute interrupt vector number. */
+#define MC_CMD_GET_VECTOR_CFG_OUT_VEC_BASE_OFST 0
+/* Number of interrupt vectors allocate to this PF. */
+#define MC_CMD_GET_VECTOR_CFG_OUT_VECS_PER_PF_OFST 4
+/* Number of interrupt vectors to allocate per VF. */
+#define MC_CMD_GET_VECTOR_CFG_OUT_VECS_PER_VF_OFST 8
+
+
+/***********************************/
+/* MC_CMD_SET_VECTOR_CFG
+ * Set Interrupt Vector config for this PF.
+ */
+#define MC_CMD_SET_VECTOR_CFG 0xc0
+#undef MC_CMD_0xc0_PRIVILEGE_CTG
+
+#define MC_CMD_0xc0_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_SET_VECTOR_CFG_IN msgrequest */
+#define MC_CMD_SET_VECTOR_CFG_IN_LEN 12
+/* Base absolute interrupt vector number, or MC_CMD_RESOURCE_INSTANCE_ANY to
+ * let the system find a suitable base.
+ */
+#define MC_CMD_SET_VECTOR_CFG_IN_VEC_BASE_OFST 0
+/* Number of interrupt vectors allocate to this PF. */
+#define MC_CMD_SET_VECTOR_CFG_IN_VECS_PER_PF_OFST 4
+/* Number of interrupt vectors to allocate per VF. */
+#define MC_CMD_SET_VECTOR_CFG_IN_VECS_PER_VF_OFST 8
+
+/* MC_CMD_SET_VECTOR_CFG_OUT msgresponse */
+#define MC_CMD_SET_VECTOR_CFG_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_VPORT_ADD_MAC_ADDRESS
+ * Add a MAC address to a v-port
+ */
+#define MC_CMD_VPORT_ADD_MAC_ADDRESS 0xa8
+#undef MC_CMD_0xa8_PRIVILEGE_CTG
+
+#define MC_CMD_0xa8_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_VPORT_ADD_MAC_ADDRESS_IN msgrequest */
+#define MC_CMD_VPORT_ADD_MAC_ADDRESS_IN_LEN 10
+/* The handle of the v-port */
+#define MC_CMD_VPORT_ADD_MAC_ADDRESS_IN_VPORT_ID_OFST 0
+/* MAC address to add */
+#define MC_CMD_VPORT_ADD_MAC_ADDRESS_IN_MACADDR_OFST 4
+#define MC_CMD_VPORT_ADD_MAC_ADDRESS_IN_MACADDR_LEN 6
+
+/* MC_CMD_VPORT_ADD_MAC_ADDRESS_OUT msgresponse */
+#define MC_CMD_VPORT_ADD_MAC_ADDRESS_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_VPORT_DEL_MAC_ADDRESS
+ * Delete a MAC address from a v-port
+ */
+#define MC_CMD_VPORT_DEL_MAC_ADDRESS 0xa9
+#undef MC_CMD_0xa9_PRIVILEGE_CTG
+
+#define MC_CMD_0xa9_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_VPORT_DEL_MAC_ADDRESS_IN msgrequest */
+#define MC_CMD_VPORT_DEL_MAC_ADDRESS_IN_LEN 10
+/* The handle of the v-port */
+#define MC_CMD_VPORT_DEL_MAC_ADDRESS_IN_VPORT_ID_OFST 0
+/* MAC address to add */
+#define MC_CMD_VPORT_DEL_MAC_ADDRESS_IN_MACADDR_OFST 4
+#define MC_CMD_VPORT_DEL_MAC_ADDRESS_IN_MACADDR_LEN 6
+
+/* MC_CMD_VPORT_DEL_MAC_ADDRESS_OUT msgresponse */
+#define MC_CMD_VPORT_DEL_MAC_ADDRESS_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_VPORT_GET_MAC_ADDRESSES
+ * Delete a MAC address from a v-port
+ */
+#define MC_CMD_VPORT_GET_MAC_ADDRESSES 0xaa
+#undef MC_CMD_0xaa_PRIVILEGE_CTG
+
+#define MC_CMD_0xaa_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_VPORT_GET_MAC_ADDRESSES_IN msgrequest */
+#define MC_CMD_VPORT_GET_MAC_ADDRESSES_IN_LEN 4
+/* The handle of the v-port */
+#define MC_CMD_VPORT_GET_MAC_ADDRESSES_IN_VPORT_ID_OFST 0
+
+/* MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT msgresponse */
+#define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_LENMIN 4
+#define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_LENMAX 250
+#define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_LEN(num) (4+6*(num))
+/* The number of MAC addresses returned */
+#define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_MACADDR_COUNT_OFST 0
+/* Array of MAC addresses */
+#define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_MACADDR_OFST 4
+#define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_MACADDR_LEN 6
+#define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_MACADDR_MINNUM 0
+#define MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_MACADDR_MAXNUM 41
+
+
+/***********************************/
+/* MC_CMD_DUMP_BUFTBL_ENTRIES
+ * Dump buffer table entries, mainly for command client debug use. Dumps
+ * absolute entries, and does not use chunk handles. All entries must be in
+ * range, and used for q page mapping, Although the latter restriction may be
+ * lifted in future.
+ */
+#define MC_CMD_DUMP_BUFTBL_ENTRIES 0xab
+#undef MC_CMD_0xab_PRIVILEGE_CTG
+
+#define MC_CMD_0xab_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_DUMP_BUFTBL_ENTRIES_IN msgrequest */
+#define MC_CMD_DUMP_BUFTBL_ENTRIES_IN_LEN 8
+/* Index of the first buffer table entry. */
+#define MC_CMD_DUMP_BUFTBL_ENTRIES_IN_FIRSTID_OFST 0
+/* Number of buffer table entries to dump. */
+#define MC_CMD_DUMP_BUFTBL_ENTRIES_IN_NUMENTRIES_OFST 4
+
+/* MC_CMD_DUMP_BUFTBL_ENTRIES_OUT msgresponse */
+#define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_LENMIN 12
+#define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_LENMAX 252
+#define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_LEN(num) (0+12*(num))
+/* Raw buffer table entries, layed out as BUFTBL_ENTRY. */
+#define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_ENTRY_OFST 0
+#define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_ENTRY_LEN 12
+#define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_ENTRY_MINNUM 1
+#define MC_CMD_DUMP_BUFTBL_ENTRIES_OUT_ENTRY_MAXNUM 21
+
+
+/***********************************/
+/* MC_CMD_SET_RXDP_CONFIG
+ * Set global RXDP configuration settings
+ */
+#define MC_CMD_SET_RXDP_CONFIG 0xc1
+#undef MC_CMD_0xc1_PRIVILEGE_CTG
+
+#define MC_CMD_0xc1_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_SET_RXDP_CONFIG_IN msgrequest */
+#define MC_CMD_SET_RXDP_CONFIG_IN_LEN 4
+#define MC_CMD_SET_RXDP_CONFIG_IN_DATA_OFST 0
+#define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_DMA_LBN 0
+#define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_DMA_WIDTH 1
+
+/* MC_CMD_SET_RXDP_CONFIG_OUT msgresponse */
+#define MC_CMD_SET_RXDP_CONFIG_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_GET_RXDP_CONFIG
+ * Get global RXDP configuration settings
+ */
+#define MC_CMD_GET_RXDP_CONFIG 0xc2
+#undef MC_CMD_0xc2_PRIVILEGE_CTG
+
+#define MC_CMD_0xc2_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_GET_RXDP_CONFIG_IN msgrequest */
+#define MC_CMD_GET_RXDP_CONFIG_IN_LEN 0
+
+/* MC_CMD_GET_RXDP_CONFIG_OUT msgresponse */
+#define MC_CMD_GET_RXDP_CONFIG_OUT_LEN 4
+#define MC_CMD_GET_RXDP_CONFIG_OUT_DATA_OFST 0
+#define MC_CMD_GET_RXDP_CONFIG_OUT_PAD_HOST_DMA_LBN 0
+#define MC_CMD_GET_RXDP_CONFIG_OUT_PAD_HOST_DMA_WIDTH 1
+
+
+/***********************************/
+/* MC_CMD_GET_CLOCK
+ * Return the system and PDCPU clock frequencies.
+ */
+#define MC_CMD_GET_CLOCK 0xac
+#undef MC_CMD_0xac_PRIVILEGE_CTG
+
+#define MC_CMD_0xac_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_GET_CLOCK_IN msgrequest */
+#define MC_CMD_GET_CLOCK_IN_LEN 0
+
+/* MC_CMD_GET_CLOCK_OUT msgresponse */
+#define MC_CMD_GET_CLOCK_OUT_LEN 8
+/* System frequency, MHz */
+#define MC_CMD_GET_CLOCK_OUT_SYS_FREQ_OFST 0
+/* DPCPU frequency, MHz */
+#define MC_CMD_GET_CLOCK_OUT_DPCPU_FREQ_OFST 4
+
+
+/***********************************/
+/* MC_CMD_SET_CLOCK
+ * Control the system and DPCPU clock frequencies. Changes are lost reboot.
+ */
+#define MC_CMD_SET_CLOCK 0xad
+#undef MC_CMD_0xad_PRIVILEGE_CTG
+
+#define MC_CMD_0xad_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_SET_CLOCK_IN msgrequest */
+#define MC_CMD_SET_CLOCK_IN_LEN 28
+/* Requested frequency in MHz for system clock domain */
+#define MC_CMD_SET_CLOCK_IN_SYS_FREQ_OFST 0
+/* enum: Leave the system clock domain frequency unchanged */
+#define MC_CMD_SET_CLOCK_IN_SYS_DOMAIN_DONT_CHANGE 0x0
+/* Requested frequency in MHz for inter-core clock domain */
+#define MC_CMD_SET_CLOCK_IN_ICORE_FREQ_OFST 4
+/* enum: Leave the inter-core clock domain frequency unchanged */
+#define MC_CMD_SET_CLOCK_IN_ICORE_DOMAIN_DONT_CHANGE 0x0
+/* Requested frequency in MHz for DPCPU clock domain */
+#define MC_CMD_SET_CLOCK_IN_DPCPU_FREQ_OFST 8
+/* enum: Leave the DPCPU clock domain frequency unchanged */
+#define MC_CMD_SET_CLOCK_IN_DPCPU_DOMAIN_DONT_CHANGE 0x0
+/* Requested frequency in MHz for PCS clock domain */
+#define MC_CMD_SET_CLOCK_IN_PCS_FREQ_OFST 12
+/* enum: Leave the PCS clock domain frequency unchanged */
+#define MC_CMD_SET_CLOCK_IN_PCS_DOMAIN_DONT_CHANGE 0x0
+/* Requested frequency in MHz for MC clock domain */
+#define MC_CMD_SET_CLOCK_IN_MC_FREQ_OFST 16
+/* enum: Leave the MC clock domain frequency unchanged */
+#define MC_CMD_SET_CLOCK_IN_MC_DOMAIN_DONT_CHANGE 0x0
+/* Requested frequency in MHz for rmon clock domain */
+#define MC_CMD_SET_CLOCK_IN_RMON_FREQ_OFST 20
+/* enum: Leave the rmon clock domain frequency unchanged */
+#define MC_CMD_SET_CLOCK_IN_RMON_DOMAIN_DONT_CHANGE 0x0
+/* Requested frequency in MHz for vswitch clock domain */
+#define MC_CMD_SET_CLOCK_IN_VSWITCH_FREQ_OFST 24
+/* enum: Leave the vswitch clock domain frequency unchanged */
+#define MC_CMD_SET_CLOCK_IN_VSWITCH_DOMAIN_DONT_CHANGE 0x0
+
+/* MC_CMD_SET_CLOCK_OUT msgresponse */
+#define MC_CMD_SET_CLOCK_OUT_LEN 28
+/* Resulting system frequency in MHz */
+#define MC_CMD_SET_CLOCK_OUT_SYS_FREQ_OFST 0
+/* enum: The system clock domain doesn't exist */
+#define MC_CMD_SET_CLOCK_OUT_SYS_DOMAIN_UNSUPPORTED 0x0
+/* Resulting inter-core frequency in MHz */
+#define MC_CMD_SET_CLOCK_OUT_ICORE_FREQ_OFST 4
+/* enum: The inter-core clock domain doesn't exist / isn't used */
+#define MC_CMD_SET_CLOCK_OUT_ICORE_DOMAIN_UNSUPPORTED 0x0
+/* Resulting DPCPU frequency in MHz */
+#define MC_CMD_SET_CLOCK_OUT_DPCPU_FREQ_OFST 8
+/* enum: The dpcpu clock domain doesn't exist */
+#define MC_CMD_SET_CLOCK_OUT_DPCPU_DOMAIN_UNSUPPORTED 0x0
+/* Resulting PCS frequency in MHz */
+#define MC_CMD_SET_CLOCK_OUT_PCS_FREQ_OFST 12
+/* enum: The PCS clock domain doesn't exist / isn't controlled */
+#define MC_CMD_SET_CLOCK_OUT_PCS_DOMAIN_UNSUPPORTED 0x0
+/* Resulting MC frequency in MHz */
+#define MC_CMD_SET_CLOCK_OUT_MC_FREQ_OFST 16
+/* enum: The MC clock domain doesn't exist / isn't controlled */
+#define MC_CMD_SET_CLOCK_OUT_MC_DOMAIN_UNSUPPORTED 0x0
+/* Resulting rmon frequency in MHz */
+#define MC_CMD_SET_CLOCK_OUT_RMON_FREQ_OFST 20
+/* enum: The rmon clock domain doesn't exist / isn't controlled */
+#define MC_CMD_SET_CLOCK_OUT_RMON_DOMAIN_UNSUPPORTED 0x0
+/* Resulting vswitch frequency in MHz */
+#define MC_CMD_SET_CLOCK_OUT_VSWITCH_FREQ_OFST 24
+/* enum: The vswitch clock domain doesn't exist / isn't controlled */
+#define MC_CMD_SET_CLOCK_OUT_VSWITCH_DOMAIN_UNSUPPORTED 0x0
+
+
+/***********************************/
+/* MC_CMD_DPCPU_RPC
+ * Send an arbitrary DPCPU message.
+ */
+#define MC_CMD_DPCPU_RPC 0xae
+#undef MC_CMD_0xae_PRIVILEGE_CTG
+
+#define MC_CMD_0xae_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_DPCPU_RPC_IN msgrequest */
+#define MC_CMD_DPCPU_RPC_IN_LEN 36
+#define MC_CMD_DPCPU_RPC_IN_CPU_OFST 0
+/* enum: RxDPCPU0 */
+#define MC_CMD_DPCPU_RPC_IN_DPCPU_RX0 0x0
+/* enum: TxDPCPU0 */
+#define MC_CMD_DPCPU_RPC_IN_DPCPU_TX0 0x1
+/* enum: TxDPCPU1 */
+#define MC_CMD_DPCPU_RPC_IN_DPCPU_TX1 0x2
+/* enum: RxDPCPU1 (Medford only) */
+#define MC_CMD_DPCPU_RPC_IN_DPCPU_RX1 0x3
+/* enum: RxDPCPU (will be for the calling function; for now, just an alias of
+ * DPCPU_RX0)
+ */
+#define MC_CMD_DPCPU_RPC_IN_DPCPU_RX 0x80
+/* enum: TxDPCPU (will be for the calling function; for now, just an alias of
+ * DPCPU_TX0)
+ */
+#define MC_CMD_DPCPU_RPC_IN_DPCPU_TX 0x81
+/* First 8 bits [39:32] of DATA are consumed by MC-DPCPU protocol and must be
+ * initialised to zero
+ */
+#define MC_CMD_DPCPU_RPC_IN_DATA_OFST 4
+#define MC_CMD_DPCPU_RPC_IN_DATA_LEN 32
+#define MC_CMD_DPCPU_RPC_IN_HDR_CMD_CMDNUM_LBN 8
+#define MC_CMD_DPCPU_RPC_IN_HDR_CMD_CMDNUM_WIDTH 8
+#define MC_CMD_DPCPU_RPC_IN_CMDNUM_TXDPCPU_READ 0x6 /* enum */
+#define MC_CMD_DPCPU_RPC_IN_CMDNUM_TXDPCPU_WRITE 0x7 /* enum */
+#define MC_CMD_DPCPU_RPC_IN_CMDNUM_TXDPCPU_SELF_TEST 0xc /* enum */
+#define MC_CMD_DPCPU_RPC_IN_CMDNUM_TXDPCPU_CSR_ACCESS 0xe /* enum */
+#define MC_CMD_DPCPU_RPC_IN_CMDNUM_RXDPCPU_READ 0x46 /* enum */
+#define MC_CMD_DPCPU_RPC_IN_CMDNUM_RXDPCPU_WRITE 0x47 /* enum */
+#define MC_CMD_DPCPU_RPC_IN_CMDNUM_RXDPCPU_SELF_TEST 0x4a /* enum */
+#define MC_CMD_DPCPU_RPC_IN_CMDNUM_RXDPCPU_CSR_ACCESS 0x4c /* enum */
+#define MC_CMD_DPCPU_RPC_IN_CMDNUM_RXDPCPU_SET_MC_REPLAY_CNTXT 0x4d /* enum */
+#define MC_CMD_DPCPU_RPC_IN_HDR_CMD_REQ_OBJID_LBN 16
+#define MC_CMD_DPCPU_RPC_IN_HDR_CMD_REQ_OBJID_WIDTH 16
+#define MC_CMD_DPCPU_RPC_IN_HDR_CMD_REQ_ADDR_LBN 16
+#define MC_CMD_DPCPU_RPC_IN_HDR_CMD_REQ_ADDR_WIDTH 16
+#define MC_CMD_DPCPU_RPC_IN_HDR_CMD_REQ_COUNT_LBN 48
+#define MC_CMD_DPCPU_RPC_IN_HDR_CMD_REQ_COUNT_WIDTH 16
+#define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_INFO_LBN 16
+#define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_INFO_WIDTH 240
+#define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_LBN 16
+#define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_WIDTH 16
+#define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_STOP_RETURN_RESULT 0x0 /* enum */
+#define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_START_READ 0x1 /* enum */
+#define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_START_WRITE 0x2 /* enum */
+#define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_START_WRITE_READ 0x3 /* enum */
+#define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_CMD_START_PIPELINED_READ 0x4 /* enum */
+#define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_START_DELAY_LBN 48
+#define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_START_DELAY_WIDTH 16
+#define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_RPT_COUNT_LBN 64
+#define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_RPT_COUNT_WIDTH 16
+#define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_GAP_DELAY_LBN 80
+#define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_GAP_DELAY_WIDTH 16
+#define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_MODE_LBN 16
+#define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_MODE_WIDTH 16
+#define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_MODE_CUT_THROUGH 0x1 /* enum */
+#define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_MODE_STORE_FORWARD 0x2 /* enum */
+#define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_MODE_STORE_FORWARD_FIRST 0x3 /* enum */
+#define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_CNTXT_LBN 64
+#define MC_CMD_DPCPU_RPC_IN_MC_REPLAY_CNTXT_WIDTH 16
+#define MC_CMD_DPCPU_RPC_IN_WDATA_OFST 12
+#define MC_CMD_DPCPU_RPC_IN_WDATA_LEN 24
+/* Register data to write. Only valid in write/write-read. */
+#define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_DATA_OFST 16
+/* Register address. */
+#define MC_CMD_DPCPU_RPC_IN_CSR_ACCESS_ADDRESS_OFST 20
+
+/* MC_CMD_DPCPU_RPC_OUT msgresponse */
+#define MC_CMD_DPCPU_RPC_OUT_LEN 36
+#define MC_CMD_DPCPU_RPC_OUT_RC_OFST 0
+/* DATA */
+#define MC_CMD_DPCPU_RPC_OUT_DATA_OFST 4
+#define MC_CMD_DPCPU_RPC_OUT_DATA_LEN 32
+#define MC_CMD_DPCPU_RPC_OUT_HDR_CMD_RESP_ERRCODE_LBN 32
+#define MC_CMD_DPCPU_RPC_OUT_HDR_CMD_RESP_ERRCODE_WIDTH 16
+#define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_COUNT_LBN 48
+#define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_COUNT_WIDTH 16
+#define MC_CMD_DPCPU_RPC_OUT_RDATA_OFST 12
+#define MC_CMD_DPCPU_RPC_OUT_RDATA_LEN 24
+#define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_VAL_1_OFST 12
+#define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_VAL_2_OFST 16
+#define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_VAL_3_OFST 20
+#define MC_CMD_DPCPU_RPC_OUT_CSR_ACCESS_READ_VAL_4_OFST 24
+
+
+/***********************************/
+/* MC_CMD_TRIGGER_INTERRUPT
+ * Trigger an interrupt by prodding the BIU.
+ */
+#define MC_CMD_TRIGGER_INTERRUPT 0xe3
+#undef MC_CMD_0xe3_PRIVILEGE_CTG
+
+#define MC_CMD_0xe3_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_TRIGGER_INTERRUPT_IN msgrequest */
+#define MC_CMD_TRIGGER_INTERRUPT_IN_LEN 4
+/* Interrupt level relative to base for function. */
+#define MC_CMD_TRIGGER_INTERRUPT_IN_INTR_LEVEL_OFST 0
+
+/* MC_CMD_TRIGGER_INTERRUPT_OUT msgresponse */
+#define MC_CMD_TRIGGER_INTERRUPT_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_SHMBOOT_OP
+ * Special operations to support (for now) shmboot.
+ */
+#define MC_CMD_SHMBOOT_OP 0xe6
+#undef MC_CMD_0xe6_PRIVILEGE_CTG
+
+#define MC_CMD_0xe6_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_SHMBOOT_OP_IN msgrequest */
+#define MC_CMD_SHMBOOT_OP_IN_LEN 4
+/* Identifies the operation to perform */
+#define MC_CMD_SHMBOOT_OP_IN_SHMBOOT_OP_OFST 0
+/* enum: Copy slave_data section to the slave core. (Greenport only) */
+#define MC_CMD_SHMBOOT_OP_IN_PUSH_SLAVE_DATA 0x0
+
+/* MC_CMD_SHMBOOT_OP_OUT msgresponse */
+#define MC_CMD_SHMBOOT_OP_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_CAP_BLK_READ
+ * Read multiple 64bit words from capture block memory
+ */
+#define MC_CMD_CAP_BLK_READ 0xe7
+#undef MC_CMD_0xe7_PRIVILEGE_CTG
+
+#define MC_CMD_0xe7_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_CAP_BLK_READ_IN msgrequest */
+#define MC_CMD_CAP_BLK_READ_IN_LEN 12
+#define MC_CMD_CAP_BLK_READ_IN_CAP_REG_OFST 0
+#define MC_CMD_CAP_BLK_READ_IN_ADDR_OFST 4
+#define MC_CMD_CAP_BLK_READ_IN_COUNT_OFST 8
+
+/* MC_CMD_CAP_BLK_READ_OUT msgresponse */
+#define MC_CMD_CAP_BLK_READ_OUT_LENMIN 8
+#define MC_CMD_CAP_BLK_READ_OUT_LENMAX 248
+#define MC_CMD_CAP_BLK_READ_OUT_LEN(num) (0+8*(num))
+#define MC_CMD_CAP_BLK_READ_OUT_BUFFER_OFST 0
+#define MC_CMD_CAP_BLK_READ_OUT_BUFFER_LEN 8
+#define MC_CMD_CAP_BLK_READ_OUT_BUFFER_LO_OFST 0
+#define MC_CMD_CAP_BLK_READ_OUT_BUFFER_HI_OFST 4
+#define MC_CMD_CAP_BLK_READ_OUT_BUFFER_MINNUM 1
+#define MC_CMD_CAP_BLK_READ_OUT_BUFFER_MAXNUM 31
+
+
+/***********************************/
+/* MC_CMD_DUMP_DO
+ * Take a dump of the DUT state
+ */
+#define MC_CMD_DUMP_DO 0xe8
+#undef MC_CMD_0xe8_PRIVILEGE_CTG
+
+#define MC_CMD_0xe8_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_DUMP_DO_IN msgrequest */
+#define MC_CMD_DUMP_DO_IN_LEN 52
+#define MC_CMD_DUMP_DO_IN_PADDING_OFST 0
+#define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_OFST 4
+#define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM 0x0 /* enum */
+#define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_DEFAULT 0x1 /* enum */
+#define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_TYPE_OFST 8
+#define MC_CMD_DUMP_DO_IN_DUMP_LOCATION_NVRAM 0x1 /* enum */
+#define MC_CMD_DUMP_DO_IN_DUMP_LOCATION_HOST_MEMORY 0x2 /* enum */
+#define MC_CMD_DUMP_DO_IN_DUMP_LOCATION_HOST_MEMORY_MLI 0x3 /* enum */
+#define MC_CMD_DUMP_DO_IN_DUMP_LOCATION_UART 0x4 /* enum */
+#define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_NVRAM_PARTITION_TYPE_ID_OFST 12
+#define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_NVRAM_OFFSET_OFST 16
+#define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_ADDR_LO_OFST 12
+#define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_ADDR_HI_OFST 16
+#define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_LO_OFST 12
+#define MC_CMD_DUMP_DO_IN_HOST_MEMORY_MLI_PAGE_SIZE 0x1000 /* enum */
+#define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_HI_OFST 16
+#define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_DEPTH_OFST 20
+#define MC_CMD_DUMP_DO_IN_HOST_MEMORY_MLI_MAX_DEPTH 0x2 /* enum */
+#define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_UART_PORT_OFST 12
+/* enum: The uart port this command was received over (if using a uart
+ * transport)
+ */
+#define MC_CMD_DUMP_DO_IN_UART_PORT_SRC 0xff
+#define MC_CMD_DUMP_DO_IN_DUMPSPEC_SRC_CUSTOM_SIZE_OFST 24
+#define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_OFST 28
+#define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM 0x0 /* enum */
+#define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_NVRAM_DUMP_PARTITION 0x1 /* enum */
+#define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_TYPE_OFST 32
+/* Enum values, see field(s): */
+/* MC_CMD_DUMP_DO_IN/DUMPSPEC_SRC_CUSTOM_TYPE */
+#define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_NVRAM_PARTITION_TYPE_ID_OFST 36
+#define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_NVRAM_OFFSET_OFST 40
+#define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_ADDR_LO_OFST 36
+#define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_ADDR_HI_OFST 40
+#define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_LO_OFST 36
+#define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_HI_OFST 40
+#define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_DEPTH_OFST 44
+#define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_UART_PORT_OFST 36
+#define MC_CMD_DUMP_DO_IN_DUMPFILE_DST_CUSTOM_SIZE_OFST 48
+
+/* MC_CMD_DUMP_DO_OUT msgresponse */
+#define MC_CMD_DUMP_DO_OUT_LEN 4
+#define MC_CMD_DUMP_DO_OUT_DUMPFILE_SIZE_OFST 0
+
+
+/***********************************/
+/* MC_CMD_DUMP_CONFIGURE_UNSOLICITED
+ * Configure unsolicited dumps
+ */
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED 0xe9
+#undef MC_CMD_0xe9_PRIVILEGE_CTG
+
+#define MC_CMD_0xe9_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN msgrequest */
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_LEN 52
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_ENABLE_OFST 0
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_OFST 4
+/* Enum values, see field(s): */
+/* MC_CMD_DUMP_DO/MC_CMD_DUMP_DO_IN/DUMPSPEC_SRC */
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_TYPE_OFST 8
+/* Enum values, see field(s): */
+/* MC_CMD_DUMP_DO/MC_CMD_DUMP_DO_IN/DUMPSPEC_SRC_CUSTOM_TYPE */
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_NVRAM_PARTITION_TYPE_ID_OFST 12
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_NVRAM_OFFSET_OFST 16
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_ADDR_LO_OFST 12
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_ADDR_HI_OFST 16
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_LO_OFST 12
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_HI_OFST 16
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_HOST_MEMORY_MLI_DEPTH_OFST 20
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_UART_PORT_OFST 12
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPSPEC_SRC_CUSTOM_SIZE_OFST 24
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_OFST 28
+/* Enum values, see field(s): */
+/* MC_CMD_DUMP_DO/MC_CMD_DUMP_DO_IN/DUMPFILE_DST */
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_TYPE_OFST 32
+/* Enum values, see field(s): */
+/* MC_CMD_DUMP_DO/MC_CMD_DUMP_DO_IN/DUMPSPEC_SRC_CUSTOM_TYPE */
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_NVRAM_PARTITION_TYPE_ID_OFST 36
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_NVRAM_OFFSET_OFST 40
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_ADDR_LO_OFST 36
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_ADDR_HI_OFST 40
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_LO_OFST 36
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_ROOT_ADDR_HI_OFST 40
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_HOST_MEMORY_MLI_DEPTH_OFST 44
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_UART_PORT_OFST 36
+#define MC_CMD_DUMP_CONFIGURE_UNSOLICITED_IN_DUMPFILE_DST_CUSTOM_SIZE_OFST 48
+
+
+/***********************************/
+/* MC_CMD_SET_PSU
+ * Adjusts power supply parameters. This is a warranty-voiding operation.
+ * Returns: ENOENT if the parameter or rail specified does not exist, EINVAL if
+ * the parameter is out of range.
+ */
+#define MC_CMD_SET_PSU 0xea
+#undef MC_CMD_0xea_PRIVILEGE_CTG
+
+#define MC_CMD_0xea_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_SET_PSU_IN msgrequest */
+#define MC_CMD_SET_PSU_IN_LEN 12
+#define MC_CMD_SET_PSU_IN_PARAM_OFST 0
+#define MC_CMD_SET_PSU_IN_PARAM_SUPPLY_VOLTAGE 0x0 /* enum */
+#define MC_CMD_SET_PSU_IN_RAIL_OFST 4
+#define MC_CMD_SET_PSU_IN_RAIL_0V9 0x0 /* enum */
+#define MC_CMD_SET_PSU_IN_RAIL_1V2 0x1 /* enum */
+/* desired value, eg voltage in mV */
+#define MC_CMD_SET_PSU_IN_VALUE_OFST 8
+
+/* MC_CMD_SET_PSU_OUT msgresponse */
+#define MC_CMD_SET_PSU_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_GET_FUNCTION_INFO
+ * Get function information. PF and VF number.
+ */
+#define MC_CMD_GET_FUNCTION_INFO 0xec
+#undef MC_CMD_0xec_PRIVILEGE_CTG
+
+#define MC_CMD_0xec_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_GET_FUNCTION_INFO_IN msgrequest */
+#define MC_CMD_GET_FUNCTION_INFO_IN_LEN 0
+
+/* MC_CMD_GET_FUNCTION_INFO_OUT msgresponse */
+#define MC_CMD_GET_FUNCTION_INFO_OUT_LEN 8
+#define MC_CMD_GET_FUNCTION_INFO_OUT_PF_OFST 0
+#define MC_CMD_GET_FUNCTION_INFO_OUT_VF_OFST 4
+
+
+/***********************************/
+/* MC_CMD_ENABLE_OFFLINE_BIST
+ * Enters offline BIST mode. All queues are torn down, chip enters quiescent
+ * mode, calling function gets exclusive MCDI ownership. The only way out is
+ * reboot.
+ */
+#define MC_CMD_ENABLE_OFFLINE_BIST 0xed
+#undef MC_CMD_0xed_PRIVILEGE_CTG
+
+#define MC_CMD_0xed_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_ENABLE_OFFLINE_BIST_IN msgrequest */
+#define MC_CMD_ENABLE_OFFLINE_BIST_IN_LEN 0
+
+/* MC_CMD_ENABLE_OFFLINE_BIST_OUT msgresponse */
+#define MC_CMD_ENABLE_OFFLINE_BIST_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_UART_SEND_DATA
+ * Send checksummed[sic] block of data over the uart. Response is a placeholder
+ * should we wish to make this reliable; currently requests are fire-and-
+ * forget.
+ */
+#define MC_CMD_UART_SEND_DATA 0xee
+#undef MC_CMD_0xee_PRIVILEGE_CTG
+
+#define MC_CMD_0xee_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_UART_SEND_DATA_OUT msgrequest */
+#define MC_CMD_UART_SEND_DATA_OUT_LENMIN 16
+#define MC_CMD_UART_SEND_DATA_OUT_LENMAX 252
+#define MC_CMD_UART_SEND_DATA_OUT_LEN(num) (16+1*(num))
+/* CRC32 over OFFSET, LENGTH, RESERVED, DATA */
+#define MC_CMD_UART_SEND_DATA_OUT_CHECKSUM_OFST 0
+/* Offset at which to write the data */
+#define MC_CMD_UART_SEND_DATA_OUT_OFFSET_OFST 4
+/* Length of data */
+#define MC_CMD_UART_SEND_DATA_OUT_LENGTH_OFST 8
+/* Reserved for future use */
+#define MC_CMD_UART_SEND_DATA_OUT_RESERVED_OFST 12
+#define MC_CMD_UART_SEND_DATA_OUT_DATA_OFST 16
+#define MC_CMD_UART_SEND_DATA_OUT_DATA_LEN 1
+#define MC_CMD_UART_SEND_DATA_OUT_DATA_MINNUM 0
+#define MC_CMD_UART_SEND_DATA_OUT_DATA_MAXNUM 236
+
+/* MC_CMD_UART_SEND_DATA_IN msgresponse */
+#define MC_CMD_UART_SEND_DATA_IN_LEN 0
+
+
+/***********************************/
+/* MC_CMD_UART_RECV_DATA
+ * Request checksummed[sic] block of data over the uart. Only a placeholder,
+ * subject to change and not currently implemented.
+ */
+#define MC_CMD_UART_RECV_DATA 0xef
+#undef MC_CMD_0xef_PRIVILEGE_CTG
+
+#define MC_CMD_0xef_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_UART_RECV_DATA_OUT msgrequest */
+#define MC_CMD_UART_RECV_DATA_OUT_LEN 16
+/* CRC32 over OFFSET, LENGTH, RESERVED */
+#define MC_CMD_UART_RECV_DATA_OUT_CHECKSUM_OFST 0
+/* Offset from which to read the data */
+#define MC_CMD_UART_RECV_DATA_OUT_OFFSET_OFST 4
+/* Length of data */
+#define MC_CMD_UART_RECV_DATA_OUT_LENGTH_OFST 8
+/* Reserved for future use */
+#define MC_CMD_UART_RECV_DATA_OUT_RESERVED_OFST 12
+
+/* MC_CMD_UART_RECV_DATA_IN msgresponse */
+#define MC_CMD_UART_RECV_DATA_IN_LENMIN 16
+#define MC_CMD_UART_RECV_DATA_IN_LENMAX 252
+#define MC_CMD_UART_RECV_DATA_IN_LEN(num) (16+1*(num))
+/* CRC32 over RESERVED1, RESERVED2, RESERVED3, DATA */
+#define MC_CMD_UART_RECV_DATA_IN_CHECKSUM_OFST 0
+/* Offset at which to write the data */
+#define MC_CMD_UART_RECV_DATA_IN_RESERVED1_OFST 4
+/* Length of data */
+#define MC_CMD_UART_RECV_DATA_IN_RESERVED2_OFST 8
+/* Reserved for future use */
+#define MC_CMD_UART_RECV_DATA_IN_RESERVED3_OFST 12
+#define MC_CMD_UART_RECV_DATA_IN_DATA_OFST 16
+#define MC_CMD_UART_RECV_DATA_IN_DATA_LEN 1
+#define MC_CMD_UART_RECV_DATA_IN_DATA_MINNUM 0
+#define MC_CMD_UART_RECV_DATA_IN_DATA_MAXNUM 236
+
+
+/***********************************/
+/* MC_CMD_READ_FUSES
+ * Read data programmed into the device One-Time-Programmable (OTP) Fuses
+ */
+#define MC_CMD_READ_FUSES 0xf0
+#undef MC_CMD_0xf0_PRIVILEGE_CTG
+
+#define MC_CMD_0xf0_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_READ_FUSES_IN msgrequest */
+#define MC_CMD_READ_FUSES_IN_LEN 8
+/* Offset in OTP to read */
+#define MC_CMD_READ_FUSES_IN_OFFSET_OFST 0
+/* Length of data to read in bytes */
+#define MC_CMD_READ_FUSES_IN_LENGTH_OFST 4
+
+/* MC_CMD_READ_FUSES_OUT msgresponse */
+#define MC_CMD_READ_FUSES_OUT_LENMIN 4
+#define MC_CMD_READ_FUSES_OUT_LENMAX 252
+#define MC_CMD_READ_FUSES_OUT_LEN(num) (4+1*(num))
+/* Length of returned OTP data in bytes */
+#define MC_CMD_READ_FUSES_OUT_LENGTH_OFST 0
+/* Returned data */
+#define MC_CMD_READ_FUSES_OUT_DATA_OFST 4
+#define MC_CMD_READ_FUSES_OUT_DATA_LEN 1
+#define MC_CMD_READ_FUSES_OUT_DATA_MINNUM 0
+#define MC_CMD_READ_FUSES_OUT_DATA_MAXNUM 248
+
+
+/***********************************/
+/* MC_CMD_KR_TUNE
+ * Get or set KR Serdes RXEQ and TX Driver settings
+ */
+#define MC_CMD_KR_TUNE 0xf1
+#undef MC_CMD_0xf1_PRIVILEGE_CTG
+
+#define MC_CMD_0xf1_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_KR_TUNE_IN msgrequest */
+#define MC_CMD_KR_TUNE_IN_LENMIN 4
+#define MC_CMD_KR_TUNE_IN_LENMAX 252
+#define MC_CMD_KR_TUNE_IN_LEN(num) (4+4*(num))
+/* Requested operation */
+#define MC_CMD_KR_TUNE_IN_KR_TUNE_OP_OFST 0
+#define MC_CMD_KR_TUNE_IN_KR_TUNE_OP_LEN 1
+/* enum: Get current RXEQ settings */
+#define MC_CMD_KR_TUNE_IN_RXEQ_GET 0x0
+/* enum: Override RXEQ settings */
+#define MC_CMD_KR_TUNE_IN_RXEQ_SET 0x1
+/* enum: Get current TX Driver settings */
+#define MC_CMD_KR_TUNE_IN_TXEQ_GET 0x2
+/* enum: Override TX Driver settings */
+#define MC_CMD_KR_TUNE_IN_TXEQ_SET 0x3
+/* enum: Force KR Serdes reset / recalibration */
+#define MC_CMD_KR_TUNE_IN_RECAL 0x4
+/* enum: Start KR Serdes Eye diagram plot on a given lane. Lane must have valid
+ * signal.
+ */
+#define MC_CMD_KR_TUNE_IN_START_EYE_PLOT 0x5
+/* enum: Poll KR Serdes Eye diagram plot. Returns one row of BER data. The
+ * caller should call this command repeatedly after starting eye plot, until no
+ * more data is returned.
+ */
+#define MC_CMD_KR_TUNE_IN_POLL_EYE_PLOT 0x6
+/* enum: Read Figure Of Merit (eye quality, higher is better). */
+#define MC_CMD_KR_TUNE_IN_READ_FOM 0x7
+/* Align the arguments to 32 bits */
+#define MC_CMD_KR_TUNE_IN_KR_TUNE_RSVD_OFST 1
+#define MC_CMD_KR_TUNE_IN_KR_TUNE_RSVD_LEN 3
+/* Arguments specific to the operation */
+#define MC_CMD_KR_TUNE_IN_KR_TUNE_ARGS_OFST 4
+#define MC_CMD_KR_TUNE_IN_KR_TUNE_ARGS_LEN 4
+#define MC_CMD_KR_TUNE_IN_KR_TUNE_ARGS_MINNUM 0
+#define MC_CMD_KR_TUNE_IN_KR_TUNE_ARGS_MAXNUM 62
+
+/* MC_CMD_KR_TUNE_OUT msgresponse */
+#define MC_CMD_KR_TUNE_OUT_LEN 0
+
+/* MC_CMD_KR_TUNE_RXEQ_GET_IN msgrequest */
+#define MC_CMD_KR_TUNE_RXEQ_GET_IN_LEN 4
+/* Requested operation */
+#define MC_CMD_KR_TUNE_RXEQ_GET_IN_KR_TUNE_OP_OFST 0
+#define MC_CMD_KR_TUNE_RXEQ_GET_IN_KR_TUNE_OP_LEN 1
+/* Align the arguments to 32 bits */
+#define MC_CMD_KR_TUNE_RXEQ_GET_IN_KR_TUNE_RSVD_OFST 1
+#define MC_CMD_KR_TUNE_RXEQ_GET_IN_KR_TUNE_RSVD_LEN 3
+
+/* MC_CMD_KR_TUNE_RXEQ_GET_OUT msgresponse */
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LENMIN 4
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LENMAX 252
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LEN(num) (0+4*(num))
+/* RXEQ Parameter */
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_OFST 0
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_LEN 4
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_MINNUM 1
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_MAXNUM 63
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_ID_LBN 0
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_ID_WIDTH 8
+/* enum: Attenuation (0-15, TBD for Medford) */
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_ATT 0x0
+/* enum: CTLE Boost (0-15, TBD for Medford) */
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_BOOST 0x1
+/* enum: Edge DFE Tap1 (0 - max negative, 64 - zero, 127 - max positive, TBD
+ * for Medford)
+ */
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP1 0x2
+/* enum: Edge DFE Tap2 (0 - max negative, 32 - zero, 63 - max positive, TBD for
+ * Medford)
+ */
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP2 0x3
+/* enum: Edge DFE Tap3 (0 - max negative, 32 - zero, 63 - max positive, TBD for
+ * Medford)
+ */
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP3 0x4
+/* enum: Edge DFE Tap4 (0 - max negative, 32 - zero, 63 - max positive, TBD for
+ * Medford)
+ */
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP4 0x5
+/* enum: Edge DFE Tap5 (0 - max negative, 32 - zero, 63 - max positive, TBD for
+ * Medford)
+ */
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_TAP5 0x6
+/* enum: Edge DFE DLEV (TBD for Medford) */
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_EDFE_DLEV 0x7
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_LANE_LBN 8
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_LANE_WIDTH 3
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LANE_0 0x0 /* enum */
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LANE_1 0x1 /* enum */
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LANE_2 0x2 /* enum */
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LANE_3 0x3 /* enum */
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_LANE_ALL 0x4 /* enum */
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_AUTOCAL_LBN 11
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_AUTOCAL_WIDTH 1
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_RESERVED_LBN 12
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_RESERVED_WIDTH 4
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_INITIAL_LBN 16
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_INITIAL_WIDTH 8
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_CURRENT_LBN 24
+#define MC_CMD_KR_TUNE_RXEQ_GET_OUT_PARAM_CURRENT_WIDTH 8
+
+/* MC_CMD_KR_TUNE_RXEQ_SET_IN msgrequest */
+#define MC_CMD_KR_TUNE_RXEQ_SET_IN_LENMIN 8
+#define MC_CMD_KR_TUNE_RXEQ_SET_IN_LENMAX 252
+#define MC_CMD_KR_TUNE_RXEQ_SET_IN_LEN(num) (4+4*(num))
+/* Requested operation */
+#define MC_CMD_KR_TUNE_RXEQ_SET_IN_KR_TUNE_OP_OFST 0
+#define MC_CMD_KR_TUNE_RXEQ_SET_IN_KR_TUNE_OP_LEN 1
+/* Align the arguments to 32 bits */
+#define MC_CMD_KR_TUNE_RXEQ_SET_IN_KR_TUNE_RSVD_OFST 1
+#define MC_CMD_KR_TUNE_RXEQ_SET_IN_KR_TUNE_RSVD_LEN 3
+/* RXEQ Parameter */
+#define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_OFST 4
+#define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_LEN 4
+#define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_MINNUM 1
+#define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_MAXNUM 62
+#define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_ID_LBN 0
+#define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_ID_WIDTH 8
+/* Enum values, see field(s): */
+/* MC_CMD_KR_TUNE_RXEQ_GET_OUT/PARAM_ID */
+#define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_LANE_LBN 8
+#define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_LANE_WIDTH 3
+/* Enum values, see field(s): */
+/* MC_CMD_KR_TUNE_RXEQ_GET_OUT/PARAM_LANE */
+#define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_AUTOCAL_LBN 11
+#define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_AUTOCAL_WIDTH 1
+#define MC_CMD_KR_TUNE_RXEQ_SET_IN_RESERVED_LBN 12
+#define MC_CMD_KR_TUNE_RXEQ_SET_IN_RESERVED_WIDTH 4
+#define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_INITIAL_LBN 16
+#define MC_CMD_KR_TUNE_RXEQ_SET_IN_PARAM_INITIAL_WIDTH 8
+#define MC_CMD_KR_TUNE_RXEQ_SET_IN_RESERVED2_LBN 24
+#define MC_CMD_KR_TUNE_RXEQ_SET_IN_RESERVED2_WIDTH 8
+
+/* MC_CMD_KR_TUNE_RXEQ_SET_OUT msgresponse */
+#define MC_CMD_KR_TUNE_RXEQ_SET_OUT_LEN 0
+
+/* MC_CMD_KR_TUNE_TXEQ_GET_IN msgrequest */
+#define MC_CMD_KR_TUNE_TXEQ_GET_IN_LEN 4
+/* Requested operation */
+#define MC_CMD_KR_TUNE_TXEQ_GET_IN_KR_TUNE_OP_OFST 0
+#define MC_CMD_KR_TUNE_TXEQ_GET_IN_KR_TUNE_OP_LEN 1
+/* Align the arguments to 32 bits */
+#define MC_CMD_KR_TUNE_TXEQ_GET_IN_KR_TUNE_RSVD_OFST 1
+#define MC_CMD_KR_TUNE_TXEQ_GET_IN_KR_TUNE_RSVD_LEN 3
+
+/* MC_CMD_KR_TUNE_TXEQ_GET_OUT msgresponse */
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LENMIN 4
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LENMAX 252
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LEN(num) (0+4*(num))
+/* TXEQ Parameter */
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_OFST 0
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_LEN 4
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_MINNUM 1
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_MAXNUM 63
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_ID_LBN 0
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_ID_WIDTH 8
+/* enum: TX Amplitude */
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_LEV 0x0
+/* enum: De-Emphasis Tap1 Magnitude (0-7) */
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_MODE 0x1
+/* enum: De-Emphasis Tap1 Fine */
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_DTLEV 0x2
+/* enum: De-Emphasis Tap2 Magnitude (0-6) */
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_D2 0x3
+/* enum: De-Emphasis Tap2 Fine */
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_D2TLEV 0x4
+/* enum: Pre-Emphasis Magnitude */
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_E 0x5
+/* enum: Pre-Emphasis Fine */
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_ETLEV 0x6
+/* enum: TX Slew Rate Coarse control */
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_PREDRV_DLY 0x7
+/* enum: TX Slew Rate Fine control */
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_SR_SET 0x8
+/* enum: TX Termination Impedance control */
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_TX_RT_SET 0x9
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_LANE_LBN 8
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_LANE_WIDTH 3
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LANE_0 0x0 /* enum */
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LANE_1 0x1 /* enum */
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LANE_2 0x2 /* enum */
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LANE_3 0x3 /* enum */
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_LANE_ALL 0x4 /* enum */
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_RESERVED_LBN 11
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_RESERVED_WIDTH 5
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_INITIAL_LBN 16
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_PARAM_INITIAL_WIDTH 8
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_RESERVED2_LBN 24
+#define MC_CMD_KR_TUNE_TXEQ_GET_OUT_RESERVED2_WIDTH 8
+
+/* MC_CMD_KR_TUNE_TXEQ_SET_IN msgrequest */
+#define MC_CMD_KR_TUNE_TXEQ_SET_IN_LENMIN 8
+#define MC_CMD_KR_TUNE_TXEQ_SET_IN_LENMAX 252
+#define MC_CMD_KR_TUNE_TXEQ_SET_IN_LEN(num) (4+4*(num))
+/* Requested operation */
+#define MC_CMD_KR_TUNE_TXEQ_SET_IN_KR_TUNE_OP_OFST 0
+#define MC_CMD_KR_TUNE_TXEQ_SET_IN_KR_TUNE_OP_LEN 1
+/* Align the arguments to 32 bits */
+#define MC_CMD_KR_TUNE_TXEQ_SET_IN_KR_TUNE_RSVD_OFST 1
+#define MC_CMD_KR_TUNE_TXEQ_SET_IN_KR_TUNE_RSVD_LEN 3
+/* TXEQ Parameter */
+#define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_OFST 4
+#define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_LEN 4
+#define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_MINNUM 1
+#define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_MAXNUM 62
+#define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_ID_LBN 0
+#define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_ID_WIDTH 8
+/* Enum values, see field(s): */
+/* MC_CMD_KR_TUNE_TXEQ_GET_OUT/PARAM_ID */
+#define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_LANE_LBN 8
+#define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_LANE_WIDTH 3
+/* Enum values, see field(s): */
+/* MC_CMD_KR_TUNE_TXEQ_GET_OUT/PARAM_LANE */
+#define MC_CMD_KR_TUNE_TXEQ_SET_IN_RESERVED_LBN 11
+#define MC_CMD_KR_TUNE_TXEQ_SET_IN_RESERVED_WIDTH 5
+#define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_INITIAL_LBN 16
+#define MC_CMD_KR_TUNE_TXEQ_SET_IN_PARAM_INITIAL_WIDTH 8
+#define MC_CMD_KR_TUNE_TXEQ_SET_IN_RESERVED2_LBN 24
+#define MC_CMD_KR_TUNE_TXEQ_SET_IN_RESERVED2_WIDTH 8
+
+/* MC_CMD_KR_TUNE_TXEQ_SET_OUT msgresponse */
+#define MC_CMD_KR_TUNE_TXEQ_SET_OUT_LEN 0
+
+/* MC_CMD_KR_TUNE_RECAL_IN msgrequest */
+#define MC_CMD_KR_TUNE_RECAL_IN_LEN 4
+/* Requested operation */
+#define MC_CMD_KR_TUNE_RECAL_IN_KR_TUNE_OP_OFST 0
+#define MC_CMD_KR_TUNE_RECAL_IN_KR_TUNE_OP_LEN 1
+/* Align the arguments to 32 bits */
+#define MC_CMD_KR_TUNE_RECAL_IN_KR_TUNE_RSVD_OFST 1
+#define MC_CMD_KR_TUNE_RECAL_IN_KR_TUNE_RSVD_LEN 3
+
+/* MC_CMD_KR_TUNE_RECAL_OUT msgresponse */
+#define MC_CMD_KR_TUNE_RECAL_OUT_LEN 0
+
+/* MC_CMD_KR_TUNE_START_EYE_PLOT_IN msgrequest */
+#define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_LEN 8
+/* Requested operation */
+#define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_KR_TUNE_OP_OFST 0
+#define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_KR_TUNE_OP_LEN 1
+/* Align the arguments to 32 bits */
+#define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_KR_TUNE_RSVD_OFST 1
+#define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_KR_TUNE_RSVD_LEN 3
+#define MC_CMD_KR_TUNE_START_EYE_PLOT_IN_LANE_OFST 4
+
+/* MC_CMD_KR_TUNE_START_EYE_PLOT_OUT msgresponse */
+#define MC_CMD_KR_TUNE_START_EYE_PLOT_OUT_LEN 0
+
+/* MC_CMD_KR_TUNE_POLL_EYE_PLOT_IN msgrequest */
+#define MC_CMD_KR_TUNE_POLL_EYE_PLOT_IN_LEN 4
+/* Requested operation */
+#define MC_CMD_KR_TUNE_POLL_EYE_PLOT_IN_KR_TUNE_OP_OFST 0
+#define MC_CMD_KR_TUNE_POLL_EYE_PLOT_IN_KR_TUNE_OP_LEN 1
+/* Align the arguments to 32 bits */
+#define MC_CMD_KR_TUNE_POLL_EYE_PLOT_IN_KR_TUNE_RSVD_OFST 1
+#define MC_CMD_KR_TUNE_POLL_EYE_PLOT_IN_KR_TUNE_RSVD_LEN 3
+
+/* MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT msgresponse */
+#define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_LENMIN 0
+#define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_LENMAX 252
+#define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_LEN(num) (0+2*(num))
+#define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_OFST 0
+#define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_LEN 2
+#define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_MINNUM 0
+#define MC_CMD_KR_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_MAXNUM 126
+
+/* MC_CMD_KR_TUNE_READ_FOM_IN msgrequest */
+#define MC_CMD_KR_TUNE_READ_FOM_IN_LEN 8
+/* Requested operation */
+#define MC_CMD_KR_TUNE_READ_FOM_IN_KR_TUNE_OP_OFST 0
+#define MC_CMD_KR_TUNE_READ_FOM_IN_KR_TUNE_OP_LEN 1
+/* Align the arguments to 32 bits */
+#define MC_CMD_KR_TUNE_READ_FOM_IN_KR_TUNE_RSVD_OFST 1
+#define MC_CMD_KR_TUNE_READ_FOM_IN_KR_TUNE_RSVD_LEN 3
+#define MC_CMD_KR_TUNE_READ_FOM_IN_LANE_OFST 4
+
+/* MC_CMD_KR_TUNE_READ_FOM_OUT msgresponse */
+#define MC_CMD_KR_TUNE_READ_FOM_OUT_LEN 4
+#define MC_CMD_KR_TUNE_READ_FOM_OUT_FOM_OFST 0
+
+
+/***********************************/
+/* MC_CMD_PCIE_TUNE
+ * Get or set PCIE Serdes RXEQ and TX Driver settings
+ */
+#define MC_CMD_PCIE_TUNE 0xf2
+#undef MC_CMD_0xf2_PRIVILEGE_CTG
+
+#define MC_CMD_0xf2_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_PCIE_TUNE_IN msgrequest */
+#define MC_CMD_PCIE_TUNE_IN_LENMIN 4
+#define MC_CMD_PCIE_TUNE_IN_LENMAX 252
+#define MC_CMD_PCIE_TUNE_IN_LEN(num) (4+4*(num))
+/* Requested operation */
+#define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_OP_OFST 0
+#define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_OP_LEN 1
+/* enum: Get current RXEQ settings */
+#define MC_CMD_PCIE_TUNE_IN_RXEQ_GET 0x0
+/* enum: Override RXEQ settings */
+#define MC_CMD_PCIE_TUNE_IN_RXEQ_SET 0x1
+/* enum: Get current TX Driver settings */
+#define MC_CMD_PCIE_TUNE_IN_TXEQ_GET 0x2
+/* enum: Override TX Driver settings */
+#define MC_CMD_PCIE_TUNE_IN_TXEQ_SET 0x3
+/* enum: Start PCIe Serdes Eye diagram plot on a given lane. */
+#define MC_CMD_PCIE_TUNE_IN_START_EYE_PLOT 0x5
+/* enum: Poll PCIe Serdes Eye diagram plot. Returns one row of BER data. The
+ * caller should call this command repeatedly after starting eye plot, until no
+ * more data is returned.
+ */
+#define MC_CMD_PCIE_TUNE_IN_POLL_EYE_PLOT 0x6
+/* Align the arguments to 32 bits */
+#define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_RSVD_OFST 1
+#define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_RSVD_LEN 3
+/* Arguments specific to the operation */
+#define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_ARGS_OFST 4
+#define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_ARGS_LEN 4
+#define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_ARGS_MINNUM 0
+#define MC_CMD_PCIE_TUNE_IN_PCIE_TUNE_ARGS_MAXNUM 62
+
+/* MC_CMD_PCIE_TUNE_OUT msgresponse */
+#define MC_CMD_PCIE_TUNE_OUT_LEN 0
+
+/* MC_CMD_PCIE_TUNE_RXEQ_GET_IN msgrequest */
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_IN_LEN 4
+/* Requested operation */
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_IN_PCIE_TUNE_OP_OFST 0
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_IN_PCIE_TUNE_OP_LEN 1
+/* Align the arguments to 32 bits */
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_IN_PCIE_TUNE_RSVD_OFST 1
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_IN_PCIE_TUNE_RSVD_LEN 3
+
+/* MC_CMD_PCIE_TUNE_RXEQ_GET_OUT msgresponse */
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LENMIN 4
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LENMAX 252
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LEN(num) (0+4*(num))
+/* RXEQ Parameter */
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_OFST 0
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_LEN 4
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_MINNUM 1
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_MAXNUM 63
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_ID_LBN 0
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_ID_WIDTH 8
+/* enum: Attenuation (0-15) */
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_ATT 0x0
+/* enum: CTLE Boost (0-15) */
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_BOOST 0x1
+/* enum: DFE Tap1 (0 - max negative, 64 - zero, 127 - max positive) */
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_TAP1 0x2
+/* enum: DFE Tap2 (0 - max negative, 32 - zero, 63 - max positive) */
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_TAP2 0x3
+/* enum: DFE Tap3 (0 - max negative, 32 - zero, 63 - max positive) */
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_TAP3 0x4
+/* enum: DFE Tap4 (0 - max negative, 32 - zero, 63 - max positive) */
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_TAP4 0x5
+/* enum: DFE Tap5 (0 - max negative, 32 - zero, 63 - max positive) */
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_TAP5 0x6
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_LANE_LBN 8
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_LANE_WIDTH 4
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_0 0x0 /* enum */
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_1 0x1 /* enum */
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_2 0x2 /* enum */
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_3 0x3 /* enum */
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_4 0x4 /* enum */
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_5 0x5 /* enum */
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_6 0x6 /* enum */
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_7 0x7 /* enum */
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_ALL 0x8 /* enum */
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_RESERVED_LBN 12
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_RESERVED_WIDTH 12
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_CURRENT_LBN 24
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_CURRENT_WIDTH 8
+
+/* MC_CMD_PCIE_TUNE_TXEQ_GET_IN msgrequest */
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_IN_LEN 4
+/* Requested operation */
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_IN_PCIE_TUNE_OP_OFST 0
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_IN_PCIE_TUNE_OP_LEN 1
+/* Align the arguments to 32 bits */
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_IN_PCIE_TUNE_RSVD_OFST 1
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_IN_PCIE_TUNE_RSVD_LEN 3
+
+/* MC_CMD_PCIE_TUNE_TXEQ_GET_OUT msgresponse */
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_LENMIN 4
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_LENMAX 252
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_LEN(num) (0+4*(num))
+/* RXEQ Parameter */
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_OFST 0
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_LEN 4
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_MINNUM 1
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_MAXNUM 63
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_ID_LBN 0
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_ID_WIDTH 8
+/* enum: TxMargin (PIPE) */
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_TXMARGIN 0x0
+/* enum: TxSwing (PIPE) */
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_TXSWING 0x1
+/* enum: De-emphasis coefficient C(-1) (PIPE) */
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_CM1 0x2
+/* enum: De-emphasis coefficient C(0) (PIPE) */
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_C0 0x3
+/* enum: De-emphasis coefficient C(+1) (PIPE) */
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_CP1 0x4
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_LANE_LBN 8
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_LANE_WIDTH 4
+/* Enum values, see field(s): */
+/* MC_CMD_PCIE_TUNE_RXEQ_GET_OUT/PARAM_LANE */
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_RESERVED_LBN 12
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_RESERVED_WIDTH 12
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_CURRENT_LBN 24
+#define MC_CMD_PCIE_TUNE_TXEQ_GET_OUT_PARAM_CURRENT_WIDTH 8
+
+/* MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN msgrequest */
+#define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_LEN 8
+/* Requested operation */
+#define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_PCIE_TUNE_OP_OFST 0
+#define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_PCIE_TUNE_OP_LEN 1
+/* Align the arguments to 32 bits */
+#define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_PCIE_TUNE_RSVD_OFST 1
+#define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_PCIE_TUNE_RSVD_LEN 3
+#define MC_CMD_PCIE_TUNE_START_EYE_PLOT_IN_LANE_OFST 4
+
+/* MC_CMD_PCIE_TUNE_START_EYE_PLOT_OUT msgresponse */
+#define MC_CMD_PCIE_TUNE_START_EYE_PLOT_OUT_LEN 0
+
+/* MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_IN msgrequest */
+#define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_IN_LEN 4
+/* Requested operation */
+#define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_IN_PCIE_TUNE_OP_OFST 0
+#define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_IN_PCIE_TUNE_OP_LEN 1
+/* Align the arguments to 32 bits */
+#define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_IN_PCIE_TUNE_RSVD_OFST 1
+#define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_IN_PCIE_TUNE_RSVD_LEN 3
+
+/* MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT msgresponse */
+#define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_LENMIN 0
+#define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_LENMAX 252
+#define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_LEN(num) (0+2*(num))
+#define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_OFST 0
+#define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_LEN 2
+#define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_MINNUM 0
+#define MC_CMD_PCIE_TUNE_POLL_EYE_PLOT_OUT_SAMPLES_MAXNUM 126
+
+
+/***********************************/
+/* MC_CMD_LICENSING
+ * Operations on the NVRAM_PARTITION_TYPE_LICENSE application license partition
+ */
+#define MC_CMD_LICENSING 0xf3
+#undef MC_CMD_0xf3_PRIVILEGE_CTG
+
+#define MC_CMD_0xf3_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_LICENSING_IN msgrequest */
+#define MC_CMD_LICENSING_IN_LEN 4
+/* identifies the type of operation requested */
+#define MC_CMD_LICENSING_IN_OP_OFST 0
+/* enum: re-read and apply licenses after a license key partition update; note
+ * that this operation returns a zero-length response
+ */
+#define MC_CMD_LICENSING_IN_OP_UPDATE_LICENSE 0x0
+/* enum: report counts of installed licenses */
+#define MC_CMD_LICENSING_IN_OP_GET_KEY_STATS 0x1
+
+/* MC_CMD_LICENSING_OUT msgresponse */
+#define MC_CMD_LICENSING_OUT_LEN 28
+/* count of application keys which are valid */
+#define MC_CMD_LICENSING_OUT_VALID_APP_KEYS_OFST 0
+/* sum of UNVERIFIABLE_APP_KEYS + WRONG_NODE_APP_KEYS (for compatibility with
+ * MC_CMD_FC_OP_LICENSE)
+ */
+#define MC_CMD_LICENSING_OUT_INVALID_APP_KEYS_OFST 4
+/* count of application keys which are invalid due to being blacklisted */
+#define MC_CMD_LICENSING_OUT_BLACKLISTED_APP_KEYS_OFST 8
+/* count of application keys which are invalid due to being unverifiable */
+#define MC_CMD_LICENSING_OUT_UNVERIFIABLE_APP_KEYS_OFST 12
+/* count of application keys which are invalid due to being for the wrong node
+ */
+#define MC_CMD_LICENSING_OUT_WRONG_NODE_APP_KEYS_OFST 16
+/* licensing state (for diagnostics; the exact meaning of the bits in this
+ * field are private to the firmware)
+ */
+#define MC_CMD_LICENSING_OUT_LICENSING_STATE_OFST 20
+/* licensing subsystem self-test report (for manftest) */
+#define MC_CMD_LICENSING_OUT_LICENSING_SELF_TEST_OFST 24
+/* enum: licensing subsystem self-test failed */
+#define MC_CMD_LICENSING_OUT_SELF_TEST_FAIL 0x0
+/* enum: licensing subsystem self-test passed */
+#define MC_CMD_LICENSING_OUT_SELF_TEST_PASS 0x1
+
+
+/***********************************/
+/* MC_CMD_MC2MC_PROXY
+ * Execute an arbitrary MCDI command on the slave MC of a dual-core device.
+ * This will fail on a single-core system.
+ */
+#define MC_CMD_MC2MC_PROXY 0xf4
+#undef MC_CMD_0xf4_PRIVILEGE_CTG
+
+#define MC_CMD_0xf4_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_MC2MC_PROXY_IN msgrequest */
+#define MC_CMD_MC2MC_PROXY_IN_LEN 0
+
+/* MC_CMD_MC2MC_PROXY_OUT msgresponse */
+#define MC_CMD_MC2MC_PROXY_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_GET_LICENSED_APP_STATE
+ * Query the state of an individual licensed application. (Note that the actual
+ * state may be invalidated by the MC_CMD_LICENSING OP_UPDATE_LICENSE operation
+ * or a reboot of the MC.)
+ */
+#define MC_CMD_GET_LICENSED_APP_STATE 0xf5
+#undef MC_CMD_0xf5_PRIVILEGE_CTG
+
+#define MC_CMD_0xf5_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_GET_LICENSED_APP_STATE_IN msgrequest */
+#define MC_CMD_GET_LICENSED_APP_STATE_IN_LEN 4
+/* application ID to query (LICENSED_APP_ID_xxx) */
+#define MC_CMD_GET_LICENSED_APP_STATE_IN_APP_ID_OFST 0
+
+/* MC_CMD_GET_LICENSED_APP_STATE_OUT msgresponse */
+#define MC_CMD_GET_LICENSED_APP_STATE_OUT_LEN 4
+/* state of this application */
+#define MC_CMD_GET_LICENSED_APP_STATE_OUT_STATE_OFST 0
+/* enum: no (or invalid) license is present for the application */
+#define MC_CMD_GET_LICENSED_APP_STATE_OUT_NOT_LICENSED 0x0
+/* enum: a valid license is present for the application */
+#define MC_CMD_GET_LICENSED_APP_STATE_OUT_LICENSED 0x1
+
+
+/***********************************/
+/* MC_CMD_LICENSED_APP_OP
+ * Perform an action for an individual licensed application.
+ */
+#define MC_CMD_LICENSED_APP_OP 0xf6
+#undef MC_CMD_0xf6_PRIVILEGE_CTG
+
+#define MC_CMD_0xf6_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_LICENSED_APP_OP_IN msgrequest */
+#define MC_CMD_LICENSED_APP_OP_IN_LENMIN 8
+#define MC_CMD_LICENSED_APP_OP_IN_LENMAX 252
+#define MC_CMD_LICENSED_APP_OP_IN_LEN(num) (8+4*(num))
+/* application ID */
+#define MC_CMD_LICENSED_APP_OP_IN_APP_ID_OFST 0
+/* the type of operation requested */
+#define MC_CMD_LICENSED_APP_OP_IN_OP_OFST 4
+/* enum: validate application */
+#define MC_CMD_LICENSED_APP_OP_IN_OP_VALIDATE 0x0
+/* enum: mask application */
+#define MC_CMD_LICENSED_APP_OP_IN_OP_MASK 0x1
+/* arguments specific to this particular operation */
+#define MC_CMD_LICENSED_APP_OP_IN_ARGS_OFST 8
+#define MC_CMD_LICENSED_APP_OP_IN_ARGS_LEN 4
+#define MC_CMD_LICENSED_APP_OP_IN_ARGS_MINNUM 0
+#define MC_CMD_LICENSED_APP_OP_IN_ARGS_MAXNUM 61
+
+/* MC_CMD_LICENSED_APP_OP_OUT msgresponse */
+#define MC_CMD_LICENSED_APP_OP_OUT_LENMIN 0
+#define MC_CMD_LICENSED_APP_OP_OUT_LENMAX 252
+#define MC_CMD_LICENSED_APP_OP_OUT_LEN(num) (0+4*(num))
+/* result specific to this particular operation */
+#define MC_CMD_LICENSED_APP_OP_OUT_RESULT_OFST 0
+#define MC_CMD_LICENSED_APP_OP_OUT_RESULT_LEN 4
+#define MC_CMD_LICENSED_APP_OP_OUT_RESULT_MINNUM 0
+#define MC_CMD_LICENSED_APP_OP_OUT_RESULT_MAXNUM 63
+
+/* MC_CMD_LICENSED_APP_OP_VALIDATE_IN msgrequest */
+#define MC_CMD_LICENSED_APP_OP_VALIDATE_IN_LEN 72
+/* application ID */
+#define MC_CMD_LICENSED_APP_OP_VALIDATE_IN_APP_ID_OFST 0
+/* the type of operation requested */
+#define MC_CMD_LICENSED_APP_OP_VALIDATE_IN_OP_OFST 4
+/* validation challenge */
+#define MC_CMD_LICENSED_APP_OP_VALIDATE_IN_CHALLENGE_OFST 8
+#define MC_CMD_LICENSED_APP_OP_VALIDATE_IN_CHALLENGE_LEN 64
+
+/* MC_CMD_LICENSED_APP_OP_VALIDATE_OUT msgresponse */
+#define MC_CMD_LICENSED_APP_OP_VALIDATE_OUT_LEN 68
+/* feature expiry (time_t) */
+#define MC_CMD_LICENSED_APP_OP_VALIDATE_OUT_EXPIRY_OFST 0
+/* validation response */
+#define MC_CMD_LICENSED_APP_OP_VALIDATE_OUT_RESPONSE_OFST 4
+#define MC_CMD_LICENSED_APP_OP_VALIDATE_OUT_RESPONSE_LEN 64
+
+/* MC_CMD_LICENSED_APP_OP_MASK_IN msgrequest */
+#define MC_CMD_LICENSED_APP_OP_MASK_IN_LEN 12
+/* application ID */
+#define MC_CMD_LICENSED_APP_OP_MASK_IN_APP_ID_OFST 0
+/* the type of operation requested */
+#define MC_CMD_LICENSED_APP_OP_MASK_IN_OP_OFST 4
+/* flag */
+#define MC_CMD_LICENSED_APP_OP_MASK_IN_FLAG_OFST 8
+
+/* MC_CMD_LICENSED_APP_OP_MASK_OUT msgresponse */
+#define MC_CMD_LICENSED_APP_OP_MASK_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_SET_PORT_SNIFF_CONFIG
+ * Configure RX port sniffing for the physical port associated with the calling
+ * function. Only a privileged function may change the port sniffing
+ * configuration. A copy of all traffic delivered to the host (non-promiscuous
+ * mode) or all traffic arriving at the port (promiscuous mode) may be
+ * delivered to a specific queue, or a set of queues with RSS.
+ */
+#define MC_CMD_SET_PORT_SNIFF_CONFIG 0xf7
+#undef MC_CMD_0xf7_PRIVILEGE_CTG
+
+#define MC_CMD_0xf7_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_SET_PORT_SNIFF_CONFIG_IN msgrequest */
+#define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_LEN 16
+/* configuration flags */
+#define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_FLAGS_OFST 0
+#define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_ENABLE_LBN 0
+#define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_ENABLE_WIDTH 1
+#define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_PROMISCUOUS_LBN 1
+#define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_PROMISCUOUS_WIDTH 1
+/* receive queue handle (for RSS mode, this is the base queue) */
+#define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_RX_QUEUE_OFST 4
+/* receive mode */
+#define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_RX_MODE_OFST 8
+/* enum: receive to just the specified queue */
+#define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_RX_MODE_SIMPLE 0x0
+/* enum: receive to multiple queues using RSS context */
+#define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_RX_MODE_RSS 0x1
+/* RSS context (for RX_MODE_RSS) as returned by MC_CMD_RSS_CONTEXT_ALLOC. Note
+ * that these handles should be considered opaque to the host, although a value
+ * of 0xFFFFFFFF is guaranteed never to be a valid handle.
+ */
+#define MC_CMD_SET_PORT_SNIFF_CONFIG_IN_RX_CONTEXT_OFST 12
+
+/* MC_CMD_SET_PORT_SNIFF_CONFIG_OUT msgresponse */
+#define MC_CMD_SET_PORT_SNIFF_CONFIG_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_GET_PORT_SNIFF_CONFIG
+ * Obtain the current RX port sniffing configuration for the physical port
+ * associated with the calling function. Only a privileged function may read
+ * the configuration.
+ */
+#define MC_CMD_GET_PORT_SNIFF_CONFIG 0xf8
+#undef MC_CMD_0xf8_PRIVILEGE_CTG
+
+#define MC_CMD_0xf8_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_GET_PORT_SNIFF_CONFIG_IN msgrequest */
+#define MC_CMD_GET_PORT_SNIFF_CONFIG_IN_LEN 0
+
+/* MC_CMD_GET_PORT_SNIFF_CONFIG_OUT msgresponse */
+#define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_LEN 16
+/* configuration flags */
+#define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_FLAGS_OFST 0
+#define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_ENABLE_LBN 0
+#define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_ENABLE_WIDTH 1
+#define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_PROMISCUOUS_LBN 1
+#define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_PROMISCUOUS_WIDTH 1
+/* receiving queue handle (for RSS mode, this is the base queue) */
+#define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_RX_QUEUE_OFST 4
+/* receive mode */
+#define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_RX_MODE_OFST 8
+/* enum: receiving to just the specified queue */
+#define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_RX_MODE_SIMPLE 0x0
+/* enum: receiving to multiple queues using RSS context */
+#define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_RX_MODE_RSS 0x1
+/* RSS context (for RX_MODE_RSS) */
+#define MC_CMD_GET_PORT_SNIFF_CONFIG_OUT_RX_CONTEXT_OFST 12
+
+
+/***********************************/
+/* MC_CMD_SET_PARSER_DISP_CONFIG
+ * Change configuration related to the parser-dispatcher subsystem.
+ */
+#define MC_CMD_SET_PARSER_DISP_CONFIG 0xf9
+#undef MC_CMD_0xf9_PRIVILEGE_CTG
+
+#define MC_CMD_0xf9_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_SET_PARSER_DISP_CONFIG_IN msgrequest */
+#define MC_CMD_SET_PARSER_DISP_CONFIG_IN_LENMIN 12
+#define MC_CMD_SET_PARSER_DISP_CONFIG_IN_LENMAX 252
+#define MC_CMD_SET_PARSER_DISP_CONFIG_IN_LEN(num) (8+4*(num))
+/* the type of configuration setting to change */
+#define MC_CMD_SET_PARSER_DISP_CONFIG_IN_TYPE_OFST 0
+/* enum: Per-TXQ enable for multicast UDP destination lookup for possible
+ * internal loopback. (ENTITY is a queue handle, VALUE is a single boolean.)
+ */
+#define MC_CMD_SET_PARSER_DISP_CONFIG_IN_TXQ_MCAST_UDP_DST_LOOKUP_EN 0x0
+/* enum: Per-v-adaptor enable for suppression of self-transmissions on the
+ * internal loopback path. (ENTITY is an EVB_PORT_ID, VALUE is a single
+ * boolean.)
+ */
+#define MC_CMD_SET_PARSER_DISP_CONFIG_IN_VADAPTOR_SUPPRESS_SELF_TX 0x1
+/* handle for the entity to update: queue handle, EVB port ID, etc. depending
+ * on the type of configuration setting being changed
+ */
+#define MC_CMD_SET_PARSER_DISP_CONFIG_IN_ENTITY_OFST 4
+/* new value: the details depend on the type of configuration setting being
+ * changed
+ */
+#define MC_CMD_SET_PARSER_DISP_CONFIG_IN_VALUE_OFST 8
+#define MC_CMD_SET_PARSER_DISP_CONFIG_IN_VALUE_LEN 4
+#define MC_CMD_SET_PARSER_DISP_CONFIG_IN_VALUE_MINNUM 1
+#define MC_CMD_SET_PARSER_DISP_CONFIG_IN_VALUE_MAXNUM 61
+
+/* MC_CMD_SET_PARSER_DISP_CONFIG_OUT msgresponse */
+#define MC_CMD_SET_PARSER_DISP_CONFIG_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_GET_PARSER_DISP_CONFIG
+ * Read configuration related to the parser-dispatcher subsystem.
+ */
+#define MC_CMD_GET_PARSER_DISP_CONFIG 0xfa
+#undef MC_CMD_0xfa_PRIVILEGE_CTG
+
+#define MC_CMD_0xfa_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_GET_PARSER_DISP_CONFIG_IN msgrequest */
+#define MC_CMD_GET_PARSER_DISP_CONFIG_IN_LEN 8
+/* the type of configuration setting to read */
+#define MC_CMD_GET_PARSER_DISP_CONFIG_IN_TYPE_OFST 0
+/* Enum values, see field(s): */
+/* MC_CMD_SET_PARSER_DISP_CONFIG/MC_CMD_SET_PARSER_DISP_CONFIG_IN/TYPE */
+/* handle for the entity to query: queue handle, EVB port ID, etc. depending on
+ * the type of configuration setting being read
+ */
+#define MC_CMD_GET_PARSER_DISP_CONFIG_IN_ENTITY_OFST 4
+
+/* MC_CMD_GET_PARSER_DISP_CONFIG_OUT msgresponse */
+#define MC_CMD_GET_PARSER_DISP_CONFIG_OUT_LENMIN 4
+#define MC_CMD_GET_PARSER_DISP_CONFIG_OUT_LENMAX 252
+#define MC_CMD_GET_PARSER_DISP_CONFIG_OUT_LEN(num) (0+4*(num))
+/* current value: the details depend on the type of configuration setting being
+ * read
+ */
+#define MC_CMD_GET_PARSER_DISP_CONFIG_OUT_VALUE_OFST 0
+#define MC_CMD_GET_PARSER_DISP_CONFIG_OUT_VALUE_LEN 4
+#define MC_CMD_GET_PARSER_DISP_CONFIG_OUT_VALUE_MINNUM 1
+#define MC_CMD_GET_PARSER_DISP_CONFIG_OUT_VALUE_MAXNUM 63
+
+
+/***********************************/
+/* MC_CMD_SET_TX_PORT_SNIFF_CONFIG
+ * Configure TX port sniffing for the physical port associated with the calling
+ * function. Only a privileged function may change the port sniffing
+ * configuration. A copy of all traffic transmitted through the port may be
+ * delivered to a specific queue, or a set of queues with RSS. Note that these
+ * packets are delivered with transmit timestamps in the packet prefix, not
+ * receive timestamps, so it is likely that the queue(s) will need to be
+ * dedicated as TX sniff receivers.
+ */
+#define MC_CMD_SET_TX_PORT_SNIFF_CONFIG 0xfb
+#undef MC_CMD_0xfb_PRIVILEGE_CTG
+
+#define MC_CMD_0xfb_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN msgrequest */
+#define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_LEN 16
+/* configuration flags */
+#define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_FLAGS_OFST 0
+#define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_ENABLE_LBN 0
+#define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_ENABLE_WIDTH 1
+/* receive queue handle (for RSS mode, this is the base queue) */
+#define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_RX_QUEUE_OFST 4
+/* receive mode */
+#define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_RX_MODE_OFST 8
+/* enum: receive to just the specified queue */
+#define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_RX_MODE_SIMPLE 0x0
+/* enum: receive to multiple queues using RSS context */
+#define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_RX_MODE_RSS 0x1
+/* RSS context (for RX_MODE_RSS) as returned by MC_CMD_RSS_CONTEXT_ALLOC. Note
+ * that these handles should be considered opaque to the host, although a value
+ * of 0xFFFFFFFF is guaranteed never to be a valid handle.
+ */
+#define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_IN_RX_CONTEXT_OFST 12
+
+/* MC_CMD_SET_TX_PORT_SNIFF_CONFIG_OUT msgresponse */
+#define MC_CMD_SET_TX_PORT_SNIFF_CONFIG_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_GET_TX_PORT_SNIFF_CONFIG
+ * Obtain the current TX port sniffing configuration for the physical port
+ * associated with the calling function. Only a privileged function may read
+ * the configuration.
+ */
+#define MC_CMD_GET_TX_PORT_SNIFF_CONFIG 0xfc
+#undef MC_CMD_0xfc_PRIVILEGE_CTG
+
+#define MC_CMD_0xfc_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_GET_TX_PORT_SNIFF_CONFIG_IN msgrequest */
+#define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_IN_LEN 0
+
+/* MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT msgresponse */
+#define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_LEN 16
+/* configuration flags */
+#define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_FLAGS_OFST 0
+#define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_ENABLE_LBN 0
+#define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_ENABLE_WIDTH 1
+/* receiving queue handle (for RSS mode, this is the base queue) */
+#define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_RX_QUEUE_OFST 4
+/* receive mode */
+#define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_RX_MODE_OFST 8
+/* enum: receiving to just the specified queue */
+#define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_RX_MODE_SIMPLE 0x0
+/* enum: receiving to multiple queues using RSS context */
+#define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_RX_MODE_RSS 0x1
+/* RSS context (for RX_MODE_RSS) */
+#define MC_CMD_GET_TX_PORT_SNIFF_CONFIG_OUT_RX_CONTEXT_OFST 12
+
+
+/***********************************/
+/* MC_CMD_RMON_STATS_RX_ERRORS
+ * Per queue rx error stats.
+ */
+#define MC_CMD_RMON_STATS_RX_ERRORS 0xfe
+#undef MC_CMD_0xfe_PRIVILEGE_CTG
+
+#define MC_CMD_0xfe_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_RMON_STATS_RX_ERRORS_IN msgrequest */
+#define MC_CMD_RMON_STATS_RX_ERRORS_IN_LEN 8
+/* The rx queue to get stats for. */
+#define MC_CMD_RMON_STATS_RX_ERRORS_IN_RX_QUEUE_OFST 0
+#define MC_CMD_RMON_STATS_RX_ERRORS_IN_FLAGS_OFST 4
+#define MC_CMD_RMON_STATS_RX_ERRORS_IN_RST_LBN 0
+#define MC_CMD_RMON_STATS_RX_ERRORS_IN_RST_WIDTH 1
+
+/* MC_CMD_RMON_STATS_RX_ERRORS_OUT msgresponse */
+#define MC_CMD_RMON_STATS_RX_ERRORS_OUT_LEN 16
+#define MC_CMD_RMON_STATS_RX_ERRORS_OUT_CRC_ERRORS_OFST 0
+#define MC_CMD_RMON_STATS_RX_ERRORS_OUT_TRUNC_ERRORS_OFST 4
+#define MC_CMD_RMON_STATS_RX_ERRORS_OUT_RX_NO_DESC_DROPS_OFST 8
+#define MC_CMD_RMON_STATS_RX_ERRORS_OUT_RX_ABORT_OFST 12
+
+
+/***********************************/
+/* MC_CMD_GET_PCIE_RESOURCE_INFO
+ * Find out about available PCIE resources
+ */
+#define MC_CMD_GET_PCIE_RESOURCE_INFO 0xfd
+
+/* MC_CMD_GET_PCIE_RESOURCE_INFO_IN msgrequest */
+#define MC_CMD_GET_PCIE_RESOURCE_INFO_IN_LEN 0
+
+/* MC_CMD_GET_PCIE_RESOURCE_INFO_OUT msgresponse */
+#define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_LEN 28
+/* The maximum number of PFs the device can expose */
+#define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_MAX_PFS_OFST 0
+/* The maximum number of VFs the device can expose in total */
+#define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_MAX_VFS_OFST 4
+/* The maximum number of MSI-X vectors the device can provide in total */
+#define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_MAX_VECTORS_OFST 8
+/* the number of MSI-X vectors the device will allocate by default to each PF
+ */
+#define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_DEFAULT_PF_VECTORS_OFST 12
+/* the number of MSI-X vectors the device will allocate by default to each VF
+ */
+#define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_DEFAULT_VF_VECTORS_OFST 16
+/* the maximum number of MSI-X vectors the device can allocate to any one PF */
+#define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_MAX_PF_VECTORS_OFST 20
+/* the maximum number of MSI-X vectors the device can allocate to any one VF */
+#define MC_CMD_GET_PCIE_RESOURCE_INFO_OUT_MAX_VF_VECTORS_OFST 24
+
+
+/***********************************/
+/* MC_CMD_GET_PORT_MODES
+ * Find out about available port modes
+ */
+#define MC_CMD_GET_PORT_MODES 0xff
+#undef MC_CMD_0xff_PRIVILEGE_CTG
+
+#define MC_CMD_0xff_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_GET_PORT_MODES_IN msgrequest */
+#define MC_CMD_GET_PORT_MODES_IN_LEN 0
+
+/* MC_CMD_GET_PORT_MODES_OUT msgresponse */
+#define MC_CMD_GET_PORT_MODES_OUT_LEN 12
+/* Bitmask of port modes available on the board (indexed by TLV_PORT_MODE_*) */
+#define MC_CMD_GET_PORT_MODES_OUT_MODES_OFST 0
+/* Default (canonical) board mode */
+#define MC_CMD_GET_PORT_MODES_OUT_DEFAULT_MODE_OFST 4
+/* Current board mode */
+#define MC_CMD_GET_PORT_MODES_OUT_CURRENT_MODE_OFST 8
+
+
+/***********************************/
+/* MC_CMD_READ_ATB
+ * Sample voltages on the ATB
+ */
+#define MC_CMD_READ_ATB 0x100
+#undef MC_CMD_0x100_PRIVILEGE_CTG
+
+#define MC_CMD_0x100_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_READ_ATB_IN msgrequest */
+#define MC_CMD_READ_ATB_IN_LEN 16
+#define MC_CMD_READ_ATB_IN_SIGNAL_BUS_OFST 0
+#define MC_CMD_READ_ATB_IN_BUS_CCOM 0x0 /* enum */
+#define MC_CMD_READ_ATB_IN_BUS_CKR 0x1 /* enum */
+#define MC_CMD_READ_ATB_IN_BUS_CPCIE 0x8 /* enum */
+#define MC_CMD_READ_ATB_IN_SIGNAL_EN_BITNO_OFST 4
+#define MC_CMD_READ_ATB_IN_SIGNAL_SEL_OFST 8
+#define MC_CMD_READ_ATB_IN_SETTLING_TIME_US_OFST 12
+
+/* MC_CMD_READ_ATB_OUT msgresponse */
+#define MC_CMD_READ_ATB_OUT_LEN 4
+#define MC_CMD_READ_ATB_OUT_SAMPLE_MV_OFST 0
+
+
+/***********************************/
+/* MC_CMD_GET_WORKAROUNDS
+ * Read the list of all implemented and all currently enabled workarounds. The
+ * enums here must correspond with those in MC_CMD_WORKAROUND.
+ */
+#define MC_CMD_GET_WORKAROUNDS 0x59
+#undef MC_CMD_0x59_PRIVILEGE_CTG
+
+#define MC_CMD_0x59_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_GET_WORKAROUNDS_OUT msgresponse */
+#define MC_CMD_GET_WORKAROUNDS_OUT_LEN 8
+/* Each workaround is represented by a single bit according to the enums below.
+ */
+#define MC_CMD_GET_WORKAROUNDS_OUT_IMPLEMENTED_OFST 0
+#define MC_CMD_GET_WORKAROUNDS_OUT_ENABLED_OFST 4
+/* enum: Bug 17230 work around. */
+#define MC_CMD_GET_WORKAROUNDS_OUT_BUG17230 0x2
+/* enum: Bug 35388 work around (unsafe EVQ writes). */
+#define MC_CMD_GET_WORKAROUNDS_OUT_BUG35388 0x4
+/* enum: Bug35017 workaround (A64 tables must be identity map) */
+#define MC_CMD_GET_WORKAROUNDS_OUT_BUG35017 0x8
+/* enum: Bug 41750 present (MC_CMD_TRIGGER_INTERRUPT won't work) */
+#define MC_CMD_GET_WORKAROUNDS_OUT_BUG41750 0x10
+/* enum: Bug 42008 present (Interrupts can overtake associated events). Caution
+ * - before adding code that queries this workaround, remember that there's
+ * released Monza firmware that doesn't understand MC_CMD_WORKAROUND_BUG42008,
+ * and will hence (incorrectly) report that the bug doesn't exist.
+ */
+#define MC_CMD_GET_WORKAROUNDS_OUT_BUG42008 0x20
+/* enum: Bug 26807 features present in firmware (multicast filter chaining) */
+#define MC_CMD_GET_WORKAROUNDS_OUT_BUG26807 0x40
+
+
+/***********************************/
+/* MC_CMD_PRIVILEGE_MASK
+ * Read/set privileges of an arbitrary PCIe function
+ */
+#define MC_CMD_PRIVILEGE_MASK 0x5a
+#undef MC_CMD_0x5a_PRIVILEGE_CTG
+
+#define MC_CMD_0x5a_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_PRIVILEGE_MASK_IN msgrequest */
+#define MC_CMD_PRIVILEGE_MASK_IN_LEN 8
+/* The target function to have its mask read or set e.g. PF 0 = 0xFFFF0000, VF
+ * 1,3 = 0x00030001
+ */
+#define MC_CMD_PRIVILEGE_MASK_IN_FUNCTION_OFST 0
+#define MC_CMD_PRIVILEGE_MASK_IN_FUNCTION_PF_LBN 0
+#define MC_CMD_PRIVILEGE_MASK_IN_FUNCTION_PF_WIDTH 16
+#define MC_CMD_PRIVILEGE_MASK_IN_FUNCTION_VF_LBN 16
+#define MC_CMD_PRIVILEGE_MASK_IN_FUNCTION_VF_WIDTH 16
+#define MC_CMD_PRIVILEGE_MASK_IN_VF_NULL 0xffff /* enum */
+/* New privilege mask to be set. The mask will only be changed if the MSB is
+ * set to 1.
+ */
+#define MC_CMD_PRIVILEGE_MASK_IN_NEW_MASK_OFST 4
+#define MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN 0x1 /* enum */
+#define MC_CMD_PRIVILEGE_MASK_IN_GRP_LINK 0x2 /* enum */
+#define MC_CMD_PRIVILEGE_MASK_IN_GRP_ONLOAD 0x4 /* enum */
+#define MC_CMD_PRIVILEGE_MASK_IN_GRP_PTP 0x8 /* enum */
+#define MC_CMD_PRIVILEGE_MASK_IN_GRP_INSECURE_FILTERS 0x10 /* enum */
+#define MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING 0x20 /* enum */
+#define MC_CMD_PRIVILEGE_MASK_IN_GRP_UNICAST 0x40 /* enum */
+#define MC_CMD_PRIVILEGE_MASK_IN_GRP_MULTICAST 0x80 /* enum */
+#define MC_CMD_PRIVILEGE_MASK_IN_GRP_BROADCAST 0x100 /* enum */
+#define MC_CMD_PRIVILEGE_MASK_IN_GRP_ALL_MULTICAST 0x200 /* enum */
+#define MC_CMD_PRIVILEGE_MASK_IN_GRP_PROMISCUOUS 0x400 /* enum */
+/* enum: Set this bit to indicate that a new privilege mask is to be set,
+ * otherwise the command will only read the existing mask.
+ */
+#define MC_CMD_PRIVILEGE_MASK_IN_DO_CHANGE 0x80000000
+
+/* MC_CMD_PRIVILEGE_MASK_OUT msgresponse */
+#define MC_CMD_PRIVILEGE_MASK_OUT_LEN 4
+/* For an admin function, always all the privileges are reported. */
+#define MC_CMD_PRIVILEGE_MASK_OUT_OLD_MASK_OFST 0
+
+
+/***********************************/
+/* MC_CMD_LINK_STATE_MODE
+ * Read/set link state mode of a VF
+ */
+#define MC_CMD_LINK_STATE_MODE 0x5c
+#undef MC_CMD_0x5c_PRIVILEGE_CTG
+
+#define MC_CMD_0x5c_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_LINK_STATE_MODE_IN msgrequest */
+#define MC_CMD_LINK_STATE_MODE_IN_LEN 8
+/* The target function to have its link state mode read or set, must be a VF
+ * e.g. VF 1,3 = 0x00030001
+ */
+#define MC_CMD_LINK_STATE_MODE_IN_FUNCTION_OFST 0
+#define MC_CMD_LINK_STATE_MODE_IN_FUNCTION_PF_LBN 0
+#define MC_CMD_LINK_STATE_MODE_IN_FUNCTION_PF_WIDTH 16
+#define MC_CMD_LINK_STATE_MODE_IN_FUNCTION_VF_LBN 16
+#define MC_CMD_LINK_STATE_MODE_IN_FUNCTION_VF_WIDTH 16
+/* New link state mode to be set */
+#define MC_CMD_LINK_STATE_MODE_IN_NEW_MODE_OFST 4
+#define MC_CMD_LINK_STATE_MODE_IN_LINK_STATE_AUTO 0x0 /* enum */
+#define MC_CMD_LINK_STATE_MODE_IN_LINK_STATE_UP 0x1 /* enum */
+#define MC_CMD_LINK_STATE_MODE_IN_LINK_STATE_DOWN 0x2 /* enum */
+/* enum: Use this value to just read the existing setting without modifying it.
+ */
+#define MC_CMD_LINK_STATE_MODE_IN_DO_NOT_CHANGE 0xffffffff
+
+/* MC_CMD_LINK_STATE_MODE_OUT msgresponse */
+#define MC_CMD_LINK_STATE_MODE_OUT_LEN 4
+#define MC_CMD_LINK_STATE_MODE_OUT_OLD_MODE_OFST 0
+
+
+/***********************************/
+/* MC_CMD_GET_SNAPSHOT_LENGTH
+ * Obtain the curent range of allowable values for the SNAPSHOT_LENGTH
+ * parameter to MC_CMD_INIT_RXQ.
+ */
+#define MC_CMD_GET_SNAPSHOT_LENGTH 0x101
+#undef MC_CMD_0x101_PRIVILEGE_CTG
+
+#define MC_CMD_0x101_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_GET_SNAPSHOT_LENGTH_IN msgrequest */
+#define MC_CMD_GET_SNAPSHOT_LENGTH_IN_LEN 0
+
+/* MC_CMD_GET_SNAPSHOT_LENGTH_OUT msgresponse */
+#define MC_CMD_GET_SNAPSHOT_LENGTH_OUT_LEN 8
+/* Minimum acceptable snapshot length. */
+#define MC_CMD_GET_SNAPSHOT_LENGTH_OUT_RX_SNAPLEN_MIN_OFST 0
+/* Maximum acceptable snapshot length. */
+#define MC_CMD_GET_SNAPSHOT_LENGTH_OUT_RX_SNAPLEN_MAX_OFST 4
+
+
+/***********************************/
+/* MC_CMD_FUSE_DIAGS
+ * Additional fuse diagnostics
+ */
+#define MC_CMD_FUSE_DIAGS 0x102
+#undef MC_CMD_0x102_PRIVILEGE_CTG
+
+#define MC_CMD_0x102_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_FUSE_DIAGS_IN msgrequest */
+#define MC_CMD_FUSE_DIAGS_IN_LEN 0
+
+/* MC_CMD_FUSE_DIAGS_OUT msgresponse */
+#define MC_CMD_FUSE_DIAGS_OUT_LEN 48
+/* Total number of mismatched bits between pairs in area 0 */
+#define MC_CMD_FUSE_DIAGS_OUT_AREA0_MISMATCH_BITS_OFST 0
+/* Total number of unexpectedly clear (set in B but not A) bits in area 0 */
+#define MC_CMD_FUSE_DIAGS_OUT_AREA0_PAIR_A_BAD_BITS_OFST 4
+/* Total number of unexpectedly clear (set in A but not B) bits in area 0 */
+#define MC_CMD_FUSE_DIAGS_OUT_AREA0_PAIR_B_BAD_BITS_OFST 8
+/* Checksum of data after logical OR of pairs in area 0 */
+#define MC_CMD_FUSE_DIAGS_OUT_AREA0_CHECKSUM_OFST 12
+/* Total number of mismatched bits between pairs in area 1 */
+#define MC_CMD_FUSE_DIAGS_OUT_AREA1_MISMATCH_BITS_OFST 16
+/* Total number of unexpectedly clear (set in B but not A) bits in area 1 */
+#define MC_CMD_FUSE_DIAGS_OUT_AREA1_PAIR_A_BAD_BITS_OFST 20
+/* Total number of unexpectedly clear (set in A but not B) bits in area 1 */
+#define MC_CMD_FUSE_DIAGS_OUT_AREA1_PAIR_B_BAD_BITS_OFST 24
+/* Checksum of data after logical OR of pairs in area 1 */
+#define MC_CMD_FUSE_DIAGS_OUT_AREA1_CHECKSUM_OFST 28
+/* Total number of mismatched bits between pairs in area 2 */
+#define MC_CMD_FUSE_DIAGS_OUT_AREA2_MISMATCH_BITS_OFST 32
+/* Total number of unexpectedly clear (set in B but not A) bits in area 2 */
+#define MC_CMD_FUSE_DIAGS_OUT_AREA2_PAIR_A_BAD_BITS_OFST 36
+/* Total number of unexpectedly clear (set in A but not B) bits in area 2 */
+#define MC_CMD_FUSE_DIAGS_OUT_AREA2_PAIR_B_BAD_BITS_OFST 40
+/* Checksum of data after logical OR of pairs in area 2 */
+#define MC_CMD_FUSE_DIAGS_OUT_AREA2_CHECKSUM_OFST 44
+
+
+/***********************************/
+/* MC_CMD_PRIVILEGE_MODIFY
+ * Modify the privileges of a set of PCIe functions. Note that this operation
+ * only effects non-admin functions unless the admin privilege itself is
+ * included in one of the masks provided.
+ */
+#define MC_CMD_PRIVILEGE_MODIFY 0x60
+#undef MC_CMD_0x60_PRIVILEGE_CTG
+
+#define MC_CMD_0x60_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_PRIVILEGE_MODIFY_IN msgrequest */
+#define MC_CMD_PRIVILEGE_MODIFY_IN_LEN 16
+/* The groups of functions to have their privilege masks modified. */
+#define MC_CMD_PRIVILEGE_MODIFY_IN_FN_GROUP_OFST 0
+#define MC_CMD_PRIVILEGE_MODIFY_IN_NONE 0x0 /* enum */
+#define MC_CMD_PRIVILEGE_MODIFY_IN_ALL 0x1 /* enum */
+#define MC_CMD_PRIVILEGE_MODIFY_IN_PFS_ONLY 0x2 /* enum */
+#define MC_CMD_PRIVILEGE_MODIFY_IN_VFS_ONLY 0x3 /* enum */
+#define MC_CMD_PRIVILEGE_MODIFY_IN_VFS_OF_PF 0x4 /* enum */
+#define MC_CMD_PRIVILEGE_MODIFY_IN_ONE 0x5 /* enum */
+/* For VFS_OF_PF specify the PF, for ONE specify the target function */
+#define MC_CMD_PRIVILEGE_MODIFY_IN_FUNCTION_OFST 4
+#define MC_CMD_PRIVILEGE_MODIFY_IN_FUNCTION_PF_LBN 0
+#define MC_CMD_PRIVILEGE_MODIFY_IN_FUNCTION_PF_WIDTH 16
+#define MC_CMD_PRIVILEGE_MODIFY_IN_FUNCTION_VF_LBN 16
+#define MC_CMD_PRIVILEGE_MODIFY_IN_FUNCTION_VF_WIDTH 16
+/* Privileges to be added to the target functions. For privilege definitions
+ * refer to the command MC_CMD_PRIVILEGE_MASK
+ */
+#define MC_CMD_PRIVILEGE_MODIFY_IN_ADD_MASK_OFST 8
+/* Privileges to be removed from the target functions. For privilege
+ * definitions refer to the command MC_CMD_PRIVILEGE_MASK
+ */
+#define MC_CMD_PRIVILEGE_MODIFY_IN_REMOVE_MASK_OFST 12
+
+/* MC_CMD_PRIVILEGE_MODIFY_OUT msgresponse */
+#define MC_CMD_PRIVILEGE_MODIFY_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_XPM_READ_BYTES
+ * Read XPM memory
+ */
+#define MC_CMD_XPM_READ_BYTES 0x103
+#undef MC_CMD_0x103_PRIVILEGE_CTG
+
+#define MC_CMD_0x103_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_XPM_READ_BYTES_IN msgrequest */
+#define MC_CMD_XPM_READ_BYTES_IN_LEN 8
+/* Start address (byte) */
+#define MC_CMD_XPM_READ_BYTES_IN_ADDR_OFST 0
+/* Count (bytes) */
+#define MC_CMD_XPM_READ_BYTES_IN_COUNT_OFST 4
+
+/* MC_CMD_XPM_READ_BYTES_OUT msgresponse */
+#define MC_CMD_XPM_READ_BYTES_OUT_LENMIN 0
+#define MC_CMD_XPM_READ_BYTES_OUT_LENMAX 252
+#define MC_CMD_XPM_READ_BYTES_OUT_LEN(num) (0+1*(num))
+/* Data */
+#define MC_CMD_XPM_READ_BYTES_OUT_DATA_OFST 0
+#define MC_CMD_XPM_READ_BYTES_OUT_DATA_LEN 1
+#define MC_CMD_XPM_READ_BYTES_OUT_DATA_MINNUM 0
+#define MC_CMD_XPM_READ_BYTES_OUT_DATA_MAXNUM 252
+
+
+/***********************************/
+/* MC_CMD_XPM_WRITE_BYTES
+ * Write XPM memory
+ */
+#define MC_CMD_XPM_WRITE_BYTES 0x104
+#undef MC_CMD_0x104_PRIVILEGE_CTG
+
+#define MC_CMD_0x104_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_XPM_WRITE_BYTES_IN msgrequest */
+#define MC_CMD_XPM_WRITE_BYTES_IN_LENMIN 8
+#define MC_CMD_XPM_WRITE_BYTES_IN_LENMAX 252
+#define MC_CMD_XPM_WRITE_BYTES_IN_LEN(num) (8+1*(num))
+/* Start address (byte) */
+#define MC_CMD_XPM_WRITE_BYTES_IN_ADDR_OFST 0
+/* Count (bytes) */
+#define MC_CMD_XPM_WRITE_BYTES_IN_COUNT_OFST 4
+/* Data */
+#define MC_CMD_XPM_WRITE_BYTES_IN_DATA_OFST 8
+#define MC_CMD_XPM_WRITE_BYTES_IN_DATA_LEN 1
+#define MC_CMD_XPM_WRITE_BYTES_IN_DATA_MINNUM 0
+#define MC_CMD_XPM_WRITE_BYTES_IN_DATA_MAXNUM 244
+
+/* MC_CMD_XPM_WRITE_BYTES_OUT msgresponse */
+#define MC_CMD_XPM_WRITE_BYTES_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_XPM_READ_SECTOR
+ * Read XPM sector
+ */
+#define MC_CMD_XPM_READ_SECTOR 0x105
+#undef MC_CMD_0x105_PRIVILEGE_CTG
+
+#define MC_CMD_0x105_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_XPM_READ_SECTOR_IN msgrequest */
+#define MC_CMD_XPM_READ_SECTOR_IN_LEN 8
+/* Sector index */
+#define MC_CMD_XPM_READ_SECTOR_IN_INDEX_OFST 0
+/* Sector size */
+#define MC_CMD_XPM_READ_SECTOR_IN_SIZE_OFST 4
+
+/* MC_CMD_XPM_READ_SECTOR_OUT msgresponse */
+#define MC_CMD_XPM_READ_SECTOR_OUT_LENMIN 4
+#define MC_CMD_XPM_READ_SECTOR_OUT_LENMAX 36
+#define MC_CMD_XPM_READ_SECTOR_OUT_LEN(num) (4+1*(num))
+/* Sector type */
+#define MC_CMD_XPM_READ_SECTOR_OUT_TYPE_OFST 0
+#define MC_CMD_XPM_READ_SECTOR_OUT_BLANK 0x0 /* enum */
+#define MC_CMD_XPM_READ_SECTOR_OUT_CRYPTO_KEY_128 0x1 /* enum */
+#define MC_CMD_XPM_READ_SECTOR_OUT_CRYPTO_KEY_256 0x2 /* enum */
+#define MC_CMD_XPM_READ_SECTOR_OUT_INVALID 0xff /* enum */
+/* Sector data */
+#define MC_CMD_XPM_READ_SECTOR_OUT_DATA_OFST 4
+#define MC_CMD_XPM_READ_SECTOR_OUT_DATA_LEN 1
+#define MC_CMD_XPM_READ_SECTOR_OUT_DATA_MINNUM 0
+#define MC_CMD_XPM_READ_SECTOR_OUT_DATA_MAXNUM 32
+
+
+/***********************************/
+/* MC_CMD_XPM_WRITE_SECTOR
+ * Write XPM sector
+ */
+#define MC_CMD_XPM_WRITE_SECTOR 0x106
+#undef MC_CMD_0x106_PRIVILEGE_CTG
+
+#define MC_CMD_0x106_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_XPM_WRITE_SECTOR_IN msgrequest */
+#define MC_CMD_XPM_WRITE_SECTOR_IN_LENMIN 12
+#define MC_CMD_XPM_WRITE_SECTOR_IN_LENMAX 44
+#define MC_CMD_XPM_WRITE_SECTOR_IN_LEN(num) (12+1*(num))
+/* If writing fails due to an uncorrectable error, try up to RETRIES following
+ * sectors (or until no more space available). If 0, only one write attempt is
+ * made. Note that uncorrectable errors are unlikely, thanks to XPM self-repair
+ * mechanism.
+ */
+#define MC_CMD_XPM_WRITE_SECTOR_IN_RETRIES_OFST 0
+#define MC_CMD_XPM_WRITE_SECTOR_IN_RETRIES_LEN 1
+#define MC_CMD_XPM_WRITE_SECTOR_IN_RESERVED_OFST 1
+#define MC_CMD_XPM_WRITE_SECTOR_IN_RESERVED_LEN 3
+/* Sector type */
+#define MC_CMD_XPM_WRITE_SECTOR_IN_TYPE_OFST 4
+/* Enum values, see field(s): */
+/* MC_CMD_XPM_READ_SECTOR_OUT/TYPE */
+/* Sector size */
+#define MC_CMD_XPM_WRITE_SECTOR_IN_SIZE_OFST 8
+/* Sector data */
+#define MC_CMD_XPM_WRITE_SECTOR_IN_DATA_OFST 12
+#define MC_CMD_XPM_WRITE_SECTOR_IN_DATA_LEN 1
+#define MC_CMD_XPM_WRITE_SECTOR_IN_DATA_MINNUM 0
+#define MC_CMD_XPM_WRITE_SECTOR_IN_DATA_MAXNUM 32
+
+/* MC_CMD_XPM_WRITE_SECTOR_OUT msgresponse */
+#define MC_CMD_XPM_WRITE_SECTOR_OUT_LEN 4
+/* New sector index */
+#define MC_CMD_XPM_WRITE_SECTOR_OUT_INDEX_OFST 0
+
+
+/***********************************/
+/* MC_CMD_XPM_INVALIDATE_SECTOR
+ * Invalidate XPM sector
+ */
+#define MC_CMD_XPM_INVALIDATE_SECTOR 0x107
+#undef MC_CMD_0x107_PRIVILEGE_CTG
+
+#define MC_CMD_0x107_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_XPM_INVALIDATE_SECTOR_IN msgrequest */
+#define MC_CMD_XPM_INVALIDATE_SECTOR_IN_LEN 4
+/* Sector index */
+#define MC_CMD_XPM_INVALIDATE_SECTOR_IN_INDEX_OFST 0
+
+/* MC_CMD_XPM_INVALIDATE_SECTOR_OUT msgresponse */
+#define MC_CMD_XPM_INVALIDATE_SECTOR_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_XPM_BLANK_CHECK
+ * Blank-check XPM memory and report bad locations
+ */
+#define MC_CMD_XPM_BLANK_CHECK 0x108
+#undef MC_CMD_0x108_PRIVILEGE_CTG
+
+#define MC_CMD_0x108_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_XPM_BLANK_CHECK_IN msgrequest */
+#define MC_CMD_XPM_BLANK_CHECK_IN_LEN 8
+/* Start address (byte) */
+#define MC_CMD_XPM_BLANK_CHECK_IN_ADDR_OFST 0
+/* Count (bytes) */
+#define MC_CMD_XPM_BLANK_CHECK_IN_COUNT_OFST 4
+
+/* MC_CMD_XPM_BLANK_CHECK_OUT msgresponse */
+#define MC_CMD_XPM_BLANK_CHECK_OUT_LENMIN 4
+#define MC_CMD_XPM_BLANK_CHECK_OUT_LENMAX 252
+#define MC_CMD_XPM_BLANK_CHECK_OUT_LEN(num) (4+2*(num))
+/* Total number of bad (non-blank) locations */
+#define MC_CMD_XPM_BLANK_CHECK_OUT_BAD_COUNT_OFST 0
+/* Addresses of bad locations (may be less than BAD_COUNT, if all cannot fit
+ * into MCDI response)
+ */
+#define MC_CMD_XPM_BLANK_CHECK_OUT_BAD_ADDR_OFST 4
+#define MC_CMD_XPM_BLANK_CHECK_OUT_BAD_ADDR_LEN 2
+#define MC_CMD_XPM_BLANK_CHECK_OUT_BAD_ADDR_MINNUM 0
+#define MC_CMD_XPM_BLANK_CHECK_OUT_BAD_ADDR_MAXNUM 124
+
+
+/***********************************/
+/* MC_CMD_XPM_REPAIR
+ * Blank-check and repair XPM memory
+ */
+#define MC_CMD_XPM_REPAIR 0x109
+#undef MC_CMD_0x109_PRIVILEGE_CTG
+
+#define MC_CMD_0x109_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_XPM_REPAIR_IN msgrequest */
+#define MC_CMD_XPM_REPAIR_IN_LEN 8
+/* Start address (byte) */
+#define MC_CMD_XPM_REPAIR_IN_ADDR_OFST 0
+/* Count (bytes) */
+#define MC_CMD_XPM_REPAIR_IN_COUNT_OFST 4
+
+/* MC_CMD_XPM_REPAIR_OUT msgresponse */
+#define MC_CMD_XPM_REPAIR_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_XPM_DECODER_TEST
+ * Test XPM memory address decoders for gross manufacturing defects. Can only
+ * be performed on an unprogrammed part.
+ */
+#define MC_CMD_XPM_DECODER_TEST 0x10a
+#undef MC_CMD_0x10a_PRIVILEGE_CTG
+
+#define MC_CMD_0x10a_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_XPM_DECODER_TEST_IN msgrequest */
+#define MC_CMD_XPM_DECODER_TEST_IN_LEN 0
+
+/* MC_CMD_XPM_DECODER_TEST_OUT msgresponse */
+#define MC_CMD_XPM_DECODER_TEST_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_XPM_WRITE_TEST
+ * XPM memory write test. Test XPM write logic for gross manufacturing defects
+ * by writing to a dedicated test row. There are 16 locations in the test row
+ * and the test can only be performed on locations that have not been
+ * previously used (i.e. can be run at most 16 times). The test will pick the
+ * first available location to use, or fail with ENOSPC if none left.
+ */
+#define MC_CMD_XPM_WRITE_TEST 0x10b
+#undef MC_CMD_0x10b_PRIVILEGE_CTG
+
+#define MC_CMD_0x10b_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_XPM_WRITE_TEST_IN msgrequest */
+#define MC_CMD_XPM_WRITE_TEST_IN_LEN 0
+
+/* MC_CMD_XPM_WRITE_TEST_OUT msgresponse */
+#define MC_CMD_XPM_WRITE_TEST_OUT_LEN 0
+
#endif /* _SIENA_MC_DRIVER_PCOL_H */
diff --git a/sys/dev/sfxge/common/efx_regs_pci.h b/sys/dev/sfxge/common/efx_regs_pci.h
index 3a3a827..a5fd45b 100644
--- a/sys/dev/sfxge/common/efx_regs_pci.h
+++ b/sys/dev/sfxge/common/efx_regs_pci.h
@@ -1,26 +1,31 @@
/*-
- * Copyright 2007-2010 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2007-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*
* $FreeBSD$
*/
@@ -366,6 +371,10 @@ extern "C" {
#define PCRF_AZ_INT_PIN_LBN 0
#define PCRF_AZ_INT_PIN_WIDTH 8
+#define PCFE_DZ_INTPIN_INTD 4
+#define PCFE_DZ_INTPIN_INTC 3
+#define PCFE_DZ_INTPIN_INTB 2
+#define PCFE_DZ_INTPIN_INTA 1
/*
@@ -373,11 +382,8 @@ extern "C" {
* Power management capability ID
*/
-#define PCR_AC_PM_CAP_ID_REG 0x00000040
-/* falcona0,falconb0,sienaa0=pci_f0_config */
-
-#define PCR_DZ_PM_CAP_ID_REG 0x00000080
-/* hunta0=pci_f0_config */
+#define PCR_AZ_PM_CAP_ID_REG 0x00000040
+/* falcona0,falconb0,sienaa0,hunta0=pci_f0_config */
#define PCRF_AZ_PM_CAP_ID_LBN 0
#define PCRF_AZ_PM_CAP_ID_WIDTH 8
@@ -388,11 +394,8 @@ extern "C" {
* Power management next item pointer
*/
-#define PCR_AC_PM_NXT_PTR_REG 0x00000041
-/* falcona0,falconb0,sienaa0=pci_f0_config */
-
-#define PCR_DZ_PM_NXT_PTR_REG 0x00000081
-/* hunta0=pci_f0_config */
+#define PCR_AZ_PM_NXT_PTR_REG 0x00000041
+/* falcona0,falconb0,sienaa0,hunta0=pci_f0_config */
#define PCRF_AZ_PM_NXT_PTR_LBN 0
#define PCRF_AZ_PM_NXT_PTR_WIDTH 8
@@ -403,11 +406,8 @@ extern "C" {
* Power management capabilities register
*/
-#define PCR_AC_PM_CAP_REG 0x00000042
-/* falcona0,falconb0,sienaa0=pci_f0_config */
-
-#define PCR_DZ_PM_CAP_REG 0x00000082
-/* hunta0=pci_f0_config */
+#define PCR_AZ_PM_CAP_REG 0x00000042
+/* falcona0,falconb0,sienaa0,hunta0=pci_f0_config */
#define PCRF_AZ_PM_PME_SUPT_LBN 11
#define PCRF_AZ_PM_PME_SUPT_WIDTH 5
@@ -430,11 +430,8 @@ extern "C" {
* Power management control & status register
*/
-#define PCR_AC_PM_CS_REG 0x00000044
-/* falcona0,falconb0,sienaa0=pci_f0_config */
-
-#define PCR_DZ_PM_CS_REG 0x00000084
-/* hunta0=pci_f0_config */
+#define PCR_AZ_PM_CS_REG 0x00000044
+/* falcona0,falconb0,sienaa0,hunta0=pci_f0_config */
#define PCRF_AZ_PM_PME_STAT_LBN 15
#define PCRF_AZ_PM_PME_STAT_WIDTH 1
@@ -455,11 +452,8 @@ extern "C" {
* MSI capability ID
*/
-#define PCR_AC_MSI_CAP_ID_REG 0x00000050
-/* falcona0,falconb0,sienaa0=pci_f0_config */
-
-#define PCR_DZ_MSI_CAP_ID_REG 0x00000090
-/* hunta0=pci_f0_config */
+#define PCR_AZ_MSI_CAP_ID_REG 0x00000050
+/* falcona0,falconb0,sienaa0,hunta0=pci_f0_config */
#define PCRF_AZ_MSI_CAP_ID_LBN 0
#define PCRF_AZ_MSI_CAP_ID_WIDTH 8
@@ -470,11 +464,8 @@ extern "C" {
* MSI next item pointer
*/
-#define PCR_AC_MSI_NXT_PTR_REG 0x00000051
-/* falcona0,falconb0,sienaa0=pci_f0_config */
-
-#define PCR_DZ_MSI_NXT_PTR_REG 0x00000091
-/* hunta0=pci_f0_config */
+#define PCR_AZ_MSI_NXT_PTR_REG 0x00000051
+/* falcona0,falconb0,sienaa0,hunta0=pci_f0_config */
#define PCRF_AZ_MSI_NXT_PTR_LBN 0
#define PCRF_AZ_MSI_NXT_PTR_WIDTH 8
@@ -485,11 +476,8 @@ extern "C" {
* MSI control register
*/
-#define PCR_AC_MSI_CTL_REG 0x00000052
-/* falcona0,falconb0,sienaa0=pci_f0_config */
-
-#define PCR_DZ_MSI_CTL_REG 0x00000092
-/* hunta0=pci_f0_config */
+#define PCR_AZ_MSI_CTL_REG 0x00000052
+/* falcona0,falconb0,sienaa0,hunta0=pci_f0_config */
#define PCRF_AZ_MSI_64_EN_LBN 7
#define PCRF_AZ_MSI_64_EN_WIDTH 1
@@ -506,65 +494,20 @@ extern "C" {
* MSI low 32 bits address register
*/
-#define PCR_AC_MSI_ADR_LO_REG 0x00000054
-/* falcona0,falconb0,sienaa0=pci_f0_config */
-
-#define PCR_DZ_MSI_ADR_LO_REG 0x00000094
-/* hunta0=pci_f0_config */
+#define PCR_AZ_MSI_ADR_LO_REG 0x00000054
+/* falcona0,falconb0,sienaa0,hunta0=pci_f0_config */
#define PCRF_AZ_MSI_ADR_LO_LBN 2
#define PCRF_AZ_MSI_ADR_LO_WIDTH 30
/*
- * PC_VPD_CAP_CTL_REG(8bit):
- * VPD control and capabilities register
- */
-
-#define PCR_DZ_VPD_CAP_CTL_REG 0x00000054
-/* hunta0=pci_f0_config */
-
-#define PCR_CC_VPD_CAP_CTL_REG 0x000000d0
-/* sienaa0=pci_f0_config */
-
-#define PCRF_CZ_VPD_FLAG_LBN 31
-#define PCRF_CZ_VPD_FLAG_WIDTH 1
-#define PCRF_CZ_VPD_ADDR_LBN 16
-#define PCRF_CZ_VPD_ADDR_WIDTH 15
-#define PCRF_CZ_VPD_NXT_PTR_LBN 8
-#define PCRF_CZ_VPD_NXT_PTR_WIDTH 8
-#define PCRF_CZ_VPD_CAP_ID_LBN 0
-#define PCRF_CZ_VPD_CAP_ID_WIDTH 8
-
-
-/*
- * PC_VPD_CAP_DATA_REG(32bit):
- * documentation to be written for sum_PC_VPD_CAP_DATA_REG
- */
-
-#define PCR_DZ_VPD_CAP_DATA_REG 0x00000058
-/* hunta0=pci_f0_config */
-
-#define PCR_AB_VPD_CAP_DATA_REG 0x000000b4
-/* falcona0,falconb0=pci_f0_config */
-
-#define PCR_CC_VPD_CAP_DATA_REG 0x000000d4
-/* sienaa0=pci_f0_config */
-
-#define PCRF_AZ_VPD_DATA_LBN 0
-#define PCRF_AZ_VPD_DATA_WIDTH 32
-
-
-/*
* PC_MSI_ADR_HI_REG(32bit):
* MSI high 32 bits address register
*/
-#define PCR_AC_MSI_ADR_HI_REG 0x00000058
-/* falcona0,falconb0,sienaa0=pci_f0_config */
-
-#define PCR_DZ_MSI_ADR_HI_REG 0x00000098
-/* hunta0=pci_f0_config */
+#define PCR_AZ_MSI_ADR_HI_REG 0x00000058
+/* falcona0,falconb0,sienaa0,hunta0=pci_f0_config */
#define PCRF_AZ_MSI_ADR_HI_LBN 0
#define PCRF_AZ_MSI_ADR_HI_WIDTH 32
@@ -575,11 +518,8 @@ extern "C" {
* MSI data register
*/
-#define PCR_AC_MSI_DAT_REG 0x0000005c
-/* falcona0,falconb0,sienaa0=pci_f0_config */
-
-#define PCR_DZ_MSI_DAT_REG 0x0000009c
-/* hunta0=pci_f0_config */
+#define PCR_AZ_MSI_DAT_REG 0x0000005c
+/* falcona0,falconb0,sienaa0,hunta0=pci_f0_config */
#define PCRF_AZ_MSI_DAT_LBN 0
#define PCRF_AZ_MSI_DAT_WIDTH 16
@@ -593,11 +533,8 @@ extern "C" {
#define PCR_AB_PCIE_CAP_LIST_REG 0x00000060
/* falcona0,falconb0=pci_f0_config */
-#define PCR_CC_PCIE_CAP_LIST_REG 0x00000070
-/* sienaa0=pci_f0_config */
-
-#define PCR_DZ_PCIE_CAP_LIST_REG 0x000000c0
-/* hunta0=pci_f0_config */
+#define PCR_CZ_PCIE_CAP_LIST_REG 0x00000070
+/* sienaa0,hunta0=pci_f0_config */
#define PCRF_AZ_PCIE_NXT_PTR_LBN 8
#define PCRF_AZ_PCIE_NXT_PTR_WIDTH 8
@@ -613,11 +550,8 @@ extern "C" {
#define PCR_AB_PCIE_CAP_REG 0x00000062
/* falcona0,falconb0=pci_f0_config */
-#define PCR_CC_PCIE_CAP_REG 0x00000072
-/* sienaa0=pci_f0_config */
-
-#define PCR_DZ_PCIE_CAP_REG 0x000000c2
-/* hunta0=pci_f0_config */
+#define PCR_CZ_PCIE_CAP_REG 0x00000072
+/* sienaa0,hunta0=pci_f0_config */
#define PCRF_AZ_PCIE_INT_MSG_NUM_LBN 9
#define PCRF_AZ_PCIE_INT_MSG_NUM_WIDTH 5
@@ -637,11 +571,8 @@ extern "C" {
#define PCR_AB_DEV_CAP_REG 0x00000064
/* falcona0,falconb0=pci_f0_config */
-#define PCR_CC_DEV_CAP_REG 0x00000074
-/* sienaa0=pci_f0_config */
-
-#define PCR_DZ_DEV_CAP_REG 0x000000c4
-/* hunta0=pci_f0_config */
+#define PCR_CZ_DEV_CAP_REG 0x00000074
+/* sienaa0=pci_f0_config,hunta0=pci_f0_config */
#define PCRF_CZ_CAP_FN_LEVEL_RESET_LBN 28
#define PCRF_CZ_CAP_FN_LEVEL_RESET_WIDTH 1
@@ -677,11 +608,8 @@ extern "C" {
#define PCR_AB_DEV_CTL_REG 0x00000068
/* falcona0,falconb0=pci_f0_config */
-#define PCR_CC_DEV_CTL_REG 0x00000078
-/* sienaa0=pci_f0_config */
-
-#define PCR_DZ_DEV_CTL_REG 0x000000c8
-/* hunta0=pci_f0_config */
+#define PCR_CZ_DEV_CTL_REG 0x00000078
+/* sienaa0,hunta0=pci_f0_config */
#define PCRF_CZ_FN_LEVEL_RESET_LBN 15
#define PCRF_CZ_FN_LEVEL_RESET_WIDTH 1
@@ -693,7 +621,6 @@ extern "C" {
#define PCFE_AZ_MAX_RD_REQ_SIZE_512 2
#define PCFE_AZ_MAX_RD_REQ_SIZE_256 1
#define PCFE_AZ_MAX_RD_REQ_SIZE_128 0
-#define PCFE_DZ_OTHER other
#define PCRF_AZ_EN_NO_SNOOP_LBN 11
#define PCRF_AZ_EN_NO_SNOOP_WIDTH 1
#define PCRF_AZ_AUX_PWR_PM_EN_LBN 10
@@ -712,7 +639,6 @@ extern "C" {
#define PCFE_AZ_MAX_PAYL_SIZE_512 2
#define PCFE_AZ_MAX_PAYL_SIZE_256 1
#define PCFE_AZ_MAX_PAYL_SIZE_128 0
-#define PCFE_DZ_OTHER other
#define PCRF_AZ_EN_RELAX_ORDER_LBN 4
#define PCRF_AZ_EN_RELAX_ORDER_WIDTH 1
#define PCRF_AZ_UNSUP_REQ_RPT_EN_LBN 3
@@ -733,11 +659,8 @@ extern "C" {
#define PCR_AB_DEV_STAT_REG 0x0000006a
/* falcona0,falconb0=pci_f0_config */
-#define PCR_CC_DEV_STAT_REG 0x0000007a
-/* sienaa0=pci_f0_config */
-
-#define PCR_DZ_DEV_STAT_REG 0x000000ca
-/* hunta0=pci_f0_config */
+#define PCR_CZ_DEV_STAT_REG 0x0000007a
+/* sienaa0,hunta0=pci_f0_config */
#define PCRF_AZ_TRNS_PEND_LBN 5
#define PCRF_AZ_TRNS_PEND_WIDTH 1
@@ -761,14 +684,13 @@ extern "C" {
#define PCR_AB_LNK_CAP_REG 0x0000006c
/* falcona0,falconb0=pci_f0_config */
-#define PCR_CC_LNK_CAP_REG 0x0000007c
-/* sienaa0=pci_f0_config */
-
-#define PCR_DZ_LNK_CAP_REG 0x000000cc
-/* hunta0=pci_f0_config */
+#define PCR_CZ_LNK_CAP_REG 0x0000007c
+/* sienaa0,hunta0=pci_f0_config */
#define PCRF_AZ_PORT_NUM_LBN 24
#define PCRF_AZ_PORT_NUM_WIDTH 8
+#define PCRF_DZ_ASPM_OPTIONALITY_CAP_LBN 22
+#define PCRF_DZ_ASPM_OPTIONALITY_CAP_WIDTH 1
#define PCRF_CZ_LINK_BWDITH_NOTIF_CAP_LBN 21
#define PCRF_CZ_LINK_BWDITH_NOTIF_CAP_WIDTH 1
#define PCRF_CZ_DATA_LINK_ACTIVE_RPT_CAP_LBN 20
@@ -797,11 +719,8 @@ extern "C" {
#define PCR_AB_LNK_CTL_REG 0x00000070
/* falcona0,falconb0=pci_f0_config */
-#define PCR_CC_LNK_CTL_REG 0x00000080
-/* sienaa0=pci_f0_config */
-
-#define PCR_DZ_LNK_CTL_REG 0x000000d0
-/* hunta0=pci_f0_config */
+#define PCR_CZ_LNK_CTL_REG 0x00000080
+/* sienaa0,hunta0=pci_f0_config */
#define PCRF_AZ_EXT_SYNC_LBN 7
#define PCRF_AZ_EXT_SYNC_WIDTH 1
@@ -827,11 +746,8 @@ extern "C" {
#define PCR_AB_LNK_STAT_REG 0x00000072
/* falcona0,falconb0=pci_f0_config */
-#define PCR_CC_LNK_STAT_REG 0x00000082
-/* sienaa0=pci_f0_config */
-
-#define PCR_DZ_LNK_STAT_REG 0x000000d2
-/* hunta0=pci_f0_config */
+#define PCR_CZ_LNK_STAT_REG 0x00000082
+/* sienaa0,hunta0=pci_f0_config */
#define PCRF_AZ_SLOT_CLK_CFG_LBN 12
#define PCRF_AZ_SLOT_CLK_CFG_WIDTH 1
@@ -977,18 +893,40 @@ extern "C" {
/*
- * PC_DEV_CAP2_REG(16bit):
- * PCIe Device Capabilities 2
+ * PC_MSIX_TBL_BASE_REG(32bit):
+ * MSIX Capability Vector Table Base
*/
-#define PCR_CC_DEV_CAP2_REG 0x00000094
-/* sienaa0=pci_f0_config */
+#define PCR_BB_MSIX_TBL_BASE_REG 0x00000094
+/* falconb0=pci_f0_config */
-#define PCR_DZ_DEV_CAP2_REG 0x000000e4
-/* hunta0=pci_f0_config */
+#define PCR_CZ_MSIX_TBL_BASE_REG 0x000000b4
+/* sienaa0,hunta0=pci_f0_config */
-#define PCRF_CZ_CMPL_TIMEOUT_DIS_LBN 4
-#define PCRF_CZ_CMPL_TIMEOUT_DIS_WIDTH 1
+#define PCRF_BZ_MSIX_TBL_OFF_LBN 3
+#define PCRF_BZ_MSIX_TBL_OFF_WIDTH 29
+#define PCRF_BZ_MSIX_TBL_BIR_LBN 0
+#define PCRF_BZ_MSIX_TBL_BIR_WIDTH 3
+
+
+/*
+ * PC_DEV_CAP2_REG(32bit):
+ * PCIe Device Capabilities 2
+ */
+
+#define PCR_CZ_DEV_CAP2_REG 0x00000094
+/* sienaa0=pci_f0_config,hunta0=pci_f0_config */
+
+#define PCRF_DZ_OBFF_SUPPORTED_LBN 18
+#define PCRF_DZ_OBFF_SUPPORTED_WIDTH 2
+#define PCRF_DZ_TPH_CMPL_SUPPORTED_LBN 12
+#define PCRF_DZ_TPH_CMPL_SUPPORTED_WIDTH 2
+#define PCRF_DZ_LTR_M_SUPPORTED_LBN 11
+#define PCRF_DZ_LTR_M_SUPPORTED_WIDTH 1
+#define PCRF_CC_CMPL_TIMEOUT_DIS_LBN 4
+#define PCRF_CC_CMPL_TIMEOUT_DIS_WIDTH 1
+#define PCRF_DZ_CMPL_TIMEOUT_DIS_SUPPORTED_LBN 4
+#define PCRF_DZ_CMPL_TIMEOUT_DIS_SUPPORTED_WIDTH 1
#define PCRF_CZ_CMPL_TIMEOUT_LBN 0
#define PCRF_CZ_CMPL_TIMEOUT_WIDTH 4
#define PCFE_CZ_CMPL_TIMEOUT_17000_TO_6400MS 14
@@ -1003,33 +941,21 @@ extern "C" {
/*
- * PC_MSIX_TBL_BASE_REG(32bit):
- * MSIX Capability Vector Table Base
- */
-
-#define PCR_BB_MSIX_TBL_BASE_REG 0x00000094
-/* falconb0=pci_f0_config */
-
-#define PCR_CZ_MSIX_TBL_BASE_REG 0x000000b4
-/* sienaa0,hunta0=pci_f0_config */
-
-#define PCRF_BZ_MSIX_TBL_OFF_LBN 3
-#define PCRF_BZ_MSIX_TBL_OFF_WIDTH 29
-#define PCRF_BZ_MSIX_TBL_BIR_LBN 0
-#define PCRF_BZ_MSIX_TBL_BIR_WIDTH 3
-
-
-/*
* PC_DEV_CTL2_REG(16bit):
* PCIe Device Control 2
*/
-#define PCR_CC_DEV_CTL2_REG 0x00000098
-/* sienaa0=pci_f0_config */
-
-#define PCR_DZ_DEV_CTL2_REG 0x000000e8
-/* hunta0=pci_f0_config */
+#define PCR_CZ_DEV_CTL2_REG 0x00000098
+/* sienaa0,hunta0=pci_f0_config */
+#define PCRF_DZ_OBFF_ENABLE_LBN 13
+#define PCRF_DZ_OBFF_ENABLE_WIDTH 2
+#define PCRF_DZ_LTR_ENABLE_LBN 10
+#define PCRF_DZ_LTR_ENABLE_WIDTH 1
+#define PCRF_DZ_IDO_COMPLETION_ENABLE_LBN 9
+#define PCRF_DZ_IDO_COMPLETION_ENABLE_WIDTH 1
+#define PCRF_DZ_IDO_REQUEST_ENABLE_LBN 8
+#define PCRF_DZ_IDO_REQUEST_ENABLE_WIDTH 1
#define PCRF_CZ_CMPL_TIMEOUT_DIS_CTL_LBN 4
#define PCRF_CZ_CMPL_TIMEOUT_DIS_CTL_WIDTH 1
#define PCRF_CZ_CMPL_TIMEOUT_CTL_LBN 0
@@ -1054,15 +980,24 @@ extern "C" {
/*
+ * PC_LNK_CAP2_REG(32bit):
+ * PCIe Link Capability 2
+ */
+
+#define PCR_DZ_LNK_CAP2_REG 0x0000009c
+/* hunta0=pci_f0_config */
+
+#define PCRF_DZ_LNK_SPEED_SUP_LBN 1
+#define PCRF_DZ_LNK_SPEED_SUP_WIDTH 7
+
+
+/*
* PC_LNK_CTL2_REG(16bit):
* PCIe Link Control 2
*/
-#define PCR_CC_LNK_CTL2_REG 0x000000a0
-/* sienaa0=pci_f0_config */
-
-#define PCR_DZ_LNK_CTL2_REG 0x000000f0
-/* hunta0=pci_f0_config */
+#define PCR_CZ_LNK_CTL2_REG 0x000000a0
+/* sienaa0,hunta0=pci_f0_config */
#define PCRF_CZ_POLLING_DEEMPH_LVL_LBN 12
#define PCRF_CZ_POLLING_DEEMPH_LVL_WIDTH 1
@@ -1080,6 +1015,9 @@ extern "C" {
#define PCRF_CZ_ENTER_COMPLIANCE_CTL_WIDTH 1
#define PCRF_CZ_TGT_LNK_SPEED_CTL_LBN 0
#define PCRF_CZ_TGT_LNK_SPEED_CTL_WIDTH 4
+#define PCFE_DZ_LCTL2_TGT_SPEED_GEN3 3
+#define PCFE_DZ_LCTL2_TGT_SPEED_GEN2 2
+#define PCFE_DZ_LCTL2_TGT_SPEED_GEN1 1
/*
@@ -1087,11 +1025,8 @@ extern "C" {
* PCIe Link Status 2
*/
-#define PCR_CC_LNK_STAT2_REG 0x000000a2
-/* sienaa0=pci_f0_config */
-
-#define PCR_DZ_LNK_STAT2_REG 0x000000f2
-/* hunta0=pci_f0_config */
+#define PCR_CZ_LNK_STAT2_REG 0x000000a2
+/* sienaa0,hunta0=pci_f0_config */
#define PCRF_CZ_CURRENT_DEEMPH_LBN 0
#define PCRF_CZ_CURRENT_DEEMPH_WIDTH 1
@@ -1136,6 +1071,39 @@ extern "C" {
/*
+ * PC_VPD_CAP_DATA_REG(32bit):
+ * documentation to be written for sum_PC_VPD_CAP_DATA_REG
+ */
+
+#define PCR_AB_VPD_CAP_DATA_REG 0x000000b4
+/* falcona0,falconb0=pci_f0_config */
+
+#define PCR_CZ_VPD_CAP_DATA_REG 0x000000d4
+/* sienaa0,hunta0=pci_f0_config */
+
+#define PCRF_AZ_VPD_DATA_LBN 0
+#define PCRF_AZ_VPD_DATA_WIDTH 32
+
+
+/*
+ * PC_VPD_CAP_CTL_REG(8bit):
+ * VPD control and capabilities register
+ */
+
+#define PCR_CZ_VPD_CAP_CTL_REG 0x000000d0
+/* sienaa0,hunta0=pci_f0_config */
+
+#define PCRF_CZ_VPD_FLAG_LBN 31
+#define PCRF_CZ_VPD_FLAG_WIDTH 1
+#define PCRF_CZ_VPD_ADDR_LBN 16
+#define PCRF_CZ_VPD_ADDR_WIDTH 15
+#define PCRF_CZ_VPD_NXT_PTR_LBN 8
+#define PCRF_CZ_VPD_NXT_PTR_WIDTH 8
+#define PCRF_CZ_VPD_CAP_ID_LBN 0
+#define PCRF_CZ_VPD_CAP_ID_WIDTH 8
+
+
+/*
* PC_AER_CAP_HDR_REG(32bit):
* AER capability header register
*/
@@ -1191,6 +1159,10 @@ extern "C" {
#define PCR_AZ_AER_UNCORR_ERR_MASK_REG 0x00000108
/* falcona0,falconb0,sienaa0,hunta0=pci_f0_config */
+#define PCRF_DZ_ATOMIC_OP_EGR_BLOCKED_MASK_LBN 24
+#define PCRF_DZ_ATOMIC_OP_EGR_BLOCKED_MASK_WIDTH 1
+#define PCRF_DZ_UNCORR_INT_ERR_MASK_LBN 22
+#define PCRF_DZ_UNCORR_INT_ERR_MASK_WIDTH 1
#define PCRF_AZ_UNSUPT_REQ_ERR_MASK_LBN 20
#define PCRF_AZ_UNSUPT_REQ_ERR_MASK_WIDTH 1
#define PCRF_AZ_ECRC_ERR_MASK_LBN 19
@@ -1328,11 +1300,8 @@ extern "C" {
* Device serial number capability header register
*/
-#define PCR_DZ_DEVSN_CAP_HDR_REG 0x00000130
-/* hunta0=pci_f0_config */
-
-#define PCR_CC_DEVSN_CAP_HDR_REG 0x00000140
-/* sienaa0=pci_f0_config */
+#define PCR_CZ_DEVSN_CAP_HDR_REG 0x00000140
+/* sienaa0,hunta0=pci_f0_config */
#define PCRF_CZ_DEVSNCAPHDR_NXT_PTR_LBN 20
#define PCRF_CZ_DEVSNCAPHDR_NXT_PTR_WIDTH 12
@@ -1347,11 +1316,8 @@ extern "C" {
* Device serial number DWORD0
*/
-#define PCR_DZ_DEVSN_DWORD0_REG 0x00000134
-/* hunta0=pci_f0_config */
-
-#define PCR_CC_DEVSN_DWORD0_REG 0x00000144
-/* sienaa0=pci_f0_config */
+#define PCR_CZ_DEVSN_DWORD0_REG 0x00000144
+/* sienaa0,hunta0=pci_f0_config */
#define PCRF_CZ_DEVSN_DWORD0_LBN 0
#define PCRF_CZ_DEVSN_DWORD0_WIDTH 32
@@ -1362,11 +1328,8 @@ extern "C" {
* Device serial number DWORD0
*/
-#define PCR_DZ_DEVSN_DWORD1_REG 0x00000138
-/* hunta0=pci_f0_config */
-
-#define PCR_CC_DEVSN_DWORD1_REG 0x00000148
-/* sienaa0=pci_f0_config */
+#define PCR_CZ_DEVSN_DWORD1_REG 0x00000148
+/* sienaa0,hunta0=pci_f0_config */
#define PCRF_CZ_DEVSN_DWORD1_LBN 0
#define PCRF_CZ_DEVSN_DWORD1_WIDTH 32
@@ -1377,11 +1340,8 @@ extern "C" {
* ARI capability header register
*/
-#define PCR_DZ_ARI_CAP_HDR_REG 0x00000140
-/* hunta0=pci_f0_config */
-
-#define PCR_CC_ARI_CAP_HDR_REG 0x00000150
-/* sienaa0=pci_f0_config */
+#define PCR_CZ_ARI_CAP_HDR_REG 0x00000150
+/* sienaa0,hunta0=pci_f0_config */
#define PCRF_CZ_ARICAPHDR_NXT_PTR_LBN 20
#define PCRF_CZ_ARICAPHDR_NXT_PTR_WIDTH 12
@@ -1396,11 +1356,8 @@ extern "C" {
* ARI Capabilities
*/
-#define PCR_DZ_ARI_CAP_REG 0x00000144
-/* hunta0=pci_f0_config */
-
-#define PCR_CC_ARI_CAP_REG 0x00000154
-/* sienaa0=pci_f0_config */
+#define PCR_CZ_ARI_CAP_REG 0x00000154
+/* sienaa0,hunta0=pci_f0_config */
#define PCRF_CZ_ARI_NXT_FN_NUM_LBN 8
#define PCRF_CZ_ARI_NXT_FN_NUM_WIDTH 8
@@ -1415,11 +1372,8 @@ extern "C" {
* ARI Control
*/
-#define PCR_DZ_ARI_CTL_REG 0x00000146
-/* hunta0=pci_f0_config */
-
-#define PCR_CC_ARI_CTL_REG 0x00000156
-/* sienaa0=pci_f0_config */
+#define PCR_CZ_ARI_CTL_REG 0x00000156
+/* sienaa0,hunta0=pci_f0_config */
#define PCRF_CZ_ARI_FN_GRP_LBN 4
#define PCRF_CZ_ARI_FN_GRP_WIDTH 3
@@ -1430,6 +1384,22 @@ extern "C" {
/*
+ * PC_SEC_PCIE_CAP_REG(32bit):
+ * Secondary PCIE Capability Register
+ */
+
+#define PCR_DZ_SEC_PCIE_CAP_REG 0x00000160
+/* hunta0=pci_f0_config */
+
+#define PCRF_DZ_SEC_NXT_PTR_LBN 20
+#define PCRF_DZ_SEC_NXT_PTR_WIDTH 12
+#define PCRF_DZ_SEC_VERSION_LBN 16
+#define PCRF_DZ_SEC_VERSION_WIDTH 4
+#define PCRF_DZ_SEC_EXT_CAP_ID_LBN 0
+#define PCRF_DZ_SEC_EXT_CAP_ID_WIDTH 16
+
+
+/*
* PC_SRIOV_CAP_HDR_REG(32bit):
* SRIOV capability header register
*/
@@ -1437,7 +1407,7 @@ extern "C" {
#define PCR_CC_SRIOV_CAP_HDR_REG 0x00000160
/* sienaa0=pci_f0_config */
-#define PCR_DZ_SRIOV_CAP_HDR_REG 0x00000200
+#define PCR_DZ_SRIOV_CAP_HDR_REG 0x00000180
/* hunta0=pci_f0_config */
#define PCRF_CZ_SRIOVCAPHDR_NXT_PTR_LBN 20
@@ -1456,16 +1426,44 @@ extern "C" {
#define PCR_CC_SRIOV_CAP_REG 0x00000164
/* sienaa0=pci_f0_config */
-#define PCR_DZ_SRIOV_CAP_REG 0x00000204
+#define PCR_DZ_SRIOV_CAP_REG 0x00000184
/* hunta0=pci_f0_config */
#define PCRF_CZ_VF_MIGR_INT_MSG_NUM_LBN 21
#define PCRF_CZ_VF_MIGR_INT_MSG_NUM_WIDTH 11
+#define PCRF_DZ_VF_ARI_CAP_PRESV_LBN 1
+#define PCRF_DZ_VF_ARI_CAP_PRESV_WIDTH 1
#define PCRF_CZ_VF_MIGR_CAP_LBN 0
#define PCRF_CZ_VF_MIGR_CAP_WIDTH 1
/*
+ * PC_LINK_CONTROL3_REG(32bit):
+ * Link Control 3.
+ */
+
+#define PCR_DZ_LINK_CONTROL3_REG 0x00000164
+/* hunta0=pci_f0_config */
+
+#define PCRF_DZ_LINK_EQ_INT_EN_LBN 1
+#define PCRF_DZ_LINK_EQ_INT_EN_WIDTH 1
+#define PCRF_DZ_PERFORM_EQL_LBN 0
+#define PCRF_DZ_PERFORM_EQL_WIDTH 1
+
+
+/*
+ * PC_LANE_ERROR_STAT_REG(32bit):
+ * Lane Error Status Register.
+ */
+
+#define PCR_DZ_LANE_ERROR_STAT_REG 0x00000168
+/* hunta0=pci_f0_config */
+
+#define PCRF_DZ_LANE_STATUS_LBN 0
+#define PCRF_DZ_LANE_STATUS_WIDTH 8
+
+
+/*
* PC_SRIOV_CTL_REG(16bit):
* SRIOV Control
*/
@@ -1473,7 +1471,7 @@ extern "C" {
#define PCR_CC_SRIOV_CTL_REG 0x00000168
/* sienaa0=pci_f0_config */
-#define PCR_DZ_SRIOV_CTL_REG 0x00000208
+#define PCR_DZ_SRIOV_CTL_REG 0x00000188
/* hunta0=pci_f0_config */
#define PCRF_CZ_VF_ARI_CAP_HRCHY_LBN 4
@@ -1496,7 +1494,7 @@ extern "C" {
#define PCR_CC_SRIOV_STAT_REG 0x0000016a
/* sienaa0=pci_f0_config */
-#define PCR_DZ_SRIOV_STAT_REG 0x0000020a
+#define PCR_DZ_SRIOV_STAT_REG 0x0000018a
/* hunta0=pci_f0_config */
#define PCRF_CZ_VF_MIGR_STAT_LBN 0
@@ -1504,6 +1502,20 @@ extern "C" {
/*
+ * PC_LANE01_EQU_CONTROL_REG(32bit):
+ * Lanes 0,1 Equalization Control Register.
+ */
+
+#define PCR_DZ_LANE01_EQU_CONTROL_REG 0x0000016c
+/* hunta0=pci_f0_config */
+
+#define PCRF_DZ_LANE1_EQ_CTRL_LBN 16
+#define PCRF_DZ_LANE1_EQ_CTRL_WIDTH 16
+#define PCRF_DZ_LANE0_EQ_CTRL_LBN 0
+#define PCRF_DZ_LANE0_EQ_CTRL_WIDTH 16
+
+
+/*
* PC_SRIOV_INITIALVFS_REG(16bit):
* SRIOV Initial VFs
*/
@@ -1511,7 +1523,7 @@ extern "C" {
#define PCR_CC_SRIOV_INITIALVFS_REG 0x0000016c
/* sienaa0=pci_f0_config */
-#define PCR_DZ_SRIOV_INITIALVFS_REG 0x0000020c
+#define PCR_DZ_SRIOV_INITIALVFS_REG 0x0000018c
/* hunta0=pci_f0_config */
#define PCRF_CZ_VF_INITIALVFS_LBN 0
@@ -1526,7 +1538,7 @@ extern "C" {
#define PCR_CC_SRIOV_TOTALVFS_REG 0x0000016e
/* sienaa0=pci_f0_config */
-#define PCR_DZ_SRIOV_TOTALVFS_REG 0x0000020e
+#define PCR_DZ_SRIOV_TOTALVFS_REG 0x0000018e
/* hunta0=pci_f0_config */
#define PCRF_CZ_VF_TOTALVFS_LBN 0
@@ -1541,7 +1553,7 @@ extern "C" {
#define PCR_CC_SRIOV_NUMVFS_REG 0x00000170
/* sienaa0=pci_f0_config */
-#define PCR_DZ_SRIOV_NUMVFS_REG 0x00000210
+#define PCR_DZ_SRIOV_NUMVFS_REG 0x00000190
/* hunta0=pci_f0_config */
#define PCRF_CZ_VF_NUMVFS_LBN 0
@@ -1549,6 +1561,20 @@ extern "C" {
/*
+ * PC_LANE23_EQU_CONTROL_REG(32bit):
+ * Lanes 2,3 Equalization Control Register.
+ */
+
+#define PCR_DZ_LANE23_EQU_CONTROL_REG 0x00000170
+/* hunta0=pci_f0_config */
+
+#define PCRF_DZ_LANE3_EQ_CTRL_LBN 16
+#define PCRF_DZ_LANE3_EQ_CTRL_WIDTH 16
+#define PCRF_DZ_LANE2_EQ_CTRL_LBN 0
+#define PCRF_DZ_LANE2_EQ_CTRL_WIDTH 16
+
+
+/*
* PC_SRIOV_FN_DPND_LNK_REG(16bit):
* SRIOV Function dependency link
*/
@@ -1556,7 +1582,7 @@ extern "C" {
#define PCR_CC_SRIOV_FN_DPND_LNK_REG 0x00000172
/* sienaa0=pci_f0_config */
-#define PCR_DZ_SRIOV_FN_DPND_LNK_REG 0x00000212
+#define PCR_DZ_SRIOV_FN_DPND_LNK_REG 0x00000192
/* hunta0=pci_f0_config */
#define PCRF_CZ_SRIOV_FN_DPND_LNK_LBN 0
@@ -1571,7 +1597,7 @@ extern "C" {
#define PCR_CC_SRIOV_1STVF_OFFSET_REG 0x00000174
/* sienaa0=pci_f0_config */
-#define PCR_DZ_SRIOV_1STVF_OFFSET_REG 0x00000214
+#define PCR_DZ_SRIOV_1STVF_OFFSET_REG 0x00000194
/* hunta0=pci_f0_config */
#define PCRF_CZ_VF_1STVF_OFFSET_LBN 0
@@ -1579,6 +1605,20 @@ extern "C" {
/*
+ * PC_LANE45_EQU_CONTROL_REG(32bit):
+ * Lanes 4,5 Equalization Control Register.
+ */
+
+#define PCR_DZ_LANE45_EQU_CONTROL_REG 0x00000174
+/* hunta0=pci_f0_config */
+
+#define PCRF_DZ_LANE5_EQ_CTRL_LBN 16
+#define PCRF_DZ_LANE5_EQ_CTRL_WIDTH 16
+#define PCRF_DZ_LANE4_EQ_CTRL_LBN 0
+#define PCRF_DZ_LANE4_EQ_CTRL_WIDTH 16
+
+
+/*
* PC_SRIOV_VFSTRIDE_REG(16bit):
* SRIOV VF Stride
*/
@@ -1586,7 +1626,7 @@ extern "C" {
#define PCR_CC_SRIOV_VFSTRIDE_REG 0x00000176
/* sienaa0=pci_f0_config */
-#define PCR_DZ_SRIOV_VFSTRIDE_REG 0x00000216
+#define PCR_DZ_SRIOV_VFSTRIDE_REG 0x00000196
/* hunta0=pci_f0_config */
#define PCRF_CZ_VF_VFSTRIDE_LBN 0
@@ -1594,6 +1634,20 @@ extern "C" {
/*
+ * PC_LANE67_EQU_CONTROL_REG(32bit):
+ * Lanes 6,7 Equalization Control Register.
+ */
+
+#define PCR_DZ_LANE67_EQU_CONTROL_REG 0x00000178
+/* hunta0=pci_f0_config */
+
+#define PCRF_DZ_LANE7_EQ_CTRL_LBN 16
+#define PCRF_DZ_LANE7_EQ_CTRL_WIDTH 16
+#define PCRF_DZ_LANE6_EQ_CTRL_LBN 0
+#define PCRF_DZ_LANE6_EQ_CTRL_WIDTH 16
+
+
+/*
* PC_SRIOV_DEVID_REG(16bit):
* SRIOV VF Device ID
*/
@@ -1601,7 +1655,7 @@ extern "C" {
#define PCR_CC_SRIOV_DEVID_REG 0x0000017a
/* sienaa0=pci_f0_config */
-#define PCR_DZ_SRIOV_DEVID_REG 0x0000021a
+#define PCR_DZ_SRIOV_DEVID_REG 0x0000019a
/* hunta0=pci_f0_config */
#define PCRF_CZ_VF_DEVID_LBN 0
@@ -1616,7 +1670,7 @@ extern "C" {
#define PCR_CC_SRIOV_SUP_PAGESZ_REG 0x0000017c
/* sienaa0=pci_f0_config */
-#define PCR_DZ_SRIOV_SUP_PAGESZ_REG 0x0000021c
+#define PCR_DZ_SRIOV_SUP_PAGESZ_REG 0x0000019c
/* hunta0=pci_f0_config */
#define PCRF_CZ_VF_SUP_PAGESZ_LBN 0
@@ -1631,7 +1685,7 @@ extern "C" {
#define PCR_CC_SRIOV_SYS_PAGESZ_REG 0x00000180
/* sienaa0=pci_f0_config */
-#define PCR_DZ_SRIOV_SYS_PAGESZ_REG 0x00000220
+#define PCR_DZ_SRIOV_SYS_PAGESZ_REG 0x000001a0
/* hunta0=pci_f0_config */
#define PCRF_CZ_VF_SYS_PAGESZ_LBN 0
@@ -1646,13 +1700,19 @@ extern "C" {
#define PCR_CC_SRIOV_BAR0_REG 0x00000184
/* sienaa0=pci_f0_config */
-#define PCR_DZ_SRIOV_BAR0_REG 0x00000224
+#define PCR_DZ_SRIOV_BAR0_REG 0x000001a4
/* hunta0=pci_f0_config */
#define PCRF_CC_VF_BAR_ADDRESS_LBN 0
#define PCRF_CC_VF_BAR_ADDRESS_WIDTH 32
-#define PCRF_DZ_VF_BAR0_ADDRESS_LBN 0
-#define PCRF_DZ_VF_BAR0_ADDRESS_WIDTH 32
+#define PCRF_DZ_VF_BAR0_ADDRESS_LBN 4
+#define PCRF_DZ_VF_BAR0_ADDRESS_WIDTH 28
+#define PCRF_DZ_VF_BAR0_PREF_LBN 3
+#define PCRF_DZ_VF_BAR0_PREF_WIDTH 1
+#define PCRF_DZ_VF_BAR0_TYPE_LBN 1
+#define PCRF_DZ_VF_BAR0_TYPE_WIDTH 2
+#define PCRF_DZ_VF_BAR0_IOM_LBN 0
+#define PCRF_DZ_VF_BAR0_IOM_WIDTH 1
/*
@@ -1663,7 +1723,7 @@ extern "C" {
#define PCR_CC_SRIOV_BAR1_REG 0x00000188
/* sienaa0=pci_f0_config */
-#define PCR_DZ_SRIOV_BAR1_REG 0x00000228
+#define PCR_DZ_SRIOV_BAR1_REG 0x000001a8
/* hunta0=pci_f0_config */
/* defined as PCRF_CC_VF_BAR_ADDRESS_LBN 0; */
@@ -1680,13 +1740,19 @@ extern "C" {
#define PCR_CC_SRIOV_BAR2_REG 0x0000018c
/* sienaa0=pci_f0_config */
-#define PCR_DZ_SRIOV_BAR2_REG 0x0000022c
+#define PCR_DZ_SRIOV_BAR2_REG 0x000001ac
/* hunta0=pci_f0_config */
/* defined as PCRF_CC_VF_BAR_ADDRESS_LBN 0; */
/* defined as PCRF_CC_VF_BAR_ADDRESS_WIDTH 32 */
-#define PCRF_DZ_VF_BAR2_ADDRESS_LBN 0
-#define PCRF_DZ_VF_BAR2_ADDRESS_WIDTH 32
+#define PCRF_DZ_VF_BAR2_ADDRESS_LBN 4
+#define PCRF_DZ_VF_BAR2_ADDRESS_WIDTH 28
+#define PCRF_DZ_VF_BAR2_PREF_LBN 3
+#define PCRF_DZ_VF_BAR2_PREF_WIDTH 1
+#define PCRF_DZ_VF_BAR2_TYPE_LBN 1
+#define PCRF_DZ_VF_BAR2_TYPE_WIDTH 2
+#define PCRF_DZ_VF_BAR2_IOM_LBN 0
+#define PCRF_DZ_VF_BAR2_IOM_WIDTH 1
/*
@@ -1697,7 +1763,7 @@ extern "C" {
#define PCR_CC_SRIOV_BAR3_REG 0x00000190
/* sienaa0=pci_f0_config */
-#define PCR_DZ_SRIOV_BAR3_REG 0x00000230
+#define PCR_DZ_SRIOV_BAR3_REG 0x000001b0
/* hunta0=pci_f0_config */
/* defined as PCRF_CC_VF_BAR_ADDRESS_LBN 0; */
@@ -1714,7 +1780,7 @@ extern "C" {
#define PCR_CC_SRIOV_BAR4_REG 0x00000194
/* sienaa0=pci_f0_config */
-#define PCR_DZ_SRIOV_BAR4_REG 0x00000234
+#define PCR_DZ_SRIOV_BAR4_REG 0x000001b4
/* hunta0=pci_f0_config */
/* defined as PCRF_CC_VF_BAR_ADDRESS_LBN 0; */
@@ -1731,7 +1797,7 @@ extern "C" {
#define PCR_CC_SRIOV_BAR5_REG 0x00000198
/* sienaa0=pci_f0_config */
-#define PCR_DZ_SRIOV_BAR5_REG 0x00000238
+#define PCR_DZ_SRIOV_BAR5_REG 0x000001b8
/* hunta0=pci_f0_config */
/* defined as PCRF_CC_VF_BAR_ADDRESS_LBN 0; */
@@ -1741,6 +1807,18 @@ extern "C" {
/*
+ * PC_SRIOV_RSVD_REG(16bit):
+ * Reserved register
+ */
+
+#define PCR_DZ_SRIOV_RSVD_REG 0x00000198
+/* hunta0=pci_f0_config */
+
+#define PCRF_DZ_VF_RSVD_LBN 0
+#define PCRF_DZ_VF_RSVD_WIDTH 16
+
+
+/*
* PC_SRIOV_MIBR_SARRAY_OFFSET_REG(32bit):
* SRIOV VF Migration State Array Offset
*/
@@ -1748,7 +1826,7 @@ extern "C" {
#define PCR_CC_SRIOV_MIBR_SARRAY_OFFSET_REG 0x0000019c
/* sienaa0=pci_f0_config */
-#define PCR_DZ_SRIOV_MIBR_SARRAY_OFFSET_REG 0x0000023c
+#define PCR_DZ_SRIOV_MIBR_SARRAY_OFFSET_REG 0x000001bc
/* hunta0=pci_f0_config */
#define PCRF_CZ_VF_MIGR_OFFSET_LBN 3
@@ -1758,45 +1836,11 @@ extern "C" {
/*
- * PC_LTR_CAP_HDR_REG(32bit):
- * Latency Tolerance Reporting Cap Header Reg
- */
-
-#define PCR_DZ_LTR_CAP_HDR_REG 0x00000240
-/* hunta0=pci_f0_config */
-
-#define PCRF_DZ_LTR_NXT_PTR_LBN 20
-#define PCRF_DZ_LTR_NXT_PTR_WIDTH 12
-#define PCRF_DZ_LTR_VERSION_LBN 16
-#define PCRF_DZ_LTR_VERSION_WIDTH 4
-#define PCRF_DZ_LTR_EXT_CAP_ID_LBN 0
-#define PCRF_DZ_LTR_EXT_CAP_ID_WIDTH 16
-
-
-/*
- * PC_LTR_MAX_SNOOP_REG(32bit):
- * LTR Maximum Snoop/No Snoop Register
- */
-
-#define PCR_DZ_LTR_MAX_SNOOP_REG 0x00000244
-/* hunta0=pci_f0_config */
-
-#define PCRF_DZ_LTR_MAX_NOSNOOP_SCALE_LBN 26
-#define PCRF_DZ_LTR_MAX_NOSNOOP_SCALE_WIDTH 3
-#define PCRF_DZ_LTR_MAX_NOSNOOP_LAT_LBN 16
-#define PCRF_DZ_LTR_MAX_NOSNOOP_LAT_WIDTH 10
-#define PCRF_DZ_LTR_MAX_SNOOP_SCALE_LBN 10
-#define PCRF_DZ_LTR_MAX_SNOOP_SCALE_WIDTH 3
-#define PCRF_DZ_LTR_MAX_SNOOP_LAT_LBN 0
-#define PCRF_DZ_LTR_MAX_SNOOP_LAT_WIDTH 10
-
-
-/*
* PC_TPH_CAP_HDR_REG(32bit):
* TPH Capability Header Register
*/
-#define PCR_DZ_TPH_CAP_HDR_REG 0x00000274
+#define PCR_DZ_TPH_CAP_HDR_REG 0x000001c0
/* hunta0=pci_f0_config */
#define PCRF_DZ_TPH_NXT_PTR_LBN 20
@@ -1812,7 +1856,7 @@ extern "C" {
* TPH Requester Capability Register
*/
-#define PCR_DZ_TPH_REQ_CAP_REG 0x00000278
+#define PCR_DZ_TPH_REQ_CAP_REG 0x000001c4
/* hunta0=pci_f0_config */
#define PCRF_DZ_ST_TBLE_SIZE_LBN 16
@@ -1834,7 +1878,7 @@ extern "C" {
* TPH Requester Control Register
*/
-#define PCR_DZ_TPH_REQ_CTL_REG 0x0000027c
+#define PCR_DZ_TPH_REQ_CTL_REG 0x000001c8
/* hunta0=pci_f0_config */
#define PCRF_DZ_TPH_REQ_ENABLE_LBN 8
@@ -1844,101 +1888,37 @@ extern "C" {
/*
- * PC_SEC_PCIE_CAP_REG(32bit):
- * Secondary PCIE Capability Register
- */
-
-#define PCR_DZ_SEC_PCIE_CAP_REG 0x00000300
-/* hunta0=pci_f0_config */
-
-#define PCRF_DZ_SEC_NXT_PTR_LBN 20
-#define PCRF_DZ_SEC_NXT_PTR_WIDTH 12
-#define PCRF_DZ_SEC_VERSION_LBN 16
-#define PCRF_DZ_SEC_VERSION_WIDTH 4
-#define PCRF_DZ_SEC_EXT_CAP_ID_LBN 0
-#define PCRF_DZ_SEC_EXT_CAP_ID_WIDTH 16
-
-
-/*
- * PC_LINK_CONTROL3_REG(32bit):
- * Link Control 3.
- */
-
-#define PCR_DZ_LINK_CONTROL3_REG 0x00000304
-/* hunta0=pci_f0_config */
-
-#define PCRF_DZ_LINK_EQ_INT_EN_LBN 1
-#define PCRF_DZ_LINK_EQ_INT_EN_WIDTH 1
-#define PCRF_DZ_PERFORM_EQL_LBN 0
-#define PCRF_DZ_PERFORM_EQL_WIDTH 1
-
-
-/*
- * PC_LANE_ERROR_STAT_REG(32bit):
- * Lane Error Status Register.
- */
-
-#define PCR_DZ_LANE_ERROR_STAT_REG 0x00000308
-/* hunta0=pci_f0_config */
-
-#define PCRF_DZ_LANE_STATUS_LBN 0
-#define PCRF_DZ_LANE_STATUS_WIDTH 8
-
-
-/*
- * PC_LANE01_EQU_CONTROL_REG(32bit):
- * Lanes 0,1 Equalization Control Register.
- */
-
-#define PCR_DZ_LANE01_EQU_CONTROL_REG 0x0000030c
-/* hunta0=pci_f0_config */
-
-#define PCRF_DZ_LANE1_EQ_CTRL_LBN 16
-#define PCRF_DZ_LANE1_EQ_CTRL_WIDTH 16
-#define PCRF_DZ_LANE0_EQ_CTRL_LBN 0
-#define PCRF_DZ_LANE0_EQ_CTRL_WIDTH 16
-
-
-/*
- * PC_LANE23_EQU_CONTROL_REG(32bit):
- * Lanes 2,3 Equalization Control Register.
- */
-
-#define PCR_DZ_LANE23_EQU_CONTROL_REG 0x00000310
-/* hunta0=pci_f0_config */
-
-#define PCRF_DZ_LANE3_EQ_CTRL_LBN 16
-#define PCRF_DZ_LANE3_EQ_CTRL_WIDTH 16
-#define PCRF_DZ_LANE2_EQ_CTRL_LBN 0
-#define PCRF_DZ_LANE2_EQ_CTRL_WIDTH 16
-
-
-/*
- * PC_LANE45_EQU_CONTROL_REG(32bit):
- * Lanes 4,5 Equalization Control Register.
+ * PC_LTR_CAP_HDR_REG(32bit):
+ * Latency Tolerance Reporting Cap Header Reg
*/
-#define PCR_DZ_LANE45_EQU_CONTROL_REG 0x00000314
+#define PCR_DZ_LTR_CAP_HDR_REG 0x00000290
/* hunta0=pci_f0_config */
-#define PCRF_DZ_LANE5_EQ_CTRL_LBN 16
-#define PCRF_DZ_LANE5_EQ_CTRL_WIDTH 16
-#define PCRF_DZ_LANE4_EQ_CTRL_LBN 0
-#define PCRF_DZ_LANE4_EQ_CTRL_WIDTH 16
+#define PCRF_DZ_LTR_NXT_PTR_LBN 20
+#define PCRF_DZ_LTR_NXT_PTR_WIDTH 12
+#define PCRF_DZ_LTR_VERSION_LBN 16
+#define PCRF_DZ_LTR_VERSION_WIDTH 4
+#define PCRF_DZ_LTR_EXT_CAP_ID_LBN 0
+#define PCRF_DZ_LTR_EXT_CAP_ID_WIDTH 16
/*
- * PC_LANE67_EQU_CONTROL_REG(32bit):
- * Lanes 6,7 Equalization Control Register.
+ * PC_LTR_MAX_SNOOP_REG(32bit):
+ * LTR Maximum Snoop/No Snoop Register
*/
-#define PCR_DZ_LANE67_EQU_CONTROL_REG 0x00000318
+#define PCR_DZ_LTR_MAX_SNOOP_REG 0x00000294
/* hunta0=pci_f0_config */
-#define PCRF_DZ_LANE7_EQ_CTRL_LBN 16
-#define PCRF_DZ_LANE7_EQ_CTRL_WIDTH 16
-#define PCRF_DZ_LANE6_EQ_CTRL_LBN 0
-#define PCRF_DZ_LANE6_EQ_CTRL_WIDTH 16
+#define PCRF_DZ_LTR_MAX_NOSNOOP_SCALE_LBN 26
+#define PCRF_DZ_LTR_MAX_NOSNOOP_SCALE_WIDTH 3
+#define PCRF_DZ_LTR_MAX_NOSNOOP_LAT_LBN 16
+#define PCRF_DZ_LTR_MAX_NOSNOOP_LAT_WIDTH 10
+#define PCRF_DZ_LTR_MAX_SNOOP_SCALE_LBN 10
+#define PCRF_DZ_LTR_MAX_SNOOP_SCALE_WIDTH 3
+#define PCRF_DZ_LTR_MAX_SNOOP_LAT_LBN 0
+#define PCRF_DZ_LTR_MAX_SNOOP_LAT_WIDTH 10
/*
@@ -2140,6 +2120,18 @@ extern "C" {
/*
+ * PC_FLT_MSK_REG(32bit):
+ * Filter Mask Register 2
+ */
+
+#define PCR_CC_FLT_MSK_REG 0x00000720
+/* sienaa0=pci_f0_config */
+
+#define PCRF_CC_DEFAULT_FLT_MSK2_LBN 0
+#define PCRF_CC_DEFAULT_FLT_MSK2_WIDTH 32
+
+
+/*
* PC_PHY_STAT_REG(32bit):
* PHY status register
*/
@@ -2161,18 +2153,6 @@ extern "C" {
/*
- * PC_FLT_MSK_REG(32bit):
- * Filter Mask Register 2
- */
-
-#define PCR_CC_FLT_MSK_REG 0x00000720
-/* sienaa0=pci_f0_config */
-
-#define PCRF_CC_DEFAULT_FLT_MSK2_LBN 0
-#define PCRF_CC_DEFAULT_FLT_MSK2_WIDTH 32
-
-
-/*
* PC_PHY_CTL_REG(32bit):
* PHY control register
*/
diff --git a/sys/dev/sfxge/common/efx_rx.c b/sys/dev/sfxge/common/efx_rx.c
index c6e0d70..3501d6e 100644
--- a/sys/dev/sfxge/common/efx_rx.c
+++ b/sys/dev/sfxge/common/efx_rx.c
@@ -1,26 +1,31 @@
/*-
- * Copyright 2007-2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2007-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -32,12 +37,174 @@ __FBSDID("$FreeBSD$");
#include "efx_regs.h"
#include "efx_impl.h"
+
+#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
+
+static __checkReturn int
+falconsiena_rx_init(
+ __in efx_nic_t *enp);
+
+static void
+falconsiena_rx_fini(
+ __in efx_nic_t *enp);
+
+#if EFSYS_OPT_RX_HDR_SPLIT
+static __checkReturn int
+falconsiena_rx_hdr_split_enable(
+ __in efx_nic_t *enp,
+ __in unsigned int hdr_buf_size,
+ __in unsigned int pld_buf_size);
+#endif /* EFSYS_OPT_RX_HDR_SPLIT */
+
+#if EFSYS_OPT_RX_SCATTER
+static __checkReturn int
+falconsiena_rx_scatter_enable(
+ __in efx_nic_t *enp,
+ __in unsigned int buf_size);
+#endif /* EFSYS_OPT_RX_SCATTER */
+
+#if EFSYS_OPT_RX_SCALE
+static __checkReturn int
+falconsiena_rx_scale_mode_set(
+ __in efx_nic_t *enp,
+ __in efx_rx_hash_alg_t alg,
+ __in efx_rx_hash_type_t type,
+ __in boolean_t insert);
+
+static __checkReturn int
+falconsiena_rx_scale_key_set(
+ __in efx_nic_t *enp,
+ __in_ecount(n) uint8_t *key,
+ __in size_t n);
+
+static __checkReturn int
+falconsiena_rx_scale_tbl_set(
+ __in efx_nic_t *enp,
+ __in_ecount(n) unsigned int *table,
+ __in size_t n);
+
+#endif /* EFSYS_OPT_RX_SCALE */
+
+static void
+falconsiena_rx_qpost(
+ __in efx_rxq_t *erp,
+ __in_ecount(n) efsys_dma_addr_t *addrp,
+ __in size_t size,
+ __in unsigned int n,
+ __in unsigned int completed,
+ __in unsigned int added);
+
+static void
+falconsiena_rx_qpush(
+ __in efx_rxq_t *erp,
+ __in unsigned int added,
+ __inout unsigned int *pushedp);
+
+static __checkReturn int
+falconsiena_rx_qflush(
+ __in efx_rxq_t *erp);
+
+static void
+falconsiena_rx_qenable(
+ __in efx_rxq_t *erp);
+
+static __checkReturn int
+falconsiena_rx_qcreate(
+ __in efx_nic_t *enp,
+ __in unsigned int index,
+ __in unsigned int label,
+ __in efx_rxq_type_t type,
+ __in efsys_mem_t *esmp,
+ __in size_t n,
+ __in uint32_t id,
+ __in efx_evq_t *eep,
+ __in efx_rxq_t *erp);
+
+static void
+falconsiena_rx_qdestroy(
+ __in efx_rxq_t *erp);
+
+#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */
+
+
+#if EFSYS_OPT_FALCON
+static efx_rx_ops_t __efx_rx_falcon_ops = {
+ falconsiena_rx_init, /* erxo_init */
+ falconsiena_rx_fini, /* erxo_fini */
+#if EFSYS_OPT_RX_HDR_SPLIT
+ falconsiena_rx_hdr_split_enable, /* erxo_hdr_split_enable */
+#endif
+#if EFSYS_OPT_RX_SCATTER
+ falconsiena_rx_scatter_enable, /* erxo_scatter_enable */
+#endif
+#if EFSYS_OPT_RX_SCALE
+ falconsiena_rx_scale_mode_set, /* erxo_scale_mode_set */
+ falconsiena_rx_scale_key_set, /* erxo_scale_key_set */
+ falconsiena_rx_scale_tbl_set, /* erxo_scale_tbl_set */
+#endif
+ falconsiena_rx_qpost, /* erxo_qpost */
+ falconsiena_rx_qpush, /* erxo_qpush */
+ falconsiena_rx_qflush, /* erxo_qflush */
+ falconsiena_rx_qenable, /* erxo_qenable */
+ falconsiena_rx_qcreate, /* erxo_qcreate */
+ falconsiena_rx_qdestroy, /* erxo_qdestroy */
+};
+#endif /* EFSYS_OPT_FALCON */
+
+#if EFSYS_OPT_SIENA
+static efx_rx_ops_t __efx_rx_siena_ops = {
+ falconsiena_rx_init, /* erxo_init */
+ falconsiena_rx_fini, /* erxo_fini */
+#if EFSYS_OPT_RX_HDR_SPLIT
+ falconsiena_rx_hdr_split_enable, /* erxo_hdr_split_enable */
+#endif
+#if EFSYS_OPT_RX_SCATTER
+ falconsiena_rx_scatter_enable, /* erxo_scatter_enable */
+#endif
+#if EFSYS_OPT_RX_SCALE
+ falconsiena_rx_scale_mode_set, /* erxo_scale_mode_set */
+ falconsiena_rx_scale_key_set, /* erxo_scale_key_set */
+ falconsiena_rx_scale_tbl_set, /* erxo_scale_tbl_set */
+#endif
+ falconsiena_rx_qpost, /* erxo_qpost */
+ falconsiena_rx_qpush, /* erxo_qpush */
+ falconsiena_rx_qflush, /* erxo_qflush */
+ falconsiena_rx_qenable, /* erxo_qenable */
+ falconsiena_rx_qcreate, /* erxo_qcreate */
+ falconsiena_rx_qdestroy, /* erxo_qdestroy */
+};
+#endif /* EFSYS_OPT_SIENA */
+
+#if EFSYS_OPT_HUNTINGTON
+static efx_rx_ops_t __efx_rx_hunt_ops = {
+ hunt_rx_init, /* erxo_init */
+ hunt_rx_fini, /* erxo_fini */
+#if EFSYS_OPT_RX_HDR_SPLIT
+ hunt_rx_hdr_split_enable, /* erxo_hdr_split_enable */
+#endif
+#if EFSYS_OPT_RX_SCATTER
+ hunt_rx_scatter_enable, /* erxo_scatter_enable */
+#endif
+#if EFSYS_OPT_RX_SCALE
+ hunt_rx_scale_mode_set, /* erxo_scale_mode_set */
+ hunt_rx_scale_key_set, /* erxo_scale_key_set */
+ hunt_rx_scale_tbl_set, /* erxo_scale_tbl_set */
+#endif
+ hunt_rx_qpost, /* erxo_qpost */
+ hunt_rx_qpush, /* erxo_qpush */
+ hunt_rx_qflush, /* erxo_qflush */
+ hunt_rx_qenable, /* erxo_qenable */
+ hunt_rx_qcreate, /* erxo_qcreate */
+ hunt_rx_qdestroy, /* erxo_qdestroy */
+};
+#endif /* EFSYS_OPT_HUNTINGTON */
+
+
__checkReturn int
efx_rx_init(
- __in efx_nic_t *enp)
+ __inout efx_nic_t *enp)
{
- efx_oword_t oword;
- unsigned int index;
+ efx_rx_ops_t *erxop;
int rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -53,6 +220,471 @@ efx_rx_init(
goto fail2;
}
+ switch (enp->en_family) {
+#if EFSYS_OPT_FALCON
+ case EFX_FAMILY_FALCON:
+ erxop = (efx_rx_ops_t *)&__efx_rx_falcon_ops;
+ break;
+#endif /* EFSYS_OPT_FALCON */
+
+#if EFSYS_OPT_SIENA
+ case EFX_FAMILY_SIENA:
+ erxop = (efx_rx_ops_t *)&__efx_rx_siena_ops;
+ break;
+#endif /* EFSYS_OPT_SIENA */
+
+#if EFSYS_OPT_HUNTINGTON
+ case EFX_FAMILY_HUNTINGTON:
+ erxop = (efx_rx_ops_t *)&__efx_rx_hunt_ops;
+ break;
+#endif /* EFSYS_OPT_HUNTINGTON */
+
+ default:
+ EFSYS_ASSERT(0);
+ rc = ENOTSUP;
+ goto fail3;
+ }
+
+ if ((rc = erxop->erxo_init(enp)) != 0)
+ goto fail4;
+
+ enp->en_erxop = erxop;
+ enp->en_mod_flags |= EFX_MOD_RX;
+ return (0);
+
+fail4:
+ EFSYS_PROBE(fail4);
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ enp->en_erxop = NULL;
+ enp->en_mod_flags &= ~EFX_MOD_RX;
+ return (rc);
+}
+
+ void
+efx_rx_fini(
+ __in efx_nic_t *enp)
+{
+ efx_rx_ops_t *erxop = enp->en_erxop;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
+ EFSYS_ASSERT3U(enp->en_rx_qcount, ==, 0);
+
+ erxop->erxo_fini(enp);
+
+ enp->en_erxop = NULL;
+ enp->en_mod_flags &= ~EFX_MOD_RX;
+}
+
+#if EFSYS_OPT_RX_HDR_SPLIT
+ __checkReturn int
+efx_rx_hdr_split_enable(
+ __in efx_nic_t *enp,
+ __in unsigned int hdr_buf_size,
+ __in unsigned int pld_buf_size)
+{
+ efx_rx_ops_t *erxop = enp->en_erxop;
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
+ EFSYS_ASSERT3U(enp->en_family, >=, EFX_FAMILY_SIENA);
+
+ if ((rc = erxop->erxo_hdr_split_enable(enp, hdr_buf_size,
+ pld_buf_size)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+ return (rc);
+}
+#endif /* EFSYS_OPT_RX_HDR_SPLIT */
+
+#if EFSYS_OPT_RX_SCATTER
+ __checkReturn int
+efx_rx_scatter_enable(
+ __in efx_nic_t *enp,
+ __in unsigned int buf_size)
+{
+ efx_rx_ops_t *erxop = enp->en_erxop;
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
+
+ if ((rc = erxop->erxo_scatter_enable(enp, buf_size)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+ return (rc);
+}
+#endif /* EFSYS_OPT_RX_SCATTER */
+
+#if EFSYS_OPT_RX_SCALE
+ __checkReturn int
+efx_rx_hash_support_get(
+ __in efx_nic_t *enp,
+ __out efx_rx_hash_support_t *supportp)
+{
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
+
+ if (supportp == NULL) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ /* Report if resources are available to insert RX hash value */
+ *supportp = enp->en_hash_support;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+efx_rx_scale_support_get(
+ __in efx_nic_t *enp,
+ __out efx_rx_scale_support_t *supportp)
+{
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
+
+ if (supportp == NULL) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ /* Report if resources are available to support RSS */
+ *supportp = enp->en_rss_support;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+efx_rx_scale_mode_set(
+ __in efx_nic_t *enp,
+ __in efx_rx_hash_alg_t alg,
+ __in efx_rx_hash_type_t type,
+ __in boolean_t insert)
+{
+ efx_rx_ops_t *erxop = enp->en_erxop;
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
+
+ if (erxop->erxo_scale_mode_set != NULL) {
+ if ((rc = erxop->erxo_scale_mode_set(enp, alg,
+ type, insert)) != 0)
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+ return (rc);
+}
+#endif /* EFSYS_OPT_RX_SCALE */
+
+#if EFSYS_OPT_RX_SCALE
+ __checkReturn int
+efx_rx_scale_key_set(
+ __in efx_nic_t *enp,
+ __in_ecount(n) uint8_t *key,
+ __in size_t n)
+{
+ efx_rx_ops_t *erxop = enp->en_erxop;
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
+
+ if ((rc = erxop->erxo_scale_key_set(enp, key, n)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+#endif /* EFSYS_OPT_RX_SCALE */
+
+#if EFSYS_OPT_RX_SCALE
+ __checkReturn int
+efx_rx_scale_tbl_set(
+ __in efx_nic_t *enp,
+ __in_ecount(n) unsigned int *table,
+ __in size_t n)
+{
+ efx_rx_ops_t *erxop = enp->en_erxop;
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
+
+ if ((rc = erxop->erxo_scale_tbl_set(enp, table, n)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+#endif /* EFSYS_OPT_RX_SCALE */
+
+ void
+efx_rx_qpost(
+ __in efx_rxq_t *erp,
+ __in_ecount(n) efsys_dma_addr_t *addrp,
+ __in size_t size,
+ __in unsigned int n,
+ __in unsigned int completed,
+ __in unsigned int added)
+{
+ efx_nic_t *enp = erp->er_enp;
+ efx_rx_ops_t *erxop = enp->en_erxop;
+
+ EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC);
+
+ erxop->erxo_qpost(erp, addrp, size, n, completed, added);
+}
+
+ void
+efx_rx_qpush(
+ __in efx_rxq_t *erp,
+ __in unsigned int added,
+ __inout unsigned int *pushedp)
+{
+ efx_nic_t *enp = erp->er_enp;
+ efx_rx_ops_t *erxop = enp->en_erxop;
+
+ EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC);
+
+ erxop->erxo_qpush(erp, added, pushedp);
+}
+
+ __checkReturn int
+efx_rx_qflush(
+ __in efx_rxq_t *erp)
+{
+ efx_nic_t *enp = erp->er_enp;
+ efx_rx_ops_t *erxop = enp->en_erxop;
+ int rc;
+
+ EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC);
+
+ if ((rc = erxop->erxo_qflush(erp)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ void
+efx_rx_qenable(
+ __in efx_rxq_t *erp)
+{
+ efx_nic_t *enp = erp->er_enp;
+ efx_rx_ops_t *erxop = enp->en_erxop;
+
+ EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC);
+
+ erxop->erxo_qenable(erp);
+}
+
+ __checkReturn int
+efx_rx_qcreate(
+ __in efx_nic_t *enp,
+ __in unsigned int index,
+ __in unsigned int label,
+ __in efx_rxq_type_t type,
+ __in efsys_mem_t *esmp,
+ __in size_t n,
+ __in uint32_t id,
+ __in efx_evq_t *eep,
+ __deref_out efx_rxq_t **erpp)
+{
+ efx_rx_ops_t *erxop = enp->en_erxop;
+ efx_rxq_t *erp;
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
+
+ /* Allocate an RXQ object */
+ EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (efx_rxq_t), erp);
+
+ if (erp == NULL) {
+ rc = ENOMEM;
+ goto fail1;
+ }
+
+ erp->er_magic = EFX_RXQ_MAGIC;
+ erp->er_enp = enp;
+ erp->er_index = index;
+ erp->er_mask = n - 1;
+ erp->er_esmp = esmp;
+
+ if ((rc = erxop->erxo_qcreate(enp, index, label, type, esmp, n, id,
+ eep, erp)) != 0)
+ goto fail2;
+
+ enp->en_rx_qcount++;
+ *erpp = erp;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+
+ EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_rxq_t), erp);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ void
+efx_rx_qdestroy(
+ __in efx_rxq_t *erp)
+{
+ efx_nic_t *enp = erp->er_enp;
+ efx_rx_ops_t *erxop = enp->en_erxop;
+
+ EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC);
+
+ erxop->erxo_qdestroy(erp);
+}
+
+/*
+ * Psuedo-header info for Siena/Falcon.
+ *
+ * The psuedo-header is a byte array of one of the forms:
+ *
+ * 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+ * XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.TT.TT.TT.TT
+ * XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.LL.LL
+ *
+ * where:
+ *
+ * TT.TT.TT.TT is a 32-bit Toeplitz hash
+ * LL.LL is a 16-bit LFSR hash
+ *
+ * Hash values are in network (big-endian) byte order.
+ *
+ *
+ * On Huntington the pseudo-header is laid out as:
+ * (See also SF-109306-TC section 9)
+ *
+ * Toeplitz hash (32 bits, little-endian)
+ * Out-of-band outer VLAN tag
+ * (16 bits, big-endian, 0 if the packet did not have an outer VLAN tag)
+ * Out-of-band inner VLAN tag
+ * (16 bits, big-endian, 0 if the packet did not have an inner VLAN tag)
+ * Packet length (16 bits, little-endian, may be 0)
+ * MAC timestamp (32 bits, little-endian, may be 0)
+ * VLAN tag
+ * (16 bits, big-endian, 0 if the packet did not have an outer VLAN tag)
+ * VLAN tag
+ * (16 bits, big-endian, 0 if the packet did not have an inner VLAN tag)
+ */
+
+ __checkReturn int
+efx_psuedo_hdr_pkt_length_get(
+ __in efx_nic_t *enp,
+ __in uint8_t *buffer,
+ __out uint16_t *pkt_lengthp)
+{
+ if (enp->en_family != EFX_FAMILY_HUNTINGTON) {
+ EFSYS_ASSERT(0);
+ return (ENOTSUP);
+ }
+
+ *pkt_lengthp = buffer[8] | (buffer[9] << 8);
+
+ return (0);
+}
+
+#if EFSYS_OPT_RX_SCALE
+
+uint32_t
+efx_psuedo_hdr_hash_get(
+ __in efx_nic_t *enp,
+ __in efx_rx_hash_alg_t func,
+ __in uint8_t *buffer)
+{
+ if (func == EFX_RX_HASHALG_TOEPLITZ) {
+ switch (enp->en_family) {
+ case EFX_FAMILY_FALCON:
+ case EFX_FAMILY_SIENA:
+ return ((buffer[12] << 24) |
+ (buffer[13] << 16) |
+ (buffer[14] << 8) |
+ buffer[15]);
+ case EFX_FAMILY_HUNTINGTON:
+ return (buffer[0] |
+ (buffer[1] << 8) |
+ (buffer[2] << 16) |
+ (buffer[3] << 24));
+ default:
+ EFSYS_ASSERT(0);
+ return (0);
+ }
+ } else if (func == EFX_RX_HASHALG_LFSR) {
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_FALCON ||
+ enp->en_family == EFX_FAMILY_SIENA);
+ return ((buffer[14] << 8) | buffer[15]);
+ } else {
+ EFSYS_ASSERT(0);
+ return (0);
+ }
+}
+
+#endif /* EFSYS_OPT_RX_SCALE */
+
+#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
+
+static __checkReturn int
+falconsiena_rx_init(
+ __in efx_nic_t *enp)
+{
+ efx_oword_t oword;
+ unsigned int index;
+
EFX_BAR_READO(enp, FR_AZ_RX_CFG_REG, &oword);
EFX_SET_OWORD_FIELD(oword, FRF_BZ_RX_DESC_PUSH_EN, 0);
@@ -68,23 +700,23 @@ efx_rx_init(
index++) {
EFX_ZERO_OWORD(oword);
EFX_BAR_TBL_WRITEO(enp, FR_BZ_RX_INDIRECTION_TBL,
- index, &oword);
+ index, &oword, B_TRUE);
}
- enp->en_mod_flags |= EFX_MOD_RX;
- return (0);
+#if EFSYS_OPT_RX_SCALE
+ /* The RSS key and indirection table are writable. */
+ enp->en_rss_support = EFX_RX_SCALE_EXCLUSIVE;
-fail2:
- EFSYS_PROBE(fail2);
-fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ /* Hardware can insert RX hash with/without RSS */
+ enp->en_hash_support = EFX_RX_HASH_AVAILABLE;
+#endif /* EFSYS_OPT_RX_SCALE */
- return (rc);
+ return (0);
}
#if EFSYS_OPT_RX_HDR_SPLIT
- __checkReturn int
-efx_rx_hdr_split_enable(
+static __checkReturn int
+falconsiena_rx_hdr_split_enable(
__in efx_nic_t *enp,
__in unsigned int hdr_buf_size,
__in unsigned int pld_buf_size)
@@ -94,10 +726,6 @@ efx_rx_hdr_split_enable(
efx_oword_t oword;
int rc;
- EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
- EFSYS_ASSERT3U(enp->en_family, >=, EFX_FAMILY_SIENA);
-
nhdr32 = hdr_buf_size / 32;
if ((nhdr32 == 0) ||
(nhdr32 >= (1 << FRF_CZ_RX_HDR_SPLIT_HDR_BUF_SIZE_WIDTH)) ||
@@ -140,10 +768,9 @@ fail1:
}
#endif /* EFSYS_OPT_RX_HDR_SPLIT */
-
#if EFSYS_OPT_RX_SCATTER
- __checkReturn int
-efx_rx_scatter_enable(
+static __checkReturn int
+falconsiena_rx_scatter_enable(
__in efx_nic_t *enp,
__in unsigned int buf_size)
{
@@ -151,10 +778,6 @@ efx_rx_scatter_enable(
efx_oword_t oword;
int rc;
- EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
- EFSYS_ASSERT3U(enp->en_family, >=, EFX_FAMILY_FALCON);
-
nbuf32 = buf_size / 32;
if ((nbuf32 == 0) ||
(nbuf32 >= (1 << FRF_BZ_RX_USR_BUF_SIZE_WIDTH)) ||
@@ -191,7 +814,7 @@ fail1:
#define EFX_RX_LFSR_HASH(_enp, _insert) \
- do { \
+ do { \
efx_oword_t oword; \
\
EFX_BAR_READO((_enp), FR_AZ_RX_CFG_REG, &oword); \
@@ -215,7 +838,7 @@ fail1:
} while (B_FALSE)
#define EFX_RX_TOEPLITZ_IPV4_HASH(_enp, _insert, _ip, _tcp) \
- do { \
+ do { \
efx_oword_t oword; \
\
EFX_BAR_READO((_enp), FR_AZ_RX_CFG_REG, &oword); \
@@ -232,7 +855,7 @@ fail1:
} while (B_FALSE)
#define EFX_RX_TOEPLITZ_IPV6_HASH(_enp, _ip, _tcp, _rc) \
- do { \
+ do { \
efx_oword_t oword; \
\
if ((_enp)->en_family == EFX_FAMILY_FALCON) { \
@@ -256,8 +879,9 @@ fail1:
#if EFSYS_OPT_RX_SCALE
- __checkReturn int
-efx_rx_scale_mode_set(
+
+static __checkReturn int
+falconsiena_rx_scale_mode_set(
__in efx_nic_t *enp,
__in efx_rx_hash_alg_t alg,
__in efx_rx_hash_type_t type,
@@ -265,10 +889,6 @@ efx_rx_scale_mode_set(
{
int rc;
- EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
- EFSYS_ASSERT3U(enp->en_family, >=, EFX_FAMILY_FALCON);
-
switch (alg) {
case EFX_RX_HASHALG_LFSR:
EFX_RX_LFSR_HASH(enp, insert);
@@ -307,8 +927,8 @@ fail1:
#endif
#if EFSYS_OPT_RX_SCALE
- __checkReturn int
-efx_rx_scale_toeplitz_ipv4_key_set(
+static __checkReturn int
+falconsiena_rx_scale_key_set(
__in efx_nic_t *enp,
__in_ecount(n) uint8_t *key,
__in size_t n)
@@ -318,12 +938,9 @@ efx_rx_scale_toeplitz_ipv4_key_set(
unsigned int offset;
int rc;
- EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
-
byte = 0;
- /* Write toeplitz hash key */
+ /* Write Toeplitz IPv4 hash key */
EFX_ZERO_OWORD(oword);
for (offset = (FRF_BZ_RX_RSS_TKEY_LBN + FRF_BZ_RX_RSS_TKEY_WIDTH) / 8;
offset > 0 && byte < n;
@@ -334,7 +951,7 @@ efx_rx_scale_toeplitz_ipv4_key_set(
byte = 0;
- /* Verify toeplitz hash key */
+ /* Verify Toeplitz IPv4 hash key */
EFX_BAR_READO(enp, FR_BZ_RX_RSS_TKEY_REG, &oword);
for (offset = (FRF_BZ_RX_RSS_TKEY_LBN + FRF_BZ_RX_RSS_TKEY_WIDTH) / 8;
offset > 0 && byte < n;
@@ -345,33 +962,14 @@ efx_rx_scale_toeplitz_ipv4_key_set(
}
}
- return (0);
+ if ((enp->en_features & EFX_FEATURE_IPV6) == 0)
+ goto done;
-fail1:
- EFSYS_PROBE1(fail1, int, rc);
-
- return (rc);
-}
-#endif
-
-#if EFSYS_OPT_RX_SCALE
- __checkReturn int
-efx_rx_scale_toeplitz_ipv6_key_set(
- __in efx_nic_t *enp,
- __in_ecount(n) uint8_t *key,
- __in size_t n)
-{
- efx_oword_t oword;
- unsigned int byte;
- int offset;
- int rc;
-
- EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
+ EFSYS_ASSERT3U(enp->en_family, !=, EFX_FAMILY_FALCON);
byte = 0;
- /* Write toeplitz hash key 3 */
+ /* Write Toeplitz IPv6 hash key 3 */
EFX_BAR_READO(enp, FR_CZ_RX_RSS_IPV6_REG3, &oword);
for (offset = (FRF_CZ_RX_RSS_IPV6_TKEY_HI_LBN +
FRF_CZ_RX_RSS_IPV6_TKEY_HI_WIDTH) / 8;
@@ -381,7 +979,7 @@ efx_rx_scale_toeplitz_ipv6_key_set(
EFX_BAR_WRITEO(enp, FR_CZ_RX_RSS_IPV6_REG3, &oword);
- /* Write toeplitz hash key 2 */
+ /* Write Toeplitz IPv6 hash key 2 */
EFX_ZERO_OWORD(oword);
for (offset = (FRF_CZ_RX_RSS_IPV6_TKEY_MID_LBN +
FRF_CZ_RX_RSS_IPV6_TKEY_MID_WIDTH) / 8;
@@ -391,7 +989,7 @@ efx_rx_scale_toeplitz_ipv6_key_set(
EFX_BAR_WRITEO(enp, FR_CZ_RX_RSS_IPV6_REG2, &oword);
- /* Write toeplitz hash key 1 */
+ /* Write Toeplitz IPv6 hash key 1 */
EFX_ZERO_OWORD(oword);
for (offset = (FRF_CZ_RX_RSS_IPV6_TKEY_LO_LBN +
FRF_CZ_RX_RSS_IPV6_TKEY_LO_WIDTH) / 8;
@@ -403,7 +1001,7 @@ efx_rx_scale_toeplitz_ipv6_key_set(
byte = 0;
- /* Verify toeplitz hash key 3 */
+ /* Verify Toeplitz IPv6 hash key 3 */
EFX_BAR_READO(enp, FR_CZ_RX_RSS_IPV6_REG3, &oword);
for (offset = (FRF_CZ_RX_RSS_IPV6_TKEY_HI_LBN +
FRF_CZ_RX_RSS_IPV6_TKEY_HI_WIDTH) / 8;
@@ -411,11 +1009,11 @@ efx_rx_scale_toeplitz_ipv6_key_set(
--offset) {
if (oword.eo_u8[offset - 1] != key[byte++]) {
rc = EFAULT;
- goto fail1;
+ goto fail2;
}
}
- /* Verify toeplitz hash key 2 */
+ /* Verify Toeplitz IPv6 hash key 2 */
EFX_BAR_READO(enp, FR_CZ_RX_RSS_IPV6_REG2, &oword);
for (offset = (FRF_CZ_RX_RSS_IPV6_TKEY_MID_LBN +
FRF_CZ_RX_RSS_IPV6_TKEY_MID_WIDTH) / 8;
@@ -423,11 +1021,11 @@ efx_rx_scale_toeplitz_ipv6_key_set(
--offset) {
if (oword.eo_u8[offset - 1] != key[byte++]) {
rc = EFAULT;
- goto fail2;
+ goto fail3;
}
}
- /* Verify toeplitz hash key 1 */
+ /* Verify Toeplitz IPv6 hash key 1 */
EFX_BAR_READO(enp, FR_CZ_RX_RSS_IPV6_REG1, &oword);
for (offset = (FRF_CZ_RX_RSS_IPV6_TKEY_LO_LBN +
FRF_CZ_RX_RSS_IPV6_TKEY_LO_WIDTH) / 8;
@@ -435,12 +1033,15 @@ efx_rx_scale_toeplitz_ipv6_key_set(
--offset) {
if (oword.eo_u8[offset - 1] != key[byte++]) {
rc = EFAULT;
- goto fail3;
+ goto fail4;
}
}
+done:
return (0);
+fail4:
+ EFSYS_PROBE(fail4);
fail3:
EFSYS_PROBE(fail3);
fail2:
@@ -453,8 +1054,8 @@ fail1:
#endif
#if EFSYS_OPT_RX_SCALE
- __checkReturn int
-efx_rx_scale_tbl_set(
+static __checkReturn int
+falconsiena_rx_scale_tbl_set(
__in efx_nic_t *enp,
__in_ecount(n) unsigned int *table,
__in size_t n)
@@ -463,9 +1064,6 @@ efx_rx_scale_tbl_set(
int index;
int rc;
- EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
-
EFX_STATIC_ASSERT(EFX_RSS_TBL_SIZE == FR_BZ_RX_INDIRECTION_TBL_ROWS);
EFX_STATIC_ASSERT(EFX_MAXRSS == (1 << FRF_BZ_IT_QUEUE_WIDTH));
@@ -478,7 +1076,7 @@ efx_rx_scale_tbl_set(
uint32_t byte;
/* Calculate the entry to place in the table */
- byte = (uint32_t)table[index % n];
+ byte = (n > 0) ? (uint32_t)table[index % n] : 0;
EFSYS_PROBE2(table, int, index, uint32_t, byte);
@@ -486,18 +1084,18 @@ efx_rx_scale_tbl_set(
/* Write the table */
EFX_BAR_TBL_WRITEO(enp, FR_BZ_RX_INDIRECTION_TBL,
- index, &oword);
+ index, &oword, B_TRUE);
}
for (index = FR_BZ_RX_INDIRECTION_TBL_ROWS - 1; index >= 0; --index) {
uint32_t byte;
/* Determine if we're starting a new batch */
- byte = (uint32_t)table[index % n];
+ byte = (n > 0) ? (uint32_t)table[index % n] : 0;
/* Read the table */
EFX_BAR_TBL_READO(enp, FR_BZ_RX_INDIRECTION_TBL,
- index, &oword);
+ index, &oword, B_TRUE);
/* Verify the entry */
if (EFX_OWORD_FIELD(oword, FRF_BZ_IT_QUEUE) != byte) {
@@ -517,36 +1115,8 @@ fail1:
}
#endif
-#if EFSYS_OPT_FILTER
-extern __checkReturn int
-efx_rx_filter_insert(
- __in efx_rxq_t *erp,
- __inout efx_filter_spec_t *spec)
-{
- EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC);
- EFSYS_ASSERT3P(spec, !=, NULL);
-
- spec->efs_dmaq_id = (uint16_t)erp->er_index;
- return (efx_filter_insert_filter(erp->er_enp, spec, B_FALSE));
-}
-#endif
-
-#if EFSYS_OPT_FILTER
-extern __checkReturn int
-efx_rx_filter_remove(
- __in efx_rxq_t *erp,
- __inout efx_filter_spec_t *spec)
-{
- EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC);
- EFSYS_ASSERT3P(spec, !=, NULL);
-
- spec->efs_dmaq_id = (uint16_t)erp->er_index;
- return (efx_filter_remove_filter(erp->er_enp, spec));
-}
-#endif
-
-extern void
-efx_rx_qpost(
+static void
+falconsiena_rx_qpost(
__in efx_rxq_t *erp,
__in_ecount(n) efsys_dma_addr_t *addrp,
__in size_t size,
@@ -559,8 +1129,6 @@ efx_rx_qpost(
unsigned int offset;
unsigned int id;
- EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC);
-
/* The client driver must not overfill the queue */
EFSYS_ASSERT3U(added - completed + n, <=,
EFX_RXQ_LIMIT(erp->er_mask + 1));
@@ -585,20 +1153,20 @@ efx_rx_qpost(
}
}
- void
-efx_rx_qpush(
+static void
+falconsiena_rx_qpush(
__in efx_rxq_t *erp,
- __in unsigned int added)
+ __in unsigned int added,
+ __inout unsigned int *pushedp)
{
efx_nic_t *enp = erp->er_enp;
+ unsigned int pushed = *pushedp;
uint32_t wptr;
efx_oword_t oword;
efx_dword_t dword;
- EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC);
-
- /* Guarantee ordering of memory (descriptors) and PIO (doorbell) */
- EFSYS_PIO_WRITE_BARRIER();
+ /* All descriptors are pushed */
+ *pushedp = added;
/* Push the populated descriptors out */
wptr = added & erp->er_mask;
@@ -608,30 +1176,35 @@ efx_rx_qpush(
/* Only write the third DWORD */
EFX_POPULATE_DWORD_1(dword,
EFX_DWORD_0, EFX_OWORD_FIELD(oword, EFX_DWORD_3));
+
+ /* Guarantee ordering of memory (descriptors) and PIO (doorbell) */
+ EFX_DMA_SYNC_QUEUE_FOR_DEVICE(erp->er_esmp, erp->er_mask + 1,
+ wptr, pushed & erp->er_mask);
+ EFSYS_PIO_WRITE_BARRIER();
EFX_BAR_TBL_WRITED3(enp, FR_BZ_RX_DESC_UPD_REGP0,
erp->er_index, &dword, B_FALSE);
}
- void
-efx_rx_qflush(
+static __checkReturn int
+falconsiena_rx_qflush(
__in efx_rxq_t *erp)
{
efx_nic_t *enp = erp->er_enp;
efx_oword_t oword;
uint32_t label;
- EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC);
-
label = erp->er_index;
/* Flush the queue */
EFX_POPULATE_OWORD_2(oword, FRF_AZ_RX_FLUSH_DESCQ_CMD, 1,
FRF_AZ_RX_FLUSH_DESCQ, label);
EFX_BAR_WRITEO(enp, FR_AZ_RX_FLUSH_DESCQ_REG, &oword);
+
+ return (0);
}
- void
-efx_rx_qenable(
+static void
+falconsiena_rx_qenable(
__in efx_rxq_t *erp)
{
efx_nic_t *enp = erp->er_enp;
@@ -640,18 +1213,18 @@ efx_rx_qenable(
EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC);
EFX_BAR_TBL_READO(enp, FR_AZ_RX_DESC_PTR_TBL,
- erp->er_index, &oword);
+ erp->er_index, &oword, B_TRUE);
EFX_SET_OWORD_FIELD(oword, FRF_AZ_RX_DC_HW_RPTR, 0);
EFX_SET_OWORD_FIELD(oword, FRF_AZ_RX_DESCQ_HW_RPTR, 0);
EFX_SET_OWORD_FIELD(oword, FRF_AZ_RX_DESCQ_EN, 1);
EFX_BAR_TBL_WRITEO(enp, FR_AZ_RX_DESC_PTR_TBL,
- erp->er_index, &oword);
+ erp->er_index, &oword, B_TRUE);
}
- __checkReturn int
-efx_rx_qcreate(
+static __checkReturn int
+falconsiena_rx_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
__in unsigned int label,
@@ -660,25 +1233,24 @@ efx_rx_qcreate(
__in size_t n,
__in uint32_t id,
__in efx_evq_t *eep,
- __deref_out efx_rxq_t **erpp)
+ __in efx_rxq_t *erp)
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
- efx_rxq_t *erp;
efx_oword_t oword;
uint32_t size;
boolean_t split;
boolean_t jumbo;
int rc;
- EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
-
EFX_STATIC_ASSERT(EFX_EV_RX_NLABELS ==
(1 << FRF_AZ_RX_DESCQ_LABEL_WIDTH));
EFSYS_ASSERT3U(label, <, EFX_EV_RX_NLABELS);
EFSYS_ASSERT3U(enp->en_rx_qcount + 1, <, encp->enc_rxq_limit);
- if (!ISP2(n) || !(n & EFX_RXQ_NDESCS_MASK)) {
+ EFX_STATIC_ASSERT(ISP2(EFX_RXQ_MAXNDESCS));
+ EFX_STATIC_ASSERT(ISP2(EFX_RXQ_MINNDESCS));
+
+ if (!ISP2(n) || (n < EFX_RXQ_MINNDESCS) || (n > EFX_RXQ_MAXNDESCS)) {
rc = EINVAL;
goto fail1;
}
@@ -737,20 +1309,6 @@ efx_rx_qcreate(
goto fail4;
}
- /* Allocate an RXQ object */
- EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (efx_rxq_t), erp);
-
- if (erp == NULL) {
- rc = ENOMEM;
- goto fail5;
- }
-
- erp->er_magic = EFX_RXQ_MAGIC;
- erp->er_enp = enp;
- erp->er_index = index;
- erp->er_mask = n - 1;
- erp->er_esmp = esmp;
-
/* Set up the new descriptor queue */
EFX_POPULATE_OWORD_10(oword,
FRF_CZ_RX_HDR_SPLIT, split,
@@ -765,14 +1323,10 @@ efx_rx_qcreate(
FRF_AZ_RX_DESCQ_JUMBO, jumbo);
EFX_BAR_TBL_WRITEO(enp, FR_AZ_RX_DESC_PTR_TBL,
- erp->er_index, &oword);
+ erp->er_index, &oword, B_TRUE);
- enp->en_rx_qcount++;
- *erpp = erp;
return (0);
-fail5:
- EFSYS_PROBE(fail5);
fail4:
EFSYS_PROBE(fail4);
fail3:
@@ -785,15 +1339,13 @@ fail1:
return (rc);
}
- void
-efx_rx_qdestroy(
+static void
+falconsiena_rx_qdestroy(
__in efx_rxq_t *erp)
{
efx_nic_t *enp = erp->er_enp;
efx_oword_t oword;
- EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC);
-
EFSYS_ASSERT(enp->en_rx_qcount != 0);
--enp->en_rx_qcount;
@@ -801,20 +1353,17 @@ efx_rx_qdestroy(
EFX_ZERO_OWORD(oword);
EFX_BAR_TBL_WRITEO(enp, FR_AZ_RX_DESC_PTR_TBL,
- erp->er_index, &oword);
+ erp->er_index, &oword, B_TRUE);
/* Free the RXQ object */
EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_rxq_t), erp);
}
- void
-efx_rx_fini(
+static void
+falconsiena_rx_fini(
__in efx_nic_t *enp)
{
- EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
- EFSYS_ASSERT3U(enp->en_rx_qcount, ==, 0);
-
- enp->en_mod_flags &= ~EFX_MOD_RX;
+ _NOTE(ARGUNUSED(enp))
}
+
+#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */
diff --git a/sys/dev/sfxge/common/efx_sram.c b/sys/dev/sfxge/common/efx_sram.c
index f081adf..4bd951b 100644
--- a/sys/dev/sfxge/common/efx_sram.c
+++ b/sys/dev/sfxge/common/efx_sram.c
@@ -1,26 +1,31 @@
/*-
- * Copyright 2007-2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2007-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -50,6 +55,21 @@ efx_sram_buf_tbl_set(
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC);
+#if EFSYS_OPT_HUNTINGTON
+ if (enp->en_family == EFX_FAMILY_HUNTINGTON) {
+ /*
+ * FIXME: the efx_sram_buf_tbl_*() functionality needs to be
+ * pulled inside the Falcon/Siena queue create/destroy code,
+ * and then the original functions can be removed (see bug30834
+ * comment #1). But, for now, we just ensure that they are
+ * no-ops for Huntington, to allow bringing up existing drivers
+ * without modification.
+ */
+
+ return (0);
+ }
+#endif /* EFSYS_OPT_HUNTINGTON */
+
if (stop >= EFX_BUF_TBL_SIZE) {
rc = EFBIG;
goto fail1;
@@ -156,6 +176,21 @@ efx_sram_buf_tbl_clear(
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC);
+#if EFSYS_OPT_HUNTINGTON
+ if (enp->en_family == EFX_FAMILY_HUNTINGTON) {
+ /*
+ * FIXME: the efx_sram_buf_tbl_*() functionality needs to be
+ * pulled inside the Falcon/Siena queue create/destroy code,
+ * and then the original functions can be removed (see bug30834
+ * comment #1). But, for now, we just ensure that they are
+ * no-ops for Huntington, to allow bringing up existing drivers
+ * without modification.
+ */
+
+ return;
+ }
+#endif /* EFSYS_OPT_HUNTINGTON */
+
EFSYS_ASSERT3U(stop, <, EFX_BUF_TBL_SIZE);
EFSYS_PROBE2(buf, uint32_t, start, uint32_t, stop - 1);
@@ -262,7 +297,7 @@ efx_sram_bit_sweep_set(
}
}
-efx_sram_pattern_fn_t __cs __efx_sram_pattern_fns[] = {
+efx_sram_pattern_fn_t __efx_sram_pattern_fns[] = {
efx_sram_byte_increment_set,
efx_sram_all_the_same_set,
efx_sram_bit_alternate_set,
diff --git a/sys/dev/sfxge/common/efx_tx.c b/sys/dev/sfxge/common/efx_tx.c
index 2b0f5e5..a2e8769 100644
--- a/sys/dev/sfxge/common/efx_tx.c
+++ b/sys/dev/sfxge/common/efx_tx.c
@@ -1,26 +1,31 @@
/*-
- * Copyright 2007-2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2007-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -42,11 +47,166 @@ __FBSDID("$FreeBSD$");
#define EFX_TX_QSTAT_INCR(_etp, _stat)
#endif
+#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
+
+static __checkReturn int
+falconsiena_tx_init(
+ __in efx_nic_t *enp);
+
+static void
+falconsiena_tx_fini(
+ __in efx_nic_t *enp);
+
+static __checkReturn int
+falconsiena_tx_qcreate(
+ __in efx_nic_t *enp,
+ __in unsigned int index,
+ __in unsigned int label,
+ __in efsys_mem_t *esmp,
+ __in size_t n,
+ __in uint32_t id,
+ __in uint16_t flags,
+ __in efx_evq_t *eep,
+ __in efx_txq_t *etp,
+ __out unsigned int *addedp);
+
+static void
+falconsiena_tx_qdestroy(
+ __in efx_txq_t *etp);
+
+static __checkReturn int
+falconsiena_tx_qpost(
+ __in efx_txq_t *etp,
+ __in_ecount(n) efx_buffer_t *eb,
+ __in unsigned int n,
+ __in unsigned int completed,
+ __inout unsigned int *addedp);
+
+static void
+falconsiena_tx_qpush(
+ __in efx_txq_t *etp,
+ __in unsigned int added,
+ __in unsigned int pushed);
+
+static __checkReturn int
+falconsiena_tx_qpace(
+ __in efx_txq_t *etp,
+ __in unsigned int ns);
+
+static __checkReturn int
+falconsiena_tx_qflush(
+ __in efx_txq_t *etp);
+
+static void
+falconsiena_tx_qenable(
+ __in efx_txq_t *etp);
+
+ __checkReturn int
+falconsiena_tx_qdesc_post(
+ __in efx_txq_t *etp,
+ __in_ecount(n) efx_desc_t *ed,
+ __in unsigned int n,
+ __in unsigned int completed,
+ __inout unsigned int *addedp);
+
+ void
+falconsiena_tx_qdesc_dma_create(
+ __in efx_txq_t *etp,
+ __in efsys_dma_addr_t addr,
+ __in size_t size,
+ __in boolean_t eop,
+ __out efx_desc_t *edp);
+
+#if EFSYS_OPT_QSTATS
+static void
+falconsiena_tx_qstats_update(
+ __in efx_txq_t *etp,
+ __inout_ecount(TX_NQSTATS) efsys_stat_t *stat);
+#endif
+
+#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */
+
+
+#if EFSYS_OPT_FALCON
+static efx_tx_ops_t __efx_tx_falcon_ops = {
+ falconsiena_tx_init, /* etxo_init */
+ falconsiena_tx_fini, /* etxo_fini */
+ falconsiena_tx_qcreate, /* etxo_qcreate */
+ falconsiena_tx_qdestroy, /* etxo_qdestroy */
+ falconsiena_tx_qpost, /* etxo_qpost */
+ falconsiena_tx_qpush, /* etxo_qpush */
+ falconsiena_tx_qpace, /* etxo_qpace */
+ falconsiena_tx_qflush, /* etxo_qflush */
+ falconsiena_tx_qenable, /* etxo_qenable */
+ NULL, /* etxo_qpio_enable */
+ NULL, /* etxo_qpio_disable */
+ NULL, /* etxo_qpio_write */
+ NULL, /* etxo_qpio_post */
+ falconsiena_tx_qdesc_post, /* etxo_qdesc_post */
+ falconsiena_tx_qdesc_dma_create, /* etxo_qdesc_dma_create */
+ NULL, /* etxo_qdesc_tso_create */
+ NULL, /* etxo_qdesc_vlantci_create */
+#if EFSYS_OPT_QSTATS
+ falconsiena_tx_qstats_update, /* etxo_qstats_update */
+#endif
+};
+#endif /* EFSYS_OPT_FALCON */
+
+#if EFSYS_OPT_SIENA
+static efx_tx_ops_t __efx_tx_siena_ops = {
+ falconsiena_tx_init, /* etxo_init */
+ falconsiena_tx_fini, /* etxo_fini */
+ falconsiena_tx_qcreate, /* etxo_qcreate */
+ falconsiena_tx_qdestroy, /* etxo_qdestroy */
+ falconsiena_tx_qpost, /* etxo_qpost */
+ falconsiena_tx_qpush, /* etxo_qpush */
+ falconsiena_tx_qpace, /* etxo_qpace */
+ falconsiena_tx_qflush, /* etxo_qflush */
+ falconsiena_tx_qenable, /* etxo_qenable */
+ NULL, /* etxo_qpio_enable */
+ NULL, /* etxo_qpio_disable */
+ NULL, /* etxo_qpio_write */
+ NULL, /* etxo_qpio_post */
+ falconsiena_tx_qdesc_post, /* etxo_qdesc_post */
+ falconsiena_tx_qdesc_dma_create, /* etxo_qdesc_dma_create */
+ NULL, /* etxo_qdesc_tso_create */
+ NULL, /* etxo_qdesc_vlantci_create */
+#if EFSYS_OPT_QSTATS
+ falconsiena_tx_qstats_update, /* etxo_qstats_update */
+#endif
+};
+#endif /* EFSYS_OPT_SIENA */
+
+#if EFSYS_OPT_HUNTINGTON
+static efx_tx_ops_t __efx_tx_hunt_ops = {
+ hunt_tx_init, /* etxo_init */
+ hunt_tx_fini, /* etxo_fini */
+ hunt_tx_qcreate, /* etxo_qcreate */
+ hunt_tx_qdestroy, /* etxo_qdestroy */
+ hunt_tx_qpost, /* etxo_qpost */
+ hunt_tx_qpush, /* etxo_qpush */
+ hunt_tx_qpace, /* etxo_qpace */
+ hunt_tx_qflush, /* etxo_qflush */
+ hunt_tx_qenable, /* etxo_qenable */
+ hunt_tx_qpio_enable, /* etxo_qpio_enable */
+ hunt_tx_qpio_disable, /* etxo_qpio_disable */
+ hunt_tx_qpio_write, /* etxo_qpio_write */
+ hunt_tx_qpio_post, /* etxo_qpio_post */
+ hunt_tx_qdesc_post, /* etxo_qdesc_post */
+ hunt_tx_qdesc_dma_create, /* etxo_qdesc_dma_create */
+ hunt_tx_qdesc_tso_create, /* etxo_qdesc_tso_create */
+ hunt_tx_qdesc_vlantci_create, /* etxo_qdesc_vlantci_create */
+#if EFSYS_OPT_QSTATS
+ hunt_tx_qstats_update, /* etxo_qstats_update */
+#endif
+};
+#endif /* EFSYS_OPT_HUNTINGTON */
+
__checkReturn int
efx_tx_init(
__in efx_nic_t *enp)
{
- efx_oword_t oword;
+ efx_tx_ops_t *etxop;
int rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -62,8 +222,436 @@ efx_tx_init(
goto fail2;
}
+ switch (enp->en_family) {
+#if EFSYS_OPT_FALCON
+ case EFX_FAMILY_FALCON:
+ etxop = (efx_tx_ops_t *)&__efx_tx_falcon_ops;
+ break;
+#endif /* EFSYS_OPT_FALCON */
+
+#if EFSYS_OPT_SIENA
+ case EFX_FAMILY_SIENA:
+ etxop = (efx_tx_ops_t *)&__efx_tx_siena_ops;
+ break;
+#endif /* EFSYS_OPT_SIENA */
+
+#if EFSYS_OPT_HUNTINGTON
+ case EFX_FAMILY_HUNTINGTON:
+ etxop = (efx_tx_ops_t *)&__efx_tx_hunt_ops;
+ break;
+#endif /* EFSYS_OPT_HUNTINGTON */
+
+ default:
+ EFSYS_ASSERT(0);
+ rc = ENOTSUP;
+ goto fail3;
+ }
+
EFSYS_ASSERT3U(enp->en_tx_qcount, ==, 0);
+ if ((rc = etxop->etxo_init(enp)) != 0)
+ goto fail4;
+
+ enp->en_etxop = etxop;
+ enp->en_mod_flags |= EFX_MOD_TX;
+ return (0);
+
+fail4:
+ EFSYS_PROBE(fail4);
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ enp->en_etxop = NULL;
+ enp->en_mod_flags &= ~EFX_MOD_TX;
+ return (rc);
+}
+
+ void
+efx_tx_fini(
+ __in efx_nic_t *enp)
+{
+ efx_tx_ops_t *etxop = enp->en_etxop;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TX);
+ EFSYS_ASSERT3U(enp->en_tx_qcount, ==, 0);
+
+ etxop->etxo_fini(enp);
+
+ enp->en_etxop = NULL;
+ enp->en_mod_flags &= ~EFX_MOD_TX;
+}
+
+ __checkReturn int
+efx_tx_qcreate(
+ __in efx_nic_t *enp,
+ __in unsigned int index,
+ __in unsigned int label,
+ __in efsys_mem_t *esmp,
+ __in size_t n,
+ __in uint32_t id,
+ __in uint16_t flags,
+ __in efx_evq_t *eep,
+ __deref_out efx_txq_t **etpp,
+ __out unsigned int *addedp)
+{
+ efx_tx_ops_t *etxop = enp->en_etxop;
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+ efx_txq_t *etp;
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TX);
+
+ EFSYS_ASSERT3U(enp->en_tx_qcount + 1, <, encp->enc_txq_limit);
+
+ /* Allocate an TXQ object */
+ EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (efx_txq_t), etp);
+
+ if (etp == NULL) {
+ rc = ENOMEM;
+ goto fail1;
+ }
+
+ etp->et_magic = EFX_TXQ_MAGIC;
+ etp->et_enp = enp;
+ etp->et_index = index;
+ etp->et_mask = n - 1;
+ etp->et_esmp = esmp;
+
+ /* Initial descriptor index may be modified by etxo_qcreate */
+ *addedp = 0;
+
+ if ((rc = etxop->etxo_qcreate(enp, index, label, esmp,
+ n, id, flags, eep, etp, addedp)) != 0)
+ goto fail2;
+
+ enp->en_tx_qcount++;
+ *etpp = etp;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+ EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_txq_t), etp);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+ return (rc);
+}
+
+ void
+efx_tx_qdestroy(
+ __in efx_txq_t *etp)
+{
+ efx_nic_t *enp = etp->et_enp;
+ efx_tx_ops_t *etxop = enp->en_etxop;
+
+ EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
+
+ EFSYS_ASSERT(enp->en_tx_qcount != 0);
+ --enp->en_tx_qcount;
+
+ etxop->etxo_qdestroy(etp);
+
+ /* Free the TXQ object */
+ EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_txq_t), etp);
+}
+
+ __checkReturn int
+efx_tx_qpost(
+ __in efx_txq_t *etp,
+ __in_ecount(n) efx_buffer_t *eb,
+ __in unsigned int n,
+ __in unsigned int completed,
+ __inout unsigned int *addedp)
+{
+ efx_nic_t *enp = etp->et_enp;
+ efx_tx_ops_t *etxop = enp->en_etxop;
+ int rc;
+
+ EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
+
+ if ((rc = etxop->etxo_qpost(etp, eb,
+ n, completed, addedp)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+ return (rc);
+}
+
+ void
+efx_tx_qpush(
+ __in efx_txq_t *etp,
+ __in unsigned int added,
+ __in unsigned int pushed)
+{
+ efx_nic_t *enp = etp->et_enp;
+ efx_tx_ops_t *etxop = enp->en_etxop;
+
+ EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
+
+ etxop->etxo_qpush(etp, added, pushed);
+}
+
+ __checkReturn int
+efx_tx_qpace(
+ __in efx_txq_t *etp,
+ __in unsigned int ns)
+{
+ efx_nic_t *enp = etp->et_enp;
+ efx_tx_ops_t *etxop = enp->en_etxop;
+ int rc;
+
+ EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
+
+ if ((rc = etxop->etxo_qpace(etp, ns)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+ return (rc);
+}
+
+ __checkReturn int
+efx_tx_qflush(
+ __in efx_txq_t *etp)
+{
+ efx_nic_t *enp = etp->et_enp;
+ efx_tx_ops_t *etxop = enp->en_etxop;
+ int rc;
+
+ EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
+
+ if ((rc = etxop->etxo_qflush(etp)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+ return (rc);
+}
+
+ void
+efx_tx_qenable(
+ __in efx_txq_t *etp)
+{
+ efx_nic_t *enp = etp->et_enp;
+ efx_tx_ops_t *etxop = enp->en_etxop;
+
+ EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
+
+ etxop->etxo_qenable(etp);
+}
+
+ __checkReturn int
+efx_tx_qpio_enable(
+ __in efx_txq_t *etp)
+{
+ efx_nic_t *enp = etp->et_enp;
+ efx_tx_ops_t *etxop = enp->en_etxop;
+ int rc;
+
+ EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
+
+ if (~enp->en_features & EFX_FEATURE_PIO_BUFFERS) {
+ rc = ENOTSUP;
+ goto fail1;
+ }
+ if (etxop->etxo_qpio_enable == NULL) {
+ rc = ENOTSUP;
+ goto fail2;
+ }
+ if ((rc = etxop->etxo_qpio_enable(etp)) != 0)
+ goto fail3;
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+ return (rc);
+}
+
+ void
+efx_tx_qpio_disable(
+ __in efx_txq_t *etp)
+{
+ efx_nic_t *enp = etp->et_enp;
+ efx_tx_ops_t *etxop = enp->en_etxop;
+
+ EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
+
+ if (etxop->etxo_qpio_disable != NULL)
+ etxop->etxo_qpio_disable(etp);
+}
+
+ __checkReturn int
+efx_tx_qpio_write(
+ __in efx_txq_t *etp,
+ __in_ecount(buf_length) uint8_t *buffer,
+ __in size_t buf_length,
+ __in size_t pio_buf_offset)
+{
+ efx_nic_t *enp = etp->et_enp;
+ efx_tx_ops_t *etxop = enp->en_etxop;
+ int rc;
+
+ EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
+
+ if (etxop->etxo_qpio_write != NULL) {
+ if ((rc = etxop->etxo_qpio_write(etp, buffer, buf_length,
+ pio_buf_offset)) != 0)
+ goto fail1;
+ return (0);
+ }
+
+ return (ENOTSUP);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+ return (rc);
+}
+
+ __checkReturn int
+efx_tx_qpio_post(
+ __in efx_txq_t *etp,
+ __in size_t pkt_length,
+ __in unsigned int completed,
+ __inout unsigned int *addedp)
+{
+ efx_nic_t *enp = etp->et_enp;
+ efx_tx_ops_t *etxop = enp->en_etxop;
+ int rc;
+
+ EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
+
+ if (etxop->etxo_qpio_post != NULL) {
+ if ((rc = etxop->etxo_qpio_post(etp, pkt_length, completed,
+ addedp)) != 0)
+ goto fail1;
+ return (0);
+ }
+
+ return (ENOTSUP);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+ return (rc);
+}
+
+ __checkReturn int
+efx_tx_qdesc_post(
+ __in efx_txq_t *etp,
+ __in_ecount(n) efx_desc_t *ed,
+ __in unsigned int n,
+ __in unsigned int completed,
+ __inout unsigned int *addedp)
+{
+ efx_nic_t *enp = etp->et_enp;
+ efx_tx_ops_t *etxop = enp->en_etxop;
+ int rc;
+
+ EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
+
+ if ((rc = etxop->etxo_qdesc_post(etp, ed,
+ n, completed, addedp)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+ return (rc);
+}
+
+ void
+efx_tx_qdesc_dma_create(
+ __in efx_txq_t *etp,
+ __in efsys_dma_addr_t addr,
+ __in size_t size,
+ __in boolean_t eop,
+ __out efx_desc_t *edp)
+{
+ efx_nic_t *enp = etp->et_enp;
+ efx_tx_ops_t *etxop = enp->en_etxop;
+
+ EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
+ EFSYS_ASSERT(etxop->etxo_qdesc_dma_create != NULL);
+
+ etxop->etxo_qdesc_dma_create(etp, addr, size, eop, edp);
+}
+
+ void
+efx_tx_qdesc_tso_create(
+ __in efx_txq_t *etp,
+ __in uint16_t ipv4_id,
+ __in uint32_t tcp_seq,
+ __in uint8_t tcp_flags,
+ __out efx_desc_t *edp)
+{
+ efx_nic_t *enp = etp->et_enp;
+ efx_tx_ops_t *etxop = enp->en_etxop;
+
+ EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
+ EFSYS_ASSERT(etxop->etxo_qdesc_tso_create != NULL);
+
+ etxop->etxo_qdesc_tso_create(etp, ipv4_id, tcp_seq, tcp_flags, edp);
+}
+
+ void
+efx_tx_qdesc_vlantci_create(
+ __in efx_txq_t *etp,
+ __in uint16_t tci,
+ __out efx_desc_t *edp)
+{
+ efx_nic_t *enp = etp->et_enp;
+ efx_tx_ops_t *etxop = enp->en_etxop;
+
+ EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
+ EFSYS_ASSERT(etxop->etxo_qdesc_vlantci_create != NULL);
+
+ etxop->etxo_qdesc_vlantci_create(etp, tci, edp);
+}
+
+
+#if EFSYS_OPT_QSTATS
+ void
+efx_tx_qstats_update(
+ __in efx_txq_t *etp,
+ __inout_ecount(TX_NQSTATS) efsys_stat_t *stat)
+{
+ efx_nic_t *enp = etp->et_enp;
+ efx_tx_ops_t *etxop = enp->en_etxop;
+
+ EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
+
+ etxop->etxo_qstats_update(etp, stat);
+}
+#endif
+
+
+#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
+
+static __checkReturn int
+falconsiena_tx_init(
+ __in efx_nic_t *enp)
+{
+ efx_oword_t oword;
+
/*
* Disable the timer-based TX DMA backoff and allow TX DMA to be
* controlled by the RX FIFO fill level (although always allow a
@@ -93,44 +681,8 @@ efx_tx_init(
EFX_SET_OWORD_FIELD(oword, FRF_AZ_TX_NO_EOP_DISC_EN, 0);
EFX_BAR_WRITEO(enp, FR_AZ_TX_CFG_REG, &oword);
- enp->en_mod_flags |= EFX_MOD_TX;
return (0);
-
-fail2:
- EFSYS_PROBE(fail2);
-fail1:
- EFSYS_PROBE1(fail1, int, rc);
-
- return (rc);
-}
-
-#if EFSYS_OPT_FILTER
-extern __checkReturn int
-efx_tx_filter_insert(
- __in efx_txq_t *etp,
- __inout efx_filter_spec_t *spec)
-{
- EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
- EFSYS_ASSERT3P(spec, !=, NULL);
-
- spec->efs_dmaq_id = (uint16_t)etp->et_index;
- return (efx_filter_insert_filter(etp->et_enp, spec, B_FALSE));
-}
-#endif
-
-#if EFSYS_OPT_FILTER
-extern __checkReturn int
-efx_tx_filter_remove(
- __in efx_txq_t *etp,
- __inout efx_filter_spec_t *spec)
-{
- EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
- EFSYS_ASSERT3P(spec, !=, NULL);
-
- spec->efs_dmaq_id = (uint16_t)etp->et_index;
- return (efx_filter_remove_filter(etp->et_enp, spec));
}
-#endif
#define EFX_TX_DESC(_etp, _addr, _size, _eop, _added) \
do { \
@@ -157,8 +709,8 @@ efx_tx_filter_remove(
_NOTE(CONSTANTCONDITION) \
} while (B_FALSE)
- __checkReturn int
-efx_tx_qpost(
+static __checkReturn int
+falconsiena_tx_qpost(
__in efx_txq_t *etp,
__in_ecount(n) efx_buffer_t *eb,
__in unsigned int n,
@@ -169,8 +721,6 @@ efx_tx_qpost(
unsigned int i;
int rc = ENOSPC;
- EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
-
if (added - completed + n > EFX_TXQ_LIMIT(etp->et_mask + 1))
goto fail1;
@@ -197,21 +747,17 @@ fail1:
return (rc);
}
- void
-efx_tx_qpush(
+static void
+falconsiena_tx_qpush(
__in efx_txq_t *etp,
- __in unsigned int added)
+ __in unsigned int added,
+ __in unsigned int pushed)
{
efx_nic_t *enp = etp->et_enp;
uint32_t wptr;
efx_dword_t dword;
efx_oword_t oword;
- EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
-
- /* Guarantee ordering of memory (descriptors) and PIO (doorbell) */
- EFSYS_PIO_WRITE_BARRIER();
-
/* Push the populated descriptors out */
wptr = added & etp->et_mask;
@@ -220,6 +766,11 @@ efx_tx_qpush(
/* Only write the third DWORD */
EFX_POPULATE_DWORD_1(dword,
EFX_DWORD_0, EFX_OWORD_FIELD(oword, EFX_DWORD_3));
+
+ /* Guarantee ordering of memory (descriptors) and PIO (doorbell) */
+ EFX_DMA_SYNC_QUEUE_FOR_DEVICE(etp->et_esmp, etp->et_mask + 1,
+ wptr, pushed & etp->et_mask);
+ EFSYS_PIO_WRITE_BARRIER();
EFX_BAR_TBL_WRITED3(enp, FR_BZ_TX_DESC_UPD_REGP0,
etp->et_index, &dword, B_FALSE);
}
@@ -227,8 +778,8 @@ efx_tx_qpush(
#define EFX_MAX_PACE_VALUE 20
#define EFX_TX_PACE_CLOCK_BASE 104
- __checkReturn int
-efx_tx_qpace(
+static __checkReturn int
+falconsiena_tx_qpace(
__in efx_txq_t *etp,
__in unsigned int ns)
{
@@ -239,8 +790,6 @@ efx_tx_qpace(
unsigned int timer_period;
int rc;
- EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
-
if (ns == 0) {
pace_val = 0;
} else {
@@ -261,7 +810,8 @@ efx_tx_qpace(
/* Update the pacing table */
EFX_POPULATE_OWORD_1(oword, FRF_AZ_TX_PACE, pace_val);
- EFX_BAR_TBL_WRITEO(enp, FR_AZ_TX_PACE_TBL, etp->et_index, &oword);
+ EFX_BAR_TBL_WRITEO(enp, FR_AZ_TX_PACE_TBL, etp->et_index,
+ &oword, B_TRUE);
return (0);
@@ -271,16 +821,14 @@ fail1:
return (rc);
}
- void
-efx_tx_qflush(
- __in efx_txq_t *etp)
+static __checkReturn int
+falconsiena_tx_qflush(
+ __in efx_txq_t *etp)
{
efx_nic_t *enp = etp->et_enp;
efx_oword_t oword;
uint32_t label;
- EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
-
efx_tx_qpace(etp, 0);
label = etp->et_index;
@@ -289,19 +837,19 @@ efx_tx_qflush(
EFX_POPULATE_OWORD_2(oword, FRF_AZ_TX_FLUSH_DESCQ_CMD, 1,
FRF_AZ_TX_FLUSH_DESCQ, label);
EFX_BAR_WRITEO(enp, FR_AZ_TX_FLUSH_DESCQ_REG, &oword);
+
+ return (0);
}
- void
-efx_tx_qenable(
+static void
+falconsiena_tx_qenable(
__in efx_txq_t *etp)
{
efx_nic_t *enp = etp->et_enp;
efx_oword_t oword;
- EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
-
EFX_BAR_TBL_READO(enp, FR_AZ_TX_DESC_PTR_TBL,
- etp->et_index, &oword);
+ etp->et_index, &oword, B_TRUE);
EFSYS_PROBE5(tx_descq_ptr, unsigned int, etp->et_index,
uint32_t, EFX_OWORD_FIELD(oword, EFX_DWORD_3),
@@ -314,11 +862,11 @@ efx_tx_qenable(
EFX_SET_OWORD_FIELD(oword, FRF_AZ_TX_DESCQ_EN, 1);
EFX_BAR_TBL_WRITEO(enp, FR_AZ_TX_DESC_PTR_TBL,
- etp->et_index, &oword);
+ etp->et_index, &oword, B_TRUE);
}
- __checkReturn int
-efx_tx_qcreate(
+static __checkReturn int
+falconsiena_tx_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
__in unsigned int label,
@@ -327,23 +875,22 @@ efx_tx_qcreate(
__in uint32_t id,
__in uint16_t flags,
__in efx_evq_t *eep,
- __deref_out efx_txq_t **etpp)
+ __in efx_txq_t *etp,
+ __out unsigned int *addedp)
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
- efx_txq_t *etp;
efx_oword_t oword;
uint32_t size;
int rc;
- EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TX);
-
EFX_STATIC_ASSERT(EFX_EV_TX_NLABELS ==
(1 << FRF_AZ_TX_DESCQ_LABEL_WIDTH));
EFSYS_ASSERT3U(label, <, EFX_EV_TX_NLABELS);
- EFSYS_ASSERT3U(enp->en_tx_qcount + 1, <, encp->enc_txq_limit);
- if (!ISP2(n) || !(n & EFX_TXQ_NDESCS_MASK)) {
+ EFSYS_ASSERT(ISP2(EFX_TXQ_MAXNDESCS(encp)));
+ EFX_STATIC_ASSERT(ISP2(EFX_TXQ_MINNDESCS));
+
+ if (!ISP2(n) || (n < EFX_TXQ_MINNDESCS) || (n > EFX_EVQ_MAXNEVS)) {
rc = EINVAL;
goto fail1;
}
@@ -351,7 +898,8 @@ efx_tx_qcreate(
rc = EINVAL;
goto fail2;
}
- for (size = 0; (1 << size) <= (EFX_TXQ_MAXNDESCS / EFX_TXQ_MINNDESCS);
+ for (size = 0;
+ (1 << size) <= (EFX_TXQ_MAXNDESCS(encp) / EFX_TXQ_MINNDESCS);
size++)
if ((1 << size) == (int)(n / EFX_TXQ_MINNDESCS))
break;
@@ -360,20 +908,6 @@ efx_tx_qcreate(
goto fail3;
}
- /* Allocate an TXQ object */
- EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (efx_txq_t), etp);
-
- if (etp == NULL) {
- rc = ENOMEM;
- goto fail4;
- }
-
- etp->et_magic = EFX_TXQ_MAGIC;
- etp->et_enp = enp;
- etp->et_index = index;
- etp->et_mask = n - 1;
- etp->et_esmp = esmp;
-
/* Set up the new descriptor queue */
EFX_POPULATE_OWORD_6(oword,
FRF_AZ_TX_DESCQ_BUF_BASE_ID, id,
@@ -390,14 +924,10 @@ efx_tx_qcreate(
(flags & EFX_CKSUM_TCPUDP) ? 0 : 1);
EFX_BAR_TBL_WRITEO(enp, FR_AZ_TX_DESC_PTR_TBL,
- etp->et_index, &oword);
+ etp->et_index, &oword, B_TRUE);
- enp->en_tx_qcount++;
- *etpp = etp;
return (0);
-fail4:
- EFSYS_PROBE(fail4);
fail3:
EFSYS_PROBE(fail3);
fail2:
@@ -408,16 +938,83 @@ fail1:
return (rc);
}
+ __checkReturn int
+falconsiena_tx_qdesc_post(
+ __in efx_txq_t *etp,
+ __in_ecount(n) efx_desc_t *ed,
+ __in unsigned int n,
+ __in unsigned int completed,
+ __inout unsigned int *addedp)
+{
+ unsigned int added = *addedp;
+ unsigned int i;
+ int rc;
+
+ if (added - completed + n > EFX_TXQ_LIMIT(etp->et_mask + 1)) {
+ rc = ENOSPC;
+ goto fail1;
+ }
+
+ for (i = 0; i < n; i++) {
+ efx_desc_t *edp = &ed[i];
+ unsigned int id;
+ size_t offset;
+
+ id = added++ & etp->et_mask;
+ offset = id * sizeof (efx_desc_t);
+
+ EFSYS_MEM_WRITEQ(etp->et_esmp, offset, &edp->ed_eq);
+ }
+
+ EFSYS_PROBE3(tx_desc_post, unsigned int, etp->et_index,
+ unsigned int, added, unsigned int, n);
+
+ EFX_TX_QSTAT_INCR(etp, TX_POST);
+
+ *addedp = added;
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+ return (rc);
+}
+
+ void
+falconsiena_tx_qdesc_dma_create(
+ __in efx_txq_t *etp,
+ __in efsys_dma_addr_t addr,
+ __in size_t size,
+ __in boolean_t eop,
+ __out efx_desc_t *edp)
+{
+ /* Fragments must not span 4k boundaries. */
+ EFSYS_ASSERT(P2ROUNDUP(addr + 1, 4096) >= addr + size);
+
+ EFSYS_PROBE4(tx_desc_dma_create, unsigned int, etp->et_index,
+ efsys_dma_addr_t, addr,
+ size_t, size, boolean_t, eop);
+
+ EFX_POPULATE_QWORD_4(edp->ed_eq,
+ FSF_AZ_TX_KER_CONT, eop ? 0 : 1,
+ FSF_AZ_TX_KER_BYTE_COUNT, (uint32_t)size,
+ FSF_AZ_TX_KER_BUF_ADDR_DW0,
+ (uint32_t)(addr & 0xffffffff),
+ FSF_AZ_TX_KER_BUF_ADDR_DW1,
+ (uint32_t)(addr >> 32));
+}
+
+#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */
+
#if EFSYS_OPT_QSTATS
#if EFSYS_OPT_NAMES
-/* START MKCONFIG GENERATED EfxTransmitQueueStatNamesBlock 78ca9ab00287fffb */
-static const char __cs * __cs __efx_tx_qstat_name[] = {
+/* START MKCONFIG GENERATED EfxTransmitQueueStatNamesBlock 9d8d26a0a5e2c453 */
+static const char *__efx_tx_qstat_name[] = {
"post",
- "unaligned_split",
+ "post_pio",
};
/* END MKCONFIG GENERATED EfxTransmitQueueStatNamesBlock */
- const char __cs *
+ const char *
efx_tx_qstat_name(
__in efx_nic_t *enp,
__in unsigned int id)
@@ -429,18 +1026,18 @@ efx_tx_qstat_name(
return (__efx_tx_qstat_name[id]);
}
#endif /* EFSYS_OPT_NAMES */
-#endif /* EFSYS_OPT_QSTATS */
+#endif /* EFSYS_OPT_QSTATS */
+
+#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
#if EFSYS_OPT_QSTATS
- void
-efx_tx_qstats_update(
+static void
+falconsiena_tx_qstats_update(
__in efx_txq_t *etp,
__inout_ecount(TX_NQSTATS) efsys_stat_t *stat)
{
unsigned int id;
- EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
-
for (id = 0; id < TX_NQSTATS; id++) {
efsys_stat_t *essp = &stat[id];
@@ -450,36 +1047,25 @@ efx_tx_qstats_update(
}
#endif /* EFSYS_OPT_QSTATS */
- void
-efx_tx_qdestroy(
+static void
+falconsiena_tx_qdestroy(
__in efx_txq_t *etp)
{
efx_nic_t *enp = etp->et_enp;
efx_oword_t oword;
- EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
-
- EFSYS_ASSERT(enp->en_tx_qcount != 0);
- --enp->en_tx_qcount;
-
/* Purge descriptor queue */
EFX_ZERO_OWORD(oword);
EFX_BAR_TBL_WRITEO(enp, FR_AZ_TX_DESC_PTR_TBL,
- etp->et_index, &oword);
-
- /* Free the TXQ object */
- EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_txq_t), etp);
+ etp->et_index, &oword, B_TRUE);
}
- void
-efx_tx_fini(
+static void
+falconsiena_tx_fini(
__in efx_nic_t *enp)
{
- EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC);
- EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TX);
- EFSYS_ASSERT3U(enp->en_tx_qcount, ==, 0);
-
- enp->en_mod_flags &= ~EFX_MOD_TX;
+ _NOTE(ARGUNUSED(enp))
}
+
+#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */
diff --git a/sys/dev/sfxge/common/efx_types.h b/sys/dev/sfxge/common/efx_types.h
index 9fbaea1..ee357b1 100644
--- a/sys/dev/sfxge/common/efx_types.h
+++ b/sys/dev/sfxge/common/efx_types.h
@@ -1,26 +1,31 @@
/*-
- * Copyright 2007-2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2007-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*
* Ackowledgement to Fen Systems Ltd.
*
@@ -113,11 +118,10 @@ extern "C" {
#define EFX_DWORD_3_LBN 96
#define EFX_DWORD_3_WIDTH 32
-#define EFX_QWORD_0_LBN 0
-#define EFX_QWORD_0_WIDTH 64
-
-#define EFX_QWORD_1_LBN 64
-#define EFX_QWORD_1_WIDTH 64
+/* There are intentionally no EFX_QWORD_0 or EFX_QWORD_1 field definitions
+ * here as the implementaion of EFX_QWORD_FIELD and EFX_OWORD_FIELD do not
+ * support field widths larger than 32 bits.
+ */
/* Specified attribute (i.e. LBN ow WIDTH) of the specified field */
#define EFX_VAL(_field, _attribute) \
@@ -229,6 +233,9 @@ typedef union efx_oword_u {
efx_word_t eo_word[8];
efx_dword_t eo_dword[4];
efx_qword_t eo_qword[2];
+#if EFSYS_HAS_SSE2_M128
+ __m128i eo_u128[1];
+#endif
#if EFSYS_HAS_UINT64
uint64_t eo_u64[2];
#endif
@@ -891,11 +898,7 @@ extern int fix_lint;
#define EFX_ZERO_OWORD(_oword) \
EFX_POPULATE_OWORD_1(_oword, EFX_DUMMY_FIELD, 0)
-#define EFX_SET_OWORD64(_oword) \
- EFX_POPULATE_OWORD_2(_oword, \
- EFX_QWORD_0, (uint64_t)-1, EFX_QWORD_1, (uint64_t)-1)
-
-#define EFX_SET_OWORD32(_oword) \
+#define EFX_SET_OWORD(_oword) \
EFX_POPULATE_OWORD_4(_oword, \
EFX_DWORD_0, 0xffffffff, EFX_DWORD_1, 0xffffffff, \
EFX_DWORD_2, 0xffffffff, EFX_DWORD_3, 0xffffffff)
@@ -969,11 +972,7 @@ extern int fix_lint;
#define EFX_ZERO_QWORD(_qword) \
EFX_POPULATE_QWORD_1(_qword, EFX_DUMMY_FIELD, 0)
-#define EFX_SET_QWORD64(_qword) \
- EFX_POPULATE_QWORD_1(_qword, \
- EFX_QWORD_0, (uint64_t)-1)
-
-#define EFX_SET_QWORD32(_qword) \
+#define EFX_SET_QWORD(_qword) \
EFX_POPULATE_QWORD_2(_qword, \
EFX_DWORD_0, 0xffffffff, EFX_DWORD_1, 0xffffffff)
@@ -1380,6 +1379,23 @@ extern int fix_lint;
_NOTE(CONSTANTCONDITION) \
} while (B_FALSE)
+#define EFX_TEST_OWORD_BIT64(_oword, _bit) \
+ (((_oword).eo_u64[0] & \
+ __CPU_TO_LE_64(EFX_SHIFT64(_bit, FIX_LINT(0)))) || \
+ ((_oword).eo_u64[1] & \
+ __CPU_TO_LE_64(EFX_SHIFT64(_bit, FIX_LINT(64)))))
+
+#define EFX_TEST_OWORD_BIT32(_oword, _bit) \
+ (((_oword).eo_u32[0] & \
+ __CPU_TO_LE_32(EFX_SHIFT32(_bit, FIX_LINT(0)))) || \
+ ((_oword).eo_u32[1] & \
+ __CPU_TO_LE_32(EFX_SHIFT32(_bit, FIX_LINT(32)))) || \
+ ((_oword).eo_u32[2] & \
+ __CPU_TO_LE_32(EFX_SHIFT32(_bit, FIX_LINT(64)))) || \
+ ((_oword).eo_u32[3] & \
+ __CPU_TO_LE_32(EFX_SHIFT32(_bit, FIX_LINT(96)))))
+
+
#define EFX_SET_QWORD_BIT64(_qword, _bit) \
do { \
_NOTE(CONSTANTCONDITION) \
@@ -1416,6 +1432,17 @@ extern int fix_lint;
_NOTE(CONSTANTCONDITION) \
} while (B_FALSE)
+#define EFX_TEST_QWORD_BIT64(_qword, _bit) \
+ (((_qword).eq_u64[0] & \
+ __CPU_TO_LE_64(EFX_SHIFT64(_bit, FIX_LINT(0)))) != 0)
+
+#define EFX_TEST_QWORD_BIT32(_qword, _bit) \
+ (((_qword).eq_u32[0] & \
+ __CPU_TO_LE_32(EFX_SHIFT32(_bit, FIX_LINT(0)))) || \
+ ((_qword).eq_u32[1] & \
+ __CPU_TO_LE_32(EFX_SHIFT32(_bit, FIX_LINT(32)))))
+
+
#define EFX_SET_DWORD_BIT(_dword, _bit) \
do { \
(_dword).ed_u32[0] |= \
@@ -1430,6 +1457,11 @@ extern int fix_lint;
_NOTE(CONSTANTCONDITION) \
} while (B_FALSE)
+#define EFX_TEST_DWORD_BIT(_dword, _bit) \
+ (((_dword).ed_u32[0] & \
+ __CPU_TO_LE_32(EFX_SHIFT32(_bit, FIX_LINT(0)))) != 0)
+
+
#define EFX_SET_WORD_BIT(_word, _bit) \
do { \
(_word).ew_u16[0] |= \
@@ -1444,6 +1476,11 @@ extern int fix_lint;
_NOTE(CONSTANTCONDITION) \
} while (B_FALSE)
+#define EFX_TEST_WORD_BIT(_word, _bit) \
+ (((_word).ew_u16[0] & \
+ __CPU_TO_LE_16(EFX_SHIFT16(_bit, FIX_LINT(0)))) != 0)
+
+
#define EFX_SET_BYTE_BIT(_byte, _bit) \
do { \
(_byte).eb_u8[0] |= \
@@ -1458,6 +1495,11 @@ extern int fix_lint;
_NOTE(CONSTANTCONDITION) \
} while (B_FALSE)
+#define EFX_TEST_BYTE_BIT(_byte, _bit) \
+ (((_byte).eb_u8[0] & \
+ __NATIVE_8(EFX_SHIFT8(_bit, FIX_LINT(0)))) != 0)
+
+
#define EFX_OR_OWORD64(_oword1, _oword2) \
do { \
(_oword1).eo_u64[0] |= (_oword2).eo_u64[0]; \
@@ -1563,18 +1605,18 @@ extern int fix_lint;
#define EFX_QWORD_IS_SET EFX_QWORD_IS_SET64
#define EFX_POPULATE_OWORD EFX_POPULATE_OWORD64
#define EFX_POPULATE_QWORD EFX_POPULATE_QWORD64
-#define EFX_SET_OWORD EFX_SET_OWORD64
-#define EFX_SET_QWORD EFX_SET_QWORD64
#define EFX_SET_OWORD_FIELD EFX_SET_OWORD_FIELD64
#define EFX_SET_QWORD_FIELD EFX_SET_QWORD_FIELD64
#define EFX_SET_OWORD_BIT EFX_SET_OWORD_BIT64
#define EFX_CLEAR_OWORD_BIT EFX_CLEAR_OWORD_BIT64
+#define EFX_TEST_OWORD_BIT EFX_TEST_OWORD_BIT64
#define EFX_SET_QWORD_BIT EFX_SET_QWORD_BIT64
#define EFX_CLEAR_QWORD_BIT EFX_CLEAR_QWORD_BIT64
+#define EFX_TEST_QWORD_BIT EFX_TEST_QWORD_BIT64
#define EFX_OR_OWORD EFX_OR_OWORD64
#define EFX_AND_OWORD EFX_AND_OWORD64
#define EFX_OR_QWORD EFX_OR_QWORD64
-#define EFX_AND_QWORD EFX_OR_QWORD64
+#define EFX_AND_QWORD EFX_AND_QWORD64
#else
#define EFX_OWORD_FIELD EFX_OWORD_FIELD32
#define EFX_QWORD_FIELD EFX_QWORD_FIELD32
@@ -1586,18 +1628,18 @@ extern int fix_lint;
#define EFX_QWORD_IS_SET EFX_QWORD_IS_SET32
#define EFX_POPULATE_OWORD EFX_POPULATE_OWORD32
#define EFX_POPULATE_QWORD EFX_POPULATE_QWORD32
-#define EFX_SET_OWORD EFX_SET_OWORD32
-#define EFX_SET_QWORD EFX_SET_QWORD32
#define EFX_SET_OWORD_FIELD EFX_SET_OWORD_FIELD32
#define EFX_SET_QWORD_FIELD EFX_SET_QWORD_FIELD32
#define EFX_SET_OWORD_BIT EFX_SET_OWORD_BIT32
#define EFX_CLEAR_OWORD_BIT EFX_CLEAR_OWORD_BIT32
+#define EFX_TEST_OWORD_BIT EFX_TEST_OWORD_BIT32
#define EFX_SET_QWORD_BIT EFX_SET_QWORD_BIT32
#define EFX_CLEAR_QWORD_BIT EFX_CLEAR_QWORD_BIT32
+#define EFX_TEST_QWORD_BIT EFX_TEST_QWORD_BIT32
#define EFX_OR_OWORD EFX_OR_OWORD32
#define EFX_AND_OWORD EFX_AND_OWORD32
#define EFX_OR_QWORD EFX_OR_QWORD32
-#define EFX_AND_QWORD EFX_OR_QWORD32
+#define EFX_AND_QWORD EFX_AND_QWORD32
#endif
#ifdef __cplusplus
diff --git a/sys/dev/sfxge/common/efx_vpd.c b/sys/dev/sfxge/common/efx_vpd.c
index 399c056..812070a 100644
--- a/sys/dev/sfxge/common/efx_vpd.c
+++ b/sys/dev/sfxge/common/efx_vpd.c
@@ -1,26 +1,31 @@
/*-
- * Copyright 2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2009-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -54,7 +59,7 @@ __FBSDID("$FreeBSD$");
#if EFSYS_OPT_FALCON
-static efx_vpd_ops_t __cs __efx_vpd_falcon_ops = {
+static efx_vpd_ops_t __efx_vpd_falcon_ops = {
NULL, /* evpdo_init */
falcon_vpd_size, /* evpdo_size */
falcon_vpd_read, /* evpdo_read */
@@ -71,7 +76,7 @@ static efx_vpd_ops_t __cs __efx_vpd_falcon_ops = {
#if EFSYS_OPT_SIENA
-static efx_vpd_ops_t __cs __efx_vpd_siena_ops = {
+static efx_vpd_ops_t __efx_vpd_siena_ops = {
siena_vpd_init, /* evpdo_init */
siena_vpd_size, /* evpdo_size */
siena_vpd_read, /* evpdo_read */
@@ -86,6 +91,23 @@ static efx_vpd_ops_t __cs __efx_vpd_siena_ops = {
#endif /* EFSYS_OPT_SIENA */
+#if EFSYS_OPT_HUNTINGTON
+
+static efx_vpd_ops_t __efx_vpd_hunt_ops = {
+ hunt_vpd_init, /* evpdo_init */
+ hunt_vpd_size, /* evpdo_size */
+ hunt_vpd_read, /* evpdo_read */
+ hunt_vpd_verify, /* evpdo_verify */
+ hunt_vpd_reinit, /* evpdo_reinit */
+ hunt_vpd_get, /* evpdo_get */
+ hunt_vpd_set, /* evpdo_set */
+ hunt_vpd_next, /* evpdo_next */
+ hunt_vpd_write, /* evpdo_write */
+ hunt_vpd_fini, /* evpdo_fini */
+};
+
+#endif /* EFSYS_OPT_HUNTINGTON */
+
__checkReturn int
efx_vpd_init(
__in efx_nic_t *enp)
@@ -110,6 +132,12 @@ efx_vpd_init(
break;
#endif /* EFSYS_OPT_SIENA */
+#if EFSYS_OPT_HUNTINGTON
+ case EFX_FAMILY_HUNTINGTON:
+ evpdop = (efx_vpd_ops_t *)&__efx_vpd_hunt_ops;
+ break;
+#endif /* EFSYS_OPT_HUNTINGTON */
+
default:
EFSYS_ASSERT(0);
rc = ENOTSUP;
@@ -566,14 +594,14 @@ fail1:
return (rc);
}
-static uint8_t __cs __efx_vpd_blank_pid[] = {
+static uint8_t __efx_vpd_blank_pid[] = {
/* Large resource type ID length 1 */
0x82, 0x01, 0x00,
/* Product name ' ' */
0x32,
};
-static uint8_t __cs __efx_vpd_blank_r[] = {
+static uint8_t __efx_vpd_blank_r[] = {
/* Large resource type VPD-R length 4 */
0x90, 0x04, 0x00,
/* RV keyword length 1 */
@@ -584,7 +612,7 @@ static uint8_t __cs __efx_vpd_blank_r[] = {
__checkReturn int
efx_vpd_hunk_reinit(
- __in caddr_t data,
+ __in_bcount(size) caddr_t data,
__in size_t size,
__in boolean_t wantpid)
{
diff --git a/sys/dev/sfxge/common/efx_wol.c b/sys/dev/sfxge/common/efx_wol.c
index 89a80c7..2e1b4a1 100644
--- a/sys/dev/sfxge/common/efx_wol.c
+++ b/sys/dev/sfxge/common/efx_wol.c
@@ -1,26 +1,31 @@
/*-
- * Copyright 2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2009-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -67,17 +72,19 @@ efx_wol_filter_clear(
__in efx_nic_t *enp)
{
efx_mcdi_req_t req;
- uint8_t payload[MC_CMD_WOL_FILTER_RESET_IN_LEN];
+ uint8_t payload[MAX(MC_CMD_WOL_FILTER_RESET_IN_LEN,
+ MC_CMD_WOL_FILTER_RESET_OUT_LEN)];
int rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_WOL);
+ (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_WOL_FILTER_RESET;
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_WOL_FILTER_RESET_IN_LEN;
- req.emr_out_buf = NULL;
- req.emr_out_length = 0;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_WOL_FILTER_RESET_OUT_LEN;
MCDI_IN_SET_DWORD(req, WOL_FILTER_RESET_IN_MASK,
MC_CMD_WOL_FILTER_RESET_IN_WAKE_FILTERS |
@@ -114,8 +121,8 @@ efx_wol_filter_add(
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_WOL);
+ (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_WOL_FILTER_SET;
- (void) memset(payload, '\0', sizeof (payload));
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_WOL_FILTER_SET_IN_LEN;
req.emr_out_buf = payload;
@@ -226,18 +233,19 @@ efx_wol_filter_remove(
__in uint32_t filter_id)
{
efx_mcdi_req_t req;
- uint8_t payload[MC_CMD_WOL_FILTER_REMOVE_IN_LEN];
+ uint8_t payload[MAX(MC_CMD_WOL_FILTER_REMOVE_IN_LEN,
+ MC_CMD_WOL_FILTER_REMOVE_OUT_LEN)];
int rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_WOL);
+ (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_WOL_FILTER_REMOVE;
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_WOL_FILTER_REMOVE_IN_LEN;
- EFX_STATIC_ASSERT(MC_CMD_WOL_FILTER_REMOVE_OUT_LEN == 0);
- req.emr_out_buf = NULL;
- req.emr_out_length = 0;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_WOL_FILTER_REMOVE_OUT_LEN;
MCDI_IN_SET_DWORD(req, WOL_FILTER_REMOVE_IN_FILTER_ID, filter_id);
@@ -273,6 +281,7 @@ efx_lightsout_offload_add(
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_WOL);
+ (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_ADD_LIGHTSOUT_OFFLOAD;
req.emr_in_buf = payload;
req.emr_in_length = sizeof (type);
@@ -282,6 +291,7 @@ efx_lightsout_offload_add(
switch (type) {
case EFX_LIGHTSOUT_OFFLOAD_TYPE_ARP:
req.emr_in_length = MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_ARP_LEN;
+
MCDI_IN_SET_DWORD(req, ADD_LIGHTSOUT_OFFLOAD_IN_PROTOCOL,
MC_CMD_LIGHTSOUT_OFFLOAD_PROTOCOL_ARP);
EFX_MAC_ADDR_COPY(MCDI_IN2(req, uint8_t,
@@ -292,6 +302,7 @@ efx_lightsout_offload_add(
break;
case EFX_LIGHTSOUT_OFFLOAD_TYPE_NS:
req.emr_in_length = MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS_LEN;
+
MCDI_IN_SET_DWORD(req, ADD_LIGHTSOUT_OFFLOAD_IN_PROTOCOL,
MC_CMD_LIGHTSOUT_OFFLOAD_PROTOCOL_NS);
EFX_MAC_ADDR_COPY(MCDI_IN2(req, uint8_t,
@@ -305,25 +316,28 @@ efx_lightsout_offload_add(
paramp->elop_ns.ip, sizeof (paramp->elop_ns.ip));
break;
default:
- EFSYS_ASSERT3U(type, !=, type);
+ rc = EINVAL;
+ goto fail1;
}
efx_mcdi_execute(enp, &req);
if (req.emr_rc != 0) {
rc = req.emr_rc;
- goto fail1;
+ goto fail2;
}
if (req.emr_out_length_used < MC_CMD_ADD_LIGHTSOUT_OFFLOAD_OUT_LEN) {
rc = EMSGSIZE;
- goto fail2;
+ goto fail3;
}
*filter_idp = MCDI_OUT_DWORD(req, ADD_LIGHTSOUT_OFFLOAD_OUT_FILTER_ID);
return (0);
+fail3:
+ EFSYS_PROBE(fail3);
fail2:
EFSYS_PROBE(fail2);
fail1:
@@ -340,18 +354,19 @@ efx_lightsout_offload_remove(
__in uint32_t filter_id)
{
efx_mcdi_req_t req;
- uint8_t payload[MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_IN_LEN];
+ uint8_t payload[MAX(MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_IN_LEN,
+ MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_OUT_LEN)];
int rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_WOL);
+ (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD;
req.emr_in_buf = payload;
- req.emr_in_length = sizeof (payload);
- EFX_STATIC_ASSERT(MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_OUT_LEN == 0);
- req.emr_out_buf = NULL;
- req.emr_out_length = 0;
+ req.emr_in_length = MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_OUT_LEN;
switch (type) {
case EFX_LIGHTSOUT_OFFLOAD_TYPE_ARP:
@@ -363,7 +378,8 @@ efx_lightsout_offload_remove(
MC_CMD_LIGHTSOUT_OFFLOAD_PROTOCOL_NS);
break;
default:
- EFSYS_ASSERT3U(type, !=, type);
+ rc = EINVAL;
+ goto fail1;
}
MCDI_IN_SET_DWORD(req, REMOVE_LIGHTSOUT_OFFLOAD_IN_FILTER_ID,
@@ -373,11 +389,13 @@ efx_lightsout_offload_remove(
if (req.emr_rc != 0) {
rc = req.emr_rc;
- goto fail1;
+ goto fail2;
}
return (0);
+fail2:
+ EFSYS_PROBE(fail2);
fail1:
EFSYS_PROBE1(fail1, int, rc);
diff --git a/sys/dev/sfxge/common/hunt_ev.c b/sys/dev/sfxge/common/hunt_ev.c
new file mode 100644
index 0000000..8e5cf89
--- /dev/null
+++ b/sys/dev/sfxge/common/hunt_ev.c
@@ -0,0 +1,1010 @@
+/*-
+ * Copyright (c) 2012-2015 Solarflare Communications Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "efsys.h"
+#include "efx.h"
+#include "efx_types.h"
+#include "efx_regs.h"
+#include "efx_impl.h"
+#if EFSYS_OPT_MON_STATS
+#include "mcdi_mon.h"
+#endif
+
+#if EFSYS_OPT_HUNTINGTON
+
+#if EFSYS_OPT_QSTATS
+#define EFX_EV_QSTAT_INCR(_eep, _stat) \
+ do { \
+ (_eep)->ee_stat[_stat]++; \
+ _NOTE(CONSTANTCONDITION) \
+ } while (B_FALSE)
+#else
+#define EFX_EV_QSTAT_INCR(_eep, _stat)
+#endif
+
+
+static __checkReturn boolean_t
+hunt_ev_rx(
+ __in efx_evq_t *eep,
+ __in efx_qword_t *eqp,
+ __in const efx_ev_callbacks_t *eecp,
+ __in_opt void *arg);
+
+static __checkReturn boolean_t
+hunt_ev_tx(
+ __in efx_evq_t *eep,
+ __in efx_qword_t *eqp,
+ __in const efx_ev_callbacks_t *eecp,
+ __in_opt void *arg);
+
+static __checkReturn boolean_t
+hunt_ev_driver(
+ __in efx_evq_t *eep,
+ __in efx_qword_t *eqp,
+ __in const efx_ev_callbacks_t *eecp,
+ __in_opt void *arg);
+
+static __checkReturn boolean_t
+hunt_ev_drv_gen(
+ __in efx_evq_t *eep,
+ __in efx_qword_t *eqp,
+ __in const efx_ev_callbacks_t *eecp,
+ __in_opt void *arg);
+
+static __checkReturn boolean_t
+hunt_ev_mcdi(
+ __in efx_evq_t *eep,
+ __in efx_qword_t *eqp,
+ __in const efx_ev_callbacks_t *eecp,
+ __in_opt void *arg);
+
+
+static __checkReturn int
+efx_mcdi_init_evq(
+ __in efx_nic_t *enp,
+ __in unsigned int instance,
+ __in efsys_mem_t *esmp,
+ __in size_t nevs,
+ __in uint32_t irq,
+ __out_opt uint32_t *irqp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[
+ MAX(MC_CMD_INIT_EVQ_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)),
+ MC_CMD_INIT_EVQ_OUT_LEN)];
+ efx_qword_t *dma_addr;
+ uint64_t addr;
+ int npages;
+ int i;
+ int supports_rx_batching;
+ int rc;
+
+ npages = EFX_EVQ_NBUFS(nevs);
+ if (MC_CMD_INIT_EVQ_IN_LEN(npages) > MC_CMD_INIT_EVQ_IN_LENMAX) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_INIT_EVQ;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_INIT_EVQ_IN_LEN(npages);
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_INIT_EVQ_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_SIZE, nevs);
+ MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_INSTANCE, instance);
+ MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_IRQ_NUM, irq);
+
+ /*
+ * On Huntington RX and TX event batching can only be requested
+ * together (even if the datapath firmware doesn't actually support RX
+ * batching).
+ * Cut through is incompatible with RX batching and so enabling cut
+ * through disables RX batching (but it does not affect TX batching).
+ *
+ * So always enable RX and TX event batching, and enable cut through
+ * if RX event batching isn't supported (i.e. on low latency firmware).
+ */
+ supports_rx_batching = enp->en_nic_cfg.enc_rx_batching_enabled ? 1 : 0;
+ MCDI_IN_POPULATE_DWORD_6(req, INIT_EVQ_IN_FLAGS,
+ INIT_EVQ_IN_FLAG_INTERRUPTING, 1,
+ INIT_EVQ_IN_FLAG_RPTR_DOS, 0,
+ INIT_EVQ_IN_FLAG_INT_ARMD, 0,
+ INIT_EVQ_IN_FLAG_CUT_THRU, !supports_rx_batching,
+ INIT_EVQ_IN_FLAG_RX_MERGE, 1,
+ INIT_EVQ_IN_FLAG_TX_MERGE, 1);
+
+ MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_MODE,
+ MC_CMD_INIT_EVQ_IN_TMR_MODE_DIS);
+ MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_LOAD, 0);
+ MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_RELOAD, 0);
+
+ MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_COUNT_MODE,
+ MC_CMD_INIT_EVQ_IN_COUNT_MODE_DIS);
+ MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_COUNT_THRSHLD, 0);
+
+ dma_addr = MCDI_IN2(req, efx_qword_t, INIT_EVQ_IN_DMA_ADDR);
+ addr = EFSYS_MEM_ADDR(esmp);
+
+ for (i = 0; i < npages; i++) {
+ EFX_POPULATE_QWORD_2(*dma_addr,
+ EFX_DWORD_1, (uint32_t)(addr >> 32),
+ EFX_DWORD_0, (uint32_t)(addr & 0xffffffff));
+
+ dma_addr++;
+ addr += EFX_BUF_SIZE;
+ }
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail2;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_INIT_EVQ_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail3;
+ }
+
+ if (irqp != NULL)
+ *irqp = MCDI_OUT_DWORD(req, INIT_EVQ_OUT_IRQ);
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+static __checkReturn int
+efx_mcdi_fini_evq(
+ __in efx_nic_t *enp,
+ __in uint32_t instance)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_FINI_EVQ_IN_LEN,
+ MC_CMD_FINI_EVQ_OUT_LEN)];
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_FINI_EVQ;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_FINI_EVQ_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_FINI_EVQ_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, FINI_EVQ_IN_INSTANCE, instance);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+
+
+ __checkReturn int
+hunt_ev_init(
+ __in efx_nic_t *enp)
+{
+ _NOTE(ARGUNUSED(enp))
+ return (0);
+}
+
+ void
+hunt_ev_fini(
+ __in efx_nic_t *enp)
+{
+ _NOTE(ARGUNUSED(enp))
+}
+
+ __checkReturn int
+hunt_ev_qcreate(
+ __in efx_nic_t *enp,
+ __in unsigned int index,
+ __in efsys_mem_t *esmp,
+ __in size_t n,
+ __in uint32_t id,
+ __in efx_evq_t *eep)
+{
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+ uint32_t irq;
+ int rc;
+
+ _NOTE(ARGUNUSED(id)) /* buftbl id managed by MC */
+ EFX_STATIC_ASSERT(ISP2(EFX_EVQ_MAXNEVS));
+ EFX_STATIC_ASSERT(ISP2(EFX_EVQ_MINNEVS));
+
+ if (!ISP2(n) || (n < EFX_EVQ_MINNEVS) || (n > EFX_EVQ_MAXNEVS)) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ if (index >= encp->enc_evq_limit) {
+ rc = EINVAL;
+ goto fail2;
+ }
+
+ /* Set up the handler table */
+ eep->ee_rx = hunt_ev_rx;
+ eep->ee_tx = hunt_ev_tx;
+ eep->ee_driver = hunt_ev_driver;
+ eep->ee_drv_gen = hunt_ev_drv_gen;
+ eep->ee_mcdi = hunt_ev_mcdi;
+
+ /*
+ * Set up the event queue
+ * NOTE: ignore the returned IRQ param as firmware does not set it.
+ */
+ irq = index; /* INIT_EVQ expects function-relative vector number */
+ if ((rc = efx_mcdi_init_evq(enp, index, esmp, n, irq, NULL)) != 0)
+ goto fail3;
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ void
+hunt_ev_qdestroy(
+ __in efx_evq_t *eep)
+{
+ efx_nic_t *enp = eep->ee_enp;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+
+ (void) efx_mcdi_fini_evq(eep->ee_enp, eep->ee_index);
+}
+
+ __checkReturn int
+hunt_ev_qprime(
+ __in efx_evq_t *eep,
+ __in unsigned int count)
+{
+ efx_nic_t *enp = eep->ee_enp;
+ uint32_t rptr;
+ efx_dword_t dword;
+
+ rptr = count & eep->ee_mask;
+
+ if (enp->en_nic_cfg.enc_bug35388_workaround) {
+ EFX_STATIC_ASSERT(EFX_EVQ_MINNEVS >
+ (1 << ERF_DD_EVQ_IND_RPTR_WIDTH));
+ EFX_STATIC_ASSERT(EFX_EVQ_MAXNEVS <
+ (1 << 2 * ERF_DD_EVQ_IND_RPTR_WIDTH));
+
+ EFX_POPULATE_DWORD_2(dword,
+ ERF_DD_EVQ_IND_RPTR_FLAGS,
+ EFE_DD_EVQ_IND_RPTR_FLAGS_HIGH,
+ ERF_DD_EVQ_IND_RPTR,
+ (rptr >> ERF_DD_EVQ_IND_RPTR_WIDTH));
+ EFX_BAR_TBL_WRITED(enp, ER_DD_EVQ_INDIRECT, eep->ee_index,
+ &dword, B_FALSE);
+
+ EFX_POPULATE_DWORD_2(dword,
+ ERF_DD_EVQ_IND_RPTR_FLAGS,
+ EFE_DD_EVQ_IND_RPTR_FLAGS_LOW,
+ ERF_DD_EVQ_IND_RPTR,
+ rptr & ((1 << ERF_DD_EVQ_IND_RPTR_WIDTH) - 1));
+ EFX_BAR_TBL_WRITED(enp, ER_DD_EVQ_INDIRECT, eep->ee_index,
+ &dword, B_FALSE);
+ } else {
+ EFX_POPULATE_DWORD_1(dword, ERF_DZ_EVQ_RPTR, rptr);
+ EFX_BAR_TBL_WRITED(enp, ER_DZ_EVQ_RPTR_REG, eep->ee_index,
+ &dword, B_FALSE);
+ }
+
+ return (0);
+}
+
+static __checkReturn int
+efx_mcdi_driver_event(
+ __in efx_nic_t *enp,
+ __in uint32_t evq,
+ __in efx_qword_t data)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_DRIVER_EVENT_IN_LEN,
+ MC_CMD_DRIVER_EVENT_OUT_LEN)];
+ int rc;
+
+ req.emr_cmd = MC_CMD_DRIVER_EVENT;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_DRIVER_EVENT_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_DRIVER_EVENT_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, DRIVER_EVENT_IN_EVQ, evq);
+
+ MCDI_IN_SET_DWORD(req, DRIVER_EVENT_IN_DATA_LO,
+ EFX_QWORD_FIELD(data, EFX_DWORD_0));
+ MCDI_IN_SET_DWORD(req, DRIVER_EVENT_IN_DATA_HI,
+ EFX_QWORD_FIELD(data, EFX_DWORD_1));
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ void
+hunt_ev_qpost(
+ __in efx_evq_t *eep,
+ __in uint16_t data)
+{
+ efx_nic_t *enp = eep->ee_enp;
+ efx_qword_t event;
+
+ EFX_POPULATE_QWORD_3(event,
+ ESF_DZ_DRV_CODE, ESE_DZ_EV_CODE_DRV_GEN_EV,
+ ESF_DZ_DRV_SUB_CODE, 0,
+ ESF_DZ_DRV_SUB_DATA_DW0, (uint32_t)data);
+
+ (void) efx_mcdi_driver_event(enp, eep->ee_index, event);
+}
+
+ __checkReturn int
+hunt_ev_qmoderate(
+ __in efx_evq_t *eep,
+ __in unsigned int us)
+{
+ efx_nic_t *enp = eep->ee_enp;
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+ efx_dword_t dword;
+ uint32_t timer_val, mode;
+ int rc;
+
+ if (us > encp->enc_evq_timer_max_us) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ /* If the value is zero then disable the timer */
+ if (us == 0) {
+ timer_val = 0;
+ mode = FFE_CZ_TIMER_MODE_DIS;
+ } else {
+ /* Calculate the timer value in quanta */
+ timer_val = us * 1000 / encp->enc_evq_timer_quantum_ns;
+
+ /* Moderation value is base 0 so we need to deduct 1 */
+ if (timer_val > 0)
+ timer_val--;
+
+ mode = FFE_CZ_TIMER_MODE_INT_HLDOFF;
+ }
+
+ if (encp->enc_bug35388_workaround) {
+ EFX_POPULATE_DWORD_3(dword,
+ ERF_DD_EVQ_IND_TIMER_FLAGS,
+ EFE_DD_EVQ_IND_TIMER_FLAGS,
+ ERF_DD_EVQ_IND_TIMER_MODE, mode,
+ ERF_DD_EVQ_IND_TIMER_VAL, timer_val);
+ EFX_BAR_TBL_WRITED(enp, ER_DD_EVQ_INDIRECT,
+ eep->ee_index, &dword, 0);
+ } else {
+ EFX_POPULATE_DWORD_2(dword,
+ FRF_CZ_TC_TIMER_MODE, mode,
+ FRF_CZ_TC_TIMER_VAL, timer_val);
+ EFX_BAR_TBL_WRITED(enp, FR_BZ_TIMER_COMMAND_REGP0,
+ eep->ee_index, &dword, 0);
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+
+#if EFSYS_OPT_QSTATS
+ void
+hunt_ev_qstats_update(
+ __in efx_evq_t *eep,
+ __inout_ecount(EV_NQSTATS) efsys_stat_t *stat)
+{
+ /*
+ * TBD: Consider a common Siena/Huntington function. The code is
+ * essentially identical.
+ */
+ unsigned int id;
+
+ for (id = 0; id < EV_NQSTATS; id++) {
+ efsys_stat_t *essp = &stat[id];
+
+ EFSYS_STAT_INCR(essp, eep->ee_stat[id]);
+ eep->ee_stat[id] = 0;
+ }
+}
+#endif /* EFSYS_OPT_QSTATS */
+
+
+static __checkReturn boolean_t
+hunt_ev_rx(
+ __in efx_evq_t *eep,
+ __in efx_qword_t *eqp,
+ __in const efx_ev_callbacks_t *eecp,
+ __in_opt void *arg)
+{
+ efx_nic_t *enp = eep->ee_enp;
+ uint32_t size;
+ boolean_t parse_err;
+ uint32_t label;
+ uint32_t mcast;
+ uint32_t eth_base_class;
+ uint32_t eth_tag_class;
+ uint32_t l3_class;
+ uint32_t l4_class;
+ uint32_t next_read_lbits;
+ boolean_t soft1, soft2;
+ uint16_t flags;
+ boolean_t should_abort;
+ efx_evq_rxq_state_t *eersp;
+ unsigned int desc_count;
+ unsigned int last_used_id;
+
+ EFX_EV_QSTAT_INCR(eep, EV_RX);
+
+ /* Discard events after RXQ/TXQ errors */
+ if (enp->en_reset_flags & (EFX_RESET_RXQ_ERR | EFX_RESET_TXQ_ERR))
+ return (B_FALSE);
+
+ /*
+ * FIXME: likely to be incomplete, incorrect and inefficient.
+ * Improvements in all three areas are required.
+ */
+
+ if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_DROP_EVENT) != 0) {
+ /* Drop this event */
+ return (B_FALSE);
+ }
+ flags = 0;
+
+ size = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_BYTES);
+
+ if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_CONT) != 0) {
+ /*
+ * FIXME: There is not yet any driver that supports scatter on
+ * Huntington. Scatter support is required for OSX.
+ */
+ EFSYS_ASSERT(0);
+ flags |= EFX_PKT_CONT;
+ }
+
+ parse_err = (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_PARSE_INCOMPLETE) != 0);
+ label = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_QLABEL);
+
+ if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ECRC_ERR) != 0) {
+ /* Ethernet frame CRC bad */
+ flags |= EFX_DISCARD;
+ }
+ if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_CRC0_ERR) != 0) {
+ /* IP+TCP, bad CRC in iSCSI header */
+ flags |= EFX_DISCARD;
+ }
+ if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_CRC1_ERR) != 0) {
+ /* IP+TCP, bad CRC in iSCSI payload or FCoE or FCoIP */
+ flags |= EFX_DISCARD;
+ }
+ if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ECC_ERR) != 0) {
+ /* ECC memory error */
+ flags |= EFX_DISCARD;
+ }
+
+ /* FIXME: do we need soft bits from RXDP firmware ? */
+ soft1 = (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_EV_SOFT1) != 0);
+ soft2 = (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_EV_SOFT2) != 0);
+
+ mcast = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_MAC_CLASS);
+ if (mcast == ESE_DZ_MAC_CLASS_UCAST)
+ flags |= EFX_PKT_UNICAST;
+
+ eth_base_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ETH_BASE_CLASS);
+ eth_tag_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ETH_TAG_CLASS);
+ l3_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_L3_CLASS);
+ l4_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_L4_CLASS);
+
+ /* bottom 4 bits of incremented index (not last desc consumed) */
+ next_read_lbits = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_DSC_PTR_LBITS);
+
+ /* Increment the count of descriptors read */
+ eersp = &eep->ee_rxq_state[label];
+ desc_count = (next_read_lbits - eersp->eers_rx_read_ptr) &
+ EFX_MASK32(ESF_DZ_RX_DSC_PTR_LBITS);
+ eersp->eers_rx_read_ptr += desc_count;
+
+ /*
+ * FIXME: add error checking to make sure this a batched event.
+ * This could also be an aborted scatter, see Bug36629.
+ */
+ if (desc_count > 1) {
+ EFX_EV_QSTAT_INCR(eep, EV_RX_BATCH);
+ flags |= EFX_PKT_PREFIX_LEN;
+ }
+
+ /* Calculate the index of the the last descriptor consumed */
+ last_used_id = (eersp->eers_rx_read_ptr - 1) & eersp->eers_rx_mask;
+
+ /* EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_OVERRIDE_HOLDOFF); */
+
+ switch (eth_base_class) {
+ case ESE_DZ_ETH_BASE_CLASS_LLC_SNAP:
+ case ESE_DZ_ETH_BASE_CLASS_LLC:
+ case ESE_DZ_ETH_BASE_CLASS_ETH2:
+ default:
+ break;
+ }
+
+ switch (eth_tag_class) {
+ case ESE_DZ_ETH_TAG_CLASS_RSVD7:
+ case ESE_DZ_ETH_TAG_CLASS_RSVD6:
+ case ESE_DZ_ETH_TAG_CLASS_RSVD5:
+ case ESE_DZ_ETH_TAG_CLASS_RSVD4:
+ break;
+
+ case ESE_DZ_ETH_TAG_CLASS_RSVD3: /* Triple tagged */
+ case ESE_DZ_ETH_TAG_CLASS_VLAN2: /* Double tagged */
+ case ESE_DZ_ETH_TAG_CLASS_VLAN1: /* VLAN tagged */
+ flags |= EFX_PKT_VLAN_TAGGED;
+ break;
+
+ case ESE_DZ_ETH_TAG_CLASS_NONE:
+ default:
+ break;
+ }
+
+ switch (l3_class) {
+ case ESE_DZ_L3_CLASS_RSVD7: /* Used by firmware for packet overrun */
+ parse_err = B_TRUE;
+ flags |= EFX_DISCARD;
+ break;
+
+ case ESE_DZ_L3_CLASS_ARP:
+ case ESE_DZ_L3_CLASS_FCOE:
+ break;
+
+ case ESE_DZ_L3_CLASS_IP6_FRAG:
+ case ESE_DZ_L3_CLASS_IP6:
+ flags |= EFX_PKT_IPV6;
+ break;
+
+ case ESE_DZ_L3_CLASS_IP4_FRAG:
+ case ESE_DZ_L3_CLASS_IP4:
+ flags |= EFX_PKT_IPV4;
+ if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_IPCKSUM_ERR) == 0)
+ flags |= EFX_CKSUM_IPV4;
+ break;
+
+ case ESE_DZ_L3_CLASS_UNKNOWN:
+ default:
+ break;
+ }
+
+ switch (l4_class) {
+ case ESE_DZ_L4_CLASS_RSVD7:
+ case ESE_DZ_L4_CLASS_RSVD6:
+ case ESE_DZ_L4_CLASS_RSVD5:
+ case ESE_DZ_L4_CLASS_RSVD4:
+ case ESE_DZ_L4_CLASS_RSVD3:
+ break;
+
+ case ESE_DZ_L4_CLASS_UDP:
+ flags |= EFX_PKT_UDP;
+ if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_TCPUDP_CKSUM_ERR) == 0)
+ flags |= EFX_CKSUM_TCPUDP;
+ break;
+
+ case ESE_DZ_L4_CLASS_TCP:
+ flags |= EFX_PKT_TCP;
+ if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_TCPUDP_CKSUM_ERR) == 0)
+ flags |= EFX_CKSUM_TCPUDP;
+ break;
+
+ case ESE_DZ_L4_CLASS_UNKNOWN:
+ default:
+ break;
+ }
+
+ /* If we're not discarding the packet then it is ok */
+ if (~flags & EFX_DISCARD)
+ EFX_EV_QSTAT_INCR(eep, EV_RX_OK);
+
+ EFSYS_ASSERT(eecp->eec_rx != NULL);
+ should_abort = eecp->eec_rx(arg, label, last_used_id, size, flags);
+
+ return (should_abort);
+}
+
+static __checkReturn boolean_t
+hunt_ev_tx(
+ __in efx_evq_t *eep,
+ __in efx_qword_t *eqp,
+ __in const efx_ev_callbacks_t *eecp,
+ __in_opt void *arg)
+{
+ efx_nic_t *enp = eep->ee_enp;
+ uint32_t id;
+ uint32_t label;
+ boolean_t should_abort;
+
+ EFX_EV_QSTAT_INCR(eep, EV_TX);
+
+ /* Discard events after RXQ/TXQ errors */
+ if (enp->en_reset_flags & (EFX_RESET_RXQ_ERR | EFX_RESET_TXQ_ERR))
+ return (B_FALSE);
+
+ if (EFX_QWORD_FIELD(*eqp, ESF_DZ_TX_DROP_EVENT) != 0) {
+ /* Drop this event */
+ return (B_FALSE);
+ }
+
+ /* Per-packet TX completion (was per-descriptor for Falcon/Siena) */
+ id = EFX_QWORD_FIELD(*eqp, ESF_DZ_TX_DESCR_INDX);
+ label = EFX_QWORD_FIELD(*eqp, ESF_DZ_TX_QLABEL);
+
+ EFSYS_PROBE2(tx_complete, uint32_t, label, uint32_t, id);
+
+ EFSYS_ASSERT(eecp->eec_tx != NULL);
+ should_abort = eecp->eec_tx(arg, label, id);
+
+ return (should_abort);
+}
+
+static __checkReturn boolean_t
+hunt_ev_driver(
+ __in efx_evq_t *eep,
+ __in efx_qword_t *eqp,
+ __in const efx_ev_callbacks_t *eecp,
+ __in_opt void *arg)
+{
+ unsigned int code;
+ boolean_t should_abort;
+
+ EFX_EV_QSTAT_INCR(eep, EV_DRIVER);
+ should_abort = B_FALSE;
+
+ code = EFX_QWORD_FIELD(*eqp, ESF_DZ_DRV_SUB_CODE);
+ switch (code) {
+ case ESE_DZ_DRV_TIMER_EV: {
+ uint32_t id;
+
+ id = EFX_QWORD_FIELD(*eqp, ESF_DZ_DRV_TMR_ID);
+
+ EFSYS_ASSERT(eecp->eec_timer != NULL);
+ should_abort = eecp->eec_timer(arg, id);
+ break;
+ }
+
+ case ESE_DZ_DRV_WAKE_UP_EV: {
+ uint32_t id;
+
+ id = EFX_QWORD_FIELD(*eqp, ESF_DZ_DRV_EVQ_ID);
+
+ EFSYS_ASSERT(eecp->eec_wake_up != NULL);
+ should_abort = eecp->eec_wake_up(arg, id);
+ break;
+ }
+
+ case ESE_DZ_DRV_START_UP_EV:
+ EFSYS_ASSERT(eecp->eec_initialized != NULL);
+ should_abort = eecp->eec_initialized(arg);
+ break;
+
+ default:
+ EFSYS_PROBE3(bad_event, unsigned int, eep->ee_index,
+ uint32_t, EFX_QWORD_FIELD(*eqp, EFX_DWORD_1),
+ uint32_t, EFX_QWORD_FIELD(*eqp, EFX_DWORD_0));
+ break;
+ }
+
+ return (should_abort);
+}
+
+static __checkReturn boolean_t
+hunt_ev_drv_gen(
+ __in efx_evq_t *eep,
+ __in efx_qword_t *eqp,
+ __in const efx_ev_callbacks_t *eecp,
+ __in_opt void *arg)
+{
+ uint32_t data;
+ boolean_t should_abort;
+
+ EFX_EV_QSTAT_INCR(eep, EV_DRV_GEN);
+ should_abort = B_FALSE;
+
+ data = EFX_QWORD_FIELD(*eqp, ESF_DZ_DRV_SUB_DATA_DW0);
+ if (data >= ((uint32_t)1 << 16)) {
+ EFSYS_PROBE3(bad_event, unsigned int, eep->ee_index,
+ uint32_t, EFX_QWORD_FIELD(*eqp, EFX_DWORD_1),
+ uint32_t, EFX_QWORD_FIELD(*eqp, EFX_DWORD_0));
+
+ return (B_TRUE);
+ }
+
+ EFSYS_ASSERT(eecp->eec_software != NULL);
+ should_abort = eecp->eec_software(arg, (uint16_t)data);
+
+ return (should_abort);
+}
+
+static __checkReturn boolean_t
+hunt_ev_mcdi(
+ __in efx_evq_t *eep,
+ __in efx_qword_t *eqp,
+ __in const efx_ev_callbacks_t *eecp,
+ __in_opt void *arg)
+{
+ efx_nic_t *enp = eep->ee_enp;
+ unsigned code;
+ boolean_t should_abort = B_FALSE;
+
+ EFX_EV_QSTAT_INCR(eep, EV_MCDI_RESPONSE);
+
+ code = EFX_QWORD_FIELD(*eqp, MCDI_EVENT_CODE);
+ switch (code) {
+ case MCDI_EVENT_CODE_BADSSERT:
+ efx_mcdi_ev_death(enp, EINTR);
+ break;
+
+ case MCDI_EVENT_CODE_CMDDONE:
+ efx_mcdi_ev_cpl(enp,
+ MCDI_EV_FIELD(eqp, CMDDONE_SEQ),
+ MCDI_EV_FIELD(eqp, CMDDONE_DATALEN),
+ MCDI_EV_FIELD(eqp, CMDDONE_ERRNO));
+ break;
+
+ case MCDI_EVENT_CODE_LINKCHANGE: {
+ efx_link_mode_t link_mode;
+
+ hunt_phy_link_ev(enp, eqp, &link_mode);
+ should_abort = eecp->eec_link_change(arg, link_mode);
+ break;
+ }
+
+ case MCDI_EVENT_CODE_SENSOREVT: {
+#if EFSYS_OPT_MON_STATS
+ efx_mon_stat_t id;
+ efx_mon_stat_value_t value;
+ int rc;
+
+ /* Decode monitor stat for MCDI sensor (if supported) */
+ if ((rc = mcdi_mon_ev(enp, eqp, &id, &value)) == 0) {
+ /* Report monitor stat change */
+ should_abort = eecp->eec_monitor(arg, id, value);
+ } else if (rc == ENOTSUP) {
+ should_abort = eecp->eec_exception(arg,
+ EFX_EXCEPTION_UNKNOWN_SENSOREVT,
+ MCDI_EV_FIELD(eqp, DATA));
+ } else {
+ EFSYS_ASSERT(rc == ENODEV); /* Wrong port */
+ }
+#endif
+ break;
+ }
+
+ case MCDI_EVENT_CODE_SCHEDERR:
+ /* Informational only */
+ break;
+
+ case MCDI_EVENT_CODE_REBOOT:
+ /* Falcon/Siena only (should not been seen with Huntington). */
+ efx_mcdi_ev_death(enp, EIO);
+ break;
+
+ case MCDI_EVENT_CODE_MC_REBOOT:
+ /* MC_REBOOT event is used for Huntington (EF10) and later. */
+ efx_mcdi_ev_death(enp, EIO);
+ break;
+
+ case MCDI_EVENT_CODE_MAC_STATS_DMA:
+#if EFSYS_OPT_MAC_STATS
+ if (eecp->eec_mac_stats != NULL) {
+ eecp->eec_mac_stats(arg,
+ MCDI_EV_FIELD(eqp, MAC_STATS_DMA_GENERATION));
+ }
+#endif
+ break;
+
+ case MCDI_EVENT_CODE_FWALERT: {
+ uint32_t reason = MCDI_EV_FIELD(eqp, FWALERT_REASON);
+
+ if (reason == MCDI_EVENT_FWALERT_REASON_SRAM_ACCESS)
+ should_abort = eecp->eec_exception(arg,
+ EFX_EXCEPTION_FWALERT_SRAM,
+ MCDI_EV_FIELD(eqp, FWALERT_DATA));
+ else
+ should_abort = eecp->eec_exception(arg,
+ EFX_EXCEPTION_UNKNOWN_FWALERT,
+ MCDI_EV_FIELD(eqp, DATA));
+ break;
+ }
+
+ case MCDI_EVENT_CODE_TX_ERR: {
+ /*
+ * After a TXQ error is detected, firmware sends a TX_ERR event.
+ * This may be followed by TX completions (which we discard),
+ * and then finally by a TX_FLUSH event. Firmware destroys the
+ * TXQ automatically after sending the TX_FLUSH event.
+ */
+ enp->en_reset_flags |= EFX_RESET_TXQ_ERR;
+
+ EFSYS_PROBE1(tx_descq_err, uint32_t, MCDI_EV_FIELD(eqp, DATA));
+
+ /* Inform the driver that a reset is required. */
+ eecp->eec_exception(arg, EFX_EXCEPTION_TX_ERROR,
+ MCDI_EV_FIELD(eqp, TX_ERR_DATA));
+ break;
+ }
+
+ case MCDI_EVENT_CODE_TX_FLUSH: {
+ uint32_t txq_index = MCDI_EV_FIELD(eqp, TX_FLUSH_TXQ);
+
+ /*
+ * EF10 firmware sends two TX_FLUSH events: one to the txq's
+ * event queue, and one to evq 0 (with TX_FLUSH_TO_DRIVER set).
+ * We want to wait for all completions, so ignore the events
+ * with TX_FLUSH_TO_DRIVER.
+ */
+ if (MCDI_EV_FIELD(eqp, TX_FLUSH_TO_DRIVER) != 0) {
+ should_abort = B_FALSE;
+ break;
+ }
+
+ EFX_EV_QSTAT_INCR(eep, EV_DRIVER_TX_DESCQ_FLS_DONE);
+
+ EFSYS_PROBE1(tx_descq_fls_done, uint32_t, txq_index);
+
+ EFSYS_ASSERT(eecp->eec_txq_flush_done != NULL);
+ should_abort = eecp->eec_txq_flush_done(arg, txq_index);
+ break;
+ }
+
+ case MCDI_EVENT_CODE_RX_ERR: {
+ /*
+ * After an RXQ error is detected, firmware sends an RX_ERR
+ * event. This may be followed by RX events (which we discard),
+ * and then finally by an RX_FLUSH event. Firmware destroys the
+ * RXQ automatically after sending the RX_FLUSH event.
+ */
+ enp->en_reset_flags |= EFX_RESET_RXQ_ERR;
+
+ EFSYS_PROBE1(rx_descq_err, uint32_t, MCDI_EV_FIELD(eqp, DATA));
+
+ /* Inform the driver that a reset is required. */
+ eecp->eec_exception(arg, EFX_EXCEPTION_RX_ERROR,
+ MCDI_EV_FIELD(eqp, RX_ERR_DATA));
+ break;
+ }
+
+ case MCDI_EVENT_CODE_RX_FLUSH: {
+ uint32_t rxq_index = MCDI_EV_FIELD(eqp, RX_FLUSH_RXQ);
+
+ /*
+ * EF10 firmware sends two RX_FLUSH events: one to the rxq's
+ * event queue, and one to evq 0 (with RX_FLUSH_TO_DRIVER set).
+ * We want to wait for all completions, so ignore the events
+ * with RX_FLUSH_TO_DRIVER.
+ */
+ if (MCDI_EV_FIELD(eqp, RX_FLUSH_TO_DRIVER) != 0) {
+ should_abort = B_FALSE;
+ break;
+ }
+
+ EFX_EV_QSTAT_INCR(eep, EV_DRIVER_RX_DESCQ_FLS_DONE);
+
+ EFSYS_PROBE1(rx_descq_fls_done, uint32_t, rxq_index);
+
+ EFSYS_ASSERT(eecp->eec_rxq_flush_done != NULL);
+ should_abort = eecp->eec_rxq_flush_done(arg, rxq_index);
+ break;
+ }
+
+ default:
+ EFSYS_PROBE3(bad_event, unsigned int, eep->ee_index,
+ uint32_t, EFX_QWORD_FIELD(*eqp, EFX_DWORD_1),
+ uint32_t, EFX_QWORD_FIELD(*eqp, EFX_DWORD_0));
+ break;
+ }
+
+ return (should_abort);
+}
+
+ void
+hunt_ev_rxlabel_init(
+ __in efx_evq_t *eep,
+ __in efx_rxq_t *erp,
+ __in unsigned int label)
+{
+ efx_evq_rxq_state_t *eersp;
+
+ EFSYS_ASSERT3U(label, <, EFX_ARRAY_SIZE(eep->ee_rxq_state));
+ eersp = &eep->ee_rxq_state[label];
+
+ EFSYS_ASSERT3U(eersp->eers_rx_mask, ==, 0);
+
+ eersp->eers_rx_read_ptr = 0;
+ eersp->eers_rx_mask = erp->er_mask;
+}
+
+ void
+hunt_ev_rxlabel_fini(
+ __in efx_evq_t *eep,
+ __in unsigned int label)
+{
+ efx_evq_rxq_state_t *eersp;
+
+ EFSYS_ASSERT3U(label, <, EFX_ARRAY_SIZE(eep->ee_rxq_state));
+ eersp = &eep->ee_rxq_state[label];
+
+ EFSYS_ASSERT3U(eersp->eers_rx_mask, !=, 0);
+
+ eersp->eers_rx_read_ptr = 0;
+ eersp->eers_rx_mask = 0;
+}
+
+#endif /* EFSYS_OPT_HUNTINGTON */
diff --git a/sys/dev/sfxge/common/hunt_filter.c b/sys/dev/sfxge/common/hunt_filter.c
new file mode 100644
index 0000000..27af7c3
--- /dev/null
+++ b/sys/dev/sfxge/common/hunt_filter.c
@@ -0,0 +1,1376 @@
+/*-
+ * Copyright (c) 2007-2015 Solarflare Communications Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "efsys.h"
+#include "efx.h"
+#include "efx_types.h"
+#include "efx_regs_mcdi.h"
+#include "efx_impl.h"
+
+#if EFSYS_OPT_HUNTINGTON
+
+#if EFSYS_OPT_FILTER
+
+#define HFE_SPEC(hftp, index) ((hftp)->hft_entry[(index)].hfe_spec)
+
+static efx_filter_spec_t *
+hunt_filter_entry_spec(
+ __in const hunt_filter_table_t *hftp,
+ __in unsigned int index)
+{
+ return ((efx_filter_spec_t *)(HFE_SPEC(hftp, index) &
+ ~(uintptr_t)EFX_HUNT_FILTER_FLAGS));
+}
+
+static boolean_t
+hunt_filter_entry_is_busy(
+ __in const hunt_filter_table_t *hftp,
+ __in unsigned int index)
+{
+ if (HFE_SPEC(hftp, index) & EFX_HUNT_FILTER_FLAG_BUSY)
+ return (B_TRUE);
+ else
+ return (B_FALSE);
+}
+
+static boolean_t
+hunt_filter_entry_is_auto_old(
+ __in const hunt_filter_table_t *hftp,
+ __in unsigned int index)
+{
+ if (HFE_SPEC(hftp, index) & EFX_HUNT_FILTER_FLAG_AUTO_OLD)
+ return (B_TRUE);
+ else
+ return (B_FALSE);
+}
+
+static void
+hunt_filter_set_entry(
+ __inout hunt_filter_table_t *hftp,
+ __in unsigned int index,
+ __in_opt const efx_filter_spec_t *efsp)
+{
+ HFE_SPEC(hftp, index) = (uintptr_t)efsp;
+}
+
+static void
+hunt_filter_set_entry_busy(
+ __inout hunt_filter_table_t *hftp,
+ __in unsigned int index)
+{
+ HFE_SPEC(hftp, index) |= (uintptr_t)EFX_HUNT_FILTER_FLAG_BUSY;
+}
+
+static void
+hunt_filter_set_entry_not_busy(
+ __inout hunt_filter_table_t *hftp,
+ __in unsigned int index)
+{
+ HFE_SPEC(hftp, index) &= ~(uintptr_t)EFX_HUNT_FILTER_FLAG_BUSY;
+}
+
+static void
+hunt_filter_set_entry_auto_old(
+ __inout hunt_filter_table_t *hftp,
+ __in unsigned int index)
+{
+ EFSYS_ASSERT(hunt_filter_entry_spec(hftp, index) != NULL);
+ HFE_SPEC(hftp, index) |= (uintptr_t)EFX_HUNT_FILTER_FLAG_AUTO_OLD;
+}
+
+static void
+hunt_filter_set_entry_not_auto_old(
+ __inout hunt_filter_table_t *hftp,
+ __in unsigned int index)
+{
+ HFE_SPEC(hftp, index) &= ~(uintptr_t)EFX_HUNT_FILTER_FLAG_AUTO_OLD;
+ EFSYS_ASSERT(hunt_filter_entry_spec(hftp, index) != NULL);
+}
+
+ __checkReturn int
+hunt_filter_init(
+ __in efx_nic_t *enp)
+{
+ int rc;
+ hunt_filter_table_t *hftp;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+
+#define MATCH_MASK(match) (EFX_MASK32(match) << EFX_LOW_BIT(match))
+ EFX_STATIC_ASSERT(EFX_FILTER_MATCH_REM_HOST ==
+ MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_SRC_IP));
+ EFX_STATIC_ASSERT(EFX_FILTER_MATCH_LOC_HOST ==
+ MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_DST_IP));
+ EFX_STATIC_ASSERT(EFX_FILTER_MATCH_REM_MAC ==
+ MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_SRC_MAC));
+ EFX_STATIC_ASSERT(EFX_FILTER_MATCH_REM_PORT ==
+ MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_SRC_PORT));
+ EFX_STATIC_ASSERT(EFX_FILTER_MATCH_LOC_MAC ==
+ MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_DST_MAC));
+ EFX_STATIC_ASSERT(EFX_FILTER_MATCH_LOC_PORT ==
+ MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_DST_PORT));
+ EFX_STATIC_ASSERT(EFX_FILTER_MATCH_ETHER_TYPE ==
+ MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_ETHER_TYPE));
+ EFX_STATIC_ASSERT(EFX_FILTER_MATCH_INNER_VID ==
+ MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_INNER_VLAN));
+ EFX_STATIC_ASSERT(EFX_FILTER_MATCH_OUTER_VID ==
+ MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_OUTER_VLAN));
+ EFX_STATIC_ASSERT(EFX_FILTER_MATCH_IP_PROTO ==
+ MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_IP_PROTO));
+#undef MATCH_MASK
+
+ EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (hunt_filter_table_t), hftp);
+
+ if (!hftp) {
+ rc = ENOMEM;
+ goto fail1;
+ }
+
+ enp->en_filter.ef_hunt_filter_table = hftp;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ void
+hunt_filter_fini(
+ __in efx_nic_t *enp)
+{
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+
+ if (enp->en_filter.ef_hunt_filter_table != NULL) {
+ EFSYS_KMEM_FREE(enp->en_esip, sizeof (hunt_filter_table_t),
+ enp->en_filter.ef_hunt_filter_table);
+ }
+}
+
+static __checkReturn int
+efx_mcdi_filter_op_add(
+ __in efx_nic_t *enp,
+ __in efx_filter_spec_t *spec,
+ __in unsigned int filter_op,
+ __inout hunt_filter_handle_t *handle)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_FILTER_OP_IN_LEN,
+ MC_CMD_FILTER_OP_OUT_LEN)];
+ uint32_t match_fields = 0;
+ int rc;
+
+ memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_FILTER_OP;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_FILTER_OP_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_FILTER_OP_OUT_LEN;
+
+ switch (filter_op) {
+ case MC_CMD_FILTER_OP_IN_OP_REPLACE:
+ MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_LO,
+ handle->hfh_lo);
+ MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_HI,
+ handle->hfh_hi);
+ /* Fall through */
+ case MC_CMD_FILTER_OP_IN_OP_INSERT:
+ case MC_CMD_FILTER_OP_IN_OP_SUBSCRIBE:
+ MCDI_IN_SET_DWORD(req, FILTER_OP_IN_OP, filter_op);
+ break;
+ default:
+ EFSYS_ASSERT(0);
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ if (spec->efs_match_flags & EFX_FILTER_MATCH_LOC_MAC_IG) {
+ /*
+ * The LOC_MAC_IG match flag can represent unknown unicast
+ * or multicast filters - use the MAC address to distinguish
+ * them.
+ */
+ if (EFX_MAC_ADDR_IS_MULTICAST(spec->efs_loc_mac))
+ match_fields |= 1U <<
+ MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_MCAST_DST_LBN;
+ else
+ match_fields |= 1U <<
+ MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_UCAST_DST_LBN;
+ }
+
+ match_fields |= spec->efs_match_flags & (~EFX_FILTER_MATCH_LOC_MAC_IG);
+
+ MCDI_IN_SET_DWORD(req, FILTER_OP_IN_PORT_ID,
+ EVB_PORT_ID_ASSIGNED);
+ MCDI_IN_SET_DWORD(req, FILTER_OP_IN_MATCH_FIELDS,
+ match_fields);
+ MCDI_IN_SET_DWORD(req, FILTER_OP_IN_RX_DEST,
+ MC_CMD_FILTER_OP_IN_RX_DEST_HOST);
+ MCDI_IN_SET_DWORD(req, FILTER_OP_IN_RX_QUEUE,
+ spec->efs_dmaq_id);
+ if (spec->efs_flags & EFX_FILTER_FLAG_RX_RSS) {
+ MCDI_IN_SET_DWORD(req, FILTER_OP_IN_RX_CONTEXT,
+ spec->efs_rss_context);
+ }
+ MCDI_IN_SET_DWORD(req, FILTER_OP_IN_RX_MODE,
+ spec->efs_flags & EFX_FILTER_FLAG_RX_RSS ?
+ MC_CMD_FILTER_OP_IN_RX_MODE_RSS :
+ MC_CMD_FILTER_OP_IN_RX_MODE_SIMPLE);
+ MCDI_IN_SET_DWORD(req, FILTER_OP_IN_TX_DEST,
+ MC_CMD_FILTER_OP_IN_TX_DEST_DEFAULT);
+
+ if (filter_op != MC_CMD_FILTER_OP_IN_OP_REPLACE) {
+ /*
+ * NOTE: Unlike most MCDI requests, the filter fields
+ * are presented in network (big endian) byte order.
+ */
+ memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_IN_SRC_MAC),
+ spec->efs_rem_mac, EFX_MAC_ADDR_LEN);
+ memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_IN_DST_MAC),
+ spec->efs_loc_mac, EFX_MAC_ADDR_LEN);
+
+ MCDI_IN_SET_WORD(req, FILTER_OP_IN_SRC_PORT,
+ __CPU_TO_BE_16(spec->efs_rem_port));
+ MCDI_IN_SET_WORD(req, FILTER_OP_IN_DST_PORT,
+ __CPU_TO_BE_16(spec->efs_loc_port));
+
+ MCDI_IN_SET_WORD(req, FILTER_OP_IN_ETHER_TYPE,
+ __CPU_TO_BE_16(spec->efs_ether_type));
+
+ MCDI_IN_SET_WORD(req, FILTER_OP_IN_INNER_VLAN,
+ __CPU_TO_BE_16(spec->efs_inner_vid));
+ MCDI_IN_SET_WORD(req, FILTER_OP_IN_OUTER_VLAN,
+ __CPU_TO_BE_16(spec->efs_outer_vid));
+
+ /* IP protocol (in low byte, high byte is zero) */
+ MCDI_IN_SET_BYTE(req, FILTER_OP_IN_IP_PROTO,
+ spec->efs_ip_proto);
+
+ EFX_STATIC_ASSERT(sizeof (spec->efs_rem_host) ==
+ MC_CMD_FILTER_OP_IN_SRC_IP_LEN);
+ EFX_STATIC_ASSERT(sizeof (spec->efs_loc_host) ==
+ MC_CMD_FILTER_OP_IN_DST_IP_LEN);
+
+ memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_IN_SRC_IP),
+ &spec->efs_rem_host.eo_byte[0],
+ MC_CMD_FILTER_OP_IN_SRC_IP_LEN);
+ memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_IN_DST_IP),
+ &spec->efs_loc_host.eo_byte[0],
+ MC_CMD_FILTER_OP_IN_DST_IP_LEN);
+ }
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail2;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_FILTER_OP_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail3;
+ }
+
+ handle->hfh_lo = MCDI_OUT_DWORD(req, FILTER_OP_OUT_HANDLE_LO);
+ handle->hfh_hi = MCDI_OUT_DWORD(req, FILTER_OP_OUT_HANDLE_HI);
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+
+}
+
+static __checkReturn int
+efx_mcdi_filter_op_delete(
+ __in efx_nic_t *enp,
+ __in unsigned int filter_op,
+ __inout hunt_filter_handle_t *handle)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_FILTER_OP_IN_LEN,
+ MC_CMD_FILTER_OP_OUT_LEN)];
+ int rc;
+
+ memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_FILTER_OP;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_FILTER_OP_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_FILTER_OP_OUT_LEN;
+
+ switch (filter_op) {
+ case MC_CMD_FILTER_OP_IN_OP_REMOVE:
+ MCDI_IN_SET_DWORD(req, FILTER_OP_IN_OP,
+ MC_CMD_FILTER_OP_IN_OP_REMOVE);
+ break;
+ case MC_CMD_FILTER_OP_IN_OP_UNSUBSCRIBE:
+ MCDI_IN_SET_DWORD(req, FILTER_OP_IN_OP,
+ MC_CMD_FILTER_OP_IN_OP_UNSUBSCRIBE);
+ break;
+ default:
+ EFSYS_ASSERT(0);
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_LO, handle->hfh_lo);
+ MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_HI, handle->hfh_hi);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail2;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_FILTER_OP_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail3;
+ }
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+static __checkReturn boolean_t
+hunt_filter_equal(
+ __in const efx_filter_spec_t *left,
+ __in const efx_filter_spec_t *right)
+{
+ /* FIXME: Consider rx vs tx filters (look at efs_flags) */
+ if (left->efs_match_flags != right->efs_match_flags)
+ return (B_FALSE);
+ if (!EFX_OWORD_IS_EQUAL(left->efs_rem_host, right->efs_rem_host))
+ return (B_FALSE);
+ if (!EFX_OWORD_IS_EQUAL(left->efs_loc_host, right->efs_loc_host))
+ return (B_FALSE);
+ if (memcmp(left->efs_rem_mac, right->efs_rem_mac, EFX_MAC_ADDR_LEN))
+ return (B_FALSE);
+ if (memcmp(left->efs_loc_mac, right->efs_loc_mac, EFX_MAC_ADDR_LEN))
+ return (B_FALSE);
+ if (left->efs_rem_port != right->efs_rem_port)
+ return (B_FALSE);
+ if (left->efs_loc_port != right->efs_loc_port)
+ return (B_FALSE);
+ if (left->efs_inner_vid != right->efs_inner_vid)
+ return (B_FALSE);
+ if (left->efs_outer_vid != right->efs_outer_vid)
+ return (B_FALSE);
+ if (left->efs_ether_type != right->efs_ether_type)
+ return (B_FALSE);
+ if (left->efs_ip_proto != right->efs_ip_proto)
+ return (B_FALSE);
+
+ return (B_TRUE);
+
+}
+
+static __checkReturn boolean_t
+hunt_filter_same_dest(
+ __in const efx_filter_spec_t *left,
+ __in const efx_filter_spec_t *right)
+{
+ if ((left->efs_flags & EFX_FILTER_FLAG_RX_RSS) &&
+ (right->efs_flags & EFX_FILTER_FLAG_RX_RSS)) {
+ if (left->efs_rss_context == right->efs_rss_context)
+ return (B_TRUE);
+ } else if ((~(left->efs_flags) & EFX_FILTER_FLAG_RX_RSS) &&
+ (~(right->efs_flags) & EFX_FILTER_FLAG_RX_RSS)) {
+ if (left->efs_dmaq_id == right->efs_dmaq_id)
+ return (B_TRUE);
+ }
+ return (B_FALSE);
+}
+
+static __checkReturn uint32_t
+hunt_filter_hash(
+ __in efx_filter_spec_t *spec)
+{
+ EFX_STATIC_ASSERT((sizeof (efx_filter_spec_t) % sizeof (uint32_t))
+ == 0);
+ EFX_STATIC_ASSERT((EFX_FIELD_OFFSET(efx_filter_spec_t, efs_outer_vid) %
+ sizeof (uint32_t)) == 0);
+
+ /*
+ * As the area of the efx_filter_spec_t we need to hash is DWORD
+ * aligned and an exact number of DWORDs in size we can use the
+ * optimised efx_hash_dwords() rather than efx_hash_bytes()
+ */
+ return (efx_hash_dwords((const uint32_t *)&spec->efs_outer_vid,
+ (sizeof (efx_filter_spec_t) -
+ EFX_FIELD_OFFSET(efx_filter_spec_t, efs_outer_vid)) /
+ sizeof (uint32_t), 0));
+}
+
+/*
+ * Decide whether a filter should be exclusive or else should allow
+ * delivery to additional recipients. Currently we decide that
+ * filters for specific local unicast MAC and IP addresses are
+ * exclusive.
+ */
+static __checkReturn boolean_t
+hunt_filter_is_exclusive(
+ __in efx_filter_spec_t *spec)
+{
+ if ((spec->efs_match_flags & EFX_FILTER_MATCH_LOC_MAC) &&
+ !EFX_MAC_ADDR_IS_MULTICAST(spec->efs_loc_mac))
+ return (B_TRUE);
+
+ if ((spec->efs_match_flags &
+ (EFX_FILTER_MATCH_ETHER_TYPE | EFX_FILTER_MATCH_LOC_HOST)) ==
+ (EFX_FILTER_MATCH_ETHER_TYPE | EFX_FILTER_MATCH_LOC_HOST)) {
+ if ((spec->efs_ether_type == EFX_ETHER_TYPE_IPV4) &&
+ ((spec->efs_loc_host.eo_u8[0] & 0xf) != 0xe))
+ return (B_TRUE);
+ if ((spec->efs_ether_type == EFX_ETHER_TYPE_IPV6) &&
+ (spec->efs_loc_host.eo_u8[0] != 0xff))
+ return (B_TRUE);
+ }
+
+ return (B_FALSE);
+}
+
+ __checkReturn int
+hunt_filter_restore(
+ __in efx_nic_t *enp)
+{
+ int tbl_id;
+ efx_filter_spec_t *spec;
+ hunt_filter_table_t *hftp = enp->en_filter.ef_hunt_filter_table;
+ boolean_t restoring;
+ int state;
+ int rc;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+
+ for (tbl_id = 0; tbl_id < EFX_HUNT_FILTER_TBL_ROWS; tbl_id++) {
+
+ EFSYS_LOCK(enp->en_eslp, state);
+
+ spec = hunt_filter_entry_spec(hftp, tbl_id);
+ if (spec == NULL) {
+ restoring = B_FALSE;
+ } else if (hunt_filter_entry_is_busy(hftp, tbl_id)) {
+ /* Ignore busy entries. */
+ restoring = B_FALSE;
+ } else {
+ hunt_filter_set_entry_busy(hftp, tbl_id);
+ restoring = B_TRUE;
+ }
+
+ EFSYS_UNLOCK(enp->en_eslp, state);
+
+ if (restoring == B_FALSE)
+ continue;
+
+ if (hunt_filter_is_exclusive(spec)) {
+ rc = efx_mcdi_filter_op_add(enp, spec,
+ MC_CMD_FILTER_OP_IN_OP_INSERT,
+ &hftp->hft_entry[tbl_id].hfe_handle);
+ } else {
+ rc = efx_mcdi_filter_op_add(enp, spec,
+ MC_CMD_FILTER_OP_IN_OP_SUBSCRIBE,
+ &hftp->hft_entry[tbl_id].hfe_handle);
+ }
+
+ if (rc != 0)
+ goto fail1;
+
+ EFSYS_LOCK(enp->en_eslp, state);
+
+ hunt_filter_set_entry_not_busy(hftp, tbl_id);
+
+ EFSYS_UNLOCK(enp->en_eslp, state);
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+/*
+ * An arbitrary search limit for the software hash table. As per the linux net
+ * driver.
+ */
+#define EFX_HUNT_FILTER_SEARCH_LIMIT 200
+
+static __checkReturn int
+hunt_filter_add_internal(
+ __in efx_nic_t *enp,
+ __inout efx_filter_spec_t *spec,
+ __in boolean_t may_replace,
+ __out_opt uint32_t *filter_id)
+{
+ int rc;
+ hunt_filter_table_t *hftp = enp->en_filter.ef_hunt_filter_table;
+ efx_filter_spec_t *saved_spec;
+ uint32_t hash;
+ unsigned int depth;
+ int ins_index;
+ boolean_t replacing = B_FALSE;
+ unsigned int i;
+ int state;
+ boolean_t locked = B_FALSE;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+
+#if EFSYS_OPT_RX_SCALE
+ spec->efs_rss_context = enp->en_rss_context;
+#endif
+
+ hash = hunt_filter_hash(spec);
+
+ /*
+ * FIXME: Add support for inserting filters of different priorities
+ * and removing lower priority multicast filters (bug 42378)
+ */
+
+ /*
+ * Find any existing filters with the same match tuple or
+ * else a free slot to insert at. If any of them are busy,
+ * we have to wait and retry.
+ */
+ for (;;) {
+ ins_index = -1;
+ depth = 1;
+ EFSYS_LOCK(enp->en_eslp, state);
+ locked = B_TRUE;
+
+ for (;;) {
+ i = (hash + depth) & (EFX_HUNT_FILTER_TBL_ROWS - 1);
+ saved_spec = hunt_filter_entry_spec(hftp, i);
+
+ if (!saved_spec) {
+ if (ins_index < 0) {
+ ins_index = i;
+ }
+ } else if (hunt_filter_equal(spec, saved_spec)) {
+ if (hunt_filter_entry_is_busy(hftp, i))
+ break;
+ if (saved_spec->efs_priority
+ == EFX_FILTER_PRI_AUTO) {
+ ins_index = i;
+ goto found;
+ } else if (hunt_filter_is_exclusive(spec)) {
+ if (may_replace) {
+ ins_index = i;
+ goto found;
+ } else {
+ rc = EEXIST;
+ goto fail1;
+ }
+ }
+
+ /* Leave existing */
+ }
+
+ /*
+ * Once we reach the maximum search depth, use
+ * the first suitable slot or return EBUSY if
+ * there was none.
+ */
+ if (depth == EFX_HUNT_FILTER_SEARCH_LIMIT) {
+ if (ins_index < 0) {
+ rc = EBUSY;
+ goto fail2;
+ }
+ goto found;
+ }
+ depth++;
+ }
+ EFSYS_UNLOCK(enp->en_eslp, state);
+ locked = B_FALSE;
+ }
+
+found:
+ /*
+ * Create a software table entry if necessary, and mark it
+ * busy. We might yet fail to insert, but any attempt to
+ * insert a conflicting filter while we're waiting for the
+ * firmware must find the busy entry.
+ */
+ saved_spec = hunt_filter_entry_spec(hftp, ins_index);
+ if (saved_spec) {
+ if (saved_spec->efs_priority == EFX_FILTER_PRI_AUTO) {
+ /* This is a filter we are refreshing */
+ hunt_filter_set_entry_not_auto_old(hftp, ins_index);
+ goto out_unlock;
+
+ }
+ replacing = B_TRUE;
+ } else {
+ EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (*spec), saved_spec);
+ if (!saved_spec) {
+ rc = ENOMEM;
+ goto fail3;
+ }
+ *saved_spec = *spec;
+ hunt_filter_set_entry(hftp, ins_index, saved_spec);
+ }
+ hunt_filter_set_entry_busy(hftp, ins_index);
+
+ EFSYS_UNLOCK(enp->en_eslp, state);
+ locked = B_FALSE;
+
+ /*
+ * On replacing the filter handle may change after after a successful
+ * replace operation.
+ */
+ if (replacing) {
+ rc = efx_mcdi_filter_op_add(enp, spec,
+ MC_CMD_FILTER_OP_IN_OP_REPLACE,
+ &hftp->hft_entry[ins_index].hfe_handle);
+ } else if (hunt_filter_is_exclusive(spec)) {
+ rc = efx_mcdi_filter_op_add(enp, spec,
+ MC_CMD_FILTER_OP_IN_OP_INSERT,
+ &hftp->hft_entry[ins_index].hfe_handle);
+ } else {
+ rc = efx_mcdi_filter_op_add(enp, spec,
+ MC_CMD_FILTER_OP_IN_OP_SUBSCRIBE,
+ &hftp->hft_entry[ins_index].hfe_handle);
+ }
+
+ if (rc != 0)
+ goto fail4;
+
+ EFSYS_LOCK(enp->en_eslp, state);
+ locked = B_TRUE;
+
+ if (replacing) {
+ /* Update the fields that may differ */
+ saved_spec->efs_priority = spec->efs_priority;
+ saved_spec->efs_flags = spec->efs_flags;
+ saved_spec->efs_rss_context = spec->efs_rss_context;
+ saved_spec->efs_dmaq_id = spec->efs_dmaq_id;
+ }
+
+ hunt_filter_set_entry_not_busy(hftp, ins_index);
+
+out_unlock:
+
+ EFSYS_UNLOCK(enp->en_eslp, state);
+ locked = B_FALSE;
+
+ if (filter_id)
+ *filter_id = ins_index;
+
+ return (0);
+
+fail4:
+ EFSYS_PROBE(fail4);
+
+ if (!replacing) {
+ EFSYS_KMEM_FREE(enp->en_esip, sizeof (*spec), saved_spec);
+ saved_spec = NULL;
+ }
+ hunt_filter_set_entry_not_busy(hftp, ins_index);
+ hunt_filter_set_entry(hftp, ins_index, NULL);
+
+fail3:
+ EFSYS_PROBE(fail3);
+
+fail2:
+ EFSYS_PROBE(fail2);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ if (locked)
+ EFSYS_UNLOCK(enp->en_eslp, state);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_filter_add(
+ __in efx_nic_t *enp,
+ __inout efx_filter_spec_t *spec,
+ __in boolean_t may_replace)
+{
+ int rc;
+
+ rc = hunt_filter_add_internal(enp, spec, may_replace, NULL);
+ if (rc != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+
+static __checkReturn int
+hunt_filter_delete_internal(
+ __in efx_nic_t *enp,
+ __in uint32_t filter_id)
+{
+ int rc;
+ hunt_filter_table_t *table = enp->en_filter.ef_hunt_filter_table;
+ efx_filter_spec_t *spec;
+ int state;
+ uint32_t filter_idx = filter_id % EFX_HUNT_FILTER_TBL_ROWS;
+
+ /*
+ * Find the software table entry and mark it busy. Don't
+ * remove it yet; any attempt to update while we're waiting
+ * for the firmware must find the busy entry.
+ *
+ * FIXME: What if the busy flag is never cleared?
+ */
+ EFSYS_LOCK(enp->en_eslp, state);
+ while (hunt_filter_entry_is_busy(table, filter_idx)) {
+ EFSYS_UNLOCK(enp->en_eslp, state);
+ EFSYS_SPIN(1);
+ EFSYS_LOCK(enp->en_eslp, state);
+ }
+ if ((spec = hunt_filter_entry_spec(table, filter_idx)) != NULL) {
+ hunt_filter_set_entry_busy(table, filter_idx);
+ }
+ EFSYS_UNLOCK(enp->en_eslp, state);
+
+ if (spec == NULL) {
+ rc = ENOENT;
+ goto fail1;
+ }
+
+ /*
+ * Try to remove the hardware filter. This may fail if the MC has
+ * rebooted (which frees all hardware filter resources).
+ */
+ if (hunt_filter_is_exclusive(spec)) {
+ rc = efx_mcdi_filter_op_delete(enp,
+ MC_CMD_FILTER_OP_IN_OP_REMOVE,
+ &table->hft_entry[filter_idx].hfe_handle);
+ } else {
+ rc = efx_mcdi_filter_op_delete(enp,
+ MC_CMD_FILTER_OP_IN_OP_UNSUBSCRIBE,
+ &table->hft_entry[filter_idx].hfe_handle);
+ }
+
+ /* Free the software table entry */
+ EFSYS_LOCK(enp->en_eslp, state);
+ hunt_filter_set_entry_not_busy(table, filter_idx);
+ hunt_filter_set_entry(table, filter_idx, NULL);
+ EFSYS_UNLOCK(enp->en_eslp, state);
+
+ EFSYS_KMEM_FREE(enp->en_esip, sizeof (*spec), spec);
+
+ /* Check result of hardware filter removal */
+ if (rc != 0)
+ goto fail2;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_filter_delete(
+ __in efx_nic_t *enp,
+ __inout efx_filter_spec_t *spec)
+{
+ int rc;
+ hunt_filter_table_t *table = enp->en_filter.ef_hunt_filter_table;
+ efx_filter_spec_t *saved_spec;
+ unsigned int hash;
+ unsigned int depth;
+ unsigned int i;
+ int state;
+ boolean_t locked = B_FALSE;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+
+ hash = hunt_filter_hash(spec);
+
+ EFSYS_LOCK(enp->en_eslp, state);
+ locked = B_TRUE;
+
+ depth = 1;
+ for (;;) {
+ i = (hash + depth) & (EFX_HUNT_FILTER_TBL_ROWS - 1);
+ saved_spec = hunt_filter_entry_spec(table, i);
+ if (saved_spec && hunt_filter_equal(spec, saved_spec) &&
+ hunt_filter_same_dest(spec, saved_spec)) {
+ break;
+ }
+ if (depth == EFX_HUNT_FILTER_SEARCH_LIMIT) {
+ rc = ENOENT;
+ goto fail1;
+ }
+ depth++;
+ }
+
+ EFSYS_UNLOCK(enp->en_eslp, state);
+ locked = B_FALSE;
+
+ rc = hunt_filter_delete_internal(enp, i);
+ if (rc != 0)
+ goto fail2;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ if (locked)
+ EFSYS_UNLOCK(enp->en_eslp, state);
+
+ return (rc);
+}
+
+static __checkReturn int
+efx_mcdi_get_parser_disp_info(
+ __in efx_nic_t *enp,
+ __out uint32_t *list,
+ __out size_t *length)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_GET_PARSER_DISP_INFO_IN_LEN,
+ MC_CMD_GET_PARSER_DISP_INFO_OUT_LENMAX)];
+ int rc;
+ uint32_t i;
+ boolean_t support_unknown_ucast = B_FALSE;
+ boolean_t support_unknown_mcast = B_FALSE;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_GET_PARSER_DISP_INFO;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_GET_PARSER_DISP_INFO_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_GET_PARSER_DISP_INFO_OUT_LENMAX;
+
+ MCDI_IN_SET_DWORD(req, GET_PARSER_DISP_INFO_OUT_OP,
+ MC_CMD_GET_PARSER_DISP_INFO_IN_OP_GET_SUPPORTED_RX_MATCHES);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ *length = MCDI_OUT_DWORD(req,
+ GET_PARSER_DISP_INFO_OUT_NUM_SUPPORTED_MATCHES);
+
+ if (req.emr_out_length_used <
+ MC_CMD_GET_PARSER_DISP_INFO_OUT_LEN(*length)) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ memcpy(list,
+ MCDI_OUT2(req,
+ uint32_t,
+ GET_PARSER_DISP_INFO_OUT_SUPPORTED_MATCHES),
+ (*length) * sizeof (uint32_t));
+ EFX_STATIC_ASSERT(sizeof (uint32_t) ==
+ MC_CMD_GET_PARSER_DISP_INFO_OUT_SUPPORTED_MATCHES_LEN);
+
+ /*
+ * Remove UNKNOWN UCAST and MCAST flags, and if both are present, change
+ * the lower priority one to LOC_MAC_IG.
+ */
+ for (i = 0; i < *length; i++) {
+ if (list[i] & MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_UCAST_DST_LBN) {
+ list[i] &=
+ (~MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_UCAST_DST_LBN);
+ support_unknown_ucast = B_TRUE;
+ }
+ if (list[i] & MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_MCAST_DST_LBN) {
+ list[i] &=
+ (~MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_MCAST_DST_LBN);
+ support_unknown_mcast = B_TRUE;
+ }
+
+ if (support_unknown_ucast && support_unknown_mcast) {
+ list[i] &= EFX_FILTER_MATCH_LOC_MAC_IG;
+ break;
+ }
+ }
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_filter_supported_filters(
+ __in efx_nic_t *enp,
+ __out uint32_t *list,
+ __out size_t *length)
+{
+ int rc;
+
+ if ((rc = efx_mcdi_get_parser_disp_info(enp, list, length) != 0))
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+static __checkReturn int
+hunt_filter_unicast_refresh(
+ __in efx_nic_t *enp,
+ __in_ecount(6) uint8_t const *addr,
+ __in boolean_t all_unicst,
+ __in efx_filter_flag_t filter_flags)
+{
+ hunt_filter_table_t *hftp = enp->en_filter.ef_hunt_filter_table;
+ efx_filter_spec_t spec;
+ int rc;
+
+ if (all_unicst == B_TRUE)
+ goto use_uc_def;
+
+ /* Insert the filter for the local station address */
+ efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO,
+ filter_flags,
+ hftp->hft_default_rxq);
+ efx_filter_spec_set_eth_local(&spec, EFX_FILTER_SPEC_VID_UNSPEC, addr);
+
+ rc = hunt_filter_add_internal(enp, &spec, B_TRUE,
+ &hftp->hft_unicst_filter_index);
+ if (rc != 0) {
+ /*
+ * Fall back to an unknown filter. We may be able to subscribe
+ * to it even if we couldn't insert the unicast filter.
+ */
+ goto use_uc_def;
+ }
+ hftp->hft_unicst_filter_set = B_TRUE;
+
+ return (0);
+
+use_uc_def:
+ /* Insert the unknown unicast filter */
+ efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO,
+ filter_flags,
+ hftp->hft_default_rxq);
+ efx_filter_spec_set_uc_def(&spec);
+ rc = hunt_filter_add_internal(enp, &spec, B_TRUE,
+ &hftp->hft_unicst_filter_index);
+ if (rc != 0)
+ goto fail1;
+
+ hftp->hft_unicst_filter_set = B_TRUE;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ if (hftp->hft_unicst_filter_set != B_FALSE) {
+ (void) hunt_filter_delete_internal(enp,
+ hftp->hft_unicst_filter_index);
+
+ hftp->hft_unicst_filter_set = B_FALSE;
+ }
+
+ return (rc);
+}
+
+static __checkReturn int
+hunt_filter_multicast_refresh(
+ __in efx_nic_t *enp,
+ __in boolean_t mulcst,
+ __in boolean_t all_mulcst,
+ __in boolean_t brdcst,
+ __in_ecount(6*count) uint8_t const *addrs,
+ __in int count,
+ __in efx_filter_flag_t filter_flags)
+{
+ hunt_filter_table_t *hftp = enp->en_filter.ef_hunt_filter_table;
+ efx_filter_spec_t spec;
+ uint8_t addr[6];
+ unsigned i;
+ int rc;
+
+ if (all_mulcst == B_TRUE)
+ goto use_mc_def;
+
+ if (mulcst == B_FALSE)
+ count = 0;
+
+ if (count + (brdcst ? 1 : 0) >
+ EFX_ARRAY_SIZE(hftp->hft_mulcst_filter_indexes)) {
+ /* Too many MAC addresses; use unknown multicast filter */
+ goto use_mc_def;
+ }
+
+ /* Insert/renew multicast address list filters */
+ hftp->hft_mulcst_filter_count = count;
+ for (i = 0; i < hftp->hft_mulcst_filter_count; i++) {
+ efx_filter_spec_init_rx(&spec,
+ EFX_FILTER_PRI_AUTO,
+ filter_flags,
+ hftp->hft_default_rxq);
+
+ efx_filter_spec_set_eth_local(&spec,
+ EFX_FILTER_SPEC_VID_UNSPEC,
+ &addrs[i * EFX_MAC_ADDR_LEN]);
+
+ rc = hunt_filter_add_internal(enp, &spec, B_TRUE,
+ &hftp->hft_mulcst_filter_indexes[i]);
+ if (rc != 0) {
+ /* Rollback, then use unknown multicast filter */
+ goto rollback;
+ }
+ }
+
+ if (brdcst == B_TRUE) {
+ /* Insert/renew broadcast address filter */
+ hftp->hft_mulcst_filter_count++;
+ efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO,
+ filter_flags,
+ hftp->hft_default_rxq);
+
+ EFX_MAC_BROADCAST_ADDR_SET(addr);
+ efx_filter_spec_set_eth_local(&spec, EFX_FILTER_SPEC_VID_UNSPEC,
+ addr);
+
+ rc = hunt_filter_add_internal(enp, &spec, B_TRUE,
+ &hftp->hft_mulcst_filter_indexes[
+ hftp->hft_mulcst_filter_count - 1]);
+ if (rc != 0) {
+ /* Rollback, then use unknown multicast filter */
+ goto rollback;
+ }
+ }
+
+ return (0);
+
+rollback:
+ /*
+ * Rollback by removing any filters we have inserted
+ * before inserting the unknown multicast filter.
+ */
+ while (i--) {
+ (void) hunt_filter_delete_internal(enp,
+ hftp->hft_mulcst_filter_indexes[i]);
+ }
+ hftp->hft_mulcst_filter_count = 0;
+
+use_mc_def:
+ /* Insert the unknown multicast filter */
+ efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO,
+ filter_flags,
+ hftp->hft_default_rxq);
+ efx_filter_spec_set_mc_def(&spec);
+
+ rc = hunt_filter_add_internal(enp, &spec, B_TRUE,
+ &hftp->hft_mulcst_filter_indexes[0]);
+ if (rc != 0)
+ goto fail1;
+
+ hftp->hft_mulcst_filter_count = 1;
+
+ /*
+ * FIXME: If brdcst == B_FALSE, add a filter to drop broadcast traffic.
+ */
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+
+}
+
+
+static __checkReturn int
+hunt_filter_get_workarounds(
+ __in efx_nic_t *enp)
+{
+ efx_nic_cfg_t *encp = &enp->en_nic_cfg;
+ uint32_t implemented = 0;
+ uint32_t enabled = 0;
+ int rc;
+
+ rc = efx_mcdi_get_workarounds(enp, &implemented, &enabled);
+ if (rc == 0) {
+ /* Check if chained multicast filter support is enabled */
+ if (implemented & enabled & MC_CMD_GET_WORKAROUNDS_OUT_BUG26807)
+ encp->enc_bug26807_workaround = B_TRUE;
+ else
+ encp->enc_bug26807_workaround = B_FALSE;
+ } else if (rc == ENOTSUP) {
+ /*
+ * Firmware is too old to support GET_WORKAROUNDS, and support
+ * for this workaround was implemented later.
+ */
+ encp->enc_bug26807_workaround = B_FALSE;
+ } else {
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+
+}
+
+
+/*
+ * Reconfigure all filters.
+ * If all_unicst and/or all mulcst filters cannot be applied then
+ * return ENOTSUP (Note the filters for the specified addresses are
+ * still applied in this case).
+ */
+ __checkReturn int
+hunt_filter_reconfigure(
+ __in efx_nic_t *enp,
+ __in_ecount(6) uint8_t const *mac_addr,
+ __in boolean_t all_unicst,
+ __in boolean_t mulcst,
+ __in boolean_t all_mulcst,
+ __in boolean_t brdcst,
+ __in_ecount(6*count) uint8_t const *addrs,
+ __in int count)
+{
+ hunt_filter_table_t *table = enp->en_filter.ef_hunt_filter_table;
+ efx_filter_flag_t filter_flags;
+ unsigned i;
+ int all_unicst_rc;
+ int all_mulcst_rc;
+ int rc;
+
+ if (table->hft_default_rxq == NULL) {
+ /*
+ * Filters direct traffic to the default RXQ, and so cannot be
+ * inserted until it is available. Any currently configured
+ * filters must be removed (ignore errors in case the MC
+ * has rebooted, which removes hardware filters).
+ */
+ if (table->hft_unicst_filter_set != B_FALSE) {
+ (void) hunt_filter_delete_internal(enp,
+ table->hft_unicst_filter_index);
+ table->hft_unicst_filter_set = B_FALSE;
+ }
+ for (i = 0; i < table->hft_mulcst_filter_count; i++) {
+ (void) hunt_filter_delete_internal(enp,
+ table->hft_mulcst_filter_indexes[i]);
+ }
+ table->hft_mulcst_filter_count = 0;
+
+ return (0);
+ }
+
+ if (table->hft_using_rss)
+ filter_flags = EFX_FILTER_FLAG_RX_RSS;
+ else
+ filter_flags = 0;
+
+ /* Mark old filters which may need to be removed */
+ if (table->hft_unicst_filter_set != B_FALSE) {
+ hunt_filter_set_entry_auto_old(table,
+ table->hft_unicst_filter_index);
+ }
+ for (i = 0; i < table->hft_mulcst_filter_count; i++) {
+ hunt_filter_set_entry_auto_old(table,
+ table->hft_mulcst_filter_indexes[i]);
+ }
+
+ /* Insert or renew unicast filters */
+ if ((all_unicst_rc = hunt_filter_unicast_refresh(enp, mac_addr,
+ all_unicst, filter_flags)) != 0) {
+ if (all_unicst == B_FALSE) {
+ rc = all_unicst_rc;
+ goto fail1;
+ }
+ /* Retry without all_unicast flag */
+ rc = hunt_filter_unicast_refresh(enp, mac_addr,
+ B_FALSE, filter_flags);
+ if (rc != 0)
+ goto fail2;
+ }
+
+ /*
+ * WORKAROUND_BUG26807 controls firmware support for chained multicast
+ * filters, and can only be enabled or disabled when the hardware filter
+ * table is empty.
+ *
+ * Firmware will reset (FLR) functions which have inserted filters in
+ * the hardware filter table when the workaround is enabled/disabled.
+ * Functions without any hardware filters are not reset.
+ *
+ * Re-check if the workaround is enabled after adding unicast hardware
+ * filters. This ensures that encp->enc_workaround_bug26807 matches the
+ * firmware state, and that later changes to enable/disable the
+ * workaround will result in this function seeing a reset (FLR).
+ */
+ if ((rc = hunt_filter_get_workarounds(enp)) != 0)
+ goto fail3;
+
+ /* Insert or renew multicast filters */
+ if ((all_mulcst_rc = hunt_filter_multicast_refresh(enp, mulcst,
+ all_mulcst, brdcst,
+ addrs, count, filter_flags)) != 0) {
+ if (all_mulcst == B_FALSE) {
+ rc = all_mulcst_rc;
+ goto fail4;
+ }
+ /* Retry without all_mulcast flag */
+ rc = hunt_filter_multicast_refresh(enp, mulcst,
+ B_FALSE, brdcst,
+ addrs, count, filter_flags);
+ if (rc != 0)
+ goto fail5;
+ }
+
+ /* Remove old filters which were not renewed */
+ for (i = 0; i < EFX_ARRAY_SIZE(table->hft_entry); i++) {
+ if (hunt_filter_entry_is_auto_old(table, i)) {
+ (void) hunt_filter_delete_internal(enp, i);
+ }
+ }
+
+ /* report if any optional flags were rejected */
+ if (((all_unicst != B_FALSE) && (all_unicst_rc != 0)) ||
+ ((all_mulcst != B_FALSE) && (all_mulcst_rc != 0))) {
+ rc = ENOTSUP;
+ }
+
+ return (rc);
+
+fail5:
+ EFSYS_PROBE(fail5);
+fail4:
+ EFSYS_PROBE(fail4);
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ /* Clear auto old flags */
+ for (i = 0; i < EFX_ARRAY_SIZE(table->hft_entry); i++) {
+ if (hunt_filter_entry_is_auto_old(table, i)) {
+ hunt_filter_set_entry_not_auto_old(table, i);
+ }
+ }
+
+ return (rc);
+}
+
+ void
+hunt_filter_get_default_rxq(
+ __in efx_nic_t *enp,
+ __out efx_rxq_t **erpp,
+ __out boolean_t *using_rss)
+{
+ hunt_filter_table_t *table = enp->en_filter.ef_hunt_filter_table;
+
+ *erpp = table->hft_default_rxq;
+ *using_rss = table->hft_using_rss;
+}
+
+
+ void
+hunt_filter_default_rxq_set(
+ __in efx_nic_t *enp,
+ __in efx_rxq_t *erp,
+ __in boolean_t using_rss)
+{
+ hunt_filter_table_t *table = enp->en_filter.ef_hunt_filter_table;
+
+#if EFSYS_OPT_RX_SCALE
+ EFSYS_ASSERT((using_rss == B_FALSE) ||
+ (enp->en_rss_context != HUNTINGTON_RSS_CONTEXT_INVALID));
+ table->hft_using_rss = using_rss;
+#else
+ EFSYS_ASSERT(using_rss == B_FALSE);
+ table->hft_using_rss = B_FALSE;
+#endif
+ table->hft_default_rxq = erp;
+}
+
+ void
+hunt_filter_default_rxq_clear(
+ __in efx_nic_t *enp)
+{
+ hunt_filter_table_t *table = enp->en_filter.ef_hunt_filter_table;
+
+ table->hft_default_rxq = NULL;
+ table->hft_using_rss = B_FALSE;
+}
+
+
+#endif /* EFSYS_OPT_FILTER */
+
+#endif /* EFSYS_OPT_HUNTINGTON */
diff --git a/sys/dev/sfxge/common/hunt_impl.h b/sys/dev/sfxge/common/hunt_impl.h
new file mode 100644
index 0000000..d1a4c94
--- /dev/null
+++ b/sys/dev/sfxge/common/hunt_impl.h
@@ -0,0 +1,1015 @@
+/*-
+ * Copyright (c) 2012-2015 Solarflare Communications Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _SYS_HUNT_IMPL_H
+#define _SYS_HUNT_IMPL_H
+
+#include "efx.h"
+#include "efx_regs.h"
+#include "efx_regs_ef10.h"
+#include "efx_mcdi.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define HUNTINGTON_NVRAM_CHUNK 0x80
+
+/* Alignment requirement for value written to RX WPTR:
+ * the WPTR must be aligned to an 8 descriptor boundary
+ */
+#define HUNTINGTON_RX_WPTR_ALIGN 8
+
+/* Invalid RSS context handle */
+#define HUNTINGTON_RSS_CONTEXT_INVALID (0xffffffff)
+
+
+/* EV */
+
+ __checkReturn int
+hunt_ev_init(
+ __in efx_nic_t *enp);
+
+ void
+hunt_ev_fini(
+ __in efx_nic_t *enp);
+
+ __checkReturn int
+hunt_ev_qcreate(
+ __in efx_nic_t *enp,
+ __in unsigned int index,
+ __in efsys_mem_t *esmp,
+ __in size_t n,
+ __in uint32_t id,
+ __in efx_evq_t *eep);
+
+ void
+hunt_ev_qdestroy(
+ __in efx_evq_t *eep);
+
+ __checkReturn int
+hunt_ev_qprime(
+ __in efx_evq_t *eep,
+ __in unsigned int count);
+
+ void
+hunt_ev_qpost(
+ __in efx_evq_t *eep,
+ __in uint16_t data);
+
+ __checkReturn int
+hunt_ev_qmoderate(
+ __in efx_evq_t *eep,
+ __in unsigned int us);
+
+#if EFSYS_OPT_QSTATS
+ void
+hunt_ev_qstats_update(
+ __in efx_evq_t *eep,
+ __inout_ecount(EV_NQSTATS) efsys_stat_t *stat);
+#endif /* EFSYS_OPT_QSTATS */
+
+ void
+hunt_ev_rxlabel_init(
+ __in efx_evq_t *eep,
+ __in efx_rxq_t *erp,
+ __in unsigned int label);
+
+ void
+hunt_ev_rxlabel_fini(
+ __in efx_evq_t *eep,
+ __in unsigned int label);
+
+/* INTR */
+
+ __checkReturn int
+hunt_intr_init(
+ __in efx_nic_t *enp,
+ __in efx_intr_type_t type,
+ __in efsys_mem_t *esmp);
+
+ void
+hunt_intr_enable(
+ __in efx_nic_t *enp);
+
+ void
+hunt_intr_disable(
+ __in efx_nic_t *enp);
+
+ void
+hunt_intr_disable_unlocked(
+ __in efx_nic_t *enp);
+
+ __checkReturn int
+hunt_intr_trigger(
+ __in efx_nic_t *enp,
+ __in unsigned int level);
+
+ void
+hunt_intr_fini(
+ __in efx_nic_t *enp);
+
+/* NIC */
+
+extern __checkReturn int
+hunt_nic_probe(
+ __in efx_nic_t *enp);
+
+extern __checkReturn int
+hunt_nic_set_drv_limits(
+ __inout efx_nic_t *enp,
+ __in efx_drv_limits_t *edlp);
+
+extern __checkReturn int
+hunt_nic_get_vi_pool(
+ __in efx_nic_t *enp,
+ __out uint32_t *vi_countp);
+
+extern __checkReturn int
+hunt_nic_get_bar_region(
+ __in efx_nic_t *enp,
+ __in efx_nic_region_t region,
+ __out uint32_t *offsetp,
+ __out size_t *sizep);
+
+extern __checkReturn int
+hunt_nic_reset(
+ __in efx_nic_t *enp);
+
+extern __checkReturn int
+hunt_nic_init(
+ __in efx_nic_t *enp);
+
+#if EFSYS_OPT_DIAG
+
+extern __checkReturn int
+hunt_nic_register_test(
+ __in efx_nic_t *enp);
+
+#endif /* EFSYS_OPT_DIAG */
+
+extern void
+hunt_nic_fini(
+ __in efx_nic_t *enp);
+
+extern void
+hunt_nic_unprobe(
+ __in efx_nic_t *enp);
+
+
+/* MAC */
+
+extern __checkReturn int
+hunt_mac_poll(
+ __in efx_nic_t *enp,
+ __out efx_link_mode_t *link_modep);
+
+extern __checkReturn int
+hunt_mac_up(
+ __in efx_nic_t *enp,
+ __out boolean_t *mac_upp);
+
+extern __checkReturn int
+hunt_mac_addr_set(
+ __in efx_nic_t *enp);
+
+extern __checkReturn int
+hunt_mac_reconfigure(
+ __in efx_nic_t *enp);
+
+extern __checkReturn int
+hunt_mac_multicast_list_set(
+ __in efx_nic_t *enp);
+
+extern __checkReturn int
+hunt_mac_filter_default_rxq_set(
+ __in efx_nic_t *enp,
+ __in efx_rxq_t *erp,
+ __in boolean_t using_rss);
+
+extern void
+hunt_mac_filter_default_rxq_clear(
+ __in efx_nic_t *enp);
+
+#if EFSYS_OPT_LOOPBACK
+
+extern __checkReturn int
+hunt_mac_loopback_set(
+ __in efx_nic_t *enp,
+ __in efx_link_mode_t link_mode,
+ __in efx_loopback_type_t loopback_type);
+
+#endif /* EFSYS_OPT_LOOPBACK */
+
+#if EFSYS_OPT_MAC_STATS
+
+extern __checkReturn int
+hunt_mac_stats_update(
+ __in efx_nic_t *enp,
+ __in efsys_mem_t *esmp,
+ __out_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat,
+ __out_opt uint32_t *generationp);
+
+#endif /* EFSYS_OPT_MAC_STATS */
+
+
+/* MCDI */
+
+#if EFSYS_OPT_MCDI
+
+extern __checkReturn int
+hunt_mcdi_init(
+ __in efx_nic_t *enp,
+ __in const efx_mcdi_transport_t *mtp);
+
+extern void
+hunt_mcdi_fini(
+ __in efx_nic_t *enp);
+
+extern void
+hunt_mcdi_request_copyin(
+ __in efx_nic_t *enp,
+ __in efx_mcdi_req_t *emrp,
+ __in unsigned int seq,
+ __in boolean_t ev_cpl,
+ __in boolean_t new_epoch);
+
+extern __checkReturn boolean_t
+hunt_mcdi_request_poll(
+ __in efx_nic_t *enp);
+
+extern void
+hunt_mcdi_request_copyout(
+ __in efx_nic_t *enp,
+ __in efx_mcdi_req_t *emrp);
+
+extern int
+hunt_mcdi_poll_reboot(
+ __in efx_nic_t *enp);
+
+extern __checkReturn int
+hunt_mcdi_fw_update_supported(
+ __in efx_nic_t *enp,
+ __out boolean_t *supportedp);
+
+extern __checkReturn int
+hunt_mcdi_macaddr_change_supported(
+ __in efx_nic_t *enp,
+ __out boolean_t *supportedp);
+
+#endif /* EFSYS_OPT_MCDI */
+
+/* NVRAM */
+
+#if EFSYS_OPT_NVRAM || EFSYS_OPT_VPD
+
+extern __checkReturn int
+hunt_nvram_buf_read_tlv(
+ __in efx_nic_t *enp,
+ __in_bcount(partn_size) caddr_t partn_data,
+ __in size_t partn_size,
+ __in uint32_t tag,
+ __deref_out_bcount_opt(*sizep) caddr_t *datap,
+ __out size_t *sizep);
+
+extern __checkReturn int
+hunt_nvram_buf_write_tlv(
+ __inout_bcount(partn_size) caddr_t partn_data,
+ __in size_t partn_size,
+ __in uint32_t tag,
+ __in_bcount(tag_size) caddr_t tag_data,
+ __in size_t tag_size,
+ __out size_t *total_lengthp);
+
+extern __checkReturn int
+hunt_nvram_partn_read_tlv(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __in uint32_t tag,
+ __deref_out_bcount_opt(*sizep) caddr_t *datap,
+ __out size_t *sizep);
+
+extern __checkReturn int
+hunt_nvram_partn_write_tlv(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __in uint32_t tag,
+ __in_bcount(size) caddr_t data,
+ __in size_t size);
+
+extern __checkReturn int
+hunt_nvram_partn_size(
+ __in efx_nic_t *enp,
+ __in unsigned int partn,
+ __out size_t *sizep);
+
+extern __checkReturn int
+hunt_nvram_partn_lock(
+ __in efx_nic_t *enp,
+ __in unsigned int partn);
+
+extern __checkReturn int
+hunt_nvram_partn_read(
+ __in efx_nic_t *enp,
+ __in unsigned int partn,
+ __in unsigned int offset,
+ __out_bcount(size) caddr_t data,
+ __in size_t size);
+
+extern __checkReturn int
+hunt_nvram_partn_erase(
+ __in efx_nic_t *enp,
+ __in unsigned int partn,
+ __in unsigned int offset,
+ __in size_t size);
+
+extern __checkReturn int
+hunt_nvram_partn_write(
+ __in efx_nic_t *enp,
+ __in unsigned int partn,
+ __in unsigned int offset,
+ __out_bcount(size) caddr_t data,
+ __in size_t size);
+
+extern void
+hunt_nvram_partn_unlock(
+ __in efx_nic_t *enp,
+ __in unsigned int partn);
+
+#endif /* EFSYS_OPT_NVRAM || EFSYS_OPT_VPD */
+
+#if EFSYS_OPT_NVRAM
+
+#if EFSYS_OPT_DIAG
+
+extern __checkReturn int
+hunt_nvram_test(
+ __in efx_nic_t *enp);
+
+#endif /* EFSYS_OPT_DIAG */
+
+extern __checkReturn int
+hunt_nvram_size(
+ __in efx_nic_t *enp,
+ __in efx_nvram_type_t type,
+ __out size_t *sizep);
+
+extern __checkReturn int
+hunt_nvram_get_version(
+ __in efx_nic_t *enp,
+ __in efx_nvram_type_t type,
+ __out uint32_t *subtypep,
+ __out_ecount(4) uint16_t version[4]);
+
+extern __checkReturn int
+hunt_nvram_rw_start(
+ __in efx_nic_t *enp,
+ __in efx_nvram_type_t type,
+ __out size_t *pref_chunkp);
+
+extern __checkReturn int
+hunt_nvram_read_chunk(
+ __in efx_nic_t *enp,
+ __in efx_nvram_type_t type,
+ __in unsigned int offset,
+ __out_bcount(size) caddr_t data,
+ __in size_t size);
+
+extern __checkReturn int
+hunt_nvram_erase(
+ __in efx_nic_t *enp,
+ __in efx_nvram_type_t type);
+
+extern __checkReturn int
+hunt_nvram_write_chunk(
+ __in efx_nic_t *enp,
+ __in efx_nvram_type_t type,
+ __in unsigned int offset,
+ __in_bcount(size) caddr_t data,
+ __in size_t size);
+
+extern void
+hunt_nvram_rw_finish(
+ __in efx_nic_t *enp,
+ __in efx_nvram_type_t type);
+
+extern __checkReturn int
+hunt_nvram_partn_set_version(
+ __in efx_nic_t *enp,
+ __in unsigned int partn,
+ __in_ecount(4) uint16_t version[4]);
+
+extern __checkReturn int
+hunt_nvram_set_version(
+ __in efx_nic_t *enp,
+ __in efx_nvram_type_t type,
+ __in_ecount(4) uint16_t version[4]);
+
+#endif /* EFSYS_OPT_NVRAM */
+
+
+/* PHY */
+
+typedef struct hunt_link_state_s {
+ uint32_t hls_adv_cap_mask;
+ uint32_t hls_lp_cap_mask;
+ unsigned int hls_fcntl;
+ efx_link_mode_t hls_link_mode;
+#if EFSYS_OPT_LOOPBACK
+ efx_loopback_type_t hls_loopback;
+#endif
+ boolean_t hls_mac_up;
+} hunt_link_state_t;
+
+extern void
+hunt_phy_link_ev(
+ __in efx_nic_t *enp,
+ __in efx_qword_t *eqp,
+ __out efx_link_mode_t *link_modep);
+
+extern __checkReturn int
+hunt_phy_get_link(
+ __in efx_nic_t *enp,
+ __out hunt_link_state_t *hlsp);
+
+extern __checkReturn int
+hunt_phy_power(
+ __in efx_nic_t *enp,
+ __in boolean_t on);
+
+extern __checkReturn int
+hunt_phy_reconfigure(
+ __in efx_nic_t *enp);
+
+extern __checkReturn int
+hunt_phy_verify(
+ __in efx_nic_t *enp);
+
+extern __checkReturn int
+hunt_phy_oui_get(
+ __in efx_nic_t *enp,
+ __out uint32_t *ouip);
+
+#if EFSYS_OPT_PHY_STATS
+
+extern __checkReturn int
+hunt_phy_stats_update(
+ __in efx_nic_t *enp,
+ __in efsys_mem_t *esmp,
+ __out_ecount(EFX_PHY_NSTATS) uint32_t *stat);
+
+#endif /* EFSYS_OPT_PHY_STATS */
+
+#if EFSYS_OPT_PHY_PROPS
+
+#if EFSYS_OPT_NAMES
+
+extern const char *
+hunt_phy_prop_name(
+ __in efx_nic_t *enp,
+ __in unsigned int id);
+
+#endif /* EFSYS_OPT_NAMES */
+
+extern __checkReturn int
+hunt_phy_prop_get(
+ __in efx_nic_t *enp,
+ __in unsigned int id,
+ __in uint32_t flags,
+ __out uint32_t *valp);
+
+extern __checkReturn int
+hunt_phy_prop_set(
+ __in efx_nic_t *enp,
+ __in unsigned int id,
+ __in uint32_t val);
+
+#endif /* EFSYS_OPT_PHY_PROPS */
+
+#if EFSYS_OPT_BIST
+
+extern __checkReturn int
+hunt_bist_enable_offline(
+ __in efx_nic_t *enp);
+
+extern __checkReturn int
+hunt_bist_start(
+ __in efx_nic_t *enp,
+ __in efx_bist_type_t type);
+
+extern __checkReturn int
+hunt_bist_poll(
+ __in efx_nic_t *enp,
+ __in efx_bist_type_t type,
+ __out efx_bist_result_t *resultp,
+ __out_opt __drv_when(count > 0, __notnull)
+ uint32_t *value_maskp,
+ __out_ecount_opt(count) __drv_when(count > 0, __notnull)
+ unsigned long *valuesp,
+ __in size_t count);
+
+extern void
+hunt_bist_stop(
+ __in efx_nic_t *enp,
+ __in efx_bist_type_t type);
+
+#endif /* EFSYS_OPT_BIST */
+
+
+/* SRAM */
+
+#if EFSYS_OPT_DIAG
+
+extern __checkReturn int
+hunt_sram_test(
+ __in efx_nic_t *enp,
+ __in efx_sram_pattern_fn_t func);
+
+#endif /* EFSYS_OPT_DIAG */
+
+
+/* TX */
+
+extern __checkReturn int
+hunt_tx_init(
+ __in efx_nic_t *enp);
+
+extern void
+hunt_tx_fini(
+ __in efx_nic_t *enp);
+
+extern __checkReturn int
+hunt_tx_qcreate(
+ __in efx_nic_t *enp,
+ __in unsigned int index,
+ __in unsigned int label,
+ __in efsys_mem_t *esmp,
+ __in size_t n,
+ __in uint32_t id,
+ __in uint16_t flags,
+ __in efx_evq_t *eep,
+ __in efx_txq_t *etp,
+ __out unsigned int *addedp);
+
+extern void
+hunt_tx_qdestroy(
+ __in efx_txq_t *etp);
+
+extern __checkReturn int
+hunt_tx_qpost(
+ __in efx_txq_t *etp,
+ __in_ecount(n) efx_buffer_t *eb,
+ __in unsigned int n,
+ __in unsigned int completed,
+ __inout unsigned int *addedp);
+
+extern void
+hunt_tx_qpush(
+ __in efx_txq_t *etp,
+ __in unsigned int added,
+ __in unsigned int pushed);
+
+extern __checkReturn int
+hunt_tx_qpace(
+ __in efx_txq_t *etp,
+ __in unsigned int ns);
+
+extern __checkReturn int
+hunt_tx_qflush(
+ __in efx_txq_t *etp);
+
+extern void
+hunt_tx_qenable(
+ __in efx_txq_t *etp);
+
+extern __checkReturn int
+hunt_tx_qpio_enable(
+ __in efx_txq_t *etp);
+
+extern void
+hunt_tx_qpio_disable(
+ __in efx_txq_t *etp);
+
+extern __checkReturn int
+hunt_tx_qpio_write(
+ __in efx_txq_t *etp,
+ __in_ecount(buf_length) uint8_t *buffer,
+ __in size_t buf_length,
+ __in size_t pio_buf_offset);
+
+extern __checkReturn int
+hunt_tx_qpio_post(
+ __in efx_txq_t *etp,
+ __in size_t pkt_length,
+ __in unsigned int completed,
+ __inout unsigned int *addedp);
+
+extern __checkReturn int
+hunt_tx_qdesc_post(
+ __in efx_txq_t *etp,
+ __in_ecount(n) efx_desc_t *ed,
+ __in unsigned int n,
+ __in unsigned int completed,
+ __inout unsigned int *addedp);
+
+extern void
+hunt_tx_qdesc_dma_create(
+ __in efx_txq_t *etp,
+ __in efsys_dma_addr_t addr,
+ __in size_t size,
+ __in boolean_t eop,
+ __out efx_desc_t *edp);
+
+extern void
+hunt_tx_qdesc_tso_create(
+ __in efx_txq_t *etp,
+ __in uint16_t ipv4_id,
+ __in uint32_t tcp_seq,
+ __in uint8_t tcp_flags,
+ __out efx_desc_t *edp);
+
+extern void
+hunt_tx_qdesc_vlantci_create(
+ __in efx_txq_t *etp,
+ __in uint16_t vlan_tci,
+ __out efx_desc_t *edp);
+
+
+#if EFSYS_OPT_QSTATS
+
+extern void
+hunt_tx_qstats_update(
+ __in efx_txq_t *etp,
+ __inout_ecount(TX_NQSTATS) efsys_stat_t *stat);
+
+#endif /* EFSYS_OPT_QSTATS */
+
+/* PIO */
+
+/* Missing register definitions */
+#ifndef ER_DZ_TX_PIOBUF_OFST
+#define ER_DZ_TX_PIOBUF_OFST 0x00001000
+#endif
+#ifndef ER_DZ_TX_PIOBUF_STEP
+#define ER_DZ_TX_PIOBUF_STEP 8192
+#endif
+#ifndef ER_DZ_TX_PIOBUF_ROWS
+#define ER_DZ_TX_PIOBUF_ROWS 2048
+#endif
+
+#ifndef ER_DZ_TX_PIOBUF_SIZE
+#define ER_DZ_TX_PIOBUF_SIZE 2048
+#endif
+
+#define HUNT_PIOBUF_NBUFS (16)
+#define HUNT_PIOBUF_SIZE (ER_DZ_TX_PIOBUF_SIZE)
+
+#define HUNT_MIN_PIO_ALLOC_SIZE (HUNT_PIOBUF_SIZE / 32)
+
+typedef uint32_t efx_piobuf_handle_t;
+
+#define EFX_PIOBUF_HANDLE_INVALID ((efx_piobuf_handle_t) -1)
+
+extern __checkReturn int
+hunt_nic_pio_alloc(
+ __inout efx_nic_t *enp,
+ __out uint32_t *bufnump,
+ __out efx_piobuf_handle_t *handlep,
+ __out uint32_t *blknump,
+ __out uint32_t *offsetp,
+ __out size_t *sizep);
+
+extern __checkReturn int
+hunt_nic_pio_free(
+ __inout efx_nic_t *enp,
+ __in uint32_t bufnum,
+ __in uint32_t blknum);
+
+extern __checkReturn int
+hunt_nic_pio_link(
+ __inout efx_nic_t *enp,
+ __in uint32_t vi_index,
+ __in efx_piobuf_handle_t handle);
+
+extern __checkReturn int
+hunt_nic_pio_unlink(
+ __inout efx_nic_t *enp,
+ __in uint32_t vi_index);
+
+
+/* VPD */
+
+#if EFSYS_OPT_VPD
+
+extern __checkReturn int
+hunt_vpd_init(
+ __in efx_nic_t *enp);
+
+extern __checkReturn int
+hunt_vpd_size(
+ __in efx_nic_t *enp,
+ __out size_t *sizep);
+
+extern __checkReturn int
+hunt_vpd_read(
+ __in efx_nic_t *enp,
+ __out_bcount(size) caddr_t data,
+ __in size_t size);
+
+extern __checkReturn int
+hunt_vpd_verify(
+ __in efx_nic_t *enp,
+ __in_bcount(size) caddr_t data,
+ __in size_t size);
+
+extern __checkReturn int
+hunt_vpd_reinit(
+ __in efx_nic_t *enp,
+ __in_bcount(size) caddr_t data,
+ __in size_t size);
+
+extern __checkReturn int
+hunt_vpd_get(
+ __in efx_nic_t *enp,
+ __in_bcount(size) caddr_t data,
+ __in size_t size,
+ __inout efx_vpd_value_t *evvp);
+
+extern __checkReturn int
+hunt_vpd_set(
+ __in efx_nic_t *enp,
+ __in_bcount(size) caddr_t data,
+ __in size_t size,
+ __in efx_vpd_value_t *evvp);
+
+extern __checkReturn int
+hunt_vpd_next(
+ __in efx_nic_t *enp,
+ __in_bcount(size) caddr_t data,
+ __in size_t size,
+ __out efx_vpd_value_t *evvp,
+ __inout unsigned int *contp);
+
+extern __checkReturn int
+hunt_vpd_write(
+ __in efx_nic_t *enp,
+ __in_bcount(size) caddr_t data,
+ __in size_t size);
+
+extern void
+hunt_vpd_fini(
+ __in efx_nic_t *enp);
+
+#endif /* EFSYS_OPT_VPD */
+
+
+/* RX */
+
+extern __checkReturn int
+hunt_rx_init(
+ __in efx_nic_t *enp);
+
+#if EFSYS_OPT_RX_HDR_SPLIT
+extern __checkReturn int
+hunt_rx_hdr_split_enable(
+ __in efx_nic_t *enp,
+ __in unsigned int hdr_buf_size,
+ __in unsigned int pld_buf_size);
+#endif /* EFSYS_OPT_RX_HDR_SPLIT */
+
+#if EFSYS_OPT_RX_SCATTER
+extern __checkReturn int
+hunt_rx_scatter_enable(
+ __in efx_nic_t *enp,
+ __in unsigned int buf_size);
+#endif /* EFSYS_OPT_RX_SCATTER */
+
+
+#if EFSYS_OPT_RX_SCALE
+
+extern __checkReturn int
+hunt_rx_scale_mode_set(
+ __in efx_nic_t *enp,
+ __in efx_rx_hash_alg_t alg,
+ __in efx_rx_hash_type_t type,
+ __in boolean_t insert);
+
+extern __checkReturn int
+hunt_rx_scale_key_set(
+ __in efx_nic_t *enp,
+ __in_ecount(n) uint8_t *key,
+ __in size_t n);
+
+extern __checkReturn int
+hunt_rx_scale_tbl_set(
+ __in efx_nic_t *enp,
+ __in_ecount(n) unsigned int *table,
+ __in size_t n);
+
+#endif /* EFSYS_OPT_RX_SCALE */
+
+extern void
+hunt_rx_qpost(
+ __in efx_rxq_t *erp,
+ __in_ecount(n) efsys_dma_addr_t *addrp,
+ __in size_t size,
+ __in unsigned int n,
+ __in unsigned int completed,
+ __in unsigned int added);
+
+extern void
+hunt_rx_qpush(
+ __in efx_rxq_t *erp,
+ __in unsigned int added,
+ __inout unsigned int *pushedp);
+
+extern __checkReturn int
+hunt_rx_qflush(
+ __in efx_rxq_t *erp);
+
+extern void
+hunt_rx_qenable(
+ __in efx_rxq_t *erp);
+
+extern __checkReturn int
+hunt_rx_qcreate(
+ __in efx_nic_t *enp,
+ __in unsigned int index,
+ __in unsigned int label,
+ __in efx_rxq_type_t type,
+ __in efsys_mem_t *esmp,
+ __in size_t n,
+ __in uint32_t id,
+ __in efx_evq_t *eep,
+ __in efx_rxq_t *erp);
+
+extern void
+hunt_rx_qdestroy(
+ __in efx_rxq_t *erp);
+
+extern void
+hunt_rx_fini(
+ __in efx_nic_t *enp);
+
+#if EFSYS_OPT_FILTER
+
+typedef struct hunt_filter_handle_s {
+ uint32_t hfh_lo;
+ uint32_t hfh_hi;
+} hunt_filter_handle_t;
+
+typedef struct hunt_filter_entry_s {
+ uintptr_t hfe_spec; /* pointer to filter spec plus busy bit */
+ hunt_filter_handle_t hfe_handle;
+} hunt_filter_entry_t;
+
+/*
+ * BUSY flag indicates that an update is in progress.
+ * AUTO_OLD flag is used to mark and sweep MAC packet filters.
+ */
+#define EFX_HUNT_FILTER_FLAG_BUSY 1U
+#define EFX_HUNT_FILTER_FLAG_AUTO_OLD 2U
+#define EFX_HUNT_FILTER_FLAGS 3U
+
+#define EFX_HUNT_FILTER_TBL_ROWS 8192
+
+/* Allow for the broadcast address to be added to the multicast list */
+#define EFX_HUNT_FILTER_MULTICAST_FILTERS_MAX (EFX_MAC_MULTICAST_LIST_MAX + 1)
+
+typedef struct hunt_filter_table_s {
+ hunt_filter_entry_t hft_entry[EFX_HUNT_FILTER_TBL_ROWS];
+ efx_rxq_t * hft_default_rxq;
+ boolean_t hft_using_rss;
+ uint32_t hft_unicst_filter_index;
+ boolean_t hft_unicst_filter_set;
+ uint32_t hft_mulcst_filter_indexes[
+ EFX_HUNT_FILTER_MULTICAST_FILTERS_MAX];
+ uint32_t hft_mulcst_filter_count;
+} hunt_filter_table_t;
+
+ __checkReturn int
+hunt_filter_init(
+ __in efx_nic_t *enp);
+
+ void
+hunt_filter_fini(
+ __in efx_nic_t *enp);
+
+ __checkReturn int
+hunt_filter_restore(
+ __in efx_nic_t *enp);
+
+ __checkReturn int
+hunt_filter_add(
+ __in efx_nic_t *enp,
+ __inout efx_filter_spec_t *spec,
+ __in boolean_t may_replace);
+
+ __checkReturn int
+hunt_filter_delete(
+ __in efx_nic_t *enp,
+ __inout efx_filter_spec_t *spec);
+
+extern __checkReturn int
+hunt_filter_supported_filters(
+ __in efx_nic_t *enp,
+ __out uint32_t *list,
+ __out size_t *length);
+
+extern __checkReturn int
+hunt_filter_reconfigure(
+ __in efx_nic_t *enp,
+ __in_ecount(6) uint8_t const *mac_addr,
+ __in boolean_t all_unicst,
+ __in boolean_t mulcst,
+ __in boolean_t all_mulcst,
+ __in boolean_t brdcst,
+ __in_ecount(6*count) uint8_t const *addrs,
+ __in int count);
+
+extern void
+hunt_filter_get_default_rxq(
+ __in efx_nic_t *enp,
+ __out efx_rxq_t **erpp,
+ __out boolean_t *using_rss);
+
+extern void
+hunt_filter_default_rxq_set(
+ __in efx_nic_t *enp,
+ __in efx_rxq_t *erp,
+ __in boolean_t using_rss);
+
+extern void
+hunt_filter_default_rxq_clear(
+ __in efx_nic_t *enp);
+
+
+#endif /* EFSYS_OPT_FILTER */
+
+extern __checkReturn int
+hunt_pktfilter_set(
+ __in efx_nic_t *enp,
+ __in boolean_t unicst,
+ __in boolean_t brdcst);
+
+#if EFSYS_OPT_MCAST_FILTER_LIST
+
+extern __checkReturn int
+hunt_pktfilter_mcast_set(
+ __in efx_nic_t *enp,
+ __in uint8_t const *addrs,
+ __in int count);
+
+#endif /* EFSYS_OPT_MCAST_FILTER_LIST */
+
+extern __checkReturn int
+hunt_pktfilter_mcast_all(
+ __in efx_nic_t *enp);
+
+extern __checkReturn int
+efx_mcdi_get_function_info(
+ __in efx_nic_t *enp,
+ __out uint32_t *pfp,
+ __out_opt uint32_t *vfp);
+
+extern __checkReturn int
+efx_mcdi_privilege_mask(
+ __in efx_nic_t *enp,
+ __in uint32_t pf,
+ __in uint32_t vf,
+ __out uint32_t *maskp);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SYS_HUNT_IMPL_H */
diff --git a/sys/dev/sfxge/common/hunt_intr.c b/sys/dev/sfxge/common/hunt_intr.c
new file mode 100644
index 0000000..b68135c
--- /dev/null
+++ b/sys/dev/sfxge/common/hunt_intr.c
@@ -0,0 +1,155 @@
+/*-
+ * Copyright (c) 2012-2015 Solarflare Communications Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "efsys.h"
+#include "efx.h"
+#include "efx_impl.h"
+
+
+#if EFSYS_OPT_HUNTINGTON
+
+ __checkReturn int
+hunt_intr_init(
+ __in efx_nic_t *enp,
+ __in efx_intr_type_t type,
+ __in efsys_mem_t *esmp)
+{
+ _NOTE(ARGUNUSED(enp, type, esmp))
+ return (0);
+}
+
+
+ void
+hunt_intr_enable(
+ __in efx_nic_t *enp)
+{
+ _NOTE(ARGUNUSED(enp))
+}
+
+
+ void
+hunt_intr_disable(
+ __in efx_nic_t *enp)
+{
+ _NOTE(ARGUNUSED(enp))
+}
+
+
+ void
+hunt_intr_disable_unlocked(
+ __in efx_nic_t *enp)
+{
+ _NOTE(ARGUNUSED(enp))
+}
+
+
+static __checkReturn int
+efx_mcdi_trigger_interrupt(
+ __in efx_nic_t *enp,
+ __in unsigned int level)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_TRIGGER_INTERRUPT_IN_LEN,
+ MC_CMD_TRIGGER_INTERRUPT_OUT_LEN)];
+ int rc;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+
+ if (level >= enp->en_nic_cfg.enc_intr_limit) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_TRIGGER_INTERRUPT;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_TRIGGER_INTERRUPT_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_TRIGGER_INTERRUPT_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, TRIGGER_INTERRUPT_IN_INTR_LEVEL, level);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail2;
+ }
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_intr_trigger(
+ __in efx_nic_t *enp,
+ __in unsigned int level)
+{
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+ int rc;
+
+ if (encp->enc_bug41750_workaround) {
+ /* bug 41750: Test interrupts don't work on Greenport */
+ rc = ENOTSUP;
+ goto fail1;
+ }
+
+ if ((rc = efx_mcdi_trigger_interrupt(enp, level)) != 0)
+ goto fail2;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+
+ void
+hunt_intr_fini(
+ __in efx_nic_t *enp)
+{
+ _NOTE(ARGUNUSED(enp))
+}
+
+#endif /* EFSYS_OPT_HUNTINGTON */
diff --git a/sys/dev/sfxge/common/hunt_mac.c b/sys/dev/sfxge/common/hunt_mac.c
new file mode 100644
index 0000000..b9f7ca4
--- /dev/null
+++ b/sys/dev/sfxge/common/hunt_mac.c
@@ -0,0 +1,685 @@
+/*-
+ * Copyright (c) 2012-2015 Solarflare Communications Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "efsys.h"
+#include "efx.h"
+#include "efx_impl.h"
+
+
+#if EFSYS_OPT_HUNTINGTON
+
+ __checkReturn int
+hunt_mac_poll(
+ __in efx_nic_t *enp,
+ __out efx_link_mode_t *link_modep)
+{
+ /*
+ * TBD: Consider a common Siena/Huntington function. The code is
+ * essentially identical.
+ */
+
+ efx_port_t *epp = &(enp->en_port);
+ hunt_link_state_t hls;
+ int rc;
+
+ if ((rc = hunt_phy_get_link(enp, &hls)) != 0)
+ goto fail1;
+
+ epp->ep_adv_cap_mask = hls.hls_adv_cap_mask;
+ epp->ep_fcntl = hls.hls_fcntl;
+
+ *link_modep = hls.hls_link_mode;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ *link_modep = EFX_LINK_UNKNOWN;
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_mac_up(
+ __in efx_nic_t *enp,
+ __out boolean_t *mac_upp)
+{
+ /*
+ * TBD: Consider a common Siena/Huntington function. The code is
+ * essentially identical.
+ */
+
+ hunt_link_state_t hls;
+ int rc;
+
+ /*
+ * Because Huntington doesn't *require* polling, we can't rely on
+ * hunt_mac_poll() being executed to populate epp->ep_mac_up.
+ */
+ if ((rc = hunt_phy_get_link(enp, &hls)) != 0)
+ goto fail1;
+
+ *mac_upp = hls.hls_mac_up;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+/*
+ * Huntington uses MC_CMD_VADAPTOR_SET_MAC to set the
+ * MAC address; the address field in MC_CMD_SET_MAC has no
+ * effect.
+ * MC_CMD_VADAPTOR_SET_MAC requires mac-spoofing privilege and
+ * the port to have no filters or queues active.
+ */
+static __checkReturn int
+efx_mcdi_vadapter_set_mac(
+ __in efx_nic_t *enp)
+{
+ efx_port_t *epp = &(enp->en_port);
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_VADAPTOR_SET_MAC_IN_LEN,
+ MC_CMD_VADAPTOR_SET_MAC_OUT_LEN)];
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_VADAPTOR_SET_MAC;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_VADAPTOR_SET_MAC_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_VADAPTOR_SET_MAC_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, VADAPTOR_SET_MAC_IN_UPSTREAM_PORT_ID,
+ enp->en_vport_id);
+ EFX_MAC_ADDR_COPY(MCDI_IN2(req, uint8_t, VADAPTOR_SET_MAC_IN_MACADDR),
+ epp->ep_mac_addr);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_mac_addr_set(
+ __in efx_nic_t *enp)
+{
+ int rc;
+
+ if ((rc = efx_mcdi_vadapter_set_mac(enp)) != 0)
+ goto fail1;
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+__checkReturn int
+hunt_mac_reconfigure(
+ __in efx_nic_t *enp)
+{
+ efx_port_t *epp = &(enp->en_port);
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_SET_MAC_IN_LEN,
+ MC_CMD_SET_MAC_OUT_LEN)];
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_SET_MAC;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_SET_MAC_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_SET_MAC_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, SET_MAC_IN_MTU, epp->ep_mac_pdu);
+ MCDI_IN_SET_DWORD(req, SET_MAC_IN_DRAIN, epp->ep_mac_drain ? 1 : 0);
+ EFX_MAC_ADDR_COPY(MCDI_IN2(req, uint8_t, SET_MAC_IN_ADDR),
+ epp->ep_mac_addr);
+
+ /*
+ * Note: The Huntington MAC does not support REJECT_BRDCST.
+ * The REJECT_UNCST flag will also prevent multicast traffic
+ * from reaching the filters. As Huntington filters drop any
+ * traffic that does not match a filter it is ok to leave the
+ * MAC running in promiscuous mode. See bug41141.
+ */
+ MCDI_IN_POPULATE_DWORD_2(req, SET_MAC_IN_REJECT,
+ SET_MAC_IN_REJECT_UNCST, 0,
+ SET_MAC_IN_REJECT_BRDCST, 0);
+
+ /*
+ * Flow control, whether it is auto-negotiated or not,
+ * is set via the PHY advertised capabilities. When set to
+ * automatic the MAC will use the PHY settings to determine
+ * the flow control settings.
+ */
+ MCDI_IN_SET_DWORD(req, SET_MAC_IN_FCNTL, MC_CMD_FCNTL_AUTO);
+
+ /* Do not include the Ethernet frame checksum in RX packets */
+ MCDI_IN_POPULATE_DWORD_1(req, SET_MAC_IN_FLAGS,
+ SET_MAC_IN_FLAG_INCLUDE_FCS, 0);
+
+ efx_mcdi_execute_quiet(enp, &req);
+
+ if (req.emr_rc != 0) {
+ /*
+ * Unprivileged functions cannot control link state,
+ * but still need to configure filters.
+ */
+ if (req.emr_rc != EACCES) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+ }
+
+ /*
+ * Apply the filters for the MAC configuration.
+ * If the NIC isn't ready to accept filters this may
+ * return success without setting anything.
+ */
+ rc = efx_filter_reconfigure(enp, epp->ep_mac_addr,
+ epp->ep_all_unicst, epp->ep_mulcst,
+ epp->ep_all_mulcst, epp->ep_brdcst,
+ epp->ep_mulcst_addr_list,
+ epp->ep_mulcst_addr_count);
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_mac_multicast_list_set(
+ __in efx_nic_t *enp)
+{
+ efx_port_t *epp = &(enp->en_port);
+ efx_mac_ops_t *emop = epp->ep_emop;
+ int rc;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+
+ /* FIXME: Insert filters for multicast list */
+
+ if ((rc = emop->emo_reconfigure(enp)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_mac_filter_default_rxq_set(
+ __in efx_nic_t *enp,
+ __in efx_rxq_t *erp,
+ __in boolean_t using_rss)
+{
+ efx_port_t *epp = &(enp->en_port);
+ efx_rxq_t *old_rxq;
+ boolean_t old_using_rss;
+ int rc;
+
+ hunt_filter_get_default_rxq(enp, &old_rxq, &old_using_rss);
+
+ hunt_filter_default_rxq_set(enp, erp, using_rss);
+
+ rc = efx_filter_reconfigure(enp, epp->ep_mac_addr,
+ epp->ep_all_unicst, epp->ep_mulcst,
+ epp->ep_all_mulcst, epp->ep_brdcst,
+ epp->ep_mulcst_addr_list,
+ epp->ep_mulcst_addr_count);
+
+ if (rc != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ hunt_filter_default_rxq_set(enp, old_rxq, old_using_rss);
+
+ return (rc);
+}
+
+ void
+hunt_mac_filter_default_rxq_clear(
+ __in efx_nic_t *enp)
+{
+ efx_port_t *epp = &(enp->en_port);
+
+ hunt_filter_default_rxq_clear(enp);
+
+ efx_filter_reconfigure(enp, epp->ep_mac_addr,
+ epp->ep_all_unicst, epp->ep_mulcst,
+ epp->ep_all_mulcst, epp->ep_brdcst,
+ epp->ep_mulcst_addr_list,
+ epp->ep_mulcst_addr_count);
+}
+
+
+#if EFSYS_OPT_LOOPBACK
+
+ __checkReturn int
+hunt_mac_loopback_set(
+ __in efx_nic_t *enp,
+ __in efx_link_mode_t link_mode,
+ __in efx_loopback_type_t loopback_type)
+{
+ /*
+ * TBD: Consider a common Siena/Huntington function. The code is
+ * essentially identical.
+ */
+
+ efx_port_t *epp = &(enp->en_port);
+ efx_phy_ops_t *epop = epp->ep_epop;
+ efx_loopback_type_t old_loopback_type;
+ efx_link_mode_t old_loopback_link_mode;
+ int rc;
+
+ /* The PHY object handles this on Huntington */
+ old_loopback_type = epp->ep_loopback_type;
+ old_loopback_link_mode = epp->ep_loopback_link_mode;
+ epp->ep_loopback_type = loopback_type;
+ epp->ep_loopback_link_mode = link_mode;
+
+ if ((rc = epop->epo_reconfigure(enp)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE(fail2);
+
+ epp->ep_loopback_type = old_loopback_type;
+ epp->ep_loopback_link_mode = old_loopback_link_mode;
+
+ return (rc);
+}
+
+#endif /* EFSYS_OPT_LOOPBACK */
+
+#if EFSYS_OPT_MAC_STATS
+
+#define HUNT_MAC_STAT_READ(_esmp, _field, _eqp) \
+ EFSYS_MEM_READQ((_esmp), (_field) * sizeof (efx_qword_t), _eqp)
+
+
+ __checkReturn int
+hunt_mac_stats_update(
+ __in efx_nic_t *enp,
+ __in efsys_mem_t *esmp,
+ __out_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat,
+ __out_opt uint32_t *generationp)
+{
+ efx_qword_t value;
+ efx_qword_t generation_start;
+ efx_qword_t generation_end;
+
+ _NOTE(ARGUNUSED(enp))
+
+ /* Read END first so we don't race with the MC */
+ EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, EFX_MAC_STATS_SIZE);
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_GENERATION_END,
+ &generation_end);
+ EFSYS_MEM_READ_BARRIER();
+
+ /* TX */
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_CONTROL_PKTS, &value);
+ EFSYS_STAT_SUBR_QWORD(&(stat[EFX_MAC_TX_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_PAUSE_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_PAUSE_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_UNICAST_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_UNICST_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_MULTICAST_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_MULTICST_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_BROADCAST_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_BRDCST_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_BYTES, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_OCTETS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_LT64_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), &value);
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_64_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_65_TO_127_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_65_TO_127_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_128_TO_255_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_128_TO_255_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_256_TO_511_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_256_TO_511_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_512_TO_1023_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_512_TO_1023_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_1024_TO_15XX_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_1024_TO_15XX_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_15XX_TO_JUMBO_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_GE_15XX_PKTS]), &value);
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_GTJUMBO_PKTS, &value);
+ EFSYS_STAT_INCR_QWORD(&(stat[EFX_MAC_TX_GE_15XX_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_BAD_FCS_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_ERRORS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_SINGLE_COLLISION_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_SGL_COL_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_MULTIPLE_COLLISION_PKTS,
+ &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_MULT_COL_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_EXCESSIVE_COLLISION_PKTS,
+ &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_EX_COL_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_LATE_COLLISION_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_LATE_COL_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_DEFERRED_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_DEF_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_EXCESSIVE_DEFERRED_PKTS,
+ &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_EX_DEF_PKTS]), &value);
+
+ /* RX */
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_BYTES, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_OCTETS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_UNICAST_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_UNICST_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_MULTICAST_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_MULTICST_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_BROADCAST_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_BRDCST_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_PAUSE_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_PAUSE_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_UNDERSIZE_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_LE_64_PKTS]), &value);
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_64_PKTS, &value);
+ EFSYS_STAT_INCR_QWORD(&(stat[EFX_MAC_RX_LE_64_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_65_TO_127_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_65_TO_127_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_128_TO_255_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_128_TO_255_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_256_TO_511_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_256_TO_511_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_512_TO_1023_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_512_TO_1023_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_1024_TO_15XX_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_1024_TO_15XX_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_15XX_TO_JUMBO_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_GE_15XX_PKTS]), &value);
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_GTJUMBO_PKTS, &value);
+ EFSYS_STAT_INCR_QWORD(&(stat[EFX_MAC_RX_GE_15XX_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_BAD_FCS_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_FCS_ERRORS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_OVERFLOW_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_DROP_EVENTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_FALSE_CARRIER_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_FALSE_CARRIER_ERRORS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_SYMBOL_ERROR_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_SYMBOL_ERRORS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_ALIGN_ERROR_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_ALIGN_ERRORS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_INTERNAL_ERROR_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_INTERNAL_ERRORS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_JABBER_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_JABBER_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES01_CHAR_ERR, &value);
+ EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE0_CHAR_ERR]),
+ &(value.eq_dword[0]));
+ EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE1_CHAR_ERR]),
+ &(value.eq_dword[1]));
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES23_CHAR_ERR, &value);
+ EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE2_CHAR_ERR]),
+ &(value.eq_dword[0]));
+ EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE3_CHAR_ERR]),
+ &(value.eq_dword[1]));
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES01_DISP_ERR, &value);
+ EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE0_DISP_ERR]),
+ &(value.eq_dword[0]));
+ EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE1_DISP_ERR]),
+ &(value.eq_dword[1]));
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_LANES23_DISP_ERR, &value);
+ EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE2_DISP_ERR]),
+ &(value.eq_dword[0]));
+ EFSYS_STAT_SET_DWORD(&(stat[EFX_MAC_RX_LANE3_DISP_ERR]),
+ &(value.eq_dword[1]));
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_MATCH_FAULT, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_MATCH_FAULT]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_NODESC_DROPS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_NODESC_DROP_CNT]), &value);
+
+ /* Packet memory (EF10 only) */
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_TRUNC_BB_OVERFLOW, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_TRUNC_BB_OVERFLOW]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_BB_OVERFLOW, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_DISCARD_BB_OVERFLOW]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_TRUNC_VFIFO_FULL, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_TRUNC_VFIFO_FULL]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_VFIFO_FULL, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_DISCARD_VFIFO_FULL]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_TRUNC_QBB, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_TRUNC_QBB]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_QBB, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_DISCARD_QBB]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_PM_DISCARD_MAPPING, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_PM_DISCARD_MAPPING]), &value);
+
+ /* RX datapath */
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_Q_DISABLED_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_Q_DISABLED_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_DI_DROPPED_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_DI_DROPPED_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_STREAMING_PKTS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_STREAMING_PKTS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_HLB_FETCH_CONDITIONS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_HLB_FETCH]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_HLB_WAIT_CONDITIONS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_HLB_WAIT]), &value);
+
+
+ /* VADAPTER RX */
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_UNICAST_PACKETS,
+ &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_UNICAST_PACKETS]),
+ &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_UNICAST_BYTES,
+ &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_UNICAST_BYTES]),
+ &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_MULTICAST_PACKETS,
+ &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_MULTICAST_PACKETS]),
+ &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_MULTICAST_BYTES,
+ &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_MULTICAST_BYTES]),
+ &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BROADCAST_PACKETS,
+ &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_BROADCAST_PACKETS]),
+ &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BROADCAST_BYTES,
+ &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_BROADCAST_BYTES]),
+ &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BAD_PACKETS,
+ &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_BAD_PACKETS]),
+ &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_BAD_BYTES, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_BAD_BYTES]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_RX_OVERFLOW, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_RX_OVERFLOW]), &value);
+
+ /* VADAPTER TX */
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_UNICAST_PACKETS,
+ &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_UNICAST_PACKETS]),
+ &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_UNICAST_BYTES,
+ &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_UNICAST_BYTES]),
+ &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_MULTICAST_PACKETS,
+ &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_MULTICAST_PACKETS]),
+ &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_MULTICAST_BYTES,
+ &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_MULTICAST_BYTES]),
+ &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BROADCAST_PACKETS,
+ &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_BROADCAST_PACKETS]),
+ &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BROADCAST_BYTES,
+ &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_BROADCAST_BYTES]),
+ &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BAD_PACKETS, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_BAD_PACKETS]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_BAD_BYTES, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_BAD_BYTES]), &value);
+
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_VADAPTER_TX_OVERFLOW, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_VADAPTER_TX_OVERFLOW]), &value);
+
+
+ EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, EFX_MAC_STATS_SIZE);
+ EFSYS_MEM_READ_BARRIER();
+ HUNT_MAC_STAT_READ(esmp, MC_CMD_MAC_GENERATION_START,
+ &generation_start);
+
+ /* Check that we didn't read the stats in the middle of a DMA */
+ /* Not a good enough check ? */
+ if (memcmp(&generation_start, &generation_end,
+ sizeof (generation_start)))
+ return (EAGAIN);
+
+ if (generationp)
+ *generationp = EFX_QWORD_FIELD(generation_start, EFX_DWORD_0);
+
+ return (0);
+}
+
+#endif /* EFSYS_OPT_MAC_STATS */
+
+#endif /* EFSYS_OPT_HUNTINGTON */
diff --git a/sys/dev/sfxge/common/hunt_mcdi.c b/sys/dev/sfxge/common/hunt_mcdi.c
new file mode 100644
index 0000000..8782bcc
--- /dev/null
+++ b/sys/dev/sfxge/common/hunt_mcdi.c
@@ -0,0 +1,465 @@
+/*-
+ * Copyright (c) 2012-2015 Solarflare Communications Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "efsys.h"
+#include "efx.h"
+#include "efx_impl.h"
+
+
+#if EFSYS_OPT_HUNTINGTON
+
+#if EFSYS_OPT_MCDI
+
+#ifndef WITH_MCDI_V2
+#error "WITH_MCDI_V2 required for Huntington MCDIv2 commands."
+#endif
+
+typedef enum efx_mcdi_header_type_e {
+ EFX_MCDI_HEADER_TYPE_V1, /* MCDIv0 (BootROM), MCDIv1 commands */
+ EFX_MCDI_HEADER_TYPE_V2, /* MCDIv2 commands */
+} efx_mcdi_header_type_t;
+
+/*
+ * Return the header format to use for sending an MCDI request.
+ *
+ * An MCDIv1 (Siena compatible) command should use MCDIv2 encapsulation if the
+ * request input buffer or response output buffer are too large for the MCDIv1
+ * format. An MCDIv2 command must always be sent using MCDIv2 encapsulation.
+ */
+#define EFX_MCDI_HEADER_TYPE(_cmd, _length) \
+ ((((_cmd) & ~EFX_MASK32(MCDI_HEADER_CODE)) || \
+ ((_length) & ~EFX_MASK32(MCDI_HEADER_DATALEN))) ? \
+ EFX_MCDI_HEADER_TYPE_V2 : EFX_MCDI_HEADER_TYPE_V1)
+
+
+/*
+ * MCDI Header NOT_EPOCH flag
+ * ==========================
+ * A new epoch begins at initial startup or after an MC reboot, and defines when
+ * the MC should reject stale MCDI requests.
+ *
+ * The first MCDI request sent by the host should contain NOT_EPOCH=0, and all
+ * subsequent requests (until the next MC reboot) should contain NOT_EPOCH=1.
+ *
+ * After rebooting the MC will fail all requests with NOT_EPOCH=1 by writing a
+ * response with ERROR=1 and DATALEN=0 until a request is seen with NOT_EPOCH=0.
+ */
+
+
+ __checkReturn int
+hunt_mcdi_init(
+ __in efx_nic_t *enp,
+ __in const efx_mcdi_transport_t *emtp)
+{
+ efsys_mem_t *esmp = emtp->emt_dma_mem;
+ efx_dword_t dword;
+ int rc;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+ EFSYS_ASSERT(enp->en_features & EFX_FEATURE_MCDI_DMA);
+
+ /* A host DMA buffer is required for Huntington MCDI */
+ if (esmp == NULL) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ /*
+ * Ensure that the MC doorbell is in a known state before issuing MCDI
+ * commands. The recovery algorithm requires that the MC command buffer
+ * must be 256 byte aligned. See bug24769.
+ */
+ if ((EFSYS_MEM_ADDR(esmp) & 0xFF) != 0) {
+ rc = EINVAL;
+ goto fail2;
+ }
+ EFX_POPULATE_DWORD_1(dword, EFX_DWORD_0, 1);
+ EFX_BAR_WRITED(enp, ER_DZ_MC_DB_HWRD_REG, &dword, B_FALSE);
+
+ /* Save initial MC reboot status */
+ (void) hunt_mcdi_poll_reboot(enp);
+
+ /* Start a new epoch (allow fresh MCDI requests to succeed) */
+ efx_mcdi_new_epoch(enp);
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ void
+hunt_mcdi_fini(
+ __in efx_nic_t *enp)
+{
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+
+ emip->emi_new_epoch = B_FALSE;
+}
+
+ void
+hunt_mcdi_request_copyin(
+ __in efx_nic_t *enp,
+ __in efx_mcdi_req_t *emrp,
+ __in unsigned int seq,
+ __in boolean_t ev_cpl,
+ __in boolean_t new_epoch)
+{
+ const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp;
+ efsys_mem_t *esmp = emtp->emt_dma_mem;
+ efx_mcdi_header_type_t hdr_type;
+ efx_dword_t dword;
+ unsigned int xflags;
+ unsigned int pos;
+ size_t offset;
+
+ EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON);
+
+ xflags = 0;
+ if (ev_cpl)
+ xflags |= MCDI_HEADER_XFLAGS_EVREQ;
+
+ offset = 0;
+
+ hdr_type = EFX_MCDI_HEADER_TYPE(emrp->emr_cmd,
+ MAX(emrp->emr_in_length, emrp->emr_out_length));
+
+ if (hdr_type == EFX_MCDI_HEADER_TYPE_V2) {
+ /* Construct MCDI v2 header */
+ EFX_POPULATE_DWORD_8(dword,
+ MCDI_HEADER_CODE, MC_CMD_V2_EXTN,
+ MCDI_HEADER_RESYNC, 1,
+ MCDI_HEADER_DATALEN, 0,
+ MCDI_HEADER_SEQ, seq,
+ MCDI_HEADER_NOT_EPOCH, new_epoch ? 0 : 1,
+ MCDI_HEADER_ERROR, 0,
+ MCDI_HEADER_RESPONSE, 0,
+ MCDI_HEADER_XFLAGS, xflags);
+ EFSYS_MEM_WRITED(esmp, offset, &dword);
+ offset += sizeof (dword);
+
+ EFX_POPULATE_DWORD_2(dword,
+ MC_CMD_V2_EXTN_IN_EXTENDED_CMD, emrp->emr_cmd,
+ MC_CMD_V2_EXTN_IN_ACTUAL_LEN, emrp->emr_in_length);
+ EFSYS_MEM_WRITED(esmp, offset, &dword);
+ offset += sizeof (dword);
+ } else {
+ /* Construct MCDI v1 header */
+ EFX_POPULATE_DWORD_8(dword,
+ MCDI_HEADER_CODE, emrp->emr_cmd,
+ MCDI_HEADER_RESYNC, 1,
+ MCDI_HEADER_DATALEN, emrp->emr_in_length,
+ MCDI_HEADER_SEQ, seq,
+ MCDI_HEADER_NOT_EPOCH, new_epoch ? 0 : 1,
+ MCDI_HEADER_ERROR, 0,
+ MCDI_HEADER_RESPONSE, 0,
+ MCDI_HEADER_XFLAGS, xflags);
+ EFSYS_MEM_WRITED(esmp, offset, &dword);
+ offset += sizeof (dword);
+ }
+
+ /* Construct the payload */
+ for (pos = 0; pos < emrp->emr_in_length; pos += sizeof (efx_dword_t)) {
+ memcpy(&dword, MCDI_IN(*emrp, efx_dword_t, pos),
+ MIN(sizeof (dword), emrp->emr_in_length - pos));
+ EFSYS_MEM_WRITED(esmp, offset + pos, &dword);
+ }
+
+ /* Ring the doorbell to post the command DMA address to the MC */
+ EFSYS_ASSERT((EFSYS_MEM_ADDR(esmp) & 0xFF) == 0);
+
+ /* Guarantee ordering of memory (MCDI request) and PIO (MC doorbell) */
+ EFSYS_DMA_SYNC_FOR_DEVICE(esmp, 0, offset + emrp->emr_in_length);
+ EFSYS_PIO_WRITE_BARRIER();
+
+ EFX_POPULATE_DWORD_1(dword,
+ EFX_DWORD_0, EFSYS_MEM_ADDR(esmp) >> 32);
+ EFX_BAR_WRITED(enp, ER_DZ_MC_DB_LWRD_REG, &dword, B_FALSE);
+
+ EFX_POPULATE_DWORD_1(dword,
+ EFX_DWORD_0, EFSYS_MEM_ADDR(esmp) & 0xffffffff);
+ EFX_BAR_WRITED(enp, ER_DZ_MC_DB_HWRD_REG, &dword, B_FALSE);
+}
+
+ void
+hunt_mcdi_request_copyout(
+ __in efx_nic_t *enp,
+ __in efx_mcdi_req_t *emrp)
+{
+ const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp;
+ efsys_mem_t *esmp = emtp->emt_dma_mem;
+ unsigned int pos;
+ unsigned int offset;
+ efx_dword_t hdr;
+ efx_dword_t hdr2;
+ efx_dword_t data;
+ size_t bytes;
+
+ if (emrp->emr_out_buf == NULL)
+ return;
+
+ /* Read the command header to detect MCDI response format */
+ EFSYS_MEM_READD(esmp, 0, &hdr);
+ if (EFX_DWORD_FIELD(hdr, MCDI_HEADER_CODE) == MC_CMD_V2_EXTN) {
+ offset = 2 * sizeof (efx_dword_t);
+
+ /*
+ * Read the actual payload length. The length given in the event
+ * is only correct for responses with the V1 format.
+ */
+ EFSYS_MEM_READD(esmp, sizeof (efx_dword_t), &hdr2);
+ emrp->emr_out_length_used = EFX_DWORD_FIELD(hdr2,
+ MC_CMD_V2_EXTN_IN_ACTUAL_LEN);
+ } else {
+ offset = sizeof (efx_dword_t);
+ }
+
+ /* Copy payload out into caller supplied buffer */
+ bytes = MIN(emrp->emr_out_length_used, emrp->emr_out_length);
+ for (pos = 0; pos < bytes; pos += sizeof (efx_dword_t)) {
+ EFSYS_MEM_READD(esmp, offset + pos, &data);
+ memcpy(MCDI_OUT(*emrp, efx_dword_t, pos), &data,
+ MIN(sizeof (data), bytes - pos));
+ }
+}
+
+ __checkReturn boolean_t
+hunt_mcdi_request_poll(
+ __in efx_nic_t *enp)
+{
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+ const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp;
+ efsys_mem_t *esmp = emtp->emt_dma_mem;
+ efx_mcdi_req_t *emrp;
+ efx_dword_t dword;
+ unsigned int seq;
+ unsigned int cmd;
+ unsigned int length;
+ size_t offset;
+ int state;
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON);
+
+ /* Serialise against post-watchdog efx_mcdi_ev* */
+ EFSYS_LOCK(enp->en_eslp, state);
+
+ EFSYS_ASSERT(emip->emi_pending_req != NULL);
+ EFSYS_ASSERT(!emip->emi_ev_cpl);
+ emrp = emip->emi_pending_req;
+
+ offset = 0;
+
+ /* Read the command header */
+ EFSYS_MEM_READD(esmp, offset, &dword);
+ offset += sizeof (efx_dword_t);
+ if (EFX_DWORD_FIELD(dword, MCDI_HEADER_RESPONSE) == 0) {
+ EFSYS_UNLOCK(enp->en_eslp, state);
+ return (B_FALSE);
+ }
+ if (EFX_DWORD_FIELD(dword, MCDI_HEADER_CODE) == MC_CMD_V2_EXTN) {
+ efx_dword_t dword2;
+
+ EFSYS_MEM_READD(esmp, offset, &dword2);
+ offset += sizeof (efx_dword_t);
+
+ cmd = EFX_DWORD_FIELD(dword2, MC_CMD_V2_EXTN_IN_EXTENDED_CMD);
+ length = EFX_DWORD_FIELD(dword2, MC_CMD_V2_EXTN_IN_ACTUAL_LEN);
+ } else {
+ cmd = EFX_DWORD_FIELD(dword, MCDI_HEADER_CODE);
+ length = EFX_DWORD_FIELD(dword, MCDI_HEADER_DATALEN);
+ }
+
+ /* Request complete */
+ emip->emi_pending_req = NULL;
+ seq = (emip->emi_seq - 1) & EFX_MASK32(MCDI_HEADER_SEQ);
+
+ /* Check for synchronous reboot */
+ if (EFX_DWORD_FIELD(dword, MCDI_HEADER_ERROR) != 0 && length == 0) {
+ /* The MC has rebooted since the request was sent. */
+ EFSYS_SPIN(EFX_MCDI_STATUS_SLEEP_US);
+ hunt_mcdi_poll_reboot(enp);
+
+ EFSYS_UNLOCK(enp->en_eslp, state);
+ rc = EIO;
+ goto fail1;
+ }
+
+ /* Ensure stale MCDI requests fail after an MC reboot. */
+ emip->emi_new_epoch = B_FALSE;
+
+ EFSYS_UNLOCK(enp->en_eslp, state);
+
+ /* Check that the returned data is consistent */
+ if (cmd != emrp->emr_cmd ||
+ EFX_DWORD_FIELD(dword, MCDI_HEADER_SEQ) != seq) {
+ /* Response is for a different request */
+ rc = EIO;
+ goto fail2;
+ }
+ if (EFX_DWORD_FIELD(dword, MCDI_HEADER_ERROR)) {
+ efx_dword_t errdword;
+ int errcode;
+ int argnum;
+
+ /* Read error code (and arg num for MCDI v2 commands) */
+ EFSYS_MEM_READD(esmp, offset + MC_CMD_ERR_CODE_OFST, &errdword);
+ errcode = EFX_DWORD_FIELD(errdword, EFX_DWORD_0);
+
+ EFSYS_MEM_READD(esmp, offset + MC_CMD_ERR_ARG_OFST, &errdword);
+ argnum = EFX_DWORD_FIELD(errdword, EFX_DWORD_0);
+
+ rc = efx_mcdi_request_errcode(errcode);
+ if (!emrp->emr_quiet) {
+ EFSYS_PROBE3(mcdi_err_arg, int, emrp->emr_cmd,
+ int, errcode, int, argnum);
+ }
+ goto fail3;
+
+ } else {
+ emrp->emr_out_length_used = length;
+ emrp->emr_rc = 0;
+ hunt_mcdi_request_copyout(enp, emrp);
+ }
+
+ goto out;
+
+fail3:
+ if (!emrp->emr_quiet)
+ EFSYS_PROBE(fail3);
+fail2:
+ if (!emrp->emr_quiet)
+ EFSYS_PROBE(fail2);
+fail1:
+ if (!emrp->emr_quiet)
+ EFSYS_PROBE1(fail1, int, rc);
+
+ /* Fill out error state */
+ emrp->emr_rc = rc;
+ emrp->emr_out_length_used = 0;
+
+ /* Reboot/Assertion */
+ if (rc == EIO || rc == EINTR)
+ efx_mcdi_raise_exception(enp, emrp, rc);
+
+out:
+ return (B_TRUE);
+}
+
+ int
+hunt_mcdi_poll_reboot(
+ __in efx_nic_t *enp)
+{
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+ efx_dword_t dword;
+ uint32_t old_status;
+ uint32_t new_status;
+ int rc;
+
+ old_status = emip->emi_mc_reboot_status;
+
+ /* Update MC reboot status word */
+ EFX_BAR_TBL_READD(enp, ER_DZ_BIU_MC_SFT_STATUS_REG, 0, &dword, B_FALSE);
+ new_status = dword.ed_u32[0];
+
+ /* MC has rebooted if the value has changed */
+ if (new_status != old_status) {
+ emip->emi_mc_reboot_status = new_status;
+
+ /*
+ * FIXME: Ignore detected MC REBOOT for now.
+ *
+ * The Siena support for checking for MC reboot from status
+ * flags is broken - see comments in siena_mcdi_poll_reboot().
+ * As the generic MCDI code is shared the Huntington reboot
+ * detection suffers similar problems.
+ *
+ * Do not report an error when the boot status changes until
+ * this can be handled by common code drivers (and reworked to
+ * support Siena too).
+ */
+ if (B_FALSE) {
+ rc = EIO;
+ goto fail1;
+ }
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_mcdi_fw_update_supported(
+ __in efx_nic_t *enp,
+ __out boolean_t *supportedp)
+{
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+
+ EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON);
+
+ /* use privilege mask state at MCDI attach */
+ *supportedp = (encp->enc_privilege_mask &
+ MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN)
+ == MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN;
+
+ return (0);
+}
+
+ __checkReturn int
+hunt_mcdi_macaddr_change_supported(
+ __in efx_nic_t *enp,
+ __out boolean_t *supportedp)
+{
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+
+ EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON);
+
+ /* use privilege mask state at MCDI attach */
+ *supportedp = (encp->enc_privilege_mask &
+ MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING)
+ == MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING;
+
+ return (0);
+}
+
+#endif /* EFSYS_OPT_MCDI */
+
+#endif /* EFSYS_OPT_HUNTINGTON */
diff --git a/sys/dev/sfxge/common/hunt_nic.c b/sys/dev/sfxge/common/hunt_nic.c
new file mode 100644
index 0000000..a4babc3
--- /dev/null
+++ b/sys/dev/sfxge/common/hunt_nic.c
@@ -0,0 +1,1741 @@
+/*-
+ * Copyright (c) 2012-2015 Solarflare Communications Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "efsys.h"
+#include "efx.h"
+#include "efx_impl.h"
+#include "mcdi_mon.h"
+
+#if EFSYS_OPT_HUNTINGTON
+
+#include "ef10_tlv_layout.h"
+
+static __checkReturn int
+efx_mcdi_get_port_assignment(
+ __in efx_nic_t *enp,
+ __out uint32_t *portp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_GET_PORT_ASSIGNMENT_IN_LEN,
+ MC_CMD_GET_PORT_ASSIGNMENT_OUT_LEN)];
+ int rc;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_GET_PORT_ASSIGNMENT;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_GET_PORT_ASSIGNMENT_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_GET_PORT_ASSIGNMENT_OUT_LEN;
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_GET_PORT_ASSIGNMENT_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ *portp = MCDI_OUT_DWORD(req, GET_PORT_ASSIGNMENT_OUT_PORT);
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+static __checkReturn int
+efx_mcdi_get_port_modes(
+ __in efx_nic_t *enp,
+ __out uint32_t *modesp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_GET_PORT_MODES_IN_LEN,
+ MC_CMD_GET_PORT_MODES_OUT_LEN)];
+ int rc;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_GET_PORT_MODES;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_GET_PORT_MODES_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_GET_PORT_MODES_OUT_LEN;
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ /* Accept pre-Medford size (8 bytes - no CurrentMode field) */
+ if (req.emr_out_length_used <
+ MC_CMD_GET_PORT_MODES_OUT_CURRENT_MODE_OFST) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ *modesp = MCDI_OUT_DWORD(req, GET_PORT_MODES_OUT_MODES);
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+
+static __checkReturn int
+efx_mcdi_vadaptor_alloc(
+ __in efx_nic_t *enp,
+ __in uint32_t port_id)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_VADAPTOR_ALLOC_IN_LEN,
+ MC_CMD_VADAPTOR_ALLOC_OUT_LEN)];
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_vport_id, ==, EVB_PORT_ID_NULL);
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_VADAPTOR_ALLOC;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_VADAPTOR_ALLOC_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_VADAPTOR_ALLOC_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, VADAPTOR_ALLOC_IN_UPSTREAM_PORT_ID, port_id);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+static __checkReturn int
+efx_mcdi_vadaptor_free(
+ __in efx_nic_t *enp,
+ __in uint32_t port_id)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_VADAPTOR_FREE_IN_LEN,
+ MC_CMD_VADAPTOR_FREE_OUT_LEN)];
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_VADAPTOR_FREE;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_VADAPTOR_FREE_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_VADAPTOR_FREE_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, VADAPTOR_FREE_IN_UPSTREAM_PORT_ID, port_id);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+static __checkReturn int
+efx_mcdi_get_mac_address_pf(
+ __in efx_nic_t *enp,
+ __out_ecount_opt(6) uint8_t mac_addrp[6])
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_GET_MAC_ADDRESSES_IN_LEN,
+ MC_CMD_GET_MAC_ADDRESSES_OUT_LEN)];
+ int rc;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_GET_MAC_ADDRESSES;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_GET_MAC_ADDRESSES_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_GET_MAC_ADDRESSES_OUT_LEN;
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_GET_MAC_ADDRESSES_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ if (MCDI_OUT_DWORD(req, GET_MAC_ADDRESSES_OUT_MAC_COUNT) < 1) {
+ rc = ENOENT;
+ goto fail3;
+ }
+
+ if (mac_addrp != NULL) {
+ uint8_t *addrp;
+
+ addrp = MCDI_OUT2(req, uint8_t,
+ GET_MAC_ADDRESSES_OUT_MAC_ADDR_BASE);
+
+ EFX_MAC_ADDR_COPY(mac_addrp, addrp);
+ }
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+static __checkReturn int
+efx_mcdi_get_mac_address_vf(
+ __in efx_nic_t *enp,
+ __out_ecount_opt(6) uint8_t mac_addrp[6])
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_VPORT_GET_MAC_ADDRESSES_IN_LEN,
+ MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_LENMAX)];
+ int rc;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_VPORT_GET_MAC_ADDRESSES;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_VPORT_GET_MAC_ADDRESSES_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_LENMAX;
+
+ MCDI_IN_SET_DWORD(req, VPORT_GET_MAC_ADDRESSES_IN_VPORT_ID,
+ EVB_PORT_ID_ASSIGNED);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used <
+ MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_LENMIN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ if (MCDI_OUT_DWORD(req,
+ VPORT_GET_MAC_ADDRESSES_OUT_MACADDR_COUNT) < 1) {
+ rc = ENOENT;
+ goto fail3;
+ }
+
+ if (mac_addrp != NULL) {
+ uint8_t *addrp;
+
+ addrp = MCDI_OUT2(req, uint8_t,
+ VPORT_GET_MAC_ADDRESSES_OUT_MACADDR);
+
+ EFX_MAC_ADDR_COPY(mac_addrp, addrp);
+ }
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+static __checkReturn int
+efx_mcdi_get_clock(
+ __in efx_nic_t *enp,
+ __out uint32_t *sys_freqp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_GET_CLOCK_IN_LEN,
+ MC_CMD_GET_CLOCK_OUT_LEN)];
+ int rc;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_GET_CLOCK;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_GET_CLOCK_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_GET_CLOCK_OUT_LEN;
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_GET_CLOCK_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ *sys_freqp = MCDI_OUT_DWORD(req, GET_CLOCK_OUT_SYS_FREQ);
+ if (*sys_freqp == 0) {
+ rc = EINVAL;
+ goto fail3;
+ }
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+static __checkReturn int
+efx_mcdi_get_vector_cfg(
+ __in efx_nic_t *enp,
+ __out_opt uint32_t *vec_basep,
+ __out_opt uint32_t *pf_nvecp,
+ __out_opt uint32_t *vf_nvecp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_GET_VECTOR_CFG_IN_LEN,
+ MC_CMD_GET_VECTOR_CFG_OUT_LEN)];
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_GET_VECTOR_CFG;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_GET_VECTOR_CFG_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_GET_VECTOR_CFG_OUT_LEN;
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_GET_VECTOR_CFG_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ if (vec_basep != NULL)
+ *vec_basep = MCDI_OUT_DWORD(req, GET_VECTOR_CFG_OUT_VEC_BASE);
+ if (pf_nvecp != NULL)
+ *pf_nvecp = MCDI_OUT_DWORD(req, GET_VECTOR_CFG_OUT_VECS_PER_PF);
+ if (vf_nvecp != NULL)
+ *vf_nvecp = MCDI_OUT_DWORD(req, GET_VECTOR_CFG_OUT_VECS_PER_VF);
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+static __checkReturn int
+efx_mcdi_get_capabilities(
+ __in efx_nic_t *enp,
+ __out efx_dword_t *flagsp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_GET_CAPABILITIES_IN_LEN,
+ MC_CMD_GET_CAPABILITIES_OUT_LEN)];
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_GET_CAPABILITIES;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_GET_CAPABILITIES_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_GET_CAPABILITIES_OUT_LEN;
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_GET_CAPABILITIES_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ *flagsp = *MCDI_OUT2(req, efx_dword_t, GET_CAPABILITIES_OUT_FLAGS1);
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+
+static __checkReturn int
+efx_mcdi_alloc_vis(
+ __in efx_nic_t *enp,
+ __in uint32_t min_vi_count,
+ __in uint32_t max_vi_count,
+ __out_opt uint32_t *vi_basep,
+ __out uint32_t *vi_countp)
+
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_ALLOC_VIS_IN_LEN,
+ MC_CMD_ALLOC_VIS_OUT_LEN)];
+ int rc;
+
+ if (vi_countp == NULL) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_ALLOC_VIS;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_ALLOC_VIS_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_ALLOC_VIS_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, ALLOC_VIS_IN_MIN_VI_COUNT, min_vi_count);
+ MCDI_IN_SET_DWORD(req, ALLOC_VIS_IN_MAX_VI_COUNT, max_vi_count);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail2;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_ALLOC_VIS_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail3;
+ }
+
+ if (vi_basep != NULL)
+ *vi_basep = MCDI_OUT_DWORD(req, ALLOC_VIS_OUT_VI_BASE);
+
+ if (vi_countp != NULL)
+ *vi_countp = MCDI_OUT_DWORD(req, ALLOC_VIS_OUT_VI_COUNT);
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+
+static __checkReturn int
+efx_mcdi_free_vis(
+ __in efx_nic_t *enp)
+{
+ efx_mcdi_req_t req;
+ int rc;
+
+ EFX_STATIC_ASSERT(MC_CMD_FREE_VIS_IN_LEN == 0);
+ EFX_STATIC_ASSERT(MC_CMD_FREE_VIS_OUT_LEN == 0);
+
+ req.emr_cmd = MC_CMD_FREE_VIS;
+ req.emr_in_buf = NULL;
+ req.emr_in_length = 0;
+ req.emr_out_buf = NULL;
+ req.emr_out_length = 0;
+
+ efx_mcdi_execute_quiet(enp, &req);
+
+ /* Ignore ELREADY (no allocated VIs, so nothing to free) */
+ if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+
+static __checkReturn int
+efx_mcdi_alloc_piobuf(
+ __in efx_nic_t *enp,
+ __out efx_piobuf_handle_t *handlep)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_ALLOC_PIOBUF_IN_LEN,
+ MC_CMD_ALLOC_PIOBUF_OUT_LEN)];
+ int rc;
+
+ if (handlep == NULL) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_ALLOC_PIOBUF;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_ALLOC_PIOBUF_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_ALLOC_PIOBUF_OUT_LEN;
+
+ efx_mcdi_execute_quiet(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail2;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_ALLOC_PIOBUF_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail3;
+ }
+
+ *handlep = MCDI_OUT_DWORD(req, ALLOC_PIOBUF_OUT_PIOBUF_HANDLE);
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+static __checkReturn int
+efx_mcdi_free_piobuf(
+ __in efx_nic_t *enp,
+ __out efx_piobuf_handle_t handle)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_FREE_PIOBUF_IN_LEN,
+ MC_CMD_FREE_PIOBUF_OUT_LEN)];
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_FREE_PIOBUF;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_FREE_PIOBUF_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_FREE_PIOBUF_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, FREE_PIOBUF_IN_PIOBUF_HANDLE, handle);
+
+ efx_mcdi_execute_quiet(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+static __checkReturn int
+efx_mcdi_link_piobuf(
+ __in efx_nic_t *enp,
+ __in uint32_t vi_index,
+ __in efx_piobuf_handle_t handle)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_LINK_PIOBUF_IN_LEN,
+ MC_CMD_LINK_PIOBUF_OUT_LEN)];
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_LINK_PIOBUF;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_LINK_PIOBUF_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_LINK_PIOBUF_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, LINK_PIOBUF_IN_PIOBUF_HANDLE, handle);
+ MCDI_IN_SET_DWORD(req, LINK_PIOBUF_IN_TXQ_INSTANCE, vi_index);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+static __checkReturn int
+efx_mcdi_unlink_piobuf(
+ __in efx_nic_t *enp,
+ __in uint32_t vi_index)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_UNLINK_PIOBUF_IN_LEN,
+ MC_CMD_UNLINK_PIOBUF_OUT_LEN)];
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_UNLINK_PIOBUF;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_UNLINK_PIOBUF_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_UNLINK_PIOBUF_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, UNLINK_PIOBUF_IN_TXQ_INSTANCE, vi_index);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+static void
+hunt_nic_alloc_piobufs(
+ __in efx_nic_t *enp,
+ __in uint32_t max_piobuf_count)
+{
+ efx_piobuf_handle_t *handlep;
+ unsigned int i;
+ int rc;
+
+ EFSYS_ASSERT3U(max_piobuf_count, <=,
+ EFX_ARRAY_SIZE(enp->en_u.hunt.enu_piobuf_handle));
+
+ enp->en_u.hunt.enu_piobuf_count = 0;
+
+ for (i = 0; i < max_piobuf_count; i++) {
+ handlep = &enp->en_u.hunt.enu_piobuf_handle[i];
+
+ if ((rc = efx_mcdi_alloc_piobuf(enp, handlep)) != 0)
+ goto fail1;
+
+ enp->en_u.hunt.enu_pio_alloc_map[i] = 0;
+ enp->en_u.hunt.enu_piobuf_count++;
+ }
+
+ return;
+
+fail1:
+ for (i = 0; i < enp->en_u.hunt.enu_piobuf_count; i++) {
+ handlep = &enp->en_u.hunt.enu_piobuf_handle[i];
+
+ efx_mcdi_free_piobuf(enp, *handlep);
+ *handlep = EFX_PIOBUF_HANDLE_INVALID;
+ }
+ enp->en_u.hunt.enu_piobuf_count = 0;
+}
+
+
+static void
+hunt_nic_free_piobufs(
+ __in efx_nic_t *enp)
+{
+ efx_piobuf_handle_t *handlep;
+ unsigned int i;
+
+ for (i = 0; i < enp->en_u.hunt.enu_piobuf_count; i++) {
+ handlep = &enp->en_u.hunt.enu_piobuf_handle[i];
+
+ efx_mcdi_free_piobuf(enp, *handlep);
+ *handlep = EFX_PIOBUF_HANDLE_INVALID;
+ }
+ enp->en_u.hunt.enu_piobuf_count = 0;
+}
+
+/* Sub-allocate a block from a piobuf */
+ __checkReturn int
+hunt_nic_pio_alloc(
+ __inout efx_nic_t *enp,
+ __out uint32_t *bufnump,
+ __out efx_piobuf_handle_t *handlep,
+ __out uint32_t *blknump,
+ __out uint32_t *offsetp,
+ __out size_t *sizep)
+{
+ efx_drv_cfg_t *edcp = &enp->en_drv_cfg;
+ uint32_t blk_per_buf;
+ uint32_t buf, blk;
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON);
+ EFSYS_ASSERT(bufnump);
+ EFSYS_ASSERT(handlep);
+ EFSYS_ASSERT(blknump);
+ EFSYS_ASSERT(offsetp);
+ EFSYS_ASSERT(sizep);
+
+ if ((edcp->edc_pio_alloc_size == 0) ||
+ (enp->en_u.hunt.enu_piobuf_count == 0)) {
+ rc = ENOMEM;
+ goto fail1;
+ }
+ blk_per_buf = HUNT_PIOBUF_SIZE / edcp->edc_pio_alloc_size;
+
+ for (buf = 0; buf < enp->en_u.hunt.enu_piobuf_count; buf++) {
+ uint32_t *map = &enp->en_u.hunt.enu_pio_alloc_map[buf];
+
+ if (~(*map) == 0)
+ continue;
+
+ EFSYS_ASSERT3U(blk_per_buf, <=, (8 * sizeof (*map)));
+ for (blk = 0; blk < blk_per_buf; blk++) {
+ if ((*map & (1u << blk)) == 0) {
+ *map |= (1u << blk);
+ goto done;
+ }
+ }
+ }
+ rc = ENOMEM;
+ goto fail2;
+
+done:
+ *handlep = enp->en_u.hunt.enu_piobuf_handle[buf];
+ *bufnump = buf;
+ *blknump = blk;
+ *sizep = edcp->edc_pio_alloc_size;
+ *offsetp = blk * (*sizep);
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+/* Free a piobuf sub-allocated block */
+ __checkReturn int
+hunt_nic_pio_free(
+ __inout efx_nic_t *enp,
+ __in uint32_t bufnum,
+ __in uint32_t blknum)
+{
+ uint32_t *map;
+ int rc;
+
+ if ((bufnum >= enp->en_u.hunt.enu_piobuf_count) ||
+ (blknum >= (8 * sizeof (*map)))) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ map = &enp->en_u.hunt.enu_pio_alloc_map[bufnum];
+ if ((*map & (1u << blknum)) == 0) {
+ rc = ENOENT;
+ goto fail2;
+ }
+ *map &= ~(1u << blknum);
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_nic_pio_link(
+ __inout efx_nic_t *enp,
+ __in uint32_t vi_index,
+ __in efx_piobuf_handle_t handle)
+{
+ return (efx_mcdi_link_piobuf(enp, vi_index, handle));
+}
+
+ __checkReturn int
+hunt_nic_pio_unlink(
+ __inout efx_nic_t *enp,
+ __in uint32_t vi_index)
+{
+ return (efx_mcdi_unlink_piobuf(enp, vi_index));
+}
+
+static __checkReturn int
+hunt_get_datapath_caps(
+ __in efx_nic_t *enp)
+{
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+ efx_dword_t datapath_capabilities;
+ int rc;
+
+ if ((rc = efx_mcdi_get_capabilities(enp, &datapath_capabilities)) != 0)
+ goto fail1;
+
+ /*
+ * Huntington RXDP firmware inserts a 0 or 14 byte prefix.
+ * We only support the 14 byte prefix here.
+ */
+ if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities,
+ GET_CAPABILITIES_OUT_RX_PREFIX_LEN_14) != 1) {
+ rc = ENOTSUP;
+ goto fail2;
+ }
+ encp->enc_rx_prefix_size = 14;
+
+ /* Check if the firmware supports TSO */
+ if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities,
+ GET_CAPABILITIES_OUT_TX_TSO) == 1)
+ encp->enc_fw_assisted_tso_enabled = B_TRUE;
+ else
+ encp->enc_fw_assisted_tso_enabled = B_FALSE;
+
+ /* Check if the firmware has vadapter/vport/vswitch support */
+ if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities,
+ GET_CAPABILITIES_OUT_EVB) == 1)
+ encp->enc_datapath_cap_evb = B_TRUE;
+ else
+ encp->enc_datapath_cap_evb = B_FALSE;
+
+ /* Check if the firmware supports VLAN insertion */
+ if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities,
+ GET_CAPABILITIES_OUT_TX_VLAN_INSERTION) == 1)
+ encp->enc_hw_tx_insert_vlan_enabled = B_TRUE;
+ else
+ encp->enc_hw_tx_insert_vlan_enabled = B_FALSE;
+
+ /* Check if the firmware supports RX event batching */
+ if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities,
+ GET_CAPABILITIES_OUT_RX_BATCHING) == 1) {
+ encp->enc_rx_batching_enabled = B_TRUE;
+ encp->enc_rx_batch_max = 16;
+ } else {
+ encp->enc_rx_batching_enabled = B_FALSE;
+ }
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+/*
+ * The external port mapping is a one-based numbering of the external
+ * connectors on the board. It does not distinguish off-board separated
+ * outputs such as multi-headed cables.
+ * The number of ports that map to each external port connector
+ * on the board is determined by the chip family and the port modes to
+ * which the NIC can be configured. The mapping table lists modes with
+ * port numbering requirements in increasing order.
+ */
+static struct {
+ efx_family_t family;
+ uint32_t modes_mask;
+ uint32_t stride;
+} __hunt_external_port_mappings[] = {
+ /* Supported modes requiring 1 output per port */
+ {
+ EFX_FAMILY_HUNTINGTON,
+ (1 << TLV_PORT_MODE_10G) |
+ (1 << TLV_PORT_MODE_40G) |
+ (1 << TLV_PORT_MODE_10G_10G) |
+ (1 << TLV_PORT_MODE_40G_40G),
+ 1
+ },
+ /* Supported modes requiring 2 outputs per port */
+ {
+ EFX_FAMILY_HUNTINGTON,
+ (1 << TLV_PORT_MODE_10G_10G_10G_10G) |
+ (1 << TLV_PORT_MODE_40G_10G_10G) |
+ (1 << TLV_PORT_MODE_10G_10G_40G),
+ 2
+ }
+};
+
+static __checkReturn int
+hunt_external_port_mapping(
+ __in efx_nic_t *enp,
+ __in uint32_t port,
+ __out uint8_t *external_portp)
+{
+ int rc;
+ int i;
+ uint32_t port_modes;
+ uint32_t matches;
+ uint32_t stride = 1; /* default 1-1 mapping */
+
+ if ((rc = efx_mcdi_get_port_modes(enp, &port_modes)) != 0) {
+ /* No port mode information available - use default mapping */
+ goto out;
+ }
+
+ /*
+ * Infer the internal port -> external port mapping from
+ * the possible port modes for this NIC.
+ */
+ for (i = 0; i < EFX_ARRAY_SIZE(__hunt_external_port_mappings); ++i) {
+ if (__hunt_external_port_mappings[i].family !=
+ enp->en_family)
+ continue;
+ matches = (__hunt_external_port_mappings[i].modes_mask &
+ port_modes);
+ if (matches != 0) {
+ stride = __hunt_external_port_mappings[i].stride;
+ port_modes &= ~matches;
+ }
+ }
+
+ if (port_modes != 0) {
+ /* Some advertised modes are not supported */
+ rc = ENOTSUP;
+ goto fail1;
+ }
+
+out:
+ /*
+ * Scale as required by last matched mode and then convert to
+ * one-based numbering
+ */
+ *external_portp = (uint8_t)(port / stride) + 1;
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+static __checkReturn int
+hunt_board_cfg(
+ __in efx_nic_t *enp)
+{
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+ uint8_t mac_addr[6];
+ uint32_t board_type = 0;
+ hunt_link_state_t hls;
+ efx_port_t *epp = &(enp->en_port);
+ uint32_t port;
+ uint32_t pf;
+ uint32_t vf;
+ uint32_t mask;
+ uint32_t flags;
+ uint32_t sysclk;
+ uint32_t base, nvec;
+ int rc;
+
+ if ((rc = efx_mcdi_get_port_assignment(enp, &port)) != 0)
+ goto fail1;
+
+ /*
+ * NOTE: The MCDI protocol numbers ports from zero.
+ * The common code MCDI interface numbers ports from one.
+ */
+ emip->emi_port = port + 1;
+
+ if ((rc = hunt_external_port_mapping(enp, port,
+ &encp->enc_external_port)) != 0)
+ goto fail2;
+
+ /*
+ * Get PCIe function number from firmware (used for
+ * per-function privilege and dynamic config info).
+ * - PCIe PF: pf = PF number, vf = 0xffff.
+ * - PCIe VF: pf = parent PF, vf = VF number.
+ */
+ if ((rc = efx_mcdi_get_function_info(enp, &pf, &vf)) != 0)
+ goto fail3;
+
+ encp->enc_pf = pf;
+ encp->enc_vf = vf;
+
+ /* MAC address for this function */
+ if (EFX_PCI_FUNCTION_IS_PF(encp)) {
+ rc = efx_mcdi_get_mac_address_pf(enp, mac_addr);
+ } else {
+ rc = efx_mcdi_get_mac_address_vf(enp, mac_addr);
+ }
+ if ((rc == 0) && (mac_addr[0] & 0x02)) {
+ /*
+ * If the static config does not include a global MAC address
+ * pool then the board may return a locally administered MAC
+ * address (this should only happen on incorrectly programmed
+ * boards).
+ */
+ rc = EINVAL;
+ }
+ if (rc != 0)
+ goto fail4;
+
+ EFX_MAC_ADDR_COPY(encp->enc_mac_addr, mac_addr);
+
+ /* Board configuration */
+ rc = efx_mcdi_get_board_cfg(enp, &board_type, NULL, NULL);
+ if (rc != 0) {
+ /* Unprivileged functions may not be able to read board cfg */
+ if (rc == EACCES)
+ board_type = 0;
+ else
+ goto fail5;
+ }
+
+ encp->enc_board_type = board_type;
+ encp->enc_clk_mult = 1; /* not used for Huntington */
+
+ /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */
+ if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0)
+ goto fail6;
+
+ /* Obtain the default PHY advertised capabilities */
+ if ((rc = hunt_phy_get_link(enp, &hls)) != 0)
+ goto fail7;
+ epp->ep_default_adv_cap_mask = hls.hls_adv_cap_mask;
+ epp->ep_adv_cap_mask = hls.hls_adv_cap_mask;
+
+ /*
+ * Enable firmware workarounds for hardware errata.
+ * Expected responses are:
+ * - 0 (zero):
+ * Success: workaround enabled or disabled as requested.
+ * - MC_CMD_ERR_ENOSYS (reported as ENOTSUP):
+ * Firmware does not support the MC_CMD_WORKAROUND request.
+ * (assume that the workaround is not supported).
+ * - MC_CMD_ERR_ENOENT (reported as ENOENT):
+ * Firmware does not support the requested workaround.
+ * - MC_CMD_ERR_EPERM (reported as EACCES):
+ * Unprivileged function cannot enable/disable workarounds.
+ *
+ * See efx_mcdi_request_errcode() for MCDI error translations.
+ */
+
+ /*
+ * If the bug35388 workaround is enabled, then use an indirect access
+ * method to avoid unsafe EVQ writes.
+ */
+ rc = efx_mcdi_set_workaround(enp, MC_CMD_WORKAROUND_BUG35388, B_TRUE,
+ NULL);
+ if ((rc == 0) || (rc == EACCES))
+ encp->enc_bug35388_workaround = B_TRUE;
+ else if ((rc == ENOTSUP) || (rc == ENOENT))
+ encp->enc_bug35388_workaround = B_FALSE;
+ else
+ goto fail8;
+
+ /*
+ * If the bug41750 workaround is enabled, then do not test interrupts,
+ * as the test will fail (seen with Greenport controllers).
+ */
+ rc = efx_mcdi_set_workaround(enp, MC_CMD_WORKAROUND_BUG41750, B_TRUE,
+ NULL);
+ if (rc == 0) {
+ encp->enc_bug41750_workaround = B_TRUE;
+ } else if (rc == EACCES) {
+ /* Assume a controller with 40G ports needs the workaround. */
+ if (epp->ep_default_adv_cap_mask & EFX_PHY_CAP_40000FDX)
+ encp->enc_bug41750_workaround = B_TRUE;
+ else
+ encp->enc_bug41750_workaround = B_FALSE;
+ } else if ((rc == ENOTSUP) || (rc == ENOENT)) {
+ encp->enc_bug41750_workaround = B_FALSE;
+ } else {
+ goto fail9;
+ }
+ if (EFX_PCI_FUNCTION_IS_VF(encp)) {
+ /* Interrupt testing does not work for VFs. See bug50084. */
+ encp->enc_bug41750_workaround = B_TRUE;
+ }
+
+ /*
+ * If the bug26807 workaround is enabled, then firmware has enabled
+ * support for chained multicast filters. Firmware will reset (FLR)
+ * functions which have filters in the hardware filter table when the
+ * workaround is enabled/disabled.
+ *
+ * We must recheck if the workaround is enabled after inserting the
+ * first hardware filter, in case it has been changed since this check.
+ */
+ rc = efx_mcdi_set_workaround(enp, MC_CMD_WORKAROUND_BUG26807,
+ B_TRUE, &flags);
+ if (rc == 0) {
+ encp->enc_bug26807_workaround = B_TRUE;
+ if (flags & (1 << MC_CMD_WORKAROUND_EXT_OUT_FLR_DONE_LBN)) {
+ /*
+ * Other functions had installed filters before the
+ * workaround was enabled, and they have been reset
+ * by firmware.
+ */
+ EFSYS_PROBE(bug26807_workaround_flr_done);
+ /* FIXME: bump MC warm boot count ? */
+ }
+ } else if (rc == EACCES) {
+ /*
+ * Unprivileged functions cannot enable the workaround in older
+ * firmware.
+ */
+ encp->enc_bug26807_workaround = B_FALSE;
+ } else if ((rc == ENOTSUP) || (rc == ENOENT)) {
+ encp->enc_bug26807_workaround = B_FALSE;
+ } else {
+ goto fail10;
+ }
+
+ /* Get sysclk frequency (in MHz). */
+ if ((rc = efx_mcdi_get_clock(enp, &sysclk)) != 0)
+ goto fail11;
+
+ /*
+ * The timer quantum is 1536 sysclk cycles, documented for the
+ * EV_TMR_VAL field of EV_TIMER_TBL. Scale for MHz and ns units.
+ */
+ encp->enc_evq_timer_quantum_ns = 1536000UL / sysclk; /* 1536 cycles */
+ if (encp->enc_bug35388_workaround) {
+ encp->enc_evq_timer_max_us = (encp->enc_evq_timer_quantum_ns <<
+ ERF_DD_EVQ_IND_TIMER_VAL_WIDTH) / 1000;
+ } else {
+ encp->enc_evq_timer_max_us = (encp->enc_evq_timer_quantum_ns <<
+ FRF_CZ_TC_TIMER_VAL_WIDTH) / 1000;
+ }
+
+ /* Check capabilities of running datapath firmware */
+ if ((rc = hunt_get_datapath_caps(enp)) != 0)
+ goto fail12;
+
+ /* Alignment for receive packet DMA buffers */
+ encp->enc_rx_buf_align_start = 1;
+ encp->enc_rx_buf_align_end = 64; /* RX DMA end padding */
+
+ /* Alignment for WPTR updates */
+ encp->enc_rx_push_align = HUNTINGTON_RX_WPTR_ALIGN;
+
+ /*
+ * Set resource limits for MC_CMD_ALLOC_VIS. Note that we cannot use
+ * MC_CMD_GET_RESOURCE_LIMITS here as that reports the available
+ * resources (allocated to this PCIe function), which is zero until
+ * after we have allocated VIs.
+ */
+ encp->enc_evq_limit = 1024;
+ encp->enc_rxq_limit = EFX_RXQ_LIMIT_TARGET;
+ encp->enc_txq_limit = EFX_TXQ_LIMIT_TARGET;
+
+ encp->enc_buftbl_limit = 0xFFFFFFFF;
+
+ encp->enc_piobuf_limit = HUNT_PIOBUF_NBUFS;
+ encp->enc_piobuf_size = HUNT_PIOBUF_SIZE;
+
+ /*
+ * Get the current privilege mask. Note that this may be modified
+ * dynamically, so this value is informational only. DO NOT use
+ * the privilege mask to check for sufficient privileges, as that
+ * can result in time-of-check/time-of-use bugs.
+ */
+ if ((rc = efx_mcdi_privilege_mask(enp, pf, vf, &mask)) != 0)
+ goto fail13;
+
+ encp->enc_privilege_mask = mask;
+
+ /* Get interrupt vector limits */
+ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) {
+ if (EFX_PCI_FUNCTION_IS_PF(encp))
+ goto fail14;
+
+ /* Ignore error (cannot query vector limits from a VF). */
+ base = 0;
+ nvec = 1024;
+ }
+ encp->enc_intr_vec_base = base;
+ encp->enc_intr_limit = nvec;
+
+ /*
+ * Maximum number of bytes into the frame the TCP header can start for
+ * firmware assisted TSO to work.
+ */
+ encp->enc_tx_tso_tcp_header_offset_limit = 208;
+
+ return (0);
+
+fail14:
+ EFSYS_PROBE(fail14);
+fail13:
+ EFSYS_PROBE(fail13);
+fail12:
+ EFSYS_PROBE(fail12);
+fail11:
+ EFSYS_PROBE(fail11);
+fail10:
+ EFSYS_PROBE(fail10);
+fail9:
+ EFSYS_PROBE(fail9);
+fail8:
+ EFSYS_PROBE(fail8);
+fail7:
+ EFSYS_PROBE(fail7);
+fail6:
+ EFSYS_PROBE(fail6);
+fail5:
+ EFSYS_PROBE(fail5);
+fail4:
+ EFSYS_PROBE(fail4);
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+
+ __checkReturn int
+hunt_nic_probe(
+ __in efx_nic_t *enp)
+{
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+ efx_drv_cfg_t *edcp = &(enp->en_drv_cfg);
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON);
+
+ /* Read and clear any assertion state */
+ if ((rc = efx_mcdi_read_assertion(enp)) != 0)
+ goto fail1;
+
+ /* Exit the assertion handler */
+ if ((rc = efx_mcdi_exit_assertion_handler(enp)) != 0)
+ if (rc != EACCES)
+ goto fail2;
+
+ if ((rc = efx_mcdi_drv_attach(enp, B_TRUE)) != 0)
+ goto fail3;
+
+ if ((rc = hunt_board_cfg(enp)) != 0)
+ if (rc != EACCES)
+ goto fail4;
+
+ /*
+ * Set default driver config limits (based on board config).
+ *
+ * FIXME: For now allocate a fixed number of VIs which is likely to be
+ * sufficient and small enough to allow multiple functions on the same
+ * port.
+ */
+ edcp->edc_min_vi_count = edcp->edc_max_vi_count =
+ MIN(128, MAX(encp->enc_rxq_limit, encp->enc_txq_limit));
+
+ /* The client driver must configure and enable PIO buffer support */
+ edcp->edc_max_piobuf_count = 0;
+ edcp->edc_pio_alloc_size = 0;
+
+#if EFSYS_OPT_MAC_STATS
+ /* Wipe the MAC statistics */
+ if ((rc = efx_mcdi_mac_stats_clear(enp)) != 0)
+ goto fail5;
+#endif
+
+#if EFSYS_OPT_LOOPBACK
+ if ((rc = efx_mcdi_get_loopback_modes(enp)) != 0)
+ goto fail6;
+#endif
+
+#if EFSYS_OPT_MON_STATS
+ if ((rc = mcdi_mon_cfg_build(enp)) != 0) {
+ /* Unprivileged functions do not have access to sensors */
+ if (rc != EACCES)
+ goto fail7;
+ }
+#endif
+
+ encp->enc_features = enp->en_features;
+
+ return (0);
+
+#if EFSYS_OPT_MON_STATS
+fail7:
+ EFSYS_PROBE(fail7);
+#endif
+#if EFSYS_OPT_LOOPBACK
+fail6:
+ EFSYS_PROBE(fail6);
+#endif
+#if EFSYS_OPT_MAC_STATS
+fail5:
+ EFSYS_PROBE(fail5);
+#endif
+fail4:
+ EFSYS_PROBE(fail4);
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_nic_set_drv_limits(
+ __inout efx_nic_t *enp,
+ __in efx_drv_limits_t *edlp)
+{
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+ efx_drv_cfg_t *edcp = &(enp->en_drv_cfg);
+ uint32_t min_evq_count, max_evq_count;
+ uint32_t min_rxq_count, max_rxq_count;
+ uint32_t min_txq_count, max_txq_count;
+ int rc;
+
+ if (edlp == NULL) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ /* Get minimum required and maximum usable VI limits */
+ min_evq_count = MIN(edlp->edl_min_evq_count, encp->enc_evq_limit);
+ min_rxq_count = MIN(edlp->edl_min_rxq_count, encp->enc_rxq_limit);
+ min_txq_count = MIN(edlp->edl_min_txq_count, encp->enc_txq_limit);
+
+ edcp->edc_min_vi_count =
+ MAX(min_evq_count, MAX(min_rxq_count, min_txq_count));
+
+ max_evq_count = MIN(edlp->edl_max_evq_count, encp->enc_evq_limit);
+ max_rxq_count = MIN(edlp->edl_max_rxq_count, encp->enc_rxq_limit);
+ max_txq_count = MIN(edlp->edl_max_txq_count, encp->enc_txq_limit);
+
+ edcp->edc_max_vi_count =
+ MAX(max_evq_count, MAX(max_rxq_count, max_txq_count));
+
+ /*
+ * Check limits for sub-allocated piobuf blocks.
+ * PIO is optional, so don't fail if the limits are incorrect.
+ */
+ if ((encp->enc_piobuf_size == 0) ||
+ (encp->enc_piobuf_limit == 0) ||
+ (edlp->edl_min_pio_alloc_size == 0) ||
+ (edlp->edl_min_pio_alloc_size > encp->enc_piobuf_size)) {
+ /* Disable PIO */
+ edcp->edc_max_piobuf_count = 0;
+ edcp->edc_pio_alloc_size = 0;
+ } else {
+ uint32_t blk_size, blk_count, blks_per_piobuf;
+
+ blk_size =
+ MAX(edlp->edl_min_pio_alloc_size, HUNT_MIN_PIO_ALLOC_SIZE);
+
+ blks_per_piobuf = encp->enc_piobuf_size / blk_size;
+ EFSYS_ASSERT3U(blks_per_piobuf, <=, 32);
+
+ blk_count = (encp->enc_piobuf_limit * blks_per_piobuf);
+
+ /* A zero max pio alloc count means unlimited */
+ if ((edlp->edl_max_pio_alloc_count > 0) &&
+ (edlp->edl_max_pio_alloc_count < blk_count)) {
+ blk_count = edlp->edl_max_pio_alloc_count;
+ }
+
+ edcp->edc_pio_alloc_size = blk_size;
+ edcp->edc_max_piobuf_count =
+ (blk_count + (blks_per_piobuf - 1)) / blks_per_piobuf;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+
+ __checkReturn int
+hunt_nic_reset(
+ __in efx_nic_t *enp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_ENTITY_RESET_IN_LEN,
+ MC_CMD_ENTITY_RESET_OUT_LEN)];
+ int rc;
+
+ /* hunt_nic_reset() is called to recover from BADASSERT failures. */
+ if ((rc = efx_mcdi_read_assertion(enp)) != 0)
+ goto fail1;
+ if ((rc = efx_mcdi_exit_assertion_handler(enp)) != 0)
+ goto fail2;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_ENTITY_RESET;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_ENTITY_RESET_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_ENTITY_RESET_OUT_LEN;
+
+ MCDI_IN_POPULATE_DWORD_1(req, ENTITY_RESET_IN_FLAG,
+ ENTITY_RESET_IN_FUNCTION_RESOURCE_RESET, 1);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail3;
+ }
+
+ /* Clear RX/TX DMA queue errors */
+ enp->en_reset_flags &= ~(EFX_RESET_RXQ_ERR | EFX_RESET_TXQ_ERR);
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_nic_init(
+ __in efx_nic_t *enp)
+{
+ efx_drv_cfg_t *edcp = &(enp->en_drv_cfg);
+ uint32_t min_vi_count, max_vi_count;
+ uint32_t vi_count, vi_base;
+ uint32_t i;
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON);
+
+ /* Enable reporting of some events (e.g. link change) */
+ if ((rc = efx_mcdi_log_ctrl(enp)) != 0)
+ goto fail1;
+
+ /* Allocate (optional) on-chip PIO buffers */
+ hunt_nic_alloc_piobufs(enp, edcp->edc_max_piobuf_count);
+
+ /*
+ * For best performance, PIO writes should use a write-combined
+ * (WC) memory mapping. Using a separate WC mapping for the PIO
+ * aperture of each VI would be a burden to drivers (and not
+ * possible if the host page size is >4Kbyte).
+ *
+ * To avoid this we use a single uncached (UC) mapping for VI
+ * register access, and a single WC mapping for extra VIs used
+ * for PIO writes.
+ *
+ * Each piobuf must be linked to a VI in the WC mapping, and to
+ * each VI that is using a sub-allocated block from the piobuf.
+ */
+ min_vi_count = edcp->edc_min_vi_count;
+ max_vi_count = edcp->edc_max_vi_count + enp->en_u.hunt.enu_piobuf_count;
+
+ /* Ensure that the previously attached driver's VIs are freed */
+ if ((rc = efx_mcdi_free_vis(enp)) != 0)
+ goto fail2;
+
+ /*
+ * Reserve VI resources (EVQ+RXQ+TXQ) for this PCIe function. If this
+ * fails then retrying the request for fewer VI resources may succeed.
+ */
+ vi_count = 0;
+ if ((rc = efx_mcdi_alloc_vis(enp, min_vi_count, max_vi_count,
+ &vi_base, &vi_count)) != 0)
+ goto fail3;
+
+ EFSYS_PROBE2(vi_alloc, uint32_t, vi_base, uint32_t, vi_count);
+
+ if (vi_count < min_vi_count) {
+ rc = ENOMEM;
+ goto fail4;
+ }
+
+ enp->en_u.hunt.enu_vi_base = vi_base;
+ enp->en_u.hunt.enu_vi_count = vi_count;
+
+ if (vi_count < min_vi_count + enp->en_u.hunt.enu_piobuf_count) {
+ /* Not enough extra VIs to map piobufs */
+ hunt_nic_free_piobufs(enp);
+ }
+
+ enp->en_u.hunt.enu_pio_write_vi_base =
+ vi_count - enp->en_u.hunt.enu_piobuf_count;
+
+ /* Save UC memory mapping details */
+ enp->en_u.hunt.enu_uc_mem_map_offset = 0;
+ if (enp->en_u.hunt.enu_piobuf_count > 0) {
+ enp->en_u.hunt.enu_uc_mem_map_size =
+ (ER_DZ_TX_PIOBUF_STEP *
+ enp->en_u.hunt.enu_pio_write_vi_base);
+ } else {
+ enp->en_u.hunt.enu_uc_mem_map_size =
+ (ER_DZ_TX_PIOBUF_STEP *
+ enp->en_u.hunt.enu_vi_count);
+ }
+
+ /* Save WC memory mapping details */
+ enp->en_u.hunt.enu_wc_mem_map_offset =
+ enp->en_u.hunt.enu_uc_mem_map_offset +
+ enp->en_u.hunt.enu_uc_mem_map_size;
+
+ enp->en_u.hunt.enu_wc_mem_map_size =
+ (ER_DZ_TX_PIOBUF_STEP *
+ enp->en_u.hunt.enu_piobuf_count);
+
+ /* Link piobufs to extra VIs in WC mapping */
+ if (enp->en_u.hunt.enu_piobuf_count > 0) {
+ for (i = 0; i < enp->en_u.hunt.enu_piobuf_count; i++) {
+ rc = efx_mcdi_link_piobuf(enp,
+ enp->en_u.hunt.enu_pio_write_vi_base + i,
+ enp->en_u.hunt.enu_piobuf_handle[i]);
+ if (rc != 0)
+ break;
+ }
+ }
+
+ /* Allocate a vAdapter attached to our upstream vPort/pPort */
+ if ((rc = efx_mcdi_vadaptor_alloc(enp, EVB_PORT_ID_ASSIGNED)) != 0)
+ goto fail5;
+
+ enp->en_vport_id = EVB_PORT_ID_ASSIGNED;
+
+ return (0);
+
+fail5:
+ EFSYS_PROBE(fail5);
+fail4:
+ EFSYS_PROBE(fail4);
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+
+ hunt_nic_free_piobufs(enp);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_nic_get_vi_pool(
+ __in efx_nic_t *enp,
+ __out uint32_t *vi_countp)
+{
+ EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON);
+
+ /*
+ * Report VIs that the client driver can use.
+ * Do not include VIs used for PIO buffer writes.
+ */
+ *vi_countp = enp->en_u.hunt.enu_pio_write_vi_base;
+
+ return (0);
+}
+
+ __checkReturn int
+hunt_nic_get_bar_region(
+ __in efx_nic_t *enp,
+ __in efx_nic_region_t region,
+ __out uint32_t *offsetp,
+ __out size_t *sizep)
+{
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON);
+
+ /*
+ * TODO: Specify host memory mapping alignment and granularity
+ * in efx_drv_limits_t so that they can be taken into account
+ * when allocating extra VIs for PIO writes.
+ */
+ switch (region) {
+ case EFX_REGION_VI:
+ /* UC mapped memory BAR region for VI registers */
+ *offsetp = enp->en_u.hunt.enu_uc_mem_map_offset;
+ *sizep = enp->en_u.hunt.enu_uc_mem_map_size;
+ break;
+
+ case EFX_REGION_PIO_WRITE_VI:
+ /* WC mapped memory BAR region for piobuf writes */
+ *offsetp = enp->en_u.hunt.enu_wc_mem_map_offset;
+ *sizep = enp->en_u.hunt.enu_wc_mem_map_size;
+ break;
+
+ default:
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ void
+hunt_nic_fini(
+ __in efx_nic_t *enp)
+{
+ (void) efx_mcdi_vadaptor_free(enp, enp->en_vport_id);
+ enp->en_vport_id = 0;
+
+ /* FIXME: do we need to unlink piobufs ? */
+ hunt_nic_free_piobufs(enp);
+
+ (void) efx_mcdi_free_vis(enp);
+ enp->en_u.hunt.enu_vi_count = 0;
+}
+
+ void
+hunt_nic_unprobe(
+ __in efx_nic_t *enp)
+{
+#if EFSYS_OPT_MON_STATS
+ mcdi_mon_cfg_free(enp);
+#endif /* EFSYS_OPT_MON_STATS */
+ (void) efx_mcdi_drv_attach(enp, B_FALSE);
+}
+
+#if EFSYS_OPT_DIAG
+
+ __checkReturn int
+hunt_nic_register_test(
+ __in efx_nic_t *enp)
+{
+ int rc;
+
+ /* FIXME */
+ _NOTE(ARGUNUSED(enp))
+ if (B_FALSE) {
+ rc = ENOTSUP;
+ goto fail1;
+ }
+ /* FIXME */
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+#endif /* EFSYS_OPT_DIAG */
+
+
+
+#endif /* EFSYS_OPT_HUNTINGTON */
diff --git a/sys/dev/sfxge/common/hunt_nvram.c b/sys/dev/sfxge/common/hunt_nvram.c
new file mode 100644
index 0000000..3e130f4
--- /dev/null
+++ b/sys/dev/sfxge/common/hunt_nvram.c
@@ -0,0 +1,1538 @@
+/*-
+ * Copyright (c) 2012-2015 Solarflare Communications Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "efsys.h"
+#include "efx.h"
+#include "efx_types.h"
+#include "efx_regs.h"
+#include "efx_impl.h"
+
+#if EFSYS_OPT_HUNTINGTON
+
+#if EFSYS_OPT_VPD || EFSYS_OPT_NVRAM
+
+#include "ef10_tlv_layout.h"
+
+/* Cursor for TLV partition format */
+typedef struct tlv_cursor_s {
+ uint32_t *block; /* Base of data block */
+ uint32_t *current; /* Cursor position */
+ uint32_t *end; /* End tag position */
+ uint32_t *limit; /* Last dword of data block */
+} tlv_cursor_t;
+
+static __checkReturn int
+tlv_validate_state(
+ __in tlv_cursor_t *cursor);
+
+
+/*
+ * Operations on TLV formatted partition data.
+ */
+static uint32_t
+tlv_tag(
+ __in tlv_cursor_t *cursor)
+{
+ uint32_t dword, tag;
+
+ dword = cursor->current[0];
+ tag = __LE_TO_CPU_32(dword);
+
+ return (tag);
+}
+
+static size_t
+tlv_length(
+ __in tlv_cursor_t *cursor)
+{
+ uint32_t dword, length;
+
+ if (tlv_tag(cursor) == TLV_TAG_END)
+ return (0);
+
+ dword = cursor->current[1];
+ length = __LE_TO_CPU_32(dword);
+
+ return ((size_t)length);
+}
+
+static uint8_t *
+tlv_value(
+ __in tlv_cursor_t *cursor)
+{
+ if (tlv_tag(cursor) == TLV_TAG_END)
+ return (NULL);
+
+ return ((uint8_t *)(&cursor->current[2]));
+}
+
+static uint8_t *
+tlv_item(
+ __in tlv_cursor_t *cursor)
+{
+ if (tlv_tag(cursor) == TLV_TAG_END)
+ return (NULL);
+
+ return ((uint8_t *)cursor->current);
+}
+
+/*
+ * TLV item DWORD length is tag + length + value (rounded up to DWORD)
+ * equivalent to tlv_n_words_for_len in mc-comms tlv.c
+ */
+#define TLV_DWORD_COUNT(length) \
+ (1 + 1 + (((length) + sizeof (uint32_t) - 1) / sizeof (uint32_t)))
+
+
+static uint32_t *
+tlv_next_item_ptr(
+ __in tlv_cursor_t *cursor)
+{
+ uint32_t length;
+
+ length = tlv_length(cursor);
+
+ return (cursor->current + TLV_DWORD_COUNT(length));
+}
+
+static int
+tlv_advance(
+ __in tlv_cursor_t *cursor)
+{
+ int rc;
+
+ if ((rc = tlv_validate_state(cursor)) != 0)
+ goto fail1;
+
+ if (cursor->current == cursor->end) {
+ /* No more tags after END tag */
+ cursor->current = NULL;
+ rc = ENOENT;
+ goto fail2;
+ }
+
+ /* Advance to next item and validate */
+ cursor->current = tlv_next_item_ptr(cursor);
+
+ if ((rc = tlv_validate_state(cursor)) != 0)
+ goto fail3;
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+static int
+tlv_rewind(
+ __in tlv_cursor_t *cursor)
+{
+ int rc;
+
+ cursor->current = cursor->block;
+
+ if ((rc = tlv_validate_state(cursor)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+static int
+tlv_find(
+ __in tlv_cursor_t *cursor,
+ __in uint32_t tag)
+{
+ int rc;
+
+ rc = tlv_rewind(cursor);
+ while (rc == 0) {
+ if (tlv_tag(cursor) == tag)
+ break;
+
+ rc = tlv_advance(cursor);
+ }
+ return (rc);
+}
+
+static __checkReturn int
+tlv_validate_state(
+ __in tlv_cursor_t *cursor)
+{
+ int rc;
+
+ /* Check cursor position */
+ if (cursor->current < cursor->block) {
+ rc = EINVAL;
+ goto fail1;
+ }
+ if (cursor->current > cursor->limit) {
+ rc = EINVAL;
+ goto fail2;
+ }
+
+ if (tlv_tag(cursor) != TLV_TAG_END) {
+ /* Check current item has space for tag and length */
+ if (cursor->current > (cursor->limit - 2)) {
+ cursor->current = NULL;
+ rc = EFAULT;
+ goto fail3;
+ }
+
+ /* Check we have value data for current item and another tag */
+ if (tlv_next_item_ptr(cursor) > (cursor->limit - 1)) {
+ cursor->current = NULL;
+ rc = EFAULT;
+ goto fail4;
+ }
+ }
+
+ return (0);
+
+fail4:
+ EFSYS_PROBE(fail4);
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+static int
+tlv_init_cursor(
+ __in tlv_cursor_t *cursor,
+ __in uint32_t *block,
+ __in uint32_t *limit)
+{
+ cursor->block = block;
+ cursor->limit = limit;
+
+ cursor->current = cursor->block;
+ cursor->end = NULL;
+
+ return (tlv_validate_state(cursor));
+}
+
+static int
+tlv_init_cursor_from_size(
+ __in tlv_cursor_t *cursor,
+ __in uint8_t *block,
+ __in size_t size)
+{
+ uint32_t *limit;
+ limit = (uint32_t *)(block + size - sizeof (uint32_t));
+ return (tlv_init_cursor(cursor, (uint32_t *)block, limit));
+}
+
+static int
+tlv_require_end(
+ __in tlv_cursor_t *cursor)
+{
+ uint32_t *pos;
+ int rc;
+
+ if (cursor->end == NULL) {
+ pos = cursor->current;
+ if ((rc = tlv_find(cursor, TLV_TAG_END)) != 0)
+ goto fail1;
+
+ cursor->end = cursor->current;
+ cursor->current = pos;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+static size_t
+tlv_block_length_used(
+ __in tlv_cursor_t *cursor)
+{
+ int rc;
+
+ if ((rc = tlv_validate_state(cursor)) != 0)
+ goto fail1;
+
+ if ((rc = tlv_require_end(cursor)) != 0)
+ goto fail2;
+
+ /* Return space used (including the END tag) */
+ return (cursor->end + 1 - cursor->block) * sizeof (uint32_t);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (0);
+}
+
+
+static __checkReturn uint32_t *
+tlv_write(
+ __in tlv_cursor_t *cursor,
+ __in uint32_t tag,
+ __in_bcount(size) uint8_t *data,
+ __in size_t size)
+{
+ uint32_t len = size;
+ uint32_t *ptr;
+
+ ptr = cursor->current;
+
+ *ptr++ = __CPU_TO_LE_32(tag);
+ *ptr++ = __CPU_TO_LE_32(len);
+
+ if (len > 0) {
+ ptr[(len - 1) / sizeof (uint32_t)] = 0;
+ memcpy(ptr, data, len);
+ ptr += P2ROUNDUP(len, sizeof (uint32_t)) / sizeof (*ptr);
+ }
+
+ return (ptr);
+}
+
+static __checkReturn int
+tlv_insert(
+ __in tlv_cursor_t *cursor,
+ __in uint32_t tag,
+ __in uint8_t *data,
+ __in size_t size)
+{
+ unsigned int delta;
+ int rc;
+
+ if ((rc = tlv_validate_state(cursor)) != 0)
+ goto fail1;
+
+ if ((rc = tlv_require_end(cursor)) != 0)
+ goto fail2;
+
+ if (tag == TLV_TAG_END) {
+ rc = EINVAL;
+ goto fail3;
+ }
+
+ delta = TLV_DWORD_COUNT(size);
+ if (cursor->end + 1 + delta > cursor->limit) {
+ rc = ENOSPC;
+ goto fail4;
+ }
+
+ /* Move data up: new space at cursor->current */
+ memmove(cursor->current + delta, cursor->current,
+ (cursor->end + 1 - cursor->current) * sizeof (uint32_t));
+
+ /* Adjust the end pointer */
+ cursor->end += delta;
+
+ /* Write new TLV item */
+ tlv_write(cursor, tag, data, size);
+
+ return (0);
+
+fail4:
+ EFSYS_PROBE(fail4);
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+static __checkReturn int
+tlv_modify(
+ __in tlv_cursor_t *cursor,
+ __in uint32_t tag,
+ __in uint8_t *data,
+ __in size_t size)
+{
+ uint32_t *pos;
+ unsigned int old_ndwords;
+ unsigned int new_ndwords;
+ unsigned int delta;
+ int rc;
+
+ if ((rc = tlv_validate_state(cursor)) != 0)
+ goto fail1;
+
+ if (tlv_tag(cursor) == TLV_TAG_END) {
+ rc = EINVAL;
+ goto fail2;
+ }
+ if (tlv_tag(cursor) != tag) {
+ rc = EINVAL;
+ goto fail3;
+ }
+
+ old_ndwords = TLV_DWORD_COUNT(tlv_length(cursor));
+ new_ndwords = TLV_DWORD_COUNT(size);
+
+ if ((rc = tlv_require_end(cursor)) != 0)
+ goto fail4;
+
+ if (new_ndwords > old_ndwords) {
+ /* Expand space used for TLV item */
+ delta = new_ndwords - old_ndwords;
+ pos = cursor->current + old_ndwords;
+
+ if (cursor->end + 1 + delta > cursor->limit) {
+ rc = ENOSPC;
+ goto fail5;
+ }
+
+ /* Move up: new space at (cursor->current + old_ndwords) */
+ memmove(pos + delta, pos,
+ (cursor->end + 1 - pos) * sizeof (uint32_t));
+
+ /* Adjust the end pointer */
+ cursor->end += delta;
+
+ } else if (new_ndwords < old_ndwords) {
+ /* Shrink space used for TLV item */
+ delta = old_ndwords - new_ndwords;
+ pos = cursor->current + new_ndwords;
+
+ /* Move down: remove words at (cursor->current + new_ndwords) */
+ memmove(pos, pos + delta,
+ (cursor->end + 1 - pos) * sizeof (uint32_t));
+
+ /* Zero the new space at the end of the TLV chain */
+ memset(cursor->end + 1 - delta, 0, delta * sizeof (uint32_t));
+
+ /* Adjust the end pointer */
+ cursor->end -= delta;
+ }
+
+ /* Write new data */
+ tlv_write(cursor, tag, data, size);
+
+ return (0);
+
+fail5:
+ EFSYS_PROBE(fail5);
+fail4:
+ EFSYS_PROBE(fail4);
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+/* Validate TLV formatted partition contents (before writing to flash) */
+ __checkReturn int
+efx_nvram_tlv_validate(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __in_bcount(partn_size) caddr_t partn_data,
+ __in size_t partn_size)
+{
+ tlv_cursor_t cursor;
+ struct tlv_partition_header *header;
+ struct tlv_partition_trailer *trailer;
+ size_t total_length;
+ uint32_t cksum;
+ int pos;
+ int rc;
+
+ EFX_STATIC_ASSERT(sizeof (*header) <= HUNTINGTON_NVRAM_CHUNK);
+
+ if ((partn_data == NULL) || (partn_size == 0)) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ /* The partition header must be the first item (at offset zero) */
+ if ((rc = tlv_init_cursor_from_size(&cursor, partn_data,
+ partn_size)) != 0) {
+ rc = EFAULT;
+ goto fail2;
+ }
+ if (tlv_tag(&cursor) != TLV_TAG_PARTITION_HEADER) {
+ rc = EINVAL;
+ goto fail3;
+ }
+ header = (struct tlv_partition_header *)tlv_item(&cursor);
+
+ /* Check TLV partition length (includes the END tag) */
+ total_length = __LE_TO_CPU_32(header->total_length);
+ if (total_length > partn_size) {
+ rc = EFBIG;
+ goto fail4;
+ }
+
+ /* Check partition ends with PARTITION_TRAILER and END tags */
+ if ((rc = tlv_find(&cursor, TLV_TAG_PARTITION_TRAILER)) != 0) {
+ rc = EINVAL;
+ goto fail5;
+ }
+ trailer = (struct tlv_partition_trailer *)tlv_item(&cursor);
+
+ if ((rc = tlv_advance(&cursor)) != 0) {
+ rc = EINVAL;
+ goto fail6;
+ }
+ if (tlv_tag(&cursor) != TLV_TAG_END) {
+ rc = EINVAL;
+ goto fail7;
+ }
+
+ /* Check generation counts are consistent */
+ if (trailer->generation != header->generation) {
+ rc = EINVAL;
+ goto fail8;
+ }
+
+ /* Verify partition checksum */
+ cksum = 0;
+ for (pos = 0; (size_t)pos < total_length; pos += sizeof (uint32_t)) {
+ cksum += *((uint32_t *)(partn_data + pos));
+ }
+ if (cksum != 0) {
+ rc = EINVAL;
+ goto fail9;
+ }
+
+ return (0);
+
+fail9:
+ EFSYS_PROBE(fail9);
+fail8:
+ EFSYS_PROBE(fail8);
+fail7:
+ EFSYS_PROBE(fail7);
+fail6:
+ EFSYS_PROBE(fail6);
+fail5:
+ EFSYS_PROBE(fail5);
+fail4:
+ EFSYS_PROBE(fail4);
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+/* Read and validate an entire TLV formatted partition */
+static __checkReturn int
+hunt_nvram_read_tlv_partition(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __in_bcount(partn_size) caddr_t partn_data,
+ __in size_t partn_size)
+{
+ tlv_cursor_t cursor;
+ struct tlv_partition_header *header;
+ struct tlv_partition_trailer *trailer;
+ size_t total_length;
+ uint32_t cksum;
+ int pos;
+ int rc;
+
+ EFX_STATIC_ASSERT(sizeof (*header) <= HUNTINGTON_NVRAM_CHUNK);
+
+ if ((partn_data == NULL) || (partn_size == 0)) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ /* Read initial chunk of partition */
+ if ((rc = hunt_nvram_partn_read(enp, partn, 0, partn_data,
+ HUNTINGTON_NVRAM_CHUNK)) != 0) {
+ goto fail2;
+ }
+
+ /* The partition header must be the first item (at offset zero) */
+ if ((rc = tlv_init_cursor_from_size(&cursor, partn_data,
+ partn_size)) != 0) {
+ rc = EFAULT;
+ goto fail3;
+ }
+ if (tlv_tag(&cursor) != TLV_TAG_PARTITION_HEADER) {
+ rc = EINVAL;
+ goto fail4;
+ }
+ header = (struct tlv_partition_header *)tlv_item(&cursor);
+
+ /* Check TLV partition length (includes the END tag) */
+ total_length = __LE_TO_CPU_32(header->total_length);
+ if (total_length > partn_size) {
+ rc = EFBIG;
+ goto fail5;
+ }
+
+ /* Read the remaining partition content */
+ if (total_length > HUNTINGTON_NVRAM_CHUNK) {
+ if ((rc = hunt_nvram_partn_read(enp, partn,
+ HUNTINGTON_NVRAM_CHUNK,
+ partn_data + HUNTINGTON_NVRAM_CHUNK,
+ total_length - HUNTINGTON_NVRAM_CHUNK)) != 0)
+ goto fail6;
+ }
+
+ /* Check partition ends with PARTITION_TRAILER and END tags */
+ if ((rc = tlv_find(&cursor, TLV_TAG_PARTITION_TRAILER)) != 0) {
+ rc = EINVAL;
+ goto fail7;
+ }
+ trailer = (struct tlv_partition_trailer *)tlv_item(&cursor);
+
+ if ((rc = tlv_advance(&cursor)) != 0) {
+ rc = EINVAL;
+ goto fail8;
+ }
+ if (tlv_tag(&cursor) != TLV_TAG_END) {
+ rc = EINVAL;
+ goto fail9;
+ }
+
+ /* Check data read from partition is consistent */
+ if (trailer->generation != header->generation) {
+ /*
+ * The partition data may have been modified between successive
+ * MCDI NVRAM_READ requests by the MC or another PCI function.
+ *
+ * The caller must retry to obtain consistent partition data.
+ */
+ rc = EAGAIN;
+ goto fail10;
+ }
+
+ /* Verify partition checksum */
+ cksum = 0;
+ for (pos = 0; (size_t)pos < total_length; pos += sizeof (uint32_t)) {
+ cksum += *((uint32_t *)(partn_data + pos));
+ }
+ if (cksum != 0) {
+ rc = EINVAL;
+ goto fail11;
+ }
+
+ return (0);
+
+fail11:
+ EFSYS_PROBE(fail11);
+fail10:
+ EFSYS_PROBE(fail10);
+fail9:
+ EFSYS_PROBE(fail9);
+fail8:
+ EFSYS_PROBE(fail8);
+fail7:
+ EFSYS_PROBE(fail7);
+fail6:
+ EFSYS_PROBE(fail6);
+fail5:
+ EFSYS_PROBE(fail5);
+fail4:
+ EFSYS_PROBE(fail4);
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+/*
+ * Read a single TLV item from a host memory
+ * buffer containing a TLV formatted partition.
+ */
+ __checkReturn int
+hunt_nvram_buf_read_tlv(
+ __in efx_nic_t *enp,
+ __in_bcount(partn_size) caddr_t partn_data,
+ __in size_t partn_size,
+ __in uint32_t tag,
+ __deref_out_bcount_opt(*sizep) caddr_t *datap,
+ __out size_t *sizep)
+{
+ tlv_cursor_t cursor;
+ caddr_t data;
+ size_t length;
+ caddr_t value;
+ int rc;
+
+ if ((partn_data == NULL) || (partn_size == 0)) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ /* Find requested TLV tag in partition data */
+ if ((rc = tlv_init_cursor_from_size(&cursor, partn_data,
+ partn_size)) != 0) {
+ rc = EFAULT;
+ goto fail2;
+ }
+ if ((rc = tlv_find(&cursor, tag)) != 0) {
+ rc = ENOENT;
+ goto fail3;
+ }
+ value = tlv_value(&cursor);
+ length = tlv_length(&cursor);
+
+ if (length == 0)
+ data = NULL;
+ else {
+ /* Copy out data from TLV item */
+ EFSYS_KMEM_ALLOC(enp->en_esip, length, data);
+ if (data == NULL) {
+ rc = ENOMEM;
+ goto fail4;
+ }
+ memcpy(data, value, length);
+ }
+
+ *datap = data;
+ *sizep = length;
+
+ return (0);
+
+fail4:
+ EFSYS_PROBE(fail4);
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+
+
+/* Read a single TLV item from a TLV formatted partition */
+ __checkReturn int
+hunt_nvram_partn_read_tlv(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __in uint32_t tag,
+ __deref_out_bcount_opt(*sizep) caddr_t *datap,
+ __out size_t *sizep)
+{
+ caddr_t partn_data = NULL;
+ size_t partn_size = 0;
+ size_t length;
+ caddr_t data;
+ int retry;
+ int rc;
+
+ /* Allocate sufficient memory for the entire partition */
+ if ((rc = hunt_nvram_partn_size(enp, partn, &partn_size)) != 0)
+ goto fail1;
+
+ if (partn_size == 0) {
+ rc = ENOENT;
+ goto fail2;
+ }
+
+ EFSYS_KMEM_ALLOC(enp->en_esip, partn_size, partn_data);
+ if (partn_data == NULL) {
+ rc = ENOMEM;
+ goto fail3;
+ }
+
+ /*
+ * Read the entire TLV partition. Retry until consistent partition
+ * contents are returned. Inconsistent data may be read if:
+ * a) the partition contents are invalid
+ * b) the MC has rebooted while we were reading the partition
+ * c) the partition has been modified while we were reading it
+ * Limit retry attempts to ensure forward progress.
+ */
+ retry = 10;
+ do {
+ rc = hunt_nvram_read_tlv_partition(enp, partn,
+ partn_data, partn_size);
+ } while ((rc == EAGAIN) && (--retry > 0));
+
+ if (rc != 0) {
+ /* Failed to obtain consistent partition data */
+ goto fail4;
+ }
+
+ if ((rc = hunt_nvram_buf_read_tlv(enp, partn_data, partn_size,
+ tag, &data, &length)) != 0)
+ goto fail5;
+
+ EFSYS_KMEM_FREE(enp->en_esip, partn_size, partn_data);
+
+ *datap = data;
+ *sizep = length;
+
+ return (0);
+
+fail5:
+ EFSYS_PROBE(fail5);
+fail4:
+ EFSYS_PROBE(fail4);
+
+ EFSYS_KMEM_FREE(enp->en_esip, partn_size, partn_data);
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+/*
+ * Add or update a single TLV item in a host memory buffer containing a TLV
+ * formatted partition.
+ */
+ __checkReturn int
+hunt_nvram_buf_write_tlv(
+ __inout_bcount(partn_size) caddr_t partn_data,
+ __in size_t partn_size,
+ __in uint32_t tag,
+ __in_bcount(tag_size) caddr_t tag_data,
+ __in size_t tag_size,
+ __out size_t *total_lengthp)
+{
+ tlv_cursor_t cursor;
+ struct tlv_partition_header *header;
+ struct tlv_partition_trailer *trailer;
+ uint32_t generation;
+ uint32_t cksum;
+ int pos;
+ int rc;
+
+ /* The partition header must be the first item (at offset zero) */
+ if ((rc = tlv_init_cursor_from_size(&cursor, partn_data,
+ partn_size)) != 0) {
+ rc = EFAULT;
+ goto fail1;
+ }
+ if (tlv_tag(&cursor) != TLV_TAG_PARTITION_HEADER) {
+ rc = EINVAL;
+ goto fail2;
+ }
+ header = (struct tlv_partition_header *)tlv_item(&cursor);
+
+ /* Update the TLV chain to contain the new data */
+ if ((rc = tlv_find(&cursor, tag)) == 0) {
+ /* Modify existing TLV item */
+ if ((rc = tlv_modify(&cursor, tag,
+ tag_data, tag_size)) != 0)
+ goto fail3;
+ } else {
+ /* Insert a new TLV item before the PARTITION_TRAILER */
+ rc = tlv_find(&cursor, TLV_TAG_PARTITION_TRAILER);
+ if (rc != 0) {
+ rc = EINVAL;
+ goto fail4;
+ }
+ if ((rc = tlv_insert(&cursor, tag,
+ tag_data, tag_size)) != 0) {
+ rc = EINVAL;
+ goto fail5;
+ }
+ }
+
+ /* Find the trailer tag */
+ if ((rc = tlv_find(&cursor, TLV_TAG_PARTITION_TRAILER)) != 0) {
+ rc = EINVAL;
+ goto fail6;
+ }
+ trailer = (struct tlv_partition_trailer *)tlv_item(&cursor);
+
+ /* Update PARTITION_HEADER and PARTITION_TRAILER fields */
+ *total_lengthp = tlv_block_length_used(&cursor);
+ EFSYS_ASSERT3U(*total_lengthp, <=, partn_size);
+ generation = __LE_TO_CPU_32(header->generation) + 1;
+
+ header->total_length = __CPU_TO_LE_32(*total_lengthp);
+ header->generation = __CPU_TO_LE_32(generation);
+ trailer->generation = __CPU_TO_LE_32(generation);
+
+ /* Recompute PARTITION_TRAILER checksum */
+ trailer->checksum = 0;
+ cksum = 0;
+ for (pos = 0; (size_t)pos < *total_lengthp; pos += sizeof (uint32_t)) {
+ cksum += *((uint32_t *)(partn_data + pos));
+ }
+ trailer->checksum = ~cksum + 1;
+
+ return (0);
+
+fail6:
+ EFSYS_PROBE(fail6);
+fail5:
+ EFSYS_PROBE(fail5);
+fail4:
+ EFSYS_PROBE(fail4);
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+/* Add or update a single TLV item in a TLV formatted partition */
+ __checkReturn int
+hunt_nvram_partn_write_tlv(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __in uint32_t tag,
+ __in_bcount(size) caddr_t data,
+ __in size_t size)
+{
+ size_t partn_size;
+ caddr_t partn_data;
+ size_t total_length;
+ int rc;
+
+ EFSYS_ASSERT3U(partn, ==, NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG);
+
+ /* Allocate sufficient memory for the entire partition */
+ if ((rc = hunt_nvram_partn_size(enp, partn, &partn_size)) != 0)
+ goto fail1;
+
+ EFSYS_KMEM_ALLOC(enp->en_esip, partn_size, partn_data);
+ if (partn_data == NULL) {
+ rc = ENOMEM;
+ goto fail2;
+ }
+
+ /* Lock the partition */
+ if ((rc = hunt_nvram_partn_lock(enp, partn)) != 0)
+ goto fail3;
+
+ /* Read the partition contents (no need to retry when locked). */
+ if ((rc = hunt_nvram_read_tlv_partition(enp, partn,
+ partn_data, partn_size)) != 0) {
+ /* Failed to obtain consistent partition data */
+ goto fail4;
+ }
+
+ /* Update the contents in memory */
+ if ((rc = hunt_nvram_buf_write_tlv(partn_data, partn_size,
+ tag, data, size, &total_length)) != 0)
+ goto fail5;
+
+ /* Erase the whole partition */
+ if ((rc = hunt_nvram_partn_erase(enp, partn, 0, partn_size)) != 0)
+ goto fail6;
+
+ /* Write new partition contents to NVRAM */
+ if ((rc = hunt_nvram_partn_write(enp, partn, 0, partn_data,
+ total_length)) != 0)
+ goto fail7;
+
+ /* Unlock the partition */
+ hunt_nvram_partn_unlock(enp, partn);
+
+ EFSYS_KMEM_FREE(enp->en_esip, partn_size, partn_data);
+
+ return (0);
+
+fail7:
+ EFSYS_PROBE(fail7);
+fail6:
+ EFSYS_PROBE(fail6);
+fail5:
+ EFSYS_PROBE(fail5);
+fail4:
+ EFSYS_PROBE(fail4);
+
+ hunt_nvram_partn_unlock(enp, partn);
+fail3:
+ EFSYS_PROBE(fail3);
+
+ EFSYS_KMEM_FREE(enp->en_esip, partn_size, partn_data);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_nvram_partn_size(
+ __in efx_nic_t *enp,
+ __in unsigned int partn,
+ __out size_t *sizep)
+{
+ int rc;
+
+ if ((rc = efx_mcdi_nvram_info(enp, partn, sizep, NULL, NULL)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_nvram_partn_lock(
+ __in efx_nic_t *enp,
+ __in unsigned int partn)
+{
+ int rc;
+
+ if ((rc = efx_mcdi_nvram_update_start(enp, partn)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_nvram_partn_read(
+ __in efx_nic_t *enp,
+ __in unsigned int partn,
+ __in unsigned int offset,
+ __out_bcount(size) caddr_t data,
+ __in size_t size)
+{
+ size_t chunk;
+ int rc;
+
+ while (size > 0) {
+ chunk = MIN(size, HUNTINGTON_NVRAM_CHUNK);
+
+ if ((rc = efx_mcdi_nvram_read(enp, partn, offset,
+ data, chunk)) != 0) {
+ goto fail1;
+ }
+
+ size -= chunk;
+ data += chunk;
+ offset += chunk;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_nvram_partn_erase(
+ __in efx_nic_t *enp,
+ __in unsigned int partn,
+ __in unsigned int offset,
+ __in size_t size)
+{
+ int rc;
+
+ if ((rc = efx_mcdi_nvram_erase(enp, partn, offset, size)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_nvram_partn_write(
+ __in efx_nic_t *enp,
+ __in unsigned int partn,
+ __in unsigned int offset,
+ __out_bcount(size) caddr_t data,
+ __in size_t size)
+{
+ size_t chunk;
+ int rc;
+
+ while (size > 0) {
+ chunk = MIN(size, HUNTINGTON_NVRAM_CHUNK);
+
+ if ((rc = efx_mcdi_nvram_write(enp, partn, offset,
+ data, chunk)) != 0) {
+ goto fail1;
+ }
+
+ size -= chunk;
+ data += chunk;
+ offset += chunk;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ void
+hunt_nvram_partn_unlock(
+ __in efx_nic_t *enp,
+ __in unsigned int partn)
+{
+ boolean_t reboot;
+ int rc;
+
+ reboot = B_FALSE;
+ if ((rc = efx_mcdi_nvram_update_finish(enp, partn, reboot)) != 0)
+ goto fail1;
+
+ return;
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+}
+
+ __checkReturn int
+hunt_nvram_partn_set_version(
+ __in efx_nic_t *enp,
+ __in unsigned int partn,
+ __in_ecount(4) uint16_t version[4])
+{
+ struct tlv_partition_version partn_version;
+ size_t size;
+ int rc;
+
+ /* Add or modify partition version TLV item */
+ partn_version.version_w = __CPU_TO_LE_16(version[0]);
+ partn_version.version_x = __CPU_TO_LE_16(version[1]);
+ partn_version.version_y = __CPU_TO_LE_16(version[2]);
+ partn_version.version_z = __CPU_TO_LE_16(version[3]);
+
+ size = sizeof (partn_version) - (2 * sizeof (uint32_t));
+
+ if ((rc = hunt_nvram_partn_write_tlv(enp,
+ NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG,
+ TLV_TAG_PARTITION_VERSION(partn),
+ (caddr_t)&partn_version.version_w, size)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+#endif /* EFSYS_OPT_VPD || EFSYS_OPT_NVRAM */
+
+#if EFSYS_OPT_NVRAM
+
+typedef struct hunt_parttbl_entry_s {
+ unsigned int partn;
+ unsigned int port;
+ efx_nvram_type_t nvtype;
+} hunt_parttbl_entry_t;
+
+/* Translate EFX NVRAM types to firmware partition types */
+static hunt_parttbl_entry_t hunt_parttbl[] = {
+ {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 1, EFX_NVRAM_MC_FIRMWARE},
+ {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 2, EFX_NVRAM_MC_FIRMWARE},
+ {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 3, EFX_NVRAM_MC_FIRMWARE},
+ {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 4, EFX_NVRAM_MC_FIRMWARE},
+ {NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP, 1, EFX_NVRAM_MC_GOLDEN},
+ {NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP, 2, EFX_NVRAM_MC_GOLDEN},
+ {NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP, 3, EFX_NVRAM_MC_GOLDEN},
+ {NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP, 4, EFX_NVRAM_MC_GOLDEN},
+ {NVRAM_PARTITION_TYPE_EXPANSION_ROM, 1, EFX_NVRAM_BOOTROM},
+ {NVRAM_PARTITION_TYPE_EXPANSION_ROM, 2, EFX_NVRAM_BOOTROM},
+ {NVRAM_PARTITION_TYPE_EXPANSION_ROM, 3, EFX_NVRAM_BOOTROM},
+ {NVRAM_PARTITION_TYPE_EXPANSION_ROM, 4, EFX_NVRAM_BOOTROM},
+ {NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT0, 1, EFX_NVRAM_BOOTROM_CFG},
+ {NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT1, 2, EFX_NVRAM_BOOTROM_CFG},
+ {NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT2, 3, EFX_NVRAM_BOOTROM_CFG},
+ {NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT3, 4, EFX_NVRAM_BOOTROM_CFG},
+ {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 1, EFX_NVRAM_DYNAMIC_CFG},
+ {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 2, EFX_NVRAM_DYNAMIC_CFG},
+ {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 3, EFX_NVRAM_DYNAMIC_CFG},
+ {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 4, EFX_NVRAM_DYNAMIC_CFG}
+};
+
+static __checkReturn hunt_parttbl_entry_t *
+hunt_parttbl_entry(
+ __in efx_nic_t *enp,
+ __in efx_nvram_type_t type)
+{
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+ hunt_parttbl_entry_t *entry;
+ int i;
+
+ EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES);
+
+ for (i = 0; i < EFX_ARRAY_SIZE(hunt_parttbl); i++) {
+ entry = &hunt_parttbl[i];
+
+ if (entry->port == emip->emi_port && entry->nvtype == type)
+ return (entry);
+ }
+
+ return (NULL);
+}
+
+
+#if EFSYS_OPT_DIAG
+
+ __checkReturn int
+hunt_nvram_test(
+ __in efx_nic_t *enp)
+{
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+ hunt_parttbl_entry_t *entry;
+ unsigned int npartns = 0;
+ uint32_t *partns = NULL;
+ size_t size;
+ int i;
+ unsigned int j;
+ int rc;
+
+ /* Find supported partitions */
+ size = MC_CMD_NVRAM_PARTITIONS_OUT_TYPE_ID_MAXNUM * sizeof (uint32_t);
+ EFSYS_KMEM_ALLOC(enp->en_esip, size, partns);
+ if (partns == NULL) {
+ rc = ENOMEM;
+ goto fail1;
+ }
+
+ if ((rc = efx_mcdi_nvram_partitions(enp, (caddr_t)partns, size,
+ &npartns)) != 0) {
+ goto fail2;
+ }
+
+ /*
+ * Iterate over the list of supported partition types
+ * applicable to *this* port
+ */
+ for (i = 0; i < EFX_ARRAY_SIZE(hunt_parttbl); i++) {
+ entry = &hunt_parttbl[i];
+
+ if (entry->port != emip->emi_port)
+ continue;
+
+ for (j = 0; j < npartns; j++) {
+ if (entry->partn == partns[j]) {
+ rc = efx_mcdi_nvram_test(enp, entry->partn);
+ if (rc != 0)
+ goto fail3;
+ }
+ }
+ }
+
+ EFSYS_KMEM_FREE(enp->en_esip, size, partns);
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+ EFSYS_KMEM_FREE(enp->en_esip, size, partns);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+ return (rc);
+}
+
+#endif /* EFSYS_OPT_DIAG */
+
+ __checkReturn int
+hunt_nvram_size(
+ __in efx_nic_t *enp,
+ __in efx_nvram_type_t type,
+ __out size_t *sizep)
+{
+ hunt_parttbl_entry_t *entry;
+ uint32_t partn;
+ int rc;
+
+ if ((entry = hunt_parttbl_entry(enp, type)) == NULL) {
+ rc = ENOTSUP;
+ goto fail1;
+ }
+ partn = entry->partn;
+
+ if ((rc = hunt_nvram_partn_size(enp, partn, sizep)) != 0)
+ goto fail2;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ *sizep = 0;
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_nvram_get_version(
+ __in efx_nic_t *enp,
+ __in efx_nvram_type_t type,
+ __out uint32_t *subtypep,
+ __out_ecount(4) uint16_t version[4])
+{
+ hunt_parttbl_entry_t *entry;
+ uint32_t partn;
+ int rc;
+
+ if ((entry = hunt_parttbl_entry(enp, type)) == NULL) {
+ rc = ENOTSUP;
+ goto fail1;
+ }
+ partn = entry->partn;
+
+ /* FIXME: get highest partn version from all ports */
+ /* FIXME: return partn description if available */
+
+ if ((rc = efx_mcdi_nvram_metadata(enp, partn, subtypep,
+ version, NULL, 0)) != 0)
+ goto fail2;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_nvram_rw_start(
+ __in efx_nic_t *enp,
+ __in efx_nvram_type_t type,
+ __out size_t *chunk_sizep)
+{
+ hunt_parttbl_entry_t *entry;
+ uint32_t partn;
+ int rc;
+
+ if ((entry = hunt_parttbl_entry(enp, type)) == NULL) {
+ rc = ENOTSUP;
+ goto fail1;
+ }
+ partn = entry->partn;
+
+ if ((rc = hunt_nvram_partn_lock(enp, partn)) != 0)
+ goto fail2;
+
+ if (chunk_sizep != NULL)
+ *chunk_sizep = HUNTINGTON_NVRAM_CHUNK;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_nvram_read_chunk(
+ __in efx_nic_t *enp,
+ __in efx_nvram_type_t type,
+ __in unsigned int offset,
+ __out_bcount(size) caddr_t data,
+ __in size_t size)
+{
+ hunt_parttbl_entry_t *entry;
+ int rc;
+
+ if ((entry = hunt_parttbl_entry(enp, type)) == NULL) {
+ rc = ENOTSUP;
+ goto fail1;
+ }
+
+ if ((rc = hunt_nvram_partn_read(enp, entry->partn,
+ offset, data, size)) != 0)
+ goto fail2;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_nvram_erase(
+ __in efx_nic_t *enp,
+ __in efx_nvram_type_t type)
+{
+ hunt_parttbl_entry_t *entry;
+ size_t size;
+ int rc;
+
+ if ((entry = hunt_parttbl_entry(enp, type)) == NULL) {
+ rc = ENOTSUP;
+ goto fail1;
+ }
+
+ if ((rc = hunt_nvram_partn_size(enp, entry->partn, &size)) != 0)
+ goto fail2;
+
+ if ((rc = hunt_nvram_partn_erase(enp, entry->partn, 0, size)) != 0)
+ goto fail3;
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_nvram_write_chunk(
+ __in efx_nic_t *enp,
+ __in efx_nvram_type_t type,
+ __in unsigned int offset,
+ __in_bcount(size) caddr_t data,
+ __in size_t size)
+{
+ hunt_parttbl_entry_t *entry;
+ int rc;
+
+ if ((entry = hunt_parttbl_entry(enp, type)) == NULL) {
+ rc = ENOTSUP;
+ goto fail1;
+ }
+
+ if ((rc = hunt_nvram_partn_write(enp, entry->partn,
+ offset, data, size)) != 0)
+ goto fail2;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ void
+hunt_nvram_rw_finish(
+ __in efx_nic_t *enp,
+ __in efx_nvram_type_t type)
+{
+ hunt_parttbl_entry_t *entry;
+
+ if ((entry = hunt_parttbl_entry(enp, type)) != NULL)
+ hunt_nvram_partn_unlock(enp, entry->partn);
+}
+
+ __checkReturn int
+hunt_nvram_set_version(
+ __in efx_nic_t *enp,
+ __in efx_nvram_type_t type,
+ __in_ecount(4) uint16_t version[4])
+{
+ hunt_parttbl_entry_t *entry;
+ unsigned int partn;
+ int rc;
+
+ if ((entry = hunt_parttbl_entry(enp, type)) == NULL) {
+ rc = ENOTSUP;
+ goto fail1;
+ }
+ partn = entry->partn;
+
+ if ((rc = hunt_nvram_partn_set_version(enp, partn, version)) != 0)
+ goto fail2;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+#endif /* EFSYS_OPT_NVRAM */
+
+#endif /* EFSYS_OPT_HUNTINGTON */
diff --git a/sys/dev/sfxge/common/hunt_phy.c b/sys/dev/sfxge/common/hunt_phy.c
new file mode 100644
index 0000000..1cffea2
--- /dev/null
+++ b/sys/dev/sfxge/common/hunt_phy.c
@@ -0,0 +1,701 @@
+/*-
+ * Copyright (c) 2012-2015 Solarflare Communications Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "efsys.h"
+#include "efx.h"
+#include "efx_impl.h"
+
+#if EFSYS_OPT_HUNTINGTON
+
+static void
+hunt_phy_decode_cap(
+ __in uint32_t mcdi_cap,
+ __out uint32_t *maskp)
+{
+ /*
+ * TBD: consider common Siena/Hunt function: Hunt is a superset of
+ * Siena here (adds 40G)
+ */
+
+ uint32_t mask;
+
+ mask = 0;
+ if (mcdi_cap & (1 << MC_CMD_PHY_CAP_10HDX_LBN))
+ mask |= (1 << EFX_PHY_CAP_10HDX);
+ if (mcdi_cap & (1 << MC_CMD_PHY_CAP_10FDX_LBN))
+ mask |= (1 << EFX_PHY_CAP_10FDX);
+ if (mcdi_cap & (1 << MC_CMD_PHY_CAP_100HDX_LBN))
+ mask |= (1 << EFX_PHY_CAP_100HDX);
+ if (mcdi_cap & (1 << MC_CMD_PHY_CAP_100FDX_LBN))
+ mask |= (1 << EFX_PHY_CAP_100FDX);
+ if (mcdi_cap & (1 << MC_CMD_PHY_CAP_1000HDX_LBN))
+ mask |= (1 << EFX_PHY_CAP_1000HDX);
+ if (mcdi_cap & (1 << MC_CMD_PHY_CAP_1000FDX_LBN))
+ mask |= (1 << EFX_PHY_CAP_1000FDX);
+ if (mcdi_cap & (1 << MC_CMD_PHY_CAP_10000FDX_LBN))
+ mask |= (1 << EFX_PHY_CAP_10000FDX);
+ if (mcdi_cap & (1 << MC_CMD_PHY_CAP_40000FDX_LBN))
+ mask |= (1 << EFX_PHY_CAP_40000FDX);
+ if (mcdi_cap & (1 << MC_CMD_PHY_CAP_PAUSE_LBN))
+ mask |= (1 << EFX_PHY_CAP_PAUSE);
+ if (mcdi_cap & (1 << MC_CMD_PHY_CAP_ASYM_LBN))
+ mask |= (1 << EFX_PHY_CAP_ASYM);
+ if (mcdi_cap & (1 << MC_CMD_PHY_CAP_AN_LBN))
+ mask |= (1 << EFX_PHY_CAP_AN);
+
+ *maskp = mask;
+}
+
+static void
+hunt_phy_decode_link_mode(
+ __in efx_nic_t *enp,
+ __in uint32_t link_flags,
+ __in unsigned int speed,
+ __in unsigned int fcntl,
+ __out efx_link_mode_t *link_modep,
+ __out unsigned int *fcntlp)
+{
+ /*
+ * TBD: consider common Siena/Hunt function: Hunt is a superset of
+ * Siena here (adds 40G and generate-only flow control)
+ */
+
+ boolean_t fd = !!(link_flags &
+ (1 << MC_CMD_GET_LINK_OUT_FULL_DUPLEX_LBN));
+ boolean_t up = !!(link_flags &
+ (1 << MC_CMD_GET_LINK_OUT_LINK_UP_LBN));
+
+ _NOTE(ARGUNUSED(enp))
+
+ if (!up)
+ *link_modep = EFX_LINK_DOWN;
+ else if (speed == 40000 && fd)
+ *link_modep = EFX_LINK_40000FDX;
+ else if (speed == 10000 && fd)
+ *link_modep = EFX_LINK_10000FDX;
+ else if (speed == 1000)
+ *link_modep = fd ? EFX_LINK_1000FDX : EFX_LINK_1000HDX;
+ else if (speed == 100)
+ *link_modep = fd ? EFX_LINK_100FDX : EFX_LINK_100HDX;
+ else if (speed == 10)
+ *link_modep = fd ? EFX_LINK_10FDX : EFX_LINK_10HDX;
+ else
+ *link_modep = EFX_LINK_UNKNOWN;
+
+ if (fcntl == MC_CMD_FCNTL_OFF)
+ *fcntlp = 0;
+ else if (fcntl == MC_CMD_FCNTL_RESPOND)
+ *fcntlp = EFX_FCNTL_RESPOND;
+ else if (fcntl == MC_CMD_FCNTL_GENERATE)
+ *fcntlp = EFX_FCNTL_GENERATE;
+ else if (fcntl == MC_CMD_FCNTL_BIDIR)
+ *fcntlp = EFX_FCNTL_RESPOND | EFX_FCNTL_GENERATE;
+ else {
+ EFSYS_PROBE1(mc_pcol_error, int, fcntl);
+ *fcntlp = 0;
+ }
+}
+
+
+ void
+hunt_phy_link_ev(
+ __in efx_nic_t *enp,
+ __in efx_qword_t *eqp,
+ __out efx_link_mode_t *link_modep)
+{
+ /*
+ * TBD: consider common Siena/Hunt function: Hunt is a superset of
+ * Siena here (adds 40G)
+ */
+
+ efx_port_t *epp = &(enp->en_port);
+ unsigned int link_flags;
+ unsigned int speed;
+ unsigned int fcntl;
+ efx_link_mode_t link_mode;
+ uint32_t lp_cap_mask;
+
+ /*
+ * Convert the LINKCHANGE speed enumeration into mbit/s, in the
+ * same way as GET_LINK encodes the speed
+ */
+ switch (MCDI_EV_FIELD(eqp, LINKCHANGE_SPEED)) {
+ case MCDI_EVENT_LINKCHANGE_SPEED_100M:
+ speed = 100;
+ break;
+ case MCDI_EVENT_LINKCHANGE_SPEED_1G:
+ speed = 1000;
+ break;
+ case MCDI_EVENT_LINKCHANGE_SPEED_10G:
+ speed = 10000;
+ break;
+ case MCDI_EVENT_LINKCHANGE_SPEED_40G:
+ speed = 40000;
+ break;
+ default:
+ speed = 0;
+ break;
+ }
+
+ link_flags = MCDI_EV_FIELD(eqp, LINKCHANGE_LINK_FLAGS);
+ hunt_phy_decode_link_mode(enp, link_flags, speed,
+ MCDI_EV_FIELD(eqp, LINKCHANGE_FCNTL),
+ &link_mode, &fcntl);
+ hunt_phy_decode_cap(MCDI_EV_FIELD(eqp, LINKCHANGE_LP_CAP),
+ &lp_cap_mask);
+
+ /*
+ * It's safe to update ep_lp_cap_mask without the driver's port lock
+ * because presumably any concurrently running efx_port_poll() is
+ * only going to arrive at the same value.
+ *
+ * ep_fcntl has two meanings. It's either the link common fcntl
+ * (if the PHY supports AN), or it's the forced link state. If
+ * the former, it's safe to update the value for the same reason as
+ * for ep_lp_cap_mask. If the latter, then just ignore the value,
+ * because we can race with efx_mac_fcntl_set().
+ */
+ epp->ep_lp_cap_mask = lp_cap_mask;
+ epp->ep_fcntl = fcntl;
+
+ *link_modep = link_mode;
+}
+
+ __checkReturn int
+hunt_phy_power(
+ __in efx_nic_t *enp,
+ __in boolean_t power)
+{
+ /* TBD: consider common Siena/Hunt function: essentially identical */
+
+ int rc;
+
+ if (!power)
+ return (0);
+
+ /* Check if the PHY is a zombie */
+ if ((rc = hunt_phy_verify(enp)) != 0)
+ goto fail1;
+
+ enp->en_reset_flags |= EFX_RESET_PHY;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_phy_get_link(
+ __in efx_nic_t *enp,
+ __out hunt_link_state_t *hlsp)
+{
+ /*
+ * TBD: consider common Siena/Hunt function: Hunt is very similar
+ * (at least for now; not clear that the loopbacks should necessarily
+ * be quite the same...)
+ */
+
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_GET_LINK_IN_LEN,
+ MC_CMD_GET_LINK_OUT_LEN)];
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_GET_LINK;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_GET_LINK_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_GET_LINK_OUT_LEN;
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_GET_LINK_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ hunt_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_CAP),
+ &hlsp->hls_adv_cap_mask);
+ hunt_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_LP_CAP),
+ &hlsp->hls_lp_cap_mask);
+
+ hunt_phy_decode_link_mode(enp, MCDI_OUT_DWORD(req, GET_LINK_OUT_FLAGS),
+ MCDI_OUT_DWORD(req, GET_LINK_OUT_LINK_SPEED),
+ MCDI_OUT_DWORD(req, GET_LINK_OUT_FCNTL),
+ &hlsp->hls_link_mode, &hlsp->hls_fcntl);
+
+#if EFSYS_OPT_LOOPBACK
+ /* Assert the MC_CMD_LOOPBACK and EFX_LOOPBACK namespace agree */
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_NONE == EFX_LOOPBACK_OFF);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_DATA == EFX_LOOPBACK_DATA);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_GMAC == EFX_LOOPBACK_GMAC);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XGMII == EFX_LOOPBACK_XGMII);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XGXS == EFX_LOOPBACK_XGXS);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XAUI == EFX_LOOPBACK_XAUI);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_GMII == EFX_LOOPBACK_GMII);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_SGMII == EFX_LOOPBACK_SGMII);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XGBR == EFX_LOOPBACK_XGBR);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XFI == EFX_LOOPBACK_XFI);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XAUI_FAR == EFX_LOOPBACK_XAUI_FAR);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_GMII_FAR == EFX_LOOPBACK_GMII_FAR);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_SGMII_FAR == EFX_LOOPBACK_SGMII_FAR);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XFI_FAR == EFX_LOOPBACK_XFI_FAR);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_GPHY == EFX_LOOPBACK_GPHY);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PHYXS == EFX_LOOPBACK_PHY_XS);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PCS == EFX_LOOPBACK_PCS);
+ EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PMAPMD == EFX_LOOPBACK_PMA_PMD);
+
+ hlsp->hls_loopback = MCDI_OUT_DWORD(req, GET_LINK_OUT_LOOPBACK_MODE);
+#endif /* EFSYS_OPT_LOOPBACK */
+
+ hlsp->hls_mac_up = MCDI_OUT_DWORD(req, GET_LINK_OUT_MAC_FAULT) == 0;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_phy_reconfigure(
+ __in efx_nic_t *enp)
+{
+ /*
+ * TBD: this is a little different for now (no LED support for Hunt
+ * yet), but ultimately should consider common Siena/Hunt function:
+ * Hunt should be a superset of Siena here (adds 40G)
+ */
+
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+ efx_port_t *epp = &(enp->en_port);
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_SET_LINK_IN_LEN,
+ MC_CMD_SET_LINK_OUT_LEN)];
+ uint32_t cap_mask;
+ unsigned int led_mode;
+ unsigned int speed;
+ int rc;
+
+ if (~encp->enc_func_flags & EFX_NIC_FUNC_LINKCTRL)
+ goto out;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_SET_LINK;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_SET_LINK_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_SET_LINK_OUT_LEN;
+
+ cap_mask = epp->ep_adv_cap_mask;
+ MCDI_IN_POPULATE_DWORD_10(req, SET_LINK_IN_CAP,
+ PHY_CAP_10HDX, (cap_mask >> EFX_PHY_CAP_10HDX) & 0x1,
+ PHY_CAP_10FDX, (cap_mask >> EFX_PHY_CAP_10FDX) & 0x1,
+ PHY_CAP_100HDX, (cap_mask >> EFX_PHY_CAP_100HDX) & 0x1,
+ PHY_CAP_100FDX, (cap_mask >> EFX_PHY_CAP_100FDX) & 0x1,
+ PHY_CAP_1000HDX, (cap_mask >> EFX_PHY_CAP_1000HDX) & 0x1,
+ PHY_CAP_1000FDX, (cap_mask >> EFX_PHY_CAP_1000FDX) & 0x1,
+ PHY_CAP_10000FDX, (cap_mask >> EFX_PHY_CAP_10000FDX) & 0x1,
+ PHY_CAP_PAUSE, (cap_mask >> EFX_PHY_CAP_PAUSE) & 0x1,
+ PHY_CAP_ASYM, (cap_mask >> EFX_PHY_CAP_ASYM) & 0x1,
+ PHY_CAP_AN, (cap_mask >> EFX_PHY_CAP_AN) & 0x1);
+ /* Too many fields for for POPULATE macros, so insert this afterwards */
+ MCDI_IN_SET_DWORD_FIELD(req, SET_LINK_IN_CAP,
+ PHY_CAP_40000FDX, (cap_mask >> EFX_PHY_CAP_40000FDX) & 0x1);
+
+#if EFSYS_OPT_LOOPBACK
+ MCDI_IN_SET_DWORD(req, SET_LINK_IN_LOOPBACK_MODE,
+ epp->ep_loopback_type);
+ switch (epp->ep_loopback_link_mode) {
+ case EFX_LINK_100FDX:
+ speed = 100;
+ break;
+ case EFX_LINK_1000FDX:
+ speed = 1000;
+ break;
+ case EFX_LINK_10000FDX:
+ speed = 10000;
+ break;
+ case EFX_LINK_40000FDX:
+ speed = 40000;
+ break;
+ default:
+ speed = 0;
+ }
+#else
+ MCDI_IN_SET_DWORD(req, SET_LINK_IN_LOOPBACK_MODE, MC_CMD_LOOPBACK_NONE);
+ speed = 0;
+#endif /* EFSYS_OPT_LOOPBACK */
+ MCDI_IN_SET_DWORD(req, SET_LINK_IN_LOOPBACK_SPEED, speed);
+
+#if EFSYS_OPT_PHY_FLAGS
+ MCDI_IN_SET_DWORD(req, SET_LINK_IN_FLAGS, epp->ep_phy_flags);
+#else
+ MCDI_IN_SET_DWORD(req, SET_LINK_IN_FLAGS, 0);
+#endif /* EFSYS_OPT_PHY_FLAGS */
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ /* And set the blink mode */
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_SET_ID_LED;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_SET_ID_LED_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_SET_ID_LED_OUT_LEN;
+
+#if EFSYS_OPT_PHY_LED_CONTROL
+ switch (epp->ep_phy_led_mode) {
+ case EFX_PHY_LED_DEFAULT:
+ led_mode = MC_CMD_LED_DEFAULT;
+ break;
+ case EFX_PHY_LED_OFF:
+ led_mode = MC_CMD_LED_OFF;
+ break;
+ case EFX_PHY_LED_ON:
+ led_mode = MC_CMD_LED_ON;
+ break;
+ default:
+ EFSYS_ASSERT(0);
+ led_mode = MC_CMD_LED_DEFAULT;
+ }
+
+ MCDI_IN_SET_DWORD(req, SET_ID_LED_IN_STATE, led_mode);
+#else
+ MCDI_IN_SET_DWORD(req, SET_ID_LED_IN_STATE, MC_CMD_LED_DEFAULT);
+#endif /* EFSYS_OPT_PHY_LED_CONTROL */
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail2;
+ }
+out:
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_phy_verify(
+ __in efx_nic_t *enp)
+{
+ /* TBD: consider common Siena/Hunt function: essentially identical */
+
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_GET_PHY_STATE_IN_LEN,
+ MC_CMD_GET_PHY_STATE_OUT_LEN)];
+ uint32_t state;
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_GET_PHY_STATE;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_GET_PHY_STATE_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_GET_PHY_STATE_OUT_LEN;
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_GET_PHY_STATE_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ state = MCDI_OUT_DWORD(req, GET_PHY_STATE_OUT_STATE);
+ if (state != MC_CMD_PHY_STATE_OK) {
+ if (state != MC_CMD_PHY_STATE_ZOMBIE)
+ EFSYS_PROBE1(mc_pcol_error, int, state);
+ rc = ENOTACTIVE;
+ goto fail3;
+ }
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_phy_oui_get(
+ __in efx_nic_t *enp,
+ __out uint32_t *ouip)
+{
+ _NOTE(ARGUNUSED(enp, ouip))
+
+ return (ENOTSUP);
+}
+
+#if EFSYS_OPT_PHY_STATS
+
+ __checkReturn int
+hunt_phy_stats_update(
+ __in efx_nic_t *enp,
+ __in efsys_mem_t *esmp,
+ __out_ecount(EFX_PHY_NSTATS) uint32_t *stat)
+{
+ /* TBD: no stats support in firmware yet */
+ _NOTE(ARGUNUSED(enp, esmp))
+ memset(stat, 0, EFX_PHY_NSTATS * sizeof (*stat));
+
+ return (0);
+}
+
+#endif /* EFSYS_OPT_PHY_STATS */
+
+#if EFSYS_OPT_PHY_PROPS
+
+#if EFSYS_OPT_NAMES
+
+extern const char *
+hunt_phy_prop_name(
+ __in efx_nic_t *enp,
+ __in unsigned int id)
+{
+ _NOTE(ARGUNUSED(enp, id))
+
+ return (NULL);
+}
+
+#endif /* EFSYS_OPT_NAMES */
+
+extern __checkReturn int
+hunt_phy_prop_get(
+ __in efx_nic_t *enp,
+ __in unsigned int id,
+ __in uint32_t flags,
+ __out uint32_t *valp)
+{
+ _NOTE(ARGUNUSED(enp, id, flags, valp))
+
+ return (ENOTSUP);
+}
+
+extern __checkReturn int
+hunt_phy_prop_set(
+ __in efx_nic_t *enp,
+ __in unsigned int id,
+ __in uint32_t val)
+{
+ _NOTE(ARGUNUSED(enp, id, val))
+
+ return (ENOTSUP);
+}
+
+#endif /* EFSYS_OPT_PHY_PROPS */
+
+#if EFSYS_OPT_BIST
+
+ __checkReturn int
+hunt_bist_enable_offline(
+ __in efx_nic_t *enp)
+{
+ int rc;
+
+ if ((rc = efx_mcdi_bist_enable_offline(enp)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_bist_start(
+ __in efx_nic_t *enp,
+ __in efx_bist_type_t type)
+{
+ int rc;
+
+ if ((rc = efx_mcdi_bist_start(enp, type)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_bist_poll(
+ __in efx_nic_t *enp,
+ __in efx_bist_type_t type,
+ __out efx_bist_result_t *resultp,
+ __out_opt __drv_when(count > 0, __notnull)
+ uint32_t *value_maskp,
+ __out_ecount_opt(count) __drv_when(count > 0, __notnull)
+ unsigned long *valuesp,
+ __in size_t count)
+{
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_POLL_BIST_IN_LEN,
+ MCDI_CTL_SDU_LEN_MAX)];
+ uint32_t value_mask = 0;
+ uint32_t result;
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_POLL_BIST;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_POLL_BIST_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MCDI_CTL_SDU_LEN_MAX;
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_POLL_BIST_OUT_RESULT_OFST + 4) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ if (count > 0)
+ (void) memset(valuesp, '\0', count * sizeof (unsigned long));
+
+ result = MCDI_OUT_DWORD(req, POLL_BIST_OUT_RESULT);
+
+ if (result == MC_CMD_POLL_BIST_FAILED &&
+ req.emr_out_length >= MC_CMD_POLL_BIST_OUT_MEM_LEN &&
+ count > EFX_BIST_MEM_ECC_FATAL) {
+ if (valuesp != NULL) {
+ valuesp[EFX_BIST_MEM_TEST] =
+ MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_TEST);
+ valuesp[EFX_BIST_MEM_ADDR] =
+ MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ADDR);
+ valuesp[EFX_BIST_MEM_BUS] =
+ MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_BUS);
+ valuesp[EFX_BIST_MEM_EXPECT] =
+ MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_EXPECT);
+ valuesp[EFX_BIST_MEM_ACTUAL] =
+ MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ACTUAL);
+ valuesp[EFX_BIST_MEM_ECC] =
+ MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ECC);
+ valuesp[EFX_BIST_MEM_ECC_PARITY] =
+ MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ECC_PARITY);
+ valuesp[EFX_BIST_MEM_ECC_FATAL] =
+ MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ECC_FATAL);
+ }
+ value_mask |= (1 << EFX_BIST_MEM_TEST) |
+ (1 << EFX_BIST_MEM_ADDR) |
+ (1 << EFX_BIST_MEM_BUS) |
+ (1 << EFX_BIST_MEM_EXPECT) |
+ (1 << EFX_BIST_MEM_ACTUAL) |
+ (1 << EFX_BIST_MEM_ECC) |
+ (1 << EFX_BIST_MEM_ECC_PARITY) |
+ (1 << EFX_BIST_MEM_ECC_FATAL);
+ } else if (result == MC_CMD_POLL_BIST_FAILED &&
+ encp->enc_phy_type == EFX_PHY_XFI_FARMI &&
+ req.emr_out_length >= MC_CMD_POLL_BIST_OUT_MRSFP_LEN &&
+ count > EFX_BIST_FAULT_CODE) {
+ if (valuesp != NULL)
+ valuesp[EFX_BIST_FAULT_CODE] =
+ MCDI_OUT_DWORD(req, POLL_BIST_OUT_MRSFP_TEST);
+ value_mask |= 1 << EFX_BIST_FAULT_CODE;
+ }
+
+ if (value_maskp != NULL)
+ *value_maskp = value_mask;
+
+ EFSYS_ASSERT(resultp != NULL);
+ if (result == MC_CMD_POLL_BIST_RUNNING)
+ *resultp = EFX_BIST_RESULT_RUNNING;
+ else if (result == MC_CMD_POLL_BIST_PASSED)
+ *resultp = EFX_BIST_RESULT_PASSED;
+ else
+ *resultp = EFX_BIST_RESULT_FAILED;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ void
+hunt_bist_stop(
+ __in efx_nic_t *enp,
+ __in efx_bist_type_t type)
+{
+ /* There is no way to stop BIST on Huntinton. */
+ _NOTE(ARGUNUSED(enp, type))
+}
+
+#endif /* EFSYS_OPT_BIST */
+
+#endif /* EFSYS_OPT_HUNTINGTON */
diff --git a/sys/dev/sfxge/common/hunt_rx.c b/sys/dev/sfxge/common/hunt_rx.c
new file mode 100644
index 0000000..991f293
--- /dev/null
+++ b/sys/dev/sfxge/common/hunt_rx.c
@@ -0,0 +1,765 @@
+/*-
+ * Copyright (c) 2012-2015 Solarflare Communications Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "efsys.h"
+#include "efx.h"
+#include "efx_impl.h"
+
+
+#if EFSYS_OPT_HUNTINGTON
+
+
+static __checkReturn int
+efx_mcdi_init_rxq(
+ __in efx_nic_t *enp,
+ __in uint32_t size,
+ __in uint32_t target_evq,
+ __in uint32_t label,
+ __in uint32_t instance,
+ __in efsys_mem_t *esmp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[
+ MAX(MC_CMD_INIT_RXQ_IN_LEN(EFX_RXQ_NBUFS(EFX_RXQ_MAXNDESCS)),
+ MC_CMD_INIT_RXQ_OUT_LEN)];
+ int npages = EFX_RXQ_NBUFS(size);
+ int i;
+ efx_qword_t *dma_addr;
+ uint64_t addr;
+ int rc;
+
+ EFSYS_ASSERT3U(size, <=, EFX_RXQ_MAXNDESCS);
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_INIT_RXQ;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_INIT_RXQ_IN_LEN(npages);
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_INIT_RXQ_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_SIZE, size);
+ MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_TARGET_EVQ, target_evq);
+ MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_LABEL, label);
+ MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_INSTANCE, instance);
+ MCDI_IN_POPULATE_DWORD_5(req, INIT_RXQ_IN_FLAGS,
+ INIT_RXQ_IN_FLAG_BUFF_MODE, 0,
+ INIT_RXQ_IN_FLAG_HDR_SPLIT, 0,
+ INIT_RXQ_IN_FLAG_TIMESTAMP, 0,
+ INIT_RXQ_IN_CRC_MODE, 0,
+ INIT_RXQ_IN_FLAG_PREFIX, 1);
+ MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_OWNER_ID, 0);
+ MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_PORT_ID, EVB_PORT_ID_ASSIGNED);
+
+ dma_addr = MCDI_IN2(req, efx_qword_t, INIT_RXQ_IN_DMA_ADDR);
+ addr = EFSYS_MEM_ADDR(esmp);
+
+ for (i = 0; i < npages; i++) {
+ EFX_POPULATE_QWORD_2(*dma_addr,
+ EFX_DWORD_1, (uint32_t)(addr >> 32),
+ EFX_DWORD_0, (uint32_t)(addr & 0xffffffff));
+
+ dma_addr++;
+ addr += EFX_BUF_SIZE;
+ }
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+static __checkReturn int
+efx_mcdi_fini_rxq(
+ __in efx_nic_t *enp,
+ __in uint32_t instance)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_FINI_RXQ_IN_LEN,
+ MC_CMD_FINI_RXQ_OUT_LEN)];
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_FINI_RXQ;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_FINI_RXQ_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_FINI_RXQ_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, FINI_RXQ_IN_INSTANCE, instance);
+
+ efx_mcdi_execute(enp, &req);
+
+ if ((req.emr_rc != 0) && (req.emr_rc != MC_CMD_ERR_EALREADY)) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+#if EFSYS_OPT_RX_SCALE
+static __checkReturn int
+efx_mcdi_rss_context_alloc(
+ __in efx_nic_t *enp,
+ __out uint32_t *rss_contextp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_ALLOC_IN_LEN,
+ MC_CMD_RSS_CONTEXT_ALLOC_OUT_LEN)];
+ uint32_t rss_context;
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_RSS_CONTEXT_ALLOC;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_RSS_CONTEXT_ALLOC_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_RSS_CONTEXT_ALLOC_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, RSS_CONTEXT_ALLOC_IN_UPSTREAM_PORT_ID,
+ EVB_PORT_ID_ASSIGNED);
+ MCDI_IN_SET_DWORD(req, RSS_CONTEXT_ALLOC_IN_TYPE,
+ MC_CMD_RSS_CONTEXT_ALLOC_IN_TYPE_EXCLUSIVE);
+ /* NUM_QUEUES is only used to validate indirection table offsets */
+ MCDI_IN_SET_DWORD(req, RSS_CONTEXT_ALLOC_IN_NUM_QUEUES, 64);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ if (req.emr_out_length_used < MC_CMD_RSS_CONTEXT_ALLOC_OUT_LEN) {
+ rc = EMSGSIZE;
+ goto fail2;
+ }
+
+ rss_context = MCDI_OUT_DWORD(req, RSS_CONTEXT_ALLOC_OUT_RSS_CONTEXT_ID);
+ if (rss_context == HUNTINGTON_RSS_CONTEXT_INVALID) {
+ rc = ENOENT;
+ goto fail3;
+ }
+
+ *rss_contextp = rss_context;
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+#endif /* EFSYS_OPT_RX_SCALE */
+
+#if EFSYS_OPT_RX_SCALE
+static int
+efx_mcdi_rss_context_free(
+ __in efx_nic_t *enp,
+ __in uint32_t rss_context)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_FREE_IN_LEN,
+ MC_CMD_RSS_CONTEXT_FREE_OUT_LEN)];
+ int rc;
+
+ if (rss_context == HUNTINGTON_RSS_CONTEXT_INVALID) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_RSS_CONTEXT_FREE;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_RSS_CONTEXT_FREE_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_RSS_CONTEXT_FREE_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, RSS_CONTEXT_FREE_IN_RSS_CONTEXT_ID, rss_context);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail2;
+ }
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+#endif /* EFSYS_OPT_RX_SCALE */
+
+#if EFSYS_OPT_RX_SCALE
+static int
+efx_mcdi_rss_context_set_flags(
+ __in efx_nic_t *enp,
+ __in uint32_t rss_context,
+ __in efx_rx_hash_type_t type)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_LEN,
+ MC_CMD_RSS_CONTEXT_SET_FLAGS_OUT_LEN)];
+ int rc;
+
+ if (rss_context == HUNTINGTON_RSS_CONTEXT_INVALID) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_RSS_CONTEXT_SET_FLAGS;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_RSS_CONTEXT_SET_FLAGS_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, RSS_CONTEXT_SET_FLAGS_IN_RSS_CONTEXT_ID,
+ rss_context);
+
+ MCDI_IN_POPULATE_DWORD_4(req, RSS_CONTEXT_SET_FLAGS_IN_FLAGS,
+ RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV4_EN,
+ (type & (1U << EFX_RX_HASH_IPV4)) ? 1 : 0,
+ RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV4_EN,
+ (type & (1U << EFX_RX_HASH_TCPIPV4)) ? 1 : 0,
+ RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV6_EN,
+ (type & (1U << EFX_RX_HASH_IPV6)) ? 1 : 0,
+ RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV6_EN,
+ (type & (1U << EFX_RX_HASH_TCPIPV6)) ? 1 : 0);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail2;
+ }
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+#endif /* EFSYS_OPT_RX_SCALE */
+
+#if EFSYS_OPT_RX_SCALE
+static int
+efx_mcdi_rss_context_set_key(
+ __in efx_nic_t *enp,
+ __in uint32_t rss_context,
+ __in_ecount(n) uint8_t *key,
+ __in size_t n)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_SET_KEY_IN_LEN,
+ MC_CMD_RSS_CONTEXT_SET_KEY_OUT_LEN)];
+ int rc;
+
+ if (rss_context == HUNTINGTON_RSS_CONTEXT_INVALID) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_RSS_CONTEXT_SET_KEY;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_RSS_CONTEXT_SET_KEY_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_RSS_CONTEXT_SET_KEY_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, RSS_CONTEXT_SET_KEY_IN_RSS_CONTEXT_ID,
+ rss_context);
+
+ EFSYS_ASSERT3U(n, ==, MC_CMD_RSS_CONTEXT_SET_KEY_IN_TOEPLITZ_KEY_LEN);
+ if (n != MC_CMD_RSS_CONTEXT_SET_KEY_IN_TOEPLITZ_KEY_LEN) {
+ rc = EINVAL;
+ goto fail2;
+ }
+
+ memcpy(MCDI_IN2(req, uint8_t, RSS_CONTEXT_SET_KEY_IN_TOEPLITZ_KEY),
+ key, n);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail3;
+ }
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+#endif /* EFSYS_OPT_RX_SCALE */
+
+#if EFSYS_OPT_RX_SCALE
+static int
+efx_mcdi_rss_context_set_table(
+ __in efx_nic_t *enp,
+ __in uint32_t rss_context,
+ __in_ecount(n) unsigned int *table,
+ __in size_t n)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_SET_TABLE_IN_LEN,
+ MC_CMD_RSS_CONTEXT_SET_TABLE_OUT_LEN)];
+ uint8_t *req_table;
+ int i, rc;
+
+ if (rss_context == HUNTINGTON_RSS_CONTEXT_INVALID) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_RSS_CONTEXT_SET_TABLE;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_RSS_CONTEXT_SET_TABLE_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_RSS_CONTEXT_SET_TABLE_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, RSS_CONTEXT_SET_TABLE_IN_RSS_CONTEXT_ID,
+ rss_context);
+
+ req_table =
+ MCDI_IN2(req, uint8_t, RSS_CONTEXT_SET_TABLE_IN_INDIRECTION_TABLE);
+
+ for (i = 0;
+ i < MC_CMD_RSS_CONTEXT_SET_TABLE_IN_INDIRECTION_TABLE_LEN;
+ i++) {
+ req_table[i] = (n > 0) ? (uint8_t)table[i % n] : 0;
+ }
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail2;
+ }
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+#endif /* EFSYS_OPT_RX_SCALE */
+
+
+ __checkReturn int
+hunt_rx_init(
+ __in efx_nic_t *enp)
+{
+#if EFSYS_OPT_RX_SCALE
+
+ if (efx_mcdi_rss_context_alloc(enp, &enp->en_rss_context) == 0) {
+ /*
+ * Allocated an exclusive RSS context, which allows both the
+ * indirection table and key to be modified.
+ */
+ enp->en_rss_support = EFX_RX_SCALE_EXCLUSIVE;
+ enp->en_hash_support = EFX_RX_HASH_AVAILABLE;
+ } else {
+ /*
+ * Failed to allocate an exclusive RSS context. Continue
+ * operation without support for RSS. The pseudo-header in
+ * received packets will not contain a Toeplitz hash value.
+ */
+ enp->en_rss_support = EFX_RX_SCALE_UNAVAILABLE;
+ enp->en_hash_support = EFX_RX_HASH_UNAVAILABLE;
+ }
+
+#endif /* EFSYS_OPT_RX_SCALE */
+
+ return (0);
+}
+
+#if EFSYS_OPT_RX_HDR_SPLIT
+ __checkReturn int
+hunt_rx_hdr_split_enable(
+ __in efx_nic_t *enp,
+ __in unsigned int hdr_buf_size,
+ __in unsigned int pld_buf_size)
+{
+ int rc;
+
+ /* FIXME */
+ _NOTE(ARGUNUSED(enp, hdr_buf_size, pld_buf_size))
+ if (B_FALSE) {
+ rc = ENOTSUP;
+ goto fail1;
+ }
+ /* FIXME */
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+#endif /* EFSYS_OPT_RX_HDR_SPLIT */
+
+#if EFSYS_OPT_RX_SCATTER
+ __checkReturn int
+hunt_rx_scatter_enable(
+ __in efx_nic_t *enp,
+ __in unsigned int buf_size)
+{
+ _NOTE(ARGUNUSED(enp, buf_size))
+ return (0);
+}
+#endif /* EFSYS_OPT_RX_SCATTER */
+
+#if EFSYS_OPT_RX_SCALE
+ __checkReturn int
+hunt_rx_scale_mode_set(
+ __in efx_nic_t *enp,
+ __in efx_rx_hash_alg_t alg,
+ __in efx_rx_hash_type_t type,
+ __in boolean_t insert)
+{
+ int rc;
+
+ EFSYS_ASSERT3U(alg, ==, EFX_RX_HASHALG_TOEPLITZ);
+ EFSYS_ASSERT3U(insert, ==, B_TRUE);
+
+ if ((alg != EFX_RX_HASHALG_TOEPLITZ) || (insert == B_FALSE)) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ if (enp->en_rss_support == EFX_RX_SCALE_UNAVAILABLE) {
+ rc = ENOTSUP;
+ goto fail2;
+ }
+
+ if ((rc = efx_mcdi_rss_context_set_flags(enp,
+ enp->en_rss_context, type)) != 0)
+ goto fail3;
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+#endif /* EFSYS_OPT_RX_SCALE */
+
+#if EFSYS_OPT_RX_SCALE
+ __checkReturn int
+hunt_rx_scale_key_set(
+ __in efx_nic_t *enp,
+ __in_ecount(n) uint8_t *key,
+ __in size_t n)
+{
+ int rc;
+
+ if (enp->en_rss_support == EFX_RX_SCALE_UNAVAILABLE) {
+ rc = ENOTSUP;
+ goto fail1;
+ }
+
+ if ((rc = efx_mcdi_rss_context_set_key(enp,
+ enp->en_rss_context, key, n)) != 0)
+ goto fail2;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+#endif /* EFSYS_OPT_RX_SCALE */
+
+#if EFSYS_OPT_RX_SCALE
+ __checkReturn int
+hunt_rx_scale_tbl_set(
+ __in efx_nic_t *enp,
+ __in_ecount(n) unsigned int *table,
+ __in size_t n)
+{
+ int rc;
+
+ if (enp->en_rss_support == EFX_RX_SCALE_UNAVAILABLE) {
+ rc = ENOTSUP;
+ goto fail1;
+ }
+
+ if ((rc = efx_mcdi_rss_context_set_table(enp,
+ enp->en_rss_context, table, n)) != 0)
+ goto fail2;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+#endif /* EFSYS_OPT_RX_SCALE */
+
+ void
+hunt_rx_qpost(
+ __in efx_rxq_t *erp,
+ __in_ecount(n) efsys_dma_addr_t *addrp,
+ __in size_t size,
+ __in unsigned int n,
+ __in unsigned int completed,
+ __in unsigned int added)
+{
+ efx_qword_t qword;
+ unsigned int i;
+ unsigned int offset;
+ unsigned int id;
+
+ /* The client driver must not overfill the queue */
+ EFSYS_ASSERT3U(added - completed + n, <=,
+ EFX_RXQ_LIMIT(erp->er_mask + 1));
+
+ id = added & (erp->er_mask);
+ for (i = 0; i < n; i++) {
+ EFSYS_PROBE4(rx_post, unsigned int, erp->er_index,
+ unsigned int, id, efsys_dma_addr_t, addrp[i],
+ size_t, size);
+
+ EFX_POPULATE_QWORD_3(qword,
+ ESF_DZ_RX_KER_BYTE_CNT, (uint32_t)(size),
+ ESF_DZ_RX_KER_BUF_ADDR_DW0,
+ (uint32_t)(addrp[i] & 0xffffffff),
+ ESF_DZ_RX_KER_BUF_ADDR_DW1,
+ (uint32_t)(addrp[i] >> 32));
+
+ offset = id * sizeof (efx_qword_t);
+ EFSYS_MEM_WRITEQ(erp->er_esmp, offset, &qword);
+
+ id = (id + 1) & (erp->er_mask);
+ }
+}
+
+ void
+hunt_rx_qpush(
+ __in efx_rxq_t *erp,
+ __in unsigned int added,
+ __inout unsigned int *pushedp)
+{
+ efx_nic_t *enp = erp->er_enp;
+ unsigned int pushed = *pushedp;
+ uint32_t wptr;
+ efx_dword_t dword;
+
+ /* Hardware has alignment restriction for WPTR */
+ wptr = P2ALIGN(added, HUNTINGTON_RX_WPTR_ALIGN);
+ if (pushed == wptr)
+ return;
+
+ *pushedp = wptr;
+
+ /* Push the populated descriptors out */
+ wptr &= erp->er_mask;
+
+ EFX_POPULATE_DWORD_1(dword, ERF_DZ_RX_DESC_WPTR, wptr);
+
+ /* Guarantee ordering of memory (descriptors) and PIO (doorbell) */
+ EFX_DMA_SYNC_QUEUE_FOR_DEVICE(erp->er_esmp, erp->er_mask + 1,
+ wptr, pushed & erp->er_mask);
+ EFSYS_PIO_WRITE_BARRIER();
+ EFX_BAR_TBL_WRITED(enp, ER_DZ_RX_DESC_UPD_REG,
+ erp->er_index, &dword, B_FALSE);
+}
+
+ __checkReturn int
+hunt_rx_qflush(
+ __in efx_rxq_t *erp)
+{
+ efx_nic_t *enp = erp->er_enp;
+ int rc;
+
+ if ((rc = efx_mcdi_fini_rxq(enp, erp->er_index)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ void
+hunt_rx_qenable(
+ __in efx_rxq_t *erp)
+{
+ /* FIXME */
+ _NOTE(ARGUNUSED(erp))
+ /* FIXME */
+}
+
+ __checkReturn int
+hunt_rx_qcreate(
+ __in efx_nic_t *enp,
+ __in unsigned int index,
+ __in unsigned int label,
+ __in efx_rxq_type_t type,
+ __in efsys_mem_t *esmp,
+ __in size_t n,
+ __in uint32_t id,
+ __in efx_evq_t *eep,
+ __in efx_rxq_t *erp)
+{
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+ int rc;
+
+ _NOTE(ARGUNUSED(erp))
+
+ EFX_STATIC_ASSERT(EFX_EV_RX_NLABELS == (1 << ESF_DZ_RX_QLABEL_WIDTH));
+ EFSYS_ASSERT3U(label, <, EFX_EV_RX_NLABELS);
+ EFSYS_ASSERT3U(enp->en_rx_qcount + 1, <, encp->enc_rxq_limit);
+
+ EFX_STATIC_ASSERT(ISP2(EFX_RXQ_MAXNDESCS));
+ EFX_STATIC_ASSERT(ISP2(EFX_RXQ_MINNDESCS));
+
+ if (!ISP2(n) || (n < EFX_RXQ_MINNDESCS) || (n > EFX_RXQ_MAXNDESCS)) {
+ rc = EINVAL;
+ goto fail1;
+ }
+ if (index >= encp->enc_rxq_limit) {
+ rc = EINVAL;
+ goto fail2;
+ }
+
+ /*
+ * FIXME: Siena code handles different queue types (default, header
+ * split, scatter); we'll need to do something more here later, but
+ * all that stuff is TBD for now.
+ */
+
+ if ((rc = efx_mcdi_init_rxq(enp, n, eep->ee_index, label, index,
+ esmp)) != 0)
+ goto fail3;
+
+ erp->er_eep = eep;
+ erp->er_label = label;
+
+ hunt_ev_rxlabel_init(eep, erp, label);
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ void
+hunt_rx_qdestroy(
+ __in efx_rxq_t *erp)
+{
+ efx_nic_t *enp = erp->er_enp;
+ efx_evq_t *eep = erp->er_eep;
+ unsigned int label = erp->er_label;
+
+ hunt_ev_rxlabel_fini(eep, label);
+
+ EFSYS_ASSERT(enp->en_rx_qcount != 0);
+ --enp->en_rx_qcount;
+
+ EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_rxq_t), erp);
+}
+
+ void
+hunt_rx_fini(
+ __in efx_nic_t *enp)
+{
+#if EFSYS_OPT_RX_SCALE
+ if (enp->en_rss_support != EFX_RX_SCALE_UNAVAILABLE) {
+ (void) efx_mcdi_rss_context_free(enp, enp->en_rss_context);
+ }
+ enp->en_rss_context = 0;
+ enp->en_rss_support = EFX_RX_SCALE_UNAVAILABLE;
+#else
+ _NOTE(ARGUNUSED(enp))
+#endif /* EFSYS_OPT_RX_SCALE */
+}
+
+#endif /* EFSYS_OPT_HUNTINGTON */
diff --git a/sys/dev/sfxge/common/hunt_sram.c b/sys/dev/sfxge/common/hunt_sram.c
new file mode 100644
index 0000000..947e033
--- /dev/null
+++ b/sys/dev/sfxge/common/hunt_sram.c
@@ -0,0 +1,69 @@
+/*-
+ * Copyright (c) 2012-2015 Solarflare Communications Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "efsys.h"
+#include "efx.h"
+#include "efx_impl.h"
+
+#if EFSYS_OPT_HUNTINGTON
+
+
+#if EFSYS_OPT_DIAG
+
+ __checkReturn int
+hunt_sram_test(
+ __in efx_nic_t *enp,
+ __in efx_sram_pattern_fn_t func)
+{
+ int rc;
+
+ /* FIXME */
+ _NOTE(ARGUNUSED(enp))
+ _NOTE(ARGUNUSED(func))
+ if (B_FALSE) {
+ rc = ENOTSUP;
+ goto fail1;
+ }
+ /* FIXME */
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+#endif /* EFSYS_OPT_DIAG */
+
+#endif /* EFSYS_OPT_HUNTINGTON */
diff --git a/sys/dev/sfxge/common/hunt_tx.c b/sys/dev/sfxge/common/hunt_tx.c
new file mode 100755
index 0000000..ee5691a
--- /dev/null
+++ b/sys/dev/sfxge/common/hunt_tx.c
@@ -0,0 +1,679 @@
+/*-
+ * Copyright (c) 2012-2015 Solarflare Communications Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "efsys.h"
+#include "efx.h"
+#include "efx_impl.h"
+
+
+#if EFSYS_OPT_HUNTINGTON
+
+#if EFSYS_OPT_QSTATS
+#define EFX_TX_QSTAT_INCR(_etp, _stat) \
+ do { \
+ (_etp)->et_stat[_stat]++; \
+ _NOTE(CONSTANTCONDITION) \
+ } while (B_FALSE)
+#else
+#define EFX_TX_QSTAT_INCR(_etp, _stat)
+#endif
+
+static __checkReturn int
+efx_mcdi_init_txq(
+ __in efx_nic_t *enp,
+ __in uint32_t size,
+ __in uint32_t target_evq,
+ __in uint32_t label,
+ __in uint32_t instance,
+ __in uint16_t flags,
+ __in efsys_mem_t *esmp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_INIT_TXQ_IN_LEN(EFX_TXQ_MAX_BUFS),
+ MC_CMD_INIT_TXQ_OUT_LEN)];
+ efx_qword_t *dma_addr;
+ uint64_t addr;
+ int npages;
+ int i;
+ int rc;
+
+ EFSYS_ASSERT(EFX_TXQ_MAX_BUFS >=
+ EFX_TXQ_NBUFS(EFX_TXQ_MAXNDESCS(&enp->en_nic_cfg)));
+
+ npages = EFX_TXQ_NBUFS(size);
+ if (npages > MC_CMD_INIT_TXQ_IN_DMA_ADDR_MAXNUM) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_INIT_TXQ;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_INIT_TXQ_IN_LEN(npages);
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_INIT_TXQ_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_SIZE, size);
+ MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_TARGET_EVQ, target_evq);
+ MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_LABEL, label);
+ MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_INSTANCE, instance);
+
+ MCDI_IN_POPULATE_DWORD_6(req, INIT_TXQ_IN_FLAGS,
+ INIT_TXQ_IN_FLAG_BUFF_MODE, 0,
+ INIT_TXQ_IN_FLAG_IP_CSUM_DIS, (flags & EFX_CKSUM_IPV4) ? 0 : 1,
+ INIT_TXQ_IN_FLAG_TCP_CSUM_DIS, (flags & EFX_CKSUM_TCPUDP) ? 0 : 1,
+ INIT_TXQ_IN_FLAG_TCP_UDP_ONLY, 0,
+ INIT_TXQ_IN_CRC_MODE, 0,
+ INIT_TXQ_IN_FLAG_TIMESTAMP, 0);
+
+ MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_OWNER_ID, 0);
+ MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_PORT_ID, EVB_PORT_ID_ASSIGNED);
+
+ dma_addr = MCDI_IN2(req, efx_qword_t, INIT_TXQ_IN_DMA_ADDR);
+ addr = EFSYS_MEM_ADDR(esmp);
+
+ for (i = 0; i < npages; i++) {
+ EFX_POPULATE_QWORD_2(*dma_addr,
+ EFX_DWORD_1, (uint32_t)(addr >> 32),
+ EFX_DWORD_0, (uint32_t)(addr & 0xffffffff));
+
+ dma_addr++;
+ addr += EFX_BUF_SIZE;
+ }
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail2;
+ }
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+static __checkReturn int
+efx_mcdi_fini_txq(
+ __in efx_nic_t *enp,
+ __in uint32_t instance)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_FINI_TXQ_IN_LEN,
+ MC_CMD_FINI_TXQ_OUT_LEN)];
+ int rc;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_FINI_TXQ;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_FINI_TXQ_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_FINI_TXQ_OUT_LEN;
+
+ MCDI_IN_SET_DWORD(req, FINI_TXQ_IN_INSTANCE, instance);
+
+ efx_mcdi_execute(enp, &req);
+
+ if ((req.emr_rc != 0) && (req.emr_rc != MC_CMD_ERR_EALREADY)) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_tx_init(
+ __in efx_nic_t *enp)
+{
+ _NOTE(ARGUNUSED(enp))
+ return (0);
+}
+
+ void
+hunt_tx_fini(
+ __in efx_nic_t *enp)
+{
+ _NOTE(ARGUNUSED(enp))
+}
+
+ __checkReturn int
+hunt_tx_qcreate(
+ __in efx_nic_t *enp,
+ __in unsigned int index,
+ __in unsigned int label,
+ __in efsys_mem_t *esmp,
+ __in size_t n,
+ __in uint32_t id,
+ __in uint16_t flags,
+ __in efx_evq_t *eep,
+ __in efx_txq_t *etp,
+ __out unsigned int *addedp)
+{
+ efx_qword_t desc;
+ int rc;
+
+
+ if ((rc = efx_mcdi_init_txq(enp, n, eep->ee_index, label, index, flags,
+ esmp)) != 0)
+ goto fail1;
+
+ /*
+ * A previous user of this TX queue may have written a descriptor to the
+ * TX push collector, but not pushed the doorbell (e.g. after a crash).
+ * The next doorbell write would then push the stale descriptor.
+ *
+ * Ensure the (per network port) TX push collector is cleared by writing
+ * a no-op TX option descriptor. See bug29981 for details.
+ */
+ *addedp = 1;
+ EFX_POPULATE_QWORD_4(desc,
+ ESF_DZ_TX_DESC_IS_OPT, 1,
+ ESF_DZ_TX_OPTION_TYPE, ESE_DZ_TX_OPTION_DESC_CRC_CSUM,
+ ESF_DZ_TX_OPTION_UDP_TCP_CSUM, (flags & EFX_CKSUM_TCPUDP) ? 1 : 0,
+ ESF_DZ_TX_OPTION_IP_CSUM, (flags & EFX_CKSUM_IPV4) ? 1 : 0);
+
+ EFSYS_MEM_WRITEQ(etp->et_esmp, 0, &desc);
+ hunt_tx_qpush(etp, *addedp, 0);
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ void
+hunt_tx_qdestroy(
+ __in efx_txq_t *etp)
+{
+ /* FIXME */
+ _NOTE(ARGUNUSED(etp))
+ /* FIXME */
+}
+
+ __checkReturn int
+hunt_tx_qpio_enable(
+ __in efx_txq_t *etp)
+{
+ efx_nic_t *enp = etp->et_enp;
+ efx_piobuf_handle_t handle;
+ int rc;
+
+ if (etp->et_pio_size != 0) {
+ rc = EALREADY;
+ goto fail1;
+ }
+
+ /* Sub-allocate a PIO block from a piobuf */
+ if ((rc = hunt_nic_pio_alloc(enp,
+ &etp->et_pio_bufnum,
+ &handle,
+ &etp->et_pio_blknum,
+ &etp->et_pio_offset,
+ &etp->et_pio_size)) != 0) {
+ goto fail2;
+ }
+ EFSYS_ASSERT3U(etp->et_pio_size, !=, 0);
+
+ /* Link the piobuf to this TXQ */
+ if ((rc = hunt_nic_pio_link(enp, etp->et_index, handle)) != 0) {
+ goto fail3;
+ }
+
+ /*
+ * et_pio_offset is the offset of the sub-allocated block within the
+ * hardware PIO buffer. It is used as the buffer address in the PIO
+ * option descriptor.
+ *
+ * et_pio_write_offset is the offset of the sub-allocated block from the
+ * start of the write-combined memory mapping, and is used for writing
+ * data into the PIO buffer.
+ */
+ etp->et_pio_write_offset =
+ (etp->et_pio_bufnum * ER_DZ_TX_PIOBUF_STEP) +
+ ER_DZ_TX_PIOBUF_OFST + etp->et_pio_offset;
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+ hunt_nic_pio_free(enp, etp->et_pio_bufnum, etp->et_pio_blknum);
+ etp->et_pio_size = 0;
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ void
+hunt_tx_qpio_disable(
+ __in efx_txq_t *etp)
+{
+ efx_nic_t *enp = etp->et_enp;
+
+ if (etp->et_pio_size != 0) {
+ /* Unlink the piobuf from this TXQ */
+ hunt_nic_pio_unlink(enp, etp->et_index);
+
+ /* Free the sub-allocated PIO block */
+ hunt_nic_pio_free(enp, etp->et_pio_bufnum, etp->et_pio_blknum);
+ etp->et_pio_size = 0;
+ etp->et_pio_write_offset = 0;
+ }
+}
+
+ __checkReturn int
+hunt_tx_qpio_write(
+ __in efx_txq_t *etp,
+ __in_ecount(length) uint8_t *buffer,
+ __in size_t length,
+ __in size_t offset)
+{
+ efx_nic_t *enp = etp->et_enp;
+ efsys_bar_t *esbp = enp->en_esbp;
+ uint32_t write_offset;
+ uint32_t write_offset_limit;
+ efx_qword_t *eqp;
+ int rc;
+
+ EFSYS_ASSERT(length % sizeof (efx_qword_t) == 0);
+
+ if (etp->et_pio_size == 0) {
+ rc = ENOENT;
+ goto fail1;
+ }
+ if (offset + length > etp->et_pio_size) {
+ rc = ENOSPC;
+ goto fail2;
+ }
+
+ /*
+ * Writes to PIO buffers must be 64 bit aligned, and multiples of
+ * 64 bits.
+ */
+ write_offset = etp->et_pio_write_offset + offset;
+ write_offset_limit = write_offset + length;
+ eqp = (efx_qword_t *)buffer;
+ while (write_offset < write_offset_limit) {
+ EFSYS_BAR_WC_WRITEQ(esbp, write_offset, eqp);
+ eqp++;
+ write_offset += sizeof (efx_qword_t);
+ }
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_tx_qpio_post(
+ __in efx_txq_t *etp,
+ __in size_t pkt_length,
+ __in unsigned int completed,
+ __inout unsigned int *addedp)
+{
+ efx_qword_t pio_desc;
+ unsigned int id;
+ size_t offset;
+ unsigned int added = *addedp;
+ int rc;
+
+
+ if (added - completed + 1 > EFX_TXQ_LIMIT(etp->et_mask + 1)) {
+ rc = ENOSPC;
+ goto fail1;
+ }
+
+ if (etp->et_pio_size == 0) {
+ rc = ENOENT;
+ goto fail2;
+ }
+
+ id = added++ & etp->et_mask;
+ offset = id * sizeof (efx_qword_t);
+
+ EFSYS_PROBE4(tx_pio_post, unsigned int, etp->et_index,
+ unsigned int, id, uint32_t, etp->et_pio_offset,
+ size_t, pkt_length);
+
+ EFX_POPULATE_QWORD_5(pio_desc,
+ ESF_DZ_TX_DESC_IS_OPT, 1,
+ ESF_DZ_TX_OPTION_TYPE, 1,
+ ESF_DZ_TX_PIO_CONT, 0,
+ ESF_DZ_TX_PIO_BYTE_CNT, pkt_length,
+ ESF_DZ_TX_PIO_BUF_ADDR, etp->et_pio_offset);
+
+ EFSYS_MEM_WRITEQ(etp->et_esmp, offset, &pio_desc);
+
+ EFX_TX_QSTAT_INCR(etp, TX_POST_PIO);
+
+ *addedp = added;
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_tx_qpost(
+ __in efx_txq_t *etp,
+ __in_ecount(n) efx_buffer_t *eb,
+ __in unsigned int n,
+ __in unsigned int completed,
+ __inout unsigned int *addedp)
+{
+ unsigned int added = *addedp;
+ unsigned int i;
+ int rc;
+
+ if (added - completed + n > EFX_TXQ_LIMIT(etp->et_mask + 1)) {
+ rc = ENOSPC;
+ goto fail1;
+ }
+
+ for (i = 0; i < n; i++) {
+ efx_buffer_t *ebp = &eb[i];
+ efsys_dma_addr_t addr = ebp->eb_addr;
+ size_t size = ebp->eb_size;
+ boolean_t eop = ebp->eb_eop;
+ unsigned int id;
+ size_t offset;
+ efx_qword_t qword;
+
+ /* Fragments must not span 4k boundaries. */
+ EFSYS_ASSERT(P2ROUNDUP(addr + 1, 4096) >= (addr + size));
+
+ id = added++ & etp->et_mask;
+ offset = id * sizeof (efx_qword_t);
+
+ EFSYS_PROBE5(tx_post, unsigned int, etp->et_index,
+ unsigned int, id, efsys_dma_addr_t, addr,
+ size_t, size, boolean_t, eop);
+
+ EFX_POPULATE_QWORD_5(qword,
+ ESF_DZ_TX_KER_TYPE, 0,
+ ESF_DZ_TX_KER_CONT, (eop) ? 0 : 1,
+ ESF_DZ_TX_KER_BYTE_CNT, (uint32_t)(size),
+ ESF_DZ_TX_KER_BUF_ADDR_DW0, (uint32_t)(addr & 0xffffffff),
+ ESF_DZ_TX_KER_BUF_ADDR_DW1, (uint32_t)(addr >> 32));
+
+ EFSYS_MEM_WRITEQ(etp->et_esmp, offset, &qword);
+ }
+
+ EFX_TX_QSTAT_INCR(etp, TX_POST);
+
+ *addedp = added;
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+/*
+ * This improves performance by pushing a TX descriptor at the same time as the
+ * doorbell. The descriptor must be added to the TXQ, so that can be used if the
+ * hardware decides not to use the pushed descriptor.
+ */
+ void
+hunt_tx_qpush(
+ __in efx_txq_t *etp,
+ __in unsigned int added,
+ __in unsigned int pushed)
+{
+ efx_nic_t *enp = etp->et_enp;
+ unsigned int wptr;
+ unsigned int id;
+ size_t offset;
+ efx_qword_t desc;
+ efx_oword_t oword;
+
+ wptr = added & etp->et_mask;
+ id = pushed & etp->et_mask;
+ offset = id * sizeof (efx_qword_t);
+
+ EFSYS_MEM_READQ(etp->et_esmp, offset, &desc);
+ EFX_POPULATE_OWORD_3(oword,
+ ERF_DZ_TX_DESC_WPTR, wptr,
+ ERF_DZ_TX_DESC_HWORD, EFX_QWORD_FIELD(desc, EFX_DWORD_1),
+ ERF_DZ_TX_DESC_LWORD, EFX_QWORD_FIELD(desc, EFX_DWORD_0));
+
+ /* Guarantee ordering of memory (descriptors) and PIO (doorbell) */
+ EFX_DMA_SYNC_QUEUE_FOR_DEVICE(etp->et_esmp, etp->et_mask + 1, wptr, id);
+ EFSYS_PIO_WRITE_BARRIER();
+ EFX_BAR_TBL_DOORBELL_WRITEO(enp, ER_DZ_TX_DESC_UPD_REG, etp->et_index,
+ &oword);
+}
+
+ __checkReturn int
+hunt_tx_qdesc_post(
+ __in efx_txq_t *etp,
+ __in_ecount(n) efx_desc_t *ed,
+ __in unsigned int n,
+ __in unsigned int completed,
+ __inout unsigned int *addedp)
+{
+ unsigned int added = *addedp;
+ unsigned int i;
+ int rc;
+
+ if (added - completed + n > EFX_TXQ_LIMIT(etp->et_mask + 1)) {
+ rc = ENOSPC;
+ goto fail1;
+ }
+
+ for (i = 0; i < n; i++) {
+ efx_desc_t *edp = &ed[i];
+ unsigned int id;
+ size_t offset;
+
+ id = added++ & etp->et_mask;
+ offset = id * sizeof (efx_desc_t);
+
+ EFSYS_MEM_WRITEQ(etp->et_esmp, offset, &edp->ed_eq);
+ }
+
+ EFSYS_PROBE3(tx_desc_post, unsigned int, etp->et_index,
+ unsigned int, added, unsigned int, n);
+
+ EFX_TX_QSTAT_INCR(etp, TX_POST);
+
+ *addedp = added;
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ void
+hunt_tx_qdesc_dma_create(
+ __in efx_txq_t *etp,
+ __in efsys_dma_addr_t addr,
+ __in size_t size,
+ __in boolean_t eop,
+ __out efx_desc_t *edp)
+{
+ /* Fragments must not span 4k boundaries. */
+ EFSYS_ASSERT(P2ROUNDUP(addr + 1, 4096) >= addr + size);
+
+ EFSYS_PROBE4(tx_desc_dma_create, unsigned int, etp->et_index,
+ efsys_dma_addr_t, addr,
+ size_t, size, boolean_t, eop);
+
+ EFX_POPULATE_QWORD_5(edp->ed_eq,
+ ESF_DZ_TX_KER_TYPE, 0,
+ ESF_DZ_TX_KER_CONT, (eop) ? 0 : 1,
+ ESF_DZ_TX_KER_BYTE_CNT, (uint32_t)(size),
+ ESF_DZ_TX_KER_BUF_ADDR_DW0, (uint32_t)(addr & 0xffffffff),
+ ESF_DZ_TX_KER_BUF_ADDR_DW1, (uint32_t)(addr >> 32));
+}
+
+ void
+hunt_tx_qdesc_tso_create(
+ __in efx_txq_t *etp,
+ __in uint16_t ipv4_id,
+ __in uint32_t tcp_seq,
+ __in uint8_t tcp_flags,
+ __out efx_desc_t *edp)
+{
+ EFSYS_PROBE4(tx_desc_tso_create, unsigned int, etp->et_index,
+ uint16_t, ipv4_id, uint32_t, tcp_seq,
+ uint8_t, tcp_flags);
+
+ EFX_POPULATE_QWORD_5(edp->ed_eq,
+ ESF_DZ_TX_DESC_IS_OPT, 1,
+ ESF_DZ_TX_OPTION_TYPE,
+ ESE_DZ_TX_OPTION_DESC_TSO,
+ ESF_DZ_TX_TSO_TCP_FLAGS, tcp_flags,
+ ESF_DZ_TX_TSO_IP_ID, ipv4_id,
+ ESF_DZ_TX_TSO_TCP_SEQNO, tcp_seq);
+}
+
+ void
+hunt_tx_qdesc_vlantci_create(
+ __in efx_txq_t *etp,
+ __in uint16_t tci,
+ __out efx_desc_t *edp)
+{
+ EFSYS_PROBE2(tx_desc_vlantci_create, unsigned int, etp->et_index,
+ uint16_t, tci);
+
+ EFX_POPULATE_QWORD_4(edp->ed_eq,
+ ESF_DZ_TX_DESC_IS_OPT, 1,
+ ESF_DZ_TX_OPTION_TYPE,
+ ESE_DZ_TX_OPTION_DESC_VLAN,
+ ESF_DZ_TX_VLAN_OP, tci ? 1 : 0,
+ ESF_DZ_TX_VLAN_TAG1, tci);
+}
+
+
+ __checkReturn int
+hunt_tx_qpace(
+ __in efx_txq_t *etp,
+ __in unsigned int ns)
+{
+ int rc;
+
+ /* FIXME */
+ _NOTE(ARGUNUSED(etp, ns))
+ if (B_FALSE) {
+ rc = ENOTSUP;
+ goto fail1;
+ }
+ /* FIXME */
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_tx_qflush(
+ __in efx_txq_t *etp)
+{
+ efx_nic_t *enp = etp->et_enp;
+ int rc;
+
+ if ((rc = efx_mcdi_fini_txq(enp, etp->et_index)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ void
+hunt_tx_qenable(
+ __in efx_txq_t *etp)
+{
+ /* FIXME */
+ _NOTE(ARGUNUSED(etp))
+ /* FIXME */
+}
+
+#if EFSYS_OPT_QSTATS
+ void
+hunt_tx_qstats_update(
+ __in efx_txq_t *etp,
+ __inout_ecount(TX_NQSTATS) efsys_stat_t *stat)
+{
+ /*
+ * TBD: Consider a common Siena/Huntington function. The code is
+ * essentially identical.
+ */
+
+ unsigned int id;
+
+ for (id = 0; id < TX_NQSTATS; id++) {
+ efsys_stat_t *essp = &stat[id];
+
+ EFSYS_STAT_INCR(essp, etp->et_stat[id]);
+ etp->et_stat[id] = 0;
+ }
+}
+
+#endif /* EFSYS_OPT_QSTATS */
+
+#endif /* EFSYS_OPT_HUNTINGTON */
diff --git a/sys/dev/sfxge/common/hunt_vpd.c b/sys/dev/sfxge/common/hunt_vpd.c
new file mode 100644
index 0000000..536ebbc
--- /dev/null
+++ b/sys/dev/sfxge/common/hunt_vpd.c
@@ -0,0 +1,435 @@
+/*-
+ * Copyright (c) 2009-2015 Solarflare Communications Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "efsys.h"
+#include "efx.h"
+#include "efx_types.h"
+#include "efx_regs.h"
+#include "efx_impl.h"
+
+
+#if EFSYS_OPT_VPD
+
+#if EFSYS_OPT_HUNTINGTON
+
+#include "ef10_tlv_layout.h"
+
+ __checkReturn int
+hunt_vpd_init(
+ __in efx_nic_t *enp)
+{
+ caddr_t svpd;
+ size_t svpd_size;
+ uint32_t pci_pf;
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+
+ pci_pf = enp->en_nic_cfg.enc_pf;
+ /*
+ * The VPD interface exposes VPD resources from the combined static and
+ * dynamic VPD storage. As the static VPD configuration should *never*
+ * change, we can cache it.
+ */
+ svpd = NULL;
+ svpd_size = 0;
+ rc = hunt_nvram_partn_read_tlv(enp,
+ NVRAM_PARTITION_TYPE_STATIC_CONFIG,
+ TLV_TAG_PF_STATIC_VPD(pci_pf),
+ &svpd, &svpd_size);
+ if (rc != 0) {
+ if (rc == EACCES) {
+ /* Unpriviledged functions cannot access VPD */
+ goto out;
+ }
+ goto fail1;
+ }
+
+ if (svpd != NULL && svpd_size > 0) {
+ if ((rc = efx_vpd_hunk_verify(svpd, svpd_size, NULL)) != 0)
+ goto fail2;
+ }
+
+ enp->en_u.hunt.enu_svpd = svpd;
+ enp->en_u.hunt.enu_svpd_length = svpd_size;
+
+out:
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+
+ EFSYS_KMEM_FREE(enp->en_esip, svpd_size, svpd);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_vpd_size(
+ __in efx_nic_t *enp,
+ __out size_t *sizep)
+{
+ int rc;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+
+ /*
+ * This function returns the total size the user should allocate
+ * for all VPD operations. We've already cached the static vpd,
+ * so we just need to return an upper bound on the dynamic vpd,
+ * which is the size of the DYNAMIC_CONFIG partition.
+ */
+ if ((rc = efx_mcdi_nvram_info(enp, NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG,
+ sizep, NULL, NULL)) != 0)
+ goto fail1;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_vpd_read(
+ __in efx_nic_t *enp,
+ __out_bcount(size) caddr_t data,
+ __in size_t size)
+{
+ caddr_t dvpd;
+ size_t dvpd_size;
+ uint32_t pci_pf;
+ int rc;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+
+ pci_pf = enp->en_nic_cfg.enc_pf;
+
+ if ((rc = hunt_nvram_partn_read_tlv(enp,
+ NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG,
+ TLV_TAG_PF_DYNAMIC_VPD(pci_pf),
+ &dvpd, &dvpd_size)) != 0)
+ goto fail1;
+
+ if (dvpd_size > size) {
+ rc = ENOSPC;
+ goto fail2;
+ }
+ memcpy(data, dvpd, dvpd_size);
+
+ /* Pad data with all-1s, consistent with update operations */
+ memset(data + dvpd_size, 0xff, size - dvpd_size);
+
+ EFSYS_KMEM_FREE(enp->en_esip, dvpd_size, dvpd);
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+
+ EFSYS_KMEM_FREE(enp->en_esip, dvpd_size, dvpd);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_vpd_verify(
+ __in efx_nic_t *enp,
+ __in_bcount(size) caddr_t data,
+ __in size_t size)
+{
+ efx_vpd_tag_t stag;
+ efx_vpd_tag_t dtag;
+ efx_vpd_keyword_t skey;
+ efx_vpd_keyword_t dkey;
+ unsigned int scont;
+ unsigned int dcont;
+ int rc;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+
+ /*
+ * Strictly you could take the view that dynamic vpd is optional.
+ * Instead, to conform more closely to the read/verify/reinit()
+ * paradigm, we require dynamic vpd. hunt_vpd_reinit() will
+ * reinitialize it as required.
+ */
+ if ((rc = efx_vpd_hunk_verify(data, size, NULL)) != 0)
+ goto fail1;
+
+ /*
+ * Verify that there is no duplication between the static and
+ * dynamic cfg sectors.
+ */
+ if (enp->en_u.hunt.enu_svpd_length == 0)
+ goto done;
+
+ dcont = 0;
+ _NOTE(CONSTANTCONDITION)
+ while (1) {
+ if ((rc = efx_vpd_hunk_next(data, size, &dtag,
+ &dkey, NULL, NULL, &dcont)) != 0)
+ goto fail2;
+ if (dcont == 0)
+ break;
+
+ scont = 0;
+ _NOTE(CONSTANTCONDITION)
+ while (1) {
+ if ((rc = efx_vpd_hunk_next(
+ enp->en_u.hunt.enu_svpd,
+ enp->en_u.hunt.enu_svpd_length, &stag, &skey,
+ NULL, NULL, &scont)) != 0)
+ goto fail3;
+ if (scont == 0)
+ break;
+
+ if (stag == dtag && skey == dkey) {
+ rc = EEXIST;
+ goto fail4;
+ }
+ }
+ }
+
+done:
+ return (0);
+
+fail4:
+ EFSYS_PROBE(fail4);
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_vpd_reinit(
+ __in efx_nic_t *enp,
+ __in_bcount(size) caddr_t data,
+ __in size_t size)
+{
+ boolean_t wantpid;
+ int rc;
+
+ /*
+ * Only create an ID string if the dynamic cfg doesn't have one
+ */
+ if (enp->en_u.hunt.enu_svpd_length == 0)
+ wantpid = B_TRUE;
+ else {
+ unsigned int offset;
+ uint8_t length;
+
+ rc = efx_vpd_hunk_get(enp->en_u.hunt.enu_svpd,
+ enp->en_u.hunt.enu_svpd_length,
+ EFX_VPD_ID, 0, &offset, &length);
+ if (rc == 0)
+ wantpid = B_FALSE;
+ else if (rc == ENOENT)
+ wantpid = B_TRUE;
+ else
+ goto fail1;
+ }
+
+ if ((rc = efx_vpd_hunk_reinit(data, size, wantpid)) != 0)
+ goto fail2;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_vpd_get(
+ __in efx_nic_t *enp,
+ __in_bcount(size) caddr_t data,
+ __in size_t size,
+ __inout efx_vpd_value_t *evvp)
+{
+ unsigned int offset;
+ uint8_t length;
+ int rc;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+
+ /* Attempt to satisfy the request from svpd first */
+ if (enp->en_u.hunt.enu_svpd_length > 0) {
+ if ((rc = efx_vpd_hunk_get(enp->en_u.hunt.enu_svpd,
+ enp->en_u.hunt.enu_svpd_length, evvp->evv_tag,
+ evvp->evv_keyword, &offset, &length)) == 0) {
+ evvp->evv_length = length;
+ memcpy(evvp->evv_value,
+ enp->en_u.hunt.enu_svpd + offset, length);
+ return (0);
+ } else if (rc != ENOENT)
+ goto fail1;
+ }
+
+ /* And then from the provided data buffer */
+ if ((rc = efx_vpd_hunk_get(data, size, evvp->evv_tag,
+ evvp->evv_keyword, &offset, &length)) != 0)
+ goto fail2;
+
+ evvp->evv_length = length;
+ memcpy(evvp->evv_value, data + offset, length);
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_vpd_set(
+ __in efx_nic_t *enp,
+ __in_bcount(size) caddr_t data,
+ __in size_t size,
+ __in efx_vpd_value_t *evvp)
+{
+ int rc;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+
+ /* If the provided (tag,keyword) exists in svpd, then it is readonly */
+ if (enp->en_u.hunt.enu_svpd_length > 0) {
+ unsigned int offset;
+ uint8_t length;
+
+ if ((rc = efx_vpd_hunk_get(enp->en_u.hunt.enu_svpd,
+ enp->en_u.hunt.enu_svpd_length, evvp->evv_tag,
+ evvp->evv_keyword, &offset, &length)) == 0) {
+ rc = EACCES;
+ goto fail1;
+ }
+ }
+
+ if ((rc = efx_vpd_hunk_set(data, size, evvp)) != 0)
+ goto fail2;
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+hunt_vpd_next(
+ __in efx_nic_t *enp,
+ __in_bcount(size) caddr_t data,
+ __in size_t size,
+ __out efx_vpd_value_t *evvp,
+ __inout unsigned int *contp)
+{
+ _NOTE(ARGUNUSED(enp, data, size, evvp, contp))
+
+ return (ENOTSUP);
+}
+
+ __checkReturn int
+hunt_vpd_write(
+ __in efx_nic_t *enp,
+ __in_bcount(size) caddr_t data,
+ __in size_t size)
+{
+ size_t vpd_length;
+ uint32_t pci_pf;
+ int rc;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+
+ pci_pf = enp->en_nic_cfg.enc_pf;
+
+ /* Determine total length of new dynamic VPD */
+ if ((rc = efx_vpd_hunk_length(data, size, &vpd_length)) != 0)
+ goto fail1;
+
+ /* Store new dynamic VPD in DYNAMIC_CONFIG partition */
+ if ((rc = hunt_nvram_partn_write_tlv(enp,
+ NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG,
+ TLV_TAG_PF_DYNAMIC_VPD(pci_pf),
+ data, vpd_length)) != 0) {
+ goto fail2;
+ }
+
+ return (0);
+
+fail2:
+ EFSYS_PROBE(fail2);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ void
+hunt_vpd_fini(
+ __in efx_nic_t *enp)
+{
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
+
+ if (enp->en_u.hunt.enu_svpd_length > 0) {
+ EFSYS_KMEM_FREE(enp->en_esip, enp->en_u.hunt.enu_svpd_length,
+ enp->en_u.hunt.enu_svpd);
+
+ enp->en_u.hunt.enu_svpd = NULL;
+ enp->en_u.hunt.enu_svpd_length = 0;
+ }
+}
+
+#endif /* EFSYS_OPT_HUNTINGTON */
+
+#endif /* EFSYS_OPT_VPD */
diff --git a/sys/dev/sfxge/common/mcdi_mon.c b/sys/dev/sfxge/common/mcdi_mon.c
new file mode 100644
index 0000000..ec692be
--- /dev/null
+++ b/sys/dev/sfxge/common/mcdi_mon.c
@@ -0,0 +1,552 @@
+/*-
+ * Copyright (c) 2009-2015 Solarflare Communications Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "efsys.h"
+#include "efx.h"
+#include "efx_impl.h"
+
+#if EFSYS_OPT_MON_MCDI
+
+#if EFSYS_OPT_MON_STATS
+
+#define MCDI_MON_NEXT_PAGE (uint16_t)0xfffe
+#define MCDI_MON_INVALID_SENSOR (uint16_t)0xfffd
+#define MCDI_MON_PAGE_SIZE 0x20
+
+/* Bitmasks of valid port(s) for each sensor */
+#define MCDI_MON_PORT_NONE (0x00)
+#define MCDI_MON_PORT_P1 (0x01)
+#define MCDI_MON_PORT_P2 (0x02)
+#define MCDI_MON_PORT_P3 (0x04)
+#define MCDI_MON_PORT_P4 (0x08)
+#define MCDI_MON_PORT_Px (0xFFFF)
+
+/* Entry for MCDI sensor in sensor map */
+#define STAT(portmask, stat) \
+ { (MCDI_MON_PORT_##portmask), (EFX_MON_STAT_##stat) }
+
+/* Entry for sensor next page flag in sensor map */
+#define STAT_NEXT_PAGE() \
+ { MCDI_MON_PORT_NONE, MCDI_MON_NEXT_PAGE }
+
+/* Placeholder for gaps in the array */
+#define STAT_NO_SENSOR() \
+ { MCDI_MON_PORT_NONE, MCDI_MON_INVALID_SENSOR }
+
+/* Map from MC sensors to monitor statistics */
+static const struct mcdi_sensor_map_s {
+ uint16_t msm_port_mask;
+ uint16_t msm_stat;
+} mcdi_sensor_map[] = {
+ /* Sensor page 0 MC_CMD_SENSOR_xxx */
+ STAT(Px, INT_TEMP), /* 0x00 CONTROLLER_TEMP */
+ STAT(Px, EXT_TEMP), /* 0x01 PHY_COMMON_TEMP */
+ STAT(Px, INT_COOLING), /* 0x02 CONTROLLER_COOLING */
+ STAT(P1, EXT_TEMP), /* 0x03 PHY0_TEMP */
+ STAT(P1, EXT_COOLING), /* 0x04 PHY0_COOLING */
+ STAT(P2, EXT_TEMP), /* 0x05 PHY1_TEMP */
+ STAT(P2, EXT_COOLING), /* 0x06 PHY1_COOLING */
+ STAT(Px, 1V), /* 0x07 IN_1V0 */
+ STAT(Px, 1_2V), /* 0x08 IN_1V2 */
+ STAT(Px, 1_8V), /* 0x09 IN_1V8 */
+ STAT(Px, 2_5V), /* 0x0a IN_2V5 */
+ STAT(Px, 3_3V), /* 0x0b IN_3V3 */
+ STAT(Px, 12V), /* 0x0c IN_12V0 */
+ STAT(Px, 1_2VA), /* 0x0d IN_1V2A */
+ STAT(Px, VREF), /* 0x0e IN_VREF */
+ STAT(Px, VAOE), /* 0x0f OUT_VAOE */
+ STAT(Px, AOE_TEMP), /* 0x10 AOE_TEMP */
+ STAT(Px, PSU_AOE_TEMP), /* 0x11 PSU_AOE_TEMP */
+ STAT(Px, PSU_TEMP), /* 0x12 PSU_TEMP */
+ STAT(Px, FAN0), /* 0x13 FAN_0 */
+ STAT(Px, FAN1), /* 0x14 FAN_1 */
+ STAT(Px, FAN2), /* 0x15 FAN_2 */
+ STAT(Px, FAN3), /* 0x16 FAN_3 */
+ STAT(Px, FAN4), /* 0x17 FAN_4 */
+ STAT(Px, VAOE_IN), /* 0x18 IN_VAOE */
+ STAT(Px, IAOE), /* 0x19 OUT_IAOE */
+ STAT(Px, IAOE_IN), /* 0x1a IN_IAOE */
+ STAT(Px, NIC_POWER), /* 0x1b NIC_POWER */
+ STAT(Px, 0_9V), /* 0x1c IN_0V9 */
+ STAT(Px, I0_9V), /* 0x1d IN_I0V9 */
+ STAT(Px, I1_2V), /* 0x1e IN_I1V2 */
+ STAT_NEXT_PAGE(), /* 0x1f Next page flag (not a sensor) */
+
+ /* Sensor page 1 MC_CMD_SENSOR_xxx */
+ STAT(Px, 0_9V_ADC), /* 0x20 IN_0V9_ADC */
+ STAT(Px, INT_TEMP2), /* 0x21 CONTROLLER_2_TEMP */
+ STAT(Px, VREG_TEMP), /* 0x22 VREG_INTERNAL_TEMP */
+ STAT(Px, VREG_0_9V_TEMP), /* 0x23 VREG_0V9_TEMP */
+ STAT(Px, VREG_1_2V_TEMP), /* 0x24 VREG_1V2_TEMP */
+ STAT(Px, INT_VPTAT), /* 0x25 CTRLR. VPTAT */
+ STAT(Px, INT_ADC_TEMP), /* 0x26 CTRLR. INTERNAL_TEMP */
+ STAT(Px, EXT_VPTAT), /* 0x27 CTRLR. VPTAT_EXTADC */
+ STAT(Px, EXT_ADC_TEMP), /* 0x28 CTRLR. INTERNAL_TEMP_EXTADC */
+ STAT(Px, AMBIENT_TEMP), /* 0x29 AMBIENT_TEMP */
+ STAT(Px, AIRFLOW), /* 0x2a AIRFLOW */
+ STAT(Px, VDD08D_VSS08D_CSR), /* 0x2b VDD08D_VSS08D_CSR */
+ STAT(Px, VDD08D_VSS08D_CSR_EXTADC), /* 0x2c VDD08D_VSS08D_CSR_EXTADC */
+ STAT(Px, HOTPOINT_TEMP), /* 0x2d HOTPOINT_TEMP */
+ STAT(P1, PHY_POWER_SWITCH_PORT0), /* 0x2e PHY_POWER_SWITCH_PORT0 */
+ STAT(P2, PHY_POWER_SWITCH_PORT1), /* 0x2f PHY_POWER_SWITCH_PORT1 */
+ STAT(Px, MUM_VCC), /* 0x30 MUM_VCC */
+ STAT(Px, 0V9_A), /* 0x31 0V9_A */
+ STAT(Px, I0V9_A), /* 0x32 I0V9_A */
+ STAT(Px, 0V9_A_TEMP), /* 0x33 0V9_A_TEMP */
+ STAT(Px, 0V9_B), /* 0x34 0V9_B */
+ STAT(Px, I0V9_B), /* 0x35 I0V9_B */
+ STAT(Px, 0V9_B_TEMP), /* 0x36 0V9_B_TEMP */
+ STAT(Px, CCOM_AVREG_1V2_SUPPLY), /* 0x37 CCOM_AVREG_1V2_SUPPLY */
+ STAT(Px, CCOM_AVREG_1V2_SUPPLY_EXT_ADC),
+ /* 0x38 CCOM_AVREG_1V2_SUPPLY_EXT_ADC */
+ STAT(Px, CCOM_AVREG_1V8_SUPPLY), /* 0x39 CCOM_AVREG_1V8_SUPPLY */
+ STAT(Px, CCOM_AVREG_1V8_SUPPLY_EXT_ADC),
+ /* 0x3a CCOM_AVREG_1V8_SUPPLY_EXT_ADC */
+ STAT_NO_SENSOR(), /* 0x3b (no sensor) */
+ STAT_NO_SENSOR(), /* 0x3c (no sensor) */
+ STAT_NO_SENSOR(), /* 0x3d (no sensor) */
+ STAT_NO_SENSOR(), /* 0x3e (no sensor) */
+ STAT_NEXT_PAGE(), /* 0x3f Next page flag (not a sensor) */
+
+ /* Sensor page 2 MC_CMD_SENSOR_xxx */
+ STAT(Px, CONTROLLER_MASTER_VPTAT), /* 0x40 MASTER_VPTAT */
+ STAT(Px, CONTROLLER_MASTER_INTERNAL_TEMP), /* 0x41 MASTER_INT_TEMP */
+ STAT(Px, CONTROLLER_MASTER_VPTAT_EXT_ADC), /* 0x42 MAST_VPTAT_EXT_ADC */
+ STAT(Px, CONTROLLER_MASTER_INTERNAL_TEMP_EXT_ADC),
+ /* 0x43 MASTER_INTERNAL_TEMP_EXT_ADC */
+ STAT(Px, CONTROLLER_SLAVE_VPTAT), /* 0x44 SLAVE_VPTAT */
+ STAT(Px, CONTROLLER_SLAVE_INTERNAL_TEMP), /* 0x45 SLAVE_INTERNAL_TEMP */
+ STAT(Px, CONTROLLER_SLAVE_VPTAT_EXT_ADC), /* 0x46 SLAVE_VPTAT_EXT_ADC */
+ STAT(Px, CONTROLLER_SLAVE_INTERNAL_TEMP_EXT_ADC),
+ /* 0x47 SLAVE_INTERNAL_TEMP_EXT_ADC */
+};
+
+#define MCDI_STATIC_SENSOR_ASSERT(_field) \
+ EFX_STATIC_ASSERT(MC_CMD_SENSOR_STATE_ ## _field \
+ == EFX_MON_STAT_STATE_ ## _field)
+
+static void
+mcdi_mon_decode_stats(
+ __in efx_nic_t *enp,
+ __in_ecount(sensor_mask_size) uint32_t *sensor_mask,
+ __in size_t sensor_mask_size,
+ __in_opt efsys_mem_t *esmp,
+ __out_ecount_opt(sensor_mask_size) uint32_t *stat_maskp,
+ __out_ecount_opt(EFX_MON_NSTATS) efx_mon_stat_value_t *stat)
+{
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+ uint16_t port_mask;
+ uint16_t sensor;
+ size_t sensor_max;
+ uint32_t stat_mask[(EFX_ARRAY_SIZE(mcdi_sensor_map) + 31) / 32];
+ uint32_t idx = 0;
+ uint32_t page = 0;
+
+ /* Assert the MC_CMD_SENSOR and EFX_MON_STATE namespaces agree */
+ MCDI_STATIC_SENSOR_ASSERT(OK);
+ MCDI_STATIC_SENSOR_ASSERT(WARNING);
+ MCDI_STATIC_SENSOR_ASSERT(FATAL);
+ MCDI_STATIC_SENSOR_ASSERT(BROKEN);
+ MCDI_STATIC_SENSOR_ASSERT(NO_READING);
+
+ EFX_STATIC_ASSERT(sizeof (stat_mask[0]) * 8 ==
+ EFX_MON_MASK_ELEMENT_SIZE);
+ sensor_max =
+ MIN((8 * sensor_mask_size), EFX_ARRAY_SIZE(mcdi_sensor_map));
+
+ port_mask = 1U << emip->emi_port;
+
+ memset(stat_mask, 0, sizeof (stat_mask));
+
+ /*
+ * The MCDI sensor readings in the DMA buffer are a packed array of
+ * MC_CMD_SENSOR_VALUE_ENTRY structures, which only includes entries for
+ * supported sensors (bit set in sensor_mask). The sensor_mask and
+ * sensor readings do not include entries for the per-page NEXT_PAGE
+ * flag.
+ *
+ * sensor_mask may legitimately contain MCDI sensors that the driver
+ * does not understand.
+ */
+ for (sensor = 0; sensor < sensor_max; ++sensor) {
+ efx_mon_stat_t id = mcdi_sensor_map[sensor].msm_stat;
+
+ if ((sensor % MCDI_MON_PAGE_SIZE) == MC_CMD_SENSOR_PAGE0_NEXT) {
+ EFSYS_ASSERT3U(id, ==, MCDI_MON_NEXT_PAGE);
+ page++;
+ continue;
+ }
+ if (~(sensor_mask[page]) & (1U << sensor))
+ continue;
+ idx++;
+
+ if ((port_mask & mcdi_sensor_map[sensor].msm_port_mask) == 0)
+ continue;
+ EFSYS_ASSERT(id < EFX_MON_NSTATS);
+
+ /*
+ * stat_mask is a bitmask indexed by EFX_MON_* monitor statistic
+ * identifiers from efx_mon_stat_t (without NEXT_PAGE bits).
+ *
+ * If there is an entry in the MCDI sensor to monitor statistic
+ * map then the sensor reading is used for the value of the
+ * monitor statistic.
+ */
+ stat_mask[id / EFX_MON_MASK_ELEMENT_SIZE] |=
+ (1U << (id % EFX_MON_MASK_ELEMENT_SIZE));
+
+ if (stat != NULL && esmp != NULL && !EFSYS_MEM_IS_NULL(esmp)) {
+ efx_dword_t dword;
+
+ /* Get MCDI sensor reading from DMA buffer */
+ EFSYS_MEM_READD(esmp, 4 * (idx - 1), &dword);
+
+ /* Update EFX monitor stat from MCDI sensor reading */
+ stat[id].emsv_value = (uint16_t)EFX_DWORD_FIELD(dword,
+ MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_VALUE);
+
+ stat[id].emsv_state = (uint16_t)EFX_DWORD_FIELD(dword,
+ MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_STATE);
+ }
+ }
+
+ if (stat_maskp != NULL) {
+ memcpy(stat_maskp, stat_mask, sizeof (stat_mask));
+ }
+}
+
+ __checkReturn int
+mcdi_mon_ev(
+ __in efx_nic_t *enp,
+ __in efx_qword_t *eqp,
+ __out efx_mon_stat_t *idp,
+ __out efx_mon_stat_value_t *valuep)
+{
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+ uint16_t port_mask;
+ uint16_t sensor;
+ uint16_t state;
+ uint16_t value;
+ efx_mon_stat_t id;
+ int rc;
+
+ port_mask = (emip->emi_port == 1)
+ ? MCDI_MON_PORT_P1
+ : MCDI_MON_PORT_P2;
+
+ sensor = (uint16_t)MCDI_EV_FIELD(eqp, SENSOREVT_MONITOR);
+ state = (uint16_t)MCDI_EV_FIELD(eqp, SENSOREVT_STATE);
+ value = (uint16_t)MCDI_EV_FIELD(eqp, SENSOREVT_VALUE);
+
+ /* Hardware must support this MCDI sensor */
+ EFSYS_ASSERT3U(sensor, <, (8 * encp->enc_mcdi_sensor_mask_size));
+ EFSYS_ASSERT((sensor % MCDI_MON_PAGE_SIZE) != MC_CMD_SENSOR_PAGE0_NEXT);
+ EFSYS_ASSERT(encp->enc_mcdi_sensor_maskp != NULL);
+ EFSYS_ASSERT((encp->enc_mcdi_sensor_maskp[sensor / MCDI_MON_PAGE_SIZE] &
+ (1U << (sensor % MCDI_MON_PAGE_SIZE))) != 0);
+
+ /* But we don't have to understand it */
+ if (sensor >= EFX_ARRAY_SIZE(mcdi_sensor_map)) {
+ rc = ENOTSUP;
+ goto fail1;
+ }
+ id = mcdi_sensor_map[sensor].msm_stat;
+ if ((port_mask & mcdi_sensor_map[sensor].msm_port_mask) == 0)
+ return (ENODEV);
+ EFSYS_ASSERT(id < EFX_MON_NSTATS);
+
+ *idp = id;
+ valuep->emsv_value = value;
+ valuep->emsv_state = state;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+
+static __checkReturn int
+efx_mcdi_read_sensors(
+ __in efx_nic_t *enp,
+ __in efsys_mem_t *esmp,
+ __in uint32_t size)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_READ_SENSORS_EXT_IN_LEN,
+ MC_CMD_READ_SENSORS_EXT_OUT_LEN)];
+ uint32_t addr_lo, addr_hi;
+
+ req.emr_cmd = MC_CMD_READ_SENSORS;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_READ_SENSORS_EXT_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_READ_SENSORS_EXT_OUT_LEN;
+
+ addr_lo = (uint32_t)(EFSYS_MEM_ADDR(esmp) & 0xffffffff);
+ addr_hi = (uint32_t)(EFSYS_MEM_ADDR(esmp) >> 32);
+
+ MCDI_IN_SET_DWORD(req, READ_SENSORS_EXT_IN_DMA_ADDR_LO, addr_lo);
+ MCDI_IN_SET_DWORD(req, READ_SENSORS_EXT_IN_DMA_ADDR_HI, addr_hi);
+ MCDI_IN_SET_DWORD(req, READ_SENSORS_EXT_IN_LENGTH, size);
+
+ efx_mcdi_execute(enp, &req);
+
+ return (req.emr_rc);
+}
+
+static __checkReturn int
+efx_mcdi_sensor_info_npages(
+ __in efx_nic_t *enp,
+ __out uint32_t *npagesp)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_SENSOR_INFO_EXT_IN_LEN,
+ MC_CMD_SENSOR_INFO_OUT_LENMAX)];
+ int page;
+ int rc;
+
+ EFSYS_ASSERT(npagesp != NULL);
+
+ page = 0;
+ do {
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_SENSOR_INFO;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_SENSOR_INFO_EXT_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_SENSOR_INFO_OUT_LENMAX;
+
+ MCDI_IN_SET_DWORD(req, SENSOR_INFO_EXT_IN_PAGE, page++);
+
+ efx_mcdi_execute_quiet(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+ } while (MCDI_OUT_DWORD(req, SENSOR_INFO_OUT_MASK) &
+ (1 << MC_CMD_SENSOR_PAGE0_NEXT));
+
+ *npagesp = page;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+static __checkReturn int
+efx_mcdi_sensor_info(
+ __in efx_nic_t *enp,
+ __out_ecount(npages) uint32_t *sensor_maskp,
+ __in size_t npages)
+{
+ efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_SENSOR_INFO_EXT_IN_LEN,
+ MC_CMD_SENSOR_INFO_OUT_LENMAX)];
+ uint32_t page;
+ int rc;
+
+ EFSYS_ASSERT(sensor_maskp != NULL);
+
+ for (page = 0; page < npages; page++) {
+ uint32_t mask;
+
+ (void) memset(payload, 0, sizeof (payload));
+ req.emr_cmd = MC_CMD_SENSOR_INFO;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_SENSOR_INFO_EXT_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_SENSOR_INFO_OUT_LENMAX;
+
+ MCDI_IN_SET_DWORD(req, SENSOR_INFO_EXT_IN_PAGE, page);
+
+ efx_mcdi_execute(enp, &req);
+
+ if (req.emr_rc != 0) {
+ rc = req.emr_rc;
+ goto fail1;
+ }
+
+ mask = MCDI_OUT_DWORD(req, SENSOR_INFO_OUT_MASK);
+
+ if ((page != (npages - 1)) &&
+ ((mask & (1U << MC_CMD_SENSOR_PAGE0_NEXT)) == 0)) {
+ rc = EINVAL;
+ goto fail2;
+ }
+ sensor_maskp[page] = mask;
+ }
+
+ if (sensor_maskp[npages - 1] & (1U << MC_CMD_SENSOR_PAGE0_NEXT)) {
+ rc = EINVAL;
+ goto fail3;
+ }
+
+ return (0);
+
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+mcdi_mon_stats_update(
+ __in efx_nic_t *enp,
+ __in efsys_mem_t *esmp,
+ __out_ecount(EFX_MON_NSTATS) efx_mon_stat_value_t *values)
+{
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+ uint32_t size = encp->enc_mon_stat_dma_buf_size;
+ int rc;
+
+ if ((rc = efx_mcdi_read_sensors(enp, esmp, size)) != 0)
+ goto fail1;
+
+ EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, size);
+
+ mcdi_mon_decode_stats(enp,
+ encp->enc_mcdi_sensor_maskp,
+ encp->enc_mcdi_sensor_mask_size,
+ esmp, NULL, values);
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ __checkReturn int
+mcdi_mon_cfg_build(
+ __in efx_nic_t *enp)
+{
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+ uint32_t npages;
+ int rc;
+
+ switch (enp->en_family) {
+#if EFSYS_OPT_SIENA
+ case EFX_FAMILY_SIENA:
+ encp->enc_mon_type = EFX_MON_SFC90X0;
+ break;
+#endif
+#if EFSYS_OPT_HUNTINGTON
+ case EFX_FAMILY_HUNTINGTON:
+ encp->enc_mon_type = EFX_MON_SFC91X0;
+ break;
+#endif
+ default:
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ /* Get mc sensor mask size */
+ npages = 0;
+ if ((rc = efx_mcdi_sensor_info_npages(enp, &npages)) != 0)
+ goto fail2;
+
+ encp->enc_mon_stat_dma_buf_size = npages * EFX_MON_STATS_PAGE_SIZE;
+ encp->enc_mcdi_sensor_mask_size = npages * sizeof (uint32_t);
+
+ /* Allocate mc sensor mask */
+ EFSYS_KMEM_ALLOC(enp->en_esip,
+ encp->enc_mcdi_sensor_mask_size,
+ encp->enc_mcdi_sensor_maskp);
+
+ if (encp->enc_mcdi_sensor_maskp == NULL) {
+ rc = ENOMEM;
+ goto fail3;
+ }
+
+ /* Read mc sensor mask */
+ if ((rc = efx_mcdi_sensor_info(enp,
+ encp->enc_mcdi_sensor_maskp,
+ npages)) != 0)
+ goto fail4;
+
+ /* Build monitor statistics mask */
+ mcdi_mon_decode_stats(enp,
+ encp->enc_mcdi_sensor_maskp,
+ encp->enc_mcdi_sensor_mask_size,
+ NULL, encp->enc_mon_stat_mask, NULL);
+
+ return (0);
+
+fail4:
+ EFSYS_PROBE(fail4);
+ EFSYS_KMEM_FREE(enp->en_esip,
+ encp->enc_mcdi_sensor_mask_size,
+ encp->enc_mcdi_sensor_maskp);
+
+fail3:
+ EFSYS_PROBE(fail3);
+
+fail2:
+ EFSYS_PROBE(fail2);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ void
+mcdi_mon_cfg_free(
+ __in efx_nic_t *enp)
+{
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+
+ if (encp->enc_mcdi_sensor_maskp != NULL) {
+ EFSYS_KMEM_FREE(enp->en_esip,
+ encp->enc_mcdi_sensor_mask_size,
+ encp->enc_mcdi_sensor_maskp);
+ }
+}
+
+
+#endif /* EFSYS_OPT_MON_STATS */
+
+#endif /* EFSYS_OPT_MON_MCDI */
diff --git a/sys/dev/sfxge/common/mcdi_mon.h b/sys/dev/sfxge/common/mcdi_mon.h
new file mode 100644
index 0000000..30bb150
--- /dev/null
+++ b/sys/dev/sfxge/common/mcdi_mon.h
@@ -0,0 +1,76 @@
+/*-
+ * Copyright (c) 2009-2015 Solarflare Communications Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _SYS_MCDI_MON_H
+#define _SYS_MCDI_MON_H
+
+#include "efx.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if EFSYS_OPT_MON_MCDI
+
+#if EFSYS_OPT_MON_STATS
+
+ __checkReturn int
+mcdi_mon_cfg_build(
+ __in efx_nic_t *enp);
+
+ void
+mcdi_mon_cfg_free(
+ __in efx_nic_t *enp);
+
+
+extern __checkReturn int
+mcdi_mon_ev(
+ __in efx_nic_t *enp,
+ __in efx_qword_t *eqp,
+ __out efx_mon_stat_t *idp,
+ __out efx_mon_stat_value_t *valuep);
+
+extern __checkReturn int
+mcdi_mon_stats_update(
+ __in efx_nic_t *enp,
+ __in efsys_mem_t *esmp,
+ __out_ecount(EFX_MON_NSTATS) efx_mon_stat_value_t *values);
+
+#endif /* EFSYS_OPT_MON_STATS */
+
+#endif /* EFSYS_OPT_MON_MCDI */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SYS_MCDI_MON_H */
diff --git a/sys/dev/sfxge/common/siena_flash.h b/sys/dev/sfxge/common/siena_flash.h
index aed688b..c1ee1c5 100644
--- a/sys/dev/sfxge/common/siena_flash.h
+++ b/sys/dev/sfxge/common/siena_flash.h
@@ -1,26 +1,31 @@
/*-
- * Copyright 2007-2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2007-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*
* $FreeBSD$
*/
@@ -48,6 +53,45 @@
#define SIENA_MC_BOOT_MAGIC (0x51E4A001)
#define SIENA_MC_BOOT_VERSION (1)
+
+/*Structures supporting an arbitrary number of binary blobs in the flash image
+ intended to house code and tables for the satellite cpus*/
+/*thanks to random.org for:*/
+#define BLOBS_HEADER_MAGIC (0xBDA3BBD4)
+#define BLOB_HEADER_MAGIC (0xA1478A91)
+
+typedef struct blobs_hdr_s { /* GENERATED BY scripts/genfwdef */
+ efx_dword_t magic;
+ efx_dword_t no_of_blobs;
+} blobs_hdr_t;
+
+typedef struct blob_hdr_s { /* GENERATED BY scripts/genfwdef */
+ efx_dword_t magic;
+ efx_dword_t cpu_type;
+ efx_dword_t build_variant;
+ efx_dword_t offset;
+ efx_dword_t length;
+ efx_dword_t checksum;
+} blob_hdr_t;
+
+#define BLOB_CPU_TYPE_TXDI_TEXT (0)
+#define BLOB_CPU_TYPE_RXDI_TEXT (1)
+#define BLOB_CPU_TYPE_TXDP_TEXT (2)
+#define BLOB_CPU_TYPE_RXDP_TEXT (3)
+#define BLOB_CPU_TYPE_RXHRSL_HR_LUT (4)
+#define BLOB_CPU_TYPE_RXHRSL_HR_LUT_CFG (5)
+#define BLOB_CPU_TYPE_TXHRSL_HR_LUT (6)
+#define BLOB_CPU_TYPE_TXHRSL_HR_LUT_CFG (7)
+#define BLOB_CPU_TYPE_RXHRSL_HR_PGM (8)
+#define BLOB_CPU_TYPE_RXHRSL_SL_PGM (9)
+#define BLOB_CPU_TYPE_TXHRSL_HR_PGM (10)
+#define BLOB_CPU_TYPE_TXHRSL_SL_PGM (11)
+#define BLOB_CPU_TYPE_RXDI_VTBL0 (12)
+#define BLOB_CPU_TYPE_TXDI_VTBL0 (13)
+#define BLOB_CPU_TYPE_RXDI_VTBL1 (14)
+#define BLOB_CPU_TYPE_TXDI_VTBL1 (15)
+#define BLOB_CPU_TYPE_DUMPSPEC (32)
+
typedef struct siena_mc_boot_hdr_s { /* GENERATED BY scripts/genfwdef */
efx_dword_t magic; /* = SIENA_MC_BOOT_MAGIC */
efx_word_t hdr_version; /* this structure definition is version 1 */
@@ -57,14 +101,21 @@ typedef struct siena_mc_boot_hdr_s { /* GENERATED BY scripts/genfwdef */
efx_byte_t firmware_version_c;
efx_word_t checksum; /* of whole header area + firmware image */
efx_word_t firmware_version_d;
- efx_word_t reserved_a[1]; /* (set to 0) */
+ efx_byte_t mcfw_subtype;
+ efx_byte_t reserved_a[1]; /* (set to 0) */
efx_dword_t firmware_text_offset; /* offset to firmware .text */
efx_dword_t firmware_text_size; /* length of firmware .text, in bytes */
efx_dword_t firmware_data_offset; /* offset to firmware .data */
efx_dword_t firmware_data_size; /* length of firmware .data, in bytes */
- efx_dword_t reserved_b[8]; /* (set to 0) */
+ efx_byte_t spi_rate; /* SPI rate for reading image, 0 is BootROM default */
+ efx_byte_t spi_phase_adj; /* SPI SDO/SCL phase adjustment, 0 is default (no adj) */
+ efx_word_t reserved_b[1]; /* (set to 0) */
+ efx_dword_t reserved_c[7]; /* (set to 0) */
} siena_mc_boot_hdr_t;
+#define SIENA_MC_BOOT_HDR_PADDING \
+ (SIENA_MC_BOOT_HDR_LEN - sizeof(siena_mc_boot_hdr_t))
+
#define SIENA_MC_STATIC_CONFIG_MAGIC (0xBDCF5555)
#define SIENA_MC_STATIC_CONFIG_VERSION (0)
@@ -81,8 +132,8 @@ typedef struct siena_mc_static_config_hdr_s { /* GENERATED BY scripts/genfwdef *
efx_byte_t green_mode_valid; /* Whether cal holds a valid value */
efx_word_t mac_addr_count;
efx_word_t mac_addr_stride;
- efx_word_t calibrated_vref;
- efx_word_t adc_vref;
+ efx_word_t calibrated_vref; /* Vref as measured during production */
+ efx_word_t adc_vref; /* Vref as read by ADC */
efx_dword_t reserved2[1]; /* (write as zero) */
efx_dword_t num_dbi_items;
struct {
@@ -117,17 +168,32 @@ typedef struct siena_mc_dynamic_config_hdr_s { /* GENERATED BY scripts/genfwdef
#define SIENA_MC_EXPROM_SINGLE_MAGIC (0xAA55) /* little-endian uint16_t */
#define SIENA_MC_EXPROM_COMBO_MAGIC (0xB0070102) /* little-endian uint32_t */
+#define SIENA_MC_EXPROM_COMBO_V2_MAGIC (0xB0070103) /* little-endian uint32_t */
typedef struct siena_mc_combo_rom_hdr_s { /* GENERATED BY scripts/genfwdef */
- efx_dword_t magic; /* = SIENA_MC_EXPROM_COMBO_MAGIC */
- efx_dword_t len1; /* length of first image */
- efx_dword_t len2; /* length of second image */
- efx_dword_t off1; /* offset of first byte to edit to combine images */
- efx_dword_t off2; /* offset of second byte to edit to combine images */
- efx_word_t infoblk0_off; /* infoblk offset */
- efx_word_t infoblk1_off; /* infoblk offset */
- efx_byte_t infoblk_len; /* length of space reserved for infoblk structures */
- efx_byte_t reserved[7]; /* (set to 0) */
+ efx_dword_t magic; /* = SIENA_MC_EXPROM_COMBO_MAGIC or SIENA_MC_EXPROM_COMBO_V2_MAGIC */
+ union {
+ struct {
+ efx_dword_t len1; /* length of first image */
+ efx_dword_t len2; /* length of second image */
+ efx_dword_t off1; /* offset of first byte to edit to combine images */
+ efx_dword_t off2; /* offset of second byte to edit to combine images */
+ efx_word_t infoblk0_off;/* infoblk offset */
+ efx_word_t infoblk1_off;/* infoblk offset */
+ efx_byte_t infoblk_len;/* length of space reserved for one infoblk structure */
+ efx_byte_t reserved[7];/* (set to 0) */
+ } v1;
+ struct {
+ efx_dword_t len1; /* length of first image */
+ efx_dword_t len2; /* length of second image */
+ efx_dword_t off1; /* offset of first byte to edit to combine images */
+ efx_dword_t off2; /* offset of second byte to edit to combine images */
+ efx_word_t infoblk_off;/* infoblk start offset */
+ efx_word_t infoblk_count;/* infoblk count */
+ efx_byte_t infoblk_len;/* length of space reserved for one infoblk structure */
+ efx_byte_t reserved[7];/* (set to 0) */
+ } v2;
+ };
} siena_mc_combo_rom_hdr_t;
#pragma pack()
diff --git a/sys/dev/sfxge/common/siena_impl.h b/sys/dev/sfxge/common/siena_impl.h
index 9d02808..b65e399 100644
--- a/sys/dev/sfxge/common/siena_impl.h
+++ b/sys/dev/sfxge/common/siena_impl.h
@@ -1,26 +1,31 @@
/*-
- * Copyright 2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2009-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*
* $FreeBSD$
*/
@@ -101,6 +106,49 @@ siena_sram_test(
#endif /* EFSYS_OPT_DIAG */
+#if EFSYS_OPT_MCDI
+
+extern __checkReturn int
+siena_mcdi_init(
+ __in efx_nic_t *enp,
+ __in const efx_mcdi_transport_t *mtp);
+
+extern void
+siena_mcdi_request_copyin(
+ __in efx_nic_t *enp,
+ __in efx_mcdi_req_t *emrp,
+ __in unsigned int seq,
+ __in boolean_t ev_cpl,
+ __in boolean_t new_epoch);
+
+extern __checkReturn boolean_t
+siena_mcdi_request_poll(
+ __in efx_nic_t *enp);
+
+extern void
+siena_mcdi_request_copyout(
+ __in efx_nic_t *enp,
+ __in efx_mcdi_req_t *emrp);
+
+extern int
+siena_mcdi_poll_reboot(
+ __in efx_nic_t *enp);
+
+extern void
+siena_mcdi_fini(
+ __in efx_nic_t *enp);
+
+extern __checkReturn int
+siena_mcdi_fw_update_supported(
+ __in efx_nic_t *enp,
+ __out boolean_t *supportedp);
+
+extern __checkReturn int
+siena_mcdi_macaddr_change_supported(
+ __in efx_nic_t *enp,
+ __out boolean_t *supportedp);
+
+#endif /* EFSYS_OPT_MCDI */
#if EFSYS_OPT_NVRAM || EFSYS_OPT_VPD
@@ -170,6 +218,12 @@ siena_nvram_size(
__out size_t *sizep);
extern __checkReturn int
+siena_nvram_get_subtype(
+ __in efx_nic_t *enp,
+ __in unsigned int partn,
+ __out uint32_t *subtypep);
+
+extern __checkReturn int
siena_nvram_get_version(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
@@ -212,7 +266,7 @@ extern __checkReturn int
siena_nvram_set_version(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
- __out uint16_t version[4]);
+ __in_ecount(4) uint16_t version[4]);
#endif /* EFSYS_OPT_NVRAM */
@@ -341,7 +395,7 @@ siena_phy_stats_update(
#if EFSYS_OPT_NAMES
-extern const char __cs *
+extern const char *
siena_phy_prop_name(
__in efx_nic_t *enp,
__in unsigned int id);
@@ -363,18 +417,18 @@ siena_phy_prop_set(
#endif /* EFSYS_OPT_PHY_PROPS */
-#if EFSYS_OPT_PHY_BIST
+#if EFSYS_OPT_BIST
extern __checkReturn int
siena_phy_bist_start(
__in efx_nic_t *enp,
- __in efx_phy_bist_type_t type);
+ __in efx_bist_type_t type);
extern __checkReturn int
siena_phy_bist_poll(
__in efx_nic_t *enp,
- __in efx_phy_bist_type_t type,
- __out efx_phy_bist_result_t *resultp,
+ __in efx_bist_type_t type,
+ __out efx_bist_result_t *resultp,
__out_opt __drv_when(count > 0, __notnull)
uint32_t *value_maskp,
__out_ecount_opt(count) __drv_when(count > 0, __notnull)
@@ -384,9 +438,9 @@ siena_phy_bist_poll(
extern void
siena_phy_bist_stop(
__in efx_nic_t *enp,
- __in efx_phy_bist_type_t type);
+ __in efx_bist_type_t type);
-#endif /* EFSYS_OPT_PHY_BIST */
+#endif /* EFSYS_OPT_BIST */
extern __checkReturn int
siena_mac_poll(
@@ -415,22 +469,6 @@ siena_mac_loopback_set(
#if EFSYS_OPT_MAC_STATS
extern __checkReturn int
-siena_mac_stats_clear(
- __in efx_nic_t *enp);
-
-extern __checkReturn int
-siena_mac_stats_upload(
- __in efx_nic_t *enp,
- __in efsys_mem_t *esmp);
-
-extern __checkReturn int
-siena_mac_stats_periodic(
- __in efx_nic_t *enp,
- __in efsys_mem_t *esmp,
- __in uint16_t period_ms,
- __in boolean_t events);
-
-extern __checkReturn int
siena_mac_stats_update(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
@@ -439,39 +477,6 @@ siena_mac_stats_update(
#endif /* EFSYS_OPT_MAC_STATS */
-extern __checkReturn int
-siena_mon_reset(
- __in efx_nic_t *enp);
-
-extern __checkReturn int
-siena_mon_reconfigure(
- __in efx_nic_t *enp);
-
-#if EFSYS_OPT_MON_STATS
-
-extern void
-siena_mon_decode_stats(
- __in efx_nic_t *enp,
- __in uint32_t dmask,
- __in_opt efsys_mem_t *esmp,
- __out_opt uint32_t *vmaskp,
- __out_ecount_opt(EFX_MON_NSTATS) efx_mon_stat_value_t *value);
-
-extern __checkReturn int
-siena_mon_ev(
- __in efx_nic_t *enp,
- __in efx_qword_t *eqp,
- __out efx_mon_stat_t *idp,
- __out efx_mon_stat_value_t *valuep);
-
-extern __checkReturn int
-siena_mon_stats_update(
- __in efx_nic_t *enp,
- __in efsys_mem_t *esmp,
- __out_ecount(EFX_MON_NSTATS) efx_mon_stat_value_t *values);
-
-#endif /* EFSYS_OPT_MON_STATS */
-
#ifdef __cplusplus
}
#endif
diff --git a/sys/dev/sfxge/common/siena_mac.c b/sys/dev/sfxge/common/siena_mac.c
index 38f5bc5..beeaea1 100644
--- a/sys/dev/sfxge/common/siena_mac.c
+++ b/sys/dev/sfxge/common/siena_mac.c
@@ -1,26 +1,31 @@
/*-
- * Copyright 2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2009-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -89,26 +94,29 @@ siena_mac_reconfigure(
__in efx_nic_t *enp)
{
efx_port_t *epp = &(enp->en_port);
- uint8_t payload[MAX(MC_CMD_SET_MAC_IN_LEN,
- MC_CMD_SET_MCAST_HASH_IN_LEN)];
+ efx_oword_t multicast_hash[2];
efx_mcdi_req_t req;
+ uint8_t payload[MAX(MAX(MC_CMD_SET_MAC_IN_LEN,
+ MC_CMD_SET_MAC_OUT_LEN),
+ MAX(MC_CMD_SET_MCAST_HASH_IN_LEN,
+ MC_CMD_SET_MCAST_HASH_OUT_LEN))];
unsigned int fcntl;
int rc;
+ (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_SET_MAC;
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_SET_MAC_IN_LEN;
- EFX_STATIC_ASSERT(MC_CMD_SET_MAC_OUT_LEN == 0);
- req.emr_out_buf = NULL;
- req.emr_out_length = 0;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_SET_MAC_OUT_LEN;
MCDI_IN_SET_DWORD(req, SET_MAC_IN_MTU, epp->ep_mac_pdu);
MCDI_IN_SET_DWORD(req, SET_MAC_IN_DRAIN, epp->ep_mac_drain ? 1 : 0);
EFX_MAC_ADDR_COPY(MCDI_IN2(req, uint8_t, SET_MAC_IN_ADDR),
epp->ep_mac_addr);
MCDI_IN_POPULATE_DWORD_2(req, SET_MAC_IN_REJECT,
- SET_MAC_IN_REJECT_UNCST, !epp->ep_unicst,
- SET_MAC_IN_REJECT_BRDCST, !epp->ep_brdcst);
+ SET_MAC_IN_REJECT_UNCST, !epp->ep_all_unicst,
+ SET_MAC_IN_REJECT_BRDCST, !epp->ep_brdcst);
if (epp->ep_fcntl_autoneg)
/* efx_fcntl_set() has already set the phy capabilities */
@@ -129,19 +137,40 @@ siena_mac_reconfigure(
goto fail1;
}
- /* Push multicast hash. Set the broadcast bit (0xff) appropriately */
+ /* Push multicast hash */
+
+ if (epp->ep_all_mulcst) {
+ /* A hash matching all multicast is all 1s */
+ EFX_SET_OWORD(multicast_hash[0]);
+ EFX_SET_OWORD(multicast_hash[1]);
+ } else if (epp->ep_mulcst) {
+ /* Use the hash set by the multicast list */
+ multicast_hash[0] = epp->ep_multicst_hash[0];
+ multicast_hash[1] = epp->ep_multicst_hash[1];
+ } else {
+ /* A hash matching no traffic is simply 0 */
+ EFX_ZERO_OWORD(multicast_hash[0]);
+ EFX_ZERO_OWORD(multicast_hash[1]);
+ }
+
+ /*
+ * Broadcast packets go through the multicast hash filter.
+ * The IEEE 802.3 CRC32 of the broadcast address is 0xbe2612ff
+ * so we always add bit 0xff to the mask (bit 0x7f in the
+ * second octword).
+ */
+ if (epp->ep_brdcst)
+ EFX_SET_OWORD_BIT(multicast_hash[1], 0x7f);
+
+ (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_SET_MCAST_HASH;
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_SET_MCAST_HASH_IN_LEN;
- EFX_STATIC_ASSERT(MC_CMD_SET_MCAST_HASH_OUT_LEN == 0);
- req.emr_out_buf = NULL;
- req.emr_out_length = 0;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_SET_MCAST_HASH_OUT_LEN;
memcpy(MCDI_IN2(req, uint8_t, SET_MCAST_HASH_IN_HASH0),
- epp->ep_multicst_hash, sizeof (epp->ep_multicst_hash));
- if (epp->ep_brdcst)
- EFX_SET_OWORD_BIT(*MCDI_IN2(req, efx_oword_t,
- SET_MCAST_HASH_IN_HASH1), 0x7f);
+ multicast_hash, sizeof (multicast_hash));
efx_mcdi_execute(enp, &req);
@@ -198,150 +227,6 @@ fail1:
#if EFSYS_OPT_MAC_STATS
- __checkReturn int
-siena_mac_stats_clear(
- __in efx_nic_t *enp)
-{
- uint8_t payload[MC_CMD_MAC_STATS_IN_LEN];
- efx_mcdi_req_t req;
- int rc;
-
- req.emr_cmd = MC_CMD_MAC_STATS;
- req.emr_in_buf = payload;
- req.emr_in_length = sizeof (payload);
- EFX_STATIC_ASSERT(MC_CMD_MAC_STATS_OUT_DMA_LEN == 0);
- req.emr_out_buf = NULL;
- req.emr_out_length = 0;
-
- MCDI_IN_POPULATE_DWORD_3(req, MAC_STATS_IN_CMD,
- MAC_STATS_IN_DMA, 0,
- MAC_STATS_IN_CLEAR, 1,
- MAC_STATS_IN_PERIODIC_CHANGE, 0);
-
- efx_mcdi_execute(enp, &req);
-
- if (req.emr_rc != 0) {
- rc = req.emr_rc;
- goto fail1;
- }
-
- return (0);
-
-fail1:
- EFSYS_PROBE1(fail1, int, rc);
-
- return (rc);
-}
-
- __checkReturn int
-siena_mac_stats_upload(
- __in efx_nic_t *enp,
- __in efsys_mem_t *esmp)
-{
- uint8_t payload[MC_CMD_MAC_STATS_IN_LEN];
- efx_mcdi_req_t req;
- size_t bytes;
- int rc;
-
- EFX_STATIC_ASSERT(MC_CMD_MAC_NSTATS * sizeof (uint64_t) <=
- EFX_MAC_STATS_SIZE);
-
- bytes = MC_CMD_MAC_NSTATS * sizeof (uint64_t);
-
- req.emr_cmd = MC_CMD_MAC_STATS;
- req.emr_in_buf = payload;
- req.emr_in_length = sizeof (payload);
- EFX_STATIC_ASSERT(MC_CMD_MAC_STATS_OUT_DMA_LEN == 0);
- req.emr_out_buf = NULL;
- req.emr_out_length = 0;
-
- MCDI_IN_SET_DWORD(req, MAC_STATS_IN_DMA_ADDR_LO,
- EFSYS_MEM_ADDR(esmp) & 0xffffffff);
- MCDI_IN_SET_DWORD(req, MAC_STATS_IN_DMA_ADDR_HI,
- EFSYS_MEM_ADDR(esmp) >> 32);
- MCDI_IN_SET_DWORD(req, MAC_STATS_IN_DMA_LEN, bytes);
-
- /*
- * The MC DMAs aggregate statistics for our convinience, so we can
- * avoid having to pull the statistics buffer into the cache to
- * maintain cumulative statistics.
- */
- MCDI_IN_POPULATE_DWORD_3(req, MAC_STATS_IN_CMD,
- MAC_STATS_IN_DMA, 1,
- MAC_STATS_IN_CLEAR, 0,
- MAC_STATS_IN_PERIODIC_CHANGE, 0);
-
- efx_mcdi_execute(enp, &req);
-
- if (req.emr_rc != 0) {
- rc = req.emr_rc;
- goto fail1;
- }
-
- return (0);
-
-fail1:
- EFSYS_PROBE1(fail1, int, rc);
-
- return (rc);
-}
-
- __checkReturn int
-siena_mac_stats_periodic(
- __in efx_nic_t *enp,
- __in efsys_mem_t *esmp,
- __in uint16_t period,
- __in boolean_t events)
-{
- uint8_t payload[MC_CMD_MAC_STATS_IN_LEN];
- efx_mcdi_req_t req;
- size_t bytes;
- int rc;
-
- bytes = MC_CMD_MAC_NSTATS * sizeof (uint64_t);
-
- req.emr_cmd = MC_CMD_MAC_STATS;
- req.emr_in_buf = payload;
- req.emr_in_length = sizeof (payload);
- EFX_STATIC_ASSERT(MC_CMD_MAC_STATS_OUT_DMA_LEN == 0);
- req.emr_out_buf = NULL;
- req.emr_out_length = 0;
-
- MCDI_IN_SET_DWORD(req, MAC_STATS_IN_DMA_ADDR_LO,
- EFSYS_MEM_ADDR(esmp) & 0xffffffff);
- MCDI_IN_SET_DWORD(req, MAC_STATS_IN_DMA_ADDR_HI,
- EFSYS_MEM_ADDR(esmp) >> 32);
- MCDI_IN_SET_DWORD(req, MAC_STATS_IN_DMA_LEN, bytes);
-
- /*
- * The MC DMAs aggregate statistics for our convinience, so we can
- * avoid having to pull the statistics buffer into the cache to
- * maintain cumulative statistics.
- */
- MCDI_IN_POPULATE_DWORD_6(req, MAC_STATS_IN_CMD,
- MAC_STATS_IN_DMA, 0,
- MAC_STATS_IN_CLEAR, 0,
- MAC_STATS_IN_PERIODIC_CHANGE, 1,
- MAC_STATS_IN_PERIODIC_ENABLE, period ? 1 : 0,
- MAC_STATS_IN_PERIODIC_NOEVENT, events ? 0 : 1,
- MAC_STATS_IN_PERIOD_MS, period);
-
- efx_mcdi_execute(enp, &req);
-
- if (req.emr_rc != 0) {
- rc = req.emr_rc;
- goto fail1;
- }
-
- return (0);
-
-fail1:
- EFSYS_PROBE1(fail1, int, rc);
-
- return (rc);
-}
-
-
#define SIENA_MAC_STAT_READ(_esmp, _field, _eqp) \
EFSYS_MEM_READQ((_esmp), (_field) * sizeof (efx_qword_t), _eqp)
@@ -352,7 +237,6 @@ siena_mac_stats_update(
__out_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat,
__out_opt uint32_t *generationp)
{
- efx_qword_t rx_pkts;
efx_qword_t value;
efx_qword_t generation_start;
efx_qword_t generation_end;
@@ -360,6 +244,7 @@ siena_mac_stats_update(
_NOTE(ARGUNUSED(enp))
/* Read END first so we don't race with the MC */
+ EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, EFX_MAC_STATS_SIZE);
SIENA_MAC_STAT_READ(esmp, MC_CMD_MAC_GENERATION_END,
&generation_end);
EFSYS_MEM_READ_BARRIER();
@@ -388,7 +273,7 @@ siena_mac_stats_update(
SIENA_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_LT64_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), &value);
SIENA_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_64_PKTS, &value);
- EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), &value);
+ EFSYS_STAT_INCR_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), &value);
SIENA_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_65_TO_127_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_65_TO_127_PKTS]), &value);
@@ -435,8 +320,8 @@ siena_mac_stats_update(
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_EX_DEF_PKTS]), &value);
/* RX */
- SIENA_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_BYTES, &rx_pkts);
- EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_OCTETS]), &rx_pkts);
+ SIENA_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_BYTES, &value);
+ EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_OCTETS]), &value);
SIENA_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_PKTS]), &value);
@@ -529,6 +414,7 @@ siena_mac_stats_update(
SIENA_MAC_STAT_READ(esmp, MC_CMD_MAC_RX_NODESC_DROPS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RX_NODESC_DROP_CNT]), &value);
+ EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, EFX_MAC_STATS_SIZE);
EFSYS_MEM_READ_BARRIER();
SIENA_MAC_STAT_READ(esmp, MC_CMD_MAC_GENERATION_START,
&generation_start);
diff --git a/sys/dev/sfxge/common/siena_mcdi.c b/sys/dev/sfxge/common/siena_mcdi.c
new file mode 100644
index 0000000..b2224ac
--- /dev/null
+++ b/sys/dev/sfxge/common/siena_mcdi.c
@@ -0,0 +1,354 @@
+/*-
+ * Copyright (c) 2012-2015 Solarflare Communications Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "efsys.h"
+#include "efx.h"
+#include "efx_impl.h"
+
+#if EFSYS_OPT_SIENA && EFSYS_OPT_MCDI
+
+#define SIENA_MCDI_PDU(_emip) \
+ (((emip)->emi_port == 1) \
+ ? MC_SMEM_P0_PDU_OFST >> 2 \
+ : MC_SMEM_P1_PDU_OFST >> 2)
+
+#define SIENA_MCDI_DOORBELL(_emip) \
+ (((emip)->emi_port == 1) \
+ ? MC_SMEM_P0_DOORBELL_OFST >> 2 \
+ : MC_SMEM_P1_DOORBELL_OFST >> 2)
+
+#define SIENA_MCDI_STATUS(_emip) \
+ (((emip)->emi_port == 1) \
+ ? MC_SMEM_P0_STATUS_OFST >> 2 \
+ : MC_SMEM_P1_STATUS_OFST >> 2)
+
+
+ void
+siena_mcdi_request_copyin(
+ __in efx_nic_t *enp,
+ __in efx_mcdi_req_t *emrp,
+ __in unsigned int seq,
+ __in boolean_t ev_cpl,
+ __in boolean_t new_epoch)
+{
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+ efx_dword_t dword;
+ unsigned int xflags;
+ unsigned int pdur;
+ unsigned int dbr;
+ unsigned int pos;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA);
+ _NOTE(ARGUNUSED(new_epoch))
+
+ EFSYS_ASSERT(emip->emi_port == 1 || emip->emi_port == 2);
+ pdur = SIENA_MCDI_PDU(emip);
+ dbr = SIENA_MCDI_DOORBELL(emip);
+
+ xflags = 0;
+ if (ev_cpl)
+ xflags |= MCDI_HEADER_XFLAGS_EVREQ;
+
+ /* Construct the header in shared memory */
+ EFX_POPULATE_DWORD_6(dword,
+ MCDI_HEADER_CODE, emrp->emr_cmd,
+ MCDI_HEADER_RESYNC, 1,
+ MCDI_HEADER_DATALEN, emrp->emr_in_length,
+ MCDI_HEADER_SEQ, seq,
+ MCDI_HEADER_RESPONSE, 0,
+ MCDI_HEADER_XFLAGS, xflags);
+ EFX_BAR_TBL_WRITED(enp, FR_CZ_MC_TREG_SMEM, pdur, &dword, B_TRUE);
+
+ for (pos = 0; pos < emrp->emr_in_length; pos += sizeof (efx_dword_t)) {
+ memcpy(&dword, MCDI_IN(*emrp, efx_dword_t, pos),
+ MIN(sizeof (dword), emrp->emr_in_length - pos));
+ EFX_BAR_TBL_WRITED(enp, FR_CZ_MC_TREG_SMEM,
+ pdur + 1 + (pos >> 2), &dword, B_FALSE);
+ }
+
+ /* Ring the doorbell */
+ EFX_POPULATE_DWORD_1(dword, EFX_DWORD_0, 0xd004be11);
+ EFX_BAR_TBL_WRITED(enp, FR_CZ_MC_TREG_SMEM, dbr, &dword, B_FALSE);
+}
+
+ void
+siena_mcdi_request_copyout(
+ __in efx_nic_t *enp,
+ __in efx_mcdi_req_t *emrp)
+{
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+ unsigned int pos;
+ unsigned int pdur;
+ efx_dword_t data;
+
+ pdur = SIENA_MCDI_PDU(emip);
+
+ /* Copy payload out if caller supplied buffer */
+ if (emrp->emr_out_buf != NULL) {
+ size_t bytes = MIN(emrp->emr_out_length_used,
+ emrp->emr_out_length);
+ for (pos = 0; pos < bytes; pos += sizeof (efx_dword_t)) {
+ EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM,
+ pdur + 1 + (pos >> 2), &data, B_FALSE);
+ memcpy(MCDI_OUT(*emrp, efx_dword_t, pos), &data,
+ MIN(sizeof (data), bytes - pos));
+ }
+ }
+}
+
+ int
+siena_mcdi_poll_reboot(
+ __in efx_nic_t *enp)
+{
+#ifndef EFX_GRACEFUL_MC_REBOOT
+ /*
+ * This function is not being used properly.
+ * Until its callers are fixed, it should always return 0.
+ */
+ _NOTE(ARGUNUSED(enp))
+ return (0);
+#else
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+ unsigned int rebootr;
+ efx_dword_t dword;
+ uint32_t value;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA);
+ EFSYS_ASSERT(emip->emi_port == 1 || emip->emi_port == 2);
+ rebootr = SIENA_MCDI_STATUS(emip);
+
+ EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, rebootr, &dword, B_FALSE);
+ value = EFX_DWORD_FIELD(dword, EFX_DWORD_0);
+
+ if (value == 0)
+ return (0);
+
+ EFX_ZERO_DWORD(dword);
+ EFX_BAR_TBL_WRITED(enp, FR_CZ_MC_TREG_SMEM, rebootr, &dword, B_FALSE);
+
+ if (value == MC_STATUS_DWORD_ASSERT)
+ return (EINTR);
+ else
+ return (EIO);
+#endif
+}
+
+ __checkReturn boolean_t
+siena_mcdi_request_poll(
+ __in efx_nic_t *enp)
+{
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+ efx_mcdi_req_t *emrp;
+ efx_dword_t dword;
+ unsigned int pdur;
+ unsigned int seq;
+ unsigned int length;
+ int state;
+ int rc;
+
+ EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA);
+
+ /* Serialise against post-watchdog efx_mcdi_ev* */
+ EFSYS_LOCK(enp->en_eslp, state);
+
+ EFSYS_ASSERT(emip->emi_pending_req != NULL);
+ EFSYS_ASSERT(!emip->emi_ev_cpl);
+ emrp = emip->emi_pending_req;
+
+ /* Check for reboot atomically w.r.t efx_mcdi_request_start */
+ if (emip->emi_poll_cnt++ == 0) {
+ if ((rc = siena_mcdi_poll_reboot(enp)) != 0) {
+ emip->emi_pending_req = NULL;
+ EFSYS_UNLOCK(enp->en_eslp, state);
+
+ goto fail1;
+ }
+ }
+
+ EFSYS_ASSERT(emip->emi_port == 1 || emip->emi_port == 2);
+ pdur = SIENA_MCDI_PDU(emip);
+
+ /* Read the command header */
+ EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, pdur, &dword, B_FALSE);
+ if (EFX_DWORD_FIELD(dword, MCDI_HEADER_RESPONSE) == 0) {
+ EFSYS_UNLOCK(enp->en_eslp, state);
+ return (B_FALSE);
+ }
+
+ /* Request complete */
+ emip->emi_pending_req = NULL;
+ seq = (emip->emi_seq - 1) & EFX_MASK32(MCDI_HEADER_SEQ);
+
+ /* Check for synchronous reboot */
+ if (EFX_DWORD_FIELD(dword, MCDI_HEADER_ERROR) != 0 &&
+ EFX_DWORD_FIELD(dword, MCDI_HEADER_DATALEN) == 0) {
+ /* Consume status word */
+ EFSYS_SPIN(EFX_MCDI_STATUS_SLEEP_US);
+ siena_mcdi_poll_reboot(enp);
+ EFSYS_UNLOCK(enp->en_eslp, state);
+ rc = EIO;
+ goto fail2;
+ }
+
+ EFSYS_UNLOCK(enp->en_eslp, state);
+
+ /* Check that the returned data is consistent */
+ if (EFX_DWORD_FIELD(dword, MCDI_HEADER_CODE) != emrp->emr_cmd ||
+ EFX_DWORD_FIELD(dword, MCDI_HEADER_SEQ) != seq) {
+ /* Response is for a different request */
+ rc = EIO;
+ goto fail3;
+ }
+
+ length = EFX_DWORD_FIELD(dword, MCDI_HEADER_DATALEN);
+ if (EFX_DWORD_FIELD(dword, MCDI_HEADER_ERROR)) {
+ efx_dword_t errdword;
+ int errcode;
+
+ EFSYS_ASSERT3U(length, ==, 4);
+ EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM,
+ pdur + 1 + (MC_CMD_ERR_CODE_OFST >> 2),
+ &errdword, B_FALSE);
+ errcode = EFX_DWORD_FIELD(errdword, EFX_DWORD_0);
+ rc = efx_mcdi_request_errcode(errcode);
+ if (!emrp->emr_quiet) {
+ EFSYS_PROBE2(mcdi_err, int, emrp->emr_cmd,
+ int, errcode);
+ }
+ goto fail4;
+
+ } else {
+ emrp->emr_out_length_used = length;
+ emrp->emr_rc = 0;
+ siena_mcdi_request_copyout(enp, emrp);
+ }
+
+ goto out;
+
+fail4:
+ if (!emrp->emr_quiet)
+ EFSYS_PROBE(fail4);
+fail3:
+ if (!emrp->emr_quiet)
+ EFSYS_PROBE(fail3);
+fail2:
+ if (!emrp->emr_quiet)
+ EFSYS_PROBE(fail2);
+fail1:
+ if (!emrp->emr_quiet)
+ EFSYS_PROBE1(fail1, int, rc);
+
+ /* Fill out error state */
+ emrp->emr_rc = rc;
+ emrp->emr_out_length_used = 0;
+
+ /* Reboot/Assertion */
+ if (rc == EIO || rc == EINTR)
+ efx_mcdi_raise_exception(enp, emrp, rc);
+
+out:
+ return (B_TRUE);
+}
+
+ __checkReturn int
+siena_mcdi_init(
+ __in efx_nic_t *enp,
+ __in const efx_mcdi_transport_t *mtp)
+{
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+ efx_oword_t oword;
+ unsigned int portnum;
+ int rc;
+
+ EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA);
+
+ /* Determine the port number to use for MCDI */
+ EFX_BAR_READO(enp, FR_AZ_CS_DEBUG_REG, &oword);
+ portnum = EFX_OWORD_FIELD(oword, FRF_CZ_CS_PORT_NUM);
+
+ if (portnum == 0) {
+ /* Presumably booted from ROM; only MCDI port 1 will work */
+ emip->emi_port = 1;
+ } else if (portnum <= 2) {
+ emip->emi_port = portnum;
+ } else {
+ rc = EINVAL;
+ goto fail1;
+ }
+
+ /*
+ * Wipe the atomic reboot status so subsequent MCDI requests succeed.
+ * BOOT_STATUS is preserved so eno_nic_probe() can boot out of the
+ * assertion handler.
+ */
+ (void) siena_mcdi_poll_reboot(enp);
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, int, rc);
+
+ return (rc);
+}
+
+ void
+siena_mcdi_fini(
+ __in efx_nic_t *enp)
+{
+}
+
+ __checkReturn int
+siena_mcdi_fw_update_supported(
+ __in efx_nic_t *enp,
+ __out boolean_t *supportedp)
+{
+ EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA);
+
+ *supportedp = B_TRUE;
+
+ return (0);
+}
+
+ __checkReturn int
+siena_mcdi_macaddr_change_supported(
+ __in efx_nic_t *enp,
+ __out boolean_t *supportedp)
+{
+ EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA);
+
+ *supportedp = B_TRUE;
+
+ return (0);
+}
+
+#endif /* EFSYS_OPT_SIENA && EFSYS_OPT_MCDI */
diff --git a/sys/dev/sfxge/common/siena_mon.c b/sys/dev/sfxge/common/siena_mon.c
deleted file mode 100644
index 227ff15..0000000
--- a/sys/dev/sfxge/common/siena_mon.c
+++ /dev/null
@@ -1,284 +0,0 @@
-/*-
- * Copyright 2009 Solarflare Communications Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "efsys.h"
-#include "efx.h"
-#include "efx_impl.h"
-
-#if EFSYS_OPT_MON_SIENA
-
- __checkReturn int
-siena_mon_reset(
- __in efx_nic_t *enp)
-{
- _NOTE(ARGUNUSED(enp))
- EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA);
-
- return (0);
-}
-
- __checkReturn int
-siena_mon_reconfigure(
- __in efx_nic_t *enp)
-{
- _NOTE(ARGUNUSED(enp))
- EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA);
-
- return (0);
-}
-
-#if EFSYS_OPT_MON_STATS
-
-#define SIENA_MON_WRONG_PORT (uint16_t)0xffff
-
-static __cs uint16_t __siena_mon_port0_map[] = {
- EFX_MON_STAT_INT_TEMP, /* MC_CMD_SENSOR_CONTROLLER_TEMP */
- EFX_MON_STAT_EXT_TEMP, /* MC_CMD_SENSOR_PHY_COMMON_TEMP */
- EFX_MON_STAT_INT_COOLING, /* MC_CMD_SENSOR_CONTROLLER_COOLING */
- EFX_MON_STAT_EXT_TEMP, /* MC_CMD_SENSOR_PHY0_TEMP */
- EFX_MON_STAT_EXT_COOLING, /* MC_CMD_SENSOR_PHY0_COOLING */
- SIENA_MON_WRONG_PORT, /* MC_CMD_SENSOR_PHY1_TEMP */
- SIENA_MON_WRONG_PORT, /* MC_CMD_SENSOR_PHY1_COOLING */
- EFX_MON_STAT_1V, /* MC_CMD_SENSOR_IN_1V0 */
- EFX_MON_STAT_1_2V, /* MC_CMD_SENSOR_IN_1V2 */
- EFX_MON_STAT_1_8V, /* MC_CMD_SENSOR_IN_1V8 */
- EFX_MON_STAT_2_5V, /* MC_CMD_SENSOR_IN_2V5 */
- EFX_MON_STAT_3_3V, /* MC_CMD_SENSOR_IN_3V3 */
- EFX_MON_STAT_12V, /* MC_CMD_SENSOR_IN_12V0 */
- EFX_MON_STAT_1_2VA, /* MC_CMD_SENSOR_IN_1V2A */
- EFX_MON_STAT_VREF, /* MC_CMD_SENSOR_IN_VREF */
- EFX_MON_STAT_VAOE, /* MC_CMD_SENSOR_OUT_VAOE */
- EFX_MON_STAT_AOE_TEMP, /* MC_CMD_SENSOR_AOE_TEMP */
- EFX_MON_STAT_PSU_AOE_TEMP, /* MC_CMD_SENSOR_PSU_AOE_TEMP */
- EFX_MON_STAT_PSU_TEMP, /* MC_CMD_SENSOR_PSE_TEMP */
- EFX_MON_STAT_FAN0, /* MC_CMD_SENSOR_FAN_0 */
- EFX_MON_STAT_FAN1, /* MC_CMD_SENSOR_FAN_1 */
- EFX_MON_STAT_FAN2, /* MC_CMD_SENSOR_FAN_2 */
- EFX_MON_STAT_FAN3, /* MC_CMD_SENSOR_FAN_3 */
- EFX_MON_STAT_FAN4, /* MC_CMD_SENSOR_FAN_4 */
- EFX_MON_STAT_VAOE_IN, /* MC_CMD_SENSOR_IN_VAOE */
- EFX_MON_STAT_IAOE, /* MC_CMD_SENSOR_OUT_IAOE */
- EFX_MON_STAT_IAOE_IN, /* MC_CMD_SENSOR_IN_IAOE */
-
-};
-
-static __cs uint16_t __siena_mon_port1_map[] = {
- EFX_MON_STAT_INT_TEMP, /* MC_CMD_SENSOR_CONTROLLER_TEMP */
- EFX_MON_STAT_EXT_TEMP, /* MC_CMD_SENSOR_PHY_COMMON_TEMP */
- EFX_MON_STAT_INT_COOLING, /* MC_CMD_SENSOR_CONTROLLER_COOLING */
- SIENA_MON_WRONG_PORT, /* MC_CMD_SENSOR_PHY0_TEMP */
- SIENA_MON_WRONG_PORT, /* MC_CMD_SENSOR_PHY0_COOLING */
- EFX_MON_STAT_EXT_TEMP, /* MC_CMD_SENSOR_PHY1_TEMP */
- EFX_MON_STAT_EXT_COOLING, /* MC_CMD_SENSOR_PHY1_COOLING */
- EFX_MON_STAT_1V, /* MC_CMD_SENSOR_IN_1V0 */
- EFX_MON_STAT_1_2V, /* MC_CMD_SENSOR_IN_1V2 */
- EFX_MON_STAT_1_8V, /* MC_CMD_SENSOR_IN_1V8 */
- EFX_MON_STAT_2_5V, /* MC_CMD_SENSOR_IN_2V5 */
- EFX_MON_STAT_3_3V, /* MC_CMD_SENSOR_IN_3V3 */
- EFX_MON_STAT_12V, /* MC_CMD_SENSOR_IN_12V0 */
- EFX_MON_STAT_1_2VA, /* MC_CMD_SENSOR_IN_1V2A */
- EFX_MON_STAT_VREF, /* MC_CMD_SENSOR_IN_VREF */
- EFX_MON_STAT_VAOE, /* MC_CMD_SENSOR_OUT_VAOE */
- EFX_MON_STAT_AOE_TEMP, /* MC_CMD_SENSOR_AOE_TEMP */
- EFX_MON_STAT_PSU_AOE_TEMP, /* MC_CMD_SENSOR_PSU_AOE_TEMP */
- EFX_MON_STAT_PSU_TEMP, /* MC_CMD_SENSOR_PSE_TEMP */
- EFX_MON_STAT_FAN0, /* MC_CMD_SENSOR_FAN_0 */
- EFX_MON_STAT_FAN1, /* MC_CMD_SENSOR_FAN_1 */
- EFX_MON_STAT_FAN2, /* MC_CMD_SENSOR_FAN_2 */
- EFX_MON_STAT_FAN3, /* MC_CMD_SENSOR_FAN_3 */
- EFX_MON_STAT_FAN4, /* MC_CMD_SENSOR_FAN_4 */
- EFX_MON_STAT_VAOE_IN, /* MC_CMD_SENSOR_IN_VAOE */
- EFX_MON_STAT_IAOE, /* MC_CMD_SENSOR_OUT_IAOE */
- EFX_MON_STAT_IAOE_IN, /* MC_CMD_SENSOR_IN_IAOE */
-
-};
-
-#define SIENA_STATIC_SENSOR_ASSERT(_field) \
- EFX_STATIC_ASSERT(MC_CMD_SENSOR_STATE_ ## _field \
- == EFX_MON_STAT_STATE_ ## _field)
-
- void
-siena_mon_decode_stats(
- __in efx_nic_t *enp,
- __in uint32_t dmask,
- __in_opt efsys_mem_t *esmp,
- __out_opt uint32_t *vmaskp,
- __out_ecount_opt(EFX_MON_NSTATS) efx_mon_stat_value_t *value)
-{
- efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip);
- uint16_t *sensor_map;
- uint16_t mc_sensor;
- size_t mc_sensor_max;
- uint32_t vmask = 0;
- uint32_t idx = 0;
-
- /* Assert the MC_CMD_SENSOR and EFX_MON_STATE namespaces agree */
- SIENA_STATIC_SENSOR_ASSERT(OK);
- SIENA_STATIC_SENSOR_ASSERT(WARNING);
- SIENA_STATIC_SENSOR_ASSERT(FATAL);
- SIENA_STATIC_SENSOR_ASSERT(BROKEN);
-
- EFX_STATIC_ASSERT(sizeof (__siena_mon_port1_map)
- == sizeof (__siena_mon_port0_map));
- mc_sensor_max = EFX_ARRAY_SIZE(__siena_mon_port0_map);
- sensor_map = (emip->emi_port == 1)
- ? __siena_mon_port0_map
- : __siena_mon_port1_map;
-
- /*
- * dmask may legitimately contain sensors not understood by the driver
- */
- for (mc_sensor = 0; mc_sensor < mc_sensor_max; ++mc_sensor) {
- uint16_t efx_sensor = sensor_map[mc_sensor];
-
- if (~dmask & (1 << mc_sensor))
- continue;
- idx++;
-
- if (efx_sensor == SIENA_MON_WRONG_PORT)
- continue;
- EFSYS_ASSERT(efx_sensor < EFX_MON_NSTATS);
-
- vmask |= (1 << efx_sensor);
- if (value != NULL && esmp != NULL && !EFSYS_MEM_IS_NULL(esmp)) {
- efx_mon_stat_value_t *emsvp = value + efx_sensor;
- efx_dword_t dword;
- EFSYS_MEM_READD(esmp, 4 * (idx - 1), &dword);
- emsvp->emsv_value =
- (uint16_t)EFX_DWORD_FIELD(
- dword,
- MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_VALUE);
- emsvp->emsv_state =
- (uint16_t)EFX_DWORD_FIELD(
- dword,
- MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_STATE);
- }
- }
-
- if (vmaskp != NULL)
- *vmaskp = vmask;
-}
-
- __checkReturn int
-siena_mon_ev(
- __in efx_nic_t *enp,
- __in efx_qword_t *eqp,
- __out efx_mon_stat_t *idp,
- __out efx_mon_stat_value_t *valuep)
-{
- efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip);
- efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
- uint16_t ev_monitor;
- uint16_t ev_state;
- uint16_t ev_value;
- uint16_t *sensor_map;
- efx_mon_stat_t id;
- int rc;
-
- sensor_map = (emip->emi_port == 1)
- ? __siena_mon_port0_map
- : __siena_mon_port1_map;
-
- ev_monitor = (uint16_t)MCDI_EV_FIELD(eqp, SENSOREVT_MONITOR);
- ev_state = (uint16_t)MCDI_EV_FIELD(eqp, SENSOREVT_STATE);
- ev_value = (uint16_t)MCDI_EV_FIELD(eqp, SENSOREVT_VALUE);
-
- /* Hardware must support this statistic */
- EFSYS_ASSERT((1 << ev_monitor) & encp->enc_siena_mon_stat_mask);
-
- /* But we don't have to understand it */
- if (ev_monitor >= EFX_ARRAY_SIZE(__siena_mon_port0_map)) {
- rc = ENOTSUP;
- goto fail1;
- }
-
- id = sensor_map[ev_monitor];
- if (id == SIENA_MON_WRONG_PORT)
- return (ENODEV);
- EFSYS_ASSERT(id < EFX_MON_NSTATS);
-
- *idp = id;
- valuep->emsv_value = ev_value;
- valuep->emsv_state = ev_state;
-
- return (0);
-
-fail1:
- EFSYS_PROBE1(fail1, int, rc);
-
- return (rc);
-}
-
- __checkReturn int
-siena_mon_stats_update(
- __in efx_nic_t *enp,
- __in efsys_mem_t *esmp,
- __out_ecount(EFX_MON_NSTATS) efx_mon_stat_value_t *values)
-{
- efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
- uint32_t dmask = encp->enc_siena_mon_stat_mask;
- uint32_t vmask;
- uint8_t payload[MC_CMD_READ_SENSORS_IN_LEN];
- efx_mcdi_req_t req;
- int rc;
-
- EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA);
-
- req.emr_cmd = MC_CMD_READ_SENSORS;
- req.emr_in_buf = payload;
- req.emr_in_length = sizeof (payload);
- EFX_STATIC_ASSERT(MC_CMD_READ_SENSORS_OUT_LEN == 0);
- req.emr_out_buf = NULL;
- req.emr_out_length = 0;
-
- MCDI_IN_SET_DWORD(req, READ_SENSORS_IN_DMA_ADDR_LO,
- EFSYS_MEM_ADDR(esmp) & 0xffffffff);
- MCDI_IN_SET_DWORD(req, READ_SENSORS_IN_DMA_ADDR_HI,
- EFSYS_MEM_ADDR(esmp) >> 32);
-
- efx_mcdi_execute(enp, &req);
-
- if (req.emr_rc != 0) {
- rc = req.emr_rc;
- goto fail1;
- }
-
- siena_mon_decode_stats(enp, dmask, esmp, &vmask, values);
- EFSYS_ASSERT(vmask == encp->enc_mon_stat_mask);
-
- return (0);
-
-fail1:
- EFSYS_PROBE1(fail1, int, rc);
-
- return (rc);
-}
-
-#endif /* EFSYS_OPT_MON_STATS */
-
-#endif /* EFSYS_OPT_MON_SIENA */
diff --git a/sys/dev/sfxge/common/siena_nic.c b/sys/dev/sfxge/common/siena_nic.c
index 1276c93..3dcf48e 100644
--- a/sys/dev/sfxge/common/siena_nic.c
+++ b/sys/dev/sfxge/common/siena_nic.c
@@ -1,26 +1,31 @@
/*-
- * Copyright 2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2009-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -29,6 +34,7 @@ __FBSDID("$FreeBSD$");
#include "efsys.h"
#include "efx.h"
#include "efx_impl.h"
+#include "mcdi_mon.h"
#if EFSYS_OPT_SIENA
@@ -38,15 +44,16 @@ siena_nic_get_partn_mask(
__out unsigned int *maskp)
{
efx_mcdi_req_t req;
- uint8_t outbuf[MC_CMD_NVRAM_TYPES_OUT_LEN];
+ uint8_t payload[MAX(MC_CMD_NVRAM_TYPES_IN_LEN,
+ MC_CMD_NVRAM_TYPES_OUT_LEN)];
int rc;
+ (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_NVRAM_TYPES;
- EFX_STATIC_ASSERT(MC_CMD_NVRAM_TYPES_IN_LEN == 0);
- req.emr_in_buf = NULL;
- req.emr_in_length = 0;
- req.emr_out_buf = outbuf;
- req.emr_out_length = sizeof (outbuf);
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_NVRAM_TYPES_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_NVRAM_TYPES_OUT_LEN;
efx_mcdi_execute(enp, &req);
@@ -72,193 +79,17 @@ fail1:
return (rc);
}
-static __checkReturn int
-siena_nic_exit_assertion_handler(
- __in efx_nic_t *enp)
-{
- efx_mcdi_req_t req;
- uint8_t payload[MC_CMD_REBOOT_IN_LEN];
- int rc;
-
- req.emr_cmd = MC_CMD_REBOOT;
- req.emr_in_buf = payload;
- req.emr_in_length = MC_CMD_REBOOT_IN_LEN;
- EFX_STATIC_ASSERT(MC_CMD_REBOOT_OUT_LEN == 0);
- req.emr_out_buf = NULL;
- req.emr_out_length = 0;
-
- MCDI_IN_SET_DWORD(req, REBOOT_IN_FLAGS,
- MC_CMD_REBOOT_FLAGS_AFTER_ASSERTION);
-
- efx_mcdi_execute(enp, &req);
-
- if (req.emr_rc != 0 && req.emr_rc != EIO) {
- rc = req.emr_rc;
- goto fail1;
- }
-
- return (0);
-
-fail1:
- EFSYS_PROBE1(fail1, int, rc);
-
- return (rc);
-}
-
-static __checkReturn int
-siena_nic_read_assertion(
- __in efx_nic_t *enp)
-{
- efx_mcdi_req_t req;
- uint8_t payload[MAX(MC_CMD_GET_ASSERTS_IN_LEN,
- MC_CMD_GET_ASSERTS_OUT_LEN)];
- const char *reason;
- unsigned int flags;
- unsigned int index;
- unsigned int ofst;
- int retry;
- int rc;
-
- /*
- * Before we attempt to chat to the MC, we should verify that the MC
- * isn't in it's assertion handler, either due to a previous reboot,
- * or because we're reinitializing due to an eec_exception().
- *
- * Use GET_ASSERTS to read any assertion state that may be present.
- * Retry this command twice. Once because a boot-time assertion failure
- * might cause the 1st MCDI request to fail. And once again because
- * we might race with siena_nic_exit_assertion_handler() running on the
- * other port.
- */
- retry = 2;
- do {
- req.emr_cmd = MC_CMD_GET_ASSERTS;
- req.emr_in_buf = payload;
- req.emr_in_length = MC_CMD_GET_ASSERTS_IN_LEN;
- req.emr_out_buf = payload;
- req.emr_out_length = MC_CMD_GET_ASSERTS_OUT_LEN;
-
- MCDI_IN_SET_DWORD(req, GET_ASSERTS_IN_CLEAR, 1);
- efx_mcdi_execute(enp, &req);
-
- } while ((req.emr_rc == EINTR || req.emr_rc == EIO) && retry-- > 0);
-
- if (req.emr_rc != 0) {
- rc = req.emr_rc;
- goto fail1;
- }
-
- if (req.emr_out_length_used < MC_CMD_GET_ASSERTS_OUT_LEN) {
- rc = EMSGSIZE;
- goto fail2;
- }
-
- /* Print out any assertion state recorded */
- flags = MCDI_OUT_DWORD(req, GET_ASSERTS_OUT_GLOBAL_FLAGS);
- if (flags == MC_CMD_GET_ASSERTS_FLAGS_NO_FAILS)
- return (0);
-
- reason = (flags == MC_CMD_GET_ASSERTS_FLAGS_SYS_FAIL)
- ? "system-level assertion"
- : (flags == MC_CMD_GET_ASSERTS_FLAGS_THR_FAIL)
- ? "thread-level assertion"
- : (flags == MC_CMD_GET_ASSERTS_FLAGS_WDOG_FIRED)
- ? "watchdog reset"
- : "unknown assertion";
- EFSYS_PROBE3(mcpu_assertion,
- const char *, reason, unsigned int,
- MCDI_OUT_DWORD(req, GET_ASSERTS_OUT_SAVED_PC_OFFS),
- unsigned int,
- MCDI_OUT_DWORD(req, GET_ASSERTS_OUT_THREAD_OFFS));
-
- /* Print out the registers */
- ofst = MC_CMD_GET_ASSERTS_OUT_GP_REGS_OFFS_OFST;
- for (index = 1; index < 32; index++) {
- EFSYS_PROBE2(mcpu_register, unsigned int, index, unsigned int,
- EFX_DWORD_FIELD(*MCDI_OUT(req, efx_dword_t, ofst),
- EFX_DWORD_0));
- ofst += sizeof (efx_dword_t);
- }
- EFSYS_ASSERT(ofst <= MC_CMD_GET_ASSERTS_OUT_LEN);
-
- return (0);
-
-fail2:
- EFSYS_PROBE(fail2);
-fail1:
- EFSYS_PROBE1(fail1, int, rc);
-
- return (rc);
-}
-
-static __checkReturn int
-siena_nic_attach(
- __in efx_nic_t *enp,
- __in boolean_t attach)
-{
- efx_mcdi_req_t req;
- uint8_t payload[MC_CMD_DRV_ATTACH_IN_LEN];
- int rc;
-
- req.emr_cmd = MC_CMD_DRV_ATTACH;
- req.emr_in_buf = payload;
- req.emr_in_length = MC_CMD_DRV_ATTACH_IN_LEN;
- req.emr_out_buf = NULL;
- req.emr_out_length = 0;
-
- MCDI_IN_SET_DWORD(req, DRV_ATTACH_IN_NEW_STATE, attach ? 1 : 0);
- MCDI_IN_SET_DWORD(req, DRV_ATTACH_IN_UPDATE, 1);
-
- efx_mcdi_execute(enp, &req);
-
- if (req.emr_rc != 0) {
- rc = req.emr_rc;
- goto fail1;
- }
-
- if (req.emr_out_length_used < MC_CMD_DRV_ATTACH_OUT_LEN) {
- rc = EMSGSIZE;
- goto fail2;
- }
-
- return (0);
-
-fail2:
- EFSYS_PROBE(fail2);
-fail1:
- EFSYS_PROBE1(fail1, int, rc);
-
- return (rc);
-}
-
#if EFSYS_OPT_PCIE_TUNE
__checkReturn int
siena_nic_pcie_extended_sync(
__in efx_nic_t *enp)
{
- uint8_t inbuf[MC_CMD_WORKAROUND_IN_LEN];
- efx_mcdi_req_t req;
int rc;
- EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA);
-
- req.emr_cmd = MC_CMD_WORKAROUND;
- req.emr_in_buf = inbuf;
- req.emr_in_length = sizeof (inbuf);
- EFX_STATIC_ASSERT(MC_CMD_WORKAROUND_OUT_LEN == 0);
- req.emr_out_buf = NULL;
- req.emr_out_length = 0;
-
- MCDI_IN_SET_DWORD(req, WORKAROUND_IN_TYPE, MC_CMD_WORKAROUND_BUG17230);
- MCDI_IN_SET_DWORD(req, WORKAROUND_IN_ENABLED, 1);
-
- efx_mcdi_execute(enp, &req);
-
- if (req.emr_rc != 0) {
- rc = req.emr_rc;
+ if ((rc = efx_mcdi_set_workaround(enp, MC_CMD_WORKAROUND_BUG17230,
+ B_TRUE, NULL) != 0))
goto fail1;
- }
return (0);
@@ -275,58 +106,33 @@ siena_board_cfg(
__in efx_nic_t *enp)
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
- efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip);
- uint8_t outbuf[MAX(MC_CMD_GET_BOARD_CFG_OUT_LENMIN,
- MC_CMD_GET_RESOURCE_LIMITS_OUT_LEN)];
- efx_mcdi_req_t req;
- uint8_t *mac_addr;
- efx_dword_t *capabilities;
+ uint8_t mac_addr[6];
+ efx_dword_t capabilities;
+ uint32_t board_type;
+ uint32_t nevq, nrxq, ntxq;
int rc;
- /* Board configuration */
- req.emr_cmd = MC_CMD_GET_BOARD_CFG;
- EFX_STATIC_ASSERT(MC_CMD_GET_BOARD_CFG_IN_LEN == 0);
- req.emr_in_buf = NULL;
- req.emr_in_length = 0;
- req.emr_out_buf = outbuf;
- req.emr_out_length = MC_CMD_GET_BOARD_CFG_OUT_LENMIN;
-
- efx_mcdi_execute(enp, &req);
+ /* External port identifier using one-based port numbering */
+ encp->enc_external_port = (uint8_t)enp->en_mcdi.em_emip.emi_port;
- if (req.emr_rc != 0) {
- rc = req.emr_rc;
+ /* Board configuration */
+ if ((rc = efx_mcdi_get_board_cfg(enp, &board_type,
+ &capabilities, mac_addr)) != 0)
goto fail1;
- }
-
- if (req.emr_out_length_used < MC_CMD_GET_BOARD_CFG_OUT_LENMIN) {
- rc = EMSGSIZE;
- goto fail2;
- }
- if (emip->emi_port == 1) {
- mac_addr = MCDI_OUT2(req, uint8_t,
- GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT0);
- capabilities = MCDI_OUT2(req, efx_dword_t,
- GET_BOARD_CFG_OUT_CAPABILITIES_PORT0);
- } else {
- mac_addr = MCDI_OUT2(req, uint8_t,
- GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT1);
- capabilities = MCDI_OUT2(req, efx_dword_t,
- GET_BOARD_CFG_OUT_CAPABILITIES_PORT1);
- }
EFX_MAC_ADDR_COPY(encp->enc_mac_addr, mac_addr);
- encp->enc_board_type = MCDI_OUT_DWORD(req,
- GET_BOARD_CFG_OUT_BOARD_TYPE);
+ encp->enc_board_type = board_type;
/* Additional capabilities */
encp->enc_clk_mult = 1;
- if (MCDI_CMD_DWORD_FIELD(capabilities, CAPABILITIES_TURBO)) {
+ if (EFX_DWORD_FIELD(capabilities, MC_CMD_CAPABILITIES_TURBO)) {
enp->en_features |= EFX_FEATURE_TURBO;
- if (MCDI_CMD_DWORD_FIELD(capabilities,
- CAPABILITIES_TURBO_ACTIVE))
+ if (EFX_DWORD_FIELD(capabilities,
+ MC_CMD_CAPABILITIES_TURBO_ACTIVE)) {
encp->enc_clk_mult = 2;
+ }
}
encp->enc_evq_timer_quantum_ns =
@@ -334,48 +140,39 @@ siena_board_cfg(
encp->enc_evq_timer_max_us = (encp->enc_evq_timer_quantum_ns <<
FRF_CZ_TC_TIMER_VAL_WIDTH) / 1000;
- /* Resource limits */
- req.emr_cmd = MC_CMD_GET_RESOURCE_LIMITS;
- EFX_STATIC_ASSERT(MC_CMD_GET_RESOURCE_LIMITS_IN_LEN == 0);
- req.emr_in_buf = NULL;
- req.emr_in_length = 0;
- req.emr_out_buf = outbuf;
- req.emr_out_length = MC_CMD_GET_RESOURCE_LIMITS_OUT_LEN;
+ /* When hash header insertion is enabled, Siena inserts 16 bytes */
+ encp->enc_rx_prefix_size = 16;
- efx_mcdi_execute(enp, &req);
+ /* Alignment for receive packet DMA buffers */
+ encp->enc_rx_buf_align_start = 1;
+ encp->enc_rx_buf_align_end = 1;
- if (req.emr_rc == 0) {
- if (req.emr_out_length_used <
- MC_CMD_GET_RESOURCE_LIMITS_OUT_LEN) {
- rc = EMSGSIZE;
- goto fail3;
- }
+ /* Alignment for WPTR updates */
+ encp->enc_rx_push_align = 1;
- encp->enc_evq_limit = MCDI_OUT_DWORD(req,
- GET_RESOURCE_LIMITS_OUT_EVQ);
- encp->enc_txq_limit = MIN(EFX_TXQ_LIMIT_TARGET,
- MCDI_OUT_DWORD(req, GET_RESOURCE_LIMITS_OUT_TXQ));
- encp->enc_rxq_limit = MIN(EFX_RXQ_LIMIT_TARGET,
- MCDI_OUT_DWORD(req, GET_RESOURCE_LIMITS_OUT_RXQ));
- } else if (req.emr_rc == ENOTSUP) {
- encp->enc_evq_limit = 1024;
- encp->enc_txq_limit = EFX_TXQ_LIMIT_TARGET;
- encp->enc_rxq_limit = EFX_RXQ_LIMIT_TARGET;
- } else {
- rc = req.emr_rc;
- goto fail4;
+ /* Resource limits */
+ rc = efx_mcdi_get_resource_limits(enp, &nevq, &nrxq, &ntxq);
+ if (rc != 0) {
+ if (rc != ENOTSUP)
+ goto fail2;
+
+ nevq = 1024;
+ nrxq = EFX_RXQ_LIMIT_TARGET;
+ ntxq = EFX_TXQ_LIMIT_TARGET;
}
+ encp->enc_evq_limit = nevq;
+ encp->enc_rxq_limit = MIN(EFX_RXQ_LIMIT_TARGET, nrxq);
+ encp->enc_txq_limit = MIN(EFX_TXQ_LIMIT_TARGET, ntxq);
encp->enc_buftbl_limit = SIENA_SRAM_ROWS -
(encp->enc_txq_limit * EFX_TXQ_DC_NDESCS(EFX_TXQ_DC_SIZE)) -
(encp->enc_rxq_limit * EFX_RXQ_DC_NDESCS(EFX_RXQ_DC_SIZE));
+ encp->enc_hw_tx_insert_vlan_enabled = B_FALSE;
+ encp->enc_fw_assisted_tso_enabled = B_FALSE;
+
return (0);
-fail4:
- EFSYS_PROBE(fail4);
-fail3:
- EFSYS_PROBE(fail3);
fail2:
EFSYS_PROBE(fail2);
fail1:
@@ -388,220 +185,27 @@ static __checkReturn int
siena_phy_cfg(
__in efx_nic_t *enp)
{
- efx_port_t *epp = &(enp->en_port);
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
- efx_mcdi_req_t req;
- uint8_t outbuf[MC_CMD_GET_PHY_CFG_OUT_LEN];
int rc;
- req.emr_cmd = MC_CMD_GET_PHY_CFG;
- EFX_STATIC_ASSERT(MC_CMD_GET_PHY_CFG_IN_LEN == 0);
- req.emr_in_buf = NULL;
- req.emr_in_length = 0;
- req.emr_out_buf = outbuf;
- req.emr_out_length = sizeof (outbuf);
-
- efx_mcdi_execute(enp, &req);
-
- if (req.emr_rc != 0) {
- rc = req.emr_rc;
+ /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */
+ if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0)
goto fail1;
- }
-
- if (req.emr_out_length_used < MC_CMD_GET_PHY_CFG_OUT_LEN) {
- rc = EMSGSIZE;
- goto fail2;
- }
-
- encp->enc_phy_type = MCDI_OUT_DWORD(req, GET_PHY_CFG_OUT_TYPE);
-#if EFSYS_OPT_NAMES
- (void) strncpy(encp->enc_phy_name,
- MCDI_OUT2(req, char, GET_PHY_CFG_OUT_NAME),
- MIN(sizeof (encp->enc_phy_name) - 1,
- MC_CMD_GET_PHY_CFG_OUT_NAME_LEN));
-#endif /* EFSYS_OPT_NAMES */
- (void) memset(encp->enc_phy_revision, 0,
- sizeof (encp->enc_phy_revision));
- memcpy(encp->enc_phy_revision,
- MCDI_OUT2(req, char, GET_PHY_CFG_OUT_REVISION),
- MIN(sizeof (encp->enc_phy_revision) - 1,
- MC_CMD_GET_PHY_CFG_OUT_REVISION_LEN));
-#if EFSYS_OPT_PHY_LED_CONTROL
- encp->enc_led_mask = ((1 << EFX_PHY_LED_DEFAULT) |
- (1 << EFX_PHY_LED_OFF) |
- (1 << EFX_PHY_LED_ON));
-#endif /* EFSYS_OPT_PHY_LED_CONTROL */
-
-#if EFSYS_OPT_PHY_PROPS
- encp->enc_phy_nprops = 0;
-#endif /* EFSYS_OPT_PHY_PROPS */
-
- /* Get the media type of the fixed port, if recognised. */
- EFX_STATIC_ASSERT(MC_CMD_MEDIA_XAUI == EFX_PHY_MEDIA_XAUI);
- EFX_STATIC_ASSERT(MC_CMD_MEDIA_CX4 == EFX_PHY_MEDIA_CX4);
- EFX_STATIC_ASSERT(MC_CMD_MEDIA_KX4 == EFX_PHY_MEDIA_KX4);
- EFX_STATIC_ASSERT(MC_CMD_MEDIA_XFP == EFX_PHY_MEDIA_XFP);
- EFX_STATIC_ASSERT(MC_CMD_MEDIA_SFP_PLUS == EFX_PHY_MEDIA_SFP_PLUS);
- EFX_STATIC_ASSERT(MC_CMD_MEDIA_BASE_T == EFX_PHY_MEDIA_BASE_T);
- epp->ep_fixed_port_type =
- MCDI_OUT_DWORD(req, GET_PHY_CFG_OUT_MEDIA_TYPE);
- if (epp->ep_fixed_port_type >= EFX_PHY_MEDIA_NTYPES)
- epp->ep_fixed_port_type = EFX_PHY_MEDIA_INVALID;
-
- epp->ep_phy_cap_mask =
- MCDI_OUT_DWORD(req, GET_PHY_CFG_OUT_SUPPORTED_CAP);
-#if EFSYS_OPT_PHY_FLAGS
- encp->enc_phy_flags_mask = MCDI_OUT_DWORD(req, GET_PHY_CFG_OUT_FLAGS);
-#endif /* EFSYS_OPT_PHY_FLAGS */
-
- encp->enc_port = (uint8_t)MCDI_OUT_DWORD(req, GET_PHY_CFG_OUT_PRT);
-
- /* Populate internal state */
- encp->enc_siena_channel =
- (uint8_t)MCDI_OUT_DWORD(req, GET_PHY_CFG_OUT_CHANNEL);
#if EFSYS_OPT_PHY_STATS
- encp->enc_siena_phy_stat_mask =
- MCDI_OUT_DWORD(req, GET_PHY_CFG_OUT_STATS_MASK);
-
/* Convert the MCDI statistic mask into the EFX_PHY_STAT mask */
- siena_phy_decode_stats(enp, encp->enc_siena_phy_stat_mask,
+ siena_phy_decode_stats(enp, encp->enc_mcdi_phy_stat_mask,
NULL, &encp->enc_phy_stat_mask, NULL);
#endif /* EFSYS_OPT_PHY_STATS */
-#if EFSYS_OPT_PHY_BIST
- encp->enc_bist_mask = 0;
- if (MCDI_OUT_DWORD_FIELD(req, GET_PHY_CFG_OUT_FLAGS,
- GET_PHY_CFG_OUT_BIST_CABLE_SHORT))
- encp->enc_bist_mask |= (1 << EFX_PHY_BIST_TYPE_CABLE_SHORT);
- if (MCDI_OUT_DWORD_FIELD(req, GET_PHY_CFG_OUT_FLAGS,
- GET_PHY_CFG_OUT_BIST_CABLE_LONG))
- encp->enc_bist_mask |= (1 << EFX_PHY_BIST_TYPE_CABLE_LONG);
- if (MCDI_OUT_DWORD_FIELD(req, GET_PHY_CFG_OUT_FLAGS,
- GET_PHY_CFG_OUT_BIST))
- encp->enc_bist_mask |= (1 << EFX_PHY_BIST_TYPE_NORMAL);
-#endif /* EFSYS_OPT_PHY_BIST */
-
- return (0);
-
-fail2:
- EFSYS_PROBE(fail2);
-fail1:
- EFSYS_PROBE1(fail1, int, rc);
-
- return (rc);
-}
-
-#if EFSYS_OPT_LOOPBACK
-
-static __checkReturn int
-siena_loopback_cfg(
- __in efx_nic_t *enp)
-{
- efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
- efx_mcdi_req_t req;
- uint8_t outbuf[MC_CMD_GET_LOOPBACK_MODES_OUT_LEN];
- int rc;
-
- req.emr_cmd = MC_CMD_GET_LOOPBACK_MODES;
- EFX_STATIC_ASSERT(MC_CMD_GET_LOOPBACK_MODES_IN_LEN == 0);
- req.emr_in_buf = NULL;
- req.emr_in_length = 0;
- req.emr_out_buf = outbuf;
- req.emr_out_length = sizeof (outbuf);
-
- efx_mcdi_execute(enp, &req);
-
- if (req.emr_rc != 0) {
- rc = req.emr_rc;
- goto fail1;
- }
-
- if (req.emr_out_length_used < MC_CMD_GET_LOOPBACK_MODES_OUT_LEN) {
- rc = EMSGSIZE;
- goto fail2;
- }
-
- /*
- * We assert the MC_CMD_LOOPBACK and EFX_LOOPBACK namespaces agree
- * in siena_phy.c:siena_phy_get_link()
- */
- encp->enc_loopback_types[EFX_LINK_100FDX] = EFX_LOOPBACK_MASK &
- MCDI_OUT_DWORD(req, GET_LOOPBACK_MODES_OUT_100M) &
- MCDI_OUT_DWORD(req, GET_LOOPBACK_MODES_OUT_SUGGESTED);
- encp->enc_loopback_types[EFX_LINK_1000FDX] = EFX_LOOPBACK_MASK &
- MCDI_OUT_DWORD(req, GET_LOOPBACK_MODES_OUT_1G) &
- MCDI_OUT_DWORD(req, GET_LOOPBACK_MODES_OUT_SUGGESTED);
- encp->enc_loopback_types[EFX_LINK_10000FDX] = EFX_LOOPBACK_MASK &
- MCDI_OUT_DWORD(req, GET_LOOPBACK_MODES_OUT_10G) &
- MCDI_OUT_DWORD(req, GET_LOOPBACK_MODES_OUT_SUGGESTED);
- encp->enc_loopback_types[EFX_LINK_UNKNOWN] =
- (1 << EFX_LOOPBACK_OFF) |
- encp->enc_loopback_types[EFX_LINK_100FDX] |
- encp->enc_loopback_types[EFX_LINK_1000FDX] |
- encp->enc_loopback_types[EFX_LINK_10000FDX];
-
- return (0);
-
-fail2:
- EFSYS_PROBE(fail2);
-fail1:
- EFSYS_PROBE1(fail1, int, rc);
-
- return (rc);
-}
-
-#endif /* EFSYS_OPT_LOOPBACK */
-
-#if EFSYS_OPT_MON_STATS
-
-static __checkReturn int
-siena_monitor_cfg(
- __in efx_nic_t *enp)
-{
- efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
- efx_mcdi_req_t req;
- uint8_t outbuf[MCDI_CTL_SDU_LEN_MAX];
- int rc;
-
- req.emr_cmd = MC_CMD_SENSOR_INFO;
- EFX_STATIC_ASSERT(MC_CMD_SENSOR_INFO_IN_LEN == 0);
- req.emr_in_buf = NULL;
- req.emr_in_length = 0;
- req.emr_out_buf = outbuf;
- req.emr_out_length = sizeof (outbuf);
-
- efx_mcdi_execute(enp, &req);
-
- if (req.emr_rc != 0) {
- rc = req.emr_rc;
- goto fail1;
- }
-
- if (req.emr_out_length_used < MC_CMD_SENSOR_INFO_OUT_MASK_OFST + 4) {
- rc = EMSGSIZE;
- goto fail2;
- }
-
- encp->enc_siena_mon_stat_mask =
- MCDI_OUT_DWORD(req, SENSOR_INFO_OUT_MASK);
- encp->enc_mon_type = EFX_MON_SFC90X0;
-
- siena_mon_decode_stats(enp, encp->enc_siena_mon_stat_mask,
- NULL, &(encp->enc_mon_stat_mask), NULL);
-
return (0);
-fail2:
- EFSYS_PROBE(fail2);
fail1:
EFSYS_PROBE1(fail1, int, rc);
return (rc);
}
-#endif /* EFSYS_OPT_MON_STATS */
-
__checkReturn int
siena_nic_probe(
__in efx_nic_t *enp)
@@ -610,56 +214,69 @@ siena_nic_probe(
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
siena_link_state_t sls;
unsigned int mask;
+ efx_oword_t oword;
int rc;
EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA);
- /* Read clear any assertion state */
- if ((rc = siena_nic_read_assertion(enp)) != 0)
+ /* Test BIU */
+ if ((rc = efx_nic_biu_test(enp)) != 0)
goto fail1;
- /* Exit the assertion handler */
- if ((rc = siena_nic_exit_assertion_handler(enp)) != 0)
+ /* Clear the region register */
+ EFX_POPULATE_OWORD_4(oword,
+ FRF_AZ_ADR_REGION0, 0,
+ FRF_AZ_ADR_REGION1, (1 << 16),
+ FRF_AZ_ADR_REGION2, (2 << 16),
+ FRF_AZ_ADR_REGION3, (3 << 16));
+ EFX_BAR_WRITEO(enp, FR_AZ_ADR_REGION_REG, &oword);
+
+ /* Read clear any assertion state */
+ if ((rc = efx_mcdi_read_assertion(enp)) != 0)
goto fail2;
- /* Wrestle control from the BMC */
- if ((rc = siena_nic_attach(enp, B_TRUE)) != 0)
+ /* Exit the assertion handler */
+ if ((rc = efx_mcdi_exit_assertion_handler(enp)) != 0)
goto fail3;
- if ((rc = siena_board_cfg(enp)) != 0)
+ /* Wrestle control from the BMC */
+ if ((rc = efx_mcdi_drv_attach(enp, B_TRUE)) != 0)
goto fail4;
- if ((rc = siena_phy_cfg(enp)) != 0)
+ if ((rc = siena_board_cfg(enp)) != 0)
goto fail5;
+ if ((rc = siena_phy_cfg(enp)) != 0)
+ goto fail6;
+
/* Obtain the default PHY advertised capabilities */
if ((rc = siena_nic_reset(enp)) != 0)
- goto fail6;
- if ((rc = siena_phy_get_link(enp, &sls)) != 0)
goto fail7;
+ if ((rc = siena_phy_get_link(enp, &sls)) != 0)
+ goto fail8;
epp->ep_default_adv_cap_mask = sls.sls_adv_cap_mask;
epp->ep_adv_cap_mask = sls.sls_adv_cap_mask;
#if EFSYS_OPT_VPD || EFSYS_OPT_NVRAM
if ((rc = siena_nic_get_partn_mask(enp, &mask)) != 0)
- goto fail8;
+ goto fail9;
enp->en_u.siena.enu_partn_mask = mask;
#endif
#if EFSYS_OPT_MAC_STATS
/* Wipe the MAC statistics */
- if ((rc = siena_mac_stats_clear(enp)) != 0)
- goto fail9;
+ if ((rc = efx_mcdi_mac_stats_clear(enp)) != 0)
+ goto fail10;
#endif
#if EFSYS_OPT_LOOPBACK
- if ((rc = siena_loopback_cfg(enp)) != 0)
- goto fail10;
+ if ((rc = efx_mcdi_get_loopback_modes(enp)) != 0)
+ goto fail11;
#endif
#if EFSYS_OPT_MON_STATS
- if ((rc = siena_monitor_cfg(enp)) != 0)
- goto fail11;
+ if ((rc = mcdi_mon_cfg_build(enp)) != 0)
+ goto fail12;
#endif
encp->enc_features = enp->en_features;
@@ -667,21 +284,23 @@ siena_nic_probe(
return (0);
#if EFSYS_OPT_MON_STATS
+fail12:
+ EFSYS_PROBE(fail12);
+#endif
+#if EFSYS_OPT_LOOPBACK
fail11:
EFSYS_PROBE(fail11);
#endif
-#if EFSYS_OPT_LOOPBACK
+#if EFSYS_OPT_MAC_STATS
fail10:
EFSYS_PROBE(fail10);
#endif
-#if EFSYS_OPT_MAC_STATS
+#if EFSYS_OPT_VPD || EFSYS_OPT_NVRAM
fail9:
EFSYS_PROBE(fail9);
#endif
-#if EFSYS_OPT_VPD || EFSYS_OPT_NVRAM
fail8:
EFSYS_PROBE(fail8);
-#endif
fail7:
EFSYS_PROBE(fail7);
fail6:
@@ -710,16 +329,20 @@ siena_nic_reset(
EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA);
/* siena_nic_reset() is called to recover from BADASSERT failures. */
- if ((rc = siena_nic_read_assertion(enp)) != 0)
+ if ((rc = efx_mcdi_read_assertion(enp)) != 0)
goto fail1;
- if ((rc = siena_nic_exit_assertion_handler(enp)) != 0)
+ if ((rc = efx_mcdi_exit_assertion_handler(enp)) != 0)
goto fail2;
- req.emr_cmd = MC_CMD_PORT_RESET;
- EFX_STATIC_ASSERT(MC_CMD_PORT_RESET_IN_LEN == 0);
+ /*
+ * Bug24908: ENTITY_RESET_IN_LEN is non zero but zero may be supplied
+ * for backwards compatibility with PORT_RESET_IN_LEN.
+ */
+ EFX_STATIC_ASSERT(MC_CMD_ENTITY_RESET_OUT_LEN == 0);
+
+ req.emr_cmd = MC_CMD_ENTITY_RESET;
req.emr_in_buf = NULL;
req.emr_in_length = 0;
- EFX_STATIC_ASSERT(MC_CMD_PORT_RESET_OUT_LEN == 0);
req.emr_out_buf = NULL;
req.emr_out_length = 0;
@@ -742,40 +365,6 @@ fail1:
return (0);
}
-static __checkReturn int
-siena_nic_logging(
- __in efx_nic_t *enp)
-{
- efx_mcdi_req_t req;
- uint8_t payload[MC_CMD_LOG_CTRL_IN_LEN];
- int rc;
-
- req.emr_cmd = MC_CMD_LOG_CTRL;
- req.emr_in_buf = payload;
- req.emr_in_length = MC_CMD_LOG_CTRL_IN_LEN;
- EFX_STATIC_ASSERT(MC_CMD_LOG_CTRL_OUT_LEN == 0);
- req.emr_out_buf = NULL;
- req.emr_out_length = 0;
-
- MCDI_IN_SET_DWORD(req, LOG_CTRL_IN_LOG_DEST,
- MC_CMD_LOG_CTRL_IN_LOG_DEST_EVQ);
- MCDI_IN_SET_DWORD(req, LOG_CTRL_IN_LOG_DEST_EVQ, 0);
-
- efx_mcdi_execute(enp, &req);
-
- if (req.emr_rc != 0) {
- rc = req.emr_rc;
- goto fail1;
- }
-
- return (0);
-
-fail1:
- EFSYS_PROBE1(fail1, int, rc);
-
- return (rc);
-}
-
static void
siena_nic_rx_cfg(
__in efx_nic_t *enp)
@@ -814,7 +403,8 @@ siena_nic_init(
EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA);
- if ((rc = siena_nic_logging(enp)) != 0)
+ /* Enable reporting of some events (e.g. link change) */
+ if ((rc = efx_mcdi_log_ctrl(enp)) != 0)
goto fail1;
siena_sram_init(enp);
@@ -850,12 +440,15 @@ siena_nic_fini(
siena_nic_unprobe(
__in efx_nic_t *enp)
{
- (void) siena_nic_attach(enp, B_FALSE);
+#if EFSYS_OPT_MON_STATS
+ mcdi_mon_cfg_free(enp);
+#endif /* EFSYS_OPT_MON_STATS */
+ (void) efx_mcdi_drv_attach(enp, B_FALSE);
}
#if EFSYS_OPT_DIAG
-static efx_register_set_t __cs __siena_registers[] = {
+static efx_register_set_t __siena_registers[] = {
{ FR_AZ_ADR_REGION_REG_OFST, 0, 1 },
{ FR_CZ_USR_EV_CFG_OFST, 0, 1 },
{ FR_AZ_RX_CFG_REG_OFST, 0, 1 },
@@ -871,7 +464,7 @@ static efx_register_set_t __cs __siena_registers[] = {
{ FR_CZ_RX_RSS_IPV6_REG3_OFST, 0, 1}
};
-static const uint32_t __cs __siena_register_masks[] = {
+static const uint32_t __siena_register_masks[] = {
0x0003FFFF, 0x0003FFFF, 0x0003FFFF, 0x0003FFFF,
0x000103FF, 0x00000000, 0x00000000, 0x00000000,
0xFFFFFFFE, 0xFFFFFFFF, 0x0003FFFF, 0x00000000,
@@ -887,7 +480,7 @@ static const uint32_t __cs __siena_register_masks[] = {
0xFFFFFFFF, 0xFFFFFFFF, 0x00000007, 0x00000000
};
-static efx_register_set_t __cs __siena_tables[] = {
+static efx_register_set_t __siena_tables[] = {
{ FR_AZ_RX_FILTER_TBL0_OFST, FR_AZ_RX_FILTER_TBL0_STEP,
FR_AZ_RX_FILTER_TBL0_ROWS },
{ FR_CZ_RX_MAC_FILTER_TBL0_OFST, FR_CZ_RX_MAC_FILTER_TBL0_STEP,
@@ -903,7 +496,7 @@ static efx_register_set_t __cs __siena_tables[] = {
FR_CZ_TX_MAC_FILTER_TBL0_STEP, FR_CZ_TX_MAC_FILTER_TBL0_ROWS }
};
-static const uint32_t __cs __siena_table_masks[] = {
+static const uint32_t __siena_table_masks[] = {
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x000003FF,
0xFFFF0FFF, 0xFFFFFFFF, 0x00000E7F, 0x00000000,
0xFFFFFFFE, 0x0FFFFFFF, 0x01800000, 0x00000000,
diff --git a/sys/dev/sfxge/common/siena_nvram.c b/sys/dev/sfxge/common/siena_nvram.c
index fa746ab..7d20ec0 100644
--- a/sys/dev/sfxge/common/siena_nvram.c
+++ b/sys/dev/sfxge/common/siena_nvram.c
@@ -1,26 +1,31 @@
/*-
- * Copyright 2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2009-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -42,9 +47,6 @@ siena_nvram_partn_size(
__in unsigned int partn,
__out size_t *sizep)
{
- efx_mcdi_req_t req;
- uint8_t payload[MAX(MC_CMD_NVRAM_INFO_IN_LEN,
- MC_CMD_NVRAM_INFO_OUT_LEN)];
int rc;
if ((1 << partn) & ~enp->en_u.siena.enu_partn_mask) {
@@ -52,32 +54,12 @@ siena_nvram_partn_size(
goto fail1;
}
- req.emr_cmd = MC_CMD_NVRAM_INFO;
- req.emr_in_buf = payload;
- req.emr_in_length = MC_CMD_NVRAM_INFO_IN_LEN;
- req.emr_out_buf = payload;
- req.emr_out_length = MC_CMD_NVRAM_INFO_OUT_LEN;
-
- MCDI_IN_SET_DWORD(req, NVRAM_INFO_IN_TYPE, partn);
-
- efx_mcdi_execute(enp, &req);
-
- if (req.emr_rc != 0) {
- rc = req.emr_rc;
+ if ((rc = efx_mcdi_nvram_info(enp, partn, sizep, NULL, NULL)) != 0) {
goto fail2;
}
- if (req.emr_out_length_used < MC_CMD_NVRAM_INFO_OUT_LEN) {
- rc = EMSGSIZE;
- goto fail3;
- }
-
- *sizep = MCDI_OUT_DWORD(req, NVRAM_INFO_OUT_SIZE);
-
return (0);
-fail3:
- EFSYS_PROBE(fail3);
fail2:
EFSYS_PROBE(fail2);
fail1:
@@ -91,23 +73,9 @@ siena_nvram_partn_lock(
__in efx_nic_t *enp,
__in unsigned int partn)
{
- efx_mcdi_req_t req;
- uint8_t payload[MC_CMD_NVRAM_UPDATE_START_IN_LEN];
int rc;
- req.emr_cmd = MC_CMD_NVRAM_UPDATE_START;
- req.emr_in_buf = payload;
- req.emr_in_length = MC_CMD_NVRAM_UPDATE_START_IN_LEN;
- EFX_STATIC_ASSERT(MC_CMD_NVRAM_UPDATE_START_OUT_LEN == 0);
- req.emr_out_buf = NULL;
- req.emr_out_length = 0;
-
- MCDI_IN_SET_DWORD(req, NVRAM_UPDATE_START_IN_TYPE, partn);
-
- efx_mcdi_execute(enp, &req);
-
- if (req.emr_rc != 0) {
- rc = req.emr_rc;
+ if ((rc = efx_mcdi_nvram_update_start(enp, partn)) != 0) {
goto fail1;
}
@@ -127,43 +95,17 @@ siena_nvram_partn_read(
__out_bcount(size) caddr_t data,
__in size_t size)
{
- efx_mcdi_req_t req;
- uint8_t payload[MAX(MC_CMD_NVRAM_READ_IN_LEN,
- MC_CMD_NVRAM_READ_OUT_LEN(SIENA_NVRAM_CHUNK))];
size_t chunk;
int rc;
while (size > 0) {
chunk = MIN(size, SIENA_NVRAM_CHUNK);
- req.emr_cmd = MC_CMD_NVRAM_READ;
- req.emr_in_buf = payload;
- req.emr_in_length = MC_CMD_NVRAM_READ_IN_LEN;
- req.emr_out_buf = payload;
- req.emr_out_length =
- MC_CMD_NVRAM_READ_OUT_LEN(SIENA_NVRAM_CHUNK);
-
- MCDI_IN_SET_DWORD(req, NVRAM_READ_IN_TYPE, partn);
- MCDI_IN_SET_DWORD(req, NVRAM_READ_IN_OFFSET, offset);
- MCDI_IN_SET_DWORD(req, NVRAM_READ_IN_LENGTH, chunk);
-
- efx_mcdi_execute(enp, &req);
-
- if (req.emr_rc != 0) {
- rc = req.emr_rc;
+ if ((rc = efx_mcdi_nvram_read(enp, partn, offset,
+ data, chunk)) != 0) {
goto fail1;
}
- if (req.emr_out_length_used <
- MC_CMD_NVRAM_READ_OUT_LEN(chunk)) {
- rc = EMSGSIZE;
- goto fail2;
- }
-
- memcpy(data,
- MCDI_OUT2(req, uint8_t, NVRAM_READ_OUT_READ_BUFFER),
- chunk);
-
size -= chunk;
data += chunk;
offset += chunk;
@@ -171,8 +113,6 @@ siena_nvram_partn_read(
return (0);
-fail2:
- EFSYS_PROBE(fail2);
fail1:
EFSYS_PROBE1(fail1, int, rc);
@@ -186,25 +126,9 @@ siena_nvram_partn_erase(
__in unsigned int offset,
__in size_t size)
{
- efx_mcdi_req_t req;
- uint8_t payload[MC_CMD_NVRAM_ERASE_IN_LEN];
int rc;
- req.emr_cmd = MC_CMD_NVRAM_ERASE;
- req.emr_in_buf = payload;
- req.emr_in_length = MC_CMD_NVRAM_ERASE_IN_LEN;
- EFX_STATIC_ASSERT(MC_CMD_NVRAM_ERASE_OUT_LEN == 0);
- req.emr_out_buf = NULL;
- req.emr_out_length = 0;
-
- MCDI_IN_SET_DWORD(req, NVRAM_ERASE_IN_TYPE, partn);
- MCDI_IN_SET_DWORD(req, NVRAM_ERASE_IN_OFFSET, offset);
- MCDI_IN_SET_DWORD(req, NVRAM_ERASE_IN_LENGTH, size);
-
- efx_mcdi_execute(enp, &req);
-
- if (req.emr_rc != 0) {
- rc = req.emr_rc;
+ if ((rc = efx_mcdi_nvram_erase(enp, partn, offset, size)) != 0) {
goto fail1;
}
@@ -224,32 +148,14 @@ siena_nvram_partn_write(
__out_bcount(size) caddr_t data,
__in size_t size)
{
- efx_mcdi_req_t req;
- uint8_t payload[MC_CMD_NVRAM_WRITE_IN_LEN(SIENA_NVRAM_CHUNK)];
size_t chunk;
int rc;
while (size > 0) {
chunk = MIN(size, SIENA_NVRAM_CHUNK);
- req.emr_cmd = MC_CMD_NVRAM_WRITE;
- req.emr_in_buf = payload;
- req.emr_in_length = MC_CMD_NVRAM_WRITE_IN_LEN(chunk);
- EFX_STATIC_ASSERT(MC_CMD_NVRAM_WRITE_OUT_LEN == 0);
- req.emr_out_buf = NULL;
- req.emr_out_length = 0;
-
- MCDI_IN_SET_DWORD(req, NVRAM_WRITE_IN_TYPE, partn);
- MCDI_IN_SET_DWORD(req, NVRAM_WRITE_IN_OFFSET, offset);
- MCDI_IN_SET_DWORD(req, NVRAM_WRITE_IN_LENGTH, chunk);
-
- memcpy(MCDI_IN2(req, uint8_t, NVRAM_WRITE_IN_WRITE_BUFFER),
- data, chunk);
-
- efx_mcdi_execute(enp, &req);
-
- if (req.emr_rc != 0) {
- rc = req.emr_rc;
+ if ((rc = efx_mcdi_nvram_write(enp, partn, offset,
+ data, chunk)) != 0) {
goto fail1;
}
@@ -271,18 +177,9 @@ siena_nvram_partn_unlock(
__in efx_nic_t *enp,
__in unsigned int partn)
{
- efx_mcdi_req_t req;
- uint8_t payload[MC_CMD_NVRAM_UPDATE_FINISH_IN_LEN];
- uint32_t reboot;
+ boolean_t reboot;
int rc;
- req.emr_cmd = MC_CMD_NVRAM_UPDATE_FINISH;
- req.emr_in_buf = payload;
- req.emr_in_length = MC_CMD_NVRAM_UPDATE_FINISH_IN_LEN;
- EFX_STATIC_ASSERT(MC_CMD_NVRAM_UPDATE_FINISH_OUT_LEN == 0);
- req.emr_out_buf = NULL;
- req.emr_out_length = 0;
-
/*
* Reboot into the new image only for PHYs. The driver has to
* explicitly cope with an MC reboot after a firmware update.
@@ -291,13 +188,7 @@ siena_nvram_partn_unlock(
partn == MC_CMD_NVRAM_TYPE_PHY_PORT1 ||
partn == MC_CMD_NVRAM_TYPE_DISABLED_CALLISTO);
- MCDI_IN_SET_DWORD(req, NVRAM_UPDATE_FINISH_IN_TYPE, partn);
- MCDI_IN_SET_DWORD(req, NVRAM_UPDATE_FINISH_IN_REBOOT, reboot);
-
- efx_mcdi_execute(enp, &req);
-
- if (req.emr_rc != 0) {
- rc = req.emr_rc;
+ if ((rc = efx_mcdi_nvram_update_finish(enp, partn, reboot)) != 0) {
goto fail1;
}
@@ -338,7 +229,6 @@ static siena_parttbl_entry_t siena_parttbl[] = {
{MC_CMD_NVRAM_TYPE_FC_FW, 2, EFX_NVRAM_FCFW},
{MC_CMD_NVRAM_TYPE_CPLD, 1, EFX_NVRAM_CPLD},
{MC_CMD_NVRAM_TYPE_CPLD, 2, EFX_NVRAM_CPLD},
- {0, 0, 0},
};
static __checkReturn siena_parttbl_entry_t *
@@ -346,12 +236,15 @@ siena_parttbl_entry(
__in efx_nic_t *enp,
__in efx_nvram_type_t type)
{
- efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip);
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
siena_parttbl_entry_t *entry;
+ unsigned int i;
EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES);
- for (entry = siena_parttbl; entry->port > 0; ++entry) {
+ for (i = 0; i < EFX_ARRAY_SIZE(siena_parttbl); i++) {
+ entry = &siena_parttbl[i];
+
if (entry->port == emip->emi_port && entry->nvtype == type)
return (entry);
}
@@ -365,59 +258,29 @@ siena_parttbl_entry(
siena_nvram_test(
__in efx_nic_t *enp)
{
- efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip);
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
siena_parttbl_entry_t *entry;
- efx_mcdi_req_t req;
- uint8_t payload[MAX(MC_CMD_NVRAM_TEST_IN_LEN,
- MC_CMD_NVRAM_TEST_OUT_LEN)];
- int result;
+ unsigned int i;
int rc;
- req.emr_cmd = MC_CMD_NVRAM_TEST;
- req.emr_in_buf = payload;
- req.emr_in_length = MC_CMD_NVRAM_TEST_IN_LEN;
- req.emr_out_buf = payload;
- req.emr_out_length = MC_CMD_NVRAM_TEST_OUT_LEN;
-
/*
* Iterate over the list of supported partition types
* applicable to *this* port
*/
- for (entry = siena_parttbl; entry->port > 0; ++entry) {
+ for (i = 0; i < EFX_ARRAY_SIZE(siena_parttbl); i++) {
+ entry = &siena_parttbl[i];
+
if (entry->port != emip->emi_port ||
!(enp->en_u.siena.enu_partn_mask & (1 << entry->partn)))
continue;
- MCDI_IN_SET_DWORD(req, NVRAM_TEST_IN_TYPE, entry->partn);
-
- efx_mcdi_execute(enp, &req);
-
- if (req.emr_rc != 0) {
- rc = req.emr_rc;
+ if ((rc = efx_mcdi_nvram_test(enp, entry->partn)) != 0) {
goto fail1;
}
-
- if (req.emr_out_length_used < MC_CMD_NVRAM_TEST_OUT_LEN) {
- rc = EMSGSIZE;
- goto fail2;
- }
-
- result = MCDI_OUT_DWORD(req, NVRAM_TEST_OUT_RESULT);
- if (result == MC_CMD_NVRAM_TEST_FAIL) {
-
- EFSYS_PROBE1(nvram_test_failure, int, entry->partn);
-
- rc = (EINVAL);
- goto fail3;
- }
}
return (0);
-fail3:
- EFSYS_PROBE(fail3);
-fail2:
- EFSYS_PROBE(fail2);
fail1:
EFSYS_PROBE1(fail1, int, rc);
@@ -467,7 +330,7 @@ siena_nvram_get_dynamic_cfg(
__out siena_mc_dynamic_config_hdr_t **dcfgp,
__out size_t *sizep)
{
- siena_mc_dynamic_config_hdr_t *dcfg;
+ siena_mc_dynamic_config_hdr_t *dcfg = NULL;
size_t size;
uint8_t cksum;
unsigned int vpd_offset;
@@ -577,34 +440,35 @@ fail4:
EFSYS_PROBE(fail4);
fail3:
EFSYS_PROBE(fail3);
-fail2:
- EFSYS_PROBE(fail2);
EFSYS_KMEM_FREE(enp->en_esip, size, dcfg);
+fail2:
+ EFSYS_PROBE(fail2);
fail1:
EFSYS_PROBE1(fail1, int, rc);
return (rc);
}
-static __checkReturn int
+ __checkReturn int
siena_nvram_get_subtype(
__in efx_nic_t *enp,
__in unsigned int partn,
__out uint32_t *subtypep)
{
efx_mcdi_req_t req;
- uint8_t outbuf[MC_CMD_GET_BOARD_CFG_OUT_LENMAX];
+ uint8_t payload[MAX(MC_CMD_GET_BOARD_CFG_IN_LEN,
+ MC_CMD_GET_BOARD_CFG_OUT_LENMAX)];
efx_word_t *fw_list;
int rc;
+ (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_GET_BOARD_CFG;
- EFX_STATIC_ASSERT(MC_CMD_GET_BOARD_CFG_IN_LEN == 0);
- req.emr_in_buf = NULL;
- req.emr_in_length = 0;
- req.emr_out_buf = outbuf;
- req.emr_out_length = sizeof (outbuf);
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_GET_BOARD_CFG_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_GET_BOARD_CFG_OUT_LENMAX;
efx_mcdi_execute(enp, &req);
@@ -652,6 +516,7 @@ siena_nvram_get_version(
siena_parttbl_entry_t *entry;
unsigned int dcfg_partn;
unsigned int partn;
+ unsigned int i;
int rc;
if ((entry = siena_parttbl_entry(enp, type)) == NULL) {
@@ -674,11 +539,12 @@ siena_nvram_get_version(
* that have access to this partition.
*/
version[0] = version[1] = version[2] = version[3] = 0;
- for (entry = siena_parttbl; entry->port > 0; ++entry) {
+ for (i = 0; i < EFX_ARRAY_SIZE(siena_parttbl); i++) {
unsigned int nitems;
uint16_t temp[4];
size_t length;
+ entry = &siena_parttbl[i];
if (entry->partn != partn)
continue;
@@ -869,7 +735,7 @@ siena_nvram_rw_finish(
siena_nvram_set_version(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
- __out uint16_t version[4])
+ __in_ecount(4) uint16_t version[4])
{
siena_mc_dynamic_config_hdr_t *dcfg = NULL;
siena_parttbl_entry_t *entry;
diff --git a/sys/dev/sfxge/common/siena_phy.c b/sys/dev/sfxge/common/siena_phy.c
index 31b5c46..fd0871d 100644
--- a/sys/dev/sfxge/common/siena_phy.c
+++ b/sys/dev/sfxge/common/siena_phy.c
@@ -1,26 +1,31 @@
/*-
- * Copyright 2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2009-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -192,15 +197,16 @@ siena_phy_get_link(
__out siena_link_state_t *slsp)
{
efx_mcdi_req_t req;
- uint8_t outbuf[MC_CMD_GET_LINK_OUT_LEN];
+ uint8_t payload[MAX(MC_CMD_GET_LINK_IN_LEN,
+ MC_CMD_GET_LINK_OUT_LEN)];
int rc;
+ (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_GET_LINK;
- EFX_STATIC_ASSERT(MC_CMD_GET_LINK_IN_LEN == 0);
- req.emr_in_buf = NULL;
- req.emr_in_length = 0;
- req.emr_out_buf = outbuf;
- req.emr_out_length = sizeof (outbuf);
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_GET_LINK_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_GET_LINK_OUT_LEN;
efx_mcdi_execute(enp, &req);
@@ -266,19 +272,21 @@ siena_phy_reconfigure(
{
efx_port_t *epp = &(enp->en_port);
efx_mcdi_req_t req;
- uint8_t payload[MAX(MC_CMD_SET_ID_LED_IN_LEN,
- MC_CMD_SET_LINK_IN_LEN)];
+ uint8_t payload[MAX(MAX(MC_CMD_SET_ID_LED_IN_LEN,
+ MC_CMD_SET_ID_LED_OUT_LEN),
+ MAX(MC_CMD_SET_LINK_IN_LEN,
+ MC_CMD_SET_LINK_OUT_LEN))];
uint32_t cap_mask;
unsigned int led_mode;
unsigned int speed;
int rc;
+ (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_SET_LINK;
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_SET_LINK_IN_LEN;
- EFX_STATIC_ASSERT(MC_CMD_SET_LINK_OUT_LEN == 0);
- req.emr_out_buf = NULL;
- req.emr_out_length = 0;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_SET_LINK_OUT_LEN;
cap_mask = epp->ep_adv_cap_mask;
MCDI_IN_POPULATE_DWORD_10(req, SET_LINK_IN_CAP,
@@ -329,12 +337,12 @@ siena_phy_reconfigure(
}
/* And set the blink mode */
+ (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_SET_ID_LED;
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_SET_ID_LED_IN_LEN;
- EFX_STATIC_ASSERT(MC_CMD_SET_ID_LED_OUT_LEN == 0);
- req.emr_out_buf = NULL;
- req.emr_out_length = 0;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_SET_ID_LED_OUT_LEN;
#if EFSYS_OPT_PHY_LED_CONTROL
switch (epp->ep_phy_led_mode) {
@@ -379,16 +387,17 @@ siena_phy_verify(
__in efx_nic_t *enp)
{
efx_mcdi_req_t req;
- uint8_t outbuf[MC_CMD_GET_PHY_STATE_OUT_LEN];
+ uint8_t payload[MAX(MC_CMD_GET_PHY_STATE_IN_LEN,
+ MC_CMD_GET_PHY_STATE_OUT_LEN)];
uint32_t state;
int rc;
+ (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_GET_PHY_STATE;
- EFX_STATIC_ASSERT(MC_CMD_GET_PHY_STATE_IN_LEN == 0);
- req.emr_in_buf = NULL;
- req.emr_in_length = 0;
- req.emr_out_buf = outbuf;
- req.emr_out_length = sizeof (outbuf);
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_GET_PHY_STATE_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_GET_PHY_STATE_OUT_LEN;
efx_mcdi_execute(enp, &req);
@@ -544,18 +553,19 @@ siena_phy_stats_update(
__out_ecount(EFX_PHY_NSTATS) uint32_t *stat)
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
- uint32_t vmask = encp->enc_siena_phy_stat_mask;
- uint8_t payload[MC_CMD_PHY_STATS_IN_LEN];
+ uint32_t vmask = encp->enc_mcdi_phy_stat_mask;
uint64_t smask;
efx_mcdi_req_t req;
+ uint8_t payload[MAX(MC_CMD_PHY_STATS_IN_LEN,
+ MC_CMD_PHY_STATS_OUT_DMA_LEN)];
int rc;
+ (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_PHY_STATS;
req.emr_in_buf = payload;
- req.emr_in_length = sizeof (payload);
- EFX_STATIC_ASSERT(MC_CMD_PHY_STATS_OUT_DMA_LEN == 0);
- req.emr_out_buf = NULL;
- req.emr_out_length = 0;
+ req.emr_in_length = MC_CMD_PHY_STATS_IN_LEN;
+ req.emr_out_buf = payload;
+ req.emr_out_length = MC_CMD_PHY_STATS_OUT_DMA_LEN;
MCDI_IN_SET_DWORD(req, PHY_STATS_IN_DMA_ADDR_LO,
EFSYS_MEM_ADDR(esmp) & 0xffffffff);
@@ -587,7 +597,7 @@ fail1:
#if EFSYS_OPT_NAMES
-extern const char __cs *
+extern const char *
siena_phy_prop_name(
__in efx_nic_t *enp,
__in unsigned int id)
@@ -624,46 +634,17 @@ siena_phy_prop_set(
#endif /* EFSYS_OPT_PHY_PROPS */
-#if EFSYS_OPT_PHY_BIST
+#if EFSYS_OPT_BIST
__checkReturn int
siena_phy_bist_start(
__in efx_nic_t *enp,
- __in efx_phy_bist_type_t type)
+ __in efx_bist_type_t type)
{
- uint8_t payload[MC_CMD_START_BIST_IN_LEN];
- efx_mcdi_req_t req;
int rc;
- req.emr_cmd = MC_CMD_START_BIST;
- req.emr_in_buf = payload;
- req.emr_in_length = sizeof (payload);
- EFX_STATIC_ASSERT(MC_CMD_START_BIST_OUT_LEN == 0);
- req.emr_out_buf = NULL;
- req.emr_out_length = 0;
-
- switch (type) {
- case EFX_PHY_BIST_TYPE_NORMAL:
- MCDI_IN_SET_DWORD(req, START_BIST_IN_TYPE, MC_CMD_PHY_BIST);
- break;
- case EFX_PHY_BIST_TYPE_CABLE_SHORT:
- MCDI_IN_SET_DWORD(req, START_BIST_IN_TYPE,
- MC_CMD_PHY_BIST_CABLE_SHORT);
- break;
- case EFX_PHY_BIST_TYPE_CABLE_LONG:
- MCDI_IN_SET_DWORD(req, START_BIST_IN_TYPE,
- MC_CMD_PHY_BIST_CABLE_LONG);
- break;
- default:
- EFSYS_ASSERT(0);
- }
-
- efx_mcdi_execute(enp, &req);
-
- if (req.emr_rc != 0) {
- rc = req.emr_rc;
+ if ((rc = efx_mcdi_bist_start(enp, type)) != 0)
goto fail1;
- }
return (0);
@@ -696,8 +677,8 @@ siena_phy_sft9001_bist_status(
__checkReturn int
siena_phy_bist_poll(
__in efx_nic_t *enp,
- __in efx_phy_bist_type_t type,
- __out efx_phy_bist_result_t *resultp,
+ __in efx_bist_type_t type,
+ __out efx_bist_result_t *resultp,
__out_opt __drv_when(count > 0, __notnull)
uint32_t *value_maskp,
__out_ecount_opt(count) __drv_when(count > 0, __notnull)
@@ -705,19 +686,19 @@ siena_phy_bist_poll(
__in size_t count)
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
- uint8_t payload[MCDI_CTL_SDU_LEN_MAX];
+ uint8_t payload[MAX(MC_CMD_POLL_BIST_IN_LEN,
+ MCDI_CTL_SDU_LEN_MAX)];
uint32_t value_mask = 0;
efx_mcdi_req_t req;
uint32_t result;
int rc;
+ (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_POLL_BIST;
- _NOTE(CONSTANTCONDITION)
- EFSYS_ASSERT(MC_CMD_POLL_BIST_IN_LEN == 0);
- req.emr_in_buf = NULL;
- req.emr_in_length = 0;
+ req.emr_in_buf = payload;
+ req.emr_in_length = MC_CMD_POLL_BIST_IN_LEN;
req.emr_out_buf = payload;
- req.emr_out_length = sizeof (payload);
+ req.emr_out_length = MCDI_CTL_SDU_LEN_MAX;
efx_mcdi_execute(enp, &req);
@@ -740,90 +721,90 @@ siena_phy_bist_poll(
if (result == MC_CMD_POLL_BIST_PASSED &&
encp->enc_phy_type == EFX_PHY_SFT9001B &&
req.emr_out_length_used >= MC_CMD_POLL_BIST_OUT_SFT9001_LEN &&
- (type == EFX_PHY_BIST_TYPE_CABLE_SHORT ||
- type == EFX_PHY_BIST_TYPE_CABLE_LONG)) {
+ (type == EFX_BIST_TYPE_PHY_CABLE_SHORT ||
+ type == EFX_BIST_TYPE_PHY_CABLE_LONG)) {
uint16_t word;
- if (count > EFX_PHY_BIST_CABLE_LENGTH_A) {
+ if (count > EFX_BIST_PHY_CABLE_LENGTH_A) {
if (valuesp != NULL)
- valuesp[EFX_PHY_BIST_CABLE_LENGTH_A] =
+ valuesp[EFX_BIST_PHY_CABLE_LENGTH_A] =
MCDI_OUT_DWORD(req,
POLL_BIST_OUT_SFT9001_CABLE_LENGTH_A);
- value_mask |= (1 << EFX_PHY_BIST_CABLE_LENGTH_A);
+ value_mask |= (1 << EFX_BIST_PHY_CABLE_LENGTH_A);
}
- if (count > EFX_PHY_BIST_CABLE_LENGTH_B) {
+ if (count > EFX_BIST_PHY_CABLE_LENGTH_B) {
if (valuesp != NULL)
- valuesp[EFX_PHY_BIST_CABLE_LENGTH_B] =
+ valuesp[EFX_BIST_PHY_CABLE_LENGTH_B] =
MCDI_OUT_DWORD(req,
POLL_BIST_OUT_SFT9001_CABLE_LENGTH_B);
- value_mask |= (1 << EFX_PHY_BIST_CABLE_LENGTH_B);
+ value_mask |= (1 << EFX_BIST_PHY_CABLE_LENGTH_B);
}
- if (count > EFX_PHY_BIST_CABLE_LENGTH_C) {
+ if (count > EFX_BIST_PHY_CABLE_LENGTH_C) {
if (valuesp != NULL)
- valuesp[EFX_PHY_BIST_CABLE_LENGTH_C] =
+ valuesp[EFX_BIST_PHY_CABLE_LENGTH_C] =
MCDI_OUT_DWORD(req,
POLL_BIST_OUT_SFT9001_CABLE_LENGTH_C);
- value_mask |= (1 << EFX_PHY_BIST_CABLE_LENGTH_C);
+ value_mask |= (1 << EFX_BIST_PHY_CABLE_LENGTH_C);
}
- if (count > EFX_PHY_BIST_CABLE_LENGTH_D) {
+ if (count > EFX_BIST_PHY_CABLE_LENGTH_D) {
if (valuesp != NULL)
- valuesp[EFX_PHY_BIST_CABLE_LENGTH_D] =
+ valuesp[EFX_BIST_PHY_CABLE_LENGTH_D] =
MCDI_OUT_DWORD(req,
POLL_BIST_OUT_SFT9001_CABLE_LENGTH_D);
- value_mask |= (1 << EFX_PHY_BIST_CABLE_LENGTH_D);
+ value_mask |= (1 << EFX_BIST_PHY_CABLE_LENGTH_D);
}
- if (count > EFX_PHY_BIST_CABLE_STATUS_A) {
+ if (count > EFX_BIST_PHY_CABLE_STATUS_A) {
if (valuesp != NULL) {
word = MCDI_OUT_WORD(req,
POLL_BIST_OUT_SFT9001_CABLE_STATUS_A);
- valuesp[EFX_PHY_BIST_CABLE_STATUS_A] =
+ valuesp[EFX_BIST_PHY_CABLE_STATUS_A] =
siena_phy_sft9001_bist_status(word);
}
- value_mask |= (1 << EFX_PHY_BIST_CABLE_STATUS_A);
+ value_mask |= (1 << EFX_BIST_PHY_CABLE_STATUS_A);
}
- if (count > EFX_PHY_BIST_CABLE_STATUS_B) {
+ if (count > EFX_BIST_PHY_CABLE_STATUS_B) {
if (valuesp != NULL) {
word = MCDI_OUT_WORD(req,
POLL_BIST_OUT_SFT9001_CABLE_STATUS_B);
- valuesp[EFX_PHY_BIST_CABLE_STATUS_B] =
+ valuesp[EFX_BIST_PHY_CABLE_STATUS_B] =
siena_phy_sft9001_bist_status(word);
}
- value_mask |= (1 << EFX_PHY_BIST_CABLE_STATUS_B);
+ value_mask |= (1 << EFX_BIST_PHY_CABLE_STATUS_B);
}
- if (count > EFX_PHY_BIST_CABLE_STATUS_C) {
+ if (count > EFX_BIST_PHY_CABLE_STATUS_C) {
if (valuesp != NULL) {
word = MCDI_OUT_WORD(req,
POLL_BIST_OUT_SFT9001_CABLE_STATUS_C);
- valuesp[EFX_PHY_BIST_CABLE_STATUS_C] =
+ valuesp[EFX_BIST_PHY_CABLE_STATUS_C] =
siena_phy_sft9001_bist_status(word);
}
- value_mask |= (1 << EFX_PHY_BIST_CABLE_STATUS_C);
+ value_mask |= (1 << EFX_BIST_PHY_CABLE_STATUS_C);
}
- if (count > EFX_PHY_BIST_CABLE_STATUS_D) {
+ if (count > EFX_BIST_PHY_CABLE_STATUS_D) {
if (valuesp != NULL) {
word = MCDI_OUT_WORD(req,
POLL_BIST_OUT_SFT9001_CABLE_STATUS_D);
- valuesp[EFX_PHY_BIST_CABLE_STATUS_D] =
+ valuesp[EFX_BIST_PHY_CABLE_STATUS_D] =
siena_phy_sft9001_bist_status(word);
}
- value_mask |= (1 << EFX_PHY_BIST_CABLE_STATUS_D);
+ value_mask |= (1 << EFX_BIST_PHY_CABLE_STATUS_D);
}
} else if (result == MC_CMD_POLL_BIST_FAILED &&
encp->enc_phy_type == EFX_PHY_QLX111V &&
req.emr_out_length >= MC_CMD_POLL_BIST_OUT_MRSFP_LEN &&
- count > EFX_PHY_BIST_FAULT_CODE) {
+ count > EFX_BIST_FAULT_CODE) {
if (valuesp != NULL)
- valuesp[EFX_PHY_BIST_FAULT_CODE] =
+ valuesp[EFX_BIST_FAULT_CODE] =
MCDI_OUT_DWORD(req, POLL_BIST_OUT_MRSFP_TEST);
- value_mask |= 1 << EFX_PHY_BIST_FAULT_CODE;
+ value_mask |= 1 << EFX_BIST_FAULT_CODE;
}
if (value_maskp != NULL)
@@ -831,11 +812,11 @@ siena_phy_bist_poll(
EFSYS_ASSERT(resultp != NULL);
if (result == MC_CMD_POLL_BIST_RUNNING)
- *resultp = EFX_PHY_BIST_RESULT_RUNNING;
+ *resultp = EFX_BIST_RESULT_RUNNING;
else if (result == MC_CMD_POLL_BIST_PASSED)
- *resultp = EFX_PHY_BIST_RESULT_PASSED;
+ *resultp = EFX_BIST_RESULT_PASSED;
else
- *resultp = EFX_PHY_BIST_RESULT_FAILED;
+ *resultp = EFX_BIST_RESULT_FAILED;
return (0);
@@ -850,12 +831,12 @@ fail1:
void
siena_phy_bist_stop(
__in efx_nic_t *enp,
- __in efx_phy_bist_type_t type)
+ __in efx_bist_type_t type)
{
/* There is no way to stop BIST on Siena */
_NOTE(ARGUNUSED(enp, type))
}
-#endif /* EFSYS_OPT_PHY_BIST */
+#endif /* EFSYS_OPT_BIST */
#endif /* EFSYS_OPT_SIENA */
diff --git a/sys/dev/sfxge/common/siena_sram.c b/sys/dev/sfxge/common/siena_sram.c
index 3137e5b..cf36067 100644
--- a/sys/dev/sfxge/common/siena_sram.c
+++ b/sys/dev/sfxge/common/siena_sram.c
@@ -1,26 +1,31 @@
/*-
- * Copyright 2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2009-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
diff --git a/sys/dev/sfxge/common/siena_vpd.c b/sys/dev/sfxge/common/siena_vpd.c
index 3f1008b..4d4b825 100644
--- a/sys/dev/sfxge/common/siena_vpd.c
+++ b/sys/dev/sfxge/common/siena_vpd.c
@@ -1,26 +1,31 @@
/*-
- * Copyright 2009 Solarflare Communications Inc. All rights reserved.
+ * Copyright (c) 2009-2015 Solarflare Communications Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -141,11 +146,11 @@ fail4:
EFSYS_PROBE(fail4);
fail3:
EFSYS_PROBE(fail3);
-fail2:
- EFSYS_PROBE(fail2);
EFSYS_KMEM_FREE(enp->en_esip, size, scfg);
+fail2:
+ EFSYS_PROBE(fail2);
fail1:
EFSYS_PROBE1(fail1, int, rc);
@@ -156,7 +161,7 @@ fail1:
siena_vpd_init(
__in efx_nic_t *enp)
{
- efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip);
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
caddr_t svpd = NULL;
unsigned partn;
size_t size = 0;
@@ -201,7 +206,7 @@ siena_vpd_size(
__in efx_nic_t *enp,
__out size_t *sizep)
{
- efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip);
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
unsigned int partn;
int rc;
@@ -236,8 +241,8 @@ siena_vpd_read(
__out_bcount(size) caddr_t data,
__in size_t size)
{
- efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip);
- siena_mc_dynamic_config_hdr_t *dcfg;
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+ siena_mc_dynamic_config_hdr_t *dcfg = NULL;
unsigned int vpd_length;
unsigned int vpd_offset;
unsigned int dcfg_partn;
@@ -499,8 +504,8 @@ siena_vpd_write(
__in_bcount(size) caddr_t data,
__in size_t size)
{
- efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip);
- siena_mc_dynamic_config_hdr_t *dcfg;
+ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+ siena_mc_dynamic_config_hdr_t *dcfg = NULL;
unsigned int vpd_offset;
unsigned int dcfg_partn;
unsigned int hdr_length;
@@ -525,18 +530,18 @@ siena_vpd_write(
goto fail2;
if ((rc = siena_nvram_partn_lock(enp, dcfg_partn)) != 0)
- goto fail2;
+ goto fail3;
if ((rc = siena_nvram_get_dynamic_cfg(enp, dcfg_partn,
B_FALSE, &dcfg, &dcfg_size)) != 0)
- goto fail3;
+ goto fail4;
hdr_length = EFX_WORD_FIELD(dcfg->length, EFX_WORD_0);
/* Allocated memory should have room for the new VPD */
if (hdr_length + vpd_length > dcfg_size) {
rc = ENOSPC;
- goto fail3;
+ goto fail5;
}
/* Copy in new vpd and update header */
@@ -553,12 +558,12 @@ siena_vpd_write(
/* Erase and write the new sector */
if ((rc = siena_nvram_partn_erase(enp, dcfg_partn, 0, partn_size)) != 0)
- goto fail4;
+ goto fail6;
/* Write out the new structure to nvram */
if ((rc = siena_nvram_partn_write(enp, dcfg_partn, 0, (caddr_t)dcfg,
vpd_offset + vpd_length)) != 0)
- goto fail5;
+ goto fail7;
EFSYS_KMEM_FREE(enp->en_esip, dcfg_size, dcfg);
@@ -566,18 +571,22 @@ siena_vpd_write(
return (0);
+fail7:
+ EFSYS_PROBE(fail7);
+fail6:
+ EFSYS_PROBE(fail6);
fail5:
EFSYS_PROBE(fail5);
+
+ EFSYS_KMEM_FREE(enp->en_esip, dcfg_size, dcfg);
fail4:
EFSYS_PROBE(fail4);
+
+ siena_nvram_partn_unlock(enp, dcfg_partn);
fail3:
EFSYS_PROBE(fail3);
-
- EFSYS_KMEM_FREE(enp->en_esip, dcfg_size, dcfg);
fail2:
EFSYS_PROBE(fail2);
-
- siena_nvram_partn_unlock(enp, dcfg_partn);
fail1:
EFSYS_PROBE1(fail1, int, rc);
diff --git a/sys/dev/sfxge/sfxge.c b/sys/dev/sfxge/sfxge.c
index 150df72..f484b74 100644
--- a/sys/dev/sfxge/sfxge.c
+++ b/sys/dev/sfxge/sfxge.c
@@ -1,30 +1,34 @@
/*-
- * Copyright (c) 2010-2011 Solarflare Communications, Inc.
+ * Copyright (c) 2010-2015 Solarflare Communications Inc.
* All rights reserved.
*
* This software was developed in part by Philip Paeps under contract for
* Solarflare Communications, Inc.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -42,6 +46,7 @@ __FBSDID("$FreeBSD$");
#include <sys/taskqueue.h>
#include <sys/sockio.h>
#include <sys/sysctl.h>
+#include <sys/priv.h>
#include <sys/syslog.h>
#include <dev/pci/pcireg.h>
@@ -57,6 +62,7 @@ __FBSDID("$FreeBSD$");
#include "sfxge.h"
#include "sfxge_rx.h"
+#include "sfxge_ioc.h"
#include "sfxge_version.h"
#define SFXGE_CAP (IFCAP_VLAN_MTU | IFCAP_VLAN_HWCSUM | \
@@ -93,6 +99,83 @@ static void
sfxge_reset(void *arg, int npending);
static int
+sfxge_estimate_rsrc_limits(struct sfxge_softc *sc)
+{
+ efx_drv_limits_t limits;
+ int rc;
+ unsigned int evq_max;
+ uint32_t evq_allocated;
+ uint32_t rxq_allocated;
+ uint32_t txq_allocated;
+
+ /*
+ * Limit the number of event queues to:
+ * - number of CPUs
+ * - hardwire maximum RSS channels
+ * - administratively specified maximum RSS channels
+ */
+ evq_max = MIN(mp_ncpus, EFX_MAXRSS);
+ if (sc->max_rss_channels > 0)
+ evq_max = MIN(evq_max, sc->max_rss_channels);
+
+ memset(&limits, 0, sizeof(limits));
+
+ limits.edl_min_evq_count = 1;
+ limits.edl_max_evq_count = evq_max;
+ limits.edl_min_txq_count = SFXGE_TXQ_NTYPES;
+ limits.edl_max_txq_count = evq_max + SFXGE_TXQ_NTYPES - 1;
+ limits.edl_min_rxq_count = 1;
+ limits.edl_max_rxq_count = evq_max;
+
+ efx_nic_set_drv_limits(sc->enp, &limits);
+
+ if ((rc = efx_nic_init(sc->enp)) != 0)
+ return (rc);
+
+ rc = efx_nic_get_vi_pool(sc->enp, &evq_allocated, &rxq_allocated,
+ &txq_allocated);
+ if (rc != 0) {
+ efx_nic_fini(sc->enp);
+ return (rc);
+ }
+
+ KASSERT(txq_allocated >= SFXGE_TXQ_NTYPES,
+ ("txq_allocated < SFXGE_TXQ_NTYPES"));
+
+ sc->evq_max = MIN(evq_allocated, evq_max);
+ sc->evq_max = MIN(rxq_allocated, sc->evq_max);
+ sc->evq_max = MIN(txq_allocated - (SFXGE_TXQ_NTYPES - 1),
+ sc->evq_max);
+
+ KASSERT(sc->evq_max <= evq_max,
+ ("allocated more than maximum requested"));
+
+ /*
+ * NIC is kept initialized in the case of success to be able to
+ * initialize port to find out media types.
+ */
+ return (0);
+}
+
+static int
+sfxge_set_drv_limits(struct sfxge_softc *sc)
+{
+ efx_drv_limits_t limits;
+
+ memset(&limits, 0, sizeof(limits));
+
+ /* Limits are strict since take into account initial estimation */
+ limits.edl_min_evq_count = limits.edl_max_evq_count =
+ sc->intr.n_alloc;
+ limits.edl_min_txq_count = limits.edl_max_txq_count =
+ sc->intr.n_alloc + SFXGE_TXQ_NTYPES - 1;
+ limits.edl_min_rxq_count = limits.edl_max_rxq_count =
+ sc->intr.n_alloc;
+
+ return (efx_nic_set_drv_limits(sc->enp, &limits));
+}
+
+static int
sfxge_start(struct sfxge_softc *sc)
{
int rc;
@@ -107,6 +190,10 @@ sfxge_start(struct sfxge_softc *sc)
goto fail;
}
+ /* Set required resource limits */
+ if ((rc = sfxge_set_drv_limits(sc)) != 0)
+ goto fail;
+
if ((rc = efx_nic_init(sc->enp)) != 0)
goto fail;
@@ -118,16 +205,16 @@ sfxge_start(struct sfxge_softc *sc)
if ((rc = sfxge_ev_start(sc)) != 0)
goto fail3;
+ /* Fire up the port. */
+ if ((rc = sfxge_port_start(sc)) != 0)
+ goto fail4;
+
/* Start the receiver side. */
if ((rc = sfxge_rx_start(sc)) != 0)
- goto fail4;
+ goto fail5;
/* Start the transmitter side. */
if ((rc = sfxge_tx_start(sc)) != 0)
- goto fail5;
-
- /* Fire up the port. */
- if ((rc = sfxge_port_start(sc)) != 0)
goto fail6;
sc->init_state = SFXGE_STARTED;
@@ -139,10 +226,10 @@ sfxge_start(struct sfxge_softc *sc)
return (0);
fail6:
- sfxge_tx_stop(sc);
+ sfxge_rx_stop(sc);
fail5:
- sfxge_rx_stop(sc);
+ sfxge_port_stop(sc);
fail4:
sfxge_ev_stop(sc);
@@ -181,15 +268,15 @@ sfxge_stop(struct sfxge_softc *sc)
sc->init_state = SFXGE_REGISTERED;
- /* Stop the port. */
- sfxge_port_stop(sc);
-
/* Stop the transmitter. */
sfxge_tx_stop(sc);
/* Stop the receiver. */
sfxge_rx_stop(sc);
+ /* Stop the port. */
+ sfxge_port_stop(sc);
+
/* Stop processing events. */
sfxge_ev_stop(sc);
@@ -201,11 +288,73 @@ sfxge_stop(struct sfxge_softc *sc)
sc->ifnet->if_drv_flags &= ~IFF_DRV_RUNNING;
}
+
+static int
+sfxge_vpd_ioctl(struct sfxge_softc *sc, sfxge_ioc_t *ioc)
+{
+ efx_vpd_value_t value;
+ int rc = 0;
+
+ switch (ioc->u.vpd.op) {
+ case SFXGE_VPD_OP_GET_KEYWORD:
+ value.evv_tag = ioc->u.vpd.tag;
+ value.evv_keyword = ioc->u.vpd.keyword;
+ rc = efx_vpd_get(sc->enp, sc->vpd_data, sc->vpd_size, &value);
+ if (rc != 0)
+ break;
+ ioc->u.vpd.len = MIN(ioc->u.vpd.len, value.evv_length);
+ if (ioc->u.vpd.payload != 0) {
+ rc = copyout(value.evv_value, ioc->u.vpd.payload,
+ ioc->u.vpd.len);
+ }
+ break;
+ case SFXGE_VPD_OP_SET_KEYWORD:
+ if (ioc->u.vpd.len > sizeof(value.evv_value))
+ return (EINVAL);
+ value.evv_tag = ioc->u.vpd.tag;
+ value.evv_keyword = ioc->u.vpd.keyword;
+ value.evv_length = ioc->u.vpd.len;
+ rc = copyin(ioc->u.vpd.payload, value.evv_value, value.evv_length);
+ if (rc != 0)
+ break;
+ rc = efx_vpd_set(sc->enp, sc->vpd_data, sc->vpd_size, &value);
+ if (rc != 0)
+ break;
+ rc = efx_vpd_verify(sc->enp, sc->vpd_data, sc->vpd_size);
+ if (rc != 0)
+ break;
+ rc = efx_vpd_write(sc->enp, sc->vpd_data, sc->vpd_size);
+ break;
+ default:
+ rc = EOPNOTSUPP;
+ break;
+ }
+
+ return (rc);
+}
+
+static int
+sfxge_private_ioctl(struct sfxge_softc *sc, sfxge_ioc_t *ioc)
+{
+ switch (ioc->op) {
+ case SFXGE_MCDI_IOC:
+ return (sfxge_mcdi_ioctl(sc, ioc));
+ case SFXGE_NVRAM_IOC:
+ return (sfxge_nvram_ioctl(sc, ioc));
+ case SFXGE_VPD_IOC:
+ return (sfxge_vpd_ioctl(sc, ioc));
+ default:
+ return (EOPNOTSUPP);
+ }
+}
+
+
static int
sfxge_if_ioctl(struct ifnet *ifp, unsigned long command, caddr_t data)
{
struct sfxge_softc *sc;
struct ifreq *ifr;
+ sfxge_ioc_t ioc;
int error;
ifr = (struct ifreq *)data;
@@ -274,7 +423,8 @@ sfxge_if_ioctl(struct ifnet *ifp, unsigned long command, caddr_t data)
* can't (yet) disable.
*/
KASSERT((reqcap & ~ifp->if_capabilities) == 0,
- ("Unsupported capabilities %x requested %x vs %x",
+ ("Unsupported capabilities 0x%x requested 0x%x vs "
+ "supported 0x%x",
reqcap & ~ifp->if_capabilities,
reqcap , ifp->if_capabilities));
if (capchg_mask & SFXGE_CAP_FIXED) {
@@ -337,6 +487,18 @@ sfxge_if_ioctl(struct ifnet *ifp, unsigned long command, caddr_t data)
case SIOCGIFMEDIA:
error = ifmedia_ioctl(ifp, ifr, &sc->media, command);
break;
+ case SIOCGPRIVATE_0:
+ error = priv_check(curthread, PRIV_DRIVER);
+ if (error != 0)
+ break;
+ error = copyin(ifr->ifr_data, &ioc, sizeof(ioc));
+ if (error != 0)
+ return (error);
+ error = sfxge_private_ioctl(sc, &ioc);
+ if (error == 0) {
+ error = copyout(&ioc, ifr->ifr_data, sizeof(ioc));
+ }
+ break;
default:
error = ether_ioctl(ifp, command, data);
}
@@ -382,6 +544,10 @@ sfxge_ifnet_init(struct ifnet *ifp, struct sfxge_softc *sc)
ifp->if_capenable |= IFCAP_LRO;
#endif
+ if (encp->enc_hw_tx_insert_vlan_enabled) {
+ ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING;
+ ifp->if_capenable |= IFCAP_VLAN_HWTAGGING;
+ }
ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO |
CSUM_TCP_IPV6 | CSUM_UDP_IPV6;
@@ -392,6 +558,7 @@ sfxge_ifnet_init(struct ifnet *ifp, struct sfxge_softc *sc)
ifp->if_get_counter = sfxge_get_counter;
+ DBGPRINT(sc->dev, "ifmedia_init");
if ((rc = sfxge_port_ifmedia_init(sc)) != 0)
goto fail;
@@ -475,10 +642,12 @@ sfxge_create(struct sfxge_softc *sc)
(void) pci_enable_busmaster(dev);
/* Initialize DMA mappings. */
+ DBGPRINT(sc->dev, "dma_init...");
if ((error = sfxge_dma_init(sc)) != 0)
goto fail;
/* Map the device registers. */
+ DBGPRINT(sc->dev, "bar_init...");
if ((error = sfxge_bar_init(sc)) != 0)
goto fail;
@@ -486,6 +655,8 @@ sfxge_create(struct sfxge_softc *sc)
&sc->family);
KASSERT(error == 0, ("Family should be filtered by sfxge_probe()"));
+ DBGPRINT(sc->dev, "nic_create...");
+
/* Create the common code nic object. */
SFXGE_EFSYS_LOCK_INIT(&sc->enp_lock,
device_get_nameunit(sc->dev), "nic");
@@ -495,7 +666,8 @@ sfxge_create(struct sfxge_softc *sc)
sc->enp = enp;
if (!ISP2(sfxge_rx_ring_entries) ||
- !(sfxge_rx_ring_entries & EFX_RXQ_NDESCS_MASK)) {
+ (sfxge_rx_ring_entries < EFX_RXQ_MINNDESCS) ||
+ (sfxge_rx_ring_entries > EFX_RXQ_MAXNDESCS)) {
log(LOG_ERR, "%s=%d must be power of 2 from %u to %u",
SFXGE_PARAM_RX_RING, sfxge_rx_ring_entries,
EFX_RXQ_MINNDESCS, EFX_RXQ_MAXNDESCS);
@@ -505,20 +677,23 @@ sfxge_create(struct sfxge_softc *sc)
sc->rxq_entries = sfxge_rx_ring_entries;
if (!ISP2(sfxge_tx_ring_entries) ||
- !(sfxge_tx_ring_entries & EFX_TXQ_NDESCS_MASK)) {
+ (sfxge_tx_ring_entries < EFX_TXQ_MINNDESCS) ||
+ (sfxge_tx_ring_entries > EFX_TXQ_MAXNDESCS(efx_nic_cfg_get(enp)))) {
log(LOG_ERR, "%s=%d must be power of 2 from %u to %u",
SFXGE_PARAM_TX_RING, sfxge_tx_ring_entries,
- EFX_TXQ_MINNDESCS, EFX_TXQ_MAXNDESCS);
+ EFX_TXQ_MINNDESCS, EFX_TXQ_MAXNDESCS(efx_nic_cfg_get(enp)));
error = EINVAL;
goto fail_tx_ring_entries;
}
sc->txq_entries = sfxge_tx_ring_entries;
/* Initialize MCDI to talk to the microcontroller. */
+ DBGPRINT(sc->dev, "mcdi_init...");
if ((error = sfxge_mcdi_init(sc)) != 0)
goto fail4;
/* Probe the NIC and build the configuration data area. */
+ DBGPRINT(sc->dev, "nic_probe...");
if ((error = efx_nic_probe(enp)) != 0)
goto fail5;
@@ -528,50 +703,75 @@ sfxge_create(struct sfxge_softc *sc)
SFXGE_VERSION_STRING, 0,
"Driver version");
+ SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+ SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
+ OID_AUTO, "phy_type", CTLFLAG_RD,
+ NULL, efx_nic_cfg_get(enp)->enc_phy_type,
+ "PHY type");
+
/* Initialize the NVRAM. */
+ DBGPRINT(sc->dev, "nvram_init...");
if ((error = efx_nvram_init(enp)) != 0)
goto fail6;
/* Initialize the VPD. */
+ DBGPRINT(sc->dev, "vpd_init...");
if ((error = efx_vpd_init(enp)) != 0)
goto fail7;
+ efx_mcdi_new_epoch(enp);
+
/* Reset the NIC. */
+ DBGPRINT(sc->dev, "nic_reset...");
if ((error = efx_nic_reset(enp)) != 0)
goto fail8;
/* Initialize buffer table allocation. */
sc->buffer_table_next = 0;
+ /*
+ * Guarantee minimum and estimate maximum number of event queues
+ * to take it into account when MSI-X interrupts are allocated.
+ * It initializes NIC and keeps it initialized on success.
+ */
+ if ((error = sfxge_estimate_rsrc_limits(sc)) != 0)
+ goto fail8;
+
/* Set up interrupts. */
+ DBGPRINT(sc->dev, "intr_init...");
if ((error = sfxge_intr_init(sc)) != 0)
- goto fail8;
+ goto fail9;
/* Initialize event processing state. */
+ DBGPRINT(sc->dev, "ev_init...");
if ((error = sfxge_ev_init(sc)) != 0)
goto fail11;
+ /* Initialize port state. */
+ DBGPRINT(sc->dev, "port_init...");
+ if ((error = sfxge_port_init(sc)) != 0)
+ goto fail12;
+
/* Initialize receive state. */
+ DBGPRINT(sc->dev, "rx_init...");
if ((error = sfxge_rx_init(sc)) != 0)
- goto fail12;
+ goto fail13;
/* Initialize transmit state. */
+ DBGPRINT(sc->dev, "tx_init...");
if ((error = sfxge_tx_init(sc)) != 0)
- goto fail13;
-
- /* Initialize port state. */
- if ((error = sfxge_port_init(sc)) != 0)
goto fail14;
sc->init_state = SFXGE_INITIALIZED;
+ DBGPRINT(sc->dev, "success");
return (0);
fail14:
- sfxge_tx_fini(sc);
+ sfxge_rx_fini(sc);
fail13:
- sfxge_rx_fini(sc);
+ sfxge_port_fini(sc);
fail12:
sfxge_ev_fini(sc);
@@ -579,6 +779,9 @@ fail12:
fail11:
sfxge_intr_fini(sc);
+fail9:
+ efx_nic_fini(sc->enp);
+
fail8:
efx_vpd_fini(enp);
@@ -603,6 +806,7 @@ fail3:
(void) pci_disable_busmaster(sc->dev);
fail:
+ DBGPRINT(sc->dev, "failed %d", error);
sc->dev = NULL;
SFXGE_ADAPTER_LOCK_DESTROY(sc);
return (error);
@@ -613,15 +817,15 @@ sfxge_destroy(struct sfxge_softc *sc)
{
efx_nic_t *enp;
- /* Clean up port state. */
- sfxge_port_fini(sc);
-
/* Clean up transmit state. */
sfxge_tx_fini(sc);
/* Clean up receive state. */
sfxge_rx_fini(sc);
+ /* Clean up port state. */
+ sfxge_port_fini(sc);
+
/* Clean up event processing state. */
sfxge_ev_fini(sc);
@@ -750,6 +954,7 @@ sfxge_reset(void *arg, int npending)
{
struct sfxge_softc *sc;
int rc;
+ unsigned attempt;
(void)npending;
@@ -762,10 +967,15 @@ sfxge_reset(void *arg, int npending)
sfxge_stop(sc);
efx_nic_reset(sc->enp);
- if ((rc = sfxge_start(sc)) != 0)
- device_printf(sc->dev,
- "reset failed (%d); interface is now stopped\n",
- rc);
+ for (attempt = 0; attempt < 3; ++attempt) {
+ if ((rc = sfxge_start(sc)) == 0)
+ goto done;
+
+ device_printf(sc->dev, "start on reset failed (%d)\n", rc);
+ DELAY(100000);
+ }
+
+ device_printf(sc->dev, "reset failed; interface is now stopped\n");
done:
SFXGE_ADAPTER_UNLOCK(sc);
@@ -797,29 +1007,42 @@ sfxge_attach(device_t dev)
sc->ifnet = ifp;
/* Initialize hardware. */
+ DBGPRINT(sc->dev, "create nic");
if ((error = sfxge_create(sc)) != 0)
goto fail2;
/* Create the ifnet for the port. */
+ DBGPRINT(sc->dev, "init ifnet");
if ((error = sfxge_ifnet_init(ifp, sc)) != 0)
goto fail3;
+ DBGPRINT(sc->dev, "init vpd");
if ((error = sfxge_vpd_init(sc)) != 0)
goto fail4;
+ /*
+ * NIC is initialized inside sfxge_create() and kept inialized
+ * to be able to initialize port to discover media types in
+ * sfxge_ifnet_init().
+ */
+ efx_nic_fini(sc->enp);
+
sc->init_state = SFXGE_REGISTERED;
+ DBGPRINT(sc->dev, "success");
return (0);
fail4:
sfxge_ifnet_fini(ifp);
fail3:
+ efx_nic_fini(sc->enp);
sfxge_destroy(sc);
fail2:
if_free(sc->ifnet);
fail:
+ DBGPRINT(sc->dev, "failed %d", error);
return (error);
}
@@ -852,13 +1075,25 @@ sfxge_probe(device_t dev)
pci_vendor_id = pci_get_vendor(dev);
pci_device_id = pci_get_device(dev);
+ DBGPRINT(dev, "PCI ID %04x:%04x", pci_vendor_id, pci_device_id);
rc = efx_family(pci_vendor_id, pci_device_id, &family);
- if (rc != 0)
+ if (rc != 0) {
+ DBGPRINT(dev, "efx_family fail %d", rc);
return (ENXIO);
+ }
- KASSERT(family == EFX_FAMILY_SIENA, ("impossible controller family"));
- device_set_desc(dev, "Solarflare SFC9000 family");
- return (0);
+ if (family == EFX_FAMILY_SIENA) {
+ device_set_desc(dev, "Solarflare SFC9000 family");
+ return (0);
+ }
+
+ if (family == EFX_FAMILY_HUNTINGTON) {
+ device_set_desc(dev, "Solarflare SFC9100 family");
+ return (0);
+ }
+
+ DBGPRINT(dev, "impossible controller family %d", family);
+ return (ENXIO);
}
static device_method_t sfxge_methods[] = {
diff --git a/sys/dev/sfxge/sfxge.h b/sys/dev/sfxge/sfxge.h
index 20a30d0..6e6c0af 100644
--- a/sys/dev/sfxge/sfxge.h
+++ b/sys/dev/sfxge/sfxge.h
@@ -1,30 +1,34 @@
/*-
- * Copyright (c) 2010-2011 Solarflare Communications, Inc.
+ * Copyright (c) 2010-2015 Solarflare Communications Inc.
* All rights reserved.
*
* This software was developed in part by Philip Paeps under contract for
* Solarflare Communications, Inc.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*
* $FreeBSD$
*/
@@ -34,7 +38,6 @@
#include <sys/param.h>
#include <sys/kernel.h>
-#include <sys/condvar.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <sys/sx.h>
@@ -46,6 +49,18 @@
#include <net/if_media.h>
#include <net/if_types.h>
+#include "sfxge_ioc.h"
+
+/*
+ * Debugging
+ */
+#if 0
+#define DBGPRINT(dev, fmt, args...) \
+ device_printf(dev, "%s: " fmt "\n", __func__, ## args)
+#else
+#define DBGPRINT(dev, fmt, args...)
+#endif
+
/*
* Backward-compatibility
*/
@@ -72,6 +87,10 @@
#define IFM_10G_KX4 IFM_10G_CX4
#endif
+#ifndef IFM_40G_CR4
+#define IFM_40G_CR4 IFM_UNKNOWN
+#endif
+
#if (__FreeBSD_version >= 800501 && __FreeBSD_version < 900000) || \
__FreeBSD_version >= 900003
#define SFXGE_HAVE_DESCRIBE_INTR
@@ -161,7 +180,7 @@ enum sfxge_mcdi_state {
struct sfxge_mcdi {
struct mtx lock;
- struct cv cv;
+ efsys_mem_t mem;
enum sfxge_mcdi_state state;
efx_mcdi_transport_t transport;
@@ -191,6 +210,9 @@ struct sfxge_port {
struct sfxge_hw_stats phy_stats;
struct sfxge_hw_stats mac_stats;
efx_link_mode_t link_mode;
+ uint8_t mcast_addrs[EFX_MAC_MULTICAST_LIST_MAX *
+ EFX_MAC_ADDR_LEN];
+ unsigned int mcast_count;
/* Only used in debugging output */
char lock_name[SFXGE_LOCK_NAME_MAX];
@@ -250,11 +272,15 @@ struct sfxge_softc {
size_t rx_prefix_size;
size_t rx_buffer_size;
+ size_t rx_buffer_align;
uma_zone_t rx_buffer_zone;
+ unsigned int evq_max;
unsigned int evq_count;
unsigned int rxq_count;
unsigned int txq_count;
+
+ int tso_fw_assisted;
};
#define SFXGE_LINK_UP(sc) ((sc)->port.link_mode != EFX_LINK_DOWN)
@@ -277,10 +303,12 @@ extern void sfxge_sram_buf_tbl_alloc(struct sfxge_softc *sc, size_t n,
extern int sfxge_dma_init(struct sfxge_softc *sc);
extern void sfxge_dma_fini(struct sfxge_softc *sc);
extern int sfxge_dma_alloc(struct sfxge_softc *sc, bus_size_t len,
- efsys_mem_t *esmp);
+ efsys_mem_t *esmp);
extern void sfxge_dma_free(efsys_mem_t *esmp);
extern int sfxge_dma_map_sg_collapse(bus_dma_tag_t tag, bus_dmamap_t map,
- struct mbuf **mp, bus_dma_segment_t *segs, int *nsegs, int maxsegs);
+ struct mbuf **mp,
+ bus_dma_segment_t *segs,
+ int *nsegs, int maxsegs);
/*
* From sfxge_ev.c.
@@ -304,6 +332,12 @@ extern void sfxge_intr_stop(struct sfxge_softc *sc);
*/
extern int sfxge_mcdi_init(struct sfxge_softc *sc);
extern void sfxge_mcdi_fini(struct sfxge_softc *sc);
+extern int sfxge_mcdi_ioctl(struct sfxge_softc *sc, sfxge_ioc_t *ip);
+
+/*
+ * From sfxge_nvram.c.
+ */
+extern int sfxge_nvram_ioctl(struct sfxge_softc *sc, sfxge_ioc_t *ip);
/*
* From sfxge_port.c.
@@ -313,7 +347,7 @@ extern void sfxge_port_fini(struct sfxge_softc *sc);
extern int sfxge_port_start(struct sfxge_softc *sc);
extern void sfxge_port_stop(struct sfxge_softc *sc);
extern void sfxge_mac_link_update(struct sfxge_softc *sc,
- efx_link_mode_t mode);
+ efx_link_mode_t mode);
extern int sfxge_mac_filter_set(struct sfxge_softc *sc);
extern int sfxge_port_ifmedia_init(struct sfxge_softc *sc);
extern uint64_t sfxge_get_counter(struct ifnet *ifp, ift_counter c);
diff --git a/sys/dev/sfxge/sfxge_dma.c b/sys/dev/sfxge/sfxge_dma.c
index d1831ac..b4347c0 100644
--- a/sys/dev/sfxge/sfxge_dma.c
+++ b/sys/dev/sfxge/sfxge_dma.c
@@ -1,30 +1,34 @@
/*-
- * Copyright (c) 2010-2011 Solarflare Communications, Inc.
+ * Copyright (c) 2010-2015 Solarflare Communications Inc.
* All rights reserved.
*
* This software was developed in part by Philip Paeps under contract for
* Solarflare Communications, Inc.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -60,7 +64,8 @@ sfxge_dma_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error)
int
sfxge_dma_map_sg_collapse(bus_dma_tag_t tag, bus_dmamap_t map,
- struct mbuf **mp, bus_dma_segment_t *segs, int *nsegs, int maxsegs)
+ struct mbuf **mp, bus_dma_segment_t *segs,
+ int *nsegs, int maxsegs)
{
bus_dma_segment_t *psegs;
struct mbuf *m;
diff --git a/sys/dev/sfxge/sfxge_ev.c b/sys/dev/sfxge/sfxge_ev.c
index 83bdf26..4536e0a 100644
--- a/sys/dev/sfxge/sfxge_ev.c
+++ b/sys/dev/sfxge/sfxge_ev.c
@@ -1,30 +1,34 @@
/*-
- * Copyright (c) 2010-2011 Solarflare Communications, Inc.
+ * Copyright (c) 2010-2015 Solarflare Communications Inc.
* All rights reserved.
*
* This software was developed in part by Philip Paeps under contract for
* Solarflare Communications, Inc.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -82,12 +86,13 @@ sfxge_ev_qcomplete(struct sfxge_evq *evq, boolean_t eop)
static boolean_t
sfxge_ev_rx(void *arg, uint32_t label, uint32_t id, uint32_t size,
- uint16_t flags)
+ uint16_t flags)
{
struct sfxge_evq *evq;
struct sfxge_softc *sc;
struct sfxge_rxq *rxq;
- unsigned int expected;
+ unsigned int stop;
+ unsigned int delta;
struct sfxge_rx_sw_desc *rx_desc;
evq = arg;
@@ -106,28 +111,40 @@ sfxge_ev_rx(void *arg, uint32_t label, uint32_t id, uint32_t size,
if (__predict_false(rxq->init_state != SFXGE_RXQ_STARTED))
goto done;
- expected = rxq->pending++ & rxq->ptr_mask;
- if (id != expected) {
- evq->exception = B_TRUE;
+ stop = (id + 1) & rxq->ptr_mask;
+ id = rxq->pending & rxq->ptr_mask;
+ delta = (stop >= id) ? (stop - id) : (rxq->entries - id + stop);
+ rxq->pending += delta;
- device_printf(sc->dev, "RX completion out of order"
- " (id=%#x expected=%#x flags=%#x); resetting\n",
- id, expected, flags);
- sfxge_schedule_reset(sc);
+ if (delta != 1) {
+ if ((!efx_nic_cfg_get(sc->enp)->enc_rx_batching_enabled) ||
+ (delta <= 0) ||
+ (delta > efx_nic_cfg_get(sc->enp)->enc_rx_batch_max)) {
+ evq->exception = B_TRUE;
- goto done;
+ device_printf(sc->dev, "RX completion out of order"
+ " (id=%#x delta=%u flags=%#x); resetting\n",
+ id, delta, flags);
+ sfxge_schedule_reset(sc);
+
+ goto done;
+ }
}
rx_desc = &rxq->queue[id];
- KASSERT(rx_desc->flags == EFX_DISCARD,
- ("rx_desc->flags != EFX_DISCARD"));
- rx_desc->flags = flags;
-
- KASSERT(size < (1 << 16), ("size > (1 << 16)"));
- rx_desc->size = (uint16_t)size;
prefetch_read_many(rx_desc->mbuf);
+ for (; id != stop; id = (id + 1) & rxq->ptr_mask) {
+ rx_desc = &rxq->queue[id];
+ KASSERT(rx_desc->flags == EFX_DISCARD,
+ ("rx_desc->flags != EFX_DISCARD"));
+ rx_desc->flags = flags;
+
+ KASSERT(size < (1 << 16), ("size > (1 << 16)"));
+ rx_desc->size = (uint16_t)size;
+ }
+
evq->rx_done++;
if (rxq->pending - rxq->completed >= SFXGE_RX_BATCH)
@@ -148,6 +165,18 @@ sfxge_ev_exception(void *arg, uint32_t code, uint32_t data)
sc = evq->sc;
+ DBGPRINT(sc->dev, "[%d] %s", evq->index,
+ (code == EFX_EXCEPTION_RX_RECOVERY) ? "RX_RECOVERY" :
+ (code == EFX_EXCEPTION_RX_DSC_ERROR) ? "RX_DSC_ERROR" :
+ (code == EFX_EXCEPTION_TX_DSC_ERROR) ? "TX_DSC_ERROR" :
+ (code == EFX_EXCEPTION_UNKNOWN_SENSOREVT) ? "UNKNOWN_SENSOREVT" :
+ (code == EFX_EXCEPTION_FWALERT_SRAM) ? "FWALERT_SRAM" :
+ (code == EFX_EXCEPTION_UNKNOWN_FWALERT) ? "UNKNOWN_FWALERT" :
+ (code == EFX_EXCEPTION_RX_ERROR) ? "RX_ERROR" :
+ (code == EFX_EXCEPTION_TX_ERROR) ? "TX_ERROR" :
+ (code == EFX_EXCEPTION_EV_ERROR) ? "EV_ERROR" :
+ "UNKNOWN");
+
evq->exception = B_TRUE;
if (code != EFX_EXCEPTION_UNKNOWN_SENSOREVT) {
@@ -180,6 +209,11 @@ sfxge_ev_rxq_flush_done(void *arg, uint32_t rxq_index)
/* Resend a software event on the correct queue */
index = rxq->index;
+ if (index == evq->index) {
+ sfxge_rx_qflush_done(rxq);
+ return (B_FALSE);
+ }
+
evq = sc->evq[index];
label = rxq_index;
@@ -299,6 +333,11 @@ sfxge_ev_txq_flush_done(void *arg, uint32_t txq_index)
KASSERT(txq->init_state == SFXGE_TXQ_INITIALIZED,
("txq not initialized"));
+ if (txq->evq_index == evq->index) {
+ sfxge_tx_qflush_done(txq);
+ return (B_FALSE);
+ }
+
/* Resend a software event on the correct queue */
evq = sc->evq[txq->evq_index];
@@ -551,7 +590,9 @@ sfxge_ev_initialized(void *arg)
evq = (struct sfxge_evq *)arg;
SFXGE_EVQ_LOCK_ASSERT_OWNED(evq);
- KASSERT(evq->init_state == SFXGE_EVQ_STARTING,
+ /* Init done events may be duplicated on 7xxx */
+ KASSERT(evq->init_state == SFXGE_EVQ_STARTING ||
+ evq->init_state == SFXGE_EVQ_STARTED,
("evq not starting"));
evq->init_state = SFXGE_EVQ_STARTED;
diff --git a/sys/dev/sfxge/sfxge_intr.c b/sys/dev/sfxge/sfxge_intr.c
index 240a33f..09538cc 100644
--- a/sys/dev/sfxge/sfxge_intr.c
+++ b/sys/dev/sfxge/sfxge_intr.c
@@ -1,30 +1,34 @@
/*-
- * Copyright (c) 2010-2011 Solarflare Communications, Inc.
+ * Copyright (c) 2010-2015 Solarflare Communications Inc.
* All rights reserved.
*
* This software was developed in part by Philip Paeps under contract for
* Solarflare Communications, Inc.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -36,7 +40,6 @@ __FBSDID("$FreeBSD$");
#include <sys/malloc.h>
#include <sys/queue.h>
#include <sys/rman.h>
-#include <sys/smp.h>
#include <sys/syslog.h>
#include <sys/taskqueue.h>
@@ -294,16 +297,9 @@ sfxge_intr_setup_msix(struct sfxge_softc *sc)
if (count == 0)
return (EINVAL);
- /* Limit the number of interrupts to the number of CPUs. */
- if (count > mp_ncpus)
- count = mp_ncpus;
-
- /* Not very likely these days... */
- if (count > EFX_MAXRSS)
- count = EFX_MAXRSS;
-
- if (sc->max_rss_channels > 0 && count > sc->max_rss_channels)
- count = sc->max_rss_channels;
+ /* Do not try to allocate more than already estimated EVQ maximum */
+ KASSERT(sc->evq_max > 0, ("evq_max is zero"));
+ count = MIN(count, sc->evq_max);
rid = PCIR_BAR(4);
resp = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
@@ -412,7 +408,7 @@ static const char *const __sfxge_err[] = {
void
sfxge_err(efsys_identifier_t *arg, unsigned int code, uint32_t dword0,
- uint32_t dword1)
+ uint32_t dword1)
{
struct sfxge_softc *sc = (struct sfxge_softc *)arg;
device_t dev = sc->dev;
diff --git a/sys/dev/sfxge/sfxge_ioc.h b/sys/dev/sfxge/sfxge_ioc.h
new file mode 100644
index 0000000..bf079c8
--- /dev/null
+++ b/sys/dev/sfxge/sfxge_ioc.h
@@ -0,0 +1,112 @@
+/*-
+ * Copyright (c) 2014-2015 Solarflare Communications Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _SYS_SFXGE_IOC_H
+#define _SYS_SFXGE_IOC_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <sys/types.h>
+
+/* More codes may be added if necessary */
+enum sfxge_ioc_codes {
+ SFXGE_MCDI_IOC,
+ SFXGE_NVRAM_IOC,
+ SFXGE_VPD_IOC
+};
+
+enum sfxge_nvram_ops {
+ SFXGE_NVRAM_OP_SIZE,
+ SFXGE_NVRAM_OP_READ,
+ SFXGE_NVRAM_OP_WRITE,
+ SFXGE_NVRAM_OP_ERASE,
+ SFXGE_NVRAM_OP_GET_VER,
+ SFXGE_NVRAM_OP_SET_VER
+};
+
+enum sfxge_nvram_types {
+ SFXGE_NVRAM_TYPE_BOOTROM,
+ SFXGE_NVRAM_TYPE_BOOTROM_CFG,
+ SFXGE_NVRAM_TYPE_MC,
+ SFXGE_NVRAM_TYPE_MC_GOLDEN,
+ SFXGE_NVRAM_TYPE_PHY,
+ SFXGE_NVRAM_TYPE_NULL_PHY,
+ SFXGE_NVRAM_TYPE_FPGA,
+ SFXGE_NVRAM_TYPE_FCFW,
+ SFXGE_NVRAM_TYPE_CPLD,
+ SFXGE_NVRAM_TYPE_FPGA_BACKUP,
+ SFXGE_NVRAM_TYPE_DYNAMIC_CFG
+};
+
+enum sfxge_vpd_ops {
+ SFXGE_VPD_OP_GET_KEYWORD,
+ SFXGE_VPD_OP_SET_KEYWORD
+};
+
+#define SFXGE_MCDI_MAX_PAYLOAD 0x400
+#define SFXGE_VPD_MAX_PAYLOAD 0x100
+
+typedef struct sfxge_ioc_s {
+ uint32_t op;
+ union {
+ struct {
+ caddr_t payload;
+ uint32_t cmd;
+ size_t len; /* In and out */
+ uint32_t rc;
+ } mcdi;
+ struct {
+ uint32_t op;
+ uint32_t type;
+ uint32_t offset;
+ uint32_t size;
+ uint32_t subtype;
+ uint16_t version[4]; /* get/set_ver */
+ caddr_t data;
+ } nvram;
+ struct {
+ uint8_t op;
+ uint8_t tag;
+ uint16_t keyword;
+ uint16_t len; /* In or out */
+ caddr_t payload;
+ } vpd;
+ } u;
+} __packed sfxge_ioc_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SYS_SFXGE_IOC_H */
diff --git a/sys/dev/sfxge/sfxge_mcdi.c b/sys/dev/sfxge/sfxge_mcdi.c
index a1bc857..fb9f650 100644
--- a/sys/dev/sfxge/sfxge_mcdi.c
+++ b/sys/dev/sfxge/sfxge_mcdi.c
@@ -1,30 +1,34 @@
/*-
- * Copyright (c) 2010-2011 Solarflare Communications, Inc.
+ * Copyright (c) 2010-2015 Solarflare Communications Inc.
* All rights reserved.
*
* This software was developed in part by Philip Paeps under contract for
* Solarflare Communications, Inc.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -37,6 +41,7 @@ __FBSDID("$FreeBSD$");
#include <sys/proc.h>
#include <sys/syslog.h>
#include <sys/taskqueue.h>
+#include <sys/malloc.h>
#include "common/efx.h"
#include "common/efx_mcdi.h"
@@ -48,36 +53,6 @@ __FBSDID("$FreeBSD$");
#define SFXGE_MCDI_POLL_INTERVAL_MAX 100000 /* 100ms in 1us units */
#define SFXGE_MCDI_WATCHDOG_INTERVAL 10000000 /* 10s in 1us units */
-/* Acquire exclusive access to MCDI for the duration of a request. */
-static void
-sfxge_mcdi_acquire(struct sfxge_mcdi *mcdi)
-{
- SFXGE_MCDI_LOCK(mcdi);
- KASSERT(mcdi->state != SFXGE_MCDI_UNINITIALIZED,
- ("MCDI not initialized"));
-
- while (mcdi->state != SFXGE_MCDI_INITIALIZED)
- (void)cv_wait_sig(&mcdi->cv, &mcdi->lock);
- mcdi->state = SFXGE_MCDI_BUSY;
-
- SFXGE_MCDI_UNLOCK(mcdi);
-}
-
-/* Release ownership of MCDI on request completion. */
-static void
-sfxge_mcdi_release(struct sfxge_mcdi *mcdi)
-{
- SFXGE_MCDI_LOCK(mcdi);
- KASSERT((mcdi->state == SFXGE_MCDI_BUSY ||
- mcdi->state == SFXGE_MCDI_COMPLETED),
- ("MCDI not busy or task not completed"));
-
- mcdi->state = SFXGE_MCDI_INITIALIZED;
- cv_broadcast(&mcdi->cv);
-
- SFXGE_MCDI_UNLOCK(mcdi);
-}
-
static void
sfxge_mcdi_timeout(struct sfxge_softc *sc)
{
@@ -140,13 +115,16 @@ sfxge_mcdi_execute(void *arg, efx_mcdi_req_t *emrp)
sc = (struct sfxge_softc *)arg;
mcdi = &sc->mcdi;
- sfxge_mcdi_acquire(mcdi);
+ SFXGE_MCDI_LOCK(mcdi);
+
+ KASSERT(mcdi->state == SFXGE_MCDI_INITIALIZED,
+ ("MCDI not initialized"));
/* Issue request and poll for completion. */
efx_mcdi_request_start(sc->enp, emrp, B_FALSE);
sfxge_mcdi_poll(sc);
- sfxge_mcdi_release(mcdi);
+ SFXGE_MCDI_UNLOCK(mcdi);
}
static void
@@ -158,11 +136,10 @@ sfxge_mcdi_ev_cpl(void *arg)
sc = (struct sfxge_softc *)arg;
mcdi = &sc->mcdi;
- SFXGE_MCDI_LOCK(mcdi);
- KASSERT(mcdi->state == SFXGE_MCDI_BUSY, ("MCDI not busy"));
- mcdi->state = SFXGE_MCDI_COMPLETED;
- cv_broadcast(&mcdi->cv);
- SFXGE_MCDI_UNLOCK(mcdi);
+ KASSERT(mcdi->state == SFXGE_MCDI_INITIALIZED,
+ ("MCDI not initialized"));
+
+ /* We do not use MCDI completion, MCDI is simply polled */
}
static void
@@ -187,16 +164,95 @@ sfxge_mcdi_exception(void *arg, efx_mcdi_exception_t eme)
}
int
+sfxge_mcdi_ioctl(struct sfxge_softc *sc, sfxge_ioc_t *ip)
+{
+ const efx_nic_cfg_t *encp = efx_nic_cfg_get(sc->enp);
+ struct sfxge_mcdi *mp = &(sc->mcdi);
+ efx_mcdi_req_t emr;
+ uint8_t *mcdibuf;
+ int rc;
+
+ if (mp->state == SFXGE_MCDI_UNINITIALIZED) {
+ rc = ENODEV;
+ goto fail1;
+ }
+
+ if (!(encp->enc_features & EFX_FEATURE_MCDI)) {
+ rc = ENOTSUP;
+ goto fail2;
+ }
+
+ if (ip->u.mcdi.len > SFXGE_MCDI_MAX_PAYLOAD) {
+ rc = EINVAL;
+ goto fail3;
+ }
+
+ mcdibuf = malloc(SFXGE_MCDI_MAX_PAYLOAD, M_TEMP, M_WAITOK | M_ZERO);
+ if (mcdibuf == NULL) {
+ rc = ENOMEM;
+ goto fail4;
+ }
+ if ((rc = copyin(ip->u.mcdi.payload, mcdibuf, ip->u.mcdi.len)) != 0) {
+ goto fail5;
+ }
+
+ emr.emr_cmd = ip->u.mcdi.cmd;
+ emr.emr_in_buf = mcdibuf;
+ emr.emr_in_length = ip->u.mcdi.len;
+
+ emr.emr_out_buf = mcdibuf;
+ emr.emr_out_length = SFXGE_MCDI_MAX_PAYLOAD;
+
+ sfxge_mcdi_execute(sc, &emr);
+
+ ip->u.mcdi.rc = emr.emr_rc;
+ ip->u.mcdi.cmd = emr.emr_cmd;
+ ip->u.mcdi.len = emr.emr_out_length_used;
+ if ((rc = copyout(mcdibuf, ip->u.mcdi.payload, ip->u.mcdi.len)) != 0) {
+ goto fail6;
+ }
+
+ /*
+ * Helpfully trigger a device reset in response to an MCDI_CMD_REBOOT
+ * Both ports will see ->emt_exception callbacks on the next MCDI poll
+ */
+ if (ip->u.mcdi.cmd == MC_CMD_REBOOT) {
+
+ EFSYS_PROBE(mcdi_ioctl_mc_reboot);
+ /* sfxge_t->s_state_lock held */
+ (void) sfxge_schedule_reset(sc);
+ }
+
+ free(mcdibuf, M_TEMP);
+
+ return (0);
+
+fail6:
+fail5:
+ free(mcdibuf, M_TEMP);
+fail4:
+fail3:
+fail2:
+fail1:
+ return (rc);
+}
+
+
+int
sfxge_mcdi_init(struct sfxge_softc *sc)
{
efx_nic_t *enp;
struct sfxge_mcdi *mcdi;
efx_mcdi_transport_t *emtp;
+ efsys_mem_t *esmp;
+ int max_msg_size;
int rc;
enp = sc->enp;
mcdi = &sc->mcdi;
emtp = &mcdi->transport;
+ esmp = &mcdi->mem;
+ max_msg_size = sizeof (uint32_t) + MCDI_CTL_SDU_LEN_MAX_V2;
KASSERT(mcdi->state == SFXGE_MCDI_UNINITIALIZED,
("MCDI already initialized"));
@@ -205,13 +261,15 @@ sfxge_mcdi_init(struct sfxge_softc *sc)
mcdi->state = SFXGE_MCDI_INITIALIZED;
+ if ((rc = sfxge_dma_alloc(sc, max_msg_size, esmp)) != 0)
+ goto fail;
+
emtp->emt_context = sc;
+ emtp->emt_dma_mem = esmp;
emtp->emt_execute = sfxge_mcdi_execute;
emtp->emt_ev_cpl = sfxge_mcdi_ev_cpl;
emtp->emt_exception = sfxge_mcdi_exception;
- cv_init(&mcdi->cv, "sfxge_mcdi");
-
if ((rc = efx_mcdi_init(enp, emtp)) != 0)
goto fail;
@@ -229,10 +287,12 @@ sfxge_mcdi_fini(struct sfxge_softc *sc)
struct sfxge_mcdi *mcdi;
efx_nic_t *enp;
efx_mcdi_transport_t *emtp;
+ efsys_mem_t *esmp;
enp = sc->enp;
mcdi = &sc->mcdi;
emtp = &mcdi->transport;
+ esmp = &mcdi->mem;
SFXGE_MCDI_LOCK(mcdi);
KASSERT(mcdi->state == SFXGE_MCDI_INITIALIZED,
@@ -241,8 +301,9 @@ sfxge_mcdi_fini(struct sfxge_softc *sc)
efx_mcdi_fini(enp);
bzero(emtp, sizeof(*emtp));
- cv_destroy(&mcdi->cv);
SFXGE_MCDI_UNLOCK(mcdi);
+ sfxge_dma_free(esmp);
+
SFXGE_MCDI_LOCK_DESTROY(mcdi);
}
diff --git a/sys/dev/sfxge/sfxge_nvram.c b/sys/dev/sfxge/sfxge_nvram.c
new file mode 100644
index 0000000..c4fa224
--- /dev/null
+++ b/sys/dev/sfxge/sfxge_nvram.c
@@ -0,0 +1,203 @@
+/*-
+ * Copyright (c) 2010-2015 Solarflare Communications, Inc.
+ * All rights reserved.
+ *
+ * This software was developed in part by OKTET Labs Ltd. under contract for
+ * Solarflare Communications, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+
+#include <sys/types.h>
+#include <sys/malloc.h>
+
+#include "common/efx.h"
+#include "sfxge.h"
+
+/* These data make no real sense, they are here just to make sfupdate happy.
+ * Any code that would rely on it is broken.
+ */
+static const uint8_t fake_dynamic_cfg_nvram[] = {
+ 0x7a, 0xda, 0x10, 0xef, 0x0c, 0x00, 0x00, 0x00,
+ 0x00, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x10,
+ 0x08, 0x00, 0x00, 0x00, 0x90, 0x04, 0x00, 0x52,
+ 0x56, 0x01, 0xc3, 0x78, 0x01, 0x00, 0x03, 0x10,
+ 0x08, 0x00, 0x00, 0x00, 0x90, 0x04, 0x00, 0x52,
+ 0x56, 0x01, 0xc3, 0x78, 0x57, 0x1a, 0x10, 0xef,
+ 0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x02, 0x0b, 0x64, 0x7d, 0xee, 0xee, 0xee, 0xee
+};
+
+static int
+sfxge_nvram_rw(struct sfxge_softc *sc, sfxge_ioc_t *ip, efx_nvram_type_t type,
+ boolean_t write)
+{
+ efx_nic_t *enp = sc->enp;
+ size_t total_size = ip->u.nvram.size;
+ size_t chunk_size;
+ off_t off;
+ int rc = 0;
+ uint8_t *buf;
+
+ if (type == EFX_NVRAM_DYNAMIC_CFG && sc->family == EFX_FAMILY_SIENA) {
+ if (write)
+ return (0);
+ rc = copyout(fake_dynamic_cfg_nvram, ip->u.nvram.data,
+ MIN(total_size, sizeof(fake_dynamic_cfg_nvram)));
+ return (rc);
+ }
+
+ if ((rc = efx_nvram_rw_start(enp, type, &chunk_size)) != 0)
+ goto fail1;
+
+ buf = malloc(chunk_size, M_TEMP, M_WAITOK);
+ if (buf == NULL) {
+ rc = ENOMEM;
+ goto fail2;
+ }
+
+ off = 0;
+ while (total_size) {
+ size_t len = MIN(chunk_size, total_size);
+
+ if (write) {
+ rc = copyin(ip->u.nvram.data + off, buf, len);
+ if (rc != 0)
+ goto fail3;
+ rc = efx_nvram_write_chunk(enp, type,
+ ip->u.nvram.offset + off, buf, len);
+ if (rc != 0)
+ goto fail3;
+ } else {
+ rc = efx_nvram_read_chunk(enp, type,
+ ip->u.nvram.offset + off, buf, len);
+ if (rc != 0)
+ goto fail3;
+ rc = copyout(buf, ip->u.nvram.data + off, len);
+ if (rc != 0)
+ goto fail3;
+ }
+
+ total_size -= len;
+ off += len;
+ }
+
+fail3:
+ free(buf, M_TEMP);
+fail2:
+ efx_nvram_rw_finish(enp, type);
+fail1:
+ return (rc);
+}
+
+
+static int
+sfxge_nvram_erase(struct sfxge_softc *sc, efx_nvram_type_t type)
+{
+ efx_nic_t *enp = sc->enp;
+ size_t chunk_size;
+ int rc = 0;
+
+ if (type == EFX_NVRAM_DYNAMIC_CFG && sc->family == EFX_FAMILY_SIENA)
+ return (0);
+
+ if ((rc = efx_nvram_rw_start(enp, type, &chunk_size)) != 0)
+ return (rc);
+
+ rc = efx_nvram_erase(enp, type);
+
+ efx_nvram_rw_finish(enp, type);
+ return (rc);
+}
+
+int
+sfxge_nvram_ioctl(struct sfxge_softc *sc, sfxge_ioc_t *ip)
+{
+ static const efx_nvram_type_t nvram_types[] = {
+ [SFXGE_NVRAM_TYPE_BOOTROM] = EFX_NVRAM_BOOTROM,
+ [SFXGE_NVRAM_TYPE_BOOTROM_CFG] = EFX_NVRAM_BOOTROM_CFG,
+ [SFXGE_NVRAM_TYPE_MC] = EFX_NVRAM_MC_FIRMWARE,
+ [SFXGE_NVRAM_TYPE_MC_GOLDEN] = EFX_NVRAM_MC_GOLDEN,
+ [SFXGE_NVRAM_TYPE_PHY] = EFX_NVRAM_PHY,
+ [SFXGE_NVRAM_TYPE_NULL_PHY] = EFX_NVRAM_NULLPHY,
+ [SFXGE_NVRAM_TYPE_FPGA] = EFX_NVRAM_FPGA,
+ [SFXGE_NVRAM_TYPE_FCFW] = EFX_NVRAM_FCFW,
+ [SFXGE_NVRAM_TYPE_CPLD] = EFX_NVRAM_CPLD,
+ [SFXGE_NVRAM_TYPE_FPGA_BACKUP] = EFX_NVRAM_FPGA_BACKUP,
+ [SFXGE_NVRAM_TYPE_DYNAMIC_CFG] = EFX_NVRAM_DYNAMIC_CFG,
+ };
+
+ efx_nic_t *enp = sc->enp;
+ efx_nvram_type_t type;
+ int rc = 0;
+
+ if (ip->u.nvram.type > SFXGE_NVRAM_TYPE_DYNAMIC_CFG)
+ return (EINVAL);
+ type = nvram_types[ip->u.nvram.type];
+ if (type == EFX_NVRAM_MC_GOLDEN &&
+ (ip->u.nvram.op == SFXGE_NVRAM_OP_WRITE ||
+ ip->u.nvram.op == SFXGE_NVRAM_OP_ERASE ||
+ ip->u.nvram.op == SFXGE_NVRAM_OP_SET_VER))
+ return (EOPNOTSUPP);
+
+ switch (ip->u.nvram.op) {
+ case SFXGE_NVRAM_OP_SIZE:
+ {
+ size_t size;
+
+ if (type == EFX_NVRAM_DYNAMIC_CFG && sc->family == EFX_FAMILY_SIENA) {
+ ip->u.nvram.size = sizeof(fake_dynamic_cfg_nvram);
+ } else {
+ if ((rc = efx_nvram_size(enp, type, &size)) != 0)
+ return (rc);
+ ip->u.nvram.size = size;
+ }
+ break;
+ }
+ case SFXGE_NVRAM_OP_READ:
+ rc = sfxge_nvram_rw(sc, ip, type, B_FALSE);
+ break;
+ case SFXGE_NVRAM_OP_WRITE:
+ rc = sfxge_nvram_rw(sc, ip, type, B_TRUE);
+ break;
+ case SFXGE_NVRAM_OP_ERASE:
+ rc = sfxge_nvram_erase(sc, type);
+ break;
+ case SFXGE_NVRAM_OP_GET_VER:
+ rc = efx_nvram_get_version(enp, type, &ip->u.nvram.subtype,
+ &ip->u.nvram.version[0]);
+ break;
+ case SFXGE_NVRAM_OP_SET_VER:
+ rc = efx_nvram_set_version(enp, type, &ip->u.nvram.version[0]);
+ break;
+ default:
+ rc = EOPNOTSUPP;
+ break;
+ }
+
+ return (rc);
+}
diff --git a/sys/dev/sfxge/sfxge_port.c b/sys/dev/sfxge/sfxge_port.c
index baddb8d..412f477 100644
--- a/sys/dev/sfxge/sfxge_port.c
+++ b/sys/dev/sfxge/sfxge_port.c
@@ -1,30 +1,34 @@
/*-
- * Copyright (c) 2010-2011 Solarflare Communications, Inc.
+ * Copyright (c) 2010-2015 Solarflare Communications Inc.
* All rights reserved.
*
* This software was developed in part by Philip Paeps under contract for
* Solarflare Communications, Inc.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -70,10 +74,6 @@ sfxge_mac_stat_update(struct sfxge_softc *sc)
for (count = 0; count < 100; ++count) {
EFSYS_PROBE1(wait, unsigned int, count);
- /* Synchronize the DMA memory for reading */
- bus_dmamap_sync(esmp->esm_tag, esmp->esm_map,
- BUS_DMASYNC_POSTREAD);
-
/* Try to update the cached counters */
if ((rc = efx_mac_stats_update(sc->enp, esmp,
port->mac_stats.decode_buf, NULL)) != EAGAIN)
@@ -294,6 +294,7 @@ static const uint64_t sfxge_link_baudrate[EFX_LINK_NMODES] = {
[EFX_LINK_1000HDX] = IF_Gbps(1),
[EFX_LINK_1000FDX] = IF_Gbps(1),
[EFX_LINK_10000FDX] = IF_Gbps(10),
+ [EFX_LINK_40000FDX] = IF_Gbps(40),
};
void
@@ -342,42 +343,68 @@ done:
}
static int
-sfxge_mac_filter_set_locked(struct sfxge_softc *sc)
+sfxge_mac_multicast_list_set(struct sfxge_softc *sc)
{
- unsigned int bucket[EFX_MAC_HASH_BITS];
struct ifnet *ifp = sc->ifnet;
+ struct sfxge_port *port = &sc->port;
+ uint8_t *mcast_addr = port->mcast_addrs;
struct ifmultiaddr *ifma;
struct sockaddr_dl *sa;
- efx_nic_t *enp = sc->enp;
- unsigned int index;
- int rc;
-
- /* Set promisc-unicast and broadcast filter bits */
- if ((rc = efx_mac_filter_set(enp, !!(ifp->if_flags & IFF_PROMISC),
- B_TRUE)) != 0)
- return (rc);
-
- /* Set multicast hash filter */
- if (ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) {
- for (index = 0; index < EFX_MAC_HASH_BITS; index++)
- bucket[index] = 1;
- } else {
- /* Broadcast frames also go through the multicast
- * filter, and the broadcast address hashes to
- * 0xff. */
- bucket[0xff] = 1;
-
- if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
- if (ifma->ifma_addr->sa_family == AF_LINK) {
- sa = (struct sockaddr_dl *)ifma->ifma_addr;
- index = ether_crc32_le(LLADDR(sa), 6) & 0xff;
- bucket[index] = 1;
+ int rc = 0;
+
+ mtx_assert(&port->lock, MA_OWNED);
+
+ port->mcast_count = 0;
+ if_maddr_rlock(ifp);
+ TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ if (ifma->ifma_addr->sa_family == AF_LINK) {
+ if (port->mcast_count == EFX_MAC_MULTICAST_LIST_MAX) {
+ device_printf(sc->dev,
+ "Too many multicast addresses\n");
+ rc = EINVAL;
+ break;
}
+
+ sa = (struct sockaddr_dl *)ifma->ifma_addr;
+ memcpy(mcast_addr, LLADDR(sa), EFX_MAC_ADDR_LEN);
+ mcast_addr += EFX_MAC_ADDR_LEN;
+ ++port->mcast_count;
}
- if_maddr_runlock(ifp);
}
- return (efx_mac_hash_set(enp, bucket));
+ if_maddr_runlock(ifp);
+
+ if (rc == 0) {
+ rc = efx_mac_multicast_list_set(sc->enp, port->mcast_addrs,
+ port->mcast_count);
+ if (rc != 0)
+ device_printf(sc->dev,
+ "Cannot set multicast address list\n");
+ }
+
+ return (rc);
+}
+
+static int
+sfxge_mac_filter_set_locked(struct sfxge_softc *sc)
+{
+ struct ifnet *ifp = sc->ifnet;
+ struct sfxge_port *port = &sc->port;
+ boolean_t all_mulcst;
+ int rc;
+
+ mtx_assert(&port->lock, MA_OWNED);
+
+ all_mulcst = !!(ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI));
+
+ rc = sfxge_mac_multicast_list_set(sc);
+ /* Fallback to all multicast if cannot set multicast list */
+ if (rc != 0)
+ all_mulcst = B_TRUE;
+
+ rc = efx_mac_filter_set(sc->enp, !!(ifp->if_flags & IFF_PROMISC),
+ (port->mcast_count > 0), all_mulcst, B_TRUE);
+
+ return (rc);
}
int
@@ -431,7 +458,9 @@ sfxge_port_stop(struct sfxge_softc *sc)
port->link_mode = EFX_LINK_UNKNOWN;
/* Destroy the common code port object. */
- efx_port_fini(sc->enp);
+ efx_port_fini(enp);
+
+ efx_filter_fini(enp);
SFXGE_PORT_UNLOCK(port);
}
@@ -455,6 +484,10 @@ sfxge_port_start(struct sfxge_softc *sc)
KASSERT(port->init_state == SFXGE_PORT_INITIALIZED,
("port not initialized"));
+ /* Initialise the required filtering */
+ if ((rc = efx_filter_init(enp)) != 0)
+ goto fail_filter_init;
+
/* Initialize the port object in the common code. */
if ((rc = efx_port_init(sc->enp)) != 0)
goto fail;
@@ -466,7 +499,7 @@ sfxge_port_start(struct sfxge_softc *sc)
if ((rc = efx_mac_fcntl_set(enp, sfxge_port_wanted_fc(sc), B_TRUE))
!= 0)
- goto fail2;
+ goto fail3;
/* Set the unicast address */
if_addr_rlock(ifp);
@@ -474,24 +507,24 @@ sfxge_port_start(struct sfxge_softc *sc)
mac_addr, sizeof(mac_addr));
if_addr_runlock(ifp);
if ((rc = efx_mac_addr_set(enp, mac_addr)) != 0)
- goto fail;
+ goto fail4;
sfxge_mac_filter_set_locked(sc);
/* Update MAC stats by DMA every second */
if ((rc = efx_mac_stats_periodic(enp, &port->mac_stats.dma_buf,
- 1000, B_FALSE)) != 0)
- goto fail2;
+ 1000, B_FALSE)) != 0)
+ goto fail6;
if ((rc = efx_mac_drain(enp, B_FALSE)) != 0)
- goto fail3;
+ goto fail8;
if ((rc = sfxge_phy_cap_mask(sc, sc->media.ifm_cur->ifm_media,
&phy_cap_mask)) != 0)
- goto fail4;
+ goto fail9;
if ((rc = efx_phy_adv_cap_set(sc->enp, phy_cap_mask)) != 0)
- goto fail5;
+ goto fail10;
port->init_state = SFXGE_PORT_STARTED;
@@ -501,15 +534,20 @@ sfxge_port_start(struct sfxge_softc *sc)
return (0);
-fail5:
-fail4:
+fail10:
+fail9:
(void)efx_mac_drain(enp, B_TRUE);
+fail8:
+ (void)efx_mac_stats_periodic(enp, &port->mac_stats.dma_buf, 0, B_FALSE);
+fail6:
+fail4:
fail3:
- (void)efx_mac_stats_periodic(enp, &port->mac_stats.dma_buf,
- 0, B_FALSE);
+
fail2:
- efx_port_fini(sc->enp);
+ efx_port_fini(enp);
fail:
+ efx_filter_fini(enp);
+fail_filter_init:
SFXGE_PORT_UNLOCK(port);
return (rc);
@@ -652,12 +690,14 @@ sfxge_port_init(struct sfxge_softc *sc)
SFXGE_PORT_LOCK_INIT(port, device_get_nameunit(sc->dev));
+ DBGPRINT(sc->dev, "alloc PHY stats");
port->phy_stats.decode_buf = malloc(EFX_PHY_NSTATS * sizeof(uint32_t),
M_SFXGE, M_WAITOK | M_ZERO);
if ((rc = sfxge_dma_alloc(sc, EFX_PHY_STATS_SIZE, phy_stats_buf)) != 0)
goto fail;
sfxge_phy_stat_init(sc);
+ DBGPRINT(sc->dev, "init sysctl");
sysctl_ctx = device_get_sysctl_ctx(sc->dev);
sysctl_tree = device_get_sysctl_tree(sc->dev);
@@ -673,6 +713,7 @@ sfxge_port_init(struct sfxge_softc *sc)
sfxge_port_link_fc_handler, "IU", "link flow control mode");
#endif
+ DBGPRINT(sc->dev, "alloc MAC stats");
port->mac_stats.decode_buf = malloc(EFX_MAC_NSTATS * sizeof(uint64_t),
M_SFXGE, M_WAITOK | M_ZERO);
if ((rc = sfxge_dma_alloc(sc, EFX_MAC_STATS_SIZE, mac_stats_buf)) != 0)
@@ -681,6 +722,7 @@ sfxge_port_init(struct sfxge_softc *sc)
port->init_state = SFXGE_PORT_INITIALIZED;
+ DBGPRINT(sc->dev, "success");
return (0);
fail2:
@@ -690,6 +732,7 @@ fail:
free(port->phy_stats.decode_buf, M_SFXGE);
SFXGE_PORT_LOCK_DESTROY(port);
port->sc = NULL;
+ DBGPRINT(sc->dev, "failed %d", rc);
return (rc);
}
@@ -704,6 +747,11 @@ static const int sfxge_link_mode[EFX_PHY_MEDIA_NTYPES][EFX_LINK_NMODES] = {
/* Don't know the module type, but assume SR for now. */
[EFX_LINK_10000FDX] = IFM_ETHER | IFM_FDX | IFM_10G_SR,
},
+ [EFX_PHY_MEDIA_QSFP_PLUS] = {
+ /* Don't know the module type, but assume SR for now. */
+ [EFX_LINK_10000FDX] = IFM_ETHER | IFM_FDX | IFM_10G_SR,
+ [EFX_LINK_40000FDX] = IFM_ETHER | IFM_FDX | IFM_40G_CR4,
+ },
[EFX_PHY_MEDIA_SFP_PLUS] = {
/* Don't know the module type, but assume SX/SR for now. */
[EFX_LINK_1000FDX] = IFM_ETHER | IFM_FDX | IFM_1000_SX,
@@ -763,6 +811,8 @@ sfxge_link_mode_to_phy_cap(efx_link_mode_t mode)
return (EFX_PHY_CAP_1000FDX);
case EFX_LINK_10000FDX:
return (EFX_PHY_CAP_10000FDX);
+ case EFX_LINK_40000FDX:
+ return (EFX_PHY_CAP_40000FDX);
default:
EFSYS_ASSERT(B_FALSE);
return (EFX_PHY_CAP_INVALID);
@@ -772,6 +822,8 @@ sfxge_link_mode_to_phy_cap(efx_link_mode_t mode)
static int
sfxge_phy_cap_mask(struct sfxge_softc *sc, int ifmedia, uint32_t *phy_cap_mask)
{
+ /* Get global options (duplex), type and subtype bits */
+ int ifmedia_masked = ifmedia & (IFM_GMASK | IFM_NMASK | IFM_TMASK);
efx_phy_media_type_t medium_type;
boolean_t mode_found = B_FALSE;
uint32_t cap_mask, mode_cap_mask;
@@ -787,7 +839,7 @@ sfxge_phy_cap_mask(struct sfxge_softc *sc, int ifmedia, uint32_t *phy_cap_mask)
efx_phy_adv_cap_get(sc->enp, EFX_PHY_CAP_PERM, &cap_mask);
for (mode = EFX_LINK_10HDX; mode < EFX_LINK_NMODES; mode++) {
- if (ifmedia == sfxge_link_mode[medium_type][mode]) {
+ if (ifmedia_masked == sfxge_link_mode[medium_type][mode]) {
mode_found = B_TRUE;
break;
}
@@ -798,8 +850,8 @@ sfxge_phy_cap_mask(struct sfxge_softc *sc, int ifmedia, uint32_t *phy_cap_mask)
* If media is not in the table, it must be IFM_AUTO.
*/
KASSERT((cap_mask & (1 << EFX_PHY_CAP_AN)) &&
- ifmedia == (IFM_ETHER | IFM_AUTO),
- ("%s: no mode for media %d", __func__, ifmedia));
+ ifmedia_masked == (IFM_ETHER | IFM_AUTO),
+ ("%s: no mode for media %#x", __func__, ifmedia));
*phy_cap_mask = (cap_mask & ~(1 << EFX_PHY_CAP_ASYM));
return (0);
}
@@ -868,9 +920,13 @@ int sfxge_port_ifmedia_init(struct sfxge_softc *sc)
int mode_ifm, best_mode_ifm = 0;
int rc;
- /* We need port state to initialise the ifmedia list. */
- if ((rc = efx_nic_init(sc->enp)) != 0)
- goto out;
+ /*
+ * We need port state to initialise the ifmedia list.
+ * It requires initialized NIC what is already done in
+ * sfxge_create() when resources are estimated.
+ */
+ if ((rc = efx_filter_init(sc->enp)) != 0)
+ goto out1;
if ((rc = efx_port_init(sc->enp)) != 0)
goto out2;
@@ -940,7 +996,7 @@ int sfxge_port_ifmedia_init(struct sfxge_softc *sc)
/* Now discard port state until interface is started. */
efx_port_fini(sc->enp);
out2:
- efx_nic_fini(sc->enp);
-out:
+ efx_filter_fini(sc->enp);
+out1:
return (rc);
}
diff --git a/sys/dev/sfxge/sfxge_rx.c b/sys/dev/sfxge/sfxge_rx.c
index 2535e87..3782c34 100644
--- a/sys/dev/sfxge/sfxge_rx.c
+++ b/sys/dev/sfxge/sfxge_rx.c
@@ -1,30 +1,34 @@
/*-
- * Copyright (c) 2010-2011 Solarflare Communications, Inc.
+ * Copyright (c) 2010-2015 Solarflare Communications Inc.
* All rights reserved.
*
* This software was developed in part by Philip Paeps under contract for
* Solarflare Communications, Inc.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
#include <sys/cdefs.h>
@@ -35,6 +39,7 @@ __FBSDID("$FreeBSD$");
#include <sys/smp.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
+#include <sys/syslog.h>
#include <sys/limits.h>
#include <sys/syslog.h>
@@ -256,7 +261,7 @@ sfxge_rx_qfill(struct sfxge_rxq *rxq, unsigned int target, boolean_t retrying)
return;
batch = 0;
- mblksize = sc->rx_buffer_size;
+ mblksize = sc->rx_buffer_size - sc->rx_buffer_align;
while (ntodo-- > 0) {
unsigned int id;
struct sfxge_rx_sw_desc *rx_desc;
@@ -271,6 +276,12 @@ sfxge_rx_qfill(struct sfxge_rxq *rxq, unsigned int target, boolean_t retrying)
m = rx_desc->mbuf = sfxge_rx_alloc_mbuf(sc);
if (m == NULL)
break;
+
+ /* m_len specifies length of area to be mapped for DMA */
+ m->m_len = mblksize;
+ m->m_data = (caddr_t)P2ROUNDUP((uintptr_t)m->m_data, CACHE_LINE_SIZE);
+ m->m_data += sc->rx_buffer_align;
+
sfxge_map_mbuf_fast(rxq->mem.esm_tag, rxq->mem.esm_map, m, &seg);
addr[batch++] = seg.ds_addr;
@@ -295,7 +306,15 @@ sfxge_rx_qfill(struct sfxge_rxq *rxq, unsigned int target, boolean_t retrying)
bus_dmamap_sync(rxq->mem.esm_tag, rxq->mem.esm_map,
BUS_DMASYNC_PREWRITE);
- efx_rx_qpush(rxq->common, rxq->added);
+ efx_rx_qpush(rxq->common, rxq->added, &rxq->pushed);
+
+ /* The queue could still be empty if no descriptors were actually
+ * pushed, in which case there will be no event to cause the next
+ * refill, so we must schedule a refill ourselves.
+ */
+ if(rxq->pushed == rxq->completed) {
+ sfxge_rx_schedule_refill(rxq, retrying);
+ }
}
void
@@ -332,8 +351,10 @@ sfxge_rx_deliver(struct sfxge_softc *sc, struct sfxge_rx_sw_desc *rx_desc)
csum_flags |= CSUM_DATA_VALID | CSUM_PSEUDO_HDR;
if (flags & (EFX_PKT_IPV4 | EFX_PKT_IPV6)) {
- m->m_pkthdr.flowid = EFX_RX_HASH_VALUE(EFX_RX_HASHALG_TOEPLITZ,
- mtod(m, uint8_t *));
+ m->m_pkthdr.flowid =
+ efx_psuedo_hdr_hash_get(sc->enp,
+ EFX_RX_HASHALG_TOEPLITZ,
+ mtod(m, uint8_t *));
/* The hash covers a 4-tuple for TCP only */
M_HASHTYPE_SET(m,
(flags & EFX_PKT_IPV4) ?
@@ -666,8 +687,9 @@ sfxge_lro(struct sfxge_rxq *rxq, struct sfxge_rx_sw_desc *rx_buf)
unsigned bucket;
/* Get the hardware hash */
- conn_hash = EFX_RX_HASH_VALUE(EFX_RX_HASHALG_TOEPLITZ,
- mtod(m, uint8_t *));
+ conn_hash = efx_psuedo_hdr_hash_get(sc->enp,
+ EFX_RX_HASHALG_TOEPLITZ,
+ mtod(m, uint8_t *));
eh = (struct ether_header *)(m->m_data + sc->rx_prefix_size);
if (eh->ether_type == htons(ETHERTYPE_VLAN)) {
@@ -824,6 +846,17 @@ sfxge_rx_qcomplete(struct sfxge_rxq *rxq, boolean_t eop)
if (rx_desc->flags & (EFX_ADDR_MISMATCH | EFX_DISCARD))
goto discard;
+ /* Read the length from the psuedo header if required */
+ if (rx_desc->flags & EFX_PKT_PREFIX_LEN) {
+ uint16_t tmp_size;
+ int rc;
+ rc = efx_psuedo_hdr_pkt_length_get(sc->enp,
+ mtod(m, uint8_t *),
+ &tmp_size);
+ KASSERT(rc == 0, ("cannot get packet length: %d", rc));
+ rx_desc->size = (int)tmp_size + sc->rx_prefix_size;
+ }
+
prefetch_read_many(mtod(m, caddr_t));
switch (rx_desc->flags & (EFX_PKT_IPV4 | EFX_PKT_IPV6)) {
@@ -908,6 +941,9 @@ sfxge_rx_qstop(struct sfxge_softc *sc, unsigned int index)
struct sfxge_rxq *rxq;
struct sfxge_evq *evq;
unsigned int count;
+ unsigned int retry = 3;
+
+ SFXGE_ADAPTER_LOCK_ASSERT_OWNED(sc);
rxq = sc->rxq[index];
evq = sc->evq[index];
@@ -921,30 +957,43 @@ sfxge_rx_qstop(struct sfxge_softc *sc, unsigned int index)
callout_stop(&rxq->refill_callout);
-again:
- rxq->flush_state = SFXGE_FLUSH_PENDING;
+ while (rxq->flush_state != SFXGE_FLUSH_DONE && retry != 0) {
+ rxq->flush_state = SFXGE_FLUSH_PENDING;
- /* Flush the receive queue */
- efx_rx_qflush(rxq->common);
+ SFXGE_EVQ_UNLOCK(evq);
- SFXGE_EVQ_UNLOCK(evq);
-
- count = 0;
- do {
- /* Spin for 100 ms */
- DELAY(100000);
-
- if (rxq->flush_state != SFXGE_FLUSH_PENDING)
+ /* Flush the receive queue */
+ if (efx_rx_qflush(rxq->common) != 0) {
+ SFXGE_EVQ_LOCK(evq);
+ rxq->flush_state = SFXGE_FLUSH_FAILED;
break;
+ }
- } while (++count < 20);
+ count = 0;
+ do {
+ /* Spin for 100 ms */
+ DELAY(100000);
- SFXGE_EVQ_LOCK(evq);
+ if (rxq->flush_state != SFXGE_FLUSH_PENDING)
+ break;
- if (rxq->flush_state == SFXGE_FLUSH_FAILED)
- goto again;
+ } while (++count < 20);
- rxq->flush_state = SFXGE_FLUSH_DONE;
+ SFXGE_EVQ_LOCK(evq);
+
+ if (rxq->flush_state == SFXGE_FLUSH_PENDING) {
+ /* Flush timeout - neither done nor failed */
+ log(LOG_ERR, "%s: Cannot flush Rx queue %u\n",
+ device_get_nameunit(sc->dev), index);
+ rxq->flush_state = SFXGE_FLUSH_DONE;
+ }
+ retry--;
+ }
+ if (rxq->flush_state == SFXGE_FLUSH_FAILED) {
+ log(LOG_ERR, "%s: Flushing Rx queue %u failed\n",
+ device_get_nameunit(sc->dev), index);
+ rxq->flush_state = SFXGE_FLUSH_DONE;
+ }
rxq->pending = rxq->added;
sfxge_rx_qcomplete(rxq, B_TRUE);
@@ -953,6 +1002,7 @@ again:
("rxq->completed != rxq->pending"));
rxq->added = 0;
+ rxq->pushed = 0;
rxq->pending = 0;
rxq->completed = 0;
rxq->loopback = 0;
@@ -974,6 +1024,8 @@ sfxge_rx_qstart(struct sfxge_softc *sc, unsigned int index)
struct sfxge_evq *evq;
int rc;
+ SFXGE_ADAPTER_LOCK_ASSERT_OWNED(sc);
+
rxq = sc->rxq[index];
esmp = &rxq->mem;
evq = sc->evq[index];
@@ -1000,6 +1052,7 @@ sfxge_rx_qstart(struct sfxge_softc *sc, unsigned int index)
efx_rx_qenable(rxq->common);
rxq->init_state = SFXGE_RXQ_STARTED;
+ rxq->flush_state = SFXGE_FLUSH_REQUIRED;
/* Try to fill the queue from the pool. */
sfxge_rx_qfill(rxq, EFX_RXQ_LIMIT(sc->rxq_entries), B_FALSE);
@@ -1019,6 +1072,8 @@ sfxge_rx_stop(struct sfxge_softc *sc)
{
int index;
+ efx_mac_filter_default_rxq_clear(sc->enp);
+
/* Stop the receive queue(s) */
index = sc->rxq_count;
while (--index >= 0)
@@ -1034,6 +1089,8 @@ int
sfxge_rx_start(struct sfxge_softc *sc)
{
struct sfxge_intr *intr;
+ const efx_nic_cfg_t *encp;
+ size_t hdrlen, align, reserved;
int index;
int rc;
@@ -1043,17 +1100,35 @@ sfxge_rx_start(struct sfxge_softc *sc)
if ((rc = efx_rx_init(sc->enp)) != 0)
return (rc);
- /* Calculate the receive packet buffer size. */
- sc->rx_prefix_size = EFX_RX_PREFIX_SIZE;
- sc->rx_buffer_size = (EFX_MAC_PDU(sc->ifnet->if_mtu) +
- sc->rx_prefix_size);
+ encp = efx_nic_cfg_get(sc->enp);
+ sc->rx_buffer_size = EFX_MAC_PDU(sc->ifnet->if_mtu);
+
+ /* Calculate the receive packet buffer size. */
+ sc->rx_prefix_size = encp->enc_rx_prefix_size;
+
+ /* Ensure IP headers are 32bit aligned */
+ hdrlen = sc->rx_prefix_size + sizeof (struct ether_header);
+ sc->rx_buffer_align = P2ROUNDUP(hdrlen, 4) - hdrlen;
+
+ sc->rx_buffer_size += sc->rx_buffer_align;
+
+ /* Align end of packet buffer for RX DMA end padding */
+ align = MAX(1, encp->enc_rx_buf_align_end);
+ EFSYS_ASSERT(ISP2(align));
+ sc->rx_buffer_size = P2ROUNDUP(sc->rx_buffer_size, align);
+
+ /*
+ * Standard mbuf zones only guarantee pointer-size alignment;
+ * we need extra space to align to the cache line
+ */
+ reserved = sc->rx_buffer_size + CACHE_LINE_SIZE;
/* Select zone for packet buffers */
- if (sc->rx_buffer_size <= MCLBYTES)
+ if (reserved <= MCLBYTES)
sc->rx_buffer_zone = zone_clust;
- else if (sc->rx_buffer_size <= MJUMPAGESIZE)
+ else if (reserved <= MJUMPAGESIZE)
sc->rx_buffer_zone = zone_jumbop;
- else if (sc->rx_buffer_size <= MJUM9BYTES)
+ else if (reserved <= MJUM9BYTES)
sc->rx_buffer_zone = zone_jumbo9;
else
sc->rx_buffer_zone = zone_jumbo16;
@@ -1070,8 +1145,8 @@ sfxge_rx_start(struct sfxge_softc *sc)
(1 << EFX_RX_HASH_IPV4) | (1 << EFX_RX_HASH_TCPIPV4) |
(1 << EFX_RX_HASH_IPV6) | (1 << EFX_RX_HASH_TCPIPV6), B_TRUE);
- if ((rc = efx_rx_scale_toeplitz_ipv4_key_set(sc->enp, toep_key,
- sizeof(toep_key))) != 0)
+ if ((rc = efx_rx_scale_key_set(sc->enp, toep_key,
+ sizeof(toep_key))) != 0)
goto fail;
/* Start the receive queue(s). */
@@ -1080,8 +1155,14 @@ sfxge_rx_start(struct sfxge_softc *sc)
goto fail2;
}
+ rc = efx_mac_filter_default_rxq_set(sc->enp, sc->rxq[0]->common,
+ sc->intr.n_alloc > 1);
+ if (rc != 0)
+ goto fail3;
+
return (0);
+fail3:
fail2:
while (--index >= 0)
sfxge_rx_qstop(sc, index);
diff --git a/sys/dev/sfxge/sfxge_rx.h b/sys/dev/sfxge/sfxge_rx.h
index dae7e08..e870ed5 100644
--- a/sys/dev/sfxge/sfxge_rx.h
+++ b/sys/dev/sfxge/sfxge_rx.h
@@ -1,30 +1,34 @@
/*-
- * Copyright (c) 2010-2011 Solarflare Communications, Inc.
+ * Copyright (c) 2010-2015 Solarflare Communications Inc.
* All rights reserved.
*
* This software was developed in part by Philip Paeps under contract for
* Solarflare Communications, Inc.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*
* $FreeBSD$
*/
@@ -39,22 +43,22 @@
#define SFXGE_LRO 1
#endif
-#define SFXGE_MAGIC_RESERVED 0x8000
+#define SFXGE_MAGIC_RESERVED 0x8000
#define SFXGE_MAGIC_DMAQ_LABEL_WIDTH 6
-#define SFXGE_MAGIC_DMAQ_LABEL_MASK \
+#define SFXGE_MAGIC_DMAQ_LABEL_MASK \
((1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH) - 1)
-#define SFXGE_MAGIC_RX_QFLUSH_DONE \
+#define SFXGE_MAGIC_RX_QFLUSH_DONE \
(SFXGE_MAGIC_RESERVED | (1 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
-#define SFXGE_MAGIC_RX_QFLUSH_FAILED \
+#define SFXGE_MAGIC_RX_QFLUSH_FAILED \
(SFXGE_MAGIC_RESERVED | (2 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
-#define SFXGE_MAGIC_RX_QREFILL \
+#define SFXGE_MAGIC_RX_QREFILL \
(SFXGE_MAGIC_RESERVED | (3 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
-#define SFXGE_MAGIC_TX_QFLUSH_DONE \
+#define SFXGE_MAGIC_TX_QFLUSH_DONE \
(SFXGE_MAGIC_RESERVED | (4 << SFXGE_MAGIC_DMAQ_LABEL_WIDTH))
#define SFXGE_RX_SCALE_MAX EFX_MAXRSS
@@ -152,6 +156,7 @@ struct sfxge_lro_state {
enum sfxge_flush_state {
SFXGE_FLUSH_DONE = 0,
+ SFXGE_FLUSH_REQUIRED,
SFXGE_FLUSH_PENDING,
SFXGE_FLUSH_FAILED
};
@@ -175,6 +180,7 @@ struct sfxge_rxq {
struct sfxge_rx_sw_desc *queue __aligned(CACHE_LINE_SIZE);
unsigned int added;
+ unsigned int pushed;
unsigned int pending;
unsigned int completed;
unsigned int loopback;
diff --git a/sys/dev/sfxge/sfxge_tx.c b/sys/dev/sfxge/sfxge_tx.c
index 524b09d..af8efc2 100644
--- a/sys/dev/sfxge/sfxge_tx.c
+++ b/sys/dev/sfxge/sfxge_tx.c
@@ -1,30 +1,34 @@
/*-
- * Copyright (c) 2010-2011 Solarflare Communications, Inc.
+ * Copyright (c) 2010-2015 Solarflare Communications Inc.
* All rights reserved.
*
* This software was developed in part by Philip Paeps under contract for
* Solarflare Communications, Inc.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*/
/* Theory of operation:
@@ -67,23 +71,6 @@ __FBSDID("$FreeBSD$");
#include "sfxge.h"
#include "sfxge_tx.h"
-/*
- * Estimate maximum number of Tx descriptors required for TSO packet.
- * With minimum MSS and maximum mbuf length we might need more (even
- * than a ring-ful of descriptors), but this should not happen in
- * practice except due to deliberate attack. In that case we will
- * truncate the output at a packet boundary.
- */
-#define SFXGE_TSO_MAX_DESC \
- (SFXGE_TSO_MAX_SEGS * 2 + SFXGE_TX_MAPPING_MAX_SEG - 1)
-
-/*
- * Set the block level to ensure there is space to generate a
- * large number of descriptors for TSO.
- */
-#define SFXGE_TXQ_BLOCK_LEVEL(_entries) \
- (EFX_TXQ_LIMIT(_entries) - SFXGE_TSO_MAX_DESC)
-
#define SFXGE_PARAM_TX_DPL_GET_MAX SFXGE_PARAM(tx_dpl_get_max)
static int sfxge_tx_dpl_get_max = SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT;
@@ -108,6 +95,13 @@ SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_dpl_put_max, CTLFLAG_RDTUN,
&sfxge_tx_dpl_put_max, 0,
"Maximum number of any packets in deferred packet put-list");
+#define SFXGE_PARAM_TSO_FW_ASSISTED SFXGE_PARAM(tso_fw_assisted)
+static int sfxge_tso_fw_assisted = 1;
+TUNABLE_INT(SFXGE_PARAM_TSO_FW_ASSISTED, &sfxge_tso_fw_assisted);
+SYSCTL_INT(_hw_sfxge, OID_AUTO, tso_fw_assisted, CTLFLAG_RDTUN,
+ &sfxge_tso_fw_assisted, 0,
+ "Use FW-assisted TSO if supported by NIC firmware");
+
static const struct {
const char *name;
@@ -134,7 +128,38 @@ static void sfxge_tx_qdpl_service(struct sfxge_txq *txq);
static void sfxge_tx_qlist_post(struct sfxge_txq *txq);
static void sfxge_tx_qunblock(struct sfxge_txq *txq);
static int sfxge_tx_queue_tso(struct sfxge_txq *txq, struct mbuf *mbuf,
- const bus_dma_segment_t *dma_seg, int n_dma_seg);
+ const bus_dma_segment_t *dma_seg, int n_dma_seg,
+ int vlan_tagged);
+
+static int
+sfxge_tx_maybe_insert_tag(struct sfxge_txq *txq, struct mbuf *mbuf)
+{
+ uint16_t this_tag = ((mbuf->m_flags & M_VLANTAG) ?
+ mbuf->m_pkthdr.ether_vtag :
+ 0);
+
+ if (this_tag == txq->hw_vlan_tci)
+ return (0);
+
+ efx_tx_qdesc_vlantci_create(txq->common,
+ bswap16(this_tag),
+ &txq->pend_desc[0]);
+ txq->n_pend_desc = 1;
+ txq->hw_vlan_tci = this_tag;
+ return (1);
+}
+
+static inline void
+sfxge_next_stmp(struct sfxge_txq *txq, struct sfxge_tx_mapping **pstmp)
+{
+ KASSERT((*pstmp)->flags == 0, ("stmp flags are not 0"));
+ if (__predict_false(*pstmp ==
+ &txq->stmp[txq->ptr_mask]))
+ *pstmp = &txq->stmp[0];
+ else
+ (*pstmp)++;
+}
+
void
sfxge_tx_qcomplete(struct sfxge_txq *txq, struct sfxge_evq *evq)
@@ -252,29 +277,30 @@ static void
sfxge_tx_qlist_post(struct sfxge_txq *txq)
{
unsigned int old_added;
+ unsigned int block_level;
unsigned int level;
int rc;
SFXGE_TXQ_LOCK_ASSERT_OWNED(txq);
KASSERT(txq->n_pend_desc != 0, ("txq->n_pend_desc == 0"));
- KASSERT(txq->n_pend_desc <= SFXGE_TSO_MAX_DESC,
+ KASSERT(txq->n_pend_desc <= txq->max_pkt_desc,
("txq->n_pend_desc too large"));
KASSERT(!txq->blocked, ("txq->blocked"));
old_added = txq->added;
/* Post the fragment list. */
- rc = efx_tx_qpost(txq->common, txq->pend_desc, txq->n_pend_desc,
+ rc = efx_tx_qdesc_post(txq->common, txq->pend_desc, txq->n_pend_desc,
txq->reaped, &txq->added);
- KASSERT(rc == 0, ("efx_tx_qpost() failed"));
+ KASSERT(rc == 0, ("efx_tx_qdesc_post() failed"));
- /* If efx_tx_qpost() had to refragment, our information about
+ /* If efx_tx_qdesc_post() had to refragment, our information about
* buffers to free may be associated with the wrong
* descriptors.
*/
KASSERT(txq->added - old_added == txq->n_pend_desc,
- ("efx_tx_qpost() refragmented descriptors"));
+ ("efx_tx_qdesc_post() refragmented descriptors"));
level = txq->added - txq->reaped;
KASSERT(level <= txq->entries, ("overfilled TX queue"));
@@ -282,14 +308,20 @@ sfxge_tx_qlist_post(struct sfxge_txq *txq)
/* Clear the fragment list. */
txq->n_pend_desc = 0;
+ /*
+ * Set the block level to ensure there is space to generate a
+ * large number of descriptors for TSO.
+ */
+ block_level = EFX_TXQ_LIMIT(txq->entries) - txq->max_pkt_desc;
+
/* Have we reached the block level? */
- if (level < SFXGE_TXQ_BLOCK_LEVEL(txq->entries))
+ if (level < block_level)
return;
/* Reap, and check again */
sfxge_tx_qreap(txq);
level = txq->added - txq->reaped;
- if (level < SFXGE_TXQ_BLOCK_LEVEL(txq->entries))
+ if (level < block_level)
return;
txq->blocked = 1;
@@ -301,7 +333,7 @@ sfxge_tx_qlist_post(struct sfxge_txq *txq)
mb();
sfxge_tx_qreap(txq);
level = txq->added - txq->reaped;
- if (level < SFXGE_TXQ_BLOCK_LEVEL(txq->entries)) {
+ if (level < block_level) {
mb();
txq->blocked = 0;
}
@@ -314,10 +346,12 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, struct mbuf *mbuf)
bus_dma_segment_t dma_seg[SFXGE_TX_MAPPING_MAX_SEG];
unsigned int id;
struct sfxge_tx_mapping *stmp;
- efx_buffer_t *desc;
+ efx_desc_t *desc;
int n_dma_seg;
int rc;
int i;
+ int eop;
+ int vlan_tagged;
KASSERT(!txq->blocked, ("txq->blocked"));
@@ -354,35 +388,35 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, struct mbuf *mbuf)
used_map = &stmp->map;
+ vlan_tagged = sfxge_tx_maybe_insert_tag(txq, mbuf);
+ if (vlan_tagged) {
+ sfxge_next_stmp(txq, &stmp);
+ }
if (mbuf->m_pkthdr.csum_flags & CSUM_TSO) {
- rc = sfxge_tx_queue_tso(txq, mbuf, dma_seg, n_dma_seg);
+ rc = sfxge_tx_queue_tso(txq, mbuf, dma_seg, n_dma_seg, vlan_tagged);
if (rc < 0)
goto reject_mapped;
- stmp = &txq->stmp[rc];
+ stmp = &txq->stmp[(rc - 1) & txq->ptr_mask];
} else {
/* Add the mapping to the fragment list, and set flags
* for the buffer.
*/
+
i = 0;
for (;;) {
- desc = &txq->pend_desc[i];
- desc->eb_addr = dma_seg[i].ds_addr;
- desc->eb_size = dma_seg[i].ds_len;
- if (i == n_dma_seg - 1) {
- desc->eb_eop = 1;
+ desc = &txq->pend_desc[i + vlan_tagged];
+ eop = (i == n_dma_seg - 1);
+ efx_tx_qdesc_dma_create(txq->common,
+ dma_seg[i].ds_addr,
+ dma_seg[i].ds_len,
+ eop,
+ desc);
+ if (eop)
break;
- }
- desc->eb_eop = 0;
i++;
-
- stmp->flags = 0;
- if (__predict_false(stmp ==
- &txq->stmp[txq->ptr_mask]))
- stmp = &txq->stmp[0];
- else
- stmp++;
+ sfxge_next_stmp(txq, &stmp);
}
- txq->n_pend_desc = n_dma_seg;
+ txq->n_pend_desc = n_dma_seg + vlan_tagged;
}
/*
@@ -469,7 +503,7 @@ sfxge_tx_qdpl_drain(struct sfxge_txq *txq)
/* Push the fragments to the hardware in batches. */
if (txq->added - pushed >= SFXGE_TX_BATCH) {
- efx_tx_qpush(txq->common, txq->added);
+ efx_tx_qpush(txq->common, txq->added, pushed);
pushed = txq->added;
}
}
@@ -489,14 +523,13 @@ sfxge_tx_qdpl_drain(struct sfxge_txq *txq)
}
if (txq->added != pushed)
- efx_tx_qpush(txq->common, txq->added);
+ efx_tx_qpush(txq->common, txq->added, pushed);
KASSERT(txq->blocked || stdp->std_get_count == 0,
("queue unblocked but count is non-zero"));
}
-#define SFXGE_TX_QDPL_PENDING(_txq) \
- ((_txq)->dpl.std_put != 0)
+#define SFXGE_TX_QDPL_PENDING(_txq) ((_txq)->dpl.std_put != 0)
/*
* Service the deferred packet list.
@@ -599,7 +632,7 @@ sfxge_tx_qdpl_put_unlocked(struct sfxge_txq *txq, struct mbuf *mbuf)
* Called from if_transmit - will try to grab the txq lock and enqueue to the
* put list if it succeeds, otherwise try to push onto the defer list if space.
*/
-int
+static int
sfxge_tx_packet_add(struct sfxge_txq *txq, struct mbuf *m)
{
int rc;
@@ -746,6 +779,10 @@ struct sfxge_tso_state {
ssize_t tcph_off; /* Offset of TCP header */
unsigned header_len; /* Number of bytes of header */
unsigned seg_size; /* TCP segment size */
+ int fw_assisted; /* Use FW-assisted TSO */
+ u_short packet_id; /* IPv4 packet ID from the original packet */
+ efx_desc_t header_desc; /* Precomputed header descriptor for
+ * FW-assisted TSO */
};
static const struct ip *tso_iph(const struct sfxge_tso_state *tso)
@@ -816,12 +853,16 @@ static void tso_fini(struct sfxge_txq *txq)
}
}
-static void tso_start(struct sfxge_tso_state *tso, struct mbuf *mbuf)
+static void tso_start(struct sfxge_txq *txq, struct sfxge_tso_state *tso,
+ const bus_dma_segment_t *hdr_dma_seg,
+ struct mbuf *mbuf)
{
struct ether_header *eh = mtod(mbuf, struct ether_header *);
+ const efx_nic_cfg_t *encp = efx_nic_cfg_get(txq->sc->enp);
const struct tcphdr *th;
struct tcphdr th_copy;
+ tso->fw_assisted = txq->sc->tso_fw_assisted;
tso->mbuf = mbuf;
/* Find network protocol and header */
@@ -840,12 +881,19 @@ static void tso_start(struct sfxge_tso_state *tso, struct mbuf *mbuf)
KASSERT(tso_iph(tso)->ip_p == IPPROTO_TCP,
("TSO required on non-TCP packet"));
tso->tcph_off = tso->nh_off + 4 * tso_iph(tso)->ip_hl;
+ tso->packet_id = tso_iph(tso)->ip_id;
} else {
KASSERT(tso->protocol == htons(ETHERTYPE_IPV6),
("TSO required on non-IP packet"));
KASSERT(tso_ip6h(tso)->ip6_nxt == IPPROTO_TCP,
("TSO required on non-TCP packet"));
tso->tcph_off = tso->nh_off + sizeof(struct ip6_hdr);
+ tso->packet_id = 0;
+ }
+ if (tso->fw_assisted &&
+ __predict_false(tso->tcph_off >
+ encp->enc_tx_tso_tcp_header_offset_limit)) {
+ tso->fw_assisted = 0;
}
KASSERT(mbuf->m_len >= tso->tcph_off,
@@ -875,6 +923,17 @@ static void tso_start(struct sfxge_tso_state *tso, struct mbuf *mbuf)
th->th_flags & (TH_URG | TH_SYN)));
tso->out_len = mbuf->m_pkthdr.len - tso->header_len;
+
+ if (tso->fw_assisted) {
+ if (hdr_dma_seg->ds_len >= tso->header_len)
+ efx_tx_qdesc_dma_create(txq->common,
+ hdr_dma_seg->ds_addr,
+ tso->header_len,
+ B_FALSE,
+ &tso->header_desc);
+ else
+ tso->fw_assisted = 0;
+ }
}
/*
@@ -887,7 +946,7 @@ static void tso_start(struct sfxge_tso_state *tso, struct mbuf *mbuf)
static void tso_fill_packet_with_fragment(struct sfxge_txq *txq,
struct sfxge_tso_state *tso)
{
- efx_buffer_t *desc;
+ efx_desc_t *desc;
int n;
if (tso->in_len == 0 || tso->packet_space == 0)
@@ -903,9 +962,11 @@ static void tso_fill_packet_with_fragment(struct sfxge_txq *txq,
tso->in_len -= n;
desc = &txq->pend_desc[txq->n_pend_desc++];
- desc->eb_addr = tso->dma_addr;
- desc->eb_size = n;
- desc->eb_eop = tso->out_len == 0 || tso->packet_space == 0;
+ efx_tx_qdesc_dma_create(txq->common,
+ tso->dma_addr,
+ n,
+ tso->out_len == 0 || tso->packet_space == 0,
+ desc);
tso->dma_addr += n;
}
@@ -928,107 +989,139 @@ static void tso_map_long_header(void *dma_addr_ret,
*/
static int tso_start_new_packet(struct sfxge_txq *txq,
struct sfxge_tso_state *tso,
- unsigned int id)
+ unsigned int *idp)
{
- struct sfxge_tx_mapping *stmp = &txq->stmp[id];
+ unsigned int id = *idp;
struct tcphdr *tsoh_th;
unsigned ip_length;
caddr_t header;
uint64_t dma_addr;
bus_dmamap_t map;
- efx_buffer_t *desc;
+ efx_desc_t *desc;
int rc;
- /* Allocate a DMA-mapped header buffer. */
- if (__predict_true(tso->header_len <= TSOH_STD_SIZE)) {
- unsigned int page_index = (id / 2) / TSOH_PER_PAGE;
- unsigned int buf_index = (id / 2) % TSOH_PER_PAGE;
+ if (tso->fw_assisted) {
+ uint8_t tcp_flags = tso_tcph(tso)->th_flags;
+
+ if (tso->out_len > tso->seg_size)
+ tcp_flags &= ~(TH_FIN | TH_PUSH);
+
+ /* TSO option descriptor */
+ desc = &txq->pend_desc[txq->n_pend_desc++];
+ efx_tx_qdesc_tso_create(txq->common,
+ tso->packet_id,
+ tso->seqnum,
+ tcp_flags,
+ desc++);
+ KASSERT(txq->stmp[id].flags == 0, ("stmp flags are not 0"));
+ id = (id + 1) & txq->ptr_mask;
- header = (txq->tsoh_buffer[page_index].esm_base +
- buf_index * TSOH_STD_SIZE);
- dma_addr = (txq->tsoh_buffer[page_index].esm_addr +
- buf_index * TSOH_STD_SIZE);
- map = txq->tsoh_buffer[page_index].esm_map;
+ /* Header DMA descriptor */
+ *desc = tso->header_desc;
+ txq->n_pend_desc++;
+ KASSERT(txq->stmp[id].flags == 0, ("stmp flags are not 0"));
+ id = (id + 1) & txq->ptr_mask;
- stmp->flags = 0;
+ tso->seqnum += tso->seg_size;
} else {
- /* We cannot use bus_dmamem_alloc() as that may sleep */
- header = malloc(tso->header_len, M_SFXGE, M_NOWAIT);
- if (__predict_false(!header))
- return (ENOMEM);
- rc = bus_dmamap_load(txq->packet_dma_tag, stmp->map,
- header, tso->header_len,
- tso_map_long_header, &dma_addr,
- BUS_DMA_NOWAIT);
- if (__predict_false(dma_addr == 0)) {
- if (rc == 0) {
- /* Succeeded but got >1 segment */
- bus_dmamap_unload(txq->packet_dma_tag,
- stmp->map);
- rc = EINVAL;
+ /* Allocate a DMA-mapped header buffer. */
+ if (__predict_true(tso->header_len <= TSOH_STD_SIZE)) {
+ unsigned int page_index = (id / 2) / TSOH_PER_PAGE;
+ unsigned int buf_index = (id / 2) % TSOH_PER_PAGE;
+
+ header = (txq->tsoh_buffer[page_index].esm_base +
+ buf_index * TSOH_STD_SIZE);
+ dma_addr = (txq->tsoh_buffer[page_index].esm_addr +
+ buf_index * TSOH_STD_SIZE);
+ map = txq->tsoh_buffer[page_index].esm_map;
+
+ KASSERT(txq->stmp[id].flags == 0,
+ ("stmp flags are not 0"));
+ } else {
+ struct sfxge_tx_mapping *stmp = &txq->stmp[id];
+
+ /* We cannot use bus_dmamem_alloc() as that may sleep */
+ header = malloc(tso->header_len, M_SFXGE, M_NOWAIT);
+ if (__predict_false(!header))
+ return (ENOMEM);
+ rc = bus_dmamap_load(txq->packet_dma_tag, stmp->map,
+ header, tso->header_len,
+ tso_map_long_header, &dma_addr,
+ BUS_DMA_NOWAIT);
+ if (__predict_false(dma_addr == 0)) {
+ if (rc == 0) {
+ /* Succeeded but got >1 segment */
+ bus_dmamap_unload(txq->packet_dma_tag,
+ stmp->map);
+ rc = EINVAL;
+ }
+ free(header, M_SFXGE);
+ return (rc);
}
- free(header, M_SFXGE);
- return (rc);
- }
- map = stmp->map;
+ map = stmp->map;
- txq->tso_long_headers++;
- stmp->u.heap_buf = header;
- stmp->flags = TX_BUF_UNMAP;
- }
+ txq->tso_long_headers++;
+ stmp->u.heap_buf = header;
+ stmp->flags = TX_BUF_UNMAP;
+ }
- tsoh_th = (struct tcphdr *)(header + tso->tcph_off);
+ tsoh_th = (struct tcphdr *)(header + tso->tcph_off);
- /* Copy and update the headers. */
- m_copydata(tso->mbuf, 0, tso->header_len, header);
+ /* Copy and update the headers. */
+ m_copydata(tso->mbuf, 0, tso->header_len, header);
- tsoh_th->th_seq = htonl(tso->seqnum);
- tso->seqnum += tso->seg_size;
- if (tso->out_len > tso->seg_size) {
- /* This packet will not finish the TSO burst. */
- ip_length = tso->header_len - tso->nh_off + tso->seg_size;
- tsoh_th->th_flags &= ~(TH_FIN | TH_PUSH);
- } else {
- /* This packet will be the last in the TSO burst. */
- ip_length = tso->header_len - tso->nh_off + tso->out_len;
- }
+ tsoh_th->th_seq = htonl(tso->seqnum);
+ tso->seqnum += tso->seg_size;
+ if (tso->out_len > tso->seg_size) {
+ /* This packet will not finish the TSO burst. */
+ ip_length = tso->header_len - tso->nh_off + tso->seg_size;
+ tsoh_th->th_flags &= ~(TH_FIN | TH_PUSH);
+ } else {
+ /* This packet will be the last in the TSO burst. */
+ ip_length = tso->header_len - tso->nh_off + tso->out_len;
+ }
- if (tso->protocol == htons(ETHERTYPE_IP)) {
- struct ip *tsoh_iph = (struct ip *)(header + tso->nh_off);
- tsoh_iph->ip_len = htons(ip_length);
- /* XXX We should increment ip_id, but FreeBSD doesn't
- * currently allocate extra IDs for multiple segments.
- */
- } else {
- struct ip6_hdr *tsoh_iph =
- (struct ip6_hdr *)(header + tso->nh_off);
- tsoh_iph->ip6_plen = htons(ip_length - sizeof(*tsoh_iph));
- }
+ if (tso->protocol == htons(ETHERTYPE_IP)) {
+ struct ip *tsoh_iph = (struct ip *)(header + tso->nh_off);
+ tsoh_iph->ip_len = htons(ip_length);
+ /* XXX We should increment ip_id, but FreeBSD doesn't
+ * currently allocate extra IDs for multiple segments.
+ */
+ } else {
+ struct ip6_hdr *tsoh_iph =
+ (struct ip6_hdr *)(header + tso->nh_off);
+ tsoh_iph->ip6_plen = htons(ip_length - sizeof(*tsoh_iph));
+ }
- /* Make the header visible to the hardware. */
- bus_dmamap_sync(txq->packet_dma_tag, map, BUS_DMASYNC_PREWRITE);
+ /* Make the header visible to the hardware. */
+ bus_dmamap_sync(txq->packet_dma_tag, map, BUS_DMASYNC_PREWRITE);
+ /* Form a descriptor for this header. */
+ desc = &txq->pend_desc[txq->n_pend_desc++];
+ efx_tx_qdesc_dma_create(txq->common,
+ dma_addr,
+ tso->header_len,
+ 0,
+ desc);
+ id = (id + 1) & txq->ptr_mask;
+ }
tso->packet_space = tso->seg_size;
txq->tso_packets++;
-
- /* Form a descriptor for this header. */
- desc = &txq->pend_desc[txq->n_pend_desc++];
- desc->eb_addr = dma_addr;
- desc->eb_size = tso->header_len;
- desc->eb_eop = 0;
+ *idp = id;
return (0);
}
static int
sfxge_tx_queue_tso(struct sfxge_txq *txq, struct mbuf *mbuf,
- const bus_dma_segment_t *dma_seg, int n_dma_seg)
+ const bus_dma_segment_t *dma_seg, int n_dma_seg,
+ int vlan_tagged)
{
struct sfxge_tso_state tso;
- unsigned int id, next_id;
+ unsigned int id;
unsigned skipped = 0;
- tso_start(&tso, mbuf);
+ tso_start(txq, &tso, dma_seg, mbuf);
while (dma_seg->ds_len + skipped <= tso.header_len) {
skipped += dma_seg->ds_len;
@@ -1039,13 +1132,15 @@ sfxge_tx_queue_tso(struct sfxge_txq *txq, struct mbuf *mbuf,
tso.in_len = dma_seg->ds_len - (tso.header_len - skipped);
tso.dma_addr = dma_seg->ds_addr + (tso.header_len - skipped);
- id = txq->added & txq->ptr_mask;
- if (__predict_false(tso_start_new_packet(txq, &tso, id)))
+ id = (txq->added + vlan_tagged) & txq->ptr_mask;
+ if (__predict_false(tso_start_new_packet(txq, &tso, &id)))
return (-1);
while (1) {
- id = (id + 1) & txq->ptr_mask;
tso_fill_packet_with_fragment(txq, &tso);
+ /* Exactly one DMA descriptor is added */
+ KASSERT(txq->stmp[id].flags == 0, ("stmp flags are not 0"));
+ id = (id + 1) & txq->ptr_mask;
/* Move onto the next fragment? */
if (tso.in_len == 0) {
@@ -1064,18 +1159,17 @@ sfxge_tx_queue_tso(struct sfxge_txq *txq, struct mbuf *mbuf,
* the remainder of the input mbuf but do not
* roll back the work we have done.
*/
- if (txq->n_pend_desc + 1 /* header */ + n_dma_seg >
- SFXGE_TSO_MAX_DESC) {
+ if (txq->n_pend_desc + tso.fw_assisted +
+ 1 /* header */ + n_dma_seg >
+ txq->max_pkt_desc) {
txq->tso_pdrop_too_many++;
break;
}
- next_id = (id + 1) & txq->ptr_mask;
if (__predict_false(tso_start_new_packet(txq, &tso,
- next_id))) {
+ &id))) {
txq->tso_pdrop_no_rsrc++;
break;
}
- id = next_id;
}
}
@@ -1128,38 +1222,52 @@ sfxge_tx_qstop(struct sfxge_softc *sc, unsigned int index)
struct sfxge_evq *evq;
unsigned int count;
+ SFXGE_ADAPTER_LOCK_ASSERT_OWNED(sc);
+
txq = sc->txq[index];
evq = sc->evq[txq->evq_index];
+ SFXGE_EVQ_LOCK(evq);
SFXGE_TXQ_LOCK(txq);
KASSERT(txq->init_state == SFXGE_TXQ_STARTED,
("txq->init_state != SFXGE_TXQ_STARTED"));
txq->init_state = SFXGE_TXQ_INITIALIZED;
- txq->flush_state = SFXGE_FLUSH_PENDING;
-
- /* Flush the transmit queue. */
- efx_tx_qflush(txq->common);
-
- SFXGE_TXQ_UNLOCK(txq);
- count = 0;
- do {
- /* Spin for 100ms. */
- DELAY(100000);
+ if (txq->flush_state != SFXGE_FLUSH_DONE) {
+ txq->flush_state = SFXGE_FLUSH_PENDING;
- if (txq->flush_state != SFXGE_FLUSH_PENDING)
- break;
- } while (++count < 20);
+ SFXGE_EVQ_UNLOCK(evq);
+ SFXGE_TXQ_UNLOCK(txq);
- SFXGE_EVQ_LOCK(evq);
- SFXGE_TXQ_LOCK(txq);
+ /* Flush the transmit queue. */
+ if (efx_tx_qflush(txq->common) != 0) {
+ log(LOG_ERR, "%s: Flushing Tx queue %u failed\n",
+ device_get_nameunit(sc->dev), index);
+ txq->flush_state = SFXGE_FLUSH_DONE;
+ } else {
+ count = 0;
+ do {
+ /* Spin for 100ms. */
+ DELAY(100000);
+ if (txq->flush_state != SFXGE_FLUSH_PENDING)
+ break;
+ } while (++count < 20);
+ }
+ SFXGE_EVQ_LOCK(evq);
+ SFXGE_TXQ_LOCK(txq);
- KASSERT(txq->flush_state != SFXGE_FLUSH_FAILED,
- ("txq->flush_state == SFXGE_FLUSH_FAILED"));
+ KASSERT(txq->flush_state != SFXGE_FLUSH_FAILED,
+ ("txq->flush_state == SFXGE_FLUSH_FAILED"));
- txq->flush_state = SFXGE_FLUSH_DONE;
+ if (txq->flush_state != SFXGE_FLUSH_DONE) {
+ /* Flush timeout */
+ log(LOG_ERR, "%s: Cannot flush Tx queue %u\n",
+ device_get_nameunit(sc->dev), index);
+ txq->flush_state = SFXGE_FLUSH_DONE;
+ }
+ }
txq->blocked = 0;
txq->pending = txq->added;
@@ -1195,8 +1303,11 @@ sfxge_tx_qstart(struct sfxge_softc *sc, unsigned int index)
efsys_mem_t *esmp;
uint16_t flags;
struct sfxge_evq *evq;
+ unsigned int desc_index;
int rc;
+ SFXGE_ADAPTER_LOCK_ASSERT_OWNED(sc);
+
txq = sc->txq[index];
esmp = &txq->mem;
evq = sc->evq[txq->evq_index];
@@ -1231,15 +1342,19 @@ sfxge_tx_qstart(struct sfxge_softc *sc, unsigned int index)
/* Create the common code transmit queue. */
if ((rc = efx_tx_qcreate(sc->enp, index, txq->type, esmp,
sc->txq_entries, txq->buf_base_id, flags, evq->common,
- &txq->common)) != 0)
+ &txq->common, &desc_index)) != 0)
goto fail;
+ /* Initialise queue descriptor indexes */
+ txq->added = txq->pending = txq->completed = txq->reaped = desc_index;
+
SFXGE_TXQ_LOCK(txq);
/* Enable the transmit queue. */
efx_tx_qenable(txq->common);
txq->init_state = SFXGE_TXQ_STARTED;
+ txq->flush_state = SFXGE_FLUSH_REQUIRED;
SFXGE_TXQ_UNLOCK(txq);
@@ -1348,9 +1463,41 @@ sfxge_tx_qfini(struct sfxge_softc *sc, unsigned int index)
free(txq, M_SFXGE);
}
+/*
+ * Estimate maximum number of Tx descriptors required for TSO packet.
+ * With minimum MSS and maximum mbuf length we might need more (even
+ * than a ring-ful of descriptors), but this should not happen in
+ * practice except due to deliberate attack. In that case we will
+ * truncate the output at a packet boundary.
+ */
+static unsigned int
+sfxge_tx_max_pkt_desc(const struct sfxge_softc *sc, enum sfxge_txq_type type)
+{
+ /* One descriptor for every input fragment */
+ unsigned int max_descs = SFXGE_TX_MAPPING_MAX_SEG;
+
+ /* VLAN tagging Tx option descriptor may be required */
+ if (efx_nic_cfg_get(sc->enp)->enc_hw_tx_insert_vlan_enabled)
+ max_descs++;
+
+ if (type == SFXGE_TXQ_IP_TCP_UDP_CKSUM) {
+ /*
+ * Plus header and payload descriptor for each output segment.
+ * Minus one since header fragment is already counted.
+ */
+ max_descs += SFXGE_TSO_MAX_SEGS * 2 - 1;
+
+ /* FW assisted TSO requires one more descriptor per segment */
+ if (sc->tso_fw_assisted)
+ max_descs += SFXGE_TSO_MAX_SEGS;
+ }
+
+ return (max_descs);
+}
+
static int
sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index,
- enum sfxge_txq_type type, unsigned int evq_index)
+ enum sfxge_txq_type type, unsigned int evq_index)
{
char name[16];
struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->dev);
@@ -1392,7 +1539,7 @@ sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index,
}
/* Allocate pending descriptor array for batching writes. */
- txq->pend_desc = malloc(sizeof(efx_buffer_t) * sc->txq_entries,
+ txq->pend_desc = malloc(sizeof(efx_desc_t) * sc->txq_entries,
M_SFXGE, M_ZERO | M_WAITOK);
/* Allocate and initialise mbuf DMA mapping array. */
@@ -1475,6 +1622,9 @@ sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int txq_index,
txq->evq_index = evq_index;
txq->txq_index = txq_index;
txq->init_state = SFXGE_TXQ_INITIALIZED;
+ txq->hw_vlan_tci = 0;
+
+ txq->max_pkt_desc = sfxge_tx_max_pkt_desc(sc, type);
return (0);
@@ -1572,6 +1722,7 @@ sfxge_tx_fini(struct sfxge_softc *sc)
int
sfxge_tx_init(struct sfxge_softc *sc)
{
+ const efx_nic_cfg_t *encp = efx_nic_cfg_get(sc->enp);
struct sfxge_intr *intr;
int index;
int rc;
@@ -1583,6 +1734,12 @@ sfxge_tx_init(struct sfxge_softc *sc)
sc->txq_count = SFXGE_TXQ_NTYPES - 1 + sc->intr.n_alloc;
+ sc->tso_fw_assisted = sfxge_tso_fw_assisted;
+ if (sc->tso_fw_assisted)
+ sc->tso_fw_assisted =
+ (encp->enc_features & EFX_FEATURE_FW_ASSISTED_TSO) &&
+ (encp->enc_fw_assisted_tso_enabled);
+
sc->txqs_node = SYSCTL_ADD_NODE(
device_get_sysctl_ctx(sc->dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)),
diff --git a/sys/dev/sfxge/sfxge_tx.h b/sys/dev/sfxge/sfxge_tx.h
index 724ee22..3a1dd5b 100644
--- a/sys/dev/sfxge/sfxge_tx.h
+++ b/sys/dev/sfxge/sfxge_tx.h
@@ -1,30 +1,34 @@
/*-
- * Copyright (c) 2010-2011 Solarflare Communications, Inc.
+ * Copyright (c) 2010-2015 Solarflare Communications Inc.
* All rights reserved.
*
* This software was developed in part by Philip Paeps under contract for
* Solarflare Communications, Inc.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*
* $FreeBSD$
*/
@@ -164,10 +168,11 @@ struct sfxge_txq {
unsigned int buf_base_id;
unsigned int entries;
unsigned int ptr_mask;
+ unsigned int max_pkt_desc;
struct sfxge_tx_mapping *stmp; /* Packets in flight. */
bus_dma_tag_t packet_dma_tag;
- efx_buffer_t *pend_desc;
+ efx_desc_t *pend_desc;
efx_txq_t *common;
efsys_mem_t *tsoh_buffer;
@@ -187,6 +192,11 @@ struct sfxge_txq {
unsigned int n_pend_desc;
unsigned int added;
unsigned int reaped;
+
+ /* The last VLAN TCI seen on the queue if FW-assisted tagging is
+ used */
+ uint16_t hw_vlan_tci;
+
/* Statistics */
unsigned long tso_bursts;
unsigned long tso_packets;
@@ -210,7 +220,6 @@ struct sfxge_txq {
struct sfxge_evq;
-extern int sfxge_tx_packet_add(struct sfxge_txq *, struct mbuf *);
extern uint64_t sfxge_tx_get_drops(struct sfxge_softc *sc);
extern int sfxge_tx_init(struct sfxge_softc *sc);
diff --git a/sys/dev/sfxge/sfxge_version.h b/sys/dev/sfxge/sfxge_version.h
index d263451..f5f4882 100644
--- a/sys/dev/sfxge/sfxge_version.h
+++ b/sys/dev/sfxge/sfxge_version.h
@@ -1,30 +1,34 @@
/*-
- * Copyright (c) 2015 Solarflare Communications, Inc.
+ * Copyright (c) 2015 Solarflare Communications Inc.
* All rights reserved.
*
* This software was developed in part by OKTET Labs under contract for
* Solarflare Communications, Inc.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * modification, are permitted provided that the following conditions are met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of the FreeBSD Project.
*
* $FreeBSD$
*/
@@ -32,6 +36,6 @@
#ifndef _SFXGE_VERSION_H
#define _SFXGE_VERSION_H
-#define SFXGE_VERSION_STRING "v3.3.4.6365"
+#define SFXGE_VERSION_STRING "v4.5.2.1000"
#endif /* _SFXGE_DRIVER_VERSION_H */
diff --git a/sys/dev/uart/uart_dev_ns8250.c b/sys/dev/uart/uart_dev_ns8250.c
index 9ff295a..b2810a0 100644
--- a/sys/dev/uart/uart_dev_ns8250.c
+++ b/sys/dev/uart/uart_dev_ns8250.c
@@ -416,10 +416,10 @@ ns8250_bus_attach(struct uart_softc *sc)
* has broken txfifo.
*/
node = ofw_bus_get_node(sc->sc_dev);
- if ((OF_getprop(node, "busy-detect", &cell, sizeof(cell))) > 0)
- ns8250->busy_detect = 1;
- if ((OF_getprop(node, "broken-txfifo", &cell, sizeof(cell))) > 0)
- broken_txfifo = 1;
+ if ((OF_getencprop(node, "busy-detect", &cell, sizeof(cell))) > 0)
+ ns8250->busy_detect = cell ? 1 : 0;
+ if ((OF_getencprop(node, "broken-txfifo", &cell, sizeof(cell))) > 0)
+ broken_txfifo = cell ? 1 : 0;
#endif
bas = &sc->sc_bas;
diff --git a/sys/dev/usb/controller/dwc_otg.c b/sys/dev/usb/controller/dwc_otg.c
index 50ead5c..868c7c7 100644
--- a/sys/dev/usb/controller/dwc_otg.c
+++ b/sys/dev/usb/controller/dwc_otg.c
@@ -180,6 +180,22 @@ dwc_otg_get_hw_ep_profile(struct usb_device *udev,
*ppf = NULL;
}
+static void
+dwc_otg_tx_fifo_reset(struct dwc_otg_softc *sc, uint32_t value)
+{
+ uint32_t temp;
+
+ /* reset FIFO */
+ DWC_OTG_WRITE_4(sc, DOTG_GRSTCTL, value);
+
+ /* wait for reset to complete */
+ for (temp = 0; temp != 16; temp++) {
+ value = DWC_OTG_READ_4(sc, DOTG_GRSTCTL);
+ if (!(value & (GRSTCTL_TXFFLSH | GRSTCTL_RXFFLSH)))
+ break;
+ }
+}
+
static int
dwc_otg_init_fifo(struct dwc_otg_softc *sc, uint8_t mode)
{
@@ -331,12 +347,11 @@ dwc_otg_init_fifo(struct dwc_otg_softc *sc, uint8_t mode)
}
/* reset RX FIFO */
- DWC_OTG_WRITE_4(sc, DOTG_GRSTCTL,
- GRSTCTL_RXFFLSH);
+ dwc_otg_tx_fifo_reset(sc, GRSTCTL_RXFFLSH);
if (mode != DWC_MODE_OTG) {
/* reset all TX FIFOs */
- DWC_OTG_WRITE_4(sc, DOTG_GRSTCTL,
+ dwc_otg_tx_fifo_reset(sc,
GRSTCTL_TXFIFO(0x10) |
GRSTCTL_TXFFLSH);
} else {
@@ -947,15 +962,21 @@ dwc_otg_setup_rx(struct dwc_otg_softc *sc, struct dwc_otg_td *td)
if (GRXSTSRD_CHNUM_GET(sc->sc_last_rx_status) != 0)
goto not_complete;
- if ((sc->sc_last_rx_status & GRXSTSRD_DPID_MASK) !=
- GRXSTSRD_DPID_DATA0) {
+ if ((sc->sc_last_rx_status & GRXSTSRD_PKTSTS_MASK) !=
+ GRXSTSRD_STP_DATA) {
+ if ((sc->sc_last_rx_status & GRXSTSRD_PKTSTS_MASK) !=
+ GRXSTSRD_STP_COMPLETE || td->remainder != 0) {
+ /* release FIFO */
+ dwc_otg_common_rx_ack(sc);
+ goto not_complete;
+ }
/* release FIFO */
dwc_otg_common_rx_ack(sc);
- goto not_complete;
+ return (0); /* complete */
}
- if ((sc->sc_last_rx_status & GRXSTSRD_PKTSTS_MASK) !=
- GRXSTSRD_STP_DATA) {
+ if ((sc->sc_last_rx_status & GRXSTSRD_DPID_MASK) !=
+ GRXSTSRD_DPID_DATA0) {
/* release FIFO */
dwc_otg_common_rx_ack(sc);
goto not_complete;
@@ -969,14 +990,6 @@ dwc_otg_setup_rx(struct dwc_otg_softc *sc, struct dwc_otg_td *td)
/* get the packet byte count */
count = GRXSTSRD_BCNT_GET(sc->sc_last_rx_status);
- /* verify data length */
- if (count != td->remainder) {
- DPRINTFN(0, "Invalid SETUP packet "
- "length, %d bytes\n", count);
- /* release FIFO */
- dwc_otg_common_rx_ack(sc);
- goto not_complete;
- }
if (count != sizeof(req)) {
DPRINTFN(0, "Unsupported SETUP packet "
"length, %d bytes\n", count);
@@ -1002,43 +1015,27 @@ dwc_otg_setup_rx(struct dwc_otg_softc *sc, struct dwc_otg_td *td)
}
/* don't send any data by default */
- DWC_OTG_WRITE_4(sc, DOTG_DIEPTSIZ(0),
- DXEPTSIZ_SET_NPKT(0) |
- DXEPTSIZ_SET_NBYTES(0));
-
- temp = sc->sc_in_ctl[0];
-
- /* enable IN endpoint */
- DWC_OTG_WRITE_4(sc, DOTG_DIEPCTL(0),
- temp | DIEPCTL_EPENA);
- DWC_OTG_WRITE_4(sc, DOTG_DIEPCTL(0),
- temp | DIEPCTL_SNAK);
+ DWC_OTG_WRITE_4(sc, DOTG_DIEPTSIZ(0), DIEPCTL_EPDIS);
+ DWC_OTG_WRITE_4(sc, DOTG_DOEPTSIZ(0), DOEPCTL_EPDIS);
/* reset IN endpoint buffer */
- DWC_OTG_WRITE_4(sc, DOTG_GRSTCTL,
+ dwc_otg_tx_fifo_reset(sc,
GRSTCTL_TXFIFO(0) |
GRSTCTL_TXFFLSH);
/* acknowledge RX status */
dwc_otg_common_rx_ack(sc);
- return (0); /* complete */
+ td->did_stall = 1;
not_complete:
/* abort any ongoing transfer, before enabling again */
-
- temp = sc->sc_out_ctl[0];
-
- temp |= DOEPCTL_EPENA |
- DOEPCTL_SNAK;
-
- /* enable OUT endpoint */
- DWC_OTG_WRITE_4(sc, DOTG_DOEPCTL(0), temp);
-
if (!td->did_stall) {
td->did_stall = 1;
DPRINTFN(5, "stalling IN and OUT direction\n");
+ temp = sc->sc_out_ctl[0];
+
/* set stall after enabling endpoint */
DWC_OTG_WRITE_4(sc, DOTG_DOEPCTL(0),
temp | DOEPCTL_STALL);
@@ -1049,13 +1046,6 @@ not_complete:
DWC_OTG_WRITE_4(sc, DOTG_DIEPCTL(0),
temp | DIEPCTL_STALL);
}
-
- /* setup number of buffers to receive */
- DWC_OTG_WRITE_4(sc, DOTG_DOEPTSIZ(0),
- DXEPTSIZ_SET_MULTI(3) |
- DXEPTSIZ_SET_NPKT(1) |
- DXEPTSIZ_SET_NBYTES(sizeof(req)));
-
return (1); /* not complete */
}
@@ -1499,7 +1489,9 @@ dwc_otg_data_rx(struct dwc_otg_softc *sc, struct dwc_otg_td *td)
/* check for SETUP packet */
if ((sc->sc_last_rx_status & GRXSTSRD_PKTSTS_MASK) ==
- GRXSTSRD_STP_DATA) {
+ GRXSTSRD_STP_DATA ||
+ (sc->sc_last_rx_status & GRXSTSRD_PKTSTS_MASK) ==
+ GRXSTSRD_STP_COMPLETE) {
if (td->remainder == 0) {
/*
* We are actually complete and have
@@ -1584,15 +1576,10 @@ dwc_otg_data_rx(struct dwc_otg_softc *sc, struct dwc_otg_td *td)
not_complete:
- temp = sc->sc_out_ctl[td->ep_no];
-
- temp |= DOEPCTL_EPENA | DOEPCTL_CNAK;
-
- DWC_OTG_WRITE_4(sc, DOTG_DOEPCTL(td->ep_no), temp);
-
/* enable SETUP and transfer complete interrupt */
if (td->ep_no == 0) {
DWC_OTG_WRITE_4(sc, DOTG_DOEPTSIZ(0),
+ DXEPTSIZ_SET_MULTI(3) |
DXEPTSIZ_SET_NPKT(1) |
DXEPTSIZ_SET_NBYTES(td->max_packet_size));
} else {
@@ -1601,8 +1588,12 @@ not_complete:
DXEPTSIZ_SET_MULTI(1) |
DXEPTSIZ_SET_NPKT(4) |
DXEPTSIZ_SET_NBYTES(4 *
- ((td->max_packet_size + 3) & ~3)));
+ ((td->max_packet_size + 3) & ~3)));
}
+ temp = sc->sc_out_ctl[td->ep_no];
+ DWC_OTG_WRITE_4(sc, DOTG_DOEPCTL(td->ep_no), temp |
+ DOEPCTL_EPENA | DOEPCTL_CNAK);
+
return (1); /* not complete */
}
@@ -2004,7 +1995,9 @@ repeat:
(GRXSTSRD_CHNUM_GET(temp) == 0)) {
if ((temp & GRXSTSRD_PKTSTS_MASK) !=
- GRXSTSRD_STP_DATA) {
+ GRXSTSRD_STP_DATA &&
+ (temp & GRXSTSRD_PKTSTS_MASK) !=
+ GRXSTSRD_STP_COMPLETE) {
/* dump data - wrong direction */
dwc_otg_common_rx_ack(sc);
@@ -2209,7 +2202,9 @@ not_complete:
(GRXSTSRD_CHNUM_GET(temp) == 0)) {
if ((temp & GRXSTSRD_PKTSTS_MASK) ==
- GRXSTSRD_STP_DATA) {
+ GRXSTSRD_STP_DATA ||
+ (temp & GRXSTSRD_PKTSTS_MASK) ==
+ GRXSTSRD_STP_COMPLETE) {
DPRINTFN(5, "faking complete\n");
/*
* Race condition: We are complete!
@@ -2634,6 +2629,7 @@ repeat:
/* non-data messages we simply skip */
if (temp != GRXSTSRD_STP_DATA &&
+ temp != GRXSTSRD_STP_COMPLETE &&
temp != GRXSTSRD_OUT_DATA) {
dwc_otg_common_rx_ack(sc);
goto repeat;
@@ -3669,7 +3665,7 @@ dwc_otg_clear_stall_sub_locked(struct dwc_otg_softc *sc, uint32_t mps,
/* we only reset the transmit FIFO */
if (ep_dir) {
- DWC_OTG_WRITE_4(sc, DOTG_GRSTCTL,
+ dwc_otg_tx_fifo_reset(sc,
GRSTCTL_TXFIFO(ep_no) |
GRSTCTL_TXFFLSH);
diff --git a/sys/dev/usb/misc/ugold.c b/sys/dev/usb/misc/ugold.c
new file mode 100644
index 0000000..d6f8f77
--- /dev/null
+++ b/sys/dev/usb/misc/ugold.c
@@ -0,0 +1,405 @@
+/* $OpenBSD: ugold.c,v 1.7 2014/12/11 18:39:27 mpi Exp $ */
+
+/*
+ * Copyright (c) 2013 Takayoshi SASANO <sasano@openbsd.org>
+ * Copyright (c) 2013 Martin Pieuchot <mpi@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* Driver for Microdia's HID based TEMPer Temperature sensor */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <sys/param.h>
+#include <sys/queue.h>
+#include <sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/module.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+#include <sys/conf.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+#include <dev/usb/usbhid.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usbdi_util.h>
+#include "usbdevs.h"
+
+#define USB_DEBUG_VAR usb_debug
+#include <dev/usb/usb_debug.h>
+
+#define UGOLD_INNER 0
+#define UGOLD_OUTER 1
+#define UGOLD_MAX_SENSORS 2
+
+#define UGOLD_CMD_DATA 0x80
+#define UGOLD_CMD_INIT 0x82
+
+enum {
+ UGOLD_INTR_DT,
+ UGOLD_N_TRANSFER,
+};
+
+/*
+ * This driver only uses two of the three known commands for the
+ * TEMPerV1.2 device.
+ *
+ * The first byte of the answer corresponds to the command and the
+ * second one seems to be the size (in bytes) of the answer.
+ *
+ * The device always sends 8 bytes and if the length of the answer
+ * is less than that, it just leaves the last bytes untouched. That
+ * is why most of the time the last n bytes of the answers are the
+ * same.
+ *
+ * The third command below seems to generate two answers with a
+ * string corresponding to the device, for example:
+ * 'TEMPer1F' and '1.1Per1F' (here Per1F is repeated).
+ */
+static uint8_t cmd_data[8] = {0x01, 0x80, 0x33, 0x01, 0x00, 0x00, 0x00, 0x00};
+static uint8_t cmd_init[8] = {0x01, 0x82, 0x77, 0x01, 0x00, 0x00, 0x00, 0x00};
+
+#if 0
+static uint8_t cmd_type[8] = {0x01, 0x86, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00};
+
+#endif
+
+struct ugold_softc;
+struct ugold_readout_msg {
+ struct usb_proc_msg hdr;
+ struct ugold_softc *sc;
+};
+
+struct ugold_softc {
+ struct usb_device *sc_udev;
+ struct usb_xfer *sc_xfer[UGOLD_N_TRANSFER];
+
+ struct callout sc_callout;
+ struct mtx sc_mtx;
+ struct ugold_readout_msg sc_readout_msg[2];
+
+ int sc_num_sensors;
+ int sc_sensor[UGOLD_MAX_SENSORS];
+ int sc_calib[UGOLD_MAX_SENSORS];
+ int sc_valid[UGOLD_MAX_SENSORS];
+ uint8_t sc_report_id;
+ uint8_t sc_iface_index[2];
+};
+
+/* prototypes */
+
+static device_probe_t ugold_probe;
+static device_attach_t ugold_attach;
+static device_detach_t ugold_detach;
+
+static usb_proc_callback_t ugold_readout_msg;
+
+static usb_callback_t ugold_intr_callback;
+
+static devclass_t ugold_devclass;
+
+static device_method_t ugold_methods[] = {
+ DEVMETHOD(device_probe, ugold_probe),
+ DEVMETHOD(device_attach, ugold_attach),
+ DEVMETHOD(device_detach, ugold_detach),
+
+ DEVMETHOD_END
+};
+
+static driver_t ugold_driver = {
+ .name = "ugold",
+ .methods = ugold_methods,
+ .size = sizeof(struct ugold_softc),
+};
+
+DRIVER_MODULE(ugold, uhub, ugold_driver, ugold_devclass, NULL, NULL);
+MODULE_DEPEND(ugold, usb, 1, 1, 1);
+MODULE_VERSION(ugold, 1);
+
+static const struct usb_config ugold_config[UGOLD_N_TRANSFER] = {
+
+ [UGOLD_INTR_DT] = {
+ .type = UE_INTERRUPT,
+ .endpoint = UE_ADDR_ANY,
+ .direction = UE_DIR_IN,
+ .flags = {.pipe_bof = 1,.short_xfer_ok = 1,},
+ .bufsize = 0, /* use wMaxPacketSize */
+ .callback = &ugold_intr_callback,
+ .if_index = 1,
+ },
+};
+
+static const STRUCT_USB_HOST_ID ugold_devs[] = {
+ {USB_VPI(USB_VENDOR_CHICONY2, USB_PRODUCT_CHICONY2_TEMPER, 0)},
+};
+
+static void
+ugold_timeout(void *arg)
+{
+ struct ugold_softc *sc = arg;
+
+ usb_proc_explore_lock(sc->sc_udev);
+ (void)usb_proc_explore_msignal(sc->sc_udev,
+ &sc->sc_readout_msg[0], &sc->sc_readout_msg[1]);
+ usb_proc_explore_unlock(sc->sc_udev);
+
+ callout_reset(&sc->sc_callout, 6 * hz, &ugold_timeout, sc);
+}
+
+static int
+ugold_probe(device_t dev)
+{
+ struct usb_attach_arg *uaa;
+
+ uaa = device_get_ivars(dev);
+ if (uaa->usb_mode != USB_MODE_HOST)
+ return (ENXIO);
+ if (uaa->info.bInterfaceClass != UICLASS_HID)
+ return (ENXIO);
+ if (uaa->info.bIfaceIndex != 0)
+ return (ENXIO);
+
+ return (usbd_lookup_id_by_uaa(ugold_devs, sizeof(ugold_devs), uaa));
+}
+
+static int
+ugold_attach(device_t dev)
+{
+ struct ugold_softc *sc = device_get_softc(dev);
+ struct usb_attach_arg *uaa = device_get_ivars(dev);
+ struct sysctl_oid *sensor_tree;
+ uint16_t d_len;
+ void *d_ptr;
+ int error;
+ int i;
+
+ sc->sc_udev = uaa->device;
+ sc->sc_readout_msg[0].hdr.pm_callback = &ugold_readout_msg;
+ sc->sc_readout_msg[0].sc = sc;
+ sc->sc_readout_msg[1].hdr.pm_callback = &ugold_readout_msg;
+ sc->sc_readout_msg[1].sc = sc;
+ sc->sc_iface_index[0] = uaa->info.bIfaceIndex;
+ sc->sc_iface_index[1] = uaa->info.bIfaceIndex + 1;
+
+ device_set_usb_desc(dev);
+ mtx_init(&sc->sc_mtx, "ugold lock", NULL, MTX_DEF | MTX_RECURSE);
+ callout_init_mtx(&sc->sc_callout, &sc->sc_mtx, 0);
+
+ /* grab all interfaces from other drivers */
+ for (i = 0;; i++) {
+ if (i == uaa->info.bIfaceIndex)
+ continue;
+ if (usbd_get_iface(uaa->device, i) == NULL)
+ break;
+
+ usbd_set_parent_iface(uaa->device, i, uaa->info.bIfaceIndex);
+ }
+
+ /* figure out report ID */
+ error = usbd_req_get_hid_desc(uaa->device, NULL,
+ &d_ptr, &d_len, M_TEMP, uaa->info.bIfaceIndex);
+
+ if (error)
+ goto detach;
+
+ (void)hid_report_size(d_ptr, d_len, hid_input, &sc->sc_report_id);
+
+ free(d_ptr, M_TEMP);
+
+ error = usbd_transfer_setup(uaa->device,
+ sc->sc_iface_index, sc->sc_xfer, ugold_config,
+ UGOLD_N_TRANSFER, sc, &sc->sc_mtx);
+ if (error)
+ goto detach;
+
+ sensor_tree = SYSCTL_ADD_NODE(device_get_sysctl_ctx(dev),
+ SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "sensors",
+ CTLFLAG_RD, NULL, "");
+
+ if (sensor_tree == NULL) {
+ error = ENOMEM;
+ goto detach;
+ }
+ SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),
+ SYSCTL_CHILDREN(sensor_tree),
+ OID_AUTO, "inner", CTLFLAG_RD, &sc->sc_sensor[UGOLD_INNER], 0,
+ "Inner temperature in microCelcius");
+
+ SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),
+ SYSCTL_CHILDREN(sensor_tree),
+ OID_AUTO, "inner_valid", CTLFLAG_RD, &sc->sc_valid[UGOLD_INNER], 0,
+ "Inner temperature is valid");
+
+ SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),
+ SYSCTL_CHILDREN(sensor_tree),
+ OID_AUTO, "inner_calib", CTLFLAG_RWTUN, &sc->sc_calib[UGOLD_INNER], 0,
+ "Inner calibration temperature in microCelcius");
+
+ SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),
+ SYSCTL_CHILDREN(sensor_tree),
+ OID_AUTO, "outer", CTLFLAG_RD, &sc->sc_sensor[UGOLD_OUTER], 0,
+ "Outer temperature in microCelcius");
+
+ SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),
+ SYSCTL_CHILDREN(sensor_tree),
+ OID_AUTO, "outer_calib", CTLFLAG_RWTUN, &sc->sc_calib[UGOLD_OUTER], 0,
+ "Outer calibration temperature in microCelcius");
+
+ SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),
+ SYSCTL_CHILDREN(sensor_tree),
+ OID_AUTO, "outer_valid", CTLFLAG_RD, &sc->sc_valid[UGOLD_OUTER], 0,
+ "Outer temperature is valid");
+
+ mtx_lock(&sc->sc_mtx);
+ usbd_transfer_start(sc->sc_xfer[UGOLD_INTR_DT]);
+ ugold_timeout(sc);
+ mtx_unlock(&sc->sc_mtx);
+
+ return (0);
+
+detach:
+ DPRINTF("error=%s\n", usbd_errstr(error));
+ ugold_detach(dev);
+ return (error);
+}
+
+static int
+ugold_detach(device_t dev)
+{
+ struct ugold_softc *sc = device_get_softc(dev);
+
+ callout_drain(&sc->sc_callout);
+
+ usb_proc_explore_lock(sc->sc_udev);
+ usb_proc_explore_mwait(sc->sc_udev,
+ &sc->sc_readout_msg[0], &sc->sc_readout_msg[1]);
+ usb_proc_explore_unlock(sc->sc_udev);
+
+ usbd_transfer_unsetup(sc->sc_xfer, UGOLD_N_TRANSFER);
+
+ mtx_destroy(&sc->sc_mtx);
+
+ return (0);
+}
+
+static int
+ugold_ds75_temp(uint8_t msb, uint8_t lsb)
+{
+ /* DS75: 12bit precision mode : 0.0625 degrees Celsius ticks */
+ /* NOTE: MSB has a sign bit for negative temperatures */
+ int32_t temp = (msb << 24) | ((lsb & 0xF0) << 16);
+ return (((int64_t)temp * (int64_t)1000000LL) >> 24);
+}
+
+
+static void
+ugold_intr_callback(struct usb_xfer *xfer, usb_error_t error)
+{
+ struct ugold_softc *sc = usbd_xfer_softc(xfer);
+ struct usb_page_cache *pc;
+ uint8_t buf[8];
+ int temp;
+ int len;
+
+ usbd_xfer_status(xfer, &len, NULL, NULL, NULL);
+
+ switch (USB_GET_STATE(xfer)) {
+ case USB_ST_TRANSFERRED:
+ memset(buf, 0, sizeof(buf));
+
+ pc = usbd_xfer_get_frame(xfer, 0);
+ usbd_copy_out(pc, 0, buf, MIN(len, sizeof(buf)));
+
+ switch (buf[0]) {
+ case UGOLD_CMD_INIT:
+ if (sc->sc_num_sensors)
+ break;
+
+ sc->sc_num_sensors = MIN(buf[1], UGOLD_MAX_SENSORS) /* XXX */ ;
+
+ DPRINTF("%d sensor%s type ds75/12bit (temperature)\n",
+ sc->sc_num_sensors, (sc->sc_num_sensors == 1) ? "" : "s");
+ break;
+ case UGOLD_CMD_DATA:
+ switch (buf[1]) {
+ case 4:
+ temp = ugold_ds75_temp(buf[4], buf[5]);
+ sc->sc_sensor[UGOLD_OUTER] = temp + sc->sc_calib[UGOLD_OUTER];
+ sc->sc_valid[UGOLD_OUTER] = 1;
+ /* FALLTHROUGH */
+ case 2:
+ temp = ugold_ds75_temp(buf[2], buf[3]);
+ sc->sc_sensor[UGOLD_INNER] = temp + sc->sc_calib[UGOLD_INNER];
+ sc->sc_valid[UGOLD_INNER] = 1;
+ break;
+ default:
+ DPRINTF("invalid data length (%d bytes)\n", buf[1]);
+ }
+ break;
+ default:
+ DPRINTF("unknown command 0x%02x\n", buf[0]);
+ break;
+ }
+ /* FALLTHROUGH */
+ case USB_ST_SETUP:
+tr_setup:
+ usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer));
+ usbd_transfer_submit(xfer);
+ break;
+ default: /* Error */
+ if (error != USB_ERR_CANCELLED) {
+ /* try clear stall first */
+ usbd_xfer_set_stall(xfer);
+ goto tr_setup;
+ }
+ break;
+ }
+}
+
+static int
+ugold_issue_cmd(struct ugold_softc *sc, uint8_t *cmd, int len)
+{
+ return (usbd_req_set_report(sc->sc_udev, &sc->sc_mtx, cmd, len,
+ sc->sc_iface_index[1], UHID_OUTPUT_REPORT, sc->sc_report_id));
+}
+
+static void
+ugold_readout_msg(struct usb_proc_msg *pm)
+{
+ struct ugold_softc *sc = ((struct ugold_readout_msg *)pm)->sc;
+
+ usb_proc_explore_unlock(sc->sc_udev);
+
+ mtx_lock(&sc->sc_mtx);
+ if (sc->sc_num_sensors == 0)
+ ugold_issue_cmd(sc, cmd_init, sizeof(cmd_init));
+
+ ugold_issue_cmd(sc, cmd_data, sizeof(cmd_data));
+ mtx_unlock(&sc->sc_mtx);
+
+ usb_proc_explore_lock(sc->sc_udev);
+}
diff --git a/sys/dev/usb/quirk/usb_quirk.c b/sys/dev/usb/quirk/usb_quirk.c
index 3cfaef0..c756b24 100644
--- a/sys/dev/usb/quirk/usb_quirk.c
+++ b/sys/dev/usb/quirk/usb_quirk.c
@@ -94,6 +94,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRKS_MAX] = {
USB_QUIRK(SILICONPORTALS, YAPPHONE, 0x100, 0x100, UQ_AU_INP_ASYNC),
USB_QUIRK(LOGITECH, UN53B, 0x0000, 0xffff, UQ_NO_STRINGS),
USB_QUIRK(REALTEK, RTL8196EU, 0x0000, 0xffff, UQ_CFG_INDEX_1),
+ USB_QUIRK(REALTEK, RTL8153, 0x0000, 0xffff, UQ_CFG_INDEX_1),
USB_QUIRK(ELSA, MODEM1, 0x0000, 0xffff, UQ_CFG_INDEX_1),
USB_QUIRK(PLANEX2, MZKUE150N, 0x0000, 0xffff, UQ_CFG_INDEX_1),
/* Quirks for printer devices */
diff --git a/sys/dev/usb/template/usb_template.c b/sys/dev/usb/template/usb_template.c
index 49bd373..140c0b9 100644
--- a/sys/dev/usb/template/usb_template.c
+++ b/sys/dev/usb/template/usb_template.c
@@ -1374,6 +1374,9 @@ usb_temp_setup_by_index(struct usb_device *udev, uint16_t index)
case USB_TEMP_SERIALNET:
err = usb_temp_setup(udev, &usb_template_serialnet);
break;
+ case USB_TEMP_MIDI:
+ err = usb_temp_setup(udev, &usb_template_midi);
+ break;
default:
return (USB_ERR_INVAL);
}
diff --git a/sys/dev/usb/template/usb_template.h b/sys/dev/usb/template/usb_template.h
index 484608d..1b320c6 100644
--- a/sys/dev/usb/template/usb_template.h
+++ b/sys/dev/usb/template/usb_template.h
@@ -107,6 +107,7 @@ extern const struct usb_temp_device_desc usb_template_msc;
extern const struct usb_temp_device_desc usb_template_mtp;
extern const struct usb_temp_device_desc usb_template_phone;
extern const struct usb_temp_device_desc usb_template_serialnet;
+extern const struct usb_temp_device_desc usb_template_midi;
usb_error_t usb_temp_setup(struct usb_device *,
const struct usb_temp_device_desc *);
diff --git a/sys/dev/usb/template/usb_template_midi.c b/sys/dev/usb/template/usb_template_midi.c
new file mode 100644
index 0000000..9be1b9e
--- /dev/null
+++ b/sys/dev/usb/template/usb_template_midi.c
@@ -0,0 +1,240 @@
+/* $FreeBSD$ */
+/*-
+ * Copyright (c) 2015 Hans Petter Selasky. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * This file contains the USB template for an USB MIDI Device.
+ */
+
+#ifdef USB_GLOBAL_INCLUDE_FILE
+#include USB_GLOBAL_INCLUDE_FILE
+#else
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <sys/param.h>
+#include <sys/queue.h>
+#include <sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/module.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+#include <dev/usb/usb_core.h>
+
+#include <dev/usb/template/usb_template.h>
+#endif /* USB_GLOBAL_INCLUDE_FILE */
+
+enum {
+ INDEX_MIDI_LANG,
+ INDEX_MIDI_IF,
+ INDEX_MIDI_PRODUCT,
+ INDEX_MIDI_MAX,
+};
+
+#define STRING_MIDI_PRODUCT \
+ "M\0I\0D\0I\0 \0T\0e\0s\0t\0 \0D\0e\0v\0i\0c\0e"
+
+#define STRING_MIDI_IF \
+ "M\0I\0D\0I\0 \0i\0n\0t\0e\0r\0f\0a\0c\0e"
+
+/* make the real string descriptors */
+
+USB_MAKE_STRING_DESC(STRING_MIDI_IF, string_midi_if);
+USB_MAKE_STRING_DESC(STRING_MIDI_PRODUCT, string_midi_product);
+
+/* prototypes */
+
+static const uint8_t midi_desc_raw_0[9] = {
+ 0x09, 0x24, 0x01, 0x00, 0x01, 0x09, 0x00, 0x01, 0x01
+};
+
+static const void *midi_descs_0[] = {
+ &midi_desc_raw_0,
+ NULL
+};
+
+static const struct usb_temp_interface_desc midi_iface_0 = {
+ .ppEndpoints = NULL, /* no endpoints */
+ .ppRawDesc = midi_descs_0,
+ .bInterfaceClass = 1,
+ .bInterfaceSubClass = 1,
+ .bInterfaceProtocol = 0,
+ .iInterface = INDEX_MIDI_IF,
+};
+
+static const struct usb_temp_packet_size midi_mps = {
+ .mps[USB_SPEED_LOW] = 8,
+ .mps[USB_SPEED_FULL] = 64,
+ .mps[USB_SPEED_HIGH] = 512,
+};
+
+static const uint8_t midi_desc_raw_7[5] = {
+ 0x05, 0x25, 0x01, 0x01, 0x01
+};
+
+static const void *midi_descs_2[] = {
+ &midi_desc_raw_7,
+ NULL
+};
+
+static const struct usb_temp_endpoint_desc midi_bulk_out_ep = {
+ .ppRawDesc = midi_descs_2,
+ .pPacketSize = &midi_mps,
+ .bEndpointAddress = UE_DIR_OUT,
+ .bmAttributes = UE_BULK,
+};
+
+static const uint8_t midi_desc_raw_6[5] = {
+ 0x05, 0x25, 0x01, 0x01, 0x03,
+};
+
+static const void *midi_descs_3[] = {
+ &midi_desc_raw_6,
+ NULL
+};
+
+static const struct usb_temp_endpoint_desc midi_bulk_in_ep = {
+ .ppRawDesc = midi_descs_3,
+ .pPacketSize = &midi_mps,
+ .bEndpointAddress = UE_DIR_IN,
+ .bmAttributes = UE_BULK,
+};
+
+static const struct usb_temp_endpoint_desc *midi_iface_1_ep[] = {
+ &midi_bulk_out_ep,
+ &midi_bulk_in_ep,
+ NULL,
+};
+
+static const uint8_t midi_desc_raw_1[7] = {
+ 0x07, 0x24, 0x01, 0x00, 0x01, /* wTotalLength: */ 0x41, 0x00
+};
+
+static const uint8_t midi_desc_raw_2[6] = {
+ 0x06, 0x24, 0x02, 0x01, 0x01, 0x00
+};
+
+static const uint8_t midi_desc_raw_3[6] = {
+ 0x06, 0x24, 0x02, 0x02, 0x02, 0x00
+};
+
+static const uint8_t midi_desc_raw_4[9] = {
+ 0x09, 0x24, 0x03, 0x01, 0x03, 0x01, 0x02, 0x01, 0x00
+};
+
+static const uint8_t midi_desc_raw_5[9] = {
+ 0x09, 0x24, 0x03, 0x02, 0x04, 0x01, 0x01, 0x01, 0x00
+};
+
+static const void *midi_descs_1[] = {
+ &midi_desc_raw_1,
+ &midi_desc_raw_2,
+ &midi_desc_raw_3,
+ &midi_desc_raw_4,
+ &midi_desc_raw_5,
+ NULL
+};
+
+static const struct usb_temp_interface_desc midi_iface_1 = {
+ .ppRawDesc = midi_descs_1,
+ .ppEndpoints = midi_iface_1_ep,
+ .bInterfaceClass = 0x01, /* MIDI */
+ .bInterfaceSubClass = 3, /* MIDI streaming */
+ .bInterfaceProtocol = 0,
+ .iInterface = INDEX_MIDI_IF,
+};
+
+static const struct usb_temp_interface_desc *midi_interfaces[] = {
+ &midi_iface_0,
+ &midi_iface_1,
+ NULL,
+};
+
+static const struct usb_temp_config_desc midi_config_desc = {
+ .ppIfaceDesc = midi_interfaces,
+ .bmAttributes = UC_BUS_POWERED,
+ .bMaxPower = 25, /* 50 mA */
+ .iConfiguration = INDEX_MIDI_PRODUCT,
+};
+
+static const struct usb_temp_config_desc *midi_configs[] = {
+ &midi_config_desc,
+ NULL,
+};
+
+static usb_temp_get_string_desc_t midi_get_string_desc;
+
+const struct usb_temp_device_desc usb_template_midi = {
+ .getStringDesc = &midi_get_string_desc,
+ .ppConfigDesc = midi_configs,
+ .idVendor = USB_TEMPLATE_VENDOR,
+ .idProduct = 0x00BB,
+ .bcdDevice = 0x0100,
+ .bDeviceClass = 0,
+ .bDeviceSubClass = 0,
+ .bDeviceProtocol = 0,
+ .iManufacturer = 0,
+ .iProduct = INDEX_MIDI_PRODUCT,
+ .iSerialNumber = 0,
+};
+
+/*------------------------------------------------------------------------*
+ * midi_get_string_desc
+ *
+ * Return values:
+ * NULL: Failure. No such string.
+ * Else: Success. Pointer to string descriptor is returned.
+ *------------------------------------------------------------------------*/
+static const void *
+midi_get_string_desc(uint16_t lang_id, uint8_t string_index)
+{
+ static const void *ptr[INDEX_MIDI_MAX] = {
+ [INDEX_MIDI_LANG] = &usb_string_lang_en,
+ [INDEX_MIDI_IF] = &string_midi_if,
+ [INDEX_MIDI_PRODUCT] = &string_midi_product,
+ };
+
+ if (string_index == 0) {
+ return (&usb_string_lang_en);
+ }
+ if (lang_id != 0x0409) {
+ return (NULL);
+ }
+ if (string_index < INDEX_MIDI_MAX) {
+ return (ptr[string_index]);
+ }
+ return (NULL);
+}
diff --git a/sys/dev/usb/usb_dev.c b/sys/dev/usb/usb_dev.c
index 1076a9f..c48bfc9 100644
--- a/sys/dev/usb/usb_dev.c
+++ b/sys/dev/usb/usb_dev.c
@@ -830,7 +830,8 @@ usb_fifo_close(struct usb_fifo *f, int fflags)
(!f->flag_iserror)) {
/* wait until all data has been written */
f->flag_sleeping = 1;
- err = cv_wait_sig(&f->cv_io, f->priv_mtx);
+ err = cv_timedwait_sig(&f->cv_io, f->priv_mtx,
+ USB_MS_TO_TICKS(USB_DEFAULT_TIMEOUT));
if (err) {
DPRINTF("signal received\n");
break;
diff --git a/sys/dev/usb/usb_ioctl.h b/sys/dev/usb/usb_ioctl.h
index 539f881..683f3e6 100644
--- a/sys/dev/usb/usb_ioctl.h
+++ b/sys/dev/usb/usb_ioctl.h
@@ -66,6 +66,7 @@ enum {
USB_TEMP_MOUSE, /* USB Mouse */
USB_TEMP_PHONE, /* USB Phone */
USB_TEMP_SERIALNET, /* USB CDC Ethernet and Modem */
+ USB_TEMP_MIDI, /* USB MIDI */
USB_TEMP_MAX,
};
diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs
index f8ba5b5..aaf1d67 100644
--- a/sys/dev/usb/usbdevs
+++ b/sys/dev/usb/usbdevs
@@ -525,7 +525,7 @@ vendor DMI 0x0c0b DMI
vendor CANYON 0x0c10 Canyon
vendor ICOM 0x0c26 Icom Inc.
vendor GNOTOMETRICS 0x0c33 GN Otometrics
-vendor CHICONY2 0x0c45 Chicony
+vendor CHICONY2 0x0c45 Chicony / Microdia / Sonix Technology Co., Ltd.
vendor REINERSCT 0x0c4b Reiner-SCT
vendor SEALEVEL 0x0c52 Sealevel System
vendor JETI 0x0c6c Jeti
@@ -3050,6 +3050,11 @@ product MGE UPS2 0xffff MGE UPS SYSTEMS PROTECTIONCENTER 2
product MEI CASHFLOW_SC 0x1100 Cashflow-SC Cash Acceptor
product MEI S2000 0x1101 Series 2000 Combo Acceptor
+/* Microdia / Sonix Techonology Co., Ltd. products */
+product CHICONY2 YUREX 0x1010 YUREX
+product CHICONY2 CAM_1 0x62c0 CAM_1
+product CHICONY2 TEMPER 0x7401 TEMPer sensor
+
/* Micro Star International products */
product MSI BT_DONGLE 0x1967 Bluetooth USB dongle
product MSI RT3070_1 0x3820 RT3070
@@ -3748,6 +3753,7 @@ product REALTEK USB20CRW 0x0158 USB20CRW Card Reader
product REALTEK RTL8188ETV 0x0179 RTL8188ETV
product REALTEK RTL8188CTV 0x018a RTL8188CTV
product REALTEK USBKR100 0x8150 USBKR100 USB Ethernet
+product REALTEK RTL8153 0x8153 RTL8153 USB Ethernet
product REALTEK RTL8188CE_0 0x8170 RTL8188CE
product REALTEK RTL8171 0x8171 RTL8171
product REALTEK RTL8172 0x8172 RTL8172
diff --git a/sys/dev/usb/wlan/if_rsu.c b/sys/dev/usb/wlan/if_rsu.c
index 677775c..89b8c00 100644
--- a/sys/dev/usb/wlan/if_rsu.c
+++ b/sys/dev/usb/wlan/if_rsu.c
@@ -142,7 +142,7 @@ static void rsu_vap_delete(struct ieee80211vap *);
static void rsu_scan_start(struct ieee80211com *);
static void rsu_scan_end(struct ieee80211com *);
static void rsu_set_channel(struct ieee80211com *);
-static void rsu_update_mcast(struct ifnet *);
+static void rsu_update_mcast(struct ieee80211com *);
static int rsu_alloc_rx_list(struct rsu_softc *);
static void rsu_free_rx_list(struct rsu_softc *);
static int rsu_alloc_tx_list(struct rsu_softc *);
@@ -355,6 +355,8 @@ rsu_attach(device_t self)
ifp->if_hwassist = CSUM_TCP;
ic->ic_ifp = ifp;
+ ic->ic_softc = sc;
+ ic->ic_name = device_get_nameunit(self);
ic->ic_phytype = IEEE80211_T_OFDM; /* Not only, but not used. */
ic->ic_opmode = IEEE80211_M_STA; /* Default to BSS mode. */
@@ -532,7 +534,7 @@ rsu_set_channel(struct ieee80211com *ic __unused)
}
static void
-rsu_update_mcast(struct ifnet *ifp)
+rsu_update_mcast(struct ieee80211com *ic)
{
/* XXX do nothing? */
}
diff --git a/sys/dev/usb/wlan/if_rum.c b/sys/dev/usb/wlan/if_rum.c
index a3dc562..d5142ea 100644
--- a/sys/dev/usb/wlan/if_rum.c
+++ b/sys/dev/usb/wlan/if_rum.c
@@ -201,8 +201,8 @@ static void rum_enable_tsf(struct rum_softc *);
static void rum_update_slot(struct ifnet *);
static void rum_set_bssid(struct rum_softc *, const uint8_t *);
static void rum_set_macaddr(struct rum_softc *, const uint8_t *);
-static void rum_update_mcast(struct ifnet *);
-static void rum_update_promisc(struct ifnet *);
+static void rum_update_mcast(struct ieee80211com *);
+static void rum_update_promisc(struct ieee80211com *);
static void rum_setpromisc(struct rum_softc *);
static const char *rum_get_rf(int);
static void rum_read_eeprom(struct rum_softc *);
@@ -488,6 +488,8 @@ rum_attach(device_t self)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_softc = sc;
+ ic->ic_name = device_get_nameunit(self);
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
/* set device capabilities */
@@ -1841,11 +1843,11 @@ rum_setpromisc(struct rum_softc *sc)
}
static void
-rum_update_promisc(struct ifnet *ifp)
+rum_update_promisc(struct ieee80211com *ic)
{
- struct rum_softc *sc = ifp->if_softc;
+ struct rum_softc *sc = ic->ic_softc;
- if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+ if ((ic->ic_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
return;
RUM_LOCK(sc);
@@ -1854,12 +1856,12 @@ rum_update_promisc(struct ifnet *ifp)
}
static void
-rum_update_mcast(struct ifnet *ifp)
+rum_update_mcast(struct ieee80211com *ic)
{
static int warning_printed;
if (warning_printed == 0) {
- if_printf(ifp, "need to implement %s\n", __func__);
+ ic_printf(ic, "need to implement %s\n", __func__);
warning_printed = 1;
}
}
diff --git a/sys/dev/usb/wlan/if_run.c b/sys/dev/usb/wlan/if_run.c
index 22cc180..ac14178 100644
--- a/sys/dev/usb/wlan/if_run.c
+++ b/sys/dev/usb/wlan/if_run.c
@@ -439,12 +439,12 @@ static void run_set_basicrates(struct run_softc *);
static void run_set_leds(struct run_softc *, uint16_t);
static void run_set_bssid(struct run_softc *, const uint8_t *);
static void run_set_macaddr(struct run_softc *, const uint8_t *);
-static void run_updateslot(struct ifnet *);
+static void run_updateslot(struct ieee80211com *);
static void run_updateslot_cb(void *);
-static void run_update_mcast(struct ifnet *);
+static void run_update_mcast(struct ieee80211com *);
static int8_t run_rssi2dbm(struct run_softc *, uint8_t, uint8_t);
-static void run_update_promisc_locked(struct ifnet *);
-static void run_update_promisc(struct ifnet *);
+static void run_update_promisc_locked(struct run_softc *);
+static void run_update_promisc(struct ieee80211com *);
static void run_rt5390_bbp_init(struct run_softc *);
static int run_bbp_init(struct run_softc *);
static int run_rt3070_rf_init(struct run_softc *);
@@ -776,6 +776,8 @@ run_attach(device_t self)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_softc = sc;
+ ic->ic_name = device_get_nameunit(self);
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
ic->ic_opmode = IEEE80211_M_STA; /* default to BSS mode */
@@ -2137,7 +2139,7 @@ run_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
IEEE80211_LOCK(ic);
return (-1);
}
- run_updateslot(ic->ic_ifp);
+ run_updateslot(ic);
run_enable_mrr(sc);
run_set_txpreamble(sc);
run_set_basicrates(sc);
@@ -3785,7 +3787,7 @@ run_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
startall = 1;
run_init_locked(sc);
} else
- run_update_promisc_locked(ifp);
+ run_update_promisc_locked(sc);
} else {
if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
(ic->ic_nrunning == 0 || sc->rvp_cnt <= 1)) {
@@ -4901,7 +4903,7 @@ run_update_beacon(struct ieee80211vap *vap, int item)
switch (item) {
case IEEE80211_BEACON_ERP:
- run_updateslot(ic->ic_ifp);
+ run_updateslot(ic);
break;
case IEEE80211_BEACON_HTINFO:
run_updateprot(ic);
@@ -5062,33 +5064,32 @@ run_reset_livelock(struct run_softc *sc)
}
static void
-run_update_promisc_locked(struct ifnet *ifp)
+run_update_promisc_locked(struct run_softc *sc)
{
- struct run_softc *sc = ifp->if_softc;
uint32_t tmp;
run_read(sc, RT2860_RX_FILTR_CFG, &tmp);
tmp |= RT2860_DROP_UC_NOME;
- if (ifp->if_flags & IFF_PROMISC)
+ if (sc->sc_ifp->if_flags & IFF_PROMISC)
tmp &= ~RT2860_DROP_UC_NOME;
run_write(sc, RT2860_RX_FILTR_CFG, tmp);
- DPRINTF("%s promiscuous mode\n", (ifp->if_flags & IFF_PROMISC) ?
+ DPRINTF("%s promiscuous mode\n", (sc->sc_ifp->if_flags & IFF_PROMISC) ?
"entering" : "leaving");
}
static void
-run_update_promisc(struct ifnet *ifp)
+run_update_promisc(struct ieee80211com *ic)
{
- struct run_softc *sc = ifp->if_softc;
+ struct run_softc *sc = ic->ic_softc;
- if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+ if ((ic->ic_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
return;
RUN_LOCK(sc);
- run_update_promisc_locked(ifp);
+ run_update_promisc_locked(sc);
RUN_UNLOCK(sc);
}
@@ -5211,16 +5212,15 @@ run_set_macaddr(struct run_softc *sc, const uint8_t *addr)
}
static void
-run_updateslot(struct ifnet *ifp)
+run_updateslot(struct ieee80211com *ic)
{
- struct run_softc *sc = ifp->if_softc;
- struct ieee80211com *ic = ifp->if_l2com;
+ struct run_softc *sc = ic->ic_softc;
uint32_t i;
i = RUN_CMDQ_GET(&sc->cmdq_store);
DPRINTF("cmdq_store=%d\n", i);
sc->cmdq[i].func = run_updateslot_cb;
- sc->cmdq[i].arg0 = ifp;
+ sc->cmdq[i].arg0 = ic->ic_ifp;
ieee80211_runtask(ic, &sc->cmdq_task);
return;
@@ -5242,10 +5242,11 @@ run_updateslot_cb(void *arg)
}
static void
-run_update_mcast(struct ifnet *ifp)
+run_update_mcast(struct ieee80211com *ic)
{
+
/* h/w filter supports getting everything or nothing */
- ifp->if_flags |= IFF_ALLMULTI;
+ ic->ic_ifp->if_flags |= IFF_ALLMULTI;
}
static int8_t
diff --git a/sys/dev/usb/wlan/if_uath.c b/sys/dev/usb/wlan/if_uath.c
index 0796fbe..fca9e39 100644
--- a/sys/dev/usb/wlan/if_uath.c
+++ b/sys/dev/usb/wlan/if_uath.c
@@ -290,8 +290,8 @@ static int uath_raw_xmit(struct ieee80211_node *, struct mbuf *,
static void uath_scan_start(struct ieee80211com *);
static void uath_scan_end(struct ieee80211com *);
static void uath_set_channel(struct ieee80211com *);
-static void uath_update_mcast(struct ifnet *);
-static void uath_update_promisc(struct ifnet *);
+static void uath_update_mcast(struct ieee80211com *);
+static void uath_update_promisc(struct ieee80211com *);
static int uath_config(struct uath_softc *, uint32_t, uint32_t);
static int uath_config_multi(struct uath_softc *, uint32_t, const void *,
int);
@@ -442,6 +442,8 @@ uath_attach(device_t dev)
ic = ifp->if_l2com;
ic->ic_ifp = ifp;
+ ic->ic_softc = sc;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
ic->ic_opmode = IEEE80211_M_STA; /* default to BSS mode */
@@ -1925,13 +1927,13 @@ uath_set_rxmulti_filter(struct uath_softc *sc)
return (0);
}
static void
-uath_update_mcast(struct ifnet *ifp)
+uath_update_mcast(struct ieee80211com *ic)
{
- struct uath_softc *sc = ifp->if_softc;
+ struct uath_softc *sc = ic->ic_softc;
UATH_LOCK(sc);
if ((sc->sc_flags & UATH_FLAG_INVALID) ||
- (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
+ (ic->ic_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
UATH_UNLOCK(sc);
return;
}
@@ -1945,13 +1947,13 @@ uath_update_mcast(struct ifnet *ifp)
}
static void
-uath_update_promisc(struct ifnet *ifp)
+uath_update_promisc(struct ieee80211com *ic)
{
- struct uath_softc *sc = ifp->if_softc;
+ struct uath_softc *sc = ic->ic_softc;
UATH_LOCK(sc);
if ((sc->sc_flags & UATH_FLAG_INVALID) ||
- (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
+ (ic->ic_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
UATH_UNLOCK(sc);
return;
}
diff --git a/sys/dev/usb/wlan/if_upgt.c b/sys/dev/usb/wlan/if_upgt.c
index 242eb67..a2e493e 100644
--- a/sys/dev/usb/wlan/if_upgt.c
+++ b/sys/dev/usb/wlan/if_upgt.c
@@ -142,7 +142,7 @@ static struct ieee80211vap *upgt_vap_create(struct ieee80211com *,
const uint8_t [IEEE80211_ADDR_LEN],
const uint8_t [IEEE80211_ADDR_LEN]);
static void upgt_vap_delete(struct ieee80211vap *);
-static void upgt_update_mcast(struct ifnet *);
+static void upgt_update_mcast(struct ieee80211com *);
static uint8_t upgt_rx_rate(struct upgt_softc *, const int);
static void upgt_set_multi(void *);
static void upgt_stop(struct upgt_softc *);
@@ -341,6 +341,8 @@ upgt_attach(device_t dev)
ic = ifp->if_l2com;
ic->ic_ifp = ifp;
+ ic->ic_softc = sc;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
ic->ic_opmode = IEEE80211_M_STA;
/* set device capabilities */
@@ -1113,9 +1115,9 @@ upgt_vap_delete(struct ieee80211vap *vap)
}
static void
-upgt_update_mcast(struct ifnet *ifp)
+upgt_update_mcast(struct ieee80211com *ic)
{
- struct upgt_softc *sc = ifp->if_softc;
+ struct upgt_softc *sc = ic->ic_softc;
upgt_set_multi(sc);
}
diff --git a/sys/dev/usb/wlan/if_ural.c b/sys/dev/usb/wlan/if_ural.c
index c81b708..79a5be0 100644
--- a/sys/dev/usb/wlan/if_ural.c
+++ b/sys/dev/usb/wlan/if_ural.c
@@ -177,7 +177,7 @@ static void ural_set_basicrates(struct ural_softc *,
const struct ieee80211_channel *);
static void ural_set_bssid(struct ural_softc *, const uint8_t *);
static void ural_set_macaddr(struct ural_softc *, uint8_t *);
-static void ural_update_promisc(struct ifnet *);
+static void ural_update_promisc(struct ieee80211com *);
static void ural_setpromisc(struct ural_softc *);
static const char *ural_get_rf(int);
static void ural_read_eeprom(struct ural_softc *);
@@ -473,6 +473,8 @@ ural_attach(device_t self)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_softc = sc;
+ ic->ic_name = device_get_nameunit(self);
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
/* set device capabilities */
@@ -1926,11 +1928,11 @@ ural_setpromisc(struct ural_softc *sc)
}
static void
-ural_update_promisc(struct ifnet *ifp)
+ural_update_promisc(struct ieee80211com *ic)
{
- struct ural_softc *sc = ifp->if_softc;
+ struct ural_softc *sc = ic->ic_softc;
- if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+ if ((ic->ic_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
return;
RAL_LOCK(sc);
diff --git a/sys/dev/usb/wlan/if_urtw.c b/sys/dev/usb/wlan/if_urtw.c
index d2c6ef9..f8b77d4 100644
--- a/sys/dev/usb/wlan/if_urtw.c
+++ b/sys/dev/usb/wlan/if_urtw.c
@@ -663,7 +663,7 @@ static int urtw_raw_xmit(struct ieee80211_node *, struct mbuf *,
static void urtw_scan_start(struct ieee80211com *);
static void urtw_scan_end(struct ieee80211com *);
static void urtw_set_channel(struct ieee80211com *);
-static void urtw_update_mcast(struct ifnet *);
+static void urtw_update_mcast(struct ieee80211com *);
static int urtw_tx_start(struct urtw_softc *,
struct ieee80211_node *, struct mbuf *,
struct urtw_data *, int);
@@ -758,7 +758,7 @@ static struct urtw_data *
urtw_getbuf(struct urtw_softc *sc);
static int urtw_compute_txtime(uint16_t, uint16_t, uint8_t,
uint8_t);
-static void urtw_updateslot(struct ifnet *);
+static void urtw_updateslot(struct ieee80211com *);
static void urtw_updateslottask(void *, int);
static void urtw_sysctl_node(struct urtw_softc *);
@@ -881,6 +881,8 @@ urtw_attach(device_t dev)
ic = ifp->if_l2com;
ic->ic_ifp = ifp;
+ ic->ic_softc = sc;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
ic->ic_opmode = IEEE80211_M_STA; /* default to BSS mode */
@@ -1661,7 +1663,7 @@ fail:
}
static void
-urtw_update_mcast(struct ifnet *ifp)
+urtw_update_mcast(struct ieee80211com *ic)
{
/* XXX do nothing? */
@@ -4365,10 +4367,9 @@ urtw_compute_txtime(uint16_t framelen, uint16_t rate,
* slot time based on the current setting.
*/
static void
-urtw_updateslot(struct ifnet *ifp)
+urtw_updateslot(struct ieee80211com *ic)
{
- struct urtw_softc *sc = ifp->if_softc;
- struct ieee80211com *ic = ifp->if_l2com;
+ struct urtw_softc *sc = ic->ic_softc;
ieee80211_runtask(ic, &sc->sc_updateslot_task);
}
diff --git a/sys/dev/usb/wlan/if_urtwn.c b/sys/dev/usb/wlan/if_urtwn.c
index 331f782..6b712b3 100644
--- a/sys/dev/usb/wlan/if_urtwn.c
+++ b/sys/dev/usb/wlan/if_urtwn.c
@@ -266,7 +266,7 @@ static void urtwn_set_channel(struct ieee80211com *);
static void urtwn_set_chan(struct urtwn_softc *,
struct ieee80211_channel *,
struct ieee80211_channel *);
-static void urtwn_update_mcast(struct ifnet *);
+static void urtwn_update_mcast(struct ieee80211com *);
static void urtwn_iq_calib(struct urtwn_softc *);
static void urtwn_lc_calib(struct urtwn_softc *);
static void urtwn_init(void *);
@@ -442,6 +442,8 @@ urtwn_attach(device_t self)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_softc = sc;
+ ic->ic_name = device_get_nameunit(self);
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
ic->ic_opmode = IEEE80211_M_STA; /* default to BSS mode */
@@ -3145,7 +3147,7 @@ urtwn_set_channel(struct ieee80211com *ic)
}
static void
-urtwn_update_mcast(struct ifnet *ifp)
+urtwn_update_mcast(struct ieee80211com *ic)
{
/* XXX do nothing? */
}
diff --git a/sys/dev/usb/wlan/if_zyd.c b/sys/dev/usb/wlan/if_zyd.c
index ca1fb06..8f9035e 100644
--- a/sys/dev/usb/wlan/if_zyd.c
+++ b/sys/dev/usb/wlan/if_zyd.c
@@ -147,7 +147,7 @@ static int zyd_set_bssid(struct zyd_softc *, const uint8_t *);
static int zyd_switch_radio(struct zyd_softc *, int);
static int zyd_set_led(struct zyd_softc *, int, int);
static void zyd_set_multi(struct zyd_softc *);
-static void zyd_update_mcast(struct ifnet *);
+static void zyd_update_mcast(struct ieee80211com *);
static int zyd_set_rxfilter(struct zyd_softc *);
static void zyd_set_chan(struct zyd_softc *, struct ieee80211_channel *);
static int zyd_set_beacon_interval(struct zyd_softc *, int);
@@ -388,6 +388,8 @@ zyd_attach(device_t dev)
ic = ifp->if_l2com;
ic->ic_ifp = ifp;
+ ic->ic_softc = sc;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
ic->ic_opmode = IEEE80211_M_STA;
@@ -2044,11 +2046,11 @@ fail:
}
static void
-zyd_update_mcast(struct ifnet *ifp)
+zyd_update_mcast(struct ieee80211com *ic)
{
- struct zyd_softc *sc = ifp->if_softc;
+ struct zyd_softc *sc = ic->ic_softc;
- if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+ if ((ic->ic_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
return;
ZYD_LOCK(sc);
diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c
index 704a3d9..232d2c9 100644
--- a/sys/dev/virtio/network/if_vtnet.c
+++ b/sys/dev/virtio/network/if_vtnet.c
@@ -443,7 +443,7 @@ vtnet_detach(device_t dev)
sc->vtnet_vlan_attach = NULL;
}
if (sc->vtnet_vlan_detach != NULL) {
- EVENTHANDLER_DEREGISTER(vlan_unconfg, sc->vtnet_vlan_detach);
+ EVENTHANDLER_DEREGISTER(vlan_unconfig, sc->vtnet_vlan_detach);
sc->vtnet_vlan_detach = NULL;
}
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c
index 6801823..b316d46 100644
--- a/sys/dev/wi/if_wi.c
+++ b/sys/dev/wi/if_wi.c
@@ -127,7 +127,8 @@ static int wi_newstate_sta(struct ieee80211vap *, enum ieee80211_state, int);
static int wi_newstate_hostap(struct ieee80211vap *, enum ieee80211_state,
int);
static void wi_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m,
- int subtype, int rssi, int nf);
+ int subtype, const struct ieee80211_rx_stats *rxs,
+ int rssi, int nf);
static int wi_reset(struct wi_softc *);
static void wi_watchdog(void *);
static int wi_ioctl(struct ifnet *, u_long, caddr_t);
@@ -143,8 +144,8 @@ static void wi_info_intr(struct wi_softc *);
static int wi_write_txrate(struct wi_softc *, struct ieee80211vap *);
static int wi_write_wep(struct wi_softc *, struct ieee80211vap *);
static int wi_write_multi(struct wi_softc *);
-static void wi_update_mcast(struct ifnet *);
-static void wi_update_promisc(struct ifnet *);
+static void wi_update_mcast(struct ieee80211com *);
+static void wi_update_promisc(struct ieee80211com *);
static int wi_alloc_fid(struct wi_softc *, int, int *);
static void wi_read_nicid(struct wi_softc *);
static int wi_write_ssid(struct wi_softc *, int, u_int8_t *, int);
@@ -344,6 +345,8 @@ wi_attach(device_t dev)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_softc = sc;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_phytype = IEEE80211_T_DS;
ic->ic_opmode = IEEE80211_M_STA;
ic->ic_caps = IEEE80211_C_STA
@@ -803,7 +806,7 @@ wi_scan_end(struct ieee80211com *ic)
static void
wi_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m,
- int subtype, int rssi, int nf)
+ int subtype, const struct ieee80211_rx_stats *rxs, int rssi, int nf)
{
struct ieee80211vap *vap = ni->ni_vap;
@@ -814,7 +817,7 @@ wi_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m,
/* NB: filter frames that trigger state changes */
return;
}
- WI_VAP(vap)->wv_recv_mgmt(ni, m, subtype, rssi, nf);
+ WI_VAP(vap)->wv_recv_mgmt(ni, m, subtype, rxs, rssi, nf);
}
static int
@@ -1620,22 +1623,22 @@ allmulti:
}
static void
-wi_update_mcast(struct ifnet *ifp)
+wi_update_mcast(struct ieee80211com *ic)
{
- wi_write_multi(ifp->if_softc);
+
+ wi_write_multi(ic->ic_softc);
}
static void
-wi_update_promisc(struct ifnet *ifp)
+wi_update_promisc(struct ieee80211com *ic)
{
- struct wi_softc *sc = ifp->if_softc;
- struct ieee80211com *ic = ifp->if_l2com;
+ struct wi_softc *sc = ic->ic_softc;
WI_LOCK(sc);
/* XXX handle WEP special case handling? */
wi_write_val(sc, WI_RID_PROMISC,
(ic->ic_opmode == IEEE80211_M_MONITOR ||
- (ifp->if_flags & IFF_PROMISC)));
+ (ic->ic_ifp->if_flags & IFF_PROMISC)));
WI_UNLOCK(sc);
}
diff --git a/sys/dev/wi/if_wivar.h b/sys/dev/wi/if_wivar.h
index 99b866d..f163744 100644
--- a/sys/dev/wi/if_wivar.h
+++ b/sys/dev/wi/if_wivar.h
@@ -61,7 +61,7 @@ struct wi_vap {
struct ieee80211_beacon_offsets wv_bo;
void (*wv_recv_mgmt)(struct ieee80211_node *, struct mbuf *,
- int, int, int);
+ int, const struct ieee80211_rx_stats *rxs, int, int);
int (*wv_newstate)(struct ieee80211vap *,
enum ieee80211_state, int);
};
diff --git a/sys/dev/wpi/if_wpi.c b/sys/dev/wpi/if_wpi.c
index 7b438c7..3440605 100644
--- a/sys/dev/wpi/if_wpi.c
+++ b/sys/dev/wpi/if_wpi.c
@@ -177,8 +177,9 @@ static int wpi_add_node_entry_adhoc(struct wpi_softc *);
static struct ieee80211_node *wpi_node_alloc(struct ieee80211vap *,
const uint8_t mac[IEEE80211_ADDR_LEN]);
static void wpi_node_free(struct ieee80211_node *);
-static void wpi_recv_mgmt(struct ieee80211_node *, struct mbuf *, int, int,
- int);
+static void wpi_recv_mgmt(struct ieee80211_node *, struct mbuf *, int,
+ const struct ieee80211_rx_stats *,
+ int, int);
static void wpi_restore_node(void *, struct ieee80211_node *);
static void wpi_restore_node_table(struct wpi_softc *, struct wpi_vap *);
static int wpi_newstate(struct ieee80211vap *, enum ieee80211_state, int);
@@ -218,8 +219,8 @@ static int wpi_add_ibss_node(struct wpi_softc *, struct ieee80211_node *);
static void wpi_del_node(struct wpi_softc *, struct ieee80211_node *);
static int wpi_updateedca(struct ieee80211com *);
static void wpi_set_promisc(struct wpi_softc *);
-static void wpi_update_promisc(struct ifnet *);
-static void wpi_update_mcast(struct ifnet *);
+static void wpi_update_promisc(struct ieee80211com *);
+static void wpi_update_mcast(struct ieee80211com *);
static void wpi_set_led(struct wpi_softc *, uint8_t, uint8_t, uint8_t);
static int wpi_set_timing(struct wpi_softc *, struct ieee80211_node *);
static void wpi_power_calibration(struct wpi_softc *);
@@ -452,6 +453,8 @@ wpi_attach(device_t dev)
ic = ifp->if_l2com;
ic->ic_ifp = ifp;
+ ic->ic_softc = sc;
+ ic->ic_name = device_get_nameunit(dev);
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
ic->ic_opmode = IEEE80211_M_STA; /* default to BSS mode */
@@ -1692,15 +1695,16 @@ wpi_check_bss_filter(struct wpi_softc *sc)
}
static void
-wpi_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m, int subtype, int rssi,
- int nf)
+wpi_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m, int subtype,
+ const struct ieee80211_rx_stats *rxs,
+ int rssi, int nf)
{
struct ieee80211vap *vap = ni->ni_vap;
struct wpi_softc *sc = vap->iv_ic->ic_ifp->if_softc;
struct wpi_vap *wvp = WPI_VAP(vap);
uint64_t ni_tstamp, rx_tstamp;
- wvp->wv_recv_mgmt(ni, m, subtype, rssi, nf);
+ wvp->wv_recv_mgmt(ni, m, subtype, rxs, rssi, nf);
if (vap->iv_opmode == IEEE80211_M_IBSS &&
vap->iv_state == IEEE80211_S_RUN &&
@@ -3538,9 +3542,9 @@ wpi_set_promisc(struct wpi_softc *sc)
}
static void
-wpi_update_promisc(struct ifnet *ifp)
+wpi_update_promisc(struct ieee80211com *ic)
{
- struct wpi_softc *sc = ifp->if_softc;
+ struct wpi_softc *sc = ic->ic_softc;
WPI_RXON_LOCK(sc);
wpi_set_promisc(sc);
@@ -3553,7 +3557,7 @@ wpi_update_promisc(struct ifnet *ifp)
}
static void
-wpi_update_mcast(struct ifnet *ifp)
+wpi_update_mcast(struct ieee80211com *ic)
{
/* Ignore */
}
diff --git a/sys/dev/wpi/if_wpivar.h b/sys/dev/wpi/if_wpivar.h
index 7a65b72..b783528 100644
--- a/sys/dev/wpi/if_wpivar.h
+++ b/sys/dev/wpi/if_wpivar.h
@@ -133,7 +133,9 @@ struct wpi_vap {
int (*wv_newstate)(struct ieee80211vap *,
enum ieee80211_state, int);
void (*wv_recv_mgmt)(struct ieee80211_node *,
- struct mbuf *, int, int, int);
+ struct mbuf *, int,
+ const struct ieee80211_rx_stats *,
+ int, int);
};
#define WPI_VAP(vap) ((struct wpi_vap *)(vap))
diff --git a/sys/dev/wtap/if_wtap.c b/sys/dev/wtap/if_wtap.c
index 3c64085..7e2eca7 100644
--- a/sys/dev/wtap/if_wtap.c
+++ b/sys/dev/wtap/if_wtap.c
@@ -702,14 +702,14 @@ wtap_wme_update(struct ieee80211com *ic)
}
static void
-wtap_update_mcast(struct ifnet *ifp)
+wtap_update_mcast(struct ieee80211com *ic)
{
DWTAP_PRINTF("%s\n", __func__);
}
static void
-wtap_update_promisc(struct ifnet *ifp)
+wtap_update_promisc(struct ieee80211com *ic)
{
DWTAP_PRINTF("%s\n", __func__);
@@ -797,6 +797,8 @@ wtap_attach(struct wtap_softc *sc, const uint8_t *macaddr)
IFQ_SET_READY(&ifp->if_snd);
ic->ic_ifp = ifp;
+ ic->ic_softc = sc;
+ ic->ic_name = sc->name;
ic->ic_phytype = IEEE80211_T_DS;
ic->ic_opmode = IEEE80211_M_MBSS;
ic->ic_caps = IEEE80211_C_MBSS;
@@ -827,9 +829,6 @@ wtap_attach(struct wtap_softc *sc, const uint8_t *macaddr)
/* override default methods */
ic->ic_newassoc = wtap_newassoc;
-#if 0
- ic->ic_updateslot = myath_updateslot;
-#endif
ic->ic_wme.wme_update = wtap_wme_update;
ic->ic_vap_create = wtap_vap_create;
ic->ic_vap_delete = wtap_vap_delete;
diff --git a/sys/dev/wtap/if_wtapvar.h b/sys/dev/wtap/if_wtapvar.h
index bb165b4..3bdc898 100644
--- a/sys/dev/wtap/if_wtapvar.h
+++ b/sys/dev/wtap/if_wtapvar.h
@@ -130,6 +130,7 @@ struct wtap_vap {
struct taskqueue;
struct wtap_softc {
+ char name[7]; /* wtapXX\0 */
int32_t id;
int32_t up;
struct ifnet *sc_ifp; /* interface common */
diff --git a/sys/dev/wtap/wtap_hal/hal.c b/sys/dev/wtap/wtap_hal/hal.c
index 9ec1ca8..6014e39 100644
--- a/sys/dev/wtap/wtap_hal/hal.c
+++ b/sys/dev/wtap/wtap_hal/hal.c
@@ -182,6 +182,8 @@ new_wtap(struct wtap_hal *hal, int32_t id)
bzero(hal->hal_devs[id], sizeof(struct wtap_softc));
hal->hal_devs[id]->sc_md = hal->hal_md;
hal->hal_devs[id]->id = id;
+ snprintf(hal->hal_devs[id]->name, sizeof(hal->hal_devs[id]->name),
+ "wlan%d", id);
mtx_init(&hal->hal_devs[id]->sc_mtx, "wtap_softc mtx", NULL,
MTX_DEF | MTX_RECURSE);
diff --git a/sys/dev/xen/blkback/blkback.c b/sys/dev/xen/blkback/blkback.c
index d352242..459271e 100644
--- a/sys/dev/xen/blkback/blkback.c
+++ b/sys/dev/xen/blkback/blkback.c
@@ -85,11 +85,19 @@ __FBSDID("$FreeBSD$");
/*--------------------------- Compile-time Tunables --------------------------*/
/**
+ * The maximum number of shared memory ring pages we will allow in a
+ * negotiated block-front/back communication channel. Allow enough
+ * ring space for all requests to be XBB_MAX_REQUEST_SIZE'd.
+ */
+#define XBB_MAX_RING_PAGES 32
+
+/**
* The maximum number of outstanding request blocks (request headers plus
* additional segment blocks) we will allow in a negotiated block-front/back
* communication channel.
*/
-#define XBB_MAX_REQUESTS 256
+#define XBB_MAX_REQUESTS \
+ __CONST_RING_SIZE(blkif, PAGE_SIZE * XBB_MAX_RING_PAGES)
/**
* \brief Define to force all I/O to be performed on memory owned by the
@@ -148,14 +156,6 @@ static MALLOC_DEFINE(M_XENBLOCKBACK, "xbbd", "Xen Block Back Driver Data");
(XBB_MAX_REQUEST_SIZE / PAGE_SIZE) + 1)))
/**
- * The maximum number of shared memory ring pages we will allow in a
- * negotiated block-front/back communication channel. Allow enough
- * ring space for all requests to be XBB_MAX_REQUEST_SIZE'd.
- */
-#define XBB_MAX_RING_PAGES \
- BLKIF_RING_PAGES(BLKIF_SEGS_TO_BLOCKS(XBB_MAX_SEGMENTS_PER_REQUEST) \
- * XBB_MAX_REQUESTS)
-/**
* The maximum number of ring pages that we can allow per request list.
* We limit this to the maximum number of segments per request, because
* that is already a reasonable number of segments to aggregate. This
@@ -1328,7 +1328,7 @@ xbb_queue_response(struct xbb_softc *xbb, struct xbb_xen_req *req, int status)
if (status != BLKIF_RSP_OKAY)
xbb->reqs_completed_with_error++;
- xbb->rings.common.rsp_prod_pvt += BLKIF_SEGS_TO_BLOCKS(req->nr_pages);
+ xbb->rings.common.rsp_prod_pvt++;
xbb->reqs_queued_for_completion++;
@@ -1666,87 +1666,49 @@ xbb_dispatch_io(struct xbb_softc *xbb, struct xbb_xen_reqlist *reqlist)
goto send_response;
}
- block_segs = MIN(nreq->nr_pages,
- BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK);
+ block_segs = nseg;
sg = ring_req->seg;
last_block_sg = sg + block_segs;
- while (1) {
-
- while (sg < last_block_sg) {
- KASSERT(seg_idx <
- XBB_MAX_SEGMENTS_PER_REQLIST,
- ("seg_idx %d is too large, max "
- "segs %d\n", seg_idx,
- XBB_MAX_SEGMENTS_PER_REQLIST));
-
- xbb_sg->first_sect = sg->first_sect;
- xbb_sg->last_sect = sg->last_sect;
- xbb_sg->nsect =
- (int8_t)(sg->last_sect -
- sg->first_sect + 1);
-
- if ((sg->last_sect >= (PAGE_SIZE >> 9))
- || (xbb_sg->nsect <= 0)) {
- reqlist->status = BLKIF_RSP_ERROR;
- goto send_response;
- }
-
- nr_sects += xbb_sg->nsect;
- map->host_addr = xbb_get_gntaddr(reqlist,
- seg_idx, /*sector*/0);
- KASSERT(map->host_addr + PAGE_SIZE <=
- xbb->ring_config.gnt_addr,
- ("Host address %#jx len %d overlaps "
- "ring address %#jx\n",
- (uintmax_t)map->host_addr, PAGE_SIZE,
- (uintmax_t)xbb->ring_config.gnt_addr));
-
- map->flags = GNTMAP_host_map;
- map->ref = sg->gref;
- map->dom = xbb->otherend_id;
- if (operation == BIO_WRITE)
- map->flags |= GNTMAP_readonly;
- sg++;
- map++;
- xbb_sg++;
- seg_idx++;
- req_seg_idx++;
- }
- block_segs = MIN(nseg - req_seg_idx,
- BLKIF_MAX_SEGMENTS_PER_SEGMENT_BLOCK);
- if (block_segs == 0)
- break;
-
- /*
- * Fetch the next request block full of SG elements.
- * For now, only the spacing between entries is
- * different in the different ABIs, not the sg entry
- * layout.
- */
- req_ring_idx++;
- switch (xbb->abi) {
- case BLKIF_PROTOCOL_NATIVE:
- sg = BLKRING_GET_SEG_BLOCK(&xbb->rings.native,
- req_ring_idx);
- break;
- case BLKIF_PROTOCOL_X86_32:
- {
- sg = BLKRING_GET_SEG_BLOCK(&xbb->rings.x86_32,
- req_ring_idx);
- break;
- }
- case BLKIF_PROTOCOL_X86_64:
- {
- sg = BLKRING_GET_SEG_BLOCK(&xbb->rings.x86_64,
- req_ring_idx);
- break;
+ while (sg < last_block_sg) {
+ KASSERT(seg_idx <
+ XBB_MAX_SEGMENTS_PER_REQLIST,
+ ("seg_idx %d is too large, max "
+ "segs %d\n", seg_idx,
+ XBB_MAX_SEGMENTS_PER_REQLIST));
+
+ xbb_sg->first_sect = sg->first_sect;
+ xbb_sg->last_sect = sg->last_sect;
+ xbb_sg->nsect =
+ (int8_t)(sg->last_sect -
+ sg->first_sect + 1);
+
+ if ((sg->last_sect >= (PAGE_SIZE >> 9))
+ || (xbb_sg->nsect <= 0)) {
+ reqlist->status = BLKIF_RSP_ERROR;
+ goto send_response;
}
- default:
- panic("Unexpected blkif protocol ABI.");
- /* NOTREACHED */
- }
- last_block_sg = sg + block_segs;
+
+ nr_sects += xbb_sg->nsect;
+ map->host_addr = xbb_get_gntaddr(reqlist,
+ seg_idx, /*sector*/0);
+ KASSERT(map->host_addr + PAGE_SIZE <=
+ xbb->ring_config.gnt_addr,
+ ("Host address %#jx len %d overlaps "
+ "ring address %#jx\n",
+ (uintmax_t)map->host_addr, PAGE_SIZE,
+ (uintmax_t)xbb->ring_config.gnt_addr));
+
+ map->flags = GNTMAP_host_map;
+ map->ref = sg->gref;
+ map->dom = xbb->otherend_id;
+ if (operation == BIO_WRITE)
+ map->flags |= GNTMAP_readonly;
+ sg++;
+ map++;
+ xbb_sg++;
+ seg_idx++;
+ req_seg_idx++;
}
/* Convert to the disk's sector size */
@@ -2000,8 +1962,7 @@ xbb_run_queue(void *context, int pending)
* response be generated before we make room in
* the queue for that response.
*/
- xbb->rings.common.req_cons +=
- BLKIF_SEGS_TO_BLOCKS(ring_req->nr_segments);
+ xbb->rings.common.req_cons++;
xbb->reqs_received++;
cur_size = xbb_count_sects(ring_req);
@@ -3091,7 +3052,7 @@ xbb_collect_frontend_info(struct xbb_softc *xbb)
* Protocol defaults valid even if all negotiation fails.
*/
xbb->ring_config.ring_pages = 1;
- xbb->max_request_segments = BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK;
+ xbb->max_request_segments = BLKIF_MAX_SEGMENTS_PER_REQUEST;
xbb->max_request_size = xbb->max_request_segments * PAGE_SIZE;
/*
@@ -3122,60 +3083,23 @@ xbb_collect_frontend_info(struct xbb_softc *xbb)
* fields.
*/
ring_page_order = 0;
+ xbb->max_requests = 32;
+
(void)xs_scanf(XST_NIL, otherend_path,
"ring-page-order", NULL, "%u",
&ring_page_order);
xbb->ring_config.ring_pages = 1 << ring_page_order;
- (void)xs_scanf(XST_NIL, otherend_path,
- "num-ring-pages", NULL, "%u",
- &xbb->ring_config.ring_pages);
ring_size = PAGE_SIZE * xbb->ring_config.ring_pages;
xbb->max_requests = BLKIF_MAX_RING_REQUESTS(ring_size);
- (void)xs_scanf(XST_NIL, otherend_path,
- "max-requests", NULL, "%u",
- &xbb->max_requests);
-
- (void)xs_scanf(XST_NIL, otherend_path,
- "max-request-segments", NULL, "%u",
- &xbb->max_request_segments);
-
- (void)xs_scanf(XST_NIL, otherend_path,
- "max-request-size", NULL, "%u",
- &xbb->max_request_size);
-
if (xbb->ring_config.ring_pages > XBB_MAX_RING_PAGES) {
xenbus_dev_fatal(xbb->dev, EINVAL,
"Front-end specified ring-pages of %u "
- "exceeds backend limit of %zu. "
+ "exceeds backend limit of %u. "
"Unable to connect.",
xbb->ring_config.ring_pages,
XBB_MAX_RING_PAGES);
return (EINVAL);
- } else if (xbb->max_requests > XBB_MAX_REQUESTS) {
- xenbus_dev_fatal(xbb->dev, EINVAL,
- "Front-end specified max_requests of %u "
- "exceeds backend limit of %u. "
- "Unable to connect.",
- xbb->max_requests,
- XBB_MAX_REQUESTS);
- return (EINVAL);
- } else if (xbb->max_request_segments > XBB_MAX_SEGMENTS_PER_REQUEST) {
- xenbus_dev_fatal(xbb->dev, EINVAL,
- "Front-end specified max_requests_segments "
- "of %u exceeds backend limit of %u. "
- "Unable to connect.",
- xbb->max_request_segments,
- XBB_MAX_SEGMENTS_PER_REQUEST);
- return (EINVAL);
- } else if (xbb->max_request_size > XBB_MAX_REQUEST_SIZE) {
- xenbus_dev_fatal(xbb->dev, EINVAL,
- "Front-end specified max_request_size "
- "of %u exceeds backend limit of %u. "
- "Unable to connect.",
- xbb->max_request_size,
- XBB_MAX_REQUEST_SIZE);
- return (EINVAL);
}
if (xbb->ring_config.ring_pages == 1) {
@@ -3723,18 +3647,6 @@ xbb_attach(device_t dev)
return (error);
}
- /*
- * Amazon EC2 client compatility. They refer to max-ring-pages
- * instead of to max-ring-page-order.
- */
- error = xs_printf(XST_NIL, xenbus_get_node(xbb->dev),
- "max-ring-pages", "%zu", XBB_MAX_RING_PAGES);
- if (error) {
- xbb_attach_failed(xbb, error, "writing %s/max-ring-pages",
- xenbus_get_node(xbb->dev));
- return (error);
- }
-
max_ring_page_order = flsl(XBB_MAX_RING_PAGES) - 1;
error = xs_printf(XST_NIL, xenbus_get_node(xbb->dev),
"max-ring-page-order", "%u", max_ring_page_order);
@@ -3744,32 +3656,6 @@ xbb_attach(device_t dev)
return (error);
}
- error = xs_printf(XST_NIL, xenbus_get_node(xbb->dev),
- "max-requests", "%u", XBB_MAX_REQUESTS);
- if (error) {
- xbb_attach_failed(xbb, error, "writing %s/max-requests",
- xenbus_get_node(xbb->dev));
- return (error);
- }
-
- error = xs_printf(XST_NIL, xenbus_get_node(xbb->dev),
- "max-request-segments", "%u",
- XBB_MAX_SEGMENTS_PER_REQUEST);
- if (error) {
- xbb_attach_failed(xbb, error, "writing %s/max-request-segments",
- xenbus_get_node(xbb->dev));
- return (error);
- }
-
- error = xs_printf(XST_NIL, xenbus_get_node(xbb->dev),
- "max-request-size", "%u",
- XBB_MAX_REQUEST_SIZE);
- if (error) {
- xbb_attach_failed(xbb, error, "writing %s/max-request-size",
- xenbus_get_node(xbb->dev));
- return (error);
- }
-
/* Collect physical device information. */
error = xs_gather(XST_NIL, xenbus_get_otherend_path(xbb->dev),
"device-type", NULL, &xbb->dev_type,
diff --git a/sys/dev/xen/blkfront/blkfront.c b/sys/dev/xen/blkfront/blkfront.c
index 92b5f35..a71251d 100644
--- a/sys/dev/xen/blkfront/blkfront.c
+++ b/sys/dev/xen/blkfront/blkfront.c
@@ -174,7 +174,6 @@ xbd_queue_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
sc = cm->cm_sc;
if (error) {
- printf("error %d in xbd_queue_cb\n", error);
cm->cm_bp->bio_error = EIO;
biodone(cm->cm_bp);
xbd_free_command(cm);
@@ -191,55 +190,44 @@ xbd_queue_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
ring_req->nr_segments = nsegs;
cm->cm_nseg = nsegs;
- block_segs = MIN(nsegs, BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK);
+ block_segs = MIN(nsegs, BLKIF_MAX_SEGMENTS_PER_REQUEST);
sg = ring_req->seg;
last_block_sg = sg + block_segs;
sg_ref = cm->cm_sg_refs;
- while (1) {
+ while (sg < last_block_sg) {
+ buffer_ma = segs->ds_addr;
+ fsect = (buffer_ma & PAGE_MASK) >> XBD_SECTOR_SHFT;
+ lsect = fsect + (segs->ds_len >> XBD_SECTOR_SHFT) - 1;
- while (sg < last_block_sg) {
- buffer_ma = segs->ds_addr;
- fsect = (buffer_ma & PAGE_MASK) >> XBD_SECTOR_SHFT;
- lsect = fsect + (segs->ds_len >> XBD_SECTOR_SHFT) - 1;
+ KASSERT(lsect <= 7, ("XEN disk driver data cannot "
+ "cross a page boundary"));
- KASSERT(lsect <= 7, ("XEN disk driver data cannot "
- "cross a page boundary"));
+ /* install a grant reference. */
+ ref = gnttab_claim_grant_reference(&cm->cm_gref_head);
- /* install a grant reference. */
- ref = gnttab_claim_grant_reference(&cm->cm_gref_head);
-
- /*
- * GNTTAB_LIST_END == 0xffffffff, but it is private
- * to gnttab.c.
- */
- KASSERT(ref != ~0, ("grant_reference failed"));
-
- gnttab_grant_foreign_access_ref(
- ref,
- xenbus_get_otherend_id(sc->xbd_dev),
- buffer_ma >> PAGE_SHIFT,
- ring_req->operation == BLKIF_OP_WRITE);
-
- *sg_ref = ref;
- *sg = (struct blkif_request_segment) {
- .gref = ref,
- .first_sect = fsect,
- .last_sect = lsect
- };
- sg++;
- sg_ref++;
- segs++;
- nsegs--;
- }
- block_segs = MIN(nsegs, BLKIF_MAX_SEGMENTS_PER_SEGMENT_BLOCK);
- if (block_segs == 0)
- break;
-
- sg = BLKRING_GET_SEG_BLOCK(&sc->xbd_ring,
- sc->xbd_ring.req_prod_pvt);
- sc->xbd_ring.req_prod_pvt++;
- last_block_sg = sg + block_segs;
+ /*
+ * GNTTAB_LIST_END == 0xffffffff, but it is private
+ * to gnttab.c.
+ */
+ KASSERT(ref != ~0, ("grant_reference failed"));
+
+ gnttab_grant_foreign_access_ref(
+ ref,
+ xenbus_get_otherend_id(sc->xbd_dev),
+ buffer_ma >> PAGE_SHIFT,
+ ring_req->operation == BLKIF_OP_WRITE);
+
+ *sg_ref = ref;
+ *sg = (struct blkif_request_segment) {
+ .gref = ref,
+ .first_sect = fsect,
+ .last_sect = lsect
+ };
+ sg++;
+ sg_ref++;
+ segs++;
+ nsegs--;
}
if (cm->cm_operation == BLKIF_OP_READ)
@@ -396,8 +384,8 @@ xbd_startio(struct xbd_softc *sc)
if (sc->xbd_state != XBD_STATE_CONNECTED)
return;
- while (RING_FREE_REQUESTS(&sc->xbd_ring) >=
- sc->xbd_max_request_blocks) {
+ while (!RING_FULL(&sc->xbd_ring)) {
+
if (sc->xbd_qfrozen_cnt != 0)
break;
@@ -450,13 +438,6 @@ xbd_bio_complete(struct xbd_softc *sc, struct xbd_command *cm)
biodone(bp);
}
-static int
-xbd_completion(struct xbd_command *cm)
-{
- gnttab_end_foreign_access_references(cm->cm_nseg, cm->cm_sg_refs);
- return (BLKIF_SEGS_TO_BLOCKS(cm->cm_nseg));
-}
-
static void
xbd_int(void *xsc)
{
@@ -482,7 +463,9 @@ xbd_int(void *xsc)
cm = &sc->xbd_shadow[bret->id];
xbd_remove_cm(cm, XBD_Q_BUSY);
- i += xbd_completion(cm);
+ gnttab_end_foreign_access_references(cm->cm_nseg,
+ cm->cm_sg_refs);
+ i++;
if (cm->cm_operation == BLKIF_OP_READ)
op = BUS_DMASYNC_POSTREAD;
@@ -1064,11 +1047,9 @@ xbd_initialize(struct xbd_softc *sc)
*/
max_ring_page_order = 0;
sc->xbd_ring_pages = 1;
- sc->xbd_max_request_segments = BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK;
+ sc->xbd_max_request_segments = BLKIF_MAX_SEGMENTS_PER_REQUEST;
sc->xbd_max_request_size =
XBD_SEGS_TO_SIZE(sc->xbd_max_request_segments);
- sc->xbd_max_request_blocks =
- BLKIF_SEGS_TO_BLOCKS(sc->xbd_max_request_segments);
/*
* Protocol negotiation.
@@ -1095,24 +1076,10 @@ xbd_initialize(struct xbd_softc *sc)
if (sc->xbd_ring_pages < 1)
sc->xbd_ring_pages = 1;
- sc->xbd_max_requests =
- BLKIF_MAX_RING_REQUESTS(sc->xbd_ring_pages * PAGE_SIZE);
- (void)xs_scanf(XST_NIL, otherend_path,
- "max-requests", NULL, "%" PRIu32,
- &sc->xbd_max_requests);
-
- (void)xs_scanf(XST_NIL, otherend_path,
- "max-request-segments", NULL, "%" PRIu32,
- &sc->xbd_max_request_segments);
-
- (void)xs_scanf(XST_NIL, otherend_path,
- "max-request-size", NULL, "%" PRIu32,
- &sc->xbd_max_request_size);
-
if (sc->xbd_ring_pages > XBD_MAX_RING_PAGES) {
device_printf(sc->xbd_dev,
"Back-end specified ring-pages of %u "
- "limited to front-end limit of %zu.\n",
+ "limited to front-end limit of %u.\n",
sc->xbd_ring_pages, XBD_MAX_RING_PAGES);
sc->xbd_ring_pages = XBD_MAX_RING_PAGES;
}
@@ -1128,46 +1095,16 @@ xbd_initialize(struct xbd_softc *sc)
sc->xbd_ring_pages = new_page_limit;
}
+ sc->xbd_max_requests =
+ BLKIF_MAX_RING_REQUESTS(sc->xbd_ring_pages * PAGE_SIZE);
if (sc->xbd_max_requests > XBD_MAX_REQUESTS) {
device_printf(sc->xbd_dev,
"Back-end specified max_requests of %u "
- "limited to front-end limit of %u.\n",
+ "limited to front-end limit of %zu.\n",
sc->xbd_max_requests, XBD_MAX_REQUESTS);
sc->xbd_max_requests = XBD_MAX_REQUESTS;
}
- if (sc->xbd_max_request_segments > XBD_MAX_SEGMENTS_PER_REQUEST) {
- device_printf(sc->xbd_dev,
- "Back-end specified max_request_segments of %u "
- "limited to front-end limit of %u.\n",
- sc->xbd_max_request_segments,
- XBD_MAX_SEGMENTS_PER_REQUEST);
- sc->xbd_max_request_segments = XBD_MAX_SEGMENTS_PER_REQUEST;
- }
-
- if (sc->xbd_max_request_size > XBD_MAX_REQUEST_SIZE) {
- device_printf(sc->xbd_dev,
- "Back-end specified max_request_size of %u "
- "limited to front-end limit of %u.\n",
- sc->xbd_max_request_size,
- XBD_MAX_REQUEST_SIZE);
- sc->xbd_max_request_size = XBD_MAX_REQUEST_SIZE;
- }
-
- if (sc->xbd_max_request_size >
- XBD_SEGS_TO_SIZE(sc->xbd_max_request_segments)) {
- device_printf(sc->xbd_dev,
- "Back-end specified max_request_size of %u "
- "limited to front-end limit of %u. (Too few segments.)\n",
- sc->xbd_max_request_size,
- XBD_SEGS_TO_SIZE(sc->xbd_max_request_segments));
- sc->xbd_max_request_size =
- XBD_SEGS_TO_SIZE(sc->xbd_max_request_segments);
- }
-
- sc->xbd_max_request_blocks =
- BLKIF_SEGS_TO_BLOCKS(sc->xbd_max_request_segments);
-
/* Allocate datastructures based on negotiated values. */
error = bus_dma_tag_create(
bus_get_dma_tag(sc->xbd_dev), /* parent */
@@ -1241,36 +1178,6 @@ xbd_initialize(struct xbd_softc *sc)
}
}
- error = xs_printf(XST_NIL, node_path,
- "max-requests","%u",
- sc->xbd_max_requests);
- if (error) {
- xenbus_dev_fatal(sc->xbd_dev, error,
- "writing %s/max-requests",
- node_path);
- return;
- }
-
- error = xs_printf(XST_NIL, node_path,
- "max-request-segments","%u",
- sc->xbd_max_request_segments);
- if (error) {
- xenbus_dev_fatal(sc->xbd_dev, error,
- "writing %s/max-request-segments",
- node_path);
- return;
- }
-
- error = xs_printf(XST_NIL, node_path,
- "max-request-size","%u",
- sc->xbd_max_request_size);
- if (error) {
- xenbus_dev_fatal(sc->xbd_dev, error,
- "writing %s/max-request-size",
- node_path);
- return;
- }
-
error = xs_printf(XST_NIL, node_path, "event-channel",
"%u", xen_intr_port(sc->xen_intr_handle));
if (error) {
diff --git a/sys/dev/xen/blkfront/block.h b/sys/dev/xen/blkfront/block.h
index 9c803bc..3007118 100644
--- a/sys/dev/xen/blkfront/block.h
+++ b/sys/dev/xen/blkfront/block.h
@@ -61,11 +61,19 @@
((size / PAGE_SIZE) + 1)
/**
+ * The maximum number of shared memory ring pages we will allow in a
+ * negotiated block-front/back communication channel. Allow enough
+ * ring space for all requests to be XBD_MAX_REQUEST_SIZE'd.
+ */
+#define XBD_MAX_RING_PAGES 32
+
+/**
* The maximum number of outstanding requests blocks (request headers plus
* additional segment blocks) we will allow in a negotiated block-front/back
* communication channel.
*/
-#define XBD_MAX_REQUESTS 256
+#define XBD_MAX_REQUESTS \
+ __CONST_RING_SIZE(blkif, PAGE_SIZE * XBD_MAX_RING_PAGES)
/**
* The maximum mapped region size per request we will allow in a negotiated
@@ -83,15 +91,6 @@
(MIN(BLKIF_MAX_SEGMENTS_PER_REQUEST, \
XBD_SIZE_TO_SEGS(XBD_MAX_REQUEST_SIZE)))
-/**
- * The maximum number of shared memory ring pages we will allow in a
- * negotiated block-front/back communication channel. Allow enough
- * ring space for all requests to be XBD_MAX_REQUEST_SIZE'd.
- */
-#define XBD_MAX_RING_PAGES \
- BLKIF_RING_PAGES(BLKIF_SEGS_TO_BLOCKS(XBD_MAX_SEGMENTS_PER_REQUEST) \
- * XBD_MAX_REQUESTS)
-
typedef enum {
XBDCF_Q_MASK = 0xFF,
/* This command has contributed to xbd_qfrozen_cnt. */
@@ -175,7 +174,6 @@ struct xbd_softc {
u_int xbd_ring_pages;
uint32_t xbd_max_requests;
uint32_t xbd_max_request_segments;
- uint32_t xbd_max_request_blocks;
uint32_t xbd_max_request_size;
grant_ref_t xbd_ring_ref[XBD_MAX_RING_PAGES];
blkif_front_ring_t xbd_ring;
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c
index 552ddd2..fe8e9ef 100644
--- a/sys/fs/devfs/devfs_vnops.c
+++ b/sys/fs/devfs/devfs_vnops.c
@@ -51,6 +51,7 @@
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/malloc.h>
+#include <sys/mman.h>
#include <sys/mount.h>
#include <sys/namei.h>
#include <sys/priv.h>
@@ -71,6 +72,10 @@ static struct fileops devfs_ops_f;
#include <security/mac/mac_framework.h>
+#include <vm/vm.h>
+#include <vm/vm_extern.h>
+#include <vm/vm_object.h>
+
static MALLOC_DEFINE(M_CDEVPDATA, "DEVFSP", "Metainfo for cdev-fp data");
struct mtx devfs_de_interlock;
@@ -1738,6 +1743,65 @@ devfs_write_f(struct file *fp, struct uio *uio, struct ucred *cred,
return (error);
}
+static int
+devfs_mmap_f(struct file *fp, vm_map_t map, vm_offset_t *addr, vm_size_t size,
+ vm_prot_t prot, vm_prot_t cap_maxprot, int flags, vm_ooffset_t foff,
+ struct thread *td)
+{
+ struct cdev *dev;
+ struct cdevsw *dsw;
+ struct mount *mp;
+ struct vnode *vp;
+ struct file *fpop;
+ vm_object_t object;
+ vm_prot_t maxprot;
+ int error, ref;
+
+ vp = fp->f_vnode;
+
+ /*
+ * Ensure that file and memory protections are
+ * compatible.
+ */
+ mp = vp->v_mount;
+ if (mp != NULL && (mp->mnt_flag & MNT_NOEXEC) != 0)
+ maxprot = VM_PROT_NONE;
+ else
+ maxprot = VM_PROT_EXECUTE;
+ if ((fp->f_flag & FREAD) != 0)
+ maxprot |= VM_PROT_READ;
+ else if ((prot & VM_PROT_READ) != 0)
+ return (EACCES);
+
+ /*
+ * Character devices always share mappings, so
+ * require a writable fd for writable mappings.
+ */
+ if ((fp->f_flag & FWRITE) != 0)
+ maxprot |= VM_PROT_WRITE;
+ else if ((prot & VM_PROT_WRITE) != 0)
+ return (EACCES);
+ maxprot &= cap_maxprot;
+
+ fpop = td->td_fpop;
+ error = devfs_fp_check(fp, &dev, &dsw, &ref);
+ if (error != 0)
+ return (error);
+
+ error = vm_mmap_cdev(td, size, prot, &maxprot, &flags, dev, dsw, &foff,
+ &object);
+ td->td_fpop = fpop;
+ dev_relthread(dev, ref);
+ if (error != 0)
+ return (error);
+
+ error = vm_mmap_object(map, addr, size, prot, maxprot, flags, object,
+ foff, FALSE, td);
+ if (error != 0)
+ vm_object_deallocate(object);
+ return (error);
+}
+
dev_t
dev2udev(struct cdev *x)
{
@@ -1760,6 +1824,7 @@ static struct fileops devfs_ops_f = {
.fo_sendfile = vn_sendfile,
.fo_seek = vn_seek,
.fo_fill_kinfo = vn_fill_kinfo,
+ .fo_mmap = devfs_mmap_f,
.fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE
};
diff --git a/sys/fs/ext2fs/ext2_vnops.c b/sys/fs/ext2fs/ext2_vnops.c
index dd30aea..5b8990ee 100644
--- a/sys/fs/ext2fs/ext2_vnops.c
+++ b/sys/fs/ext2fs/ext2_vnops.c
@@ -128,6 +128,7 @@ struct vop_vector ext2_vnodeops = {
.vop_create = ext2_create,
.vop_fsync = ext2_fsync,
.vop_getpages = vnode_pager_local_getpages,
+ .vop_getpages_async = vnode_pager_local_getpages_async,
.vop_getattr = ext2_getattr,
.vop_inactive = ext2_inactive,
.vop_ioctl = ext2_ioctl,
diff --git a/sys/fs/fdescfs/fdesc_vfsops.c b/sys/fs/fdescfs/fdesc_vfsops.c
index d3d8ce0..f379c5a 100644
--- a/sys/fs/fdescfs/fdesc_vfsops.c
+++ b/sys/fs/fdescfs/fdesc_vfsops.c
@@ -199,9 +199,7 @@ fdesc_statfs(mp, sbp)
* limit is ever reduced below the current number
* of open files... ]
*/
- PROC_LOCK(td->td_proc);
- lim = lim_cur(td->td_proc, RLIMIT_NOFILE);
- PROC_UNLOCK(td->td_proc);
+ lim = lim_cur(td, RLIMIT_NOFILE);
fdp = td->td_proc->p_fd;
FILEDESC_SLOCK(fdp);
limit = racct_get_limit(td->td_proc, RACCT_NOFILE);
diff --git a/sys/fs/nfs/nfs.h b/sys/fs/nfs/nfs.h
index 2ee9145..be60c1c 100644
--- a/sys/fs/nfs/nfs.h
+++ b/sys/fs/nfs/nfs.h
@@ -138,11 +138,11 @@
/*
* This macro defines the high water mark for issuing V4 delegations.
- * (It is currently set at a conservative 20% of NFSRV_V4STATELIMIT. This
+ * (It is currently set at a conservative 20% of nfsrv_v4statelimit. This
* may want to increase when clients can make more effective use of
* delegations.)
*/
-#define NFSRV_V4DELEGLIMIT(c) (((c) * 5) > NFSRV_V4STATELIMIT)
+#define NFSRV_V4DELEGLIMIT(c) (((c) * 5) > nfsrv_v4statelimit)
#define NFS_READDIRBLKSIZ DIRBLKSIZ /* Minimal nm_readdirsize */
diff --git a/sys/fs/nfs/nfsdport.h b/sys/fs/nfs/nfsdport.h
index efa4b12..a20b554 100644
--- a/sys/fs/nfs/nfsdport.h
+++ b/sys/fs/nfs/nfsdport.h
@@ -88,7 +88,7 @@ struct nfsexstuff {
bcmp(&(f1)->fh_fid, &(f2)->fh_fid, sizeof(struct fid)) == 0)
#define NFSLOCKHASH(f) \
- (&nfslockhash[nfsrv_hashfh(f) % NFSLOCKHASHSIZE])
+ (&nfslockhash[nfsrv_hashfh(f) % nfsrv_lockhashsize])
#define NFSFPVNODE(f) ((struct vnode *)((f)->f_data))
#define NFSFPCRED(f) ((f)->f_cred)
diff --git a/sys/fs/nfs/nfsrvstate.h b/sys/fs/nfs/nfsrvstate.h
index 59a0542..972fffe 100644
--- a/sys/fs/nfs/nfsrvstate.h
+++ b/sys/fs/nfs/nfsrvstate.h
@@ -52,9 +52,9 @@ LIST_HEAD(nfsuserhashhead, nfsusrgrp);
TAILQ_HEAD(nfsuserlruhead, nfsusrgrp);
#define NFSCLIENTHASH(id) \
- (&nfsclienthash[(id).lval[1] % NFSCLIENTHASHSIZE])
+ (&nfsclienthash[(id).lval[1] % nfsrv_clienthashsize])
#define NFSSTATEHASH(clp, id) \
- (&((clp)->lc_stateid[(id).other[2] % NFSSTATEHASHSIZE]))
+ (&((clp)->lc_stateid[(id).other[2] % nfsrv_statehashsize]))
#define NFSUSERHASH(id) \
(&nfsuserhash[(id) % NFSUSERHASHSIZE])
#define NFSUSERNAMEHASH(p, l) \
@@ -71,7 +71,7 @@ struct nfssessionhash {
struct nfssessionhashhead list;
};
#define NFSSESSIONHASH(f) \
- (&nfssessionhash[nfsrv_hashsessionid(f) % NFSSESSIONHASHSIZE])
+ (&nfssessionhash[nfsrv_hashsessionid(f) % nfsrv_sessionhashsize])
/*
* Client server structure for V4. It is doubly linked into two lists.
@@ -81,7 +81,7 @@ struct nfssessionhash {
*/
struct nfsclient {
LIST_ENTRY(nfsclient) lc_hash; /* Clientid hash list */
- struct nfsstatehead lc_stateid[NFSSTATEHASHSIZE]; /* stateid hash */
+ struct nfsstatehead *lc_stateid; /* Stateid hash */
struct nfsstatehead lc_open; /* Open owner list */
struct nfsstatehead lc_deleg; /* Delegations */
struct nfsstatehead lc_olddeleg; /* and old delegations */
@@ -97,10 +97,10 @@ struct nfsclient {
u_int32_t lc_cbref; /* Cnt of callbacks */
uid_t lc_uid; /* User credential */
gid_t lc_gid;
- u_int16_t lc_namelen;
+ u_int16_t lc_idlen; /* Client ID and len */
+ u_int16_t lc_namelen; /* plus GSS principal and len */
u_char *lc_name;
struct nfssockreq lc_req; /* Callback info */
- u_short lc_idlen; /* Length of id string */
u_int32_t lc_flags; /* LCL_ flag bits */
u_char lc_verf[NFSX_VERF]; /* client verifier */
u_char lc_id[1]; /* Malloc'd correct size */
diff --git a/sys/fs/nfsserver/nfs_nfsdkrpc.c b/sys/fs/nfsserver/nfs_nfsdkrpc.c
index f9b8eb8..0f60686 100644
--- a/sys/fs/nfsserver/nfs_nfsdkrpc.c
+++ b/sys/fs/nfsserver/nfs_nfsdkrpc.c
@@ -294,6 +294,8 @@ nfssvc_program(struct svc_req *rqst, SVCXPRT *xprt)
svc_freereq(rqst);
out:
+ if (softdep_ast_cleanup != NULL)
+ softdep_ast_cleanup();
NFSEXITCODE(0);
}
@@ -464,6 +466,7 @@ int
nfsrvd_nfsd(struct thread *td, struct nfsd_nfsd_args *args)
{
char principal[MAXHOSTNAMELEN + 5];
+ struct proc *p;
int error = 0;
bool_t ret2, ret3, ret4;
@@ -481,6 +484,10 @@ nfsrvd_nfsd(struct thread *td, struct nfsd_nfsd_args *args)
*/
NFSD_LOCK();
if (newnfs_numnfsd == 0) {
+ p = td->td_proc;
+ PROC_LOCK(p);
+ p->p_flag2 |= P2_AST_SU;
+ PROC_UNLOCK(p);
newnfs_numnfsd++;
NFSD_UNLOCK();
@@ -512,6 +519,9 @@ nfsrvd_nfsd(struct thread *td, struct nfsd_nfsd_args *args)
NFSD_LOCK();
newnfs_numnfsd--;
nfsrvd_init(1);
+ PROC_LOCK(p);
+ p->p_flag2 &= ~P2_AST_SU;
+ PROC_UNLOCK(p);
}
NFSD_UNLOCK();
diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c
index 94475d9..85b4466 100644
--- a/sys/fs/nfsserver/nfs_nfsdport.c
+++ b/sys/fs/nfsserver/nfs_nfsdport.c
@@ -58,7 +58,10 @@ extern struct nfsrv_stablefirst nfsrv_stablefirst;
extern void (*nfsd_call_servertimer)(void);
extern SVCPOOL *nfsrvd_pool;
extern struct nfsv4lock nfsd_suspend_lock;
-extern struct nfssessionhash nfssessionhash[NFSSESSIONHASHSIZE];
+extern struct nfsclienthashhead *nfsclienthash;
+extern struct nfslockhashhead *nfslockhash;
+extern struct nfssessionhash *nfssessionhash;
+extern int nfsrv_sessionhashsize;
struct vfsoptlist nfsv4root_opt, nfsv4root_newopt;
NFSDLOCKMUTEX;
struct nfsrchash_bucket nfsrchash_table[NFSRVCACHE_HASHSIZE];
@@ -3330,9 +3333,6 @@ nfsd_modevent(module_t mod, int type, void *data)
mtx_init(&nfsrc_udpmtx, "nfsuc", NULL, MTX_DEF);
mtx_init(&nfs_v4root_mutex, "nfs4rt", NULL, MTX_DEF);
mtx_init(&nfsv4root_mnt.mnt_mtx, "nfs4mnt", NULL, MTX_DEF);
- for (i = 0; i < NFSSESSIONHASHSIZE; i++)
- mtx_init(&nfssessionhash[i].mtx, "nfssm",
- NULL, MTX_DEF);
lockinit(&nfsv4root_mnt.mnt_explock, PVFS, "explock", 0, 0);
nfsrvd_initcache();
nfsd_init();
@@ -3380,9 +3380,12 @@ nfsd_modevent(module_t mod, int type, void *data)
mtx_destroy(&nfsrc_udpmtx);
mtx_destroy(&nfs_v4root_mutex);
mtx_destroy(&nfsv4root_mnt.mnt_mtx);
- for (i = 0; i < NFSSESSIONHASHSIZE; i++)
+ for (i = 0; i < nfsrv_sessionhashsize; i++)
mtx_destroy(&nfssessionhash[i].mtx);
lockdestroy(&nfsv4root_mnt.mnt_explock);
+ free(nfsclienthash, M_NFSDCLIENT);
+ free(nfslockhash, M_NFSDLOCKFILE);
+ free(nfssessionhash, M_NFSDSESSION);
loaded = 0;
break;
default:
diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c
index bd0c2da..bd054c4 100644
--- a/sys/fs/nfsserver/nfs_nfsdserv.c
+++ b/sys/fs/nfsserver/nfs_nfsdserv.c
@@ -53,6 +53,7 @@ extern enum vtype nv34tov_type[8];
extern struct timeval nfsboottime;
extern int nfs_rootfhset;
extern int nfsrv_enable_crossmntpt;
+extern int nfsrv_statehashsize;
#endif /* !APPLEKEXT */
static int nfs_async = 0;
@@ -3468,9 +3469,10 @@ nfsrvd_setclientid(struct nfsrv_descript *nd, __unused int isdgram,
idlen = i;
if (nd->nd_flag & ND_GSS)
i += nd->nd_princlen;
- MALLOC(clp, struct nfsclient *, sizeof (struct nfsclient) + i,
- M_NFSDCLIENT, M_WAITOK);
- NFSBZERO((caddr_t)clp, sizeof (struct nfsclient) + i);
+ clp = malloc(sizeof(struct nfsclient) + i, M_NFSDCLIENT, M_WAITOK |
+ M_ZERO);
+ clp->lc_stateid = malloc(sizeof(struct nfsstatehead) *
+ nfsrv_statehashsize, M_NFSDCLIENT, M_WAITOK);
NFSINITSOCKMUTEX(&clp->lc_req.nr_mtx);
NFSSOCKADDRALLOC(clp->lc_req.nr_nam);
NFSSOCKADDRSIZE(clp->lc_req.nr_nam, sizeof (struct sockaddr_in));
@@ -3530,7 +3532,8 @@ nfsrvd_setclientid(struct nfsrv_descript *nd, __unused int isdgram,
if (clp) {
NFSSOCKADDRFREE(clp->lc_req.nr_nam);
NFSFREEMUTEX(&clp->lc_req.nr_mtx);
- free((caddr_t)clp, M_NFSDCLIENT);
+ free(clp->lc_stateid, M_NFSDCLIENT);
+ free(clp, M_NFSDCLIENT);
}
if (!nd->nd_repstat) {
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_HYPER);
@@ -3547,7 +3550,8 @@ nfsmout:
if (clp) {
NFSSOCKADDRFREE(clp->lc_req.nr_nam);
NFSFREEMUTEX(&clp->lc_req.nr_mtx);
- free((caddr_t)clp, M_NFSDCLIENT);
+ free(clp->lc_stateid, M_NFSDCLIENT);
+ free(clp, M_NFSDCLIENT);
}
NFSEXITCODE2(error, nd);
return (error);
@@ -3738,8 +3742,10 @@ nfsrvd_exchangeid(struct nfsrv_descript *nd, __unused int isdgram,
idlen = i;
if (nd->nd_flag & ND_GSS)
i += nd->nd_princlen;
- clp = (struct nfsclient *)malloc(sizeof(struct nfsclient) + i,
- M_NFSDCLIENT, M_WAITOK | M_ZERO);
+ clp = malloc(sizeof(struct nfsclient) + i, M_NFSDCLIENT, M_WAITOK |
+ M_ZERO);
+ clp->lc_stateid = malloc(sizeof(struct nfsstatehead) *
+ nfsrv_statehashsize, M_NFSDCLIENT, M_WAITOK);
NFSINITSOCKMUTEX(&clp->lc_req.nr_mtx);
NFSSOCKADDRALLOC(clp->lc_req.nr_nam);
NFSSOCKADDRSIZE(clp->lc_req.nr_nam, sizeof (struct sockaddr_in));
@@ -3796,6 +3802,7 @@ nfsrvd_exchangeid(struct nfsrv_descript *nd, __unused int isdgram,
if (clp != NULL) {
NFSSOCKADDRFREE(clp->lc_req.nr_nam);
NFSFREEMUTEX(&clp->lc_req.nr_mtx);
+ free(clp->lc_stateid, M_NFSDCLIENT);
free(clp, M_NFSDCLIENT);
}
if (nd->nd_repstat == 0) {
@@ -3828,6 +3835,7 @@ nfsmout:
if (clp != NULL) {
NFSSOCKADDRFREE(clp->lc_req.nr_nam);
NFSFREEMUTEX(&clp->lc_req.nr_mtx);
+ free(clp->lc_stateid, M_NFSDCLIENT);
free(clp, M_NFSDCLIENT);
}
NFSEXITCODE2(error, nd);
diff --git a/sys/fs/nfsserver/nfs_nfsdsocket.c b/sys/fs/nfsserver/nfs_nfsdsocket.c
index b15dfec..4497161 100644
--- a/sys/fs/nfsserver/nfs_nfsdsocket.c
+++ b/sys/fs/nfsserver/nfs_nfsdsocket.c
@@ -46,7 +46,8 @@ extern struct nfsrvfh nfs_pubfh, nfs_rootfh;
extern int nfs_pubfhset, nfs_rootfhset;
extern struct nfsv4lock nfsv4rootfs_lock;
extern struct nfsrv_stablefirst nfsrv_stablefirst;
-extern struct nfsclienthashhead nfsclienthash[NFSCLIENTHASHSIZE];
+extern struct nfsclienthashhead *nfsclienthash;
+extern int nfsrv_clienthashsize;
extern int nfsrc_floodlevel, nfsrc_tcpsavedreplies;
extern int nfsd_debuglevel;
NFSV4ROOTLOCKMUTEX;
@@ -439,9 +440,12 @@ nfsrvd_dorpc(struct nfsrv_descript *nd, int isdgram, u_char *tag, int taglen,
if (nd->nd_procnum == NFSPROC_READ ||
nd->nd_procnum == NFSPROC_WRITE ||
nd->nd_procnum == NFSPROC_READDIR ||
+ nd->nd_procnum == NFSPROC_READDIRPLUS ||
nd->nd_procnum == NFSPROC_READLINK ||
nd->nd_procnum == NFSPROC_GETATTR ||
- nd->nd_procnum == NFSPROC_ACCESS)
+ nd->nd_procnum == NFSPROC_ACCESS ||
+ nd->nd_procnum == NFSPROC_FSSTAT ||
+ nd->nd_procnum == NFSPROC_FSINFO)
lktype = LK_SHARED;
else
lktype = LK_EXCLUSIVE;
@@ -543,7 +547,7 @@ static void
nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag,
int taglen, u_int32_t minorvers, NFSPROC_T *p)
{
- int i, op, op0 = 0;
+ int i, lktype, op, op0 = 0;
u_int32_t *tl;
struct nfsclient *clp, *nclp;
int numops, error = 0, igotlock;
@@ -610,7 +614,7 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag,
*/
if (nfsrv_stablefirst.nsf_flags & NFSNSF_EXPIREDCLIENT) {
nfsrv_stablefirst.nsf_flags &= ~NFSNSF_EXPIREDCLIENT;
- for (i = 0; i < NFSCLIENTHASHSIZE; i++) {
+ for (i = 0; i < nfsrv_clienthashsize; i++) {
LIST_FOREACH_SAFE(clp, &nfsclienthash[i], lc_hash,
nclp) {
if (clp->lc_flags & LCL_EXPIREIT) {
@@ -952,11 +956,15 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag,
panic("nfsrvd_compound");
if (nfsv4_opflag[op].needscfh) {
if (vp != NULL) {
- if (nfsv4_opflag[op].modifyfs)
+ lktype = nfsv4_opflag[op].lktype;
+ if (nfsv4_opflag[op].modifyfs) {
vn_start_write(vp, &temp_mp,
V_WAIT);
- if (NFSVOPLOCK(vp, nfsv4_opflag[op].lktype)
- == 0)
+ if (op == NFSV4OP_WRITE &&
+ MNT_SHARED_WRITES(temp_mp))
+ lktype = LK_SHARED;
+ }
+ if (NFSVOPLOCK(vp, lktype) == 0)
VREF(vp);
else
nd->nd_repstat = NFSERR_PERM;
diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c
index 5e9beeb..15f5243 100644
--- a/sys/fs/nfsserver/nfs_nfsdstate.c
+++ b/sys/fs/nfsserver/nfs_nfsdstate.c
@@ -44,14 +44,38 @@ extern u_int32_t newnfs_true, newnfs_false;
NFSV4ROOTLOCKMUTEX;
NFSSTATESPINLOCK;
+SYSCTL_DECL(_vfs_nfsd);
+int nfsrv_statehashsize = NFSSTATEHASHSIZE;
+SYSCTL_INT(_vfs_nfsd, OID_AUTO, statehashsize, CTLFLAG_RDTUN,
+ &nfsrv_statehashsize, 0,
+ "Size of state hash table set via loader.conf");
+
+int nfsrv_clienthashsize = NFSCLIENTHASHSIZE;
+SYSCTL_INT(_vfs_nfsd, OID_AUTO, clienthashsize, CTLFLAG_RDTUN,
+ &nfsrv_clienthashsize, 0,
+ "Size of client hash table set via loader.conf");
+
+int nfsrv_lockhashsize = NFSLOCKHASHSIZE;
+SYSCTL_INT(_vfs_nfsd, OID_AUTO, fhhashsize, CTLFLAG_RDTUN,
+ &nfsrv_lockhashsize, 0,
+ "Size of file handle hash table set via loader.conf");
+
+int nfsrv_sessionhashsize = NFSSESSIONHASHSIZE;
+SYSCTL_INT(_vfs_nfsd, OID_AUTO, sessionhashsize, CTLFLAG_RDTUN,
+ &nfsrv_sessionhashsize, 0,
+ "Size of session hash table set via loader.conf");
+
+static int nfsrv_v4statelimit = NFSRV_V4STATELIMIT;
+SYSCTL_INT(_vfs_nfsd, OID_AUTO, v4statelimit, CTLFLAG_RWTUN,
+ &nfsrv_v4statelimit, 0,
+ "High water limit for NFSv4 opens+locks+delegations");
+
/*
* Hash lists for nfs V4.
- * (Some would put them in the .h file, but I don't like declaring storage
- * in a .h)
*/
-struct nfsclienthashhead nfsclienthash[NFSCLIENTHASHSIZE];
-struct nfslockhashhead nfslockhash[NFSLOCKHASHSIZE];
-struct nfssessionhash nfssessionhash[NFSSESSIONHASHSIZE];
+struct nfsclienthashhead *nfsclienthash;
+struct nfslockhashhead *nfslockhash;
+struct nfssessionhash *nfssessionhash;
#endif /* !APPLEKEXT */
static u_int32_t nfsrv_openpluslock = 0, nfsrv_delegatecnt = 0;
@@ -153,7 +177,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp,
/*
* Check for state resource limit exceeded.
*/
- if (nfsrv_openpluslock > NFSRV_V4STATELIMIT) {
+ if (nfsrv_openpluslock > nfsrv_v4statelimit) {
error = NFSERR_RESOURCE;
goto out;
}
@@ -188,7 +212,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp,
* Search for a match in the client list.
*/
gotit = i = 0;
- while (i < NFSCLIENTHASHSIZE && !gotit) {
+ while (i < nfsrv_clienthashsize && !gotit) {
LIST_FOREACH(clp, &nfsclienthash[i], lc_hash) {
if (new_clp->lc_idlen == clp->lc_idlen &&
!NFSBCMP(new_clp->lc_id, clp->lc_id, clp->lc_idlen)) {
@@ -215,7 +239,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp,
/*
* Get rid of the old one.
*/
- if (i != NFSCLIENTHASHSIZE) {
+ if (i != nfsrv_clienthashsize) {
LIST_REMOVE(clp, lc_hash);
nfsrv_cleanclient(clp, p);
nfsrv_freedeleglist(&clp->lc_deleg);
@@ -244,7 +268,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp,
LIST_INIT(&new_clp->lc_deleg);
LIST_INIT(&new_clp->lc_olddeleg);
LIST_INIT(&new_clp->lc_session);
- for (i = 0; i < NFSSTATEHASHSIZE; i++)
+ for (i = 0; i < nfsrv_statehashsize; i++)
LIST_INIT(&new_clp->lc_stateid[i]);
LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp,
lc_hash);
@@ -344,7 +368,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp,
ls_list);
LIST_FOREACH(tstp, &new_clp->lc_olddeleg, ls_list)
tstp->ls_clp = new_clp;
- for (i = 0; i < NFSSTATEHASHSIZE; i++) {
+ for (i = 0; i < nfsrv_statehashsize; i++) {
LIST_NEWHEAD(&new_clp->lc_stateid[i],
&clp->lc_stateid[i], ls_hash);
LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_hash)
@@ -405,7 +429,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp,
LIST_NEWHEAD(&new_clp->lc_olddeleg, &clp->lc_olddeleg, ls_list);
LIST_FOREACH(tstp, &new_clp->lc_olddeleg, ls_list)
tstp->ls_clp = new_clp;
- for (i = 0; i < NFSSTATEHASHSIZE; i++) {
+ for (i = 0; i < nfsrv_statehashsize; i++) {
LIST_NEWHEAD(&new_clp->lc_stateid[i],
&clp->lc_stateid[i], ls_hash);
LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_hash)
@@ -615,7 +639,7 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp,
if (!error && (opflags & CLOPS_RENEWOP)) {
if (nfsrv_notsamecredname(nd, clp)) {
doneok = 0;
- for (i = 0; i < NFSSTATEHASHSIZE && doneok == 0; i++) {
+ for (i = 0; i < nfsrv_statehashsize && doneok == 0; i++) {
LIST_FOREACH(stp, &clp->lc_stateid[i], ls_hash) {
if ((stp->ls_flags & NFSLCK_OPEN) &&
stp->ls_uid == nd->nd_cred->cr_uid) {
@@ -687,7 +711,7 @@ nfsrv_destroyclient(nfsquad_t clientid, NFSPROC_T *p)
}
/* Scan for state on the clientid. */
- for (i = 0; i < NFSSTATEHASHSIZE; i++)
+ for (i = 0; i < nfsrv_statehashsize; i++)
if (!LIST_EMPTY(&clp->lc_stateid[i])) {
NFSLOCKV4ROOTMUTEX();
nfsv4_unlock(&nfsv4rootfs_lock, 1);
@@ -744,7 +768,7 @@ nfsrv_adminrevoke(struct nfsd_clid *revokep, NFSPROC_T *p)
* Search for a match in the client list.
*/
gotit = i = 0;
- while (i < NFSCLIENTHASHSIZE && !gotit) {
+ while (i < nfsrv_clienthashsize && !gotit) {
LIST_FOREACH(clp, &nfsclienthash[i], lc_hash) {
if (revokep->nclid_idlen == clp->lc_idlen &&
!NFSBCMP(revokep->nclid_id, clp->lc_id, clp->lc_idlen)) {
@@ -806,7 +830,7 @@ nfsrv_dumpclients(struct nfsd_dumpclients *dumpp, int maxcnt)
/*
* Rattle through the client lists until done.
*/
- while (i < NFSCLIENTHASHSIZE && cnt < maxcnt) {
+ while (i < nfsrv_clienthashsize && cnt < maxcnt) {
clp = LIST_FIRST(&nfsclienthash[i]);
while (clp != LIST_END(&nfsclienthash[i]) && cnt < maxcnt) {
nfsrv_dumpaclient(clp, &dumpp[cnt]);
@@ -1074,7 +1098,7 @@ nfsrv_servertimer(void)
/*
* For each client...
*/
- for (i = 0; i < NFSCLIENTHASHSIZE; i++) {
+ for (i = 0; i < nfsrv_clienthashsize; i++) {
clp = LIST_FIRST(&nfsclienthash[i]);
while (clp != LIST_END(&nfsclienthash[i])) {
nclp = LIST_NEXT(clp, lc_hash);
@@ -1085,7 +1109,7 @@ nfsrv_servertimer(void)
nfsrv_clients > nfsrv_clienthighwater)) ||
(clp->lc_expiry + NFSRV_MOULDYLEASE) < NFSD_MONOSEC ||
(clp->lc_expiry < NFSD_MONOSEC &&
- (nfsrv_openpluslock * 10 / 9) > NFSRV_V4STATELIMIT)) {
+ (nfsrv_openpluslock * 10 / 9) > nfsrv_v4statelimit)) {
/*
* Lease has expired several nfsrv_lease times ago:
* PLUS
@@ -1124,7 +1148,7 @@ nfsrv_servertimer(void)
stp->ls_noopens++;
if (stp->ls_noopens > NFSNOOPEN ||
(nfsrv_openpluslock * 2) >
- NFSRV_V4STATELIMIT)
+ nfsrv_v4statelimit)
nfsrv_stablefirst.nsf_flags |=
NFSNSF_NOOPENS;
} else {
@@ -1188,7 +1212,8 @@ nfsrv_zapclient(struct nfsclient *clp, NFSPROC_T *p)
newnfs_disconnect(&clp->lc_req);
NFSSOCKADDRFREE(clp->lc_req.nr_nam);
NFSFREEMUTEX(&clp->lc_req.nr_mtx);
- free((caddr_t)clp, M_NFSDCLIENT);
+ free(clp->lc_stateid, M_NFSDCLIENT);
+ free(clp, M_NFSDCLIENT);
NFSLOCKSTATE();
newnfsstats.srvclients--;
nfsrv_openpluslock--;
@@ -1534,7 +1559,7 @@ nfsrv_lockctrl(vnode_t vp, struct nfsstate **new_stpp,
* Check for state resource limit exceeded.
*/
if ((new_stp->ls_flags & NFSLCK_LOCK) &&
- nfsrv_openpluslock > NFSRV_V4STATELIMIT) {
+ nfsrv_openpluslock > nfsrv_v4statelimit) {
error = NFSERR_RESOURCE;
goto out;
}
@@ -2232,7 +2257,7 @@ nfsrv_opencheck(nfsquad_t clientid, nfsv4stateid_t *stateidp,
* returns NFSERR_RESOURCE and the limit is just a rather
* arbitrary high water mark, so no harm is done.
*/
- if (nfsrv_openpluslock > NFSRV_V4STATELIMIT) {
+ if (nfsrv_openpluslock > nfsrv_v4statelimit) {
error = NFSERR_RESOURCE;
goto out;
}
@@ -4298,7 +4323,7 @@ nfsrv_nextstateindex(struct nfsclient *clp)
*/
min_index = 0;
max_index = 0xffffffff;
- for (i = 0; i < NFSSTATEHASHSIZE; i++) {
+ for (i = 0; i < nfsrv_statehashsize; i++) {
LIST_FOREACH(stp, &clp->lc_stateid[i], ls_hash) {
if (stp->ls_stateid.other[2] > 0x80000000) {
if (stp->ls_stateid.other[2] < max_index)
@@ -4322,7 +4347,7 @@ nfsrv_nextstateindex(struct nfsclient *clp)
* cleanest way to code the loop.)
*/
tryagain:
- for (i = 0; i < NFSSTATEHASHSIZE; i++) {
+ for (i = 0; i < nfsrv_statehashsize; i++) {
LIST_FOREACH(stp, &clp->lc_stateid[i], ls_hash) {
if (stp->ls_stateid.other[2] == canuse) {
canuse++;
@@ -5319,13 +5344,13 @@ nfsrv_throwawayopens(NFSPROC_T *p)
/*
* For each client...
*/
- for (i = 0; i < NFSCLIENTHASHSIZE; i++) {
+ for (i = 0; i < nfsrv_clienthashsize; i++) {
LIST_FOREACH_SAFE(clp, &nfsclienthash[i], lc_hash, nclp) {
LIST_FOREACH_SAFE(stp, &clp->lc_open, ls_list, nstp) {
if (LIST_EMPTY(&stp->ls_open) &&
(stp->ls_noopens > NFSNOOPEN ||
(nfsrv_openpluslock * 2) >
- NFSRV_V4STATELIMIT))
+ nfsrv_v4statelimit))
nfsrv_freeopenowner(stp, 0, p);
}
}
@@ -5696,11 +5721,12 @@ nfsrv_throwawayallstate(NFSPROC_T *p)
/*
* For each client, clean out the state and then free the structure.
*/
- for (i = 0; i < NFSCLIENTHASHSIZE; i++) {
+ for (i = 0; i < nfsrv_clienthashsize; i++) {
LIST_FOREACH_SAFE(clp, &nfsclienthash[i], lc_hash, nclp) {
nfsrv_cleanclient(clp, p);
nfsrv_freedeleglist(&clp->lc_deleg);
nfsrv_freedeleglist(&clp->lc_olddeleg);
+ free(clp->lc_stateid, M_NFSDCLIENT);
free(clp, M_NFSDCLIENT);
}
}
@@ -5708,7 +5734,7 @@ nfsrv_throwawayallstate(NFSPROC_T *p)
/*
* Also, free up any remaining lock file structures.
*/
- for (i = 0; i < NFSLOCKHASHSIZE; i++) {
+ for (i = 0; i < nfsrv_lockhashsize; i++) {
LIST_FOREACH_SAFE(lfp, &nfslockhash[i], lf_hash, nlfp) {
printf("nfsd unload: fnd a lock file struct\n");
nfsrv_freenfslockfile(lfp);
diff --git a/sys/fs/nfsserver/nfs_nfsdsubs.c b/sys/fs/nfsserver/nfs_nfsdsubs.c
index 6bd1412..c0421e3 100644
--- a/sys/fs/nfsserver/nfs_nfsdsubs.c
+++ b/sys/fs/nfsserver/nfs_nfsdsubs.c
@@ -44,9 +44,12 @@ __FBSDID("$FreeBSD$");
extern u_int32_t newnfs_true, newnfs_false;
extern int nfs_pubfhset;
-extern struct nfsclienthashhead nfsclienthash[NFSCLIENTHASHSIZE];
-extern struct nfslockhashhead nfslockhash[NFSLOCKHASHSIZE];
-extern struct nfssessionhash nfssessionhash[NFSSESSIONHASHSIZE];
+extern struct nfsclienthashhead *nfsclienthash;
+extern int nfsrv_clienthashsize;
+extern struct nfslockhashhead *nfslockhash;
+extern int nfsrv_lockhashsize;
+extern struct nfssessionhash *nfssessionhash;
+extern int nfsrv_sessionhashsize;
extern int nfsrv_useacl;
extern uid_t nfsrv_defaultuid;
extern gid_t nfsrv_defaultgid;
@@ -2036,12 +2039,20 @@ nfsd_init(void)
* Initialize client queues. Don't free/reinitialize
* them when nfsds are restarted.
*/
- for (i = 0; i < NFSCLIENTHASHSIZE; i++)
+ nfsclienthash = malloc(sizeof(struct nfsclienthashhead) *
+ nfsrv_clienthashsize, M_NFSDCLIENT, M_WAITOK | M_ZERO);
+ for (i = 0; i < nfsrv_clienthashsize; i++)
LIST_INIT(&nfsclienthash[i]);
- for (i = 0; i < NFSLOCKHASHSIZE; i++)
+ nfslockhash = malloc(sizeof(struct nfslockhashhead) *
+ nfsrv_lockhashsize, M_NFSDLOCKFILE, M_WAITOK | M_ZERO);
+ for (i = 0; i < nfsrv_lockhashsize; i++)
LIST_INIT(&nfslockhash[i]);
- for (i = 0; i < NFSSESSIONHASHSIZE; i++)
+ nfssessionhash = malloc(sizeof(struct nfssessionhash) *
+ nfsrv_sessionhashsize, M_NFSDSESSION, M_WAITOK | M_ZERO);
+ for (i = 0; i < nfsrv_sessionhashsize; i++) {
+ mtx_init(&nfssessionhash[i].mtx, "nfssm", NULL, MTX_DEF);
LIST_INIT(&nfssessionhash[i].list);
+ }
/* and the v2 pubfh should be all zeros */
NFSBZERO(nfs_v2pubfh, NFSX_V2FH);
diff --git a/sys/fs/procfs/procfs_ctl.c b/sys/fs/procfs/procfs_ctl.c
index 1437644..15679e3 100644
--- a/sys/fs/procfs/procfs_ctl.c
+++ b/sys/fs/procfs/procfs_ctl.c
@@ -235,6 +235,7 @@ out:
} else
PROC_LOCK(p);
p->p_oppid = 0;
+ p->p_stops = 0;
p->p_flag &= ~P_WAITED; /* XXX ? */
sx_xunlock(&proctree_lock);
diff --git a/sys/fs/procfs/procfs_map.c b/sys/fs/procfs/procfs_map.c
index eae70229..b00aac3 100644
--- a/sys/fs/procfs/procfs_map.c
+++ b/sys/fs/procfs/procfs_map.c
@@ -159,11 +159,11 @@ procfs_doprocmap(PFS_FILL_ARGS)
freepath = NULL;
fullpath = "-";
if (lobj) {
+ vp = NULL;
switch (lobj->type) {
default:
case OBJT_DEFAULT:
type = "default";
- vp = NULL;
break;
case OBJT_VNODE:
type = "vnode";
@@ -171,13 +171,19 @@ procfs_doprocmap(PFS_FILL_ARGS)
vref(vp);
break;
case OBJT_SWAP:
- type = "swap";
- vp = NULL;
+ if ((lobj->flags & OBJ_TMPFS_NODE) != 0) {
+ type = "vnode";
+ if ((lobj->flags & OBJ_TMPFS) != 0) {
+ vp = lobj->un_pager.swp.swp_tmpfs;
+ vref(vp);
+ }
+ } else {
+ type = "swap";
+ }
break;
case OBJT_SG:
case OBJT_DEVICE:
type = "device";
- vp = NULL;
break;
}
if (lobj != obj)
diff --git a/sys/fs/pseudofs/pseudofs.c b/sys/fs/pseudofs/pseudofs.c
index d7894af..1824d0b 100644
--- a/sys/fs/pseudofs/pseudofs.c
+++ b/sys/fs/pseudofs/pseudofs.c
@@ -52,9 +52,11 @@ static MALLOC_DEFINE(M_PFSNODES, "pfs_nodes", "pseudofs nodes");
SYSCTL_NODE(_vfs, OID_AUTO, pfs, CTLFLAG_RW, 0,
"pseudofs");
+#ifdef PSEUDOFS_TRACE
int pfs_trace;
SYSCTL_INT(_vfs_pfs, OID_AUTO, trace, CTLFLAG_RW, &pfs_trace, 0,
"enable tracing of pseudofs vnode operations");
+#endif
#if PFS_FSNAMELEN != MFSNAMELEN
#error "PFS_FSNAMELEN is not equal to MFSNAMELEN"
diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c
index 2e35582..5e2a825 100644
--- a/sys/fs/tmpfs/tmpfs_subr.c
+++ b/sys/fs/tmpfs/tmpfs_subr.c
@@ -1320,7 +1320,7 @@ tmpfs_reg_resize(struct vnode *vp, off_t newsize, boolean_t ignerr)
struct tmpfs_mount *tmp;
struct tmpfs_node *node;
vm_object_t uobj;
- vm_page_t m, ma[1];
+ vm_page_t m;
vm_pindex_t idx, newpages, oldpages;
off_t oldsize;
int base, rv;
@@ -1367,11 +1367,9 @@ retry:
VM_WAIT;
VM_OBJECT_WLOCK(uobj);
goto retry;
- } else if (m->valid != VM_PAGE_BITS_ALL) {
- ma[0] = m;
- rv = vm_pager_get_pages(uobj, ma, 1, 0);
- m = vm_page_lookup(uobj, idx);
- } else
+ } else if (m->valid != VM_PAGE_BITS_ALL)
+ rv = vm_pager_get_pages(uobj, &m, 1, 0);
+ else
/* A cached page was reactivated. */
rv = VM_PAGER_OK;
vm_page_lock(m);
diff --git a/sys/fs/unionfs/union_vfsops.c b/sys/fs/unionfs/union_vfsops.c
index e4b9fb5..f65ee8c 100644
--- a/sys/fs/unionfs/union_vfsops.c
+++ b/sys/fs/unionfs/union_vfsops.c
@@ -291,18 +291,11 @@ unionfs_domount(struct mount *mp)
}
MNT_ILOCK(mp);
- /*
- * Check mnt_flag
- */
if ((ump->um_lowervp->v_mount->mnt_flag & MNT_LOCAL) &&
(ump->um_uppervp->v_mount->mnt_flag & MNT_LOCAL))
mp->mnt_flag |= MNT_LOCAL;
- /*
- * Check mnt_kern_flag
- */
- if ((ump->um_lowervp->v_mount->mnt_flag & MNTK_SUSPENDABLE) ||
- (ump->um_uppervp->v_mount->mnt_flag & MNTK_SUSPENDABLE))
+ if ((ump->um_uppervp->v_mount->mnt_kern_flag & MNTK_SUSPENDABLE) != 0)
mp->mnt_kern_flag |= MNTK_SUSPENDABLE;
MNT_IUNLOCK(mp);
diff --git a/sys/geom/part/g_part_gpt.c b/sys/geom/part/g_part_gpt.c
index 81ddfa2..08a3198 100644
--- a/sys/geom/part/g_part_gpt.c
+++ b/sys/geom/part/g_part_gpt.c
@@ -760,7 +760,7 @@ g_part_gpt_resize(struct g_part_table *basetable,
struct g_part_gpt_entry *entry;
if (baseentry == NULL)
- return (EOPNOTSUPP);
+ return (g_part_gpt_recover(basetable));
entry = (struct g_part_gpt_entry *)baseentry;
baseentry->gpe_end = baseentry->gpe_start + gpp->gpp_size - 1;
diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES
index e5710bf..1bf8163 100644
--- a/sys/i386/conf/NOTES
+++ b/sys/i386/conf/NOTES
@@ -17,6 +17,23 @@ profile 2
#
options KDTRACE_HOOKS
+# DTrace core
+# NOTE: introduces CDDL-licensed components into the kernel
+#device dtrace
+
+# DTrace modules
+#device dtrace_lockstat
+#device dtrace_profile
+#device dtrace_sdt
+#device dtrace_fbt
+#device dtrace_systrace
+#device dtrace_prototype
+#device dtnfscl
+#device dtmalloc
+
+# Alternatively include all the DTrace modules
+#device dtraceall
+
#####################################################################
# SMP OPTIONS:
diff --git a/sys/i386/i386/elf_machdep.c b/sys/i386/i386/elf_machdep.c
index 8cd4440..03ab10f 100644
--- a/sys/i386/i386/elf_machdep.c
+++ b/sys/i386/i386/elf_machdep.c
@@ -88,6 +88,7 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_shared_page_base = SHAREDPAGE,
.sv_shared_page_len = PAGE_SIZE,
.sv_schedtail = NULL,
+ .sv_thread_detach = NULL,
};
INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec);
diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s
index 39a8828..70c6d9d 100644
--- a/sys/i386/i386/exception.s
+++ b/sys/i386/i386/exception.s
@@ -157,9 +157,12 @@ IDTVEC(xmm)
.type alltraps,@function
alltraps:
pushal
- pushl %ds
- pushl %es
- pushl %fs
+ pushl $0
+ movl %ds,(%esp)
+ pushl $0
+ movl %es,(%esp)
+ pushl $0
+ movl %fs,(%esp)
alltraps_with_regs_pushed:
SET_KERNEL_SREGS
cld
@@ -233,9 +236,12 @@ IDTVEC(lcall_syscall)
pushl $7 /* sizeof "lcall 7,0" */
subl $4,%esp /* skip over tf_trapno */
pushal
- pushl %ds
- pushl %es
- pushl %fs
+ pushl $0
+ movl %ds,(%esp)
+ pushl $0
+ movl %es,(%esp)
+ pushl $0
+ movl %fs,(%esp)
SET_KERNEL_SREGS
cld
FAKE_MCOUNT(TF_EIP(%esp))
@@ -259,9 +265,12 @@ IDTVEC(int0x80_syscall)
pushl $2 /* sizeof "int 0x80" */
subl $4,%esp /* skip over tf_trapno */
pushal
- pushl %ds
- pushl %es
- pushl %fs
+ pushl $0
+ movl %ds,(%esp)
+ pushl $0
+ movl %es,(%esp)
+ pushl $0
+ movl %fs,(%esp)
SET_KERNEL_SREGS
cld
FAKE_MCOUNT(TF_EIP(%esp))
@@ -416,13 +425,16 @@ doreti_iret:
doreti_iret_fault:
subl $8,%esp
pushal
- pushl %ds
+ pushl $0
+ movl %ds,(%esp)
.globl doreti_popl_ds_fault
doreti_popl_ds_fault:
- pushl %es
+ pushl $0
+ movl %es,(%esp)
.globl doreti_popl_es_fault
doreti_popl_es_fault:
- pushl %fs
+ pushl $0
+ movl %fs,(%esp)
.globl doreti_popl_fs_fault
doreti_popl_fs_fault:
sti
diff --git a/sys/i386/i386/gdb_machdep.c b/sys/i386/i386/gdb_machdep.c
index a42b2b6..06809ad 100644
--- a/sys/i386/i386/gdb_machdep.c
+++ b/sys/i386/i386/gdb_machdep.c
@@ -45,14 +45,22 @@ __FBSDID("$FreeBSD$");
void *
gdb_cpu_getreg(int regnum, size_t *regsz)
{
+ static uint32_t _kcodesel = GSEL(GCODE_SEL, SEL_KPL);
+ static uint32_t _kdatasel = GSEL(GDATA_SEL, SEL_KPL);
+ static uint32_t _kprivsel = GSEL(GPRIV_SEL, SEL_KPL);
*regsz = gdb_cpu_regsz(regnum);
- if (kdb_thread == curthread) {
+ if (kdb_thread == curthread) {
switch (regnum) {
case 0: return (&kdb_frame->tf_eax);
case 1: return (&kdb_frame->tf_ecx);
case 2: return (&kdb_frame->tf_edx);
+ case 9: return (&kdb_frame->tf_eflags);
+ case 10: return (&kdb_frame->tf_cs);
+ case 12: return (&kdb_frame->tf_ds);
+ case 13: return (&kdb_frame->tf_es);
+ case 14: return (&kdb_frame->tf_fs);
}
}
switch (regnum) {
@@ -62,6 +70,12 @@ gdb_cpu_getreg(int regnum, size_t *regsz)
case 6: return (&kdb_thrctx->pcb_esi);
case 7: return (&kdb_thrctx->pcb_edi);
case 8: return (&kdb_thrctx->pcb_eip);
+ case 10: return (&_kcodesel);
+ case 11: return (&_kdatasel);
+ case 12: return (&_kdatasel);
+ case 13: return (&_kdatasel);
+ case 14: return (&_kprivsel);
+ case 15: return (&kdb_thrctx->pcb_gs);
}
return (NULL);
}
diff --git a/sys/i386/i386/initcpu.c b/sys/i386/i386/initcpu.c
index 9d8c265..705d915 100644
--- a/sys/i386/i386/initcpu.c
+++ b/sys/i386/i386/initcpu.c
@@ -102,6 +102,7 @@ u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */
#endif
u_int cpu_clflush_line_size = 32;
u_int cpu_stdext_feature;
+u_int cpu_stdext_feature2;
u_int cpu_max_ext_state_size;
u_int cpu_mon_mwait_flags; /* MONITOR/MWAIT flags (CPUID.05H.ECX) */
u_int cpu_mon_min_size; /* MONITOR minimum range size, bytes */
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index a5867c4..0373b6f 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -383,10 +383,6 @@ osendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
} else
fp = (struct osigframe *)regs->tf_esp - 1;
- /* Translate the signal if appropriate. */
- if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize)
- sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
-
/* Build the argument list for the signal handler. */
sf.sf_signum = sig;
sf.sf_scp = (register_t)&fp->sf_siginfo.si_sc;
@@ -534,10 +530,6 @@ freebsd4_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
} else
sfp = (struct sigframe4 *)regs->tf_esp - 1;
- /* Translate the signal if appropriate. */
- if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize)
- sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
-
/* Build the argument list for the signal handler. */
sf.sf_signum = sig;
sf.sf_ucontext = (register_t)&sfp->sf_uc;
@@ -2875,6 +2867,7 @@ makectx(struct trapframe *tf, struct pcb *pcb)
pcb->pcb_ebx = tf->tf_ebx;
pcb->pcb_eip = tf->tf_eip;
pcb->pcb_esp = (ISPL(tf->tf_cs)) ? tf->tf_esp : (int)(tf + 1) - 8;
+ pcb->pcb_gs = rgs();
}
int
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index 029a277..a642d10 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -4035,6 +4035,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, vm_size_t len,
~PG_W;
dst_pmap->pm_stats.resident_count +=
NBPDR / PAGE_SIZE;
+ pmap_pde_mappings++;
}
continue;
}
diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c
index d783a2b..1e417bf 100644
--- a/sys/i386/i386/trap.c
+++ b/sys/i386/i386/trap.c
@@ -306,8 +306,8 @@ trap(struct trapframe *frame)
td->td_pticks = 0;
td->td_frame = frame;
addr = frame->tf_eip;
- if (td->td_ucred != p->p_ucred)
- cred_update_thread(td);
+ if (td->td_cowgen != p->p_cowgen)
+ thread_cow_update(td);
switch (type) {
case T_PRIVINFLT: /* privileged instruction fault */
@@ -998,12 +998,8 @@ trap_fatal(frame, eva)
if (frame->tf_eflags & PSL_VM)
printf("vm86, ");
printf("IOPL = %d\n", (frame->tf_eflags & PSL_IOPL) >> 12);
- printf("current process = ");
- if (curproc) {
- printf("%lu (%s)\n", (u_long)curproc->p_pid, curthread->td_name);
- } else {
- printf("Idle\n");
- }
+ printf("current process = %d (%s)\n",
+ curproc->p_pid, curthread->td_name);
#ifdef KDB
if (debugger_on_panic || kdb_active) {
diff --git a/sys/i386/ibcs2/ibcs2_misc.c b/sys/i386/ibcs2/ibcs2_misc.c
index 2c2cae4..c4dba20 100644
--- a/sys/i386/ibcs2/ibcs2_misc.c
+++ b/sys/i386/ibcs2/ibcs2_misc.c
@@ -98,40 +98,30 @@ ibcs2_ulimit(td, uap)
struct ibcs2_ulimit_args *uap;
{
struct rlimit rl;
- struct proc *p;
int error;
#define IBCS2_GETFSIZE 1
#define IBCS2_SETFSIZE 2
#define IBCS2_GETPSIZE 3
#define IBCS2_GETDTABLESIZE 4
- p = td->td_proc;
switch (uap->cmd) {
case IBCS2_GETFSIZE:
- PROC_LOCK(p);
- td->td_retval[0] = lim_cur(p, RLIMIT_FSIZE);
- PROC_UNLOCK(p);
+ td->td_retval[0] = lim_cur(td, RLIMIT_FSIZE);
if (td->td_retval[0] == -1)
td->td_retval[0] = 0x7fffffff;
return 0;
case IBCS2_SETFSIZE:
- PROC_LOCK(p);
- rl.rlim_max = lim_max(p, RLIMIT_FSIZE);
- PROC_UNLOCK(p);
+ rl.rlim_max = lim_max(td, RLIMIT_FSIZE);
rl.rlim_cur = uap->newlimit;
error = kern_setrlimit(td, RLIMIT_FSIZE, &rl);
if (!error) {
- PROC_LOCK(p);
- td->td_retval[0] = lim_cur(p, RLIMIT_FSIZE);
- PROC_UNLOCK(p);
+ td->td_retval[0] = lim_cur(td, RLIMIT_FSIZE);
} else {
DPRINTF(("failed "));
}
return error;
case IBCS2_GETPSIZE:
- PROC_LOCK(p);
- td->td_retval[0] = lim_cur(p, RLIMIT_RSS); /* XXX */
- PROC_UNLOCK(p);
+ td->td_retval[0] = lim_cur(td, RLIMIT_RSS); /* XXX */
return 0;
case IBCS2_GETDTABLESIZE:
uap->cmd = IBCS2_SC_OPEN_MAX;
@@ -801,18 +791,14 @@ ibcs2_sysconf(td, uap)
struct ibcs2_sysconf_args *uap;
{
int mib[2], value, len, error;
- struct proc *p;
- p = td->td_proc;
switch(uap->name) {
case IBCS2_SC_ARG_MAX:
mib[1] = KERN_ARGMAX;
break;
case IBCS2_SC_CHILD_MAX:
- PROC_LOCK(p);
- td->td_retval[0] = lim_cur(td->td_proc, RLIMIT_NPROC);
- PROC_UNLOCK(p);
+ td->td_retval[0] = lim_cur(td, RLIMIT_NPROC);
return 0;
case IBCS2_SC_CLK_TCK:
@@ -824,9 +810,7 @@ ibcs2_sysconf(td, uap)
break;
case IBCS2_SC_OPEN_MAX:
- PROC_LOCK(p);
- td->td_retval[0] = lim_cur(td->td_proc, RLIMIT_NOFILE);
- PROC_UNLOCK(p);
+ td->td_retval[0] = lim_cur(td, RLIMIT_NOFILE);
return 0;
case IBCS2_SC_JOB_CONTROL:
diff --git a/sys/i386/ibcs2/ibcs2_sysvec.c b/sys/i386/ibcs2/ibcs2_sysvec.c
index 5d007c7..16507ee 100644
--- a/sys/i386/ibcs2/ibcs2_sysvec.c
+++ b/sys/i386/ibcs2/ibcs2_sysvec.c
@@ -89,6 +89,7 @@ struct sysentvec ibcs2_svr3_sysvec = {
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
.sv_syscallnames = NULL,
.sv_schedtail = NULL,
+ .sv_thread_detach = NULL,
};
static int
diff --git a/sys/i386/include/asmacros.h b/sys/i386/include/asmacros.h
index 716915c..91c25f7 100644
--- a/sys/i386/include/asmacros.h
+++ b/sys/i386/include/asmacros.h
@@ -146,9 +146,12 @@
pushl $0 ; /* dummy error code */ \
pushl $0 ; /* dummy trap type */ \
pushal ; /* 8 ints */ \
- pushl %ds ; /* save data and extra segments ... */ \
- pushl %es ; \
- pushl %fs
+ pushl $0 ; /* save data and extra segments ... */ \
+ mov %ds,(%esp) ; \
+ pushl $0 ; \
+ mov %es,(%esp) ; \
+ pushl $0 ; \
+ mov %fs,(%esp)
#define POP_FRAME \
popl %fs ; \
diff --git a/sys/i386/include/gdb_machdep.h b/sys/i386/include/gdb_machdep.h
index 95af8d4..a60ba18 100644
--- a/sys/i386/include/gdb_machdep.h
+++ b/sys/i386/include/gdb_machdep.h
@@ -30,7 +30,7 @@
#define _MACHINE_GDB_MACHDEP_H_
#define GDB_BUFSZ 400
-#define GDB_NREGS 14
+#define GDB_NREGS 16
#define GDB_REG_PC 8
static __inline size_t
diff --git a/sys/i386/include/md_var.h b/sys/i386/include/md_var.h
index b5bd35e..633e9c5 100644
--- a/sys/i386/include/md_var.h
+++ b/sys/i386/include/md_var.h
@@ -49,6 +49,7 @@ extern u_int via_feature_rng;
extern u_int via_feature_xcrypt;
extern u_int cpu_clflush_line_size;
extern u_int cpu_stdext_feature;
+extern u_int cpu_stdext_feature2;
extern u_int cpu_fxsr;
extern u_int cpu_high;
extern u_int cpu_id;
diff --git a/sys/i386/include/vmparam.h b/sys/i386/include/vmparam.h
index cb23b05..987ac62 100644
--- a/sys/i386/include/vmparam.h
+++ b/sys/i386/include/vmparam.h
@@ -83,13 +83,12 @@
#define VM_PHYSSEG_MAX 17
/*
- * Create two free page pools. Since the i386 kernel virtual address
+ * Create one free page pool. Since the i386 kernel virtual address
* space does not include a mapping onto the machine's entire physical
* memory, VM_FREEPOOL_DIRECT is defined as an alias for the default
* pool, VM_FREEPOOL_DEFAULT.
*/
-#define VM_NFREEPOOL 2
-#define VM_FREEPOOL_CACHE 1
+#define VM_NFREEPOOL 1
#define VM_FREEPOOL_DEFAULT 0
#define VM_FREEPOOL_DIRECT 0
diff --git a/sys/i386/linux/imgact_linux.c b/sys/i386/linux/imgact_linux.c
index 0a4114b..9363b47 100644
--- a/sys/i386/linux/imgact_linux.c
+++ b/sys/i386/linux/imgact_linux.c
@@ -108,7 +108,7 @@ exec_linux_imgact(struct image_params *imgp)
*/
PROC_LOCK(imgp->proc);
if (a_out->a_text > maxtsiz ||
- a_out->a_data + bss_size > lim_cur(imgp->proc, RLIMIT_DATA) ||
+ a_out->a_data + bss_size > lim_cur_proc(imgp->proc, RLIMIT_DATA) ||
racct_set(imgp->proc, RACCT_DATA, a_out->a_data + bss_size) != 0) {
PROC_UNLOCK(imgp->proc);
return (ENOMEM);
diff --git a/sys/i386/linux/linux.h b/sys/i386/linux/linux.h
index 27eff32..36b2084 100644
--- a/sys/i386/linux/linux.h
+++ b/sys/i386/linux/linux.h
@@ -33,6 +33,7 @@
#include <sys/signal.h> /* for sigval union */
+#include <compat/linux/linux.h>
#include <i386/linux/linux_syscall.h>
/*
@@ -40,14 +41,12 @@
*/
extern u_char linux_debug_map[];
#define ldebug(name) isclr(linux_debug_map, LINUX_SYS_linux_ ## name)
-#define ARGS(nm, fmt) "linux(%ld): "#nm"("fmt")\n", (long)td->td_proc->p_pid
-#define LMSG(fmt) "linux(%ld): "fmt"\n", (long)td->td_proc->p_pid
+#define ARGS(nm, fmt) "linux(%ld/%ld): "#nm"("fmt")\n", \
+ (long)td->td_proc->p_pid, (long)td->td_tid
+#define LMSG(fmt) "linux(%ld/%ld): "fmt"\n", \
+ (long)td->td_proc->p_pid, (long)td->td_tid
#define LINUX_DTRACE linuxulator
-#ifdef MALLOC_DECLARE
-MALLOC_DECLARE(M_LINUX);
-#endif
-
#define LINUX_SHAREDPAGE (VM_MAXUSER_ADDRESS - PAGE_SIZE)
#define LINUX_USRSTACK LINUX_SHAREDPAGE
@@ -91,6 +90,7 @@ typedef l_uint l_uid_t;
typedef l_ushort l_uid16_t;
typedef l_int l_timer_t;
typedef l_int l_mqd_t;
+typedef l_ulong l_fd_mask;
typedef struct {
l_int val[2];
@@ -106,7 +106,7 @@ typedef struct {
/*
* Miscellaneous
*/
-#define LINUX_AT_COUNT 16 /* Count of used aux entry types.
+#define LINUX_AT_COUNT 20 /* Count of used aux entry types.
* Keep this synchronized with
* elf_linux_fixup() code.
*/
@@ -235,48 +235,7 @@ struct l_statfs64 {
l_int f_spare[6];
};
-/*
- * Signalling
- */
-#define LINUX_SIGHUP 1
-#define LINUX_SIGINT 2
-#define LINUX_SIGQUIT 3
-#define LINUX_SIGILL 4
-#define LINUX_SIGTRAP 5
-#define LINUX_SIGABRT 6
-#define LINUX_SIGIOT LINUX_SIGABRT
-#define LINUX_SIGBUS 7
-#define LINUX_SIGFPE 8
-#define LINUX_SIGKILL 9
-#define LINUX_SIGUSR1 10
-#define LINUX_SIGSEGV 11
-#define LINUX_SIGUSR2 12
-#define LINUX_SIGPIPE 13
-#define LINUX_SIGALRM 14
-#define LINUX_SIGTERM 15
-#define LINUX_SIGSTKFLT 16
-#define LINUX_SIGCHLD 17
-#define LINUX_SIGCONT 18
-#define LINUX_SIGSTOP 19
-#define LINUX_SIGTSTP 20
-#define LINUX_SIGTTIN 21
-#define LINUX_SIGTTOU 22
-#define LINUX_SIGURG 23
-#define LINUX_SIGXCPU 24
-#define LINUX_SIGXFSZ 25
-#define LINUX_SIGVTALRM 26
-#define LINUX_SIGPROF 27
-#define LINUX_SIGWINCH 28
-#define LINUX_SIGIO 29
-#define LINUX_SIGPOLL LINUX_SIGIO
-#define LINUX_SIGPWR 30
-#define LINUX_SIGSYS 31
-#define LINUX_SIGRTMIN 32
-
-#define LINUX_SIGTBLSZ 31
#define LINUX_NSIG_WORDS 2
-#define LINUX_NBPW 32
-#define LINUX_NSIG (LINUX_NBPW * LINUX_NSIG_WORDS)
/* sigaction flags */
#define LINUX_SA_NOCLDSTOP 0x00000001
@@ -294,27 +253,13 @@ struct l_statfs64 {
#define LINUX_SIG_UNBLOCK 1
#define LINUX_SIG_SETMASK 2
-/* sigset_t macros */
-#define LINUX_SIGEMPTYSET(set) (set).__bits[0] = (set).__bits[1] = 0
-#define LINUX_SIGISMEMBER(set, sig) SIGISMEMBER(set, sig)
-#define LINUX_SIGADDSET(set, sig) SIGADDSET(set, sig)
-
/* sigaltstack */
#define LINUX_MINSIGSTKSZ 2048
-#define LINUX_SS_ONSTACK 1
-#define LINUX_SS_DISABLE 2
-
-int linux_to_bsd_sigaltstack(int lsa);
-int bsd_to_linux_sigaltstack(int bsa);
typedef void (*l_handler_t)(l_int);
typedef l_ulong l_osigset_t;
typedef struct {
- l_uint __bits[LINUX_NSIG_WORDS];
-} l_sigset_t;
-
-typedef struct {
l_handler_t lsa_handler;
l_osigset_t lsa_mask;
l_ulong lsa_flags;
@@ -497,50 +442,14 @@ struct l_rt_sigframe {
};
extern struct sysentvec linux_sysvec;
-extern struct sysentvec elf_linux_sysvec;
/*
- * open/fcntl flags
+ * arch specific open/fcntl flags
*/
-#define LINUX_O_RDONLY 00000000
-#define LINUX_O_WRONLY 00000001
-#define LINUX_O_RDWR 00000002
-#define LINUX_O_ACCMODE 00000003
-#define LINUX_O_CREAT 00000100
-#define LINUX_O_EXCL 00000200
-#define LINUX_O_NOCTTY 00000400
-#define LINUX_O_TRUNC 00001000
-#define LINUX_O_APPEND 00002000
-#define LINUX_O_NONBLOCK 00004000
-#define LINUX_O_NDELAY LINUX_O_NONBLOCK
-#define LINUX_O_SYNC 00010000
-#define LINUX_FASYNC 00020000
-#define LINUX_O_DIRECT 00040000 /* Direct disk access hint */
-#define LINUX_O_LARGEFILE 00100000
-#define LINUX_O_DIRECTORY 00200000 /* Must be a directory */
-#define LINUX_O_NOFOLLOW 00400000 /* Do not follow links */
-#define LINUX_O_NOATIME 01000000
-#define LINUX_O_CLOEXEC 02000000
-
-#define LINUX_F_DUPFD 0
-#define LINUX_F_GETFD 1
-#define LINUX_F_SETFD 2
-#define LINUX_F_GETFL 3
-#define LINUX_F_SETFL 4
-#define LINUX_F_GETLK 5
-#define LINUX_F_SETLK 6
-#define LINUX_F_SETLKW 7
-#define LINUX_F_SETOWN 8
-#define LINUX_F_GETOWN 9
-
#define LINUX_F_GETLK64 12
#define LINUX_F_SETLK64 13
#define LINUX_F_SETLKW64 14
-#define LINUX_F_RDLCK 0
-#define LINUX_F_WRLCK 1
-#define LINUX_F_UNLCK 2
-
union l_semun {
l_int val;
struct l_semid_ds *buf;
@@ -549,6 +458,16 @@ union l_semun {
void *__pad;
};
+struct l_ipc_perm {
+ l_key_t key;
+ l_uid16_t uid;
+ l_gid16_t gid;
+ l_uid16_t cuid;
+ l_gid16_t cgid;
+ l_ushort mode;
+ l_ushort seq;
+};
+
/*
* Socket defines
*/
@@ -585,22 +504,6 @@ struct l_sockaddr {
char sa_data[14];
};
-struct l_msghdr {
- l_uintptr_t msg_name;
- l_int msg_namelen;
- l_uintptr_t msg_iov;
- l_size_t msg_iovlen;
- l_uintptr_t msg_control;
- l_size_t msg_controllen;
- l_uint msg_flags;
-};
-
-struct l_cmsghdr {
- l_size_t cmsg_len;
- l_int cmsg_level;
- l_int cmsg_type;
-};
-
struct l_ifmap {
l_ulong mem_start;
l_ulong mem_end;
@@ -739,6 +642,8 @@ struct l_desc_struct {
#define LINUX_GET_USEABLE(desc) \
(((desc)->b >> LINUX_ENTRY_B_USEABLE) & 1)
+#define linux_copyout_rusage(r, u) copyout(r, u, sizeof(*r))
+
/* robust futexes */
struct linux_robust_list {
struct linux_robust_list *next;
diff --git a/sys/i386/linux/linux_dummy.c b/sys/i386/linux/linux_dummy.c
index 85d40f0..4c0cad0 100644
--- a/sys/i386/linux/linux_dummy.c
+++ b/sys/i386/linux/linux_dummy.c
@@ -64,23 +64,18 @@ DUMMY(sysfs);
DUMMY(vm86);
DUMMY(query_module);
DUMMY(nfsservctl);
-DUMMY(rt_sigqueueinfo);
DUMMY(sendfile); /* different semantics */
DUMMY(setfsuid);
DUMMY(setfsgid);
DUMMY(pivot_root);
DUMMY(mincore);
DUMMY(lookup_dcookie);
-DUMMY(epoll_create);
-DUMMY(epoll_ctl);
-DUMMY(epoll_wait);
DUMMY(remap_file_pages);
DUMMY(fstatfs64);
DUMMY(mbind);
DUMMY(get_mempolicy);
DUMMY(set_mempolicy);
DUMMY(kexec_load);
-DUMMY(waitid);
/* linux 2.6.11: */
DUMMY(add_key);
DUMMY(request_key);
@@ -93,8 +88,6 @@ DUMMY(inotify_add_watch);
DUMMY(inotify_rm_watch);
/* linux 2.6.16: */
DUMMY(migrate_pages);
-DUMMY(pselect6);
-DUMMY(ppoll);
DUMMY(unshare);
/* linux 2.6.17: */
DUMMY(splice);
@@ -105,22 +98,14 @@ DUMMY(vmsplice);
DUMMY(move_pages);
/* linux 2.6.19: */
DUMMY(getcpu);
-DUMMY(epoll_pwait);
/* linux 2.6.22: */
-DUMMY(utimensat);
DUMMY(signalfd);
DUMMY(timerfd_create);
-DUMMY(eventfd);
-/* linux 2.6.23: */
-DUMMY(fallocate);
/* linux 2.6.25: */
DUMMY(timerfd_settime);
DUMMY(timerfd_gettime);
/* linux 2.6.27: */
DUMMY(signalfd4);
-DUMMY(eventfd2);
-DUMMY(epoll_create1);
-DUMMY(dup3);
DUMMY(inotify_init1);
/* linux 2.6.30: */
DUMMY(preadv);
@@ -129,17 +114,12 @@ DUMMY(pwritev);
DUMMY(rt_tsigqueueinfo);
DUMMY(perf_event_open);
/* linux 2.6.33: */
-DUMMY(recvmmsg);
DUMMY(fanotify_init);
DUMMY(fanotify_mark);
-/* linux 2.6.36: */
-DUMMY(prlimit64);
/* later: */
DUMMY(name_to_handle_at);
DUMMY(open_by_handle_at);
DUMMY(clock_adjtime);
-DUMMY(syncfs);
-DUMMY(sendmmsg);
DUMMY(setns);
DUMMY(process_vm_readv);
DUMMY(process_vm_writev);
diff --git a/sys/i386/linux/linux_genassym.c b/sys/i386/linux/linux_genassym.c
index 1e84572..9735110 100644
--- a/sys/i386/linux/linux_genassym.c
+++ b/sys/i386/linux/linux_genassym.c
@@ -6,6 +6,7 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <i386/linux/linux.h>
+#include <compat/linux/linux_mib.h>
ASSYM(LINUX_SIGF_HANDLER, offsetof(struct l_sigframe, sf_handler));
ASSYM(LINUX_SIGF_SC, offsetof(struct l_sigframe, sf_sc));
@@ -14,3 +15,5 @@ ASSYM(LINUX_SC_EFLAGS, offsetof(struct l_sigcontext, sc_eflags));
ASSYM(LINUX_RT_SIGF_HANDLER, offsetof(struct l_rt_sigframe, sf_handler));
ASSYM(LINUX_RT_SIGF_UC, offsetof(struct l_rt_sigframe, sf_sc));
ASSYM(LINUX_RT_SIGF_SC, offsetof(struct l_ucontext, uc_mcontext));
+ASSYM(LINUX_SC_ESP, offsetof(struct l_sigcontext, sc_esp));
+ASSYM(LINUX_VERSION_CODE, LINUX_VERSION_CODE);
diff --git a/sys/i386/linux/linux_locore.s b/sys/i386/linux/linux_locore.s
index a3e0e7dc..6c4d19c 100644
--- a/sys/i386/linux/linux_locore.s
+++ b/sys/i386/linux/linux_locore.s
@@ -5,33 +5,145 @@
#include <i386/linux/linux_syscall.h> /* system call numbers */
+#include "assym.s"
+
+/*
+ * To avoid excess stack frame the signal trampoline code emulates
+ * the 'call' instruction.
+ */
NON_GPROF_ENTRY(linux_sigcode)
- call *LINUX_SIGF_HANDLER(%esp)
- leal LINUX_SIGF_SC(%esp),%ebx /* linux scp */
- mov LINUX_SC_GS(%ebx),%gs
- movl %esp, %ebx /* pass sigframe */
- push %eax /* fake ret addr */
+ movl %esp, %ebx /* preserve sigframe */
+ call .getip0
+.getip0:
+ popl %eax
+ add $.startsigcode-.getip0, %eax /* ret address */
+ push %eax
+ jmp *LINUX_SIGF_HANDLER(%ebx)
+.startsigcode:
+ popl %eax /* gcc unwind code need this */
movl $LINUX_SYS_linux_sigreturn,%eax /* linux_sigreturn() */
int $0x80 /* enter kernel with args */
+.endsigcode:
0: jmp 0b
- ALIGN_TEXT
-/* XXXXX */
-linux_rt_sigcode:
- call *LINUX_RT_SIGF_HANDLER(%esp)
+
+NON_GPROF_ENTRY(linux_rt_sigcode)
leal LINUX_RT_SIGF_UC(%esp),%ebx /* linux ucp */
leal LINUX_RT_SIGF_SC(%ebx),%ecx /* linux sigcontext */
- mov LINUX_SC_GS(%ecx),%gs
- push %eax /* fake ret addr */
+ movl %esp, %edi
+ call .getip1
+.getip1:
+ popl %eax
+ add $.startrtsigcode-.getip1, %eax /* ret address */
+ push %eax
+ jmp *LINUX_RT_SIGF_HANDLER(%edi)
+.startrtsigcode:
movl $LINUX_SYS_linux_rt_sigreturn,%eax /* linux_rt_sigreturn() */
int $0x80 /* enter kernel with args */
+.endrtsigcode:
0: jmp 0b
- ALIGN_TEXT
-/* XXXXX */
-linux_esigcode:
-
- .data
- .globl linux_szsigcode, linux_sznonrtsigcode
-linux_szsigcode:
- .long linux_esigcode-linux_sigcode
-linux_sznonrtsigcode:
- .long linux_rt_sigcode-linux_sigcode
+
+NON_GPROF_ENTRY(linux_vsyscall)
+.startvsyscall:
+ int $0x80
+ ret
+.endvsyscall:
+
+#if 0
+ .section .note.Linux, "a",@note
+ .long 2f - 1f /* namesz */
+ .balign 4
+ .long 4f - 3f /* descsz */
+ .long 0
+1:
+ .asciz "Linux"
+2:
+ .balign 4
+3:
+ .long LINUX_VERSION_CODE
+4:
+ .balign 4
+ .previous
+#endif
+
+#define do_cfa_expr(offset) \
+ .byte 0x0f; /* DW_CFA_def_cfa_expression */ \
+ .uleb128 11f-10f; /* length */ \
+10: .byte 0x74; /* DW_OP_breg4 */ \
+ .sleb128 offset; /* offset */ \
+ .byte 0x06; /* DW_OP_deref */ \
+11:
+
+
+ /* CIE */
+ .section .eh_frame,"a",@progbits
+.LSTARTFRAMEDLSI1:
+ .long .LENDCIEDLSI1-.LSTARTCIEDLSI1
+.LSTARTCIEDLSI1:
+ .long 0 /* CIE ID */
+ .byte 1 /* Version number */
+ .string "zRS" /* NULL-terminated
+ * augmentation string
+ */
+ .uleb128 1 /* Code alignment factor */
+ .sleb128 -4 /* Data alignment factor */
+ .byte 8 /* Return address
+ * register column
+ */
+ .uleb128 1 /* Augmentation value length */
+ .byte 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */
+ .byte 0 /* DW_CFA_nop */
+ .align 4
+.LENDCIEDLSI1:
+
+ /* FDE */
+ .long .LENDFDEDLSI1-.LSTARTFDEDLSI1 /* Length FDE */
+.LSTARTFDEDLSI1:
+ .long .LSTARTFDEDLSI1-.LSTARTFRAMEDLSI1 /* CIE pointer */
+ .long .startsigcode-. /* PC-relative start address */
+ .long .endsigcode-.startsigcode
+ .uleb128 0 /* Augmentation */
+ do_cfa_expr(LINUX_SIGF_SC-8)
+ .align 4
+.LENDFDEDLSI1:
+
+ .long .LENDFDEDLSI2-.LSTARTFDEDLSI2 /* Length FDE */
+.LSTARTFDEDLSI2:
+ .long .LSTARTFDEDLSI2-.LSTARTFRAMEDLSI1 /* CIE pointer */
+ .long .startrtsigcode-. /* PC-relative start address */
+ .long .endrtsigcode-.startrtsigcode
+ .uleb128 0 /* Augmentation */
+ do_cfa_expr(LINUX_RT_SIGF_SC-4+LINUX_SC_ESP)
+ .align 4
+.LENDFDEDLSI2:
+ .previous
+
+ .section .eh_frame,"a",@progbits
+.LSTARTFRAMEDLSI2:
+ .long .LENDCIEDLSI2-.LSTARTCIEDLSI2
+.LSTARTCIEDLSI2:
+ .long 0 /* CIE ID */
+ .byte 1 /* Version number */
+ .string "zR" /* NULL-terminated
+ * augmentation string
+ */
+ .uleb128 1 /* Code alignment factor */
+ .sleb128 -4 /* Data alignment factor */
+ .byte 8 /* Return address register column */
+ .uleb128 1 /* Augmentation value length */
+ .byte 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */
+ .byte 0x0c /* DW_CFA_def_cfa */
+ .uleb128 4
+ .uleb128 4
+ .byte 0x88 /* DW_CFA_offset, column 0x8 */
+ .uleb128 1
+ .align 4
+.LENDCIEDLSI2:
+ .long .LENDFDEDLSI3-.LSTARTFDEDLSI3 /* Length FDE */
+.LSTARTFDEDLSI3:
+ .long .LSTARTFDEDLSI3-.LSTARTFRAMEDLSI2 /* CIE pointer */
+ .long .startvsyscall-. /* PC-relative start address */
+ .long .endvsyscall-.startvsyscall
+ .uleb128 0
+ .align 4
+.LENDFDEDLSI3:
+ .previous
diff --git a/sys/i386/linux/linux_machdep.c b/sys/i386/linux/linux_machdep.c
index effc32a..4fb5785 100644
--- a/sys/i386/linux/linux_machdep.c
+++ b/sys/i386/linux/linux_machdep.c
@@ -99,35 +99,11 @@ static int linux_mmap_common(struct thread *td, l_uintptr_t addr,
l_size_t len, l_int prot, l_int flags, l_int fd,
l_loff_t pos);
-int
-linux_to_bsd_sigaltstack(int lsa)
-{
- int bsa = 0;
-
- if (lsa & LINUX_SS_DISABLE)
- bsa |= SS_DISABLE;
- if (lsa & LINUX_SS_ONSTACK)
- bsa |= SS_ONSTACK;
- return (bsa);
-}
-
-int
-bsd_to_linux_sigaltstack(int bsa)
-{
- int lsa = 0;
-
- if (bsa & SS_DISABLE)
- lsa |= LINUX_SS_DISABLE;
- if (bsa & SS_ONSTACK)
- lsa |= LINUX_SS_ONSTACK;
- return (lsa);
-}
int
linux_execve(struct thread *td, struct linux_execve_args *args)
{
struct image_args eargs;
- struct vmspace *oldvmspace;
char *newpath;
int error;
@@ -138,26 +114,11 @@ linux_execve(struct thread *td, struct linux_execve_args *args)
printf(ARGS(execve, "%s"), newpath);
#endif
- error = pre_execve(td, &oldvmspace);
- if (error != 0) {
- free(newpath, M_TEMP);
- return (error);
- }
error = exec_copyin_args(&eargs, newpath, UIO_SYSSPACE,
args->argp, args->envp);
free(newpath, M_TEMP);
if (error == 0)
- error = kern_execve(td, &eargs, NULL);
- if (error == 0) {
- /* linux process can exec fbsd one, dont attempt
- * to create emuldata for such process using
- * linux_proc_init, this leads to a panic on KASSERT
- * because such process has p->p_emuldata == NULL
- */
- if (SV_PROC_ABI(td->td_proc) == SV_ABI_LINUX)
- error = linux_proc_init(td, 0, 0);
- }
- post_execve(td, error, oldvmspace);
+ error = linux_common_execve(td, &eargs);
return (error);
}
@@ -368,8 +329,14 @@ int
linux_set_upcall_kse(struct thread *td, register_t stack)
{
- td->td_frame->tf_esp = stack;
+ if (stack)
+ td->td_frame->tf_esp = stack;
+ /*
+ * The newly created Linux thread returns
+ * to the user space by the same path that a parent do.
+ */
+ td->td_frame->tf_eax = 0;
return (0);
}
@@ -542,7 +509,7 @@ linux_mmap_common(struct thread *td, l_uintptr_t addr, l_size_t len, l_int prot,
*/
PROC_LOCK(p);
p->p_vmspace->vm_maxsaddr = (char *)USRSTACK -
- lim_cur(p, RLIMIT_STACK);
+ lim_cur_proc(p, RLIMIT_STACK);
PROC_UNLOCK(p);
}
@@ -710,7 +677,7 @@ linux_sigaction(struct thread *td, struct linux_sigaction_args *args)
act.lsa_flags = osa.lsa_flags;
act.lsa_restorer = osa.lsa_restorer;
LINUX_SIGEMPTYSET(act.lsa_mask);
- act.lsa_mask.__bits[0] = osa.lsa_mask;
+ act.lsa_mask.__mask = osa.lsa_mask;
}
error = linux_do_sigaction(td, args->sig, args->nsa ? &act : NULL,
@@ -720,7 +687,7 @@ linux_sigaction(struct thread *td, struct linux_sigaction_args *args)
osa.lsa_handler = oact.lsa_handler;
osa.lsa_flags = oact.lsa_flags;
osa.lsa_restorer = oact.lsa_restorer;
- osa.lsa_mask = oact.lsa_mask.__bits[0];
+ osa.lsa_mask = oact.lsa_mask.__mask;
error = copyout(&osa, args->osa, sizeof(l_osigaction_t));
}
@@ -744,7 +711,7 @@ linux_sigsuspend(struct thread *td, struct linux_sigsuspend_args *args)
#endif
LINUX_SIGEMPTYSET(mask);
- mask.__bits[0] = args->mask;
+ mask.__mask = args->mask;
linux_to_bsd_sigset(&mask, &sigmask);
return (kern_sigsuspend(td, sigmask));
}
@@ -1048,34 +1015,3 @@ linux_mq_getsetattr(struct thread *td, struct linux_mq_getsetattr_args *args)
return (ENOSYS);
#endif
}
-
-int
-linux_wait4(struct thread *td, struct linux_wait4_args *args)
-{
- int error, options;
- struct rusage ru, *rup;
-
-#ifdef DEBUG
- if (ldebug(wait4))
- printf(ARGS(wait4, "%d, %p, %d, %p"),
- args->pid, (void *)args->status, args->options,
- (void *)args->rusage);
-#endif
-
- options = (args->options & (WNOHANG | WUNTRACED));
- /* WLINUXCLONE should be equal to __WCLONE, but we make sure */
- if (args->options & __WCLONE)
- options |= WLINUXCLONE;
-
- if (args->rusage != NULL)
- rup = &ru;
- else
- rup = NULL;
- error = linux_common_wait(td, args->pid, args->status, options, rup);
- if (error)
- return (error);
- if (args->rusage != NULL)
- error = copyout(&ru, args->rusage, sizeof(ru));
-
- return (error);
-}
diff --git a/sys/i386/linux/linux_proto.h b/sys/i386/linux/linux_proto.h
index c542c1d..a5d6ed2 100644
--- a/sys/i386/linux/linux_proto.h
+++ b/sys/i386/linux/linux_proto.h
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: head/sys/i386/linux/syscalls.master 276509 2015-01-01 18:41:34Z dchagin
+ * created from FreeBSD: head/sys/i386/linux/syscalls.master 283492 2015-05-24 18:08:01Z dchagin
*/
#ifndef _LINUX_SYSPROTO_H_
@@ -35,6 +35,9 @@ struct thread;
#endif
#define nosys linux_nosys
+struct linux_exit_args {
+ char rval_l_[PADL_(int)]; int rval; char rval_r_[PADR_(int)];
+};
struct linux_fork_args {
register_t dummy;
};
@@ -357,7 +360,7 @@ struct linux_wait4_args {
char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
char status_l_[PADL_(l_int *)]; l_int * status; char status_r_[PADR_(l_int *)];
char options_l_[PADL_(l_int)]; l_int options; char options_r_[PADR_(l_int)];
- char rusage_l_[PADL_(struct l_rusage *)]; struct l_rusage * rusage; char rusage_r_[PADR_(struct l_rusage *)];
+ char rusage_l_[PADL_(void *)]; void * rusage; char rusage_r_[PADR_(void *)];
};
struct linux_swapoff_args {
register_t dummy;
@@ -473,6 +476,14 @@ struct linux_fdatasync_args {
struct linux_sysctl_args {
char args_l_[PADL_(struct l___sysctl_args *)]; struct l___sysctl_args * args; char args_r_[PADR_(struct l___sysctl_args *)];
};
+struct linux_sched_setparam_args {
+ char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+ char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)];
+};
+struct linux_sched_getparam_args {
+ char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+ char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)];
+};
struct linux_sched_setscheduler_args {
char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)];
@@ -487,6 +498,10 @@ struct linux_sched_get_priority_max_args {
struct linux_sched_get_priority_min_args {
char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)];
};
+struct linux_sched_rr_get_interval_args {
+ char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+ char interval_l_[PADL_(struct l_timespec *)]; struct l_timespec * interval; char interval_r_[PADR_(struct l_timespec *)];
+};
struct linux_nanosleep_args {
char rqtp_l_[PADL_(const struct l_timespec *)]; const struct l_timespec * rqtp; char rqtp_r_[PADR_(const struct l_timespec *)];
char rmtp_l_[PADL_(struct l_timespec *)]; struct l_timespec * rmtp; char rmtp_r_[PADR_(struct l_timespec *)];
@@ -560,7 +575,9 @@ struct linux_rt_sigtimedwait_args {
char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)];
};
struct linux_rt_sigqueueinfo_args {
- register_t dummy;
+ char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+ char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)];
+ char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)];
};
struct linux_rt_sigsuspend_args {
char newset_l_[PADL_(l_sigset_t *)]; l_sigset_t * newset; char newset_r_[PADR_(l_sigset_t *)];
@@ -766,13 +783,19 @@ struct linux_lookup_dcookie_args {
register_t dummy;
};
struct linux_epoll_create_args {
- register_t dummy;
+ char size_l_[PADL_(l_int)]; l_int size; char size_r_[PADR_(l_int)];
};
struct linux_epoll_ctl_args {
- register_t dummy;
+ char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)];
+ char op_l_[PADL_(l_int)]; l_int op; char op_r_[PADR_(l_int)];
+ char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
+ char event_l_[PADL_(struct epoll_event *)]; struct epoll_event * event; char event_r_[PADR_(struct epoll_event *)];
};
struct linux_epoll_wait_args {
- register_t dummy;
+ char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)];
+ char events_l_[PADL_(struct epoll_event *)]; struct epoll_event * events; char events_r_[PADR_(struct epoll_event *)];
+ char maxevents_l_[PADL_(l_int)]; l_int maxevents; char maxevents_r_[PADR_(l_int)];
+ char timeout_l_[PADL_(l_int)]; l_int timeout; char timeout_r_[PADR_(l_int)];
};
struct linux_remap_file_pages_args {
register_t dummy;
@@ -887,7 +910,11 @@ struct linux_kexec_load_args {
register_t dummy;
};
struct linux_waitid_args {
- register_t dummy;
+ char idtype_l_[PADL_(int)]; int idtype; char idtype_r_[PADR_(int)];
+ char id_l_[PADL_(l_pid_t)]; l_pid_t id; char id_r_[PADR_(l_pid_t)];
+ char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)];
+ char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)];
+ char rusage_l_[PADL_(void *)]; void * rusage; char rusage_r_[PADR_(void *)];
};
struct linux_add_key_args {
register_t dummy;
@@ -989,13 +1016,21 @@ struct linux_faccessat_args {
char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)];
char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)];
char amode_l_[PADL_(l_int)]; l_int amode; char amode_r_[PADR_(l_int)];
- char flag_l_[PADL_(l_int)]; l_int flag; char flag_r_[PADR_(l_int)];
};
struct linux_pselect6_args {
- register_t dummy;
+ char nfds_l_[PADL_(l_int)]; l_int nfds; char nfds_r_[PADR_(l_int)];
+ char readfds_l_[PADL_(l_fd_set *)]; l_fd_set * readfds; char readfds_r_[PADR_(l_fd_set *)];
+ char writefds_l_[PADL_(l_fd_set *)]; l_fd_set * writefds; char writefds_r_[PADR_(l_fd_set *)];
+ char exceptfds_l_[PADL_(l_fd_set *)]; l_fd_set * exceptfds; char exceptfds_r_[PADR_(l_fd_set *)];
+ char tsp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tsp; char tsp_r_[PADR_(struct l_timespec *)];
+ char sig_l_[PADL_(l_uintptr_t *)]; l_uintptr_t * sig; char sig_r_[PADR_(l_uintptr_t *)];
};
struct linux_ppoll_args {
- register_t dummy;
+ char fds_l_[PADL_(struct pollfd *)]; struct pollfd * fds; char fds_r_[PADR_(struct pollfd *)];
+ char nfds_l_[PADL_(uint32_t)]; uint32_t nfds; char nfds_r_[PADR_(uint32_t)];
+ char tsp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tsp; char tsp_r_[PADR_(struct l_timespec *)];
+ char sset_l_[PADL_(l_sigset_t *)]; l_sigset_t * sset; char sset_r_[PADR_(l_sigset_t *)];
+ char ssize_l_[PADL_(l_size_t)]; l_size_t ssize; char ssize_r_[PADR_(l_size_t)];
};
struct linux_unshare_args {
register_t dummy;
@@ -1028,10 +1063,17 @@ struct linux_getcpu_args {
register_t dummy;
};
struct linux_epoll_pwait_args {
- register_t dummy;
+ char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)];
+ char events_l_[PADL_(struct epoll_event *)]; struct epoll_event * events; char events_r_[PADR_(struct epoll_event *)];
+ char maxevents_l_[PADL_(l_int)]; l_int maxevents; char maxevents_r_[PADR_(l_int)];
+ char timeout_l_[PADL_(l_int)]; l_int timeout; char timeout_r_[PADR_(l_int)];
+ char mask_l_[PADL_(l_sigset_t *)]; l_sigset_t * mask; char mask_r_[PADR_(l_sigset_t *)];
};
struct linux_utimensat_args {
- register_t dummy;
+ char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)];
+ char pathname_l_[PADL_(const char *)]; const char * pathname; char pathname_r_[PADR_(const char *)];
+ char times_l_[PADL_(const struct l_timespec *)]; const struct l_timespec * times; char times_r_[PADR_(const struct l_timespec *)];
+ char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
};
struct linux_signalfd_args {
register_t dummy;
@@ -1040,10 +1082,13 @@ struct linux_timerfd_create_args {
register_t dummy;
};
struct linux_eventfd_args {
- register_t dummy;
+ char initval_l_[PADL_(l_uint)]; l_uint initval; char initval_r_[PADR_(l_uint)];
};
struct linux_fallocate_args {
- register_t dummy;
+ char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
+ char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)];
+ char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)];
+ char len_l_[PADL_(l_loff_t)]; l_loff_t len; char len_r_[PADR_(l_loff_t)];
};
struct linux_timerfd_settime_args {
register_t dummy;
@@ -1055,13 +1100,16 @@ struct linux_signalfd4_args {
register_t dummy;
};
struct linux_eventfd2_args {
- register_t dummy;
+ char initval_l_[PADL_(l_uint)]; l_uint initval; char initval_r_[PADR_(l_uint)];
+ char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
};
struct linux_epoll_create1_args {
- register_t dummy;
+ char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
};
struct linux_dup3_args {
- register_t dummy;
+ char oldfd_l_[PADL_(l_int)]; l_int oldfd; char oldfd_r_[PADR_(l_int)];
+ char newfd_l_[PADL_(l_int)]; l_int newfd; char newfd_r_[PADR_(l_int)];
+ char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
};
struct linux_pipe2_args {
char pipefds_l_[PADL_(l_int *)]; l_int * pipefds; char pipefds_r_[PADR_(l_int *)];
@@ -1083,7 +1131,11 @@ struct linux_perf_event_open_args {
register_t dummy;
};
struct linux_recvmmsg_args {
- register_t dummy;
+ char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
+ char msg_l_[PADL_(struct l_mmsghdr *)]; struct l_mmsghdr * msg; char msg_r_[PADR_(struct l_mmsghdr *)];
+ char vlen_l_[PADL_(l_uint)]; l_uint vlen; char vlen_r_[PADR_(l_uint)];
+ char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)];
+ char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)];
};
struct linux_fanotify_init_args {
register_t dummy;
@@ -1092,7 +1144,10 @@ struct linux_fanotify_mark_args {
register_t dummy;
};
struct linux_prlimit64_args {
- register_t dummy;
+ char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
+ char resource_l_[PADL_(l_uint)]; l_uint resource; char resource_r_[PADR_(l_uint)];
+ char new_l_[PADL_(struct rlimit *)]; struct rlimit * new; char new_r_[PADR_(struct rlimit *)];
+ char old_l_[PADL_(struct rlimit *)]; struct rlimit * old; char old_r_[PADR_(struct rlimit *)];
};
struct linux_name_to_handle_at_args {
register_t dummy;
@@ -1104,10 +1159,13 @@ struct linux_clock_adjtime_args {
register_t dummy;
};
struct linux_syncfs_args {
- register_t dummy;
+ char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
};
struct linux_sendmmsg_args {
- register_t dummy;
+ char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
+ char msg_l_[PADL_(struct l_mmsghdr *)]; struct l_mmsghdr * msg; char msg_r_[PADR_(struct l_mmsghdr *)];
+ char vlen_l_[PADL_(l_uint)]; l_uint vlen; char vlen_r_[PADR_(l_uint)];
+ char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)];
};
struct linux_setns_args {
register_t dummy;
@@ -1119,6 +1177,7 @@ struct linux_process_vm_writev_args {
register_t dummy;
};
#define nosys linux_nosys
+int linux_exit(struct thread *, struct linux_exit_args *);
int linux_fork(struct thread *, struct linux_fork_args *);
int linux_open(struct thread *, struct linux_open_args *);
int linux_waitpid(struct thread *, struct linux_waitpid_args *);
@@ -1230,10 +1289,13 @@ int linux_msync(struct thread *, struct linux_msync_args *);
int linux_getsid(struct thread *, struct linux_getsid_args *);
int linux_fdatasync(struct thread *, struct linux_fdatasync_args *);
int linux_sysctl(struct thread *, struct linux_sysctl_args *);
+int linux_sched_setparam(struct thread *, struct linux_sched_setparam_args *);
+int linux_sched_getparam(struct thread *, struct linux_sched_getparam_args *);
int linux_sched_setscheduler(struct thread *, struct linux_sched_setscheduler_args *);
int linux_sched_getscheduler(struct thread *, struct linux_sched_getscheduler_args *);
int linux_sched_get_priority_max(struct thread *, struct linux_sched_get_priority_max_args *);
int linux_sched_get_priority_min(struct thread *, struct linux_sched_get_priority_min_args *);
+int linux_sched_rr_get_interval(struct thread *, struct linux_sched_rr_get_interval_args *);
int linux_nanosleep(struct thread *, struct linux_nanosleep_args *);
int linux_mremap(struct thread *, struct linux_mremap_args *);
int linux_setresuid16(struct thread *, struct linux_setresuid16_args *);
@@ -1422,6 +1484,7 @@ int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args
#endif /* COMPAT_FREEBSD7 */
+#define LINUX_SYS_AUE_linux_exit AUE_EXIT
#define LINUX_SYS_AUE_linux_fork AUE_FORK
#define LINUX_SYS_AUE_linux_open AUE_OPEN_RWTC
#define LINUX_SYS_AUE_linux_waitpid AUE_WAIT4
@@ -1533,10 +1596,13 @@ int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args
#define LINUX_SYS_AUE_linux_getsid AUE_GETSID
#define LINUX_SYS_AUE_linux_fdatasync AUE_NULL
#define LINUX_SYS_AUE_linux_sysctl AUE_SYSCTL
+#define LINUX_SYS_AUE_linux_sched_setparam AUE_SCHED_SETPARAM
+#define LINUX_SYS_AUE_linux_sched_getparam AUE_SCHED_GETPARAM
#define LINUX_SYS_AUE_linux_sched_setscheduler AUE_SCHED_SETSCHEDULER
#define LINUX_SYS_AUE_linux_sched_getscheduler AUE_SCHED_GETSCHEDULER
#define LINUX_SYS_AUE_linux_sched_get_priority_max AUE_SCHED_GET_PRIORITY_MAX
#define LINUX_SYS_AUE_linux_sched_get_priority_min AUE_SCHED_GET_PRIORITY_MIN
+#define LINUX_SYS_AUE_linux_sched_rr_get_interval AUE_SCHED_RR_GET_INTERVAL
#define LINUX_SYS_AUE_linux_nanosleep AUE_NULL
#define LINUX_SYS_AUE_linux_mremap AUE_NULL
#define LINUX_SYS_AUE_linux_setresuid16 AUE_SETRESUID
@@ -1633,7 +1699,7 @@ int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args
#define LINUX_SYS_AUE_linux_mq_notify AUE_NULL
#define LINUX_SYS_AUE_linux_mq_getsetattr AUE_NULL
#define LINUX_SYS_AUE_linux_kexec_load AUE_NULL
-#define LINUX_SYS_AUE_linux_waitid AUE_NULL
+#define LINUX_SYS_AUE_linux_waitid AUE_WAIT6
#define LINUX_SYS_AUE_linux_add_key AUE_NULL
#define LINUX_SYS_AUE_linux_request_key AUE_NULL
#define LINUX_SYS_AUE_linux_keyctl AUE_NULL
@@ -1656,8 +1722,8 @@ int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args
#define LINUX_SYS_AUE_linux_readlinkat AUE_READLINKAT
#define LINUX_SYS_AUE_linux_fchmodat AUE_FCHMODAT
#define LINUX_SYS_AUE_linux_faccessat AUE_FACCESSAT
-#define LINUX_SYS_AUE_linux_pselect6 AUE_NULL
-#define LINUX_SYS_AUE_linux_ppoll AUE_NULL
+#define LINUX_SYS_AUE_linux_pselect6 AUE_SELECT
+#define LINUX_SYS_AUE_linux_ppoll AUE_POLL
#define LINUX_SYS_AUE_linux_unshare AUE_NULL
#define LINUX_SYS_AUE_linux_set_robust_list AUE_NULL
#define LINUX_SYS_AUE_linux_get_robust_list AUE_NULL
@@ -1668,7 +1734,7 @@ int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args
#define LINUX_SYS_AUE_linux_move_pages AUE_NULL
#define LINUX_SYS_AUE_linux_getcpu AUE_NULL
#define LINUX_SYS_AUE_linux_epoll_pwait AUE_NULL
-#define LINUX_SYS_AUE_linux_utimensat AUE_NULL
+#define LINUX_SYS_AUE_linux_utimensat AUE_FUTIMESAT
#define LINUX_SYS_AUE_linux_signalfd AUE_NULL
#define LINUX_SYS_AUE_linux_timerfd_create AUE_NULL
#define LINUX_SYS_AUE_linux_eventfd AUE_NULL
@@ -1692,7 +1758,7 @@ int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args
#define LINUX_SYS_AUE_linux_name_to_handle_at AUE_NULL
#define LINUX_SYS_AUE_linux_open_by_handle_at AUE_NULL
#define LINUX_SYS_AUE_linux_clock_adjtime AUE_NULL
-#define LINUX_SYS_AUE_linux_syncfs AUE_NULL
+#define LINUX_SYS_AUE_linux_syncfs AUE_SYNC
#define LINUX_SYS_AUE_linux_sendmmsg AUE_NULL
#define LINUX_SYS_AUE_linux_setns AUE_NULL
#define LINUX_SYS_AUE_linux_process_vm_readv AUE_NULL
diff --git a/sys/i386/linux/linux_ptrace.c b/sys/i386/linux/linux_ptrace.c
index 46a1169..2925e6b 100644
--- a/sys/i386/linux/linux_ptrace.c
+++ b/sys/i386/linux/linux_ptrace.c
@@ -91,8 +91,7 @@ static __inline int
map_signum(int signum)
{
- if (signum > 0 && signum <= LINUX_SIGTBLSZ)
- signum = linux_to_bsd_signal[_SIG_IDX(signum)];
+ signum = linux_to_bsd_signal(signum);
return ((signum == SIGSTOP)? 0 : signum);
}
diff --git a/sys/i386/linux/linux_syscall.h b/sys/i386/linux/linux_syscall.h
index 178e97c..60c284a 100644
--- a/sys/i386/linux/linux_syscall.h
+++ b/sys/i386/linux/linux_syscall.h
@@ -3,10 +3,10 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: head/sys/i386/linux/syscalls.master 276509 2015-01-01 18:41:34Z dchagin
+ * created from FreeBSD: head/sys/i386/linux/syscalls.master 283492 2015-05-24 18:08:01Z dchagin
*/
-#define LINUX_SYS_exit 1
+#define LINUX_SYS_linux_exit 1
#define LINUX_SYS_linux_fork 2
#define LINUX_SYS_read 3
#define LINUX_SYS_write 4
@@ -148,14 +148,14 @@
#define LINUX_SYS_munlock 151
#define LINUX_SYS_mlockall 152
#define LINUX_SYS_munlockall 153
-#define LINUX_SYS_sched_setparam 154
-#define LINUX_SYS_sched_getparam 155
+#define LINUX_SYS_linux_sched_setparam 154
+#define LINUX_SYS_linux_sched_getparam 155
#define LINUX_SYS_linux_sched_setscheduler 156
#define LINUX_SYS_linux_sched_getscheduler 157
#define LINUX_SYS_sched_yield 158
#define LINUX_SYS_linux_sched_get_priority_max 159
#define LINUX_SYS_linux_sched_get_priority_min 160
-#define LINUX_SYS_sched_rr_get_interval 161
+#define LINUX_SYS_linux_sched_rr_get_interval 161
#define LINUX_SYS_linux_nanosleep 162
#define LINUX_SYS_linux_mremap 163
#define LINUX_SYS_linux_setresuid16 164
@@ -328,4 +328,4 @@
#define LINUX_SYS_linux_setns 346
#define LINUX_SYS_linux_process_vm_readv 347
#define LINUX_SYS_linux_process_vm_writev 348
-#define LINUX_SYS_MAXSYSCALL 349
+#define LINUX_SYS_MAXSYSCALL 350
diff --git a/sys/i386/linux/linux_syscalls.c b/sys/i386/linux/linux_syscalls.c
index ea05c03..64556a9 100644
--- a/sys/i386/linux/linux_syscalls.c
+++ b/sys/i386/linux/linux_syscalls.c
@@ -3,13 +3,13 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: head/sys/i386/linux/syscalls.master 276509 2015-01-01 18:41:34Z dchagin
+ * created from FreeBSD: head/sys/i386/linux/syscalls.master 283492 2015-05-24 18:08:01Z dchagin
*/
const char *linux_syscallnames[] = {
#define nosys linux_nosys
"#0", /* 0 = setup */
- "exit", /* 1 = exit */
+ "linux_exit", /* 1 = linux_exit */
"linux_fork", /* 2 = linux_fork */
"read", /* 3 = read */
"write", /* 4 = write */
@@ -162,14 +162,14 @@ const char *linux_syscallnames[] = {
"munlock", /* 151 = munlock */
"mlockall", /* 152 = mlockall */
"munlockall", /* 153 = munlockall */
- "sched_setparam", /* 154 = sched_setparam */
- "sched_getparam", /* 155 = sched_getparam */
+ "linux_sched_setparam", /* 154 = linux_sched_setparam */
+ "linux_sched_getparam", /* 155 = linux_sched_getparam */
"linux_sched_setscheduler", /* 156 = linux_sched_setscheduler */
"linux_sched_getscheduler", /* 157 = linux_sched_getscheduler */
"sched_yield", /* 158 = sched_yield */
"linux_sched_get_priority_max", /* 159 = linux_sched_get_priority_max */
"linux_sched_get_priority_min", /* 160 = linux_sched_get_priority_min */
- "sched_rr_get_interval", /* 161 = sched_rr_get_interval */
+ "linux_sched_rr_get_interval", /* 161 = linux_sched_rr_get_interval */
"linux_nanosleep", /* 162 = linux_nanosleep */
"linux_mremap", /* 163 = linux_mremap */
"linux_setresuid16", /* 164 = linux_setresuid16 */
@@ -357,4 +357,5 @@ const char *linux_syscallnames[] = {
"linux_setns", /* 346 = linux_setns */
"linux_process_vm_readv", /* 347 = linux_process_vm_readv */
"linux_process_vm_writev", /* 348 = linux_process_vm_writev */
+ "#349", /* 349 = nosys */
};
diff --git a/sys/i386/linux/linux_sysent.c b/sys/i386/linux/linux_sysent.c
index 5e42a0d..922ddbb 100644
--- a/sys/i386/linux/linux_sysent.c
+++ b/sys/i386/linux/linux_sysent.c
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: head/sys/i386/linux/syscalls.master 276509 2015-01-01 18:41:34Z dchagin
+ * created from FreeBSD: head/sys/i386/linux/syscalls.master 283492 2015-05-24 18:08:01Z dchagin
*/
#include <sys/param.h>
@@ -19,7 +19,7 @@
struct sysent linux_sysent[] = {
#define nosys linux_nosys
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 0 = setup */
- { AS(sys_exit_args), (sy_call_t *)sys_sys_exit, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 1 = exit */
+ { AS(linux_exit_args), (sy_call_t *)linux_exit, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 1 = linux_exit */
{ 0, (sy_call_t *)linux_fork, AUE_FORK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 2 = linux_fork */
{ AS(read_args), (sy_call_t *)sys_read, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 3 = read */
{ AS(write_args), (sy_call_t *)sys_write, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 4 = write */
@@ -172,14 +172,14 @@ struct sysent linux_sysent[] = {
{ AS(munlock_args), (sy_call_t *)sys_munlock, AUE_MUNLOCK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 151 = munlock */
{ AS(mlockall_args), (sy_call_t *)sys_mlockall, AUE_MLOCKALL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 152 = mlockall */
{ 0, (sy_call_t *)sys_munlockall, AUE_MUNLOCKALL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 153 = munlockall */
- { AS(sched_setparam_args), (sy_call_t *)sys_sched_setparam, AUE_SCHED_SETPARAM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 154 = sched_setparam */
- { AS(sched_getparam_args), (sy_call_t *)sys_sched_getparam, AUE_SCHED_GETPARAM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 155 = sched_getparam */
+ { AS(linux_sched_setparam_args), (sy_call_t *)linux_sched_setparam, AUE_SCHED_SETPARAM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 154 = linux_sched_setparam */
+ { AS(linux_sched_getparam_args), (sy_call_t *)linux_sched_getparam, AUE_SCHED_GETPARAM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 155 = linux_sched_getparam */
{ AS(linux_sched_setscheduler_args), (sy_call_t *)linux_sched_setscheduler, AUE_SCHED_SETSCHEDULER, NULL, 0, 0, 0, SY_THR_STATIC }, /* 156 = linux_sched_setscheduler */
{ AS(linux_sched_getscheduler_args), (sy_call_t *)linux_sched_getscheduler, AUE_SCHED_GETSCHEDULER, NULL, 0, 0, 0, SY_THR_STATIC }, /* 157 = linux_sched_getscheduler */
{ 0, (sy_call_t *)sys_sched_yield, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 158 = sched_yield */
{ AS(linux_sched_get_priority_max_args), (sy_call_t *)linux_sched_get_priority_max, AUE_SCHED_GET_PRIORITY_MAX, NULL, 0, 0, 0, SY_THR_STATIC }, /* 159 = linux_sched_get_priority_max */
{ AS(linux_sched_get_priority_min_args), (sy_call_t *)linux_sched_get_priority_min, AUE_SCHED_GET_PRIORITY_MIN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 160 = linux_sched_get_priority_min */
- { AS(sched_rr_get_interval_args), (sy_call_t *)sys_sched_rr_get_interval, AUE_SCHED_RR_GET_INTERVAL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 161 = sched_rr_get_interval */
+ { AS(linux_sched_rr_get_interval_args), (sy_call_t *)linux_sched_rr_get_interval, AUE_SCHED_RR_GET_INTERVAL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 161 = linux_sched_rr_get_interval */
{ AS(linux_nanosleep_args), (sy_call_t *)linux_nanosleep, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 162 = linux_nanosleep */
{ AS(linux_mremap_args), (sy_call_t *)linux_mremap, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 163 = linux_mremap */
{ AS(linux_setresuid16_args), (sy_call_t *)linux_setresuid16, AUE_SETRESUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 164 = linux_setresuid16 */
@@ -196,7 +196,7 @@ struct sysent linux_sysent[] = {
{ AS(linux_rt_sigprocmask_args), (sy_call_t *)linux_rt_sigprocmask, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 175 = linux_rt_sigprocmask */
{ AS(linux_rt_sigpending_args), (sy_call_t *)linux_rt_sigpending, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 176 = linux_rt_sigpending */
{ AS(linux_rt_sigtimedwait_args), (sy_call_t *)linux_rt_sigtimedwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 177 = linux_rt_sigtimedwait */
- { 0, (sy_call_t *)linux_rt_sigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 178 = linux_rt_sigqueueinfo */
+ { AS(linux_rt_sigqueueinfo_args), (sy_call_t *)linux_rt_sigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 178 = linux_rt_sigqueueinfo */
{ AS(linux_rt_sigsuspend_args), (sy_call_t *)linux_rt_sigsuspend, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 179 = linux_rt_sigsuspend */
{ AS(linux_pread_args), (sy_call_t *)linux_pread, AUE_PREAD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 180 = linux_pread */
{ AS(linux_pwrite_args), (sy_call_t *)linux_pwrite, AUE_PWRITE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 181 = linux_pwrite */
@@ -272,9 +272,9 @@ struct sysent linux_sysent[] = {
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 251 = */
{ AS(linux_exit_group_args), (sy_call_t *)linux_exit_group, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 252 = linux_exit_group */
{ 0, (sy_call_t *)linux_lookup_dcookie, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 253 = linux_lookup_dcookie */
- { 0, (sy_call_t *)linux_epoll_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 254 = linux_epoll_create */
- { 0, (sy_call_t *)linux_epoll_ctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 255 = linux_epoll_ctl */
- { 0, (sy_call_t *)linux_epoll_wait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 256 = linux_epoll_wait */
+ { AS(linux_epoll_create_args), (sy_call_t *)linux_epoll_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 254 = linux_epoll_create */
+ { AS(linux_epoll_ctl_args), (sy_call_t *)linux_epoll_ctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 255 = linux_epoll_ctl */
+ { AS(linux_epoll_wait_args), (sy_call_t *)linux_epoll_wait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 256 = linux_epoll_wait */
{ 0, (sy_call_t *)linux_remap_file_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 257 = linux_remap_file_pages */
{ AS(linux_set_tid_address_args), (sy_call_t *)linux_set_tid_address, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 258 = linux_set_tid_address */
{ AS(linux_timer_create_args), (sy_call_t *)linux_timer_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 259 = linux_timer_create */
@@ -302,7 +302,7 @@ struct sysent linux_sysent[] = {
{ AS(linux_mq_notify_args), (sy_call_t *)linux_mq_notify, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 281 = linux_mq_notify */
{ AS(linux_mq_getsetattr_args), (sy_call_t *)linux_mq_getsetattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 282 = linux_mq_getsetattr */
{ 0, (sy_call_t *)linux_kexec_load, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 283 = linux_kexec_load */
- { 0, (sy_call_t *)linux_waitid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 284 = linux_waitid */
+ { AS(linux_waitid_args), (sy_call_t *)linux_waitid, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 284 = linux_waitid */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 285 = */
{ 0, (sy_call_t *)linux_add_key, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 286 = linux_add_key */
{ 0, (sy_call_t *)linux_request_key, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 287 = linux_request_key */
@@ -326,8 +326,8 @@ struct sysent linux_sysent[] = {
{ AS(linux_readlinkat_args), (sy_call_t *)linux_readlinkat, AUE_READLINKAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 305 = linux_readlinkat */
{ AS(linux_fchmodat_args), (sy_call_t *)linux_fchmodat, AUE_FCHMODAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 306 = linux_fchmodat */
{ AS(linux_faccessat_args), (sy_call_t *)linux_faccessat, AUE_FACCESSAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 307 = linux_faccessat */
- { 0, (sy_call_t *)linux_pselect6, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 308 = linux_pselect6 */
- { 0, (sy_call_t *)linux_ppoll, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 309 = linux_ppoll */
+ { AS(linux_pselect6_args), (sy_call_t *)linux_pselect6, AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 308 = linux_pselect6 */
+ { AS(linux_ppoll_args), (sy_call_t *)linux_ppoll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 309 = linux_ppoll */
{ 0, (sy_call_t *)linux_unshare, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 310 = linux_unshare */
{ AS(linux_set_robust_list_args), (sy_call_t *)linux_set_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 311 = linux_set_robust_list */
{ AS(linux_get_robust_list_args), (sy_call_t *)linux_get_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 312 = linux_get_robust_list */
@@ -337,34 +337,35 @@ struct sysent linux_sysent[] = {
{ 0, (sy_call_t *)linux_vmsplice, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 316 = linux_vmsplice */
{ 0, (sy_call_t *)linux_move_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 317 = linux_move_pages */
{ 0, (sy_call_t *)linux_getcpu, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 318 = linux_getcpu */
- { 0, (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 319 = linux_epoll_pwait */
- { 0, (sy_call_t *)linux_utimensat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 320 = linux_utimensat */
+ { AS(linux_epoll_pwait_args), (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 319 = linux_epoll_pwait */
+ { AS(linux_utimensat_args), (sy_call_t *)linux_utimensat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 320 = linux_utimensat */
{ 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 321 = linux_signalfd */
{ 0, (sy_call_t *)linux_timerfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 322 = linux_timerfd_create */
- { 0, (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 323 = linux_eventfd */
- { 0, (sy_call_t *)linux_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 324 = linux_fallocate */
+ { AS(linux_eventfd_args), (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 323 = linux_eventfd */
+ { AS(linux_fallocate_args), (sy_call_t *)linux_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 324 = linux_fallocate */
{ 0, (sy_call_t *)linux_timerfd_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 325 = linux_timerfd_settime */
{ 0, (sy_call_t *)linux_timerfd_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 326 = linux_timerfd_gettime */
{ 0, (sy_call_t *)linux_signalfd4, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 327 = linux_signalfd4 */
- { 0, (sy_call_t *)linux_eventfd2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 328 = linux_eventfd2 */
- { 0, (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 329 = linux_epoll_create1 */
- { 0, (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 330 = linux_dup3 */
+ { AS(linux_eventfd2_args), (sy_call_t *)linux_eventfd2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 328 = linux_eventfd2 */
+ { AS(linux_epoll_create1_args), (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 329 = linux_epoll_create1 */
+ { AS(linux_dup3_args), (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 330 = linux_dup3 */
{ AS(linux_pipe2_args), (sy_call_t *)linux_pipe2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 331 = linux_pipe2 */
{ 0, (sy_call_t *)linux_inotify_init1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 332 = linux_inotify_init1 */
{ 0, (sy_call_t *)linux_preadv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 333 = linux_preadv */
{ 0, (sy_call_t *)linux_pwritev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 334 = linux_pwritev */
{ 0, (sy_call_t *)linux_rt_tsigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 335 = linux_rt_tsigqueueinfo */
{ 0, (sy_call_t *)linux_perf_event_open, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 336 = linux_perf_event_open */
- { 0, (sy_call_t *)linux_recvmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = linux_recvmmsg */
+ { AS(linux_recvmmsg_args), (sy_call_t *)linux_recvmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = linux_recvmmsg */
{ 0, (sy_call_t *)linux_fanotify_init, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = linux_fanotify_init */
{ 0, (sy_call_t *)linux_fanotify_mark, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 339 = linux_fanotify_mark */
- { 0, (sy_call_t *)linux_prlimit64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 340 = linux_prlimit64 */
+ { AS(linux_prlimit64_args), (sy_call_t *)linux_prlimit64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 340 = linux_prlimit64 */
{ 0, (sy_call_t *)linux_name_to_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 341 = linux_name_to_handle_at */
{ 0, (sy_call_t *)linux_open_by_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 342 = linux_open_by_handle_at */
{ 0, (sy_call_t *)linux_clock_adjtime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 343 = linux_clock_adjtime */
- { 0, (sy_call_t *)linux_syncfs, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 344 = linux_syncfs */
- { 0, (sy_call_t *)linux_sendmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 345 = linux_sendmmsg */
+ { AS(linux_syncfs_args), (sy_call_t *)linux_syncfs, AUE_SYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 344 = linux_syncfs */
+ { AS(linux_sendmmsg_args), (sy_call_t *)linux_sendmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 345 = linux_sendmmsg */
{ 0, (sy_call_t *)linux_setns, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 346 = linux_setns */
{ 0, (sy_call_t *)linux_process_vm_readv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 347 = linux_process_vm_readv */
{ 0, (sy_call_t *)linux_process_vm_writev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 348 = linux_process_vm_writev */
+ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 349 = nosys */
};
diff --git a/sys/i386/linux/linux_systrace_args.c b/sys/i386/linux/linux_systrace_args.c
index 3564fda..85fc9ca 100644
--- a/sys/i386/linux/linux_systrace_args.c
+++ b/sys/i386/linux/linux_systrace_args.c
@@ -12,9 +12,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
int64_t *iarg = (int64_t *) uarg;
switch (sysnum) {
#define nosys linux_nosys
- /* sys_exit */
+ /* linux_exit */
case 1: {
- struct sys_exit_args *p = params;
+ struct linux_exit_args *p = params;
iarg[0] = p->rval; /* int */
*n_args = 1;
break;
@@ -792,7 +792,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
iarg[0] = p->pid; /* l_pid_t */
uarg[1] = (intptr_t) p->status; /* l_int * */
iarg[2] = p->options; /* l_int */
- uarg[3] = (intptr_t) p->rusage; /* struct l_rusage * */
+ uarg[3] = (intptr_t) p->rusage; /* void * */
*n_args = 4;
break;
}
@@ -1081,19 +1081,19 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
*n_args = 0;
break;
}
- /* sched_setparam */
+ /* linux_sched_setparam */
case 154: {
- struct sched_setparam_args *p = params;
- iarg[0] = p->pid; /* pid_t */
- uarg[1] = (intptr_t) p->param; /* const struct sched_param * */
+ struct linux_sched_setparam_args *p = params;
+ iarg[0] = p->pid; /* l_pid_t */
+ uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */
*n_args = 2;
break;
}
- /* sched_getparam */
+ /* linux_sched_getparam */
case 155: {
- struct sched_getparam_args *p = params;
- iarg[0] = p->pid; /* pid_t */
- uarg[1] = (intptr_t) p->param; /* struct sched_param * */
+ struct linux_sched_getparam_args *p = params;
+ iarg[0] = p->pid; /* l_pid_t */
+ uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */
*n_args = 2;
break;
}
@@ -1132,9 +1132,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
*n_args = 1;
break;
}
- /* sched_rr_get_interval */
+ /* linux_sched_rr_get_interval */
case 161: {
- struct sched_rr_get_interval_args *p = params;
+ struct linux_sched_rr_get_interval_args *p = params;
iarg[0] = p->pid; /* l_pid_t */
uarg[1] = (intptr_t) p->interval; /* struct l_timespec * */
*n_args = 2;
@@ -1277,7 +1277,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* linux_rt_sigqueueinfo */
case 178: {
- *n_args = 0;
+ struct linux_rt_sigqueueinfo_args *p = params;
+ iarg[0] = p->pid; /* l_pid_t */
+ iarg[1] = p->sig; /* l_int */
+ uarg[2] = (intptr_t) p->info; /* l_siginfo_t * */
+ *n_args = 3;
break;
}
/* linux_rt_sigsuspend */
@@ -1743,17 +1747,29 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* linux_epoll_create */
case 254: {
- *n_args = 0;
+ struct linux_epoll_create_args *p = params;
+ iarg[0] = p->size; /* l_int */
+ *n_args = 1;
break;
}
/* linux_epoll_ctl */
case 255: {
- *n_args = 0;
+ struct linux_epoll_ctl_args *p = params;
+ iarg[0] = p->epfd; /* l_int */
+ iarg[1] = p->op; /* l_int */
+ iarg[2] = p->fd; /* l_int */
+ uarg[3] = (intptr_t) p->event; /* struct epoll_event * */
+ *n_args = 4;
break;
}
/* linux_epoll_wait */
case 256: {
- *n_args = 0;
+ struct linux_epoll_wait_args *p = params;
+ iarg[0] = p->epfd; /* l_int */
+ uarg[1] = (intptr_t) p->events; /* struct epoll_event * */
+ iarg[2] = p->maxevents; /* l_int */
+ iarg[3] = p->timeout; /* l_int */
+ *n_args = 4;
break;
}
/* linux_remap_file_pages */
@@ -1962,7 +1978,13 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* linux_waitid */
case 284: {
- *n_args = 0;
+ struct linux_waitid_args *p = params;
+ iarg[0] = p->idtype; /* int */
+ iarg[1] = p->id; /* l_pid_t */
+ uarg[2] = (intptr_t) p->info; /* l_siginfo_t * */
+ iarg[3] = p->options; /* int */
+ uarg[4] = (intptr_t) p->rusage; /* void * */
+ *n_args = 5;
break;
}
/* linux_add_key */
@@ -2133,18 +2155,30 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
iarg[0] = p->dfd; /* l_int */
uarg[1] = (intptr_t) p->filename; /* const char * */
iarg[2] = p->amode; /* l_int */
- iarg[3] = p->flag; /* l_int */
- *n_args = 4;
+ *n_args = 3;
break;
}
/* linux_pselect6 */
case 308: {
- *n_args = 0;
+ struct linux_pselect6_args *p = params;
+ iarg[0] = p->nfds; /* l_int */
+ uarg[1] = (intptr_t) p->readfds; /* l_fd_set * */
+ uarg[2] = (intptr_t) p->writefds; /* l_fd_set * */
+ uarg[3] = (intptr_t) p->exceptfds; /* l_fd_set * */
+ uarg[4] = (intptr_t) p->tsp; /* struct l_timespec * */
+ uarg[5] = (intptr_t) p->sig; /* l_uintptr_t * */
+ *n_args = 6;
break;
}
/* linux_ppoll */
case 309: {
- *n_args = 0;
+ struct linux_ppoll_args *p = params;
+ uarg[0] = (intptr_t) p->fds; /* struct pollfd * */
+ uarg[1] = p->nfds; /* uint32_t */
+ uarg[2] = (intptr_t) p->tsp; /* struct l_timespec * */
+ uarg[3] = (intptr_t) p->sset; /* l_sigset_t * */
+ iarg[4] = p->ssize; /* l_size_t */
+ *n_args = 5;
break;
}
/* linux_unshare */
@@ -2201,12 +2235,23 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* linux_epoll_pwait */
case 319: {
- *n_args = 0;
+ struct linux_epoll_pwait_args *p = params;
+ iarg[0] = p->epfd; /* l_int */
+ uarg[1] = (intptr_t) p->events; /* struct epoll_event * */
+ iarg[2] = p->maxevents; /* l_int */
+ iarg[3] = p->timeout; /* l_int */
+ uarg[4] = (intptr_t) p->mask; /* l_sigset_t * */
+ *n_args = 5;
break;
}
/* linux_utimensat */
case 320: {
- *n_args = 0;
+ struct linux_utimensat_args *p = params;
+ iarg[0] = p->dfd; /* l_int */
+ uarg[1] = (intptr_t) p->pathname; /* const char * */
+ uarg[2] = (intptr_t) p->times; /* const struct l_timespec * */
+ iarg[3] = p->flags; /* l_int */
+ *n_args = 4;
break;
}
/* linux_signalfd */
@@ -2221,12 +2266,19 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* linux_eventfd */
case 323: {
- *n_args = 0;
+ struct linux_eventfd_args *p = params;
+ iarg[0] = p->initval; /* l_uint */
+ *n_args = 1;
break;
}
/* linux_fallocate */
case 324: {
- *n_args = 0;
+ struct linux_fallocate_args *p = params;
+ iarg[0] = p->fd; /* l_int */
+ iarg[1] = p->mode; /* l_int */
+ iarg[2] = p->offset; /* l_loff_t */
+ iarg[3] = p->len; /* l_loff_t */
+ *n_args = 4;
break;
}
/* linux_timerfd_settime */
@@ -2246,17 +2298,26 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* linux_eventfd2 */
case 328: {
- *n_args = 0;
+ struct linux_eventfd2_args *p = params;
+ iarg[0] = p->initval; /* l_uint */
+ iarg[1] = p->flags; /* l_int */
+ *n_args = 2;
break;
}
/* linux_epoll_create1 */
case 329: {
- *n_args = 0;
+ struct linux_epoll_create1_args *p = params;
+ iarg[0] = p->flags; /* l_int */
+ *n_args = 1;
break;
}
/* linux_dup3 */
case 330: {
- *n_args = 0;
+ struct linux_dup3_args *p = params;
+ iarg[0] = p->oldfd; /* l_int */
+ iarg[1] = p->newfd; /* l_int */
+ iarg[2] = p->flags; /* l_int */
+ *n_args = 3;
break;
}
/* linux_pipe2 */
@@ -2294,7 +2355,13 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* linux_recvmmsg */
case 337: {
- *n_args = 0;
+ struct linux_recvmmsg_args *p = params;
+ iarg[0] = p->s; /* l_int */
+ uarg[1] = (intptr_t) p->msg; /* struct l_mmsghdr * */
+ iarg[2] = p->vlen; /* l_uint */
+ iarg[3] = p->flags; /* l_uint */
+ uarg[4] = (intptr_t) p->timeout; /* struct l_timespec * */
+ *n_args = 5;
break;
}
/* linux_fanotify_init */
@@ -2309,7 +2376,12 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* linux_prlimit64 */
case 340: {
- *n_args = 0;
+ struct linux_prlimit64_args *p = params;
+ iarg[0] = p->pid; /* l_pid_t */
+ iarg[1] = p->resource; /* l_uint */
+ uarg[2] = (intptr_t) p->new; /* struct rlimit * */
+ uarg[3] = (intptr_t) p->old; /* struct rlimit * */
+ *n_args = 4;
break;
}
/* linux_name_to_handle_at */
@@ -2329,12 +2401,19 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* linux_syncfs */
case 344: {
- *n_args = 0;
+ struct linux_syncfs_args *p = params;
+ iarg[0] = p->fd; /* l_int */
+ *n_args = 1;
break;
}
/* linux_sendmmsg */
case 345: {
- *n_args = 0;
+ struct linux_sendmmsg_args *p = params;
+ iarg[0] = p->s; /* l_int */
+ uarg[1] = (intptr_t) p->msg; /* struct l_mmsghdr * */
+ iarg[2] = p->vlen; /* l_uint */
+ iarg[3] = p->flags; /* l_uint */
+ *n_args = 4;
break;
}
/* linux_setns */
@@ -2363,7 +2442,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
const char *p = NULL;
switch (sysnum) {
#define nosys linux_nosys
- /* sys_exit */
+ /* linux_exit */
case 1:
switch(ndx) {
case 0:
@@ -3548,7 +3627,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
p = "l_int";
break;
case 3:
- p = "struct l_rusage *";
+ p = "void *";
break;
default:
break;
@@ -3982,27 +4061,27 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
/* munlockall */
case 153:
break;
- /* sched_setparam */
+ /* linux_sched_setparam */
case 154:
switch(ndx) {
case 0:
- p = "pid_t";
+ p = "l_pid_t";
break;
case 1:
- p = "const struct sched_param *";
+ p = "struct l_sched_param *";
break;
default:
break;
};
break;
- /* sched_getparam */
+ /* linux_sched_getparam */
case 155:
switch(ndx) {
case 0:
- p = "pid_t";
+ p = "l_pid_t";
break;
case 1:
- p = "struct sched_param *";
+ p = "struct l_sched_param *";
break;
default:
break;
@@ -4057,7 +4136,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
};
break;
- /* sched_rr_get_interval */
+ /* linux_sched_rr_get_interval */
case 161:
switch(ndx) {
case 0:
@@ -4298,6 +4377,19 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_rt_sigqueueinfo */
case 178:
+ switch(ndx) {
+ case 0:
+ p = "l_pid_t";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "l_siginfo_t *";
+ break;
+ default:
+ break;
+ };
break;
/* linux_rt_sigsuspend */
case 179:
@@ -4970,12 +5062,51 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_epoll_create */
case 254:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
break;
/* linux_epoll_ctl */
case 255:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ case 3:
+ p = "struct epoll_event *";
+ break;
+ default:
+ break;
+ };
break;
/* linux_epoll_wait */
case 256:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "struct epoll_event *";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ case 3:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
break;
/* linux_remap_file_pages */
case 257:
@@ -5299,6 +5430,25 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_waitid */
case 284:
+ switch(ndx) {
+ case 0:
+ p = "int";
+ break;
+ case 1:
+ p = "l_pid_t";
+ break;
+ case 2:
+ p = "l_siginfo_t *";
+ break;
+ case 3:
+ p = "int";
+ break;
+ case 4:
+ p = "void *";
+ break;
+ default:
+ break;
+ };
break;
/* linux_add_key */
case 286:
@@ -5558,18 +5708,56 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
case 2:
p = "l_int";
break;
- case 3:
- p = "l_int";
- break;
default:
break;
};
break;
/* linux_pselect6 */
case 308:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_fd_set *";
+ break;
+ case 2:
+ p = "l_fd_set *";
+ break;
+ case 3:
+ p = "l_fd_set *";
+ break;
+ case 4:
+ p = "struct l_timespec *";
+ break;
+ case 5:
+ p = "l_uintptr_t *";
+ break;
+ default:
+ break;
+ };
break;
/* linux_ppoll */
case 309:
+ switch(ndx) {
+ case 0:
+ p = "struct pollfd *";
+ break;
+ case 1:
+ p = "uint32_t";
+ break;
+ case 2:
+ p = "struct l_timespec *";
+ break;
+ case 3:
+ p = "l_sigset_t *";
+ break;
+ case 4:
+ p = "l_size_t";
+ break;
+ default:
+ break;
+ };
break;
/* linux_unshare */
case 310:
@@ -5623,9 +5811,44 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_epoll_pwait */
case 319:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "struct epoll_event *";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ case 3:
+ p = "l_int";
+ break;
+ case 4:
+ p = "l_sigset_t *";
+ break;
+ default:
+ break;
+ };
break;
/* linux_utimensat */
case 320:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "const char *";
+ break;
+ case 2:
+ p = "const struct l_timespec *";
+ break;
+ case 3:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
break;
/* linux_signalfd */
case 321:
@@ -5635,9 +5858,32 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_eventfd */
case 323:
+ switch(ndx) {
+ case 0:
+ p = "l_uint";
+ break;
+ default:
+ break;
+ };
break;
/* linux_fallocate */
case 324:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "l_loff_t";
+ break;
+ case 3:
+ p = "l_loff_t";
+ break;
+ default:
+ break;
+ };
break;
/* linux_timerfd_settime */
case 325:
@@ -5650,12 +5896,42 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_eventfd2 */
case 328:
+ switch(ndx) {
+ case 0:
+ p = "l_uint";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
break;
/* linux_epoll_create1 */
case 329:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
break;
/* linux_dup3 */
case 330:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "l_int";
+ break;
+ case 2:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
break;
/* linux_pipe2 */
case 331:
@@ -5687,6 +5963,25 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_recvmmsg */
case 337:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "struct l_mmsghdr *";
+ break;
+ case 2:
+ p = "l_uint";
+ break;
+ case 3:
+ p = "l_uint";
+ break;
+ case 4:
+ p = "struct l_timespec *";
+ break;
+ default:
+ break;
+ };
break;
/* linux_fanotify_init */
case 338:
@@ -5696,6 +5991,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_prlimit64 */
case 340:
+ switch(ndx) {
+ case 0:
+ p = "l_pid_t";
+ break;
+ case 1:
+ p = "l_uint";
+ break;
+ case 2:
+ p = "struct rlimit *";
+ break;
+ case 3:
+ p = "struct rlimit *";
+ break;
+ default:
+ break;
+ };
break;
/* linux_name_to_handle_at */
case 341:
@@ -5708,9 +6019,32 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_syncfs */
case 344:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ default:
+ break;
+ };
break;
/* linux_sendmmsg */
case 345:
+ switch(ndx) {
+ case 0:
+ p = "l_int";
+ break;
+ case 1:
+ p = "struct l_mmsghdr *";
+ break;
+ case 2:
+ p = "l_uint";
+ break;
+ case 3:
+ p = "l_uint";
+ break;
+ default:
+ break;
+ };
break;
/* linux_setns */
case 346:
@@ -5733,7 +6067,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
const char *p = NULL;
switch (sysnum) {
#define nosys linux_nosys
- /* sys_exit */
+ /* linux_exit */
case 1:
if (ndx == 0 || ndx == 1)
p = "void";
@@ -6365,12 +6699,12 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* munlockall */
case 153:
- /* sched_setparam */
+ /* linux_sched_setparam */
case 154:
if (ndx == 0 || ndx == 1)
p = "int";
break;
- /* sched_getparam */
+ /* linux_sched_getparam */
case 155:
if (ndx == 0 || ndx == 1)
p = "int";
@@ -6397,7 +6731,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
if (ndx == 0 || ndx == 1)
p = "int";
break;
- /* sched_rr_get_interval */
+ /* linux_sched_rr_get_interval */
case 161:
if (ndx == 0 || ndx == 1)
p = "int";
@@ -6475,6 +6809,9 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_rt_sigqueueinfo */
case 178:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_rt_sigsuspend */
case 179:
if (ndx == 0 || ndx == 1)
@@ -6729,10 +7066,19 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
case 253:
/* linux_epoll_create */
case 254:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_epoll_ctl */
case 255:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_epoll_wait */
case 256:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_remap_file_pages */
case 257:
/* linux_set_tid_address */
@@ -6847,6 +7193,9 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
case 283:
/* linux_waitid */
case 284:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_add_key */
case 286:
/* linux_request_key */
@@ -6932,8 +7281,14 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_pselect6 */
case 308:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_ppoll */
case 309:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_unshare */
case 310:
/* linux_set_robust_list */
@@ -6960,16 +7315,28 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
case 318:
/* linux_epoll_pwait */
case 319:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_utimensat */
case 320:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_signalfd */
case 321:
/* linux_timerfd_create */
case 322:
/* linux_eventfd */
case 323:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_fallocate */
case 324:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_timerfd_settime */
case 325:
/* linux_timerfd_gettime */
@@ -6978,10 +7345,19 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
case 327:
/* linux_eventfd2 */
case 328:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_epoll_create1 */
case 329:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_dup3 */
case 330:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_pipe2 */
case 331:
if (ndx == 0 || ndx == 1)
@@ -6999,12 +7375,18 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
case 336:
/* linux_recvmmsg */
case 337:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_fanotify_init */
case 338:
/* linux_fanotify_mark */
case 339:
/* linux_prlimit64 */
case 340:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_name_to_handle_at */
case 341:
/* linux_open_by_handle_at */
@@ -7013,8 +7395,14 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
case 343:
/* linux_syncfs */
case 344:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_sendmmsg */
case 345:
+ if (ndx == 0 || ndx == 1)
+ p = "int";
+ break;
/* linux_setns */
case 346:
/* linux_process_vm_readv */
diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c
index 67d5056..acf23ac 100644
--- a/sys/i386/linux/linux_sysvec.c
+++ b/sys/i386/linux/linux_sysvec.c
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
#include <sys/proc.h>
#include <sys/signalvar.h>
#include <sys/syscallsubr.h>
+#include <sys/sysctl.h>
#include <sys/sysent.h>
#include <sys/sysproto.h>
#include <sys/vnode.h>
@@ -71,17 +72,23 @@ __FBSDID("$FreeBSD$");
#include <compat/linux/linux_misc.h>
#include <compat/linux/linux_signal.h>
#include <compat/linux/linux_util.h>
+#include <compat/linux/linux_vdso.h>
MODULE_VERSION(linux, 1);
-MALLOC_DEFINE(M_LINUX, "linux", "Linux mode structures");
-
#if BYTE_ORDER == LITTLE_ENDIAN
#define SHELLMAGIC 0x2123 /* #! */
#else
#define SHELLMAGIC 0x2321
#endif
+#if defined(DEBUG)
+SYSCTL_PROC(_compat_linux, OID_AUTO, debug,
+ CTLTYPE_STRING | CTLFLAG_RW,
+ 0, 0, linux_sysctl_debug, "A",
+ "Linux debugging control");
+#endif
+
/*
* Allow the sendsig functions to use the ldebug() facility
* even though they are not syscalls themselves. Map them
@@ -93,13 +100,15 @@ MALLOC_DEFINE(M_LINUX, "linux", "Linux mode structures");
#define LINUX_PS_STRINGS (LINUX_USRSTACK - sizeof(struct ps_strings))
-extern char linux_sigcode[];
-extern int linux_szsigcode;
+static int linux_szsigcode;
+static vm_object_t linux_shared_page_obj;
+static char *linux_shared_page_mapping;
+extern char _binary_linux_locore_o_start;
+extern char _binary_linux_locore_o_end;
extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL];
SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler);
-SET_DECLARE(linux_device_handler_set, struct linux_device_handler);
static int linux_fixup(register_t **stack_base,
struct image_params *iparams);
@@ -110,12 +119,15 @@ static void exec_linux_setregs(struct thread *td,
struct image_params *imgp, u_long stack);
static register_t *linux_copyout_strings(struct image_params *imgp);
static boolean_t linux_trans_osrel(const Elf_Note *note, int32_t *osrel);
+static void linux_vdso_install(void *param);
+static void linux_vdso_deinstall(void *param);
static int linux_szplatform;
-const char *linux_platform;
+const char *linux_kplatform;
static eventhandler_tag linux_exit_tag;
static eventhandler_tag linux_exec_tag;
+static eventhandler_tag linux_thread_dtor_tag;
/*
* Linux syscalls return negative errno's, we do positive and map them
@@ -137,28 +149,6 @@ static int bsd_to_linux_errno[ELAST + 1] = {
-72, -67, -71
};
-int bsd_to_linux_signal[LINUX_SIGTBLSZ] = {
- LINUX_SIGHUP, LINUX_SIGINT, LINUX_SIGQUIT, LINUX_SIGILL,
- LINUX_SIGTRAP, LINUX_SIGABRT, 0, LINUX_SIGFPE,
- LINUX_SIGKILL, LINUX_SIGBUS, LINUX_SIGSEGV, LINUX_SIGSYS,
- LINUX_SIGPIPE, LINUX_SIGALRM, LINUX_SIGTERM, LINUX_SIGURG,
- LINUX_SIGSTOP, LINUX_SIGTSTP, LINUX_SIGCONT, LINUX_SIGCHLD,
- LINUX_SIGTTIN, LINUX_SIGTTOU, LINUX_SIGIO, LINUX_SIGXCPU,
- LINUX_SIGXFSZ, LINUX_SIGVTALRM, LINUX_SIGPROF, LINUX_SIGWINCH,
- 0, LINUX_SIGUSR1, LINUX_SIGUSR2
-};
-
-int linux_to_bsd_signal[LINUX_SIGTBLSZ] = {
- SIGHUP, SIGINT, SIGQUIT, SIGILL,
- SIGTRAP, SIGABRT, SIGBUS, SIGFPE,
- SIGKILL, SIGUSR1, SIGSEGV, SIGUSR2,
- SIGPIPE, SIGALRM, SIGTERM, SIGBUS,
- SIGCHLD, SIGCONT, SIGSTOP, SIGTSTP,
- SIGTTIN, SIGTTOU, SIGURG, SIGXCPU,
- SIGXFSZ, SIGVTALRM, SIGPROF, SIGWINCH,
- SIGIO, SIGURG, SIGSYS
-};
-
#define LINUX_T_UNKNOWN 255
static int _bsd_to_linux_trapcode[] = {
LINUX_T_UNKNOWN, /* 0 */
@@ -198,6 +188,10 @@ static int _bsd_to_linux_trapcode[] = {
_bsd_to_linux_trapcode[(code)]: \
LINUX_T_UNKNOWN)
+LINUX_VDSO_SYM_INTPTR(linux_sigcode);
+LINUX_VDSO_SYM_INTPTR(linux_rt_sigcode);
+LINUX_VDSO_SYM_INTPTR(linux_vsyscall);
+
/*
* If FreeBSD & Linux have a difference of opinion about what a trap
* means, deal with it here.
@@ -208,15 +202,15 @@ static int
translate_traps(int signal, int trap_code)
{
if (signal != SIGBUS)
- return signal;
+ return (signal);
switch (trap_code) {
case T_PROTFLT:
case T_TSSFLT:
case T_DOUBLEFLT:
case T_PAGEFLT:
- return SIGSEGV;
+ return (SIGSEGV);
default:
- return signal;
+ return (signal);
}
}
@@ -254,6 +248,9 @@ elf_linux_fixup(register_t **stack_base, struct image_params *imgp)
args = (Elf32_Auxargs *)imgp->auxargs;
pos = *stack_base + (imgp->args->argc + imgp->args->envc + 2);
+ AUXARGS_ENTRY(pos, LINUX_AT_SYSINFO_EHDR,
+ imgp->proc->p_sysent->sv_shared_page_base);
+ AUXARGS_ENTRY(pos, LINUX_AT_SYSINFO, linux_vsyscall);
AUXARGS_ENTRY(pos, LINUX_AT_HWCAP, cpu_feature);
/*
@@ -279,6 +276,9 @@ elf_linux_fixup(register_t **stack_base, struct image_params *imgp)
AUXARGS_ENTRY(pos, AT_GID, imgp->proc->p_ucred->cr_rgid);
AUXARGS_ENTRY(pos, AT_EGID, imgp->proc->p_ucred->cr_svgid);
AUXARGS_ENTRY(pos, LINUX_AT_PLATFORM, PTROUT(uplatform));
+ AUXARGS_ENTRY(pos, LINUX_AT_RANDOM, imgp->canary);
+ if (imgp->execpathp != 0)
+ AUXARGS_ENTRY(pos, LINUX_AT_EXECFN, imgp->execpathp);
if (args->execfd != -1)
AUXARGS_ENTRY(pos, AT_EXECFD, args->execfd);
AUXARGS_ENTRY(pos, AT_NULL, 0);
@@ -302,23 +302,45 @@ linux_copyout_strings(struct image_params *imgp)
char *stringp, *destp;
register_t *stack_base;
struct ps_strings *arginfo;
+ char canary[LINUX_AT_RANDOM_LEN];
+ size_t execpath_len;
struct proc *p;
/*
* Calculate string base and vector table pointers.
- * Also deal with signal trampoline code for this exec type.
*/
p = imgp->proc;
+ if (imgp->execpath != NULL && imgp->auxargs != NULL)
+ execpath_len = strlen(imgp->execpath) + 1;
+ else
+ execpath_len = 0;
arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings;
destp = (caddr_t)arginfo - SPARE_USRSPACE - linux_szplatform -
+ roundup(sizeof(canary), sizeof(char *)) -
+ roundup(execpath_len, sizeof(char *)) -
roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *));
/*
* install LINUX_PLATFORM
*/
- copyout(linux_platform, ((caddr_t)arginfo - linux_szplatform),
+ copyout(linux_kplatform, ((caddr_t)arginfo - linux_szplatform),
linux_szplatform);
+ if (execpath_len != 0) {
+ imgp->execpathp = (uintptr_t)arginfo -
+ linux_szplatform - execpath_len;
+ copyout(imgp->execpath, (void *)imgp->execpathp, execpath_len);
+ }
+
+ /*
+ * Prepare the canary for SSP.
+ */
+ arc4rand(canary, sizeof(canary), 0);
+ imgp->canary = (uintptr_t)arginfo - linux_szplatform -
+ roundup(execpath_len, sizeof(char *)) -
+ roundup(sizeof(canary), sizeof(char *));
+ copyout(canary, (void *)imgp->canary, sizeof(canary));
+
/*
* If we have a valid auxargs ptr, prepare some room
* on the stack.
@@ -398,10 +420,6 @@ linux_copyout_strings(struct image_params *imgp)
return (stack_base);
}
-
-
-extern unsigned long linux_sznonrtsigcode;
-
static void
linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
{
@@ -440,9 +458,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
/*
* Build the argument list for the signal handler.
*/
- if (p->p_sysent->sv_sigtbl)
- if (sig <= p->p_sysent->sv_sigsize)
- sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
+ sig = bsd_to_linux_signal(sig);
bzero(&frame, sizeof(frame));
@@ -468,7 +484,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
bsd_to_linux_sigset(mask, &frame.sf_sc.uc_sigmask);
- frame.sf_sc.uc_mcontext.sc_mask = frame.sf_sc.uc_sigmask.__bits[0];
+ frame.sf_sc.uc_mcontext.sc_mask = frame.sf_sc.uc_sigmask.__mask;
frame.sf_sc.uc_mcontext.sc_gs = rgs();
frame.sf_sc.uc_mcontext.sc_fs = regs->tf_fs;
frame.sf_sc.uc_mcontext.sc_es = regs->tf_es;
@@ -477,6 +493,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
frame.sf_sc.uc_mcontext.sc_esi = regs->tf_esi;
frame.sf_sc.uc_mcontext.sc_ebp = regs->tf_ebp;
frame.sf_sc.uc_mcontext.sc_ebx = regs->tf_ebx;
+ frame.sf_sc.uc_mcontext.sc_esp = regs->tf_esp;
frame.sf_sc.uc_mcontext.sc_edx = regs->tf_edx;
frame.sf_sc.uc_mcontext.sc_ecx = regs->tf_ecx;
frame.sf_sc.uc_mcontext.sc_eax = regs->tf_eax;
@@ -514,7 +531,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
* Build context to run handler in.
*/
regs->tf_esp = (int)fp;
- regs->tf_eip = p->p_sysent->sv_sigcode_base + linux_sznonrtsigcode;
+ regs->tf_eip = linux_rt_sigcode;
regs->tf_eflags &= ~(PSL_T | PSL_VM | PSL_D);
regs->tf_cs = _ucodesel;
regs->tf_ds = _udatasel;
@@ -546,7 +563,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
struct l_sigframe *fp, frame;
l_sigset_t lmask;
int sig, code;
- int oonstack, i;
+ int oonstack;
PROC_LOCK_ASSERT(p, MA_OWNED);
psp = p->p_sigacts;
@@ -582,9 +599,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
/*
* Build the argument list for the signal handler.
*/
- if (p->p_sysent->sv_sigtbl)
- if (sig <= p->p_sysent->sv_sigsize)
- sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
+ sig = bsd_to_linux_signal(sig);
bzero(&frame, sizeof(frame));
@@ -596,7 +611,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
/*
* Build the signal context to be used by sigreturn.
*/
- frame.sf_sc.sc_mask = lmask.__bits[0];
+ frame.sf_sc.sc_mask = lmask.__mask;
frame.sf_sc.sc_gs = rgs();
frame.sf_sc.sc_fs = regs->tf_fs;
frame.sf_sc.sc_es = regs->tf_es;
@@ -605,6 +620,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
frame.sf_sc.sc_esi = regs->tf_esi;
frame.sf_sc.sc_ebp = regs->tf_ebp;
frame.sf_sc.sc_ebx = regs->tf_ebx;
+ frame.sf_sc.sc_esp = regs->tf_esp;
frame.sf_sc.sc_edx = regs->tf_edx;
frame.sf_sc.sc_ecx = regs->tf_ecx;
frame.sf_sc.sc_eax = regs->tf_eax;
@@ -617,8 +633,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
frame.sf_sc.sc_cr2 = (register_t)ksi->ksi_addr;
frame.sf_sc.sc_trapno = bsd_to_linux_trapcode(ksi->ksi_trapno);
- for (i = 0; i < (LINUX_NSIG_WORDS-1); i++)
- frame.sf_extramask[i] = lmask.__bits[i+1];
+ frame.sf_extramask[0] = lmask.__mask;
if (copyout(&frame, fp, sizeof(frame)) != 0) {
/*
@@ -633,7 +648,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
* Build context to run handler in.
*/
regs->tf_esp = (int)fp;
- regs->tf_eip = p->p_sysent->sv_sigcode_base;
+ regs->tf_eip = linux_sigcode;
regs->tf_eflags &= ~(PSL_T | PSL_VM | PSL_D);
regs->tf_cs = _ucodesel;
regs->tf_ds = _udatasel;
@@ -661,7 +676,7 @@ linux_sigreturn(struct thread *td, struct linux_sigreturn_args *args)
struct trapframe *regs;
l_sigset_t lmask;
sigset_t bmask;
- int eflags, i;
+ int eflags;
ksiginfo_t ksi;
regs = td->td_frame;
@@ -684,7 +699,7 @@ linux_sigreturn(struct thread *td, struct linux_sigreturn_args *args)
#define EFLAGS_SECURE(ef, oef) ((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0)
eflags = frame.sf_sc.sc_eflags;
if (!EFLAGS_SECURE(eflags, regs->tf_eflags))
- return(EINVAL);
+ return (EINVAL);
/*
* Don't allow users to load a valid privileged %cs. Let the
@@ -699,12 +714,10 @@ linux_sigreturn(struct thread *td, struct linux_sigreturn_args *args)
ksi.ksi_trapno = T_PROTFLT;
ksi.ksi_addr = (void *)regs->tf_eip;
trapsignal(td, &ksi);
- return(EINVAL);
+ return (EINVAL);
}
- lmask.__bits[0] = frame.sf_sc.sc_mask;
- for (i = 0; i < (LINUX_NSIG_WORDS-1); i++)
- lmask.__bits[i+1] = frame.sf_extramask[i];
+ lmask.__mask = frame.sf_sc.sc_mask;
linux_to_bsd_sigset(&lmask, &bmask);
kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0);
@@ -775,7 +788,7 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args)
#define EFLAGS_SECURE(ef, oef) ((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0)
eflags = context->sc_eflags;
if (!EFLAGS_SECURE(eflags, regs->tf_eflags))
- return(EINVAL);
+ return (EINVAL);
/*
* Don't allow users to load a valid privileged %cs. Let the
@@ -790,7 +803,7 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args)
ksi.ksi_trapno = T_PROTFLT;
ksi.ksi_addr = (void *)regs->tf_eip;
trapsignal(td, &ksi);
- return(EINVAL);
+ return (EINVAL);
}
linux_to_bsd_sigset(&uc.uc_sigmask, &bmask);
@@ -852,7 +865,8 @@ linux_fetch_syscall_args(struct thread *td, struct syscall_args *sa)
sa->args[5] = frame->tf_ebp; /* Unconfirmed */
if (sa->code >= p->p_sysent->sv_size)
- sa->callp = &p->p_sysent->sv_table[0];
+ /* nosys */
+ sa->callp = &p->p_sysent->sv_table[LINUX_SYS_MAXSYSCALL];
else
sa->callp = &p->p_sysent->sv_table[sa->code];
sa->narg = sa->callp->sy_narg;
@@ -942,14 +956,14 @@ struct sysentvec linux_sysvec = {
.sv_size = LINUX_SYS_MAXSYSCALL,
.sv_table = linux_sysent,
.sv_mask = 0,
- .sv_sigsize = LINUX_SIGTBLSZ,
- .sv_sigtbl = bsd_to_linux_signal,
+ .sv_sigsize = 0,
+ .sv_sigtbl = NULL,
.sv_errsize = ELAST + 1,
.sv_errtbl = bsd_to_linux_errno,
.sv_transtrap = translate_traps,
.sv_fixup = linux_fixup,
.sv_sendsig = linux_sendsig,
- .sv_sigcode = linux_sigcode,
+ .sv_sigcode = &_binary_linux_locore_o_start,
.sv_szsigcode = &linux_szsigcode,
.sv_prepsyscall = NULL,
.sv_name = "Linux a.out",
@@ -973,6 +987,7 @@ struct sysentvec linux_sysvec = {
.sv_shared_page_base = LINUX_SHAREDPAGE,
.sv_shared_page_len = PAGE_SIZE,
.sv_schedtail = linux_schedtail,
+ .sv_thread_detach = linux_thread_detach,
};
INIT_SYSENTVEC(aout_sysvec, &linux_sysvec);
@@ -980,14 +995,14 @@ struct sysentvec elf_linux_sysvec = {
.sv_size = LINUX_SYS_MAXSYSCALL,
.sv_table = linux_sysent,
.sv_mask = 0,
- .sv_sigsize = LINUX_SIGTBLSZ,
- .sv_sigtbl = bsd_to_linux_signal,
+ .sv_sigsize = 0,
+ .sv_sigtbl = NULL,
.sv_errsize = ELAST + 1,
.sv_errtbl = bsd_to_linux_errno,
.sv_transtrap = translate_traps,
.sv_fixup = elf_linux_fixup,
.sv_sendsig = linux_sendsig,
- .sv_sigcode = linux_sigcode,
+ .sv_sigcode = &_binary_linux_locore_o_start,
.sv_szsigcode = &linux_szsigcode,
.sv_prepsyscall = NULL,
.sv_name = "Linux ELF",
@@ -1011,8 +1026,41 @@ struct sysentvec elf_linux_sysvec = {
.sv_shared_page_base = LINUX_SHAREDPAGE,
.sv_shared_page_len = PAGE_SIZE,
.sv_schedtail = linux_schedtail,
+ .sv_thread_detach = linux_thread_detach,
+};
+
+static void
+linux_vdso_install(void *param)
+{
+
+ linux_szsigcode = (&_binary_linux_locore_o_end -
+ &_binary_linux_locore_o_start);
+
+ if (linux_szsigcode > elf_linux_sysvec.sv_shared_page_len)
+ panic("Linux invalid vdso size\n");
+
+ __elfN(linux_vdso_fixup)(&elf_linux_sysvec);
+
+ linux_shared_page_obj = __elfN(linux_shared_page_init)
+ (&linux_shared_page_mapping);
+
+ __elfN(linux_vdso_reloc)(&elf_linux_sysvec, LINUX_SHAREDPAGE);
+
+ bcopy(elf_linux_sysvec.sv_sigcode, linux_shared_page_mapping,
+ linux_szsigcode);
+ elf_linux_sysvec.sv_shared_page_obj = linux_shared_page_obj;
+}
+SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_ANY,
+ (sysinit_cfunc_t)linux_vdso_install, NULL);
+
+static void
+linux_vdso_deinstall(void *param)
+{
+
+ __elfN(linux_shared_page_fini)(linux_shared_page_obj);
};
-INIT_SYSENTVEC(elf_sysvec, &elf_linux_sysvec);
+SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER_FIRST,
+ (sysinit_cfunc_t)linux_vdso_deinstall, NULL);
static char GNU_ABI_VENDOR[] = "GNU";
static int GNULINUX_ABI_DESC = 0;
@@ -1084,7 +1132,6 @@ linux_elf_modevent(module_t mod, int type, void *data)
Elf32_Brandinfo **brandinfo;
int error;
struct linux_ioctl_handler **lihp;
- struct linux_device_handler **ldhp;
error = 0;
@@ -1097,18 +1144,16 @@ linux_elf_modevent(module_t mod, int type, void *data)
if (error == 0) {
SET_FOREACH(lihp, linux_ioctl_handler_set)
linux_ioctl_register_handler(*lihp);
- SET_FOREACH(ldhp, linux_device_handler_set)
- linux_device_register_handler(*ldhp);
- mtx_init(&emul_lock, "emuldata lock", NULL, MTX_DEF);
- sx_init(&emul_shared_lock, "emuldata->shared lock");
LIST_INIT(&futex_list);
mtx_init(&futex_mtx, "ftllk", NULL, MTX_DEF);
linux_exit_tag = EVENTHANDLER_REGISTER(process_exit, linux_proc_exit,
NULL, 1000);
linux_exec_tag = EVENTHANDLER_REGISTER(process_exec, linux_proc_exec,
NULL, 1000);
- linux_get_machine(&linux_platform);
- linux_szplatform = roundup(strlen(linux_platform) + 1,
+ linux_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor,
+ linux_thread_dtor, NULL, EVENTHANDLER_PRI_ANY);
+ linux_get_machine(&linux_kplatform);
+ linux_szplatform = roundup(strlen(linux_kplatform) + 1,
sizeof(char *));
linux_osd_jail_register();
stclohz = (stathz ? stathz : hz);
@@ -1131,13 +1176,10 @@ linux_elf_modevent(module_t mod, int type, void *data)
if (error == 0) {
SET_FOREACH(lihp, linux_ioctl_handler_set)
linux_ioctl_unregister_handler(*lihp);
- SET_FOREACH(ldhp, linux_device_handler_set)
- linux_device_unregister_handler(*ldhp);
- mtx_destroy(&emul_lock);
- sx_destroy(&emul_shared_lock);
mtx_destroy(&futex_mtx);
EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag);
EVENTHANDLER_DEREGISTER(process_exec, linux_exec_tag);
+ EVENTHANDLER_DEREGISTER(thread_dtor, linux_thread_dtor_tag);
linux_osd_jail_deregister();
if (bootverbose)
printf("Linux ELF exec handler removed\n");
@@ -1145,9 +1187,9 @@ linux_elf_modevent(module_t mod, int type, void *data)
printf("Could not deinstall ELF interpreter entry\n");
break;
default:
- return EOPNOTSUPP;
+ return (EOPNOTSUPP);
}
- return error;
+ return (error);
}
static moduledata_t linux_elf_mod = {
diff --git a/sys/i386/linux/linux_vdso.lds.s b/sys/i386/linux/linux_vdso.lds.s
new file mode 100644
index 0000000..dcb61cf
--- /dev/null
+++ b/sys/i386/linux/linux_vdso.lds.s
@@ -0,0 +1,65 @@
+/*
+ * Linker script for 32-bit vDSO.
+ * Copied from Linux kernel arch/x86/vdso/vdso-layout.lds.S
+ * and arch/x86/vdso/vdso32/vdso32.lds.S
+ *
+ * $FreeBSD$
+ */
+
+SECTIONS
+{
+ . = . + SIZEOF_HEADERS;
+
+ .hash : { *(.hash) } :text
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+
+ .note : { *(.note.*) } :text :note
+
+ .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
+ .eh_frame : { KEEP (*(.eh_frame)) } :text
+
+ .dynamic : { *(.dynamic) } :text :dynamic
+
+ .rodata : { *(.rodata*) } :text
+ .data : {
+ *(.data*)
+ *(.sdata*)
+ *(.got.plt) *(.got)
+ *(.gnu.linkonce.d.*)
+ *(.bss*)
+ *(.dynbss*)
+ *(.gnu.linkonce.b.*)
+ }
+
+ .altinstructions : { *(.altinstructions) }
+ .altinstr_replacement : { *(.altinstr_replacement) }
+
+ . = ALIGN(0x100);
+ .text : { *(.text*) } :text =0x90909090
+}
+
+PHDRS
+{
+ text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
+ dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
+ note PT_NOTE FLAGS(4); /* PF_R */
+ eh_frame_hdr PT_GNU_EH_FRAME;
+}
+
+ENTRY(linux_vsyscall);
+
+VERSION
+{
+ LINUX_2.5 {
+ global:
+ linux_vsyscall;
+ linux_sigcode;
+ linux_rt_sigcode;
+ local: *;
+ };
+}
diff --git a/sys/i386/linux/syscalls.master b/sys/i386/linux/syscalls.master
index 5b4f3a6..e6609a9 100644
--- a/sys/i386/linux/syscalls.master
+++ b/sys/i386/linux/syscalls.master
@@ -37,8 +37,7 @@
; #ifdef's, etc. may be included, and are copied to the output files.
0 AUE_NULL UNIMPL setup
-1 AUE_EXIT NOPROTO { void sys_exit(int rval); } exit \
- sys_exit_args void
+1 AUE_EXIT STD { void linux_exit(int rval); }
2 AUE_FORK STD { int linux_fork(void); }
3 AUE_NULL NOPROTO { int read(int fd, char *buf, \
u_int nbyte); }
@@ -209,7 +208,7 @@
113 AUE_NULL STD { int linux_vm86old(void); }
114 AUE_WAIT4 STD { int linux_wait4(l_pid_t pid, \
l_int *status, l_int options, \
- struct l_rusage *rusage); }
+ void *rusage); }
115 AUE_SWAPOFF STD { int linux_swapoff(void); }
116 AUE_NULL STD { int linux_sysinfo(struct l_sysinfo *info); }
117 AUE_NULL STD { int linux_ipc(l_uint what, l_int arg1, \
@@ -270,10 +269,10 @@
151 AUE_MUNLOCK NOPROTO { int munlock(const void *addr, size_t len); }
152 AUE_MLOCKALL NOPROTO { int mlockall(int how); }
153 AUE_MUNLOCKALL NOPROTO { int munlockall(void); }
-154 AUE_SCHED_SETPARAM NOPROTO { int sched_setparam(pid_t pid, \
- const struct sched_param *param); }
-155 AUE_SCHED_GETPARAM NOPROTO { int sched_getparam(pid_t pid, \
- struct sched_param *param); }
+154 AUE_SCHED_SETPARAM STD { int linux_sched_setparam(l_pid_t pid, \
+ struct l_sched_param *param); }
+155 AUE_SCHED_GETPARAM STD { int linux_sched_getparam(l_pid_t pid, \
+ struct l_sched_param *param); }
156 AUE_SCHED_SETSCHEDULER STD { int linux_sched_setscheduler( \
l_pid_t pid, l_int policy, \
struct l_sched_param *param); }
@@ -284,8 +283,8 @@
l_int policy); }
160 AUE_SCHED_GET_PRIORITY_MIN STD { int linux_sched_get_priority_min( \
l_int policy); }
-161 AUE_SCHED_RR_GET_INTERVAL NOPROTO { int sched_rr_get_interval(l_pid_t pid, \
- struct l_timespec *interval); }
+161 AUE_SCHED_RR_GET_INTERVAL STD { int linux_sched_rr_get_interval( \
+ l_pid_t pid, struct l_timespec *interval); }
162 AUE_NULL STD { int linux_nanosleep( \
const struct l_timespec *rqtp, \
struct l_timespec *rmtp); }
@@ -321,7 +320,8 @@
l_siginfo_t *ptr, \
struct l_timeval *timeout, \
l_size_t sigsetsize); }
-178 AUE_NULL STD { int linux_rt_sigqueueinfo(void); }
+178 AUE_NULL STD { int linux_rt_sigqueueinfo(l_pid_t pid, l_int sig, \
+ l_siginfo_t *info); }
179 AUE_NULL STD { int linux_rt_sigsuspend( \
l_sigset_t *newset, \
l_size_t sigsetsize); }
@@ -432,9 +432,11 @@
251 AUE_NULL UNIMPL
252 AUE_EXIT STD { int linux_exit_group(int error_code); }
253 AUE_NULL STD { int linux_lookup_dcookie(void); }
-254 AUE_NULL STD { int linux_epoll_create(void); }
-255 AUE_NULL STD { int linux_epoll_ctl(void); }
-256 AUE_NULL STD { int linux_epoll_wait(void); }
+254 AUE_NULL STD { int linux_epoll_create(l_int size); }
+255 AUE_NULL STD { int linux_epoll_ctl(l_int epfd, l_int op, l_int fd, \
+ struct epoll_event *event); }
+256 AUE_NULL STD { int linux_epoll_wait(l_int epfd, struct epoll_event *events, \
+ l_int maxevents, l_int timeout); }
257 AUE_NULL STD { int linux_remap_file_pages(void); }
258 AUE_NULL STD { int linux_set_tid_address(int *tidptr); }
259 AUE_NULL STD { int linux_timer_create(clockid_t clock_id, \
@@ -475,7 +477,9 @@
282 AUE_NULL STD { int linux_mq_getsetattr(l_mqd_t mqd, const struct mq_attr *attr, \
struct mq_attr *oattr); }
283 AUE_NULL STD { int linux_kexec_load(void); }
-284 AUE_NULL STD { int linux_waitid(void); }
+284 AUE_WAIT6 STD { int linux_waitid(int idtype, l_pid_t id, \
+ l_siginfo_t *info, int options, \
+ void *rusage); }
285 AUE_NULL UNIMPL
; linux 2.6.11:
286 AUE_NULL STD { int linux_add_key(void); }
@@ -513,9 +517,13 @@
char *buf, l_int bufsiz); }
306 AUE_FCHMODAT STD { int linux_fchmodat(l_int dfd, const char *filename, \
l_mode_t mode); }
-307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, l_int amode, l_int flag); }
-308 AUE_NULL STD { int linux_pselect6(void); }
-309 AUE_NULL STD { int linux_ppoll(void); }
+307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, \
+ l_int amode); }
+308 AUE_SELECT STD { int linux_pselect6(l_int nfds, l_fd_set *readfds, \
+ l_fd_set *writefds, l_fd_set *exceptfds, \
+ struct l_timespec *tsp, l_uintptr_t *sig); }
+309 AUE_POLL STD { int linux_ppoll(struct pollfd *fds, uint32_t nfds, \
+ struct l_timespec *tsp, l_sigset_t *sset, l_size_t ssize); }
310 AUE_NULL STD { int linux_unshare(void); }
; linux 2.6.17:
311 AUE_NULL STD { int linux_set_robust_list(struct linux_robust_list_head *head, \
@@ -530,22 +538,26 @@
317 AUE_NULL STD { int linux_move_pages(void); }
; linux 2.6.19:
318 AUE_NULL STD { int linux_getcpu(void); }
-319 AUE_NULL STD { int linux_epoll_pwait(void); }
+319 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \
+ l_int maxevents, l_int timeout, l_sigset_t *mask); }
; linux 2.6.22:
-320 AUE_NULL STD { int linux_utimensat(void); }
+320 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \
+ const struct l_timespec *times, l_int flags); }
321 AUE_NULL STD { int linux_signalfd(void); }
322 AUE_NULL STD { int linux_timerfd_create(void); }
-323 AUE_NULL STD { int linux_eventfd(void); }
+323 AUE_NULL STD { int linux_eventfd(l_uint initval); }
; linux 2.6.23:
-324 AUE_NULL STD { int linux_fallocate(void); }
+324 AUE_NULL STD { int linux_fallocate(l_int fd, l_int mode, \
+ l_loff_t offset, l_loff_t len); }
; linux 2.6.25:
325 AUE_NULL STD { int linux_timerfd_settime(void); }
326 AUE_NULL STD { int linux_timerfd_gettime(void); }
; linux 2.6.27:
327 AUE_NULL STD { int linux_signalfd4(void); }
-328 AUE_NULL STD { int linux_eventfd2(void); }
-329 AUE_NULL STD { int linux_epoll_create1(void); }
-330 AUE_NULL STD { int linux_dup3(void); }
+328 AUE_NULL STD { int linux_eventfd2(l_uint initval, l_int flags); }
+329 AUE_NULL STD { int linux_epoll_create1(l_int flags); }
+330 AUE_NULL STD { int linux_dup3(l_int oldfd, \
+ l_int newfd, l_int flags); }
331 AUE_NULL STD { int linux_pipe2(l_int *pipefds, l_int flags); }
332 AUE_NULL STD { int linux_inotify_init1(void); }
; linux 2.6.30:
@@ -555,17 +567,26 @@
335 AUE_NULL STD { int linux_rt_tsigqueueinfo(void); }
336 AUE_NULL STD { int linux_perf_event_open(void); }
; linux 2.6.33:
-337 AUE_NULL STD { int linux_recvmmsg(void); }
+337 AUE_NULL STD { int linux_recvmmsg(l_int s, \
+ struct l_mmsghdr *msg, l_uint vlen, \
+ l_uint flags, struct l_timespec *timeout); }
338 AUE_NULL STD { int linux_fanotify_init(void); }
339 AUE_NULL STD { int linux_fanotify_mark(void); }
; linux 2.6.36:
-340 AUE_NULL STD { int linux_prlimit64(void); }
+340 AUE_NULL STD { int linux_prlimit64(l_pid_t pid, \
+ l_uint resource, \
+ struct rlimit *new, \
+ struct rlimit *old); }
; later:
341 AUE_NULL STD { int linux_name_to_handle_at(void); }
342 AUE_NULL STD { int linux_open_by_handle_at(void); }
343 AUE_NULL STD { int linux_clock_adjtime(void); }
-344 AUE_NULL STD { int linux_syncfs(void); }
-345 AUE_NULL STD { int linux_sendmmsg(void); }
+344 AUE_SYNC STD { int linux_syncfs(l_int fd); }
+345 AUE_NULL STD { int linux_sendmmsg(l_int s, \
+ struct l_mmsghdr *msg, l_uint vlen, \
+ l_uint flags); }
346 AUE_NULL STD { int linux_setns(void); }
347 AUE_NULL STD { int linux_process_vm_readv(void); }
348 AUE_NULL STD { int linux_process_vm_writev(void); }
+; please, keep this line at the end.
+349 AUE_NULL UNIMPL nosys
diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c
index 3ae78de..3165ac0 100644
--- a/sys/kern/imgact_aout.c
+++ b/sys/kern/imgact_aout.c
@@ -99,6 +99,7 @@ struct sysentvec aout_sysvec = {
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
.sv_syscallnames = syscallnames,
.sv_schedtail = NULL,
+ .sv_thread_detach = NULL,
};
#elif defined(__amd64__)
@@ -247,7 +248,7 @@ exec_aout_imgact(struct image_params *imgp)
a_out->a_text > maxtsiz ||
/* data + bss can't exceed rlimit */
- a_out->a_data + bss_size > lim_cur(imgp->proc, RLIMIT_DATA) ||
+ a_out->a_data + bss_size > lim_cur_proc(imgp->proc, RLIMIT_DATA) ||
racct_set(imgp->proc, RACCT_DATA, a_out->a_data + bss_size) != 0) {
PROC_UNLOCK(imgp->proc);
return (ENOMEM);
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index a98a15d..0675128 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -732,7 +732,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
u_long addr, baddr, et_dyn_addr, entry = 0, proghdr = 0;
int32_t osrel = 0;
int error = 0, i, n, interp_name_len = 0;
- const char *interp = NULL, *newinterp = NULL;
+ const char *err_str = NULL, *interp = NULL, *newinterp = NULL;
Elf_Brandinfo *brand_info;
char *path;
struct sysentvec *sv;
@@ -755,11 +755,14 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
if ((hdr->e_phoff > PAGE_SIZE) ||
(u_int)hdr->e_phentsize * hdr->e_phnum > PAGE_SIZE - hdr->e_phoff) {
/* Only support headers in first page for now */
+ uprintf("Program headers not in the first page\n");
return (ENOEXEC);
}
- phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff);
- if (!aligned(phdr, Elf_Addr))
+ phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff);
+ if (!aligned(phdr, Elf_Addr)) {
+ uprintf("Unaligned program headers\n");
return (ENOEXEC);
+ }
n = 0;
baddr = 0;
for (i = 0; i < hdr->e_phnum; i++) {
@@ -773,8 +776,10 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
/* Path to interpreter */
if (phdr[i].p_filesz > MAXPATHLEN ||
phdr[i].p_offset > PAGE_SIZE ||
- phdr[i].p_filesz > PAGE_SIZE - phdr[i].p_offset)
+ phdr[i].p_filesz > PAGE_SIZE - phdr[i].p_offset) {
+ uprintf("Invalid PT_INTERP\n");
return (ENOEXEC);
+ }
interp = imgp->image_header + phdr[i].p_offset;
interp_name_len = phdr[i].p_filesz;
break;
@@ -795,8 +800,10 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
return (ENOEXEC);
}
if (hdr->e_type == ET_DYN) {
- if ((brand_info->flags & BI_CAN_EXEC_DYN) == 0)
+ if ((brand_info->flags & BI_CAN_EXEC_DYN) == 0) {
+ uprintf("Cannot execute shared object\n");
return (ENOEXEC);
+ }
/*
* Honour the base load address from the dso if it is
* non-zero for some reason.
@@ -901,12 +908,19 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
* not actually fault in all the segments pages.
*/
PROC_LOCK(imgp->proc);
- if (data_size > lim_cur(imgp->proc, RLIMIT_DATA) ||
- text_size > maxtsiz ||
- total_size > lim_cur(imgp->proc, RLIMIT_VMEM) ||
- racct_set(imgp->proc, RACCT_DATA, data_size) != 0 ||
- racct_set(imgp->proc, RACCT_VMEM, total_size) != 0) {
+ if (data_size > lim_cur_proc(imgp->proc, RLIMIT_DATA))
+ err_str = "Data segment size exceeds process limit";
+ else if (text_size > maxtsiz)
+ err_str = "Text segment size exceeds system limit";
+ else if (total_size > lim_cur_proc(imgp->proc, RLIMIT_VMEM))
+ err_str = "Total segment size exceeds process limit";
+ else if (racct_set(imgp->proc, RACCT_DATA, data_size) != 0)
+ err_str = "Data segment size exceeds resource limit";
+ else if (racct_set(imgp->proc, RACCT_VMEM, total_size) != 0)
+ err_str = "Total segment size exceeds resource limit";
+ if (err_str != NULL) {
PROC_UNLOCK(imgp->proc);
+ uprintf("%s\n", err_str);
return (ENOMEM);
}
@@ -922,7 +936,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
* calculation is that it leaves room for the heap to grow to
* its maximum allowed size.
*/
- addr = round_page((vm_offset_t)vmspace->vm_daddr + lim_max(imgp->proc,
+ addr = round_page((vm_offset_t)vmspace->vm_daddr + lim_max(curthread,
RLIMIT_DATA));
PROC_UNLOCK(imgp->proc);
@@ -1969,7 +1983,7 @@ note_procstat_rlimit(void *arg, struct sbuf *sb, size_t *sizep)
sbuf_bcat(sb, &structsize, sizeof(structsize));
PROC_LOCK(p);
for (i = 0; i < RLIM_NLIMITS; i++)
- lim_rlimit(p, i, &rlim[i]);
+ lim_rlimit_proc(p, i, &rlim[i]);
PROC_UNLOCK(p);
sbuf_bcat(sb, rlim, sizeof(rlim));
}
diff --git a/sys/kern/imgact_gzip.c b/sys/kern/imgact_gzip.c
index ab77a88..47b7280 100644
--- a/sys/kern/imgact_gzip.c
+++ b/sys/kern/imgact_gzip.c
@@ -212,7 +212,7 @@ do_aout_hdr(struct imgact_gzip * gz)
/* data + bss can't exceed rlimit */
gz->a_out.a_data + gz->bss_size >
- lim_cur(gz->ip->proc, RLIMIT_DATA) ||
+ lim_cur_proc(gz->ip->proc, RLIMIT_DATA) ||
racct_set(gz->ip->proc, RACCT_DATA,
gz->a_out.a_data + gz->bss_size) != 0) {
PROC_UNLOCK(gz->ip->proc);
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index c263356..37539c4 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -411,6 +411,7 @@ struct sysentvec null_sysvec = {
.sv_fetch_syscall_args = null_fetch_syscall_args,
.sv_syscallnames = NULL,
.sv_schedtail = NULL,
+ .sv_thread_detach = NULL,
};
/*
@@ -522,8 +523,6 @@ proc0_init(void *dummy __unused)
#ifdef MAC
mac_cred_create_swapper(newcred);
#endif
- td->td_ucred = crhold(newcred);
-
/* Create sigacts. */
p->p_sigacts = sigacts_alloc();
@@ -555,6 +554,10 @@ proc0_init(void *dummy __unused)
p->p_limit->pl_rlimit[RLIMIT_MEMLOCK].rlim_max = pageablemem;
p->p_cpulimit = RLIM_INFINITY;
+ PROC_LOCK(p);
+ thread_cow_get_proc(td, p);
+ PROC_UNLOCK(p);
+
/* Initialize resource accounting structures. */
racct_create(&p->p_racct);
@@ -842,10 +845,10 @@ create_init(const void *udata __unused)
audit_cred_proc1(newcred);
#endif
proc_set_cred(initproc, newcred);
+ cred_update_thread(FIRST_THREAD_IN_PROC(initproc));
PROC_UNLOCK(initproc);
sx_xunlock(&proctree_lock);
crfree(oldcred);
- cred_update_thread(FIRST_THREAD_IN_PROC(initproc));
cpu_set_fork_handler(FIRST_THREAD_IN_PROC(initproc), start_init, NULL);
}
SYSINIT(init, SI_SUB_CREATE_INIT, SI_ORDER_FIRST, create_init, NULL);
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 7848396..f6f8194 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -109,7 +109,7 @@ static void fdgrowtable(struct filedesc *fdp, int nfd);
static void fdgrowtable_exp(struct filedesc *fdp, int nfd);
static void fdunused(struct filedesc *fdp, int fd);
static void fdused(struct filedesc *fdp, int fd);
-static int getmaxfd(struct proc *p);
+static int getmaxfd(struct thread *td);
/* Flags for do_dup() */
#define DUP_FIXED 0x1 /* Force fixed allocation. */
@@ -178,9 +178,6 @@ volatile int openfiles; /* actual number of open files */
struct mtx sigio_lock; /* mtx to protect pointers to sigio */
void (*mq_fdclose)(struct thread *td, int fd, struct file *fp);
-/* A mutex to protect the association between a proc and filedesc. */
-static struct mtx fdesc_mtx;
-
/*
* If low >= size, just return low. Otherwise find the first zero bit in the
* given bitmap, starting at low and not exceeding size - 1. Return size if
@@ -331,16 +328,19 @@ struct getdtablesize_args {
int
sys_getdtablesize(struct thread *td, struct getdtablesize_args *uap)
{
- struct proc *p = td->td_proc;
+#ifdef RACCT
uint64_t lim;
+#endif
- PROC_LOCK(p);
td->td_retval[0] =
- min((int)lim_cur(p, RLIMIT_NOFILE), maxfilesperproc);
+ min((int)lim_cur(td, RLIMIT_NOFILE), maxfilesperproc);
+#ifdef RACCT
+ PROC_LOCK(td->td_proc);
lim = racct_get_limit(td->td_proc, RACCT_NOFILE);
- PROC_UNLOCK(p);
+ PROC_UNLOCK(td->td_proc);
if (lim < td->td_retval[0])
td->td_retval[0] = lim;
+#endif
return (0);
}
@@ -783,15 +783,10 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg)
}
static int
-getmaxfd(struct proc *p)
+getmaxfd(struct thread *td)
{
- int maxfd;
-
- PROC_LOCK(p);
- maxfd = min((int)lim_cur(p, RLIMIT_NOFILE), maxfilesperproc);
- PROC_UNLOCK(p);
- return (maxfd);
+ return (min((int)lim_cur(td, RLIMIT_NOFILE), maxfilesperproc));
}
/*
@@ -819,7 +814,7 @@ do_dup(struct thread *td, int flags, int old, int new)
return (EBADF);
if (new < 0)
return (flags & DUP_FCNTL ? EINVAL : EBADF);
- maxfd = getmaxfd(p);
+ maxfd = getmaxfd(td);
if (new >= maxfd)
return (flags & DUP_FCNTL ? EINVAL : EBADF);
@@ -1619,7 +1614,7 @@ fdalloc(struct thread *td, int minfd, int *result)
if (fdp->fd_freefile > minfd)
minfd = fdp->fd_freefile;
- maxfd = getmaxfd(p);
+ maxfd = getmaxfd(td);
/*
* Search the bitmap for a free descriptor starting at minfd.
@@ -1809,8 +1804,8 @@ fdinit(struct filedesc *fdp, bool prepfiles)
/* Create the file descriptor table. */
FILEDESC_LOCK_INIT(newfdp);
- newfdp->fd_refcnt = 1;
- newfdp->fd_holdcnt = 1;
+ refcount_init(&newfdp->fd_refcnt, 1);
+ refcount_init(&newfdp->fd_holdcnt, 1);
newfdp->fd_cmask = CMASK;
newfdp->fd_map = newfdp0->fd_dmap;
newfdp->fd_lastfile = -1;
@@ -1852,24 +1847,19 @@ fdhold(struct proc *p)
{
struct filedesc *fdp;
- mtx_lock(&fdesc_mtx);
+ PROC_LOCK_ASSERT(p, MA_OWNED);
fdp = p->p_fd;
if (fdp != NULL)
- fdp->fd_holdcnt++;
- mtx_unlock(&fdesc_mtx);
+ refcount_acquire(&fdp->fd_holdcnt);
return (fdp);
}
static void
fddrop(struct filedesc *fdp)
{
- int i;
if (fdp->fd_holdcnt > 1) {
- mtx_lock(&fdesc_mtx);
- i = --fdp->fd_holdcnt;
- mtx_unlock(&fdesc_mtx);
- if (i > 0)
+ if (refcount_release(&fdp->fd_holdcnt) == 0)
return;
}
@@ -1884,9 +1874,7 @@ struct filedesc *
fdshare(struct filedesc *fdp)
{
- FILEDESC_XLOCK(fdp);
- fdp->fd_refcnt++;
- FILEDESC_XUNLOCK(fdp);
+ refcount_acquire(&fdp->fd_refcnt);
return (fdp);
}
@@ -2032,6 +2020,7 @@ retry:
void
fdescfree(struct thread *td)
{
+ struct proc *p;
struct filedesc0 *fdp0;
struct filedesc *fdp;
struct freetable *ft, *tft;
@@ -2040,31 +2029,29 @@ fdescfree(struct thread *td)
struct vnode *cdir, *jdir, *rdir;
int i;
- fdp = td->td_proc->p_fd;
+ p = td->td_proc;
+ fdp = p->p_fd;
MPASS(fdp != NULL);
#ifdef RACCT
if (racct_enable) {
- PROC_LOCK(td->td_proc);
- racct_set(td->td_proc, RACCT_NOFILE, 0);
- PROC_UNLOCK(td->td_proc);
+ PROC_LOCK(p);
+ racct_set(p, RACCT_NOFILE, 0);
+ PROC_UNLOCK(p);
}
#endif
if (td->td_proc->p_fdtol != NULL)
fdclearlocks(td);
- mtx_lock(&fdesc_mtx);
- td->td_proc->p_fd = NULL;
- mtx_unlock(&fdesc_mtx);
+ PROC_LOCK(p);
+ p->p_fd = NULL;
+ PROC_UNLOCK(p);
- FILEDESC_XLOCK(fdp);
- i = --fdp->fd_refcnt;
- if (i > 0) {
- FILEDESC_XUNLOCK(fdp);
+ if (refcount_release(&fdp->fd_refcnt) == 0)
return;
- }
+ FILEDESC_XLOCK(fdp);
cdir = fdp->fd_cdir;
fdp->fd_cdir = NULL;
rdir = fdp->fd_rdir;
@@ -2884,7 +2871,9 @@ mountcheckdirs(struct vnode *olddp, struct vnode *newdp)
nrele = 0;
sx_slock(&allproc_lock);
FOREACH_PROC_IN_SYSTEM(p) {
+ PROC_LOCK(p);
fdp = fdhold(p);
+ PROC_UNLOCK(p);
if (fdp == NULL)
continue;
FILEDESC_XLOCK(fdp);
@@ -2979,9 +2968,13 @@ sysctl_kern_file(SYSCTL_HANDLER_ARGS)
n = 0;
sx_slock(&allproc_lock);
FOREACH_PROC_IN_SYSTEM(p) {
- if (p->p_state == PRS_NEW)
+ PROC_LOCK(p);
+ if (p->p_state == PRS_NEW) {
+ PROC_UNLOCK(p);
continue;
+ }
fdp = fdhold(p);
+ PROC_UNLOCK(p);
if (fdp == NULL)
continue;
/* overestimates sparse tables. */
@@ -3008,8 +3001,8 @@ sysctl_kern_file(SYSCTL_HANDLER_ARGS)
}
xf.xf_pid = p->p_pid;
xf.xf_uid = p->p_ucred->cr_uid;
- PROC_UNLOCK(p);
fdp = fdhold(p);
+ PROC_UNLOCK(p);
if (fdp == NULL)
continue;
FILEDESC_SLOCK(fdp);
@@ -3644,7 +3637,6 @@ filelistinit(void *dummy)
filedesc0_zone = uma_zcreate("filedesc0", sizeof(struct filedesc0),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
mtx_init(&sigio_lock, "sigio lock", NULL, MTX_DEF);
- mtx_init(&fdesc_mtx, "fdesc", NULL, MTX_DEF);
}
SYSINIT(select, SI_SUB_LOCK, SI_ORDER_FIRST, filelistinit, NULL);
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
index b6d8a79..ff17fe9 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -737,6 +737,13 @@ filt_usertouch(struct knote *kn, struct kevent *kev, u_long type)
int
sys_kqueue(struct thread *td, struct kqueue_args *uap)
{
+
+ return (kern_kqueue(td, 0));
+}
+
+int
+kern_kqueue(struct thread *td, int flags)
+{
struct filedesc *fdp;
struct kqueue *kq;
struct file *fp;
@@ -747,17 +754,13 @@ sys_kqueue(struct thread *td, struct kqueue_args *uap)
p = td->td_proc;
cred = td->td_ucred;
crhold(cred);
- PROC_LOCK(p);
- if (!chgkqcnt(cred->cr_ruidinfo, 1, lim_cur(td->td_proc,
- RLIMIT_KQUEUES))) {
- PROC_UNLOCK(p);
+ if (!chgkqcnt(cred->cr_ruidinfo, 1, lim_cur(td, RLIMIT_KQUEUES))) {
crfree(cred);
return (ENOMEM);
}
- PROC_UNLOCK(p);
fdp = p->p_fd;
- error = falloc(td, &fp, &fd, 0);
+ error = falloc(td, &fp, &fd, flags);
if (error)
goto done2;
@@ -888,12 +891,9 @@ int
kern_kevent(struct thread *td, int fd, int nchanges, int nevents,
struct kevent_copyops *k_ops, const struct timespec *timeout)
{
- struct kevent keva[KQ_NEVENTS];
- struct kevent *kevp, *changes;
- struct kqueue *kq;
- struct file *fp;
cap_rights_t rights;
- int i, n, nerrors, error;
+ struct file *fp;
+ int error;
cap_rights_init(&rights);
if (nchanges > 0)
@@ -904,9 +904,24 @@ kern_kevent(struct thread *td, int fd, int nchanges, int nevents,
if (error != 0)
return (error);
+ error = kern_kevent_fp(td, fp, nchanges, nevents, k_ops, timeout);
+ fdrop(fp, td);
+
+ return (error);
+}
+
+int
+kern_kevent_fp(struct thread *td, struct file *fp, int nchanges, int nevents,
+ struct kevent_copyops *k_ops, const struct timespec *timeout)
+{
+ struct kevent keva[KQ_NEVENTS];
+ struct kevent *kevp, *changes;
+ struct kqueue *kq;
+ int i, n, nerrors, error;
+
error = kqueue_acquire(fp, &kq);
if (error != 0)
- goto done_norel;
+ return (error);
nerrors = 0;
@@ -946,8 +961,6 @@ kern_kevent(struct thread *td, int fd, int nchanges, int nevents,
error = kqueue_scan(kq, nevents, k_ops, timeout, keva, td);
done:
kqueue_release(kq, 0);
-done_norel:
- fdrop(fp, td);
return (error);
}
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 8668f0d..375e644 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -966,13 +966,10 @@ exec_map_first_page(imgp)
}
initial_pagein = i;
rv = vm_pager_get_pages(object, ma, initial_pagein, 0);
- ma[0] = vm_page_lookup(object, 0);
- if ((rv != VM_PAGER_OK) || (ma[0] == NULL)) {
- if (ma[0] != NULL) {
- vm_page_lock(ma[0]);
- vm_page_free(ma[0]);
- vm_page_unlock(ma[0]);
- }
+ if (rv != VM_PAGER_OK) {
+ vm_page_lock(ma[0]);
+ vm_page_free(ma[0]);
+ vm_page_unlock(ma[0]);
VM_OBJECT_WUNLOCK(object);
return (EIO);
}
@@ -1073,7 +1070,7 @@ exec_new_vmspace(imgp, sv)
if (imgp->stack_sz != 0) {
ssiz = trunc_page(imgp->stack_sz);
PROC_LOCK(p);
- lim_rlimit(p, RLIMIT_STACK, &rlim_stack);
+ lim_rlimit_proc(p, RLIMIT_STACK, &rlim_stack);
PROC_UNLOCK(p);
if (ssiz > rlim_stack.rlim_max)
ssiz = rlim_stack.rlim_max;
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index e760bc8..9ce6d34 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -205,6 +205,12 @@ exit1(struct thread *td, int rv)
}
/*
+ * Deref SU mp, since the thread does not return to userspace.
+ */
+ if (softdep_ast_cleanup != NULL)
+ softdep_ast_cleanup();
+
+ /*
* MUST abort all other threads before proceeding past here.
*/
PROC_LOCK(p);
@@ -525,6 +531,8 @@ exit1(struct thread *td, int rv)
*/
while ((q = LIST_FIRST(&p->p_orphans)) != NULL) {
PROC_LOCK(q);
+ CTR2(KTR_PTRACE, "exit: pid %d, clearing orphan %d", p->p_pid,
+ q->p_pid);
clear_orphan(q);
PROC_UNLOCK(q);
}
@@ -857,6 +865,9 @@ proc_reap(struct thread *td, struct proc *p, int *status, int options)
t = proc_realparent(p);
PROC_LOCK(t);
PROC_LOCK(p);
+ CTR2(KTR_PTRACE,
+ "wait: traced child %d moved back to parent %d", p->p_pid,
+ t->p_pid);
proc_reparent(p, t);
p->p_oppid = 0;
PROC_UNLOCK(p);
@@ -950,14 +961,13 @@ proc_reap(struct thread *td, struct proc *p, int *status, int options)
static int
proc_to_reap(struct thread *td, struct proc *p, idtype_t idtype, id_t id,
- int *status, int options, struct __wrusage *wrusage, siginfo_t *siginfo)
+ int *status, int options, struct __wrusage *wrusage, siginfo_t *siginfo,
+ int check_only)
{
- struct proc *q;
struct rusage *rup;
sx_assert(&proctree_lock, SA_XLOCKED);
- q = td->td_proc;
PROC_LOCK(p);
switch (idtype) {
@@ -1088,7 +1098,7 @@ proc_to_reap(struct thread *td, struct proc *p, idtype_t idtype, id_t id,
calccru(p, &rup->ru_utime, &rup->ru_stime);
}
- if (p->p_state == PRS_ZOMBIE) {
+ if (p->p_state == PRS_ZOMBIE && !check_only) {
PROC_SLOCK(p);
proc_reap(td, p, status, options);
return (-1);
@@ -1182,7 +1192,7 @@ loop:
sx_xlock(&proctree_lock);
LIST_FOREACH(p, &q->p_children, p_sibling) {
ret = proc_to_reap(td, p, idtype, id, status, options,
- wrusage, siginfo);
+ wrusage, siginfo, 0);
if (ret == 0)
continue;
else if (ret == 1)
@@ -1216,6 +1226,10 @@ loop:
PROC_UNLOCK(q);
}
+ CTR4(KTR_PTRACE,
+ "wait: returning trapped pid %d status %#x (xstat %d) xthread %d",
+ p->p_pid, W_STOPCODE(p->p_xstat), p->p_xstat,
+ p->p_xthread != NULL ? p->p_xthread->td_tid : -1);
PROC_UNLOCK(p);
return (0);
}
@@ -1280,15 +1294,17 @@ loop:
* for. By maintaining a list of orphans we allow the parent
* to successfully wait until the child becomes a zombie.
*/
- LIST_FOREACH(p, &q->p_orphans, p_orphan) {
- ret = proc_to_reap(td, p, idtype, id, status, options,
- wrusage, siginfo);
- if (ret == 0)
- continue;
- else if (ret == 1)
- nfound++;
- else
- return (0);
+ if (nfound == 0) {
+ LIST_FOREACH(p, &q->p_orphans, p_orphan) {
+ ret = proc_to_reap(td, p, idtype, id, NULL, options,
+ NULL, NULL, 1);
+ if (ret != 0) {
+ KASSERT(ret != -1, ("reaped an orphan (pid %d)",
+ (int)td->td_retval[0]));
+ nfound++;
+ break;
+ }
+ }
}
if (nfound == 0) {
sx_xunlock(&proctree_lock);
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 2c7fe2e..3fd4f09 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -496,7 +496,6 @@ do_fork(struct thread *td, int flags, struct proc *p2, struct thread *td2,
p2->p_swtick = ticks;
if (p1->p_flag & P_PROFIL)
startprofclock(p2);
- td2->td_ucred = crhold(p2->p_ucred);
if (flags & RFSIGSHARE) {
p2->p_sigacts = sigacts_hold(p1->p_sigacts);
@@ -526,6 +525,8 @@ do_fork(struct thread *td, int flags, struct proc *p2, struct thread *td2,
*/
lim_fork(p1, p2);
+ thread_cow_get_proc(td2, p2);
+
pstats_fork(p1->p_stats, p2->p_stats);
PROC_UNLOCK(p1);
@@ -911,10 +912,8 @@ fork1(struct thread *td, int flags, int pages, struct proc **procp,
if (error == 0)
ok = chgproccnt(td->td_ucred->cr_ruidinfo, 1, 0);
else {
- PROC_LOCK(p1);
ok = chgproccnt(td->td_ucred->cr_ruidinfo, 1,
- lim_cur(p1, RLIMIT_NPROC));
- PROC_UNLOCK(p1);
+ lim_cur(td, RLIMIT_NPROC));
}
if (ok) {
do_fork(td, flags, newproc, td2, vm2, pdflags);
@@ -1035,6 +1034,9 @@ fork_return(struct thread *td, struct trapframe *frame)
dbg = p->p_pptr->p_pptr;
p->p_flag |= P_TRACED;
p->p_oppid = p->p_pptr->p_pid;
+ CTR2(KTR_PTRACE,
+ "fork_return: attaching to new child pid %d: oppid %d",
+ p->p_pid, p->p_oppid);
proc_reparent(p, dbg);
sx_xunlock(&proctree_lock);
td->td_dbgflags |= TDB_CHILD;
diff --git a/sys/kern/kern_kthread.c b/sys/kern/kern_kthread.c
index ee94de0..863bbc6 100644
--- a/sys/kern/kern_kthread.c
+++ b/sys/kern/kern_kthread.c
@@ -289,7 +289,7 @@ kthread_add(void (*func)(void *), void *arg, struct proc *p,
cpu_set_fork_handler(newtd, func, arg);
newtd->td_pflags |= TDP_KTHREAD;
- newtd->td_ucred = crhold(p->p_ucred);
+ thread_cow_get_proc(newtd, p);
/* this code almost the same as create_thread() in kern_thr.c */
p->p_flag |= P_HADTHREADS;
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c
index ea6f7a6..72fc434 100644
--- a/sys/kern/kern_mutex.c
+++ b/sys/kern/kern_mutex.c
@@ -384,6 +384,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t tid, int opts,
uint64_t spin_cnt = 0;
uint64_t sleep_cnt = 0;
int64_t sleep_time = 0;
+ int64_t all_time = 0;
#endif
if (SCHEDULER_STOPPED())
@@ -414,6 +415,9 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t tid, int opts,
CTR4(KTR_LOCK,
"_mtx_lock_sleep: %s contested (lock=%p) at %s:%d",
m->lock_object.lo_name, (void *)m->mtx_lock, file, line);
+#ifdef KDTRACE_HOOKS
+ all_time -= lockstat_nsecs();
+#endif
while (!_mtx_obtain_lock(m, tid)) {
#ifdef KDTRACE_HOOKS
@@ -517,6 +521,9 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t tid, int opts,
sleep_cnt++;
#endif
}
+#ifdef KDTRACE_HOOKS
+ all_time += lockstat_nsecs();
+#endif
#ifdef KTR
if (cont_logged) {
CTR4(KTR_CONTENTION,
@@ -534,7 +541,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t tid, int opts,
* Only record the loops spinning and not sleeping.
*/
if (spin_cnt > sleep_cnt)
- LOCKSTAT_RECORD1(LS_MTX_LOCK_SPIN, m, (spin_cnt - sleep_cnt));
+ LOCKSTAT_RECORD1(LS_MTX_LOCK_SPIN, m, (all_time - sleep_time));
#endif
}
@@ -574,6 +581,9 @@ _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t tid, int opts,
int contested = 0;
uint64_t waittime = 0;
#endif
+#ifdef KDTRACE_HOOKS
+ int64_t spin_time = 0;
+#endif
if (SCHEDULER_STOPPED())
return;
@@ -589,6 +599,9 @@ _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t tid, int opts,
PMC_SOFT_CALL( , , lock, failed);
#endif
lock_profile_obtain_lock_failed(&m->lock_object, &contested, &waittime);
+#ifdef KDTRACE_HOOKS
+ spin_time -= lockstat_nsecs();
+#endif
while (!_mtx_obtain_lock(m, tid)) {
/* Give interrupts a chance while we spin. */
@@ -606,6 +619,9 @@ _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t tid, int opts,
}
spinlock_enter();
}
+#ifdef KDTRACE_HOOKS
+ spin_time += lockstat_nsecs();
+#endif
if (LOCK_LOG_TEST(&m->lock_object, opts))
CTR1(KTR_LOCK, "_mtx_lock_spin: %p spin done", m);
@@ -614,7 +630,7 @@ _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t tid, int opts,
LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_MTX_SPIN_LOCK_ACQUIRE, m,
contested, waittime, (file), (line));
- LOCKSTAT_RECORD1(LS_MTX_SPIN_LOCK_SPIN, m, i);
+ LOCKSTAT_RECORD1(LS_MTX_SPIN_LOCK_SPIN, m, spin_time);
}
#endif /* SMP */
@@ -629,7 +645,7 @@ thread_lock_flags_(struct thread *td, int opts, const char *file, int line)
uint64_t waittime = 0;
#endif
#ifdef KDTRACE_HOOKS
- uint64_t spin_cnt = 0;
+ int64_t spin_time = 0;
#endif
i = 0;
@@ -638,6 +654,9 @@ thread_lock_flags_(struct thread *td, int opts, const char *file, int line)
if (SCHEDULER_STOPPED())
return;
+#ifdef KDTRACE_HOOKS
+ spin_time -= lockstat_nsecs();
+#endif
for (;;) {
retry:
spinlock_enter();
@@ -654,9 +673,6 @@ retry:
WITNESS_CHECKORDER(&m->lock_object,
opts | LOP_NEWORDER | LOP_EXCLUSIVE, file, line, NULL);
while (!_mtx_obtain_lock(m, tid)) {
-#ifdef KDTRACE_HOOKS
- spin_cnt++;
-#endif
if (m->mtx_lock == tid) {
m->mtx_recurse++;
break;
@@ -685,17 +701,17 @@ retry:
if (m == td->td_lock)
break;
__mtx_unlock_spin(m); /* does spinlock_exit() */
+ }
#ifdef KDTRACE_HOOKS
- spin_cnt++;
+ spin_time += lockstat_nsecs();
#endif
- }
if (m->mtx_recurse == 0)
LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_MTX_SPIN_LOCK_ACQUIRE,
m, contested, waittime, (file), (line));
LOCK_LOG_LOCK("LOCK", &m->lock_object, opts, m->mtx_recurse, file,
line);
WITNESS_LOCK(&m->lock_object, opts | LOP_EXCLUSIVE, file, line);
- LOCKSTAT_RECORD1(LS_THREAD_LOCK_SPIN, m, spin_cnt);
+ LOCKSTAT_RECORD1(LS_THREAD_LOCK_SPIN, m, spin_time);
}
struct mtx *
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index 6618c08..27c6f40 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -2113,7 +2113,15 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_ARGS)
vref(vp);
break;
case OBJT_SWAP:
- kve->kve_type = KVME_TYPE_SWAP;
+ if ((lobj->flags & OBJ_TMPFS_NODE) != 0) {
+ kve->kve_type = KVME_TYPE_VNODE;
+ if ((lobj->flags & OBJ_TMPFS) != 0) {
+ vp = lobj->un_pager.swp.swp_tmpfs;
+ vref(vp);
+ }
+ } else {
+ kve->kve_type = KVME_TYPE_SWAP;
+ }
break;
case OBJT_DEVICE:
kve->kve_type = KVME_TYPE_DEVICE;
@@ -2339,7 +2347,15 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb)
vref(vp);
break;
case OBJT_SWAP:
- kve->kve_type = KVME_TYPE_SWAP;
+ if ((lobj->flags & OBJ_TMPFS_NODE) != 0) {
+ kve->kve_type = KVME_TYPE_VNODE;
+ if ((lobj->flags & OBJ_TMPFS) != 0) {
+ vp = lobj->un_pager.swp.swp_tmpfs;
+ vref(vp);
+ }
+ } else {
+ kve->kve_type = KVME_TYPE_SWAP;
+ }
break;
case OBJT_DEVICE:
kve->kve_type = KVME_TYPE_DEVICE;
@@ -2599,7 +2615,7 @@ sysctl_kern_proc_rlimit(SYSCTL_HANDLER_ARGS)
*/
if (req->oldptr != NULL) {
PROC_LOCK(p);
- lim_rlimit(p, which, &rlim);
+ lim_rlimit_proc(p, which, &rlim);
PROC_UNLOCK(p);
}
error = SYSCTL_OUT(req, &rlim, sizeof(rlim));
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
index 9c49f71..b531763 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -1946,9 +1946,8 @@ cred_update_thread(struct thread *td)
p = td->td_proc;
cred = td->td_ucred;
- PROC_LOCK(p);
+ PROC_LOCK_ASSERT(p, MA_OWNED);
td->td_ucred = crhold(p->p_ucred);
- PROC_UNLOCK(p);
if (cred != NULL)
crfree(cred);
}
@@ -1987,6 +1986,8 @@ proc_set_cred(struct proc *p, struct ucred *newcred)
oldcred = p->p_ucred;
p->p_ucred = newcred;
+ if (newcred != NULL)
+ PROC_UPDATE_COW(p);
return (oldcred);
}
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c
index dac49cd..546f3b2 100644
--- a/sys/kern/kern_resource.c
+++ b/sys/kern/kern_resource.c
@@ -560,15 +560,11 @@ ogetrlimit(struct thread *td, register struct ogetrlimit_args *uap)
{
struct orlimit olim;
struct rlimit rl;
- struct proc *p;
int error;
if (uap->which >= RLIM_NLIMITS)
return (EINVAL);
- p = td->td_proc;
- PROC_LOCK(p);
- lim_rlimit(p, uap->which, &rl);
- PROC_UNLOCK(p);
+ lim_rlimit(td, uap->which, &rl);
/*
* XXX would be more correct to convert only RLIM_INFINITY to the
@@ -625,7 +621,7 @@ lim_cb(void *arg)
}
PROC_STATUNLOCK(p);
if (p->p_rux.rux_runtime > p->p_cpulimit * cpu_tickrate()) {
- lim_rlimit(p, RLIMIT_CPU, &rlim);
+ lim_rlimit_proc(p, RLIMIT_CPU, &rlim);
if (p->p_rux.rux_runtime >= rlim.rlim_max * cpu_tickrate()) {
killproc(p, "exceeded maximum CPU limit");
} else {
@@ -667,29 +663,21 @@ kern_proc_setrlimit(struct thread *td, struct proc *p, u_int which,
limp->rlim_max = RLIM_INFINITY;
oldssiz.rlim_cur = 0;
- newlim = NULL;
+ newlim = lim_alloc();
PROC_LOCK(p);
- if (lim_shared(p->p_limit)) {
- PROC_UNLOCK(p);
- newlim = lim_alloc();
- PROC_LOCK(p);
- }
oldlim = p->p_limit;
alimp = &oldlim->pl_rlimit[which];
if (limp->rlim_cur > alimp->rlim_max ||
limp->rlim_max > alimp->rlim_max)
if ((error = priv_check(td, PRIV_PROC_SETRLIMIT))) {
PROC_UNLOCK(p);
- if (newlim != NULL)
- lim_free(newlim);
+ lim_free(newlim);
return (error);
}
if (limp->rlim_cur > limp->rlim_max)
limp->rlim_cur = limp->rlim_max;
- if (newlim != NULL) {
- lim_copy(newlim, oldlim);
- alimp = &newlim->pl_rlimit[which];
- }
+ lim_copy(newlim, oldlim);
+ alimp = &newlim->pl_rlimit[which];
switch (which) {
@@ -739,11 +727,10 @@ kern_proc_setrlimit(struct thread *td, struct proc *p, u_int which,
if (p->p_sysent->sv_fixlimit != NULL)
p->p_sysent->sv_fixlimit(limp, which);
*alimp = *limp;
- if (newlim != NULL)
- p->p_limit = newlim;
+ p->p_limit = newlim;
+ PROC_UPDATE_COW(p);
PROC_UNLOCK(p);
- if (newlim != NULL)
- lim_free(oldlim);
+ lim_free(oldlim);
if (which == RLIMIT_STACK &&
/*
@@ -793,15 +780,11 @@ int
sys_getrlimit(struct thread *td, register struct __getrlimit_args *uap)
{
struct rlimit rlim;
- struct proc *p;
int error;
if (uap->which >= RLIM_NLIMITS)
return (EINVAL);
- p = td->td_proc;
- PROC_LOCK(p);
- lim_rlimit(p, uap->which, &rlim);
- PROC_UNLOCK(p);
+ lim_rlimit(td, uap->which, &rlim);
error = copyout(&rlim, uap->rlp, sizeof(struct rlimit));
return (error);
}
@@ -1172,11 +1155,20 @@ lim_copy(struct plimit *dst, struct plimit *src)
* which parameter specifies the index into the rlimit array.
*/
rlim_t
-lim_max(struct proc *p, int which)
+lim_max(struct thread *td, int which)
{
struct rlimit rl;
- lim_rlimit(p, which, &rl);
+ lim_rlimit(td, which, &rl);
+ return (rl.rlim_max);
+}
+
+rlim_t
+lim_max_proc(struct proc *p, int which)
+{
+ struct rlimit rl;
+
+ lim_rlimit_proc(p, which, &rl);
return (rl.rlim_max);
}
@@ -1185,11 +1177,20 @@ lim_max(struct proc *p, int which)
* The which parameter which specifies the index into the rlimit array
*/
rlim_t
-lim_cur(struct proc *p, int which)
+lim_cur(struct thread *td, int which)
{
struct rlimit rl;
- lim_rlimit(p, which, &rl);
+ lim_rlimit(td, which, &rl);
+ return (rl.rlim_cur);
+}
+
+rlim_t
+lim_cur_proc(struct proc *p, int which)
+{
+ struct rlimit rl;
+
+ lim_rlimit_proc(p, which, &rl);
return (rl.rlim_cur);
}
@@ -1198,7 +1199,20 @@ lim_cur(struct proc *p, int which)
* specified by 'which' in the rlimit structure pointed to by 'rlp'.
*/
void
-lim_rlimit(struct proc *p, int which, struct rlimit *rlp)
+lim_rlimit(struct thread *td, int which, struct rlimit *rlp)
+{
+ struct proc *p = td->td_proc;
+
+ MPASS(td == curthread);
+ KASSERT(which >= 0 && which < RLIM_NLIMITS,
+ ("request for invalid resource limit"));
+ *rlp = td->td_limit->pl_rlimit[which];
+ if (p->p_sysent->sv_fixlimit != NULL)
+ p->p_sysent->sv_fixlimit(rlp, which);
+}
+
+void
+lim_rlimit_proc(struct proc *p, int which, struct rlimit *rlp)
{
PROC_LOCK_ASSERT(p, MA_OWNED);
@@ -1441,3 +1455,17 @@ chgkqcnt(struct uidinfo *uip, int diff, rlim_t max)
}
return (1);
}
+
+void
+lim_update_thread(struct thread *td)
+{
+ struct proc *p;
+ struct plimit *lim;
+
+ p = td->td_proc;
+ lim = td->td_limit;
+ PROC_LOCK_ASSERT(p, MA_OWNED);
+ td->td_limit = lim_hold(p->p_limit);
+ if (lim != NULL)
+ lim_free(lim);
+}
diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c
index d3cfbdd..f75912b 100644
--- a/sys/kern/kern_rwlock.c
+++ b/sys/kern/kern_rwlock.c
@@ -300,6 +300,9 @@ __rw_try_wlock(volatile uintptr_t *c, const char *file, int line)
if (rval) {
WITNESS_LOCK(&rw->lock_object, LOP_EXCLUSIVE | LOP_TRYLOCK,
file, line);
+ if (!rw_recursed(rw))
+ LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_RW_WLOCK_ACQUIRE,
+ rw, 0, 0, file, line);
curthread->td_locks++;
}
return (rval);
@@ -352,9 +355,11 @@ __rw_rlock(volatile uintptr_t *c, const char *file, int line)
#endif
uintptr_t v;
#ifdef KDTRACE_HOOKS
+ uintptr_t state;
uint64_t spin_cnt = 0;
uint64_t sleep_cnt = 0;
int64_t sleep_time = 0;
+ int64_t all_time = 0;
#endif
if (SCHEDULER_STOPPED())
@@ -372,6 +377,10 @@ __rw_rlock(volatile uintptr_t *c, const char *file, int line)
rw->lock_object.lo_name, file, line));
WITNESS_CHECKORDER(&rw->lock_object, LOP_NEWORDER, file, line, NULL);
+#ifdef KDTRACE_HOOKS
+ all_time -= lockstat_nsecs();
+ state = rw->rw_lock;
+#endif
for (;;) {
#ifdef KDTRACE_HOOKS
spin_cnt++;
@@ -534,7 +543,19 @@ __rw_rlock(volatile uintptr_t *c, const char *file, int line)
CTR2(KTR_LOCK, "%s: %p resuming from turnstile",
__func__, rw);
}
+#ifdef KDTRACE_HOOKS
+ all_time += lockstat_nsecs();
+ if (sleep_time)
+ LOCKSTAT_RECORD4(LS_RW_RLOCK_BLOCK, rw, sleep_time,
+ LOCKSTAT_READER, (state & RW_LOCK_READ) == 0,
+ (state & RW_LOCK_READ) == 0 ? 0 : RW_READERS(state));
+ /* Record only the loops spinning and not sleeping. */
+ if (spin_cnt > sleep_cnt)
+ LOCKSTAT_RECORD4(LS_RW_RLOCK_SPIN, rw, all_time - sleep_time,
+ LOCKSTAT_READER, (state & RW_LOCK_READ) == 0,
+ (state & RW_LOCK_READ) == 0 ? 0 : RW_READERS(state));
+#endif
/*
* TODO: acquire "owner of record" here. Here be turnstile dragons
* however. turnstiles don't like owners changing between calls to
@@ -546,16 +567,6 @@ __rw_rlock(volatile uintptr_t *c, const char *file, int line)
WITNESS_LOCK(&rw->lock_object, 0, file, line);
curthread->td_locks++;
curthread->td_rw_rlocks++;
-#ifdef KDTRACE_HOOKS
- if (sleep_time)
- LOCKSTAT_RECORD1(LS_RW_RLOCK_BLOCK, rw, sleep_time);
-
- /*
- * Record only the loops spinning and not sleeping.
- */
- if (spin_cnt > sleep_cnt)
- LOCKSTAT_RECORD1(LS_RW_RLOCK_SPIN, rw, (spin_cnt - sleep_cnt));
-#endif
}
int
@@ -583,6 +594,8 @@ __rw_try_rlock(volatile uintptr_t *c, const char *file, int line)
LOCK_LOG_TRY("RLOCK", &rw->lock_object, 0, 1, file,
line);
WITNESS_LOCK(&rw->lock_object, LOP_TRYLOCK, file, line);
+ LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_RW_RLOCK_ACQUIRE,
+ rw, 0, 0, file, line);
curthread->td_locks++;
curthread->td_rw_rlocks++;
return (1);
@@ -727,9 +740,11 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t tid, const char *file,
int contested = 0;
#endif
#ifdef KDTRACE_HOOKS
+ uintptr_t state;
uint64_t spin_cnt = 0;
uint64_t sleep_cnt = 0;
int64_t sleep_time = 0;
+ int64_t all_time = 0;
#endif
if (SCHEDULER_STOPPED())
@@ -751,6 +766,10 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t tid, const char *file,
CTR5(KTR_LOCK, "%s: %s contested (lock=%p) at %s:%d", __func__,
rw->lock_object.lo_name, (void *)rw->rw_lock, file, line);
+#ifdef KDTRACE_HOOKS
+ all_time -= lockstat_nsecs();
+ state = rw->rw_lock;
+#endif
while (!_rw_write_lock(rw, tid)) {
#ifdef KDTRACE_HOOKS
spin_cnt++;
@@ -888,18 +907,21 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t tid, const char *file,
spintries = 0;
#endif
}
- LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_RW_WLOCK_ACQUIRE, rw, contested,
- waittime, file, line);
#ifdef KDTRACE_HOOKS
+ all_time += lockstat_nsecs();
if (sleep_time)
- LOCKSTAT_RECORD1(LS_RW_WLOCK_BLOCK, rw, sleep_time);
+ LOCKSTAT_RECORD4(LS_RW_WLOCK_BLOCK, rw, sleep_time,
+ LOCKSTAT_WRITER, (state & RW_LOCK_READ) == 0,
+ (state & RW_LOCK_READ) == 0 ? 0 : RW_READERS(state));
- /*
- * Record only the loops spinning and not sleeping.
- */
+ /* Record only the loops spinning and not sleeping. */
if (spin_cnt > sleep_cnt)
- LOCKSTAT_RECORD1(LS_RW_WLOCK_SPIN, rw, (spin_cnt - sleep_cnt));
+ LOCKSTAT_RECORD4(LS_RW_WLOCK_SPIN, rw, all_time - sleep_time,
+ LOCKSTAT_READER, (state & RW_LOCK_READ) == 0,
+ (state & RW_LOCK_READ) == 0 ? 0 : RW_READERS(state));
#endif
+ LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_RW_WLOCK_ACQUIRE, rw, contested,
+ waittime, file, line);
}
/*
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 154c250..b70da5b 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -2368,9 +2368,12 @@ tdsigwakeup(struct thread *td, int sig, sig_t action, int intrval)
thread_lock(td);
/*
* Bring the priority of a thread up if we want it to get
- * killed in this lifetime.
+ * killed in this lifetime. Be careful to avoid bumping the
+ * priority of the idle thread, since we still allow to signal
+ * kernel processes.
*/
- if (action == SIG_DFL && (prop & SA_KILL) && td->td_priority > PUSER)
+ if (action == SIG_DFL && (prop & SA_KILL) != 0 &&
+ td->td_priority > PUSER && !TD_IS_IDLETHREAD(td))
sched_prio(td, PUSER);
if (TD_ON_SLEEPQ(td)) {
/*
@@ -2408,7 +2411,7 @@ tdsigwakeup(struct thread *td, int sig, sig_t action, int intrval)
/*
* Give low priority threads a better chance to run.
*/
- if (td->td_priority > PUSER)
+ if (td->td_priority > PUSER && !TD_IS_IDLETHREAD(td))
sched_prio(td, PUSER);
wakeup_swapper = sleepq_abort(td, intrval);
@@ -2478,6 +2481,8 @@ ptracestop(struct thread *td, int sig)
td->td_dbgflags |= TDB_XSIG;
td->td_xsig = sig;
+ CTR4(KTR_PTRACE, "ptracestop: tid %d (pid %d) flags %#x sig %d",
+ td->td_tid, p->p_pid, td->td_dbgflags, sig);
PROC_SLOCK(p);
while ((p->p_flag & P_TRACED) && (td->td_dbgflags & TDB_XSIG)) {
if (p->p_flag & P_SINGLE_EXIT) {
@@ -3304,7 +3309,7 @@ coredump(struct thread *td)
* a corefile is truncated instead of not being created,
* if it is larger than the limit.
*/
- limit = (off_t)lim_cur(p, RLIMIT_CORE);
+ limit = (off_t)lim_cur(td, RLIMIT_CORE);
if (limit == 0 || racct_get_available(p, RACCT_CORE) == 0) {
PROC_UNLOCK(p);
return (EFBIG);
diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c
index a986590..91e8c60 100644
--- a/sys/kern/kern_sx.c
+++ b/sys/kern/kern_sx.c
@@ -288,6 +288,8 @@ sx_try_slock_(struct sx *sx, const char *file, int line)
if (atomic_cmpset_acq_ptr(&sx->sx_lock, x, x + SX_ONE_SHARER)) {
LOCK_LOG_TRY("SLOCK", &sx->lock_object, 0, 1, file, line);
WITNESS_LOCK(&sx->lock_object, LOP_TRYLOCK, file, line);
+ LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_SX_SLOCK_ACQUIRE,
+ sx, 0, 0, file, line);
curthread->td_locks++;
return (1);
}
@@ -348,6 +350,9 @@ sx_try_xlock_(struct sx *sx, const char *file, int line)
if (rval) {
WITNESS_LOCK(&sx->lock_object, LOP_EXCLUSIVE | LOP_TRYLOCK,
file, line);
+ if (!sx_recursed(sx))
+ LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_SX_XLOCK_ACQUIRE,
+ sx, 0, 0, file, line);
curthread->td_locks++;
}
@@ -509,9 +514,11 @@ _sx_xlock_hard(struct sx *sx, uintptr_t tid, int opts, const char *file,
#endif
int error = 0;
#ifdef KDTRACE_HOOKS
+ uintptr_t state;
uint64_t spin_cnt = 0;
uint64_t sleep_cnt = 0;
int64_t sleep_time = 0;
+ int64_t all_time = 0;
#endif
if (SCHEDULER_STOPPED())
@@ -533,6 +540,10 @@ _sx_xlock_hard(struct sx *sx, uintptr_t tid, int opts, const char *file,
CTR5(KTR_LOCK, "%s: %s contested (lock=%p) at %s:%d", __func__,
sx->lock_object.lo_name, (void *)sx->sx_lock, file, line);
+#ifdef KDTRACE_HOOKS
+ all_time -= lockstat_nsecs();
+ state = sx->sx_lock;
+#endif
while (!atomic_cmpset_acq_ptr(&sx->sx_lock, SX_LOCK_UNLOCKED, tid)) {
#ifdef KDTRACE_HOOKS
spin_cnt++;
@@ -705,17 +716,21 @@ _sx_xlock_hard(struct sx *sx, uintptr_t tid, int opts, const char *file,
CTR2(KTR_LOCK, "%s: %p resuming from sleep queue",
__func__, sx);
}
-
- GIANT_RESTORE();
- if (!error)
- LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_SX_XLOCK_ACQUIRE, sx,
- contested, waittime, file, line);
#ifdef KDTRACE_HOOKS
+ all_time += lockstat_nsecs();
if (sleep_time)
- LOCKSTAT_RECORD1(LS_SX_XLOCK_BLOCK, sx, sleep_time);
+ LOCKSTAT_RECORD4(LS_SX_XLOCK_BLOCK, sx, sleep_time,
+ LOCKSTAT_WRITER, (state & SX_LOCK_SHARED) == 0,
+ (state & SX_LOCK_SHARED) == 0 ? 0 : SX_SHARERS(state));
if (spin_cnt > sleep_cnt)
- LOCKSTAT_RECORD1(LS_SX_XLOCK_SPIN, sx, (spin_cnt - sleep_cnt));
+ LOCKSTAT_RECORD4(LS_SX_XLOCK_SPIN, sx, all_time - sleep_time,
+ LOCKSTAT_WRITER, (state & SX_LOCK_SHARED) == 0,
+ (state & SX_LOCK_SHARED) == 0 ? 0 : SX_SHARERS(state));
#endif
+ if (!error)
+ LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_SX_XLOCK_ACQUIRE, sx,
+ contested, waittime, file, line);
+ GIANT_RESTORE();
return (error);
}
@@ -801,14 +816,21 @@ _sx_slock_hard(struct sx *sx, int opts, const char *file, int line)
uintptr_t x;
int error = 0;
#ifdef KDTRACE_HOOKS
+ uintptr_t state;
uint64_t spin_cnt = 0;
uint64_t sleep_cnt = 0;
int64_t sleep_time = 0;
+ int64_t all_time = 0;
#endif
if (SCHEDULER_STOPPED())
return (0);
+#ifdef KDTRACE_HOOKS
+ state = sx->sx_lock;
+ all_time -= lockstat_nsecs();
+#endif
+
/*
* As with rwlocks, we don't make any attempt to try to block
* shared locks once there is an exclusive waiter.
@@ -958,15 +980,20 @@ _sx_slock_hard(struct sx *sx, int opts, const char *file, int line)
CTR2(KTR_LOCK, "%s: %p resuming from sleep queue",
__func__, sx);
}
- if (error == 0)
- LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_SX_SLOCK_ACQUIRE, sx,
- contested, waittime, file, line);
#ifdef KDTRACE_HOOKS
+ all_time += lockstat_nsecs();
if (sleep_time)
- LOCKSTAT_RECORD1(LS_SX_XLOCK_BLOCK, sx, sleep_time);
+ LOCKSTAT_RECORD4(LS_SX_SLOCK_BLOCK, sx, sleep_time,
+ LOCKSTAT_READER, (state & SX_LOCK_SHARED) == 0,
+ (state & SX_LOCK_SHARED) == 0 ? 0 : SX_SHARERS(state));
if (spin_cnt > sleep_cnt)
- LOCKSTAT_RECORD1(LS_SX_XLOCK_SPIN, sx, (spin_cnt - sleep_cnt));
+ LOCKSTAT_RECORD4(LS_SX_SLOCK_SPIN, sx, all_time - sleep_time,
+ LOCKSTAT_READER, (state & SX_LOCK_SHARED) == 0,
+ (state & SX_LOCK_SHARED) == 0 ? 0 : SX_SHARERS(state));
#endif
+ if (error == 0)
+ LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_SX_SLOCK_ACQUIRE, sx,
+ contested, waittime, file, line);
GIANT_RESTORE();
return (error);
}
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index e0ee2dc..8c84773 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -414,11 +414,9 @@ mi_switch(int flags, struct thread *newtd)
{
uint64_t runtime, new_switchtime;
struct thread *td;
- struct proc *p;
td = curthread; /* XXX */
THREAD_LOCK_ASSERT(td, MA_OWNED | MA_NOTRECURSED);
- p = td->td_proc; /* XXX */
KASSERT(!TD_ON_RUNQ(td), ("mi_switch: called by old code"));
#ifdef INVARIANTS
if (!TD_ON_LOCK(td) && !TD_IS_RUNNING(td))
@@ -458,7 +456,7 @@ mi_switch(int flags, struct thread *newtd)
PCPU_INC(cnt.v_swtch);
PCPU_SET(switchticks, ticks);
CTR4(KTR_PROC, "mi_switch: old thread %ld (td_sched %p, pid %ld, %s)",
- td->td_tid, td->td_sched, p->p_pid, td->td_name);
+ td->td_tid, td->td_sched, td->td_proc->p_pid, td->td_name);
#if (KTR_COMPILE & KTR_SCHED) != 0
if (TD_IS_IDLETHREAD(td))
KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "idle",
@@ -474,7 +472,7 @@ mi_switch(int flags, struct thread *newtd)
"prio:%d", td->td_priority);
CTR4(KTR_PROC, "mi_switch: new thread %ld (td_sched %p, pid %ld, %s)",
- td->td_tid, td->td_sched, p->p_pid, td->td_name);
+ td->td_tid, td->td_sched, td->td_proc->p_pid, td->td_name);
/*
* If the last thread was exiting, finish cleaning it up.
diff --git a/sys/kern/kern_syscalls.c b/sys/kern/kern_syscalls.c
index dada746..15574be 100644
--- a/sys/kern/kern_syscalls.c
+++ b/sys/kern/kern_syscalls.c
@@ -31,6 +31,9 @@ __FBSDID("$FreeBSD$");
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/module.h>
+#include <sys/mutex.h>
+#include <sys/proc.h>
+#include <sys/resourcevar.h>
#include <sys/sx.h>
#include <sys/syscall.h>
#include <sys/sysent.h>
diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c
index 9dca0e8..eba0b60 100644
--- a/sys/kern/kern_tc.c
+++ b/sys/kern/kern_tc.c
@@ -71,7 +71,7 @@ struct timehands {
struct timeval th_microtime;
struct timespec th_nanotime;
/* Fields not to be copied in tc_windup start with th_generation. */
- volatile u_int th_generation;
+ u_int th_generation;
struct timehands *th_next;
};
@@ -189,6 +189,33 @@ tc_delta(struct timehands *th)
tc->tc_counter_mask);
}
+static inline u_int
+tc_getgen(struct timehands *th)
+{
+
+#ifdef SMP
+ return (atomic_load_acq_int(&th->th_generation));
+#else
+ u_int gen;
+
+ gen = th->th_generation;
+ __compiler_membar();
+ return (gen);
+#endif
+}
+
+static inline void
+tc_setgen(struct timehands *th, u_int newgen)
+{
+
+#ifdef SMP
+ atomic_store_rel_int(&th->th_generation, newgen);
+#else
+ __compiler_membar();
+ th->th_generation = newgen;
+#endif
+}
+
/*
* Functions for reading the time. We have to loop until we are sure that
* the timehands that we operated on was not updated under our feet. See
@@ -204,10 +231,10 @@ fbclock_binuptime(struct bintime *bt)
do {
th = timehands;
- gen = th->th_generation;
+ gen = tc_getgen(th);
*bt = th->th_offset;
bintime_addx(bt, th->th_scale * tc_delta(th));
- } while (gen == 0 || gen != th->th_generation);
+ } while (gen == 0 || gen != tc_getgen(th));
}
void
@@ -262,9 +289,9 @@ fbclock_getbinuptime(struct bintime *bt)
do {
th = timehands;
- gen = th->th_generation;
+ gen = tc_getgen(th);
*bt = th->th_offset;
- } while (gen == 0 || gen != th->th_generation);
+ } while (gen == 0 || gen != tc_getgen(th));
}
void
@@ -275,9 +302,9 @@ fbclock_getnanouptime(struct timespec *tsp)
do {
th = timehands;
- gen = th->th_generation;
+ gen = tc_getgen(th);
bintime2timespec(&th->th_offset, tsp);
- } while (gen == 0 || gen != th->th_generation);
+ } while (gen == 0 || gen != tc_getgen(th));
}
void
@@ -288,9 +315,9 @@ fbclock_getmicrouptime(struct timeval *tvp)
do {
th = timehands;
- gen = th->th_generation;
+ gen = tc_getgen(th);
bintime2timeval(&th->th_offset, tvp);
- } while (gen == 0 || gen != th->th_generation);
+ } while (gen == 0 || gen != tc_getgen(th));
}
void
@@ -301,9 +328,9 @@ fbclock_getbintime(struct bintime *bt)
do {
th = timehands;
- gen = th->th_generation;
+ gen = tc_getgen(th);
*bt = th->th_offset;
- } while (gen == 0 || gen != th->th_generation);
+ } while (gen == 0 || gen != tc_getgen(th));
bintime_add(bt, &boottimebin);
}
@@ -315,9 +342,9 @@ fbclock_getnanotime(struct timespec *tsp)
do {
th = timehands;
- gen = th->th_generation;
+ gen = tc_getgen(th);
*tsp = th->th_nanotime;
- } while (gen == 0 || gen != th->th_generation);
+ } while (gen == 0 || gen != tc_getgen(th));
}
void
@@ -328,9 +355,9 @@ fbclock_getmicrotime(struct timeval *tvp)
do {
th = timehands;
- gen = th->th_generation;
+ gen = tc_getgen(th);
*tvp = th->th_microtime;
- } while (gen == 0 || gen != th->th_generation);
+ } while (gen == 0 || gen != tc_getgen(th));
}
#else /* !FFCLOCK */
void
@@ -341,10 +368,10 @@ binuptime(struct bintime *bt)
do {
th = timehands;
- gen = th->th_generation;
+ gen = tc_getgen(th);
*bt = th->th_offset;
bintime_addx(bt, th->th_scale * tc_delta(th));
- } while (gen == 0 || gen != th->th_generation);
+ } while (gen == 0 || gen != tc_getgen(th));
}
void
@@ -399,9 +426,9 @@ getbinuptime(struct bintime *bt)
do {
th = timehands;
- gen = th->th_generation;
+ gen = tc_getgen(th);
*bt = th->th_offset;
- } while (gen == 0 || gen != th->th_generation);
+ } while (gen == 0 || gen != tc_getgen(th));
}
void
@@ -412,9 +439,9 @@ getnanouptime(struct timespec *tsp)
do {
th = timehands;
- gen = th->th_generation;
+ gen = tc_getgen(th);
bintime2timespec(&th->th_offset, tsp);
- } while (gen == 0 || gen != th->th_generation);
+ } while (gen == 0 || gen != tc_getgen(th));
}
void
@@ -425,9 +452,9 @@ getmicrouptime(struct timeval *tvp)
do {
th = timehands;
- gen = th->th_generation;
+ gen = tc_getgen(th);
bintime2timeval(&th->th_offset, tvp);
- } while (gen == 0 || gen != th->th_generation);
+ } while (gen == 0 || gen != tc_getgen(th));
}
void
@@ -438,9 +465,9 @@ getbintime(struct bintime *bt)
do {
th = timehands;
- gen = th->th_generation;
+ gen = tc_getgen(th);
*bt = th->th_offset;
- } while (gen == 0 || gen != th->th_generation);
+ } while (gen == 0 || gen != tc_getgen(th));
bintime_add(bt, &boottimebin);
}
@@ -452,9 +479,9 @@ getnanotime(struct timespec *tsp)
do {
th = timehands;
- gen = th->th_generation;
+ gen = tc_getgen(th);
*tsp = th->th_nanotime;
- } while (gen == 0 || gen != th->th_generation);
+ } while (gen == 0 || gen != tc_getgen(th));
}
void
@@ -465,9 +492,9 @@ getmicrotime(struct timeval *tvp)
do {
th = timehands;
- gen = th->th_generation;
+ gen = tc_getgen(th);
*tvp = th->th_microtime;
- } while (gen == 0 || gen != th->th_generation);
+ } while (gen == 0 || gen != tc_getgen(th));
}
#endif /* FFCLOCK */
@@ -880,11 +907,11 @@ ffclock_read_counter(ffcounter *ffcount)
*/
do {
th = timehands;
- gen = th->th_generation;
+ gen = tc_getgen(th);
ffth = fftimehands;
delta = tc_delta(th);
*ffcount = ffth->tick_ffcount;
- } while (gen == 0 || gen != th->th_generation);
+ } while (gen == 0 || gen != tc_getgen(th));
*ffcount += delta;
}
@@ -988,9 +1015,9 @@ dtrace_getnanotime(struct timespec *tsp)
do {
th = timehands;
- gen = th->th_generation;
+ gen = tc_getgen(th);
*tsp = th->th_nanotime;
- } while (gen == 0 || gen != th->th_generation);
+ } while (gen == 0 || gen != tc_getgen(th));
}
/*
@@ -1028,7 +1055,7 @@ sysclock_getsnapshot(struct sysclock_snap *clock_snap, int fast)
do {
th = timehands;
- gen = th->th_generation;
+ gen = tc_getgen(th);
fbi->th_scale = th->th_scale;
fbi->tick_time = th->th_offset;
#ifdef FFCLOCK
@@ -1042,7 +1069,7 @@ sysclock_getsnapshot(struct sysclock_snap *clock_snap, int fast)
#endif
if (!fast)
delta = tc_delta(th);
- } while (gen == 0 || gen != th->th_generation);
+ } while (gen == 0 || gen != tc_getgen(th));
clock_snap->delta = delta;
clock_snap->sysclock_active = sysclock_active;
@@ -1260,7 +1287,7 @@ tc_windup(void)
tho = timehands;
th = tho->th_next;
ogen = th->th_generation;
- th->th_generation = 0;
+ tc_setgen(th, 0);
bcopy(tho, th, offsetof(struct timehands, th_generation));
/*
@@ -1377,7 +1404,7 @@ tc_windup(void)
*/
if (++ogen == 0)
ogen = 1;
- th->th_generation = ogen;
+ tc_setgen(th, ogen);
/* Go live with the new struct timehands. */
#ifdef FFCLOCK
@@ -1651,13 +1678,13 @@ pps_capture(struct pps_state *pps)
KASSERT(pps != NULL, ("NULL pps pointer in pps_capture"));
th = timehands;
- pps->capgen = th->th_generation;
+ pps->capgen = tc_getgen(th);
pps->capth = th;
#ifdef FFCLOCK
pps->capffth = fftimehands;
#endif
pps->capcount = th->th_counter->tc_get_timecount(th->th_counter);
- if (pps->capgen != th->th_generation)
+ if (pps->capgen != tc_getgen(th))
pps->capgen = 0;
}
@@ -1677,7 +1704,7 @@ pps_event(struct pps_state *pps, int event)
KASSERT(pps != NULL, ("NULL pps pointer in pps_event"));
/* If the timecounter was wound up underneath us, bail out. */
- if (pps->capgen == 0 || pps->capgen != pps->capth->th_generation)
+ if (pps->capgen == 0 || pps->capgen != tc_getgen(pps->capth))
return;
/* Things would be easier with arrays. */
@@ -1727,7 +1754,7 @@ pps_event(struct pps_state *pps, int event)
bintime2timespec(&bt, &ts);
/* If the timecounter was wound up underneath us, bail out. */
- if (pps->capgen != pps->capth->th_generation)
+ if (pps->capgen != tc_getgen(pps->capth))
return;
*pcount = pps->capcount;
diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c
index 6911bb97..e6b0a59 100644
--- a/sys/kern/kern_thr.c
+++ b/sys/kern/kern_thr.c
@@ -162,12 +162,6 @@ create_thread(struct thread *td, mcontext_t *ctx,
p = td->td_proc;
- /* Have race condition but it is cheap. */
- if (p->p_numthreads >= max_threads_per_proc) {
- ++max_threads_hits;
- return (EPROCLIM);
- }
-
if (rtp != NULL) {
switch(rtp->type) {
case RTP_PRIO_REALTIME:
@@ -197,11 +191,9 @@ create_thread(struct thread *td, mcontext_t *ctx,
#endif
/* Initialize our td */
- newtd = thread_alloc(0);
- if (newtd == NULL) {
- error = ENOMEM;
+ error = kern_thr_alloc(p, 0, &newtd);
+ if (error)
goto fail;
- }
cpu_set_upcall(newtd, td);
@@ -228,13 +220,13 @@ create_thread(struct thread *td, mcontext_t *ctx,
bcopy(&td->td_startcopy, &newtd->td_startcopy,
__rangeof(struct thread, td_startcopy, td_endcopy));
newtd->td_proc = td->td_proc;
- newtd->td_ucred = crhold(td->td_ucred);
+ thread_cow_get(newtd, td);
if (ctx != NULL) { /* old way to set user context */
error = set_mcontext(newtd, ctx);
if (error != 0) {
+ thread_cow_free(newtd);
thread_free(newtd);
- crfree(td->td_ucred);
goto fail;
}
} else {
@@ -246,8 +238,8 @@ create_thread(struct thread *td, mcontext_t *ctx,
/* Setup user TLS address and TLS pointer register. */
error = cpu_set_user_tls(newtd, tls_base);
if (error != 0) {
+ thread_cow_free(newtd);
thread_free(newtd);
- crfree(td->td_ucred);
goto fail;
}
}
@@ -307,9 +299,6 @@ int
sys_thr_exit(struct thread *td, struct thr_exit_args *uap)
/* long *state */
{
- struct proc *p;
-
- p = td->td_proc;
/* Signal userland that it can free the stack. */
if ((void *)uap->state != NULL) {
@@ -317,8 +306,17 @@ sys_thr_exit(struct thread *td, struct thr_exit_args *uap)
kern_umtx_wake(td, uap->state, INT_MAX, 0);
}
- rw_wlock(&tidhash_lock);
+ return (kern_thr_exit(td));
+}
+
+int
+kern_thr_exit(struct thread *td)
+{
+ struct proc *p;
+ p = td->td_proc;
+
+ rw_wlock(&tidhash_lock);
PROC_LOCK(p);
if (p->p_numthreads != 1) {
@@ -560,3 +558,20 @@ sys_thr_set_name(struct thread *td, struct thr_set_name_args *uap)
PROC_UNLOCK(p);
return (error);
}
+
+int
+kern_thr_alloc(struct proc *p, int pages, struct thread **ntd)
+{
+
+ /* Have race condition but it is cheap. */
+ if (p->p_numthreads >= max_threads_per_proc) {
+ ++max_threads_hits;
+ return (EPROCLIM);
+ }
+
+ *ntd = thread_alloc(pages);
+ if (*ntd == NULL)
+ return (ENOMEM);
+
+ return (0);
+}
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
index 0dd5f46..4343b64 100644
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
#include <sys/sched.h>
#include <sys/sleepqueue.h>
#include <sys/selinfo.h>
+#include <sys/sysent.h>
#include <sys/turnstile.h>
#include <sys/ktr.h>
#include <sys/rwlock.h>
@@ -326,8 +327,7 @@ thread_reap(void)
mtx_unlock_spin(&zombie_lock);
while (td_first) {
td_next = TAILQ_NEXT(td_first, td_slpq);
- if (td_first->td_ucred)
- crfree(td_first->td_ucred);
+ thread_cow_free(td_first);
thread_free(td_first);
td_first = td_next;
}
@@ -383,6 +383,50 @@ thread_free(struct thread *td)
uma_zfree(thread_zone, td);
}
+void
+thread_cow_get_proc(struct thread *newtd, struct proc *p)
+{
+
+ PROC_LOCK_ASSERT(p, MA_OWNED);
+ newtd->td_ucred = crhold(p->p_ucred);
+ newtd->td_limit = lim_hold(p->p_limit);
+ newtd->td_cowgen = p->p_cowgen;
+}
+
+void
+thread_cow_get(struct thread *newtd, struct thread *td)
+{
+
+ newtd->td_ucred = crhold(td->td_ucred);
+ newtd->td_limit = lim_hold(td->td_limit);
+ newtd->td_cowgen = td->td_cowgen;
+}
+
+void
+thread_cow_free(struct thread *td)
+{
+
+ if (td->td_ucred)
+ crfree(td->td_ucred);
+ if (td->td_limit)
+ lim_free(td->td_limit);
+}
+
+void
+thread_cow_update(struct thread *td)
+{
+ struct proc *p;
+
+ p = td->td_proc;
+ PROC_LOCK(p);
+ if (td->td_ucred != p->p_ucred)
+ cred_update_thread(td);
+ if (td->td_limit != p->p_limit)
+ lim_update_thread(td);
+ td->td_cowgen = p->p_cowgen;
+ PROC_UNLOCK(p);
+}
+
/*
* Discard the current thread and exit from its context.
* Always called with scheduler locked.
@@ -520,7 +564,7 @@ thread_wait(struct proc *p)
cpuset_rel(td->td_cpuset);
td->td_cpuset = NULL;
cpu_thread_clean(td);
- crfree(td->td_ucred);
+ thread_cow_free(td);
thread_reap(); /* check for zombie threads etc. */
}
@@ -884,6 +928,14 @@ thread_suspend_check(int return_instead)
if ((p->p_flag & P_SINGLE_EXIT) && (p->p_singlethread != td)) {
PROC_UNLOCK(p);
tidhash_remove(td);
+
+ /*
+ * Allow Linux emulation layer to do some work
+ * before thread suicide.
+ */
+ if (__predict_false(p->p_sysent->sv_thread_detach != NULL))
+ (p->p_sysent->sv_thread_detach)(td);
+
PROC_LOCK(p);
tdsigcleanup(td);
umtx_thread_exit(td);
diff --git a/sys/kern/p1003_1b.c b/sys/kern/p1003_1b.c
index fb89efc..ac6cd60 100644
--- a/sys/kern/p1003_1b.c
+++ b/sys/kern/p1003_1b.c
@@ -130,16 +130,29 @@ sys_sched_setparam(struct thread *td, struct sched_setparam_args *uap)
targettd = FIRST_THREAD_IN_PROC(targetp);
}
- e = p_cansched(td, targetp);
- if (e == 0) {
- e = ksched_setparam(ksched, targettd,
- (const struct sched_param *)&sched_param);
- }
+ e = kern_sched_setparam(td, targettd, &sched_param);
PROC_UNLOCK(targetp);
return (e);
}
int
+kern_sched_setparam(struct thread *td, struct thread *targettd,
+ struct sched_param *param)
+{
+ struct proc *targetp;
+ int error;
+
+ targetp = targettd->td_proc;
+ PROC_LOCK_ASSERT(targetp, MA_OWNED);
+
+ error = p_cansched(td, targetp);
+ if (error == 0)
+ error = ksched_setparam(ksched, targettd,
+ (const struct sched_param *)param);
+ return (error);
+}
+
+int
sys_sched_getparam(struct thread *td, struct sched_getparam_args *uap)
{
int e;
@@ -159,10 +172,7 @@ sys_sched_getparam(struct thread *td, struct sched_getparam_args *uap)
targettd = FIRST_THREAD_IN_PROC(targetp);
}
- e = p_cansee(td, targetp);
- if (e == 0) {
- e = ksched_getparam(ksched, targettd, &sched_param);
- }
+ e = kern_sched_getparam(td, targettd, &sched_param);
PROC_UNLOCK(targetp);
if (e == 0)
e = copyout(&sched_param, uap->param, sizeof(sched_param));
@@ -170,6 +180,22 @@ sys_sched_getparam(struct thread *td, struct sched_getparam_args *uap)
}
int
+kern_sched_getparam(struct thread *td, struct thread *targettd,
+ struct sched_param *param)
+{
+ struct proc *targetp;
+ int error;
+
+ targetp = targettd->td_proc;
+ PROC_LOCK_ASSERT(targetp, MA_OWNED);
+
+ error = p_cansee(td, targetp);
+ if (error == 0)
+ error = ksched_getparam(ksched, targettd, param);
+ return (error);
+}
+
+int
sys_sched_setscheduler(struct thread *td, struct sched_setscheduler_args *uap)
{
int e;
@@ -177,11 +203,6 @@ sys_sched_setscheduler(struct thread *td, struct sched_setscheduler_args *uap)
struct thread *targettd;
struct proc *targetp;
- /* Don't allow non root user to set a scheduler policy. */
- e = priv_check(td, PRIV_SCHED_SET);
- if (e)
- return (e);
-
e = copyin(uap->param, &sched_param, sizeof(sched_param));
if (e)
return (e);
@@ -197,16 +218,35 @@ sys_sched_setscheduler(struct thread *td, struct sched_setscheduler_args *uap)
targettd = FIRST_THREAD_IN_PROC(targetp);
}
- e = p_cansched(td, targetp);
- if (e == 0) {
- e = ksched_setscheduler(ksched, targettd,
- uap->policy, (const struct sched_param *)&sched_param);
- }
+ e = kern_sched_setscheduler(td, targettd, uap->policy,
+ &sched_param);
PROC_UNLOCK(targetp);
return (e);
}
int
+kern_sched_setscheduler(struct thread *td, struct thread *targettd,
+ int policy, struct sched_param *param)
+{
+ struct proc *targetp;
+ int error;
+
+ targetp = targettd->td_proc;
+ PROC_LOCK_ASSERT(targetp, MA_OWNED);
+
+ /* Don't allow non root user to set a scheduler policy. */
+ error = priv_check(td, PRIV_SCHED_SET);
+ if (error)
+ return (error);
+
+ error = p_cansched(td, targetp);
+ if (error == 0)
+ error = ksched_setscheduler(ksched, targettd, policy,
+ (const struct sched_param *)param);
+ return (error);
+}
+
+int
sys_sched_getscheduler(struct thread *td, struct sched_getscheduler_args *uap)
{
int e, policy;
@@ -224,17 +264,31 @@ sys_sched_getscheduler(struct thread *td, struct sched_getscheduler_args *uap)
targettd = FIRST_THREAD_IN_PROC(targetp);
}
- e = p_cansee(td, targetp);
- if (e == 0) {
- e = ksched_getscheduler(ksched, targettd, &policy);
- td->td_retval[0] = policy;
- }
+ e = kern_sched_getscheduler(td, targettd, &policy);
PROC_UNLOCK(targetp);
+ if (e == 0)
+ td->td_retval[0] = policy;
return (e);
}
int
+kern_sched_getscheduler(struct thread *td, struct thread *targettd,
+ int *policy)
+{
+ struct proc *targetp;
+ int error;
+
+ targetp = targettd->td_proc;
+ PROC_LOCK_ASSERT(targetp, MA_OWNED);
+
+ error = p_cansee(td, targetp);
+ if (error == 0)
+ error = ksched_getscheduler(ksched, targettd, policy);
+ return (error);
+}
+
+int
sys_sched_yield(struct thread *td, struct sched_yield_args *uap)
{
@@ -296,13 +350,26 @@ kern_sched_rr_get_interval(struct thread *td, pid_t pid,
targettd = FIRST_THREAD_IN_PROC(targetp);
}
- e = p_cansee(td, targetp);
- if (e == 0)
- e = ksched_rr_get_interval(ksched, targettd, ts);
+ e = kern_sched_rr_get_interval_td(td, targettd, ts);
PROC_UNLOCK(targetp);
return (e);
}
+int
+kern_sched_rr_get_interval_td(struct thread *td, struct thread *targettd,
+ struct timespec *ts)
+{
+ struct proc *p;
+ int error;
+
+ p = targettd->td_proc;
+ PROC_LOCK_ASSERT(p, MA_OWNED);
+
+ error = p_cansee(td, p);
+ if (error == 0)
+ error = ksched_rr_get_interval(ksched, targettd, ts);
+ return (error);
+}
#endif
static void
diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c
index 6509522..4f35838 100644
--- a/sys/kern/subr_prf.c
+++ b/sys/kern/subr_prf.c
@@ -37,10 +37,13 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#ifdef _KERNEL
#include "opt_ddb.h"
#include "opt_printf.h"
+#endif /* _KERNEL */
#include <sys/param.h>
+#ifdef _KERNEL
#include <sys/systm.h>
#include <sys/lock.h>
#include <sys/kdb.h>
@@ -57,7 +60,9 @@ __FBSDID("$FreeBSD$");
#include <sys/syslog.h>
#include <sys/cons.h>
#include <sys/uio.h>
+#endif
#include <sys/ctype.h>
+#include <sys/sbuf.h>
#ifdef DDB
#include <ddb/ddb.h>
@@ -69,6 +74,8 @@ __FBSDID("$FreeBSD$");
*/
#include <machine/stdarg.h>
+#ifdef _KERNEL
+
#define TOCONS 0x01
#define TOTTY 0x02
#define TOLOG 0x04
@@ -1119,3 +1126,59 @@ hexdump(const void *ptr, int length, const char *hdr, int flags)
printf("\n");
}
}
+#endif /* _KERNEL */
+
+void
+sbuf_hexdump(struct sbuf *sb, const void *ptr, int length, const char *hdr,
+ int flags)
+{
+ int i, j, k;
+ int cols;
+ const unsigned char *cp;
+ char delim;
+
+ if ((flags & HD_DELIM_MASK) != 0)
+ delim = (flags & HD_DELIM_MASK) >> 8;
+ else
+ delim = ' ';
+
+ if ((flags & HD_COLUMN_MASK) != 0)
+ cols = flags & HD_COLUMN_MASK;
+ else
+ cols = 16;
+
+ cp = ptr;
+ for (i = 0; i < length; i+= cols) {
+ if (hdr != NULL)
+ sbuf_printf(sb, "%s", hdr);
+
+ if ((flags & HD_OMIT_COUNT) == 0)
+ sbuf_printf(sb, "%04x ", i);
+
+ if ((flags & HD_OMIT_HEX) == 0) {
+ for (j = 0; j < cols; j++) {
+ k = i + j;
+ if (k < length)
+ sbuf_printf(sb, "%c%02x", delim, cp[k]);
+ else
+ sbuf_printf(sb, " ");
+ }
+ }
+
+ if ((flags & HD_OMIT_CHARS) == 0) {
+ sbuf_printf(sb, " |");
+ for (j = 0; j < cols; j++) {
+ k = i + j;
+ if (k >= length)
+ sbuf_printf(sb, " ");
+ else if (cp[k] >= ' ' && cp[k] <= '~')
+ sbuf_printf(sb, "%c", cp[k]);
+ else
+ sbuf_printf(sb, ".");
+ }
+ sbuf_printf(sb, "|");
+ }
+ sbuf_printf(sb, "\n");
+ }
+}
+
diff --git a/sys/kern/subr_syscall.c b/sys/kern/subr_syscall.c
index 1bf78b8..070ba28 100644
--- a/sys/kern/subr_syscall.c
+++ b/sys/kern/subr_syscall.c
@@ -61,8 +61,8 @@ syscallenter(struct thread *td, struct syscall_args *sa)
p = td->td_proc;
td->td_pticks = 0;
- if (td->td_ucred != p->p_ucred)
- cred_update_thread(td);
+ if (td->td_cowgen != p->p_cowgen)
+ thread_cow_update(td);
if (p->p_flag & P_TRACED) {
traced = 1;
PROC_LOCK(p);
diff --git a/sys/kern/subr_taskqueue.c b/sys/kern/subr_taskqueue.c
index 2cf1f63..f0a5a1b 100644
--- a/sys/kern/subr_taskqueue.c
+++ b/sys/kern/subr_taskqueue.c
@@ -323,17 +323,16 @@ taskqueue_drain_tq_queue(struct taskqueue *queue)
return;
/*
- * Enqueue our barrier with the lowest possible priority
- * so we are inserted after all current tasks.
+ * Enqueue our barrier after all current tasks, but with
+ * the highest priority so that newly queued tasks cannot
+ * pass it. Because of the high priority, we can not use
+ * taskqueue_enqueue_locked directly (which drops the lock
+ * anyway) so just insert it at tail while we have the
+ * queue lock.
*/
- TASK_INIT(&t_barrier, 0, taskqueue_task_nop_fn, &t_barrier);
- taskqueue_enqueue_locked(queue, &t_barrier);
-
- /*
- * Raise the barrier's priority so newly queued tasks cannot
- * pass it.
- */
- t_barrier.ta_priority = USHRT_MAX;
+ TASK_INIT(&t_barrier, USHRT_MAX, taskqueue_task_nop_fn, &t_barrier);
+ STAILQ_INSERT_TAIL(&queue->tq_queue, &t_barrier, ta_link);
+ t_barrier.ta_pending = 1;
/*
* Once the barrier has executed, all previously queued tasks
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c
index 93f7557..375bb32 100644
--- a/sys/kern/subr_trap.c
+++ b/sys/kern/subr_trap.c
@@ -86,6 +86,8 @@ __FBSDID("$FreeBSD$");
#include <security/mac/mac_framework.h>
+void (*softdep_ast_cleanup)(void);
+
/*
* Define the code needed before returning to user mode, for trap and
* syscall.
@@ -114,6 +116,9 @@ userret(struct thread *td, struct trapframe *frame)
#ifdef KTRACE
KTRUSERRET(td);
#endif
+ if (softdep_ast_cleanup != NULL)
+ softdep_ast_cleanup();
+
/*
* If this thread tickled GEOM, we need to wait for the giggling to
* stop before we return to userland
@@ -157,6 +162,8 @@ userret(struct thread *td, struct trapframe *frame)
("userret: Returning while holding vnode reservation"));
KASSERT((td->td_flags & TDF_SBDRY) == 0,
("userret: Returning with stop signals deferred"));
+ KASSERT(td->td_su == NULL,
+ ("userret: Returning with SU cleanup request not handled"));
#ifdef VIMAGE
/* Unfortunately td_vnet_lpush needs VNET_DEBUG. */
VNET_ASSERT(curvnet == NULL,
@@ -213,8 +220,8 @@ ast(struct trapframe *framep)
thread_unlock(td);
PCPU_INC(cnt.v_trap);
- if (td->td_ucred != p->p_ucred)
- cred_update_thread(td);
+ if (td->td_cowgen != p->p_cowgen)
+ thread_cow_update(td);
if (td->td_pflags & TDP_OWEUPC && p->p_flag & P_PROFIL) {
addupc_task(td, td->td_profil_addr, td->td_profil_ticks);
td->td_profil_ticks = 0;
diff --git a/sys/kern/subr_uio.c b/sys/kern/subr_uio.c
index 87892fd..aac6eb6 100644
--- a/sys/kern/subr_uio.c
+++ b/sys/kern/subr_uio.c
@@ -409,15 +409,13 @@ copyout_map(struct thread *td, vm_offset_t *addr, size_t sz)
/*
* Map somewhere after heap in process memory.
*/
- PROC_LOCK(td->td_proc);
*addr = round_page((vm_offset_t)vms->vm_daddr +
- lim_max(td->td_proc, RLIMIT_DATA));
- PROC_UNLOCK(td->td_proc);
+ lim_max(td, RLIMIT_DATA));
/* round size up to page boundry */
size = (vm_size_t)round_page(sz);
- error = vm_mmap(&vms->vm_map, addr, size, PROT_READ | PROT_WRITE,
+ error = vm_mmap(&vms->vm_map, addr, size, VM_PROT_READ | VM_PROT_WRITE,
VM_PROT_ALL, MAP_PRIVATE | MAP_ANON, OBJT_DEFAULT, NULL, 0);
return (error);
diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c
index dc343d0..1280807 100644
--- a/sys/kern/subr_witness.c
+++ b/sys/kern/subr_witness.c
@@ -1170,19 +1170,25 @@ witness_checkorder(struct lock_object *lock, int flags, const char *file,
/*
* Try to perform most checks without a lock. If this succeeds we
- * can skip acquiring the lock and return success.
+ * can skip acquiring the lock and return success. Otherwise we redo
+ * the check with the lock held to handle races with concurrent updates.
*/
w1 = plock->li_lock->lo_witness;
if (witness_lock_order_check(w1, w))
return;
+ mtx_lock_spin(&w_mtx);
+ if (witness_lock_order_check(w1, w)) {
+ mtx_unlock_spin(&w_mtx);
+ return;
+ }
+ witness_lock_order_add(w1, w);
+
/*
* Check for duplicate locks of the same type. Note that we only
* have to check for this on the last lock we just acquired. Any
* other cases will be caught as lock order violations.
*/
- mtx_lock_spin(&w_mtx);
- witness_lock_order_add(w1, w);
if (w1 == w) {
i = w->w_index;
if (!(lock->lo_flags & LO_DUPOK) && !(flags & LOP_DUPOK) &&
@@ -1996,7 +2002,10 @@ _isitmyx(struct witness *w1, struct witness *w2, int rmask, const char *fname)
/* The flags on one better be the inverse of the flags on the other */
if (!((WITNESS_ATOD(r1) == r2 && WITNESS_DTOA(r2) == r1) ||
- (WITNESS_DTOA(r1) == r2 && WITNESS_ATOD(r2) == r1))) {
+ (WITNESS_DTOA(r1) == r2 && WITNESS_ATOD(r2) == r1))) {
+ /* Don't squawk if we're potentially racing with an update. */
+ if (!mtx_owned(&w_mtx))
+ return (0);
printf("%s: rmatrix mismatch between %s (index %d) and %s "
"(index %d): w_rmatrix[%d][%d] == %hhx but "
"w_rmatrix[%d][%d] == %hhx\n",
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index 7dd3d17..d82fda0 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -402,7 +402,7 @@ ptrace_vm_entry(struct thread *td, struct proc *p, struct ptrace_vm_entry *pve)
lobj = tobj;
pve->pve_offset += tobj->backing_object_offset;
}
- vp = (lobj->type == OBJT_VNODE) ? lobj->handle : NULL;
+ vp = vm_object_vnode(lobj);
if (vp != NULL)
vref(vp);
if (lobj != obj)
@@ -432,6 +432,9 @@ ptrace_vm_entry(struct thread *td, struct proc *p, struct ptrace_vm_entry *pve)
free(freepath, M_TEMP);
}
}
+ if (error == 0)
+ CTR3(KTR_PTRACE, "PT_VM_ENTRY: pid %d, entry %d, start %p",
+ p->p_pid, pve->pve_entry, pve->pve_start);
return (error);
}
@@ -826,6 +829,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
if (p->p_flag & P_PPWAIT)
p->p_flag |= P_PPTRACE;
p->p_oppid = p->p_pptr->p_pid;
+ CTR1(KTR_PTRACE, "PT_TRACE_ME: pid %d", p->p_pid);
break;
case PT_ATTACH:
@@ -845,17 +849,25 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
proc_reparent(p, td->td_proc);
}
data = SIGSTOP;
+ CTR2(KTR_PTRACE, "PT_ATTACH: pid %d, oppid %d", p->p_pid,
+ p->p_oppid);
goto sendsig; /* in PT_CONTINUE below */
case PT_CLEARSTEP:
+ CTR2(KTR_PTRACE, "PT_CLEARSTEP: tid %d (pid %d)", td2->td_tid,
+ p->p_pid);
error = ptrace_clear_single_step(td2);
break;
case PT_SETSTEP:
+ CTR2(KTR_PTRACE, "PT_SETSTEP: tid %d (pid %d)", td2->td_tid,
+ p->p_pid);
error = ptrace_single_step(td2);
break;
case PT_SUSPEND:
+ CTR2(KTR_PTRACE, "PT_SUSPEND: tid %d (pid %d)", td2->td_tid,
+ p->p_pid);
td2->td_dbgflags |= TDB_SUSPEND;
thread_lock(td2);
td2->td_flags |= TDF_NEEDSUSPCHK;
@@ -863,10 +875,15 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
break;
case PT_RESUME:
+ CTR2(KTR_PTRACE, "PT_RESUME: tid %d (pid %d)", td2->td_tid,
+ p->p_pid);
td2->td_dbgflags &= ~TDB_SUSPEND;
break;
case PT_FOLLOW_FORK:
+ CTR3(KTR_PTRACE, "PT_FOLLOW_FORK: pid %d %s -> %s", p->p_pid,
+ p->p_flag & P_FOLLOWFORK ? "enabled" : "disabled",
+ data ? "enabled" : "disabled");
if (data)
p->p_flag |= P_FOLLOWFORK;
else
@@ -887,6 +904,8 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
switch (req) {
case PT_STEP:
+ CTR2(KTR_PTRACE, "PT_STEP: tid %d (pid %d)",
+ td2->td_tid, p->p_pid);
error = ptrace_single_step(td2);
if (error)
goto out;
@@ -904,12 +923,25 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
switch (req) {
case PT_TO_SCE:
p->p_stops |= S_PT_SCE;
+ CTR2(KTR_PTRACE,
+ "PT_TO_SCE: pid %d, stops = %#x", p->p_pid,
+ p->p_stops);
break;
case PT_TO_SCX:
p->p_stops |= S_PT_SCX;
+ CTR2(KTR_PTRACE,
+ "PT_TO_SCX: pid %d, stops = %#x", p->p_pid,
+ p->p_stops);
break;
case PT_SYSCALL:
p->p_stops |= S_PT_SCE | S_PT_SCX;
+ CTR2(KTR_PTRACE,
+ "PT_SYSCALL: pid %d, stops = %#x", p->p_pid,
+ p->p_stops);
+ break;
+ case PT_CONTINUE:
+ CTR1(KTR_PTRACE,
+ "PT_CONTINUE: pid %d", p->p_pid);
break;
}
break;
@@ -924,9 +956,14 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
proc_reparent(p, pp);
if (pp == initproc)
p->p_sigparent = SIGCHLD;
- }
+ CTR2(KTR_PTRACE,
+ "PT_DETACH: pid %d reparented to pid %d",
+ p->p_pid, pp->p_pid);
+ } else
+ CTR1(KTR_PTRACE, "PT_DETACH: pid %d", p->p_pid);
p->p_oppid = 0;
p->p_flag &= ~(P_TRACED | P_WAITED | P_FOLLOWFORK);
+ p->p_stops = 0;
/* should we send SIGCHLD? */
/* childproc_continued(p); */
@@ -1001,6 +1038,14 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
}
if (!write)
td->td_retval[0] = tmp;
+ if (error == 0) {
+ if (write)
+ CTR3(KTR_PTRACE, "PT_WRITE: pid %d: %p <= %#x",
+ p->p_pid, addr, data);
+ else
+ CTR3(KTR_PTRACE, "PT_READ: pid %d: %p >= %#x",
+ p->p_pid, addr, tmp);
+ }
PROC_LOCK(p);
break;
@@ -1033,10 +1078,14 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
switch (tmp) {
case PIOD_READ_D:
case PIOD_READ_I:
+ CTR3(KTR_PTRACE, "PT_IO: pid %d: READ (%p, %#x)",
+ p->p_pid, (uintptr_t)uio.uio_offset, uio.uio_resid);
uio.uio_rw = UIO_READ;
break;
case PIOD_WRITE_D:
case PIOD_WRITE_I:
+ CTR3(KTR_PTRACE, "PT_IO: pid %d: WRITE (%p, %#x)",
+ p->p_pid, (uintptr_t)uio.uio_offset, uio.uio_resid);
td2->td_dbgflags |= TDB_USERWR;
uio.uio_rw = UIO_WRITE;
break;
@@ -1056,33 +1105,46 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
break;
case PT_KILL:
+ CTR1(KTR_PTRACE, "PT_KILL: pid %d", p->p_pid);
data = SIGKILL;
goto sendsig; /* in PT_CONTINUE above */
case PT_SETREGS:
+ CTR2(KTR_PTRACE, "PT_SETREGS: tid %d (pid %d)", td2->td_tid,
+ p->p_pid);
td2->td_dbgflags |= TDB_USERWR;
error = PROC_WRITE(regs, td2, addr);
break;
case PT_GETREGS:
+ CTR2(KTR_PTRACE, "PT_GETREGS: tid %d (pid %d)", td2->td_tid,
+ p->p_pid);
error = PROC_READ(regs, td2, addr);
break;
case PT_SETFPREGS:
+ CTR2(KTR_PTRACE, "PT_SETFPREGS: tid %d (pid %d)", td2->td_tid,
+ p->p_pid);
td2->td_dbgflags |= TDB_USERWR;
error = PROC_WRITE(fpregs, td2, addr);
break;
case PT_GETFPREGS:
+ CTR2(KTR_PTRACE, "PT_GETFPREGS: tid %d (pid %d)", td2->td_tid,
+ p->p_pid);
error = PROC_READ(fpregs, td2, addr);
break;
case PT_SETDBREGS:
+ CTR2(KTR_PTRACE, "PT_SETDBREGS: tid %d (pid %d)", td2->td_tid,
+ p->p_pid);
td2->td_dbgflags |= TDB_USERWR;
error = PROC_WRITE(dbregs, td2, addr);
break;
case PT_GETDBREGS:
+ CTR2(KTR_PTRACE, "PT_GETDBREGS: tid %d (pid %d)", td2->td_tid,
+ p->p_pid);
error = PROC_READ(dbregs, td2, addr);
break;
@@ -1145,13 +1207,21 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
if (wrap32)
ptrace_lwpinfo_to32(pl, pl32);
#endif
+ CTR5(KTR_PTRACE,
+ "PT_LWPINFO: tid %d (pid %d) event %d flags %#x child pid %d",
+ td2->td_tid, p->p_pid, pl->pl_event, pl->pl_flags,
+ pl->pl_child_pid);
break;
case PT_GETNUMLWPS:
+ CTR2(KTR_PTRACE, "PT_GETNUMLWPS: pid %d: %d threads", p->p_pid,
+ p->p_numthreads);
td->td_retval[0] = p->p_numthreads;
break;
case PT_GETLWPLIST:
+ CTR3(KTR_PTRACE, "PT_GETLWPLIST: pid %d: data %d, actual %d",
+ p->p_pid, data, p->p_numthreads);
if (data <= 0) {
error = EINVAL;
break;
@@ -1175,6 +1245,8 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
break;
case PT_VM_TIMESTAMP:
+ CTR2(KTR_PTRACE, "PT_VM_TIMESTAMP: pid %d: timestamp %d",
+ p->p_pid, p->p_vmspace->vm_map.timestamp);
td->td_retval[0] = p->p_vmspace->vm_map.timestamp;
break;
@@ -1225,6 +1297,8 @@ stopevent(struct proc *p, unsigned int event, unsigned int val)
PROC_LOCK_ASSERT(p, MA_OWNED);
p->p_step = 1;
+ CTR3(KTR_PTRACE, "stopevent: pid %d event %u val %u", p->p_pid, event,
+ val);
do {
p->p_xstat = val;
p->p_xthread = NULL;
diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c
index 3240a5f..3eb126b 100644
--- a/sys/kern/sysv_shm.c
+++ b/sys/kern/sysv_shm.c
@@ -382,7 +382,7 @@ kern_shmat_locked(struct thread *td, int shmid, const void *shmaddr,
*/
PROC_LOCK(p);
attach_va = round_page((vm_offset_t)p->p_vmspace->vm_daddr +
- lim_max(p, RLIMIT_DATA));
+ lim_max_proc(p, RLIMIT_DATA));
PROC_UNLOCK(p);
}
diff --git a/sys/kern/tty_pts.c b/sys/kern/tty_pts.c
index 2d1e8fe..fcc9c47 100644
--- a/sys/kern/tty_pts.c
+++ b/sys/kern/tty_pts.c
@@ -741,7 +741,7 @@ pts_alloc(int fflags, struct thread *td, struct file *fp)
PROC_UNLOCK(p);
return (EAGAIN);
}
- ok = chgptscnt(cred->cr_ruidinfo, 1, lim_cur(p, RLIMIT_NPTS));
+ ok = chgptscnt(cred->cr_ruidinfo, 1, lim_cur(td, RLIMIT_NPTS));
if (!ok) {
racct_sub(p, RACCT_NPTS, 1);
PROC_UNLOCK(p);
@@ -795,7 +795,7 @@ pts_alloc_external(int fflags, struct thread *td, struct file *fp,
PROC_UNLOCK(p);
return (EAGAIN);
}
- ok = chgptscnt(cred->cr_ruidinfo, 1, lim_cur(p, RLIMIT_NPTS));
+ ok = chgptscnt(cred->cr_ruidinfo, 1, lim_cur(td, RLIMIT_NPTS));
if (!ok) {
racct_sub(p, RACCT_NPTS, 1);
PROC_UNLOCK(p);
diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c
index 93c7ed1..fb84330 100644
--- a/sys/kern/uipc_shm.c
+++ b/sys/kern/uipc_shm.c
@@ -127,6 +127,7 @@ static fo_chmod_t shm_chmod;
static fo_chown_t shm_chown;
static fo_seek_t shm_seek;
static fo_fill_kinfo_t shm_fill_kinfo;
+static fo_mmap_t shm_mmap;
/* File descriptor operations. */
static struct fileops shm_ops = {
@@ -143,6 +144,7 @@ static struct fileops shm_ops = {
.fo_sendfile = vn_sendfile,
.fo_seek = shm_seek,
.fo_fill_kinfo = shm_fill_kinfo,
+ .fo_mmap = shm_mmap,
.fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE
};
@@ -187,14 +189,6 @@ uiomove_object_page(vm_object_t obj, size_t len, struct uio *uio)
if (m->valid != VM_PAGE_BITS_ALL) {
if (vm_pager_has_page(obj, idx, NULL, NULL)) {
rv = vm_pager_get_pages(obj, &m, 1, 0);
- m = vm_page_lookup(obj, idx);
- if (m == NULL) {
- printf(
- "uiomove_object: vm_obj %p idx %jd null lookup rv %d\n",
- obj, idx, rv);
- VM_OBJECT_WUNLOCK(obj);
- return (EIO);
- }
if (rv != VM_PAGER_OK) {
printf(
"uiomove_object: vm_obj %p idx %jd valid %x pager error %d\n",
@@ -421,7 +415,7 @@ static int
shm_dotruncate(struct shmfd *shmfd, off_t length)
{
vm_object_t object;
- vm_page_t m, ma[1];
+ vm_page_t m;
vm_pindex_t idx, nobjsize;
vm_ooffset_t delta;
int base, rv;
@@ -463,12 +457,10 @@ retry:
VM_WAIT;
VM_OBJECT_WLOCK(object);
goto retry;
- } else if (m->valid != VM_PAGE_BITS_ALL) {
- ma[0] = m;
- rv = vm_pager_get_pages(object, ma, 1,
+ } else if (m->valid != VM_PAGE_BITS_ALL)
+ rv = vm_pager_get_pages(object, &m, 1,
0);
- m = vm_page_lookup(object, idx);
- } else
+ else
/* A cached page was reactivated. */
rv = VM_PAGER_OK;
vm_page_lock(m);
@@ -851,15 +843,37 @@ sys_shm_unlink(struct thread *td, struct shm_unlink_args *uap)
return (error);
}
-/*
- * mmap() helper to validate mmap() requests against shm object state
- * and give mmap() the vm_object to use for the mapping.
- */
int
-shm_mmap(struct shmfd *shmfd, vm_size_t objsize, vm_ooffset_t foff,
- vm_object_t *obj)
+shm_mmap(struct file *fp, vm_map_t map, vm_offset_t *addr, vm_size_t objsize,
+ vm_prot_t prot, vm_prot_t cap_maxprot, int flags,
+ vm_ooffset_t foff, struct thread *td)
{
+ struct shmfd *shmfd;
+ vm_prot_t maxprot;
+ int error;
+
+ shmfd = fp->f_data;
+ maxprot = VM_PROT_NONE;
+ /* FREAD should always be set. */
+ if ((fp->f_flag & FREAD) != 0)
+ maxprot |= VM_PROT_EXECUTE | VM_PROT_READ;
+ if ((fp->f_flag & FWRITE) != 0)
+ maxprot |= VM_PROT_WRITE;
+
+ /* Don't permit shared writable mappings on read-only descriptors. */
+ if ((flags & MAP_SHARED) != 0 &&
+ (maxprot & VM_PROT_WRITE) == 0 &&
+ (prot & VM_PROT_WRITE) != 0)
+ return (EACCES);
+ maxprot &= cap_maxprot;
+
+#ifdef MAC
+ error = mac_posixshm_check_mmap(td->td_ucred, shmfd, prot, flags);
+ if (error != 0)
+ return (error);
+#endif
+
/*
* XXXRW: This validation is probably insufficient, and subject to
* sign errors. It should be fixed.
@@ -872,7 +886,11 @@ shm_mmap(struct shmfd *shmfd, vm_size_t objsize, vm_ooffset_t foff,
vfs_timestamp(&shmfd->shm_atime);
mtx_unlock(&shm_timestamp_lock);
vm_object_reference(shmfd->shm_object);
- *obj = shmfd->shm_object;
+
+ error = vm_mmap_object(map, addr, objsize, prot, maxprot, flags,
+ shmfd->shm_object, foff, FALSE, td);
+ if (error != 0)
+ vm_object_deallocate(shmfd->shm_object);
return (0);
}
diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c
index 88952ed..243450d 100644
--- a/sys/kern/uipc_sockbuf.c
+++ b/sys/kern/uipc_sockbuf.c
@@ -420,9 +420,7 @@ sbreserve_locked(struct sockbuf *sb, u_long cc, struct socket *so,
if (cc > sb_max_adj)
return (0);
if (td != NULL) {
- PROC_LOCK(td->td_proc);
- sbsize_limit = lim_cur(td->td_proc, RLIMIT_SBSIZE);
- PROC_UNLOCK(td->td_proc);
+ sbsize_limit = lim_cur(td, RLIMIT_SBSIZE);
} else
sbsize_limit = RLIM_INFINITY;
if (!chgsbsize(so->so_cred->cr_uidinfo, &sb->sb_hiwat, cc,
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 1efe3da..e3557ba 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -2026,10 +2026,7 @@ sendfile_readpage(vm_object_t obj, struct vnode *vp, int nd,
if (vm_pager_has_page(obj, pindex, NULL, NULL)) {
rv = vm_pager_get_pages(obj, &m, 1, 0);
SFSTAT_INC(sf_iocnt);
- m = vm_page_lookup(obj, pindex);
- if (m == NULL)
- error = EIO;
- else if (rv != VM_PAGER_OK) {
+ if (rv != VM_PAGER_OK) {
vm_page_lock(m);
vm_page_free(m);
vm_page_unlock(m);
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index ef0b83c..808020e 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -1787,7 +1787,7 @@ unp_externalize(struct mbuf *control, struct mbuf **controlp, int flags)
fdp = (int *)
CMSG_DATA(mtod(*controlp, struct cmsghdr *));
if (fdallocn(td, 0, fdp, newfds) != 0) {
- FILEDESC_XUNLOCK(td->td_proc->p_fd);
+ FILEDESC_XUNLOCK(fdesc);
error = EMSGSIZE;
unp_freerights(fdep, newfds);
m_freem(*controlp);
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c
index 9601082..362ebb7b 100644
--- a/sys/kern/vfs_cluster.c
+++ b/sys/kern/vfs_cluster.c
@@ -310,7 +310,6 @@ static struct buf *
cluster_rbuild(struct vnode *vp, u_quad_t filesize, daddr_t lbn,
daddr_t blkno, long size, int run, int gbflags, struct buf *fbp)
{
- struct bufobj *bo;
struct buf *bp, *tbp;
daddr_t bn;
off_t off;
@@ -376,7 +375,6 @@ cluster_rbuild(struct vnode *vp, u_quad_t filesize, daddr_t lbn,
bp->b_npages = 0;
inc = btodb(size);
- bo = &vp->v_bufobj;
for (bn = blkno, i = 0; i < run; ++i, bn += inc) {
if (i == 0) {
VM_OBJECT_WLOCK(tbp->b_bufobj->bo_object);
diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c
index cf3928e..f935954 100644
--- a/sys/kern/vfs_init.c
+++ b/sys/kern/vfs_init.c
@@ -311,9 +311,7 @@ static int
vfs_unregister(struct vfsconf *vfc)
{
struct vfsconf *vfsp;
- int error, i, maxtypenum;
-
- i = vfc->vfc_typenum;
+ int error, maxtypenum;
vfsconf_lock();
vfsp = vfs_byname_locked(vfc->vfc_name);
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index 09fa7ed..c86259b 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -1128,12 +1128,7 @@ struct unmount_args {
#endif
/* ARGSUSED */
int
-sys_unmount(td, uap)
- struct thread *td;
- register struct unmount_args /* {
- char *path;
- int flags;
- } */ *uap;
+sys_unmount(struct thread *td, struct unmount_args *uap)
{
struct nameidata nd;
struct mount *mp;
@@ -1164,8 +1159,10 @@ sys_unmount(td, uap)
mtx_lock(&mountlist_mtx);
TAILQ_FOREACH_REVERSE(mp, &mountlist, mntlist, mnt_list) {
if (mp->mnt_stat.f_fsid.val[0] == id0 &&
- mp->mnt_stat.f_fsid.val[1] == id1)
+ mp->mnt_stat.f_fsid.val[1] == id1) {
+ vfs_ref(mp);
break;
+ }
}
mtx_unlock(&mountlist_mtx);
} else {
@@ -1183,8 +1180,10 @@ sys_unmount(td, uap)
}
mtx_lock(&mountlist_mtx);
TAILQ_FOREACH_REVERSE(mp, &mountlist, mntlist, mnt_list) {
- if (strcmp(mp->mnt_stat.f_mntonname, pathbuf) == 0)
+ if (strcmp(mp->mnt_stat.f_mntonname, pathbuf) == 0) {
+ vfs_ref(mp);
break;
+ }
}
mtx_unlock(&mountlist_mtx);
}
@@ -1202,8 +1201,10 @@ sys_unmount(td, uap)
/*
* Don't allow unmounting the root filesystem.
*/
- if (mp->mnt_flag & MNT_ROOTFS)
+ if (mp->mnt_flag & MNT_ROOTFS) {
+ vfs_rel(mp);
return (EINVAL);
+ }
error = dounmount(mp, uap->flags, td);
return (error);
}
@@ -1212,10 +1213,7 @@ sys_unmount(td, uap)
* Do the actual filesystem unmount.
*/
int
-dounmount(mp, flags, td)
- struct mount *mp;
- int flags;
- struct thread *td;
+dounmount(struct mount *mp, int flags, struct thread *td)
{
struct vnode *coveredvp, *fsrootvp;
int error;
@@ -1235,6 +1233,7 @@ dounmount(mp, flags, td)
if (coveredvp->v_mountedhere != mp ||
coveredvp->v_mountedhere->mnt_gen != mnt_gen_r) {
VOP_UNLOCK(coveredvp, 0);
+ vfs_rel(mp);
return (EBUSY);
}
}
@@ -1243,13 +1242,14 @@ dounmount(mp, flags, td)
* original mount is permitted to unmount this filesystem.
*/
error = vfs_suser(mp, td);
- if (error) {
+ if (error != 0) {
if (coveredvp)
VOP_UNLOCK(coveredvp, 0);
+ vfs_rel(mp);
return (error);
}
- vn_start_write(NULL, &mp, V_WAIT);
+ vn_start_write(NULL, &mp, V_WAIT | V_MNTREF);
MNT_ILOCK(mp);
if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0 ||
!TAILQ_EMPTY(&mp->mnt_uppers)) {
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 8e34456..625d193 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -3502,8 +3502,9 @@ vfs_unmountall(void)
*/
while(!TAILQ_EMPTY(&mountlist)) {
mp = TAILQ_LAST(&mountlist, mntlist);
+ vfs_ref(mp);
error = dounmount(mp, MNT_FORCE, td);
- if (error) {
+ if (error != 0) {
TAILQ_REMOVE(&mountlist, mp, mnt_list);
/*
* XXX: Due to the way in which we mount the root
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 01d448e..0b073b9 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$");
#include <sys/proc.h>
#include <sys/limits.h>
#include <sys/lock.h>
+#include <sys/mman.h>
#include <sys/mount.h>
#include <sys/mutex.h>
#include <sys/namei.h>
@@ -80,6 +81,7 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_map.h>
#include <vm/vm_object.h>
#include <vm/vm_page.h>
+#include <vm/vnode_pager.h>
static fo_rdwr_t vn_read;
static fo_rdwr_t vn_write;
@@ -90,6 +92,7 @@ static fo_poll_t vn_poll;
static fo_kqfilter_t vn_kqfilter;
static fo_stat_t vn_statfile;
static fo_close_t vn_closefile;
+static fo_mmap_t vn_mmap;
struct fileops vnops = {
.fo_read = vn_io_fault,
@@ -105,6 +108,7 @@ struct fileops vnops = {
.fo_sendfile = vn_sendfile,
.fo_seek = vn_seek,
.fo_fill_kinfo = vn_fill_kinfo,
+ .fo_mmap = vn_mmap,
.fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE
};
@@ -1646,16 +1650,18 @@ unlock:
}
int
-vn_start_write(vp, mpp, flags)
- struct vnode *vp;
- struct mount **mpp;
- int flags;
+vn_start_write(struct vnode *vp, struct mount **mpp, int flags)
{
struct mount *mp;
int error;
- if (!vn_suspendable(vp, mpp))
+ KASSERT((flags & V_MNTREF) == 0 || (*mpp != NULL && vp == NULL),
+ ("V_MNTREF requires mp"));
+ if (!vn_suspendable(vp, mpp)) {
+ if ((flags & V_MNTREF) != 0)
+ vfs_rel(*mpp);
return (0);
+ }
error = 0;
/*
@@ -1681,7 +1687,7 @@ vn_start_write(vp, mpp, flags)
* emulate a vfs_ref().
*/
MNT_ILOCK(mp);
- if (vp == NULL)
+ if (vp == NULL && (flags & V_MNTREF) == 0)
MNT_REF(mp);
return (vn_start_write_locked(mp, flags));
@@ -1695,16 +1701,18 @@ vn_start_write(vp, mpp, flags)
* time, these operations are halted until the suspension is over.
*/
int
-vn_start_secondary_write(vp, mpp, flags)
- struct vnode *vp;
- struct mount **mpp;
- int flags;
+vn_start_secondary_write(struct vnode *vp, struct mount **mpp, int flags)
{
struct mount *mp;
int error;
- if (!vn_suspendable(vp, mpp))
+ KASSERT((flags & V_MNTREF) == 0 || (*mpp != NULL && vp == NULL),
+ ("V_MNTREF requires mp"));
+ if (!vn_suspendable(vp, mpp)) {
+ if ((flags & V_MNTREF) != 0)
+ vfs_rel(*mpp);
return (0);
+ }
retry:
if (vp != NULL) {
@@ -1730,7 +1738,7 @@ vn_start_secondary_write(vp, mpp, flags)
* emulate a vfs_ref().
*/
MNT_ILOCK(mp);
- if (vp == NULL)
+ if (vp == NULL && (flags & V_MNTREF) == 0)
MNT_REF(mp);
if ((mp->mnt_kern_flag & (MNTK_SUSPENDED | MNTK_SUSPEND2)) == 0) {
mp->mnt_secondary_writes++;
@@ -2098,19 +2106,18 @@ vn_vget_ino_gen(struct vnode *vp, vn_get_ino_t alloc, void *alloc_arg,
int
vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio,
- const struct thread *td)
+ struct thread *td)
{
if (vp->v_type != VREG || td == NULL)
return (0);
- PROC_LOCK(td->td_proc);
if ((uoff_t)uio->uio_offset + uio->uio_resid >
- lim_cur(td->td_proc, RLIMIT_FSIZE)) {
+ lim_cur(td, RLIMIT_FSIZE)) {
+ PROC_LOCK(td->td_proc);
kern_psignal(td->td_proc, SIGXFSZ);
PROC_UNLOCK(td->td_proc);
return (EFBIG);
}
- PROC_UNLOCK(td->td_proc);
return (0);
}
@@ -2358,3 +2365,95 @@ vn_fill_kinfo_vnode(struct vnode *vp, struct kinfo_file *kif)
kif->kf_un.kf_file.kf_file_rdev = va.va_rdev;
return (0);
}
+
+int
+vn_mmap(struct file *fp, vm_map_t map, vm_offset_t *addr, vm_size_t size,
+ vm_prot_t prot, vm_prot_t cap_maxprot, int flags, vm_ooffset_t foff,
+ struct thread *td)
+{
+#ifdef HWPMC_HOOKS
+ struct pmckern_map_in pkm;
+#endif
+ struct mount *mp;
+ struct vnode *vp;
+ vm_object_t object;
+ vm_prot_t maxprot;
+ boolean_t writecounted;
+ int error;
+
+#if defined(COMPAT_FREEBSD7) || defined(COMPAT_FREEBSD6) || \
+ defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4)
+ /*
+ * POSIX shared-memory objects are defined to have
+ * kernel persistence, and are not defined to support
+ * read(2)/write(2) -- or even open(2). Thus, we can
+ * use MAP_ASYNC to trade on-disk coherence for speed.
+ * The shm_open(3) library routine turns on the FPOSIXSHM
+ * flag to request this behavior.
+ */
+ if ((fp->f_flag & FPOSIXSHM) != 0)
+ flags |= MAP_NOSYNC;
+#endif
+ vp = fp->f_vnode;
+
+ /*
+ * Ensure that file and memory protections are
+ * compatible. Note that we only worry about
+ * writability if mapping is shared; in this case,
+ * current and max prot are dictated by the open file.
+ * XXX use the vnode instead? Problem is: what
+ * credentials do we use for determination? What if
+ * proc does a setuid?
+ */
+ mp = vp->v_mount;
+ if (mp != NULL && (mp->mnt_flag & MNT_NOEXEC) != 0)
+ maxprot = VM_PROT_NONE;
+ else
+ maxprot = VM_PROT_EXECUTE;
+ if ((fp->f_flag & FREAD) != 0)
+ maxprot |= VM_PROT_READ;
+ else if ((prot & VM_PROT_READ) != 0)
+ return (EACCES);
+
+ /*
+ * If we are sharing potential changes via MAP_SHARED and we
+ * are trying to get write permission although we opened it
+ * without asking for it, bail out.
+ */
+ if ((flags & MAP_SHARED) != 0) {
+ if ((fp->f_flag & FWRITE) != 0)
+ maxprot |= VM_PROT_WRITE;
+ else if ((prot & VM_PROT_WRITE) != 0)
+ return (EACCES);
+ } else {
+ maxprot |= VM_PROT_WRITE;
+ cap_maxprot |= VM_PROT_WRITE;
+ }
+ maxprot &= cap_maxprot;
+
+ writecounted = FALSE;
+ error = vm_mmap_vnode(td, size, prot, &maxprot, &flags, vp,
+ &foff, &object, &writecounted);
+ if (error != 0)
+ return (error);
+ error = vm_mmap_object(map, addr, size, prot, maxprot, flags, object,
+ foff, writecounted, td);
+ if (error != 0) {
+ /*
+ * If this mapping was accounted for in the vnode's
+ * writecount, then undo that now.
+ */
+ if (writecounted)
+ vnode_pager_release_writecount(object, 0, size);
+ vm_object_deallocate(object);
+ }
+#ifdef HWPMC_HOOKS
+ /* Inform hwpmc(4) if an executable is being mapped. */
+ if (error == 0 && (prot & VM_PROT_EXECUTE) != 0) {
+ pkm.pm_file = vp;
+ pkm.pm_address = (uintptr_t) addr;
+ PMC_CALL_HOOK(td, PMC_FN_MMAP, (void *) &pkm);
+ }
+#endif
+ return (error);
+}
diff --git a/sys/libkern/arm/memcpy.S b/sys/libkern/arm/memcpy.S
index 9fca8f6..3703195 100644
--- a/sys/libkern/arm/memcpy.S
+++ b/sys/libkern/arm/memcpy.S
@@ -31,7 +31,11 @@ __FBSDID("$FreeBSD$");
#ifdef __ARM_EABI__
ENTRY_NP(__aeabi_memcpy)
+EENTRY_NP(__aeabi_memcpy4)
+EENTRY_NP(__aeabi_memcpy8)
b memcpy
+EEND(__aeabi_memcpy8)
+EEND(__aeabi_memcpy4)
END(__aeabi_memcpy)
#endif
diff --git a/sys/mips/conf/AR71XX_BASE b/sys/mips/conf/AR71XX_BASE
index 357f965..d2ff804 100644
--- a/sys/mips/conf/AR71XX_BASE
+++ b/sys/mips/conf/AR71XX_BASE
@@ -26,6 +26,9 @@ makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols
# modules already built.
makeoptions MODULES_OVERRIDE="random gpio ar71xx if_gif if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_pci"
+# For small memory footprints
+options VM_KMEM_SIZE_SCALE=1
+
options DDB
options KDB
diff --git a/sys/mips/conf/AR724X_BASE b/sys/mips/conf/AR724X_BASE
index f0be92c..7c28450 100644
--- a/sys/mips/conf/AR724X_BASE
+++ b/sys/mips/conf/AR724X_BASE
@@ -27,6 +27,9 @@ makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols
# modules already built.
makeoptions MODULES_OVERRIDE="random gpio ar71xx if_gif if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_pci hwpmc cam"
+# For small memory footprints
+options VM_KMEM_SIZE_SCALE=1
+
options DDB
options KDB
diff --git a/sys/mips/conf/AR934X_BASE b/sys/mips/conf/AR934X_BASE
index 7a62633..50af5f2 100644
--- a/sys/mips/conf/AR934X_BASE
+++ b/sys/mips/conf/AR934X_BASE
@@ -20,7 +20,7 @@ files "../atheros/files.ar71xx"
hints "AR934X_BASE.hints"
makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols
-makeoptions MODULES_OVERRIDE="random gpio ar71xx if_gif if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_ahb hwpmc"
+makeoptions MODULES_OVERRIDE="random gpio ar71xx if_gif if_gre if_vlan if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_ahb hwpmc ipfw ipfw_nat libalias"
# makeoptions MODULES_OVERRIDE=""
options DDB
diff --git a/sys/mips/include/pcpu.h b/sys/mips/include/pcpu.h
index 89b6525..f4be33d 100644
--- a/sys/mips/include/pcpu.h
+++ b/sys/mips/include/pcpu.h
@@ -31,6 +31,7 @@
#ifndef _MACHINE_PCPU_H_
#define _MACHINE_PCPU_H_
+#include <machine/cpufunc.h>
#include <machine/pte.h>
#define PCPU_MD_COMMON_FIELDS \
diff --git a/sys/mips/include/vmparam.h b/sys/mips/include/vmparam.h
index 89caf27..020d0ac 100644
--- a/sys/mips/include/vmparam.h
+++ b/sys/mips/include/vmparam.h
@@ -149,13 +149,12 @@
#define VM_PHYSSEG_SPARSE
/*
- * Create three free page pools: VM_FREEPOOL_DEFAULT is the default pool
+ * Create two free page pools: VM_FREEPOOL_DEFAULT is the default pool
* from which physical pages are allocated and VM_FREEPOOL_DIRECT is
* the pool from which physical pages for small UMA objects are
* allocated.
*/
-#define VM_NFREEPOOL 3
-#define VM_FREEPOOL_CACHE 2
+#define VM_NFREEPOOL 2
#define VM_FREEPOOL_DEFAULT 0
#define VM_FREEPOOL_DIRECT 1
diff --git a/sys/mips/mips/elf_machdep.c b/sys/mips/mips/elf_machdep.c
index d374713..8cbe8d3 100644
--- a/sys/mips/mips/elf_machdep.c
+++ b/sys/mips/mips/elf_machdep.c
@@ -83,6 +83,7 @@ struct sysentvec elf64_freebsd_sysvec = {
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
.sv_syscallnames = syscallnames,
.sv_schedtail = NULL,
+ .sv_thread_detach = NULL,
};
static Elf64_Brandinfo freebsd_brand_info = {
@@ -139,6 +140,7 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
.sv_syscallnames = syscallnames,
.sv_schedtail = NULL,
+ .sv_thread_detach = NULL,
};
static Elf32_Brandinfo freebsd_brand_info = {
diff --git a/sys/mips/mips/freebsd32_machdep.c b/sys/mips/mips/freebsd32_machdep.c
index 9de4685b..5303420 100644
--- a/sys/mips/mips/freebsd32_machdep.c
+++ b/sys/mips/mips/freebsd32_machdep.c
@@ -106,6 +106,7 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
.sv_syscallnames = freebsd32_syscallnames,
.sv_schedtail = NULL,
+ .sv_thread_detach = NULL,
};
INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec);
@@ -418,12 +419,6 @@ freebsd32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
sfp = (struct sigframe32 *)((vm_offset_t)(td->td_frame->sp -
sizeof(struct sigframe32)) & ~(sizeof(__int64_t) - 1));
- /* Translate the signal if appropriate */
- if (p->p_sysent->sv_sigtbl) {
- if (sig <= p->p_sysent->sv_sigsize)
- sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
- }
-
/* Build the argument list for the signal handler. */
td->td_frame->a0 = sig;
td->td_frame->a2 = (register_t)(intptr_t)&sfp->sf_uc;
diff --git a/sys/mips/mips/pm_machdep.c b/sys/mips/mips/pm_machdep.c
index 8f55280..d5f6df0 100644
--- a/sys/mips/mips/pm_machdep.c
+++ b/sys/mips/mips/pm_machdep.c
@@ -133,12 +133,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
sfp = (struct sigframe *)((vm_offset_t)(regs->sp -
sizeof(struct sigframe)) & ~(sizeof(__int64_t) - 1));
- /* Translate the signal if appropriate */
- if (p->p_sysent->sv_sigtbl) {
- if (sig <= p->p_sysent->sv_sigsize)
- sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
- }
-
/* Build the argument list for the signal handler. */
regs->a0 = sig;
regs->a2 = (register_t)(intptr_t)&sfp->sf_uc;
diff --git a/sys/modules/Makefile b/sys/modules/Makefile
index 7afc5a8..39b8bfd 100644
--- a/sys/modules/Makefile
+++ b/sys/modules/Makefile
@@ -196,6 +196,8 @@ SUBDIR= \
${_linprocfs} \
${_linsysfs} \
${_linux} \
+ ${_linux_common} \
+ ${_linux64} \
${_linuxapi} \
lmc \
lpt \
@@ -510,7 +512,6 @@ _io= io
.if ${MK_OFED} != "no" || defined(ALL_MODULES)
_ipoib= ipoib
.endif
-_ix= ix
_ixv= ixv
_linprocfs= linprocfs
_linsysfs= linsysfs
@@ -619,6 +620,8 @@ _x86bios= x86bios
.if ${MACHINE_CPUARCH} == "amd64"
_ixl= ixl
_ixlv= ixlv
+_linux64= linux64
+_linux_common= linux_common
_ntb= ntb
_qlxge= qlxge
_qlxgb= qlxgb
diff --git a/sys/modules/em/Makefile b/sys/modules/em/Makefile
index 3112d01..1de7c62 100644
--- a/sys/modules/em/Makefile
+++ b/sys/modules/em/Makefile
@@ -2,7 +2,8 @@
.PATH: ${.CURDIR}/../../dev/e1000
KMOD = if_em
-SRCS = device_if.h bus_if.h pci_if.h opt_inet.h opt_inet6.h
+SRCS = device_if.h bus_if.h pci_if.h opt_ddb.h opt_em.h opt_inet.h \
+ opt_inet6.h
SRCS += $(CORE_SRC) $(LEGACY_SRC)
SRCS += $(COMMON_SHARED) $(LEGACY_SHARED) $(PCIE_SHARED)
CORE_SRC = if_em.c e1000_osdep.c
diff --git a/sys/modules/geom/geom_map/Makefile b/sys/modules/geom/geom_map/Makefile
new file mode 100644
index 0000000..6b26ba9
--- /dev/null
+++ b/sys/modules/geom/geom_map/Makefile
@@ -0,0 +1,8 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../../../geom
+
+KMOD= geom_map
+SRCS= geom_map.c bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/controllers/Makefile b/sys/modules/i2c/controllers/Makefile
index 2b4432f..132ff2d 100644
--- a/sys/modules/i2c/controllers/Makefile
+++ b/sys/modules/i2c/controllers/Makefile
@@ -3,7 +3,7 @@
.if ${MACHINE} == "pc98"
SUBDIR = lpbb
.else
-SUBDIR = alpm amdpm amdsmb ichsmb intpm ismt nfsmb viapm lpbb pcf
+SUBDIR = alpm amdpm amdsmb ichiic ichsmb intpm ismt nfsmb viapm lpbb pcf
.endif
.include <bsd.subdir.mk>
diff --git a/sys/modules/i2c/controllers/ichiic/Makefile b/sys/modules/i2c/controllers/ichiic/Makefile
new file mode 100644
index 0000000..288a79e
--- /dev/null
+++ b/sys/modules/i2c/controllers/ichiic/Makefile
@@ -0,0 +1,8 @@
+#$FreeBSD$
+
+.PATH: ${.CURDIR}/../../../../dev/ichiic
+KMOD = ig4
+SRCS = device_if.h bus_if.h iicbb_if.h pci_if.h smbus_if.h \
+ ig4_iic.c ig4_pci.c ig4_reg.h ig4_var.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ixl/Makefile b/sys/modules/ixl/Makefile
index 7d2fca9..2f969a5 100755..100644
--- a/sys/modules/ixl/Makefile
+++ b/sys/modules/ixl/Makefile
@@ -3,14 +3,14 @@
.PATH: ${.CURDIR}/../../dev/ixl
KMOD = if_ixl
-SRCS = device_if.h bus_if.h pci_if.h opt_bdg.h
+SRCS = device_if.h bus_if.h pci_if.h pci_iov_if.h opt_bdg.h
SRCS += opt_inet.h opt_inet6.h opt_rss.h
SRCS += if_ixl.c ixl_txrx.c i40e_osdep.c
# Shared source
SRCS += i40e_common.c i40e_nvm.c i40e_adminq.c i40e_lan_hmc.c i40e_hmc.c
-CFLAGS += -DSMP
+CFLAGS += -DSMP -DIXL_DEBUG_SYSCTL
# Add Flow Director support
# CFLAGS += -DIXL_FDIR
diff --git a/sys/modules/ixlv/Makefile b/sys/modules/ixlv/Makefile
index 2e51bb8..3e2678e 100755
--- a/sys/modules/ixlv/Makefile
+++ b/sys/modules/ixlv/Makefile
@@ -8,7 +8,7 @@ SRCS += opt_inet.h opt_inet6.h opt_rss.h
SRCS += if_ixlv.c ixlvc.c ixl_txrx.c i40e_osdep.c
# Shared source
-SRCS += i40e_common.c i40e_nvm.c i40e_adminq.c i40e_lan_hmc.c i40e_hmc.c
+SRCS += i40e_common.c i40e_nvm.c i40e_adminq.c
CFLAGS += -DSMP
diff --git a/sys/modules/ixv/Makefile b/sys/modules/ixv/Makefile
index f8ce347..3207739 100644
--- a/sys/modules/ixv/Makefile
+++ b/sys/modules/ixv/Makefile
@@ -7,9 +7,8 @@ SRCS = device_if.h bus_if.h pci_if.h
SRCS += opt_inet.h opt_inet6.h opt_rss.h
SRCS += if_ixv.c ix_txrx.c
# Shared source
-SRCS += ixgbe_common.c ixgbe_api.c ixgbe_phy.c ixgbe_mbx.c ixgbe_vf.c
-SRCS += ixgbe_dcb.c ixgbe_dcb_82598.c ixgbe_dcb_82599.c
-SRCS += ixgbe_82598.c ixgbe_82599.c ixgbe_x540.c ixgbe_x550.c
+SRCS += ixgbe_common.c ixgbe_api.c ixgbe_phy.c
+SRCS += ixgbe_dcb.c ixgbe_mbx.c ixgbe_vf.c
CFLAGS+= -I${.CURDIR}/../../dev/ixgbe -DSMP
.include <bsd.kmod.mk>
diff --git a/sys/modules/linprocfs/Makefile b/sys/modules/linprocfs/Makefile
index 4b1b375..979429f 100644
--- a/sys/modules/linprocfs/Makefile
+++ b/sys/modules/linprocfs/Makefile
@@ -5,11 +5,6 @@
KMOD= linprocfs
SRCS= vnode_if.h \
device_if.h bus_if.h \
- linprocfs.c \
- opt_compat.h
-
-.if ${MACHINE_CPUARCH} == "amd64"
-CFLAGS+=-DCOMPAT_LINUX32
-.endif
+ linprocfs.c
.include <bsd.kmod.mk>
diff --git a/sys/modules/linsysfs/Makefile b/sys/modules/linsysfs/Makefile
index 4017967..13230ff 100644
--- a/sys/modules/linsysfs/Makefile
+++ b/sys/modules/linsysfs/Makefile
@@ -5,11 +5,6 @@
KMOD= linsysfs
SRCS= vnode_if.h \
device_if.h bus_if.h pci_if.h \
- linsysfs.c \
- opt_compat.h
-
-.if ${MACHINE_CPUARCH} == "amd64"
-CFLAGS+=-DCOMPAT_LINUX32
-.endif
+ linsysfs.c
.include <bsd.kmod.mk>
diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile
index a671a33..e887290 100644
--- a/sys/modules/linux/Makefile
+++ b/sys/modules/linux/Makefile
@@ -7,16 +7,18 @@ CFLAGS+=-DCOMPAT_FREEBSD32 -DCOMPAT_LINUX32
.PATH: ${.CURDIR}/../../compat/linux ${.CURDIR}/../../${MACHINE_CPUARCH}/linux${SFX}
+VDSO= linux${SFX}_vdso
+
KMOD= linux
-SRCS= linux_fork.c linux${SFX}_dummy.c linux_emul.c linux_file.c \
+SRCS= linux_fork.c linux${SFX}_dummy.c linux_file.c linux_event.c \
linux_futex.c linux_getcwd.c linux_ioctl.c linux_ipc.c \
- linux${SFX}_machdep.c linux_mib.c linux_misc.c linux_signal.c \
+ linux${SFX}_machdep.c linux_misc.c linux_signal.c \
linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \
- linux${SFX}_sysvec.c linux_uid16.c linux_util.c linux_time.c \
- linux_timer.c \
+ linux${SFX}_sysvec.c linux_uid16.c linux_time.c \
+ linux_timer.c linux_vdso.c \
opt_inet6.h opt_compat.h opt_posix.h opt_usb.h vnode_if.h \
device_if.h bus_if.h assym.s \
- linux${SFX}_locore.s linux${SFX}_support.s
+ linux${SFX}_support.s
DPSRCS= linux${SFX}_genassym.c
# XXX: for assym.s
@@ -25,31 +27,49 @@ SRCS+= opt_kstack_pages.h opt_nfs.h opt_compat.h opt_hwpmc_hooks.h
SRCS+= opt_apic.h
.endif
+OBJS= ${VDSO}.so
+
.if ${MACHINE_CPUARCH} == "i386"
-SRCS+= linux_ptrace.c imgact_linux.c opt_cpu.h
+SRCS+= linux_ptrace.c imgact_linux.c linux_util.c linux_mib.c \
+ linux_emul.c opt_cpu.h linux.c
.endif
+.if ${MACHINE_CPUARCH} == "i386"
EXPORT_SYMS=
EXPORT_SYMS+= linux_emul_path
EXPORT_SYMS+= linux_get_osname
EXPORT_SYMS+= linux_get_osrelease
-EXPORT_SYMS+= linux_ifname
EXPORT_SYMS+= linux_ioctl_register_handler
EXPORT_SYMS+= linux_ioctl_unregister_handler
+.endif
-CLEANFILES= linux${SFX}_assym.h linux${SFX}_genassym.o
+CLEANFILES= linux${SFX}_assym.h linux${SFX}_genassym.o linux${SFX}_locore.o
linux${SFX}_assym.h: linux${SFX}_genassym.o
sh ${SYSDIR}/kern/genassym.sh linux${SFX}_genassym.o > ${.TARGET}
linux${SFX}_locore.o: linux${SFX}_assym.h assym.s
- ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
+ ${CC} -x assembler-with-cpp -DLOCORE -m32 -shared -s \
+ -pipe -I. -I${SYSDIR} -Werror -Wall -fno-common -nostdinc -nostdlib \
+ -fno-omit-frame-pointer \
+ -Wl,-T${.CURDIR}/../../${MACHINE_CPUARCH}/linux${SFX}/${VDSO}.lds.s \
+ -Wl,-soname=${VDSO}.so.1,--eh-frame-hdr,-fPIC,-warn-common \
${.IMPSRC} -o ${.TARGET}
linux${SFX}_support.o: linux${SFX}_assym.h assym.s
${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
${.IMPSRC} -o ${.TARGET}
+.if ${MACHINE_CPUARCH} == "amd64"
+${VDSO}.so: linux${SFX}_locore.o
+ ${OBJCOPY} --input-target binary --output-target elf64-x86-64-freebsd \
+ --binary-architecture i386 linux${SFX}_locore.o ${.TARGET}
+.else
+${VDSO}.so: linux${SFX}_locore.o
+ ${OBJCOPY} --input-target binary --output-target elf32-i386-freebsd \
+ --binary-architecture i386 linux${SFX}_locore.o ${.TARGET}
+.endif
+
linux${SFX}_genassym.o:
${CC} -c ${CFLAGS:N-fno-common} ${.IMPSRC}
@@ -57,6 +77,9 @@ linux${SFX}_genassym.o:
.if defined(KTR)
CFLAGS+= -DKTR
.endif
+.if defined(DEBUG)
+CFLAGS+= -DDEBUG
+.endif
.endif
.include <bsd.kmod.mk>
diff --git a/sys/modules/linux64/Makefile b/sys/modules/linux64/Makefile
new file mode 100644
index 0000000..1656323
--- /dev/null
+++ b/sys/modules/linux64/Makefile
@@ -0,0 +1,55 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../../compat/linux ${.CURDIR}/../../${MACHINE_ARCH}/linux
+
+VDSO= linux_vdso
+
+KMOD= linux64
+SRCS= linux_fork.c linux_dummy.c linux_file.c linux_event.c \
+ linux_futex.c linux_getcwd.c linux_ioctl.c linux_ipc.c \
+ linux_machdep.c linux_misc.c linux_signal.c \
+ linux_socket.c linux_stats.c linux_sysctl.c linux_sysent.c \
+ linux_sysvec.c linux_time.c linux_vdso.c linux_timer.c \
+ opt_inet6.h opt_compat.h opt_kdtrace.h opt_posix.h opt_usb.h \
+ vnode_if.h device_if.h bus_if.h assym.s \
+ linux_support.s
+DPSRCS= linux_genassym.c
+
+# XXX: for assym.s
+SRCS+= opt_kstack_pages.h opt_nfs.h opt_apic.h opt_hwpmc_hooks.h
+
+CLEANFILES= linux_assym.h linux_genassym.o linux_locore.o
+
+OBJS= ${VDSO}.so
+
+linux_assym.h: linux_genassym.o
+ sh ${SYSDIR}/kern/genassym.sh linux_genassym.o > ${.TARGET}
+
+linux_locore.o: linux_locore.s linux_assym.h
+ ${CC} -x assembler-with-cpp -DLOCORE -shared -mcmodel=small \
+ -pipe -I. -I${SYSDIR} -Werror -Wall -fno-common -nostdinc \
+ -Wl,-T${.CURDIR}/../../${MACHINE_CPUARCH}/linux/${VDSO}.lds.s \
+ -Wl,-soname=${VDSO}.so.1,-fPIC,-warn-common -nostdlib \
+ ${.IMPSRC} -o ${.TARGET}
+
+${VDSO}.so: linux_locore.o
+ ${OBJCOPY} --input-target binary --output-target elf64-x86-64-freebsd \
+ -S -g --binary-architecture i386:x86-64 linux_locore.o ${.TARGET}
+
+linux_support.o: assym.s linux_assym.h
+ ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
+ ${.IMPSRC} -o ${.TARGET}
+
+linux_genassym.o:
+ ${CC} -c ${CFLAGS:N-fno-common} ${.IMPSRC}
+
+.if !defined(KERNBUILDDIR)
+.if defined(DEBUG)
+CFLAGS+=-DDEBUG
+.endif
+.if defined(KTR)
+CFLAGS+=-DKTR
+.endif
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/linux_common/Makefile b/sys/modules/linux_common/Makefile
new file mode 100644
index 0000000..91449f7
--- /dev/null
+++ b/sys/modules/linux_common/Makefile
@@ -0,0 +1,25 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../../compat/linux
+
+KMOD= linux_common
+SRCS= linux_common.c linux_mib.c linux_util.c linux_emul.c \
+ linux.c opt_compat.h device_if.h vnode_if.h bus_if.h
+
+EXPORT_SYMS=
+EXPORT_SYMS+= linux_emul_path
+EXPORT_SYMS+= linux_ioctl_register_handler
+EXPORT_SYMS+= linux_ioctl_unregister_handler
+EXPORT_SYMS+= linux_get_osname
+EXPORT_SYMS+= linux_get_osrelease
+
+.if !defined(KERNBUILDDIR)
+.if defined(DEBUG)
+CFLAGS+=-DDEBUG
+.endif
+.if defined(KTR)
+CFLAGS+=-DKTR
+.endif
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/proto/Makefile b/sys/modules/proto/Makefile
index 4cfbd72..3038c77 100644
--- a/sys/modules/proto/Makefile
+++ b/sys/modules/proto/Makefile
@@ -5,6 +5,7 @@
KMOD= proto
SRCS= \
proto_bus_pci.c \
+ proto_busdma.c \
proto_core.c
SRCS+= \
diff --git a/sys/modules/pseudofs/Makefile b/sys/modules/pseudofs/Makefile
index d5696c5..6ddb749 100644
--- a/sys/modules/pseudofs/Makefile
+++ b/sys/modules/pseudofs/Makefile
@@ -23,4 +23,10 @@ EXPORT_SYMS= pfs_mount \
pfs_enable \
pfs_destroy
+.if !defined(KERNBUILDDIR)
+.if defined(PSEUDOFS_TRACE)
+CFLAGS+=-DPSEUDOFS_TRACE
+.endif
+.endif
+
.include <bsd.kmod.mk>
diff --git a/sys/modules/sfxge/Makefile b/sys/modules/sfxge/Makefile
index 48a2983..b2116d8 100644
--- a/sys/modules/sfxge/Makefile
+++ b/sys/modules/sfxge/Makefile
@@ -9,22 +9,32 @@ SRCS+= opt_inet.h opt_inet6.h opt_sched.h
.PATH: ${.CURDIR}/../../dev/sfxge
SRCS+= sfxge.c sfxge_dma.c sfxge_ev.c
-SRCS+= sfxge_intr.c sfxge_mcdi.c
+SRCS+= sfxge_intr.c sfxge_mcdi.c sfxge_nvram.c
SRCS+= sfxge_port.c sfxge_rx.c sfxge_tx.c
SRCS+= sfxge.h sfxge_rx.h sfxge_tx.h sfxge_version.h
.PATH: ${.CURDIR}/../../dev/sfxge/common
-SRCS+= efx_ev.c efx_intr.c efx_mac.c efx_mcdi.c efx_nic.c
+SRCS+= efx_bootcfg.c efx_crc32.c efx_ev.c efx_intr.c efx_mac.c
+SRCS+= efx_mcdi.c efx_mon.c efx_nic.c
SRCS+= efx_nvram.c efx_phy.c efx_port.c efx_rx.c efx_sram.c efx_tx.c
-SRCS+= efx_vpd.c efx_wol.c
+SRCS+= efx_vpd.c efx_wol.c efx_filter.c efx_hash.c
SRCS+= efsys.h
-SRCS+= efx.h efx_impl.h efx_mcdi.h efx_regs.h efx_regs_ef10.h
-SRCS+= efx_regs_mcdi.h efx_regs_pci.h efx_types.h
+SRCS+= efx.h efx_check.h efx_impl.h efx_mcdi.h efx_regs.h efx_regs_ef10.h
+SRCS+= efx_regs_mcdi.h efx_regs_pci.h efx_types.h efx_phy_ids.h
+SRCS+= ef10_tlv_layout.h
-SRCS+= siena_mac.c siena_nic.c siena_nvram.c siena_phy.c
+SRCS+= mcdi_mon.c mcdi_mon.h
+
+SRCS+= siena_mac.c siena_mcdi.c siena_nic.c siena_nvram.c siena_phy.c
SRCS+= siena_sram.c siena_vpd.c
SRCS+= siena_flash.h siena_impl.h
-DEBUG_FLAGS= -DDEBUG=1
+SRCS+= hunt_ev.c hunt_intr.c hunt_mac.c hunt_mcdi.c hunt_nic.c
+SRCS+= hunt_nvram.c hunt_rx.c hunt_phy.c hunt_sram.c hunt_tx.c hunt_vpd.c
+SRCS+= hunt_filter.c
+SRCS+= hunt_impl.h
+
+# Extra debug checks
+#CFLAGS += -DDEBUG=1
.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/template/Makefile b/sys/modules/usb/template/Makefile
index fc1cca9..4164177 100644
--- a/sys/modules/usb/template/Makefile
+++ b/sys/modules/usb/template/Makefile
@@ -40,6 +40,7 @@ SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h usbdevs.h \
usb_template_msc.c \
usb_template_mtp.c \
usb_template_phone.c \
- usb_template_serialnet.c
+ usb_template_serialnet.c \
+ usb_template_midi.c
.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/ugold/Makefile b/sys/modules/usb/ugold/Makefile
new file mode 100644
index 0000000..48af6ef
--- /dev/null
+++ b/sys/modules/usb/ugold/Makefile
@@ -0,0 +1,13 @@
+#
+# $FreeBSD$
+#
+
+S= ${.CURDIR}/../../..
+
+.PATH: $S/dev/usb/misc
+
+KMOD= ugold
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h \
+ usbdevs.h ugold.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c
index 2fa7e9a..3902227 100644
--- a/sys/net80211/ieee80211.c
+++ b/sys/net80211/ieee80211.c
@@ -35,9 +35,10 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
-
#include <sys/socket.h>
+#include <machine/stdarg.h>
+
#include <net/if.h>
#include <net/if_var.h>
#include <net/if_dl.h>
@@ -81,7 +82,7 @@ const int ieee80211_opcap[IEEE80211_OPMODE_MAX] = {
#endif
};
-static const uint8_t ieee80211broadcastaddr[IEEE80211_ADDR_LEN] =
+const uint8_t ieee80211broadcastaddr[IEEE80211_ADDR_LEN] =
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
static void ieee80211_syncflag_locked(struct ieee80211com *ic, int flag);
@@ -94,6 +95,7 @@ static void ieee80211com_media_status(struct ifnet *, struct ifmediareq *);
static int ieee80211com_media_change(struct ifnet *);
static int media_status(enum ieee80211_opmode,
const struct ieee80211_channel *);
+static uint64_t ieee80211_get_counter(struct ifnet *, ift_counter);
MALLOC_DEFINE(M_80211_VAP, "80211vap", "802.11 vap state");
@@ -223,15 +225,17 @@ ieee80211_chan_init(struct ieee80211com *ic)
}
static void
-null_update_mcast(struct ifnet *ifp)
+null_update_mcast(struct ieee80211com *ic)
{
- if_printf(ifp, "need multicast update callback\n");
+
+ ic_printf(ic, "need multicast update callback\n");
}
static void
-null_update_promisc(struct ifnet *ifp)
+null_update_promisc(struct ieee80211com *ic)
{
- if_printf(ifp, "need promiscuous mode update callback\n");
+
+ ic_printf(ic, "need promiscuous mode update callback\n");
}
static int
@@ -242,15 +246,9 @@ null_transmit(struct ifnet *ifp, struct mbuf *m)
return EACCES; /* XXX EIO/EPERM? */
}
-#if __FreeBSD_version >= 1000031
static int
null_output(struct ifnet *ifp, struct mbuf *m,
const struct sockaddr *dst, struct route *ro)
-#else
-static int
-null_output(struct ifnet *ifp, struct mbuf *m,
- struct sockaddr *dst, struct route *ro)
-#endif
{
if_printf(ifp, "discard raw packet\n");
return null_transmit(ifp, m);
@@ -267,7 +265,20 @@ static void
null_update_chw(struct ieee80211com *ic)
{
- if_printf(ic->ic_ifp, "%s: need callback\n", __func__);
+ ic_printf(ic, "%s: need callback\n", __func__);
+}
+
+int
+ic_printf(struct ieee80211com *ic, const char * fmt, ...)
+{
+ va_list ap;
+ int retval;
+
+ retval = printf("%s: ", ic->ic_name);
+ va_start(ap, fmt);
+ retval += vprintf(fmt, ap);
+ va_end(ap);
+ return (retval);
}
/*
@@ -284,15 +295,17 @@ ieee80211_ifattach(struct ieee80211com *ic,
KASSERT(ifp->if_type == IFT_IEEE80211, ("if_type %d", ifp->if_type));
- IEEE80211_LOCK_INIT(ic, ifp->if_xname);
- IEEE80211_TX_LOCK_INIT(ic, ifp->if_xname);
+ IEEE80211_LOCK_INIT(ic, ic->ic_name);
+ IEEE80211_TX_LOCK_INIT(ic, ic->ic_name);
TAILQ_INIT(&ic->ic_vaps);
/* Create a taskqueue for all state changes */
ic->ic_tq = taskqueue_create("ic_taskq", M_WAITOK | M_ZERO,
taskqueue_thread_enqueue, &ic->ic_tq);
taskqueue_start_threads(&ic->ic_tq, 1, PI_NET, "%s net80211 taskq",
- ifp->if_xname);
+ ic->ic_name);
+ ic->ic_ierrors = counter_u64_alloc(M_WAITOK);
+ ic->ic_oerrors = counter_u64_alloc(M_WAITOK);
/*
* Fill in 802.11 available channel set, mark all
* available channels as active, and pick a default
@@ -391,6 +404,8 @@ ieee80211_ifdetach(struct ieee80211com *ic)
/* XXX VNET needed? */
ifmedia_removeall(&ic->ic_media);
+ counter_u64_free(ic->ic_ierrors);
+ counter_u64_free(ic->ic_oerrors);
taskqueue_free(ic->ic_tq);
IEEE80211_TX_LOCK_DESTROY(ic);
@@ -413,6 +428,31 @@ default_reset(struct ieee80211vap *vap, u_long cmd)
}
/*
+ * Add underlying device errors to vap errors.
+ */
+static uint64_t
+ieee80211_get_counter(struct ifnet *ifp, ift_counter cnt)
+{
+ struct ieee80211vap *vap = ifp->if_softc;
+ struct ieee80211com *ic = vap->iv_ic;
+ uint64_t rv;
+
+ rv = if_get_counter_default(ifp, cnt);
+ switch (cnt) {
+ case IFCOUNTER_OERRORS:
+ rv += counter_u64_fetch(ic->ic_oerrors);
+ break;
+ case IFCOUNTER_IERRORS:
+ rv += counter_u64_fetch(ic->ic_ierrors);
+ break;
+ default:
+ break;
+ }
+
+ return (rv);
+}
+
+/*
* Prepare a vap for use. Drivers use this call to
* setup net80211 state in new vap's prior attaching
* them with ieee80211_vap_attach (below).
@@ -427,7 +467,7 @@ ieee80211_vap_setup(struct ieee80211com *ic, struct ieee80211vap *vap,
ifp = if_alloc(IFT_ETHER);
if (ifp == NULL) {
- if_printf(ic->ic_ifp, "%s: unable to allocate ifnet\n",
+ ic_printf(ic, "%s: unable to allocate ifnet\n",
__func__);
return ENOMEM;
}
@@ -438,6 +478,7 @@ ieee80211_vap_setup(struct ieee80211com *ic, struct ieee80211vap *vap,
ifp->if_qflush = ieee80211_vap_qflush;
ifp->if_ioctl = ieee80211_ioctl;
ifp->if_init = ieee80211_init;
+ ifp->if_get_counter = ieee80211_get_counter;
vap->iv_ifp = ifp;
vap->iv_ic = ic;
@@ -551,7 +592,7 @@ ieee80211_vap_attach(struct ieee80211vap *vap,
IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE,
"%s: %s parent %s flags 0x%x flags_ext 0x%x\n",
__func__, ieee80211_opmode_name[vap->iv_opmode],
- ic->ic_ifp->if_xname, vap->iv_flags, vap->iv_flags_ext);
+ ic->ic_name, vap->iv_flags, vap->iv_flags_ext);
/*
* Do late attach work that cannot happen until after
@@ -607,8 +648,7 @@ ieee80211_vap_detach(struct ieee80211vap *vap)
CURVNET_SET(ifp->if_vnet);
IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, "%s: %s parent %s\n",
- __func__, ieee80211_opmode_name[vap->iv_opmode],
- ic->ic_ifp->if_xname);
+ __func__, ieee80211_opmode_name[vap->iv_opmode], ic->ic_name);
/* NB: bpfdetach is called by ether_ifdetach and claims all taps */
ether_ifdetach(ifp);
@@ -900,7 +940,7 @@ int
ieee80211_chan2ieee(struct ieee80211com *ic, const struct ieee80211_channel *c)
{
if (c == NULL) {
- if_printf(ic->ic_ifp, "invalid channel (NULL)\n");
+ ic_printf(ic, "invalid channel (NULL)\n");
return 0; /* XXX */
}
return (c == IEEE80211_CHAN_ANYC ? IEEE80211_CHAN_ANY : c->ic_ieee);
@@ -991,6 +1031,75 @@ ieee80211_find_channel_byieee(struct ieee80211com *ic, int ieee, int flags)
return NULL;
}
+/*
+ * Lookup a channel suitable for the given rx status.
+ *
+ * This is used to find a channel for a frame (eg beacon, probe
+ * response) based purely on the received PHY information.
+ *
+ * For now it tries to do it based on R_FREQ / R_IEEE.
+ * This is enough for 11bg and 11a (and thus 11ng/11na)
+ * but it will not be enough for GSM, PSB channels and the
+ * like. It also doesn't know about legacy-turbog and
+ * legacy-turbo modes, which some offload NICs actually
+ * support in weird ways.
+ *
+ * Takes the ic and rxstatus; returns the channel or NULL
+ * if not found.
+ *
+ * XXX TODO: Add support for that when the need arises.
+ */
+struct ieee80211_channel *
+ieee80211_lookup_channel_rxstatus(struct ieee80211vap *vap,
+ const struct ieee80211_rx_stats *rxs)
+{
+ struct ieee80211com *ic = vap->iv_ic;
+ uint32_t flags;
+ struct ieee80211_channel *c;
+
+ if (rxs == NULL)
+ return (NULL);
+
+ /*
+ * Strictly speaking we only use freq for now,
+ * however later on we may wish to just store
+ * the ieee for verification.
+ */
+ if ((rxs->r_flags & IEEE80211_R_FREQ) == 0)
+ return (NULL);
+ if ((rxs->r_flags & IEEE80211_R_IEEE) == 0)
+ return (NULL);
+
+ /*
+ * If the rx status contains a valid ieee/freq, then
+ * ensure we populate the correct channel information
+ * in rxchan before passing it up to the scan infrastructure.
+ * Offload NICs will pass up beacons from all channels
+ * during background scans.
+ */
+
+ /* Determine a band */
+ /* XXX should be done by the driver? */
+ if (rxs->c_freq < 3000) {
+ flags = IEEE80211_CHAN_G;
+ } else {
+ flags = IEEE80211_CHAN_A;
+ }
+
+ /* Channel lookup */
+ c = ieee80211_find_channel(ic, rxs->c_freq, flags);
+
+ IEEE80211_DPRINTF(vap, IEEE80211_MSG_INPUT,
+ "%s: freq=%d, ieee=%d, flags=0x%08x; c=%p\n",
+ __func__,
+ (int) rxs->c_freq,
+ (int) rxs->c_ieee,
+ flags,
+ c);
+
+ return (c);
+}
+
static void
addmedia(struct ifmedia *media, int caps, int addsta, int mode, int mword)
{
@@ -1169,7 +1278,6 @@ ieee80211_get_suprates(struct ieee80211com *ic, const struct ieee80211_channel *
void
ieee80211_announce(struct ieee80211com *ic)
{
- struct ifnet *ifp = ic->ic_ifp;
int i, rate, mword;
enum ieee80211_phymode mode;
const struct ieee80211_rateset *rs;
@@ -1178,7 +1286,7 @@ ieee80211_announce(struct ieee80211com *ic)
for (mode = IEEE80211_MODE_AUTO+1; mode < IEEE80211_MODE_11NA; mode++) {
if (isclr(ic->ic_modecaps, mode))
continue;
- if_printf(ifp, "%s rates: ", ieee80211_phymode_name[mode]);
+ ic_printf(ic, "%s rates: ", ieee80211_phymode_name[mode]);
rs = &ic->ic_sup_rates[mode];
for (i = 0; i < rs->rs_nrates; i++) {
mword = ieee80211_rate2media(ic, rs->rs_rates[i], mode);
diff --git a/sys/net80211/ieee80211.h b/sys/net80211/ieee80211.h
index 8e586bd..64d0754 100644
--- a/sys/net80211/ieee80211.h
+++ b/sys/net80211/ieee80211.h
@@ -36,6 +36,10 @@
/* is 802.11 address multicast/broadcast? */
#define IEEE80211_IS_MULTICAST(_a) (*(_a) & 0x01)
+#ifdef _KERNEL
+extern const uint8_t ieee80211broadcastaddr[];
+#endif
+
typedef uint16_t ieee80211_seq;
/* IEEE 802.11 PLCP header */
@@ -812,7 +816,7 @@ struct ieee80211_csa_ie {
#define IEEE80211_RATE_BASIC 0x80
#define IEEE80211_RATE_VAL 0x7f
-/* EPR information element flags */
+/* ERP information element flags */
#define IEEE80211_ERP_NON_ERP_PRESENT 0x01
#define IEEE80211_ERP_USE_PROTECTION 0x02
#define IEEE80211_ERP_LONG_PREAMBLE 0x04
diff --git a/sys/net80211/ieee80211_acl.c b/sys/net80211/ieee80211_acl.c
index ac604fb..eeb7f0b 100644
--- a/sys/net80211/ieee80211_acl.c
+++ b/sys/net80211/ieee80211_acl.c
@@ -99,8 +99,8 @@ acl_attach(struct ieee80211vap *vap)
{
struct aclstate *as;
- as = (struct aclstate *) malloc(sizeof(struct aclstate),
- M_80211_ACL, M_NOWAIT | M_ZERO);
+ as = (struct aclstate *) IEEE80211_MALLOC(sizeof(struct aclstate),
+ M_80211_ACL, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (as == NULL)
return 0;
ACL_LOCK_INIT(as, "acl");
@@ -123,7 +123,7 @@ acl_detach(struct ieee80211vap *vap)
acl_free_all(vap);
vap->iv_as = NULL;
ACL_LOCK_DESTROY(as);
- free(as, M_80211_ACL);
+ IEEE80211_FREE(as, M_80211_ACL);
}
static __inline struct acl *
@@ -147,7 +147,7 @@ _acl_free(struct aclstate *as, struct acl *acl)
TAILQ_REMOVE(&as->as_list, acl, acl_list);
LIST_REMOVE(acl, acl_hash);
- free(acl, M_80211_ACL);
+ IEEE80211_FREE(acl, M_80211_ACL);
as->as_nacls--;
}
@@ -175,7 +175,8 @@ acl_add(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN])
struct acl *acl, *new;
int hash;
- new = (struct acl *) malloc(sizeof(struct acl), M_80211_ACL, M_NOWAIT | M_ZERO);
+ new = (struct acl *) IEEE80211_MALLOC(sizeof(struct acl),
+ M_80211_ACL, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (new == NULL) {
IEEE80211_DPRINTF(vap, IEEE80211_MSG_ACL,
"ACL: add %s failed, no memory\n", ether_sprintf(mac));
@@ -188,7 +189,7 @@ acl_add(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN])
LIST_FOREACH(acl, &as->as_hash[hash], acl_hash) {
if (IEEE80211_ADDR_EQ(acl->acl_macaddr, mac)) {
ACL_UNLOCK(as);
- free(new, M_80211_ACL);
+ IEEE80211_FREE(new, M_80211_ACL);
IEEE80211_DPRINTF(vap, IEEE80211_MSG_ACL,
"ACL: add %s failed, already present\n",
ether_sprintf(mac));
@@ -302,8 +303,8 @@ acl_getioctl(struct ieee80211vap *vap, struct ieee80211req *ireq)
ireq->i_len = space; /* return required space */
return 0; /* NB: must not error */
}
- ap = (struct ieee80211req_maclist *) malloc(space,
- M_TEMP, M_NOWAIT);
+ ap = (struct ieee80211req_maclist *) IEEE80211_MALLOC(space,
+ M_TEMP, IEEE80211_M_NOWAIT);
if (ap == NULL)
return ENOMEM;
i = 0;
@@ -318,7 +319,7 @@ acl_getioctl(struct ieee80211vap *vap, struct ieee80211req *ireq)
ireq->i_len = space;
} else
error = copyout(ap, ireq->i_data, ireq->i_len);
- free(ap, M_TEMP);
+ IEEE80211_FREE(ap, M_TEMP);
return error;
}
return EINVAL;
diff --git a/sys/net80211/ieee80211_adhoc.c b/sys/net80211/ieee80211_adhoc.c
index 0d761c4..d31ad9b 100644
--- a/sys/net80211/ieee80211_adhoc.c
+++ b/sys/net80211/ieee80211_adhoc.c
@@ -70,11 +70,12 @@ __FBSDID("$FreeBSD$");
static void adhoc_vattach(struct ieee80211vap *);
static int adhoc_newstate(struct ieee80211vap *, enum ieee80211_state, int);
-static int adhoc_input(struct ieee80211_node *, struct mbuf *, int, int);
+static int adhoc_input(struct ieee80211_node *, struct mbuf *,
+ const struct ieee80211_rx_stats *, int, int);
static void adhoc_recv_mgmt(struct ieee80211_node *, struct mbuf *,
- int subtype, int, int);
+ int subtype, const struct ieee80211_rx_stats *, int, int);
static void ahdemo_recv_mgmt(struct ieee80211_node *, struct mbuf *,
- int subtype, int, int);
+ int subtype, const struct ieee80211_rx_stats *rxs, int, int);
static void adhoc_recv_ctl(struct ieee80211_node *, struct mbuf *, int subtype);
void
@@ -289,7 +290,8 @@ doprint(struct ieee80211vap *vap, int subtype)
* by the 802.11 layer.
*/
static int
-adhoc_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf)
+adhoc_input(struct ieee80211_node *ni, struct mbuf *m,
+ const struct ieee80211_rx_stats *rxs, int rssi, int nf)
{
struct ieee80211vap *vap = ni->ni_vap;
struct ieee80211com *ic = ni->ni_ic;
@@ -642,7 +644,7 @@ adhoc_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf)
vap->iv_stats.is_rx_mgtdiscard++; /* XXX */
goto out;
}
- vap->iv_recv_mgmt(ni, m, subtype, rssi, nf);
+ vap->iv_recv_mgmt(ni, m, subtype, rxs, rssi, nf);
goto out;
case IEEE80211_FC0_TYPE_CTL:
@@ -687,10 +689,11 @@ is11bclient(const uint8_t *rates, const uint8_t *xrates)
static void
adhoc_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
- int subtype, int rssi, int nf)
+ int subtype, const struct ieee80211_rx_stats *rxs, int rssi, int nf)
{
struct ieee80211vap *vap = ni->ni_vap;
struct ieee80211com *ic = ni->ni_ic;
+ struct ieee80211_channel *rxchan = ic->ic_curchan;
struct ieee80211_frame *wh;
uint8_t *frm, *efrm, *sfrm;
uint8_t *ssid, *rates, *xrates;
@@ -705,11 +708,17 @@ adhoc_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
case IEEE80211_FC0_SUBTYPE_PROBE_RESP:
case IEEE80211_FC0_SUBTYPE_BEACON: {
struct ieee80211_scanparams scan;
+ struct ieee80211_channel *c;
/*
* We process beacon/probe response
* frames to discover neighbors.
*/
- if (ieee80211_parse_beacon(ni, m0, &scan) != 0)
+ if (rxs != NULL) {
+ c = ieee80211_lookup_channel_rxstatus(vap, rxs);
+ if (c != NULL)
+ rxchan = c;
+ }
+ if (ieee80211_parse_beacon(ni, m0, rxchan, &scan) != 0)
return;
/*
* Count frame now that we know it's to be processed.
@@ -735,7 +744,7 @@ adhoc_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
ieee80211_probe_curchan(vap, 1);
ic->ic_flags_ext &= ~IEEE80211_FEXT_PROBECHAN;
}
- ieee80211_add_scan(vap, ic->ic_curchan, &scan, wh,
+ ieee80211_add_scan(vap, rxchan, &scan, wh,
subtype, rssi, nf);
return;
}
@@ -911,7 +920,7 @@ adhoc_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
static void
ahdemo_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
- int subtype, int rssi, int nf)
+ int subtype, const struct ieee80211_rx_stats *rxs, int rssi, int nf)
{
struct ieee80211vap *vap = ni->ni_vap;
struct ieee80211com *ic = ni->ni_ic;
@@ -922,7 +931,7 @@ ahdemo_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
* a site-survey.
*/
if (ic->ic_flags & IEEE80211_F_SCAN)
- adhoc_recv_mgmt(ni, m0, subtype, rssi, nf);
+ adhoc_recv_mgmt(ni, m0, subtype, rxs, rssi, nf);
else {
wh = mtod(m0, struct ieee80211_frame *);
switch (subtype) {
diff --git a/sys/net80211/ieee80211_amrr.c b/sys/net80211/ieee80211_amrr.c
index b1d92c8..b7c11fd 100644
--- a/sys/net80211/ieee80211_amrr.c
+++ b/sys/net80211/ieee80211_amrr.c
@@ -113,8 +113,8 @@ amrr_init(struct ieee80211vap *vap)
KASSERT(vap->iv_rs == NULL, ("%s called multiple times", __func__));
- amrr = vap->iv_rs = malloc(sizeof(struct ieee80211_amrr),
- M_80211_RATECTL, M_NOWAIT|M_ZERO);
+ amrr = vap->iv_rs = IEEE80211_MALLOC(sizeof(struct ieee80211_amrr),
+ M_80211_RATECTL, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (amrr == NULL) {
if_printf(vap->iv_ifp, "couldn't alloc ratectl structure\n");
return;
@@ -128,7 +128,7 @@ amrr_init(struct ieee80211vap *vap)
static void
amrr_deinit(struct ieee80211vap *vap)
{
- free(vap->iv_rs, M_80211_RATECTL);
+ IEEE80211_FREE(vap->iv_rs, M_80211_RATECTL);
}
/*
@@ -160,8 +160,8 @@ amrr_node_init(struct ieee80211_node *ni)
uint8_t rate;
if (ni->ni_rctls == NULL) {
- ni->ni_rctls = amn = malloc(sizeof(struct ieee80211_amrr_node),
- M_80211_RATECTL, M_NOWAIT|M_ZERO);
+ ni->ni_rctls = amn = IEEE80211_MALLOC(sizeof(struct ieee80211_amrr_node),
+ M_80211_RATECTL, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (amn == NULL) {
if_printf(vap->iv_ifp, "couldn't alloc per-node ratectl "
"structure\n");
@@ -225,7 +225,7 @@ amrr_node_init(struct ieee80211_node *ni)
static void
amrr_node_deinit(struct ieee80211_node *ni)
{
- free(ni->ni_rctls, M_80211_RATECTL);
+ IEEE80211_FREE(ni->ni_rctls, M_80211_RATECTL);
}
static int
diff --git a/sys/net80211/ieee80211_crypto_ccmp.c b/sys/net80211/ieee80211_crypto_ccmp.c
index cb9ed0a..89ca6d0 100644
--- a/sys/net80211/ieee80211_crypto_ccmp.c
+++ b/sys/net80211/ieee80211_crypto_ccmp.c
@@ -96,8 +96,8 @@ ccmp_attach(struct ieee80211vap *vap, struct ieee80211_key *k)
{
struct ccmp_ctx *ctx;
- ctx = (struct ccmp_ctx *) malloc(sizeof(struct ccmp_ctx),
- M_80211_CRYPTO, M_NOWAIT | M_ZERO);
+ ctx = (struct ccmp_ctx *) IEEE80211_MALLOC(sizeof(struct ccmp_ctx),
+ M_80211_CRYPTO, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (ctx == NULL) {
vap->iv_stats.is_crypto_nomem++;
return NULL;
@@ -113,7 +113,7 @@ ccmp_detach(struct ieee80211_key *k)
{
struct ccmp_ctx *ctx = k->wk_private;
- free(ctx, M_80211_CRYPTO);
+ IEEE80211_FREE(ctx, M_80211_CRYPTO);
KASSERT(nrefs > 0, ("imbalanced attach/detach"));
nrefs--; /* NB: we assume caller locking */
}
diff --git a/sys/net80211/ieee80211_crypto_tkip.c b/sys/net80211/ieee80211_crypto_tkip.c
index 05d9c74..c6d2f54 100644
--- a/sys/net80211/ieee80211_crypto_tkip.c
+++ b/sys/net80211/ieee80211_crypto_tkip.c
@@ -109,8 +109,8 @@ tkip_attach(struct ieee80211vap *vap, struct ieee80211_key *k)
{
struct tkip_ctx *ctx;
- ctx = (struct tkip_ctx *) malloc(sizeof(struct tkip_ctx),
- M_80211_CRYPTO, M_NOWAIT | M_ZERO);
+ ctx = (struct tkip_ctx *) IEEE80211_MALLOC(sizeof(struct tkip_ctx),
+ M_80211_CRYPTO, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (ctx == NULL) {
vap->iv_stats.is_crypto_nomem++;
return NULL;
@@ -126,7 +126,7 @@ tkip_detach(struct ieee80211_key *k)
{
struct tkip_ctx *ctx = k->wk_private;
- free(ctx, M_80211_CRYPTO);
+ IEEE80211_FREE(ctx, M_80211_CRYPTO);
KASSERT(nrefs > 0, ("imbalanced attach/detach"));
nrefs--; /* NB: we assume caller locking */
}
diff --git a/sys/net80211/ieee80211_crypto_wep.c b/sys/net80211/ieee80211_crypto_wep.c
index 07c1797..587cf39 100644
--- a/sys/net80211/ieee80211_crypto_wep.c
+++ b/sys/net80211/ieee80211_crypto_wep.c
@@ -87,8 +87,8 @@ wep_attach(struct ieee80211vap *vap, struct ieee80211_key *k)
{
struct wep_ctx *ctx;
- ctx = (struct wep_ctx *) malloc(sizeof(struct wep_ctx),
- M_80211_CRYPTO, M_NOWAIT | M_ZERO);
+ ctx = (struct wep_ctx *) IEEE80211_MALLOC(sizeof(struct wep_ctx),
+ M_80211_CRYPTO, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (ctx == NULL) {
vap->iv_stats.is_crypto_nomem++;
return NULL;
@@ -106,7 +106,7 @@ wep_detach(struct ieee80211_key *k)
{
struct wep_ctx *ctx = k->wk_private;
- free(ctx, M_80211_CRYPTO);
+ IEEE80211_FREE(ctx, M_80211_CRYPTO);
KASSERT(nrefs > 0, ("imbalanced attach/detach"));
nrefs--; /* NB: we assume caller locking */
}
diff --git a/sys/net80211/ieee80211_ddb.c b/sys/net80211/ieee80211_ddb.c
index 74e82e5..e646cf2 100644
--- a/sys/net80211/ieee80211_ddb.c
+++ b/sys/net80211/ieee80211_ddb.c
@@ -521,6 +521,7 @@ _db_show_com(const struct ieee80211com *ic, int showvaps, int showsta,
db_printf(" %s(%p)", vap->iv_ifp->if_xname, vap);
db_printf("\n");
db_printf("\tifp %p(%s)", ic->ic_ifp, ic->ic_ifp->if_xname);
+ db_printf("\tname %s", ic->ic_name);
db_printf(" comlock %p", &ic->ic_comlock);
db_printf("\n");
db_printf("\theadroom %d", ic->ic_headroom);
diff --git a/sys/net80211/ieee80211_dfs.c b/sys/net80211/ieee80211_dfs.c
index 5fa9ba4..232ceb7 100644
--- a/sys/net80211/ieee80211_dfs.c
+++ b/sys/net80211/ieee80211_dfs.c
@@ -253,8 +253,8 @@ dfs_timeout(void *arg)
* msg instead of one for every channel
* table entry.
*/
- if_printf(ic->ic_ifp, "radar on channel"
- " %u (%u MHz) cleared after timeout\n",
+ ic_printf(ic, "radar on channel %u "
+ "(%u MHz) cleared after timeout\n",
c->ic_ieee, c->ic_freq);
/* notify user space */
c->ic_state &=
@@ -272,14 +272,14 @@ dfs_timeout(void *arg)
}
static void
-announce_radar(struct ifnet *ifp, const struct ieee80211_channel *curchan,
+announce_radar(struct ieee80211com *ic, const struct ieee80211_channel *curchan,
const struct ieee80211_channel *newchan)
{
if (newchan == NULL)
- if_printf(ifp, "radar detected on channel %u (%u MHz)\n",
+ ic_printf(ic, "radar detected on channel %u (%u MHz)\n",
curchan->ic_ieee, curchan->ic_freq);
else
- if_printf(ifp, "radar detected on channel %u (%u MHz), "
+ ic_printf(ic, "radar detected on channel %u (%u MHz), "
"moving to channel %u (%u MHz)\n",
curchan->ic_ieee, curchan->ic_freq,
newchan->ic_ieee, newchan->ic_freq);
@@ -309,7 +309,7 @@ ieee80211_dfs_notify_radar(struct ieee80211com *ic, struct ieee80211_channel *ch
* along merrily.
*/
if (ieee80211_dfs_debug == DFS_DBG_NOCSANOL) {
- announce_radar(ic->ic_ifp, chan, chan);
+ announce_radar(ic, chan, chan);
ieee80211_notify_radar(ic, chan);
return;
}
@@ -364,7 +364,7 @@ ieee80211_dfs_notify_radar(struct ieee80211com *ic, struct ieee80211_channel *ch
else
dfs->newchan = chan;
- announce_radar(ic->ic_ifp, chan, dfs->newchan);
+ announce_radar(ic, chan, dfs->newchan);
if (callout_pending(&dfs->cac_timer))
callout_schedule(&dfs->cac_timer, 0);
@@ -380,7 +380,7 @@ ieee80211_dfs_notify_radar(struct ieee80211com *ic, struct ieee80211_channel *ch
* on the NOL to expire.
*/
/*XXX*/
- if_printf(ic->ic_ifp, "%s: No free channels; waiting for entry "
+ ic_printf(ic, "%s: No free channels; waiting for entry "
"on NOL to expire\n", __func__);
}
} else {
@@ -390,9 +390,9 @@ ieee80211_dfs_notify_radar(struct ieee80211com *ic, struct ieee80211_channel *ch
if (dfs->lastchan != chan) {
dfs->lastchan = chan;
dfs->cureps = 0;
- announce_radar(ic->ic_ifp, chan, NULL);
+ announce_radar(ic, chan, NULL);
} else if (ppsratecheck(&dfs->lastevent, &dfs->cureps, 1)) {
- announce_radar(ic->ic_ifp, chan, NULL);
+ announce_radar(ic, chan, NULL);
}
}
}
@@ -434,6 +434,6 @@ ieee80211_dfs_pickchannel(struct ieee80211com *ic)
(c->ic_flags & flags) == flags)
return c;
}
- if_printf(ic->ic_ifp, "HELP, no channel located to switch to!\n");
+ ic_printf(ic, "HELP, no channel located to switch to!\n");
return NULL;
}
diff --git a/sys/net80211/ieee80211_freebsd.c b/sys/net80211/ieee80211_freebsd.c
index 7a2abf8..3af75df 100644
--- a/sys/net80211/ieee80211_freebsd.c
+++ b/sys/net80211/ieee80211_freebsd.c
@@ -66,10 +66,8 @@ SYSCTL_INT(_net_wlan, OID_AUTO, debug, CTLFLAG_RW, &ieee80211_debug,
static MALLOC_DEFINE(M_80211_COM, "80211com", "802.11 com state");
-#if __FreeBSD_version >= 1000020
static const char wlanname[] = "wlan";
static struct if_clone *wlan_cloner;
-#endif
/*
* Allocate/free com structure in conjunction with ifnet;
@@ -82,7 +80,8 @@ wlan_alloc(u_char type, struct ifnet *ifp)
{
struct ieee80211com *ic;
- ic = malloc(sizeof(struct ieee80211com), M_80211_COM, M_WAITOK|M_ZERO);
+ ic = IEEE80211_MALLOC(sizeof(struct ieee80211com), M_80211_COM,
+ IEEE80211_M_WAITOK | IEEE80211_M_ZERO);
ic->ic_ifp = ifp;
return (ic);
@@ -91,7 +90,7 @@ wlan_alloc(u_char type, struct ifnet *ifp)
static void
wlan_free(void *ic, u_char type)
{
- free(ic, M_80211_COM);
+ IEEE80211_FREE(ic, M_80211_COM);
}
static int
@@ -135,18 +134,10 @@ wlan_clone_create(struct if_clone *ifc, int unit, caddr_t params)
if_printf(ifp, "TDMA not supported\n");
return EOPNOTSUPP;
}
-#if __FreeBSD_version >= 1000020
vap = ic->ic_vap_create(ic, wlanname, unit,
cp.icp_opmode, cp.icp_flags, cp.icp_bssid,
cp.icp_flags & IEEE80211_CLONE_MACADDR ?
cp.icp_macaddr : (const uint8_t *)IF_LLADDR(ifp));
-#else
- vap = ic->ic_vap_create(ic, ifc->ifc_name, unit,
- cp.icp_opmode, cp.icp_flags, cp.icp_bssid,
- cp.icp_flags & IEEE80211_CLONE_MACADDR ?
- cp.icp_macaddr : (const uint8_t *)IF_LLADDR(ifp));
-
-#endif
return (vap == NULL ? EIO : 0);
}
@@ -160,19 +151,11 @@ wlan_clone_destroy(struct ifnet *ifp)
ic->ic_vap_delete(vap);
}
-#if __FreeBSD_version < 1000020
-IFC_SIMPLE_DECLARE(wlan, 0);
-#endif
-
void
ieee80211_vap_destroy(struct ieee80211vap *vap)
{
CURVNET_SET(vap->iv_ifp->if_vnet);
-#if __FreeBSD_version >= 1000020
if_clone_destroyif(wlan_cloner, vap->iv_ifp);
-#else
- if_clone_destroyif(&wlan_cloner, vap->iv_ifp);
-#endif
CURVNET_RESTORE();
}
@@ -207,9 +190,8 @@ static int
ieee80211_sysctl_parent(SYSCTL_HANDLER_ARGS)
{
struct ieee80211com *ic = arg1;
- const char *name = ic->ic_ifp->if_xname;
- return SYSCTL_OUT_STR(req, name);
+ return SYSCTL_OUT_STR(req, ic->ic_name);
}
static int
@@ -245,8 +227,8 @@ ieee80211_sysctl_vattach(struct ieee80211vap *vap)
struct sysctl_oid *oid;
char num[14]; /* sufficient for 32 bits */
- ctx = (struct sysctl_ctx_list *) malloc(sizeof(struct sysctl_ctx_list),
- M_DEVBUF, M_NOWAIT | M_ZERO);
+ ctx = (struct sysctl_ctx_list *) IEEE80211_MALLOC(sizeof(struct sysctl_ctx_list),
+ M_DEVBUF, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (ctx == NULL) {
if_printf(ifp, "%s: cannot allocate sysctl context!\n",
__func__);
@@ -321,7 +303,7 @@ ieee80211_sysctl_vdetach(struct ieee80211vap *vap)
if (vap->iv_sysctl != NULL) {
sysctl_ctx_free(vap->iv_sysctl);
- free(vap->iv_sysctl, M_DEVBUF);
+ IEEE80211_FREE(vap->iv_sysctl, M_DEVBUF);
vap->iv_sysctl = NULL;
}
}
@@ -492,6 +474,40 @@ ieee80211_add_callback(struct mbuf *m,
return 1;
}
+int
+ieee80211_add_xmit_params(struct mbuf *m,
+ const struct ieee80211_bpf_params *params)
+{
+ struct m_tag *mtag;
+ struct ieee80211_tx_params *tx;
+
+ mtag = m_tag_alloc(MTAG_ABI_NET80211, NET80211_TAG_XMIT_PARAMS,
+ sizeof(struct ieee80211_tx_params), M_NOWAIT);
+ if (mtag == NULL)
+ return (0);
+
+ tx = (struct ieee80211_tx_params *)(mtag+1);
+ memcpy(&tx->params, params, sizeof(struct ieee80211_bpf_params));
+ m_tag_prepend(m, mtag);
+ return (1);
+}
+
+int
+ieee80211_get_xmit_params(struct mbuf *m,
+ struct ieee80211_bpf_params *params)
+{
+ struct m_tag *mtag;
+ struct ieee80211_tx_params *tx;
+
+ mtag = m_tag_locate(m, MTAG_ABI_NET80211, NET80211_TAG_XMIT_PARAMS,
+ NULL);
+ if (mtag == NULL)
+ return (-1);
+ tx = (struct ieee80211_tx_params *)(mtag + 1);
+ memcpy(params, &tx->params, sizeof(struct ieee80211_bpf_params));
+ return (0);
+}
+
void
ieee80211_process_callback(struct ieee80211_node *ni,
struct mbuf *m, int status)
@@ -694,8 +710,9 @@ void
ieee80211_notify_csa(struct ieee80211com *ic,
const struct ieee80211_channel *c, int mode, int count)
{
- struct ifnet *ifp = ic->ic_ifp;
struct ieee80211_csa_event iev;
+ struct ieee80211vap *vap;
+ struct ifnet *ifp;
memset(&iev, 0, sizeof(iev));
iev.iev_flags = c->ic_flags;
@@ -703,42 +720,53 @@ ieee80211_notify_csa(struct ieee80211com *ic,
iev.iev_ieee = c->ic_ieee;
iev.iev_mode = mode;
iev.iev_count = count;
- CURVNET_SET(ifp->if_vnet);
- rt_ieee80211msg(ifp, RTM_IEEE80211_CSA, &iev, sizeof(iev));
- CURVNET_RESTORE();
+ TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
+ ifp = vap->iv_ifp;
+ CURVNET_SET(ifp->if_vnet);
+ rt_ieee80211msg(ifp, RTM_IEEE80211_CSA, &iev, sizeof(iev));
+ CURVNET_RESTORE();
+ }
}
void
ieee80211_notify_radar(struct ieee80211com *ic,
const struct ieee80211_channel *c)
{
- struct ifnet *ifp = ic->ic_ifp;
struct ieee80211_radar_event iev;
+ struct ieee80211vap *vap;
+ struct ifnet *ifp;
memset(&iev, 0, sizeof(iev));
iev.iev_flags = c->ic_flags;
iev.iev_freq = c->ic_freq;
iev.iev_ieee = c->ic_ieee;
- CURVNET_SET(ifp->if_vnet);
- rt_ieee80211msg(ifp, RTM_IEEE80211_RADAR, &iev, sizeof(iev));
- CURVNET_RESTORE();
+ TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
+ ifp = vap->iv_ifp;
+ CURVNET_SET(ifp->if_vnet);
+ rt_ieee80211msg(ifp, RTM_IEEE80211_RADAR, &iev, sizeof(iev));
+ CURVNET_RESTORE();
+ }
}
void
ieee80211_notify_cac(struct ieee80211com *ic,
const struct ieee80211_channel *c, enum ieee80211_notify_cac_event type)
{
- struct ifnet *ifp = ic->ic_ifp;
struct ieee80211_cac_event iev;
+ struct ieee80211vap *vap;
+ struct ifnet *ifp;
memset(&iev, 0, sizeof(iev));
iev.iev_flags = c->ic_flags;
iev.iev_freq = c->ic_freq;
iev.iev_ieee = c->ic_ieee;
iev.iev_type = type;
- CURVNET_SET(ifp->if_vnet);
- rt_ieee80211msg(ifp, RTM_IEEE80211_CAC, &iev, sizeof(iev));
- CURVNET_RESTORE();
+ TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
+ ifp = vap->iv_ifp;
+ CURVNET_SET(ifp->if_vnet);
+ rt_ieee80211msg(ifp, RTM_IEEE80211_CAC, &iev, sizeof(iev));
+ CURVNET_RESTORE();
+ }
}
void
@@ -782,14 +810,18 @@ ieee80211_notify_country(struct ieee80211vap *vap,
void
ieee80211_notify_radio(struct ieee80211com *ic, int state)
{
- struct ifnet *ifp = ic->ic_ifp;
struct ieee80211_radio_event iev;
+ struct ieee80211vap *vap;
+ struct ifnet *ifp;
memset(&iev, 0, sizeof(iev));
iev.iev_state = state;
- CURVNET_SET(ifp->if_vnet);
- rt_ieee80211msg(ifp, RTM_IEEE80211_RADIO, &iev, sizeof(iev));
- CURVNET_RESTORE();
+ TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
+ ifp = vap->iv_ifp;
+ CURVNET_SET(ifp->if_vnet);
+ rt_ieee80211msg(ifp, RTM_IEEE80211_RADIO, &iev, sizeof(iev));
+ CURVNET_RESTORE();
+ }
}
void
@@ -875,21 +907,13 @@ wlan_modevent(module_t mod, int type, void *unused)
bpf_track, 0, EVENTHANDLER_PRI_ANY);
wlan_ifllevent = EVENTHANDLER_REGISTER(iflladdr_event,
wlan_iflladdr, NULL, EVENTHANDLER_PRI_ANY);
-#if __FreeBSD_version >= 1000020
wlan_cloner = if_clone_simple(wlanname, wlan_clone_create,
wlan_clone_destroy, 0);
-#else
- if_clone_attach(&wlan_cloner);
-#endif
if_register_com_alloc(IFT_IEEE80211, wlan_alloc, wlan_free);
return 0;
case MOD_UNLOAD:
if_deregister_com_alloc(IFT_IEEE80211);
-#if __FreeBSD_version >= 1000020
if_clone_detach(wlan_cloner);
-#else
- if_clone_detach(&wlan_cloner);
-#endif
EVENTHANDLER_DEREGISTER(bpf_track, wlan_bpfevent);
EVENTHANDLER_DEREGISTER(iflladdr_event, wlan_ifllevent);
return 0;
@@ -898,11 +922,7 @@ wlan_modevent(module_t mod, int type, void *unused)
}
static moduledata_t wlan_mod = {
-#if __FreeBSD_version >= 1000020
wlanname,
-#else
- "wlan",
-#endif
wlan_modevent,
0
};
diff --git a/sys/net80211/ieee80211_freebsd.h b/sys/net80211/ieee80211_freebsd.h
index aa21f3b..162cf43 100644
--- a/sys/net80211/ieee80211_freebsd.h
+++ b/sys/net80211/ieee80211_freebsd.h
@@ -28,7 +28,9 @@
#define _NET80211_IEEE80211_FREEBSD_H_
#ifdef _KERNEL
-#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/systm.h>
+#include <sys/counter.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/rwlock.h>
@@ -183,6 +185,34 @@ typedef struct mtx ieee80211_scan_table_lock_t;
#define IEEE80211_SCAN_TABLE_LOCK(_st) mtx_lock(&(_st)->st_lock)
#define IEEE80211_SCAN_TABLE_UNLOCK(_st) mtx_unlock(&(_st)->st_lock)
+typedef struct mtx ieee80211_scan_iter_lock_t;
+#define IEEE80211_SCAN_ITER_LOCK_INIT(_st, _name) \
+ mtx_init(&(_st)->st_scanlock, _name, "802.11 scangen", MTX_DEF)
+#define IEEE80211_SCAN_ITER_LOCK_DESTROY(_st) mtx_destroy(&(_st)->st_scanlock)
+#define IEEE80211_SCAN_ITER_LOCK(_st) mtx_lock(&(_st)->st_scanlock)
+#define IEEE80211_SCAN_ITER_UNLOCK(_st) mtx_unlock(&(_st)->st_scanlock)
+
+/*
+ * Mesh node/routing definitions.
+ */
+typedef struct mtx ieee80211_rte_lock_t;
+#define MESH_RT_ENTRY_LOCK_INIT(_rt, _name) \
+ mtx_init(&(rt)->rt_lock, _name, "802.11s route entry", MTX_DEF)
+#define MESH_RT_ENTRY_LOCK_DESTROY(_rt) \
+ mtx_destroy(&(_rt)->rt_lock)
+#define MESH_RT_ENTRY_LOCK(rt) mtx_lock(&(rt)->rt_lock)
+#define MESH_RT_ENTRY_LOCK_ASSERT(rt) mtx_assert(&(rt)->rt_lock, MA_OWNED)
+#define MESH_RT_ENTRY_UNLOCK(rt) mtx_unlock(&(rt)->rt_lock)
+
+typedef struct mtx ieee80211_rt_lock_t;
+#define MESH_RT_LOCK(ms) mtx_lock(&(ms)->ms_rt_lock)
+#define MESH_RT_LOCK_ASSERT(ms) mtx_assert(&(ms)->ms_rt_lock, MA_OWNED)
+#define MESH_RT_UNLOCK(ms) mtx_unlock(&(ms)->ms_rt_lock)
+#define MESH_RT_LOCK_INIT(ms, name) \
+ mtx_init(&(ms)->ms_rt_lock, name, "802.11s routing table", MTX_DEF)
+#define MESH_RT_LOCK_DESTROY(ms) \
+ mtx_destroy(&(ms)->ms_rt_lock)
+
/*
* Node reference counting definitions.
*
@@ -234,21 +264,9 @@ struct mbuf *ieee80211_getmgtframe(uint8_t **frm, int headroom, int pktlen);
#define M_FF M_PROTO6 /* fast frame */
#define M_TXCB M_PROTO7 /* do tx complete callback */
#define M_AMPDU_MPDU M_PROTO8 /* ok for A-MPDU aggregation */
-
-/*
- * FreeBSD-HEAD from 1000046 retired M_*FRAG* flags and turned them
- * into header flags instead. So, we use the new protocol-specific
- * flags.
- *
- * Earlier FreeBSD versions overload M_FRAG, M_FIRSTFRAG and M_LASTFRAG.
- *
- * XXX TODO: rename these fields so there are no namespace clashes!
- */
-#if __FreeBSD_version >= 1000046
#define M_FRAG M_PROTO9 /* frame fragmentation */
#define M_FIRSTFRAG M_PROTO10 /* first frame fragment */
#define M_LASTFRAG M_PROTO11 /* last frame fragment */
-#endif
#define M_80211_TX \
(M_ENCAP|M_EAPOL|M_PWR_SAV|M_MORE_DATA|M_FF|M_TXCB| \
@@ -262,18 +280,10 @@ struct mbuf *ieee80211_getmgtframe(uint8_t **frm, int headroom, int pktlen);
#endif
#define M_80211_RX (M_AMPDU|M_WEP|M_AMPDU_MPDU)
-#if __FreeBSD_version >= 1000046
#define IEEE80211_MBUF_TX_FLAG_BITS \
M_FLAG_BITS \
"\15M_ENCAP\17M_EAPOL\20M_PWR_SAV\21M_MORE_DATA\22M_FF\23M_TXCB" \
"\24M_AMPDU_MPDU\25M_FRAG\26M_FIRSTFRAG\27M_LASTFRAG"
-#else
-/* There aren't any flag bits available for versions before this */
-/* XXX TODO: implement M_FLAG_BITS for this! */
-#define IEEE80211_MBUF_TX_FLAG_BITS \
- "\15M_ENCAP\17M_EAPOL\20M_PWR_SAV\21M_MORE_DATA\22M_FF\23M_TXCB" \
- "\24M_AMPDU_MPDU"
-#endif
#define IEEE80211_MBUF_RX_FLAG_BITS \
M_FLAG_BITS \
@@ -317,6 +327,9 @@ int ieee80211_add_callback(struct mbuf *m,
void (*func)(struct ieee80211_node *, void *, int), void *arg);
void ieee80211_process_callback(struct ieee80211_node *, struct mbuf *, int);
+#define NET80211_TAG_XMIT_PARAMS 1
+/* See below; this is after the bpf_params definition */
+
struct ieee80211com;
int ieee80211_parent_xmitpkt(struct ieee80211com *, struct mbuf *);
int ieee80211_vap_xmitpkt(struct ieee80211vap *, struct mbuf *);
@@ -596,4 +609,29 @@ struct ieee80211_bpf_params {
uint8_t ibp_try3; /* series 4 try count */
uint8_t ibp_rate3; /* series 4 IEEE tx rate */
};
+
+#ifdef _KERNEL
+struct ieee80211_tx_params {
+ struct ieee80211_bpf_params params;
+};
+int ieee80211_add_xmit_params(struct mbuf *m,
+ const struct ieee80211_bpf_params *);
+int ieee80211_get_xmit_params(struct mbuf *m,
+ struct ieee80211_bpf_params *);
+#endif /* _KERNEL */
+
+/*
+ * Malloc API. Other BSD operating systems have slightly
+ * different malloc/free namings (eg DragonflyBSD.)
+ */
+#define IEEE80211_MALLOC malloc
+#define IEEE80211_FREE free
+
+/* XXX TODO: get rid of WAITOK, fix all the users of it? */
+#define IEEE80211_M_NOWAIT M_NOWAIT
+#define IEEE80211_M_WAITOK M_WAITOK
+#define IEEE80211_M_ZERO M_ZERO
+
+/* XXX TODO: the type fields */
+
#endif /* _NET80211_IEEE80211_FREEBSD_H_ */
diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c
index a625b4e..ccb31ab 100644
--- a/sys/net80211/ieee80211_hostap.c
+++ b/sys/net80211/ieee80211_hostap.c
@@ -68,11 +68,12 @@ __FBSDID("$FreeBSD$");
static void hostap_vattach(struct ieee80211vap *);
static int hostap_newstate(struct ieee80211vap *, enum ieee80211_state, int);
static int hostap_input(struct ieee80211_node *ni, struct mbuf *m,
+ const struct ieee80211_rx_stats *,
int rssi, int nf);
static void hostap_deliver_data(struct ieee80211vap *,
struct ieee80211_node *, struct mbuf *);
static void hostap_recv_mgmt(struct ieee80211_node *, struct mbuf *,
- int subtype, int rssi, int nf);
+ int subtype, const struct ieee80211_rx_stats *rxs, int rssi, int nf);
static void hostap_recv_ctl(struct ieee80211_node *, struct mbuf *, int);
void
@@ -356,12 +357,8 @@ hostap_deliver_data(struct ieee80211vap *vap,
struct ifnet *ifp = vap->iv_ifp;
/* clear driver/net80211 flags before passing up */
-#if __FreeBSD_version >= 1000046
m->m_flags &= ~(M_MCAST | M_BCAST);
m_clrprotoflags(m);
-#else
- m->m_flags &= ~(M_80211_RX | M_MCAST | M_BCAST);
-#endif
KASSERT(vap->iv_opmode == IEEE80211_M_HOSTAP,
("gack, opmode %d", vap->iv_opmode));
@@ -476,7 +473,8 @@ doprint(struct ieee80211vap *vap, int subtype)
* by the 802.11 layer.
*/
static int
-hostap_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf)
+hostap_input(struct ieee80211_node *ni, struct mbuf *m,
+ const struct ieee80211_rx_stats *rxs, int rssi, int nf)
{
struct ieee80211vap *vap = ni->ni_vap;
struct ieee80211com *ic = ni->ni_ic;
@@ -893,7 +891,7 @@ hostap_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf)
if (ieee80211_radiotap_active_vap(vap))
ieee80211_radiotap_rx(vap, m);
need_tap = 0;
- vap->iv_recv_mgmt(ni, m, subtype, rssi, nf);
+ vap->iv_recv_mgmt(ni, m, subtype, rxs, rssi, nf);
goto out;
case IEEE80211_FC0_TYPE_CTL:
@@ -937,7 +935,7 @@ hostap_auth_open(struct ieee80211_node *ni, struct ieee80211_frame *wh,
* open auth is attempted.
*/
if (ni->ni_challenge != NULL) {
- free(ni->ni_challenge, M_80211_NODE);
+ IEEE80211_FREE(ni->ni_challenge, M_80211_NODE);
ni->ni_challenge = NULL;
}
/* XXX hack to workaround calling convention */
@@ -1681,7 +1679,7 @@ is11bclient(const uint8_t *rates, const uint8_t *xrates)
static void
hostap_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
- int subtype, int rssi, int nf)
+ int subtype, const struct ieee80211_rx_stats *rxs, int rssi, int nf)
{
struct ieee80211vap *vap = ni->ni_vap;
struct ieee80211com *ic = ni->ni_ic;
@@ -1709,7 +1707,8 @@ hostap_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
return;
}
/* NB: accept off-channel frames */
- if (ieee80211_parse_beacon(ni, m0, &scan) &~ IEEE80211_BPARSE_OFFCHAN)
+ /* XXX TODO: use rxstatus to determine off-channel details */
+ if (ieee80211_parse_beacon(ni, m0, ic->ic_curchan, &scan) &~ IEEE80211_BPARSE_OFFCHAN)
return;
/*
* Count frame now that we know it's to be processed.
@@ -2039,7 +2038,7 @@ hostap_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
return;
/* discard challenge after association */
if (ni->ni_challenge != NULL) {
- free(ni->ni_challenge, M_80211_NODE);
+ IEEE80211_FREE(ni->ni_challenge, M_80211_NODE);
ni->ni_challenge = NULL;
}
/* NB: 802.11 spec says to ignore station's privacy bit */
diff --git a/sys/net80211/ieee80211_ht.c b/sys/net80211/ieee80211_ht.c
index 0700de8..d83cf65 100644
--- a/sys/net80211/ieee80211_ht.c
+++ b/sys/net80211/ieee80211_ht.c
@@ -354,7 +354,6 @@ static struct printranges {
static void
ht_rateprint(struct ieee80211com *ic, enum ieee80211_phymode mode, int ratetype)
{
- struct ifnet *ifp = ic->ic_ifp;
int minrate, maxrate;
struct printranges *range;
@@ -369,12 +368,12 @@ ht_rateprint(struct ieee80211com *ic, enum ieee80211_phymode mode, int ratetype)
minrate = ht_getrate(ic, range->minmcs, mode, ratetype);
maxrate = ht_getrate(ic, range->maxmcs, mode, ratetype);
if (range->maxmcs) {
- if_printf(ifp, "MCS %d-%d: %d%sMbps - %d%sMbps\n",
+ ic_printf(ic, "MCS %d-%d: %d%sMbps - %d%sMbps\n",
range->minmcs, range->maxmcs,
minrate/2, ((minrate & 0x1) != 0 ? ".5" : ""),
maxrate/2, ((maxrate & 0x1) != 0 ? ".5" : ""));
} else {
- if_printf(ifp, "MCS %d: %d%sMbps\n", range->minmcs,
+ ic_printf(ic, "MCS %d: %d%sMbps\n", range->minmcs,
minrate/2, ((minrate & 0x1) != 0 ? ".5" : ""));
}
}
@@ -383,22 +382,21 @@ ht_rateprint(struct ieee80211com *ic, enum ieee80211_phymode mode, int ratetype)
static void
ht_announce(struct ieee80211com *ic, enum ieee80211_phymode mode)
{
- struct ifnet *ifp = ic->ic_ifp;
const char *modestr = ieee80211_phymode_name[mode];
- if_printf(ifp, "%s MCS 20MHz\n", modestr);
+ ic_printf(ic, "%s MCS 20MHz\n", modestr);
ht_rateprint(ic, mode, 0);
if (ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI20) {
- if_printf(ifp, "%s MCS 20MHz SGI\n", modestr);
+ ic_printf(ic, "%s MCS 20MHz SGI\n", modestr);
ht_rateprint(ic, mode, 1);
}
if (ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) {
- if_printf(ifp, "%s MCS 40MHz:\n", modestr);
+ ic_printf(ic, "%s MCS 40MHz:\n", modestr);
ht_rateprint(ic, mode, 2);
}
if ((ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) &&
(ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI40)) {
- if_printf(ifp, "%s MCS 40MHz SGI:\n", modestr);
+ ic_printf(ic, "%s MCS 40MHz SGI:\n", modestr);
ht_rateprint(ic, mode, 3);
}
}
@@ -406,11 +404,10 @@ ht_announce(struct ieee80211com *ic, enum ieee80211_phymode mode)
void
ieee80211_ht_announce(struct ieee80211com *ic)
{
- struct ifnet *ifp = ic->ic_ifp;
if (isset(ic->ic_modecaps, IEEE80211_MODE_11NA) ||
isset(ic->ic_modecaps, IEEE80211_MODE_11NG))
- if_printf(ifp, "%dT%dR\n", ic->ic_txstream, ic->ic_rxstream);
+ ic_printf(ic, "%dT%dR\n", ic->ic_txstream, ic->ic_rxstream);
if (isset(ic->ic_modecaps, IEEE80211_MODE_11NA))
ht_announce(ic, IEEE80211_MODE_11NA);
if (isset(ic->ic_modecaps, IEEE80211_MODE_11NG))
diff --git a/sys/net80211/ieee80211_hwmp.c b/sys/net80211/ieee80211_hwmp.c
index 601b848..6bbc32c 100644
--- a/sys/net80211/ieee80211_hwmp.c
+++ b/sys/net80211/ieee80211_hwmp.c
@@ -268,8 +268,8 @@ hwmp_vattach(struct ieee80211vap *vap)
KASSERT(vap->iv_opmode == IEEE80211_M_MBSS,
("not a mesh vap, opmode %d", vap->iv_opmode));
- hs = malloc(sizeof(struct ieee80211_hwmp_state), M_80211_VAP,
- M_NOWAIT | M_ZERO);
+ hs = IEEE80211_MALLOC(sizeof(struct ieee80211_hwmp_state), M_80211_VAP,
+ IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (hs == NULL) {
printf("%s: couldn't alloc HWMP state\n", __func__);
return;
@@ -285,7 +285,7 @@ hwmp_vdetach(struct ieee80211vap *vap)
struct ieee80211_hwmp_state *hs = vap->iv_hwmp;
callout_drain(&hs->hs_roottimer);
- free(vap->iv_hwmp, M_80211_VAP);
+ IEEE80211_FREE(vap->iv_hwmp, M_80211_VAP);
vap->iv_hwmp = NULL;
}
@@ -429,9 +429,10 @@ hwmp_recv_action_meshpath(struct ieee80211_node *ni,
vap->iv_stats.is_rx_mgtdiscard++;
break;
}
- preq = malloc(sizeof(*preq) +
+ preq = IEEE80211_MALLOC(sizeof(*preq) +
(ndest - 1) * sizeof(*preq->preq_targets),
- M_80211_MESH_PREQ, M_NOWAIT | M_ZERO);
+ M_80211_MESH_PREQ,
+ IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
KASSERT(preq != NULL, ("preq == NULL"));
preq->preq_ie = *iefrm_t++;
@@ -464,7 +465,7 @@ hwmp_recv_action_meshpath(struct ieee80211_node *ni,
}
hwmp_recv_preq(vap, ni, wh, preq);
- free(preq, M_80211_MESH_PREQ);
+ IEEE80211_FREE(preq, M_80211_MESH_PREQ);
found++;
break;
}
@@ -476,8 +477,9 @@ hwmp_recv_action_meshpath(struct ieee80211_node *ni,
vap->iv_stats.is_rx_mgtdiscard++;
break;
}
- prep = malloc(sizeof(*prep),
- M_80211_MESH_PREP, M_NOWAIT | M_ZERO);
+ prep = IEEE80211_MALLOC(sizeof(*prep),
+ M_80211_MESH_PREP,
+ IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
KASSERT(prep != NULL, ("prep == NULL"));
prep->prep_ie = *iefrm_t++;
@@ -501,7 +503,7 @@ hwmp_recv_action_meshpath(struct ieee80211_node *ni,
prep->prep_origseq = LE_READ_4(iefrm_t); iefrm_t += 4;
hwmp_recv_prep(vap, ni, wh, prep);
- free(prep, M_80211_MESH_PREP);
+ IEEE80211_FREE(prep, M_80211_MESH_PREP);
found++;
break;
}
@@ -515,9 +517,10 @@ hwmp_recv_action_meshpath(struct ieee80211_node *ni,
vap->iv_stats.is_rx_mgtdiscard++;
break;
}
- perr = malloc(sizeof(*perr) +
+ perr = IEEE80211_MALLOC(sizeof(*perr) +
(ndest - 1) * sizeof(*perr->perr_dests),
- M_80211_MESH_PERR, M_NOWAIT | M_ZERO);
+ M_80211_MESH_PERR,
+ IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
KASSERT(perr != NULL, ("perr == NULL"));
perr->perr_ie = *iefrm_t++;
@@ -546,7 +549,7 @@ hwmp_recv_action_meshpath(struct ieee80211_node *ni,
}
hwmp_recv_perr(vap, ni, wh, perr);
- free(perr, M_80211_MESH_PERR);
+ IEEE80211_FREE(perr, M_80211_MESH_PERR);
found++;
break;
}
@@ -1556,8 +1559,8 @@ hwmp_recv_perr(struct ieee80211vap *vap, struct ieee80211_node *ni,
*/
if (ms->ms_flags & IEEE80211_MESHFLAGS_FWD) {
forward = 1;
- pperr = malloc(sizeof(*perr) + 31*sizeof(*perr->perr_dests),
- M_80211_MESH_PERR, M_NOWAIT); /* XXX: magic number, 32 err dests */
+ pperr = IEEE80211_MALLOC(sizeof(*perr) + 31*sizeof(*perr->perr_dests),
+ M_80211_MESH_PERR, IEEE80211_M_NOWAIT); /* XXX: magic number, 32 err dests */
}
/*
@@ -1632,7 +1635,7 @@ hwmp_recv_perr(struct ieee80211vap *vap, struct ieee80211_node *ni,
}
done:
if (pperr != NULL)
- free(pperr, M_80211_MESH_PERR);
+ IEEE80211_FREE(pperr, M_80211_MESH_PERR);
}
#undef PERR_DFLAGS
#undef PERR_DADDR
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c
index a0f737d..b757ae6 100644
--- a/sys/net80211/ieee80211_input.c
+++ b/sys/net80211/ieee80211_input.c
@@ -88,7 +88,8 @@ ieee80211_input_mimo(struct ieee80211_node *ni, struct mbuf *m,
{
/* XXX should assert IEEE80211_R_NF and IEEE80211_R_RSSI are set */
ieee80211_process_mimo(ni, rx);
- return ieee80211_input(ni, m, rx->rssi, rx->nf);
+ //return ieee80211_input(ni, m, rx->rssi, rx->nf);
+ return ni->ni_vap->iv_input(ni, m, rx, rx->rssi, rx->nf);
}
int
@@ -252,9 +253,7 @@ ieee80211_deliver_data(struct ieee80211vap *vap,
/* clear driver/net80211 flags before passing up */
m->m_flags &= ~(M_MCAST | M_BCAST);
-#if __FreeBSD_version >= 1000046
m_clrprotoflags(m);
-#endif
/* NB: see hostap_deliver_data, this path doesn't handle hostap */
KASSERT(vap->iv_opmode != IEEE80211_M_HOSTAP, ("gack, hostap"));
@@ -448,8 +447,9 @@ int
ieee80211_alloc_challenge(struct ieee80211_node *ni)
{
if (ni->ni_challenge == NULL)
- ni->ni_challenge = (uint32_t *) malloc(IEEE80211_CHALLENGE_LEN,
- M_80211_NODE, M_NOWAIT);
+ ni->ni_challenge = (uint32_t *)
+ IEEE80211_MALLOC(IEEE80211_CHALLENGE_LEN,
+ M_80211_NODE, IEEE80211_M_NOWAIT);
if (ni->ni_challenge == NULL) {
IEEE80211_NOTE(ni->ni_vap,
IEEE80211_MSG_DEBUG | IEEE80211_MSG_AUTH, ni,
@@ -468,7 +468,7 @@ ieee80211_alloc_challenge(struct ieee80211_node *ni)
*/
int
ieee80211_parse_beacon(struct ieee80211_node *ni, struct mbuf *m,
- struct ieee80211_scanparams *scan)
+ struct ieee80211_channel *rxchan, struct ieee80211_scanparams *scan)
{
struct ieee80211vap *vap = ni->ni_vap;
struct ieee80211com *ic = ni->ni_ic;
@@ -505,7 +505,7 @@ ieee80211_parse_beacon(struct ieee80211_node *ni, struct mbuf *m,
scan->tstamp = frm; frm += 8;
scan->bintval = le16toh(*(uint16_t *)frm); frm += 2;
scan->capinfo = le16toh(*(uint16_t *)frm); frm += 2;
- scan->bchan = ieee80211_chan2ieee(ic, ic->ic_curchan);
+ scan->bchan = ieee80211_chan2ieee(ic, rxchan);
scan->chan = scan->bchan;
scan->ies = frm;
scan->ies_len = efrm - frm;
@@ -648,7 +648,8 @@ ieee80211_parse_beacon(struct ieee80211_node *ni, struct mbuf *m,
*/
IEEE80211_DISCARD(vap,
IEEE80211_MSG_ELEMID | IEEE80211_MSG_INPUT,
- wh, NULL, "for off-channel %u", scan->chan);
+ wh, NULL, "for off-channel %u (bchan=%u)",
+ scan->chan, scan->bchan);
vap->iv_stats.is_rx_chanmismatch++;
scan->status |= IEEE80211_BPARSE_OFFCHAN;
}
diff --git a/sys/net80211/ieee80211_input.h b/sys/net80211/ieee80211_input.h
index f3d569e..72fd25b 100644
--- a/sys/net80211/ieee80211_input.h
+++ b/sys/net80211/ieee80211_input.h
@@ -255,6 +255,7 @@ void ieee80211_send_error(struct ieee80211_node *,
const uint8_t mac[IEEE80211_ADDR_LEN], int subtype, int arg);
int ieee80211_alloc_challenge(struct ieee80211_node *);
int ieee80211_parse_beacon(struct ieee80211_node *, struct mbuf *,
+ struct ieee80211_channel *,
struct ieee80211_scanparams *);
int ieee80211_parse_action(struct ieee80211_node *, struct mbuf *);
#endif /* _NET80211_IEEE80211_INPUT_H_ */
diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c
index 2798d80..54ab390 100644
--- a/sys/net80211/ieee80211_ioctl.c
+++ b/sys/net80211/ieee80211_ioctl.c
@@ -323,14 +323,15 @@ ieee80211_ioctl_getscanresults(struct ieee80211vap *vap,
space = req.space;
/* XXX M_WAITOK after driver lock released */
- p = malloc(space, M_TEMP, M_NOWAIT | M_ZERO);
+ p = IEEE80211_MALLOC(space, M_TEMP,
+ IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (p == NULL)
return ENOMEM;
req.sr = p;
ieee80211_scan_iterate(vap, get_scan_result, &req);
ireq->i_len = space - req.space;
error = copyout(p, ireq->i_data, ireq->i_len);
- free(p, M_TEMP);
+ IEEE80211_FREE(p, M_TEMP);
} else
ireq->i_len = 0;
@@ -473,7 +474,8 @@ getstainfo_common(struct ieee80211vap *vap, struct ieee80211req *ireq,
if (req.space > 0) {
space = req.space;
/* XXX M_WAITOK after driver lock released */
- p = malloc(space, M_TEMP, M_NOWAIT | M_ZERO);
+ p = IEEE80211_MALLOC(space, M_TEMP,
+ IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (p == NULL) {
error = ENOMEM;
goto bad;
@@ -485,7 +487,7 @@ getstainfo_common(struct ieee80211vap *vap, struct ieee80211req *ireq,
get_sta_info(&req, ni);
ireq->i_len = space - req.space;
error = copyout(p, (uint8_t *) ireq->i_data+off, ireq->i_len);
- free(p, M_TEMP);
+ IEEE80211_FREE(p, M_TEMP);
} else
ireq->i_len = 0;
bad:
@@ -697,7 +699,8 @@ ieee80211_ioctl_getdevcaps(struct ieee80211com *ic,
if (maxchans > 2048)
maxchans = 2048;
dc = (struct ieee80211_devcaps_req *)
- malloc(IEEE80211_DEVCAPS_SIZE(maxchans), M_TEMP, M_NOWAIT | M_ZERO);
+ IEEE80211_MALLOC(IEEE80211_DEVCAPS_SIZE(maxchans), M_TEMP,
+ IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (dc == NULL)
return ENOMEM;
dc->dc_drivercaps = ic->ic_caps;
@@ -709,7 +712,7 @@ ieee80211_ioctl_getdevcaps(struct ieee80211com *ic,
("nchans %d maxchans %d", ci->ic_nchans, maxchans));
ieee80211_sort_channels(ci->ic_chans, ci->ic_nchans);
error = copyout(dc, ireq->i_data, IEEE80211_DEVCAPS_SPACE(dc));
- free(dc, M_TEMP);
+ IEEE80211_FREE(dc, M_TEMP);
return error;
}
@@ -1666,13 +1669,13 @@ ieee80211_ioctl_setchanlist(struct ieee80211vap *vap, struct ieee80211req *ireq)
if (ireq->i_len > sizeof(ic->ic_chan_active))
ireq->i_len = sizeof(ic->ic_chan_active);
- list = malloc(ireq->i_len + IEEE80211_CHAN_BYTES, M_TEMP,
- M_NOWAIT | M_ZERO);
+ list = IEEE80211_MALLOC(ireq->i_len + IEEE80211_CHAN_BYTES, M_TEMP,
+ IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (list == NULL)
return ENOMEM;
error = copyin(ireq->i_data, list, ireq->i_len);
if (error) {
- free(list, M_TEMP);
+ IEEE80211_FREE(list, M_TEMP);
return error;
}
nchan = 0;
@@ -1691,7 +1694,7 @@ ieee80211_ioctl_setchanlist(struct ieee80211vap *vap, struct ieee80211req *ireq)
}
}
if (nchan == 0) {
- free(list, M_TEMP);
+ IEEE80211_FREE(list, M_TEMP);
return EINVAL;
}
if (ic->ic_bsschan != IEEE80211_CHAN_ANYC && /* XXX */
@@ -1699,7 +1702,7 @@ ieee80211_ioctl_setchanlist(struct ieee80211vap *vap, struct ieee80211req *ireq)
ic->ic_bsschan = IEEE80211_CHAN_ANYC;
memcpy(ic->ic_chan_active, chanlist, IEEE80211_CHAN_BYTES);
ieee80211_scan_flush(vap);
- free(list, M_TEMP);
+ IEEE80211_FREE(list, M_TEMP);
return ENETRESET;
}
@@ -2112,7 +2115,8 @@ ieee80211_ioctl_setregdomain(struct ieee80211vap *vap,
return EINVAL;
}
reg = (struct ieee80211_regdomain_req *)
- malloc(IEEE80211_REGDOMAIN_SIZE(nchans), M_TEMP, M_NOWAIT);
+ IEEE80211_MALLOC(IEEE80211_REGDOMAIN_SIZE(nchans), M_TEMP,
+ IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (reg == NULL) {
IEEE80211_DPRINTF(vap, IEEE80211_MSG_IOCTL,
"%s: no memory, nchans %d\n", __func__, nchans);
@@ -2129,7 +2133,7 @@ ieee80211_ioctl_setregdomain(struct ieee80211vap *vap,
} else
error = ieee80211_setregdomain(vap, reg);
}
- free(reg, M_TEMP);
+ IEEE80211_FREE(reg, M_TEMP);
return (error == 0 ? ENETRESET : error);
}
@@ -2246,7 +2250,7 @@ setappie(struct ieee80211_appie **aie, const struct ieee80211req *ireq)
if (ireq->i_len == 0) { /* delete any existing ie */
if (app != NULL) {
*aie = NULL; /* XXX racey */
- free(app, M_80211_NODE_IE);
+ IEEE80211_FREE(app, M_80211_NODE_IE);
}
return 0;
}
@@ -2260,20 +2264,21 @@ setappie(struct ieee80211_appie **aie, const struct ieee80211req *ireq)
*
* XXX bad bad bad
*/
- napp = (struct ieee80211_appie *) malloc(
- sizeof(struct ieee80211_appie) + ireq->i_len, M_80211_NODE_IE, M_NOWAIT);
+ napp = (struct ieee80211_appie *) IEEE80211_MALLOC(
+ sizeof(struct ieee80211_appie) + ireq->i_len, M_80211_NODE_IE,
+ IEEE80211_M_NOWAIT);
if (napp == NULL)
return ENOMEM;
/* XXX holding ic lock */
error = copyin(ireq->i_data, napp->ie_data, ireq->i_len);
if (error) {
- free(napp, M_80211_NODE_IE);
+ IEEE80211_FREE(napp, M_80211_NODE_IE);
return error;
}
napp->ie_len = ireq->i_len;
*aie = napp;
if (app != NULL)
- free(app, M_80211_NODE_IE);
+ IEEE80211_FREE(app, M_80211_NODE_IE);
return 0;
}
diff --git a/sys/net80211/ieee80211_mesh.c b/sys/net80211/ieee80211_mesh.c
index 5ffd50b..ef81184 100644
--- a/sys/net80211/ieee80211_mesh.c
+++ b/sys/net80211/ieee80211_mesh.c
@@ -85,9 +85,10 @@ static void mesh_transmit_to_gate(struct ieee80211vap *, struct mbuf *,
struct ieee80211_mesh_route *);
static void mesh_forward(struct ieee80211vap *, struct mbuf *,
const struct ieee80211_meshcntl *);
-static int mesh_input(struct ieee80211_node *, struct mbuf *, int, int);
+static int mesh_input(struct ieee80211_node *, struct mbuf *,
+ const struct ieee80211_rx_stats *rxs, int, int);
static void mesh_recv_mgmt(struct ieee80211_node *, struct mbuf *, int,
- int, int);
+ const struct ieee80211_rx_stats *rxs, int, int);
static void mesh_recv_ctl(struct ieee80211_node *, struct mbuf *, int);
static void mesh_peer_timeout_setup(struct ieee80211_node *);
static void mesh_peer_timeout_backoff(struct ieee80211_node *);
@@ -161,14 +162,6 @@ static const struct ieee80211_mesh_proto_metric mesh_metric_airtime = {
static struct ieee80211_mesh_proto_path mesh_proto_paths[4];
static struct ieee80211_mesh_proto_metric mesh_proto_metrics[4];
-#define RT_ENTRY_LOCK(rt) mtx_lock(&(rt)->rt_lock)
-#define RT_ENTRY_LOCK_ASSERT(rt) mtx_assert(&(rt)->rt_lock, MA_OWNED)
-#define RT_ENTRY_UNLOCK(rt) mtx_unlock(&(rt)->rt_lock)
-
-#define MESH_RT_LOCK(ms) mtx_lock(&(ms)->ms_rt_lock)
-#define MESH_RT_LOCK_ASSERT(ms) mtx_assert(&(ms)->ms_rt_lock, MA_OWNED)
-#define MESH_RT_UNLOCK(ms) mtx_unlock(&(ms)->ms_rt_lock)
-
MALLOC_DEFINE(M_80211_MESH_PREQ, "80211preq", "802.11 MESH Path Request frame");
MALLOC_DEFINE(M_80211_MESH_PREP, "80211prep", "802.11 MESH Path Reply frame");
MALLOC_DEFINE(M_80211_MESH_PERR, "80211perr", "802.11 MESH Path Error frame");
@@ -210,13 +203,14 @@ mesh_rt_add_locked(struct ieee80211vap *vap,
MESH_RT_LOCK_ASSERT(ms);
- rt = malloc(ALIGN(sizeof(struct ieee80211_mesh_route)) +
- ms->ms_ppath->mpp_privlen, M_80211_MESH_RT, M_NOWAIT | M_ZERO);
+ rt = IEEE80211_MALLOC(ALIGN(sizeof(struct ieee80211_mesh_route)) +
+ ms->ms_ppath->mpp_privlen, M_80211_MESH_RT,
+ IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (rt != NULL) {
rt->rt_vap = vap;
IEEE80211_ADDR_COPY(rt->rt_dest, dest);
rt->rt_priv = (void *)ALIGN(&rt[1]);
- mtx_init(&rt->rt_lock, "MBSS_RT", "802.11s route entry", MTX_DEF);
+ MESH_RT_ENTRY_LOCK_INIT(rt, "MBSS_RT");
callout_init(&rt->rt_discovery, 1);
rt->rt_updtime = ticks; /* create time */
TAILQ_INSERT_TAIL(&ms->ms_routes, rt, rt_next);
@@ -269,11 +263,11 @@ ieee80211_mesh_rt_update(struct ieee80211_mesh_route *rt, int new_lifetime)
KASSERT(rt != NULL, ("route is NULL"));
now = ticks;
- RT_ENTRY_LOCK(rt);
+ MESH_RT_ENTRY_LOCK(rt);
/* dont clobber a proxy entry gated by us */
if (rt->rt_flags & IEEE80211_MESHRT_FLAGS_PROXY && rt->rt_nhops == 0) {
- RT_ENTRY_UNLOCK(rt);
+ MESH_RT_ENTRY_UNLOCK(rt);
return rt->rt_lifetime;
}
@@ -294,7 +288,7 @@ ieee80211_mesh_rt_update(struct ieee80211_mesh_route *rt, int new_lifetime)
new_lifetime, rt->rt_lifetime);
}
lifetime = rt->rt_lifetime;
- RT_ENTRY_UNLOCK(rt);
+ MESH_RT_ENTRY_UNLOCK(rt);
return lifetime;
}
@@ -356,10 +350,10 @@ mesh_rt_del(struct ieee80211_mesh_state *ms, struct ieee80211_mesh_route *rt)
* Grab the lock before destroying it, to be sure no one else
* is holding the route.
*/
- RT_ENTRY_LOCK(rt);
+ MESH_RT_ENTRY_LOCK(rt);
callout_drain(&rt->rt_discovery);
- mtx_destroy(&rt->rt_lock);
- free(rt, M_80211_MESH_RT);
+ MESH_RT_ENTRY_LOCK_DESTROY(rt);
+ IEEE80211_FREE(rt, M_80211_MESH_RT);
}
void
@@ -651,9 +645,9 @@ mesh_vdetach(struct ieee80211vap *vap)
ieee80211_iterate_nodes(&vap->iv_ic->ic_sta, mesh_vdetach_peers,
NULL);
ieee80211_mesh_rt_flush(vap);
- mtx_destroy(&ms->ms_rt_lock);
+ MESH_RT_LOCK_DESTROY(ms);
ms->ms_ppath->mpp_vdetach(vap);
- free(vap->iv_mesh, M_80211_VAP);
+ IEEE80211_FREE(vap->iv_mesh, M_80211_VAP);
vap->iv_mesh = NULL;
}
@@ -666,8 +660,8 @@ mesh_vattach(struct ieee80211vap *vap)
vap->iv_opdetach = mesh_vdetach;
vap->iv_recv_mgmt = mesh_recv_mgmt;
vap->iv_recv_ctl = mesh_recv_ctl;
- ms = malloc(sizeof(struct ieee80211_mesh_state), M_80211_VAP,
- M_NOWAIT | M_ZERO);
+ ms = IEEE80211_MALLOC(sizeof(struct ieee80211_mesh_state), M_80211_VAP,
+ IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (ms == NULL) {
printf("%s: couldn't alloc MBSS state\n", __func__);
return;
@@ -678,7 +672,7 @@ mesh_vattach(struct ieee80211vap *vap)
ms->ms_ttl = IEEE80211_MESH_DEFAULT_TTL;
TAILQ_INIT(&ms->ms_known_gates);
TAILQ_INIT(&ms->ms_routes);
- mtx_init(&ms->ms_rt_lock, "MBSS", "802.11s routing table", MTX_DEF);
+ MESH_RT_LOCK_INIT(ms, "MBSS");
callout_init(&ms->ms_cleantimer, 1);
callout_init(&ms->ms_gatetimer, 1);
ms->ms_gateseq = 0;
@@ -884,8 +878,9 @@ ieee80211_mesh_mark_gate(struct ieee80211vap *vap, const uint8_t *addr,
/* New mesh gate add it to known table. */
IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, addr,
"%s", "stored new gate information from pro-PREQ.");
- gr = malloc(ALIGN(sizeof(struct ieee80211_mesh_gate_route)),
- M_80211_MESH_GT_RT, M_NOWAIT | M_ZERO);
+ gr = IEEE80211_MALLOC(ALIGN(sizeof(struct ieee80211_mesh_gate_route)),
+ M_80211_MESH_GT_RT,
+ IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
IEEE80211_ADDR_COPY(gr->gr_addr, addr);
TAILQ_INSERT_TAIL(&ms->ms_known_gates, gr, gr_next);
}
@@ -1532,7 +1527,8 @@ mesh_recv_group_data(struct ieee80211vap *vap, struct mbuf *m,
}
static int
-mesh_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf)
+mesh_input(struct ieee80211_node *ni, struct mbuf *m,
+ const struct ieee80211_rx_stats *rxs, int rssi, int nf)
{
#define HAS_SEQ(type) ((type & 0x4) == 0)
#define MC01(mc) ((const struct ieee80211_meshcntl_ae01 *)mc)
@@ -1831,7 +1827,7 @@ mesh_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf)
vap->iv_stats.is_rx_mgtdiscard++; /* XXX */
goto out;
}
- vap->iv_recv_mgmt(ni, m, subtype, rssi, nf);
+ vap->iv_recv_mgmt(ni, m, subtype, rxs, rssi, nf);
goto out;
case IEEE80211_FC0_TYPE_CTL:
vap->iv_stats.is_rx_ctl++;
@@ -1859,11 +1855,12 @@ out:
static void
mesh_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, int subtype,
- int rssi, int nf)
+ const struct ieee80211_rx_stats *rxs, int rssi, int nf)
{
struct ieee80211vap *vap = ni->ni_vap;
struct ieee80211_mesh_state *ms = vap->iv_mesh;
struct ieee80211com *ic = ni->ni_ic;
+ struct ieee80211_channel *rxchan = ic->ic_curchan;
struct ieee80211_frame *wh;
struct ieee80211_mesh_route *rt;
uint8_t *frm, *efrm;
@@ -1876,11 +1873,17 @@ mesh_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, int subtype,
case IEEE80211_FC0_SUBTYPE_BEACON:
{
struct ieee80211_scanparams scan;
+ struct ieee80211_channel *c;
/*
* We process beacon/probe response
* frames to discover neighbors.
*/
- if (ieee80211_parse_beacon(ni, m0, &scan) != 0)
+ if (rxs != NULL) {
+ c = ieee80211_lookup_channel_rxstatus(vap, rxs);
+ if (c != NULL)
+ rxchan = c;
+ }
+ if (ieee80211_parse_beacon(ni, m0, rxchan, &scan) != 0)
return;
/*
* Count frame now that we know it's to be processed.
@@ -1906,7 +1909,7 @@ mesh_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, int subtype,
ieee80211_probe_curchan(vap, 1);
ic->ic_flags_ext &= ~IEEE80211_FEXT_PROBECHAN;
}
- ieee80211_add_scan(vap, ic->ic_curchan, &scan, wh,
+ ieee80211_add_scan(vap, rxchan, &scan, wh,
subtype, rssi, nf);
return;
}
@@ -2634,8 +2637,9 @@ mesh_recv_action_meshgate(struct ieee80211_node *ni,
/* this GANN is from a new mesh Gate add it to known table. */
IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, ie.gann_addr,
"stored new GANN information, seq %u.", ie.gann_seq);
- gr = malloc(ALIGN(sizeof(struct ieee80211_mesh_gate_route)),
- M_80211_MESH_GT_RT, M_NOWAIT | M_ZERO);
+ gr = IEEE80211_MALLOC(ALIGN(sizeof(struct ieee80211_mesh_gate_route)),
+ M_80211_MESH_GT_RT,
+ IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
IEEE80211_ADDR_COPY(gr->gr_addr, ie.gann_addr);
TAILQ_INSERT_TAIL(&ms->ms_known_gates, gr, gr_next);
}
@@ -3482,7 +3486,8 @@ mesh_ioctl_get80211(struct ieee80211vap *vap, struct ieee80211req *ireq)
}
ireq->i_len = len;
/* XXX M_WAIT? */
- p = malloc(len, M_TEMP, M_NOWAIT | M_ZERO);
+ p = IEEE80211_MALLOC(len, M_TEMP,
+ IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (p == NULL)
return ENOMEM;
off = 0;
@@ -3507,7 +3512,7 @@ mesh_ioctl_get80211(struct ieee80211vap *vap, struct ieee80211req *ireq)
MESH_RT_UNLOCK(ms);
error = copyout(p, (uint8_t *)ireq->i_data,
ireq->i_len);
- free(p, M_TEMP);
+ IEEE80211_FREE(p, M_TEMP);
break;
case IEEE80211_MESH_RTCMD_FLUSH:
case IEEE80211_MESH_RTCMD_ADD:
diff --git a/sys/net80211/ieee80211_mesh.h b/sys/net80211/ieee80211_mesh.h
index 5dc2b2c..2253af00 100644
--- a/sys/net80211/ieee80211_mesh.h
+++ b/sys/net80211/ieee80211_mesh.h
@@ -418,7 +418,7 @@ MALLOC_DECLARE(M_80211_MESH_GT_RT);
struct ieee80211_mesh_route {
TAILQ_ENTRY(ieee80211_mesh_route) rt_next;
struct ieee80211vap *rt_vap;
- struct mtx rt_lock; /* fine grained route lock */
+ ieee80211_rte_lock_t rt_lock; /* fine grained route lock */
struct callout rt_discovery; /* discovery timeout */
int rt_updtime; /* last update time */
uint8_t rt_dest[IEEE80211_ADDR_LEN];
@@ -515,7 +515,7 @@ struct ieee80211_mesh_state {
#define IEEE80211_MESHFLAGS_FWD 0x04 /* forward packets */
#define IEEE80211_MESHFLAGS_ROOT 0x08 /* configured as root */
uint8_t ms_flags;
- struct mtx ms_rt_lock;
+ ieee80211_rt_lock_t ms_rt_lock;
struct callout ms_cleantimer;
struct callout ms_gatetimer;
ieee80211_mesh_seq ms_gateseq;
diff --git a/sys/net80211/ieee80211_monitor.c b/sys/net80211/ieee80211_monitor.c
index 8909339..e077846 100644
--- a/sys/net80211/ieee80211_monitor.c
+++ b/sys/net80211/ieee80211_monitor.c
@@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$");
static void monitor_vattach(struct ieee80211vap *);
static int monitor_newstate(struct ieee80211vap *, enum ieee80211_state, int);
static int monitor_input(struct ieee80211_node *ni, struct mbuf *m,
- int rssi, int nf);
+ const struct ieee80211_rx_stats *rxs, int rssi, int nf);
void
ieee80211_monitor_attach(struct ieee80211com *ic)
@@ -125,7 +125,8 @@ monitor_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
* Process a received frame in monitor mode.
*/
static int
-monitor_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf)
+monitor_input(struct ieee80211_node *ni, struct mbuf *m,
+ const struct ieee80211_rx_stats *rxs, int rssi, int nf)
{
struct ieee80211vap *vap = ni->ni_vap;
struct ifnet *ifp = vap->iv_ifp;
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c
index fbb8e93..82cfccf 100644
--- a/sys/net80211/ieee80211_node.c
+++ b/sys/net80211/ieee80211_node.c
@@ -172,9 +172,10 @@ ieee80211_node_latevattach(struct ieee80211vap *vap)
"WARNING: max aid too small, changed to %d\n",
vap->iv_max_aid);
}
- vap->iv_aid_bitmap = (uint32_t *) malloc(
+ vap->iv_aid_bitmap = (uint32_t *) IEEE80211_MALLOC(
howmany(vap->iv_max_aid, 32) * sizeof(uint32_t),
- M_80211_NODE, M_NOWAIT | M_ZERO);
+ M_80211_NODE,
+ IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (vap->iv_aid_bitmap == NULL) {
/* XXX no way to recover */
printf("%s: no memory for AID bitmap, max aid %d!\n",
@@ -199,7 +200,7 @@ ieee80211_node_vdetach(struct ieee80211vap *vap)
vap->iv_bss = NULL;
}
if (vap->iv_aid_bitmap != NULL) {
- free(vap->iv_aid_bitmap, M_80211_NODE);
+ IEEE80211_FREE(vap->iv_aid_bitmap, M_80211_NODE);
vap->iv_aid_bitmap = NULL;
}
}
@@ -892,8 +893,8 @@ node_alloc(struct ieee80211vap *vap, const uint8_t macaddr[IEEE80211_ADDR_LEN])
{
struct ieee80211_node *ni;
- ni = (struct ieee80211_node *) malloc(sizeof(struct ieee80211_node),
- M_80211_NODE, M_NOWAIT | M_ZERO);
+ ni = (struct ieee80211_node *) IEEE80211_MALLOC(sizeof(struct ieee80211_node),
+ M_80211_NODE, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
return ni;
}
@@ -910,11 +911,12 @@ ieee80211_ies_init(struct ieee80211_ies *ies, const uint8_t *data, int len)
memset(ies, 0, offsetof(struct ieee80211_ies, data));
if (ies->data != NULL && ies->len != len) {
/* data size changed */
- free(ies->data, M_80211_NODE_IE);
+ IEEE80211_FREE(ies->data, M_80211_NODE_IE);
ies->data = NULL;
}
if (ies->data == NULL) {
- ies->data = (uint8_t *) malloc(len, M_80211_NODE_IE, M_NOWAIT);
+ ies->data = (uint8_t *) IEEE80211_MALLOC(len, M_80211_NODE_IE,
+ IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (ies->data == NULL) {
ies->len = 0;
/* NB: pointers have already been zero'd above */
@@ -933,7 +935,7 @@ void
ieee80211_ies_cleanup(struct ieee80211_ies *ies)
{
if (ies->data != NULL)
- free(ies->data, M_80211_NODE_IE);
+ IEEE80211_FREE(ies->data, M_80211_NODE_IE);
}
/*
@@ -1045,7 +1047,7 @@ node_cleanup(struct ieee80211_node *ni)
ni->ni_associd = 0;
if (ni->ni_challenge != NULL) {
- free(ni->ni_challenge, M_80211_NODE);
+ IEEE80211_FREE(ni->ni_challenge, M_80211_NODE);
ni->ni_challenge = NULL;
}
/*
@@ -1080,7 +1082,7 @@ node_free(struct ieee80211_node *ni)
ic->ic_node_cleanup(ni);
ieee80211_ies_cleanup(&ni->ni_ies);
ieee80211_psq_cleanup(&ni->ni_psq);
- free(ni, M_80211_NODE);
+ IEEE80211_FREE(ni, M_80211_NODE);
}
static void
@@ -1908,22 +1910,22 @@ ieee80211_node_table_init(struct ieee80211com *ic,
struct ieee80211_node_table *nt,
const char *name, int inact, int keyixmax)
{
- struct ifnet *ifp = ic->ic_ifp;
nt->nt_ic = ic;
- IEEE80211_NODE_LOCK_INIT(nt, ifp->if_xname);
- IEEE80211_NODE_ITERATE_LOCK_INIT(nt, ifp->if_xname);
+ IEEE80211_NODE_LOCK_INIT(nt, ic->ic_name);
+ IEEE80211_NODE_ITERATE_LOCK_INIT(nt, ic->ic_name);
TAILQ_INIT(&nt->nt_node);
nt->nt_name = name;
nt->nt_scangen = 1;
nt->nt_inact_init = inact;
nt->nt_keyixmax = keyixmax;
if (nt->nt_keyixmax > 0) {
- nt->nt_keyixmap = (struct ieee80211_node **) malloc(
+ nt->nt_keyixmap = (struct ieee80211_node **) IEEE80211_MALLOC(
keyixmax * sizeof(struct ieee80211_node *),
- M_80211_NODE, M_NOWAIT | M_ZERO);
+ M_80211_NODE,
+ IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (nt->nt_keyixmap == NULL)
- if_printf(ic->ic_ifp,
+ ic_printf(ic,
"Cannot allocate key index map with %u entries\n",
keyixmax);
} else
@@ -1980,7 +1982,7 @@ ieee80211_node_table_cleanup(struct ieee80211_node_table *nt)
printf("%s: %s[%u] still active\n", __func__,
nt->nt_name, i);
#endif
- free(nt->nt_keyixmap, M_80211_NODE);
+ IEEE80211_FREE(nt->nt_keyixmap, M_80211_NODE);
nt->nt_keyixmap = NULL;
}
IEEE80211_NODE_ITERATE_LOCK_DESTROY(nt);
@@ -2256,8 +2258,8 @@ ieee80211_iterate_nt(struct ieee80211_node_table *nt,
TAILQ_FOREACH(ni, &nt->nt_node, ni_list) {
if (i >= max_aid) {
ret = E2BIG;
- if_printf(nt->nt_ic->ic_ifp,
- "Node array overflow: max=%u", max_aid);
+ ic_printf(nt->nt_ic, "Node array overflow: max=%u",
+ max_aid);
break;
}
ni_arr[i] = ieee80211_ref_node(ni);
@@ -2319,8 +2321,8 @@ ieee80211_iterate_nodes(struct ieee80211_node_table *nt,
max_aid = vap->iv_max_aid;
size = max_aid * sizeof(struct ieee80211_node *);
- ni_arr = (struct ieee80211_node **) malloc(size, M_80211_NODE,
- M_NOWAIT | M_ZERO);
+ ni_arr = (struct ieee80211_node **) IEEE80211_MALLOC(size, M_80211_NODE,
+ IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (ni_arr == NULL)
return;
@@ -2343,7 +2345,7 @@ ieee80211_iterate_nodes(struct ieee80211_node_table *nt,
}
done:
- free(ni_arr, M_80211_NODE);
+ IEEE80211_FREE(ni_arr, M_80211_NODE);
}
void
diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c
index 2158bee..d11628d 100644
--- a/sys/net80211/ieee80211_output.c
+++ b/sys/net80211/ieee80211_output.c
@@ -508,6 +508,26 @@ ieee80211_raw_output(struct ieee80211vap *vap, struct ieee80211_node *ni,
{
struct ieee80211com *ic = vap->iv_ic;
+ /*
+ * Set node - the caller has taken a reference, so ensure
+ * that the mbuf has the same node value that
+ * it would if it were going via the normal path.
+ */
+ m->m_pkthdr.rcvif = (void *)ni;
+
+ /*
+ * Attempt to add bpf transmit parameters.
+ *
+ * For now it's ok to fail; the raw_xmit api still takes
+ * them as an option.
+ *
+ * Later on when ic_raw_xmit() has params removed,
+ * they'll have to be added - so fail the transmit if
+ * they can't be.
+ */
+ if (params)
+ (void) ieee80211_add_xmit_params(m, params);
+
return (ic->ic_raw_xmit(ni, m, params));
}
@@ -516,15 +536,9 @@ ieee80211_raw_output(struct ieee80211vap *vap, struct ieee80211_node *ni,
* connect bpf write calls to the 802.11 layer for injecting
* raw 802.11 frames.
*/
-#if __FreeBSD_version >= 1000031
int
ieee80211_output(struct ifnet *ifp, struct mbuf *m,
const struct sockaddr *dst, struct route *ro)
-#else
-int
-ieee80211_output(struct ifnet *ifp, struct mbuf *m,
- struct sockaddr *dst, struct route *ro)
-#endif
{
#define senderr(e) do { error = (e); goto bad;} while (0)
struct ieee80211_node *ni = NULL;
@@ -1950,7 +1964,7 @@ ieee80211_add_countryie(uint8_t *frm, struct ieee80211com *ic)
* re-calculation.
*/
if (ic->ic_countryie != NULL)
- free(ic->ic_countryie, M_80211_NODE_IE);
+ IEEE80211_FREE(ic->ic_countryie, M_80211_NODE_IE);
ic->ic_countryie = ieee80211_alloc_countryie(ic);
if (ic->ic_countryie == NULL)
return frm;
diff --git a/sys/net80211/ieee80211_power.c b/sys/net80211/ieee80211_power.c
index 812cd70..91668cc 100644
--- a/sys/net80211/ieee80211_power.c
+++ b/sys/net80211/ieee80211_power.c
@@ -83,8 +83,9 @@ ieee80211_power_latevattach(struct ieee80211vap *vap)
*/
if (vap->iv_opmode == IEEE80211_M_HOSTAP) {
vap->iv_tim_len = howmany(vap->iv_max_aid,8) * sizeof(uint8_t);
- vap->iv_tim_bitmap = (uint8_t *) malloc(vap->iv_tim_len,
- M_80211_POWER, M_NOWAIT | M_ZERO);
+ vap->iv_tim_bitmap = (uint8_t *) IEEE80211_MALLOC(vap->iv_tim_len,
+ M_80211_POWER,
+ IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (vap->iv_tim_bitmap == NULL) {
printf("%s: no memory for TIM bitmap!\n", __func__);
/* XXX good enough to keep from crashing? */
@@ -97,7 +98,7 @@ void
ieee80211_power_vdetach(struct ieee80211vap *vap)
{
if (vap->iv_tim_bitmap != NULL) {
- free(vap->iv_tim_bitmap, M_80211_POWER);
+ IEEE80211_FREE(vap->iv_tim_bitmap, M_80211_POWER);
vap->iv_tim_bitmap = NULL;
}
}
diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c
index 1f09616..01c60e1 100644
--- a/sys/net80211/ieee80211_proto.c
+++ b/sys/net80211/ieee80211_proto.c
@@ -113,9 +113,8 @@ static int
null_raw_xmit(struct ieee80211_node *ni, struct mbuf *m,
const struct ieee80211_bpf_params *params)
{
- struct ifnet *ifp = ni->ni_ic->ic_ifp;
- if_printf(ifp, "missing ic_raw_xmit callback, drop frame\n");
+ ic_printf(ni->ni_ic, "missing ic_raw_xmit callback, drop frame\n");
m_freem(m);
return ENETDOWN;
}
@@ -251,7 +250,7 @@ ieee80211_proto_vdetach(struct ieee80211vap *vap)
{
#define FREEAPPIE(ie) do { \
if (ie != NULL) \
- free(ie, M_80211_NODE_IE); \
+ IEEE80211_FREE(ie, M_80211_NODE_IE); \
} while (0)
/*
* Detach operating mode module.
@@ -651,7 +650,7 @@ ieee80211_set_shortslottime(struct ieee80211com *ic, int onoff)
ic->ic_flags &= ~IEEE80211_F_SHSLOT;
/* notify driver */
if (ic->ic_updateslot != NULL)
- ic->ic_updateslot(ic->ic_ifp);
+ ic->ic_updateslot(ic);
}
/*
@@ -1165,18 +1164,16 @@ static void
update_mcast(void *arg, int npending)
{
struct ieee80211com *ic = arg;
- struct ifnet *parent = ic->ic_ifp;
- ic->ic_update_mcast(parent);
+ ic->ic_update_mcast(ic);
}
static void
update_promisc(void *arg, int npending)
{
struct ieee80211com *ic = arg;
- struct ifnet *parent = ic->ic_ifp;
- ic->ic_update_promisc(parent);
+ ic->ic_update_promisc(ic);
}
static void
diff --git a/sys/net80211/ieee80211_proto.h b/sys/net80211/ieee80211_proto.h
index 3b46ac4..a812393 100644
--- a/sys/net80211/ieee80211_proto.h
+++ b/sys/net80211/ieee80211_proto.h
@@ -68,6 +68,9 @@ void ieee80211_syncflag_ext(struct ieee80211vap *, int flag);
#define IEEE80211_R_C_RSSI 0x0000010 /* per-chain RSSI value valid */
#define IEEE80211_R_C_EVM 0x0000020 /* per-chain EVM valid */
#define IEEE80211_R_C_HT40 0x0000040 /* RX'ed packet is 40mhz, pilots 4,5 valid */
+#define IEEE80211_R_FREQ 0x0000080 /* Freq value populated, MHz */
+#define IEEE80211_R_IEEE 0x0000100 /* IEEE value populated */
+#define IEEE80211_R_BAND 0x0000200 /* Frequency band populated */
struct ieee80211_rx_stats {
uint32_t r_flags; /* IEEE80211_R_* flags */
@@ -80,10 +83,12 @@ struct ieee80211_rx_stats {
uint8_t rssi; /* global RSSI */
uint8_t evm[IEEE80211_MAX_CHAINS][IEEE80211_MAX_EVM_PILOTS];
/* per-chain, per-pilot EVM values */
+ uint16_t c_freq;
+ uint8_t c_ieee;
};
#define ieee80211_input(ni, m, rssi, nf) \
- ((ni)->ni_vap->iv_input(ni, m, rssi, nf))
+ ((ni)->ni_vap->iv_input(ni, m, NULL, rssi, nf))
int ieee80211_input_all(struct ieee80211com *, struct mbuf *, int, int);
int ieee80211_input_mimo(struct ieee80211_node *, struct mbuf *,
@@ -96,13 +101,8 @@ int ieee80211_mgmt_output(struct ieee80211_node *, struct mbuf *, int,
struct ieee80211_bpf_params *);
int ieee80211_raw_xmit(struct ieee80211_node *, struct mbuf *,
const struct ieee80211_bpf_params *);
-#if __FreeBSD_version >= 1000031
int ieee80211_output(struct ifnet *, struct mbuf *,
const struct sockaddr *, struct route *ro);
-#else
-int ieee80211_output(struct ifnet *, struct mbuf *,
- struct sockaddr *, struct route *ro);
-#endif
int ieee80211_vap_pkt_send_dest(struct ieee80211vap *, struct mbuf *,
struct ieee80211_node *);
int ieee80211_raw_output(struct ieee80211vap *, struct ieee80211_node *,
diff --git a/sys/net80211/ieee80211_radiotap.c b/sys/net80211/ieee80211_radiotap.c
index 5638f52..eb218dd 100644
--- a/sys/net80211/ieee80211_radiotap.c
+++ b/sys/net80211/ieee80211_radiotap.c
@@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$");
#include <net/bpf.h>
#include <net/if.h>
#include <net/if_var.h>
-#include <net/if_llc.h>
#include <net/if_media.h>
#include <net/ethernet.h>
@@ -80,8 +79,8 @@ ieee80211_radiotap_attachv(struct ieee80211com *ic,
else if (tx_radiotap & B(IEEE80211_RADIOTAP_XCHANNEL))
off = radiotap_offset(th, n_tx_v, IEEE80211_RADIOTAP_XCHANNEL);
if (off == -1) {
- if_printf(ic->ic_ifp, "%s: no tx channel, radiotap 0x%x\n",
- __func__, tx_radiotap);
+ ic_printf(ic, "%s: no tx channel, radiotap 0x%x\n", __func__,
+ tx_radiotap);
/* NB: we handle this case but data will have no chan spec */
} else
ic->ic_txchan = ((uint8_t *) th) + off;
@@ -96,8 +95,8 @@ ieee80211_radiotap_attachv(struct ieee80211com *ic,
else if (rx_radiotap & B(IEEE80211_RADIOTAP_XCHANNEL))
off = radiotap_offset(rh, n_rx_v, IEEE80211_RADIOTAP_XCHANNEL);
if (off == -1) {
- if_printf(ic->ic_ifp, "%s: no rx channel, radiotap 0x%x\n",
- __func__, rx_radiotap);
+ ic_printf(ic, "%s: no rx channel, radiotap 0x%x\n", __func__,
+ rx_radiotap);
/* NB: we handle this case but data will have no chan spec */
} else
ic->ic_rxchan = ((uint8_t *) rh) + off;
diff --git a/sys/net80211/ieee80211_ratectl_none.c b/sys/net80211/ieee80211_ratectl_none.c
index a0056f3..5a45a74 100644
--- a/sys/net80211/ieee80211_ratectl_none.c
+++ b/sys/net80211/ieee80211_ratectl_none.c
@@ -56,7 +56,7 @@ none_init(struct ieee80211vap *vap)
static void
none_deinit(struct ieee80211vap *vap)
{
- free(vap->iv_rs, M_80211_RATECTL);
+ IEEE80211_FREE(vap->iv_rs, M_80211_RATECTL);
}
static void
diff --git a/sys/net80211/ieee80211_regdomain.c b/sys/net80211/ieee80211_regdomain.c
index ed7f422..9dfef2c 100644
--- a/sys/net80211/ieee80211_regdomain.c
+++ b/sys/net80211/ieee80211_regdomain.c
@@ -84,7 +84,7 @@ void
ieee80211_regdomain_detach(struct ieee80211com *ic)
{
if (ic->ic_countryie != NULL) {
- free(ic->ic_countryie, M_80211_NODE_IE);
+ IEEE80211_FREE(ic->ic_countryie, M_80211_NODE_IE);
ic->ic_countryie = NULL;
}
}
@@ -301,19 +301,19 @@ ieee80211_alloc_countryie(struct ieee80211com *ic)
struct ieee80211_country_ie *ie;
int i, skip, nruns;
- aie = malloc(IEEE80211_COUNTRY_MAX_SIZE, M_80211_NODE_IE,
- M_NOWAIT | M_ZERO);
+ aie = IEEE80211_MALLOC(IEEE80211_COUNTRY_MAX_SIZE, M_80211_NODE_IE,
+ IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (aie == NULL) {
- if_printf(ic->ic_ifp,
- "%s: unable to allocate memory for country ie\n", __func__);
+ ic_printf(ic, "%s: unable to allocate memory for country ie\n",
+ __func__);
/* XXX stat */
return NULL;
}
ie = (struct ieee80211_country_ie *) aie->ie_data;
ie->ie = IEEE80211_ELEMID_COUNTRY;
if (rd->isocc[0] == '\0') {
- if_printf(ic->ic_ifp, "no ISO country string for cc %d; "
- "using blanks\n", rd->country);
+ ic_printf(ic, "no ISO country string for cc %d; using blanks\n",
+ rd->country);
ie->cc[0] = ie->cc[1] = ' ';
} else {
ie->cc[0] = rd->isocc[0];
@@ -350,7 +350,7 @@ ieee80211_alloc_countryie(struct ieee80211com *ic)
if (c->ic_ieee != nextchan ||
c->ic_maxregpower != frm[-1]) { /* new run */
if (nruns == IEEE80211_COUNTRY_MAX_BANDS) {
- if_printf(ic->ic_ifp, "%s: country ie too big, "
+ ic_printf(ic, "%s: country ie too big, "
"runs > max %d, truncating\n",
__func__, IEEE80211_COUNTRY_MAX_BANDS);
/* XXX stat? fail? */
@@ -493,7 +493,7 @@ ieee80211_setregdomain(struct ieee80211vap *vap,
* Invalidate channel-related state.
*/
if (ic->ic_countryie != NULL) {
- free(ic->ic_countryie, M_80211_NODE_IE);
+ IEEE80211_FREE(ic->ic_countryie, M_80211_NODE_IE);
ic->ic_countryie = NULL;
}
ieee80211_scan_flush(vap);
diff --git a/sys/net80211/ieee80211_rssadapt.c b/sys/net80211/ieee80211_rssadapt.c
index f230f60..b5fdb86 100644
--- a/sys/net80211/ieee80211_rssadapt.c
+++ b/sys/net80211/ieee80211_rssadapt.c
@@ -132,8 +132,8 @@ rssadapt_init(struct ieee80211vap *vap)
KASSERT(vap->iv_rs == NULL, ("%s: iv_rs already initialized",
__func__));
- vap->iv_rs = rs = malloc(sizeof(struct ieee80211_rssadapt),
- M_80211_RATECTL, M_NOWAIT|M_ZERO);
+ vap->iv_rs = rs = IEEE80211_MALLOC(sizeof(struct ieee80211_rssadapt),
+ M_80211_RATECTL, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (rs == NULL) {
if_printf(vap->iv_ifp, "couldn't alloc ratectl structure\n");
return;
@@ -146,7 +146,7 @@ rssadapt_init(struct ieee80211vap *vap)
static void
rssadapt_deinit(struct ieee80211vap *vap)
{
- free(vap->iv_rs, M_80211_RATECTL);
+ IEEE80211_FREE(vap->iv_rs, M_80211_RATECTL);
}
static void
@@ -175,8 +175,8 @@ rssadapt_node_init(struct ieee80211_node *ni)
if (ni->ni_rctls == NULL) {
ni->ni_rctls = ra =
- malloc(sizeof(struct ieee80211_rssadapt_node),
- M_80211_RATECTL, M_NOWAIT|M_ZERO);
+ IEEE80211_MALLOC(sizeof(struct ieee80211_rssadapt_node),
+ M_80211_RATECTL, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (ra == NULL) {
if_printf(vap->iv_ifp, "couldn't alloc per-node ratectl "
"structure\n");
@@ -204,7 +204,7 @@ static void
rssadapt_node_deinit(struct ieee80211_node *ni)
{
- free(ni->ni_rctls, M_80211_RATECTL);
+ IEEE80211_FREE(ni->ni_rctls, M_80211_RATECTL);
}
static __inline int
diff --git a/sys/net80211/ieee80211_scan.c b/sys/net80211/ieee80211_scan.c
index 6c950d6..f28a982 100644
--- a/sys/net80211/ieee80211_scan.c
+++ b/sys/net80211/ieee80211_scan.c
@@ -71,15 +71,14 @@ __FBSDID("$FreeBSD$");
void
ieee80211_scan_attach(struct ieee80211com *ic)
{
-
/*
- * For now, the swscan module does both the
- * allocation (so it can pad it) and sets up the net80211
- * bits.
- *
- * I'll split this stuff later.
+ * If there's no scan method pointer, attach the
+ * swscan set as a default.
*/
- ieee80211_swscan_attach(ic);
+ if (ic->ic_scan_methods == NULL)
+ ieee80211_swscan_attach(ic);
+ else
+ ic->ic_scan_methods->sc_attach(ic);
}
void
@@ -88,12 +87,11 @@ ieee80211_scan_detach(struct ieee80211com *ic)
/*
* Ideally we'd do the ss_ops detach call here;
- * but then ieee80211_swscan_detach would need
- * to be split in two.
+ * but then sc_detach() would need to be split in two.
*
* I'll do that later.
*/
- ieee80211_swscan_detach(ic);
+ ic->ic_scan_methods->sc_detach(ic);
}
static const struct ieee80211_roamparam defroam[IEEE80211_MODE_MAX] = {
@@ -122,6 +120,8 @@ static const struct ieee80211_roamparam defroam[IEEE80211_MODE_MAX] = {
void
ieee80211_scan_vattach(struct ieee80211vap *vap)
{
+ struct ieee80211com *ic = vap->iv_ic;
+
vap->iv_bgscanidle = (IEEE80211_BGSCAN_IDLE_DEFAULT*1000)/hz;
vap->iv_bgscanintvl = IEEE80211_BGSCAN_INTVAL_DEFAULT*hz;
vap->iv_scanvalid = IEEE80211_SCAN_VALID_DEFAULT*hz;
@@ -129,7 +129,7 @@ ieee80211_scan_vattach(struct ieee80211vap *vap)
vap->iv_roaming = IEEE80211_ROAMING_AUTO;
memcpy(vap->iv_roamparms, defroam, sizeof(defroam));
- ieee80211_swscan_vattach(vap);
+ ic->ic_scan_methods->sc_vattach(vap);
}
void
@@ -141,7 +141,7 @@ ieee80211_scan_vdetach(struct ieee80211vap *vap)
IEEE80211_LOCK(ic);
ss = ic->ic_scan;
- ieee80211_swscan_vdetach(vap);
+ ic->ic_scan_methods->sc_vdetach(vap);
if (ss != NULL && ss->ss_vap == vap) {
if (ss->ss_ops != NULL) {
@@ -314,6 +314,7 @@ ieee80211_start_scan(struct ieee80211vap *vap, int flags,
u_int nssid, const struct ieee80211_scan_ssid ssids[])
{
const struct ieee80211_scanner *scan;
+ struct ieee80211com *ic = vap->iv_ic;
scan = ieee80211_scanner_get(vap->iv_opmode);
if (scan == NULL) {
@@ -324,8 +325,7 @@ ieee80211_start_scan(struct ieee80211vap *vap, int flags,
return 0;
}
- /* XXX ops */
- return ieee80211_swscan_start_scan(scan, vap, flags, duration,
+ return ic->ic_scan_methods->sc_start_scan(scan, vap, flags, duration,
mindwell, maxdwell, nssid, ssids);
}
@@ -376,11 +376,10 @@ ieee80211_check_scan(struct ieee80211vap *vap, int flags,
/*
* XXX TODO: separate things out a bit better.
- * XXX TODO: ops
*/
ieee80211_scan_update_locked(vap, scan);
- result = ieee80211_swscan_check_scan(scan, vap, flags, duration,
+ result = ic->ic_scan_methods->sc_check_scan(scan, vap, flags, duration,
mindwell, maxdwell, nssid, ssids);
IEEE80211_UNLOCK(ic);
@@ -408,6 +407,7 @@ ieee80211_check_scan_current(struct ieee80211vap *vap)
int
ieee80211_bg_scan(struct ieee80211vap *vap, int flags)
{
+ struct ieee80211com *ic = vap->iv_ic;
const struct ieee80211_scanner *scan;
// IEEE80211_UNLOCK_ASSERT(sc);
@@ -425,10 +425,8 @@ ieee80211_bg_scan(struct ieee80211vap *vap, int flags)
* XXX TODO: pull apart the bgscan logic into whatever
* belongs here and whatever belongs in the software
* scanner.
- *
- * XXX TODO: ops
*/
- return (ieee80211_swscan_bg_scan(scan, vap, flags));
+ return (ic->ic_scan_methods->sc_bg_scan(scan, vap, flags));
}
/*
@@ -437,9 +435,9 @@ ieee80211_bg_scan(struct ieee80211vap *vap, int flags)
void
ieee80211_cancel_scan(struct ieee80211vap *vap)
{
+ struct ieee80211com *ic = vap->iv_ic;
- /* XXX TODO: ops */
- ieee80211_swscan_cancel_scan(vap);
+ ic->ic_scan_methods->sc_cancel_scan(vap);
}
/*
@@ -448,9 +446,9 @@ ieee80211_cancel_scan(struct ieee80211vap *vap)
void
ieee80211_cancel_anyscan(struct ieee80211vap *vap)
{
+ struct ieee80211com *ic = vap->iv_ic;
- /* XXX TODO: ops */
- ieee80211_swscan_cancel_anyscan(vap);
+ ic->ic_scan_methods->sc_cancel_anyscan(vap);
}
/*
@@ -460,9 +458,9 @@ ieee80211_cancel_anyscan(struct ieee80211vap *vap)
void
ieee80211_scan_next(struct ieee80211vap *vap)
{
+ struct ieee80211com *ic = vap->iv_ic;
- /* XXX TODO: ops */
- ieee80211_swscan_scan_next(vap);
+ ic->ic_scan_methods->sc_scan_next(vap);
}
/*
@@ -481,8 +479,7 @@ ieee80211_scan_done(struct ieee80211vap *vap)
ss = ic->ic_scan;
ss->ss_next = ss->ss_last; /* all channels are complete */
- /* XXX TODO: ops */
- ieee80211_swscan_scan_done(vap);
+ ic->ic_scan_methods->sc_scan_done(vap);
IEEE80211_UNLOCK(ic);
}
@@ -504,8 +501,7 @@ ieee80211_probe_curchan(struct ieee80211vap *vap, int force)
return;
}
- /* XXX TODO: ops */
- ieee80211_swscan_probe_curchan(vap, force);
+ ic->ic_scan_methods->sc_scan_probe_curchan(vap, force);
}
#ifdef IEEE80211_DEBUG
@@ -567,8 +563,9 @@ ieee80211_add_scan(struct ieee80211vap *vap,
const struct ieee80211_frame *wh,
int subtype, int rssi, int noise)
{
+ struct ieee80211com *ic = vap->iv_ic;
- return (ieee80211_swscan_add_scan(vap, curchan, sp, wh, subtype,
+ return (ic->ic_scan_methods->sc_add_scan(vap, curchan, sp, wh, subtype,
rssi, noise));
}
diff --git a/sys/net80211/ieee80211_scan.h b/sys/net80211/ieee80211_scan.h
index 8b54186..f568b65 100644
--- a/sys/net80211/ieee80211_scan.h
+++ b/sys/net80211/ieee80211_scan.h
@@ -80,6 +80,39 @@ struct ieee80211_scan_ssid {
#define IEEE80211_SCAN_MAX_SSID 1 /* max # ssid's to probe */
/*
+ * High-level implementation visible to ieee80211_scan.[ch].
+ *
+ * The default scanner (ieee80211_scan_sw.[ch]) implements a software
+ * driven scanner. Firmware driven scanning needs a different set of
+ * behaviours.
+ */
+struct ieee80211_scan_methods {
+ void (*sc_attach)(struct ieee80211com *);
+ void (*sc_detach)(struct ieee80211com *);
+ void (*sc_vattach)(struct ieee80211vap *);
+ void (*sc_vdetach)(struct ieee80211vap *);
+ void (*sc_set_scan_duration)(struct ieee80211vap *, u_int);
+ int (*sc_start_scan)(const struct ieee80211_scanner *,
+ struct ieee80211vap *, int, u_int, u_int, u_int, u_int,
+ const struct ieee80211_scan_ssid ssids[]);
+ int (*sc_check_scan)(const struct ieee80211_scanner *,
+ struct ieee80211vap *, int, u_int, u_int, u_int, u_int,
+ const struct ieee80211_scan_ssid ssids[]);
+ int (*sc_bg_scan)(const struct ieee80211_scanner *,
+ struct ieee80211vap *, int);
+ void (*sc_cancel_scan)(struct ieee80211vap *);
+ void (*sc_cancel_anyscan)(struct ieee80211vap *);
+ void (*sc_scan_next)(struct ieee80211vap *);
+ void (*sc_scan_done)(struct ieee80211vap *);
+ void (*sc_scan_probe_curchan)(struct ieee80211vap *, int);
+ void (*sc_add_scan)(struct ieee80211vap *,
+ struct ieee80211_channel *,
+ const struct ieee80211_scanparams *,
+ const struct ieee80211_frame *,
+ int, int, int);
+};
+
+/*
* Scan state visible to the 802.11 layer. Scan parameters and
* results are stored in this data structure. The ieee80211_scan_state
* structure is extended with space that is maintained private to
diff --git a/sys/net80211/ieee80211_scan_sta.c b/sys/net80211/ieee80211_scan_sta.c
index 1fb45b0..c0cbb7d 100644
--- a/sys/net80211/ieee80211_scan_sta.c
+++ b/sys/net80211/ieee80211_scan_sta.c
@@ -102,7 +102,7 @@ struct sta_table {
ieee80211_scan_table_lock_t st_lock; /* on scan table */
TAILQ_HEAD(, sta_entry) st_entry; /* all entries */
LIST_HEAD(, sta_entry) st_hash[STA_HASHSIZE];
- struct mtx st_scanlock; /* on st_scaniter */
+ ieee80211_scan_iter_lock_t st_scanlock; /* on st_scaniter */
u_int st_scaniter; /* gen# for iterator */
u_int st_scangen; /* scan generation # */
int st_newscan;
@@ -159,12 +159,13 @@ sta_attach(struct ieee80211_scan_state *ss)
{
struct sta_table *st;
- st = (struct sta_table *) malloc(sizeof(struct sta_table),
- M_80211_SCAN, M_NOWAIT | M_ZERO);
+ st = (struct sta_table *) IEEE80211_MALLOC(sizeof(struct sta_table),
+ M_80211_SCAN,
+ IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (st == NULL)
return 0;
IEEE80211_SCAN_TABLE_LOCK_INIT(st, "scantable");
- mtx_init(&st->st_scanlock, "scangen", "802.11 scangen", MTX_DEF);
+ IEEE80211_SCAN_ITER_LOCK_INIT(st, "scangen");
TAILQ_INIT(&st->st_entry);
ss->ss_priv = st;
nrefs++; /* NB: we assume caller locking */
@@ -182,8 +183,8 @@ sta_detach(struct ieee80211_scan_state *ss)
if (st != NULL) {
sta_flush_table(st);
IEEE80211_SCAN_TABLE_LOCK_DESTROY(st);
- mtx_destroy(&st->st_scanlock);
- free(st, M_80211_SCAN);
+ IEEE80211_SCAN_ITER_LOCK_DESTROY(st);
+ IEEE80211_FREE(st, M_80211_SCAN);
KASSERT(nrefs > 0, ("imbalanced attach/detach"));
nrefs--; /* NB: we assume caller locking */
}
@@ -217,7 +218,7 @@ sta_flush_table(struct sta_table *st)
TAILQ_REMOVE(&st->st_entry, se, se_list);
LIST_REMOVE(se, se_hash);
ieee80211_ies_cleanup(&se->base.se_ies);
- free(se, M_80211_SCAN);
+ IEEE80211_FREE(se, M_80211_SCAN);
}
memset(st->st_maxrssi, 0, sizeof(st->st_maxrssi));
}
@@ -252,8 +253,8 @@ sta_add(struct ieee80211_scan_state *ss,
LIST_FOREACH(se, &st->st_hash[hash], se_hash)
if (IEEE80211_ADDR_EQ(se->base.se_macaddr, macaddr))
goto found;
- se = (struct sta_entry *) malloc(sizeof(struct sta_entry),
- M_80211_SCAN, M_NOWAIT | M_ZERO);
+ se = (struct sta_entry *) IEEE80211_MALLOC(sizeof(struct sta_entry),
+ M_80211_SCAN, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (se == NULL) {
IEEE80211_SCAN_TABLE_UNLOCK(st);
return 0;
@@ -1402,7 +1403,7 @@ sta_iterate(struct ieee80211_scan_state *ss,
struct sta_entry *se;
u_int gen;
- mtx_lock(&st->st_scanlock);
+ IEEE80211_SCAN_ITER_LOCK(st);
gen = st->st_scaniter++;
restart:
IEEE80211_SCAN_TABLE_LOCK(st);
@@ -1418,7 +1419,7 @@ restart:
}
IEEE80211_SCAN_TABLE_UNLOCK(st);
- mtx_unlock(&st->st_scanlock);
+ IEEE80211_SCAN_ITER_UNLOCK(st);
}
static void
@@ -1680,7 +1681,7 @@ adhoc_age(struct ieee80211_scan_state *ss)
TAILQ_REMOVE(&st->st_entry, se, se_list);
LIST_REMOVE(se, se_hash);
ieee80211_ies_cleanup(&se->base.se_ies);
- free(se, M_80211_SCAN);
+ IEEE80211_FREE(se, M_80211_SCAN);
}
}
IEEE80211_SCAN_TABLE_UNLOCK(st);
diff --git a/sys/net80211/ieee80211_scan_sw.c b/sys/net80211/ieee80211_scan_sw.c
index 70b4673..eb58386 100644
--- a/sys/net80211/ieee80211_scan_sw.c
+++ b/sys/net80211/ieee80211_scan_sw.c
@@ -102,33 +102,7 @@ static void scan_task(void *, int);
MALLOC_DEFINE(M_80211_SCAN, "80211scan", "802.11 scan state");
-void
-ieee80211_swscan_attach(struct ieee80211com *ic)
-{
- struct scan_state *ss;
-
- ss = (struct scan_state *) malloc(sizeof(struct scan_state),
- M_80211_SCAN, M_NOWAIT | M_ZERO);
- if (ss == NULL) {
- ic->ic_scan = NULL;
- return;
- }
- callout_init_mtx(&ss->ss_scan_timer, IEEE80211_LOCK_OBJ(ic), 0);
- cv_init(&ss->ss_scan_cv, "scan");
- TASK_INIT(&ss->ss_scan_task, 0, scan_task, ss);
-
- ic->ic_scan = &ss->base;
- ss->base.ss_ic = ic;
-
- ic->ic_scan_curchan = scan_curchan;
- ic->ic_scan_mindwell = scan_mindwell;
-
- /*
- * TODO: all of the non-vap scan calls should be methods!
- */
-}
-
-void
+static void
ieee80211_swscan_detach(struct ieee80211com *ic)
{
struct ieee80211_scan_state *ss = ic->ic_scan;
@@ -155,11 +129,11 @@ ieee80211_swscan_detach(struct ieee80211com *ic)
ss->ss_ops = NULL;
}
ic->ic_scan = NULL;
- free(SCAN_PRIVATE(ss), M_80211_SCAN);
+ IEEE80211_FREE(SCAN_PRIVATE(ss), M_80211_SCAN);
}
}
-void
+static void
ieee80211_swscan_vattach(struct ieee80211vap *vap)
{
/* nothing to do for now */
@@ -169,7 +143,7 @@ ieee80211_swscan_vattach(struct ieee80211vap *vap)
}
-void
+static void
ieee80211_swscan_vdetach(struct ieee80211vap *vap)
{
struct ieee80211com *ic = vap->iv_ic;
@@ -185,7 +159,7 @@ ieee80211_swscan_vdetach(struct ieee80211vap *vap)
}
}
-void
+static void
ieee80211_swscan_set_scan_duration(struct ieee80211vap *vap, u_int duration)
{
struct ieee80211com *ic = vap->iv_ic;
@@ -198,17 +172,6 @@ ieee80211_swscan_set_scan_duration(struct ieee80211vap *vap, u_int duration)
SCAN_PRIVATE(ss)->ss_duration = duration;
}
-void
-ieee80211_swscan_run_scan_task(struct ieee80211vap *vap)
-{
- struct ieee80211com *ic = vap->iv_ic;
- struct ieee80211_scan_state *ss = ic->ic_scan;
-
- IEEE80211_LOCK_ASSERT(ic);
-
- ieee80211_runtask(ic, &SCAN_PRIVATE(ss)->ss_scan_task);
-}
-
/*
* Start a scan unless one is already going.
*/
@@ -272,7 +235,7 @@ ieee80211_swscan_start_scan_locked(const struct ieee80211_scanner *scan,
ic->ic_flags |= IEEE80211_F_SCAN;
/* Start scan task */
- ieee80211_swscan_run_scan_task(vap);
+ ieee80211_runtask(ic, &SCAN_PRIVATE(ss)->ss_scan_task);
}
return 1;
} else {
@@ -289,7 +252,7 @@ ieee80211_swscan_start_scan_locked(const struct ieee80211_scanner *scan,
*
* Called without the comlock held; grab the comlock as appropriate.
*/
-int
+static int
ieee80211_swscan_start_scan(const struct ieee80211_scanner *scan,
struct ieee80211vap *vap, int flags,
u_int duration, u_int mindwell, u_int maxdwell,
@@ -316,7 +279,7 @@ ieee80211_swscan_start_scan(const struct ieee80211_scanner *scan,
*
* XXX TODO: split out!
*/
-int
+static int
ieee80211_swscan_check_scan(const struct ieee80211_scanner *scan,
struct ieee80211vap *vap, int flags,
u_int duration, u_int mindwell, u_int maxdwell,
@@ -374,7 +337,7 @@ ieee80211_swscan_check_scan(const struct ieee80211_scanner *scan,
* Restart a previous scan. If the previous scan completed
* then we start again using the existing channel list.
*/
-int
+static int
ieee80211_swscan_bg_scan(const struct ieee80211_scanner *scan,
struct ieee80211vap *vap, int flags)
{
@@ -465,7 +428,7 @@ ieee80211_swscan_bg_scan(const struct ieee80211_scanner *scan,
/*
* Cancel any scan currently going on for the specified vap.
*/
-void
+static void
ieee80211_swscan_cancel_scan(struct ieee80211vap *vap)
{
struct ieee80211com *ic = vap->iv_ic;
@@ -499,7 +462,7 @@ ieee80211_swscan_cancel_scan(struct ieee80211vap *vap)
/*
* Cancel any scan currently going on.
*/
-void
+static void
ieee80211_swscan_cancel_anyscan(struct ieee80211vap *vap)
{
struct ieee80211com *ic = vap->iv_ic;
@@ -533,7 +496,7 @@ ieee80211_swscan_cancel_anyscan(struct ieee80211vap *vap)
* Public access to scan_next for drivers that manage
* scanning themselves (e.g. for firmware-based devices).
*/
-void
+static void
ieee80211_swscan_scan_next(struct ieee80211vap *vap)
{
struct ieee80211com *ic = vap->iv_ic;
@@ -551,7 +514,7 @@ ieee80211_swscan_scan_next(struct ieee80211vap *vap)
* Public access to scan_next for drivers that are not able to scan single
* channels (e.g. for firmware-based devices).
*/
-void
+static void
ieee80211_swscan_scan_done(struct ieee80211vap *vap)
{
struct ieee80211com *ic = vap->iv_ic;
@@ -570,7 +533,7 @@ ieee80211_swscan_scan_done(struct ieee80211vap *vap)
* listen for beacons on the channel; if we receive something
* then we'll transmit a probe request.
*/
-void
+static void
ieee80211_swscan_probe_curchan(struct ieee80211vap *vap, int force)
{
struct ieee80211com *ic = vap->iv_ic;
@@ -898,7 +861,7 @@ done:
/*
* Process a beacon or probe response frame.
*/
-void
+static void
ieee80211_swscan_add_scan(struct ieee80211vap *vap,
struct ieee80211_channel *curchan,
const struct ieee80211_scanparams *sp,
@@ -946,3 +909,50 @@ ieee80211_swscan_add_scan(struct ieee80211vap *vap,
}
}
+static struct ieee80211_scan_methods swscan_methods = {
+ .sc_attach = ieee80211_swscan_attach,
+ .sc_detach = ieee80211_swscan_detach,
+ .sc_vattach = ieee80211_swscan_vattach,
+ .sc_vdetach = ieee80211_swscan_vdetach,
+ .sc_set_scan_duration = ieee80211_swscan_set_scan_duration,
+ .sc_start_scan = ieee80211_swscan_start_scan,
+ .sc_check_scan = ieee80211_swscan_check_scan,
+ .sc_bg_scan = ieee80211_swscan_bg_scan,
+ .sc_cancel_scan = ieee80211_swscan_cancel_scan,
+ .sc_cancel_anyscan = ieee80211_swscan_cancel_anyscan,
+ .sc_scan_next = ieee80211_swscan_scan_next,
+ .sc_scan_done = ieee80211_swscan_scan_done,
+ .sc_scan_probe_curchan = ieee80211_swscan_probe_curchan,
+ .sc_add_scan = ieee80211_swscan_add_scan
+};
+
+/*
+ * Default scan attach method.
+ */
+void
+ieee80211_swscan_attach(struct ieee80211com *ic)
+{
+ struct scan_state *ss;
+
+ /*
+ * Setup the default methods
+ */
+ ic->ic_scan_methods = &swscan_methods;
+
+ /* Allocate initial scan state */
+ ss = (struct scan_state *) IEEE80211_MALLOC(sizeof(struct scan_state),
+ M_80211_SCAN, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
+ if (ss == NULL) {
+ ic->ic_scan = NULL;
+ return;
+ }
+ callout_init_mtx(&ss->ss_scan_timer, IEEE80211_LOCK_OBJ(ic), 0);
+ cv_init(&ss->ss_scan_cv, "scan");
+ TASK_INIT(&ss->ss_scan_task, 0, scan_task, ss);
+
+ ic->ic_scan = &ss->base;
+ ss->base.ss_ic = ic;
+
+ ic->ic_scan_curchan = scan_curchan;
+ ic->ic_scan_mindwell = scan_mindwell;
+}
diff --git a/sys/net80211/ieee80211_scan_sw.h b/sys/net80211/ieee80211_scan_sw.h
index 7bb0cc3..8408933 100644
--- a/sys/net80211/ieee80211_scan_sw.h
+++ b/sys/net80211/ieee80211_scan_sw.h
@@ -28,34 +28,5 @@
#define __NET80211_IEEE80211_SCAN_SW_H__
extern void ieee80211_swscan_attach(struct ieee80211com *ic);
-extern void ieee80211_swscan_detach(struct ieee80211com *ic);
-
-extern void ieee80211_swscan_vattach(struct ieee80211vap *vap);
-extern void ieee80211_swscan_vdetach(struct ieee80211vap *vap);
-
-extern int ieee80211_swscan_start_scan(const struct ieee80211_scanner *scan,
- struct ieee80211vap *vap, int flags,
- u_int duration, u_int mindwell, u_int maxdwell,
- u_int nssid, const struct ieee80211_scan_ssid ssids[]);
-extern void ieee80211_swscan_set_scan_duration(struct ieee80211vap *vap,
- u_int duration);
-extern void ieee80211_swscan_run_scan_task(struct ieee80211vap *vap);
-extern int ieee80211_swscan_check_scan(const struct ieee80211_scanner *scan,
- struct ieee80211vap *vap, int flags,
- u_int duration, u_int mindwell, u_int maxdwell,
- u_int nssid, const struct ieee80211_scan_ssid ssids[]);
-extern int ieee80211_swscan_bg_scan(const struct ieee80211_scanner *scan,
- struct ieee80211vap *vap, int flags);
-extern void ieee80211_swscan_cancel_scan(struct ieee80211vap *vap);
-extern void ieee80211_swscan_cancel_anyscan(struct ieee80211vap *vap);
-extern void ieee80211_swscan_scan_next(struct ieee80211vap *vap);
-extern void ieee80211_swscan_scan_done(struct ieee80211vap *vap);
-extern void ieee80211_swscan_probe_curchan(struct ieee80211vap *vap,
- int force);
-extern void ieee80211_swscan_add_scan(struct ieee80211vap *vap,
- struct ieee80211_channel *curchan,
- const struct ieee80211_scanparams *sp,
- const struct ieee80211_frame *wh,
- int subtype, int rssi, int noise);
#endif /* __NET80211_IEEE80211_SCAN_SW_H__ */
diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c
index 267ad11..81d7559 100644
--- a/sys/net80211/ieee80211_sta.c
+++ b/sys/net80211/ieee80211_sta.c
@@ -70,9 +70,10 @@ __FBSDID("$FreeBSD$");
static void sta_vattach(struct ieee80211vap *);
static void sta_beacon_miss(struct ieee80211vap *);
static int sta_newstate(struct ieee80211vap *, enum ieee80211_state, int);
-static int sta_input(struct ieee80211_node *, struct mbuf *, int, int);
+static int sta_input(struct ieee80211_node *, struct mbuf *,
+ const struct ieee80211_rx_stats *, int, int);
static void sta_recv_mgmt(struct ieee80211_node *, struct mbuf *,
- int subtype, int rssi, int nf);
+ int subtype, const struct ieee80211_rx_stats *, int rssi, int nf);
static void sta_recv_ctl(struct ieee80211_node *, struct mbuf *, int subtype);
void
@@ -525,7 +526,8 @@ doprint(struct ieee80211vap *vap, int subtype)
* by the 802.11 layer.
*/
static int
-sta_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf)
+sta_input(struct ieee80211_node *ni, struct mbuf *m,
+ const struct ieee80211_rx_stats *rxs, int rssi, int nf)
{
struct ieee80211vap *vap = ni->ni_vap;
struct ieee80211com *ic = ni->ni_ic;
@@ -922,7 +924,7 @@ sta_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf)
wh = mtod(m, struct ieee80211_frame *);
wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED;
}
- vap->iv_recv_mgmt(ni, m, subtype, rssi, nf);
+ vap->iv_recv_mgmt(ni, m, subtype, rxs, rssi, nf);
goto out;
case IEEE80211_FC0_TYPE_CTL:
@@ -1058,7 +1060,7 @@ sta_auth_shared(struct ieee80211_node *ni, struct ieee80211_frame *wh,
switch (seq) {
case IEEE80211_AUTH_SHARED_PASS:
if (ni->ni_challenge != NULL) {
- free(ni->ni_challenge, M_80211_NODE);
+ IEEE80211_FREE(ni->ni_challenge, M_80211_NODE);
ni->ni_challenge = NULL;
}
if (status != 0) {
@@ -1285,13 +1287,15 @@ startbgscan(struct ieee80211vap *vap)
}
static void
-sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
- int subtype, int rssi, int nf)
+sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, int subtype,
+ const struct ieee80211_rx_stats *rxs,
+ int rssi, int nf)
{
#define ISPROBE(_st) ((_st) == IEEE80211_FC0_SUBTYPE_PROBE_RESP)
#define ISREASSOC(_st) ((_st) == IEEE80211_FC0_SUBTYPE_REASSOC_RESP)
struct ieee80211vap *vap = ni->ni_vap;
struct ieee80211com *ic = ni->ni_ic;
+ struct ieee80211_channel *rxchan = ic->ic_curchan;
struct ieee80211_frame *wh;
uint8_t *frm, *efrm;
uint8_t *rates, *xrates, *wme, *htcap, *htinfo;
@@ -1305,6 +1309,7 @@ sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
case IEEE80211_FC0_SUBTYPE_PROBE_RESP:
case IEEE80211_FC0_SUBTYPE_BEACON: {
struct ieee80211_scanparams scan;
+ struct ieee80211_channel *c;
/*
* We process beacon/probe response frames:
* o when scanning, or
@@ -1316,8 +1321,16 @@ sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
vap->iv_stats.is_rx_mgtdiscard++;
return;
}
+
+ /* Override RX channel as appropriate */
+ if (rxs != NULL) {
+ c = ieee80211_lookup_channel_rxstatus(vap, rxs);
+ if (c != NULL)
+ rxchan = c;
+ }
+
/* XXX probe response in sta mode when !scanning? */
- if (ieee80211_parse_beacon(ni, m0, &scan) != 0) {
+ if (ieee80211_parse_beacon(ni, m0, rxchan, &scan) != 0) {
if (! (ic->ic_flags & IEEE80211_F_SCAN))
vap->iv_stats.is_beacon_bad++;
return;
@@ -1484,7 +1497,7 @@ sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
* our ap.
*/
if (ic->ic_flags & IEEE80211_F_SCAN) {
- ieee80211_add_scan(vap, ic->ic_curchan,
+ ieee80211_add_scan(vap, rxchan,
&scan, wh, subtype, rssi, nf);
} else if (contbgscan(vap)) {
ieee80211_bg_scan(vap, 0);
@@ -1529,7 +1542,7 @@ sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
ieee80211_probe_curchan(vap, 1);
ic->ic_flags_ext &= ~IEEE80211_FEXT_PROBECHAN;
}
- ieee80211_add_scan(vap, ic->ic_curchan, &scan, wh,
+ ieee80211_add_scan(vap, rxchan, &scan, wh,
subtype, rssi, nf);
return;
}
diff --git a/sys/net80211/ieee80211_superg.c b/sys/net80211/ieee80211_superg.c
index 81a4b43..2e2bbd1 100644
--- a/sys/net80211/ieee80211_superg.c
+++ b/sys/net80211/ieee80211_superg.c
@@ -100,9 +100,9 @@ ieee80211_superg_attach(struct ieee80211com *ic)
struct ieee80211_superg *sg;
if (ic->ic_caps & IEEE80211_C_FF) {
- sg = (struct ieee80211_superg *) malloc(
+ sg = (struct ieee80211_superg *) IEEE80211_MALLOC(
sizeof(struct ieee80211_superg), M_80211_VAP,
- M_NOWAIT | M_ZERO);
+ IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (sg == NULL) {
printf("%s: cannot allocate SuperG state block\n",
__func__);
@@ -117,7 +117,7 @@ void
ieee80211_superg_detach(struct ieee80211com *ic)
{
if (ic->ic_superg != NULL) {
- free(ic->ic_superg, M_80211_VAP);
+ IEEE80211_FREE(ic->ic_superg, M_80211_VAP);
ic->ic_superg = NULL;
}
}
diff --git a/sys/net80211/ieee80211_tdma.c b/sys/net80211/ieee80211_tdma.c
index 08acc38..278decf 100644
--- a/sys/net80211/ieee80211_tdma.c
+++ b/sys/net80211/ieee80211_tdma.c
@@ -115,7 +115,7 @@ static void tdma_vdetach(struct ieee80211vap *vap);
static int tdma_newstate(struct ieee80211vap *, enum ieee80211_state, int);
static void tdma_beacon_miss(struct ieee80211vap *vap);
static void tdma_recv_mgmt(struct ieee80211_node *, struct mbuf *,
- int subtype, int rssi, int nf);
+ int subtype, const struct ieee80211_rx_stats *rxs, int rssi, int nf);
static int tdma_update(struct ieee80211vap *vap,
const struct ieee80211_tdma_param *tdma, struct ieee80211_node *ni,
int pickslot);
@@ -149,8 +149,9 @@ ieee80211_tdma_vattach(struct ieee80211vap *vap)
KASSERT(vap->iv_caps & IEEE80211_C_TDMA,
("not a tdma vap, caps 0x%x", vap->iv_caps));
- ts = (struct ieee80211_tdma_state *) malloc(
- sizeof(struct ieee80211_tdma_state), M_80211_VAP, M_NOWAIT | M_ZERO);
+ ts = (struct ieee80211_tdma_state *) IEEE80211_MALLOC(
+ sizeof(struct ieee80211_tdma_state), M_80211_VAP,
+ IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (ts == NULL) {
printf("%s: cannot allocate TDMA state block\n", __func__);
/* NB: fall back to adhdemo mode */
@@ -199,7 +200,7 @@ tdma_vdetach(struct ieee80211vap *vap)
return;
}
ts->tdma_opdetach(vap);
- free(vap->iv_tdma, M_80211_VAP);
+ IEEE80211_FREE(vap->iv_tdma, M_80211_VAP);
vap->iv_tdma = NULL;
setackpolicy(vap->iv_ic, 0); /* enable ACK's */
@@ -320,7 +321,7 @@ tdma_beacon_miss(struct ieee80211vap *vap)
static void
tdma_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
- int subtype, int rssi, int nf)
+ int subtype, const struct ieee80211_rx_stats *rxs, int rssi, int nf)
{
struct ieee80211com *ic = ni->ni_ic;
struct ieee80211vap *vap = ni->ni_vap;
@@ -331,7 +332,8 @@ tdma_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
struct ieee80211_frame *wh = mtod(m0, struct ieee80211_frame *);
struct ieee80211_scanparams scan;
- if (ieee80211_parse_beacon(ni, m0, &scan) != 0)
+ /* XXX TODO: use rxstatus to determine off-channel beacons */
+ if (ieee80211_parse_beacon(ni, m0, ic->ic_curchan, &scan) != 0)
return;
if (scan.tdma == NULL) {
/*
@@ -391,7 +393,7 @@ tdma_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
* 2x parsing of the frame but should happen infrequently
*/
}
- ts->tdma_recv_mgmt(ni, m0, subtype, rssi, nf);
+ ts->tdma_recv_mgmt(ni, m0, subtype, rxs, rssi, nf);
}
/*
diff --git a/sys/net80211/ieee80211_tdma.h b/sys/net80211/ieee80211_tdma.h
index 2fe591f..76b9ed1 100644
--- a/sys/net80211/ieee80211_tdma.h
+++ b/sys/net80211/ieee80211_tdma.h
@@ -81,7 +81,8 @@ struct ieee80211_tdma_state {
int (*tdma_newstate)(struct ieee80211vap *, enum ieee80211_state,
int arg);
void (*tdma_recv_mgmt)(struct ieee80211_node *,
- struct mbuf *, int, int, int);
+ struct mbuf *, int,
+ const struct ieee80211_rx_stats *rxs, int, int);
void (*tdma_opdetach)(struct ieee80211vap *);
};
diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h
index 4710697..26238b8 100644
--- a/sys/net80211/ieee80211_var.h
+++ b/sys/net80211/ieee80211_var.h
@@ -117,6 +117,8 @@ struct ieee80211_frame;
struct ieee80211com {
struct ifnet *ic_ifp; /* associated device */
+ void *ic_softc; /* driver softc */
+ const char *ic_name; /* usually device name */
ieee80211_com_lock_t ic_comlock; /* state update lock */
ieee80211_tx_lock_t ic_txlock; /* ic/vap TX lock */
TAILQ_HEAD(, ieee80211vap) ic_vaps; /* list of vap instances */
@@ -133,6 +135,9 @@ struct ieee80211com {
struct task ic_bmiss_task; /* deferred beacon miss hndlr */
struct task ic_chw_task; /* deferred HT CHW update */
+ counter_u64_t ic_ierrors; /* input errors */
+ counter_u64_t ic_oerrors; /* output errors */
+
uint32_t ic_flags; /* state flags */
uint32_t ic_flags_ext; /* extended state flags */
uint32_t ic_flags_ht; /* HT state flags */
@@ -192,6 +197,7 @@ struct ieee80211com {
struct ieee80211_dfs_state ic_dfs; /* DFS state */
struct ieee80211_scan_state *ic_scan; /* scan state */
+ struct ieee80211_scan_methods *ic_scan_methods; /* scan methods */
int ic_lastdata; /* time of last data frame */
int ic_lastscan; /* time last scan completed */
@@ -256,11 +262,11 @@ struct ieee80211com {
struct mbuf *,
const struct ieee80211_bpf_params *);
/* update device state for 802.11 slot time change */
- void (*ic_updateslot)(struct ifnet *);
+ void (*ic_updateslot)(struct ieee80211com *);
/* handle multicast state changes */
- void (*ic_update_mcast)(struct ifnet *);
+ void (*ic_update_mcast)(struct ieee80211com *);
/* handle promiscuous mode changes */
- void (*ic_update_promisc)(struct ifnet *);
+ void (*ic_update_promisc)(struct ieee80211com *);
/* new station association callback/notification */
void (*ic_newassoc)(struct ieee80211_node *, int);
/* TDMA update notification */
@@ -466,9 +472,13 @@ struct ieee80211vap {
void (*iv_opdetach)(struct ieee80211vap *);
/* receive processing */
int (*iv_input)(struct ieee80211_node *,
- struct mbuf *, int, int);
+ struct mbuf *,
+ const struct ieee80211_rx_stats *,
+ int, int);
void (*iv_recv_mgmt)(struct ieee80211_node *,
- struct mbuf *, int, int, int);
+ struct mbuf *, int,
+ const struct ieee80211_rx_stats *,
+ int, int);
void (*iv_recv_ctl)(struct ieee80211_node *,
struct mbuf *, int);
void (*iv_deliver_data)(struct ieee80211vap *,
@@ -496,13 +506,8 @@ struct ieee80211vap {
int (*iv_newstate)(struct ieee80211vap *,
enum ieee80211_state, int);
/* 802.3 output method for raw frame xmit */
-#if __FreeBSD_version >= 1000031
int (*iv_output)(struct ifnet *, struct mbuf *,
const struct sockaddr *, struct route *);
-#else
- int (*iv_output)(struct ifnet *, struct mbuf *,
- struct sockaddr *, struct route *);
-#endif
uint64_t iv_spare[6];
};
MALLOC_DECLARE(M_80211_VAP);
@@ -675,6 +680,7 @@ MALLOC_DECLARE(M_80211_VAP);
"\20\1LDPC\2CHWIDTH40\5GREENFIELD\6SHORTGI20\7SHORTGI40\10TXSTBC" \
"\21AMPDU\22AMSDU\23HT\24SMPS\25RIFS"
+int ic_printf(struct ieee80211com *, const char *, ...) __printflike(2, 3);
void ieee80211_ifattach(struct ieee80211com *,
const uint8_t macaddr[IEEE80211_ADDR_LEN]);
void ieee80211_ifdetach(struct ieee80211com *);
@@ -707,6 +713,8 @@ struct ieee80211_channel *ieee80211_find_channel(struct ieee80211com *,
int freq, int flags);
struct ieee80211_channel *ieee80211_find_channel_byieee(struct ieee80211com *,
int ieee, int flags);
+struct ieee80211_channel *ieee80211_lookup_channel_rxstatus(struct ieee80211vap *,
+ const struct ieee80211_rx_stats *);
int ieee80211_setmode(struct ieee80211com *, enum ieee80211_phymode);
enum ieee80211_phymode ieee80211_chan2mode(const struct ieee80211_channel *);
uint32_t ieee80211_mac_hash(const struct ieee80211com *,
diff --git a/sys/net80211/ieee80211_wds.c b/sys/net80211/ieee80211_wds.c
index fc77259..1d3f30a 100644
--- a/sys/net80211/ieee80211_wds.c
+++ b/sys/net80211/ieee80211_wds.c
@@ -64,9 +64,10 @@ __FBSDID("$FreeBSD$");
static void wds_vattach(struct ieee80211vap *);
static int wds_newstate(struct ieee80211vap *, enum ieee80211_state, int);
-static int wds_input(struct ieee80211_node *ni, struct mbuf *m, int, int);
-static void wds_recv_mgmt(struct ieee80211_node *, struct mbuf *,
- int subtype, int, int);
+static int wds_input(struct ieee80211_node *ni, struct mbuf *m,
+ const struct ieee80211_rx_stats *rxs, int, int);
+static void wds_recv_mgmt(struct ieee80211_node *, struct mbuf *, int subtype,
+ const struct ieee80211_rx_stats *, int, int);
void
ieee80211_wds_attach(struct ieee80211com *ic)
@@ -408,7 +409,8 @@ wds_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
* by the 802.11 layer.
*/
static int
-wds_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf)
+wds_input(struct ieee80211_node *ni, struct mbuf *m,
+ const struct ieee80211_rx_stats *rxs, int rssi, int nf)
{
struct ieee80211vap *vap = ni->ni_vap;
struct ieee80211com *ic = ni->ni_ic;
@@ -718,7 +720,7 @@ wds_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf)
vap->iv_stats.is_rx_mgtdiscard++; /* XXX */
goto out;
}
- vap->iv_recv_mgmt(ni, m, subtype, rssi, nf);
+ vap->iv_recv_mgmt(ni, m, subtype, rxs, rssi, nf);
goto out;
case IEEE80211_FC0_TYPE_CTL:
@@ -744,8 +746,8 @@ out:
}
static void
-wds_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
- int subtype, int rssi, int nf)
+wds_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, int subtype,
+ const struct ieee80211_rx_stats *rxs, int rssi, int nf)
{
struct ieee80211vap *vap = ni->ni_vap;
struct ieee80211com *ic = ni->ni_ic;
diff --git a/sys/netinet/sctp_asconf.c b/sys/netinet/sctp_asconf.c
index 4569900..21add43 100644
--- a/sys/netinet/sctp_asconf.c
+++ b/sys/netinet/sctp_asconf.c
@@ -555,7 +555,9 @@ sctp_process_asconf_set_primary(struct sockaddr *src,
(stcb->asoc.primary_destination->dest_state &
SCTP_ADDR_UNCONFIRMED) == 0) {
- sctp_timer_stop(SCTP_TIMER_TYPE_PRIM_DELETED, stcb->sctp_ep, stcb, NULL, SCTP_FROM_SCTP_TIMER + SCTP_LOC_7);
+ sctp_timer_stop(SCTP_TIMER_TYPE_PRIM_DELETED,
+ stcb->sctp_ep, stcb, NULL,
+ SCTP_FROM_SCTP_ASCONF + SCTP_LOC_1);
if (sctp_is_mobility_feature_on(stcb->sctp_ep,
SCTP_MOBILITY_FASTHANDOFF)) {
sctp_assoc_immediate_retrans(stcb,
@@ -991,7 +993,7 @@ sctp_assoc_immediate_retrans(struct sctp_tcb *stcb, struct sctp_nets *dstnet)
SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, &stcb->asoc.primary_destination->ro._l_addr.sa);
sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb,
stcb->asoc.deleted_primary,
- SCTP_FROM_SCTP_TIMER + SCTP_LOC_8);
+ SCTP_FROM_SCTP_ASCONF + SCTP_LOC_3);
stcb->asoc.num_send_timers_up--;
if (stcb->asoc.num_send_timers_up < 0) {
stcb->asoc.num_send_timers_up = 0;
@@ -1030,7 +1032,7 @@ sctp_net_immediate_retrans(struct sctp_tcb *stcb, struct sctp_nets *net)
SCTPDBG(SCTP_DEBUG_ASCONF1, "net_immediate_retrans: RTO is %d\n", net->RTO);
sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net,
- SCTP_FROM_SCTP_TIMER + SCTP_LOC_5);
+ SCTP_FROM_SCTP_ASCONF + SCTP_LOC_4);
stcb->asoc.cc_functions.sctp_set_initial_cc_param(stcb, net);
net->error_count = 0;
TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) {
@@ -1684,7 +1686,7 @@ sctp_handle_asconf_ack(struct mbuf *m, int offset,
if (serial_num == asoc->asconf_seq_out - 1) {
/* stop our timer */
sctp_timer_stop(SCTP_TIMER_TYPE_ASCONF, stcb->sctp_ep, stcb, net,
- SCTP_FROM_SCTP_ASCONF + SCTP_LOC_3);
+ SCTP_FROM_SCTP_ASCONF + SCTP_LOC_5);
}
/* process the ASCONF-ACK contents */
ack_length = ntohs(cp->ch.chunk_length) -
@@ -1975,7 +1977,8 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
* sent when the state goes open.
*/
if (status == 0 &&
- SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) {
+ ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) ||
+ (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED))) {
#ifdef SCTP_TIMER_BASED_ASCONF
sctp_timer_start(SCTP_TIMER_TYPE_ASCONF, inp,
stcb, stcb->asoc.primary_destination);
@@ -2223,7 +2226,8 @@ sctp_asconf_iterator_stcb(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
* count of queued params. If in the non-open
* state, these get sent when the assoc goes open.
*/
- if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) {
+ if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) ||
+ (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) {
if (status >= 0) {
num_queued++;
}
@@ -2283,7 +2287,8 @@ sctp_set_primary_ip_address_sa(struct sctp_tcb *stcb, struct sockaddr *sa)
"set_primary_ip_address_sa: queued on tcb=%p, ",
(void *)stcb);
SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa);
- if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) {
+ if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) ||
+ (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) {
#ifdef SCTP_TIMER_BASED_ASCONF
sctp_timer_start(SCTP_TIMER_TYPE_ASCONF,
stcb->sctp_ep, stcb,
@@ -2319,7 +2324,8 @@ sctp_set_primary_ip_address(struct sctp_ifa *ifa)
SCTPDBG(SCTP_DEBUG_ASCONF1, "set_primary_ip_address: queued on stcb=%p, ",
(void *)stcb);
SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, &ifa->address.sa);
- if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) {
+ if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) ||
+ (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) {
#ifdef SCTP_TIMER_BASED_ASCONF
sctp_timer_start(SCTP_TIMER_TYPE_ASCONF,
stcb->sctp_ep, stcb,
diff --git a/sys/netinet/sctp_cc_functions.c b/sys/netinet/sctp_cc_functions.c
index 17a897b..d616d19 100644
--- a/sys/netinet/sctp_cc_functions.c
+++ b/sys/netinet/sctp_cc_functions.c
@@ -226,7 +226,8 @@ sctp_cwnd_update_after_fr(struct sctp_tcb *stcb,
}
sctp_timer_stop(SCTP_TIMER_TYPE_SEND,
- stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_32);
+ stcb->sctp_ep, stcb, net,
+ SCTP_FROM_SCTP_CC_FUNCTIONS + SCTP_LOC_1);
sctp_timer_start(SCTP_TIMER_TYPE_SEND,
stcb->sctp_ep, stcb, net);
}
@@ -1732,7 +1733,8 @@ sctp_hs_cwnd_update_after_fr(struct sctp_tcb *stcb,
}
sctp_timer_stop(SCTP_TIMER_TYPE_SEND,
- stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_32);
+ stcb->sctp_ep, stcb, net,
+ SCTP_FROM_SCTP_CC_FUNCTIONS + SCTP_LOC_2);
sctp_timer_start(SCTP_TIMER_TYPE_SEND,
stcb->sctp_ep, stcb, net);
}
@@ -2264,7 +2266,8 @@ sctp_htcp_cwnd_update_after_fr(struct sctp_tcb *stcb,
}
sctp_timer_stop(SCTP_TIMER_TYPE_SEND,
- stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_32);
+ stcb->sctp_ep, stcb, net,
+ SCTP_FROM_SCTP_CC_FUNCTIONS + SCTP_LOC_3);
sctp_timer_start(SCTP_TIMER_TYPE_SEND,
stcb->sctp_ep, stcb, net);
}
diff --git a/sys/netinet/sctp_constants.h b/sys/netinet/sctp_constants.h
index de45165..d90bd25 100644
--- a/sys/netinet/sctp_constants.h
+++ b/sys/netinet/sctp_constants.h
@@ -765,18 +765,19 @@ __FBSDID("$FreeBSD$");
*/
/* File defines */
-#define SCTP_FROM_SCTP_INPUT 0x10000000
-#define SCTP_FROM_SCTP_PCB 0x20000000
-#define SCTP_FROM_SCTP_INDATA 0x30000000
-#define SCTP_FROM_SCTP_TIMER 0x40000000
-#define SCTP_FROM_SCTP_USRREQ 0x50000000
-#define SCTP_FROM_SCTPUTIL 0x60000000
-#define SCTP_FROM_SCTP6_USRREQ 0x70000000
-#define SCTP_FROM_SCTP_ASCONF 0x80000000
-#define SCTP_FROM_SCTP_OUTPUT 0x90000000
-#define SCTP_FROM_SCTP_PEELOFF 0xa0000000
-#define SCTP_FROM_SCTP_PANDA 0xb0000000
-#define SCTP_FROM_SCTP_SYSCTL 0xc0000000
+#define SCTP_FROM_SCTP_INPUT 0x10000000
+#define SCTP_FROM_SCTP_PCB 0x20000000
+#define SCTP_FROM_SCTP_INDATA 0x30000000
+#define SCTP_FROM_SCTP_TIMER 0x40000000
+#define SCTP_FROM_SCTP_USRREQ 0x50000000
+#define SCTP_FROM_SCTPUTIL 0x60000000
+#define SCTP_FROM_SCTP6_USRREQ 0x70000000
+#define SCTP_FROM_SCTP_ASCONF 0x80000000
+#define SCTP_FROM_SCTP_OUTPUT 0x90000000
+#define SCTP_FROM_SCTP_PEELOFF 0xa0000000
+#define SCTP_FROM_SCTP_PANDA 0xb0000000
+#define SCTP_FROM_SCTP_SYSCTL 0xc0000000
+#define SCTP_FROM_SCTP_CC_FUNCTIONS 0xd0000000
/* Location ID's */
#define SCTP_LOC_1 0x00000001
@@ -812,6 +813,8 @@ __FBSDID("$FreeBSD$");
#define SCTP_LOC_31 0x0000001f
#define SCTP_LOC_32 0x00000020
#define SCTP_LOC_33 0x00000021
+#define SCTP_LOC_34 0x00000022
+#define SCTP_LOC_35 0x00000023
/* Free assoc codes */
diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c
index d3b4855..50a6628 100644
--- a/sys/netinet/sctp_indata.c
+++ b/sys/netinet/sctp_indata.c
@@ -1034,7 +1034,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc,
chk->rec.data.TSN_seq,
(chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) ? 1 : 0);
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
- stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_7;
+ stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_8;
sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED);
*abort_flag = 1;
return;
@@ -1056,7 +1056,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc,
chk->rec.data.stream_number,
chk->rec.data.stream_seq);
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
- stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_8;
+ stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_9;
sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED);
*abort_flag = 1;
return;
@@ -1073,7 +1073,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc,
chk->rec.data.stream_number,
chk->rec.data.stream_seq);
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
- stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_9;
+ stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_10;
sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED);
*abort_flag = 1;
return;
@@ -1100,7 +1100,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc,
chk->rec.data.stream_number,
chk->rec.data.stream_seq);
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
- stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_10;
+ stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_11;
sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED);
*abort_flag = 1;
return;
@@ -1123,7 +1123,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc,
chk->rec.data.stream_number,
chk->rec.data.stream_seq);
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
- stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_11;
+ stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_12;
sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED);
*abort_flag = 1;
return;
@@ -1144,7 +1144,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc,
chk->rec.data.stream_number,
chk->rec.data.stream_seq);
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
- stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_12;
+ stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_13;
sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED);
*abort_flag = 1;
return;
@@ -1162,7 +1162,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc,
chk->rec.data.TSN_seq,
(chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) ? 1 : 0);
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
- stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_12;
+ stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_14;
sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED);
*abort_flag = 1;
return;
@@ -1184,7 +1184,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc,
chk->rec.data.stream_number,
chk->rec.data.stream_seq);
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
- stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_13;
+ stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_15;
sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED);
*abort_flag = 1;
return;
@@ -1476,7 +1476,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc,
asoc->strmin[strmno].last_sequence_delivered,
tsn, strmno, strmseq);
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
- stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_14;
+ stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16;
sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED);
*abort_flag = 1;
return (0);
@@ -1713,7 +1713,7 @@ failed_pdapi_express_del:
snprintf(msg, sizeof(msg), "Reas. queue emtpy, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x",
tsn, strmno, strmseq);
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
- stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_15;
+ stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_17;
sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED);
*abort_flag = 1;
if (last_chunk) {
@@ -1732,7 +1732,7 @@ failed_pdapi_express_del:
snprintf(msg, sizeof(msg), "PD ongoing, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x",
tsn, strmno, strmseq);
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
- stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16;
+ stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_18;
sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED);
*abort_flag = 1;
if (last_chunk) {
@@ -1761,7 +1761,7 @@ failed_pdapi_express_del:
snprintf(msg, sizeof(msg), "No PD ongoing, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x",
tsn, strmno, strmseq);
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
- stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_17;
+ stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_19;
sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED);
*abort_flag = 1;
if (last_chunk) {
@@ -2159,7 +2159,8 @@ sctp_sack_check(struct sctp_tcb *stcb, int was_a_gap)
*/
if (SCTP_OS_TIMER_PENDING(&stcb->asoc.dack_timer.timer)) {
sctp_timer_stop(SCTP_TIMER_TYPE_RECV,
- stcb->sctp_ep, stcb, NULL, SCTP_FROM_SCTP_INDATA + SCTP_LOC_18);
+ stcb->sctp_ep, stcb, NULL,
+ SCTP_FROM_SCTP_INDATA + SCTP_LOC_20);
}
sctp_send_shutdown(stcb,
((stcb->asoc.alternate) ? stcb->asoc.alternate : stcb->asoc.primary_destination));
@@ -2382,7 +2383,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length,
snprintf(msg, sizeof(msg), "DATA chunk of length %d",
chk_length);
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
- stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_19;
+ stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21;
sctp_abort_association(inp, stcb, m, iphlen,
src, dst, sh, op_err,
mflowtype, mflowid,
@@ -2397,7 +2398,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length,
struct mbuf *op_err;
op_err = sctp_generate_no_user_data_cause(ch->dp.tsn);
- stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_19;
+ stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_22;
sctp_abort_association(inp, stcb, m, iphlen,
src, dst, sh, op_err,
mflowtype, mflowid,
@@ -3462,12 +3463,18 @@ sctp_fs_audit(struct sctp_association *asoc)
{
struct sctp_tmit_chunk *chk;
int inflight = 0, resend = 0, inbetween = 0, acked = 0, above = 0;
- int entry_flight, entry_cnt, ret;
+ int ret;
+
+#ifndef INVARIANTS
+ int entry_flight, entry_cnt;
+
+#endif
+ ret = 0;
+#ifndef INVARIANTS
entry_flight = asoc->total_flight;
entry_cnt = asoc->total_flight_count;
- ret = 0;
-
+#endif
if (asoc->pr_sctp_cnt >= asoc->sent_queue_cnt)
return (0);
@@ -3622,7 +3629,7 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32_t cumack,
snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x",
cumack, send_s);
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
- stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_25;
+ stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_23;
sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED);
return;
}
@@ -3818,7 +3825,9 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32_t cumack,
}
if (net->dest_state & SCTP_ADDR_PF) {
net->dest_state &= ~SCTP_ADDR_PF;
- sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_3);
+ sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT,
+ stcb->sctp_ep, stcb, net,
+ SCTP_FROM_SCTP_INDATA + SCTP_LOC_24);
sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net);
asoc->cc_functions.sctp_cwnd_update_exit_pf(stcb, net);
/* Done with this net */
@@ -3904,7 +3913,7 @@ again:
} else if (SCTP_OS_TIMER_PENDING(&net->rxt_timer.timer)) {
sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep,
stcb, net,
- SCTP_FROM_SCTP_INDATA + SCTP_LOC_22);
+ SCTP_FROM_SCTP_INDATA + SCTP_LOC_25);
}
}
}
@@ -3978,7 +3987,7 @@ again:
*abort_now = 1;
/* XXX */
op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, "");
- stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24;
+ stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_26;
sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED);
} else {
struct sctp_nets *netp;
@@ -4191,7 +4200,7 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup,
snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x",
cum_ack, send_s);
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
- stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_25;
+ stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_27;
sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED);
return;
}
@@ -4223,7 +4232,7 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup,
/* stop any timers */
TAILQ_FOREACH(net, &asoc->nets, sctp_next) {
sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep,
- stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_26);
+ stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_28);
net->partial_bytes_acked = 0;
net->flight_size = 0;
}
@@ -4428,14 +4437,14 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup,
if (net->new_pseudo_cumack)
sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep,
stcb, net,
- SCTP_FROM_SCTP_INDATA + SCTP_LOC_27);
+ SCTP_FROM_SCTP_INDATA + SCTP_LOC_29);
}
} else {
if (accum_moved) {
TAILQ_FOREACH(net, &asoc->nets, sctp_next) {
sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep,
- stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_28);
+ stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_30);
}
}
}
@@ -4608,7 +4617,9 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup,
}
if (net->dest_state & SCTP_ADDR_PF) {
net->dest_state &= ~SCTP_ADDR_PF;
- sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_3);
+ sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT,
+ stcb->sctp_ep, stcb, net,
+ SCTP_FROM_SCTP_INDATA + SCTP_LOC_31);
sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net);
asoc->cc_functions.sctp_cwnd_update_exit_pf(stcb, net);
/* Done with this net */
@@ -4631,7 +4642,8 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup,
TAILQ_FOREACH(net, &asoc->nets, sctp_next) {
/* stop all timers */
sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep,
- stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_30);
+ stcb, net,
+ SCTP_FROM_SCTP_INDATA + SCTP_LOC_32);
net->flight_size = 0;
net->partial_bytes_acked = 0;
}
@@ -4687,7 +4699,7 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup,
*abort_now = 1;
/* XXX */
op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, "");
- stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_31;
+ stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_33;
sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED);
return;
} else {
@@ -4839,7 +4851,7 @@ again:
} else if (SCTP_OS_TIMER_PENDING(&net->rxt_timer.timer)) {
sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep,
stcb, net,
- SCTP_FROM_SCTP_INDATA + SCTP_LOC_22);
+ SCTP_FROM_SCTP_INDATA + SCTP_LOC_34);
}
}
}
@@ -5129,7 +5141,7 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb,
"New cum ack %8.8x too high, highest TSN %8.8x",
new_cum_tsn, asoc->highest_tsn_inside_map);
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
- stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_33;
+ stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_35;
sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED);
return;
}
diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c
index 048dfd3..89047cb 100644
--- a/sys/netinet/sctp_input.c
+++ b/sys/netinet/sctp_input.c
@@ -513,7 +513,7 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int offset,
* primary.
*/
sctp_timer_stop(SCTP_TIMER_TYPE_INIT, stcb->sctp_ep, stcb,
- asoc->primary_destination, SCTP_FROM_SCTP_INPUT + SCTP_LOC_4);
+ asoc->primary_destination, SCTP_FROM_SCTP_INPUT + SCTP_LOC_3);
/* calculate the RTO */
net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, sctp_align_safe_nocopy,
@@ -633,7 +633,8 @@ sctp_handle_heartbeat_ack(struct sctp_heartbeat_chunk *cp,
}
sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED,
stcb, 0, (void *)r_net, SCTP_SO_NOT_LOCKED);
- sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, r_net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_3);
+ sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb,
+ r_net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_4);
sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, r_net);
}
old_error_counter = r_net->error_count;
@@ -654,7 +655,8 @@ sctp_handle_heartbeat_ack(struct sctp_heartbeat_chunk *cp,
stcb->asoc.cc_functions.sctp_cwnd_update_exit_pf(stcb, net);
}
if (old_error_counter > 0) {
- sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, r_net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_3);
+ sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep,
+ stcb, r_net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_5);
sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, r_net);
}
if (r_net == stcb->asoc.primary_destination) {
@@ -673,7 +675,9 @@ sctp_handle_heartbeat_ack(struct sctp_heartbeat_chunk *cp,
sctp_is_mobility_feature_on(stcb->sctp_ep,
SCTP_MOBILITY_PRIM_DELETED)) {
- sctp_timer_stop(SCTP_TIMER_TYPE_PRIM_DELETED, stcb->sctp_ep, stcb, NULL, SCTP_FROM_SCTP_TIMER + SCTP_LOC_7);
+ sctp_timer_stop(SCTP_TIMER_TYPE_PRIM_DELETED,
+ stcb->sctp_ep, stcb, NULL,
+ SCTP_FROM_SCTP_INPUT + SCTP_LOC_6);
if (sctp_is_mobility_feature_on(stcb->sctp_ep,
SCTP_MOBILITY_FASTHANDOFF)) {
sctp_assoc_immediate_retrans(stcb,
@@ -795,7 +799,8 @@ sctp_handle_abort(struct sctp_abort_chunk *abort,
error = 0;
}
/* stop any receive timers */
- sctp_timer_stop(SCTP_TIMER_TYPE_RECV, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_6);
+ sctp_timer_stop(SCTP_TIMER_TYPE_RECV, stcb->sctp_ep, stcb, net,
+ SCTP_FROM_SCTP_INPUT + SCTP_LOC_7);
/* notify user of the abort and clean up... */
sctp_abort_notification(stcb, 1, error, abort, SCTP_SO_NOT_LOCKED);
/* free the tcb */
@@ -817,7 +822,7 @@ sctp_handle_abort(struct sctp_abort_chunk *abort,
#endif
stcb->asoc.state |= SCTP_STATE_WAS_ABORTED;
(void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC,
- SCTP_FROM_SCTP_INPUT + SCTP_LOC_6);
+ SCTP_FROM_SCTP_INPUT + SCTP_LOC_8);
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
SCTP_SOCKET_UNLOCK(so, 1);
#endif
@@ -932,7 +937,8 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp,
* stop the shutdown timer, since we WILL move to
* SHUTDOWN-ACK-SENT.
*/
- sctp_timer_stop(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_8);
+ sctp_timer_stop(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb,
+ net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_9);
}
/* Now is there unsent data on a stream somewhere? */
some_on_streamwheel = sctp_is_there_unsent_data(stcb, SCTP_SO_NOT_LOCKED);
@@ -1025,7 +1031,8 @@ sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chunk *cp SCTP_UNUSED,
}
#endif
/* stop the timer */
- sctp_timer_stop(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_9);
+ sctp_timer_stop(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, net,
+ SCTP_FROM_SCTP_INPUT + SCTP_LOC_10);
/* send SHUTDOWN-COMPLETE */
sctp_send_shutdown_complete(stcb, net, 0);
/* notify upper layer protocol */
@@ -1046,7 +1053,7 @@ sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chunk *cp SCTP_UNUSED,
atomic_subtract_int(&stcb->asoc.refcnt, 1);
#endif
(void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC,
- SCTP_FROM_SCTP_INPUT + SCTP_LOC_10);
+ SCTP_FROM_SCTP_INPUT + SCTP_LOC_11);
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
SCTP_SOCKET_UNLOCK(so, 1);
#endif
@@ -1206,7 +1213,7 @@ sctp_handle_error(struct sctp_chunkhdr *ch,
atomic_subtract_int(&stcb->asoc.refcnt, 1);
#endif
(void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC,
- SCTP_FROM_SCTP_INPUT + SCTP_LOC_11);
+ SCTP_FROM_SCTP_INPUT + SCTP_LOC_12);
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
SCTP_SOCKET_UNLOCK(so, 1);
#endif
@@ -1558,9 +1565,12 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset,
return (NULL);
}
/* we have already processed the INIT so no problem */
- sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb,
- net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_12);
- sctp_timer_stop(SCTP_TIMER_TYPE_INIT, inp, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_13);
+ sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, inp,
+ stcb, net,
+ SCTP_FROM_SCTP_INPUT + SCTP_LOC_13);
+ sctp_timer_stop(SCTP_TIMER_TYPE_INIT, inp,
+ stcb, net,
+ SCTP_FROM_SCTP_INPUT + SCTP_LOC_14);
/* update current state */
if (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)
SCTP_STAT_INCR_COUNTER32(sctps_activeestab);
@@ -1720,7 +1730,8 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset,
}
if (how_indx < sizeof(asoc->cookie_how))
asoc->cookie_how[how_indx] = 8;
- sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_14);
+ sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net,
+ SCTP_FROM_SCTP_INPUT + SCTP_LOC_15);
sctp_stop_all_cookie_timers(stcb);
/*
* since we did not send a HB make sure we don't double
@@ -1865,8 +1876,10 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset,
/* temp code */
if (how_indx < sizeof(asoc->cookie_how))
asoc->cookie_how[how_indx] = 12;
- sctp_timer_stop(SCTP_TIMER_TYPE_INIT, inp, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_15);
- sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_16);
+ sctp_timer_stop(SCTP_TIMER_TYPE_INIT, inp, stcb, net,
+ SCTP_FROM_SCTP_INPUT + SCTP_LOC_16);
+ sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net,
+ SCTP_FROM_SCTP_INPUT + SCTP_LOC_17);
/* notify upper layer */
*notification = SCTP_NOTIFY_ASSOC_RESTART;
@@ -2134,7 +2147,7 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset,
SCTP_TCB_LOCK(stcb);
#endif
(void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
- SCTP_FROM_SCTP_INPUT + SCTP_LOC_16);
+ SCTP_FROM_SCTP_INPUT + SCTP_LOC_18);
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
SCTP_SOCKET_UNLOCK(so, 1);
#endif
@@ -2165,7 +2178,8 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset,
SCTP_SOCKET_LOCK(so, 1);
SCTP_TCB_LOCK(stcb);
#endif
- (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_16);
+ (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
+ SCTP_FROM_SCTP_INPUT + SCTP_LOC_19);
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
SCTP_SOCKET_UNLOCK(so, 1);
#endif
@@ -2182,7 +2196,8 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset,
SCTP_SOCKET_LOCK(so, 1);
SCTP_TCB_LOCK(stcb);
#endif
- (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_17);
+ (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
+ SCTP_FROM_SCTP_INPUT + SCTP_LOC_20);
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
SCTP_SOCKET_UNLOCK(so, 1);
#endif
@@ -2211,7 +2226,8 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset,
SCTP_SOCKET_LOCK(so, 1);
SCTP_TCB_LOCK(stcb);
#endif
- (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_18);
+ (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
+ SCTP_FROM_SCTP_INPUT + SCTP_LOC_21);
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
SCTP_SOCKET_UNLOCK(so, 1);
#endif
@@ -2271,7 +2287,8 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset,
SCTP_SOCKET_LOCK(so, 1);
SCTP_TCB_LOCK(stcb);
#endif
- (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_19);
+ (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
+ SCTP_FROM_SCTP_INPUT + SCTP_LOC_22);
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
SCTP_SOCKET_UNLOCK(so, 1);
#endif
@@ -2741,7 +2758,8 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset,
SCTP_TCB_LOCK((*stcb));
atomic_subtract_int(&(*stcb)->asoc.refcnt, 1);
#endif
- (void)sctp_free_assoc(*inp_p, *stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_20);
+ (void)sctp_free_assoc(*inp_p, *stcb, SCTP_NORMAL_PROC,
+ SCTP_FROM_SCTP_INPUT + SCTP_LOC_23);
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
SCTP_SOCKET_UNLOCK(pcb_so, 1);
#endif
@@ -3173,7 +3191,8 @@ sctp_handle_shutdown_complete(struct sctp_shutdown_complete_chunk *cp SCTP_UNUSE
}
#endif
/* stop the timer */
- sctp_timer_stop(SCTP_TIMER_TYPE_SHUTDOWNACK, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_22);
+ sctp_timer_stop(SCTP_TIMER_TYPE_SHUTDOWNACK, stcb->sctp_ep, stcb, net,
+ SCTP_FROM_SCTP_INPUT + SCTP_LOC_24);
SCTP_STAT_INCR_COUNTER32(sctps_shutdown);
/* free the TCB */
SCTPDBG(SCTP_DEBUG_INPUT2,
@@ -3186,7 +3205,8 @@ sctp_handle_shutdown_complete(struct sctp_shutdown_complete_chunk *cp SCTP_UNUSE
SCTP_TCB_LOCK(stcb);
atomic_subtract_int(&stcb->asoc.refcnt, 1);
#endif
- (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_23);
+ (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC,
+ SCTP_FROM_SCTP_INPUT + SCTP_LOC_25);
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
SCTP_SOCKET_UNLOCK(so, 1);
#endif
@@ -3294,7 +3314,8 @@ process_chunk_drop(struct sctp_tcb *stcb, struct sctp_chunk_desc *desc,
/* restart the timer */
sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep,
- stcb, tp1->whoTo, SCTP_FROM_SCTP_INPUT + SCTP_LOC_24);
+ stcb, tp1->whoTo,
+ SCTP_FROM_SCTP_INPUT + SCTP_LOC_26);
sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep,
stcb, tp1->whoTo);
@@ -3362,7 +3383,8 @@ process_chunk_drop(struct sctp_tcb *stcb, struct sctp_chunk_desc *desc,
* this, otherwise we let the timer fire.
*/
sctp_timer_stop(SCTP_TIMER_TYPE_INIT, stcb->sctp_ep,
- stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_25);
+ stcb, net,
+ SCTP_FROM_SCTP_INPUT + SCTP_LOC_27);
sctp_send_initiate(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED);
}
break;
@@ -3539,7 +3561,8 @@ sctp_clean_up_stream_reset(struct sctp_tcb *stcb)
}
asoc = &stcb->asoc;
- sctp_timer_stop(SCTP_TIMER_TYPE_STRRESET, stcb->sctp_ep, stcb, chk->whoTo, SCTP_FROM_SCTP_INPUT + SCTP_LOC_26);
+ sctp_timer_stop(SCTP_TIMER_TYPE_STRRESET, stcb->sctp_ep, stcb,
+ chk->whoTo, SCTP_FROM_SCTP_INPUT + SCTP_LOC_28);
TAILQ_REMOVE(&asoc->control_send_queue,
chk,
sctp_next);
@@ -4783,7 +4806,8 @@ process_control_chunks:
SCTP_TCB_LOCK(stcb);
atomic_subtract_int(&stcb->asoc.refcnt, 1);
#endif
- (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_27);
+ (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
+ SCTP_FROM_SCTP_INPUT + SCTP_LOC_29);
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
SCTP_SOCKET_UNLOCK(so, 1);
#endif
@@ -5203,7 +5227,8 @@ process_control_chunks:
SCTP_TCB_LOCK(stcb);
atomic_subtract_int(&stcb->asoc.refcnt, 1);
#endif
- (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_27);
+ (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
+ SCTP_FROM_SCTP_INPUT + SCTP_LOC_30);
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
SCTP_SOCKET_UNLOCK(so, 1);
#endif
@@ -5381,7 +5406,8 @@ process_control_chunks:
SCTP_TCB_LOCK(stcb);
atomic_subtract_int(&stcb->asoc.refcnt, 1);
#endif
- (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_29);
+ (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
+ SCTP_FROM_SCTP_INPUT + SCTP_LOC_31);
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
SCTP_SOCKET_UNLOCK(so, 1);
#endif
diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c
index ed3b9ec..a52ed4e 100644
--- a/sys/netinet/sctp_output.c
+++ b/sys/netinet/sctp_output.c
@@ -3160,8 +3160,6 @@ again_with_private_addresses_allowed:
sifa = NULL;
continue;
}
- } else {
- SCTP_PRINTF("Stcb is null - no print\n");
}
atomic_add_int(&sifa->refcount, 1);
goto out;
@@ -4063,7 +4061,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
sctp_route_t iproute;
int len;
- len = sizeof(struct ip) + sizeof(struct sctphdr);
+ len = SCTP_MIN_V4_OVERHEAD;
if (port) {
len += sizeof(struct udphdr);
}
@@ -4345,7 +4343,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
flowlabel = ntohl(((struct in6pcb *)inp)->in6p_flowinfo);
}
flowlabel &= 0x000fffff;
- len = sizeof(struct ip6_hdr) + sizeof(struct sctphdr);
+ len = SCTP_MIN_OVERHEAD;
if (port) {
len += sizeof(struct udphdr);
}
@@ -5107,10 +5105,11 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_initpkt,
if (op_err == NULL) {
/* Ok need to try to get a mbuf */
#ifdef INET6
- l_len = sizeof(struct ip6_hdr) + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr);
+ l_len = SCTP_MIN_OVERHEAD;
#else
- l_len = sizeof(struct ip) + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr);
+ l_len = SCTP_MIN_V4_OVERHEAD;
#endif
+ l_len += sizeof(struct sctp_chunkhdr);
l_len += plen;
l_len += sizeof(struct sctp_paramhdr);
op_err = sctp_get_mbuf_for_msg(l_len, 0, M_NOWAIT, 1, MT_DATA);
@@ -5176,10 +5175,11 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_initpkt,
/* Ok need to try to get an mbuf */
#ifdef INET6
- l_len = sizeof(struct ip6_hdr) + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr);
+ l_len = SCTP_MIN_OVERHEAD;
#else
- l_len = sizeof(struct ip) + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr);
+ l_len = SCTP_MIN_V4_OVERHEAD;
#endif
+ l_len += sizeof(struct sctp_chunkhdr);
l_len += plen;
l_len += sizeof(struct sctp_paramhdr);
op_err = sctp_get_mbuf_for_msg(l_len, 0, M_NOWAIT, 1, MT_DATA);
@@ -5251,10 +5251,11 @@ invalid_size:
int l_len;
#ifdef INET6
- l_len = sizeof(struct ip6_hdr) + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr);
+ l_len = SCTP_MIN_OVERHEAD;
#else
- l_len = sizeof(struct ip) + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr);
+ l_len = SCTP_MIN_V4_OVERHEAD;
#endif
+ l_len += sizeof(struct sctp_chunkhdr);
l_len += (2 * sizeof(struct sctp_paramhdr));
op_err = sctp_get_mbuf_for_msg(l_len, 0, M_NOWAIT, 1, MT_DATA);
if (op_err) {
@@ -5588,11 +5589,7 @@ do_a_abort:
stc.ipv6_addr_legal = 0;
stc.ipv4_addr_legal = 1;
}
-#ifdef SCTP_DONT_DO_PRIVADDR_SCOPE
- stc.ipv4_scope = 1;
-#else
stc.ipv4_scope = 0;
-#endif
if (net == NULL) {
to = src;
switch (dst->sa_family) {
@@ -5613,13 +5610,10 @@ do_a_abort:
stc.laddr_type = SCTP_IPV4_ADDRESS;
/* scope_id is only for v6 */
stc.scope_id = 0;
-#ifndef SCTP_DONT_DO_PRIVADDR_SCOPE
- if (IN4_ISPRIVATE_ADDRESS(&src4->sin_addr)) {
+ if ((IN4_ISPRIVATE_ADDRESS(&src4->sin_addr)) ||
+ (IN4_ISPRIVATE_ADDRESS(&dst4->sin_addr))) {
stc.ipv4_scope = 1;
}
-#else
- stc.ipv4_scope = 1;
-#endif /* SCTP_DONT_DO_PRIVADDR_SCOPE */
/* Must use the address in this case */
if (sctp_is_address_on_local_host(src, vrf_id)) {
stc.loopback_scope = 1;
@@ -5641,16 +5635,18 @@ do_a_abort:
stc.local_scope = 0;
stc.site_scope = 1;
stc.ipv4_scope = 1;
- } else if (IN6_IS_ADDR_LINKLOCAL(&src6->sin6_addr)) {
+ } else if (IN6_IS_ADDR_LINKLOCAL(&src6->sin6_addr) ||
+ IN6_IS_ADDR_LINKLOCAL(&dst6->sin6_addr)) {
/*
- * If the new destination is a
- * LINK_LOCAL we must have common
- * both site and local scope. Don't
- * set local scope though since we
- * must depend on the source to be
- * added implicitly. We cannot
- * assure just because we share one
- * link that all links are common.
+ * If the new destination or source
+ * is a LINK_LOCAL we must have
+ * common both site and local scope.
+ * Don't set local scope though
+ * since we must depend on the
+ * source to be added implicitly. We
+ * cannot assure just because we
+ * share one link that all links are
+ * common.
*/
stc.local_scope = 0;
stc.site_scope = 1;
@@ -5666,11 +5662,12 @@ do_a_abort:
* pull out the scope_id from
* incoming pkt
*/
- } else if (IN6_IS_ADDR_SITELOCAL(&src6->sin6_addr)) {
+ } else if (IN6_IS_ADDR_SITELOCAL(&src6->sin6_addr) ||
+ IN6_IS_ADDR_SITELOCAL(&dst6->sin6_addr)) {
/*
- * If the new destination is
- * SITE_LOCAL then we must have site
- * scope in common.
+ * If the new destination or source
+ * is SITE_LOCAL then we must have
+ * site scope in common.
*/
stc.site_scope = 1;
}
@@ -7961,12 +7958,12 @@ again_one_more_time:
switch (((struct sockaddr *)&net->ro._l_addr)->sa_family) {
#ifdef INET
case AF_INET:
- mtu = net->mtu - (sizeof(struct ip) + sizeof(struct sctphdr));
+ mtu = net->mtu - SCTP_MIN_V4_OVERHEAD;
break;
#endif
#ifdef INET6
case AF_INET6:
- mtu = net->mtu - (sizeof(struct ip6_hdr) + sizeof(struct sctphdr));
+ mtu = net->mtu - SCTP_MIN_OVERHEAD;
break;
#endif
default:
@@ -7988,6 +7985,7 @@ again_one_more_time:
} else {
r_mtu = mtu;
}
+ error = 0;
/************************/
/* ASCONF transmission */
/************************/
@@ -8111,6 +8109,12 @@ again_one_more_time:
* it is used to do appropriate
* source address selection.
*/
+ if (*now_filled == 0) {
+ (void)SCTP_GETTIME_TIMEVAL(now);
+ *now_filled = 1;
+ }
+ net->last_sent_time = *now;
+ hbflag = 0;
if ((error = sctp_lowlevel_chunk_output(inp, stcb, net,
(struct sockaddr *)&net->ro._l_addr,
outchain, auth_offset, auth,
@@ -8121,21 +8125,18 @@ again_one_more_time:
net->port, NULL,
0, 0,
so_locked))) {
- if (error == ENOBUFS) {
- asoc->ifp_had_enobuf = 1;
- SCTP_STAT_INCR(sctps_lowlevelerr);
- }
+ /*
+ * error, we could not
+ * output
+ */
+ SCTPDBG(SCTP_DEBUG_OUTPUT3, "Gak send error %d\n", error);
if (from_where == 0) {
SCTP_STAT_INCR(sctps_lowlevelerrusr);
}
- if (*now_filled == 0) {
- (void)SCTP_GETTIME_TIMEVAL(&net->last_sent_time);
- *now_filled = 1;
- *now = net->last_sent_time;
- } else {
- net->last_sent_time = *now;
+ if (error == ENOBUFS) {
+ asoc->ifp_had_enobuf = 1;
+ SCTP_STAT_INCR(sctps_lowlevelerr);
}
- hbflag = 0;
/* error, could not output */
if (error == EHOSTUNREACH) {
/*
@@ -8146,17 +8147,10 @@ again_one_more_time:
sctp_move_chunks_from_net(stcb, net);
}
*reason_code = 7;
- continue;
- } else
- asoc->ifp_had_enobuf = 0;
- if (*now_filled == 0) {
- (void)SCTP_GETTIME_TIMEVAL(&net->last_sent_time);
- *now_filled = 1;
- *now = net->last_sent_time;
+ break;
} else {
- net->last_sent_time = *now;
+ asoc->ifp_had_enobuf = 0;
}
- hbflag = 0;
/*
* increase the number we sent, if a
* cookie is sent we don't tell them
@@ -8189,6 +8183,10 @@ again_one_more_time:
}
}
}
+ if (error != 0) {
+ /* try next net */
+ continue;
+ }
/************************/
/* Control transmission */
/************************/
@@ -8327,7 +8325,8 @@ again_one_more_time:
/* turn off the timer */
if (SCTP_OS_TIMER_PENDING(&stcb->asoc.dack_timer.timer)) {
sctp_timer_stop(SCTP_TIMER_TYPE_RECV,
- inp, stcb, net, SCTP_FROM_SCTP_OUTPUT + SCTP_LOC_1);
+ inp, stcb, net,
+ SCTP_FROM_SCTP_OUTPUT + SCTP_LOC_1);
}
}
ctl_cnt++;
@@ -8384,6 +8383,15 @@ again_one_more_time:
sctp_timer_start(SCTP_TIMER_TYPE_COOKIE, inp, stcb, net);
cookie = 0;
}
+ /* Only HB or ASCONF advances time */
+ if (hbflag) {
+ if (*now_filled == 0) {
+ (void)SCTP_GETTIME_TIMEVAL(now);
+ *now_filled = 1;
+ }
+ net->last_sent_time = *now;
+ hbflag = 0;
+ }
if ((error = sctp_lowlevel_chunk_output(inp, stcb, net,
(struct sockaddr *)&net->ro._l_addr,
outchain,
@@ -8395,23 +8403,17 @@ again_one_more_time:
net->port, NULL,
0, 0,
so_locked))) {
- if (error == ENOBUFS) {
- asoc->ifp_had_enobuf = 1;
- SCTP_STAT_INCR(sctps_lowlevelerr);
- }
+ /*
+ * error, we could not
+ * output
+ */
+ SCTPDBG(SCTP_DEBUG_OUTPUT3, "Gak send error %d\n", error);
if (from_where == 0) {
SCTP_STAT_INCR(sctps_lowlevelerrusr);
}
- /* error, could not output */
- if (hbflag) {
- if (*now_filled == 0) {
- (void)SCTP_GETTIME_TIMEVAL(&net->last_sent_time);
- *now_filled = 1;
- *now = net->last_sent_time;
- } else {
- net->last_sent_time = *now;
- }
- hbflag = 0;
+ if (error == ENOBUFS) {
+ asoc->ifp_had_enobuf = 1;
+ SCTP_STAT_INCR(sctps_lowlevelerr);
}
if (error == EHOSTUNREACH) {
/*
@@ -8422,19 +8424,9 @@ again_one_more_time:
sctp_move_chunks_from_net(stcb, net);
}
*reason_code = 7;
- continue;
- } else
+ break;
+ } else {
asoc->ifp_had_enobuf = 0;
- /* Only HB or ASCONF advances time */
- if (hbflag) {
- if (*now_filled == 0) {
- (void)SCTP_GETTIME_TIMEVAL(&net->last_sent_time);
- *now_filled = 1;
- *now = net->last_sent_time;
- } else {
- net->last_sent_time = *now;
- }
- hbflag = 0;
}
/*
* increase the number we sent, if a
@@ -8468,6 +8460,10 @@ again_one_more_time:
}
}
}
+ if (error != 0) {
+ /* try next net */
+ continue;
+ }
/* JRI: if dest is in PF state, do not send data to it */
if ((asoc->sctp_cmt_on_off > 0) &&
(net != stcb->asoc.alternate) &&
@@ -8512,16 +8508,16 @@ again_one_more_time:
switch (((struct sockaddr *)&net->ro._l_addr)->sa_family) {
#ifdef INET
case AF_INET:
- if (net->mtu > (sizeof(struct ip) + sizeof(struct sctphdr)))
- omtu = net->mtu - (sizeof(struct ip) + sizeof(struct sctphdr));
+ if (net->mtu > SCTP_MIN_V4_OVERHEAD)
+ omtu = net->mtu - SCTP_MIN_V4_OVERHEAD;
else
omtu = 0;
break;
#endif
#ifdef INET6
case AF_INET6:
- if (net->mtu > (sizeof(struct ip6_hdr) + sizeof(struct sctphdr)))
- omtu = net->mtu - (sizeof(struct ip6_hdr) + sizeof(struct sctphdr));
+ if (net->mtu > SCTP_MIN_OVERHEAD)
+ omtu = net->mtu - SCTP_MIN_OVERHEAD;
else
omtu = 0;
break;
@@ -8531,7 +8527,8 @@ again_one_more_time:
omtu = 0;
break;
}
- if ((((asoc->state & SCTP_STATE_OPEN) == SCTP_STATE_OPEN) &&
+ if ((((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) ||
+ (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) &&
(skip_data_for_this_net == 0)) ||
(cookie)) {
TAILQ_FOREACH_SAFE(chk, &asoc->send_queue, sctp_next, nchk) {
@@ -8721,6 +8718,14 @@ no_data_fill:
*/
sctp_timer_start(SCTP_TIMER_TYPE_SEND, inp, stcb, net);
}
+ if (bundle_at || hbflag) {
+ /* For data/asconf and hb set time */
+ if (*now_filled == 0) {
+ (void)SCTP_GETTIME_TIMEVAL(now);
+ *now_filled = 1;
+ }
+ net->last_sent_time = *now;
+ }
/* Now send it, if there is anything to send :> */
if ((error = sctp_lowlevel_chunk_output(inp,
stcb,
@@ -8739,23 +8744,13 @@ no_data_fill:
0, 0,
so_locked))) {
/* error, we could not output */
- if (error == ENOBUFS) {
- SCTP_STAT_INCR(sctps_lowlevelerr);
- asoc->ifp_had_enobuf = 1;
- }
+ SCTPDBG(SCTP_DEBUG_OUTPUT3, "Gak send error %d\n", error);
if (from_where == 0) {
SCTP_STAT_INCR(sctps_lowlevelerrusr);
}
- SCTPDBG(SCTP_DEBUG_OUTPUT3, "Gak send error %d\n", error);
- if (hbflag) {
- if (*now_filled == 0) {
- (void)SCTP_GETTIME_TIMEVAL(&net->last_sent_time);
- *now_filled = 1;
- *now = net->last_sent_time;
- } else {
- net->last_sent_time = *now;
- }
- hbflag = 0;
+ if (error == ENOBUFS) {
+ SCTP_STAT_INCR(sctps_lowlevelerr);
+ asoc->ifp_had_enobuf = 1;
}
if (error == EHOSTUNREACH) {
/*
@@ -8780,16 +8775,6 @@ no_data_fill:
endoutchain = NULL;
auth = NULL;
auth_offset = 0;
- if (bundle_at || hbflag) {
- /* For data/asconf and hb set time */
- if (*now_filled == 0) {
- (void)SCTP_GETTIME_TIMEVAL(&net->last_sent_time);
- *now_filled = 1;
- *now = net->last_sent_time;
- } else {
- net->last_sent_time = *now;
- }
- }
if (!no_out_cnt) {
*num_out += (ctl_cnt + bundle_at);
}
@@ -9780,7 +9765,7 @@ one_chunk_around:
* t3-expiring.
*/
sctp_timer_stop(SCTP_TIMER_TYPE_SEND, inp, stcb, net,
- SCTP_FROM_SCTP_OUTPUT + SCTP_LOC_4);
+ SCTP_FROM_SCTP_OUTPUT + SCTP_LOC_2);
sctp_timer_start(SCTP_TIMER_TYPE_SEND, inp, stcb, net);
}
}
@@ -10387,7 +10372,8 @@ sctp_send_sack(struct sctp_tcb *stcb, int so_locked
/* No memory so we drop the idea, and set a timer */
if (stcb->asoc.delayed_ack) {
sctp_timer_stop(SCTP_TIMER_TYPE_RECV,
- stcb->sctp_ep, stcb, NULL, SCTP_FROM_SCTP_OUTPUT + SCTP_LOC_5);
+ stcb->sctp_ep, stcb, NULL,
+ SCTP_FROM_SCTP_OUTPUT + SCTP_LOC_3);
sctp_timer_start(SCTP_TIMER_TYPE_RECV,
stcb->sctp_ep, stcb, NULL);
} else {
@@ -10455,7 +10441,8 @@ sctp_send_sack(struct sctp_tcb *stcb, int so_locked
/* sa_ignore NO_NULL_CHK */
if (stcb->asoc.delayed_ack) {
sctp_timer_stop(SCTP_TIMER_TYPE_RECV,
- stcb->sctp_ep, stcb, NULL, SCTP_FROM_SCTP_OUTPUT + SCTP_LOC_6);
+ stcb->sctp_ep, stcb, NULL,
+ SCTP_FROM_SCTP_OUTPUT + SCTP_LOC_4);
sctp_timer_start(SCTP_TIMER_TYPE_RECV,
stcb->sctp_ep, stcb, NULL);
} else {
@@ -11996,9 +11983,6 @@ sctp_copy_one(struct sctp_stream_queue_pending *sp,
struct uio *uio,
int resv_upfront)
{
- int left;
-
- left = sp->length;
sp->data = m_uiotombuf(uio, M_WAITOK, sp->length,
resv_upfront, 0);
if (sp->data == NULL) {
@@ -12427,7 +12411,8 @@ sctp_lower_sosend(struct socket *so,
if (control) {
if (sctp_process_cmsgs_for_init(stcb, control, &error)) {
- sctp_free_assoc(inp, stcb, SCTP_PCBFREE_FORCE, SCTP_FROM_SCTP_OUTPUT + SCTP_LOC_7);
+ sctp_free_assoc(inp, stcb, SCTP_PCBFREE_FORCE,
+ SCTP_FROM_SCTP_OUTPUT + SCTP_LOC_5);
hold_tcblock = 0;
stcb = NULL;
goto out_unlocked;
diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c
index 6edf33a..6fcb6d2 100644
--- a/sys/netinet/sctp_pcb.c
+++ b/sys/netinet/sctp_pcb.c
@@ -3544,7 +3544,8 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from)
(SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) {
SCTP_STAT_DECR_GAUGE32(sctps_currestab);
}
- if (sctp_free_assoc(inp, asoc, SCTP_PCBFREE_FORCE, SCTP_FROM_SCTP_PCB + SCTP_LOC_8) == 0) {
+ if (sctp_free_assoc(inp, asoc, SCTP_PCBFREE_FORCE,
+ SCTP_FROM_SCTP_PCB + SCTP_LOC_8) == 0) {
cnt++;
}
}
@@ -3791,13 +3792,9 @@ sctp_add_remote_addr(struct sctp_tcb *stcb, struct sockaddr *newaddr,
/* assure len is set */
sin->sin_len = sizeof(struct sockaddr_in);
if (set_scope) {
-#ifdef SCTP_DONT_DO_PRIVADDR_SCOPE
- stcb->asoc.scope.ipv4_local_scope = 1;
-#else
if (IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) {
stcb->asoc.scope.ipv4_local_scope = 1;
}
-#endif /* SCTP_DONT_DO_PRIVADDR_SCOPE */
} else {
/* Validate the address is in scope */
if ((IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) &&
diff --git a/sys/netinet/sctp_sysctl.c b/sys/netinet/sctp_sysctl.c
index 285d7fb..bb22c27 100644
--- a/sys/netinet/sctp_sysctl.c
+++ b/sys/netinet/sctp_sysctl.c
@@ -418,6 +418,7 @@ sctp_sysctl_handle_assoclist(SYSCTL_HANDLER_ARGS)
xinpcb.total_recvs = inp->total_recvs;
xinpcb.total_nospaces = inp->total_nospaces;
xinpcb.fragmentation_point = inp->sctp_frag_point;
+ xinpcb.socket = inp->sctp_socket;
so = inp->sctp_socket;
if ((so == NULL) ||
(inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) {
diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c
index d8422b9..257d188 100644
--- a/sys/netinet/sctp_timer.c
+++ b/sys/netinet/sctp_timer.c
@@ -110,7 +110,9 @@ sctp_threshold_management(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
net->dest_state |= SCTP_ADDR_PF;
net->last_active = sctp_get_tick_count();
sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED);
- sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_TIMER + SCTP_LOC_3);
+ sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT,
+ stcb->sctp_ep, stcb, net,
+ SCTP_FROM_SCTP_TIMER + SCTP_LOC_1);
sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net);
}
}
@@ -153,7 +155,7 @@ sctp_threshold_management(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION,
"Association error counter exceeded");
- inp->last_abort_code = SCTP_FROM_SCTP_TIMER + SCTP_LOC_1;
+ inp->last_abort_code = SCTP_FROM_SCTP_TIMER + SCTP_LOC_2;
sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED);
return (1);
}
@@ -1046,7 +1048,7 @@ sctp_cookie_timer(struct sctp_inpcb *inp,
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION,
"Cookie timer expired, but no cookie");
- inp->last_abort_code = SCTP_FROM_SCTP_TIMER + SCTP_LOC_4;
+ inp->last_abort_code = SCTP_FROM_SCTP_TIMER + SCTP_LOC_3;
sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED);
} else {
#ifdef INVARIANTS
diff --git a/sys/netinet/sctp_uio.h b/sys/netinet/sctp_uio.h
index d22b9d1..fd78d34 100644
--- a/sys/netinet/sctp_uio.h
+++ b/sys/netinet/sctp_uio.h
@@ -1165,7 +1165,12 @@ struct xsctp_inpcb {
uint16_t local_port;
uint16_t qlen;
uint16_t maxqlen;
- uint32_t extra_padding[31]; /* future */
+ void *socket;
+#if defined(__LP64__)
+ uint32_t extra_padding[29]; /* future */
+#else
+ uint32_t extra_padding[30]; /* future */
+#endif
};
struct xsctp_tcb {
diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c
index d252969..3d06a52 100644
--- a/sys/netinet/sctp_usrreq.c
+++ b/sys/netinet/sctp_usrreq.c
@@ -288,7 +288,8 @@ sctp_notify(struct sctp_inpcb *inp,
SCTP_TCB_LOCK(stcb);
atomic_subtract_int(&stcb->asoc.refcnt, 1);
#endif
- (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_2);
+ (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
+ SCTP_FROM_SCTP_USRREQ + SCTP_LOC_2);
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
SCTP_SOCKET_UNLOCK(so, 1);
/* SCTP_TCB_UNLOCK(stcb); MT: I think this is not needed. */
@@ -777,7 +778,8 @@ sctp_disconnect(struct socket *so)
(SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) {
SCTP_STAT_DECR_GAUGE32(sctps_currestab);
}
- (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_3);
+ (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
+ SCTP_FROM_SCTP_USRREQ + SCTP_LOC_3);
/* No unlock tcb assoc is gone */
return (0);
}
@@ -862,7 +864,8 @@ sctp_disconnect(struct socket *so)
SCTP_STAT_DECR_GAUGE32(sctps_currestab);
}
SCTP_INP_RUNLOCK(inp);
- (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_5);
+ (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
+ SCTP_FROM_SCTP_USRREQ + SCTP_LOC_5);
return (0);
} else {
sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CLOSING, SCTP_SO_LOCKED);
@@ -1562,7 +1565,8 @@ sctp_do_connect_x(struct socket *so, struct sctp_inpcb *inp, void *optval,
sctp_connectx_helper_add(stcb, sa, (totaddr - 1), &error);
/* Fill in the return id */
if (error) {
- (void)sctp_free_assoc(inp, stcb, SCTP_PCBFREE_FORCE, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_6);
+ (void)sctp_free_assoc(inp, stcb, SCTP_PCBFREE_FORCE,
+ SCTP_FROM_SCTP_USRREQ + SCTP_LOC_7);
goto out_now;
}
a_id = (sctp_assoc_t *) optval;
@@ -2435,17 +2439,23 @@ flags_out:
/* Applies to the specific association */
paddrp->spp_flags = 0;
if (net != NULL) {
- int ovh;
-
- if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
- ovh = SCTP_MED_OVERHEAD;
- } else {
- ovh = SCTP_MED_V4_OVERHEAD;
- }
-
paddrp->spp_hbinterval = net->heart_beat_delay;
paddrp->spp_pathmaxrxt = net->failure_threshold;
- paddrp->spp_pathmtu = net->mtu - ovh;
+ paddrp->spp_pathmtu = net->mtu;
+ switch (net->ro._l_addr.sa.sa_family) {
+#ifdef INET
+ case AF_INET:
+ paddrp->spp_pathmtu -= SCTP_MIN_V4_OVERHEAD;
+ break;
+#endif
+#ifdef INET6
+ case AF_INET6:
+ paddrp->spp_pathmtu -= SCTP_MIN_V4_OVERHEAD;
+ break;
+#endif
+ default:
+ break;
+ }
/* get flags for HB */
if (net->dest_state & SCTP_ADDR_NOHB) {
paddrp->spp_flags |= SPP_HB_DISABLE;
@@ -2454,9 +2464,9 @@ flags_out:
}
/* get flags for PMTU */
if (net->dest_state & SCTP_ADDR_NO_PMTUD) {
- paddrp->spp_flags |= SPP_PMTUD_ENABLE;
- } else {
paddrp->spp_flags |= SPP_PMTUD_DISABLE;
+ } else {
+ paddrp->spp_flags |= SPP_PMTUD_ENABLE;
}
if (net->dscp & 0x01) {
paddrp->spp_dscp = net->dscp & 0xfc;
@@ -2475,7 +2485,7 @@ flags_out:
* value
*/
paddrp->spp_pathmaxrxt = stcb->asoc.def_net_failure;
- paddrp->spp_pathmtu = sctp_get_frag_point(stcb, &stcb->asoc);
+ paddrp->spp_pathmtu = 0;
if (stcb->asoc.default_dscp & 0x01) {
paddrp->spp_dscp = stcb->asoc.default_dscp & 0xfc;
paddrp->spp_flags |= SPP_DSCP;
@@ -2611,6 +2621,20 @@ flags_out:
paddri->spinfo_rto = net->RTO;
paddri->spinfo_assoc_id = sctp_get_associd(stcb);
paddri->spinfo_mtu = net->mtu;
+ switch (addr->sa_family) {
+#if defined(INET)
+ case AF_INET:
+ paddri->spinfo_mtu -= SCTP_MIN_V4_OVERHEAD;
+ break;
+#endif
+#if defined(INET6)
+ case AF_INET6:
+ paddri->spinfo_mtu -= SCTP_MIN_OVERHEAD;
+ break;
+#endif
+ default:
+ break;
+ }
SCTP_TCB_UNLOCK(stcb);
*optsize = sizeof(struct sctp_paddrinfo);
} else {
@@ -2687,6 +2711,20 @@ flags_out:
sstat->sstat_primary.spinfo_srtt = net->lastsa >> SCTP_RTT_SHIFT;
sstat->sstat_primary.spinfo_rto = net->RTO;
sstat->sstat_primary.spinfo_mtu = net->mtu;
+ switch (stcb->asoc.primary_destination->ro._l_addr.sa.sa_family) {
+#if defined(INET)
+ case AF_INET:
+ sstat->sstat_primary.spinfo_mtu -= SCTP_MIN_V4_OVERHEAD;
+ break;
+#endif
+#if defined(INET6)
+ case AF_INET6:
+ sstat->sstat_primary.spinfo_mtu -= SCTP_MIN_OVERHEAD;
+ break;
+#endif
+ default:
+ break;
+ }
sstat->sstat_primary.spinfo_assoc_id = sctp_get_associd(stcb);
SCTP_TCB_UNLOCK(stcb);
*optsize = sizeof(struct sctp_status);
@@ -4785,7 +4823,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
(void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered);
sctp_timer_stop(SCTP_TIMER_TYPE_INIT, inp, stcb,
stcb->asoc.primary_destination,
- SCTP_FROM_SCTP_USRREQ + SCTP_LOC_9);
+ SCTP_FROM_SCTP_USRREQ + SCTP_LOC_8);
sctp_send_initiate(inp, stcb, SCTP_SO_LOCKED);
} else {
/*
@@ -5184,26 +5222,13 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
}
if (stcb != NULL) {
/************************TCB SPECIFIC SET ******************/
- /*
- * do we change the timer for HB, we run
- * only one?
- */
- int ovh = 0;
-
- if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
- ovh = SCTP_MED_OVERHEAD;
- } else {
- ovh = SCTP_MED_V4_OVERHEAD;
- }
-
- /* network sets ? */
if (net != NULL) {
/************************NET SPECIFIC SET ******************/
if (paddrp->spp_flags & SPP_HB_DISABLE) {
if (!(net->dest_state & SCTP_ADDR_UNCONFIRMED) &&
!(net->dest_state & SCTP_ADDR_NOHB)) {
sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net,
- SCTP_FROM_SCTP_USRREQ + SCTP_LOC_10);
+ SCTP_FROM_SCTP_USRREQ + SCTP_LOC_9);
}
net->dest_state |= SCTP_ADDR_NOHB;
}
@@ -5227,10 +5252,24 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
if ((paddrp->spp_flags & SPP_PMTUD_DISABLE) && (paddrp->spp_pathmtu >= SCTP_SMALLEST_PMTU)) {
if (SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) {
sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net,
- SCTP_FROM_SCTP_USRREQ + SCTP_LOC_10);
+ SCTP_FROM_SCTP_USRREQ + SCTP_LOC_11);
}
net->dest_state |= SCTP_ADDR_NO_PMTUD;
- net->mtu = paddrp->spp_pathmtu + ovh;
+ net->mtu = paddrp->spp_pathmtu;
+ switch (net->ro._l_addr.sa.sa_family) {
+#ifdef INET
+ case AF_INET:
+ net->mtu += SCTP_MIN_V4_OVERHEAD;
+ break;
+#endif
+#ifdef INET6
+ case AF_INET6:
+ net->mtu += SCTP_MIN_OVERHEAD;
+ break;
+#endif
+ default:
+ break;
+ }
if (net->mtu < stcb->asoc.smallest_mtu) {
sctp_pathmtu_adjustment(stcb, net->mtu);
}
@@ -5251,7 +5290,9 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
(net->error_count > net->pf_threshold)) {
net->dest_state |= SCTP_ADDR_PF;
sctp_send_hb(stcb, net, SCTP_SO_LOCKED);
- sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_TIMER + SCTP_LOC_3);
+ sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT,
+ stcb->sctp_ep, stcb, net,
+ SCTP_FROM_SCTP_USRREQ + SCTP_LOC_12);
sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net);
}
}
@@ -5294,7 +5335,9 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
(net->error_count > net->pf_threshold)) {
net->dest_state |= SCTP_ADDR_PF;
sctp_send_hb(stcb, net, SCTP_SO_LOCKED);
- sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_TIMER + SCTP_LOC_3);
+ sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT,
+ stcb->sctp_ep, stcb, net,
+ SCTP_FROM_SCTP_USRREQ + SCTP_LOC_13);
sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net);
}
}
@@ -5329,7 +5372,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
net->dest_state &= ~SCTP_ADDR_NOHB;
}
sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net,
- SCTP_FROM_SCTP_USRREQ + SCTP_LOC_10);
+ SCTP_FROM_SCTP_USRREQ + SCTP_LOC_14);
sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net);
}
sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_DONOT_HEARTBEAT);
@@ -5339,7 +5382,9 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
if (!(net->dest_state & SCTP_ADDR_NOHB)) {
net->dest_state |= SCTP_ADDR_NOHB;
if (!(net->dest_state & SCTP_ADDR_UNCONFIRMED)) {
- sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_10);
+ sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT,
+ inp, stcb, net,
+ SCTP_FROM_SCTP_USRREQ + SCTP_LOC_15);
}
}
}
@@ -5349,10 +5394,24 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
if (SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) {
sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net,
- SCTP_FROM_SCTP_USRREQ + SCTP_LOC_10);
+ SCTP_FROM_SCTP_USRREQ + SCTP_LOC_16);
}
net->dest_state |= SCTP_ADDR_NO_PMTUD;
- net->mtu = paddrp->spp_pathmtu + ovh;
+ net->mtu = paddrp->spp_pathmtu;
+ switch (net->ro._l_addr.sa.sa_family) {
+#ifdef INET
+ case AF_INET:
+ net->mtu += SCTP_MIN_V4_OVERHEAD;
+ break;
+#endif
+#ifdef INET6
+ case AF_INET6:
+ net->mtu += SCTP_MIN_OVERHEAD;
+ break;
+#endif
+ default:
+ break;
+ }
if (net->mtu < stcb->asoc.smallest_mtu) {
sctp_pathmtu_adjustment(stcb, net->mtu);
}
@@ -6199,7 +6258,9 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
(net->error_count <= net->failure_threshold)) {
net->dest_state |= SCTP_ADDR_PF;
sctp_send_hb(stcb, net, SCTP_SO_LOCKED);
- sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_TIMER + SCTP_LOC_3);
+ sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT,
+ stcb->sctp_ep, stcb, net,
+ SCTP_FROM_SCTP_USRREQ + SCTP_LOC_17);
sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net);
}
}
@@ -6228,7 +6289,9 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
(net->error_count <= net->failure_threshold)) {
net->dest_state |= SCTP_ADDR_PF;
sctp_send_hb(stcb, net, SCTP_SO_LOCKED);
- sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_TIMER + SCTP_LOC_3);
+ sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT,
+ stcb->sctp_ep, stcb, net,
+ SCTP_FROM_SCTP_USRREQ + SCTP_LOC_18);
sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net);
}
}
@@ -7127,7 +7190,8 @@ sctp_accept(struct socket *so, struct sockaddr **addr)
}
if (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) {
SCTP_TCB_LOCK(stcb);
- sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_7);
+ sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
+ SCTP_FROM_SCTP_USRREQ + SCTP_LOC_19);
}
return (0);
}
diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c
index a30a942..24110dd 100644
--- a/sys/netinet/sctputil.c
+++ b/sys/netinet/sctputil.c
@@ -1449,7 +1449,7 @@ sctp_timeout_handler(void *t)
struct socket *so;
#endif
- int did_output, type;
+ int did_output;
tmr = (struct sctp_timer *)t;
inp = (struct sctp_inpcb *)tmr->ep;
@@ -1488,7 +1488,6 @@ sctp_timeout_handler(void *t)
}
/* if this is an iterator timeout, get the struct and clear inp */
tmr->stopped_from = 0xa003;
- type = tmr->type;
if (inp) {
SCTP_INP_INCR_REF(inp);
if ((inp->sctp_socket == NULL) &&
@@ -1809,7 +1808,8 @@ sctp_timeout_handler(void *t)
SCTP_STAT_INCR(sctps_timoassockill);
/* Can we free it yet? */
SCTP_INP_DECR_REF(inp);
- sctp_timer_stop(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL, SCTP_FROM_SCTPUTIL + SCTP_LOC_1);
+ sctp_timer_stop(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL,
+ SCTP_FROM_SCTPUTIL + SCTP_LOC_1);
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
so = SCTP_INP_SO(inp);
atomic_add_int(&stcb->asoc.refcnt, 1);
@@ -1818,7 +1818,8 @@ sctp_timeout_handler(void *t)
SCTP_TCB_LOCK(stcb);
atomic_subtract_int(&stcb->asoc.refcnt, 1);
#endif
- (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTPUTIL + SCTP_LOC_2);
+ (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
+ SCTP_FROM_SCTPUTIL + SCTP_LOC_2);
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
SCTP_SOCKET_UNLOCK(so, 1);
#endif
@@ -1838,7 +1839,8 @@ sctp_timeout_handler(void *t)
* killer
*/
SCTP_INP_DECR_REF(inp);
- sctp_timer_stop(SCTP_TIMER_TYPE_INPKILL, inp, NULL, NULL, SCTP_FROM_SCTPUTIL + SCTP_LOC_3);
+ sctp_timer_stop(SCTP_TIMER_TYPE_INPKILL, inp, NULL, NULL,
+ SCTP_FROM_SCTPUTIL + SCTP_LOC_3);
sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_ABORT,
SCTP_CALLED_FROM_INPKILL_TIMER);
inp = NULL;
@@ -1873,7 +1875,7 @@ out_decr:
}
out_no_decr:
SCTPDBG(SCTP_DEBUG_TIMER1, "Timer now complete (type %d)\n",
- type);
+ tmr->type);
CURVNET_RESTORE();
}
@@ -3910,7 +3912,8 @@ sctp_abort_association(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
(SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) {
SCTP_STAT_DECR_GAUGE32(sctps_currestab);
}
- (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTPUTIL + SCTP_LOC_4);
+ (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
+ SCTP_FROM_SCTPUTIL + SCTP_LOC_4);
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
SCTP_SOCKET_UNLOCK(so, 1);
#endif
@@ -4034,7 +4037,8 @@ sctp_abort_an_association(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
atomic_subtract_int(&stcb->asoc.refcnt, 1);
}
#endif
- (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTPUTIL + SCTP_LOC_5);
+ (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
+ SCTP_FROM_SCTPUTIL + SCTP_LOC_5);
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
if (!so_locked) {
SCTP_SOCKET_UNLOCK(so, 1);
@@ -5165,7 +5169,8 @@ sctp_user_rcvd(struct sctp_tcb *stcb, uint32_t * freed_so_far, int hold_rlock,
sctp_chunk_output(stcb->sctp_ep, stcb,
SCTP_OUTPUT_FROM_USR_RCVD, SCTP_SO_LOCKED);
/* make sure no timer is running */
- sctp_timer_stop(SCTP_TIMER_TYPE_RECV, stcb->sctp_ep, stcb, NULL, SCTP_FROM_SCTPUTIL + SCTP_LOC_6);
+ sctp_timer_stop(SCTP_TIMER_TYPE_RECV, stcb->sctp_ep, stcb, NULL,
+ SCTP_FROM_SCTPUTIL + SCTP_LOC_6);
SCTP_TCB_UNLOCK(stcb);
} else {
/* Update how much we have pending */
@@ -6323,14 +6328,16 @@ sctp_connectx_helper_add(struct sctp_tcb *stcb, struct sockaddr *addr,
(sin->sin_addr.s_addr == INADDR_BROADCAST) ||
IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) {
SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, EINVAL);
- (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_7);
+ (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
+ SCTP_FROM_SCTPUTIL + SCTP_LOC_7);
*error = EINVAL;
goto out_now;
}
if (sctp_add_remote_addr(stcb, sa, NULL, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) {
/* assoc gone no un-lock */
SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ENOBUFS);
- (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_7);
+ (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
+ SCTP_FROM_SCTPUTIL + SCTP_LOC_8);
*error = ENOBUFS;
goto out_now;
}
@@ -6344,14 +6351,16 @@ sctp_connectx_helper_add(struct sctp_tcb *stcb, struct sockaddr *addr,
if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) ||
IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) {
SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, EINVAL);
- (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_8);
+ (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
+ SCTP_FROM_SCTPUTIL + SCTP_LOC_9);
*error = EINVAL;
goto out_now;
}
if (sctp_add_remote_addr(stcb, sa, NULL, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) {
/* assoc gone no un-lock */
SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ENOBUFS);
- (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_8);
+ (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
+ SCTP_FROM_SCTPUTIL + SCTP_LOC_10);
*error = ENOBUFS;
goto out_now;
}
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c
index a64e403..d992492 100644
--- a/sys/netinet/tcp_timer.c
+++ b/sys/netinet/tcp_timer.c
@@ -347,11 +347,12 @@ tcp_timer_2msl(void *xtp)
tp = tcp_close(tp);
} else {
if (tp->t_state != TCPS_TIME_WAIT &&
- ticks - tp->t_rcvtime <= TP_MAXIDLE(tp))
- callout_reset_on(&tp->t_timers->tt_2msl,
- TP_KEEPINTVL(tp), tcp_timer_2msl, tp,
- inp_to_cpuid(inp));
- else
+ ticks - tp->t_rcvtime <= TP_MAXIDLE(tp)) {
+ if (!callout_reset(&tp->t_timers->tt_2msl,
+ TP_KEEPINTVL(tp), tcp_timer_2msl, tp)) {
+ tp->t_timers->tt_flags &= ~TT_2MSL_RST;
+ }
+ } else
tp = tcp_close(tp);
}
@@ -431,11 +432,14 @@ tcp_timer_keep(void *xtp)
tp->rcv_nxt, tp->snd_una - 1, 0);
free(t_template, M_TEMP);
}
- callout_reset_on(&tp->t_timers->tt_keep, TP_KEEPINTVL(tp),
- tcp_timer_keep, tp, inp_to_cpuid(inp));
- } else
- callout_reset_on(&tp->t_timers->tt_keep, TP_KEEPIDLE(tp),
- tcp_timer_keep, tp, inp_to_cpuid(inp));
+ if (!callout_reset(&tp->t_timers->tt_keep, TP_KEEPINTVL(tp),
+ tcp_timer_keep, tp)) {
+ tp->t_timers->tt_flags &= ~TT_KEEP_RST;
+ }
+ } else if (!callout_reset(&tp->t_timers->tt_keep, TP_KEEPIDLE(tp),
+ tcp_timer_keep, tp)) {
+ tp->t_timers->tt_flags &= ~TT_KEEP_RST;
+ }
#ifdef TCPDEBUG
if (inp->inp_socket->so_options & SO_DEBUG)
@@ -810,6 +814,7 @@ tcp_timer_activate(struct tcpcb *tp, uint32_t timer_type, u_int delta)
timeout_t *f_callout;
struct inpcb *inp = tp->t_inpcb;
int cpu = inp_to_cpuid(inp);
+ uint32_t f_reset;
#ifdef TCP_OFFLOAD
if (tp->t_flags & TF_TOE)
@@ -823,38 +828,49 @@ tcp_timer_activate(struct tcpcb *tp, uint32_t timer_type, u_int delta)
case TT_DELACK:
t_callout = &tp->t_timers->tt_delack;
f_callout = tcp_timer_delack;
+ f_reset = TT_DELACK_RST;
break;
case TT_REXMT:
t_callout = &tp->t_timers->tt_rexmt;
f_callout = tcp_timer_rexmt;
+ f_reset = TT_REXMT_RST;
break;
case TT_PERSIST:
t_callout = &tp->t_timers->tt_persist;
f_callout = tcp_timer_persist;
+ f_reset = TT_PERSIST_RST;
break;
case TT_KEEP:
t_callout = &tp->t_timers->tt_keep;
f_callout = tcp_timer_keep;
+ f_reset = TT_KEEP_RST;
break;
case TT_2MSL:
t_callout = &tp->t_timers->tt_2msl;
f_callout = tcp_timer_2msl;
+ f_reset = TT_2MSL_RST;
break;
default:
panic("tp %p bad timer_type %#x", tp, timer_type);
}
if (delta == 0) {
if ((tp->t_timers->tt_flags & timer_type) &&
- callout_stop(t_callout)) {
- tp->t_timers->tt_flags &= ~timer_type;
+ callout_stop(t_callout) &&
+ (tp->t_timers->tt_flags & f_reset)) {
+ tp->t_timers->tt_flags &= ~(timer_type | f_reset);
}
} else {
if ((tp->t_timers->tt_flags & timer_type) == 0) {
- tp->t_timers->tt_flags |= timer_type;
+ tp->t_timers->tt_flags |= (timer_type | f_reset);
callout_reset_on(t_callout, delta, f_callout, tp, cpu);
} else {
/* Reset already running callout on the same CPU. */
- callout_reset(t_callout, delta, f_callout, tp);
+ if (!callout_reset(t_callout, delta, f_callout, tp)) {
+ /*
+ * Callout not cancelled, consider it as not
+ * properly restarted. */
+ tp->t_timers->tt_flags &= ~f_reset;
+ }
}
}
}
@@ -891,6 +907,7 @@ tcp_timer_stop(struct tcpcb *tp, uint32_t timer_type)
{
struct callout *t_callout;
timeout_t *f_callout;
+ uint32_t f_reset;
tp->t_timers->tt_flags |= TT_STOPPED;
@@ -898,30 +915,36 @@ tcp_timer_stop(struct tcpcb *tp, uint32_t timer_type)
case TT_DELACK:
t_callout = &tp->t_timers->tt_delack;
f_callout = tcp_timer_delack_discard;
+ f_reset = TT_DELACK_RST;
break;
case TT_REXMT:
t_callout = &tp->t_timers->tt_rexmt;
f_callout = tcp_timer_rexmt_discard;
+ f_reset = TT_REXMT_RST;
break;
case TT_PERSIST:
t_callout = &tp->t_timers->tt_persist;
f_callout = tcp_timer_persist_discard;
+ f_reset = TT_PERSIST_RST;
break;
case TT_KEEP:
t_callout = &tp->t_timers->tt_keep;
f_callout = tcp_timer_keep_discard;
+ f_reset = TT_KEEP_RST;
break;
case TT_2MSL:
t_callout = &tp->t_timers->tt_2msl;
f_callout = tcp_timer_2msl_discard;
+ f_reset = TT_2MSL_RST;
break;
default:
panic("tp %p bad timer_type %#x", tp, timer_type);
}
if (tp->t_timers->tt_flags & timer_type) {
- if (callout_stop(t_callout)) {
- tp->t_timers->tt_flags &= ~timer_type;
+ if (callout_stop(t_callout) &&
+ (tp->t_timers->tt_flags & f_reset)) {
+ tp->t_timers->tt_flags &= ~(timer_type | f_reset);
} else {
/*
* Can't stop the callout, defer tcpcb actual deletion
diff --git a/sys/netinet/tcp_timer.h b/sys/netinet/tcp_timer.h
index 02a7782..dbb8aee 100644
--- a/sys/netinet/tcp_timer.h
+++ b/sys/netinet/tcp_timer.h
@@ -160,6 +160,12 @@ struct tcp_timer {
#define TT_2MSL 0x0010
#define TT_MASK (TT_DELACK|TT_REXMT|TT_PERSIST|TT_KEEP|TT_2MSL)
+#define TT_DELACK_RST 0x0100
+#define TT_REXMT_RST 0x0200
+#define TT_PERSIST_RST 0x0400
+#define TT_KEEP_RST 0x0800
+#define TT_2MSL_RST 0x1000
+
#define TT_STOPPED 0x00010000
#define TP_KEEPINIT(tp) ((tp)->t_keepinit ? (tp)->t_keepinit : tcp_keepinit)
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index d2570c4..fe98f0c 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -1279,6 +1279,7 @@ in6_broadcast_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra,
nd6_dad_start((struct ifaddr *)ia, delay);
}
+ in6_newaddrmsg(ia, RTM_ADD);
ifa_free(&ia->ia_ifa);
return (error);
}
@@ -1327,6 +1328,7 @@ in6_purgeaddr(struct ifaddr *ifa)
ia->ia_flags &= ~IFA_ROUTE;
}
+ in6_newaddrmsg(ia, RTM_DELETE);
in6_unlink_ifa(ia, ifp);
}
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 83dda1a..daac188 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -2185,7 +2185,6 @@ nd6_add_ifa_lle(struct in6_ifaddr *ia)
ln->la_expire = 0; /* for IPv6 this means permanent */
ln->ln_state = ND6_LLINFO_REACHABLE;
LLE_WUNLOCK(ln);
- in6_newaddrmsg(ia, RTM_ADD);
return (0);
}
@@ -2205,8 +2204,6 @@ nd6_rem_ifa_lle(struct in6_ifaddr *ia)
struct sockaddr_in6 mask, addr;
struct ifnet *ifp;
- in6_newaddrmsg(ia, RTM_DELETE);
-
ifp = ia->ia_ifa.ifa_ifp;
memcpy(&addr, &ia->ia_addr, sizeof(ia->ia_addr));
memcpy(&mask, &ia->ia_prefixmask, sizeof(ia->ia_prefixmask));
diff --git a/sys/netinet6/sctp6_usrreq.c b/sys/netinet6/sctp6_usrreq.c
index f2b2322..54c65b6 100644
--- a/sys/netinet6/sctp6_usrreq.c
+++ b/sys/netinet6/sctp6_usrreq.c
@@ -211,7 +211,8 @@ sctp6_notify_mbuf(struct sctp_inpcb *inp, struct icmp6_hdr *icmp6,
*/
nxtsz = ntohl(icmp6->icmp6_mtu);
/* Stop any PMTU timer */
- sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, NULL, SCTP_FROM_SCTP6_USRREQ + SCTP_LOC_1);
+ sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, NULL,
+ SCTP_FROM_SCTP6_USRREQ + SCTP_LOC_1);
/* Adjust destination size limit */
if (net->mtu > nxtsz) {
@@ -333,7 +334,8 @@ sctp6_notify(struct sctp_inpcb *inp,
SCTP_TCB_LOCK(stcb);
atomic_subtract_int(&stcb->asoc.refcnt, 1);
#endif
- (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_2);
+ (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
+ SCTP_FROM_SCTP6_USRREQ + SCTP_LOC_2);
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
SCTP_SOCKET_UNLOCK(so, 1);
/* SCTP_TCB_UNLOCK(stcb); MT: I think this is not needed. */
diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c
index 1e70fb2..b6c6a6a 100644
--- a/sys/netipsec/key.c
+++ b/sys/netipsec/key.c
@@ -7714,14 +7714,6 @@ key_sa_chgstate(struct secasvar *sav, u_int8_t state)
}
}
-void
-key_sa_stir_iv(struct secasvar *sav)
-{
-
- IPSEC_ASSERT(sav->iv != NULL, ("null IV"));
- key_randomfill(sav->iv, sav->ivlen);
-}
-
/*
* Take one of the kernel's security keys and convert it into a PF_KEY
* structure within an mbuf, suitable for sending up to a waiting
diff --git a/sys/netipsec/key.h b/sys/netipsec/key.h
index 29abb80..82811be 100644
--- a/sys/netipsec/key.h
+++ b/sys/netipsec/key.h
@@ -105,7 +105,6 @@ extern void key_init(void);
extern void key_destroy(void);
#endif
extern void key_sa_recordxfer(struct secasvar *, struct mbuf *);
-extern void key_sa_stir_iv(struct secasvar *);
#ifdef IPSEC_NAT_T
u_int16_t key_portfromsaddr(struct sockaddr *);
#define KEY_PORTFROMSADDR(saddr) \
diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c
index 3f210c2..384f565 100644
--- a/sys/netpfil/pf/pf_norm.c
+++ b/sys/netpfil/pf/pf_norm.c
@@ -76,7 +76,6 @@ struct pf_fragment_cmp {
uint32_t frc_id;
sa_family_t frc_af;
uint8_t frc_proto;
- uint8_t frc_direction;
};
struct pf_fragment {
@@ -86,7 +85,6 @@ struct pf_fragment {
#define fr_id fr_key.frc_id
#define fr_af fr_key.frc_af
#define fr_proto fr_key.frc_proto
-#define fr_direction fr_key.frc_direction
RB_ENTRY(pf_fragment) fr_entry;
TAILQ_ENTRY(pf_fragment) frag_next;
@@ -157,7 +155,7 @@ static struct mbuf *pf_fragcache(struct mbuf **, struct ip*,
#endif /* INET */
#ifdef INET6
static int pf_reassemble6(struct mbuf **, struct ip6_hdr *,
- struct ip6_frag *, uint16_t, uint16_t, int, u_short *);
+ struct ip6_frag *, uint16_t, uint16_t, u_short *);
static void pf_scrub_ip6(struct mbuf **, uint8_t);
#endif /* INET6 */
@@ -178,7 +176,6 @@ pf_ip2key(struct ip *ip, int dir, struct pf_fragment_cmp *key)
key->frc_af = AF_INET;
key->frc_proto = ip->ip_p;
key->frc_id = ip->ip_id;
- key->frc_direction = dir;
}
#endif /* INET */
@@ -663,7 +660,7 @@ pf_reassemble(struct mbuf **m0, struct ip *ip, int dir, u_short *reason)
#ifdef INET6
static int
pf_reassemble6(struct mbuf **m0, struct ip6_hdr *ip6, struct ip6_frag *fraghdr,
- uint16_t hdrlen, uint16_t extoff, int dir, u_short *reason)
+ uint16_t hdrlen, uint16_t extoff, u_short *reason)
{
struct mbuf *m = *m0;
struct pf_frent *frent;
@@ -697,7 +694,6 @@ pf_reassemble6(struct mbuf **m0, struct ip6_hdr *ip6, struct ip6_frag *fraghdr,
/* Only the first fragment's protocol is relevant. */
key.frc_proto = 0;
key.frc_id = fraghdr->ip6f_ident;
- key.frc_direction = dir;
if ((frag = pf_fillup_fragment(&key, frent, reason)) == NULL) {
PF_FRAG_UNLOCK();
@@ -823,6 +819,8 @@ pf_fragcache(struct mbuf **m0, struct ip *h, struct pf_fragment **frag, int mff,
(*frag)->fr_max = 0;
(*frag)->fr_src.v4 = h->ip_src;
(*frag)->fr_dst.v4 = h->ip_dst;
+ (*frag)->fr_af = AF_INET;
+ (*frag)->fr_proto = h->ip_p;
(*frag)->fr_id = h->ip_id;
(*frag)->fr_timeout = time_uptime;
@@ -1553,7 +1551,7 @@ pf_normalize_ip6(struct mbuf **m0, int dir, struct pfi_kif *kif,
off += sizeof(frag);
/* Returns PF_DROP or *m0 is NULL or completely reassembled mbuf. */
- if (pf_reassemble6(m0, h, &frag, off, extoff, dir, reason) != PF_PASS)
+ if (pf_reassemble6(m0, h, &frag, off, extoff, reason) != PF_PASS)
return (PF_DROP);
m = *m0;
if (m == NULL)
diff --git a/sys/ofed/drivers/infiniband/core/umem.c b/sys/ofed/drivers/infiniband/core/umem.c
index cdd2e67..5f4465f 100644
--- a/sys/ofed/drivers/infiniband/core/umem.c
+++ b/sys/ofed/drivers/infiniband/core/umem.c
@@ -272,7 +272,7 @@ struct ib_umem *ib_umem_get_ex(struct ib_ucontext *context, unsigned long addr,
PROC_LOCK(proc);
if (ptoa(npages +
pmap_wired_count(vm_map_pmap(&proc->p_vmspace->vm_map))) >
- lim_cur(proc, RLIMIT_MEMLOCK)) {
+ lim_cur_proc(proc, RLIMIT_MEMLOCK)) {
PROC_UNLOCK(proc);
kfree(umem);
return ERR_PTR(-ENOMEM);
diff --git a/sys/ofed/drivers/infiniband/hw/mthca/mthca_memfree.c b/sys/ofed/drivers/infiniband/hw/mthca/mthca_memfree.c
index 0cdebaf..ad5818e 100644
--- a/sys/ofed/drivers/infiniband/hw/mthca/mthca_memfree.c
+++ b/sys/ofed/drivers/infiniband/hw/mthca/mthca_memfree.c
@@ -553,7 +553,8 @@ out:
proc = curproc;
pmap = vm_map_pmap(&proc->p_vmspace->vm_map);
PROC_LOCK(proc);
- if (ptoa(pmap_wired_count(pmap) + 1) > lim_cur(proc, RLIMIT_MEMLOCK)) {
+ if (ptoa(pmap_wired_count(pmap) + 1) >
+ lim_cur_proc(proc, RLIMIT_MEMLOCK)) {
PROC_UNLOCK(proc);
ret = -ENOMEM;
goto out;
diff --git a/sys/ofed/drivers/net/mlx4/en_netdev.c b/sys/ofed/drivers/net/mlx4/en_netdev.c
index 5988c0d..d8b2f4f 100644
--- a/sys/ofed/drivers/net/mlx4/en_netdev.c
+++ b/sys/ofed/drivers/net/mlx4/en_netdev.c
@@ -1967,6 +1967,29 @@ static int mlx4_en_ioctl(struct ifnet *dev, u_long command, caddr_t data)
mutex_unlock(&mdev->state_lock);
VLAN_CAPABILITIES(dev);
break;
+ case SIOCGI2C: {
+ struct ifi2creq i2c;
+
+ error = copyin(ifr->ifr_data, &i2c, sizeof(i2c));
+ if (error)
+ break;
+ if (i2c.len > sizeof(i2c.data)) {
+ error = EINVAL;
+ break;
+ }
+ /*
+ * Note that we ignore i2c.addr here. The driver hardcodes
+ * the address to 0x50, while standard expects it to be 0xA0.
+ */
+ error = mlx4_get_module_info(mdev->dev, priv->port,
+ i2c.offset, i2c.len, i2c.data);
+ if (error < 0) {
+ error = -error;
+ break;
+ }
+ error = copyout(&i2c, ifr->ifr_data, sizeof(i2c));
+ break;
+ }
default:
error = ether_ioctl(dev, command, data);
break;
diff --git a/sys/ofed/drivers/net/mlx4/port.c b/sys/ofed/drivers/net/mlx4/port.c
index c653d4b..4d7aa0b 100644
--- a/sys/ofed/drivers/net/mlx4/port.c
+++ b/sys/ofed/drivers/net/mlx4/port.c
@@ -1058,3 +1058,160 @@ int mlx4_get_roce_gid_from_slave(struct mlx4_dev *dev, int port, int slave_id, u
}
EXPORT_SYMBOL(mlx4_get_roce_gid_from_slave);
+/* Cable Module Info */
+#define MODULE_INFO_MAX_READ 48
+
+#define I2C_ADDR_LOW 0x50
+#define I2C_ADDR_HIGH 0x51
+#define I2C_PAGE_SIZE 256
+
+/* Module Info Data */
+struct mlx4_cable_info {
+ u8 i2c_addr;
+ u8 page_num;
+ __be16 dev_mem_address;
+ __be16 reserved1;
+ __be16 size;
+ __be32 reserved2[2];
+ u8 data[MODULE_INFO_MAX_READ];
+};
+
+enum cable_info_err {
+ CABLE_INF_INV_PORT = 0x1,
+ CABLE_INF_OP_NOSUP = 0x2,
+ CABLE_INF_NOT_CONN = 0x3,
+ CABLE_INF_NO_EEPRM = 0x4,
+ CABLE_INF_PAGE_ERR = 0x5,
+ CABLE_INF_INV_ADDR = 0x6,
+ CABLE_INF_I2C_ADDR = 0x7,
+ CABLE_INF_QSFP_VIO = 0x8,
+ CABLE_INF_I2C_BUSY = 0x9,
+};
+
+#define MAD_STATUS_2_CABLE_ERR(mad_status) ((mad_status >> 8) & 0xFF)
+
+#ifdef DEBUG
+static inline const char *cable_info_mad_err_str(u16 mad_status)
+{
+ u8 err = MAD_STATUS_2_CABLE_ERR(mad_status);
+
+ switch (err) {
+ case CABLE_INF_INV_PORT:
+ return "invalid port selected";
+ case CABLE_INF_OP_NOSUP:
+ return "operation not supported for this port (the port is of type CX4 or internal)";
+ case CABLE_INF_NOT_CONN:
+ return "cable is not connected";
+ case CABLE_INF_NO_EEPRM:
+ return "the connected cable has no EPROM (passive copper cable)";
+ case CABLE_INF_PAGE_ERR:
+ return "page number is greater than 15";
+ case CABLE_INF_INV_ADDR:
+ return "invalid device_address or size (that is, size equals 0 or address+size is greater than 256)";
+ case CABLE_INF_I2C_ADDR:
+ return "invalid I2C slave address";
+ case CABLE_INF_QSFP_VIO:
+ return "at least one cable violates the QSFP specification and ignores the modsel signal";
+ case CABLE_INF_I2C_BUSY:
+ return "I2C bus is constantly busy";
+ }
+ return "Unknown Error";
+}
+#endif /* DEBUG */
+
+/**
+ * mlx4_get_module_info - Read cable module eeprom data
+ * @dev: mlx4_dev.
+ * @port: port number.
+ * @offset: byte offset in eeprom to start reading data from.
+ * @size: num of bytes to read.
+ * @data: output buffer to put the requested data into.
+ *
+ * Reads cable module eeprom data, puts the outcome data into
+ * data pointer paramer.
+ * Returns num of read bytes on success or a negative error
+ * code.
+ */
+int mlx4_get_module_info(struct mlx4_dev *dev, u8 port, u16 offset,
+ u16 size, u8 *data)
+{
+ struct mlx4_cmd_mailbox *inbox, *outbox;
+ struct mlx4_mad_ifc *inmad, *outmad;
+ struct mlx4_cable_info *cable_info;
+ u16 i2c_addr;
+ int ret;
+
+ if (size > MODULE_INFO_MAX_READ)
+ size = MODULE_INFO_MAX_READ;
+
+ inbox = mlx4_alloc_cmd_mailbox(dev);
+ if (IS_ERR(inbox))
+ return PTR_ERR(inbox);
+
+ outbox = mlx4_alloc_cmd_mailbox(dev);
+ if (IS_ERR(outbox)) {
+ mlx4_free_cmd_mailbox(dev, inbox);
+ return PTR_ERR(outbox);
+ }
+
+ inmad = (struct mlx4_mad_ifc *)(inbox->buf);
+ outmad = (struct mlx4_mad_ifc *)(outbox->buf);
+
+ inmad->method = 0x1; /* Get */
+ inmad->class_version = 0x1;
+ inmad->mgmt_class = 0x1;
+ inmad->base_version = 0x1;
+ inmad->attr_id = cpu_to_be16(0xFF60); /* Module Info */
+
+ if (offset < I2C_PAGE_SIZE && offset + size > I2C_PAGE_SIZE)
+ /* Cross pages reads are not allowed
+ * read until offset 256 in low page
+ */
+ size -= offset + size - I2C_PAGE_SIZE;
+
+ i2c_addr = I2C_ADDR_LOW;
+ if (offset >= I2C_PAGE_SIZE) {
+ /* Reset offset to high page */
+ i2c_addr = I2C_ADDR_HIGH;
+ offset -= I2C_PAGE_SIZE;
+ }
+
+ cable_info = (struct mlx4_cable_info *)inmad->data;
+ cable_info->dev_mem_address = cpu_to_be16(offset);
+ cable_info->page_num = 0;
+ cable_info->i2c_addr = i2c_addr;
+ cable_info->size = cpu_to_be16(size);
+
+ ret = mlx4_cmd_box(dev, inbox->dma, outbox->dma, port, 3,
+ MLX4_CMD_MAD_IFC, MLX4_CMD_TIME_CLASS_C, MLX4_CMD_NATIVE);
+ if (ret)
+ goto out;
+
+ if (be16_to_cpu(outmad->status)) {
+ /* Mad returned with bad status */
+ ret = be16_to_cpu(outmad->status);
+#ifdef DEBUG
+ mlx4_warn(dev, "MLX4_CMD_MAD_IFC Get Module info attr(%x) "
+ "port(%d) i2c_addr(%x) offset(%d) size(%d): Response "
+ "Mad Status(%x) - %s\n", 0xFF60, port, i2c_addr, offset,
+ size, ret, cable_info_mad_err_str(ret));
+#endif
+ if (i2c_addr == I2C_ADDR_HIGH &&
+ MAD_STATUS_2_CABLE_ERR(ret) == CABLE_INF_I2C_ADDR)
+ /* Some SFP cables do not support i2c slave
+ * address 0x51 (high page), abort silently.
+ */
+ ret = 0;
+ else
+ ret = -ret;
+ goto out;
+ }
+ cable_info = (struct mlx4_cable_info *)outmad->data;
+ memcpy(data, cable_info->data, size);
+ ret = size;
+out:
+ mlx4_free_cmd_mailbox(dev, inbox);
+ mlx4_free_cmd_mailbox(dev, outbox);
+ return ret;
+}
+EXPORT_SYMBOL(mlx4_get_module_info);
diff --git a/sys/ofed/include/linux/mlx4/device.h b/sys/ofed/include/linux/mlx4/device.h
index 8c0db91..536c421 100644
--- a/sys/ofed/include/linux/mlx4/device.h
+++ b/sys/ofed/include/linux/mlx4/device.h
@@ -892,6 +892,26 @@ struct mlx4_init_port_param {
u64 si_guid;
};
+#define MAD_IFC_DATA_SZ 192
+/* MAD IFC Mailbox */
+struct mlx4_mad_ifc {
+ u8 base_version;
+ u8 mgmt_class;
+ u8 class_version;
+ u8 method;
+ __be16 status;
+ __be16 class_specific;
+ __be64 tid;
+ __be16 attr_id;
+ __be16 resv;
+ __be32 attr_mod;
+ __be64 mkey;
+ __be16 dr_slid;
+ __be16 dr_dlid;
+ u8 reserved[28];
+ u8 data[MAD_IFC_DATA_SZ];
+} __packed;
+
#define mlx4_foreach_port(port, dev, type) \
for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \
if ((type) == (dev)->caps.port_mask[(port)])
@@ -1294,4 +1314,7 @@ int mlx4_read_clock(struct mlx4_dev *dev);
int mlx4_get_internal_clock_params(struct mlx4_dev *dev,
struct mlx4_clock_params *params);
+int mlx4_get_module_info(struct mlx4_dev *dev, u8 port,
+ u16 offset, u16 size, u8 *data);
+
#endif /* MLX4_DEVICE_H */
diff --git a/sys/opencrypto/cryptodeflate.c b/sys/opencrypto/cryptodeflate.c
index c55210d..28e284f 100644
--- a/sys/opencrypto/cryptodeflate.c
+++ b/sys/opencrypto/cryptodeflate.c
@@ -105,8 +105,8 @@ deflate_global(data, size, decomp, out)
bufh = bufp = malloc(sizeof(*bufp) + (size_t)(size * i),
M_CRYPTO_DATA, M_NOWAIT);
if (bufp == NULL) {
- SDT_PROBE3(opencrypto, deflate, deflate_global, bad,
- decomp, 0, __LINE__);
+ SDT_PROBE5(opencrypto, deflate, deflate_global, bad,
+ decomp, 0, __LINE__, 0, 0);
goto bad2;
}
bufp->next = NULL;
@@ -125,8 +125,8 @@ deflate_global(data, size, decomp, out)
deflateInit2(&zbuf, Z_DEFAULT_COMPRESSION, Z_METHOD,
window_deflate, Z_MEMLEVEL, Z_DEFAULT_STRATEGY);
if (error != Z_OK) {
- SDT_PROBE3(opencrypto, deflate, deflate_global, bad,
- decomp, error, __LINE__);
+ SDT_PROBE5(opencrypto, deflate, deflate_global, bad,
+ decomp, error, __LINE__, 0, 0);
goto bad;
}
@@ -165,8 +165,8 @@ deflate_global(data, size, decomp, out)
p = malloc(sizeof(*p) + (size_t)(size * i),
M_CRYPTO_DATA, M_NOWAIT);
if (p == NULL) {
- SDT_PROBE3(opencrypto, deflate, deflate_global,
- bad, decomp, 0, __LINE__);
+ SDT_PROBE5(opencrypto, deflate, deflate_global,
+ bad, decomp, 0, __LINE__, 0, 0);
goto bad;
}
p->next = NULL;
@@ -195,8 +195,8 @@ deflate_global(data, size, decomp, out)
*out = malloc(result, M_CRYPTO_DATA, M_NOWAIT);
if (*out == NULL) {
- SDT_PROBE3(opencrypto, deflate, deflate_global, bad,
- decomp, 0, __LINE__);
+ SDT_PROBE5(opencrypto, deflate, deflate_global, bad,
+ decomp, 0, __LINE__, 0, 0);
goto bad;
}
if (decomp)
diff --git a/sys/powerpc/conf/NOTES b/sys/powerpc/conf/NOTES
index 974c91b..9bfe6a9 100644
--- a/sys/powerpc/conf/NOTES
+++ b/sys/powerpc/conf/NOTES
@@ -3,6 +3,28 @@
# This file contains machine dependent kernel configuration notes. For
# machine independent notes, look in /sys/conf/NOTES.
+#
+# Enable the kernel DTrace hooks which are required to load the DTrace
+# kernel modules.
+#
+options KDTRACE_HOOKS
+
+# DTrace core
+# NOTE: introduces CDDL-licensed components into the kernel
+#device dtrace
+
+# DTrace modules
+#device dtrace_lockstat
+#device dtrace_profile
+#device dtrace_sdt
+#device dtrace_fbt
+#device dtrace_systrace
+#device dtrace_prototype
+#device dtnfscl
+#device dtmalloc
+
+# Alternatively include all the DTrace modules
+#device dtraceall
#####################################################################
diff --git a/sys/powerpc/include/vmparam.h b/sys/powerpc/include/vmparam.h
index c79a7c5..5b808ab 100644
--- a/sys/powerpc/include/vmparam.h
+++ b/sys/powerpc/include/vmparam.h
@@ -136,13 +136,12 @@ struct pmap_physseg {
#endif
/*
- * Create three free page pools: VM_FREEPOOL_DEFAULT is the default pool
+ * Create two free page pools: VM_FREEPOOL_DEFAULT is the default pool
* from which physical pages are allocated and VM_FREEPOOL_DIRECT is
* the pool from which physical pages for small UMA objects are
* allocated.
*/
-#define VM_NFREEPOOL 3
-#define VM_FREEPOOL_CACHE 2
+#define VM_NFREEPOOL 2
#define VM_FREEPOOL_DEFAULT 0
#define VM_FREEPOOL_DIRECT 1
diff --git a/sys/powerpc/powerpc/elf32_machdep.c b/sys/powerpc/powerpc/elf32_machdep.c
index ea00306..bdcd9ba 100644
--- a/sys/powerpc/powerpc/elf32_machdep.c
+++ b/sys/powerpc/powerpc/elf32_machdep.c
@@ -108,6 +108,7 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_shared_page_base = FREEBSD32_SHAREDPAGE,
.sv_shared_page_len = PAGE_SIZE,
.sv_schedtail = NULL,
+ .sv_thread_detach = NULL,
};
INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec);
diff --git a/sys/powerpc/powerpc/elf64_machdep.c b/sys/powerpc/powerpc/elf64_machdep.c
index 0b15ca3..47fbbff 100644
--- a/sys/powerpc/powerpc/elf64_machdep.c
+++ b/sys/powerpc/powerpc/elf64_machdep.c
@@ -84,6 +84,7 @@ struct sysentvec elf64_freebsd_sysvec = {
.sv_shared_page_base = SHAREDPAGE,
.sv_shared_page_len = PAGE_SIZE,
.sv_schedtail = NULL,
+ .sv_thread_detach = NULL,
};
INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec);
diff --git a/sys/powerpc/powerpc/exec_machdep.c b/sys/powerpc/powerpc/exec_machdep.c
index 67ce4bc..0019faa 100644
--- a/sys/powerpc/powerpc/exec_machdep.c
+++ b/sys/powerpc/powerpc/exec_machdep.c
@@ -226,12 +226,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
}
/*
- * Translate the signal if appropriate (Linux emu ?)
- */
- if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize)
- sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
-
- /*
* Save the floating-point state, if necessary, then copy it.
*/
/* XXX */
diff --git a/sys/powerpc/powerpc/trap.c b/sys/powerpc/powerpc/trap.c
index 0ceb170..bfbd94d 100644
--- a/sys/powerpc/powerpc/trap.c
+++ b/sys/powerpc/powerpc/trap.c
@@ -196,8 +196,8 @@ trap(struct trapframe *frame)
if (user) {
td->td_pticks = 0;
td->td_frame = frame;
- if (td->td_ucred != p->p_ucred)
- cred_update_thread(td);
+ if (td->td_cowgen != p->p_cowgen)
+ thread_cow_update(td);
/* User Mode Traps */
switch (type) {
diff --git a/sys/sparc64/include/vmparam.h b/sys/sparc64/include/vmparam.h
index c2f30c3..facec86 100644
--- a/sys/sparc64/include/vmparam.h
+++ b/sys/sparc64/include/vmparam.h
@@ -75,13 +75,12 @@
#define VM_PHYSSEG_MAX 64
/*
- * Create three free page pools: VM_FREEPOOL_DEFAULT is the default pool
+ * Create two free page pools: VM_FREEPOOL_DEFAULT is the default pool
* from which physical pages are allocated and VM_FREEPOOL_DIRECT is
* the pool from which physical pages for small UMA objects are
* allocated.
*/
-#define VM_NFREEPOOL 3
-#define VM_FREEPOOL_CACHE 2
+#define VM_NFREEPOOL 2
#define VM_FREEPOOL_DEFAULT 0
#define VM_FREEPOOL_DIRECT 1
diff --git a/sys/sparc64/sparc64/elf_machdep.c b/sys/sparc64/sparc64/elf_machdep.c
index 4d55717..9304575 100644
--- a/sys/sparc64/sparc64/elf_machdep.c
+++ b/sys/sparc64/sparc64/elf_machdep.c
@@ -87,6 +87,7 @@ static struct sysentvec elf64_freebsd_sysvec = {
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
.sv_syscallnames = syscallnames,
.sv_schedtail = NULL,
+ .sv_thread_detach = NULL,
};
static Elf64_Brandinfo freebsd_brand_info = {
diff --git a/sys/sparc64/sparc64/machdep.c b/sys/sparc64/sparc64/machdep.c
index 67f7d64..a95bc63 100644
--- a/sys/sparc64/sparc64/machdep.c
+++ b/sys/sparc64/sparc64/machdep.c
@@ -654,10 +654,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
fp = (struct frame *)sfp - 1;
- /* Translate the signal if appropriate. */
- if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize)
- sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
-
/* Build the argument list for the signal handler. */
tf->tf_out[0] = sig;
tf->tf_out[2] = (register_t)&sfp->sf_uc;
diff --git a/sys/sparc64/sparc64/trap.c b/sys/sparc64/sparc64/trap.c
index b4f0e27..e9917e5 100644
--- a/sys/sparc64/sparc64/trap.c
+++ b/sys/sparc64/sparc64/trap.c
@@ -277,8 +277,8 @@ trap(struct trapframe *tf)
td->td_pticks = 0;
td->td_frame = tf;
addr = tf->tf_tpc;
- if (td->td_ucred != p->p_ucred)
- cred_update_thread(td);
+ if (td->td_cowgen != p->p_cowgen)
+ thread_cow_update(td);
switch (tf->tf_type) {
case T_DATA_MISS:
diff --git a/sys/sys/bus.h b/sys/sys/bus.h
index 8b1f173..42d3a3f 100644
--- a/sys/sys/bus.h
+++ b/sys/sys/bus.h
@@ -612,7 +612,7 @@ void bus_data_generation_update(void);
#define BUS_PROBE_DEFAULT (-20) /* Base OS default driver */
#define BUS_PROBE_LOW_PRIORITY (-40) /* Older, less desirable drivers */
#define BUS_PROBE_GENERIC (-100) /* generic driver for dev */
-#define BUS_PROBE_HOOVER (-500) /* Generic dev for all devs on bus */
+#define BUS_PROBE_HOOVER (-1000000) /* Driver for any dev on bus */
#define BUS_PROBE_NOWILDCARD (-2000000000) /* No wildcard device matches */
/**
diff --git a/sys/sys/file.h b/sys/sys/file.h
index 1538851..cb51c27 100644
--- a/sys/sys/file.h
+++ b/sys/sys/file.h
@@ -42,6 +42,7 @@
#include <sys/refcount.h>
#include <sys/_lock.h>
#include <sys/_mutex.h>
+#include <vm/vm.h>
struct filedesc;
struct stat;
@@ -66,6 +67,7 @@ struct socket;
#define DTYPE_PTS 10 /* pseudo teletype master device */
#define DTYPE_DEV 11 /* Device specific fd type */
#define DTYPE_PROCDESC 12 /* process descriptor */
+#define DTYPE_LINUXEFD 13 /* emulation eventfd type */
#ifdef _KERNEL
@@ -114,6 +116,9 @@ typedef int fo_seek_t(struct file *fp, off_t offset, int whence,
struct thread *td);
typedef int fo_fill_kinfo_t(struct file *fp, struct kinfo_file *kif,
struct filedesc *fdp);
+typedef int fo_mmap_t(struct file *fp, vm_map_t map, vm_offset_t *addr,
+ vm_size_t size, vm_prot_t prot, vm_prot_t cap_maxprot,
+ int flags, vm_ooffset_t foff, struct thread *td);
typedef int fo_flags_t;
struct fileops {
@@ -130,6 +135,7 @@ struct fileops {
fo_sendfile_t *fo_sendfile;
fo_seek_t *fo_seek;
fo_fill_kinfo_t *fo_fill_kinfo;
+ fo_mmap_t *fo_mmap;
fo_flags_t fo_flags; /* DFLAG_* below */
};
@@ -390,6 +396,18 @@ fo_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp)
return ((*fp->f_ops->fo_fill_kinfo)(fp, kif, fdp));
}
+static __inline int
+fo_mmap(struct file *fp, vm_map_t map, vm_offset_t *addr, vm_size_t size,
+ vm_prot_t prot, vm_prot_t cap_maxprot, int flags, vm_ooffset_t foff,
+ struct thread *td)
+{
+
+ if (fp->f_ops->fo_mmap == NULL)
+ return (ENODEV);
+ return ((*fp->f_ops->fo_mmap)(fp, map, addr, size, prot, cap_maxprot,
+ flags, foff, td));
+}
+
#endif /* _KERNEL */
#endif /* !SYS_FILE_H */
diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h
index eca30ff..3fe61c8 100644
--- a/sys/sys/filedesc.h
+++ b/sys/sys/filedesc.h
@@ -83,8 +83,8 @@ struct filedesc {
int fd_lastfile; /* high-water mark of fd_ofiles */
int fd_freefile; /* approx. next free file */
u_short fd_cmask; /* mask for file creation */
- u_short fd_refcnt; /* thread reference count */
- u_short fd_holdcnt; /* hold count on structure + mutex */
+ int fd_refcnt; /* thread reference count */
+ int fd_holdcnt; /* hold count on structure + mutex */
struct sx fd_sx; /* protects members of this struct */
struct kqlist fd_kqlist; /* list of kqueues on this filedesc */
int fd_holdleaderscount; /* block fdfree() for shared close() */
diff --git a/sys/sys/ktr_class.h b/sys/sys/ktr_class.h
index bdd7c1a..6635cdc 100644
--- a/sys/sys/ktr_class.h
+++ b/sys/sys/ktr_class.h
@@ -71,7 +71,8 @@
#define KTR_INET6 0x10000000 /* IPv6 stack */
#define KTR_SCHED 0x20000000 /* Machine parsed sched info. */
#define KTR_BUF 0x40000000 /* Buffer cache */
-#define KTR_ALL 0x7fffffff
+#define KTR_PTRACE 0x80000000 /* Process debugging. */
+#define KTR_ALL 0xffffffff
/* KTR trace classes to compile in */
#ifdef KTR
diff --git a/sys/sys/lockstat.h b/sys/sys/lockstat.h
index ed9cffa..2a7853f 100644
--- a/sys/sys/lockstat.h
+++ b/sys/sys/lockstat.h
@@ -198,6 +198,9 @@ extern uint64_t lockstat_nsecs(void);
(*lockstat_probe_func)(id, (uintptr_t)(lp), 0, 0, 0, 0); \
} while (0)
+#define LOCKSTAT_WRITER 0
+#define LOCKSTAT_READER 1
+
#else /* !KDTRACE_HOOKS */
#define LOCKSTAT_RECORD(probe, lp, arg1)
diff --git a/sys/sys/mman.h b/sys/sys/mman.h
index 53b656c..19d992e 100644
--- a/sys/sys/mman.h
+++ b/sys/sys/mman.h
@@ -230,8 +230,6 @@ struct shmfd {
#endif
#ifdef _KERNEL
-int shm_mmap(struct shmfd *shmfd, vm_size_t objsize, vm_ooffset_t foff,
- vm_object_t *obj);
int shm_map(struct file *fp, size_t size, off_t offset, void **memp);
int shm_unmap(struct file *fp, void *mem, size_t size);
diff --git a/sys/sys/nlist_aout.h b/sys/sys/nlist_aout.h
index fc7a3c7..cb3dd8591 100644
--- a/sys/sys/nlist_aout.h
+++ b/sys/sys/nlist_aout.h
@@ -56,8 +56,6 @@ struct nlist {
} n_un;
#else
const char *n_name; /* symbol name (in memory) */
- int : 8 * (sizeof(long) > sizeof(char *) ?
- sizeof(long) - sizeof(char *) : sizeof(char *) - sizeof(long));
#endif
unsigned char n_type; /* type defines */
char n_other; /* ".type" and binding information */
diff --git a/sys/sys/param.h b/sys/sys/param.h
index cbc2901..a146da8 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -58,7 +58,7 @@
* in the range 5 to 9.
*/
#undef __FreeBSD_version
-#define __FreeBSD_version 1100073 /* Master, propagated to newvers */
+#define __FreeBSD_version 1100077 /* Master, propagated to newvers */
/*
* __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
diff --git a/sys/sys/pmc.h b/sys/sys/pmc.h
index f4d46b2..e0e7fcb 100644
--- a/sys/sys/pmc.h
+++ b/sys/sys/pmc.h
@@ -105,7 +105,12 @@
__PMC_CPU(PPC_MPC85XX, 0x340, "Freescale PowerPC MPC85XX") \
__PMC_CPU(PPC_970, 0x380, "IBM PowerPC 970") \
__PMC_CPU(GENERIC, 0x400, "Generic") \
- __PMC_CPU(ARMV7, 0x500, "ARMv7") \
+ __PMC_CPU(ARMV7_CORTEX_A5, 0x500, "ARMv7 Cortex A5") \
+ __PMC_CPU(ARMV7_CORTEX_A7, 0x501, "ARMv7 Cortex A7") \
+ __PMC_CPU(ARMV7_CORTEX_A8, 0x502, "ARMv7 Cortex A8") \
+ __PMC_CPU(ARMV7_CORTEX_A9, 0x503, "ARMv7 Cortex A9") \
+ __PMC_CPU(ARMV7_CORTEX_A15, 0x504, "ARMv7 Cortex A15") \
+ __PMC_CPU(ARMV7_CORTEX_A17, 0x505, "ARMv7 Cortex A17") \
__PMC_CPU(ARMV8_CORTEX_A53, 0x600, "ARMv8 Cortex A53") \
__PMC_CPU(ARMV8_CORTEX_A57, 0x601, "ARMv8 Cortex A57")
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index 6b1a2f0..e6c83b4 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -246,6 +246,7 @@ struct thread {
int td_intr_nesting_level; /* (k) Interrupt recursion. */
int td_pinned; /* (k) Temporary cpu pin count. */
struct ucred *td_ucred; /* (k) Reference to credentials. */
+ struct plimit *td_limit; /* (k) Resource limits. */
u_int td_estcpu; /* (t) estimated cpu utilization */
int td_slptick; /* (t) Time at sleep. */
int td_blktick; /* (t) Time spent blocked. */
@@ -277,6 +278,7 @@ struct thread {
u_int td_vp_reserv; /* (k) Count of reserved vnodes. */
int td_no_sleeping; /* (k) Sleeping disabled count. */
int td_dom_rr_idx; /* (k) RR Numa domain selection. */
+ void *td_su; /* (k) FFS SU private */
#define td_endzero td_sigmask
/* Copied during fork1() or create_thread(). */
@@ -307,6 +309,7 @@ struct thread {
off_t tdu_off;
} td_uretoff; /* (k) Syscall aux returns. */
#define td_retval td_uretoff.tdu_retval
+ u_int td_cowgen; /* (k) Generation of COW pointers. */
struct callout td_slpcallout; /* (h) Callout for sleep. */
struct trapframe *td_frame; /* (k) */
struct vm_object *td_kstack_obj;/* (a) Kstack object. */
@@ -325,6 +328,7 @@ struct thread {
struct proc *td_rfppwait_p; /* (k) The vforked child */
struct vm_page **td_ma; /* (k) uio pages held */
int td_ma_cnt; /* (k) size of *td_ma */
+ void *td_emuldata; /* Emulator state data */
};
struct mtx *thread_lock_block(struct thread *);
@@ -496,7 +500,7 @@ struct proc {
struct filedesc *p_fd; /* (b) Open files. */
struct filedesc_to_leader *p_fdtol; /* (b) Tracking node */
struct pstats *p_stats; /* (b) Accounting/statistics (CPU). */
- struct plimit *p_limit; /* (c) Process limits. */
+ struct plimit *p_limit; /* (c) Resource limits. */
struct callout p_limco; /* (c) Limit callout handle */
struct sigacts *p_sigacts; /* (x) Signal actions, state (CPU). */
@@ -531,6 +535,7 @@ struct proc {
pid_t p_oppid; /* (c + e) Save ppid in ptrace. XXX */
struct vmspace *p_vmspace; /* (b) Address space. */
u_int p_swtick; /* (c) Tick when swapped in or out. */
+ u_int p_cowgen; /* (c) Generation of COW pointers. */
struct itimerval p_realtimer; /* (c) Alarm timer. */
struct rusage p_ru; /* (a) Exit information. */
struct rusage_ext p_rux; /* (cu) Internal resource usage. */
@@ -676,6 +681,7 @@ struct proc {
#define P2_INHERIT_PROTECTED 0x00000001 /* New children get P_PROTECTED. */
#define P2_NOTRACE 0x00000002 /* No ptrace(2) attach or coredumps. */
#define P2_NOTRACE_EXEC 0x00000004 /* Keep P2_NOPTRACE on exec(2). */
+#define P2_AST_SU 0x00000008 /* Handles SU ast for kthreads. */
/* Flags protected by proctree_lock, kept in p_treeflags. */
#define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */
@@ -830,6 +836,11 @@ extern pid_t pid_max;
KASSERT((p)->p_lock == 0, ("process held")); \
} while (0)
+#define PROC_UPDATE_COW(p) do { \
+ PROC_LOCK_ASSERT((p), MA_OWNED); \
+ (p)->p_cowgen++; \
+} while (0)
+
/* Check whether a thread is safe to be swapped out. */
#define thread_safetoswapout(td) ((td)->td_flags & TDF_CANSWAP)
@@ -974,6 +985,10 @@ void cpu_thread_swapin(struct thread *);
void cpu_thread_swapout(struct thread *);
struct thread *thread_alloc(int pages);
int thread_alloc_stack(struct thread *, int pages);
+void thread_cow_get_proc(struct thread *newtd, struct proc *p);
+void thread_cow_get(struct thread *newtd, struct thread *td);
+void thread_cow_free(struct thread *td);
+void thread_cow_update(struct thread *td);
void thread_exit(void) __dead2;
void thread_free(struct thread *td);
void thread_link(struct thread *td, struct proc *p);
diff --git a/sys/sys/resourcevar.h b/sys/sys/resourcevar.h
index a07fdf8..b4c707d 100644
--- a/sys/sys/resourcevar.h
+++ b/sys/sys/resourcevar.h
@@ -130,13 +130,16 @@ int kern_proc_setrlimit(struct thread *td, struct proc *p, u_int which,
struct plimit
*lim_alloc(void);
void lim_copy(struct plimit *dst, struct plimit *src);
-rlim_t lim_cur(struct proc *p, int which);
+rlim_t lim_cur(struct thread *td, int which);
+rlim_t lim_cur_proc(struct proc *p, int which);
void lim_fork(struct proc *p1, struct proc *p2);
void lim_free(struct plimit *limp);
struct plimit
*lim_hold(struct plimit *limp);
-rlim_t lim_max(struct proc *p, int which);
-void lim_rlimit(struct proc *p, int which, struct rlimit *rlp);
+rlim_t lim_max(struct thread *td, int which);
+rlim_t lim_max_proc(struct proc *p, int which);
+void lim_rlimit(struct thread *td, int which, struct rlimit *rlp);
+void lim_rlimit_proc(struct proc *p, int which, struct rlimit *rlp);
void ruadd(struct rusage *ru, struct rusage_ext *rux, struct rusage *ru2,
struct rusage_ext *rux2);
void rucollect(struct rusage *ru, struct rusage *ru2);
@@ -156,5 +159,7 @@ void ui_racct_foreach(void (*callback)(struct racct *racct,
void *arg2, void *arg3), void *arg2, void *arg3);
#endif
+void lim_update_thread(struct thread *td);
+
#endif /* _KERNEL */
#endif /* !_SYS_RESOURCEVAR_H_ */
diff --git a/sys/sys/sbuf.h b/sys/sys/sbuf.h
index 40de36e..580cbd2 100644
--- a/sys/sys/sbuf.h
+++ b/sys/sys/sbuf.h
@@ -58,6 +58,14 @@ struct sbuf {
ssize_t s_sect_len; /* current length of section */
};
+#ifndef HD_COLUMN_MASK
+#define HD_COLUMN_MASK 0xff
+#define HD_DELIM_MASK 0xff00
+#define HD_OMIT_COUNT (1 << 16)
+#define HD_OMIT_HEX (1 << 17)
+#define HD_OMIT_CHARS (1 << 18)
+#endif /* HD_COLUMN_MASK */
+
__BEGIN_DECLS
/*
* API functions
@@ -89,6 +97,8 @@ int sbuf_done(const struct sbuf *);
void sbuf_delete(struct sbuf *);
void sbuf_start_section(struct sbuf *, ssize_t *);
ssize_t sbuf_end_section(struct sbuf *, ssize_t, size_t, int);
+void sbuf_hexdump(struct sbuf *, const void *, int, const char *,
+ int);
#ifdef _KERNEL
struct uio;
diff --git a/sys/sys/sockio.h b/sys/sys/sockio.h
index 8624ad2..73ebf5f 100644
--- a/sys/sys/sockio.h
+++ b/sys/sys/sockio.h
@@ -96,7 +96,7 @@
#define SIOCGIFSTATUS _IOWR('i', 59, struct ifstat) /* get IF status */
#define SIOCSIFLLADDR _IOW('i', 60, struct ifreq) /* set linklevel addr */
-#define SIOCGI2C _IOWR('i', 61, struct ifstat) /* get I2C data */
+#define SIOCGI2C _IOWR('i', 61, struct ifreq) /* get I2C data */
#define SIOCSIFPHYADDR _IOW('i', 70, struct ifaliasreq) /* set gif addres */
#define SIOCGIFPSRCADDR _IOWR('i', 71, struct ifreq) /* get gif psrc addr */
diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h
index 8d8c173..4ff111e 100644
--- a/sys/sys/syscallsubr.h
+++ b/sys/sys/syscallsubr.h
@@ -55,6 +55,7 @@ struct sendfile_args;
struct sockaddr;
struct stat;
struct thr_param;
+struct sched_param;
struct __wrusage;
int kern___getcwd(struct thread *td, char *buf, enum uio_seg bufseg,
@@ -120,6 +121,10 @@ int kern_jail_get(struct thread *td, struct uio *options, int flags);
int kern_jail_set(struct thread *td, struct uio *options, int flags);
int kern_kevent(struct thread *td, int fd, int nchanges, int nevents,
struct kevent_copyops *k_ops, const struct timespec *timeout);
+int kern_kevent_fp(struct thread *td, struct file *fp, int nchanges,
+ int nevents, struct kevent_copyops *k_ops,
+ const struct timespec *timeout);
+int kern_kqueue(struct thread *td, int flags);
int kern_kldload(struct thread *td, const char *file, int *fileid);
int kern_kldstat(struct thread *td, int fileid, struct kld_file_stat *stat);
int kern_kldunload(struct thread *td, int fileid, int flags);
@@ -169,8 +174,18 @@ int kern_renameat(struct thread *td, int oldfd, char *old, int newfd,
char *new, enum uio_seg pathseg);
int kern_rmdirat(struct thread *td, int fd, char *path,
enum uio_seg pathseg);
+int kern_sched_getparam(struct thread *td, struct thread *targettd,
+ struct sched_param *param);
+int kern_sched_getscheduler(struct thread *td, struct thread *targettd,
+ int *policy);
+int kern_sched_setparam(struct thread *td, struct thread *targettd,
+ struct sched_param *param);
+int kern_sched_setscheduler(struct thread *td, struct thread *targettd,
+ int policy, struct sched_param *param);
int kern_sched_rr_get_interval(struct thread *td, pid_t pid,
struct timespec *ts);
+int kern_sched_rr_get_interval_td(struct thread *td, struct thread *targettd,
+ struct timespec *ts);
int kern_semctl(struct thread *td, int semid, int semnum, int cmd,
union semun *arg, register_t *rval);
int kern_select(struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou,
@@ -214,6 +229,8 @@ int kern_ktimer_settime(struct thread *td, int timer_id, int flags,
int kern_ktimer_gettime(struct thread *td, int timer_id,
struct itimerspec *val);
int kern_ktimer_getoverrun(struct thread *td, int timer_id);
+int kern_thr_alloc(struct proc *, int pages, struct thread **);
+int kern_thr_exit(struct thread *td);
int kern_thr_new(struct thread *td, struct thr_param *param);
int kern_thr_suspend(struct thread *td, struct timespec *tsp);
int kern_truncate(struct thread *td, char *path, enum uio_seg pathseg,
diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h
index bef27ce..b1f61a9 100644
--- a/sys/sys/sysent.h
+++ b/sys/sys/sysent.h
@@ -136,6 +136,7 @@ struct sysentvec {
uint32_t sv_timekeep_gen;
void *sv_shared_page_obj;
void (*sv_schedtail)(struct thread *);
+ void (*sv_thread_detach)(struct thread *);
};
#define SV_ILP32 0x000100
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index acea565..cb05a00 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -431,4 +431,6 @@ void free_unr(struct unrhdr *uh, u_int item);
void intr_prof_stack_use(struct thread *td, struct trapframe *frame);
+extern void (*softdep_ast_cleanup)(void);
+
#endif /* !_SYS_SYSTM_H_ */
diff --git a/sys/sys/user.h b/sys/sys/user.h
index c3b3bc5..e831a37 100644
--- a/sys/sys/user.h
+++ b/sys/sys/user.h
@@ -486,6 +486,27 @@ struct kinfo_vmentry {
};
/*
+ * The "vm.objects" sysctl provides a list of all VM objects in the system
+ * via an array of these entries.
+ */
+struct kinfo_vmobject {
+ int kvo_structsize; /* Variable size of record. */
+ int kvo_type; /* Object type: KVME_TYPE_*. */
+ uint64_t kvo_size; /* Object size in pages. */
+ uint64_t kvo_vn_fileid; /* inode number if vnode. */
+ uint32_t kvo_vn_fsid; /* dev_t of vnode location. */
+ int kvo_ref_count; /* Reference count. */
+ int kvo_shadow_count; /* Shadow count. */
+ int kvo_memattr; /* Memory attribute. */
+ uint64_t kvo_resident; /* Number of resident pages. */
+ uint64_t kvo_active; /* Number of active pages. */
+ uint64_t kvo_inactive; /* Number of inactive pages. */
+ uint64_t _kvo_qspare[8];
+ uint32_t _kvo_ispare[8];
+ char kvo_path[PATH_MAX]; /* Pathname, if any. */
+};
+
+/*
* The KERN_PROC_KSTACK sysctl allows a process to dump the kernel stacks of
* another process as a series of entries. Each stack is represented by a
* series of symbol names and offsets as generated by stack_sbuf_print(9).
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index d70aa57..36ef8af 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -397,6 +397,7 @@ extern int vttoif_tab[];
#define V_WAIT 0x0001 /* vn_start_write: sleep for suspend */
#define V_NOWAIT 0x0002 /* vn_start_write: don't sleep for suspend */
#define V_XSLEEP 0x0004 /* vn_start_write: just return after sleep */
+#define V_MNTREF 0x0010 /* vn_start_write: mp is already ref-ed */
#define VR_START_WRITE 0x0001 /* vfs_write_resume: start write atomically */
#define VR_NO_SUSPCLR 0x0002 /* vfs_write_resume: do not clear suspension */
@@ -691,7 +692,7 @@ int vn_rdwr_inchunks(enum uio_rw rw, struct vnode *vp, void *base,
struct ucred *active_cred, struct ucred *file_cred, size_t *aresid,
struct thread *td);
int vn_rlimit_fsize(const struct vnode *vn, const struct uio *uio,
- const struct thread *td);
+ struct thread *td);
int vn_stat(struct vnode *vp, struct stat *sb, struct ucred *active_cred,
struct ucred *file_cred, struct thread *td);
int vn_start_write(struct vnode *vp, struct mount **mpp, int flags);
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index ab2bd41..4fee265 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -900,6 +900,8 @@ static int pagedep_find(struct pagedep_hashhead *, ino_t, ufs_lbn_t,
struct pagedep **);
static void pause_timer(void *);
static int request_cleanup(struct mount *, int);
+static void schedule_cleanup(struct mount *);
+static void softdep_ast_cleanup_proc(void);
static int process_worklist_item(struct mount *, int, int);
static void process_removes(struct vnode *);
static void process_truncates(struct vnode *);
@@ -921,6 +923,8 @@ static int journal_unsuspend(struct ufsmount *ump);
static void softdep_prelink(struct vnode *, struct vnode *);
static void add_to_journal(struct worklist *);
static void remove_from_journal(struct worklist *);
+static bool softdep_excess_inodes(struct ufsmount *);
+static bool softdep_excess_dirrem(struct ufsmount *);
static void softdep_process_journal(struct mount *, struct worklist *, int);
static struct jremref *newjremref(struct dirrem *, struct inode *,
struct inode *ip, off_t, nlink_t);
@@ -2059,7 +2063,6 @@ retry_flush:
* allocates a new structure if an existing one is not found.
*/
#define DEPALLOC 0x0001 /* allocate structure if lookup fails */
-#define NODELAY 0x0002 /* cannot do background work */
/*
* Structures and routines associated with pagedep caching.
@@ -2209,12 +2212,10 @@ inodedep_lookup(mp, inum, flags, inodedeppp)
* responsible for more than our share of that usage and
* we are not in a rush, request some inodedep cleanup.
*/
- while (dep_current[D_INODEDEP] > max_softdeps &&
- (flags & NODELAY) == 0 &&
- ump->softdep_curdeps[D_INODEDEP] >
- max_softdeps / stat_flush_threads)
- request_cleanup(mp, FLUSH_INODES);
- FREE_LOCK(ump);
+ if (softdep_excess_inodes(ump))
+ schedule_cleanup(mp);
+ else
+ FREE_LOCK(ump);
inodedep = malloc(sizeof(struct inodedep),
M_INODEDEP, M_SOFTDEP_FLAGS);
workitem_alloc(&inodedep->id_list, D_INODEDEP, mp);
@@ -2412,6 +2413,7 @@ softdep_initialize()
bioops.io_complete = softdep_disk_write_complete;
bioops.io_deallocate = softdep_deallocate_dependencies;
bioops.io_countdeps = softdep_count_dependencies;
+ softdep_ast_cleanup = softdep_ast_cleanup_proc;
/* Initialize the callout with an mtx. */
callout_init_mtx(&softdep_callout, &lk, 0);
@@ -2430,6 +2432,7 @@ softdep_uninitialize()
bioops.io_complete = NULL;
bioops.io_deallocate = NULL;
bioops.io_countdeps = NULL;
+ softdep_ast_cleanup = NULL;
callout_drain(&softdep_callout);
}
@@ -4631,14 +4634,10 @@ inodedep_lookup_ip(ip)
struct inode *ip;
{
struct inodedep *inodedep;
- int dflags;
KASSERT(ip->i_nlink >= ip->i_effnlink,
("inodedep_lookup_ip: bad delta"));
- dflags = DEPALLOC;
- if (IS_SNAPSHOT(ip))
- dflags |= NODELAY;
- (void) inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, dflags,
+ (void) inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, DEPALLOC,
&inodedep);
inodedep->id_nlinkdelta = ip->i_nlink - ip->i_effnlink;
KASSERT((inodedep->id_state & UNLINKED) == 0, ("inode unlinked"));
@@ -4692,12 +4691,10 @@ softdep_setup_dotdot_link(dp, ip)
struct inodedep *inodedep;
struct jaddref *jaddref;
struct vnode *dvp;
- struct vnode *vp;
KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0,
("softdep_setup_dotdot_link called on non-softdep filesystem"));
dvp = ITOV(dp);
- vp = ITOV(ip);
jaddref = NULL;
/*
* We don't set MKDIR_PARENT as this is not tied to a mkdir and
@@ -5038,7 +5035,7 @@ softdep_setup_inomapdep(bp, ip, newinum, mode)
M_BMSAFEMAP, M_SOFTDEP_FLAGS);
workitem_alloc(&bmsafemap->sm_list, D_BMSAFEMAP, mp);
ACQUIRE_LOCK(ip->i_ump);
- if ((inodedep_lookup(mp, newinum, DEPALLOC | NODELAY, &inodedep)))
+ if ((inodedep_lookup(mp, newinum, DEPALLOC, &inodedep)))
panic("softdep_setup_inomapdep: dependency %p for new"
"inode already exists", inodedep);
bmsafemap = bmsafemap_lookup(mp, bp, ino_to_cg(fs, newinum), bmsafemap);
@@ -5335,7 +5332,7 @@ softdep_setup_allocdirect(ip, off, newblkno, oldblkno, newsize, oldsize, bp)
if (freefrag && freefrag->ff_jdep != NULL &&
freefrag->ff_jdep->wk_type == D_JFREEFRAG)
add_to_journal(freefrag->ff_jdep);
- inodedep_lookup(mp, ip->i_number, DEPALLOC | NODELAY, &inodedep);
+ inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep);
adp->ad_inodedep = inodedep;
WORKLIST_INSERT(&bp->b_dep, &newblk->nb_list);
@@ -5693,7 +5690,7 @@ softdep_setup_allocext(ip, off, newblkno, oldblkno, newsize, oldsize, bp)
if (freefrag && freefrag->ff_jdep != NULL &&
freefrag->ff_jdep->wk_type == D_JFREEFRAG)
add_to_journal(freefrag->ff_jdep);
- inodedep_lookup(mp, ip->i_number, DEPALLOC | NODELAY, &inodedep);
+ inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep);
adp->ad_inodedep = inodedep;
WORKLIST_INSERT(&bp->b_dep, &newblk->nb_list);
@@ -5818,7 +5815,6 @@ softdep_setup_allocindir_page(ip, lbn, bp, ptrno, newblkno, oldblkno, nbp)
struct allocindir *aip;
struct pagedep *pagedep;
struct mount *mp;
- int dflags;
mp = UFSTOVFS(ip->i_ump);
KASSERT(MOUNTEDSOFTDEP(mp) != 0,
@@ -5831,10 +5827,7 @@ softdep_setup_allocindir_page(ip, lbn, bp, ptrno, newblkno, oldblkno, nbp)
"lbn %jd", ip->i_number, newblkno, oldblkno, lbn);
ASSERT_VOP_LOCKED(ITOV(ip), "softdep_setup_allocindir_page");
aip = newallocindir(ip, ptrno, newblkno, oldblkno, lbn);
- dflags = DEPALLOC;
- if (IS_SNAPSHOT(ip))
- dflags |= NODELAY;
- (void) inodedep_lookup(mp, ip->i_number, dflags, &inodedep);
+ (void) inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep);
/*
* If we are allocating a directory page, then we must
* allocate an associated pagedep to track additions and
@@ -5864,7 +5857,6 @@ softdep_setup_allocindir_meta(nbp, ip, bp, ptrno, newblkno)
struct inodedep *inodedep;
struct allocindir *aip;
ufs_lbn_t lbn;
- int dflags;
KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0,
("softdep_setup_allocindir_meta called on non-softdep filesystem"));
@@ -5874,10 +5866,8 @@ softdep_setup_allocindir_meta(nbp, ip, bp, ptrno, newblkno)
lbn = nbp->b_lblkno;
ASSERT_VOP_LOCKED(ITOV(ip), "softdep_setup_allocindir_meta");
aip = newallocindir(ip, ptrno, newblkno, 0, lbn);
- dflags = DEPALLOC;
- if (IS_SNAPSHOT(ip))
- dflags |= NODELAY;
- inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, dflags, &inodedep);
+ inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, DEPALLOC,
+ &inodedep);
WORKLIST_INSERT(&nbp->b_dep, &aip->ai_block.nb_list);
if (setup_allocindir_phase2(bp, ip, inodedep, aip, lbn))
panic("softdep_setup_allocindir_meta: Block already existed");
@@ -6490,7 +6480,7 @@ softdep_journal_freeblocks(ip, cred, length, flags)
struct mount *mp;
ufs2_daddr_t extblocks, datablocks;
ufs_lbn_t tmpval, lbn, lastlbn;
- int frags, lastoff, iboff, allocblock, needj, dflags, error, i;
+ int frags, lastoff, iboff, allocblock, needj, error, i;
fs = ip->i_fs;
ump = ip->i_ump;
@@ -6511,10 +6501,7 @@ softdep_journal_freeblocks(ip, cred, length, flags)
* we don't need to journal the block frees. The canceled journals
* for the allocations will suffice.
*/
- dflags = DEPALLOC;
- if (IS_SNAPSHOT(ip))
- dflags |= NODELAY;
- inodedep_lookup(mp, ip->i_number, dflags, &inodedep);
+ inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep);
if ((inodedep->id_state & (UNLINKED | DEPCOMPLETE)) == UNLINKED &&
length == 0)
needj = 0;
@@ -6644,7 +6631,7 @@ softdep_journal_freeblocks(ip, cred, length, flags)
*((struct ufs2_dinode *)bp->b_data +
ino_to_fsbo(fs, ip->i_number)) = *ip->i_din2;
ACQUIRE_LOCK(ump);
- (void) inodedep_lookup(mp, ip->i_number, dflags, &inodedep);
+ (void) inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep);
if ((inodedep->id_state & IOSTARTED) != 0)
panic("softdep_setup_freeblocks: inode busy");
/*
@@ -6737,7 +6724,7 @@ softdep_journal_freeblocks(ip, cred, length, flags)
}
ACQUIRE_LOCK(ump);
- inodedep_lookup(mp, ip->i_number, dflags, &inodedep);
+ inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep);
TAILQ_INSERT_TAIL(&inodedep->id_freeblklst, freeblks, fb_next);
freeblks->fb_state |= DEPCOMPLETE | ONDEPLIST;
/*
@@ -6828,7 +6815,7 @@ softdep_setup_freeblocks(ip, length, flags)
struct fs *fs;
ufs2_daddr_t extblocks, datablocks;
struct mount *mp;
- int i, delay, error, dflags;
+ int i, delay, error;
ufs_lbn_t tmpval;
ufs_lbn_t lbn;
@@ -6897,10 +6884,7 @@ softdep_setup_freeblocks(ip, length, flags)
* Find and eliminate any inode dependencies.
*/
ACQUIRE_LOCK(ump);
- dflags = DEPALLOC;
- if (IS_SNAPSHOT(ip))
- dflags |= NODELAY;
- (void) inodedep_lookup(mp, ip->i_number, dflags, &inodedep);
+ (void) inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep);
if ((inodedep->id_state & IOSTARTED) != 0)
panic("softdep_setup_freeblocks: inode busy");
/*
@@ -7066,7 +7050,6 @@ trunc_dependencies(ip, freeblks, lastlbn, lastoff, flags)
struct bufobj *bo;
struct vnode *vp;
struct buf *bp;
- struct fs *fs;
int blkoff;
/*
@@ -7075,7 +7058,6 @@ trunc_dependencies(ip, freeblks, lastlbn, lastoff, flags)
* Once they are all there, walk the list and get rid of
* any dependencies.
*/
- fs = ip->i_fs;
vp = ITOV(ip);
bo = &vp->v_bufobj;
BO_LOCK(bo);
@@ -7226,7 +7208,6 @@ deallocate_dependencies(bp, freeblks, off)
{
struct indirdep *indirdep;
struct pagedep *pagedep;
- struct allocdirect *adp;
struct worklist *wk, *wkn;
struct ufsmount *ump;
@@ -7273,7 +7254,6 @@ deallocate_dependencies(bp, freeblks, off)
break;
case D_ALLOCDIRECT:
- adp = WK_ALLOCDIRECT(wk);
if (off != 0)
continue;
/* FALLTHROUGH */
@@ -8506,7 +8486,7 @@ softdep_setup_directory_add(bp, dp, diroffset, newinum, newdirbp, isnewblk)
dap->da_pagedep = pagedep;
LIST_INSERT_HEAD(&pagedep->pd_diraddhd[DIRADDHASH(offset)], dap,
da_pdlist);
- inodedep_lookup(mp, newinum, DEPALLOC | NODELAY, &inodedep);
+ inodedep_lookup(mp, newinum, DEPALLOC, &inodedep);
/*
* If we're journaling, link the diradd into the jaddref so it
* may be completed after the journal entry is written. Otherwise,
@@ -9126,13 +9106,12 @@ newdirrem(bp, dp, ip, isrmdir, prevdirremp)
* the number of freefile and freeblks structures.
*/
ACQUIRE_LOCK(ip->i_ump);
- while (!IS_SNAPSHOT(ip) && dep_current[D_DIRREM] > max_softdeps / 2 &&
- ip->i_ump->softdep_curdeps[D_DIRREM] >
- (max_softdeps / 2) / stat_flush_threads)
- (void) request_cleanup(ITOV(dp)->v_mount, FLUSH_BLOCKS);
- FREE_LOCK(ip->i_ump);
- dirrem = malloc(sizeof(struct dirrem),
- M_DIRREM, M_SOFTDEP_FLAGS|M_ZERO);
+ if (!IS_SNAPSHOT(ip) && softdep_excess_dirrem(ip->i_ump))
+ schedule_cleanup(ITOV(dp)->v_mount);
+ else
+ FREE_LOCK(ip->i_ump);
+ dirrem = malloc(sizeof(struct dirrem), M_DIRREM, M_SOFTDEP_FLAGS |
+ M_ZERO);
workitem_alloc(&dirrem->dm_list, D_DIRREM, dvp->v_mount);
LIST_INIT(&dirrem->dm_jremrefhd);
LIST_INIT(&dirrem->dm_jwork);
@@ -9368,7 +9347,7 @@ softdep_setup_directory_change(bp, dp, ip, newinum, isrmdir)
* inode is not yet written. If it is written, do the post-inode
* write processing to put it on the id_pendinghd list.
*/
- inodedep_lookup(mp, newinum, DEPALLOC | NODELAY, &inodedep);
+ inodedep_lookup(mp, newinum, DEPALLOC, &inodedep);
if (MOUNTEDSUJ(mp)) {
jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst,
inoreflst);
@@ -9410,15 +9389,12 @@ softdep_change_linkcnt(ip)
struct inode *ip; /* the inode with the increased link count */
{
struct inodedep *inodedep;
- int dflags;
KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0,
("softdep_change_linkcnt called on non-softdep filesystem"));
ACQUIRE_LOCK(ip->i_ump);
- dflags = DEPALLOC;
- if (IS_SNAPSHOT(ip))
- dflags |= NODELAY;
- inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, dflags, &inodedep);
+ inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, DEPALLOC,
+ &inodedep);
if (ip->i_nlink < ip->i_effnlink)
panic("softdep_change_linkcnt: bad delta");
inodedep->id_nlinkdelta = ip->i_nlink - ip->i_effnlink;
@@ -9511,12 +9487,10 @@ handle_written_sbdep(sbdep, bp)
struct buf *bp;
{
struct inodedep *inodedep;
- struct mount *mp;
struct fs *fs;
LOCK_OWNED(sbdep->sb_ump);
fs = sbdep->sb_fs;
- mp = UFSTOVFS(sbdep->sb_ump);
/*
* If the superblock doesn't match the in-memory list start over.
*/
@@ -13269,6 +13243,92 @@ retry:
return (1);
}
+static bool
+softdep_excess_inodes(struct ufsmount *ump)
+{
+
+ return (dep_current[D_INODEDEP] > max_softdeps &&
+ ump->softdep_curdeps[D_INODEDEP] > max_softdeps /
+ stat_flush_threads);
+}
+
+static bool
+softdep_excess_dirrem(struct ufsmount *ump)
+{
+
+ return (dep_current[D_DIRREM] > max_softdeps / 2 &&
+ ump->softdep_curdeps[D_DIRREM] > (max_softdeps / 2) /
+ stat_flush_threads);
+}
+
+static void
+schedule_cleanup(struct mount *mp)
+{
+ struct ufsmount *ump;
+ struct thread *td;
+
+ ump = VFSTOUFS(mp);
+ LOCK_OWNED(ump);
+ FREE_LOCK(ump);
+ td = curthread;
+ if ((td->td_pflags & TDP_KTHREAD) != 0 &&
+ (td->td_proc->p_flag2 & P2_AST_SU) == 0) {
+ /*
+ * No ast is delivered to kernel threads, so nobody
+ * would deref the mp. Some kernel threads
+ * explicitely check for AST, e.g. NFS daemon does
+ * this in the serving loop.
+ */
+ return;
+ }
+ if (td->td_su != NULL)
+ vfs_rel(td->td_su);
+ vfs_ref(mp);
+ td->td_su = mp;
+ thread_lock(td);
+ td->td_flags |= TDF_ASTPENDING;
+ thread_unlock(td);
+}
+
+static void
+softdep_ast_cleanup_proc(void)
+{
+ struct thread *td;
+ struct mount *mp;
+ struct ufsmount *ump;
+ int error;
+ bool req;
+
+ td = curthread;
+ mp = td->td_su;
+ if (mp == NULL)
+ return;
+ td->td_su = NULL;
+ error = vfs_busy(mp, MBF_NOWAIT);
+ vfs_rel(mp);
+ if (error != 0)
+ return;
+ if (ffs_own_mount(mp) && MOUNTEDSOFTDEP(mp)) {
+ ump = VFSTOUFS(mp);
+ for (;;) {
+ req = false;
+ ACQUIRE_LOCK(ump);
+ if (softdep_excess_inodes(ump)) {
+ req = true;
+ request_cleanup(mp, FLUSH_INODES);
+ }
+ if (softdep_excess_dirrem(ump)) {
+ req = true;
+ request_cleanup(mp, FLUSH_BLOCKS);
+ }
+ FREE_LOCK(ump);
+ if ((td->td_pflags & TDP_KTHREAD) != 0 || !req)
+ break;
+ }
+ }
+ vfs_unbusy(mp);
+}
+
/*
* If memory utilization has gotten too high, deliberately slow things
* down and speed up the I/O processing.
@@ -13355,7 +13415,8 @@ request_cleanup(mp, resource)
callout_reset(&softdep_callout, tickdelay > 2 ? tickdelay : 2,
pause_timer, 0);
- msleep((caddr_t)&proc_waiting, &lk, PPAUSE, "softupdate", 0);
+ if ((td->td_pflags & TDP_KTHREAD) == 0)
+ msleep((caddr_t)&proc_waiting, &lk, PPAUSE, "softupdate", 0);
proc_waiting -= 1;
FREE_GBLLOCK(&lk);
ACQUIRE_LOCK(ump);
diff --git a/sys/ufs/ffs/ffs_suspend.c b/sys/ufs/ffs/ffs_suspend.c
index b50fadc..450282c 100644
--- a/sys/ufs/ffs/ffs_suspend.c
+++ b/sys/ufs/ffs/ffs_suspend.c
@@ -177,7 +177,6 @@ out:
static int
ffs_susp_suspend(struct mount *mp)
{
- struct fs *fs;
struct ufsmount *ump;
int error;
@@ -189,7 +188,6 @@ ffs_susp_suspend(struct mount *mp)
return (EBUSY);
ump = VFSTOUFS(mp);
- fs = ump->um_fs;
/*
* Make sure the calling thread is permitted to access the mounted
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 2a368bd..ce43bcd 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1486,7 +1486,7 @@ ffs_sync(mp, waitfor)
struct inode *ip;
struct ufsmount *ump = VFSTOUFS(mp);
struct fs *fs;
- int error, count, wait, lockreq, allerror = 0;
+ int error, count, lockreq, allerror = 0;
int suspend;
int suspended;
int secondary_writes;
@@ -1495,7 +1495,6 @@ ffs_sync(mp, waitfor)
int softdep_accdeps;
struct bufobj *bo;
- wait = 0;
suspend = 0;
suspended = 0;
td = curthread;
@@ -1517,10 +1516,8 @@ ffs_sync(mp, waitfor)
suspend = 1;
waitfor = MNT_WAIT;
}
- if (waitfor == MNT_WAIT) {
- wait = 1;
+ if (waitfor == MNT_WAIT)
lockreq = LK_EXCLUSIVE;
- }
lockreq |= LK_INTERLOCK | LK_SLEEPFAIL;
loop:
/* Grab snapshot of secondary write counts */
@@ -2024,7 +2021,6 @@ static int
ffs_bufwrite(struct buf *bp)
{
struct buf *newbp;
- int oldflags;
CTR3(KTR_BUF, "bufwrite(%p) vp %p flags %X", bp, bp->b_vp, bp->b_flags);
if (bp->b_flags & B_INVAL) {
@@ -2032,8 +2028,6 @@ ffs_bufwrite(struct buf *bp)
return (0);
}
- oldflags = bp->b_flags;
-
if (!BUF_ISLOCKED(bp))
panic("bufwrite: buffer is not busy???");
/*
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index 6b34a40..618ed8e 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -201,8 +201,8 @@ retry:
* bo_dirty list. Recheck and resync as needed.
*/
BO_LOCK(bo);
- if (vp->v_type == VREG && (bo->bo_numoutput > 0 ||
- bo->bo_dirty.bv_cnt > 0)) {
+ if ((vp->v_type == VREG || vp->v_type == VDIR) &&
+ (bo->bo_numoutput > 0 || bo->bo_dirty.bv_cnt > 0)) {
BO_UNLOCK(bo);
goto retry;
}
@@ -1366,11 +1366,6 @@ struct vop_openextattr_args {
};
*/
{
- struct inode *ip;
- struct fs *fs;
-
- ip = VTOI(ap->a_vp);
- fs = ip->i_fs;
if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK)
return (EOPNOTSUPP);
@@ -1394,11 +1389,6 @@ struct vop_closeextattr_args {
};
*/
{
- struct inode *ip;
- struct fs *fs;
-
- ip = VTOI(ap->a_vp);
- fs = ip->i_fs;
if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK)
return (EOPNOTSUPP);
@@ -1512,13 +1502,11 @@ vop_getextattr {
*/
{
struct inode *ip;
- struct fs *fs;
u_char *eae, *p;
unsigned easize;
int error, ealen;
ip = VTOI(ap->a_vp);
- fs = ip->i_fs;
if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK)
return (EOPNOTSUPP);
@@ -1567,14 +1555,12 @@ vop_listextattr {
*/
{
struct inode *ip;
- struct fs *fs;
u_char *eae, *p, *pe, *pn;
unsigned easize;
uint32_t ul;
int error, ealen;
ip = VTOI(ap->a_vp);
- fs = ip->i_fs;
if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK)
return (EOPNOTSUPP);
diff --git a/sys/ufs/ufs/ufs_bmap.c b/sys/ufs/ufs/ufs_bmap.c
index 22887c8..9819ef5 100644
--- a/sys/ufs/ufs/ufs_bmap.c
+++ b/sys/ufs/ufs/ufs_bmap.c
@@ -114,7 +114,6 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb)
struct buf *bp;
struct ufsmount *ump;
struct mount *mp;
- struct vnode *devvp;
struct indir a[NIADDR+1], *ap;
ufs2_daddr_t daddr;
ufs_lbn_t metalbn;
@@ -125,7 +124,6 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb)
ip = VTOI(vp);
mp = vp->v_mount;
ump = VFSTOUFS(mp);
- devvp = ump->um_devvp;
if (runp) {
maxrun = mp->mnt_iosize_max / mp->mnt_stat.f_iosize - 1;
diff --git a/sys/ufs/ufs/ufs_dirhash.c b/sys/ufs/ufs/ufs_dirhash.c
index 39f29d0..766fe54 100644
--- a/sys/ufs/ufs/ufs_dirhash.c
+++ b/sys/ufs/ufs/ufs_dirhash.c
@@ -190,9 +190,7 @@ ufsdirhash_create(struct inode *ip)
struct dirhash *ndh;
struct dirhash *dh;
struct vnode *vp;
- int error;
- error = 0;
ndh = dh = NULL;
vp = ip->i_vnode;
for (;;) {
@@ -274,11 +272,9 @@ static struct dirhash *
ufsdirhash_acquire(struct inode *ip)
{
struct dirhash *dh;
- struct vnode *vp;
ASSERT_VOP_ELOCKED(ip->i_vnode, __FUNCTION__);
- vp = ip->i_vnode;
dh = ip->i_dirhash;
if (dh == NULL)
return (NULL);
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 3005491..5ade2bc 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -224,16 +224,14 @@ swap_reserve_by_cred(vm_ooffset_t incr, struct ucred *cred)
mtx_unlock(&sw_dev_mtx);
if (res) {
- PROC_LOCK(curproc);
UIDINFO_VMSIZE_LOCK(uip);
if ((overcommit & SWAP_RESERVE_RLIMIT_ON) != 0 &&
- uip->ui_vmsize + incr > lim_cur(curproc, RLIMIT_SWAP) &&
+ uip->ui_vmsize + incr > lim_cur(curthread, RLIMIT_SWAP) &&
priv_check(curthread, PRIV_VM_SWAP_NORLIMIT))
res = 0;
else
uip->ui_vmsize += incr;
UIDINFO_VMSIZE_UNLOCK(uip);
- PROC_UNLOCK(curproc);
if (!res) {
mtx_lock(&sw_dev_mtx);
swap_reserved -= incr;
diff --git a/sys/vm/vm_extern.h b/sys/vm/vm_extern.h
index f639a22..922c328 100644
--- a/sys/vm/vm_extern.h
+++ b/sys/vm/vm_extern.h
@@ -40,6 +40,8 @@ struct vnode;
struct vmem;
#ifdef _KERNEL
+struct cdev;
+struct cdevsw;
/* These operate on kernel virtual addresses only. */
vm_offset_t kva_alloc(vm_size_t);
@@ -81,10 +83,18 @@ int vm_fault_hold(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type,
int fault_flags, vm_page_t *m_hold);
int vm_fault_quick_hold_pages(vm_map_t map, vm_offset_t addr, vm_size_t len,
vm_prot_t prot, vm_page_t *ma, int max_count);
-int vm_forkproc(struct thread *, struct proc *, struct thread *, struct vmspace *, int);
+int vm_forkproc(struct thread *, struct proc *, struct thread *,
+ struct vmspace *, int);
void vm_waitproc(struct proc *);
-int vm_mmap(vm_map_t, vm_offset_t *, vm_size_t, vm_prot_t, vm_prot_t, int, objtype_t, void *, vm_ooffset_t);
+int vm_mmap(vm_map_t, vm_offset_t *, vm_size_t, vm_prot_t, vm_prot_t, int,
+ objtype_t, void *, vm_ooffset_t);
+int vm_mmap_object(vm_map_t, vm_offset_t *, vm_size_t, vm_prot_t,
+ vm_prot_t, int, vm_object_t, vm_ooffset_t, boolean_t, struct thread *);
int vm_mmap_to_errno(int rv);
+int vm_mmap_cdev(struct thread *, vm_size_t, vm_prot_t, vm_prot_t *,
+ int *, struct cdev *, struct cdevsw *, vm_ooffset_t *, vm_object_t *);
+int vm_mmap_vnode(struct thread *, vm_size_t, vm_prot_t, vm_prot_t *, int *,
+ struct vnode *, vm_ooffset_t *, vm_object_t *, boolean_t *);
void vm_set_page_size(void);
void vm_sync_icache(vm_map_t, vm_offset_t, vm_size_t);
typedef int (*pmap_pinit_t)(struct pmap *pmap);
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
index 0c84d44..7391465 100644
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -679,19 +679,12 @@ vnode_locked:
/*
* Found the page. Leave it busy while we play
* with it.
- */
-
- /*
- * Relookup in case pager changed page. Pager
+ *
+ * Pager could have changed the page. Pager
* is responsible for disposition of old page
* if moved.
*/
- fs.m = vm_page_lookup(fs.object, fs.pindex);
- if (!fs.m) {
- unlock_and_deallocate(&fs);
- goto RetryFault;
- }
-
+ fs.m = marray[reqpage];
hardfault++;
break; /* break to PAGE HAS BEEN FOUND */
}
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c
index c9ee890..1ff17c2 100644
--- a/sys/vm/vm_glue.c
+++ b/sys/vm/vm_glue.c
@@ -230,7 +230,7 @@ vsunlock(void *addr, size_t len)
static vm_page_t
vm_imgact_hold_page(vm_object_t object, vm_ooffset_t offset)
{
- vm_page_t m, ma[1];
+ vm_page_t m;
vm_pindex_t pindex;
int rv;
@@ -238,11 +238,7 @@ vm_imgact_hold_page(vm_object_t object, vm_ooffset_t offset)
pindex = OFF_TO_IDX(offset);
m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL);
if (m->valid != VM_PAGE_BITS_ALL) {
- ma[0] = m;
- rv = vm_pager_get_pages(object, ma, 1, 0);
- m = vm_page_lookup(object, pindex);
- if (m == NULL)
- goto out;
+ rv = vm_pager_get_pages(object, &m, 1, 0);
if (rv != VM_PAGER_OK) {
vm_page_lock(m);
vm_page_free(m);
@@ -571,7 +567,7 @@ vm_thread_swapin(struct thread *td)
{
vm_object_t ksobj;
vm_page_t ma[KSTACK_MAX_PAGES];
- int i, j, k, pages, rv;
+ int i, j, pages, rv;
pages = td->td_kstack_pages;
ksobj = td->td_kstack_obj;
@@ -593,9 +589,12 @@ vm_thread_swapin(struct thread *td)
if (rv != VM_PAGER_OK)
panic("vm_thread_swapin: cannot get kstack for proc: %d",
td->td_proc->p_pid);
+ /*
+ * All pages in the array are in place, due to the
+ * pager is always the swap pager, which doesn't
+ * free or remove wired non-req pages from object.
+ */
vm_object_pip_wakeup(ksobj);
- for (k = i; k < j; k++)
- ma[k] = vm_page_lookup(ksobj, k);
vm_page_xunbusy(ma[i]);
} else if (vm_page_xbusied(ma[i]))
vm_page_xunbusy(ma[i]);
diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c
index d4527b3..fd16bf2 100644
--- a/sys/vm/vm_kern.c
+++ b/sys/vm/vm_kern.c
@@ -391,8 +391,7 @@ void
kmem_unback(vm_object_t object, vm_offset_t addr, vm_size_t size)
{
vm_page_t m;
- vm_offset_t offset;
- int i;
+ vm_offset_t i, offset;
KASSERT(object == kmem_object || object == kernel_object,
("kmem_unback: only supports kernel objects."));
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index bad9994..12ebf5d 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -3424,10 +3424,8 @@ vm_map_stack(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize,
growsize = sgrowsiz;
init_ssize = (max_ssize < growsize) ? max_ssize : growsize;
vm_map_lock(map);
- PROC_LOCK(curproc);
- lmemlim = lim_cur(curproc, RLIMIT_MEMLOCK);
- vmemlim = lim_cur(curproc, RLIMIT_VMEM);
- PROC_UNLOCK(curproc);
+ lmemlim = lim_cur(curthread, RLIMIT_MEMLOCK);
+ vmemlim = lim_cur(curthread, RLIMIT_VMEM);
if (!old_mlock && map->flags & MAP_WIREFUTURE) {
if (ptoa(pmap_wired_count(map->pmap)) + init_ssize > lmemlim) {
rv = KERN_NO_SPACE;
@@ -3556,12 +3554,10 @@ vm_map_growstack(struct proc *p, vm_offset_t addr)
int error;
#endif
+ lmemlim = lim_cur(curthread, RLIMIT_MEMLOCK);
+ stacklim = lim_cur(curthread, RLIMIT_STACK);
+ vmemlim = lim_cur(curthread, RLIMIT_VMEM);
Retry:
- PROC_LOCK(p);
- lmemlim = lim_cur(p, RLIMIT_MEMLOCK);
- stacklim = lim_cur(p, RLIMIT_STACK);
- vmemlim = lim_cur(p, RLIMIT_VMEM);
- PROC_UNLOCK(p);
vm_map_lock_read(map);
diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c
index 1dd2479..d331a9b 100644
--- a/sys/vm/vm_mmap.c
+++ b/sys/vm/vm_mmap.c
@@ -100,13 +100,6 @@ SYSCTL_INT(_vm, OID_AUTO, old_mlock, CTLFLAG_RWTUN, &old_mlock, 0,
#define MAP_32BIT_MAX_ADDR ((vm_offset_t)1 << 31)
#endif
-static int vm_mmap_vnode(struct thread *, vm_size_t, vm_prot_t, vm_prot_t *,
- int *, struct vnode *, vm_ooffset_t *, vm_object_t *, boolean_t *);
-static int vm_mmap_cdev(struct thread *, vm_size_t, vm_prot_t, vm_prot_t *,
- int *, struct cdev *, vm_ooffset_t *, vm_object_t *);
-static int vm_mmap_shm(struct thread *, vm_size_t, vm_prot_t, vm_prot_t *,
- int *, struct shmfd *, vm_ooffset_t, vm_object_t *);
-
#ifndef _SYS_SYSPROTO_H_
struct sbrk_args {
int incr;
@@ -197,16 +190,10 @@ sys_mmap(td, uap)
struct thread *td;
struct mmap_args *uap;
{
-#ifdef HWPMC_HOOKS
- struct pmckern_map_in pkm;
-#endif
struct file *fp;
- struct vnode *vp;
vm_offset_t addr;
vm_size_t size, pageoff;
- vm_prot_t cap_maxprot, maxprot;
- void *handle;
- objtype_t handle_type;
+ vm_prot_t cap_maxprot;
int align, error, flags, prot;
off_t pos;
struct vmspace *vms = td->td_proc->p_vmspace;
@@ -329,19 +316,27 @@ sys_mmap(td, uap)
if (addr == 0 ||
(addr >= round_page((vm_offset_t)vms->vm_taddr) &&
addr < round_page((vm_offset_t)vms->vm_daddr +
- lim_max(td->td_proc, RLIMIT_DATA))))
+ lim_max_proc(td->td_proc, RLIMIT_DATA))))
addr = round_page((vm_offset_t)vms->vm_daddr +
- lim_max(td->td_proc, RLIMIT_DATA));
+ lim_max_proc(td->td_proc, RLIMIT_DATA));
PROC_UNLOCK(td->td_proc);
}
- if (flags & MAP_ANON) {
+ if (size == 0) {
+ /*
+ * Return success without mapping anything for old
+ * binaries that request a page-aligned mapping of
+ * length 0. For modern binaries, this function
+ * returns an error earlier.
+ */
+ error = 0;
+ } else if (flags & MAP_ANON) {
/*
* Mapping blank space is trivial.
+ *
+ * This relies on VM_PROT_* matching PROT_*.
*/
- handle = NULL;
- handle_type = OBJT_DEFAULT;
- maxprot = VM_PROT_ALL;
- cap_maxprot = VM_PROT_ALL;
+ error = vm_mmap_object(&vms->vm_map, &addr, size, prot,
+ VM_PROT_ALL, flags, NULL, pos, FALSE, td);
} else {
/*
* Mapping file, get fp for validation and don't let the
@@ -366,93 +361,12 @@ sys_mmap(td, uap)
error = EINVAL;
goto done;
}
- if (fp->f_type == DTYPE_SHM) {
- handle = fp->f_data;
- handle_type = OBJT_SWAP;
- maxprot = VM_PROT_NONE;
-
- /* FREAD should always be set. */
- if (fp->f_flag & FREAD)
- maxprot |= VM_PROT_EXECUTE | VM_PROT_READ;
- if (fp->f_flag & FWRITE)
- maxprot |= VM_PROT_WRITE;
- goto map;
- }
- if (fp->f_type != DTYPE_VNODE) {
- error = ENODEV;
- goto done;
- }
-#if defined(COMPAT_FREEBSD7) || defined(COMPAT_FREEBSD6) || \
- defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4)
- /*
- * POSIX shared-memory objects are defined to have
- * kernel persistence, and are not defined to support
- * read(2)/write(2) -- or even open(2). Thus, we can
- * use MAP_ASYNC to trade on-disk coherence for speed.
- * The shm_open(3) library routine turns on the FPOSIXSHM
- * flag to request this behavior.
- */
- if (fp->f_flag & FPOSIXSHM)
- flags |= MAP_NOSYNC;
-#endif
- vp = fp->f_vnode;
- /*
- * Ensure that file and memory protections are
- * compatible. Note that we only worry about
- * writability if mapping is shared; in this case,
- * current and max prot are dictated by the open file.
- * XXX use the vnode instead? Problem is: what
- * credentials do we use for determination? What if
- * proc does a setuid?
- */
- if (vp->v_mount != NULL && vp->v_mount->mnt_flag & MNT_NOEXEC)
- maxprot = VM_PROT_NONE;
- else
- maxprot = VM_PROT_EXECUTE;
- if (fp->f_flag & FREAD) {
- maxprot |= VM_PROT_READ;
- } else if (prot & PROT_READ) {
- error = EACCES;
- goto done;
- }
- /*
- * If we are sharing potential changes (either via
- * MAP_SHARED or via the implicit sharing of character
- * device mappings), and we are trying to get write
- * permission although we opened it without asking
- * for it, bail out.
- */
- if ((flags & MAP_SHARED) != 0) {
- if ((fp->f_flag & FWRITE) != 0) {
- maxprot |= VM_PROT_WRITE;
- } else if ((prot & PROT_WRITE) != 0) {
- error = EACCES;
- goto done;
- }
- } else if (vp->v_type != VCHR || (fp->f_flag & FWRITE) != 0) {
- maxprot |= VM_PROT_WRITE;
- cap_maxprot |= VM_PROT_WRITE;
- }
- handle = (void *)vp;
- handle_type = OBJT_VNODE;
- }
-map:
- td->td_fpop = fp;
- maxprot &= cap_maxprot;
- /* This relies on VM_PROT_* matching PROT_*. */
- error = vm_mmap(&vms->vm_map, &addr, size, prot, maxprot,
- flags, handle_type, handle, pos);
- td->td_fpop = NULL;
-#ifdef HWPMC_HOOKS
- /* inform hwpmc(4) if an executable is being mapped */
- if (error == 0 && handle_type == OBJT_VNODE &&
- (prot & PROT_EXEC)) {
- pkm.pm_file = handle;
- pkm.pm_address = (uintptr_t) addr;
- PMC_CALL_HOOK(td, PMC_FN_MMAP, (void *) &pkm);
+ /* This relies on VM_PROT_* matching PROT_*. */
+ error = fo_mmap(fp, &vms->vm_map, &addr, size, prot,
+ cap_maxprot, flags, pos, td);
}
-#endif
+
if (error == 0)
td->td_retval[0] = (register_t) (addr + pageoff);
done:
@@ -1114,7 +1028,7 @@ vm_mlock(struct proc *proc, struct ucred *cred, const void *addr0, size_t len)
map = &proc->p_vmspace->vm_map;
PROC_LOCK(proc);
nsize = ptoa(npages + pmap_wired_count(map->pmap));
- if (nsize > lim_cur(proc, RLIMIT_MEMLOCK)) {
+ if (nsize > lim_cur_proc(proc, RLIMIT_MEMLOCK)) {
PROC_UNLOCK(proc);
return (ENOMEM);
}
@@ -1174,7 +1088,7 @@ sys_mlockall(td, uap)
*/
if (!old_mlock && uap->how & MCL_CURRENT) {
PROC_LOCK(td->td_proc);
- if (map->size > lim_cur(td->td_proc, RLIMIT_MEMLOCK)) {
+ if (map->size > lim_cur(td, RLIMIT_MEMLOCK)) {
PROC_UNLOCK(td->td_proc);
return (ENOMEM);
}
@@ -1311,9 +1225,6 @@ sys_munlock(td, uap)
*
* Helper function for vm_mmap. Perform sanity check specific for mmap
* operations on vnodes.
- *
- * For VCHR vnodes, the vnode lock is held over the call to
- * vm_mmap_cdev() to keep vp->v_rdev valid.
*/
int
vm_mmap_vnode(struct thread *td, vm_size_t objsize,
@@ -1360,12 +1271,6 @@ vm_mmap_vnode(struct thread *td, vm_size_t objsize,
*writecounted = TRUE;
vnode_pager_update_writecount(obj, 0, objsize);
}
- } else if (vp->v_type == VCHR) {
- error = vm_mmap_cdev(td, objsize, prot, maxprotp, flagsp,
- vp->v_rdev, foffp, objp);
- if (error == 0)
- goto mark_atime;
- goto done;
} else {
error = EINVAL;
goto done;
@@ -1373,13 +1278,14 @@ vm_mmap_vnode(struct thread *td, vm_size_t objsize,
if ((error = VOP_GETATTR(vp, &va, cred)))
goto done;
#ifdef MAC
- error = mac_vnode_check_mmap(cred, vp, prot, flags);
+ /* This relies on VM_PROT_* matching PROT_*. */
+ error = mac_vnode_check_mmap(cred, vp, (int)prot, flags);
if (error != 0)
goto done;
#endif
if ((flags & MAP_SHARED) != 0) {
if ((va.va_flags & (SF_SNAPSHOT|IMMUTABLE|APPEND)) != 0) {
- if (prot & PROT_WRITE) {
+ if (prot & VM_PROT_WRITE) {
error = EPERM;
goto done;
}
@@ -1414,7 +1320,6 @@ vm_mmap_vnode(struct thread *td, vm_size_t objsize,
*objp = obj;
*flagsp = flags;
-mark_atime:
vfs_mark_atime(vp, cred);
done:
@@ -1435,21 +1340,18 @@ done:
* operations on cdevs.
*/
int
-vm_mmap_cdev(struct thread *td, vm_size_t objsize,
- vm_prot_t prot, vm_prot_t *maxprotp, int *flagsp,
- struct cdev *cdev, vm_ooffset_t *foff, vm_object_t *objp)
+vm_mmap_cdev(struct thread *td, vm_size_t objsize, vm_prot_t prot,
+ vm_prot_t *maxprotp, int *flagsp, struct cdev *cdev, struct cdevsw *dsw,
+ vm_ooffset_t *foff, vm_object_t *objp)
{
vm_object_t obj;
- struct cdevsw *dsw;
- int error, flags, ref;
+ int error, flags;
flags = *flagsp;
- dsw = dev_refthread(cdev, &ref);
- if (dsw == NULL)
- return (ENXIO);
if (dsw->d_flags & D_MMAP_ANON) {
- dev_relthread(cdev, ref);
+ *objp = NULL;
+ *foff = 0;
*maxprotp = VM_PROT_ALL;
*flagsp |= MAP_ANON;
return (0);
@@ -1458,24 +1360,18 @@ vm_mmap_cdev(struct thread *td, vm_size_t objsize,
* cdevs do not provide private mappings of any kind.
*/
if ((*maxprotp & VM_PROT_WRITE) == 0 &&
- (prot & PROT_WRITE) != 0) {
- dev_relthread(cdev, ref);
+ (prot & VM_PROT_WRITE) != 0)
return (EACCES);
- }
- if (flags & (MAP_PRIVATE|MAP_COPY)) {
- dev_relthread(cdev, ref);
+ if (flags & (MAP_PRIVATE|MAP_COPY))
return (EINVAL);
- }
/*
* Force device mappings to be shared.
*/
flags |= MAP_SHARED;
#ifdef MAC_XXX
- error = mac_cdev_check_mmap(td->td_ucred, cdev, prot);
- if (error != 0) {
- dev_relthread(cdev, ref);
+ error = mac_cdev_check_mmap(td->td_ucred, cdev, (int)prot);
+ if (error != 0)
return (error);
- }
#endif
/*
* First, try d_mmap_single(). If that is not implemented
@@ -1487,7 +1383,6 @@ vm_mmap_cdev(struct thread *td, vm_size_t objsize,
* XXX assumes VM_PROT_* == PROT_*
*/
error = dsw->d_mmap_single(cdev, foff, objsize, objp, (int)prot);
- dev_relthread(cdev, ref);
if (error != ENODEV)
return (error);
obj = vm_pager_allocate(OBJT_DEVICE, cdev, objsize, prot, *foff,
@@ -1500,63 +1395,93 @@ vm_mmap_cdev(struct thread *td, vm_size_t objsize,
}
/*
- * vm_mmap_shm()
- *
- * MPSAFE
+ * vm_mmap()
*
- * Helper function for vm_mmap. Perform sanity check specific for mmap
- * operations on shm file descriptors.
+ * Internal version of mmap used by exec, sys5 shared memory, and
+ * various device drivers. Handle is either a vnode pointer, a
+ * character device, or NULL for MAP_ANON.
*/
int
-vm_mmap_shm(struct thread *td, vm_size_t objsize,
- vm_prot_t prot, vm_prot_t *maxprotp, int *flagsp,
- struct shmfd *shmfd, vm_ooffset_t foff, vm_object_t *objp)
+vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot,
+ vm_prot_t maxprot, int flags,
+ objtype_t handle_type, void *handle,
+ vm_ooffset_t foff)
{
+ vm_object_t object;
+ struct thread *td = curthread;
int error;
+ boolean_t writecounted;
- if ((*flagsp & MAP_SHARED) != 0 &&
- (*maxprotp & VM_PROT_WRITE) == 0 &&
- (prot & PROT_WRITE) != 0)
- return (EACCES);
-#ifdef MAC
- error = mac_posixshm_check_mmap(td->td_ucred, shmfd, prot, *flagsp);
- if (error != 0)
- return (error);
-#endif
- error = shm_mmap(shmfd, objsize, foff, objp);
+ if (size == 0)
+ return (EINVAL);
+
+ size = round_page(size);
+ writecounted = FALSE;
+
+ /*
+ * Lookup/allocate object.
+ */
+ switch (handle_type) {
+ case OBJT_DEVICE: {
+ struct cdevsw *dsw;
+ struct cdev *cdev;
+ int ref;
+
+ cdev = handle;
+ dsw = dev_refthread(cdev, &ref);
+ if (dsw == NULL)
+ return (ENXIO);
+ error = vm_mmap_cdev(td, size, prot, &maxprot, &flags, cdev,
+ dsw, &foff, &object);
+ dev_relthread(cdev, ref);
+ break;
+ }
+ case OBJT_VNODE:
+ error = vm_mmap_vnode(td, size, prot, &maxprot, &flags,
+ handle, &foff, &object, &writecounted);
+ break;
+ case OBJT_DEFAULT:
+ if (handle == NULL) {
+ error = 0;
+ break;
+ }
+ /* FALLTHROUGH */
+ default:
+ error = EINVAL;
+ break;
+ }
if (error)
return (error);
- return (0);
+
+ error = vm_mmap_object(map, addr, size, prot, maxprot, flags, object,
+ foff, writecounted, td);
+ if (error != 0 && object != NULL) {
+ /*
+ * If this mapping was accounted for in the vnode's
+ * writecount, then undo that now.
+ */
+ if (writecounted)
+ vnode_pager_release_writecount(object, 0, size);
+ vm_object_deallocate(object);
+ }
+ return (error);
}
/*
- * vm_mmap()
- *
- * MPSAFE
- *
- * Internal version of mmap. Currently used by mmap, exec, and sys5
- * shared memory. Handle is either a vnode pointer or NULL for MAP_ANON.
+ * Internal version of mmap that maps a specific VM object into an
+ * map. Called by mmap for MAP_ANON, vm_mmap, shm_mmap, and vn_mmap.
*/
int
-vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot,
- vm_prot_t maxprot, int flags,
- objtype_t handle_type, void *handle,
- vm_ooffset_t foff)
+vm_mmap_object(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot,
+ vm_prot_t maxprot, int flags, vm_object_t object, vm_ooffset_t foff,
+ boolean_t writecounted, struct thread *td)
{
boolean_t fitit;
- vm_object_t object = NULL;
- struct thread *td = curthread;
int docow, error, findspace, rv;
- boolean_t writecounted;
-
- if (size == 0)
- return (0);
-
- size = round_page(size);
if (map == &td->td_proc->p_vmspace->vm_map) {
PROC_LOCK(td->td_proc);
- if (map->size + size > lim_cur(td->td_proc, RLIMIT_VMEM)) {
+ if (map->size + size > lim_cur_proc(td->td_proc, RLIMIT_VMEM)) {
PROC_UNLOCK(td->td_proc);
return (ENOMEM);
}
@@ -1566,7 +1491,7 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot,
}
if (!old_mlock && map->flags & MAP_WIREFUTURE) {
if (ptoa(pmap_wired_count(map->pmap)) + size >
- lim_cur(td->td_proc, RLIMIT_MEMLOCK)) {
+ lim_cur_proc(td->td_proc, RLIMIT_MEMLOCK)) {
racct_set_force(td->td_proc, RACCT_VMEM,
map->size);
PROC_UNLOCK(td->td_proc);
@@ -1586,11 +1511,11 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot,
/*
* We currently can only deal with page aligned file offsets.
- * The check is here rather than in the syscall because the
- * kernel calls this function internally for other mmaping
- * operations (such as in exec) and non-aligned offsets will
- * cause pmap inconsistencies...so we want to be sure to
- * disallow this in all cases.
+ * The mmap() system call already enforces this by subtracting
+ * the page offset from the file offset, but checking here
+ * catches errors in device drivers (e.g. d_single_mmap()
+ * callbacks) and other internal mapping requests (such as in
+ * exec).
*/
if (foff & PAGE_MASK)
return (EINVAL);
@@ -1603,44 +1528,11 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot,
return (EINVAL);
fitit = FALSE;
}
- writecounted = FALSE;
- /*
- * Lookup/allocate object.
- */
- switch (handle_type) {
- case OBJT_DEVICE:
- error = vm_mmap_cdev(td, size, prot, &maxprot, &flags,
- handle, &foff, &object);
- break;
- case OBJT_VNODE:
- error = vm_mmap_vnode(td, size, prot, &maxprot, &flags,
- handle, &foff, &object, &writecounted);
- break;
- case OBJT_SWAP:
- error = vm_mmap_shm(td, size, prot, &maxprot, &flags,
- handle, foff, &object);
- break;
- case OBJT_DEFAULT:
- if (handle == NULL) {
- error = 0;
- break;
- }
- /* FALLTHROUGH */
- default:
- error = EINVAL;
- break;
- }
- if (error)
- return (error);
if (flags & MAP_ANON) {
- object = NULL;
+ if (object != NULL || foff != 0)
+ return (EINVAL);
docow = 0;
- /*
- * Unnamed anonymous regions always start at 0.
- */
- if (handle == 0)
- foff = 0;
} else if (flags & MAP_PREFAULT_READ)
docow = MAP_PREFAULT;
else
@@ -1693,19 +1585,6 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot,
VM_MAP_WIRE_USER | ((flags & MAP_STACK) ?
VM_MAP_WIRE_HOLESOK : VM_MAP_WIRE_NOHOLES));
}
- } else {
- /*
- * If this mapping was accounted for in the vnode's
- * writecount, then undo that now.
- */
- if (writecounted)
- vnode_pager_release_writecount(object, 0, size);
- /*
- * Lose the object reference. Will destroy the
- * object if it's an unnamed anonymous mapping
- * or named anonymous without other references.
- */
- vm_object_deallocate(object);
}
return (vm_mmap_to_errno(rv));
}
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 78cea70..c7f3153 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$");
#include <sys/socket.h>
#include <sys/resourcevar.h>
#include <sys/rwlock.h>
+#include <sys/user.h>
#include <sys/vnode.h>
#include <sys/vmmeter.h>
#include <sys/sx.h>
@@ -2045,7 +2046,7 @@ vm_object_page_cache(vm_object_t object, vm_pindex_t start, vm_pindex_t end)
boolean_t
vm_object_populate(vm_object_t object, vm_pindex_t start, vm_pindex_t end)
{
- vm_page_t m, ma[1];
+ vm_page_t m;
vm_pindex_t pindex;
int rv;
@@ -2053,11 +2054,7 @@ vm_object_populate(vm_object_t object, vm_pindex_t start, vm_pindex_t end)
for (pindex = start; pindex < end; pindex++) {
m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL);
if (m->valid != VM_PAGE_BITS_ALL) {
- ma[0] = m;
- rv = vm_pager_get_pages(object, ma, 1, 0);
- m = vm_page_lookup(object, pindex);
- if (m == NULL)
- break;
+ rv = vm_pager_get_pages(object, &m, 1, 0);
if (rv != VM_PAGER_OK) {
vm_page_lock(m);
vm_page_free(m);
@@ -2286,6 +2283,154 @@ next_page:
}
}
+struct vnode *
+vm_object_vnode(vm_object_t object)
+{
+
+ VM_OBJECT_ASSERT_LOCKED(object);
+ if (object->type == OBJT_VNODE)
+ return (object->handle);
+ if (object->type == OBJT_SWAP && (object->flags & OBJ_TMPFS) != 0)
+ return (object->un_pager.swp.swp_tmpfs);
+ return (NULL);
+}
+
+static int
+sysctl_vm_object_list(SYSCTL_HANDLER_ARGS)
+{
+ struct kinfo_vmobject kvo;
+ char *fullpath, *freepath;
+ struct vnode *vp;
+ struct vattr va;
+ vm_object_t obj;
+ vm_page_t m;
+ int count, error;
+
+ if (req->oldptr == NULL) {
+ /*
+ * If an old buffer has not been provided, generate an
+ * estimate of the space needed for a subsequent call.
+ */
+ mtx_lock(&vm_object_list_mtx);
+ count = 0;
+ TAILQ_FOREACH(obj, &vm_object_list, object_list) {
+ if (obj->type == OBJT_DEAD)
+ continue;
+ count++;
+ }
+ mtx_unlock(&vm_object_list_mtx);
+ return (SYSCTL_OUT(req, NULL, sizeof(struct kinfo_vmobject) *
+ count * 11 / 10));
+ }
+
+ error = 0;
+
+ /*
+ * VM objects are type stable and are never removed from the
+ * list once added. This allows us to safely read obj->object_list
+ * after reacquiring the VM object lock.
+ */
+ mtx_lock(&vm_object_list_mtx);
+ TAILQ_FOREACH(obj, &vm_object_list, object_list) {
+ if (obj->type == OBJT_DEAD)
+ continue;
+ VM_OBJECT_RLOCK(obj);
+ if (obj->type == OBJT_DEAD) {
+ VM_OBJECT_RUNLOCK(obj);
+ continue;
+ }
+ mtx_unlock(&vm_object_list_mtx);
+ kvo.kvo_size = ptoa(obj->size);
+ kvo.kvo_resident = obj->resident_page_count;
+ kvo.kvo_ref_count = obj->ref_count;
+ kvo.kvo_shadow_count = obj->shadow_count;
+ kvo.kvo_memattr = obj->memattr;
+ kvo.kvo_active = 0;
+ kvo.kvo_inactive = 0;
+ TAILQ_FOREACH(m, &obj->memq, listq) {
+ /*
+ * A page may belong to the object but be
+ * dequeued and set to PQ_NONE while the
+ * object lock is not held. This makes the
+ * reads of m->queue below racy, and we do not
+ * count pages set to PQ_NONE. However, this
+ * sysctl is only meant to give an
+ * approximation of the system anyway.
+ */
+ if (m->queue == PQ_ACTIVE)
+ kvo.kvo_active++;
+ else if (m->queue == PQ_INACTIVE)
+ kvo.kvo_inactive++;
+ }
+
+ kvo.kvo_vn_fileid = 0;
+ kvo.kvo_vn_fsid = 0;
+ freepath = NULL;
+ fullpath = "";
+ vp = NULL;
+ switch (obj->type) {
+ case OBJT_DEFAULT:
+ kvo.kvo_type = KVME_TYPE_DEFAULT;
+ break;
+ case OBJT_VNODE:
+ kvo.kvo_type = KVME_TYPE_VNODE;
+ vp = obj->handle;
+ vref(vp);
+ break;
+ case OBJT_SWAP:
+ kvo.kvo_type = KVME_TYPE_SWAP;
+ break;
+ case OBJT_DEVICE:
+ kvo.kvo_type = KVME_TYPE_DEVICE;
+ break;
+ case OBJT_PHYS:
+ kvo.kvo_type = KVME_TYPE_PHYS;
+ break;
+ case OBJT_DEAD:
+ kvo.kvo_type = KVME_TYPE_DEAD;
+ break;
+ case OBJT_SG:
+ kvo.kvo_type = KVME_TYPE_SG;
+ break;
+ case OBJT_MGTDEVICE:
+ kvo.kvo_type = KVME_TYPE_MGTDEVICE;
+ break;
+ default:
+ kvo.kvo_type = KVME_TYPE_UNKNOWN;
+ break;
+ }
+ VM_OBJECT_RUNLOCK(obj);
+ if (vp != NULL) {
+ vn_fullpath(curthread, vp, &fullpath, &freepath);
+ vn_lock(vp, LK_SHARED | LK_RETRY);
+ if (VOP_GETATTR(vp, &va, curthread->td_ucred) == 0) {
+ kvo.kvo_vn_fileid = va.va_fileid;
+ kvo.kvo_vn_fsid = va.va_fsid;
+ }
+ vput(vp);
+ }
+
+ strlcpy(kvo.kvo_path, fullpath, sizeof(kvo.kvo_path));
+ if (freepath != NULL)
+ free(freepath, M_TEMP);
+
+ /* Pack record size down */
+ kvo.kvo_structsize = offsetof(struct kinfo_vmobject, kvo_path) +
+ strlen(kvo.kvo_path) + 1;
+ kvo.kvo_structsize = roundup(kvo.kvo_structsize,
+ sizeof(uint64_t));
+ error = SYSCTL_OUT(req, &kvo, kvo.kvo_structsize);
+ mtx_lock(&vm_object_list_mtx);
+ if (error)
+ break;
+ }
+ mtx_unlock(&vm_object_list_mtx);
+ return (error);
+}
+SYSCTL_PROC(_vm, OID_AUTO, objects, CTLTYPE_STRUCT | CTLFLAG_RW | CTLFLAG_SKIP |
+ CTLFLAG_MPSAFE, NULL, 0, sysctl_vm_object_list, "S,kinfo_vmobject",
+ "List of VM objects");
+
#include "opt_ddb.h"
#ifdef DDB
#include <sys/kernel.h>
diff --git a/sys/vm/vm_object.h b/sys/vm/vm_object.h
index 731c9e3..1f59156 100644
--- a/sys/vm/vm_object.h
+++ b/sys/vm/vm_object.h
@@ -322,6 +322,7 @@ boolean_t vm_object_sync(vm_object_t, vm_ooffset_t, vm_size_t, boolean_t,
boolean_t);
void vm_object_unwire(vm_object_t object, vm_ooffset_t offset,
vm_size_t length, uint8_t queue);
+struct vnode *vm_object_vnode(vm_object_t object);
#endif /* _KERNEL */
#endif /* _VM_OBJECT_ */
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index b3b36d6..3b58fb7 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -1827,6 +1827,7 @@ vm_page_alloc_contig_vdrop(struct spglist *lst)
*
* optional allocation flags:
* VM_ALLOC_NOBUSY do not exclusive busy the page
+ * VM_ALLOC_NODUMP do not include the page in a kernel core dump
* VM_ALLOC_NOOBJ page is not associated with an object and
* should not be exclusive busy
* VM_ALLOC_SBUSY shared busy the allocated page
@@ -2707,7 +2708,6 @@ vm_page_cache(vm_page_t m)
#else
if (TRUE) {
#endif
- vm_phys_set_pool(VM_FREEPOOL_CACHE, m, 0);
vm_phys_free_pages(m, 0);
}
vm_page_free_wakeup();
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index 2f57579..71d76d4 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -1851,7 +1851,7 @@ again:
/*
* get a limit
*/
- lim_rlimit(p, RLIMIT_RSS, &rsslim);
+ lim_rlimit_proc(p, RLIMIT_RSS, &rsslim);
limit = OFF_TO_IDX(
qmin(rsslim.rlim_cur, rsslim.rlim_max));
diff --git a/sys/vm/vm_reserv.c b/sys/vm/vm_reserv.c
index b74c768..2cfc630 100644
--- a/sys/vm/vm_reserv.c
+++ b/sys/vm/vm_reserv.c
@@ -801,9 +801,6 @@ vm_reserv_free_page(vm_page_t m)
rv = vm_reserv_from_page(m);
if (rv->object == NULL)
return (FALSE);
- if ((m->flags & PG_CACHED) != 0 && m->pool != VM_FREEPOOL_CACHE)
- vm_phys_set_pool(VM_FREEPOOL_CACHE, rv->pages,
- VM_LEVEL_0_ORDER);
vm_reserv_depopulate(rv, m - rv->pages);
return (TRUE);
}
diff --git a/sys/vm/vm_unix.c b/sys/vm/vm_unix.c
index cc77ff7..201c13b 100644
--- a/sys/vm/vm_unix.c
+++ b/sys/vm/vm_unix.c
@@ -83,11 +83,9 @@ sys_obreak(td, uap)
int error = 0;
boolean_t do_map_wirefuture;
- PROC_LOCK(td->td_proc);
- datalim = lim_cur(td->td_proc, RLIMIT_DATA);
- lmemlim = lim_cur(td->td_proc, RLIMIT_MEMLOCK);
- vmemlim = lim_cur(td->td_proc, RLIMIT_VMEM);
- PROC_UNLOCK(td->td_proc);
+ datalim = lim_cur(td, RLIMIT_DATA);
+ lmemlim = lim_cur(td, RLIMIT_MEMLOCK);
+ vmemlim = lim_cur(td, RLIMIT_VMEM);
do_map_wirefuture = FALSE;
new = round_page((vm_offset_t)uap->nsize);
diff --git a/sys/x86/acpica/madt.c b/sys/x86/acpica/madt.c
index 149e5dd..e812358 100644
--- a/sys/x86/acpica/madt.c
+++ b/sys/x86/acpica/madt.c
@@ -56,8 +56,8 @@ static struct {
} *ioapics;
static struct lapic_info {
- u_int la_enabled:1;
- u_int la_acpi_id:8;
+ u_int la_enabled;
+ u_int la_acpi_id;
} lapics[MAX_APIC_ID + 1];
int madt_found_sci_override;
@@ -255,34 +255,48 @@ madt_walk_table(acpi_subtable_handler *handler, void *arg)
}
static void
+madt_add_cpu(u_int acpi_id, u_int apic_id, u_int flags)
+{
+ struct lapic_info *la;
+
+ /*
+ * The MADT does not include a BSP flag, so we have to let the
+ * MP code figure out which CPU is the BSP on its own.
+ */
+ if (bootverbose)
+ printf("MADT: Found CPU APIC ID %u ACPI ID %u: %s\n",
+ apic_id, acpi_id, flags & ACPI_MADT_ENABLED ?
+ "enabled" : "disabled");
+ if (!(flags & ACPI_MADT_ENABLED))
+ return;
+ if (apic_id > MAX_APIC_ID) {
+ printf("MADT: Ignoring local APIC ID %u (too high)\n",
+ apic_id);
+ return;
+ }
+
+ la = &lapics[apic_id];
+ KASSERT(la->la_enabled == 0, ("Duplicate local APIC ID %u", apic_id));
+ la->la_enabled = 1;
+ la->la_acpi_id = acpi_id;
+ lapic_create(apic_id, 0);
+}
+
+static void
madt_probe_cpus_handler(ACPI_SUBTABLE_HEADER *entry, void *arg)
{
ACPI_MADT_LOCAL_APIC *proc;
- struct lapic_info *la;
+ ACPI_MADT_LOCAL_X2APIC *x2apic;
switch (entry->Type) {
case ACPI_MADT_TYPE_LOCAL_APIC:
- /*
- * The MADT does not include a BSP flag, so we have to
- * let the MP code figure out which CPU is the BSP on
- * its own.
- */
proc = (ACPI_MADT_LOCAL_APIC *)entry;
- if (bootverbose)
- printf("MADT: Found CPU APIC ID %u ACPI ID %u: %s\n",
- proc->Id, proc->ProcessorId,
- (proc->LapicFlags & ACPI_MADT_ENABLED) ?
- "enabled" : "disabled");
- if (!(proc->LapicFlags & ACPI_MADT_ENABLED))
- break;
- if (proc->Id > MAX_APIC_ID)
- panic("%s: CPU ID %u too high", __func__, proc->Id);
- la = &lapics[proc->Id];
- KASSERT(la->la_enabled == 0,
- ("Duplicate local APIC ID %u", proc->Id));
- la->la_enabled = 1;
- la->la_acpi_id = proc->ProcessorId;
- lapic_create(proc->Id, 0);
+ madt_add_cpu(proc->ProcessorId, proc->Id, proc->LapicFlags);
+ break;
+ case ACPI_MADT_TYPE_LOCAL_X2APIC:
+ x2apic = (ACPI_MADT_LOCAL_X2APIC *)entry;
+ madt_add_cpu(x2apic->Uid, x2apic->LocalApicId,
+ x2apic->LapicFlags);
break;
}
}
@@ -551,29 +565,44 @@ madt_parse_nmi(ACPI_MADT_NMI_SOURCE *nmi)
* Parse an entry for an NMI routed to a local APIC LVT pin.
*/
static void
-madt_parse_local_nmi(ACPI_MADT_LOCAL_APIC_NMI *nmi)
+madt_handle_local_nmi(u_int acpi_id, UINT8 Lint, UINT16 IntiFlags)
{
u_int apic_id, pin;
- if (nmi->ProcessorId == 0xff)
+ if (acpi_id == 0xffffffff)
apic_id = APIC_ID_ALL;
- else if (madt_find_cpu(nmi->ProcessorId, &apic_id) != 0) {
+ else if (madt_find_cpu(acpi_id, &apic_id) != 0) {
if (bootverbose)
printf("MADT: Ignoring local NMI routed to "
- "ACPI CPU %u\n", nmi->ProcessorId);
+ "ACPI CPU %u\n", acpi_id);
return;
}
- if (nmi->Lint == 0)
+ if (Lint == 0)
pin = APIC_LVT_LINT0;
else
pin = APIC_LVT_LINT1;
lapic_set_lvt_mode(apic_id, pin, APIC_LVT_DM_NMI);
- if (!(nmi->IntiFlags & ACPI_MADT_TRIGGER_CONFORMS))
+ if (!(IntiFlags & ACPI_MADT_TRIGGER_CONFORMS))
lapic_set_lvt_triggermode(apic_id, pin,
- interrupt_trigger(nmi->IntiFlags, 0));
- if (!(nmi->IntiFlags & ACPI_MADT_POLARITY_CONFORMS))
+ interrupt_trigger(IntiFlags, 0));
+ if (!(IntiFlags & ACPI_MADT_POLARITY_CONFORMS))
lapic_set_lvt_polarity(apic_id, pin,
- interrupt_polarity(nmi->IntiFlags, 0));
+ interrupt_polarity(IntiFlags, 0));
+}
+
+static void
+madt_parse_local_nmi(ACPI_MADT_LOCAL_APIC_NMI *nmi)
+{
+
+ madt_handle_local_nmi(nmi->ProcessorId == 0xff ? 0xffffffff :
+ nmi->ProcessorId, nmi->Lint, nmi->IntiFlags);
+}
+
+static void
+madt_parse_local_x2apic_nmi(ACPI_MADT_LOCAL_X2APIC_NMI *nmi)
+{
+
+ madt_handle_local_nmi(nmi->Uid, nmi->Lint, nmi->IntiFlags);
}
/*
@@ -594,6 +623,10 @@ madt_parse_ints(ACPI_SUBTABLE_HEADER *entry, void *arg __unused)
case ACPI_MADT_TYPE_LOCAL_APIC_NMI:
madt_parse_local_nmi((ACPI_MADT_LOCAL_APIC_NMI *)entry);
break;
+ case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI:
+ madt_parse_local_x2apic_nmi(
+ (ACPI_MADT_LOCAL_X2APIC_NMI *)entry);
+ break;
}
}
diff --git a/sys/x86/iommu/busdma_dmar.c b/sys/x86/iommu/busdma_dmar.c
index 96b0bce..3ef8107 100644
--- a/sys/x86/iommu/busdma_dmar.c
+++ b/sys/x86/iommu/busdma_dmar.c
@@ -818,7 +818,6 @@ dmar_bus_task_dmamap(void *arg, int pending)
struct bus_dma_tag_dmar *tag;
struct bus_dmamap_dmar *map;
struct dmar_unit *unit;
- struct dmar_ctx *ctx;
unit = arg;
DMAR_LOCK(unit);
@@ -826,7 +825,6 @@ dmar_bus_task_dmamap(void *arg, int pending)
TAILQ_REMOVE(&unit->delayed_maps, map, delay_link);
DMAR_UNLOCK(unit);
tag = map->tag;
- ctx = map->tag->ctx;
map->cansleep = true;
map->locked = false;
bus_dmamap_load_mem((bus_dma_tag_t)tag, (bus_dmamap_t)map,
@@ -847,9 +845,7 @@ dmar_bus_task_dmamap(void *arg, int pending)
static void
dmar_bus_schedule_dmamap(struct dmar_unit *unit, struct bus_dmamap_dmar *map)
{
- struct dmar_ctx *ctx;
- ctx = map->tag->ctx;
map->locked = false;
DMAR_LOCK(unit);
TAILQ_INSERT_TAIL(&unit->delayed_maps, map, delay_link);
diff --git a/sys/x86/iommu/intel_idpgtbl.c b/sys/x86/iommu/intel_idpgtbl.c
index 6621b17..b9492dd 100644
--- a/sys/x86/iommu/intel_idpgtbl.c
+++ b/sys/x86/iommu/intel_idpgtbl.c
@@ -108,7 +108,7 @@ static void
ctx_idmap_nextlvl(struct idpgtbl *tbl, int lvl, vm_pindex_t idx,
dmar_gaddr_t addr)
{
- vm_page_t m, m1;
+ vm_page_t m1;
dmar_pte_t *pte;
struct sf_buf *sf;
dmar_gaddr_t f, pg_sz;
@@ -118,7 +118,7 @@ ctx_idmap_nextlvl(struct idpgtbl *tbl, int lvl, vm_pindex_t idx,
VM_OBJECT_ASSERT_LOCKED(tbl->pgtbl_obj);
if (addr >= tbl->maxaddr)
return;
- m = dmar_pgalloc(tbl->pgtbl_obj, idx, DMAR_PGF_OBJL | DMAR_PGF_WAITOK |
+ (void)dmar_pgalloc(tbl->pgtbl_obj, idx, DMAR_PGF_OBJL | DMAR_PGF_WAITOK |
DMAR_PGF_ZERO);
base = idx * DMAR_NPTEPG + 1; /* Index of the first child page of idx */
pg_sz = pglvl_page_size(tbl->pglvl, lvl);
@@ -598,7 +598,7 @@ ctx_unmap_buf_locked(struct dmar_ctx *ctx, dmar_gaddr_t base,
dmar_pte_t *pte;
struct sf_buf *sf;
vm_pindex_t idx;
- dmar_gaddr_t pg_sz, base1, size1;
+ dmar_gaddr_t pg_sz;
int lvl;
DMAR_CTX_ASSERT_PGLOCKED(ctx);
@@ -625,8 +625,6 @@ ctx_unmap_buf_locked(struct dmar_ctx *ctx, dmar_gaddr_t base,
KASSERT((flags & ~DMAR_PGF_WAITOK) == 0, ("invalid flags %x", flags));
pg_sz = 0; /* silence gcc */
- base1 = base;
- size1 = size;
flags |= DMAR_PGF_OBJL;
TD_PREP_PINNED_ASSERT;
diff --git a/sys/x86/iommu/intel_qi.c b/sys/x86/iommu/intel_qi.c
index ce7b041..293e2be 100644
--- a/sys/x86/iommu/intel_qi.c
+++ b/sys/x86/iommu/intel_qi.c
@@ -411,6 +411,7 @@ dmar_init_qi(struct dmar_unit *unit)
ics = DMAR_ICS_IWC;
dmar_write4(unit, DMAR_ICS_REG, ics);
}
+ dmar_enable_qi_intr(unit);
DMAR_UNLOCK(unit);
return (0);
@@ -434,6 +435,7 @@ dmar_fini_qi(struct dmar_unit *unit)
dmar_qi_advance_tail(unit);
dmar_qi_wait_for_seq(unit, &gseq, false);
/* only after the quisce, disable queue */
+ dmar_disable_qi_intr(unit);
dmar_disable_qi(unit);
KASSERT(unit->inv_seq_waiters == 0,
("dmar%d: waiters on disabled queue", unit->unit));
diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c
index 9f39d1c..548da4a 100644
--- a/sys/x86/x86/identcpu.c
+++ b/sys/x86/x86/identcpu.c
@@ -903,6 +903,9 @@ printcpuinfo(void)
"\013INVPCID"
/* Restricted Transactional Memory */
"\014RTM"
+ "\015PQM"
+ "\016NFPUSG"
+ "\020PQE"
/* Intel Memory Protection Extensions */
"\017MPX"
/* AVX512 Foundation */
@@ -922,6 +925,16 @@ printcpuinfo(void)
);
}
+ if (cpu_stdext_feature2 != 0) {
+ printf("\n Structured Extended Features2=0x%b",
+ cpu_stdext_feature2,
+ "\020"
+ "\001PREFETCHWT1"
+ "\004PKU"
+ "\005OSPKE"
+ );
+ }
+
if ((cpu_feature2 & CPUID2_XSAVE) != 0) {
cpuid_count(0xd, 0x1, regs);
if (regs[0] != 0) {
@@ -1357,6 +1370,7 @@ identify_cpu(void)
cpu_stdext_disable = 0;
TUNABLE_INT_FETCH("hw.cpu_stdext_disable", &cpu_stdext_disable);
cpu_stdext_feature &= ~cpu_stdext_disable;
+ cpu_stdext_feature2 = regs[2];
}
#ifdef __i386__
@@ -1701,18 +1715,39 @@ print_INTEL_TLB(u_int data)
case 0x8:
printf("1st-level instruction cache: 16 KB, 4-way set associative, 32 byte line size\n");
break;
+ case 0x9:
+ printf("1st-level instruction cache: 32 KB, 4-way set associative, 64 byte line size\n");
+ break;
case 0xa:
printf("1st-level data cache: 8 KB, 2-way set associative, 32 byte line size\n");
break;
+ case 0xb:
+ printf("Instruction TLB: 4 MByte pages, 4-way set associative, 4 entries\n");
+ break;
case 0xc:
printf("1st-level data cache: 16 KB, 4-way set associative, 32 byte line size\n");
break;
+ case 0xd:
+ printf("1st-level data cache: 16 KBytes, 4-way set associative, 64 byte line size");
+ break;
+ case 0xe:
+ printf("1st-level data cache: 24 KBytes, 6-way set associative, 64 byte line size\n");
+ break;
+ case 0x1d:
+ printf("2nd-level cache: 128 KBytes, 2-way set associative, 64 byte line size\n");
+ break;
+ case 0x21:
+ printf("2nd-level cache: 256 KBytes, 8-way set associative, 64 byte line size\n");
+ break;
case 0x22:
printf("3rd-level cache: 512 KB, 4-way set associative, sectored cache, 64 byte line size\n");
break;
case 0x23:
printf("3rd-level cache: 1 MB, 8-way set associative, sectored cache, 64 byte line size\n");
break;
+ case 0x24:
+ printf("2nd-level cache: 1 MBytes, 16-way set associative, 64 byte line size\n");
+ break;
case 0x25:
printf("3rd-level cache: 2 MB, 8-way set associative, sectored cache, 64 byte line size\n");
break;
@@ -1725,13 +1760,13 @@ print_INTEL_TLB(u_int data)
case 0x30:
printf("1st-level instruction cache: 32 KB, 8-way set associative, 64 byte line size\n");
break;
- case 0x39:
+ case 0x39: /* De-listed in SDM rev. 54 */
printf("2nd-level cache: 128 KB, 4-way set associative, sectored cache, 64 byte line size\n");
break;
- case 0x3b:
+ case 0x3b: /* De-listed in SDM rev. 54 */
printf("2nd-level cache: 128 KB, 2-way set associative, sectored cache, 64 byte line size\n");
break;
- case 0x3c:
+ case 0x3c: /* De-listed in SDM rev. 54 */
printf("2nd-level cache: 256 KB, 4-way set associative, sectored cache, 64 byte line size\n");
break;
case 0x41:
@@ -1755,6 +1790,34 @@ print_INTEL_TLB(u_int data)
case 0x47:
printf("3rd-level cache: 8 MB, 8-way set associative, 64 byte line size\n");
break;
+ case 0x48:
+ printf("2nd-level cache: 3MByte, 12-way set associative, 64 byte line size\n");
+ break;
+ case 0x49:
+ if (CPUID_TO_FAMILY(cpu_id) == 0xf &&
+ CPUID_TO_MODEL(cpu_id) == 0x6)
+ printf("3rd-level cache: 4MB, 16-way set associative, 64-byte line size\n");
+ else
+ printf("2nd-level cache: 4 MByte, 16-way set associative, 64 byte line size");
+ break;
+ case 0x4a:
+ printf("3rd-level cache: 6MByte, 12-way set associative, 64 byte line size\n");
+ break;
+ case 0x4b:
+ printf("3rd-level cache: 8MByte, 16-way set associative, 64 byte line size\n");
+ break;
+ case 0x4c:
+ printf("3rd-level cache: 12MByte, 12-way set associative, 64 byte line size\n");
+ break;
+ case 0x4d:
+ printf("3rd-level cache: 16MByte, 16-way set associative, 64 byte line size\n");
+ break;
+ case 0x4e:
+ printf("2nd-level cache: 6MByte, 24-way set associative, 64 byte line size\n");
+ break;
+ case 0x4f:
+ printf("Instruction TLB: 4 KByte pages, 32 entries\n");
+ break;
case 0x50:
printf("Instruction TLB: 4 KB, 2 MB or 4 MB pages, fully associative, 64 entries\n");
break;
@@ -1764,6 +1827,21 @@ print_INTEL_TLB(u_int data)
case 0x52:
printf("Instruction TLB: 4 KB, 2 MB or 4 MB pages, fully associative, 256 entries\n");
break;
+ case 0x55:
+ printf("Instruction TLB: 2-MByte or 4-MByte pages, fully associative, 7 entries\n");
+ break;
+ case 0x56:
+ printf("Data TLB0: 4 MByte pages, 4-way set associative, 16 entries\n");
+ break;
+ case 0x57:
+ printf("Data TLB0: 4 KByte pages, 4-way associative, 16 entries\n");
+ break;
+ case 0x59:
+ printf("Data TLB0: 4 KByte pages, fully associative, 16 entries\n");
+ break;
+ case 0x5a:
+ printf("Data TLB0: 2-MByte or 4 MByte pages, 4-way set associative, 32 entries\n");
+ break;
case 0x5b:
printf("Data TLB: 4 KB or 4 MB pages, fully associative, 64 entries\n");
break;
@@ -1776,6 +1854,12 @@ print_INTEL_TLB(u_int data)
case 0x60:
printf("1st-level data cache: 16 KB, 8-way set associative, sectored cache, 64 byte line size\n");
break;
+ case 0x61:
+ printf("Instruction TLB: 4 KByte pages, fully associative, 48 entries\n");
+ break;
+ case 0x63:
+ printf("Data TLB: 1 GByte pages, 4-way set associative, 4 entries\n");
+ break;
case 0x66:
printf("1st-level data cache: 8 KB, 4-way set associative, sectored cache, 64 byte line size\n");
break;
@@ -1794,6 +1878,9 @@ print_INTEL_TLB(u_int data)
case 0x72:
printf("Trace cache: 32K-uops, 8-way set associative\n");
break;
+ case 0x76:
+ printf("Instruction TLB: 2M/4M pages, fully associative, 8 entries\n");
+ break;
case 0x78:
printf("2nd-level cache: 1 MB, 4-way set associative, 64-byte line size\n");
break;
@@ -1815,6 +1902,9 @@ print_INTEL_TLB(u_int data)
case 0x7f:
printf("2nd-level cache: 512-KB, 2-way set associative, 64-byte line size\n");
break;
+ case 0x80:
+ printf("2nd-level cache: 512 KByte, 8-way set associative, 64-byte line size\n");
+ break;
case 0x82:
printf("2nd-level cache: 256 KB, 8-way set associative, 32 byte line size\n");
break;
@@ -1833,12 +1923,99 @@ print_INTEL_TLB(u_int data)
case 0x87:
printf("2nd-level cache: 1 MB, 8-way set associative, 64 byte line size\n");
break;
+ case 0xa0:
+ printf("DTLB: 4k pages, fully associative, 32 entries\n");
+ break;
case 0xb0:
printf("Instruction TLB: 4 KB Pages, 4-way set associative, 128 entries\n");
break;
+ case 0xb1:
+ printf("Instruction TLB: 2M pages, 4-way, 8 entries or 4M pages, 4-way, 4 entries\n");
+ break;
+ case 0xb2:
+ printf("Instruction TLB: 4KByte pages, 4-way set associative, 64 entries\n");
+ break;
case 0xb3:
printf("Data TLB: 4 KB Pages, 4-way set associative, 128 entries\n");
break;
+ case 0xb4:
+ printf("Data TLB1: 4 KByte pages, 4-way associative, 256 entries\n");
+ break;
+ case 0xb5:
+ printf("Instruction TLB: 4KByte pages, 8-way set associative, 64 entries\n");
+ break;
+ case 0xb6:
+ printf("Instruction TLB: 4KByte pages, 8-way set associative, 128 entries\n");
+ break;
+ case 0xba:
+ printf("Data TLB1: 4 KByte pages, 4-way associative, 64 entries\n");
+ break;
+ case 0xc0:
+ printf("Data TLB: 4 KByte and 4 MByte pages, 4-way associative, 8 entries\n");
+ break;
+ case 0xc1:
+ printf("Shared 2nd-Level TLB: 4 KByte/2MByte pages, 8-way associative, 1024 entries\n");
+ break;
+ case 0xc2:
+ printf("DTLB: 4 KByte/2 MByte pages, 4-way associative, 16 entries\n");
+ break;
+ case 0xc3:
+ printf("Shared 2nd-Level TLB: 4 KByte /2 MByte pages, 6-way associative, 1536 entries. Also 1GBbyte pages, 4-way, 16 entries\n");
+ break;
+ case 0xca:
+ printf("Shared 2nd-Level TLB: 4 KByte pages, 4-way associative, 512 entries\n");
+ break;
+ case 0xd0:
+ printf("3rd-level cache: 512 KByte, 4-way set associative, 64 byte line size\n");
+ break;
+ case 0xd1:
+ printf("3rd-level cache: 1 MByte, 4-way set associative, 64 byte line size\n");
+ break;
+ case 0xd2:
+ printf("3rd-level cache: 2 MByte, 4-way set associative, 64 byte line size\n");
+ break;
+ case 0xd6:
+ printf("3rd-level cache: 1 MByte, 8-way set associative, 64 byte line size\n");
+ break;
+ case 0xd7:
+ printf("3rd-level cache: 2 MByte, 8-way set associative, 64 byte line size\n");
+ break;
+ case 0xd8:
+ printf("3rd-level cache: 4 MByte, 8-way set associative, 64 byte line size\n");
+ break;
+ case 0xdc:
+ printf("3rd-level cache: 1.5 MByte, 12-way set associative, 64 byte line size\n");
+ break;
+ case 0xdd:
+ printf("3rd-level cache: 3 MByte, 12-way set associative, 64 byte line size\n");
+ break;
+ case 0xde:
+ printf("3rd-level cache: 6 MByte, 12-way set associative, 64 byte line size\n");
+ break;
+ case 0xe2:
+ printf("3rd-level cache: 2 MByte, 16-way set associative, 64 byte line size\n");
+ break;
+ case 0xe3:
+ printf("3rd-level cache: 4 MByte, 16-way set associative, 64 byte line size\n");
+ break;
+ case 0xe4:
+ printf("3rd-level cache: 8 MByte, 16-way set associative, 64 byte line size\n");
+ break;
+ case 0xea:
+ printf("3rd-level cache: 12MByte, 24-way set associative, 64 byte line size\n");
+ break;
+ case 0xeb:
+ printf("3rd-level cache: 18MByte, 24-way set associative, 64 byte line size\n");
+ break;
+ case 0xec:
+ printf("3rd-level cache: 24MByte, 24-way set associative, 64 byte line size\n");
+ break;
+ case 0xf0:
+ printf("64-Byte prefetching\n");
+ break;
+ case 0xf1:
+ printf("128-Byte prefetching\n");
+ break;
}
}
diff --git a/sys/x86/xen/xenpv.c b/sys/x86/xen/xenpv.c
index 2e4a9fe..50fd9df 100644
--- a/sys/x86/xen/xenpv.c
+++ b/sys/x86/xen/xenpv.c
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/pcpu.h>
#include <sys/rman.h>
#include <sys/smp.h>
+#include <sys/limits.h>
#include <vm/vm.h>
#include <vm/vm_page.h>
@@ -72,7 +73,11 @@ xenpv_identify(driver_t *driver, device_t parent)
if (devclass_get_device(xenpv_devclass, 0))
return;
- if (BUS_ADD_CHILD(parent, 0, "xenpv", 0) == NULL)
+ /*
+ * The xenpv bus should be the last to attach in order
+ * to properly detect if an ISA bus has already been added.
+ */
+ if (BUS_ADD_CHILD(parent, UINT_MAX, "xenpv", 0) == NULL)
panic("Unable to attach xenpv bus.");
}
diff --git a/sys/xen/blkif.h b/sys/xen/blkif.h
index 48b71ea..8a19d5d 100644
--- a/sys/xen/blkif.h
+++ b/sys/xen/blkif.h
@@ -46,7 +46,7 @@ struct blkif_x86_32_request {
blkif_vdev_t handle; /* only for read/write requests */
uint64_t id; /* private guest value, echoed in resp */
blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */
- struct blkif_request_segment seg[BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK];
+ struct blkif_request_segment seg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
};
struct blkif_x86_32_response {
uint64_t id; /* copied from request */
@@ -64,7 +64,7 @@ struct blkif_x86_64_request {
blkif_vdev_t handle; /* only for read/write requests */
uint64_t __attribute__((__aligned__(8))) id;
blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */
- struct blkif_request_segment seg[BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK];
+ struct blkif_request_segment seg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
};
struct blkif_x86_64_response {
uint64_t __attribute__((__aligned__(8))) id;
@@ -114,7 +114,7 @@ enum blkif_protocol {
static void inline blkif_get_x86_32_req(blkif_request_t *dst, blkif_x86_32_request_t *src)
{
- int i, n = BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK;
+ int i, n = BLKIF_MAX_SEGMENTS_PER_REQUEST;
dst->operation = src->operation;
dst->nr_segments = src->nr_segments;
dst->handle = src->handle;
@@ -129,7 +129,7 @@ static void inline blkif_get_x86_32_req(blkif_request_t *dst, blkif_x86_32_reque
static void inline blkif_get_x86_64_req(blkif_request_t *dst, blkif_x86_64_request_t *src)
{
- int i, n = BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK;
+ int i, n = BLKIF_MAX_SEGMENTS_PER_REQUEST;
dst->operation = src->operation;
dst->nr_segments = src->nr_segments;
dst->handle = src->handle;
diff --git a/sys/xen/interface/io/blkif.h b/sys/xen/interface/io/blkif.h
index 9155662..b725776 100644
--- a/sys/xen/interface/io/blkif.h
+++ b/sys/xen/interface/io/blkif.h
@@ -457,21 +457,9 @@
#define BLKIF_OP_DISCARD 5
/*
- * Maximum scatter/gather segments associated with a request header block.
- * This is carefully chosen so that sizeof(blkif_ring_t) <= PAGE_SIZE.
- * NB. This could be 12 if the ring indexes weren't stored in the same page.
- */
-#define BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK 11
-
-/*
- * Maximum scatter/gather segments associated with a segment block.
- */
-#define BLKIF_MAX_SEGMENTS_PER_SEGMENT_BLOCK 14
-
-/*
* Maximum scatter/gather segments per request (header + segment blocks).
*/
-#define BLKIF_MAX_SEGMENTS_PER_REQUEST 255
+#define BLKIF_MAX_SEGMENTS_PER_REQUEST 11
/*
* NB. first_sect and last_sect in blkif_request_segment, as well as
@@ -512,22 +500,11 @@ struct blkif_request {
blkif_vdev_t handle; /* only for read/write requests */
uint64_t id; /* private guest value, echoed in resp */
blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */
- blkif_request_segment_t seg[BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK];
+ blkif_request_segment_t seg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
};
typedef struct blkif_request blkif_request_t;
/*
- * A segment block is a ring request structure that contains only
- * segment data.
- *
- * sizeof(struct blkif_segment_block) <= sizeof(struct blkif_request)
- */
-struct blkif_segment_block {
- blkif_request_segment_t seg[BLKIF_MAX_SEGMENTS_PER_SEGMENT_BLOCK];
-};
-typedef struct blkif_segment_block blkif_segment_block_t;
-
-/*
* Cast to this structure when blkif_request.operation == BLKIF_OP_DISCARD
* sizeof(struct blkif_request_discard) <= sizeof(struct blkif_request)
*/
@@ -564,21 +541,6 @@ typedef struct blkif_response blkif_response_t;
*/
DEFINE_RING_TYPES(blkif, struct blkif_request, struct blkif_response);
-/*
- * Index to, and treat as a segment block, an entry in the ring.
- */
-#define BLKRING_GET_SEG_BLOCK(_r, _idx) \
- (((blkif_segment_block_t *)RING_GET_REQUEST(_r, _idx))->seg)
-
-/*
- * The number of ring request blocks required to handle an I/O
- * request containing _segs segments.
- */
-#define BLKIF_SEGS_TO_BLOCKS(_segs) \
- ((((_segs - BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK) \
- + (BLKIF_MAX_SEGMENTS_PER_SEGMENT_BLOCK - 1)) \
- / BLKIF_MAX_SEGMENTS_PER_SEGMENT_BLOCK) + /*header_block*/1)
-
#define VDISK_CDROM 0x1
#define VDISK_REMOVABLE 0x2
#define VDISK_READONLY 0x4
diff --git a/tests/Makefile b/tests/Makefile
index 12c1509..7fdc5d7 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -2,8 +2,8 @@
.include <bsd.own.mk>
-SUBDIR= etc
-SUBDIR= sys
+SUBDIR+= etc
+SUBDIR+= sys
TESTSDIR= ${TESTSBASE}
KYUAFILE= yes
diff --git a/tests/sys/kern/ptrace_test.c b/tests/sys/kern/ptrace_test.c
index 28b0592..a64262a 100644
--- a/tests/sys/kern/ptrace_test.c
+++ b/tests/sys/kern/ptrace_test.c
@@ -29,14 +29,38 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/ptrace.h>
+#include <sys/sysctl.h>
+#include <sys/user.h>
#include <sys/wait.h>
#include <errno.h>
#include <signal.h>
+#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <atf-c.h>
/*
+ * A variant of ATF_REQUIRE that is suitable for use in child
+ * processes. This only works if the parent process is tripped up by
+ * the early exit and fails some requirement itself.
+ */
+#define CHILD_REQUIRE(exp) do { \
+ if (!(exp)) \
+ child_fail_require(__FILE__, __LINE__, \
+ #exp " not met"); \
+ } while (0)
+
+static void __dead2
+child_fail_require(const char *file, int line, const char *str)
+{
+ char buf[128];
+
+ snprintf(buf, sizeof(buf), "%s:%d: %s\n", file, line, str);
+ write(2, buf, strlen(buf));
+ _exit(32);
+}
+
+/*
* Verify that a parent debugger process "sees" the exit of a debugged
* process exactly once when attached via PT_TRACE_ME.
*/
@@ -49,7 +73,7 @@ ATF_TC_BODY(ptrace__parent_wait_after_trace_me, tc)
ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
/* Child process. */
- ATF_REQUIRE(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
+ CHILD_REQUIRE(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
/* Trigger a stop. */
raise(SIGSTOP);
@@ -98,7 +122,7 @@ ATF_TC_BODY(ptrace__parent_wait_after_attach, tc)
close(cpipe[0]);
/* Wait for the parent to attach. */
- ATF_REQUIRE(read(cpipe[1], &c, sizeof(c)) == 0);
+ CHILD_REQUIRE(read(cpipe[1], &c, sizeof(c)) == 0);
exit(1);
}
@@ -133,11 +157,257 @@ ATF_TC_BODY(ptrace__parent_wait_after_attach, tc)
ATF_REQUIRE(errno == ECHILD);
}
+/*
+ * Verify that a parent process "sees" the exit of a debugged process only
+ * after the debugger has seen it.
+ */
+ATF_TC_WITHOUT_HEAD(ptrace__parent_sees_exit_after_child_debugger);
+ATF_TC_BODY(ptrace__parent_sees_exit_after_child_debugger, tc)
+{
+ pid_t child, debugger, wpid;
+ int cpipe[2], dpipe[2], status;
+ char c;
+
+ ATF_REQUIRE(pipe(cpipe) == 0);
+ ATF_REQUIRE((child = fork()) != -1);
+
+ if (child == 0) {
+ /* Child process. */
+ close(cpipe[0]);
+
+ /* Wait for parent to be ready. */
+ CHILD_REQUIRE(read(cpipe[1], &c, sizeof(c)) == sizeof(c));
+
+ exit(1);
+ }
+ close(cpipe[1]);
+
+ ATF_REQUIRE(pipe(dpipe) == 0);
+ ATF_REQUIRE((debugger = fork()) != -1);
+
+ if (debugger == 0) {
+ /* Debugger process. */
+ close(dpipe[0]);
+
+ CHILD_REQUIRE(ptrace(PT_ATTACH, child, NULL, 0) != -1);
+
+ wpid = waitpid(child, &status, 0);
+ CHILD_REQUIRE(wpid == child);
+ CHILD_REQUIRE(WIFSTOPPED(status));
+ CHILD_REQUIRE(WSTOPSIG(status) == SIGSTOP);
+
+ CHILD_REQUIRE(ptrace(PT_CONTINUE, child, (caddr_t)1, 0) != -1);
+
+ /* Signal parent that debugger is attached. */
+ CHILD_REQUIRE(write(dpipe[1], &c, sizeof(c)) == sizeof(c));
+
+ /* Wait for parent's failed wait. */
+ CHILD_REQUIRE(read(dpipe[1], &c, sizeof(c)) == 0);
+
+ wpid = waitpid(child, &status, 0);
+ CHILD_REQUIRE(wpid == child);
+ CHILD_REQUIRE(WIFEXITED(status));
+ CHILD_REQUIRE(WEXITSTATUS(status) == 1);
+
+ exit(0);
+ }
+ close(dpipe[1]);
+
+ /* Parent process. */
+
+ /* Wait for the debugger to attach to the child. */
+ ATF_REQUIRE(read(dpipe[0], &c, sizeof(c)) == sizeof(c));
+
+ /* Release the child. */
+ ATF_REQUIRE(write(cpipe[0], &c, sizeof(c)) == sizeof(c));
+ ATF_REQUIRE(read(cpipe[0], &c, sizeof(c)) == 0);
+ close(cpipe[0]);
+
+ /*
+ * Wait for the child to exit. This is kind of gross, but
+ * there is not a better way.
+ */
+ for (;;) {
+ struct kinfo_proc kp;
+ size_t len;
+ int mib[4];
+
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROC;
+ mib[2] = KERN_PROC_PID;
+ mib[3] = child;
+ len = sizeof(kp);
+ if (sysctl(mib, nitems(mib), &kp, &len, NULL, 0) == -1) {
+ /* The KERN_PROC_PID sysctl fails for zombies. */
+ ATF_REQUIRE(errno == ESRCH);
+ break;
+ }
+ usleep(5000);
+ }
+
+ /*
+ * This wait should return a pid of 0 to indicate no status to
+ * report. The parent should see the child as non-exited
+ * until the debugger sees the exit.
+ */
+ wpid = waitpid(child, &status, WNOHANG);
+ ATF_REQUIRE(wpid == 0);
+
+ /* Signal the debugger to wait for the child. */
+ close(dpipe[0]);
+
+ /* Wait for the debugger. */
+ wpid = waitpid(debugger, &status, 0);
+ ATF_REQUIRE(wpid == debugger);
+ ATF_REQUIRE(WIFEXITED(status));
+ ATF_REQUIRE(WEXITSTATUS(status) == 0);
+
+ /* The child process should now be ready. */
+ wpid = waitpid(child, &status, WNOHANG);
+ ATF_REQUIRE(wpid == child);
+ ATF_REQUIRE(WIFEXITED(status));
+ ATF_REQUIRE(WEXITSTATUS(status) == 1);
+}
+
+/*
+ * Verify that a parent process "sees" the exit of a debugged process
+ * only after a non-direct-child debugger has seen it. In particular,
+ * various wait() calls in the parent must avoid failing with ESRCH by
+ * checking the parent's orphan list for the debugee.
+ */
+ATF_TC_WITHOUT_HEAD(ptrace__parent_sees_exit_after_unrelated_debugger);
+ATF_TC_BODY(ptrace__parent_sees_exit_after_unrelated_debugger, tc)
+{
+ pid_t child, debugger, fpid, wpid;
+ int cpipe[2], dpipe[2], status;
+ char c;
+
+ ATF_REQUIRE(pipe(cpipe) == 0);
+ ATF_REQUIRE((child = fork()) != -1);
+
+ if (child == 0) {
+ /* Child process. */
+ close(cpipe[0]);
+
+ /* Wait for parent to be ready. */
+ CHILD_REQUIRE(read(cpipe[1], &c, sizeof(c)) == sizeof(c));
+
+ exit(1);
+ }
+ close(cpipe[1]);
+
+ ATF_REQUIRE(pipe(dpipe) == 0);
+ ATF_REQUIRE((debugger = fork()) != -1);
+
+ if (debugger == 0) {
+ /* Debugger parent. */
+
+ /*
+ * Fork again and drop the debugger parent so that the
+ * debugger is not a child of the main parent.
+ */
+ CHILD_REQUIRE((fpid = fork()) != -1);
+ if (fpid != 0)
+ exit(2);
+
+ /* Debugger process. */
+ close(dpipe[0]);
+
+ CHILD_REQUIRE(ptrace(PT_ATTACH, child, NULL, 0) != -1);
+
+ wpid = waitpid(child, &status, 0);
+ CHILD_REQUIRE(wpid == child);
+ CHILD_REQUIRE(WIFSTOPPED(status));
+ CHILD_REQUIRE(WSTOPSIG(status) == SIGSTOP);
+
+ CHILD_REQUIRE(ptrace(PT_CONTINUE, child, (caddr_t)1, 0) != -1);
+
+ /* Signal parent that debugger is attached. */
+ CHILD_REQUIRE(write(dpipe[1], &c, sizeof(c)) == sizeof(c));
+
+ /* Wait for parent's failed wait. */
+ CHILD_REQUIRE(read(dpipe[1], &c, sizeof(c)) == sizeof(c));
+
+ wpid = waitpid(child, &status, 0);
+ CHILD_REQUIRE(wpid == child);
+ CHILD_REQUIRE(WIFEXITED(status));
+ CHILD_REQUIRE(WEXITSTATUS(status) == 1);
+
+ exit(0);
+ }
+ close(dpipe[1]);
+
+ /* Parent process. */
+
+ /* Wait for the debugger parent process to exit. */
+ wpid = waitpid(debugger, &status, 0);
+ ATF_REQUIRE(wpid == debugger);
+ ATF_REQUIRE(WIFEXITED(status));
+ ATF_REQUIRE(WEXITSTATUS(status) == 2);
+
+ /* A WNOHANG wait here should see the non-exited child. */
+ wpid = waitpid(child, &status, WNOHANG);
+ ATF_REQUIRE(wpid == 0);
+
+ /* Wait for the debugger to attach to the child. */
+ ATF_REQUIRE(read(dpipe[0], &c, sizeof(c)) == sizeof(c));
+
+ /* Release the child. */
+ ATF_REQUIRE(write(cpipe[0], &c, sizeof(c)) == sizeof(c));
+ ATF_REQUIRE(read(cpipe[0], &c, sizeof(c)) == 0);
+ close(cpipe[0]);
+
+ /*
+ * Wait for the child to exit. This is kind of gross, but
+ * there is not a better way.
+ */
+ for (;;) {
+ struct kinfo_proc kp;
+ size_t len;
+ int mib[4];
+
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROC;
+ mib[2] = KERN_PROC_PID;
+ mib[3] = child;
+ len = sizeof(kp);
+ if (sysctl(mib, nitems(mib), &kp, &len, NULL, 0) == -1) {
+ /* The KERN_PROC_PID sysctl fails for zombies. */
+ ATF_REQUIRE(errno == ESRCH);
+ break;
+ }
+ usleep(5000);
+ }
+
+ /*
+ * This wait should return a pid of 0 to indicate no status to
+ * report. The parent should see the child as non-exited
+ * until the debugger sees the exit.
+ */
+ wpid = waitpid(child, &status, WNOHANG);
+ ATF_REQUIRE(wpid == 0);
+
+ /* Signal the debugger to wait for the child. */
+ ATF_REQUIRE(write(dpipe[0], &c, sizeof(c)) == sizeof(c));
+
+ /* Wait for the debugger. */
+ ATF_REQUIRE(read(dpipe[0], &c, sizeof(c)) == 0);
+ close(dpipe[0]);
+
+ /* The child process should now be ready. */
+ wpid = waitpid(child, &status, WNOHANG);
+ ATF_REQUIRE(wpid == child);
+ ATF_REQUIRE(WIFEXITED(status));
+ ATF_REQUIRE(WEXITSTATUS(status) == 1);
+}
+
ATF_TP_ADD_TCS(tp)
{
ATF_TP_ADD_TC(tp, ptrace__parent_wait_after_trace_me);
ATF_TP_ADD_TC(tp, ptrace__parent_wait_after_attach);
+ ATF_TP_ADD_TC(tp, ptrace__parent_sees_exit_after_child_debugger);
+ ATF_TP_ADD_TC(tp, ptrace__parent_sees_exit_after_unrelated_debugger);
return (atf_no_error());
}
diff --git a/tests/sys/pjdfstest/pjdfstest/Makefile b/tests/sys/pjdfstest/pjdfstest/Makefile
index c0e82a4..29bee82 100644
--- a/tests/sys/pjdfstest/pjdfstest/Makefile
+++ b/tests/sys/pjdfstest/pjdfstest/Makefile
@@ -8,7 +8,7 @@ BINDIR= ${TESTSBASE}/sys/pjdfstest
PROG= pjdfstest
MAN=
-CFLAGS= -D__OS_FreeBSD__ -DHAS_LCHMOD -DHAS_CHFLAGS -DHAS_FCHFLAGS
+CFLAGS+= -D__OS_FreeBSD__ -DHAS_LCHMOD -DHAS_CHFLAGS -DHAS_FCHFLAGS
CFLAGS+= -DHAS_CHFLAGSAT -DHAS_LCHFLAGS -DHAS_FREEBSD_ACL -DHAS_BINDAT
CFLAGS+= -DHAS_CONNECTAT
diff --git a/tools/build/Makefile.depend b/tools/build/Makefile.depend
index 57b7e10..d14a02b 100644
--- a/tools/build/Makefile.depend
+++ b/tools/build/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc
index ed39f7d..ae415a9 100644
--- a/tools/build/mk/OptionalObsoleteFiles.inc
+++ b/tools/build/mk/OptionalObsoleteFiles.inc
@@ -841,66 +841,66 @@ OLD_FILES+=usr/bin/clang++
OLD_FILES+=usr/bin/clang-cpp
OLD_FILES+=usr/bin/clang-tblgen
OLD_FILES+=usr/bin/tblgen
-OLD_FILES+=usr/lib/clang/3.6.0/include/__stddef_max_align_t.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/__wmmintrin_aes.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/__wmmintrin_pclmul.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/adxintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/altivec.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/ammintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/arm_acle.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/arm_neon.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/avx2intrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/avx512bwintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/avx512erintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/avx512fintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/avx512vlbwintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/avx512vlintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/avxintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/bmi2intrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/bmiintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/cpuid.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/emmintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/f16cintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/fma4intrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/fmaintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/ia32intrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/immintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/lzcntintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/mm3dnow.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/mm_malloc.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/mmintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/module.modulemap
-OLD_FILES+=usr/lib/clang/3.6.0/include/nmmintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/pmmintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/popcntintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/prfchwintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/rdseedintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/rtmintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/shaintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/smmintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/tbmintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/tmmintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/wmmintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/x86intrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/xmmintrin.h
-OLD_FILES+=usr/lib/clang/3.6.0/include/xopintrin.h
-OLD_DIRS+=usr/lib/clang/3.6.0/include
-OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.asan-i386.a
-OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.asan-x86_64.a
-OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.asan_cxx-i386.a
-OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.asan_cxx-x86_64.a
-OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.profile-arm.a
-OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.profile-i386.a
-OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.profile-x86_64.a
-OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.san-i386.a
-OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.san-x86_64.a
-OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.ubsan-i386.a
-OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.ubsan-x86_64.a
-OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.ubsan_cxx-i386.a
-OLD_FILES+=usr/lib/clang/3.6.0/lib/freebsd/libclang_rt.ubsan_cxx-x86_64.a
-OLD_DIRS+=usr/lib/clang/3.6.0/lib/freebsd
-OLD_DIRS+=usr/lib/clang/3.6.0/lib
-OLD_DIRS+=usr/lib/clang/3.6.0
+OLD_FILES+=usr/lib/clang/3.6.1/include/__stddef_max_align_t.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/__wmmintrin_aes.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/__wmmintrin_pclmul.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/adxintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/altivec.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/ammintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/arm_acle.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/arm_neon.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/avx2intrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/avx512bwintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/avx512erintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/avx512fintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/avx512vlbwintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/avx512vlintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/avxintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/bmi2intrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/bmiintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/cpuid.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/emmintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/f16cintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/fma4intrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/fmaintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/ia32intrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/immintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/lzcntintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/mm3dnow.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/mm_malloc.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/mmintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/module.modulemap
+OLD_FILES+=usr/lib/clang/3.6.1/include/nmmintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/pmmintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/popcntintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/prfchwintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/rdseedintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/rtmintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/shaintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/smmintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/tbmintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/tmmintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/wmmintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/x86intrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/xmmintrin.h
+OLD_FILES+=usr/lib/clang/3.6.1/include/xopintrin.h
+OLD_DIRS+=usr/lib/clang/3.6.1/include
+OLD_FILES+=usr/lib/clang/3.6.1/lib/freebsd/libclang_rt.asan-i386.a
+OLD_FILES+=usr/lib/clang/3.6.1/lib/freebsd/libclang_rt.asan-x86_64.a
+OLD_FILES+=usr/lib/clang/3.6.1/lib/freebsd/libclang_rt.asan_cxx-i386.a
+OLD_FILES+=usr/lib/clang/3.6.1/lib/freebsd/libclang_rt.asan_cxx-x86_64.a
+OLD_FILES+=usr/lib/clang/3.6.1/lib/freebsd/libclang_rt.profile-arm.a
+OLD_FILES+=usr/lib/clang/3.6.1/lib/freebsd/libclang_rt.profile-i386.a
+OLD_FILES+=usr/lib/clang/3.6.1/lib/freebsd/libclang_rt.profile-x86_64.a
+OLD_FILES+=usr/lib/clang/3.6.1/lib/freebsd/libclang_rt.san-i386.a
+OLD_FILES+=usr/lib/clang/3.6.1/lib/freebsd/libclang_rt.san-x86_64.a
+OLD_FILES+=usr/lib/clang/3.6.1/lib/freebsd/libclang_rt.ubsan-i386.a
+OLD_FILES+=usr/lib/clang/3.6.1/lib/freebsd/libclang_rt.ubsan-x86_64.a
+OLD_FILES+=usr/lib/clang/3.6.1/lib/freebsd/libclang_rt.ubsan_cxx-i386.a
+OLD_FILES+=usr/lib/clang/3.6.1/lib/freebsd/libclang_rt.ubsan_cxx-x86_64.a
+OLD_DIRS+=usr/lib/clang/3.6.1/lib/freebsd
+OLD_DIRS+=usr/lib/clang/3.6.1/lib
+OLD_DIRS+=usr/lib/clang/3.6.1
OLD_DIRS+=usr/lib/clang
OLD_FILES+=usr/share/doc/llvm/clang/LICENSE.TXT
OLD_DIRS+=usr/share/doc/llvm/clang
diff --git a/tools/build/options/WITHOUT_MANDOCDB b/tools/build/options/WITHOUT_MANDOCDB
new file mode 100644
index 0000000..7d7ec21
--- /dev/null
+++ b/tools/build/options/WITHOUT_MANDOCDB
@@ -0,0 +1,6 @@
+.\" $FreeBSD$
+Use the
+.Xr mandoc 1
+version of
+.Xr makewhatis 8
+database and utilities.
diff --git a/tools/bus_space/C/Makefile b/tools/bus_space/C/Makefile
index 9d767e8..5fd64c7 100644
--- a/tools/bus_space/C/Makefile
+++ b/tools/bus_space/C/Makefile
@@ -1,8 +1,9 @@
# $FreeBSD$
-LIB= bus_space
+LIB= bus
SHLIB_MAJOR= 0
SRCS= lang.c
+INCS= libbus.h
CFLAGS+= -I${.CURDIR}/..
diff --git a/tools/bus_space/C/lang.c b/tools/bus_space/C/lang.c
index 6408343..345957e 100644
--- a/tools/bus_space/C/lang.c
+++ b/tools/bus_space/C/lang.c
@@ -30,19 +30,20 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <errno.h>
-#include "bus_space.h"
-#include "libbus_space.h"
+#include "bus.h"
+#include "busdma.h"
+#include "libbus.h"
-int
-bus_space_read_1(int rid, long ofs)
+int16_t
+bus_read_1(int rid, long ofs)
{
uint8_t val;
return ((!bs_read(rid, ofs, &val, sizeof(val))) ? -1 : (int)val);
}
-int
-bus_space_read_2(int rid, long ofs)
+int32_t
+bus_read_2(int rid, long ofs)
{
uint16_t val;
@@ -50,7 +51,7 @@ bus_space_read_2(int rid, long ofs)
}
int64_t
-bus_space_read_4(int rid, long ofs)
+bus_read_4(int rid, long ofs)
{
uint32_t val;
@@ -58,43 +59,136 @@ bus_space_read_4(int rid, long ofs)
}
int
-bus_space_write_1(int rid, long ofs, uint8_t val)
+bus_write_1(int rid, long ofs, uint8_t val)
{
return ((!bs_write(rid, ofs, &val, sizeof(val))) ? errno : 0);
}
int
-bus_space_write_2(int rid, long ofs, uint16_t val)
+bus_write_2(int rid, long ofs, uint16_t val)
{
return ((!bs_write(rid, ofs, &val, sizeof(val))) ? errno : 0);
}
int
-bus_space_write_4(int rid, long ofs, uint32_t val)
+bus_write_4(int rid, long ofs, uint32_t val)
{
return ((!bs_write(rid, ofs, &val, sizeof(val))) ? errno : 0);
}
int
-bus_space_map(const char *dev)
+bus_map(const char *dev)
{
return (bs_map(dev));
}
int
-bus_space_unmap(int rid)
+bus_unmap(int rid)
{
return ((!bs_unmap(rid)) ? errno : 0);
}
int
-bus_space_subregion(int rid, long ofs, long sz)
+bus_subregion(int rid, long ofs, long sz)
{
return (bs_subregion(rid, ofs, sz));
}
+
+int
+busdma_tag_create(const char *dev, bus_addr_t align, bus_addr_t bndry,
+ bus_addr_t maxaddr, bus_size_t maxsz, u_int nsegs, bus_size_t maxsegsz,
+ u_int datarate, u_int flags, busdma_tag_t *out_p)
+{
+ int res;
+
+ res = bd_tag_create(dev, align, bndry, maxaddr, maxsz, nsegs, maxsegsz,
+ datarate, flags);
+ if (res == -1)
+ return (errno);
+ *out_p = res;
+ return (0);
+}
+
+int
+busdma_tag_derive(busdma_tag_t tag, bus_addr_t align, bus_addr_t bndry,
+ bus_addr_t maxaddr, bus_size_t maxsz, u_int nsegs, bus_size_t maxsegsz,
+ u_int datarate, u_int flags, busdma_tag_t *out_p)
+{
+ int res;
+
+ res = bd_tag_derive(tag, align, bndry, maxaddr, maxsz, nsegs, maxsegsz,
+ datarate, flags);
+ if (res == -1)
+ return (errno);
+ *out_p = res;
+ return (0);
+}
+
+int
+busdma_tag_destroy(busdma_tag_t tag)
+{
+
+ return (bd_tag_destroy(tag));
+}
+
+int
+busdma_mem_alloc(busdma_tag_t tag, u_int flags, busdma_md_t *out_p)
+{
+ int res;
+
+ res = bd_mem_alloc(tag, flags);
+ if (res == -1)
+ return (errno);
+ *out_p = res;
+ return (0);
+}
+
+int
+busdma_mem_free(busdma_md_t md)
+{
+
+ return (bd_mem_free(md));
+}
+
+busdma_seg_t
+busdma_md_first_seg(busdma_md_t md, int space)
+{
+ busdma_seg_t seg;
+
+ seg = bd_md_first_seg(md, space);
+ return (seg);
+}
+
+busdma_seg_t
+busdma_md_next_seg(busdma_md_t md, busdma_seg_t seg)
+{
+
+ seg = bd_md_next_seg(md, seg);
+ return (seg);
+}
+
+bus_addr_t
+busdma_seg_get_addr(busdma_seg_t seg)
+{
+ u_long addr;
+ int error;
+
+ error = bd_seg_get_addr(seg, &addr);
+ return ((error) ? ~0UL : addr);
+}
+
+bus_size_t
+busdma_seg_get_size(busdma_seg_t seg)
+{
+ u_long size;
+ int error;
+
+ error = bd_seg_get_size(seg, &size);
+ return ((error) ? ~0UL : size);
+}
diff --git a/tools/bus_space/C/libbus.h b/tools/bus_space/C/libbus.h
new file mode 100644
index 0000000..76ab402
--- /dev/null
+++ b/tools/bus_space/C/libbus.h
@@ -0,0 +1,71 @@
+/*-
+ * Copyright (c) 2014, 2015 Marcel Moolenaar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _LIBBUS_SPACE_H_
+#define _LIBBUS_SPACE_H_
+
+int bus_map(const char *dev);
+int16_t bus_read_1(int rid, long ofs);
+int32_t bus_read_2(int rid, long ofs);
+int64_t bus_read_4(int rid, long ofs);
+int bus_subregion(int rid, long ofs, long sz);
+int bus_unmap(int rid);
+int bus_write_1(int rid, long ofs, uint8_t val);
+int bus_write_2(int rid, long ofs, uint16_t val);
+int bus_write_4(int rid, long ofs, uint32_t val);
+
+typedef unsigned long bus_addr_t;
+typedef unsigned long bus_size_t;
+typedef int busdma_tag_t;
+typedef int busdma_md_t;
+typedef int busdma_seg_t;
+
+int busdma_tag_create(const char *dev, bus_addr_t align, bus_addr_t bndry,
+ bus_addr_t maxaddr, bus_size_t maxsz, u_int nsegs,
+ bus_size_t maxsegsz, u_int datarate, u_int flags,
+ busdma_tag_t *out_p);
+int busdma_tag_derive(busdma_tag_t tag, bus_addr_t align, bus_addr_t bndry,
+ bus_addr_t maxaddr, bus_size_t maxsz, u_int nsegs,
+ bus_size_t maxsegsz, u_int datarate, u_int flags,
+ busdma_tag_t *out_p);
+int busdma_tag_destroy(busdma_tag_t tag);
+
+int busdma_mem_alloc(busdma_tag_t tag, u_int flags, busdma_md_t *out_p);
+int busdma_mem_free(busdma_md_t md);
+
+#define BUSDMA_MD_BUS_SPACE 0
+#define BUSDMA_MD_PHYS_SPACE 1
+#define BUSDMA_MD_VIRT_SPACE 2
+
+int busdma_md_first_seg(busdma_md_t, int space);
+int busdma_md_next_seg(busdma_md_t, busdma_seg_t seg);
+
+bus_addr_t busdma_seg_get_addr(busdma_seg_t seg);
+bus_size_t busdma_seg_get_size(busdma_seg_t seg);
+
+#endif /* _LIBBUS_SPACE_H_ */
diff --git a/tools/bus_space/Makefile.inc b/tools/bus_space/Makefile.inc
index a448e33..080689a 100644
--- a/tools/bus_space/Makefile.inc
+++ b/tools/bus_space/Makefile.inc
@@ -1,4 +1,4 @@
# $FreeBSD$
.PATH: ${.CURDIR}/..
-SRCS+= bus_space.c
+SRCS+= bus.c busdma.c
diff --git a/tools/bus_space/Python/Makefile b/tools/bus_space/Python/Makefile
index 8e38ed3..5bc9b77 100644
--- a/tools/bus_space/Python/Makefile
+++ b/tools/bus_space/Python/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-SHLIB_NAME= bus_space.so
+SHLIB_NAME= bus.so
SRCS= lang.c
CFLAGS+= -I${.CURDIR}/.. -I/usr/local/include/python2.7
diff --git a/tools/bus_space/Python/lang.c b/tools/bus_space/Python/lang.c
index f328a77..2127df5 100644
--- a/tools/bus_space/Python/lang.c
+++ b/tools/bus_space/Python/lang.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014 Marcel Moolenaar
+ * Copyright (c) 2014, 2015 Marcel Moolenaar
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,7 +29,8 @@ __FBSDID("$FreeBSD$");
#include <Python.h>
-#include "bus_space.h"
+#include "bus.h"
+#include "busdma.h"
static PyObject *
bus_read_1(PyObject *self, PyObject *args)
@@ -173,7 +174,154 @@ bus_subregion(PyObject *self, PyObject *args)
return (Py_BuildValue("i", rid));
}
-static PyMethodDef bus_space_methods[] = {
+static PyObject *
+busdma_tag_create(PyObject *self, PyObject *args)
+{
+ char *dev;
+ u_long align, bndry, maxaddr, maxsz, maxsegsz;
+ u_int nsegs, datarate, flags;
+ int tid;
+
+ if (!PyArg_ParseTuple(args, "skkkkIkII", &dev, &align, &bndry,
+ &maxaddr, &maxsz, &nsegs, &maxsegsz, &datarate, &flags))
+ return (NULL);
+ tid = bd_tag_create(dev, align, bndry, maxaddr, maxsz, nsegs,
+ maxsegsz, datarate, flags);
+ if (tid == -1) {
+ PyErr_SetString(PyExc_IOError, strerror(errno));
+ return (NULL);
+ }
+ return (Py_BuildValue("i", tid));
+}
+
+static PyObject *
+busdma_tag_derive(PyObject *self, PyObject *args)
+{
+ u_long align, bndry, maxaddr, maxsz, maxsegsz;
+ u_int nsegs, datarate, flags;
+ int ptid, tid;
+
+ if (!PyArg_ParseTuple(args, "ikkkkIkII", &ptid, &align, &bndry,
+ &maxaddr, &maxsz, &nsegs, &maxsegsz, &datarate, &flags))
+ return (NULL);
+ tid = bd_tag_derive(ptid, align, bndry, maxaddr, maxsz, nsegs,
+ maxsegsz, datarate, flags);
+ if (tid == -1) {
+ PyErr_SetString(PyExc_IOError, strerror(errno));
+ return (NULL);
+ }
+ return (Py_BuildValue("i", tid));
+}
+
+static PyObject *
+busdma_tag_destroy(PyObject *self, PyObject *args)
+{
+ int error, tid;
+
+ if (!PyArg_ParseTuple(args, "i", &tid))
+ return (NULL);
+ error = bd_tag_destroy(tid);
+ if (error) {
+ PyErr_SetString(PyExc_IOError, strerror(error));
+ return (NULL);
+ }
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+busdma_mem_alloc(PyObject *self, PyObject *args)
+{
+ u_int flags;
+ int mdid, tid;
+
+ if (!PyArg_ParseTuple(args, "iI", &tid, &flags))
+ return (NULL);
+ mdid = bd_mem_alloc(tid, flags);
+ if (mdid == -1) {
+ PyErr_SetString(PyExc_IOError, strerror(errno));
+ return (NULL);
+ }
+ return (Py_BuildValue("i", mdid));
+}
+
+static PyObject *
+busdma_mem_free(PyObject *self, PyObject *args)
+{
+ int error, mdid;
+
+ if (!PyArg_ParseTuple(args, "i", &mdid))
+ return (NULL);
+ error = bd_mem_free(mdid);
+ if (error) {
+ PyErr_SetString(PyExc_IOError, strerror(error));
+ return (NULL);
+ }
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+busdma_md_first_seg(PyObject *self, PyObject *args)
+{
+ int error, mdid, sid, what;
+
+ if (!PyArg_ParseTuple(args, "ii", &mdid, &what))
+ return (NULL);
+ sid = bd_md_first_seg(mdid, what);
+ if (sid == -1) {
+ PyErr_SetString(PyExc_IOError, strerror(errno));
+ return (NULL);
+ }
+ return (Py_BuildValue("i", sid));
+}
+
+static PyObject *
+busdma_md_next_seg(PyObject *self, PyObject *args)
+{
+ int error, mdid, sid;
+
+ if (!PyArg_ParseTuple(args, "ii", &mdid, &sid))
+ return (NULL);
+ sid = bd_md_next_seg(mdid, sid);
+ if (sid == -1) {
+ PyErr_SetString(PyExc_IOError, strerror(errno));
+ return (NULL);
+ }
+ return (Py_BuildValue("i", sid));
+}
+
+static PyObject *
+busdma_seg_get_addr(PyObject *self, PyObject *args)
+{
+ u_long addr;
+ int error, sid;
+
+ if (!PyArg_ParseTuple(args, "i", &sid))
+ return (NULL);
+ error = bd_seg_get_addr(sid, &addr);
+ if (error) {
+ PyErr_SetString(PyExc_IOError, strerror(error));
+ return (NULL);
+ }
+ return (Py_BuildValue("k", addr));
+}
+
+static PyObject *
+busdma_seg_get_size(PyObject *self, PyObject *args)
+{
+ u_long size;
+ int error, sid;
+
+ if (!PyArg_ParseTuple(args, "i", &sid))
+ return (NULL);
+ error = bd_seg_get_size(sid, &size);
+ if (error) {
+ PyErr_SetString(PyExc_IOError, strerror(error));
+ return (NULL);
+ }
+ return (Py_BuildValue("k", size));
+}
+
+static PyMethodDef bus_methods[] = {
{ "read_1", bus_read_1, METH_VARARGS, "Read a 1-byte data item." },
{ "read_2", bus_read_2, METH_VARARGS, "Read a 2-byte data item." },
{ "read_4", bus_read_4, METH_VARARGS, "Read a 4-byte data item." },
@@ -192,9 +340,33 @@ static PyMethodDef bus_space_methods[] = {
{ NULL, NULL, 0, NULL }
};
+static PyMethodDef busdma_methods[] = {
+ { "tag_create", busdma_tag_create, METH_VARARGS,
+ "Create a root tag." },
+ { "tag_derive", busdma_tag_derive, METH_VARARGS,
+ "Derive a child tag." },
+ { "tag_destroy", busdma_tag_destroy, METH_VARARGS,
+ "Destroy a tag." },
+ { "mem_alloc", busdma_mem_alloc, METH_VARARGS,
+ "Allocate memory according to the DMA constraints." },
+ { "mem_free", busdma_mem_free, METH_VARARGS,
+ "Free allocated memory." },
+
+ { "md_first_seg", busdma_md_first_seg, METH_VARARGS,
+ "Return first segment in one of the segment lists." },
+ { "md_next_seg", busdma_md_next_seg, METH_VARARGS,
+ "Return next segment in the segment list." },
+ { "seg_get_addr", busdma_seg_get_addr, METH_VARARGS,
+ "Return the address of the segment." },
+ { "seg_get_size", busdma_seg_get_size, METH_VARARGS,
+ "Return the size of the segment." },
+ { NULL, NULL, 0, NULL }
+};
+
PyMODINIT_FUNC
-initbus_space(void)
+initbus(void)
{
- Py_InitModule("bus_space", bus_space_methods);
+ Py_InitModule("bus", bus_methods);
+ Py_InitModule("busdma", busdma_methods);
}
diff --git a/tools/bus_space/bus_space.c b/tools/bus_space/bus.c
index 260222c..01b7693 100644
--- a/tools/bus_space/bus_space.c
+++ b/tools/bus_space/bus.c
@@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <unistd.h>
-#include "bus_space.h"
+#include "bus.h"
#include "../../sys/dev/proto/proto_dev.h"
diff --git a/tools/bus_space/bus_space.h b/tools/bus_space/bus.h
index d347106..d347106 100644
--- a/tools/bus_space/bus_space.h
+++ b/tools/bus_space/bus.h
diff --git a/tools/bus_space/busdma.c b/tools/bus_space/busdma.c
new file mode 100644
index 0000000..e1e5a00
--- /dev/null
+++ b/tools/bus_space/busdma.c
@@ -0,0 +1,437 @@
+/*-
+ * Copyright (c) 2015 Marcel Moolenaar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <assert.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "busdma.h"
+
+#include "../../sys/dev/proto/proto_dev.h"
+
+struct obj {
+ int oid;
+ u_int type;
+#define OBJ_TYPE_NONE 0
+#define OBJ_TYPE_TAG 1
+#define OBJ_TYPE_MD 2
+#define OBJ_TYPE_SEG 3
+ u_int refcnt;
+ int fd;
+ struct obj *parent;
+ u_long key;
+ union {
+ struct {
+ unsigned long align;
+ unsigned long bndry;
+ unsigned long maxaddr;
+ unsigned long maxsz;
+ unsigned long maxsegsz;
+ unsigned long nsegs;
+ unsigned long datarate;
+ } tag;
+ struct {
+ struct obj *seg[3];
+ int nsegs[3];
+#define BUSDMA_MD_BUS 0
+#define BUSDMA_MD_PHYS 1
+#define BUSDMA_MD_VIRT 2
+ } md;
+ struct {
+ struct obj *next;
+ unsigned long address;
+ unsigned long size;
+ } seg;
+ } u;
+};
+
+static struct obj **oidtbl = NULL;
+static int noids = 0;
+
+static struct obj *
+obj_alloc(u_int type)
+{
+ struct obj **newtbl, *obj;
+ int oid;
+
+ obj = calloc(1, sizeof(struct obj));
+ obj->type = type;
+
+ for (oid = 0; oid < noids; oid++) {
+ if (oidtbl[oid] == 0)
+ break;
+ }
+ if (oid == noids) {
+ newtbl = realloc(oidtbl, sizeof(struct obj *) * (noids + 1));
+ if (newtbl == NULL) {
+ free(obj);
+ return (NULL);
+ }
+ oidtbl = newtbl;
+ noids++;
+ }
+ oidtbl[oid] = obj;
+ obj->oid = oid;
+ return (obj);
+}
+
+static int
+obj_free(struct obj *obj)
+{
+
+ oidtbl[obj->oid] = NULL;
+ free(obj);
+ return (0);
+}
+
+static struct obj *
+obj_lookup(int oid, u_int type)
+{
+ struct obj *obj;
+
+ if (oid < 0 || oid >= noids) {
+ errno = EINVAL;
+ return (NULL);
+ }
+ obj = oidtbl[oid];
+ if (obj->refcnt == 0) {
+ errno = ENXIO;
+ return (NULL);
+ }
+ if (type != OBJ_TYPE_NONE && obj->type != type) {
+ errno = ENODEV;
+ return (NULL);
+ }
+ return (obj);
+}
+
+struct obj *
+bd_tag_new(struct obj *ptag, int fd, u_long align, u_long bndry,
+ u_long maxaddr, u_long maxsz, u_int nsegs, u_long maxsegsz,
+ u_int datarate, u_int flags)
+{
+ struct proto_ioc_busdma ioc;
+ struct obj *tag;
+
+ tag = obj_alloc(OBJ_TYPE_TAG);
+ if (tag == NULL)
+ return (NULL);
+
+ memset(&ioc, 0, sizeof(ioc));
+ ioc.request = (ptag != NULL) ? PROTO_IOC_BUSDMA_TAG_DERIVE :
+ PROTO_IOC_BUSDMA_TAG_CREATE;
+ ioc.key = (ptag != NULL) ? ptag->key : 0;
+ ioc.u.tag.align = align;
+ ioc.u.tag.bndry = bndry;
+ ioc.u.tag.maxaddr = maxaddr;
+ ioc.u.tag.maxsz = maxsz;
+ ioc.u.tag.nsegs = nsegs;
+ ioc.u.tag.maxsegsz = maxsegsz;
+ ioc.u.tag.datarate = datarate;
+ ioc.u.tag.flags = flags;
+ if (ioctl(fd, PROTO_IOC_BUSDMA, &ioc) == -1) {
+ obj_free(tag);
+ return (NULL);
+ }
+ tag->refcnt = 1;
+ tag->fd = fd;
+ tag->parent = ptag;
+ tag->key = ioc.result;
+ tag->u.tag.align = ioc.u.tag.align;
+ tag->u.tag.bndry = ioc.u.tag.bndry;
+ tag->u.tag.maxaddr = ioc.u.tag.maxaddr;
+ tag->u.tag.maxsz = ioc.u.tag.maxsz;
+ tag->u.tag.maxsegsz = ioc.u.tag.maxsegsz;
+ tag->u.tag.nsegs = ioc.u.tag.nsegs;
+ tag->u.tag.datarate = ioc.u.tag.datarate;
+ return (tag);
+}
+
+int
+bd_tag_create(const char *dev, u_long align, u_long bndry, u_long maxaddr,
+ u_long maxsz, u_int nsegs, u_long maxsegsz, u_int datarate, u_int flags)
+{
+ struct obj *tag;
+ int fd;
+
+ fd = open(dev, O_RDWR);
+ if (fd == -1)
+ return (-1);
+
+ tag = bd_tag_new(NULL, fd, align, bndry, maxaddr, maxsz, nsegs,
+ maxsegsz, datarate, flags);
+ if (tag == NULL) {
+ close(fd);
+ return (-1);
+ }
+ return (tag->oid);
+}
+
+int
+bd_tag_derive(int ptid, u_long align, u_long bndry, u_long maxaddr,
+ u_long maxsz, u_int nsegs, u_long maxsegsz, u_int datarate, u_int flags)
+{
+ struct obj *ptag, *tag;
+
+ ptag = obj_lookup(ptid, OBJ_TYPE_TAG);
+ if (ptag == NULL)
+ return (-1);
+
+ tag = bd_tag_new(ptag, ptag->fd, align, bndry, maxaddr, maxsz, nsegs,
+ maxsegsz, datarate, flags);
+ if (tag == NULL)
+ return (-1);
+ ptag->refcnt++;
+ return (tag->oid);
+}
+
+int
+bd_tag_destroy(int tid)
+{
+ struct proto_ioc_busdma ioc;
+ struct obj *ptag, *tag;
+
+ tag = obj_lookup(tid, OBJ_TYPE_TAG);
+ if (tag == NULL)
+ return (errno);
+ if (tag->refcnt > 1)
+ return (EBUSY);
+
+ memset(&ioc, 0, sizeof(ioc));
+ ioc.request = PROTO_IOC_BUSDMA_TAG_DESTROY;
+ ioc.key = tag->key;
+ if (ioctl(tag->fd, PROTO_IOC_BUSDMA, &ioc) == -1)
+ return (errno);
+
+ if (tag->parent != NULL)
+ tag->parent->refcnt--;
+ else
+ close(tag->fd);
+ obj_free(tag);
+ return (0);
+}
+
+int
+bd_mem_alloc(int tid, u_int flags)
+{
+ struct proto_ioc_busdma ioc;
+ struct obj *md, *tag;
+ struct obj *bseg, *pseg, *vseg;
+
+ tag = obj_lookup(tid, OBJ_TYPE_TAG);
+ if (tag == NULL)
+ return (-1);
+
+ md = obj_alloc(OBJ_TYPE_MD);
+ if (md == NULL)
+ return (-1);
+
+ memset(&ioc, 0, sizeof(ioc));
+ ioc.request = PROTO_IOC_BUSDMA_MEM_ALLOC;
+ ioc.u.mem.tag = tag->key;
+ ioc.u.mem.flags = flags;
+ if (ioctl(tag->fd, PROTO_IOC_BUSDMA, &ioc) == -1) {
+ obj_free(md);
+ return (-1);
+ }
+
+ md->refcnt = 1;
+ md->fd = tag->fd;
+ md->parent = tag;
+ tag->refcnt++;
+ md->key = ioc.result;
+
+ /* XXX we need to support multiple segments */
+ assert(ioc.u.mem.phys_nsegs == 1);
+ assert(ioc.u.mem.bus_nsegs == 1);
+
+ bseg = pseg = vseg = NULL;
+
+ bseg = obj_alloc(OBJ_TYPE_SEG);
+ if (bseg == NULL)
+ goto fail;
+ bseg->refcnt = 1;
+ bseg->parent = md;
+ bseg->u.seg.address = ioc.u.mem.bus_addr;
+ bseg->u.seg.size = tag->u.tag.maxsz;
+ md->u.md.seg[BUSDMA_MD_BUS] = bseg;
+ md->u.md.nsegs[BUSDMA_MD_BUS] = ioc.u.mem.bus_nsegs;
+
+ pseg = obj_alloc(OBJ_TYPE_SEG);
+ if (pseg == NULL)
+ goto fail;
+ pseg->refcnt = 1;
+ pseg->parent = md;
+ pseg->u.seg.address = ioc.u.mem.phys_addr;
+ pseg->u.seg.size = tag->u.tag.maxsz;
+ md->u.md.seg[BUSDMA_MD_PHYS] = pseg;
+ md->u.md.nsegs[BUSDMA_MD_PHYS] = ioc.u.mem.phys_nsegs;
+
+ vseg = obj_alloc(OBJ_TYPE_SEG);
+ if (vseg == NULL)
+ goto fail;
+ vseg->refcnt = 1;
+ vseg->parent = md;
+ vseg->u.seg.address = (uintptr_t)mmap(NULL, pseg->u.seg.size,
+ PROT_READ | PROT_WRITE, MAP_NOCORE | MAP_SHARED, md->fd,
+ pseg->u.seg.address);
+ if (vseg->u.seg.address == (uintptr_t)MAP_FAILED)
+ goto fail;
+ vseg->u.seg.size = pseg->u.seg.size;
+ md->u.md.seg[BUSDMA_MD_VIRT] = vseg;
+ md->u.md.nsegs[BUSDMA_MD_VIRT] = 1;
+
+ return (md->oid);
+
+ fail:
+ if (vseg != NULL)
+ obj_free(vseg);
+ if (pseg != NULL)
+ obj_free(pseg);
+ if (bseg != NULL)
+ obj_free(bseg);
+ memset(&ioc, 0, sizeof(ioc));
+ ioc.request = PROTO_IOC_BUSDMA_MEM_FREE;
+ ioc.key = md->key;
+ ioctl(md->fd, PROTO_IOC_BUSDMA, &ioc);
+ md->parent->refcnt--;
+ obj_free(md);
+ return (-1);
+}
+
+int
+bd_mem_free(int mdid)
+{
+ struct proto_ioc_busdma ioc;
+ struct obj *md, *seg, *seg0;
+
+ md = obj_lookup(mdid, OBJ_TYPE_MD);
+ if (md == NULL)
+ return (errno);
+
+ for (seg = md->u.md.seg[BUSDMA_MD_VIRT]; seg != NULL; seg = seg0) {
+ munmap((void *)seg->u.seg.address, seg->u.seg.size);
+ seg0 = seg->u.seg.next;
+ obj_free(seg);
+ }
+ for (seg = md->u.md.seg[BUSDMA_MD_PHYS]; seg != NULL; seg = seg0) {
+ seg0 = seg->u.seg.next;
+ obj_free(seg);
+ }
+ for (seg = md->u.md.seg[BUSDMA_MD_BUS]; seg != NULL; seg = seg0) {
+ seg0 = seg->u.seg.next;
+ obj_free(seg);
+ }
+ memset(&ioc, 0, sizeof(ioc));
+ ioc.request = PROTO_IOC_BUSDMA_MEM_FREE;
+ ioc.key = md->key;
+ if (ioctl(md->fd, PROTO_IOC_BUSDMA, &ioc) == -1)
+ return (errno);
+
+ md->parent->refcnt--;
+ obj_free(md);
+ return (0);
+}
+
+int
+bd_md_first_seg(int mdid, int space)
+{
+ struct obj *md, *seg;
+
+ md = obj_lookup(mdid, OBJ_TYPE_MD);
+ if (md == NULL)
+ return (-1);
+
+ if (space != BUSDMA_MD_BUS && space != BUSDMA_MD_PHYS &&
+ space != BUSDMA_MD_VIRT) {
+ errno = EINVAL;
+ return (-1);
+ }
+ seg = md->u.md.seg[space];
+ if (seg == NULL) {
+ errno = ENXIO;
+ return (-1);
+ }
+ return (seg->oid);
+}
+
+int
+bd_md_next_seg(int mdid, int sid)
+{
+ struct obj *seg;
+
+ seg = obj_lookup(sid, OBJ_TYPE_SEG);
+ if (seg == NULL)
+ return (-1);
+
+ seg = seg->u.seg.next;
+ if (seg == NULL) {
+ errno = ENXIO;
+ return (-1);
+ }
+ return (seg->oid);
+}
+
+int
+bd_seg_get_addr(int sid, u_long *addr_p)
+{
+ struct obj *seg;
+
+ if (addr_p == NULL)
+ return (EINVAL);
+
+ seg = obj_lookup(sid, OBJ_TYPE_SEG);
+ if (seg == NULL)
+ return (errno);
+
+ *addr_p = seg->u.seg.address;
+ return (0);
+}
+
+int
+bd_seg_get_size(int sid, u_long *size_p)
+{
+ struct obj *seg;
+
+ if (size_p == NULL)
+ return (EINVAL);
+
+ seg = obj_lookup(sid, OBJ_TYPE_SEG);
+ if (seg == NULL)
+ return (errno);
+
+ *size_p = seg->u.seg.size;
+ return (0);
+}
diff --git a/tools/bus_space/C/libbus_space.h b/tools/bus_space/busdma.h
index 3e8860f..7394b26 100644
--- a/tools/bus_space/C/libbus_space.h
+++ b/tools/bus_space/busdma.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014 Marcel Moolenaar
+ * Copyright (c) 2015 Marcel Moolenaar
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,17 +26,24 @@
* $FreeBSD$
*/
-#ifndef _LIBBUS_SPACE_H_
-#define _LIBBUS_SPACE_H_
+#ifndef _TOOLS_BUS_DMA_H_
+#define _TOOLS_BUS_DMA_H_
-int bus_space_map(const char *dev);
-int bus_space_read_1(int rid, long ofs);
-int bus_space_read_2(int rid, long ofs);
-int64_t bus_space_read_4(int rid, long ofs);
-int bus_space_subregion(int rid, long ofs, long sz);
-int bus_space_unmap(int rid);
-int bus_space_write_1(int rid, long ofs, uint8_t val);
-int bus_space_write_2(int rid, long ofs, uint16_t val);
-int bus_space_write_4(int rid, long ofs, uint32_t val);
+int bd_tag_create(const char *dev, u_long align, u_long bndry,
+ u_long maxaddr, u_long maxsz, u_int nsegs, u_long maxsegsz,
+ u_int datarate, u_int flags);
+int bd_tag_derive(int tid, u_long align, u_long bndry, u_long maxaddr,
+ u_long maxsz, u_int nsegs, u_long maxsegsz, u_int datarate,
+ u_int flags);
+int bd_tag_destroy(int tid);
-#endif /* _LIBBUS_SPACE_H_ */
+int bd_mem_alloc(int tid, u_int flags);
+int bd_mem_free(int mdid);
+
+int bd_md_first_seg(int mdid, int what);
+int bd_md_next_seg(int mdid, int sid);
+
+int bd_seg_get_addr(int sid, u_long *);
+int bd_seg_get_size(int sid, u_long *);
+
+#endif /* _TOOLS_BUS_DMA_H_ */
diff --git a/tools/regression/file/closefrom/Makefile b/tools/regression/file/closefrom/Makefile
deleted file mode 100644
index 4b8829c..0000000
--- a/tools/regression/file/closefrom/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-# $FreeBSD$
-
-PROG= closefrom
-MAN=
-WARNS?= 6
-DPADD= ${LIBUTIL}
-LDADD= -lutil
-
-.include <bsd.prog.mk>
diff --git a/tools/regression/file/closefrom/closefrom.c b/tools/regression/file/closefrom/closefrom.c
deleted file mode 100644
index b27ec51..0000000
--- a/tools/regression/file/closefrom/closefrom.c
+++ /dev/null
@@ -1,274 +0,0 @@
-/*-
- * Copyright (c) 2009 Hudson River Trading LLC
- * Written by: John H. Baldwin <jhb@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-/*
- * Regression tests for the closefrom(2) system call.
- */
-
-#include <sys/param.h>
-#include <sys/mman.h>
-#include <sys/user.h>
-#include <sys/wait.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <libutil.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-struct shared_info {
- int failed;
- char tag[64];
- char message[0];
-};
-
-static int test = 1;
-
-static void
-ok(const char *descr)
-{
-
- printf("ok %d - %s\n", test, descr);
- test++;
-}
-
-static void
-fail(const char *descr, const char *fmt, ...)
-{
- va_list ap;
-
- printf("not ok %d - %s", test, descr);
- test++;
- if (fmt) {
- va_start(ap, fmt);
- printf(" # ");
- vprintf(fmt, ap);
- va_end(ap);
- }
- printf("\n");
- exit(1);
-}
-
-#define fail_err(descr) fail((descr), "%s", strerror(errno))
-
-static void
-cok(struct shared_info *info, const char *descr)
-{
-
- info->failed = 0;
- strlcpy(info->tag, descr, sizeof(info->tag));
- exit(0);
-}
-
-static void
-cfail(struct shared_info *info, const char *descr, const char *fmt, ...)
-{
- va_list ap;
-
- info->failed = 1;
- strlcpy(info->tag, descr, sizeof(info->tag));
- if (fmt) {
- va_start(ap, fmt);
- vsprintf(info->message, fmt, ap);
- va_end(ap);
- }
- exit(0);
-}
-
-#define cfail_err(info, descr) cfail((info), (descr), "%s", strerror(errno))
-
-/*
- * Use kinfo_getfile() to fetch the list of file descriptors and figure out
- * the highest open file descriptor.
- */
-static int
-highest_fd(void)
-{
- struct kinfo_file *kif;
- int cnt, i, highest;
-
- kif = kinfo_getfile(getpid(), &cnt);
- if (kif == NULL)
- fail_err("kinfo_getfile");
- highest = INT_MIN;
- for (i = 0; i < cnt; i++)
- if (kif[i].kf_fd > highest)
- highest = kif[i].kf_fd;
- free(kif);
- return (highest);
-}
-
-static int
-devnull(void)
-{
- int fd;
-
- fd = open("/dev/null", O_RDONLY);
- if (fd < 0)
- fail_err("open(\"/dev/null\")");
- return (fd);
-}
-
-int
-main(int __unused argc, char __unused *argv[])
-{
- struct shared_info *info;
- pid_t pid;
- int fd, i;
-
- printf("1..15\n");
-
- /* We better start up with fd's 0, 1, and 2 open. */
- fd = devnull();
- if (fd != 3)
- fail("open", "bad descriptor %d", fd);
- ok("open");
-
- /* Make sure highest_fd() works. */
- fd = highest_fd();
- if (fd != 3)
- fail("highest_fd", "bad descriptor %d", fd);
- ok("highest_fd");
-
- /* Try to use closefrom() for just closing fd 3. */
- closefrom(3);
- fd = highest_fd();
- if (fd != 2)
- fail("closefrom", "highest fd %d", fd);
- ok("closefrom");
-
- /* Eat up 16 descriptors. */
- for (i = 0; i < 16; i++)
- (void)devnull();
- fd = highest_fd();
- if (fd != 18)
- fail("open 16", "highest fd %d", fd);
- ok("open 16");
-
- /* Close half of them. */
- closefrom(11);
- fd = highest_fd();
- if (fd != 10)
- fail("closefrom", "highest fd %d", fd);
- ok("closefrom");
-
- /* Explicitly close descriptors 6 and 8 to create holes. */
- if (close(6) < 0 || close(8) < 0)
- fail_err("close2 ");
- ok("close 2");
-
- /* Verify that close on 6 and 8 fails with EBADF. */
- if (close(6) == 0)
- fail("close(6)", "did not fail");
- if (errno != EBADF)
- fail_err("close(6)");
- ok("close(6)");
- if (close(8) == 0)
- fail("close(8)", "did not fail");
- if (errno != EBADF)
- fail_err("close(8)");
- ok("close(8)");
-
- /* Close from 4 on. */
- closefrom(4);
- fd = highest_fd();
- if (fd != 3)
- fail("closefrom", "highest fd %d", fd);
- ok("closefrom");
-
- /* Allocate a small SHM region for IPC with our child. */
- info = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_ANON |
- MAP_SHARED, -1, 0);
- if (info == MAP_FAILED)
- fail_err("mmap");
- ok("mmap");
-
- /* Fork a child process to test closefrom(0). */
- pid = fork();
- if (pid < 0)
- fail_err("fork");
- if (pid == 0) {
- /* Child. */
- closefrom(0);
- fd = highest_fd();
- if (fd >= 0)
- cfail(info, "closefrom(0)", "highest fd %d", fd);
- cok(info, "closefrom(0)");
- }
- if (wait(NULL) < 0)
- fail_err("wait");
- if (info->failed)
- fail(info->tag, "%s", info->message);
- ok(info->tag);
-
- /* Fork a child process to test closefrom(-1). */
- pid = fork();
- if (pid < 0)
- fail_err("fork");
- if (pid == 0) {
- /* Child. */
- closefrom(-1);
- fd = highest_fd();
- if (fd >= 0)
- cfail(info, "closefrom(-1)", "highest fd %d", fd);
- cok(info, "closefrom(-1)");
- }
- if (wait(NULL) < 0)
- fail_err("wait");
- if (info->failed)
- fail(info->tag, "%s", info->message);
- ok(info->tag);
-
- /* Dup stdout to 6. */
- if (dup2(1, 6) < 0)
- fail_err("dup2");
- fd = highest_fd();
- if (fd != 6)
- fail("dup2", "highest fd %d", fd);
- ok("dup2");
-
- /* Do a closefrom() starting in a hole. */
- closefrom(4);
- fd = highest_fd();
- if (fd != 3)
- fail("closefrom", "highest fd %d", fd);
- ok("closefrom");
-
- /* Do a closefrom() beyond our highest open fd. */
- closefrom(32);
- fd = highest_fd();
- if (fd != 3)
- fail("closefrom", "highest fd %d", fd);
- ok("closefrom");
-
- return (0);
-}
diff --git a/tools/regression/file/closefrom/closefrom.t b/tools/regression/file/closefrom/closefrom.t
deleted file mode 100644
index 8bdfd03..0000000
--- a/tools/regression/file/closefrom/closefrom.t
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-# $FreeBSD$
-
-cd `dirname $0`
-
-executable=`basename $0 .t`
-
-make $executable 2>&1 > /dev/null
-
-exec ./$executable
diff --git a/tools/regression/include/stdatomic/Makefile.depend b/tools/regression/include/stdatomic/Makefile.depend
index 65ce567..abf239e 100644
--- a/tools/regression/include/stdatomic/Makefile.depend
+++ b/tools/regression/include/stdatomic/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/tools/tools/ath/ath_ee_9300_print/Makefile.depend b/tools/tools/ath/ath_ee_9300_print/Makefile.depend
index d8c68bc..c9ce330 100644
--- a/tools/tools/ath/ath_ee_9300_print/Makefile.depend
+++ b/tools/tools/ath/ath_ee_9300_print/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/tools/tools/drm/radeon/mkregtable/Makefile.depend b/tools/tools/drm/radeon/mkregtable/Makefile.depend
index 65ce567..abf239e 100644
--- a/tools/tools/drm/radeon/mkregtable/Makefile.depend
+++ b/tools/tools/drm/radeon/mkregtable/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/tools/tools/makeroot/Makefile.depend b/tools/tools/makeroot/Makefile.depend
index 57b7e10..d14a02b 100644
--- a/tools/tools/makeroot/Makefile.depend
+++ b/tools/tools/makeroot/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/tools/tools/usbtest/Makefile.depend b/tools/tools/usbtest/Makefile.depend
index 0deec23..e33ad82 100644
--- a/tools/tools/usbtest/Makefile.depend
+++ b/tools/tools/usbtest/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/Makefile b/usr.bin/Makefile
index af9b471..c77f89a 100644
--- a/usr.bin/Makefile
+++ b/usr.bin/Makefile
@@ -317,7 +317,9 @@ SUBDIR+= bmake
.if ${MK_MAN_UTILS} != "no"
SUBDIR+= catman
+.if ${MK_MANDOCDB} == "no"
_makewhatis= makewhatis
+.endif
_man= man
.endif
diff --git a/usr.bin/alias/Makefile.depend b/usr.bin/alias/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.bin/alias/Makefile.depend
+++ b/usr.bin/alias/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/apply/Makefile.depend b/usr.bin/apply/Makefile.depend
index d5a7c11..6002005 100644
--- a/usr.bin/apply/Makefile.depend
+++ b/usr.bin/apply/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/ar/Makefile.depend b/usr.bin/ar/Makefile.depend
index b1dce21..cb166c0 100644
--- a/usr.bin/ar/Makefile.depend
+++ b/usr.bin/ar/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/asa/Makefile.depend b/usr.bin/asa/Makefile.depend
index 461e710..9cb890b 100644
--- a/usr.bin/asa/Makefile.depend
+++ b/usr.bin/asa/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/at/Makefile.depend b/usr.bin/at/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/at/Makefile.depend
+++ b/usr.bin/at/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/atf/Makefile.inc b/usr.bin/atf/Makefile.inc
deleted file mode 100644
index a79cd6d..0000000
--- a/usr.bin/atf/Makefile.inc
+++ /dev/null
@@ -1,4 +0,0 @@
-# $FreeBSD$
-
-BINDIR?= /usr/bin
-WARNS?= 3
diff --git a/usr.bin/atf/atf-sh/Makefile b/usr.bin/atf/atf-sh/Makefile
deleted file mode 100644
index 845521c..0000000
--- a/usr.bin/atf/atf-sh/Makefile
+++ /dev/null
@@ -1,66 +0,0 @@
-#-
-# Copyright (c) 2011 Google, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-#
-# $FreeBSD$
-
-.include <src.opts.mk>
-.include <bsd.init.mk>
-
-ATF= ${.CURDIR:H:H:H}/contrib/atf
-.PATH: ${ATF}/atf-sh
-
-PROG_CXX= atf-sh
-SRCS= atf-sh.cpp
-MAN= atf-sh.1 atf-sh-api.3
-
-CFLAGS+= -DHAVE_CONFIG_H
-CFLAGS+= -I${ATF}
-
-DPADD+= ${LIBATF_C} ${LIBATF_CXX}
-LDADD+= -latf-c++ -latf-c
-
-FILESGROUPS= SUBR
-
-SUBRDIR= ${SHAREDIR}/atf
-SUBR= libatf-sh.subr
-
-all: atf-sh.pc
-atf-sh.pc: atf-sh.pc.in atf-version
- sed -e 's,__EXEC_PREFIX__,/usr,g' \
- -e "s,__ATF_VERSION__,$$(cat atf-version),g" \
- <${ATF}/atf-sh/atf-sh.pc.in >atf-sh.pc
-
-beforeinstall:
- ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
- atf-sh.pc ${DESTDIR}${LIBDATADIR}/pkgconfig
- ${INSTALL} -C -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \
- ${ATF}/atf-sh/atf-sh.m4 ${DESTDIR}${SHAREDIR}/aclocal
-
-.if ${MK_TESTS} != "no"
-SUBDIR+= tests
-.endif
-
-.include "../../../lib/atf/common.mk"
-.include <bsd.prog.mk>
diff --git a/usr.bin/atf/atf-sh/Makefile.depend b/usr.bin/atf/atf-sh/Makefile.depend
deleted file mode 100644
index 72e04cf..0000000
--- a/usr.bin/atf/atf-sh/Makefile.depend
+++ /dev/null
@@ -1,24 +0,0 @@
-# Autogenerated - do NOT edit!
-
-DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
-
-DIRDEPS = \
- gnu/lib/csu \
- gnu/lib/libgcc \
- include \
- include/xlocale \
- lib/${CSU_DIR} \
- lib/atf/libatf-c \
- lib/atf/libatf-c++ \
- lib/libc \
- lib/libc++ \
- lib/libcompiler_rt \
- lib/libcxxrt \
- lib/msun \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/usr.bin/atf/atf-sh/tests/Makefile b/usr.bin/atf/atf-sh/tests/Makefile
deleted file mode 100644
index 4fc0ed7..0000000
--- a/usr.bin/atf/atf-sh/tests/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.init.mk>
-
-TESTSDIR= ${TESTSBASE}/usr.bin/atf/atf-sh
-
-ATF= ${.CURDIR:H:H:H:H}/contrib/atf
-.PATH: ${ATF}/atf-sh
-
-ATF_TESTS_SH+= atf_check_test
-ATF_TESTS_SH+= config_test
-ATF_TESTS_SH+= integration_test
-ATF_TESTS_SH+= normalize_test
-ATF_TESTS_SH+= tc_test
-ATF_TESTS_SH+= tp_test
-
-SCRIPTS+= misc_helpers
-SCRIPTSDIR_misc_helpers=${TESTSDIR}
-CLEANFILES+= misc_helpers misc_helpers.tmp
-misc_helpers: misc_helpers.sh
- echo '#! /usr/bin/atf-sh' >${.TARGET}.tmp
- cat ${.ALLSRC} >>${.TARGET}.tmp
- chmod +x ${.TARGET}.tmp
- mv ${.TARGET}.tmp ${.TARGET}
-
-.include <bsd.test.mk>
diff --git a/usr.bin/atf/tests/Makefile b/usr.bin/atf/tests/Makefile
deleted file mode 100644
index 3ff9f93..0000000
--- a/usr.bin/atf/tests/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.own.mk>
-
-TESTSDIR= ${TESTSBASE}/usr.bin/atf
-
-.PATH: ${.CURDIR:H:H:H}/tests
-KYUAFILE= yes
-
-.include <bsd.test.mk>
diff --git a/usr.bin/atm/sscop/Makefile.depend b/usr.bin/atm/sscop/Makefile.depend
index dfa18de..a49eafb 100644
--- a/usr.bin/atm/sscop/Makefile.depend
+++ b/usr.bin/atm/sscop/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/awk/Makefile.depend b/usr.bin/awk/Makefile.depend
index 94deebf..2fddd14 100644
--- a/usr.bin/awk/Makefile.depend
+++ b/usr.bin/awk/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/banner/Makefile.depend b/usr.bin/banner/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/banner/Makefile.depend
+++ b/usr.bin/banner/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/basename/Makefile.depend b/usr.bin/basename/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/basename/Makefile.depend
+++ b/usr.bin/basename/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/bc/Makefile.depend b/usr.bin/bc/Makefile.depend
index f41c8c3..e759653 100644
--- a/usr.bin/bc/Makefile.depend
+++ b/usr.bin/bc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/biff/Makefile.depend b/usr.bin/biff/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/biff/Makefile.depend
+++ b/usr.bin/biff/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/bluetooth/bthost/Makefile.depend b/usr.bin/bluetooth/bthost/Makefile.depend
index af90191..5d21038 100644
--- a/usr.bin/bluetooth/bthost/Makefile.depend
+++ b/usr.bin/bluetooth/bthost/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/bluetooth/btsockstat/Makefile.depend b/usr.bin/bluetooth/btsockstat/Makefile.depend
index 5797eb4..0929154 100644
--- a/usr.bin/bluetooth/btsockstat/Makefile.depend
+++ b/usr.bin/bluetooth/btsockstat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/bluetooth/rfcomm_sppd/Makefile.depend b/usr.bin/bluetooth/rfcomm_sppd/Makefile.depend
index 19a9ab8..4633528 100644
--- a/usr.bin/bluetooth/rfcomm_sppd/Makefile.depend
+++ b/usr.bin/bluetooth/rfcomm_sppd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/bmake/Makefile b/usr.bin/bmake/Makefile
index 4abb45fe..4f83731 100644
--- a/usr.bin/bmake/Makefile
+++ b/usr.bin/bmake/Makefile
@@ -14,10 +14,10 @@ CFLAGS+= -I${.CURDIR}
CLEANDIRS+= FreeBSD
CLEANFILES+= bootstrap
-# $Id: Makefile,v 1.38 2015/05/05 21:58:05 sjg Exp $
+# $Id: Makefile,v 1.39 2015/06/07 15:54:37 sjg Exp $
# Base version on src date
-MAKE_VERSION= 20150505
+MAKE_VERSION= 20150606
PROG?= ${.CURDIR:T}
diff --git a/usr.bin/bmake/Makefile.depend b/usr.bin/bmake/Makefile.depend
index 84b8ddd..6cfaab1 100644
--- a/usr.bin/bmake/Makefile.depend
+++ b/usr.bin/bmake/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/bmake/Makefile.inc b/usr.bin/bmake/Makefile.inc
index 2fa7785..ad7faad 100644
--- a/usr.bin/bmake/Makefile.inc
+++ b/usr.bin/bmake/Makefile.inc
@@ -21,4 +21,4 @@ SUBDIR+= tests
.endif
WARNS=3
-CFLAGS+= -DNO_PWD_OVERRIDE ${DBG}
+CFLAGS+= -DNO_PWD_OVERRIDE
diff --git a/usr.bin/brandelf/Makefile.depend b/usr.bin/brandelf/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/brandelf/Makefile.depend
+++ b/usr.bin/brandelf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/bsdiff/bsdiff/Makefile.depend b/usr.bin/bsdiff/bsdiff/Makefile.depend
index 74b6cfb..36fe468 100644
--- a/usr.bin/bsdiff/bsdiff/Makefile.depend
+++ b/usr.bin/bsdiff/bsdiff/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/bsdiff/bspatch/Makefile.depend b/usr.bin/bsdiff/bspatch/Makefile.depend
index 74b6cfb..36fe468 100644
--- a/usr.bin/bsdiff/bspatch/Makefile.depend
+++ b/usr.bin/bsdiff/bspatch/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/bzip2/Makefile.depend b/usr.bin/bzip2/Makefile.depend
index afe16c4..509010f 100644
--- a/usr.bin/bzip2/Makefile.depend
+++ b/usr.bin/bzip2/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/bzip2recover/Makefile.depend b/usr.bin/bzip2recover/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/bzip2recover/Makefile.depend
+++ b/usr.bin/bzip2recover/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/c89/Makefile.depend b/usr.bin/c89/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/c89/Makefile.depend
+++ b/usr.bin/c89/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/c99/Makefile.depend b/usr.bin/c99/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/c99/Makefile.depend
+++ b/usr.bin/c99/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/calendar/Makefile.depend b/usr.bin/calendar/Makefile.depend
index 8a1da00..c9f9d52 100644
--- a/usr.bin/calendar/Makefile.depend
+++ b/usr.bin/calendar/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/calendar/calendars/calendar.holiday b/usr.bin/calendar/calendars/calendar.holiday
index fe9029e..f3115c6 100644
--- a/usr.bin/calendar/calendars/calendar.holiday
+++ b/usr.bin/calendar/calendars/calendar.holiday
@@ -357,7 +357,7 @@
08/31 Independence Day (Merdeka) in Malaysia
08/31 Independence Day in Trinidad and Tobago
08/31 Pashtoonian Day in Afghanistan
-08/FriThird Admission Day in Hawaii, 1984 (3rd Friday)
+08/FriThird Admission Day in Hawaii, 1959 (3rd Friday)
09/01 Army Day in Chile
09/03 Independence Day in Qatar
09/03 Memorial Day in Tunisia
diff --git a/usr.bin/cap_mkdb/Makefile.depend b/usr.bin/cap_mkdb/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/cap_mkdb/Makefile.depend
+++ b/usr.bin/cap_mkdb/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/catman/Makefile.depend b/usr.bin/catman/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/catman/Makefile.depend
+++ b/usr.bin/catman/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/chat/Makefile.depend b/usr.bin/chat/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/chat/Makefile.depend
+++ b/usr.bin/chat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/checknr/Makefile.depend b/usr.bin/checknr/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/checknr/Makefile.depend
+++ b/usr.bin/checknr/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/chkey/Makefile.depend b/usr.bin/chkey/Makefile.depend
index 3739603..bae15c2 100644
--- a/usr.bin/chkey/Makefile.depend
+++ b/usr.bin/chkey/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/chpass/Makefile.depend b/usr.bin/chpass/Makefile.depend
index 3755d65..3dc74b2 100644
--- a/usr.bin/chpass/Makefile.depend
+++ b/usr.bin/chpass/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/cksum/Makefile.depend b/usr.bin/cksum/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/cksum/Makefile.depend
+++ b/usr.bin/cksum/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/clang/clang-tblgen/Makefile.depend b/usr.bin/clang/clang-tblgen/Makefile.depend
index cc5a7b7..e1ee91c 100644
--- a/usr.bin/clang/clang-tblgen/Makefile.depend
+++ b/usr.bin/clang/clang-tblgen/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/clang/clang/Makefile.depend b/usr.bin/clang/clang/Makefile.depend
index ba86a94..900b8c8 100644
--- a/usr.bin/clang/clang/Makefile.depend
+++ b/usr.bin/clang/clang/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/clang/tblgen/Makefile.depend b/usr.bin/clang/tblgen/Makefile.depend
index 71f237e..4d35366 100644
--- a/usr.bin/clang/tblgen/Makefile.depend
+++ b/usr.bin/clang/tblgen/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/cmp/Makefile.depend b/usr.bin/cmp/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/cmp/Makefile.depend
+++ b/usr.bin/cmp/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/col/Makefile.depend b/usr.bin/col/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/col/Makefile.depend
+++ b/usr.bin/col/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/colcrt/Makefile.depend b/usr.bin/colcrt/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/colcrt/Makefile.depend
+++ b/usr.bin/colcrt/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/colcrt/colcrt.1 b/usr.bin/colcrt/colcrt.1
index 8a5445f..1b4aacf 100644
--- a/usr.bin/colcrt/colcrt.1
+++ b/usr.bin/colcrt/colcrt.1
@@ -28,7 +28,7 @@
.\" @(#)colcrt.1 8.1 (Berkeley) 6/30/93
.\" $FreeBSD$
.\"
-.Dd July 31, 2004
+.Dd June 6, 2015
.Dt COLCRT 1
.Os
.Sh NAME
@@ -93,8 +93,8 @@ tbl exum2.n \&| nroff \-ms \&| colcrt \- \&| more
.Sh HISTORY
The
.Nm
-command appeared in
-.Bx 3.0 .
+utility first appeared in
+.Bx 1 .
.Sh BUGS
Should fold underlines onto blanks even with the
.Sq Fl
diff --git a/usr.bin/colldef/Makefile.depend b/usr.bin/colldef/Makefile.depend
index 06136c7..dc467b2 100644
--- a/usr.bin/colldef/Makefile.depend
+++ b/usr.bin/colldef/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/colrm/Makefile.depend b/usr.bin/colrm/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/colrm/Makefile.depend
+++ b/usr.bin/colrm/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/colrm/colrm.1 b/usr.bin/colrm/colrm.1
index db365f8..9454ed5 100644
--- a/usr.bin/colrm/colrm.1
+++ b/usr.bin/colrm/colrm.1
@@ -28,7 +28,7 @@
.\" @(#)colrm.1 8.1 (Berkeley) 6/6/93
.\" $FreeBSD$
.\"
-.Dd August 4, 2004
+.Dd June 6, 2015
.Dt COLRM 1
.Os
.Sh NAME
@@ -83,5 +83,10 @@ as described in
.Sh HISTORY
The
.Nm
-command appeared in
-.Bx 3.0 .
+utility first appeared in
+.Bx 1 .
+.Sh AUTHORS
+.An Jeff Schriebman
+wrote the original version of
+.Nm
+in November 1974.
diff --git a/usr.bin/column/Makefile.depend b/usr.bin/column/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/column/Makefile.depend
+++ b/usr.bin/column/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/comm/Makefile.depend b/usr.bin/comm/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/comm/Makefile.depend
+++ b/usr.bin/comm/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/compile_et/Makefile.depend b/usr.bin/compile_et/Makefile.depend
index ac0e650..94ad84e 100644
--- a/usr.bin/compile_et/Makefile.depend
+++ b/usr.bin/compile_et/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/compress/Makefile.depend b/usr.bin/compress/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/compress/Makefile.depend
+++ b/usr.bin/compress/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/cpio/Makefile.depend b/usr.bin/cpio/Makefile.depend
index 2b9c4f7..4e7906b 100644
--- a/usr.bin/cpio/Makefile.depend
+++ b/usr.bin/cpio/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/cpuset/Makefile.depend b/usr.bin/cpuset/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/cpuset/Makefile.depend
+++ b/usr.bin/cpuset/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/csplit/Makefile.depend b/usr.bin/csplit/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/csplit/Makefile.depend
+++ b/usr.bin/csplit/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/csup/Makefile b/usr.bin/csup/Makefile
deleted file mode 100644
index 0cea821..0000000
--- a/usr.bin/csup/Makefile
+++ /dev/null
@@ -1,42 +0,0 @@
-# $FreeBSD$
-
-PROG= csup
-SRCS= attrstack.c \
- auth.c \
- config.c \
- detailer.c \
- diff.c \
- fattr.c \
- fixups.c \
- fnmatch.c \
- globtree.c \
- idcache.c \
- keyword.c \
- lex.rcs.c \
- lister.c \
- main.c \
- misc.c \
- mux.c \
- parse.y \
- pathcomp.c \
- proto.c \
- rcsfile.c \
- rcsparse.c \
- rsyncfile.c \
- status.c \
- stream.c \
- threads.c \
- token.l \
- updater.c
-
-CFLAGS+= -I. -I${.CURDIR}
-CFLAGS+= -DHAVE_FFLAGS -DNDEBUG
-WARNS?= 1
-
-DPADD= ${LIBMD} ${LIBZ} ${LIBPTHREAD}
-LDADD= -lmd -lz -lpthread
-
-SCRIPTS= cpasswd.sh
-MAN= csup.1 cpasswd.1
-
-.include <bsd.prog.mk>
diff --git a/usr.bin/csup/Makefile.depend b/usr.bin/csup/Makefile.depend
deleted file mode 100644
index c223aad..0000000
--- a/usr.bin/csup/Makefile.depend
+++ /dev/null
@@ -1,30 +0,0 @@
-# Autogenerated - do NOT edit!
-
-DIRDEPS = \
- gnu/lib/csu \
- gnu/lib/libgcc \
- include \
- include/arpa \
- include/xlocale \
- lib/${CSU_DIR} \
- lib/libc \
- lib/libcompiler_rt \
- lib/libmd \
- lib/libthr \
- lib/libz \
- usr.bin/yacc.host \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-config.o: parse.h
-config.po: parse.h
-parse.o: parse.c
-parse.po: parse.c
-token.o: parse.h
-token.o: token.c
-token.po: parse.h
-token.po: token.c
-.endif
diff --git a/usr.bin/csup/README b/usr.bin/csup/README
deleted file mode 100644
index 879c481..0000000
--- a/usr.bin/csup/README
+++ /dev/null
@@ -1,39 +0,0 @@
-$FreeBSD$
-
-Authors
--------
-
-CVSup was originally written in Modula-3 by
- John Polstra <jdp@polstra.com>.
-
-Csup is a rewrite of CVSup in C. It has been mostly written by
- Maxime Henrion <mux@FreeBSD.org>.
-
-A few contributors have helped him in his task and they are listed here in
-alphabetical order :
-
- Olivier Houchard <cognet@FreeBSD.org>
- Ulf Lilleengen <lulf@kerneled.org>
- Christoph Mathys <cmathys@bluewin.ch> (Google SoC Project)
- Etienne Vidal <etienne.vidal@gmail.com>
-
-
-Building & Installing
----------------------
-
-Csup should build and run fine under any *BSD OS (that includes FreeBSD,
-NetBSD, OpenBSD and DragonFlyBSD), as well as Linux and Darwin. If you
-have a problem building from source, drop me a mail!
-
-There is one Makefile specifically tailored for *BSD systems named
-Makefile and another one that is gmake-specific for Darwin and Linux
-users named GNUmakefile. You don't really need to worry about that
-since whatever your "make" command is, it should pick up the correct
-Makefile.
-
-As usual, to build the source code, just run "make". Once this is done,
-just run "make install" to install the binary and manual page.
-
-Be warned however that if the packaging system of your OS knows about
-csup, it is certainly better to install it from there rather than by
-hand, so that it can then be properly deinstalled.
diff --git a/usr.bin/csup/TODO b/usr.bin/csup/TODO
deleted file mode 100644
index 9854d35..0000000
--- a/usr.bin/csup/TODO
+++ /dev/null
@@ -1,28 +0,0 @@
-$FreeBSD$
-
-BUGS:
-
-- Fix every XXX in the code :-).
-- The stream API needs some polishing. It needs proper error numbers
- and a stream_error() function similar to the ferror() function.
-- The yacc/lex code to parse the configuration file is sub-optimal. It
- has global variables because of yacc, but I think it should be possible
- to do it better by using YYFUNC_PROTOTYPE or something. I think it
- should also be possible to completely get rid of the lex file.
-- The $Log$ CVS keyword is not supported.
-- Add missing support for supfile keywords and add sanity checks for
- some of them. Also, we're not supposed to choke on unknown keywords
- to stay in line with CVSup, which just ignores them in order to
- maintain compatibility with sup configuration files.
-
-MISSING FEATURES:
-
-- Add support for shell commands sent by the server.
-- Add missing support for various CVSup options : -D, -e and -E (requires
- shell commands support) and the destDir parameter.
-- For now, this code should build fine on FreeBSD, NetBSD, OpenBSD,
- Linux and Darwin. Solaris support would also be nice at some point.
-- Implement some new useful options : the ability to generate CVS
- checkout files (files in CVS/ subdirectores), a command line override
- to only update a specific collection and a third verbosity level to
- display commit log messages.
diff --git a/usr.bin/csup/attrstack.h b/usr.bin/csup/attrstack.h
deleted file mode 100644
index 721313c..0000000
--- a/usr.bin/csup/attrstack.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*-
- * Copyright (c) 2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- */
-#ifndef _ATTRSTACK_H_
-#define _ATTRSTACK_H_
-
-struct fattr;
-struct attrstack;
-
-struct attrstack *attrstack_new(void);
-void attrstack_push(struct attrstack *, struct fattr *);
-struct fattr *attrstack_pop(struct attrstack *);
-size_t attrstack_size(struct attrstack *);
-void attrstack_free(struct attrstack *);
-
-#endif /* !_ATTRSTACK_H_ */
diff --git a/usr.bin/csup/auth.c b/usr.bin/csup/auth.c
deleted file mode 100644
index 1704eba..0000000
--- a/usr.bin/csup/auth.c
+++ /dev/null
@@ -1,331 +0,0 @@
-/*-
- * Copyright (c) 2003-2007, Petar Zhivkov Petrov <pesho.petrov@gmail.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <sys/types.h>
-
-#include <arpa/inet.h>
-#include <netinet/in.h>
-
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "auth.h"
-#include "config.h"
-#include "misc.h"
-#include "proto.h"
-#include "stream.h"
-
-#define MD5_BYTES 16
-
-/* This should be at least 2 * MD5_BYTES + 6 (length of "$md5$" + 1) */
-#define MD5_CHARS_MAX (2*(MD5_BYTES)+6)
-
-struct srvrecord {
- char server[MAXHOSTNAMELEN];
- char client[256];
- char password[256];
-};
-
-static int auth_domd5auth(struct config *);
-static int auth_lookuprecord(char *, struct srvrecord *);
-static int auth_parsetoken(char **, char *, int);
-static void auth_makesecret(struct srvrecord *, char *);
-static void auth_makeresponse(char *, char *, char *);
-static void auth_readablesum(unsigned char *, char *);
-static void auth_makechallenge(struct config *, char *);
-static int auth_checkresponse(char *, char *, char *);
-
-int auth_login(struct config *config)
-{
- struct stream *s;
- char hostbuf[MAXHOSTNAMELEN];
- char *login, *host;
- int error;
-
- s = config->server;
- error = gethostname(hostbuf, sizeof(hostbuf));
- hostbuf[sizeof(hostbuf) - 1] = '\0';
- if (error)
- host = NULL;
- else
- host = hostbuf;
- login = getlogin();
- proto_printf(s, "USER %s %s\n", login != NULL ? login : "?",
- host != NULL ? host : "?");
- stream_flush(s);
- error = auth_domd5auth(config);
- return (error);
-}
-
-static int
-auth_domd5auth(struct config *config)
-{
- struct stream *s;
- char *line, *cmd, *challenge, *realm, *client, *srvresponse, *msg;
- char shrdsecret[MD5_CHARS_MAX], response[MD5_CHARS_MAX];
- char clichallenge[MD5_CHARS_MAX];
- struct srvrecord auth;
- int error;
-
- lprintf(2, "MD5 authentication started\n");
- s = config->server;
- line = stream_getln(s, NULL);
- cmd = proto_get_ascii(&line);
- realm = proto_get_ascii(&line);
- challenge = proto_get_ascii(&line);
- if (challenge == NULL ||
- line != NULL ||
- (strcmp(cmd, "AUTHMD5") != 0)) {
- lprintf(-1, "Invalid server reply to USER\n");
- return (STATUS_FAILURE);
- }
-
- client = NULL;
- response[0] = clichallenge[0] = '.';
- response[1] = clichallenge[1] = 0;
- if (config->reqauth || (strcmp(challenge, ".") != 0)) {
- if (strcmp(realm, ".") == 0) {
- lprintf(-1, "Authentication required, but not enabled on server\n");
- return (STATUS_FAILURE);
- }
- error = auth_lookuprecord(realm, &auth);
- if (error != STATUS_SUCCESS)
- return (error);
- client = auth.client;
- auth_makesecret(&auth, shrdsecret);
- }
-
- if (strcmp(challenge, ".") != 0)
- auth_makeresponse(challenge, shrdsecret, response);
- if (config->reqauth)
- auth_makechallenge(config, clichallenge);
- proto_printf(s, "AUTHMD5 %s %s %s\n",
- client == NULL ? "." : client, response, clichallenge);
- stream_flush(s);
- line = stream_getln(s, NULL);
- cmd = proto_get_ascii(&line);
- if (cmd == NULL || line == NULL)
- goto bad;
- if (strcmp(cmd, "OK") == 0) {
- srvresponse = proto_get_ascii(&line);
- if (srvresponse == NULL)
- goto bad;
- if (config->reqauth &&
- !auth_checkresponse(srvresponse, clichallenge, shrdsecret)) {
- lprintf(-1, "Server failed to authenticate itself to client\n");
- return (STATUS_FAILURE);
- }
- lprintf(2, "MD5 authentication successful\n");
- return (STATUS_SUCCESS);
- }
- if (strcmp(cmd, "!") == 0) {
- msg = proto_get_rest(&line);
- if (msg == NULL)
- goto bad;
- lprintf(-1, "Server error: %s\n", msg);
- return (STATUS_FAILURE);
- }
-bad:
- lprintf(-1, "Invalid server reply to AUTHMD5\n");
- return (STATUS_FAILURE);
-}
-
-static int
-auth_lookuprecord(char *server, struct srvrecord *auth)
-{
- char *home, *line, authfile[FILENAME_MAX];
- struct stream *s;
- int linenum = 0, error;
-
- home = getenv("HOME");
- if (home == NULL) {
- lprintf(-1, "Environment variable \"HOME\" is not set\n");
- return (STATUS_FAILURE);
- }
- snprintf(authfile, sizeof(authfile), "%s/%s", home, AUTHFILE);
- s = stream_open_file(authfile, O_RDONLY);
- if (s == NULL) {
- lprintf(-1, "Could not open file %s\n", authfile);
- return (STATUS_FAILURE);
- }
-
- while ((line = stream_getln(s, NULL)) != NULL) {
- linenum++;
- if (line[0] == '#' || line[0] == '\0')
- continue;
- error = auth_parsetoken(&line, auth->server,
- sizeof(auth->server));
- if (error != STATUS_SUCCESS) {
- lprintf(-1, "%s:%d Missing client name\n", authfile, linenum);
- goto close;
- }
- /* Skip the rest of this line, it isn't what we are looking for. */
- if (strcasecmp(auth->server, server) != 0)
- continue;
- error = auth_parsetoken(&line, auth->client,
- sizeof(auth->client));
- if (error != STATUS_SUCCESS) {
- lprintf(-1, "%s:%d Missing password\n", authfile, linenum);
- goto close;
- }
- error = auth_parsetoken(&line, auth->password,
- sizeof(auth->password));
- if (error != STATUS_SUCCESS) {
- lprintf(-1, "%s:%d Missing comment\n", authfile, linenum);
- goto close;
- }
- stream_close(s);
- lprintf(2, "Found authentication record for server \"%s\"\n",
- server);
- return (STATUS_SUCCESS);
- }
- lprintf(-1, "Unknown server \"%s\". Fix your %s\n", server , authfile);
- memset(auth->password, 0, sizeof(auth->password));
-close:
- stream_close(s);
- return (STATUS_FAILURE);
-}
-
-static int
-auth_parsetoken(char **line, char *buf, int len)
-{
- char *colon;
-
- colon = strchr(*line, ':');
- if (colon == NULL)
- return (STATUS_FAILURE);
- *colon = 0;
- buf[len - 1] = 0;
- strncpy(buf, *line, len - 1);
- *line = colon + 1;
- return (STATUS_SUCCESS);
-}
-
-static void
-auth_makesecret(struct srvrecord *auth, char *secret)
-{
- char *s, ch;
- const char *md5salt = "$md5$";
- unsigned char md5sum[MD5_BYTES];
- MD5_CTX md5;
-
- MD5_Init(&md5);
- for (s = auth->client; *s != 0; ++s) {
- ch = tolower(*s);
- MD5_Update(&md5, &ch, 1);
- }
- MD5_Update(&md5, ":", 1);
- for (s = auth->server; *s != 0; ++s) {
- ch = tolower(*s);
- MD5_Update(&md5, &ch, 1);
- }
- MD5_Update(&md5, ":", 1);
- MD5_Update(&md5, auth->password, strlen(auth->password));
- MD5_Final(md5sum, &md5);
- memset(secret, 0, MD5_CHARS_MAX);
- strcpy(secret, md5salt);
- auth_readablesum(md5sum, secret + strlen(md5salt));
-}
-
-static void
-auth_makeresponse(char *challenge, char *sharedsecret, char *response)
-{
- MD5_CTX md5;
- unsigned char md5sum[MD5_BYTES];
-
- MD5_Init(&md5);
- MD5_Update(&md5, sharedsecret, strlen(sharedsecret));
- MD5_Update(&md5, ":", 1);
- MD5_Update(&md5, challenge, strlen(challenge));
- MD5_Final(md5sum, &md5);
- auth_readablesum(md5sum, response);
-}
-
-/*
- * Generates a challenge string which is an MD5 sum
- * of a fairly random string. The purpose is to decrease
- * the possibility of generating the same challenge
- * string (even by different clients) more then once
- * for the same server.
- */
-static void
-auth_makechallenge(struct config *config, char *challenge)
-{
- MD5_CTX md5;
- unsigned char md5sum[MD5_BYTES];
- char buf[128];
- struct timeval tv;
- struct sockaddr_in laddr;
- pid_t pid, ppid;
- int error, addrlen;
-
- gettimeofday(&tv, NULL);
- pid = getpid();
- ppid = getppid();
- srandom(tv.tv_usec ^ tv.tv_sec ^ pid);
- addrlen = sizeof(laddr);
- error = getsockname(config->socket, (struct sockaddr *)&laddr, &addrlen);
- if (error < 0) {
- memset(&laddr, 0, sizeof(laddr));
- }
- gettimeofday(&tv, NULL);
- MD5_Init(&md5);
- snprintf(buf, sizeof(buf), "%s:%jd:%ld:%ld:%d:%d",
- inet_ntoa(laddr.sin_addr), (intmax_t)tv.tv_sec, tv.tv_usec,
- random(), pid, ppid);
- MD5_Update(&md5, buf, strlen(buf));
- MD5_Final(md5sum, &md5);
- auth_readablesum(md5sum, challenge);
-}
-
-static int
-auth_checkresponse(char *response, char *challenge, char *secret)
-{
- char correctresponse[MD5_CHARS_MAX];
-
- auth_makeresponse(challenge, secret, correctresponse);
- return (strcmp(response, correctresponse) == 0);
-}
-
-static void
-auth_readablesum(unsigned char *md5sum, char *readable)
-{
- unsigned int i;
- char *s = readable;
-
- for (i = 0; i < MD5_BYTES; ++i, s+=2) {
- sprintf(s, "%.2x", md5sum[i]);
- }
-}
-
diff --git a/usr.bin/csup/config.c b/usr.bin/csup/config.c
deleted file mode 100644
index 46ae6cd..0000000
--- a/usr.bin/csup/config.c
+++ /dev/null
@@ -1,579 +0,0 @@
-/*-
- * Copyright (c) 2003-2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "config.h"
-#include "globtree.h"
-#include "keyword.h"
-#include "misc.h"
-#include "parse.h"
-#include "stream.h"
-#include "token.h"
-
-static int config_parse_refusefiles(struct coll *);
-static int config_parse_refusefile(struct coll *, char *);
-
-extern FILE *yyin;
-
-/* These are globals because I can't think of a better way with yacc. */
-static STAILQ_HEAD(, coll) colls;
-static struct coll *cur_coll;
-static struct coll *defaults;
-static struct coll *ovcoll;
-static int ovmask;
-static const char *cfgfile;
-
-/*
- * Extract all the configuration information from the config
- * file and some command line parameters.
- */
-struct config *
-config_init(const char *file, struct coll *override, int overridemask)
-{
- struct config *config;
- struct coll *coll;
- size_t slen;
- char *prefix;
- int error;
- mode_t mask;
-
- config = xmalloc(sizeof(struct config));
- memset(config, 0, sizeof(struct config));
- STAILQ_INIT(&colls);
-
- defaults = coll_new(NULL);
- /* Set the default umask. */
- mask = umask(0);
- umask(mask);
- defaults->co_umask = mask;
- ovcoll = override;
- ovmask = overridemask;
-
- /* Extract a list of collections from the configuration file. */
- cur_coll = coll_new(defaults);
- yyin = fopen(file, "r");
- if (yyin == NULL) {
- lprintf(-1, "Cannot open \"%s\": %s\n", file, strerror(errno));
- goto bad;
- }
- cfgfile = file;
- error = yyparse();
- fclose(yyin);
- if (error)
- goto bad;
-
- memcpy(&config->colls, &colls, sizeof(colls));
- if (STAILQ_EMPTY(&config->colls)) {
- lprintf(-1, "Empty supfile\n");
- goto bad;
- }
-
- /* Fixup the list of collections. */
- STAILQ_FOREACH(coll, &config->colls, co_next) {
- if (coll->co_base == NULL)
- coll->co_base = xstrdup("/usr/local/etc/cvsup");
- if (coll->co_colldir == NULL)
- coll->co_colldir = "sup";
- if (coll->co_prefix == NULL) {
- coll->co_prefix = xstrdup(coll->co_base);
- /*
- * If prefix is not an absolute pathname, it is
- * interpreted relative to base.
- */
- } else if (coll->co_prefix[0] != '/') {
- slen = strlen(coll->co_base);
- if (slen > 0 && coll->co_base[slen - 1] != '/')
- xasprintf(&prefix, "%s/%s", coll->co_base,
- coll->co_prefix);
- else
- xasprintf(&prefix, "%s%s", coll->co_base,
- coll->co_prefix);
- free(coll->co_prefix);
- coll->co_prefix = prefix;
- }
- coll->co_prefixlen = strlen(coll->co_prefix);
- /* Determine whether to checksum RCS files or not. */
- if (coll->co_options & CO_EXACTRCS)
- coll->co_options |= CO_CHECKRCS;
- else
- coll->co_options &= ~CO_CHECKRCS;
- /* In recent versions, we always try to set the file modes. */
- coll->co_options |= CO_SETMODE;
- coll->co_options |= CO_NORSYNC;
- error = config_parse_refusefiles(coll);
- if (error)
- goto bad;
- }
-
- coll_free(cur_coll);
- coll_free(defaults);
- config->host = STAILQ_FIRST(&config->colls)->co_host;
- return (config);
-bad:
- coll_free(cur_coll);
- coll_free(defaults);
- config_free(config);
- return (NULL);
-}
-
-int
-config_checkcolls(struct config *config)
-{
- char linkname[4];
- struct stat sb;
- struct coll *coll;
- int error, numvalid, ret;
-
- numvalid = 0;
- STAILQ_FOREACH(coll, &config->colls, co_next) {
- error = stat(coll->co_prefix, &sb);
- if (error || !S_ISDIR(sb.st_mode)) {
- /* Skip this collection, and warn about it unless its
- prefix is a symbolic link pointing to "SKIP". */
- coll->co_options |= CO_SKIP;
- ret = readlink(coll->co_prefix, linkname,
- sizeof(linkname));
- if (ret != 4 || memcmp(linkname, "SKIP", 4) != 0) {
- lprintf(-1,"Nonexistent prefix \"%s\" for "
- "%s/%s\n", coll->co_prefix, coll->co_name,
- coll->co_release);
- }
- continue;
- }
- numvalid++;
- }
- return (numvalid);
-}
-
-static int
-config_parse_refusefiles(struct coll *coll)
-{
- char *collstem, *suffix, *supdir, *path;
- int error;
-
- if (coll->co_colldir[0] == '/')
- supdir = xstrdup(coll->co_colldir);
- else
- xasprintf(&supdir, "%s/%s", coll->co_base, coll->co_colldir);
-
- /* First, the global refuse file that applies to all collections. */
- xasprintf(&path, "%s/refuse", supdir);
- error = config_parse_refusefile(coll, path);
- free(path);
- if (error) {
- free(supdir);
- return (error);
- }
-
- /* Next the per-collection refuse files that applies to all release/tag
- combinations. */
- xasprintf(&collstem, "%s/%s/refuse", supdir, coll->co_name);
- free(supdir);
- error = config_parse_refusefile(coll, collstem);
- if (error) {
- free(collstem);
- return (error);
- }
-
- /* Finally, the per-release and per-tag refuse file. */
- suffix = coll_statussuffix(coll);
- if (suffix != NULL) {
- xasprintf(&path, "%s%s", collstem, suffix);
- free(suffix);
- error = config_parse_refusefile(coll, path);
- free(path);
- }
- free(collstem);
- return (error);
-}
-
-/*
- * Parses a "refuse" file, and records the relevant information in
- * coll->co_refusals. If the file does not exist, it is silently
- * ignored.
- */
-static int
-config_parse_refusefile(struct coll *coll, char *path)
-{
- struct stream *rd;
- char *cp, *line, *pat;
-
- rd = stream_open_file(path, O_RDONLY);
- if (rd == NULL)
- return (0);
- while ((line = stream_getln(rd, NULL)) != NULL) {
- pat = line;
- for (;;) {
- /* Trim leading whitespace. */
- pat += strspn(pat, " \t");
- if (pat[0] == '\0')
- break;
- cp = strpbrk(pat, " \t");
- if (cp != NULL)
- *cp = '\0';
- pattlist_add(coll->co_refusals, pat);
- if (cp == NULL)
- break;
- pat = cp + 1;
- }
- }
- if (!stream_eof(rd)) {
- stream_close(rd);
- lprintf(-1, "Read failure from \"%s\": %s\n", path,
- strerror(errno));
- return (-1);
- }
- stream_close(rd);
- return (0);
-}
-
-void
-config_free(struct config *config)
-{
- struct coll *coll;
-
- while (!STAILQ_EMPTY(&config->colls)) {
- coll = STAILQ_FIRST(&config->colls);
- STAILQ_REMOVE_HEAD(&config->colls, co_next);
- coll_free(coll);
- }
- if (config->server != NULL)
- stream_close(config->server);
- if (config->laddr != NULL)
- free(config->laddr);
- free(config);
-}
-
-/* Create a new collection, inheriting options from the default collection. */
-struct coll *
-coll_new(struct coll *def)
-{
- struct coll *new;
-
- new = xmalloc(sizeof(struct coll));
- memset(new, 0, sizeof(struct coll));
- if (def != NULL) {
- new->co_options = def->co_options;
- new->co_umask = def->co_umask;
- if (def->co_host != NULL)
- new->co_host = xstrdup(def->co_host);
- if (def->co_base != NULL)
- new->co_base = xstrdup(def->co_base);
- if (def->co_date != NULL)
- new->co_date = xstrdup(def->co_date);
- if (def->co_prefix != NULL)
- new->co_prefix = xstrdup(def->co_prefix);
- if (def->co_release != NULL)
- new->co_release = xstrdup(def->co_release);
- if (def->co_tag != NULL)
- new->co_tag = xstrdup(def->co_tag);
- if (def->co_listsuffix != NULL)
- new->co_listsuffix = xstrdup(def->co_listsuffix);
- } else {
- new->co_tag = xstrdup(".");
- new->co_date = xstrdup(".");
- }
- new->co_keyword = keyword_new();
- new->co_accepts = pattlist_new();
- new->co_refusals = pattlist_new();
- new->co_attrignore = FA_DEV | FA_INODE;
- return (new);
-}
-
-void
-coll_override(struct coll *coll, struct coll *from, int mask)
-{
- size_t i;
- int newoptions, oldoptions;
-
- newoptions = from->co_options & mask;
- oldoptions = coll->co_options & (CO_MASK & ~mask);
-
- if (from->co_release != NULL) {
- if (coll->co_release != NULL)
- free(coll->co_release);
- coll->co_release = xstrdup(from->co_release);
- }
- if (from->co_host != NULL) {
- if (coll->co_host != NULL)
- free(coll->co_host);
- coll->co_host = xstrdup(from->co_host);
- }
- if (from->co_base != NULL) {
- if (coll->co_base != NULL)
- free(coll->co_base);
- coll->co_base = xstrdup(from->co_base);
- }
- if (from->co_colldir != NULL)
- coll->co_colldir = from->co_colldir;
- if (from->co_prefix != NULL) {
- if (coll->co_prefix != NULL)
- free(coll->co_prefix);
- coll->co_prefix = xstrdup(from->co_prefix);
- }
- if (newoptions & CO_CHECKOUTMODE) {
- if (from->co_tag != NULL) {
- if (coll->co_tag != NULL)
- free(coll->co_tag);
- coll->co_tag = xstrdup(from->co_tag);
- }
- if (from->co_date != NULL) {
- if (coll->co_date != NULL)
- free(coll->co_date);
- coll->co_date = xstrdup(from->co_date);
- }
- }
- if (from->co_listsuffix != NULL) {
- if (coll->co_listsuffix != NULL)
- free(coll->co_listsuffix);
- coll->co_listsuffix = xstrdup(from->co_listsuffix);
- }
- for (i = 0; i < pattlist_size(from->co_accepts); i++) {
- pattlist_add(coll->co_accepts,
- pattlist_get(from->co_accepts, i));
- }
- for (i = 0; i < pattlist_size(from->co_refusals); i++) {
- pattlist_add(coll->co_refusals,
- pattlist_get(from->co_refusals, i));
- }
- coll->co_options = oldoptions | newoptions;
-}
-
-char *
-coll_statussuffix(struct coll *coll)
-{
- const char *tag;
- char *suffix;
-
- if (coll->co_listsuffix != NULL) {
- xasprintf(&suffix, ".%s", coll->co_listsuffix);
- } else if (coll->co_options & CO_USERELSUFFIX) {
- if (coll->co_tag == NULL)
- tag = ".";
- else
- tag = coll->co_tag;
- if (coll->co_release != NULL) {
- if (coll->co_options & CO_CHECKOUTMODE) {
- xasprintf(&suffix, ".%s:%s",
- coll->co_release, tag);
- } else {
- xasprintf(&suffix, ".%s", coll->co_release);
- }
- } else if (coll->co_options & CO_CHECKOUTMODE) {
- xasprintf(&suffix, ":%s", tag);
- }
- } else
- suffix = NULL;
- return (suffix);
-}
-
-char *
-coll_statuspath(struct coll *coll)
-{
- char *path, *suffix;
-
- suffix = coll_statussuffix(coll);
- if (suffix != NULL) {
- if (coll->co_colldir[0] == '/')
- xasprintf(&path, "%s/%s/checkouts%s", coll->co_colldir,
- coll->co_name, suffix);
- else
- xasprintf(&path, "%s/%s/%s/checkouts%s", coll->co_base,
- coll->co_colldir, coll->co_name, suffix);
- } else {
- if (coll->co_colldir[0] == '/')
- xasprintf(&path, "%s/%s/checkouts", coll->co_colldir,
- coll->co_name);
- else
- xasprintf(&path, "%s/%s/%s/checkouts", coll->co_base,
- coll->co_colldir, coll->co_name);
- }
- free(suffix);
- return (path);
-}
-
-void
-coll_add(char *name)
-{
- struct coll *coll;
-
- cur_coll->co_name = name;
- coll_override(cur_coll, ovcoll, ovmask);
- if (cur_coll->co_release == NULL) {
- lprintf(-1, "Release not specified for collection "
- "\"%s\"\n", cur_coll->co_name);
- exit(1);
- }
- if (cur_coll->co_host == NULL) {
- lprintf(-1, "Host not specified for collection "
- "\"%s\"\n", cur_coll->co_name);
- exit(1);
- }
- if (!STAILQ_EMPTY(&colls)) {
- coll = STAILQ_LAST(&colls, coll, co_next);
- if (strcmp(coll->co_host, cur_coll->co_host) != 0) {
- lprintf(-1, "All \"host\" fields in the supfile "
- "must be the same\n");
- exit(1);
- }
- }
- STAILQ_INSERT_TAIL(&colls, cur_coll, co_next);
- cur_coll = coll_new(defaults);
-}
-
-void
-coll_free(struct coll *coll)
-{
-
- if (coll == NULL)
- return;
- if (coll->co_host != NULL)
- free(coll->co_host);
- if (coll->co_base != NULL)
- free(coll->co_base);
- if (coll->co_date != NULL)
- free(coll->co_date);
- if (coll->co_prefix != NULL)
- free(coll->co_prefix);
- if (coll->co_release != NULL)
- free(coll->co_release);
- if (coll->co_tag != NULL)
- free(coll->co_tag);
- if (coll->co_cvsroot != NULL)
- free(coll->co_cvsroot);
- if (coll->co_name != NULL)
- free(coll->co_name);
- if (coll->co_listsuffix != NULL)
- free(coll->co_listsuffix);
- keyword_free(coll->co_keyword);
- if (coll->co_dirfilter != NULL)
- globtree_free(coll->co_dirfilter);
- if (coll->co_dirfilter != NULL)
- globtree_free(coll->co_filefilter);
- if (coll->co_norsync != NULL)
- globtree_free(coll->co_norsync);
- if (coll->co_accepts != NULL)
- pattlist_free(coll->co_accepts);
- if (coll->co_refusals != NULL)
- pattlist_free(coll->co_refusals);
- free(coll);
-}
-
-void
-coll_setopt(int opt, char *value)
-{
- struct coll *coll;
- int error, mask;
-
- coll = cur_coll;
- switch (opt) {
- case PT_HOST:
- if (coll->co_host != NULL)
- free(coll->co_host);
- coll->co_host = value;
- break;
- case PT_BASE:
- if (coll->co_base != NULL)
- free(coll->co_base);
- coll->co_base = value;
- break;
- case PT_DATE:
- if (coll->co_date != NULL)
- free(coll->co_date);
- coll->co_date = value;
- coll->co_options |= CO_CHECKOUTMODE;
- break;
- case PT_PREFIX:
- if (coll->co_prefix != NULL)
- free(coll->co_prefix);
- coll->co_prefix = value;
- break;
- case PT_RELEASE:
- if (coll->co_release != NULL)
- free(coll->co_release);
- coll->co_release = value;
- break;
- case PT_TAG:
- if (coll->co_tag != NULL)
- free(coll->co_tag);
- coll->co_tag = value;
- coll->co_options |= CO_CHECKOUTMODE;
- break;
- case PT_LIST:
- if (strchr(value, '/') != NULL) {
- lprintf(-1, "Parse error in \"%s\": \"list\" suffix "
- "must not contain slashes\n", cfgfile);
- exit(1);
- }
- if (coll->co_listsuffix != NULL)
- free(coll->co_listsuffix);
- coll->co_listsuffix = value;
- break;
- case PT_UMASK:
- error = asciitoint(value, &mask, 8);
- free(value);
- if (error) {
- lprintf(-1, "Parse error in \"%s\": Invalid "
- "umask value\n", cfgfile);
- exit(1);
- }
- coll->co_umask = mask;
- break;
- case PT_USE_REL_SUFFIX:
- coll->co_options |= CO_USERELSUFFIX;
- break;
- case PT_DELETE:
- coll->co_options |= CO_DELETE | CO_EXACTRCS;
- break;
- case PT_COMPRESS:
- coll->co_options |= CO_COMPRESS;
- break;
- case PT_NORSYNC:
- coll->co_options |= CO_NORSYNC;
- break;
- }
-}
-
-/* Set "coll" as being the default collection. */
-void
-coll_setdef(void)
-{
-
- coll_free(defaults);
- defaults = cur_coll;
- cur_coll = coll_new(defaults);
-}
diff --git a/usr.bin/csup/config.h b/usr.bin/csup/config.h
deleted file mode 100644
index 6068b63..0000000
--- a/usr.bin/csup/config.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*-
- * Copyright (c) 2003-2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#ifndef _CONFIG_H_
-#define _CONFIG_H_
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/queue.h>
-
-#include <time.h>
-
-#include "fattr.h"
-#include "misc.h"
-
-/*
- * Collection options.
- */
-#define CO_BACKUP 0x00000001
-#define CO_DELETE 0x00000002
-#define CO_KEEP 0x00000004
-#define CO_OLD 0x00000008
-#define CO_UNLINKBUSY 0x00000010
-#define CO_NOUPDATE 0x00000020
-#define CO_COMPRESS 0x00000040
-#define CO_USERELSUFFIX 0x00000080
-#define CO_EXACTRCS 0x00000100
-#define CO_CHECKRCS 0x00000200
-#define CO_SKIP 0x00000400
-#define CO_CHECKOUTMODE 0x00000800
-#define CO_NORSYNC 0x00001000
-#define CO_KEEPBADFILES 0x00002000
-#define CO_EXECUTE 0x00004000
-#define CO_SETOWNER 0x00008000
-#define CO_SETMODE 0x00010000
-#define CO_SETFLAGS 0x00020000
-#define CO_NORCS 0x00040000
-#define CO_STRICTCHECKRCS 0x00080000
-#define CO_TRUSTSTATUSFILE 0x00100000
-#define CO_DODELETESONLY 0x00200000
-#define CO_DETAILALLRCSFILES 0x00400000
-
-#define CO_MASK 0x007fffff
-
-/* Options that the server is allowed to set. */
-#define CO_SERVMAYSET (CO_SKIP | CO_NORSYNC | CO_NORCS)
-/* Options that the server is allowed to clear. */
-#define CO_SERVMAYCLEAR CO_CHECKRCS
-
-struct coll {
- char *co_name;
- char *co_host;
- char *co_base;
- char *co_date;
- char *co_prefix;
- size_t co_prefixlen;
- char *co_release;
- char *co_tag;
- char *co_cvsroot;
- int co_attrignore;
- struct pattlist *co_accepts;
- struct pattlist *co_refusals;
- struct globtree *co_dirfilter;
- struct globtree *co_filefilter;
- struct globtree *co_norsync;
- const char *co_colldir;
- char *co_listsuffix;
- time_t co_scantime; /* Set by the detailer thread. */
- int co_options;
- mode_t co_umask;
- struct keyword *co_keyword;
- STAILQ_ENTRY(coll) co_next;
-};
-
-struct config {
- STAILQ_HEAD(, coll) colls;
- struct fixups *fixups;
- char *host;
- struct sockaddr *laddr;
- socklen_t laddrlen;
- int deletelim;
- int socket;
- struct chan *chan0;
- struct chan *chan1;
- struct stream *server;
- fattr_support_t fasupport;
- int reqauth;
-};
-
-struct config *config_init(const char *, struct coll *, int);
-int config_checkcolls(struct config *);
-void config_free(struct config *);
-
-struct coll *coll_new(struct coll *);
-void coll_override(struct coll *, struct coll *, int);
-char *coll_statuspath(struct coll *);
-char *coll_statussuffix(struct coll *);
-void coll_add(char *);
-void coll_free(struct coll *);
-void coll_setdef(void);
-void coll_setopt(int, char *);
-
-#endif /* !_CONFIG_H_ */
diff --git a/usr.bin/csup/cpasswd.1 b/usr.bin/csup/cpasswd.1
deleted file mode 100644
index 8d0ef09..0000000
--- a/usr.bin/csup/cpasswd.1
+++ /dev/null
@@ -1,119 +0,0 @@
-.\" Copyright 1999-2003 John D. Polstra.
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgment:
-.\" This product includes software developed by John D. Polstra.
-.\" 4. The name of the author may not be used to endorse or promote products
-.\" derived from this software without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-.\"
-.\" $Id: cvpasswd.1,v 1.4 2003/03/04 18:24:42 jdp Exp $
-.\" $FreeBSD$
-.\"
-.Dd June 27, 2007
-.Dt CPASSWD 1
-.Os FreeBSD
-.Sh NAME
-.Nm cpasswd
-.Nd scramble passwords for csup authentication
-.Sh SYNOPSIS
-.Nm
-.Ar clientName
-.Ar serverName
-.Sh DESCRIPTION
-The
-.Nm
-utility creates scrambled passwords for the
-.Nm CVSup
-server's authentication database. It is invoked with a client name
-and a server name.
-.Ar ClientName
-is the name the client uses to gain access to the
-server. By convention, e-mail addresses are used for all client
-names, e.g.,
-.Ql BillyJoe@FreeBSD.org .
-Client names are case-insensitive.
-.Pp
-.Ar ServerName
-is the name of the
-.Nm CVSup
-server which the client wishes to access. By convention,
-it is the canonical fully-qualified domain name of the server, e.g.,
-.Ql CVSup.FreeBSD.ORG .
-This must agree with the server's own idea of its name. The name is
-case-insensitive.
-.Pp
-To set up authentication for a given server, one must perform the
-following steps:
-.Bl -enum
-.It
-Obtain the official
-.Ar serverName
-from the administrator of the server or from some other source.
-.It
-Choose an appropriate
-.Ar clientName .
-It should be in the form of a valid e-mail address, to make it easy
-for the server administrator to contact the user if necessary.
-.It
-Choose an arbitrary secret
-.Ar password .
-.It
-Run
-.Nm cpasswd ,
-and type in the
-.Ar password
-when prompted for it. The utility will print out a line to send
-to the server administrator, and instruct you how to modify your
-.Li $ Ns Ev HOME Ns Pa /.csup/auth
-file. You should use a secure channel to send the line to the
-server administrator.
-.El
-.Pp
-Since
-.Li $ Ns Ev HOME Ns Pa /.csup/auth
-contains passwords, you should ensure that it is not readable by
-anyone except yourself.
-.Sh FILES
-.Bl -tag -width $HOME/.csup/authxx -compact
-.It Li $ Ns Ev HOME Ns Pa /.csup/auth
-Authentication password file.
-.El
-.Sh SEE ALSO
-.Xr csup 1 ,
-.Xr cvsup 1 ,
-.Xr cvsupd 8 .
-.Bd -literal
-http://www.cvsup.org/
-.Ed
-.Sh AUTHORS
-.An -nosplit
-.An Petar Zhivkov Petrov Aq Mt pesho.petrov@gmail.com
-is the author of
-.Nm ,
-the rewrite of
-.Nm cvpasswd .
-.An John Polstra Aq Mt jdp@polstra.com
-is the author of
-.Nm CVSup .
-.Sh LEGALITIES
-CVSup is a registered trademark of John D. Polstra.
diff --git a/usr.bin/csup/cpasswd.sh b/usr.bin/csup/cpasswd.sh
deleted file mode 100755
index 71e17c5..0000000
--- a/usr.bin/csup/cpasswd.sh
+++ /dev/null
@@ -1,135 +0,0 @@
-#! /bin/sh
-#
-# Copyright 2007. Petar Zhivkov Petrov
-# pesho.petrov@gmail.com
-#
-# $FreeBSD$
-
-usage() {
- echo "Usage: $0 clientName serverName"
- echo " $0 -v"
-}
-
-countChars() {
- _count="`echo "$1" | sed -e "s/[^$2]//g" | tr -d "\n" | wc -c`"
- return 0
-}
-
-readPassword() {
- while [ true ]; do
- stty -echo
- read -p "$1" _password
- stty echo
- echo ""
- countChars "$_password" ":"
- if [ $_count != 0 ]; then
- echo "Sorry, password must not contain \":\" characters"
- echo ""
- else
- break
- fi
- done
- return 0
-}
-
-makeSecret() {
- local clientLower="`echo "$1" | tr "[:upper:]" "[:lower:]"`"
- local serverLower="`echo "$2" | tr "[:upper:]" "[:lower:]"`"
- local secret="`md5 -qs "$clientLower:$serverLower:$3"`"
- _secret="\$md5\$$secret"
-}
-
-if [ $# -eq 1 -a "X$1" = "X-v" ]; then
- echo "Csup authentication key generator"
- usage
- exit
-elif [ $# -ne 2 ]; then
- usage
- exit
-fi
-
-clientName=$1
-serverName=$2
-
-#
-# Client name must contain exactly one '@' and at least one '.'.
-# It must not contain a ':'.
-#
-
-countChars "$clientName" "@"
-aCount=$_count
-
-countChars "$clientName" "."
-dotCount=$_count
-if [ $aCount -ne 1 -o $dotCount -eq 0 ]; then
- echo "Client name must have the form of an e-mail address,"
- echo "e.g., \"user@domain.com\""
- exit
-fi
-
-countChars "$clientName" ":"
-colonCount=$_count
-if [ $colonCount -gt 0 ]; then
- echo "Client name must not contain \":\" characters"
- exit
-fi
-
-#
-# Server name must not contain '@' and must have at least one '.'.
-# It also must not contain a ':'.
-#
-
-countChars "$serverName" "@"
-aCount=$_count
-
-countChars "$serverName" "."
-dotCount=$_count
-if [ $aCount != 0 -o $dotCount = 0 ]; then
- echo "Server name must be a fully-qualified domain name."
- echo "e.g., \"host.domain.com\""
- exit
-fi
-
-countChars "$serverName" ":"
-colonCount=$_count
-if [ $colonCount -gt 0 ]; then
- echo "Server name must not contain \":\" characters"
- exit
-fi
-
-#
-# Ask for password and generate secret.
-#
-
-while [ true ]; do
- readPassword "Enter password: "
- makeSecret "$clientName" "$serverName" "$_password"
- secret=$_secret
-
- readPassword "Enter same password again: "
- makeSecret "$clientName" "$serverName" "$_password"
- secret2=$_secret
-
- if [ "X$secret" = "X$secret2" ]; then
- break
- else
- echo "Passwords did not match. Try again."
- echo ""
- fi
-done
-
-echo ""
-echo "Send this line to the server administrator at $serverName:"
-echo "-------------------------------------------------------------------------------"
-echo "$clientName:$secret::"
-echo "-------------------------------------------------------------------------------"
-echo "Be sure to send it using a secure channel!"
-echo ""
-echo "Add this line to your file \"$HOME/.csup/auth\", replacing \"XXX\""
-echo "with the password you typed in:"
-echo "-------------------------------------------------------------------------------"
-echo "$serverName:$clientName:XXX:"
-echo "-------------------------------------------------------------------------------"
-echo "Make sure the file is readable and writable only by you!"
-echo ""
-
diff --git a/usr.bin/csup/csup.1 b/usr.bin/csup/csup.1
deleted file mode 100644
index e40204b4..0000000
--- a/usr.bin/csup/csup.1
+++ /dev/null
@@ -1,996 +0,0 @@
-.\" Copyright 1996-2003 John D. Polstra.
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-.\"
-.\" $Id: cvsup.1,v 1.70 2003/03/04 18:23:46 jdp Exp $
-.\" $FreeBSD$
-.\"
-.Dd February 8, 2013
-.Dt CSUP 1
-.Os FreeBSD
-.Sh NAME
-.Nm csup
-.Nd network distribution package for CVS repositories
-.Sh SYNOPSIS
-.Nm
-.Op Fl 146aksvzZ
-.Op Fl A Ar addr
-.Op Fl b Ar base
-.Op Fl c Ar collDir
-.Op Fl d Ar delLimit
-.Op Fl h Ar host
-.Op Fl i Ar pattern
-.Op Fl l Ar lockfile
-.Op Fl L Ar verbosity
-.Op Fl p Ar port
-.Op Fl r Ar maxRetries
-.Ar supfile
-.Sh DESCRIPTION
-.Nm
-is a software package for updating collections of files across a network.
-It is a rewrite of the
-.Nm CVSup
-software in C.
-This manual page describes the usage of the
-.Nm
-client program.
-.Pp
-Unlike more traditional network distribution packages, such as
-.Nm rdist
-and
-.Nm sup ,
-.Nm
-has specific optimizations for distributing CVS repositories.
-.Nm
-takes advantage of the properties of CVS repositories and the files they
-contain (in particular, RCS files), enabling it to perform updates much
-faster than traditional systems.
-.Pp
-.Nm
-is a general-purpose network file updating package.
-It is extremely fast,
-even for collections of files which have nothing to do with CVS or
-RCS.
-.Sh OPTIONS
-The client program
-.Nm
-requires at least a single argument,
-.Ar supfile .
-It names a file describing one or more collections of files to be
-transferred and/or updated from the server.
-The
-.Ar supfile
-has a format similar to the corresponding file used by
-.Nm sup .
-In most cases,
-.Nm
-can use existing
-.Nm sup Ar supfiles .
-.Pp
-The following options are supported by
-.Nm :
-.Bl -tag -width Fl
-.It Fl 1
-Disables automatic retries when transient failures occur.
-Without this option, a transient failure such as a dropped network
-connection causes
-.Nm
-to retry repeatedly, using randomized exponential backoff to space the
-retries.
-This option is equivalent to
-.Fl r Cm 0 .
-.It Fl 4
-Forces
-.Nm
-to use IPv4 addresses only.
-.It Fl 6
-Forces
-.Nm
-to use IPv6 addresses only.
-.It Fl a
-Requires the server to authenticate itself (prove its identity) to
-the client. If authentication of the server fails, the update is
-canceled. See
-.Sx AUTHENTICATION ,
-below.
-.It Fl A Ar addr
-Specifies a local address to bind to when connecting to the server.
-The local address might be a hostname or a numeric host address string
-consisting of a dotted decimal IPv4 address or an IPv6 address.
-This may be useful on hosts which have multiple IP addresses.
-.It Fl b Ar base
-Specifies the base directory under which
-.Nm
-will maintain its bookkeeping files, overriding any
-.Cm base
-specifications in the
-.Ar supfile .
-.It Fl c Ar collDir
-Specifies the subdirectory of
-.Ar base
-where the information about the collections is maintained.
-The default is
-.Pa sup .
-.It Fl d Ar delLimit
-Specifies the maximum number of files that may be deleted in a
-single update run.
-Any attempt to exceed the limit results in a fatal error.
-This can provide some protection against temporary configuration
-mistakes on the server.
-The default limit is infinity.
-.It Fl h Ar host
-Specifies the server host to contact, overriding any
-.Cm host
-specifications in the
-.Ar supfile .
-.It Fl i Ar pattern
-Causes
-.Nm
-to include only files and directories matching
-.Ar pattern
-in the update. If a directory matches the pattern, then the entire
-subtree rooted at the directory is included. If this option is
-specified multiple times, the patterns are combined using the
-.Ql or
-operation. If no
-.Fl i
-options are given, the default is to update all files in each
-collection.
-.Pp
-The
-.Ar pattern
-is a standard file name pattern.
-It is interpreted relative to the collection's prefix directory.
-Slash characters are matched only by explicit slashes in the pattern.
-Leading periods in file name are not treated specially.
-.It Fl k
-Causes
-.Nm
-to keep the temporary copies of any incorrectly edited files, in the
-event of checksum mismatches.
-This option is for debugging, to help determine why the files were
-edited incorrectly.
-Regardless of whether this option is specified, the permanent versions
-of faulty files are replaced with correct versions obtained by
-transferring the files in their entirety.
-Such transfers are called fixups.
-.It Fl l Ar lockfile
-Creates and locks the
-.Ar lockfile
-while the update is in progress.
-If
-.Ar lockfile
-is already locked,
-.Nm
-fails without performing automatic retries.
-This option is useful when
-.Nm
-is executed periodically from
-.Nm cron .
-It prevents a job from interfering with an earlier job that is perhaps
-taking extra long because of network problems.
-.Pp
-The process-ID is written to the lock file in text form when the lock
-is successfully acquired.
-Upon termination of the update, the lock file is removed.
-.It Fl L Ar verbosity
-Sets the verbosity level for output.
-A level of 0 causes
-.Nm
-to be completely silent unless errors occur.
-A level of 1 (the default) causes each updated file to be listed.
-A level of 2 provides more detailed information about the updates
-performed on each file.
-All messages are directed to the standard output.
-.It Fl p Ar port
-Sets the TCP port to which
-.Nm
-attempts to connect on the server host.
-The default port is 5999.
-.It Fl r Ar maxRetries
-Limits the number of automatic retries that will be attempted when
-transient errors such as lost network connections are encountered.
-By default,
-.Nm
-will retry indefinitely until an update is successfully completed.
-The retries are spaced using randomized exponential backoff.
-Note that
-.Fl r Cm 0
-is equivalent to the
-.Fl 1
-option.
-.It Fl s
-Suppresses the check of each client file's status against what is
-recorded in the list file. Instead, the list file is assumed to be
-accurate. This option greatly reduces the amount of disk activity and
-results in faster updates with less load on the client host. However
-it should only be used if client's files are never modified locally in
-any way. Mirror sites may find this option beneficial to reduce the
-disk load on their systems. For safety, even mirror sites should run
-.Nm
-occasionally (perhaps once a day) without the
-.Fl s
-option.
-.Pp
-Without the
-.Fl s
-option,
-.Nm
-performs a
-.Xr stat 2
-call on each file and verifies that its attributes match those
-recorded in the list file. This ensures that any file changes made
-outside of
-.Nm
-are detected and corrected.
-.Pp
-If the
-.Fl s
-option is used when one or more files have been modified locally, the
-results are undefined. Local file damage may remain uncorrected,
-updates may be missed, or
-.Nm
-may abort prematurely.
-.It Fl v
-Prints the version number and exits, without contacting the server.
-.It Fl z
-Enables compression for all collections, as if the
-.Cm compress
-keyword were added to every collection in the
-.Ar supfile .
-.It Fl Z
-Disables compression for all collections, as if the
-.Cm compress
-keyword were removed from every collection in the
-.Ar supfile .
-.El
-.Pp
-The
-.Ar supfile
-is a text file which specifies the file collections to be updated.
-Comments begin with
-.Ql #
-and extend to the end of the line. Lines that are empty except for
-comments and white space are ignored. Each remaining line begins
-with the name of a server-defined collection of files. Following the
-collection name on the line are zero or more keywords or keyword=value
-pairs.
-.Pp
-Default settings may be specified in lines whose collection name is
-.Cm *default .
-Such defaults will apply to subsequent lines in the
-.Ar supfile .
-Multiple
-.Cm *default
-lines may be present.
-New values augment or override any defaults specified earlier in the
-.Ar supfile .
-Values specified explicitly for a collection override any default
-values.
-.Pp
-The most commonly used keywords are:
-.Bl -tag -width Fl
-.It Cm release= Ns Ar releaseName
-This specifies the release of the files within a collection.
-Like collection names, release names are defined by the server
-configuration files. Usually there is only one release in each
-collection, but there may be any number. Collections which come from
-a CVS repository often use
-.Cm release=cvs
-by convention. Non-CVS collections conventionally use
-.Cm release=current .
-.It Cm base= Ns Ar base
-This specifies a directory under which
-.Nm
-will maintain its bookkeeping files, describing the state of each
-collection on the client machine.
-The
-.Ar base
-directory must already exist;
-.Nm
-will not create it.
-The default
-.Ar base
-directory is
-.Pa /usr/local/etc/cvsup .
-.It Cm prefix= Ns Ar prefix
-This is the directory under which updated files will be placed.
-By default, it is the same as
-.Ar base .
-If it is not an absolute pathname, it is interpreted relative to
-.Ar base .
-The
-.Ar prefix
-directory must already exist;
-.Nm
-will not create it.
-.Pp
-As a special case, if
-.Ar prefix
-is a symbolic link pointing to a nonexistent file named
-.Ql SKIP ,
-then
-.Nm
-will skip the collection.
-The parameters associated with the collection are still checked for
-validity, but none of its files will be updated.
-This feature allows a site to use a standard
-.Ar supfile
-on several machines, yet control which collections get updated on a
-per-machine basis.
-.It Cm host= Ns Ar hostname
-This specifies the server machine from which all files will be taken.
-.Nm
-requires that all collections in a single run come from the same host.
-If you wish to update collections from several different hosts, you must
-run
-.Nm
-several times.
-.It Cm delete
-The presence of this keyword gives
-.Nm
-permission to delete files.
-If it is missing, no files will be deleted.
-.Pp
-The presence of the
-.Cm delete
-keyword puts
-.Nm
-into so-called
-.Em exact
-mode. In exact mode,
-.Nm
-does its best to make the client's files correspond to those on the server.
-This includes deleting individual deltas and symbolic tags from RCS
-files, as well as deleting entire files.
-In exact mode,
-.Nm
-verifies every edited file with a checksum, to ensure that the edits
-have produced a file identical to the master copy on the server.
-If the checksum test fails for a file, then
-.Nm
-falls back upon transferring the entire file.
-.Pp
-In general,
-.Nm
-deletes only files which are known to the server.
-Extra files present in the client's tree are left alone, even in exact
-mode.
-More precisely,
-.Nm
-is willing to delete two classes of files:
-.Bl -bullet -compact
-.It
-Files that were previously created or updated by
-.Nm
-itself.
-.It
-Checked-out versions of files which are marked as dead on the server.
-.El
-.It Cm use-rel-suffix
-Causes
-.Nm
-to append a suffix constructed from the release and tag to the name of
-each list file that it maintains.
-See
-.Sx THE LIST FILE
-for details.
-.It Cm compress
-This enables compression of all data sent across the network.
-Compression is quite effective, normally eliminating 65% to 75% of the
-bytes that would otherwise need to be transferred.
-However, it is costly in terms of CPU time on both the client and the
-server.
-On local area networks, compression is generally counter-productive; it
-actually slows down file updates.
-On links with speeds of 56K bits/second or less, compression is almost
-always beneficial.
-For network links with speeds between these two extremes, let
-experimentation be your guide.
-.Pp
-The
-.Fl z
-command line option enables the
-.Cm compress
-keyword for all collections, regardless of what is specified in the supfile.
-Likewise, the
-.Fl Z
-command line option disables the
-.Cm compress
-option for all collections.
-.Nm
-uses a looser checksum for RCS files, which ignores harmless
-differences in white space. Different versions of CVS and RCS produce
-a variety of differences in white space for the same RCS files. Thus
-the strict checksum can report spurious mismatches for files which are
-logically identical. This can lead to numerous unneeded
-.Dq fixups ,
-and thus to slow updates.
-.It Cm umask= Ns Ar n
-Causes
-.Nm
-to use a umask value of
-.Ar n
-(an octal number) when updating the files in the collection.
-This option is ignored if
-.Cm preserve
-is specified.
-.El
-.Pp
-Some additional, more specialized keywords are described below.
-Unrecognized keywords are silently ignored for backward compatibility
-with
-.Nm sup .
-.Sh CVS MODE
-.Nm CVSup
-supports two primary modes of operation.
-They are called
-.Em CVS
-mode and
-.Em checkout
-mode.
-.Pp
-In CVS mode, the client receives copies of the actual RCS files making
-up the master CVS repository. CVS mode is the default mode of operation.
-It is appropriate when the user wishes to maintain a full copy of the
-CVS repository on the client machine.
-.Pp
-CVS mode is also appropriate for file collections which are not
-based upon a CVS repository. The files are simply transferred
-verbatim, without interpretation.
-.Sh CHECKOUT MODE
-In checkout mode, the client receives specific revisions of files,
-checked out directly from the server's CVS repository.
-Checkout mode allows the client to receive any version from the
-repository, without requiring any extra disk space on the server for
-storing multiple versions in checked-out form.
-Checkout mode provides much flexibility beyond that basic functionality,
-however.
-The client can specify any CVS symbolic tag, or any date, or both, and
-.Nm
-will provide the corresponding checked-out versions of the files in the
-repository.
-.Pp
-Checkout mode is selected on a per-collection basis, by the presence of
-one or both of the following keywords in the
-.Ar supfile :
-.Bl -tag -width Fl
-.It Cm tag= Ns Ar tagname
-This specifies a symbolic tag that should be used to select the
-revisions that are checked out from the CVS repository.
-The tag may refer to either a branch or a specific revision.
-It must be symbolic; numeric revision numbers are not supported.
-.Pp
-For the FreeBSD source repository, the most commonly used tags will be:
-.Bl -tag -width RELENG_6
-.It Li RELENG_6
-The
-.Ql stable
-branch.
-.It Li \&.
-The main branch (the
-.Ql current
-release).
-This is the default, if only the
-.Cm date
-keyword is given.
-.El
-.Sm off
-.It Xo Cm date=
-.Op Ar cc
-.Ar yy.mm.dd.hh.mm.ss
-.Xc
-.Sm on
-This specifies a date that should be used to select the revisions that
-are checked out from the CVS repository.
-The client will receive the revisions that were in effect at the
-specified date and time.
-.Pp
-At present, the date format is inflexible. All 17 or 19 characters must
-be specified, exactly as shown.
-For the years 2000 and beyond, specify the century
-.Ar cc .
-For earlier years, specify only the last two digits
-.Ar yy .
-Dates and times are considered to
-be GMT.
-The default date is
-.Ql \&. ,
-which means
-.Dq as late as possible .
-.El
-.Pp
-To enable checkout mode, you must specify at least one of these keywords.
-If both are missing,
-.Nm
-defaults to CVS mode.
-.Pp
-If both a branch tag and a date are specified, then the revisions on the
-given branch, as of the given date, will be checked out. It is
-permitted, but not particularly useful, to specify a date with a
-specific release tag.
-.Pp
-In checkout mode, the tag and/or date may be changed between updates.
-For example, suppose that a collection has been transferred using the
-specification
-.Ql tag=. .
-The user could later change the specification to
-.Ql tag=RELENG_3 .
-This would cause
-.Nm
-to edit the checked-out files in such a way as to transform them from the
-.Ql current
-versions to the
-.Ql stable
-versions.
-In general,
-.Nm
-is willing to transform any tag/date combination into any other tag/date
-combination, by applying the intervening RCS deltas to the existing files.
-.Pp
-When transforming a collection of checked-out files from one tag to
-another, it is important to specify the
-.Cm list
-keyword in the
-.Ar supfile ,
-to ensure that the same list file is used both before and after the
-transformation.
-The list file is described in
-.Sx THE LIST FILE ,
-below.
-.Sh THE LIST FILE
-For efficiency,
-.Nm
-maintains a bookkeeping file for each collection, called the list file.
-The list file contains information about which files and revisions the client
-currently possesses.
-It also contains information used for verifying that the list file
-is consistent with the actual files in the client's tree.
-.Pp
-The list file is not strictly necessary. If it is deleted, or becomes
-inconsistent with the actual client files,
-.Nm
-falls back upon a less efficient method of identifying the client's
-files and performing its updates.
-Depending on
-.Nm csup Ns No 's
-mode of operation, the fallback method employs time stamps, checksums, or
-analysis of RCS files.
-.Pp
-Because the list file is not essential,
-.Nm
-is able to
-.Dq adopt
-an existing file tree acquired by FTP or from a CD-ROM.
-.Nm
-identifies the client's versions of the files, updates them as
-necessary, and creates a list file for future use.
-Adopting a foreign file tree is not as fast as performing a normal
-update.
-It also produces a heavier load on the server.
-.Pp
-The list file is stored in a collection-specific directory; see
-.Sx FILES
-for details.
-Its name always begins with
-.Ql checkouts .
-If the keyword
-.Cm use-rel-suffix
-is specified in the
-.Ar supfile ,
-a suffix, formed from the release and tag, is appended to the name.
-The default suffix can be overridden by specifying an explicit suffix in
-the
-.Ar supfile :
-.Bl -tag -width Fl
-.It Cm list= Ns Ar suffix
-This specifies a suffix for the name of the list file. A leading dot is
-provided automatically.
-For example,
-.Ql list=stable
-would produce a list file named
-.Pa checkouts.stable ,
-regardless of the release, tag, or
-.Cm use-rel-suffix
-keyword.
-.El
-.Sh REFUSE FILES
-The user can specify sets of files that he does not wish to receive.
-The files are specified as file name patterns in so-called
-.Em refuse
-files.
-The patterns are separated by whitespace, and multiple patterns are
-permitted on each line.
-Files and directories matching the patterns are neither updated nor
-deleted; they are simply ignored.
-.Pp
-There is currently no provision for comments in refuse files.
-.Pp
-The patterns are similar to those of
-.Xr sh 1 ,
-except that there is no special treatment for slashes or for
-filenames that begin with a period.
-For example, the pattern
-.Ql *.c
-will match any file name ending with
-.Ql \&.c
-including those in subdirectories, such as
-.Ql foo/bar/lam.c .
-All patterns are interpreted relative to the collection's prefix
-directory.
-.Pp
-If the files are coming from a CVS repository, as is usually
-the case, then they will be RCS files. These have a
-.Ql \&,v
-suffix which must be taken into account in the patterns. For
-example, the FreeBSD documentation files are in a sub-directory of
-.Ar base
-called
-.Ql doc .
-If
-.Ql Makefile
-from that directory is not required then the line
-.Pp
-.Bl -item -compact -offset indent
-.It
-.Pa doc/Makefile
-.El
-.Pp
-will not work because the file on the server is called
-.Ql Makefile,v .
-A better solution would be
-.Pp
-.Bl -item -compact -offset indent
-.It
-.Pa doc/Makefile*
-.El
-.Pp
-which will match whether
-.Ql Makefile
-is an RCS file or not.
-.Pp
-As another example, to receive the FreeBSD documentation files without
-the Japanese, Russian, and Chinese translations, create a refuse file
-containing the following lines:
-.Pp
-.Bl -item -compact -offset indent
-.It
-.Pa doc/ja*
-.It
-.Pa doc/ru*
-.It
-.Pa doc/zh*
-.El
-.Pp
-As many as three refuse files are examined for each
-.Ar supfile
-line.
-There can be a global refuse file named
-.Sm off
-.Ar base / Ar collDir Pa /refuse
-.Sm on
-which applies to all collections and releases.
-There can be a per-collection refuse file named
-.Sm off
-.Xo Ar base / Ar collDir / Ar collection
-.Pa /refuse
-.Xc
-.Sm on
-which applies to a specific collection.
-Finally, there can be a per-release and tag refuse file which applies only
-to a given release/tag combination within a collection.
-The name of the latter is formed by suffixing the name of the
-per-collection refuse file in the same manner as described above for the
-list file.
-None of the refuse files are required to exist.
-.Pp
-.Nm
-has a built-in default value of
-.Ar /usr/local/etc/cvsup
-for
-.Ar base
-and
-.Ar sup
-for
-.Ar collDir
-but it is possible to override both of these. The value of
-.Ar base
-can be changed using the
-.Fl b
-option or a
-.Ar base=pathname
-entry in the
-.Ar supfile .
-(If both are used the
-.Fl b
-option will override the
-.Ar supfile
-entry.) The value of
-.Ar collDir
-can only be changed with the
-.Fl c
-option; there is no
-.Ar supfile
-command to change it.
-.Pp
-As an example, suppose that the
-.Ar base
-and
-.Ar collDir
-both have their default values, and that the collection and release are
-.Ql src-all
-and
-.Ql cvs ,
-respectively.
-Assume further that checkout mode is being used with
-.Ql tag=RELENG_3 .
-The three possible refuse files would then be named:
-.Pp
-.Bl -item -compact -offset indent
-.It
-.Pa /usr/local/etc/cvsup/sup/refuse
-.It
-.Pa /usr/local/etc/cvsup/sup/src-all/refuse
-.It
-.Pa /usr/local/etc/cvsup/sup/src-all/refuse.cvs:RELENG_3
-.El
-.Pp
-If the
-.Ar supfile
-includes the command
-.Ar base=/foo
-the refuse files would be:
-.Pp
-.Bl -item -compact -offset indent
-.It
-.Pa /foo/sup/refuse
-.It
-.Pa /foo/sup/src-all/refuse
-.It
-.Pa /foo/sup/src-all/refuse.cvs:RELENG_3
-.El
-.Pp
-If
-.Fl b
-.Ar /bar
-is used (even with
-.Ar base=/foo
-in the
-.Ar supfile ) :
-.Pp
-.Bl -item -compact -offset indent
-.It
-.Pa /bar/sup/refuse
-.It
-.Pa /bar/sup/src-all/refuse
-.It
-.Pa /bar/sup/src-all/refuse.cvs:RELENG_3
-.El
-.Pp
-and with
-.Fl c
-.Ar stool
-as well:
-.Pp
-.Bl -item -compact -offset indent
-.It
-.Pa /bar/stool/refuse
-.It
-.Pa /bar/stool/src-all/refuse
-.It
-.Pa /bar/stool/src-all/refuse.cvs:RELENG_3
-.El
-.Sh AUTHENTICATION
-.Nm
-implements an optional authentication mechanism which can be used by the
-client and server to verify each other's identities.
-Public CVSup servers normally do not enable authentication.
-.Nm
-users may ignore this section unless they have been informed
-that authentication is required by the administrator of their server.
-.Pp
-The authentication subsystem uses a
-challenge-response protocol which is immune to packet sniffing and
-replay attacks. No passwords are sent over the network in either
-direction. Both the client and the server can independently verify
-the identities of each other.
-.Pp
-The file
-.Li $ Ns Ev HOME Ns Pa /.csup/auth
-holds the information used for authentication. This file contains a
-record for each server that the client is allowed to access. Each
-record occupies one line in the file. Lines beginning with
-.Ql #
-are ignored, as are lines containing only white space. White space is
-significant everywhere else in the file. Fields are separated by
-.Ql \&:
-characters.
-.Pp
-Each record of the file has the following form:
-.Bd -literal -offset indent
-.Sm off
-.Xo Ar serverName No : Ar clientName No :
-.Ar password No : Ar comment
-.Xc
-.Sm on
-.Ed
-.Pp
-All fields must be present even if some of them are empty.
-.Ar ServerName
-is the name of the server to which the record applies. By convention,
-it is the canonical fully-qualified domain name of the server, e.g.,
-.Ql CVSup177.FreeBSD.ORG .
-This must agree with the server's own idea of its name. The name is
-case-insensitive.
-.Pp
-.Ar ClientName
-is the name the client uses to gain access to the server. By
-convention, e-mail addresses are used for all client names, e.g.,
-.Ql BillyJoe@FreeBSD.org .
-Client names are case-insensitive.
-.Pp
-.Ar Password
-is a secret string of characters that the client uses to prove its
-identity. It may not contain any
-.Ql \&:
-or newline characters.
-.Pp
-.Ar Comment
-may contain any additional information to identify the record. It
-is not interpreted by the program.
-.Pp
-To set up authentication for a given server, one must perform the
-following steps:
-.Bl -enum
-.It
-Obtain the official
-.Ar serverName
-from the administrator of the server or from some other source.
-.It
-Choose an appropriate
-.Ar clientName .
-It should be in the form of a valid e-mail address, to make it easy
-for the server administrator to contact the user if necessary.
-.It
-Choose an arbitrary secret
-.Ar password .
-.It
-Run the
-.Nm cpasswd
-utility, and type in the
-.Ar password
-when prompted for it. The utility will print out a line to send
-to the server administrator, and instruct you how to modify your
-.Li $ Ns Ev HOME Ns Pa /.csup/auth
-file. You should use a secure channel to send the line to the
-server administrator.
-.El
-.Pp
-Since
-.Li $ Ns Ev HOME Ns Pa /.csup/auth
-contains passwords, you should ensure that it is not readable by
-anyone except yourself.
-.Pp
-Authentication works independently in both directions. The server
-administrator controls whether you must prove your identity.
-You control whether to check the server's identity, by means of the
-.Fl a
-command line option.
-.Sh csup AND FIREWALLS
-In its default mode,
-.Nm
-will work through any firewall which permits outbound connections to
-port 5999 of the server host.
-.Sh USING csup WITH SOCKS
-.Nm
-can be used through a SOCKS proxy server with the
-.Nm tsocks
-command.
-The
-.Nm
-executable needs to be dynamically-linked with the system
-libraries for
-.Nm tsocks
-to work properly.
-.Sh USING ssh PORT FORWARDING
-As an alternative to SOCKS, a user behind a firewall can penetrate it
-with the TCP port forwarding provided by the Secure Shell package
-.Nm ssh .
-The user must have a login account on the
-.Nm CVSup
-server host in order to do this.
-The procedure is as follows:
-.Bl -enum
-.It
-Establish a connection to the server host with
-.Nm ssh ,
-like this:
-.Bd -literal
-ssh -f -x -L 5999:localhost:5999 serverhost sleep 60
-.Ed
-.Pp
-Replace
-.Ar serverhost
-with the hostname of the CVSup server, but type
-.Ql localhost
-literally.
-This sets up the required port forwarding.
-You must start
-.Nm
-before the 60-second
-.Nm sleep
-finishes.
-Once the update has begun,
-.Nm ssh
-will keep the forwarded channels open as long as they are needed.
-.It
-Run
-.Nm
-on the local host, including the arguments
-.Ql -h localhost
-on the command line.
-.El
-.Sh FILES
-.Bl -tag -width base/sup/collection/checkouts*xx -compact
-.It Pa /usr/local/etc/cvsup
-Default
-.Ar base
-directory.
-.It Pa sup
-Default
-.Ar collDir
-subdirectory.
-.Sm off
-.It Xo Ar base / Ar collDir / Ar collection
-.Pa /checkouts*
-.Xc
-.Sm on
-List files.
-.El
-.Sh SEE ALSO
-.Xr cpasswd 1 ,
-.Xr cvs 1 ,
-.Xr rcsintro 1 ,
-.Xr ssh 1 .
-.Sh AUTHORS
-.An -nosplit
-.An Maxime Henrion Aq Mt mux@FreeBSD.org
-is the author of
-.Nm ,
-the rewrite of
-.Nm CVSup
-in C.
-.An John Polstra Aq Mt jdp@polstra.com
-is the author of
-.Nm CVSup .
-.Sh LEGALITIES
-CVSup is a registered trademark of John D. Polstra.
-.Pp
-.Nm
-is released under a 2-clauses BSD license.
-.Sh BUGS
-An RCS file is not recognized as such unless its name ends with
-.Ql \&,v .
-.Pp
-Any directory named
-.Ql Attic
-is assumed to be a CVS Attic, and is treated specially.
diff --git a/usr.bin/csup/detailer.c b/usr.bin/csup/detailer.c
deleted file mode 100644
index 5592655..0000000
--- a/usr.bin/csup/detailer.c
+++ /dev/null
@@ -1,603 +0,0 @@
-/*-
- * Copyright (c) 2003-2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <assert.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include "config.h"
-#include "detailer.h"
-#include "fixups.h"
-#include "globtree.h"
-#include "misc.h"
-#include "mux.h"
-#include "proto.h"
-#include "rcsfile.h"
-#include "rsyncfile.h"
-#include "status.h"
-#include "stream.h"
-
-/* Internal error codes. */
-#define DETAILER_ERR_PROTO (-1) /* Protocol error. */
-#define DETAILER_ERR_MSG (-2) /* Error is in detailer->errmsg. */
-#define DETAILER_ERR_READ (-3) /* Error reading from server. */
-#define DETAILER_ERR_WRITE (-4) /* Error writing to server. */
-
-struct detailer {
- struct config *config;
- struct stream *rd;
- struct stream *wr;
- char *errmsg;
-};
-
-static int detailer_batch(struct detailer *);
-static int detailer_coll(struct detailer *, struct coll *,
- struct status *);
-static int detailer_dofile_co(struct detailer *, struct coll *,
- struct status *, char *);
-static int detailer_dofile_rcs(struct detailer *, struct coll *,
- char *, char *);
-static int detailer_dofile_regular(struct detailer *, char *, char *);
-static int detailer_dofile_rsync(struct detailer *, char *, char *);
-static int detailer_checkrcsattr(struct detailer *, struct coll *, char *,
- struct fattr *, int);
-int detailer_send_details(struct detailer *, struct coll *, char *,
- char *, struct fattr *);
-
-void *
-detailer(void *arg)
-{
- struct thread_args *args;
- struct detailer dbuf, *d;
- int error;
-
- args = arg;
-
- d = &dbuf;
- d->config = args->config;
- d->rd = args->rd;
- d->wr = args->wr;
- d->errmsg = NULL;
-
- error = detailer_batch(d);
- switch (error) {
- case DETAILER_ERR_PROTO:
- xasprintf(&args->errmsg, "Detailer failed: Protocol error");
- args->status = STATUS_FAILURE;
- break;
- case DETAILER_ERR_MSG:
- xasprintf(&args->errmsg, "Detailer failed: %s", d->errmsg);
- free(d->errmsg);
- args->status = STATUS_FAILURE;
- break;
- case DETAILER_ERR_READ:
- if (stream_eof(d->rd)) {
- xasprintf(&args->errmsg, "Detailer failed: "
- "Premature EOF from server");
- } else {
- xasprintf(&args->errmsg, "Detailer failed: "
- "Network read failure: %s", strerror(errno));
- }
- args->status = STATUS_TRANSIENTFAILURE;
- break;
- case DETAILER_ERR_WRITE:
- xasprintf(&args->errmsg, "Detailer failed: "
- "Network write failure: %s", strerror(errno));
- args->status = STATUS_TRANSIENTFAILURE;
- break;
- default:
- assert(error == 0);
- args->status = STATUS_SUCCESS;
- }
- return (NULL);
-}
-
-static int
-detailer_batch(struct detailer *d)
-{
- struct config *config;
- struct stream *rd, *wr;
- struct coll *coll;
- struct status *st;
- struct fixup *fixup;
- char *cmd, *collname, *line, *release;
- int error, fixupseof;
-
- config = d->config;
- rd = d->rd;
- wr = d->wr;
- STAILQ_FOREACH(coll, &config->colls, co_next) {
- if (coll->co_options & CO_SKIP)
- continue;
- line = stream_getln(rd, NULL);
- cmd = proto_get_ascii(&line);
- collname = proto_get_ascii(&line);
- release = proto_get_ascii(&line);
- error = proto_get_time(&line, &coll->co_scantime);
- if (error || line != NULL || strcmp(cmd, "COLL") != 0 ||
- strcmp(collname, coll->co_name) != 0 ||
- strcmp(release, coll->co_release) != 0)
- return (DETAILER_ERR_PROTO);
- error = proto_printf(wr, "COLL %s %s\n", coll->co_name,
- coll->co_release);
- if (error)
- return (DETAILER_ERR_WRITE);
- stream_flush(wr);
- if (coll->co_options & CO_COMPRESS) {
- stream_filter_start(rd, STREAM_FILTER_ZLIB, NULL);
- stream_filter_start(wr, STREAM_FILTER_ZLIB, NULL);
- }
- st = status_open(coll, -1, &d->errmsg);
- if (st == NULL)
- return (DETAILER_ERR_MSG);
- error = detailer_coll(d, coll, st);
- status_close(st, NULL);
- if (error)
- return (error);
- if (coll->co_options & CO_COMPRESS) {
- stream_filter_stop(rd);
- stream_filter_stop(wr);
- }
- stream_flush(wr);
- }
- line = stream_getln(rd, NULL);
- if (line == NULL)
- return (DETAILER_ERR_READ);
- if (strcmp(line, ".") != 0)
- return (DETAILER_ERR_PROTO);
- error = proto_printf(wr, ".\n");
- if (error)
- return (DETAILER_ERR_WRITE);
- stream_flush(wr);
-
- /* Now send fixups if needed. */
- fixup = NULL;
- fixupseof = 0;
- STAILQ_FOREACH(coll, &config->colls, co_next) {
- if (coll->co_options & CO_SKIP)
- continue;
- error = proto_printf(wr, "COLL %s %s\n", coll->co_name,
- coll->co_release);
- if (error)
- return (DETAILER_ERR_WRITE);
- if (coll->co_options & CO_COMPRESS)
- stream_filter_start(wr, STREAM_FILTER_ZLIB, NULL);
- while (!fixupseof) {
- if (fixup == NULL)
- fixup = fixups_get(config->fixups);
- if (fixup == NULL) {
- fixupseof = 1;
- break;
- }
- if (fixup->f_coll != coll)
- break;
- if (coll->co_options & CO_CHECKOUTMODE)
- error = proto_printf(wr, "Y %s %s %s\n",
- fixup->f_name, coll->co_tag, coll->co_date);
- else {
- error = proto_printf(wr, "A %s\n",
- fixup->f_name);
- }
- if (error)
- return (DETAILER_ERR_WRITE);
- fixup = NULL;
- }
- error = proto_printf(wr, ".\n");
- if (error)
- return (DETAILER_ERR_WRITE);
- if (coll->co_options & CO_COMPRESS)
- stream_filter_stop(wr);
- stream_flush(wr);
- }
- error = proto_printf(wr, ".\n");
- if (error)
- return (DETAILER_ERR_WRITE);
- return (0);
-}
-
-static int
-detailer_coll(struct detailer *d, struct coll *coll, struct status *st)
-{
- struct fattr *rcsattr;
- struct stream *rd, *wr;
- char *attr, *cmd, *file, *line, *msg, *path, *target;
- int error, attic;
-
- rd = d->rd;
- wr = d->wr;
- attic = 0;
- line = stream_getln(rd, NULL);
- if (line == NULL)
- return (DETAILER_ERR_READ);
- while (strcmp(line, ".") != 0) {
- cmd = proto_get_ascii(&line);
- if (cmd == NULL || strlen(cmd) != 1)
- return (DETAILER_ERR_PROTO);
- switch (cmd[0]) {
- case 'D':
- /* Delete file. */
- file = proto_get_ascii(&line);
- if (file == NULL || line != NULL)
- return (DETAILER_ERR_PROTO);
- error = proto_printf(wr, "D %s\n", file);
- if (error)
- return (DETAILER_ERR_WRITE);
- break;
- case 'I':
- case 'i':
- case 'j':
- /* Directory operations. */
- file = proto_get_ascii(&line);
- if (file == NULL || line != NULL)
- return (DETAILER_ERR_PROTO);
- error = proto_printf(wr, "%s %s\n", cmd, file);
- if (error)
- return (DETAILER_ERR_WRITE);
- break;
- case 'J':
- /* Set directory attributes. */
- file = proto_get_ascii(&line);
- attr = proto_get_ascii(&line);
- if (file == NULL || line != NULL || attr == NULL)
- return (DETAILER_ERR_PROTO);
- error = proto_printf(wr, "%s %s %s\n", cmd, file, attr);
- if (error)
- return (DETAILER_ERR_WRITE);
- break;
- case 'H':
- case 'h':
- /* Create a hard link. */
- file = proto_get_ascii(&line);
- target = proto_get_ascii(&line);
- if (file == NULL || target == NULL)
- return (DETAILER_ERR_PROTO);
- error = proto_printf(wr, "%s %s %s\n", cmd, file,
- target);
- break;
- case 't':
- file = proto_get_ascii(&line);
- attr = proto_get_ascii(&line);
- if (file == NULL || attr == NULL || line != NULL) {
- return (DETAILER_ERR_PROTO);
- }
- rcsattr = fattr_decode(attr);
- if (rcsattr == NULL) {
- return (DETAILER_ERR_PROTO);
- }
- error = detailer_checkrcsattr(d, coll, file, rcsattr,
- 1);
- break;
-
- case 'T':
- file = proto_get_ascii(&line);
- attr = proto_get_ascii(&line);
- if (file == NULL || attr == NULL || line != NULL)
- return (DETAILER_ERR_PROTO);
- rcsattr = fattr_decode(attr);
- if (rcsattr == NULL)
- return (DETAILER_ERR_PROTO);
- error = detailer_checkrcsattr(d, coll, file, rcsattr,
- 0);
- break;
-
- case 'U':
- /* Add or update file. */
- file = proto_get_ascii(&line);
- if (file == NULL || line != NULL)
- return (DETAILER_ERR_PROTO);
- if (coll->co_options & CO_CHECKOUTMODE) {
- error = detailer_dofile_co(d, coll, st, file);
- } else {
- path = cvspath(coll->co_prefix, file, 0);
- rcsattr = fattr_frompath(path, FATTR_NOFOLLOW);
- error = detailer_send_details(d, coll, file,
- path, rcsattr);
- if (rcsattr != NULL)
- fattr_free(rcsattr);
- free(path);
- }
- if (error)
- return (error);
- break;
- case '!':
- /* Warning from server. */
- msg = proto_get_rest(&line);
- if (msg == NULL)
- return (DETAILER_ERR_PROTO);
- lprintf(-1, "Server warning: %s\n", msg);
- break;
- default:
- return (DETAILER_ERR_PROTO);
- }
- stream_flush(wr);
- line = stream_getln(rd, NULL);
- if (line == NULL)
- return (DETAILER_ERR_READ);
- }
- error = proto_printf(wr, ".\n");
- if (error)
- return (DETAILER_ERR_WRITE);
- return (0);
-}
-
-/*
- * Tell the server to update a regular file.
- */
-static int
-detailer_dofile_regular(struct detailer *d, char *name, char *path)
-{
- struct stream *wr;
- struct stat st;
- char md5[MD5_DIGEST_SIZE];
- int error;
-
- wr = d->wr;
- error = stat(path, &st);
- /* If we don't have it or it's unaccessible, we want it again. */
- if (error) {
- proto_printf(wr, "A %s\n", name);
- return (0);
- }
-
- /* If not, we want the file to be updated. */
- error = MD5_File(path, md5);
- if (error) {
- lprintf(-1, "Error reading \"%s\"\n", name);
- return (error);
- }
- error = proto_printf(wr, "R %s %O %s\n", name, st.st_size, md5);
- if (error)
- return (DETAILER_ERR_WRITE);
- return (0);
-}
-
-/*
- * Tell the server to update a file with the rsync algorithm.
- */
-static int
-detailer_dofile_rsync(struct detailer *d, char *name, char *path)
-{
- struct stream *wr;
- struct rsyncfile *rf;
-
- wr = d->wr;
- rf = rsync_open(path, 0, 1);
- if (rf == NULL) {
- /* Fallback if we fail in opening it. */
- proto_printf(wr, "A %s\n", name);
- return (0);
- }
- proto_printf(wr, "r %s %z %z\n", name, rsync_filesize(rf),
- rsync_blocksize(rf));
- /* Detail the blocks. */
- while (rsync_nextblock(rf) != 0)
- proto_printf(wr, "%s %s\n", rsync_rsum(rf), rsync_blockmd5(rf));
- proto_printf(wr, ".\n");
- rsync_close(rf);
- return (0);
-}
-
-/*
- * Tell the server to update an RCS file that we have, or send it if we don't.
- */
-static int
-detailer_dofile_rcs(struct detailer *d, struct coll *coll, char *name,
- char *path)
-{
- struct stream *wr;
- struct fattr *fa;
- struct rcsfile *rf;
- int error;
-
- wr = d->wr;
- path = atticpath(coll->co_prefix, name);
- fa = fattr_frompath(path, FATTR_NOFOLLOW);
- if (fa == NULL) {
- /* We don't have it, so send request to get it. */
- error = proto_printf(wr, "A %s\n", name);
- if (error)
- return (DETAILER_ERR_WRITE);
- free(path);
- return (0);
- }
-
- rf = rcsfile_frompath(path, name, coll->co_cvsroot, coll->co_tag, 1);
- free(path);
- if (rf == NULL) {
- error = proto_printf(wr, "A %s\n", name);
- if (error)
- return (DETAILER_ERR_WRITE);
- return (0);
- }
- /* Tell to update the RCS file. The client version details follow. */
- rcsfile_send_details(rf, wr);
- rcsfile_free(rf);
- fattr_free(fa);
- return (0);
-}
-
-static int
-detailer_dofile_co(struct detailer *d, struct coll *coll, struct status *st,
- char *file)
-{
- struct stream *wr;
- struct fattr *fa;
- struct statusrec *sr;
- char md5[MD5_DIGEST_SIZE];
- char *path;
- int error, ret;
-
- wr = d->wr;
- path = checkoutpath(coll->co_prefix, file);
- if (path == NULL)
- return (DETAILER_ERR_PROTO);
- fa = fattr_frompath(path, FATTR_NOFOLLOW);
- if (fa == NULL) {
- /* We don't have the file, so the only option at this
- point is to tell the server to send it. The server
- may figure out that the file is dead, in which case
- it will tell us. */
- error = proto_printf(wr, "C %s %s %s\n",
- file, coll->co_tag, coll->co_date);
- free(path);
- if (error)
- return (DETAILER_ERR_WRITE);
- return (0);
- }
- ret = status_get(st, file, 0, 0, &sr);
- if (ret == -1) {
- d->errmsg = status_errmsg(st);
- free(path);
- return (DETAILER_ERR_MSG);
- }
- if (ret == 0)
- sr = NULL;
-
- /* If our recorded information doesn't match the file that the
- client has, then ignore the recorded information. */
- if (sr != NULL && (sr->sr_type != SR_CHECKOUTLIVE ||
- !fattr_equal(sr->sr_clientattr, fa)))
- sr = NULL;
- fattr_free(fa);
- if (sr != NULL && strcmp(sr->sr_revdate, ".") != 0) {
- error = proto_printf(wr, "U %s %s %s %s %s\n", file,
- coll->co_tag, coll->co_date, sr->sr_revnum, sr->sr_revdate);
- free(path);
- if (error)
- return (DETAILER_ERR_WRITE);
- return (0);
- }
-
- /*
- * We don't have complete and/or accurate recorded information
- * about what version of the file we have. Compute the file's
- * checksum as an aid toward identifying which version it is.
- */
- error = MD5_File(path, md5);
- if (error) {
- xasprintf(&d->errmsg,
- "Cannot calculate checksum for \"%s\": %s", path,
- strerror(errno));
- return (DETAILER_ERR_MSG);
- }
- free(path);
- if (sr == NULL) {
- error = proto_printf(wr, "S %s %s %s %s\n", file,
- coll->co_tag, coll->co_date, md5);
- } else {
- error = proto_printf(wr, "s %s %s %s %s %s\n", file,
- coll->co_tag, coll->co_date, sr->sr_revnum, md5);
- }
- if (error)
- return (DETAILER_ERR_WRITE);
- return (0);
-}
-
-int
-detailer_checkrcsattr(struct detailer *d, struct coll *coll, char *name,
- struct fattr *server_attr, int attic)
-{
- struct fattr *client_attr;
- char *attr, *path;
- int error;
-
- /*
- * I don't think we can use the status file, since it only records file
- * attributes in cvsmode.
- */
- client_attr = NULL;
- path = cvspath(coll->co_prefix, name, attic);
- if (path == NULL) {
- return (DETAILER_ERR_PROTO);
- }
-
- if (access(path, F_OK) == 0 &&
- ((client_attr = fattr_frompath(path, FATTR_NOFOLLOW)) != NULL) &&
- fattr_equal(client_attr, server_attr)) {
- attr = fattr_encode(client_attr, NULL, 0);
- if (attic) {
- error = proto_printf(d->wr, "l %s %s\n", name, attr);
- } else {
- error = proto_printf(d->wr, "L %s %s\n", name, attr);
- }
- free(attr);
- free(path);
- fattr_free(client_attr);
- if (error)
- return (DETAILER_ERR_WRITE);
- return (0);
- }
- /* We don't have it, so tell the server to send it. */
- error = detailer_send_details(d, coll, name, path, client_attr);
- fattr_free(client_attr);
- free(path);
- return (error);
-}
-
-int
-detailer_send_details(struct detailer *d, struct coll *coll, char *name,
- char *path, struct fattr *fa)
-{
- int error;
- size_t len;
-
- /*
- * Try to check if the file exists either live or dead to see if we can
- * edit it and put it live or dead, rather than receiving the entire
- * file.
- */
- if (fa == NULL) {
- path = atticpath(coll->co_prefix, name);
- fa = fattr_frompath(path, FATTR_NOFOLLOW);
- }
- if (fa == NULL) {
- error = proto_printf(d->wr, "A %s\n", name);
- if (error)
- return (DETAILER_ERR_WRITE);
- } else if (fattr_type(fa) == FT_FILE) {
- if (isrcs(name, &len) && !(coll->co_options & CO_NORCS)) {
- detailer_dofile_rcs(d, coll, name, path);
- } else if (!(coll->co_options & CO_NORSYNC) &&
- !globtree_test(coll->co_norsync, name)) {
- detailer_dofile_rsync(d, name, path);
- } else {
- detailer_dofile_regular(d, name, path);
- }
- } else {
- error = proto_printf(d->wr, "N %s\n", name);
- if (error)
- return (DETAILER_ERR_WRITE);
- }
- return (0);
-}
diff --git a/usr.bin/csup/detailer.h b/usr.bin/csup/detailer.h
deleted file mode 100644
index fe82b27..0000000
--- a/usr.bin/csup/detailer.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*-
- * Copyright (c) 2003-2004, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#ifndef _DETAILER_H_
-#define _DETAILER_H_
-
-void *detailer(void *);
-
-#endif /* !_DETAILER_H_ */
diff --git a/usr.bin/csup/diff.c b/usr.bin/csup/diff.c
deleted file mode 100644
index 30a6c35..0000000
--- a/usr.bin/csup/diff.c
+++ /dev/null
@@ -1,438 +0,0 @@
-/*-
- * Copyright (c) 2003-2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <sys/queue.h>
-
-#include <assert.h>
-#include <err.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "diff.h"
-#include "keyword.h"
-#include "misc.h"
-#include "stream.h"
-
-typedef long lineno_t;
-
-#define EC_ADD 0
-#define EC_DEL 1
-#define MAXKEY LONG_MAX
-
-/* Editing command and state. */
-struct editcmd {
- int cmd;
- long key;
- int havetext;
- int offset;
- lineno_t where;
- lineno_t count;
- lineno_t lasta;
- lineno_t lastd;
- lineno_t editline;
- /* For convenience. */
- struct keyword *keyword;
- struct diffinfo *di;
- struct stream *orig;
- struct stream *dest;
- LIST_ENTRY(editcmd) next;
-};
-
-struct diffstart {
- LIST_HEAD(, editcmd) dhead;
-};
-
-static int diff_geteditcmd(struct editcmd *, char *);
-static int diff_copyln(struct editcmd *, lineno_t);
-static int diff_ignoreln(struct editcmd *, lineno_t);
-static void diff_write(struct editcmd *, void *, size_t);
-static int diff_insert_edit(struct diffstart *, struct editcmd *);
-static void diff_free(struct diffstart *);
-
-int
-diff_apply(struct stream *rd, struct stream *orig, struct stream *dest,
- struct keyword *keyword, struct diffinfo *di, int comode)
-{
- struct editcmd ec;
- lineno_t i;
- size_t size;
- char *line;
- int empty, error, noeol;
-
- memset(&ec, 0, sizeof(ec));
- empty = 0;
- noeol = 0;
- ec.di = di;
- ec.keyword = keyword;
- ec.orig = orig;
- ec.dest = dest;
- line = stream_getln(rd, NULL);
- while (line != NULL && strcmp(line, ".") != 0 &&
- strcmp(line, ".+") != 0) {
- /*
- * The server sends an empty line and then terminates
- * with .+ for forced (and thus empty) commits.
- */
- if (*line == '\0') {
- if (empty)
- return (-1);
- empty = 1;
- line = stream_getln(rd, NULL);
- continue;
- }
- error = diff_geteditcmd(&ec, line);
- if (error)
- return (-1);
-
- if (ec.cmd == EC_ADD) {
- error = diff_copyln(&ec, ec.where);
- if (error)
- return (-1);
- for (i = 0; i < ec.count; i++) {
- line = stream_getln(rd, &size);
- if (line == NULL)
- return (-1);
- if (comode && line[0] == '.') {
- line++;
- size--;
- }
- diff_write(&ec, line, size);
- }
- } else {
- assert(ec.cmd == EC_DEL);
- error = diff_copyln(&ec, ec.where - 1);
- if (error)
- return (-1);
- for (i = 0; i < ec.count; i++) {
- line = stream_getln(orig, NULL);
- if (line == NULL)
- return (-1);
- ec.editline++;
- }
- }
- line = stream_getln(rd, NULL);
- }
- if (comode && line == NULL)
- return (-1);
- /* If we got ".+", there's no ending newline. */
- if (comode && strcmp(line, ".+") == 0 && !empty)
- noeol = 1;
- ec.where = 0;
- while ((line = stream_getln(orig, &size)) != NULL)
- diff_write(&ec, line, size);
- stream_flush(dest);
- if (noeol) {
- error = stream_truncate_rel(dest, -1);
- if (error) {
- warn("stream_truncate_rel");
- return (-1);
- }
- }
- return (0);
-}
-
-/*
- * Reverse a diff using the same algorithm as in cvsup.
- */
-static int
-diff_write_reverse(struct stream *dest, struct diffstart *ds)
-{
- struct editcmd *ec, *nextec;
- long editline, endline, firstoutputlinedeleted;
- long num_added, num_deleted, startline;
- int num;
-
- nextec = LIST_FIRST(&ds->dhead);
- editline = 0;
- num = 0;
- while (nextec != NULL) {
- ec = nextec;
- nextec = LIST_NEXT(nextec, next);
- if (nextec == NULL)
- break;
- num++;
- num_deleted = 0;
- if (ec->havetext)
- num_deleted = ec->count;
- num_added = num_deleted + nextec->offset - ec->offset;
- if (num_deleted > 0) {
- firstoutputlinedeleted = ec->key - num_deleted + 1;
- stream_printf(dest, "d%ld %ld\n", firstoutputlinedeleted,
- num_deleted);
- if (num_added <= 0)
- continue;
- }
- if (num_added > 0) {
- stream_printf(dest, "a%ld %ld\n", ec->key, num_added);
- startline = ec->key - num_deleted + 1 + ec->offset;
- endline = startline + num_added - 1;
-
- /* Copy lines from original file. First ignore some. */
- ec->editline = editline;
- diff_ignoreln(ec, startline - 1);
- diff_copyln(ec, endline);
- editline = ec->editline;
- }
- }
- return (0);
-}
-
-/*
- * Insert a diff into the list sorted on key. Should perhaps use quicker
- * algorithms than insertion sort, but do this for now.
- */
-static int
-diff_insert_edit(struct diffstart *ds, struct editcmd *ec)
-{
- struct editcmd *curec;
-
- if (ec == NULL)
- return (0);
-
- if (LIST_EMPTY(&ds->dhead)) {
- LIST_INSERT_HEAD(&ds->dhead, ec, next);
- return (0);
- }
-
- /* Insertion sort based on key. */
- LIST_FOREACH(curec, &ds->dhead, next) {
- if (ec->key < curec->key) {
- LIST_INSERT_BEFORE(curec, ec, next);
- return (0);
- }
- if (LIST_NEXT(curec, next) == NULL)
- break;
- }
- /* Just insert it after. */
- LIST_INSERT_AFTER(curec, ec, next);
- return (0);
-}
-
-static void
-diff_free(struct diffstart *ds)
-{
- struct editcmd *ec;
-
- while(!LIST_EMPTY(&ds->dhead)) {
- ec = LIST_FIRST(&ds->dhead);
- LIST_REMOVE(ec, next);
- free(ec);
- }
-}
-
-/*
- * Write the reverse diff from the diff in rd, and original file into
- * destination. This algorithm is the same as used in cvsup.
- */
-int
-diff_reverse(struct stream *rd, struct stream *orig, struct stream *dest,
- struct keyword *keyword, struct diffinfo *di)
-{
- struct diffstart ds;
- struct editcmd ec, *addec, *delec;
- lineno_t i;
- char *line;
- int error, offset;
-
- memset(&ec, 0, sizeof(ec));
- ec.orig = orig;
- ec.dest = dest;
- ec.keyword = keyword;
- ec.di = di;
- addec = NULL;
- delec = NULL;
- ec.havetext = 0;
- offset = 0;
- LIST_INIT(&ds.dhead);
-
- /* Start with next since we need it. */
- line = stream_getln(rd, NULL);
- /* First we build up the list of diffs from input. */
- while (line != NULL) {
- error = diff_geteditcmd(&ec, line);
- if (error)
- break;
- if (ec.cmd == EC_ADD) {
- addec = xmalloc(sizeof(struct editcmd));
- *addec = ec;
- addec->havetext = 1;
- /* Ignore the lines we was supposed to add. */
- for (i = 0; i < ec.count; i++) {
- line = stream_getln(rd, NULL);
- if (line == NULL)
- return (-1);
- }
-
- /* Get the next diff command if we have one. */
- addec->key = addec->where + addec->count - offset;
- if (delec != NULL &&
- delec->key == addec->key - addec->count) {
- delec->key = addec->key;
- delec->havetext = addec->havetext;
- delec->count = addec->count;
- diff_insert_edit(&ds, delec);
- free(addec);
- delec = NULL;
- addec = NULL;
- } else {
- if (delec != NULL) {
- diff_insert_edit(&ds, delec);
- }
- delec = NULL;
- addec->offset = offset;
- diff_insert_edit(&ds, addec);
- addec = NULL;
- }
- offset -= ec.count;
- } else if (ec.cmd == EC_DEL) {
- if (delec != NULL) {
- /* Update offset to our next. */
- diff_insert_edit(&ds, delec);
- delec = NULL;
- }
- delec = xmalloc(sizeof(struct editcmd));
- *delec = ec;
- delec->key = delec->where - 1 - offset;
- delec->offset = offset;
- delec->count = 0;
- delec->havetext = 0;
- /* Important to use the count we had before reset.*/
- offset += ec.count;
- }
- line = stream_getln(rd, NULL);
- }
-
- while (line != NULL)
- line = stream_getln(rd, NULL);
- if (delec != NULL) {
- diff_insert_edit(&ds, delec);
- delec = NULL;
- }
-
- addec = xmalloc(sizeof(struct editcmd));
- /* Should be filesize, but we set it to max value. */
- addec->key = MAXKEY;
- addec->offset = offset;
- addec->havetext = 0;
- addec->count = 0;
- diff_insert_edit(&ds, addec);
- addec = NULL;
- diff_write_reverse(dest, &ds);
- diff_free(&ds);
- stream_flush(dest);
- return (0);
-}
-
-/* Get an editing command from the diff. */
-static int
-diff_geteditcmd(struct editcmd *ec, char *line)
-{
- char *end;
-
- if (line[0] == 'a')
- ec->cmd = EC_ADD;
- else if (line[0] == 'd')
- ec->cmd = EC_DEL;
- else
- return (-1);
- errno = 0;
- ec->where = strtol(line + 1, &end, 10);
- if (errno || ec->where < 0 || *end != ' ')
- return (-1);
- line = end + 1;
- errno = 0;
- ec->count = strtol(line, &end, 10);
- if (errno || ec->count <= 0 || *end != '\0')
- return (-1);
- if (ec->cmd == EC_ADD) {
- if (ec->where < ec->lasta)
- return (-1);
- ec->lasta = ec->where + 1;
- } else {
- if (ec->where < ec->lasta || ec->where < ec->lastd)
- return (-1);
- ec->lasta = ec->where;
- ec->lastd = ec->where + ec->count;
- }
- return (0);
-}
-
-/* Copy lines from the original version of the file up to line "to". */
-static int
-diff_copyln(struct editcmd *ec, lineno_t to)
-{
- size_t size;
- char *line;
-
- while (ec->editline < to) {
- line = stream_getln(ec->orig, &size);
- if (line == NULL)
- return (-1);
- ec->editline++;
- diff_write(ec, line, size);
- }
- return (0);
-}
-
-/* Ignore lines from the original version of the file up to line "to". */
-static int
-diff_ignoreln(struct editcmd *ec, lineno_t to)
-{
- size_t size;
- char *line;
-
- while (ec->editline < to) {
- line = stream_getln(ec->orig, &size);
- if (line == NULL)
- return (-1);
- ec->editline++;
- }
- return (0);
-}
-
-/* Write a new line to the file, expanding RCS keywords appropriately. */
-static void
-diff_write(struct editcmd *ec, void *buf, size_t size)
-{
- size_t newsize;
- char *line, *newline;
- int ret;
-
- line = buf;
- ret = keyword_expand(ec->keyword, ec->di, line, size,
- &newline, &newsize);
- if (ret) {
- stream_write(ec->dest, newline, newsize);
- free(newline);
- } else {
- stream_write(ec->dest, buf, size);
- }
-}
diff --git a/usr.bin/csup/fattr.c b/usr.bin/csup/fattr.c
deleted file mode 100644
index b141c2c..0000000
--- a/usr.bin/csup/fattr.c
+++ /dev/null
@@ -1,981 +0,0 @@
-/*-
- * Copyright (c) 2003-2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include <assert.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "fattr.h"
-#include "idcache.h"
-#include "misc.h"
-
-/*
- * Include the appropriate definition for the file attributes we support.
- * There are two different files: fattr_bsd.h for BSD-like systems that
- * support the extended file flags a la chflags() and fattr_posix.h for
- * bare POSIX systems that don't.
- */
-#ifdef HAVE_FFLAGS
-#include "fattr_bsd.h"
-#else
-#include "fattr_posix.h"
-#endif
-
-#ifdef __FreeBSD__
-#include <osreldate.h>
-#endif
-
-/* Define fflags_t if we're on a system that doesn't have it. */
-#if !defined(__FreeBSD_version) || __FreeBSD_version < 500030
-typedef uint32_t fflags_t;
-#endif
-
-#define FA_MASKRADIX 16
-#define FA_FILETYPERADIX 10
-#define FA_MODTIMERADIX 10
-#define FA_SIZERADIX 10
-#define FA_RDEVRADIX 16
-#define FA_MODERADIX 8
-#define FA_FLAGSRADIX 16
-#define FA_LINKCOUNTRADIX 10
-#define FA_DEVRADIX 16
-#define FA_INODERADIX 10
-
-#define FA_PERMMASK (S_IRWXU | S_IRWXG | S_IRWXO)
-#define FA_SETIDMASK (S_ISUID | S_ISGID | S_ISVTX)
-
-struct fattr {
- int mask;
- int type;
- time_t modtime;
- off_t size;
- char *linktarget;
- dev_t rdev;
- uid_t uid;
- gid_t gid;
- mode_t mode;
- fflags_t flags;
- nlink_t linkcount;
- dev_t dev;
- ino_t inode;
-};
-
-static const struct fattr bogus = {
- FA_MODTIME | FA_SIZE | FA_MODE,
- FT_UNKNOWN,
- 1,
- 0,
- NULL,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
-};
-
-static struct fattr *defaults[FT_NUMBER];
-
-void
-fattr_init(void)
-{
- struct fattr *fa;
- int i;
-
- for (i = 0; i < FT_NUMBER; i++) {
- fa = fattr_new(i, -1);
- if (i == FT_DIRECTORY)
- fa->mode = 0777;
- else
- fa->mode = 0666;
- fa->mask |= FA_MODE;
- defaults[i] = fa;
- }
- /* Initialize the uid/gid lookup cache. */
- idcache_init();
-}
-
-void
-fattr_fini(void)
-{
- int i;
-
- idcache_fini();
- for (i = 0; i < FT_NUMBER; i++)
- fattr_free(defaults[i]);
-}
-
-const struct fattr *fattr_bogus = &bogus;
-
-static char *fattr_scanattr(struct fattr *, int, const char *);
-
-int
-fattr_supported(int type)
-{
-
- return (fattr_support[type]);
-}
-
-struct fattr *
-fattr_new(int type, time_t modtime)
-{
- struct fattr *new;
-
- new = xmalloc(sizeof(struct fattr));
- memset(new, 0, sizeof(struct fattr));
- new->type = type;
- if (type != FT_UNKNOWN)
- new->mask |= FA_FILETYPE;
- if (modtime != -1) {
- new->modtime = modtime;
- new->mask |= FA_MODTIME;
- }
- if (fattr_supported(new->type) & FA_LINKCOUNT) {
- new->mask |= FA_LINKCOUNT;
- new->linkcount = 1;
- }
- return (new);
-}
-
-/* Returns a new file attribute structure based on a stat structure. */
-struct fattr *
-fattr_fromstat(struct stat *sb)
-{
- struct fattr *fa;
-
- fa = fattr_new(FT_UNKNOWN, -1);
- if (S_ISREG(sb->st_mode))
- fa->type = FT_FILE;
- else if (S_ISDIR(sb->st_mode))
- fa->type = FT_DIRECTORY;
- else if (S_ISCHR(sb->st_mode))
- fa->type = FT_CDEV;
- else if (S_ISBLK(sb->st_mode))
- fa->type = FT_BDEV;
- else if (S_ISLNK(sb->st_mode))
- fa->type = FT_SYMLINK;
- else
- fa->type = FT_UNKNOWN;
-
- fa->mask = FA_FILETYPE | fattr_supported(fa->type);
- if (fa->mask & FA_MODTIME)
- fa->modtime = sb->st_mtime;
- if (fa->mask & FA_SIZE)
- fa->size = sb->st_size;
- if (fa->mask & FA_RDEV)
- fa->rdev = sb->st_rdev;
- if (fa->mask & FA_OWNER)
- fa->uid = sb->st_uid;
- if (fa->mask & FA_GROUP)
- fa->gid = sb->st_gid;
- if (fa->mask & FA_MODE)
- fa->mode = sb->st_mode & (FA_SETIDMASK | FA_PERMMASK);
-#ifdef HAVE_FFLAGS
- if (fa->mask & FA_FLAGS)
- fa->flags = sb->st_flags;
-#endif
- if (fa->mask & FA_LINKCOUNT)
- fa->linkcount = sb->st_nlink;
- if (fa->mask & FA_DEV)
- fa->dev = sb->st_dev;
- if (fa->mask & FA_INODE)
- fa->inode = sb->st_ino;
- return (fa);
-}
-
-struct fattr *
-fattr_frompath(const char *path, int nofollow)
-{
- struct fattr *fa;
- struct stat sb;
- int error, len;
-
- if (nofollow)
- error = lstat(path, &sb);
- else
- error = stat(path, &sb);
- if (error)
- return (NULL);
- fa = fattr_fromstat(&sb);
- if (fa->mask & FA_LINKTARGET) {
- char buf[1024];
-
- len = readlink(path, buf, sizeof(buf));
- if (len == -1) {
- fattr_free(fa);
- return (NULL);
- }
- if ((unsigned)len > sizeof(buf) - 1) {
- fattr_free(fa);
- errno = ENAMETOOLONG;
- return (NULL);
- }
- buf[len] = '\0';
- fa->linktarget = xstrdup(buf);
- }
- return (fa);
-}
-
-struct fattr *
-fattr_fromfd(int fd)
-{
- struct fattr *fa;
- struct stat sb;
- int error;
-
- error = fstat(fd, &sb);
- if (error)
- return (NULL);
- fa = fattr_fromstat(&sb);
- return (fa);
-}
-
-int
-fattr_type(const struct fattr *fa)
-{
-
- return (fa->type);
-}
-
-/* Returns a new file attribute structure from its encoded text form. */
-struct fattr *
-fattr_decode(char *attr)
-{
- struct fattr *fa;
- char *next;
-
- fa = fattr_new(FT_UNKNOWN, -1);
- next = fattr_scanattr(fa, FA_MASK, attr);
- if (next == NULL || (fa->mask & ~FA_MASK) > 0)
- goto bad;
- if (fa->mask & FA_FILETYPE) {
- next = fattr_scanattr(fa, FA_FILETYPE, next);
- if (next == NULL)
- goto bad;
- if (fa->type < 0 || fa->type > FT_MAX)
- fa->type = FT_UNKNOWN;
- } else {
- /* The filetype attribute is always valid. */
- fa->mask |= FA_FILETYPE;
- fa->type = FT_UNKNOWN;
- }
- fa->mask = fa->mask & fattr_supported(fa->type);
- if (fa->mask & FA_MODTIME)
- next = fattr_scanattr(fa, FA_MODTIME, next);
- if (fa->mask & FA_SIZE)
- next = fattr_scanattr(fa, FA_SIZE, next);
- if (fa->mask & FA_LINKTARGET)
- next = fattr_scanattr(fa, FA_LINKTARGET, next);
- if (fa->mask & FA_RDEV)
- next = fattr_scanattr(fa, FA_RDEV, next);
- if (fa->mask & FA_OWNER)
- next = fattr_scanattr(fa, FA_OWNER, next);
- if (fa->mask & FA_GROUP)
- next = fattr_scanattr(fa, FA_GROUP, next);
- if (fa->mask & FA_MODE)
- next = fattr_scanattr(fa, FA_MODE, next);
- if (fa->mask & FA_FLAGS)
- next = fattr_scanattr(fa, FA_FLAGS, next);
- if (fa->mask & FA_LINKCOUNT) {
- next = fattr_scanattr(fa, FA_LINKCOUNT, next);
- } else if (fattr_supported(fa->type) & FA_LINKCOUNT) {
- /* If the link count is missing but supported, fake it as 1. */
- fa->mask |= FA_LINKCOUNT;
- fa->linkcount = 1;
- }
- if (fa->mask & FA_DEV)
- next = fattr_scanattr(fa, FA_DEV, next);
- if (fa->mask & FA_INODE)
- next = fattr_scanattr(fa, FA_INODE, next);
- if (next == NULL)
- goto bad;
- return (fa);
-bad:
- fattr_free(fa);
- return (NULL);
-}
-
-char *
-fattr_encode(const struct fattr *fa, fattr_support_t support, int ignore)
-{
- struct {
- char val[32];
- char len[4];
- int extval;
- char *ext;
- } pieces[FA_NUMBER], *piece;
- char *cp, *s, *username, *groupname;
- size_t len, vallen;
- mode_t mode, modemask;
- int mask, n, i;
-
- username = NULL;
- groupname = NULL;
- if (support == NULL)
- mask = fa->mask;
- else
- mask = fa->mask & support[fa->type];
- mask &= ~ignore;
- if (fa->mask & FA_OWNER) {
- username = getuserbyid(fa->uid);
- if (username == NULL)
- mask &= ~FA_OWNER;
- }
- if (fa->mask & FA_GROUP) {
- groupname = getgroupbyid(fa->gid);
- if (groupname == NULL)
- mask &= ~FA_GROUP;
- }
- if (fa->mask & FA_LINKCOUNT && fa->linkcount == 1)
- mask &= ~FA_LINKCOUNT;
-
- memset(pieces, 0, FA_NUMBER * sizeof(*pieces));
- len = 0;
- piece = pieces;
- vallen = snprintf(piece->val, sizeof(piece->val), "%x", mask);
- len += snprintf(piece->len, sizeof(piece->len), "%lld",
- (long long)vallen) + vallen + 1;
- piece++;
- if (mask & FA_FILETYPE) {
- vallen = snprintf(piece->val, sizeof(piece->val),
- "%d", fa->type);
- len += snprintf(piece->len, sizeof(piece->len), "%lld",
- (long long)vallen) + vallen + 1;
- piece++;
- }
- if (mask & FA_MODTIME) {
- vallen = snprintf(piece->val, sizeof(piece->val),
- "%lld", (long long)fa->modtime);
- len += snprintf(piece->len, sizeof(piece->len), "%lld",
- (long long)vallen) + vallen + 1;
- piece++;
- }
- if (mask & FA_SIZE) {
- vallen = snprintf(piece->val, sizeof(piece->val),
- "%lld", (long long)fa->size);
- len += snprintf(piece->len, sizeof(piece->len), "%lld",
- (long long)vallen) + vallen + 1;
- piece++;
- }
- if (mask & FA_LINKTARGET) {
- vallen = strlen(fa->linktarget);
- piece->extval = 1;
- piece->ext = fa->linktarget;
- len += snprintf(piece->len, sizeof(piece->len), "%lld",
- (long long)vallen) + vallen + 1;
- piece++;
- }
- if (mask & FA_RDEV) {
- vallen = snprintf(piece->val, sizeof(piece->val),
- "%lld", (long long)fa->rdev);
- len += snprintf(piece->len, sizeof(piece->len), "%lld",
- (long long)vallen) + vallen + 1;
- piece++;
- }
- if (mask & FA_OWNER) {
- vallen = strlen(username);
- piece->extval = 1;
- piece->ext = username;
- len += snprintf(piece->len, sizeof(piece->len), "%lld",
- (long long)vallen) + vallen + 1;
- piece++;
- }
- if (mask & FA_GROUP) {
- vallen = strlen(groupname);
- piece->extval = 1;
- piece->ext = groupname;
- len += snprintf(piece->len, sizeof(piece->len), "%lld",
- (long long)vallen) + vallen + 1;
- piece++;
- }
- if (mask & FA_MODE) {
- if (mask & FA_OWNER && mask & FA_GROUP)
- modemask = FA_SETIDMASK | FA_PERMMASK;
- else
- modemask = FA_PERMMASK;
- mode = fa->mode & modemask;
- vallen = snprintf(piece->val, sizeof(piece->val),
- "%o", mode);
- len += snprintf(piece->len, sizeof(piece->len), "%lld",
- (long long)vallen) + vallen + 1;
- piece++;
- }
- if (mask & FA_FLAGS) {
- vallen = snprintf(piece->val, sizeof(piece->val), "%llx",
- (long long)fa->flags);
- len += snprintf(piece->len, sizeof(piece->len), "%lld",
- (long long)vallen) + vallen + 1;
- piece++;
- }
- if (mask & FA_LINKCOUNT) {
- vallen = snprintf(piece->val, sizeof(piece->val), "%lld",
- (long long)fa->linkcount);
- len += snprintf(piece->len, sizeof(piece->len), "%lld",
- (long long)vallen) + vallen + 1;
- piece++;
- }
- if (mask & FA_DEV) {
- vallen = snprintf(piece->val, sizeof(piece->val), "%llx",
- (long long)fa->dev);
- len += snprintf(piece->len, sizeof(piece->len), "%lld",
- (long long)vallen) + vallen + 1;
- piece++;
- }
- if (mask & FA_INODE) {
- vallen = snprintf(piece->val, sizeof(piece->val), "%lld",
- (long long)fa->inode);
- len += snprintf(piece->len, sizeof(piece->len), "%lld",
- (long long)vallen) + vallen + 1;
- piece++;
- }
-
- s = xmalloc(len + 1);
-
- n = piece - pieces;
- piece = pieces;
- cp = s;
- for (i = 0; i < n; i++) {
- if (piece->extval)
- len = sprintf(cp, "%s#%s", piece->len, piece->ext);
- else
- len = sprintf(cp, "%s#%s", piece->len, piece->val);
- cp += len;
- piece++;
- }
- return (s);
-}
-
-struct fattr *
-fattr_dup(const struct fattr *from)
-{
- struct fattr *fa;
-
- fa = fattr_new(FT_UNKNOWN, -1);
- fattr_override(fa, from, FA_MASK);
- return (fa);
-}
-
-void
-fattr_free(struct fattr *fa)
-{
-
- if (fa == NULL)
- return;
- if (fa->linktarget != NULL)
- free(fa->linktarget);
- free(fa);
-}
-
-void
-fattr_umask(struct fattr *fa, mode_t newumask)
-{
-
- if (fa->mask & FA_MODE)
- fa->mode = fa->mode & ~newumask;
-}
-
-void
-fattr_maskout(struct fattr *fa, int mask)
-{
-
- /* Don't forget to free() the linktarget attribute if we remove it. */
- if (mask & FA_LINKTARGET && fa->mask & FA_LINKTARGET) {
- free(fa->linktarget);
- fa->linktarget = NULL;
- }
- fa->mask &= ~mask;
-}
-
-int
-fattr_getmask(const struct fattr *fa)
-{
-
- return (fa->mask);
-}
-
-nlink_t
-fattr_getlinkcount(const struct fattr *fa)
-{
-
- return (fa->linkcount);
-}
-
-char *
-fattr_getlinktarget(const struct fattr *fa)
-{
-
- return (fa->linktarget);
-}
-
-/*
- * Eat the specified attribute and put it in the file attribute
- * structure. Returns NULL on error, or a pointer to the next
- * attribute to parse.
- *
- * This would be much prettier if we had strntol() so that we're
- * not forced to write '\0' to the string before calling strtol()
- * and then put back the old value...
- *
- * We need to use (unsigned) long long types here because some
- * of the opaque types we're parsing (off_t, time_t...) may need
- * 64bits to fit.
- */
-static char *
-fattr_scanattr(struct fattr *fa, int type, const char *attr)
-{
- char *attrend, *attrstart, *end;
- size_t len;
- unsigned long attrlen;
- int error;
- mode_t modemask;
- char tmp;
-
- if (attr == NULL)
- return (NULL);
- errno = 0;
- attrlen = strtoul(attr, &end, 10);
- if (errno || *end != '#')
- return (NULL);
- len = strlen(attr);
- attrstart = end + 1;
- attrend = attrstart + attrlen;
- tmp = *attrend;
- *attrend = '\0';
- switch (type) {
- /* Using FA_MASK here is a bit bogus semantically. */
- case FA_MASK:
- errno = 0;
- fa->mask = (int)strtol(attrstart, &end, FA_MASKRADIX);
- if (errno || end != attrend)
- goto bad;
- break;
- case FA_FILETYPE:
- errno = 0;
- fa->type = (int)strtol(attrstart, &end, FA_FILETYPERADIX);
- if (errno || end != attrend)
- goto bad;
- break;
- case FA_MODTIME:
- errno = 0;
- fa->modtime = (time_t)strtoll(attrstart, &end, FA_MODTIMERADIX);
- if (errno || end != attrend)
- goto bad;
- break;
- case FA_SIZE:
- errno = 0;
- fa->size = (off_t)strtoll(attrstart, &end, FA_SIZERADIX);
- if (errno || end != attrend)
- goto bad;
- break;
- case FA_LINKTARGET:
- fa->linktarget = xstrdup(attrstart);
- break;
- case FA_RDEV:
- errno = 0;
- fa->rdev = (dev_t)strtoll(attrstart, &end, FA_RDEVRADIX);
- if (errno || end != attrend)
- goto bad;
- break;
- case FA_OWNER:
- error = getuidbyname(attrstart, &fa->uid);
- if (error)
- fa->mask &= ~FA_OWNER;
- break;
- case FA_GROUP:
- error = getgidbyname(attrstart, &fa->gid);
- if (error)
- fa->mask &= ~FA_GROUP;
- break;
- case FA_MODE:
- errno = 0;
- fa->mode = (mode_t)strtol(attrstart, &end, FA_MODERADIX);
- if (errno || end != attrend)
- goto bad;
- if (fa->mask & FA_OWNER && fa->mask & FA_GROUP)
- modemask = FA_SETIDMASK | FA_PERMMASK;
- else
- modemask = FA_PERMMASK;
- fa->mode &= modemask;
- break;
- case FA_FLAGS:
- errno = 0;
- fa->flags = (fflags_t)strtoul(attrstart, &end, FA_FLAGSRADIX);
- if (errno || end != attrend)
- goto bad;
- break;
- case FA_LINKCOUNT:
- errno = 0;
- fa->linkcount = (nlink_t)strtol(attrstart, &end, FA_FLAGSRADIX);
- if (errno || end != attrend)
- goto bad;
- break;
- case FA_DEV:
- errno = 0;
- fa->dev = (dev_t)strtoll(attrstart, &end, FA_DEVRADIX);
- if (errno || end != attrend)
- goto bad;
- break;
- case FA_INODE:
- errno = 0;
- fa->inode = (ino_t)strtoll(attrstart, &end, FA_INODERADIX);
- if (errno || end != attrend)
- goto bad;
- break;
- }
- *attrend = tmp;
- return (attrend);
-bad:
- *attrend = tmp;
- return (NULL);
-}
-
-/* Return a file attribute structure built from the RCS file attributes. */
-struct fattr *
-fattr_forcheckout(const struct fattr *rcsattr, mode_t mask)
-{
- struct fattr *fa;
-
- fa = fattr_new(FT_FILE, -1);
- if (rcsattr->mask & FA_MODE) {
- if ((rcsattr->mode & 0111) > 0)
- fa->mode = 0777;
- else
- fa->mode = 0666;
- fa->mode &= ~mask;
- fa->mask |= FA_MODE;
- }
- return (fa);
-}
-
-/* Merge attributes from "from" that aren't present in "fa". */
-void
-fattr_merge(struct fattr *fa, const struct fattr *from)
-{
-
- fattr_override(fa, from, from->mask & ~fa->mask);
-}
-
-/* Merge default attributes. */
-void
-fattr_mergedefault(struct fattr *fa)
-{
-
- fattr_merge(fa, defaults[fa->type]);
-}
-
-/* Override selected attributes of "fa" with values from "from". */
-void
-fattr_override(struct fattr *fa, const struct fattr *from, int mask)
-{
-
- mask &= from->mask;
- if (fa->mask & FA_LINKTARGET && mask & FA_LINKTARGET)
- free(fa->linktarget);
- fa->mask |= mask;
- if (mask & FA_FILETYPE)
- fa->type = from->type;
- if (mask & FA_MODTIME)
- fa->modtime = from->modtime;
- if (mask & FA_SIZE)
- fa->size = from->size;
- if (mask & FA_LINKTARGET)
- fa->linktarget = xstrdup(from->linktarget);
- if (mask & FA_RDEV)
- fa->rdev = from->rdev;
- if (mask & FA_OWNER)
- fa->uid = from->uid;
- if (mask & FA_GROUP)
- fa->gid = from->gid;
- if (mask & FA_MODE)
- fa->mode = from->mode;
- if (mask & FA_FLAGS)
- fa->flags = from->flags;
- if (mask & FA_LINKCOUNT)
- fa->linkcount = from->linkcount;
- if (mask & FA_DEV)
- fa->dev = from->dev;
- if (mask & FA_INODE)
- fa->inode = from->inode;
-}
-
-/* Create a node. */
-int
-fattr_makenode(const struct fattr *fa, const char *path)
-{
- mode_t modemask, mode;
- int error;
-
- error = 0;
-
- if (fa->mask & FA_OWNER && fa->mask & FA_GROUP)
- modemask = FA_SETIDMASK | FA_PERMMASK;
- else
- modemask = FA_PERMMASK;
-
- /* We only implement fattr_makenode() for dirs for now. */
- if (fa->mask & FA_MODE)
- mode = fa->mode & modemask;
- else
- mode = 0700;
-
- if (fa->type == FT_DIRECTORY)
- error = mkdir(path, mode);
- else if (fa->type == FT_SYMLINK) {
- error = symlink(fa->linktarget, path);
- } else if (fa->type == FT_CDEV) {
- lprintf(-1, "Character devices not supported!\n");
- } else if (fa->type == FT_BDEV) {
- lprintf(-1, "Block devices not supported!\n");
- }
- return (error);
-}
-
-int
-fattr_delete(const char *path)
-{
- struct fattr *fa;
- int error;
-
- fa = fattr_frompath(path, FATTR_NOFOLLOW);
- if (fa == NULL) {
- if (errno == ENOENT)
- return (0);
- return (-1);
- }
-
-#ifdef HAVE_FFLAGS
- /* Clear flags. */
- if (fa->mask & FA_FLAGS && fa->flags != 0) {
- fa->flags = 0;
- (void)chflags(path, fa->flags);
- }
-#endif
-
- if (fa->type == FT_DIRECTORY)
- error = rmdir(path);
- else
- error = unlink(path);
- fattr_free(fa);
- return (error);
-}
-
-/*
- * Changes those attributes we can change. Returns -1 on error,
- * 0 if no update was needed, and 1 if an update was needed and
- * it has been applied successfully.
- */
-int
-fattr_install(struct fattr *fa, const char *topath, const char *frompath)
-{
- struct timeval tv[2];
- struct fattr *old;
- int error, inplace, mask;
- mode_t modemask, newmode;
- uid_t uid;
- gid_t gid;
-
- mask = fa->mask & fattr_supported(fa->type);
- if (mask & FA_OWNER && mask & FA_GROUP)
- modemask = FA_SETIDMASK | FA_PERMMASK;
- else
- modemask = FA_PERMMASK;
-
- inplace = 0;
- if (frompath == NULL) {
- /* Changing attributes in place. */
- frompath = topath;
- inplace = 1;
- }
- old = fattr_frompath(topath, FATTR_NOFOLLOW);
- if (old != NULL) {
- if (inplace && fattr_equal(fa, old)) {
- fattr_free(old);
- return (0);
- }
-
-#ifdef HAVE_FFLAGS
- /*
- * Determine whether we need to clear the flags of the target.
- * This is bogus in that it assumes a value of 0 is safe and
- * that non-zero is unsafe. I'm not really worried by that
- * since as far as I know that's the way things are.
- */
- if ((old->mask & FA_FLAGS) && old->flags > 0) {
- (void)chflags(topath, 0);
- old->flags = 0;
- }
-#endif
-
- /*
- * If it is changed from a file to a symlink, remove the file
- * and create the symlink.
- */
- if (inplace && (fa->type == FT_SYMLINK) &&
- (old->type == FT_FILE)) {
- error = unlink(topath);
- if (error)
- goto bad;
- error = symlink(fa->linktarget, topath);
- if (error)
- goto bad;
- }
- /* Determine whether we need to remove the target first. */
- if (!inplace && (fa->type == FT_DIRECTORY) !=
- (old->type == FT_DIRECTORY)) {
- if (old->type == FT_DIRECTORY)
- error = rmdir(topath);
- else
- error = unlink(topath);
- if (error)
- goto bad;
- }
- }
-
- /* Change those attributes that we can before moving the file
- * into place. That makes installation atomic in most cases. */
- if (mask & FA_MODTIME) {
- gettimeofday(tv, NULL); /* Access time. */
- tv[1].tv_sec = fa->modtime; /* Modification time. */
- tv[1].tv_usec = 0;
- error = utimes(frompath, tv);
- if (error)
- goto bad;
- }
- if (mask & FA_OWNER || mask & FA_GROUP) {
- uid = -1;
- gid = -1;
- if (mask & FA_OWNER)
- uid = fa->uid;
- if (mask & FA_GROUP)
- gid = fa->gid;
- error = chown(frompath, uid, gid);
- if (error) {
- goto bad;
- }
- }
- if (mask & FA_MODE) {
- newmode = fa->mode & modemask;
- /* Merge in set*id bits from the old attribute. */
- if (old != NULL && old->mask & FA_MODE) {
- newmode |= (old->mode & ~modemask);
- newmode &= (FA_SETIDMASK | FA_PERMMASK);
- }
- error = chmod(frompath, newmode);
- if (error)
- goto bad;
- }
-
- if (!inplace) {
- error = rename(frompath, topath);
- if (error)
- goto bad;
- }
-
-#ifdef HAVE_FFLAGS
- /* Set the flags. */
- if (mask & FA_FLAGS)
- (void)chflags(topath, fa->flags);
-#endif
- fattr_free(old);
- return (1);
-bad:
- fattr_free(old);
- return (-1);
-}
-
-/*
- * Returns 1 if both attributes are equal, 0 otherwise.
- *
- * This function only compares attributes that are valid in both
- * files. A file of unknown type ("FT_UNKNOWN") is unequal to
- * anything, including itself.
- */
-int
-fattr_equal(const struct fattr *fa1, const struct fattr *fa2)
-{
- int mask;
-
- mask = fa1->mask & fa2->mask;
- if (fa1->type == FT_UNKNOWN || fa2->type == FT_UNKNOWN)
- return (0);
- if (mask & FA_FILETYPE)
- if (fa1->type != fa2->type)
- return (0);
- if (mask & FA_MODTIME)
- if (fa1->modtime != fa2->modtime)
- return (0);
- if (mask & FA_SIZE)
- if (fa1->size != fa2->size)
- return (0);
- if (mask & FA_LINKTARGET)
- if (strcmp(fa1->linktarget, fa2->linktarget) != 0)
- return (0);
- if (mask & FA_RDEV)
- if (fa1->rdev != fa2->rdev)
- return (0);
- if (mask & FA_OWNER)
- if (fa1->uid != fa2->uid)
- return (0);
- if (mask & FA_GROUP)
- if (fa1->gid != fa2->gid)
- return (0);
- if (mask & FA_MODE)
- if (fa1->mode != fa2->mode)
- return (0);
- if (mask & FA_FLAGS)
- if (fa1->flags != fa2->flags)
- return (0);
- if (mask & FA_LINKCOUNT)
- if (fa1->linkcount != fa2->linkcount)
- return (0);
- if (mask & FA_DEV)
- if (fa1->dev != fa2->dev)
- return (0);
- if (mask & FA_INODE)
- if (fa1->inode != fa2->inode)
- return (0);
- return (1);
-}
-
-/*
- * Must have to get the correct filesize sendt by the server.
- */
-off_t
-fattr_filesize(const struct fattr *fa)
-{
- return (fa->size);
-}
diff --git a/usr.bin/csup/fattr.h b/usr.bin/csup/fattr.h
deleted file mode 100644
index bd4e649..0000000
--- a/usr.bin/csup/fattr.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*-
- * Copyright (c) 2003-2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#ifndef _FATTR_H_
-#define _FATTR_H_
-
-#include <sys/types.h>
-
-#include <fcntl.h>
-#include <time.h>
-
-/*
- * File types.
- */
-#define FT_UNKNOWN 0 /* Unknown file type. */
-#define FT_FILE 1 /* Regular file. */
-#define FT_DIRECTORY 2 /* Directory. */
-#define FT_CDEV 3 /* Character device. */
-#define FT_BDEV 4 /* Block device. */
-#define FT_SYMLINK 5 /* Symbolic link. */
-#define FT_MAX FT_SYMLINK /* Maximum file type number. */
-#define FT_NUMBER (FT_MAX + 1) /* Number of file types. */
-
-/*
- * File attributes.
- */
-#define FA_FILETYPE 0x0001 /* True for all supported file types. */
-#define FA_MODTIME 0x0002 /* Last file modification time. */
-#define FA_SIZE 0x0004 /* Size of the file. */
-#define FA_LINKTARGET 0x0008 /* Target of a symbolic link. */
-#define FA_RDEV 0x0010 /* Device for a device node. */
-#define FA_OWNER 0x0020 /* Owner of the file. */
-#define FA_GROUP 0x0040 /* Group of the file. */
-#define FA_MODE 0x0080 /* File permissions. */
-#define FA_FLAGS 0x0100 /* 4.4BSD flags, a la chflags(2). */
-#define FA_LINKCOUNT 0x0200 /* Hard link count. */
-#define FA_DEV 0x0400 /* Device holding the inode. */
-#define FA_INODE 0x0800 /* Inode number. */
-
-#define FA_MASK 0x0fff
-
-#define FA_NUMBER 12 /* Number of file attributes. */
-
-/* Attributes that we might be able to change. */
-#define FA_CHANGEABLE (FA_MODTIME | FA_OWNER | FA_GROUP | FA_MODE | FA_FLAGS)
-
-/*
- * Attributes that we don't want to save in the "checkouts" file
- * when in checkout mode.
- */
-#define FA_COIGNORE (FA_MASK & ~(FA_FILETYPE|FA_MODTIME|FA_SIZE|FA_MODE))
-
-/* These are for fattr_frompath(). */
-#define FATTR_FOLLOW 0
-#define FATTR_NOFOLLOW 1
-
-struct stat;
-struct fattr;
-
-typedef int fattr_support_t[FT_NUMBER];
-
-extern const struct fattr *fattr_bogus;
-
-void fattr_init(void);
-void fattr_fini(void);
-
-struct fattr *fattr_new(int, time_t);
-struct fattr *fattr_default(int);
-struct fattr *fattr_fromstat(struct stat *);
-struct fattr *fattr_frompath(const char *, int);
-struct fattr *fattr_fromfd(int);
-struct fattr *fattr_decode(char *);
-struct fattr *fattr_forcheckout(const struct fattr *, mode_t);
-struct fattr *fattr_dup(const struct fattr *);
-char *fattr_encode(const struct fattr *, fattr_support_t, int);
-int fattr_type(const struct fattr *);
-void fattr_maskout(struct fattr *, int);
-int fattr_getmask(const struct fattr *);
-nlink_t fattr_getlinkcount(const struct fattr *);
-char *fattr_getlinktarget(const struct fattr *);
-void fattr_umask(struct fattr *, mode_t);
-void fattr_merge(struct fattr *, const struct fattr *);
-void fattr_mergedefault(struct fattr *);
-void fattr_override(struct fattr *, const struct fattr *, int);
-int fattr_makenode(const struct fattr *, const char *);
-int fattr_delete(const char *path);
-int fattr_install(struct fattr *, const char *, const char *);
-int fattr_equal(const struct fattr *, const struct fattr *);
-void fattr_free(struct fattr *);
-int fattr_supported(int);
-off_t fattr_filesize(const struct fattr *);
-
-
-#endif /* !_FATTR_H_ */
diff --git a/usr.bin/csup/fattr_bsd.h b/usr.bin/csup/fattr_bsd.h
deleted file mode 100644
index 112a824..0000000
--- a/usr.bin/csup/fattr_bsd.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*-
- * Copyright (c) 2003-2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- */
-
-/*
- * The file attributes we support in a BSD environment.
- *
- * This is similar to fattr_posix.h, except that we support the FA_FLAGS
- * attribute when it makes sense. The FA_FLAGS attribute is for the
- * extended BSD file flags, see chflags(2).
- */
-fattr_support_t fattr_support = {
- /* FT_UNKNOWN */
- 0,
- /* FT_FILE */
- FA_FILETYPE | FA_MODTIME | FA_SIZE | FA_OWNER | FA_GROUP | FA_MODE |
- FA_FLAGS | FA_LINKCOUNT | FA_INODE | FA_DEV,
- /* FT_DIRECTORY */
- FA_FILETYPE | FA_OWNER | FA_GROUP | FA_MODE | FA_FLAGS,
- /* FT_CDEV */
- FA_FILETYPE | FA_RDEV | FA_OWNER | FA_GROUP | FA_MODE | FA_FLAGS |
- FA_LINKCOUNT | FA_DEV | FA_INODE,
- /* FT_BDEV */
- FA_FILETYPE | FA_RDEV | FA_OWNER | FA_GROUP | FA_MODE | FA_FLAGS |
- FA_LINKCOUNT | FA_DEV | FA_INODE,
- /* FT_SYMLINK */
- FA_FILETYPE | FA_LINKTARGET
-};
diff --git a/usr.bin/csup/fattr_posix.h b/usr.bin/csup/fattr_posix.h
deleted file mode 100644
index c4650e4..0000000
--- a/usr.bin/csup/fattr_posix.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*-
- * Copyright (c) 2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- */
-
-/*
- * The file attributes we support in a POSIX environment.
- */
-fattr_support_t fattr_support = {
- /* FT_UNKNOWN */
- 0,
- /* FT_FILE */
- FA_FILETYPE | FA_MODTIME | FA_SIZE | FA_OWNER | FA_GROUP | FA_MODE |
- FA_LINKCOUNT | FA_INODE | FA_DEV,
- /* FT_DIRECTORY */
- FA_FILETYPE | FA_OWNER | FA_GROUP | FA_MODE,
- /* FT_CDEV */
- FA_FILETYPE | FA_RDEV | FA_OWNER | FA_GROUP | FA_MODE | FA_LINKCOUNT |
- FA_DEV | FA_INODE,
- /* FT_BDEV */
- FA_FILETYPE | FA_RDEV | FA_OWNER | FA_GROUP | FA_MODE | FA_LINKCOUNT |
- FA_DEV | FA_INODE,
- /* FT_SYMLINK */
- FA_FILETYPE | FA_LINKTARGET
-};
diff --git a/usr.bin/csup/fixups.c b/usr.bin/csup/fixups.c
deleted file mode 100644
index c398397..0000000
--- a/usr.bin/csup/fixups.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/*-
- * Copyright (c) 2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <sys/queue.h>
-
-#include <assert.h>
-#include <pthread.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "fixups.h"
-#include "misc.h"
-
-/*
- * A synchronized queue to implement fixups. The updater thread adds
- * fixup requests to the queue with fixups_put() when a checksum
- * mismatch error occurred. It then calls fixups_close() when he's
- * done requesting fixups. The detailer thread gets the fixups with
- * fixups_get() and then send the requests to the server.
- *
- * The queue is synchronized with a mutex and a condition variable.
- */
-
-struct fixups {
- pthread_mutex_t lock;
- pthread_cond_t cond;
- STAILQ_HEAD(, fixup) fixupq;
- struct fixup *cur;
- size_t size;
- int closed;
-};
-
-static void fixups_lock(struct fixups *);
-static void fixups_unlock(struct fixups *);
-
-static struct fixup *fixup_new(struct coll *, const char *);
-static void fixup_free(struct fixup *);
-
-static void
-fixups_lock(struct fixups *f)
-{
- int error;
-
- error = pthread_mutex_lock(&f->lock);
- assert(!error);
-}
-
-static void
-fixups_unlock(struct fixups *f)
-{
- int error;
-
- error = pthread_mutex_unlock(&f->lock);
- assert(!error);
-}
-
-static struct fixup *
-fixup_new(struct coll *coll, const char *name)
-{
- struct fixup *fixup;
-
- fixup = xmalloc(sizeof(struct fixup));
- fixup->f_name = xstrdup(name);
- fixup->f_coll = coll;
- return (fixup);
-}
-
-static void
-fixup_free(struct fixup *fixup)
-{
-
- free(fixup->f_name);
- free(fixup);
-}
-
-/* Create a new fixup queue. */
-struct fixups *
-fixups_new(void)
-{
- struct fixups *f;
-
- f = xmalloc(sizeof(struct fixups));
- f->size = 0;
- f->closed = 0;
- f->cur = NULL;
- STAILQ_INIT(&f->fixupq);
- pthread_mutex_init(&f->lock, NULL);
- pthread_cond_init(&f->cond, NULL);
- return (f);
-}
-
-/* Add a fixup request to the queue. */
-void
-fixups_put(struct fixups *f, struct coll *coll, const char *name)
-{
- struct fixup *fixup;
- int dosignal;
-
- dosignal = 0;
- fixup = fixup_new(coll, name);
- fixups_lock(f);
- assert(!f->closed);
- STAILQ_INSERT_TAIL(&f->fixupq, fixup, f_link);
- if (f->size++ == 0)
- dosignal = 1;
- fixups_unlock(f);
- if (dosignal)
- pthread_cond_signal(&f->cond);
-}
-
-/* Get a fixup request from the queue. */
-struct fixup *
-fixups_get(struct fixups *f)
-{
- struct fixup *fixup, *tofree;
-
- fixups_lock(f);
- while (f->size == 0 && !f->closed)
- pthread_cond_wait(&f->cond, &f->lock);
- if (f->closed && f->size == 0) {
- fixups_unlock(f);
- return (NULL);
- }
- assert(f->size > 0);
- fixup = STAILQ_FIRST(&f->fixupq);
- tofree = f->cur;
- f->cur = fixup;
- STAILQ_REMOVE_HEAD(&f->fixupq, f_link);
- f->size--;
- fixups_unlock(f);
- if (tofree != NULL)
- fixup_free(tofree);
- return (fixup);
-}
-
-/* Close the writing end of the queue. */
-void
-fixups_close(struct fixups *f)
-{
- int dosignal;
-
- dosignal = 0;
- fixups_lock(f);
- if (f->size == 0 && !f->closed)
- dosignal = 1;
- f->closed = 1;
- fixups_unlock(f);
- if (dosignal)
- pthread_cond_signal(&f->cond);
-}
-
-/* Free a fixups queue. */
-void
-fixups_free(struct fixups *f)
-{
- struct fixup *fixup, *fixup2;
-
- assert(f->closed);
- /*
- * Free any fixup that has been left on the queue.
- * This can happen if we have been aborted prematurely.
- */
- fixup = STAILQ_FIRST(&f->fixupq);
- while (fixup != NULL) {
- fixup2 = STAILQ_NEXT(fixup, f_link);
- fixup_free(fixup);
- fixup = fixup2;
- }
- if (f->cur != NULL)
- fixup_free(f->cur);
- pthread_cond_destroy(&f->cond);
- pthread_mutex_destroy(&f->lock);
- free(f);
-}
diff --git a/usr.bin/csup/fnmatch.c b/usr.bin/csup/fnmatch.c
deleted file mode 100644
index 16e4e21..0000000
--- a/usr.bin/csup/fnmatch.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Copyright (c) 1989, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Guido van Rossum.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- *
- * From FreeBSD fnmatch.c 1.11
- * $Id: fnmatch.c,v 1.3 1997/08/19 02:34:30 jdp Exp $
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94";
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * Function fnmatch() as specified in POSIX 1003.2-1992, section B.6.
- * Compares a filename or pathname to a pattern.
- */
-
-#include <ctype.h>
-#include <string.h>
-#include <stdio.h>
-
-#include "fnmatch.h"
-
-#define EOS '\0'
-
-static const char *rangematch(const char *, char, int);
-
-int
-fnmatch(const char *pattern, const char *string, int flags)
-{
- const char *stringstart;
- char c, test;
-
- for (stringstart = string;;)
- switch (c = *pattern++) {
- case EOS:
- if ((flags & FNM_LEADING_DIR) && *string == '/')
- return (0);
- return (*string == EOS ? 0 : FNM_NOMATCH);
- case '?':
- if (*string == EOS)
- return (FNM_NOMATCH);
- if (*string == '/' && (flags & FNM_PATHNAME))
- return (FNM_NOMATCH);
- if (*string == '.' && (flags & FNM_PERIOD) &&
- (string == stringstart ||
- ((flags & FNM_PATHNAME) && *(string - 1) == '/')))
- return (FNM_NOMATCH);
- ++string;
- break;
- case '*':
- c = *pattern;
- /* Collapse multiple stars. */
- while (c == '*')
- c = *++pattern;
-
- if (*string == '.' && (flags & FNM_PERIOD) &&
- (string == stringstart ||
- ((flags & FNM_PATHNAME) && *(string - 1) == '/')))
- return (FNM_NOMATCH);
-
- /* Optimize for pattern with * at end or before /. */
- if (c == EOS)
- if (flags & FNM_PATHNAME)
- return ((flags & FNM_LEADING_DIR) ||
- strchr(string, '/') == NULL ?
- 0 : FNM_NOMATCH);
- else
- return (0);
- else if (c == '/' && flags & FNM_PATHNAME) {
- if ((string = strchr(string, '/')) == NULL)
- return (FNM_NOMATCH);
- break;
- }
-
- /* General case, use recursion. */
- while ((test = *string) != EOS) {
- if (!fnmatch(pattern, string, flags & ~FNM_PERIOD))
- return (0);
- if (test == '/' && flags & FNM_PATHNAME)
- break;
- ++string;
- }
- return (FNM_NOMATCH);
- case '[':
- if (*string == EOS)
- return (FNM_NOMATCH);
- if (*string == '/' && flags & FNM_PATHNAME)
- return (FNM_NOMATCH);
- if ((pattern =
- rangematch(pattern, *string, flags)) == NULL)
- return (FNM_NOMATCH);
- ++string;
- break;
- case '\\':
- if (!(flags & FNM_NOESCAPE)) {
- if ((c = *pattern++) == EOS) {
- c = '\\';
- --pattern;
- }
- }
- /* FALLTHROUGH */
- default:
- if (c == *string)
- ;
- else if ((flags & FNM_CASEFOLD) &&
- (tolower((unsigned char)c) ==
- tolower((unsigned char)*string)))
- ;
- else if ((flags & FNM_PREFIX_DIRS) && *string == EOS &&
- ((c == '/' && string != stringstart) ||
- (string == stringstart+1 && *stringstart == '/')))
- return (0);
- else
- return (FNM_NOMATCH);
- string++;
- break;
- }
- /* NOTREACHED */
-}
-
-static const char *
-rangematch(const char *pattern, char test, int flags)
-{
- int negate, ok;
- char c, c2;
-
- /*
- * A bracket expression starting with an unquoted circumflex
- * character produces unspecified results (IEEE 1003.2-1992,
- * 3.13.2). This implementation treats it like '!', for
- * consistency with the regular expression syntax.
- * J.T. Conklin (conklin@ngai.kaleida.com)
- */
- if ( (negate = (*pattern == '!' || *pattern == '^')) )
- ++pattern;
-
- if (flags & FNM_CASEFOLD)
- test = tolower((unsigned char)test);
-
- for (ok = 0; (c = *pattern++) != ']';) {
- if (c == '\\' && !(flags & FNM_NOESCAPE))
- c = *pattern++;
- if (c == EOS)
- return (NULL);
-
- if (flags & FNM_CASEFOLD)
- c = tolower((unsigned char)c);
-
- if (*pattern == '-'
- && (c2 = *(pattern+1)) != EOS && c2 != ']') {
- pattern += 2;
- if (c2 == '\\' && !(flags & FNM_NOESCAPE))
- c2 = *pattern++;
- if (c2 == EOS)
- return (NULL);
-
- if (flags & FNM_CASEFOLD)
- c2 = tolower((unsigned char)c2);
-
- if ((unsigned char)c <= (unsigned char)test &&
- (unsigned char)test <= (unsigned char)c2)
- ok = 1;
- } else if (c == test)
- ok = 1;
- }
- return (ok == negate ? NULL : pattern);
-}
diff --git a/usr.bin/csup/fnmatch.h b/usr.bin/csup/fnmatch.h
deleted file mode 100644
index 6c51e7e..0000000
--- a/usr.bin/csup/fnmatch.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- *
- * @(#)fnmatch.h 8.1 (Berkeley) 6/2/93
- *
- * From FreeBSD fnmatch.h 1.7
- * $Id: fnmatch.h,v 1.4 2001/10/04 02:46:21 jdp Exp $
- */
-
-#ifndef _FNMATCH_H_
-#define _FNMATCH_H_
-
-#define FNM_NOMATCH 1 /* Match failed. */
-
-#define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */
-#define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */
-#define FNM_PERIOD 0x04 /* Period must be matched by period. */
-#define FNM_LEADING_DIR 0x08 /* Ignore /<tail> after Imatch. */
-#define FNM_CASEFOLD 0x10 /* Case insensitive search. */
-#define FNM_PREFIX_DIRS 0x20 /* Directory prefixes of pattern match too. */
-
-/* Make this compile successfully with "gcc -traditional" */
-#ifndef __STDC__
-#define const /* empty */
-#endif
-
-int fnmatch(const char *, const char *, int);
-
-#endif /* !_FNMATCH_H_ */
diff --git a/usr.bin/csup/globtree.c b/usr.bin/csup/globtree.c
deleted file mode 100644
index 74ac2c1..0000000
--- a/usr.bin/csup/globtree.c
+++ /dev/null
@@ -1,393 +0,0 @@
-/*-
- * Copyright (c) 2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <sys/types.h>
-
-#include <assert.h>
-#include <regex.h>
-#include <stdlib.h>
-
-#include "fnmatch.h"
-#include "globtree.h"
-#include "misc.h"
-
-/*
- * The "GlobTree" interface allows one to construct arbitrarily complex
- * boolean expressions for evaluating whether to accept or reject a
- * filename. The globtree_test() function returns true or false
- * according to whether the name is accepted or rejected by the
- * expression.
- *
- * Expressions are trees constructed from nodes representing either
- * primitive matching operations (primaries) or operators that are
- * applied to their subexpressions. The simplest primitives are
- * globtree_false(), which matches nothing, and globtree_true(), which
- * matches everything.
- *
- * A more useful primitive is the matching operation, constructed with
- * globtree_match(). It will call fnmatch() with the suppliedi
- * shell-style pattern to determine if the filename matches.
- *
- * Expressions can be combined with the boolean operators AND, OR, and
- * NOT, to form more complex expressions.
- */
-
-/* Node types. */
-#define GLOBTREE_NOT 0
-#define GLOBTREE_AND 1
-#define GLOBTREE_OR 2
-#define GLOBTREE_MATCH 3
-#define GLOBTREE_REGEX 4
-#define GLOBTREE_TRUE 5
-#define GLOBTREE_FALSE 6
-
-/* A node. */
-struct globtree {
- int type;
- struct globtree *left;
- struct globtree *right;
-
- /* The "data" field points to the text pattern for GLOBTREE_MATCH
- nodes, and to the regex_t for GLOBTREE_REGEX nodes. For any
- other node, it is set to NULL. */
- void *data;
- /* The "flags" field contains the flags to pass to fnmatch() for
- GLOBTREE_MATCH nodes. */
- int flags;
-};
-
-static struct globtree *globtree_new(int);
-static int globtree_eval(struct globtree *, const char *);
-
-static struct globtree *
-globtree_new(int type)
-{
- struct globtree *gt;
-
- gt = xmalloc(sizeof(struct globtree));
- gt->type = type;
- gt->data = NULL;
- gt->flags = 0;
- gt->left = NULL;
- gt->right = NULL;
- return (gt);
-}
-
-struct globtree *
-globtree_true(void)
-{
- struct globtree *gt;
-
- gt = globtree_new(GLOBTREE_TRUE);
- return (gt);
-}
-
-struct globtree *
-globtree_false(void)
-{
- struct globtree *gt;
-
- gt = globtree_new(GLOBTREE_FALSE);
- return (gt);
-}
-
-struct globtree *
-globtree_match(const char *pattern, int flags)
-{
- struct globtree *gt;
-
- gt = globtree_new(GLOBTREE_MATCH);
- gt->data = xstrdup(pattern);
- gt->flags = flags;
- return (gt);
-}
-
-struct globtree *
-globtree_regex(const char *pattern)
-{
- struct globtree *gt;
- int error;
-
- gt = globtree_new(GLOBTREE_REGEX);
- gt->data = xmalloc(sizeof(regex_t));
- error = regcomp(gt->data, pattern, REG_NOSUB);
- assert(!error);
- return (gt);
-}
-
-struct globtree *
-globtree_and(struct globtree *left, struct globtree *right)
-{
- struct globtree *gt;
-
- if (left->type == GLOBTREE_FALSE || right->type == GLOBTREE_FALSE) {
- globtree_free(left);
- globtree_free(right);
- gt = globtree_false();
- return (gt);
- }
- if (left->type == GLOBTREE_TRUE) {
- globtree_free(left);
- return (right);
- }
- if (right->type == GLOBTREE_TRUE) {
- globtree_free(right);
- return (left);
- }
- gt = globtree_new(GLOBTREE_AND);
- gt->left = left;
- gt->right = right;
- return (gt);
-}
-
-struct globtree *
-globtree_or(struct globtree *left, struct globtree *right)
-{
- struct globtree *gt;
-
- if (left->type == GLOBTREE_TRUE || right->type == GLOBTREE_TRUE) {
- globtree_free(left);
- globtree_free(right);
- gt = globtree_true();
- return (gt);
- }
- if (left->type == GLOBTREE_FALSE) {
- globtree_free(left);
- return (right);
- }
- if (right->type == GLOBTREE_FALSE) {
- globtree_free(right);
- return (left);
- }
- gt = globtree_new(GLOBTREE_OR);
- gt->left = left;
- gt->right = right;
- return (gt);
-}
-
-struct globtree *
-globtree_not(struct globtree *child)
-{
- struct globtree *gt;
-
- if (child->type == GLOBTREE_TRUE) {
- globtree_free(child);
- gt = globtree_new(GLOBTREE_FALSE);
- return (gt);
- }
- if (child->type == GLOBTREE_FALSE) {
- globtree_free(child);
- gt = globtree_new(GLOBTREE_TRUE);
- return (gt);
- }
- gt = globtree_new(GLOBTREE_NOT);
- gt->left = child;
- return (gt);
-}
-
-/* Evaluate one node (must be a leaf node). */
-static int
-globtree_eval(struct globtree *gt, const char *path)
-{
- int rv;
-
- switch (gt->type) {
- case GLOBTREE_TRUE:
- return (1);
- case GLOBTREE_FALSE:
- return (0);
- case GLOBTREE_MATCH:
- assert(gt->data != NULL);
- rv = fnmatch(gt->data, path, gt->flags);
- if (rv == 0)
- return (1);
- assert(rv == FNM_NOMATCH);
- return (0);
- case GLOBTREE_REGEX:
- assert(gt->data != NULL);
- rv = regexec(gt->data, path, 0, NULL, 0);
- if (rv == 0)
- return (1);
- assert(rv == REG_NOMATCH);
- return (0);
- }
-
- assert(0);
- return (-1);
-}
-
-/* Small stack API to walk the tree iteratively. */
-typedef enum {
- STATE_DOINGLEFT,
- STATE_DOINGRIGHT
-} walkstate_t;
-
-struct stack {
- struct stackelem *stack;
- size_t size;
- size_t in;
-};
-
-struct stackelem {
- struct globtree *node;
- walkstate_t state;
-};
-
-static void
-stack_init(struct stack *stack)
-{
-
- stack->in = 0;
- stack->size = 8; /* Initial size. */
- stack->stack = xmalloc(sizeof(struct stackelem) * stack->size);
-}
-
-static size_t
-stack_size(struct stack *stack)
-{
-
- return (stack->in);
-}
-
-static void
-stack_push(struct stack *stack, struct globtree *node, walkstate_t state)
-{
- struct stackelem *e;
-
- if (stack->in == stack->size) {
- stack->size *= 2;
- stack->stack = xrealloc(stack->stack,
- sizeof(struct stackelem) * stack->size);
- }
- e = stack->stack + stack->in++;
- e->node = node;
- e->state = state;
-}
-
-static void
-stack_pop(struct stack *stack, struct globtree **node, walkstate_t *state)
-{
- struct stackelem *e;
-
- assert(stack->in > 0);
- e = stack->stack + --stack->in;
- *node = e->node;
- *state = e->state;
-}
-
-static void
-stack_free(struct stack *s)
-{
-
- free(s->stack);
-}
-
-/* Tests if the supplied filename matches. */
-int
-globtree_test(struct globtree *gt, const char *path)
-{
- struct stack stack;
- walkstate_t state;
- int val;
-
- stack_init(&stack);
- for (;;) {
-doleft:
- /* Descend to the left until we hit bottom. */
- while (gt->left != NULL) {
- stack_push(&stack, gt, STATE_DOINGLEFT);
- gt = gt->left;
- }
-
- /* Now we're at a leaf node. Evaluate it. */
- val = globtree_eval(gt, path);
- /* Ascend, propagating the value through operator nodes. */
- for (;;) {
- if (stack_size(&stack) == 0) {
- stack_free(&stack);
- return (val);
- }
- stack_pop(&stack, &gt, &state);
- switch (gt->type) {
- case GLOBTREE_NOT:
- val = !val;
- break;
- case GLOBTREE_AND:
- /* If we haven't yet evaluated the right subtree
- and the partial result is true, descend to
- the right. Otherwise the result is already
- determined to be val. */
- if (state == STATE_DOINGLEFT && val) {
- stack_push(&stack, gt,
- STATE_DOINGRIGHT);
- gt = gt->right;
- goto doleft;
- }
- break;
- case GLOBTREE_OR:
- /* If we haven't yet evaluated the right subtree
- and the partial result is false, descend to
- the right. Otherwise the result is already
- determined to be val. */
- if (state == STATE_DOINGLEFT && !val) {
- stack_push(&stack, gt,
- STATE_DOINGRIGHT);
- gt = gt->right;
- goto doleft;
- }
- break;
- default:
- /* We only push nodes that have children. */
- assert(0);
- return (-1);
- }
- }
- }
-}
-
-/*
- * We could de-recursify this function using a stack, but it would be
- * overkill since it is never called from a thread context with a
- * limited stack size nor used in a critical path, so I think we can
- * afford keeping it recursive.
- */
-void
-globtree_free(struct globtree *gt)
-{
-
- if (gt->data != NULL) {
- if (gt->type == GLOBTREE_REGEX)
- regfree(gt->data);
- free(gt->data);
- }
- if (gt->left != NULL)
- globtree_free(gt->left);
- if (gt->right != NULL)
- globtree_free(gt->right);
- free(gt);
-}
diff --git a/usr.bin/csup/globtree.h b/usr.bin/csup/globtree.h
deleted file mode 100644
index 43882e3..0000000
--- a/usr.bin/csup/globtree.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*-
- * Copyright (c) 2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#ifndef _GLOBTREE_H_
-#define _GLOBTREE_H_
-
-#include "fnmatch.h"
-
-struct globtree;
-
-struct globtree *globtree_true(void);
-struct globtree *globtree_false(void);
-struct globtree *globtree_match(const char *, int);
-struct globtree *globtree_regex(const char *);
-struct globtree *globtree_and(struct globtree *, struct globtree *);
-struct globtree *globtree_or(struct globtree *, struct globtree *);
-struct globtree *globtree_not(struct globtree *);
-int globtree_test(struct globtree *, const char *);
-void globtree_free(struct globtree *);
-
-#endif /* !_GLOBTREE_H_ */
diff --git a/usr.bin/csup/idcache.c b/usr.bin/csup/idcache.c
deleted file mode 100644
index 47a3e71..0000000
--- a/usr.bin/csup/idcache.c
+++ /dev/null
@@ -1,421 +0,0 @@
-/*-
- * Copyright (c) 2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#include <sys/types.h>
-
-#include <assert.h>
-#include <grp.h>
-#include <pthread.h>
-#include <pwd.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "idcache.h"
-#include "misc.h"
-
-/*
- * Constants and data structures used to implement the thread-safe
- * group and password file caches. Cache sizes must be prime.
- */
-#define UIDTONAME_SZ 317 /* Size of uid -> user name cache */
-#define NAMETOUID_SZ 317 /* Size of user name -> uid cache */
-#define GIDTONAME_SZ 317 /* Size of gid -> group name cache */
-#define NAMETOGID_SZ 317 /* Size of group name -> gid cache */
-
-/* Node structures used to cache lookups. */
-struct uidc {
- char *name; /* user name */
- uid_t uid; /* cached uid */
- int valid; /* is this a valid or a miss entry */
- struct uidc *next; /* for collisions */
-};
-
-struct gidc {
- char *name; /* group name */
- gid_t gid; /* cached gid */
- int valid; /* is this a valid or a miss entry */
- struct gidc *next; /* for collisions */
-};
-
-static struct uidc **uidtoname; /* uid to user name cache */
-static struct gidc **gidtoname; /* gid to group name cache */
-static struct uidc **nametouid; /* user name to uid cache */
-static struct gidc **nametogid; /* group name to gid cache */
-
-static pthread_mutex_t uid_mtx;
-static pthread_mutex_t gid_mtx;
-
-static void uid_lock(void);
-static void uid_unlock(void);
-static void gid_lock(void);
-static void gid_unlock(void);
-
-static uint32_t hash(const char *);
-
-/* A 32-bit version of Peter Weinberger's (PJW) hash algorithm,
- as used by ELF for hashing function names. */
-static uint32_t
-hash(const char *name)
-{
- uint32_t g, h;
-
- h = 0;
- while(*name != '\0') {
- h = (h << 4) + *name++;
- if ((g = h & 0xF0000000)) {
- h ^= g >> 24;
- h &= 0x0FFFFFFF;
- }
- }
- return (h);
-}
-
-static void
-uid_lock(void)
-{
- int error;
-
- error = pthread_mutex_lock(&uid_mtx);
- assert(!error);
-}
-
-static void
-uid_unlock(void)
-{
- int error;
-
- error = pthread_mutex_unlock(&uid_mtx);
- assert(!error);
-}
-
-static void
-gid_lock(void)
-{
- int error;
-
- error = pthread_mutex_lock(&gid_mtx);
- assert(!error);
-}
-
-static void
-gid_unlock(void)
-{
- int error;
-
- error = pthread_mutex_unlock(&gid_mtx);
- assert(!error);
-}
-
-static void
-uidc_insert(struct uidc **tbl, struct uidc *uidc, uint32_t key)
-{
-
- uidc->next = tbl[key];
- tbl[key] = uidc;
-}
-
-static void
-gidc_insert(struct gidc **tbl, struct gidc *gidc, uint32_t key)
-{
-
- gidc->next = tbl[key];
- tbl[key] = gidc;
-}
-
-/* Return the user name for this uid, or NULL if it's not found. */
-char *
-getuserbyid(uid_t uid)
-{
- struct passwd *pw;
- struct uidc *uidc, *uidc2;
- uint32_t key, key2;
-
- key = uid % UIDTONAME_SZ;
- uid_lock();
- uidc = uidtoname[key];
- while (uidc != NULL) {
- if (uidc->uid == uid)
- break;
- uidc = uidc->next;
- }
-
- if (uidc == NULL) {
- /* We didn't find this uid, look it up and add it. */
- uidc = xmalloc(sizeof(struct uidc));
- uidc->uid = uid;
- pw = getpwuid(uid);
- if (pw != NULL) {
- /* This uid is in the password file. */
- uidc->name = xstrdup(pw->pw_name);
- uidc->valid = 1;
- /* Also add it to the name -> gid table. */
- uidc2 = xmalloc(sizeof(struct uidc));
- uidc2->uid = uid;
- uidc2->name = uidc->name; /* We reuse the pointer. */
- uidc2->valid = 1;
- key2 = hash(uidc->name) % NAMETOUID_SZ;
- uidc_insert(nametouid, uidc2, key2);
- } else {
- /* Add a miss entry for this uid. */
- uidc->name = NULL;
- uidc->valid = 0;
- }
- uidc_insert(uidtoname, uidc, key);
- }
- /* It is safe to unlock here since the cache structure
- is not going to get freed or changed. */
- uid_unlock();
- return (uidc->name);
-}
-
-/* Return the group name for this gid, or NULL if it's not found. */
-char *
-getgroupbyid(gid_t gid)
-{
- struct group *gr;
- struct gidc *gidc, *gidc2;
- uint32_t key, key2;
-
- key = gid % GIDTONAME_SZ;
- gid_lock();
- gidc = gidtoname[key];
- while (gidc != NULL) {
- if (gidc->gid == gid)
- break;
- gidc = gidc->next;
- }
-
- if (gidc == NULL) {
- /* We didn't find this gid, look it up and add it. */
- gidc = xmalloc(sizeof(struct gidc));
- gidc->gid = gid;
- gr = getgrgid(gid);
- if (gr != NULL) {
- /* This gid is in the group file. */
- gidc->name = xstrdup(gr->gr_name);
- gidc->valid = 1;
- /* Also add it to the name -> gid table. */
- gidc2 = xmalloc(sizeof(struct gidc));
- gidc2->gid = gid;
- gidc2->name = gidc->name; /* We reuse the pointer. */
- gidc2->valid = 1;
- key2 = hash(gidc->name) % NAMETOGID_SZ;
- gidc_insert(nametogid, gidc2, key2);
- } else {
- /* Add a miss entry for this gid. */
- gidc->name = NULL;
- gidc->valid = 0;
- }
- gidc_insert(gidtoname, gidc, key);
- }
- /* It is safe to unlock here since the cache structure
- is not going to get freed or changed. */
- gid_unlock();
- return (gidc->name);
-}
-
-/* Finds the uid for this user name. If it's found, the gid is stored
- in *uid and 0 is returned. Otherwise, -1 is returned. */
-int
-getuidbyname(const char *name, uid_t *uid)
-{
- struct passwd *pw;
- struct uidc *uidc, *uidc2;
- uint32_t key, key2;
-
- uid_lock();
- key = hash(name) % NAMETOUID_SZ;
- uidc = nametouid[key];
- while (uidc != NULL) {
- if (strcmp(uidc->name, name) == 0)
- break;
- uidc = uidc->next;
- }
-
- if (uidc == NULL) {
- uidc = xmalloc(sizeof(struct uidc));
- uidc->name = xstrdup(name);
- pw = getpwnam(name);
- if (pw != NULL) {
- /* This user name is in the password file. */
- uidc->valid = 1;
- uidc->uid = pw->pw_uid;
- /* Also add it to the uid -> name table. */
- uidc2 = xmalloc(sizeof(struct uidc));
- uidc2->name = uidc->name; /* We reuse the pointer. */
- uidc2->uid = uidc->uid;
- uidc2->valid = 1;
- key2 = uidc2->uid % UIDTONAME_SZ;
- uidc_insert(uidtoname, uidc2, key2);
- } else {
- /* Add a miss entry for this user name. */
- uidc->valid = 0;
- uidc->uid = (uid_t)-1; /* Should not be accessed. */
- }
- uidc_insert(nametouid, uidc, key);
- }
- /* It is safe to unlock here since the cache structure
- is not going to get freed or changed. */
- uid_unlock();
- if (!uidc->valid)
- return (-1);
- *uid = uidc->uid;
- return (0);
-}
-
-/* Finds the gid for this group name. If it's found, the gid is stored
- in *gid and 0 is returned. Otherwise, -1 is returned. */
-int
-getgidbyname(const char *name, gid_t *gid)
-{
- struct group *gr;
- struct gidc *gidc, *gidc2;
- uint32_t key, key2;
-
- gid_lock();
- key = hash(name) % NAMETOGID_SZ;
- gidc = nametogid[key];
- while (gidc != NULL) {
- if (strcmp(gidc->name, name) == 0)
- break;
- gidc = gidc->next;
- }
-
- if (gidc == NULL) {
- gidc = xmalloc(sizeof(struct gidc));
- gidc->name = xstrdup(name);
- gr = getgrnam(name);
- if (gr != NULL) {
- /* This group name is in the group file. */
- gidc->gid = gr->gr_gid;
- gidc->valid = 1;
- /* Also add it to the gid -> name table. */
- gidc2 = xmalloc(sizeof(struct gidc));
- gidc2->name = gidc->name; /* We reuse the pointer. */
- gidc2->gid = gidc->gid;
- gidc2->valid = 1;
- key2 = gidc2->gid % GIDTONAME_SZ;
- gidc_insert(gidtoname, gidc2, key2);
- } else {
- /* Add a miss entry for this group name. */
- gidc->gid = (gid_t)-1; /* Should not be accessed. */
- gidc->valid = 0;
- }
- gidc_insert(nametogid, gidc, key);
- }
- /* It is safe to unlock here since the cache structure
- is not going to get freed or changed. */
- gid_unlock();
- if (!gidc->valid)
- return (-1);
- *gid = gidc->gid;
- return (0);
-}
-
-/* Initialize the cache structures. */
-void
-idcache_init(void)
-{
-
- pthread_mutex_init(&uid_mtx, NULL);
- pthread_mutex_init(&gid_mtx, NULL);
- uidtoname = xmalloc(UIDTONAME_SZ * sizeof(struct uidc *));
- gidtoname = xmalloc(GIDTONAME_SZ * sizeof(struct gidc *));
- nametouid = xmalloc(NAMETOUID_SZ * sizeof(struct uidc *));
- nametogid = xmalloc(NAMETOGID_SZ * sizeof(struct gidc *));
- memset(uidtoname, 0, UIDTONAME_SZ * sizeof(struct uidc *));
- memset(gidtoname, 0, GIDTONAME_SZ * sizeof(struct gidc *));
- memset(nametouid, 0, NAMETOUID_SZ * sizeof(struct uidc *));
- memset(nametogid, 0, NAMETOGID_SZ * sizeof(struct gidc *));
-}
-
-/* Cleanup the cache structures. */
-void
-idcache_fini(void)
-{
- struct uidc *uidc, *uidc2;
- struct gidc *gidc, *gidc2;
- size_t i;
-
- for (i = 0; i < UIDTONAME_SZ; i++) {
- uidc = uidtoname[i];
- while (uidc != NULL) {
- if (uidc->name != NULL) {
- assert(uidc->valid);
- free(uidc->name);
- }
- uidc2 = uidc->next;
- free(uidc);
- uidc = uidc2;
- }
- }
- free(uidtoname);
- for (i = 0; i < NAMETOUID_SZ; i++) {
- uidc = nametouid[i];
- while (uidc != NULL) {
- assert(uidc->name != NULL);
- /* If it's a valid entry, it has been added to both the
- uidtoname and nametouid tables, and the name pointer
- has been reused for both entries. Thus, the name
- pointer has already been freed in the loop above. */
- if (!uidc->valid)
- free(uidc->name);
- uidc2 = uidc->next;
- free(uidc);
- uidc = uidc2;
- }
- }
- free(nametouid);
- for (i = 0; i < GIDTONAME_SZ; i++) {
- gidc = gidtoname[i];
- while (gidc != NULL) {
- if (gidc->name != NULL) {
- assert(gidc->valid);
- free(gidc->name);
- }
- gidc2 = gidc->next;
- free(gidc);
- gidc = gidc2;
- }
- }
- free(gidtoname);
- for (i = 0; i < NAMETOGID_SZ; i++) {
- gidc = nametogid[i];
- while (gidc != NULL) {
- assert(gidc->name != NULL);
- /* See above comment. */
- if (!gidc->valid)
- free(gidc->name);
- gidc2 = gidc->next;
- free(gidc);
- gidc = gidc2;
- }
- }
- free(nametogid);
- pthread_mutex_destroy(&uid_mtx);
- pthread_mutex_destroy(&gid_mtx);
-}
diff --git a/usr.bin/csup/keyword.c b/usr.bin/csup/keyword.c
deleted file mode 100644
index 8e03c8d..0000000
--- a/usr.bin/csup/keyword.c
+++ /dev/null
@@ -1,526 +0,0 @@
-/*-
- * Copyright (c) 2003-2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <sys/queue.h>
-
-#include <assert.h>
-#include <err.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-#include "diff.h"
-#include "keyword.h"
-#include "misc.h"
-#include "stream.h"
-
-/*
- * The keyword API is used to expand the CVS/RCS keywords in files,
- * such as $Id$, $Revision$, etc. The server does it for us when it
- * sends us entire files, but we need to handle the expansion when
- * applying a diff update.
- */
-
-enum rcskey {
- RCSKEY_AUTHOR,
- RCSKEY_CVSHEADER,
- RCSKEY_DATE,
- RCSKEY_HEADER,
- RCSKEY_ID,
- RCSKEY_LOCKER,
- RCSKEY_LOG,
- RCSKEY_NAME,
- RCSKEY_RCSFILE,
- RCSKEY_REVISION,
- RCSKEY_SOURCE,
- RCSKEY_STATE
-};
-
-typedef enum rcskey rcskey_t;
-
-struct tag {
- char *ident;
- rcskey_t key;
- int enabled;
- STAILQ_ENTRY(tag) next;
-};
-
-static struct tag *tag_new(const char *, rcskey_t);
-static char *tag_expand(struct tag *, struct diffinfo *);
-static void tag_free(struct tag *);
-
-struct keyword {
- STAILQ_HEAD(, tag) keywords; /* Enabled keywords. */
- size_t minkeylen;
- size_t maxkeylen;
-};
-
-/* Default CVS keywords. */
-static struct {
- const char *ident;
- rcskey_t key;
-} tag_defaults[] = {
- { "Author", RCSKEY_AUTHOR },
- { "CVSHeader", RCSKEY_CVSHEADER },
- { "Date", RCSKEY_DATE },
- { "Header", RCSKEY_HEADER },
- { "Id", RCSKEY_ID },
- { "Locker", RCSKEY_LOCKER },
- { "Log", RCSKEY_LOG },
- { "Name", RCSKEY_NAME },
- { "RCSfile", RCSKEY_RCSFILE },
- { "Revision", RCSKEY_REVISION },
- { "Source", RCSKEY_SOURCE },
- { "State", RCSKEY_STATE },
- { NULL, 0, }
-};
-
-struct keyword *
-keyword_new(void)
-{
- struct keyword *new;
- struct tag *tag;
- size_t len;
- int i;
-
- new = xmalloc(sizeof(struct keyword));
- STAILQ_INIT(&new->keywords);
- new->minkeylen = ~0;
- new->maxkeylen = 0;
- for (i = 0; tag_defaults[i].ident != NULL; i++) {
- tag = tag_new(tag_defaults[i].ident, tag_defaults[i].key);
- STAILQ_INSERT_TAIL(&new->keywords, tag, next);
- len = strlen(tag->ident);
- /*
- * These values are only computed here and not updated when
- * adding an alias. This is a bug, but CVSup has it and we
- * need to be bug-to-bug compatible since the server will
- * expect us to do the same, and we will fail with an MD5
- * checksum mismatch if we don't.
- */
- new->minkeylen = min(new->minkeylen, len);
- new->maxkeylen = max(new->maxkeylen, len);
- }
- return (new);
-}
-
-int
-keyword_decode_expand(const char *expand)
-{
-
- if (strcmp(expand, ".") == 0)
- return (EXPAND_DEFAULT);
- else if (strcmp(expand, "kv") == 0)
- return (EXPAND_KEYVALUE);
- else if (strcmp(expand, "kvl") == 0)
- return (EXPAND_KEYVALUELOCKER);
- else if (strcmp(expand, "k") == 0)
- return (EXPAND_KEY);
- else if (strcmp(expand, "o") == 0)
- return (EXPAND_OLD);
- else if (strcmp(expand, "b") == 0)
- return (EXPAND_BINARY);
- else if (strcmp(expand, "v") == 0)
- return (EXPAND_VALUE);
- else
- return (-1);
-}
-
-const char *
-keyword_encode_expand(int expand)
-{
-
- switch (expand) {
- case EXPAND_DEFAULT:
- return (".");
- case EXPAND_KEYVALUE:
- return ("kv");
- case EXPAND_KEYVALUELOCKER:
- return ("kvl");
- case EXPAND_KEY:
- return ("k");
- case EXPAND_OLD:
- return ("o");
- case EXPAND_BINARY:
- return ("b");
- case EXPAND_VALUE:
- return ("v");
- }
- return (NULL);
-}
-
-void
-keyword_free(struct keyword *keyword)
-{
- struct tag *tag;
-
- if (keyword == NULL)
- return;
- while (!STAILQ_EMPTY(&keyword->keywords)) {
- tag = STAILQ_FIRST(&keyword->keywords);
- STAILQ_REMOVE_HEAD(&keyword->keywords, next);
- tag_free(tag);
- }
- free(keyword);
-}
-
-int
-keyword_alias(struct keyword *keyword, const char *ident, const char *rcskey)
-{
- struct tag *new, *tag;
-
- STAILQ_FOREACH(tag, &keyword->keywords, next) {
- if (strcmp(tag->ident, rcskey) == 0) {
- new = tag_new(ident, tag->key);
- STAILQ_INSERT_HEAD(&keyword->keywords, new, next);
- return (0);
- }
- }
- errno = ENOENT;
- return (-1);
-}
-
-int
-keyword_enable(struct keyword *keyword, const char *ident)
-{
- struct tag *tag;
- int all;
-
- all = 0;
- if (strcmp(ident, ".") == 0)
- all = 1;
-
- STAILQ_FOREACH(tag, &keyword->keywords, next) {
- if (!all && strcmp(tag->ident, ident) != 0)
- continue;
- tag->enabled = 1;
- if (!all)
- return (0);
- }
- if (!all) {
- errno = ENOENT;
- return (-1);
- }
- return (0);
-}
-
-int
-keyword_disable(struct keyword *keyword, const char *ident)
-{
- struct tag *tag;
- int all;
-
- all = 0;
- if (strcmp(ident, ".") == 0)
- all = 1;
-
- STAILQ_FOREACH(tag, &keyword->keywords, next) {
- if (!all && strcmp(tag->ident, ident) != 0)
- continue;
- tag->enabled = 0;
- if (!all)
- return (0);
- }
-
- if (!all) {
- errno = ENOENT;
- return (-1);
- }
- return (0);
-}
-
-void
-keyword_prepare(struct keyword *keyword)
-{
- struct tag *tag, *temp;
-
- STAILQ_FOREACH_SAFE(tag, &keyword->keywords, next, temp) {
- if (!tag->enabled) {
- STAILQ_REMOVE(&keyword->keywords, tag, tag, next);
- tag_free(tag);
- continue;
- }
- }
-}
-
-/*
- * Expand appropriate RCS keywords. If there's no tag to expand,
- * keyword_expand() returns 0, otherwise it returns 1 and writes a
- * pointer to the new line in *buf and the new len in *len. The
- * new line is allocated with malloc() and needs to be freed by the
- * caller after use.
- */
-int
-keyword_expand(struct keyword *keyword, struct diffinfo *di, char *line,
- size_t size, char **buf, size_t *len)
-{
- struct tag *tag;
- char *dollar, *keystart, *valstart, *vallim, *next;
- char *linestart, *newline, *newval, *cp, *tmp;
- size_t left, newsize, vallen;
-
- if (di->di_expand == EXPAND_OLD || di->di_expand == EXPAND_BINARY)
- return (0);
- newline = NULL;
- newsize = 0;
- left = size;
- linestart = cp = line;
-again:
- dollar = memchr(cp, '$', left);
- if (dollar == NULL) {
- if (newline != NULL) {
- *buf = newline;
- *len = newsize;
- return (1);
- }
- return (0);
- }
- keystart = dollar + 1;
- left -= keystart - cp;
- vallim = memchr(keystart, '$', left);
- if (vallim == NULL) {
- if (newline != NULL) {
- *buf = newline;
- *len = newsize;
- return (1);
- }
- return (0);
- }
- if (vallim == keystart) {
- cp = keystart;
- goto again;
- }
- valstart = memchr(keystart, ':', left);
- if (valstart == keystart) {
- cp = vallim;
- left -= vallim - keystart;
- goto again;
- }
- if (valstart == NULL || valstart > vallim)
- valstart = vallim;
-
- if (valstart < keystart + keyword->minkeylen ||
- valstart > keystart + keyword->maxkeylen) {
- cp = vallim;
- left -= vallim -keystart;
- goto again;
- }
- STAILQ_FOREACH(tag, &keyword->keywords, next) {
- if (strncmp(tag->ident, keystart, valstart - keystart) == 0 &&
- tag->ident[valstart - keystart] == '\0') {
- if (newline != NULL)
- tmp = newline;
- else
- tmp = NULL;
- newval = NULL;
- if (di->di_expand == EXPAND_KEY) {
- newsize = dollar - linestart + 1 +
- valstart - keystart + 1 +
- size - (vallim + 1 - linestart);
- newline = xmalloc(newsize);
- cp = newline;
- memcpy(cp, linestart, dollar - linestart);
- cp += dollar - linestart;
- *cp++ = '$';
- memcpy(cp, keystart, valstart - keystart);
- cp += valstart - keystart;
- *cp++ = '$';
- next = cp;
- memcpy(cp, vallim + 1,
- size - (vallim + 1 - linestart));
- } else if (di->di_expand == EXPAND_VALUE) {
- newval = tag_expand(tag, di);
- if (newval == NULL)
- vallen = 0;
- else
- vallen = strlen(newval);
- newsize = dollar - linestart +
- vallen +
- size - (vallim + 1 - linestart);
- newline = xmalloc(newsize);
- cp = newline;
- memcpy(cp, linestart, dollar - linestart);
- cp += dollar - linestart;
- if (newval != NULL) {
- memcpy(cp, newval, vallen);
- cp += vallen;
- }
- next = cp;
- memcpy(cp, vallim + 1,
- size - (vallim + 1 - linestart));
- } else {
- assert(di->di_expand == EXPAND_DEFAULT ||
- di->di_expand == EXPAND_KEYVALUE ||
- di->di_expand == EXPAND_KEYVALUELOCKER);
- newval = tag_expand(tag, di);
- if (newval == NULL)
- vallen = 0;
- else
- vallen = strlen(newval);
- newsize = dollar - linestart + 1 +
- valstart - keystart + 2 +
- vallen + 2 +
- size - (vallim + 1 - linestart);
- newline = xmalloc(newsize);
- cp = newline;
- memcpy(cp, linestart, dollar - linestart);
- cp += dollar - linestart;
- *cp++ = '$';
- memcpy(cp, keystart, valstart - keystart);
- cp += valstart - keystart;
- *cp++ = ':';
- *cp++ = ' ';
- if (newval != NULL) {
- memcpy(cp, newval, vallen);
- cp += vallen;
- }
- *cp++ = ' ';
- *cp++ = '$';
- next = cp;
- memcpy(cp, vallim + 1,
- size - (vallim + 1 - linestart));
- }
- if (newval != NULL)
- free(newval);
- if (tmp != NULL)
- free(tmp);
- /*
- * Continue looking for tags in the rest of the line.
- */
- cp = next;
- size = newsize;
- left = size - (cp - newline);
- linestart = newline;
- goto again;
- }
- }
- cp = vallim;
- left = size - (cp - linestart);
- goto again;
-}
-
-static struct tag *
-tag_new(const char *ident, rcskey_t key)
-{
- struct tag *new;
-
- new = xmalloc(sizeof(struct tag));
- new->ident = xstrdup(ident);
- new->key = key;
- new->enabled = 1;
- return (new);
-}
-
-static void
-tag_free(struct tag *tag)
-{
-
- free(tag->ident);
- free(tag);
-}
-
-/*
- * Expand a specific tag and return the new value. If NULL
- * is returned, the tag is empty.
- */
-static char *
-tag_expand(struct tag *tag, struct diffinfo *di)
-{
- /*
- * CVS formats dates as "XXXX/XX/XX XX:XX:XX". 32 bytes
- * is big enough until year 10,000,000,000,000,000 :-).
- */
- char cvsdate[32];
- struct tm tm;
- char *filename, *val;
- int error;
-
- error = rcsdatetotm(di->di_revdate, &tm);
- if (error)
- err(1, "strptime");
- if (strftime(cvsdate, sizeof(cvsdate), "%Y/%m/%d %H:%M:%S", &tm) == 0)
- err(1, "strftime");
- filename = strrchr(di->di_rcsfile, '/');
- if (filename == NULL)
- filename = di->di_rcsfile;
- else
- filename++;
-
- switch (tag->key) {
- case RCSKEY_AUTHOR:
- xasprintf(&val, "%s", di->di_author);
- break;
- case RCSKEY_CVSHEADER:
- xasprintf(&val, "%s %s %s %s %s", di->di_rcsfile,
- di->di_revnum, cvsdate, di->di_author, di->di_state);
- break;
- case RCSKEY_DATE:
- xasprintf(&val, "%s", cvsdate);
- break;
- case RCSKEY_HEADER:
- xasprintf(&val, "%s/%s %s %s %s %s", di->di_cvsroot,
- di->di_rcsfile, di->di_revnum, cvsdate, di->di_author,
- di->di_state);
- break;
- case RCSKEY_ID:
- xasprintf(&val, "%s %s %s %s %s", filename, di->di_revnum,
- cvsdate, di->di_author, di->di_state);
- break;
- case RCSKEY_LOCKER:
- /*
- * Unimplemented even in CVSup sources. It seems we don't
- * even have this information sent by the server.
- */
- return (NULL);
- case RCSKEY_LOG:
- /* XXX */
- printf("%s: Implement Log keyword expansion\n", __func__);
- return (NULL);
- case RCSKEY_NAME:
- if (di->di_tag != NULL)
- xasprintf(&val, "%s", di->di_tag);
- else
- return (NULL);
- break;
- case RCSKEY_RCSFILE:
- xasprintf(&val, "%s", filename);
- break;
- case RCSKEY_REVISION:
- xasprintf(&val, "%s", di->di_revnum);
- break;
- case RCSKEY_SOURCE:
- xasprintf(&val, "%s/%s", di->di_cvsroot, di->di_rcsfile);
- break;
- case RCSKEY_STATE:
- xasprintf(&val, "%s", di->di_state);
- break;
- }
- return (val);
-}
diff --git a/usr.bin/csup/keyword.h b/usr.bin/csup/keyword.h
deleted file mode 100644
index 033cb0a..0000000
--- a/usr.bin/csup/keyword.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * Copyright (c) 2003-2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#ifndef _KEYWORD_H_
-#define _KEYWORD_H_
-
-/* CVS expansion modes. */
-#define EXPAND_DEFAULT 0
-#define EXPAND_KEYVALUE 1
-#define EXPAND_KEYVALUELOCKER 2
-#define EXPAND_KEY 3
-#define EXPAND_OLD 4
-#define EXPAND_BINARY 5
-#define EXPAND_VALUE 6
-
-struct diffinfo;
-struct keyword;
-
-struct keyword *keyword_new(void);
-int keyword_decode_expand(const char *);
-const char *keyword_encode_expand(int);
-int keyword_alias(struct keyword *, const char *, const char *);
-int keyword_enable(struct keyword *, const char *);
-int keyword_disable(struct keyword *, const char *);
-void keyword_prepare(struct keyword *);
-int keyword_expand(struct keyword *, struct diffinfo *, char *,
- size_t, char **, size_t *);
-void keyword_free(struct keyword *);
-
-#endif /* !_KEYWORD_H_ */
diff --git a/usr.bin/csup/lex.rcs.c b/usr.bin/csup/lex.rcs.c
deleted file mode 100644
index 5db7a7b..0000000
--- a/usr.bin/csup/lex.rcs.c
+++ /dev/null
@@ -1,2094 +0,0 @@
-
-#line 3 "lex.rcs.c"
-
-#define YY_INT_ALIGNED short int
-
-/* A lexical scanner generated by flex */
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
-#if YY_FLEX_SUBMINOR_VERSION > 0
-#define FLEX_BETA
-#endif
-
-/* First, we deal with platform-specific or compiler-specific issues. */
-
-/* begin standard C headers. */
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-
-/* end standard C headers. */
-
-/* flex integer type definitions */
-
-#ifndef FLEXINT_H
-#define FLEXINT_H
-
-/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
-
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-
-/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types.
- */
-#ifndef __STDC_LIMIT_MACROS
-#define __STDC_LIMIT_MACROS 1
-#endif
-
-#include <inttypes.h>
-typedef int8_t flex_int8_t;
-typedef uint8_t flex_uint8_t;
-typedef int16_t flex_int16_t;
-typedef uint16_t flex_uint16_t;
-typedef int32_t flex_int32_t;
-typedef uint32_t flex_uint32_t;
-#else
-typedef signed char flex_int8_t;
-typedef short int flex_int16_t;
-typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
-typedef unsigned short int flex_uint16_t;
-typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
-
-/* Limits of integral types. */
-#ifndef INT8_MIN
-#define INT8_MIN (-128)
-#endif
-#ifndef INT16_MIN
-#define INT16_MIN (-32767-1)
-#endif
-#ifndef INT32_MIN
-#define INT32_MIN (-2147483647-1)
-#endif
-#ifndef INT8_MAX
-#define INT8_MAX (127)
-#endif
-#ifndef INT16_MAX
-#define INT16_MAX (32767)
-#endif
-#ifndef INT32_MAX
-#define INT32_MAX (2147483647)
-#endif
-#ifndef UINT8_MAX
-#define UINT8_MAX (255U)
-#endif
-#ifndef UINT16_MAX
-#define UINT16_MAX (65535U)
-#endif
-#ifndef UINT32_MAX
-#define UINT32_MAX (4294967295U)
-#endif
-
-#endif /* ! FLEXINT_H */
-
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else /* ! __cplusplus */
-
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
-
-#define YY_USE_CONST
-
-#endif /* defined (__STDC__) */
-#endif /* ! __cplusplus */
-
-#ifdef YY_USE_CONST
-#define yyconst const
-#else
-#define yyconst
-#endif
-
-/* Returned upon end-of-file. */
-#define YY_NULL 0
-
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index. If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
- */
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-
-/* An opaque pointer. */
-#ifndef YY_TYPEDEF_YY_SCANNER_T
-#define YY_TYPEDEF_YY_SCANNER_T
-typedef void* yyscan_t;
-#endif
-
-/* For convenience, these vars (plus the bison vars far below)
- are macros in the reentrant scanner. */
-#define yyin yyg->yyin_r
-#define yyout yyg->yyout_r
-#define yyextra yyg->yyextra_r
-#define yyleng yyg->yyleng_r
-#define yytext yyg->yytext_r
-#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
-#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
-#define yy_flex_debug yyg->yy_flex_debug_r
-
-/* Enter a start condition. This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN.
- */
-#define BEGIN yyg->yy_start = 1 + 2 *
-
-/* Translate the current start state into a value that can be later handed
- * to BEGIN to return to the state. The YYSTATE alias is for lex
- * compatibility.
- */
-#define YY_START ((yyg->yy_start - 1) / 2)
-#define YYSTATE YY_START
-
-/* Action number for EOF rule of a given start state. */
-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
-/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE rcsrestart(yyin ,yyscanner )
-
-#define YY_END_OF_BUFFER_CHAR 0
-
-/* Size of default input buffer. */
-#ifndef YY_BUF_SIZE
-#define YY_BUF_SIZE 16384
-#endif
-
-/* The state buf must be large enough to hold one state per character in the main buffer.
- */
-#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
-
-#ifndef YY_TYPEDEF_YY_BUFFER_STATE
-#define YY_TYPEDEF_YY_BUFFER_STATE
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-#endif
-
-#define EOB_ACT_CONTINUE_SCAN 0
-#define EOB_ACT_END_OF_FILE 1
-#define EOB_ACT_LAST_MATCH 2
-
- #define YY_LESS_LINENO(n)
-
-/* Return all but the first "n" matched characters back to the input stream. */
-#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up yytext. */ \
- int yyless_macro_arg = (n); \
- YY_LESS_LINENO(yyless_macro_arg);\
- *yy_cp = yyg->yy_hold_char; \
- YY_RESTORE_YY_MORE_OFFSET \
- yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
- YY_DO_BEFORE_ACTION; /* set up yytext again */ \
- } \
- while ( 0 )
-
-#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
-
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
-#ifndef YY_STRUCT_YY_BUFFER_STATE
-#define YY_STRUCT_YY_BUFFER_STATE
-struct yy_buffer_state
- {
- FILE *yy_input_file;
-
- char *yy_ch_buf; /* input buffer */
- char *yy_buf_pos; /* current position in input buffer */
-
- /* Size of input buffer in bytes, not including room for EOB
- * characters.
- */
- yy_size_t yy_buf_size;
-
- /* Number of characters read into yy_ch_buf, not including EOB
- * characters.
- */
- int yy_n_chars;
-
- /* Whether we "own" the buffer - i.e., we know we created it,
- * and can realloc() it to grow it, and should free() it to
- * delete it.
- */
- int yy_is_our_buffer;
-
- /* Whether this is an "interactive" input source; if so, and
- * if we're using stdio for input, then we want to use getc()
- * instead of fread(), to make sure we stop fetching input after
- * each newline.
- */
- int yy_is_interactive;
-
- /* Whether we're considered to be at the beginning of a line.
- * If so, '^' rules will be active on the next match, otherwise
- * not.
- */
- int yy_at_bol;
-
- int yy_bs_lineno; /**< The line count. */
- int yy_bs_column; /**< The column count. */
-
- /* Whether to try to fill the input buffer when we reach the
- * end of it.
- */
- int yy_fill_buffer;
-
- int yy_buffer_status;
-
-#define YY_BUFFER_NEW 0
-#define YY_BUFFER_NORMAL 1
- /* When an EOF's been seen but there's still some text to process
- * then we mark the buffer as YY_EOF_PENDING, to indicate that we
- * shouldn't try reading from the input source any more. We might
- * still have a bunch of tokens to match, though, because of
- * possible backing-up.
- *
- * When we actually see the EOF, we change the status to "new"
- * (via rcsrestart()), so that the user can continue scanning by
- * just pointing yyin at a new input file.
- */
-#define YY_BUFFER_EOF_PENDING 2
-
- };
-#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-
-/* We provide macros for accessing buffer states in case in the
- * future we want to put the buffer states in a more general
- * "scanner state".
- *
- * Returns the top of the stack, or NULL.
- */
-#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
- ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
- : NULL)
-
-/* Same as previous macro, but useful when we know that the buffer stack is not
- * NULL or when we need an lvalue. For internal use only.
- */
-#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
-
-void rcsrestart (FILE *input_file ,yyscan_t yyscanner );
-void rcs_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-YY_BUFFER_STATE rcs_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
-void rcs_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void rcs_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void rcspush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-void rcspop_buffer_state (yyscan_t yyscanner );
-
-static void rcsensure_buffer_stack (yyscan_t yyscanner );
-static void rcs_load_buffer_state (yyscan_t yyscanner );
-static void rcs_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
-
-#define YY_FLUSH_BUFFER rcs_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
-
-YY_BUFFER_STATE rcs_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
-YY_BUFFER_STATE rcs_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE rcs_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
-
-void *rcsalloc (yy_size_t ,yyscan_t yyscanner );
-void *rcsrealloc (void *,yy_size_t ,yyscan_t yyscanner );
-void rcsfree (void * ,yyscan_t yyscanner );
-
-#define yy_new_buffer rcs_create_buffer
-
-#define yy_set_interactive(is_interactive) \
- { \
- if ( ! YY_CURRENT_BUFFER ){ \
- rcsensure_buffer_stack (yyscanner); \
- YY_CURRENT_BUFFER_LVALUE = \
- rcs_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
- } \
- YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
- }
-
-#define yy_set_bol(at_bol) \
- { \
- if ( ! YY_CURRENT_BUFFER ){\
- rcsensure_buffer_stack (yyscanner); \
- YY_CURRENT_BUFFER_LVALUE = \
- rcs_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
- } \
- YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
- }
-
-#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
-
-/* Begin user sect3 */
-
-#define rcswrap(n) 1
-#define YY_SKIP_YYWRAP
-
-typedef unsigned char YY_CHAR;
-
-typedef int yy_state_type;
-
-#define yytext_ptr yytext_r
-
-static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
-static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
-static int yy_get_next_buffer (yyscan_t yyscanner );
-static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
-
-/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
- */
-#define YY_DO_BEFORE_ACTION \
- yyg->yytext_ptr = yy_bp; \
- yyleng = (size_t) (yy_cp - yy_bp); \
- yyg->yy_hold_char = *yy_cp; \
- *yy_cp = '\0'; \
- yyg->yy_c_buf_p = yy_cp;
-
-#define YY_NUM_RULES 10
-#define YY_END_OF_BUFFER 11
-/* This struct is not used in this scanner,
- but its presence is necessary. */
-struct yy_trans_info
- {
- flex_int32_t yy_verify;
- flex_int32_t yy_nxt;
- };
-static yyconst flex_int16_t yy_accept[89] =
- { 0,
- 0, 0, 11, 5, 9, 8, 10, 4, 4, 7,
- 6, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 9, 5, 4, 4, 5,
- 4, 4, 5, 0, 0, 5, 5, 3, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 3, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 2, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 1, 5, 5, 5, 0
- } ;
-
-static yyconst flex_int32_t yy_ec[256] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 2, 1, 1, 1, 4, 1, 1, 1, 1,
- 1, 1, 1, 4, 1, 5, 1, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 7, 8, 1,
- 1, 1, 1, 9, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 10, 11, 12, 13,
-
- 14, 1, 15, 16, 17, 1, 18, 19, 20, 21,
- 22, 23, 1, 24, 25, 26, 27, 1, 1, 28,
- 29, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1
- } ;
-
-static yyconst flex_int32_t yy_meta[30] =
- { 0,
- 1, 2, 2, 2, 1, 1, 2, 2, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1
- } ;
-
-static yyconst flex_int16_t yy_base[94] =
- { 0,
- 0, 0, 136, 25, 127, 297, 297, 27, 29, 297,
- 297, 34, 39, 41, 47, 44, 50, 54, 57, 66,
- 68, 70, 76, 80, 82, 91, 84, 86, 90, 93,
- 95, 97, 102, 58, 61, 0, 0, 107, 109, 112,
- 114, 117, 120, 122, 125, 129, 137, 127, 135, 145,
- 148, 74, 152, 155, 157, 162, 167, 174, 164, 178,
- 182, 184, 187, 189, 191, 193, 196, 200, 204, 206,
- 214, 211, 218, 224, 228, 230, 236, 239, 241, 243,
- 245, 248, 250, 254, 260, 265, 267, 297, 76, 56,
- 47, 292, 294
-
- } ;
-
-static yyconst flex_int16_t yy_def[94] =
- { 0,
- 88, 1, 88, 89, 88, 88, 88, 90, 91, 88,
- 88, 92, 89, 89, 89, 89, 89, 89, 89, 89,
- 89, 89, 89, 89, 89, 88, 89, 90, 91, 89,
- 91, 91, 92, 93, 93, 33, 33, 89, 89, 89,
- 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
- 89, 88, 89, 89, 89, 89, 89, 89, 89, 89,
- 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
- 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
- 89, 89, 89, 89, 89, 89, 89, 0, 88, 88,
- 88, 88, 88
-
- } ;
-
-static yyconst flex_int16_t yy_nxt[327] =
- { 0,
- 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
- 14, 15, 16, 17, 4, 18, 4, 4, 19, 4,
- 20, 4, 4, 4, 21, 22, 4, 4, 4, 24,
- 25, 28, 29, 31, 32, 34, 35, 34, 36, 37,
- 34, 34, 38, 24, 25, 24, 25, 30, 24, 25,
- 39, 24, 25, 43, 24, 25, 27, 44, 24, 25,
- 35, 24, 25, 35, 41, 40, 52, 46, 42, 52,
- 24, 25, 24, 25, 24, 25, 23, 45, 47, 48,
- 24, 25, 34, 51, 24, 25, 24, 25, 24, 25,
- 28, 29, 26, 49, 31, 32, 50, 24, 25, 31,
-
- 32, 31, 32, 34, 35, 34, 36, 37, 34, 34,
- 38, 24, 25, 24, 25, 33, 24, 25, 24, 25,
- 53, 24, 25, 55, 24, 25, 24, 25, 26, 24,
- 25, 24, 25, 24, 25, 88, 56, 54, 60, 24,
- 25, 24, 25, 88, 64, 57, 58, 59, 61, 24,
- 25, 62, 24, 25, 63, 88, 24, 25, 65, 24,
- 25, 24, 25, 88, 66, 68, 24, 25, 24, 25,
- 69, 24, 25, 72, 88, 67, 88, 70, 24, 25,
- 62, 71, 24, 25, 88, 62, 24, 25, 24, 25,
- 62, 24, 25, 24, 25, 24, 25, 24, 25, 73,
-
- 24, 25, 88, 76, 24, 25, 88, 75, 24, 25,
- 24, 25, 62, 88, 74, 24, 25, 79, 24, 25,
- 88, 62, 24, 25, 77, 78, 88, 80, 24, 25,
- 88, 81, 24, 25, 24, 25, 88, 62, 88, 82,
- 24, 25, 62, 24, 25, 24, 25, 24, 25, 24,
- 25, 83, 24, 25, 24, 25, 84, 62, 24, 25,
- 62, 88, 62, 85, 24, 25, 88, 87, 86, 24,
- 25, 24, 25, 62, 88, 88, 88, 88, 88, 88,
- 88, 88, 88, 88, 88, 62, 88, 88, 88, 62,
- 88, 62, 33, 33, 34, 34, 3, 88, 88, 88,
-
- 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
- 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
- 88, 88, 88, 88, 88, 88
- } ;
-
-static yyconst flex_int16_t yy_chk[327] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 4,
- 4, 8, 8, 9, 9, 12, 12, 12, 12, 12,
- 12, 12, 12, 13, 13, 14, 14, 91, 16, 16,
- 13, 15, 15, 16, 17, 17, 90, 16, 18, 18,
- 34, 19, 19, 35, 14, 13, 34, 18, 15, 35,
- 20, 20, 21, 21, 22, 22, 89, 17, 19, 20,
- 23, 23, 52, 22, 24, 24, 25, 25, 27, 27,
- 28, 28, 26, 21, 29, 29, 21, 30, 30, 31,
-
- 31, 32, 32, 33, 33, 33, 33, 33, 33, 33,
- 33, 38, 38, 39, 39, 38, 40, 40, 41, 41,
- 39, 42, 42, 41, 43, 43, 44, 44, 5, 45,
- 45, 48, 48, 46, 46, 3, 42, 40, 46, 49,
- 49, 47, 47, 0, 49, 43, 44, 45, 47, 50,
- 50, 47, 51, 51, 48, 0, 53, 53, 49, 54,
- 54, 55, 55, 0, 50, 53, 56, 56, 59, 59,
- 54, 57, 57, 59, 0, 51, 0, 55, 58, 58,
- 57, 56, 60, 60, 0, 58, 61, 61, 62, 62,
- 60, 63, 63, 64, 64, 65, 65, 66, 66, 61,
-
- 67, 67, 0, 66, 68, 68, 0, 65, 69, 69,
- 70, 70, 63, 0, 64, 72, 72, 70, 71, 71,
- 0, 67, 73, 73, 68, 69, 0, 71, 74, 74,
- 0, 72, 75, 75, 76, 76, 0, 74, 0, 75,
- 77, 77, 73, 78, 78, 79, 79, 80, 80, 81,
- 81, 76, 82, 82, 83, 83, 79, 81, 84, 84,
- 77, 0, 78, 80, 85, 85, 0, 84, 83, 86,
- 86, 87, 87, 82, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 85, 0, 0, 0, 86,
- 0, 87, 92, 92, 93, 93, 88, 88, 88, 88,
-
- 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
- 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
- 88, 88, 88, 88, 88, 88
- } ;
-
-/* The intent behind this definition is that it'll catch
- * any uses of REJECT which flex missed.
- */
-#define REJECT reject_used_but_not_detected
-#define yymore() yymore_used_but_not_detected
-#define YY_MORE_ADJ 0
-#define YY_RESTORE_YY_MORE_OFFSET
-#line 1 "rcstokenizer.l"
-/*-
- * Copyright (c) 2007-2008, Ulf Lilleengen <lulf@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- *
- */
-/*
- * This tokenizer must be generated by a lexxer with support for reentrancy.
- */
-#line 34 "rcstokenizer.l"
-#include <string.h>
-#include "misc.h"
-#include "rcsparse.h"
-
-#line 567 "lex.rcs.c"
-
-#define INITIAL 0
-
-#ifndef YY_NO_UNISTD_H
-/* Special case for "unistd.h", since it is non-ANSI. We include it way
- * down here because we want the user's section 1 to have been scanned first.
- * The user has a chance to override it with an option.
- */
-#include <unistd.h>
-#endif
-
-#ifndef YY_EXTRA_TYPE
-#define YY_EXTRA_TYPE void *
-#endif
-
-/* Holds the entire state of the reentrant scanner. */
-struct yyguts_t
- {
-
- /* User-defined. Not touched by flex. */
- YY_EXTRA_TYPE yyextra_r;
-
- /* The rest are the same as the globals declared in the non-reentrant scanner. */
- FILE *yyin_r, *yyout_r;
- size_t yy_buffer_stack_top; /**< index of top of stack. */
- size_t yy_buffer_stack_max; /**< capacity of stack. */
- YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
- char yy_hold_char;
- int yy_n_chars;
- int yyleng_r;
- char *yy_c_buf_p;
- int yy_init;
- int yy_start;
- int yy_did_buffer_switch_on_eof;
- int yy_start_stack_ptr;
- int yy_start_stack_depth;
- int *yy_start_stack;
- yy_state_type yy_last_accepting_state;
- char* yy_last_accepting_cpos;
-
- int yylineno_r;
- int yy_flex_debug_r;
-
- char *yytext_r;
- int yy_more_flag;
- int yy_more_len;
-
- }; /* end struct yyguts_t */
-
-static int yy_init_globals (yyscan_t yyscanner );
-
-int rcslex_init (yyscan_t* scanner);
-
-int rcslex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
-
-/* Accessor methods to globals.
- These are made visible to non-reentrant scanners for convenience. */
-
-int rcslex_destroy (yyscan_t yyscanner );
-
-int rcsget_debug (yyscan_t yyscanner );
-
-void rcsset_debug (int debug_flag ,yyscan_t yyscanner );
-
-YY_EXTRA_TYPE rcsget_extra (yyscan_t yyscanner );
-
-void rcsset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
-
-FILE *rcsget_in (yyscan_t yyscanner );
-
-void rcsset_in (FILE * in_str ,yyscan_t yyscanner );
-
-FILE *rcsget_out (yyscan_t yyscanner );
-
-void rcsset_out (FILE * out_str ,yyscan_t yyscanner );
-
-int rcsget_leng (yyscan_t yyscanner );
-
-char *rcsget_text (yyscan_t yyscanner );
-
-int rcsget_lineno (yyscan_t yyscanner );
-
-void rcsset_lineno (int line_number ,yyscan_t yyscanner );
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#ifdef __cplusplus
-extern "C" int rcswrap (yyscan_t yyscanner );
-#else
-extern int rcswrap (yyscan_t yyscanner );
-#endif
-#endif
-
- static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner);
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
-#endif
-
-#ifndef YY_NO_INPUT
-
-#ifdef __cplusplus
-static int yyinput (yyscan_t yyscanner );
-#else
-static int input (yyscan_t yyscanner );
-#endif
-
-#endif
-
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#define YY_READ_BUF_SIZE 8192
-#endif
-
-/* Copy whatever the last rule matched to the standard output. */
-#ifndef ECHO
-/* This used to be an fputs(), but since the string might contain NUL's,
- * we now use fwrite().
- */
-#define ECHO fwrite( yytext, yyleng, 1, yyout )
-#endif
-
-/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
- * is returned in "result".
- */
-#ifndef YY_INPUT
-#define YY_INPUT(buf,result,max_size) \
- if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
- { \
- int c = '*'; \
- int n; \
- for ( n = 0; n < max_size && \
- (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
- buf[n] = (char) c; \
- if ( c == '\n' ) \
- buf[n++] = (char) c; \
- if ( c == EOF && ferror( yyin ) ) \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- result = n; \
- } \
- else \
- { \
- errno=0; \
- while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
- { \
- if( errno != EINTR) \
- { \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- break; \
- } \
- errno=0; \
- clearerr(yyin); \
- } \
- }\
-\
-
-#endif
-
-/* No semi-colon after return; correct usage is to write "yyterminate();" -
- * we don't want an extra ';' after the "return" because that will cause
- * some compilers to complain about unreachable statements.
- */
-#ifndef yyterminate
-#define yyterminate() return YY_NULL
-#endif
-
-/* Number of entries by which start-condition stack grows. */
-#ifndef YY_START_STACK_INCR
-#define YY_START_STACK_INCR 25
-#endif
-
-/* Report a fatal error. */
-#ifndef YY_FATAL_ERROR
-#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
-#endif
-
-/* end tables serialization structures and prototypes */
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#define YY_DECL_IS_OURS 1
-
-extern int rcslex (yyscan_t yyscanner);
-
-#define YY_DECL int rcslex (yyscan_t yyscanner)
-#endif /* !YY_DECL */
-
-/* Code executed at the beginning of each rule, after yytext and yyleng
- * have been set up.
- */
-#ifndef YY_USER_ACTION
-#define YY_USER_ACTION
-#endif
-
-/* Code executed at the end of each rule. */
-#ifndef YY_BREAK
-#define YY_BREAK break;
-#endif
-
-#define YY_RULE_SETUP \
- YY_USER_ACTION
-
-/** The main scanner function which does all the work.
- */
-YY_DECL
-{
- register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
- register int yy_act;
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
-#line 51 "rcstokenizer.l"
-
-
-#line 791 "lex.rcs.c"
-
- if ( !yyg->yy_init )
- {
- yyg->yy_init = 1;
-
-#ifdef YY_USER_INIT
- YY_USER_INIT;
-#endif
-
- if ( ! yyg->yy_start )
- yyg->yy_start = 1; /* first start state */
-
- if ( ! yyin )
- yyin = stdin;
-
- if ( ! yyout )
- yyout = stdout;
-
- if ( ! YY_CURRENT_BUFFER ) {
- rcsensure_buffer_stack (yyscanner);
- YY_CURRENT_BUFFER_LVALUE =
- rcs_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
- }
-
- rcs_load_buffer_state(yyscanner );
- }
-
- while ( 1 ) /* loops until end-of-file is reached */
- {
- yy_cp = yyg->yy_c_buf_p;
-
- /* Support of yytext. */
- *yy_cp = yyg->yy_hold_char;
-
- /* yy_bp points to the position in yy_ch_buf of the start of
- * the current run.
- */
- yy_bp = yy_cp;
-
- yy_current_state = yyg->yy_start;
-yy_match:
- do
- {
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
- if ( yy_accept[yy_current_state] )
- {
- yyg->yy_last_accepting_state = yy_current_state;
- yyg->yy_last_accepting_cpos = yy_cp;
- }
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 89 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- ++yy_cp;
- }
- while ( yy_base[yy_current_state] != 297 );
-
-yy_find_action:
- yy_act = yy_accept[yy_current_state];
- if ( yy_act == 0 )
- { /* have to back up */
- yy_cp = yyg->yy_last_accepting_cpos;
- yy_current_state = yyg->yy_last_accepting_state;
- yy_act = yy_accept[yy_current_state];
- }
-
- YY_DO_BEFORE_ACTION;
-
-do_action: /* This label is used only to access EOF actions. */
-
- switch ( yy_act )
- { /* beginning of action switch */
- case 0: /* must back up */
- /* undo the effects of YY_DO_BEFORE_ACTION */
- *yy_cp = yyg->yy_hold_char;
- yy_cp = yyg->yy_last_accepting_cpos;
- yy_current_state = yyg->yy_last_accepting_state;
- goto yy_find_action;
-
-case 1:
-YY_RULE_SETUP
-#line 53 "rcstokenizer.l"
-{
- return (KEYWORD_TWO);
-}
- YY_BREAK
-case 2:
-YY_RULE_SETUP
-#line 56 "rcstokenizer.l"
-{
- return (KEYWORD);
-}
- YY_BREAK
-case 3:
-/* rule 3 can match eol */
-YY_RULE_SETUP
-#line 59 "rcstokenizer.l"
-{
- return (STRING);
-}
- YY_BREAK
-case 4:
-YY_RULE_SETUP
-#line 62 "rcstokenizer.l"
-{
- return (NUM);
-}
- YY_BREAK
-case 5:
-YY_RULE_SETUP
-#line 65 "rcstokenizer.l"
-{
-/* This will use ID as both ID and SYM. Do extra checking elsewhere.*/
- return (ID);
-}
- YY_BREAK
-case 6:
-YY_RULE_SETUP
-#line 69 "rcstokenizer.l"
-{ return (SEMIC); }
- YY_BREAK
-case 7:
-YY_RULE_SETUP
-#line 70 "rcstokenizer.l"
-{ return (COLON); }
- YY_BREAK
-case 8:
-/* rule 8 can match eol */
-YY_RULE_SETUP
-#line 71 "rcstokenizer.l"
-;
- YY_BREAK
-case 9:
-YY_RULE_SETUP
-#line 72 "rcstokenizer.l"
-;
- YY_BREAK
-case 10:
-YY_RULE_SETUP
-#line 73 "rcstokenizer.l"
-ECHO;
- YY_BREAK
-#line 937 "lex.rcs.c"
-case YY_STATE_EOF(INITIAL):
- yyterminate();
-
- case YY_END_OF_BUFFER:
- {
- /* Amount of text matched not including the EOB char. */
- int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
-
- /* Undo the effects of YY_DO_BEFORE_ACTION. */
- *yy_cp = yyg->yy_hold_char;
- YY_RESTORE_YY_MORE_OFFSET
-
- if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
- {
- /* We're scanning a new file or input source. It's
- * possible that this happened because the user
- * just pointed yyin at a new source and called
- * rcslex(). If so, then we have to assure
- * consistency between YY_CURRENT_BUFFER and our
- * globals. Here is the right place to do so, because
- * this is the first action (other than possibly a
- * back-up) that will match for the new input source.
- */
- yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
- YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
- YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
- }
-
- /* Note that here we test for yy_c_buf_p "<=" to the position
- * of the first EOB in the buffer, since yy_c_buf_p will
- * already have been incremented past the NUL character
- * (since all states make transitions on EOB to the
- * end-of-buffer state). Contrast this with the test
- * in input().
- */
- if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
- { /* This was really a NUL. */
- yy_state_type yy_next_state;
-
- yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state( yyscanner );
-
- /* Okay, we're now positioned to make the NUL
- * transition. We couldn't have
- * yy_get_previous_state() go ahead and do it
- * for us because it doesn't know how to deal
- * with the possibility of jamming (and we don't
- * want to build jamming into it because then it
- * will run more slowly).
- */
-
- yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
-
- yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-
- if ( yy_next_state )
- {
- /* Consume the NUL. */
- yy_cp = ++yyg->yy_c_buf_p;
- yy_current_state = yy_next_state;
- goto yy_match;
- }
-
- else
- {
- yy_cp = yyg->yy_c_buf_p;
- goto yy_find_action;
- }
- }
-
- else switch ( yy_get_next_buffer( yyscanner ) )
- {
- case EOB_ACT_END_OF_FILE:
- {
- yyg->yy_did_buffer_switch_on_eof = 0;
-
- if ( rcswrap(yyscanner ) )
- {
- /* Note: because we've taken care in
- * yy_get_next_buffer() to have set up
- * yytext, we can now set up
- * yy_c_buf_p so that if some total
- * hoser (like flex itself) wants to
- * call the scanner after we return the
- * YY_NULL, it'll still work - another
- * YY_NULL will get returned.
- */
- yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
-
- yy_act = YY_STATE_EOF(YY_START);
- goto do_action;
- }
-
- else
- {
- if ( ! yyg->yy_did_buffer_switch_on_eof )
- YY_NEW_FILE;
- }
- break;
- }
-
- case EOB_ACT_CONTINUE_SCAN:
- yyg->yy_c_buf_p =
- yyg->yytext_ptr + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state( yyscanner );
-
- yy_cp = yyg->yy_c_buf_p;
- yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
- goto yy_match;
-
- case EOB_ACT_LAST_MATCH:
- yyg->yy_c_buf_p =
- &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
-
- yy_current_state = yy_get_previous_state( yyscanner );
-
- yy_cp = yyg->yy_c_buf_p;
- yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
- goto yy_find_action;
- }
- break;
- }
-
- default:
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--no action found" );
- } /* end of action switch */
- } /* end of scanning one token */
-} /* end of rcslex */
-
-/* yy_get_next_buffer - try to read in a new buffer
- *
- * Returns a code representing an action:
- * EOB_ACT_LAST_MATCH -
- * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- * EOB_ACT_END_OF_FILE - end of file
- */
-static int yy_get_next_buffer (yyscan_t yyscanner)
-{
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
- register char *source = yyg->yytext_ptr;
- register int number_to_move, i;
- int ret_val;
-
- if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--end of buffer missed" );
-
- if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
- { /* Don't try to fill the buffer, so this is an EOF. */
- if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
- {
- /* We matched a single character, the EOB, so
- * treat this as a final EOF.
- */
- return EOB_ACT_END_OF_FILE;
- }
-
- else
- {
- /* We matched some text prior to the EOB, first
- * process it.
- */
- return EOB_ACT_LAST_MATCH;
- }
- }
-
- /* Try to read more data. */
-
- /* First move last chars to start of buffer. */
- number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
-
- for ( i = 0; i < number_to_move; ++i )
- *(dest++) = *(source++);
-
- if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
- /* don't do the read, it's not guaranteed to return an EOF,
- * just force an EOF
- */
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
-
- else
- {
- int num_to_read =
- YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-
- while ( num_to_read <= 0 )
- { /* Not enough room in the buffer - grow it. */
-
- /* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
-
- int yy_c_buf_p_offset =
- (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
-
- if ( b->yy_is_our_buffer )
- {
- int new_size = b->yy_buf_size * 2;
-
- if ( new_size <= 0 )
- b->yy_buf_size += b->yy_buf_size / 8;
- else
- b->yy_buf_size *= 2;
-
- b->yy_ch_buf = (char *)
- /* Include room in for 2 EOB chars. */
- rcsrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
- }
- else
- /* Can't grow it, we don't own it. */
- b->yy_ch_buf = 0;
-
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR(
- "fatal error - scanner input buffer overflow" );
-
- yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
-
- num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
- number_to_move - 1;
-
- }
-
- if ( num_to_read > YY_READ_BUF_SIZE )
- num_to_read = YY_READ_BUF_SIZE;
-
- /* Read in more data. */
- YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
- yyg->yy_n_chars, (size_t) num_to_read );
-
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
- }
-
- if ( yyg->yy_n_chars == 0 )
- {
- if ( number_to_move == YY_MORE_ADJ )
- {
- ret_val = EOB_ACT_END_OF_FILE;
- rcsrestart(yyin ,yyscanner);
- }
-
- else
- {
- ret_val = EOB_ACT_LAST_MATCH;
- YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
- YY_BUFFER_EOF_PENDING;
- }
- }
-
- else
- ret_val = EOB_ACT_CONTINUE_SCAN;
-
- if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
- /* Extend the array by 50%, plus the number we really need. */
- yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) rcsrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
- if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
- }
-
- yyg->yy_n_chars += number_to_move;
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
-
- yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
-
- return ret_val;
-}
-
-/* yy_get_previous_state - get the state just before the EOB char was reached */
-
- static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
-{
- register yy_state_type yy_current_state;
- register char *yy_cp;
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
- yy_current_state = yyg->yy_start;
-
- for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
- {
- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
- if ( yy_accept[yy_current_state] )
- {
- yyg->yy_last_accepting_state = yy_current_state;
- yyg->yy_last_accepting_cpos = yy_cp;
- }
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 89 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- }
-
- return yy_current_state;
-}
-
-/* yy_try_NUL_trans - try to make a transition on the NUL character
- *
- * synopsis
- * next_state = yy_try_NUL_trans( current_state );
- */
- static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
-{
- register int yy_is_jam;
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
- register char *yy_cp = yyg->yy_c_buf_p;
-
- register YY_CHAR yy_c = 1;
- if ( yy_accept[yy_current_state] )
- {
- yyg->yy_last_accepting_state = yy_current_state;
- yyg->yy_last_accepting_cpos = yy_cp;
- }
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 89 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 88);
-
- return yy_is_jam ? 0 : yy_current_state;
-}
-
- static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner)
-{
- register char *yy_cp;
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
- yy_cp = yyg->yy_c_buf_p;
-
- /* undo effects of setting up yytext */
- *yy_cp = yyg->yy_hold_char;
-
- if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
- { /* need to shift things up to make room */
- /* +2 for EOB chars. */
- register int number_to_move = yyg->yy_n_chars + 2;
- register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
- YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
- register char *source =
- &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
-
- while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
- *--dest = *--source;
-
- yy_cp += (int) (dest - source);
- yy_bp += (int) (dest - source);
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
- yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
-
- if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
- YY_FATAL_ERROR( "flex scanner push-back overflow" );
- }
-
- *--yy_cp = (char) c;
-
- yyg->yytext_ptr = yy_bp;
- yyg->yy_hold_char = *yy_cp;
- yyg->yy_c_buf_p = yy_cp;
-}
-
-#ifndef YY_NO_INPUT
-#ifdef __cplusplus
- static int yyinput (yyscan_t yyscanner)
-#else
- static int input (yyscan_t yyscanner)
-#endif
-
-{
- int c;
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
- *yyg->yy_c_buf_p = yyg->yy_hold_char;
-
- if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
- {
- /* yy_c_buf_p now points to the character we want to return.
- * If this occurs *before* the EOB characters, then it's a
- * valid NUL; if not, then we've hit the end of the buffer.
- */
- if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
- /* This was really a NUL. */
- *yyg->yy_c_buf_p = '\0';
-
- else
- { /* need more input */
- int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
- ++yyg->yy_c_buf_p;
-
- switch ( yy_get_next_buffer( yyscanner ) )
- {
- case EOB_ACT_LAST_MATCH:
- /* This happens because yy_g_n_b()
- * sees that we've accumulated a
- * token and flags that we need to
- * try matching the token before
- * proceeding. But for input(),
- * there's no matching to consider.
- * So convert the EOB_ACT_LAST_MATCH
- * to EOB_ACT_END_OF_FILE.
- */
-
- /* Reset buffer status. */
- rcsrestart(yyin ,yyscanner);
-
- /*FALLTHROUGH*/
-
- case EOB_ACT_END_OF_FILE:
- {
- if ( rcswrap(yyscanner ) )
- return EOF;
-
- if ( ! yyg->yy_did_buffer_switch_on_eof )
- YY_NEW_FILE;
-#ifdef __cplusplus
- return yyinput(yyscanner);
-#else
- return input(yyscanner);
-#endif
- }
-
- case EOB_ACT_CONTINUE_SCAN:
- yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
- break;
- }
- }
- }
-
- c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
- *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
- yyg->yy_hold_char = *++yyg->yy_c_buf_p;
-
- return c;
-}
-#endif /* ifndef YY_NO_INPUT */
-
-/** Immediately switch to a different input stream.
- * @param input_file A readable stream.
- * @param yyscanner The scanner object.
- * @note This function does not reset the start condition to @c INITIAL .
- */
- void rcsrestart (FILE * input_file , yyscan_t yyscanner)
-{
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
- if ( ! YY_CURRENT_BUFFER ){
- rcsensure_buffer_stack (yyscanner);
- YY_CURRENT_BUFFER_LVALUE =
- rcs_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
- }
-
- rcs_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
- rcs_load_buffer_state(yyscanner );
-}
-
-/** Switch to a different input buffer.
- * @param new_buffer The new input buffer.
- * @param yyscanner The scanner object.
- */
- void rcs_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
-{
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
- /* TODO. We should be able to replace this entire function body
- * with
- * rcspop_buffer_state();
- * rcspush_buffer_state(new_buffer);
- */
- rcsensure_buffer_stack (yyscanner);
- if ( YY_CURRENT_BUFFER == new_buffer )
- return;
-
- if ( YY_CURRENT_BUFFER )
- {
- /* Flush out information for old buffer. */
- *yyg->yy_c_buf_p = yyg->yy_hold_char;
- YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
- }
-
- YY_CURRENT_BUFFER_LVALUE = new_buffer;
- rcs_load_buffer_state(yyscanner );
-
- /* We don't actually know whether we did this switch during
- * EOF (rcswrap()) processing, but the only time this flag
- * is looked at is after rcswrap() is called, so it's safe
- * to go ahead and always set it.
- */
- yyg->yy_did_buffer_switch_on_eof = 1;
-}
-
-static void rcs_load_buffer_state (yyscan_t yyscanner)
-{
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
- yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
- yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
- yyg->yy_hold_char = *yyg->yy_c_buf_p;
-}
-
-/** Allocate and initialize an input buffer state.
- * @param file A readable stream.
- * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- * @param yyscanner The scanner object.
- * @return the allocated buffer state.
- */
- YY_BUFFER_STATE rcs_create_buffer (FILE * file, int size , yyscan_t yyscanner)
-{
- YY_BUFFER_STATE b;
-
- b = (YY_BUFFER_STATE) rcsalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in rcs_create_buffer()" );
-
- b->yy_buf_size = size;
-
- /* yy_ch_buf has to be 2 characters longer than the size given because
- * we need to put in 2 end-of-buffer characters.
- */
- b->yy_ch_buf = (char *) rcsalloc(b->yy_buf_size + 2 ,yyscanner );
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in rcs_create_buffer()" );
-
- b->yy_is_our_buffer = 1;
-
- rcs_init_buffer(b,file ,yyscanner);
-
- return b;
-}
-
-/** Destroy the buffer.
- * @param b a buffer created with rcs_create_buffer()
- * @param yyscanner The scanner object.
- */
- void rcs_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
-{
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
- if ( ! b )
- return;
-
- if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
- YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
-
- if ( b->yy_is_our_buffer )
- rcsfree((void *) b->yy_ch_buf ,yyscanner );
-
- rcsfree((void *) b ,yyscanner );
-}
-
-#ifndef __cplusplus
-extern int isatty (int );
-#endif /* __cplusplus */
-
-/* Initializes or reinitializes a buffer.
- * This function is sometimes called more than once on the same buffer,
- * such as during a rcsrestart() or at EOF.
- */
- static void rcs_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
-
-{
- int oerrno = errno;
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
- rcs_flush_buffer(b ,yyscanner);
-
- b->yy_input_file = file;
- b->yy_fill_buffer = 1;
-
- /* If b is the current buffer, then rcs_init_buffer was _probably_
- * called from rcsrestart() or through yy_get_next_buffer.
- * In that case, we don't want to reset the lineno or column.
- */
- if (b != YY_CURRENT_BUFFER){
- b->yy_bs_lineno = 1;
- b->yy_bs_column = 0;
- }
-
- b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-
- errno = oerrno;
-}
-
-/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
- * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- * @param yyscanner The scanner object.
- */
- void rcs_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
-{
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- if ( ! b )
- return;
-
- b->yy_n_chars = 0;
-
- /* We always need two end-of-buffer characters. The first causes
- * a transition to the end-of-buffer state. The second causes
- * a jam in that state.
- */
- b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
- b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
-
- b->yy_buf_pos = &b->yy_ch_buf[0];
-
- b->yy_at_bol = 1;
- b->yy_buffer_status = YY_BUFFER_NEW;
-
- if ( b == YY_CURRENT_BUFFER )
- rcs_load_buffer_state(yyscanner );
-}
-
-/** Pushes the new state onto the stack. The new state becomes
- * the current state. This function will allocate the stack
- * if necessary.
- * @param new_buffer The new state.
- * @param yyscanner The scanner object.
- */
-void rcspush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
-{
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- if (new_buffer == NULL)
- return;
-
- rcsensure_buffer_stack(yyscanner);
-
- /* This block is copied from rcs_switch_to_buffer. */
- if ( YY_CURRENT_BUFFER )
- {
- /* Flush out information for old buffer. */
- *yyg->yy_c_buf_p = yyg->yy_hold_char;
- YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
- }
-
- /* Only push if top exists. Otherwise, replace top. */
- if (YY_CURRENT_BUFFER)
- yyg->yy_buffer_stack_top++;
- YY_CURRENT_BUFFER_LVALUE = new_buffer;
-
- /* copied from rcs_switch_to_buffer. */
- rcs_load_buffer_state(yyscanner );
- yyg->yy_did_buffer_switch_on_eof = 1;
-}
-
-/** Removes and deletes the top of the stack, if present.
- * The next element becomes the new top.
- * @param yyscanner The scanner object.
- */
-void rcspop_buffer_state (yyscan_t yyscanner)
-{
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- if (!YY_CURRENT_BUFFER)
- return;
-
- rcs_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
- YY_CURRENT_BUFFER_LVALUE = NULL;
- if (yyg->yy_buffer_stack_top > 0)
- --yyg->yy_buffer_stack_top;
-
- if (YY_CURRENT_BUFFER) {
- rcs_load_buffer_state(yyscanner );
- yyg->yy_did_buffer_switch_on_eof = 1;
- }
-}
-
-/* Allocates the stack if it does not exist.
- * Guarantees space for at least one push.
- */
-static void rcsensure_buffer_stack (yyscan_t yyscanner)
-{
- int num_to_alloc;
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
- if (!yyg->yy_buffer_stack) {
-
- /* First allocation is just for 2 elements, since we don't know if this
- * scanner will even need a stack. We use 2 instead of 1 to avoid an
- * immediate realloc on the next call.
- */
- num_to_alloc = 1;
- yyg->yy_buffer_stack = (struct yy_buffer_state**)rcsalloc
- (num_to_alloc * sizeof(struct yy_buffer_state*)
- , yyscanner);
- if ( ! yyg->yy_buffer_stack )
- YY_FATAL_ERROR( "out of dynamic memory in rcsensure_buffer_stack()" );
-
- memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-
- yyg->yy_buffer_stack_max = num_to_alloc;
- yyg->yy_buffer_stack_top = 0;
- return;
- }
-
- if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
-
- /* Increase the buffer to prepare for a possible push. */
- int grow_size = 8 /* arbitrary grow size */;
-
- num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
- yyg->yy_buffer_stack = (struct yy_buffer_state**)rcsrealloc
- (yyg->yy_buffer_stack,
- num_to_alloc * sizeof(struct yy_buffer_state*)
- , yyscanner);
- if ( ! yyg->yy_buffer_stack )
- YY_FATAL_ERROR( "out of dynamic memory in rcsensure_buffer_stack()" );
-
- /* zero only the new slots.*/
- memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
- yyg->yy_buffer_stack_max = num_to_alloc;
- }
-}
-
-/** Setup the input buffer state to scan directly from a user-specified character buffer.
- * @param base the character buffer
- * @param size the size in bytes of the character buffer
- * @param yyscanner The scanner object.
- * @return the newly allocated buffer state object.
- */
-YY_BUFFER_STATE rcs_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
-{
- YY_BUFFER_STATE b;
-
- if ( size < 2 ||
- base[size-2] != YY_END_OF_BUFFER_CHAR ||
- base[size-1] != YY_END_OF_BUFFER_CHAR )
- /* They forgot to leave room for the EOB's. */
- return 0;
-
- b = (YY_BUFFER_STATE) rcsalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in rcs_scan_buffer()" );
-
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
- b->yy_buf_pos = b->yy_ch_buf = base;
- b->yy_is_our_buffer = 0;
- b->yy_input_file = 0;
- b->yy_n_chars = b->yy_buf_size;
- b->yy_is_interactive = 0;
- b->yy_at_bol = 1;
- b->yy_fill_buffer = 0;
- b->yy_buffer_status = YY_BUFFER_NEW;
-
- rcs_switch_to_buffer(b ,yyscanner );
-
- return b;
-}
-
-/** Setup the input buffer state to scan a string. The next call to rcslex() will
- * scan from a @e copy of @a str.
- * @param yystr a NUL-terminated string to scan
- * @param yyscanner The scanner object.
- * @return the newly allocated buffer state object.
- * @note If you want to scan bytes that may contain NUL values, then use
- * rcs_scan_bytes() instead.
- */
-YY_BUFFER_STATE rcs_scan_string (yyconst char * yystr , yyscan_t yyscanner)
-{
-
- return rcs_scan_bytes(yystr,strlen(yystr) ,yyscanner);
-}
-
-/** Setup the input buffer state to scan the given bytes. The next call to rcslex() will
- * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
- * @param yyscanner The scanner object.
- * @return the newly allocated buffer state object.
- */
-YY_BUFFER_STATE rcs_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
-{
- YY_BUFFER_STATE b;
- char *buf;
- yy_size_t n;
- int i;
-
- /* Get memory for full buffer, including space for trailing EOB's. */
- n = _yybytes_len + 2;
- buf = (char *) rcsalloc(n ,yyscanner );
- if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in rcs_scan_bytes()" );
-
- for ( i = 0; i < _yybytes_len; ++i )
- buf[i] = yybytes[i];
-
- buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
-
- b = rcs_scan_buffer(buf,n ,yyscanner);
- if ( ! b )
- YY_FATAL_ERROR( "bad buffer in rcs_scan_bytes()" );
-
- /* It's okay to grow etc. this buffer, and we should throw it
- * away when we're done.
- */
- b->yy_is_our_buffer = 1;
-
- return b;
-}
-
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
-
-static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
-{
- (void) fprintf( stderr, "%s\n", msg );
- exit( YY_EXIT_FAILURE );
-}
-
-/* Redefine yyless() so it works in section 3 code. */
-
-#undef yyless
-#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up yytext. */ \
- int yyless_macro_arg = (n); \
- YY_LESS_LINENO(yyless_macro_arg);\
- yytext[yyleng] = yyg->yy_hold_char; \
- yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
- yyg->yy_hold_char = *yyg->yy_c_buf_p; \
- *yyg->yy_c_buf_p = '\0'; \
- yyleng = yyless_macro_arg; \
- } \
- while ( 0 )
-
-/* Accessor methods (get/set functions) to struct members. */
-
-/** Get the user-defined data for this scanner.
- * @param yyscanner The scanner object.
- */
-YY_EXTRA_TYPE rcsget_extra (yyscan_t yyscanner)
-{
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- return yyextra;
-}
-
-/** Get the current line number.
- * @param yyscanner The scanner object.
- */
-int rcsget_lineno (yyscan_t yyscanner)
-{
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
- if (! YY_CURRENT_BUFFER)
- return 0;
-
- return yylineno;
-}
-
-/** Get the current column number.
- * @param yyscanner The scanner object.
- */
-int rcsget_column (yyscan_t yyscanner)
-{
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
- if (! YY_CURRENT_BUFFER)
- return 0;
-
- return yycolumn;
-}
-
-/** Get the input stream.
- * @param yyscanner The scanner object.
- */
-FILE *rcsget_in (yyscan_t yyscanner)
-{
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- return yyin;
-}
-
-/** Get the output stream.
- * @param yyscanner The scanner object.
- */
-FILE *rcsget_out (yyscan_t yyscanner)
-{
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- return yyout;
-}
-
-/** Get the length of the current token.
- * @param yyscanner The scanner object.
- */
-int rcsget_leng (yyscan_t yyscanner)
-{
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- return yyleng;
-}
-
-/** Get the current token.
- * @param yyscanner The scanner object.
- */
-
-char *rcsget_text (yyscan_t yyscanner)
-{
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- return yytext;
-}
-
-/** Set the user-defined data. This data is never touched by the scanner.
- * @param user_defined The data to be associated with this scanner.
- * @param yyscanner The scanner object.
- */
-void rcsset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
-{
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- yyextra = user_defined ;
-}
-
-/** Set the current line number.
- * @param line_number
- * @param yyscanner The scanner object.
- */
-void rcsset_lineno (int line_number , yyscan_t yyscanner)
-{
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
- /* lineno is only valid if an input buffer exists. */
- if (! YY_CURRENT_BUFFER )
- yy_fatal_error( "rcsset_lineno called with no buffer" , yyscanner);
-
- yylineno = line_number;
-}
-
-/** Set the current column.
- * @param line_number
- * @param yyscanner The scanner object.
- */
-void rcsset_column (int column_no , yyscan_t yyscanner)
-{
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
- /* column is only valid if an input buffer exists. */
- if (! YY_CURRENT_BUFFER )
- yy_fatal_error( "rcsset_column called with no buffer" , yyscanner);
-
- yycolumn = column_no;
-}
-
-/** Set the input stream. This does not discard the current
- * input buffer.
- * @param in_str A readable stream.
- * @param yyscanner The scanner object.
- * @see rcs_switch_to_buffer
- */
-void rcsset_in (FILE * in_str , yyscan_t yyscanner)
-{
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- yyin = in_str ;
-}
-
-void rcsset_out (FILE * out_str , yyscan_t yyscanner)
-{
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- yyout = out_str ;
-}
-
-int rcsget_debug (yyscan_t yyscanner)
-{
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- return yy_flex_debug;
-}
-
-void rcsset_debug (int bdebug , yyscan_t yyscanner)
-{
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- yy_flex_debug = bdebug ;
-}
-
-/* Accessor methods for yylval and yylloc */
-
-/* User-visible API */
-
-/* rcslex_init is special because it creates the scanner itself, so it is
- * the ONLY reentrant function that doesn't take the scanner as the last argument.
- * That's why we explicitly handle the declaration, instead of using our macros.
- */
-
-int rcslex_init(yyscan_t* ptr_yy_globals)
-
-{
- if (ptr_yy_globals == NULL){
- errno = EINVAL;
- return 1;
- }
-
- *ptr_yy_globals = (yyscan_t) rcsalloc ( sizeof( struct yyguts_t ), NULL );
-
- if (*ptr_yy_globals == NULL){
- errno = ENOMEM;
- return 1;
- }
-
- /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
- memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
-
- return yy_init_globals ( *ptr_yy_globals );
-}
-
-/* rcslex_init_extra has the same functionality as rcslex_init, but follows the
- * convention of taking the scanner as the last argument. Note however, that
- * this is a *pointer* to a scanner, as it will be allocated by this call (and
- * is the reason, too, why this function also must handle its own declaration).
- * The user defined value in the first argument will be available to rcsalloc in
- * the yyextra field.
- */
-
-int rcslex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
-
-{
- struct yyguts_t dummy_yyguts;
-
- rcsset_extra (yy_user_defined, &dummy_yyguts);
-
- if (ptr_yy_globals == NULL){
- errno = EINVAL;
- return 1;
- }
-
- *ptr_yy_globals = (yyscan_t) rcsalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
-
- if (*ptr_yy_globals == NULL){
- errno = ENOMEM;
- return 1;
- }
-
- /* By setting to 0xAA, we expose bugs in
- yy_init_globals. Leave at 0x00 for releases. */
- memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
-
- rcsset_extra (yy_user_defined, *ptr_yy_globals);
-
- return yy_init_globals ( *ptr_yy_globals );
-}
-
-static int yy_init_globals (yyscan_t yyscanner)
-{
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- /* Initialization is the same as for the non-reentrant scanner.
- * This function is called from rcslex_destroy(), so don't allocate here.
- */
-
- yyg->yy_buffer_stack = 0;
- yyg->yy_buffer_stack_top = 0;
- yyg->yy_buffer_stack_max = 0;
- yyg->yy_c_buf_p = (char *) 0;
- yyg->yy_init = 0;
- yyg->yy_start = 0;
-
- yyg->yy_start_stack_ptr = 0;
- yyg->yy_start_stack_depth = 0;
- yyg->yy_start_stack = NULL;
-
-/* Defined in main.c */
-#ifdef YY_STDINIT
- yyin = stdin;
- yyout = stdout;
-#else
- yyin = (FILE *) 0;
- yyout = (FILE *) 0;
-#endif
-
- /* For future reference: Set errno on error, since we are called by
- * rcslex_init()
- */
- return 0;
-}
-
-/* rcslex_destroy is for both reentrant and non-reentrant scanners. */
-int rcslex_destroy (yyscan_t yyscanner)
-{
- struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
- /* Pop the buffer stack, destroying each element. */
- while(YY_CURRENT_BUFFER){
- rcs_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
- YY_CURRENT_BUFFER_LVALUE = NULL;
- rcspop_buffer_state(yyscanner);
- }
-
- /* Destroy the stack itself. */
- rcsfree(yyg->yy_buffer_stack ,yyscanner);
- yyg->yy_buffer_stack = NULL;
-
- /* Destroy the start condition stack. */
- rcsfree(yyg->yy_start_stack ,yyscanner );
- yyg->yy_start_stack = NULL;
-
- /* Reset the globals. This is important in a non-reentrant scanner so the next time
- * rcslex() is called, initialization will occur. */
- yy_init_globals( yyscanner);
-
- /* Destroy the main struct (reentrant only). */
- rcsfree ( yyscanner , yyscanner );
- yyscanner = NULL;
- return 0;
-}
-
-/*
- * Internal utility routines.
- */
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
-{
- register int i;
- for ( i = 0; i < n; ++i )
- s1[i] = s2[i];
-}
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
-{
- register int n;
- for ( n = 0; s[n]; ++n )
- ;
-
- return n;
-}
-#endif
-
-void *rcsalloc (yy_size_t size , yyscan_t yyscanner)
-{
- return (void *) malloc( size );
-}
-
-void *rcsrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
-{
- /* The cast to (char *) in the following accommodates both
- * implementations that use char* generic pointers, and those
- * that use void* generic pointers. It works with the latter
- * because both ANSI C and C++ allow castless assignment from
- * any pointer type to void*, and deal with argument conversions
- * as though doing an assignment.
- */
- return (void *) realloc( (char *) ptr, size );
-}
-
-void rcsfree (void * ptr , yyscan_t yyscanner)
-{
- free( (char *) ptr ); /* see rcsrealloc() for (char *) cast */
-}
-
-#define YYTABLES_NAME "yytables"
-
-#line 73 "rcstokenizer.l"
-
-
-
diff --git a/usr.bin/csup/lister.c b/usr.bin/csup/lister.c
deleted file mode 100644
index 104963a..0000000
--- a/usr.bin/csup/lister.c
+++ /dev/null
@@ -1,569 +0,0 @@
-/*-
- * Copyright (c) 2003-2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <assert.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "attrstack.h"
-#include "config.h"
-#include "fattr.h"
-#include "globtree.h"
-#include "lister.h"
-#include "misc.h"
-#include "mux.h"
-#include "proto.h"
-#include "status.h"
-#include "stream.h"
-
-/* Internal error codes. */
-#define LISTER_ERR_WRITE (-1) /* Error writing to server. */
-#define LISTER_ERR_STATUS (-2) /* Status file error in lstr->errmsg. */
-
-struct lister {
- struct config *config;
- struct stream *wr;
- char *errmsg;
-};
-
-static int lister_batch(struct lister *);
-static int lister_coll(struct lister *, struct coll *, struct status *);
-static int lister_dodirdown(struct lister *, struct coll *,
- struct statusrec *, struct attrstack *as);
-static int lister_dodirup(struct lister *, struct coll *,
- struct statusrec *, struct attrstack *as);
-static int lister_dofile(struct lister *, struct coll *,
- struct statusrec *);
-static int lister_dodead(struct lister *, struct coll *,
- struct statusrec *);
-static int lister_dorcsfile(struct lister *, struct coll *,
- struct statusrec *);
-static int lister_dorcsdead(struct lister *, struct coll *,
- struct statusrec *);
-
-void *
-lister(void *arg)
-{
- struct thread_args *args;
- struct lister lbuf, *l;
- int error;
-
- args = arg;
- l = &lbuf;
- l->config = args->config;
- l->wr = args->wr;
- l->errmsg = NULL;
- error = lister_batch(l);
- switch (error) {
- case LISTER_ERR_WRITE:
- xasprintf(&args->errmsg,
- "TreeList failed: Network write failure: %s",
- strerror(errno));
- args->status = STATUS_TRANSIENTFAILURE;
- break;
- case LISTER_ERR_STATUS:
- xasprintf(&args->errmsg,
- "TreeList failed: %s. Delete it and try again.",
- l->errmsg);
- free(l->errmsg);
- args->status = STATUS_FAILURE;
- break;
- default:
- assert(error == 0);
- args->status = STATUS_SUCCESS;
- };
- return (NULL);
-}
-
-static int
-lister_batch(struct lister *l)
-{
- struct config *config;
- struct stream *wr;
- struct status *st;
- struct coll *coll;
- int error;
-
- config = l->config;
- wr = l->wr;
- STAILQ_FOREACH(coll, &config->colls, co_next) {
- if (coll->co_options & CO_SKIP)
- continue;
- st = status_open(coll, -1, &l->errmsg);
- if (st == NULL)
- return (LISTER_ERR_STATUS);
- error = proto_printf(wr, "COLL %s %s\n", coll->co_name,
- coll->co_release);
- if (error)
- return (LISTER_ERR_WRITE);
- stream_flush(wr);
- if (coll->co_options & CO_COMPRESS)
- stream_filter_start(wr, STREAM_FILTER_ZLIB, NULL);
- error = lister_coll(l, coll, st);
- status_close(st, NULL);
- if (error)
- return (error);
- if (coll->co_options & CO_COMPRESS)
- stream_filter_stop(wr);
- stream_flush(wr);
- }
- error = proto_printf(wr, ".\n");
- if (error)
- return (LISTER_ERR_WRITE);
- return (0);
-}
-
-/* List a single collection based on the status file. */
-static int
-lister_coll(struct lister *l, struct coll *coll, struct status *st)
-{
- struct stream *wr;
- struct attrstack *as;
- struct statusrec *sr;
- struct fattr *fa;
- size_t i;
- int depth, error, ret, prunedepth;
-
- wr = l->wr;
- depth = 0;
- prunedepth = INT_MAX;
- as = attrstack_new();
- while ((ret = status_get(st, NULL, 0, 0, &sr)) == 1) {
- switch (sr->sr_type) {
- case SR_DIRDOWN:
- depth++;
- if (depth < prunedepth) {
- error = lister_dodirdown(l, coll, sr, as);
- if (error < 0)
- goto bad;
- if (error)
- prunedepth = depth;
- }
- break;
- case SR_DIRUP:
- if (depth < prunedepth) {
- error = lister_dodirup(l, coll, sr, as);
- if (error)
- goto bad;
- } else if (depth == prunedepth) {
- /* Finished pruning. */
- prunedepth = INT_MAX;
- }
- depth--;
- continue;
- case SR_CHECKOUTLIVE:
- if (depth < prunedepth) {
- error = lister_dofile(l, coll, sr);
- if (error)
- goto bad;
- }
- break;
- case SR_CHECKOUTDEAD:
- if (depth < prunedepth) {
- error = lister_dodead(l, coll, sr);
- if (error)
- goto bad;
- }
- break;
- case SR_FILEDEAD:
- if (depth < prunedepth) {
- if (!(coll->co_options & CO_CHECKOUTMODE)) {
- error = lister_dorcsdead(l, coll, sr);
- if (error)
- goto bad;
- }
- }
- break;
- case SR_FILELIVE:
- if (depth < prunedepth) {
- if (!(coll->co_options & CO_CHECKOUTMODE)) {
- error = lister_dorcsfile(l, coll, sr);
- if (error)
- goto bad;
- }
- }
- break;
- }
- }
- if (ret == -1) {
- l->errmsg = status_errmsg(st);
- error = LISTER_ERR_STATUS;
- goto bad;
- }
- assert(status_eof(st));
- assert(depth == 0);
- error = proto_printf(wr, ".\n");
- attrstack_free(as);
- if (error)
- return (LISTER_ERR_WRITE);
- return (0);
-bad:
- for (i = 0; i < attrstack_size(as); i++) {
- fa = attrstack_pop(as);
- fattr_free(fa);
- }
- attrstack_free(as);
- return (error);
-}
-
-/* Handle a directory up entry found in the status file. */
-static int
-lister_dodirdown(struct lister *l, struct coll *coll, struct statusrec *sr,
- struct attrstack *as)
-{
- struct config *config;
- struct stream *wr;
- struct fattr *fa, *fa2;
- char *path;
- int error;
-
- config = l->config;
- wr = l->wr;
- if (!globtree_test(coll->co_dirfilter, sr->sr_file))
- return (1);
- if (coll->co_options & CO_TRUSTSTATUSFILE) {
- fa = fattr_new(FT_DIRECTORY, -1);
- } else {
- xasprintf(&path, "%s/%s", coll->co_prefix, sr->sr_file);
- fa = fattr_frompath(path, FATTR_NOFOLLOW);
- if (fa == NULL) {
- /* The directory doesn't exist, prune
- * everything below it. */
- free(path);
- return (1);
- }
- if (fattr_type(fa) == FT_SYMLINK) {
- fa2 = fattr_frompath(path, FATTR_FOLLOW);
- if (fa2 != NULL && fattr_type(fa2) == FT_DIRECTORY) {
- /* XXX - When not in checkout mode, CVSup warns
- * here about the file being a symlink to a
- * directory instead of a directory. */
- fattr_free(fa);
- fa = fa2;
- } else {
- fattr_free(fa2);
- }
- }
- free(path);
- }
-
- if (fattr_type(fa) != FT_DIRECTORY) {
- fattr_free(fa);
- /* Report it as something bogus so
- * that it will be replaced. */
- error = proto_printf(wr, "F %s %F\n", pathlast(sr->sr_file),
- fattr_bogus, config->fasupport, coll->co_attrignore);
- if (error)
- return (LISTER_ERR_WRITE);
- return (1);
- }
-
- /* It really is a directory. */
- attrstack_push(as, fa);
- error = proto_printf(wr, "D %s\n", pathlast(sr->sr_file));
- if (error)
- return (LISTER_ERR_WRITE);
- return (0);
-}
-
-/* Handle a directory up entry found in the status file. */
-static int
-lister_dodirup(struct lister *l, struct coll *coll, struct statusrec *sr,
- struct attrstack *as)
-{
- struct config *config;
- const struct fattr *sendattr;
- struct stream *wr;
- struct fattr *fa, *fa2;
- int error;
-
- config = l->config;
- wr = l->wr;
- fa = attrstack_pop(as);
- if (coll->co_options & CO_TRUSTSTATUSFILE) {
- fattr_free(fa);
- fa = sr->sr_clientattr;
- }
-
- fa2 = sr->sr_clientattr;
- if (fattr_equal(fa, fa2))
- sendattr = fa;
- else
- sendattr = fattr_bogus;
- error = proto_printf(wr, "U %F\n", sendattr, config->fasupport,
- coll->co_attrignore);
- if (error)
- return (LISTER_ERR_WRITE);
- if (!(coll->co_options & CO_TRUSTSTATUSFILE))
- fattr_free(fa);
- /* XXX CVSup flushes here for some reason with a comment saying
- "Be smarter". We don't flush when listing other file types. */
- stream_flush(wr);
- return (0);
-}
-
-/* Handle a checkout live entry found in the status file. */
-static int
-lister_dofile(struct lister *l, struct coll *coll, struct statusrec *sr)
-{
- struct config *config;
- struct stream *wr;
- const struct fattr *sendattr, *fa;
- struct fattr *fa2, *rfa;
- char *path, *spath;
- int error;
-
- if (!globtree_test(coll->co_filefilter, sr->sr_file))
- return (0);
- config = l->config;
- wr = l->wr;
- rfa = NULL;
- sendattr = NULL;
- error = 0;
- if (!(coll->co_options & CO_TRUSTSTATUSFILE)) {
- path = checkoutpath(coll->co_prefix, sr->sr_file);
- if (path == NULL) {
- spath = coll_statuspath(coll);
- xasprintf(&l->errmsg, "Error in \"%s\": "
- "Invalid filename \"%s\"", spath, sr->sr_file);
- free(spath);
- return (LISTER_ERR_STATUS);
- }
- rfa = fattr_frompath(path, FATTR_NOFOLLOW);
- free(path);
- if (rfa == NULL) {
- /*
- * According to the checkouts file we should have
- * this file but we don't. Maybe the user deleted
- * the file, or maybe the checkouts file is wrong.
- * List the file with bogus attributes to cause the
- * server to get things back in sync again.
- */
- sendattr = fattr_bogus;
- goto send;
- }
- fa = rfa;
- } else {
- fa = sr->sr_clientattr;
- }
- fa2 = fattr_forcheckout(sr->sr_serverattr, coll->co_umask);
- if (!fattr_equal(fa, sr->sr_clientattr) || !fattr_equal(fa, fa2) ||
- strcmp(coll->co_tag, sr->sr_tag) != 0 ||
- strcmp(coll->co_date, sr->sr_date) != 0) {
- /*
- * The file corresponds to the information we have
- * recorded about it, and its moded is correct for
- * the requested umask setting.
- */
- sendattr = fattr_bogus;
- } else {
- /*
- * Either the file has been touched, or we are asking
- * for a different revision than the one we recorded
- * information about, or its mode isn't right (because
- * it was last updated using a version of CVSup that
- * wasn't so strict about modes).
- */
- sendattr = sr->sr_serverattr;
- }
- fattr_free(fa2);
- if (rfa != NULL)
- fattr_free(rfa);
-send:
- error = proto_printf(wr, "F %s %F\n", pathlast(sr->sr_file), sendattr,
- config->fasupport, coll->co_attrignore);
- if (error)
- return (LISTER_ERR_WRITE);
- return (0);
-}
-
-/* Handle a rcs file live entry found in the status file. */
-static int
-lister_dorcsfile(struct lister *l, struct coll *coll, struct statusrec *sr)
-{
- struct config *config;
- struct stream *wr;
- const struct fattr *sendattr;
- struct fattr *fa;
- char *path, *spath;
- size_t len;
- int error;
-
- if (!globtree_test(coll->co_filefilter, sr->sr_file))
- return (0);
- config = l->config;
- wr = l->wr;
- if (!(coll->co_options & CO_TRUSTSTATUSFILE)) {
- path = cvspath(coll->co_prefix, sr->sr_file, 0);
- if (path == NULL) {
- spath = coll_statuspath(coll);
- xasprintf(&l->errmsg, "Error in \"%s\": "
- "Invalid filename \"%s\"", spath, sr->sr_file);
- free(spath);
- return (LISTER_ERR_STATUS);
- }
- fa = fattr_frompath(path, FATTR_NOFOLLOW);
- free(path);
- } else
- fa = sr->sr_clientattr;
- if (fa != NULL && fattr_equal(fa, sr->sr_clientattr)) {
- /*
- * If the file is an RCS file, we use "loose" equality, so sizes
- * may disagress because of differences in whitespace.
- */
- if (isrcs(sr->sr_file, &len) &&
- !(coll->co_options & CO_NORCS) &&
- !(coll->co_options & CO_STRICTCHECKRCS)) {
- fattr_maskout(fa, FA_SIZE);
- }
- sendattr = fa;
- } else {
- /*
- * If different, the user may have changed it, so we report
- * bogus attributes to force a full comparison.
- */
- sendattr = fattr_bogus;
- }
- error = proto_printf(wr, "F %s %F\n", pathlast(sr->sr_file), sendattr,
- config->fasupport, coll->co_attrignore);
- if (error)
- return (LISTER_ERR_WRITE);
- return (0);
-}
-
-/* Handle a checkout dead entry found in the status file. */
-static int
-lister_dodead(struct lister *l, struct coll *coll, struct statusrec *sr)
-{
- struct config *config;
- struct stream *wr;
- const struct fattr *sendattr;
- struct fattr *fa;
- char *path, *spath;
- int error;
-
- if (!globtree_test(coll->co_filefilter, sr->sr_file))
- return (0);
- config = l->config;
- wr = l->wr;
- if (!(coll->co_options & CO_TRUSTSTATUSFILE)) {
- path = checkoutpath(coll->co_prefix, sr->sr_file);
- if (path == NULL) {
- spath = coll_statuspath(coll);
- xasprintf(&l->errmsg, "Error in \"%s\": "
- "Invalid filename \"%s\"", spath, sr->sr_file);
- free(spath);
- return (LISTER_ERR_STATUS);
- }
- fa = fattr_frompath(path, FATTR_NOFOLLOW);
- free(path);
- if (fa != NULL && fattr_type(fa) != FT_DIRECTORY) {
- /*
- * We shouldn't have this file but we do. Report
- * it to the server, which will either send a
- * deletion request, of (if the file has come alive)
- * sent the correct version.
- */
- fattr_free(fa);
- error = proto_printf(wr, "F %s %F\n",
- pathlast(sr->sr_file), fattr_bogus,
- config->fasupport, coll->co_attrignore);
- if (error)
- return (LISTER_ERR_WRITE);
- return (0);
- }
- fattr_free(fa);
- }
- if (strcmp(coll->co_tag, sr->sr_tag) != 0 ||
- strcmp(coll->co_date, sr->sr_date) != 0)
- sendattr = fattr_bogus;
- else
- sendattr = sr->sr_serverattr;
- error = proto_printf(wr, "f %s %F\n", pathlast(sr->sr_file), sendattr,
- config->fasupport, coll->co_attrignore);
- if (error)
- return (LISTER_ERR_WRITE);
- return (0);
-}
-
-/* Handle a rcs file dead entry found in the status file. */
-static int
-lister_dorcsdead(struct lister *l, struct coll *coll, struct statusrec *sr)
-{
- struct config *config;
- struct stream *wr;
- const struct fattr *sendattr;
- struct fattr *fa;
- char *path, *spath;
- size_t len;
- int error;
-
- if (!globtree_test(coll->co_filefilter, sr->sr_file))
- return (0);
- config = l->config;
- wr = l->wr;
- if (!(coll->co_options & CO_TRUSTSTATUSFILE)) {
- path = cvspath(coll->co_prefix, sr->sr_file, 1);
- if (path == NULL) {
- spath = coll_statuspath(coll);
- xasprintf(&l->errmsg, "Error in \"%s\": "
- "Invalid filename \"%s\"", spath, sr->sr_file);
- free(spath);
- return (LISTER_ERR_STATUS);
- }
- fa = fattr_frompath(path, FATTR_NOFOLLOW);
- free(path);
- } else
- fa = sr->sr_clientattr;
- if (fattr_equal(fa, sr->sr_clientattr)) {
- /*
- * If the file is an RCS file, we use "loose" equality, so sizes
- * may disagress because of differences in whitespace.
- */
- if (isrcs(sr->sr_file, &len) &&
- !(coll->co_options & CO_NORCS) &&
- !(coll->co_options & CO_STRICTCHECKRCS)) {
- fattr_maskout(fa, FA_SIZE);
- }
- sendattr = fa;
- } else {
- /*
- * If different, the user may have changed it, so we report
- * bogus attributes to force a full comparison.
- */
- sendattr = fattr_bogus;
- }
- error = proto_printf(wr, "f %s %F\n", pathlast(sr->sr_file), sendattr,
- config->fasupport, coll->co_attrignore);
- if (error)
- return (LISTER_ERR_WRITE);
- return (0);
-}
diff --git a/usr.bin/csup/lister.h b/usr.bin/csup/lister.h
deleted file mode 100644
index a0a9bbe..0000000
--- a/usr.bin/csup/lister.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*-
- * Copyright (c) 2003-2004, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#ifndef _LISTER_H_
-#define _LISTER_H_
-
-void *lister(void *);
-
-#endif /* !_LISTER_H_ */
diff --git a/usr.bin/csup/main.c b/usr.bin/csup/main.c
deleted file mode 100644
index 1363d14..0000000
--- a/usr.bin/csup/main.c
+++ /dev/null
@@ -1,346 +0,0 @@
-/*-
- * Copyright (c) 2003-2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <sys/file.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <libgen.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "config.h"
-#include "fattr.h"
-#include "misc.h"
-#include "proto.h"
-#include "stream.h"
-
-#define USAGE_OPTFMT " %-12s %s\n"
-#define USAGE_OPTFMTSUB " %-14s %s\n", ""
-
-int verbose = 1;
-
-static void
-usage(char *argv0)
-{
-
- lprintf(-1, "Usage: %s [options] supfile\n", basename(argv0));
- lprintf(-1, " Options:\n");
- lprintf(-1, USAGE_OPTFMT, "-1", "Don't retry automatically on failure "
- "(same as \"-r 0\")");
- lprintf(-1, USAGE_OPTFMT, "-4", "Force usage of IPv4 addresses");
- lprintf(-1, USAGE_OPTFMT, "-6", "Force usage of IPv6 addresses");
- lprintf(-1, USAGE_OPTFMT, "-a",
- "Require server to authenticate itself to us");
- lprintf(-1, USAGE_OPTFMT, "-A addr",
- "Bind local socket to a specific address");
- lprintf(-1, USAGE_OPTFMT, "-b base",
- "Override supfile's \"base\" directory");
- lprintf(-1, USAGE_OPTFMT, "-c collDir",
- "Subdirectory of \"base\" for collections (default \"sup\")");
- lprintf(-1, USAGE_OPTFMT, "-d delLimit",
- "Allow at most \"delLimit\" file deletions (default unlimited)");
- lprintf(-1, USAGE_OPTFMT, "-h host",
- "Override supfile's \"host\" name");
- lprintf(-1, USAGE_OPTFMT, "-i pattern",
- "Include only files/directories matching pattern.");
- lprintf(-1, USAGE_OPTFMTSUB,
- "May be repeated for an OR operation. Default is");
- lprintf(-1, USAGE_OPTFMTSUB, "to include each entire collection.");
- lprintf(-1, USAGE_OPTFMT, "-k",
- "Keep bad temporary files when fixups are required");
- lprintf(-1, USAGE_OPTFMT, "-l lockfile",
- "Lock file during update; fail if already locked");
- lprintf(-1, USAGE_OPTFMT, "-L n",
- "Verbosity level (0..2, default 1)");
- lprintf(-1, USAGE_OPTFMT, "-p port",
- "Alternate server port (default 5999)");
- lprintf(-1, USAGE_OPTFMT, "-r n",
- "Maximum retries on transient errors (default unlimited)");
- lprintf(-1, USAGE_OPTFMT, "-s",
- "Don't stat client files; trust the checkouts file");
- lprintf(-1, USAGE_OPTFMT, "-v", "Print version and exit");
- lprintf(-1, USAGE_OPTFMT, "-z", "Enable compression for all "
- "collections");
- lprintf(-1, USAGE_OPTFMT, "-Z", "Disable compression for all "
- "collections");
-}
-
-int
-main(int argc, char *argv[])
-{
- struct tm tm;
- struct backoff_timer *timer;
- struct config *config;
- struct coll *override;
- struct addrinfo *res;
- struct sockaddr *laddr;
- socklen_t laddrlen;
- struct stream *lock;
- char *argv0, *file, *lockfile;
- int family, error, lockfd, lflag, overridemask;
- int c, i, deletelim, port, retries, status, reqauth;
- time_t nexttry;
-
- error = 0;
- family = PF_UNSPEC;
- deletelim = -1;
- port = 0;
- lflag = 0;
- lockfd = 0;
- nexttry = 0;
- retries = -1;
- argv0 = argv[0];
- laddr = NULL;
- laddrlen = 0;
- lockfile = NULL;
- override = coll_new(NULL);
- overridemask = 0;
- reqauth = 0;
-
- while ((c = getopt(argc, argv,
- "146aA:b:c:d:gh:i:kl:L:p:P:r:svzZ")) != -1) {
- switch (c) {
- case '1':
- retries = 0;
- break;
- case '4':
- family = AF_INET;
- break;
- case '6':
- family = AF_INET6;
- break;
- case 'a':
- /* Require server authentication */
- reqauth = 1;
- break;
- case 'A':
- error = getaddrinfo(optarg, NULL, NULL, &res);
- if (error) {
- lprintf(-1, "%s: %s\n", optarg,
- gai_strerror(error));
- return (1);
- }
- laddrlen = res->ai_addrlen;
- laddr = xmalloc(laddrlen);
- memcpy(laddr, res->ai_addr, laddrlen);
- freeaddrinfo(res);
- break;
- case 'b':
- if (override->co_base != NULL)
- free(override->co_base);
- override->co_base = xstrdup(optarg);
- break;
- case 'c':
- override->co_colldir = optarg;
- break;
- case 'd':
- error = asciitoint(optarg, &deletelim, 0);
- if (error || deletelim < 0) {
- lprintf(-1, "Invalid deletion limit\n");
- usage(argv0);
- return (1);
- }
- break;
- case 'g':
- /* For compatibility. */
- break;
- case 'h':
- if (override->co_host != NULL)
- free(override->co_host);
- override->co_host = xstrdup(optarg);
- break;
- case 'i':
- pattlist_add(override->co_accepts, optarg);
- break;
- case 'k':
- override->co_options |= CO_KEEPBADFILES;
- overridemask |= CO_KEEPBADFILES;
- break;
- case 'l':
- lockfile = optarg;
- lflag = 1;
- lockfd = open(lockfile,
- O_CREAT | O_WRONLY | O_TRUNC, 0700);
- if (lockfd != -1) {
- error = flock(lockfd, LOCK_EX | LOCK_NB);
- if (error == -1 && errno == EWOULDBLOCK) {
- if (lockfd != -1)
- close(lockfd);
- lprintf(-1, "\"%s\" is already locked "
- "by another process\n", lockfile);
- return (1);
- }
- }
- if (lockfd == -1 || error == -1) {
- if (lockfd != -1)
- close(lockfd);
- lprintf(-1, "Error locking \"%s\": %s\n",
- lockfile, strerror(errno));
- return (1);
- }
- lock = stream_open_fd(lockfd,
- NULL, stream_write_fd, NULL);
- (void)stream_printf(lock, "%10ld\n", (long)getpid());
- stream_close(lock);
- break;
- case 'L':
- error = asciitoint(optarg, &verbose, 0);
- if (error) {
- lprintf(-1, "Invalid verbosity\n");
- usage(argv0);
- return (1);
- }
- break;
- case 'p':
- /* Use specified server port. */
- error = asciitoint(optarg, &port, 0);
- if (error) {
- lprintf(-1, "Invalid server port\n");
- usage(argv0);
- return (1);
- }
- if (port <= 0 || port >= 65536) {
- lprintf(-1, "Invalid port %d\n", port);
- return (1);
- }
- if (port < 1024) {
- lprintf(-1, "Reserved port %d not permitted\n",
- port);
- return (1);
- }
- break;
- case 'P':
- /* For compatibility. */
- if (strcmp(optarg, "m") != 0) {
- lprintf(-1,
- "Client only supports multiplexed mode\n");
- return (1);
- }
- break;
- case 'r':
- error = asciitoint(optarg, &retries, 0);
- if (error || retries < 0) {
- lprintf(-1, "Invalid retry limit\n");
- usage(argv0);
- return (1);
- }
- break;
- case 's':
- override->co_options |= CO_TRUSTSTATUSFILE;
- overridemask |= CO_TRUSTSTATUSFILE;
- break;
- case 'v':
- lprintf(0, "CVSup client written in C\n");
- lprintf(0, "Software version: %s\n", PROTO_SWVER);
- lprintf(0, "Protocol version: %d.%d\n",
- PROTO_MAJ, PROTO_MIN);
- return (0);
- break;
- case 'z':
- /* Force compression on all collections. */
- override->co_options |= CO_COMPRESS;
- overridemask |= CO_COMPRESS;
- break;
- case 'Z':
- /* Disables compression on all collections. */
- override->co_options &= ~CO_COMPRESS;
- overridemask &= ~CO_COMPRESS;
- break;
- case '?':
- default:
- usage(argv0);
- return (1);
- }
- }
-
- argc -= optind;
- argv += optind;
-
- if (argc < 1) {
- usage(argv0);
- return (1);
- }
-
- file = argv[0];
- lprintf(2, "Parsing supfile \"%s\"\n", file);
- config = config_init(file, override, overridemask);
- coll_free(override);
- if (config == NULL)
- return (1);
-
- if (config_checkcolls(config) == 0) {
- lprintf(-1, "No collections selected\n");
- return (1);
- }
-
- if (laddr != NULL) {
- config->laddr = laddr;
- config->laddrlen = laddrlen;
- }
- config->deletelim = deletelim;
- config->reqauth = reqauth;
- lprintf(2, "Connecting to %s\n", config->host);
-
- i = 0;
- fattr_init(); /* Initialize the fattr API. */
- timer = bt_new(300, 7200, 2.0, 0.1);
- for (;;) {
- status = proto_connect(config, family, port);
- if (status == STATUS_SUCCESS) {
- status = proto_run(config);
- if (status != STATUS_TRANSIENTFAILURE)
- break;
- }
- if (retries >= 0 && i >= retries)
- break;
- nexttry = time(0) + bt_get(timer);
- localtime_r(&nexttry, &tm);
- lprintf(1, "Will retry at %02d:%02d:%02d\n",
- tm.tm_hour, tm.tm_min, tm.tm_sec);
- bt_pause(timer);
- lprintf(1, "Retrying\n");
- i++;
- }
- bt_free(timer);
- fattr_fini();
- if (lflag) {
- unlink(lockfile);
- flock(lockfd, LOCK_UN);
- close(lockfd);
- }
- config_free(config);
- if (status != STATUS_SUCCESS)
- return (1);
- return (0);
-}
diff --git a/usr.bin/csup/main.h b/usr.bin/csup/main.h
deleted file mode 100644
index 217c7eb..0000000
--- a/usr.bin/csup/main.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*-
- * Copyright (c) 2003-2004, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- */
-
-extern int verbose;
diff --git a/usr.bin/csup/misc.c b/usr.bin/csup/misc.c
deleted file mode 100644
index f4170df..0000000
--- a/usr.bin/csup/misc.c
+++ /dev/null
@@ -1,644 +0,0 @@
-/*-
- * Copyright (c) 2003-2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include <assert.h>
-#include <err.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <pthread.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
-
-#include "fattr.h"
-#include "main.h"
-#include "misc.h"
-
-struct pattlist {
- char **patterns;
- size_t size;
- size_t in;
-};
-
-struct backoff_timer {
- time_t min;
- time_t max;
- time_t interval;
- float backoff;
- float jitter;
-};
-
-static void bt_update(struct backoff_timer *);
-static void bt_addjitter(struct backoff_timer *);
-
-int
-asciitoint(const char *s, int *val, int base)
-{
- char *end;
- long longval;
-
- errno = 0;
- longval = strtol(s, &end, base);
- if (errno || *end != '\0')
- return (-1);
- if (longval > INT_MAX || longval < INT_MIN) {
- errno = ERANGE;
- return (-1);
- }
- *val = longval;
- return (0);
-}
-
-int
-lprintf(int level, const char *fmt, ...)
-{
- FILE *to;
- va_list ap;
- int ret;
-
- if (level > verbose)
- return (0);
- if (level == -1)
- to = stderr;
- else
- to = stdout;
- va_start(ap, fmt);
- ret = vfprintf(to, fmt, ap);
- va_end(ap);
- fflush(to);
- return (ret);
-}
-
-/*
- * Compute the MD5 checksum of a file. The md parameter must
- * point to a buffer containing at least MD5_DIGEST_SIZE bytes.
- *
- * Do not confuse OpenSSL's MD5_DIGEST_LENGTH with our own
- * MD5_DIGEST_SIZE macro.
- */
-int
-MD5_File(char *path, char *md)
-{
- char buf[1024];
- MD5_CTX ctx;
- ssize_t n;
- int fd;
-
- fd = open(path, O_RDONLY);
- if (fd == -1)
- return (-1);
- MD5_Init(&ctx);
- while ((n = read(fd, buf, sizeof(buf))) > 0)
- MD5_Update(&ctx, buf, n);
- close(fd);
- if (n == -1)
- return (-1);
- MD5_End(md, &ctx);
- return (0);
-}
-
-/*
- * Wrapper around MD5_Final() that converts the 128 bits MD5 hash
- * to an ASCII string representing this value in hexadecimal.
- */
-void
-MD5_End(char *md, MD5_CTX *c)
-{
- unsigned char md5[MD5_DIGEST_LENGTH];
- const char hex[] = "0123456789abcdef";
- int i, j;
-
- MD5_Final(md5, c);
- j = 0;
- for (i = 0; i < MD5_DIGEST_LENGTH; i++) {
- md[j++] = hex[md5[i] >> 4];
- md[j++] = hex[md5[i] & 0xf];
- }
- md[j] = '\0';
-}
-
-int
-pathcmp(const char *s1, const char *s2)
-{
- char c1, c2;
-
- do {
- c1 = *s1++;
- if (c1 == '/')
- c1 = 1;
- c2 = *s2++;
- if (c2 == '/')
- c2 = 1;
- } while (c1 == c2 && c1 != '\0');
-
- return (c1 - c2);
-}
-
-size_t
-commonpathlength(const char *a, size_t alen, const char *b, size_t blen)
-{
- size_t i, minlen, lastslash;
-
- minlen = min(alen, blen);
- lastslash = 0;
- for (i = 0; i < minlen; i++) {
- if (a[i] != b[i])
- return (lastslash);
- if (a[i] == '/') {
- if (i == 0) /* Include the leading slash. */
- lastslash = 1;
- else
- lastslash = i;
- }
- }
-
- /* One path is a prefix of the other/ */
- if (alen > minlen) { /* Path "b" is a prefix of "a". */
- if (a[minlen] == '/')
- return (minlen);
- else
- return (lastslash);
- } else if (blen > minlen) { /* Path "a" is a prefix of "b". */
- if (b[minlen] == '/')
- return (minlen);
- else
- return (lastslash);
- }
-
- /* The paths are identical. */
- return (minlen);
-}
-
-const char *
-pathlast(const char *path)
-{
- const char *s;
-
- s = strrchr(path, '/');
- if (s == NULL)
- return (path);
- return (++s);
-}
-
-int
-rcsdatetotm(const char *revdate, struct tm *tm)
-{
- char *cp;
- size_t len;
-
- cp = strchr(revdate, '.');
- if (cp == NULL)
- return (-1);
- len = cp - revdate;
- if (len >= 4)
- cp = strptime(revdate, "%Y.%m.%d.%H.%M.%S", tm);
- else if (len == 2)
- cp = strptime(revdate, "%y.%m.%d.%H.%M.%S", tm);
- else
- return (-1);
- if (cp == NULL || *cp != '\0')
- return (-1);
- return (0);
-}
-
-time_t
-rcsdatetotime(const char *revdate)
-{
- struct tm tm;
- time_t t;
- int error;
-
- error = rcsdatetotm(revdate, &tm);
- if (error)
- return (error);
- t = timegm(&tm);
- return (t);
-}
-
-/*
- * Checks if a file is an RCS file.
- */
-int
-isrcs(const char *file, size_t *len)
-{
- const char *cp;
-
- if (file[0] == '/')
- return (0);
- cp = file;
- while ((cp = strstr(cp, "..")) != NULL) {
- if (cp == file || cp[2] == '\0' ||
- (cp[-1] == '/' && cp[2] == '/'))
- return (0);
- cp += 2;
- }
- *len = strlen(file);
- if (*len < 2 || file[*len - 1] != 'v' || file[*len - 2] != ',') {
- return (0);
- }
-
- return (1);
-}
-
-/*
- * Returns a buffer allocated with malloc() containing the absolute
- * pathname to the checkout file made from the prefix and the path
- * of the corresponding RCS file relatively to the prefix. If the
- * filename is not an RCS filename, NULL will be returned.
- */
-char *
-checkoutpath(const char *prefix, const char *file)
-{
- char *path;
- size_t len;
-
- if (!isrcs(file, &len))
- return (NULL);
- xasprintf(&path, "%s/%.*s", prefix, (int)len - 2, file);
- return (path);
-}
-
-/*
- * Returns a cvs path allocated with malloc() containing absolute pathname to a
- * file in cvs mode which can reside in the attic. XXX: filename has really no
- * restrictions.
- */
-char *
-cvspath(const char *prefix, const char *file, int attic)
-{
- const char *last;
- char *path;
-
- last = pathlast(file);
- if (attic)
- xasprintf(&path, "%s/%.*sAttic/%s", prefix, (int)(last - file),
- file, last);
- else
- xasprintf(&path, "%s/%s", prefix, file);
-
- return (path);
-}
-
-/*
- * Regular or attic path if regular fails.
- * XXX: This should perhaps also check if the Attic file exists too, and return
- * NULL if not.
- */
-char *
-atticpath(const char *prefix, const char *file)
-{
- char *path;
-
- path = cvspath(prefix, file, 0);
- if (access(path, F_OK) != 0) {
- free(path);
- path = cvspath(prefix, file, 1);
- }
- return (path);
-}
-
-int
-mkdirhier(char *path, mode_t mask)
-{
- struct fattr *fa;
- size_t i, last, len;
- int error, finish, rv;
-
- finish = 0;
- last = 0;
- len = strlen(path);
- for (i = len - 1; i > 0; i--) {
- if (path[i] == '/') {
- path[i] = '\0';
- if (access(path, F_OK) == 0) {
- path[i] = '/';
- break;
- }
- if (errno != ENOENT) {
- path[i] = '/';
- if (last == 0)
- return (-1);
- finish = 1;
- break;
- }
- last = i;
- }
- }
- if (last == 0)
- return (0);
-
- i = strlen(path);
- fa = fattr_new(FT_DIRECTORY, -1);
- fattr_mergedefault(fa);
- fattr_umask(fa, mask);
- while (i < len) {
- if (!finish) {
- rv = 0;
- error = fattr_makenode(fa, path);
- if (!error)
- rv = fattr_install(fa, path, NULL);
- if (error || rv == -1)
- finish = 1;
- }
- path[i] = '/';
- i += strlen(path + i);
- }
- assert(i == len);
- if (finish)
- return (-1);
- return (0);
-}
-
-/*
- * Compute temporary pathnames.
- * This can look a bit like overkill but we mimic CVSup's behaviour.
- */
-#define TEMPNAME_PREFIX "#cvs.csup"
-
-static pthread_mutex_t tempname_mtx = PTHREAD_MUTEX_INITIALIZER;
-static pid_t tempname_pid = -1;
-static int tempname_count;
-
-char *
-tempname(const char *path)
-{
- char *cp, *temp;
- int count, error;
-
- error = pthread_mutex_lock(&tempname_mtx);
- assert(!error);
- if (tempname_pid == -1) {
- tempname_pid = getpid();
- tempname_count = 0;
- }
- count = tempname_count++;
- error = pthread_mutex_unlock(&tempname_mtx);
- assert(!error);
- cp = strrchr(path, '/');
- if (cp == NULL)
- xasprintf(&temp, "%s-%ld.%d", TEMPNAME_PREFIX,
- (long)tempname_pid, count);
- else
- xasprintf(&temp, "%.*s%s-%ld.%d", (int)(cp - path + 1), path,
- TEMPNAME_PREFIX, (long)tempname_pid, count);
- return (temp);
-}
-
-void *
-xmalloc(size_t size)
-{
- void *buf;
-
- buf = malloc(size);
- if (buf == NULL)
- err(1, "malloc");
- return (buf);
-}
-
-void *
-xrealloc(void *buf, size_t size)
-{
-
- buf = realloc(buf, size);
- if (buf == NULL)
- err(1, "realloc");
- return (buf);
-}
-
-char *
-xstrdup(const char *str)
-{
- char *buf;
-
- buf = strdup(str);
- if (buf == NULL)
- err(1, "strdup");
- return (buf);
-}
-
-int
-xasprintf(char **ret, const char *format, ...)
-{
- va_list ap;
- int rv;
-
- va_start(ap, format);
- rv = vasprintf(ret, format, ap);
- va_end(ap);
- if (*ret == NULL)
- err(1, "asprintf");
- return (rv);
-}
-
-struct pattlist *
-pattlist_new(void)
-{
- struct pattlist *p;
-
- p = xmalloc(sizeof(struct pattlist));
- p->size = 4; /* Initial size. */
- p->patterns = xmalloc(p->size * sizeof(char *));
- p->in = 0;
- return (p);
-}
-
-void
-pattlist_add(struct pattlist *p, const char *pattern)
-{
-
- if (p->in == p->size) {
- p->size *= 2;
- p->patterns = xrealloc(p->patterns, p->size * sizeof(char *));
- }
- assert(p->in < p->size);
- p->patterns[p->in++] = xstrdup(pattern);
-}
-
-char *
-pattlist_get(struct pattlist *p, size_t i)
-{
-
- assert(i < p->in);
- return (p->patterns[i]);
-}
-
-size_t
-pattlist_size(struct pattlist *p)
-{
-
- return (p->in);
-}
-
-void
-pattlist_free(struct pattlist *p)
-{
- size_t i;
-
- for (i = 0; i < p->in; i++)
- free(p->patterns[i]);
- free(p->patterns);
- free(p);
-}
-
-/* Creates a backoff timer. */
-struct backoff_timer *
-bt_new(time_t min, time_t max, float backoff, float jitter)
-{
- struct backoff_timer *bt;
-
- bt = xmalloc(sizeof(struct backoff_timer));
- bt->min = min;
- bt->max = max;
- bt->backoff = backoff;
- bt->jitter = jitter;
- bt->interval = min;
- bt_addjitter(bt);
- srandom(time(0));
- return (bt);
-}
-
-/* Updates the backoff timer. */
-static void
-bt_update(struct backoff_timer *bt)
-{
-
- bt->interval = (time_t)min(bt->interval * bt->backoff, bt->max);
- bt_addjitter(bt);
-}
-
-/* Adds some jitter. */
-static void
-bt_addjitter(struct backoff_timer *bt)
-{
- long mag;
-
- mag = (long)(bt->jitter * bt->interval);
- /* We want a random number between -mag and mag. */
- bt->interval += (time_t)(random() % (2 * mag) - mag);
-}
-
-/* Returns the current timer value. */
-time_t
-bt_get(struct backoff_timer *bt)
-{
-
- return (bt->interval);
-}
-
-/* Times out for bt->interval seconds. */
-void
-bt_pause(struct backoff_timer *bt)
-{
-
- sleep(bt->interval);
- bt_update(bt);
-}
-
-void
-bt_free(struct backoff_timer *bt)
-{
-
- free(bt);
-}
-
-/* Compare two revisions. */
-int
-rcsnum_cmp(char *revision1, char *revision2)
-{
- char *ptr1, *ptr2, *dot1, *dot2;
- int num1len, num2len, ret;
-
- ptr1 = revision1;
- ptr2 = revision2;
- while (*ptr1 != '\0' && *ptr2 != '\0') {
- dot1 = strchr(ptr1, '.');
- dot2 = strchr(ptr2, '.');
- if (dot1 == NULL)
- dot1 = strchr(ptr1, '\0');
- if (dot2 == NULL)
- dot2 = strchr(ptr2, '\0');
-
- num1len = dot1 - ptr1;
- num2len = dot2 - ptr2;
- /* Check the distance between each, showing how many digits */
- if (num1len > num2len)
- return (1);
- else if (num1len < num2len)
- return (-1);
-
- /* Equal distance means we must check each character. */
- ret = strncmp(ptr1, ptr2, num1len);
- if (ret != 0)
- return (ret);
- ptr1 = (*dot1 == '.') ? (dot1 + 1) : dot1;
- ptr2 = (*dot2 == '.') ? (dot2 + 1) : dot2;
- }
-
- if (*ptr1 != '\0' && *ptr2 == '\0')
- return (1);
- if (*ptr1 == '\0' && *ptr2 != '\0')
- return (-1);
- return (0);
-
-}
-
-/* Returns 0 if a rcsrev is not a trunk revision number. */
-int
-rcsrev_istrunk(char *revnum)
-{
- char *tmp;
-
- tmp = strchr(revnum, '.');
- tmp++;
- if (strchr(tmp, '.') != NULL)
- return (0);
- return (1);
-}
-
-/* Return prefix of rcsfile. */
-char *
-rcsrev_prefix(char *revnum)
-{
- char *modrev, *pos;
-
- modrev = xstrdup(revnum);
- pos = strrchr(modrev, '.');
- if (pos == NULL) {
- free(modrev);
- return (NULL);
- }
- *pos = '\0';
- return (modrev);
-}
diff --git a/usr.bin/csup/misc.h b/usr.bin/csup/misc.h
deleted file mode 100644
index b01b77a..0000000
--- a/usr.bin/csup/misc.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*-
- * Copyright (c) 2003-2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#ifndef _MISC_H_
-#define _MISC_H_
-
-#include <sys/types.h>
-
-#ifdef __FreeBSD__
-#include <md5.h>
-#define MD5_DIGEST_LENGTH 16
-#define MD5_Init MD5Init
-#define MD5_Final MD5Final
-#define MD5_Update MD5Update
-#else
-#include <openssl/md5.h>
-#endif
-
-/* If we're not compiling in a C99 environment, define the C99 types. */
-#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901
-
-#ifdef uint32_t
-#undef uint32_t
-#endif
-#define uint32_t u_int32_t
-
-#ifdef uint16_t
-#undef uint16_t
-#endif
-#define uint16_t u_int16_t
-
-#ifdef uint8_t
-#undef uint8_t
-#endif
-#define uint8_t u_int8_t
-
-#else
-#include <stdint.h>
-#endif
-
-/* This is a GCC-specific keyword but some other compilers (namely icc)
- understand it, and the code won't work if we can't disable padding
- anyways. */
-#undef __packed
-#define __packed __attribute__((__packed__))
-
-/* We explicitely don't define this with icc because it defines __GNUC__
- but doesn't support it. */
-#undef __printflike
-#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && \
- (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC__MINOR__ >= 7)
-#define __printflike(fmtarg, firstvararg) \
- __attribute__((__format__ (__printf__, fmtarg, firstvararg)))
-#else
-#define __printflike(fmtarg, firstvararg)
-#endif
-
-/* Exit codes. */
-#define STATUS_SUCCESS 0
-#define STATUS_FAILURE 1
-#define STATUS_TRANSIENTFAILURE 2
-#define STATUS_INTERRUPTED 3
-
-struct config;
-struct stream;
-
-/* Thread parameters. */
-struct thread_args {
- struct config *config;
- struct stream *rd;
- struct stream *wr;
- int status;
- char *errmsg;
-};
-
-/* Minimum size for MD5_File() and MD5_End() buffers. */
-#define MD5_DIGEST_SIZE 33
-
-#define min(a, b) ((a) > (b) ? (b) : (a))
-#define max(a, b) ((a) < (b) ? (b) : (a))
-
-struct backoff_timer;
-struct pattlist;
-struct tm;
-
-int asciitoint(const char *, int *, int);
-int lprintf(int, const char *, ...) __printflike(2, 3);
-int MD5_File(char *, char *);
-void MD5_End(char *, MD5_CTX *);
-int rcsdatetotm(const char *, struct tm *);
-time_t rcsdatetotime(const char *);
-int pathcmp(const char *, const char *);
-size_t commonpathlength(const char *, size_t, const char *, size_t);
-const char *pathlast(const char *);
-int isrcs(const char *, size_t *);
-char *checkoutpath(const char *, const char *);
-char *cvspath(const char *, const char *, int);
-char *atticpath(const char *, const char *);
-char *path_prefix(char *);
-char *path_first(char *);
-int mkdirhier(char *, mode_t);
-char *tempname(const char *);
-void *xmalloc(size_t);
-void *xrealloc(void *, size_t);
-char *xstrdup(const char *);
-int xasprintf(char **, const char *, ...) __printflike(2, 3);
-int rcsnum_cmp(char *, char *);
-int rcsrev_istrunk(char *);
-char *rcsrev_prefix(char *);
-
-struct pattlist *pattlist_new(void);
-void pattlist_add(struct pattlist *, const char *);
-char *pattlist_get(struct pattlist *, size_t);
-size_t pattlist_size(struct pattlist *);
-void pattlist_free(struct pattlist *);
-
-struct backoff_timer *bt_new(time_t, time_t, float, float);
-time_t bt_get(struct backoff_timer *);
-void bt_pause(struct backoff_timer *);
-void bt_free(struct backoff_timer *);
-
-#endif /* !_MISC_H_ */
diff --git a/usr.bin/csup/mux.c b/usr.bin/csup/mux.c
deleted file mode 100644
index 9335fa9..0000000
--- a/usr.bin/csup/mux.c
+++ /dev/null
@@ -1,1202 +0,0 @@
-/*-
- * Copyright (c) 2003-2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/uio.h>
-
-#include <netinet/in.h>
-
-#include <assert.h>
-#include <errno.h>
-#include <pthread.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "misc.h"
-#include "mux.h"
-
-/*
- * Packet types.
- */
-#define MUX_STARTUPREQ 0
-#define MUX_STARTUPREP 1
-#define MUX_CONNECT 2
-#define MUX_ACCEPT 3
-#define MUX_RESET 4
-#define MUX_DATA 5
-#define MUX_WINDOW 6
-#define MUX_CLOSE 7
-
-/*
- * Header sizes.
- */
-#define MUX_STARTUPHDRSZ 3
-#define MUX_CONNECTHDRSZ 8
-#define MUX_ACCEPTHDRSZ 8
-#define MUX_RESETHDRSZ 2
-#define MUX_DATAHDRSZ 4
-#define MUX_WINDOWHDRSZ 6
-#define MUX_CLOSEHDRSZ 2
-
-#define MUX_PROTOVER 0 /* Protocol version. */
-
-struct mux_header {
- uint8_t type;
- union {
- struct {
- uint16_t version;
- } __packed mh_startup;
- struct {
- uint8_t id;
- uint16_t mss;
- uint32_t window;
- } __packed mh_connect;
- struct {
- uint8_t id;
- uint16_t mss;
- uint32_t window;
- } __packed mh_accept;
- struct {
- uint8_t id;
- } __packed mh_reset;
- struct {
- uint8_t id;
- uint16_t len;
- } __packed mh_data;
- struct {
- uint8_t id;
- uint32_t window;
- } __packed mh_window;
- struct {
- uint8_t id;
- } __packed mh_close;
- } mh_u;
-} __packed;
-
-#define mh_startup mh_u.mh_startup
-#define mh_connect mh_u.mh_connect
-#define mh_accept mh_u.mh_accept
-#define mh_reset mh_u.mh_reset
-#define mh_data mh_u.mh_data
-#define mh_window mh_u.mh_window
-#define mh_close mh_u.mh_close
-
-#define MUX_MAXCHAN 2
-
-/* Channel states. */
-#define CS_UNUSED 0
-#define CS_LISTENING 1
-#define CS_CONNECTING 2
-#define CS_ESTABLISHED 3
-#define CS_RDCLOSED 4
-#define CS_WRCLOSED 5
-#define CS_CLOSED 6
-
-/* Channel flags. */
-#define CF_CONNECT 0x01
-#define CF_ACCEPT 0x02
-#define CF_RESET 0x04
-#define CF_WINDOW 0x08
-#define CF_DATA 0x10
-#define CF_CLOSE 0x20
-
-#define CHAN_SBSIZE (16 * 1024) /* Send buffer size. */
-#define CHAN_RBSIZE (16 * 1024) /* Receive buffer size. */
-#define CHAN_MAXSEGSIZE 1024 /* Maximum segment size. */
-
-/* Circular buffer. */
-struct buf {
- uint8_t *data;
- size_t size;
- size_t in;
- size_t out;
-};
-
-struct chan {
- int flags;
- int state;
- pthread_mutex_t lock;
- struct mux *mux;
-
- /* Receiver state variables. */
- struct buf *recvbuf;
- pthread_cond_t rdready;
- uint32_t recvseq;
- uint16_t recvmss;
-
- /* Sender state variables. */
- struct buf *sendbuf;
- pthread_cond_t wrready;
- uint32_t sendseq;
- uint32_t sendwin;
- uint16_t sendmss;
-};
-
-struct mux {
- int closed;
- int status;
- int socket;
- pthread_mutex_t lock;
- pthread_cond_t done;
- struct chan *channels[MUX_MAXCHAN];
- int nchans;
-
- /* Sender thread data. */
- pthread_t sender;
- pthread_cond_t sender_newwork;
- pthread_cond_t sender_started;
- int sender_waiting;
- int sender_ready;
- int sender_lastid;
-
- /* Receiver thread data. */
- pthread_t receiver;
-};
-
-static int sock_writev(int, struct iovec *, int);
-static int sock_write(int, void *, size_t);
-static ssize_t sock_read(int, void *, size_t);
-static int sock_readwait(int, void *, size_t);
-
-static int mux_init(struct mux *);
-static void mux_lock(struct mux *);
-static void mux_unlock(struct mux *);
-
-static struct chan *chan_new(struct mux *);
-static struct chan *chan_get(struct mux *, int);
-static struct chan *chan_connect(struct mux *, int);
-static void chan_lock(struct chan *);
-static void chan_unlock(struct chan *);
-static int chan_insert(struct mux *, struct chan *);
-static void chan_free(struct chan *);
-
-static struct buf *buf_new(size_t);
-static size_t buf_count(struct buf *);
-static size_t buf_avail(struct buf *);
-static void buf_get(struct buf *, void *, size_t);
-static void buf_put(struct buf *, const void *, size_t);
-static void buf_free(struct buf *);
-
-static void sender_wakeup(struct mux *);
-static void *sender_loop(void *);
-static int sender_waitforwork(struct mux *, int *);
-static int sender_scan(struct mux *, int *);
-static void sender_cleanup(void *);
-
-static void *receiver_loop(void *);
-
-static int
-sock_writev(int s, struct iovec *iov, int iovcnt)
-{
- ssize_t nbytes;
-
-again:
- nbytes = writev(s, iov, iovcnt);
- if (nbytes != -1) {
- while (nbytes > 0 && (size_t)nbytes >= iov->iov_len) {
- nbytes -= iov->iov_len;
- iov++;
- iovcnt--;
- }
- if (nbytes == 0)
- return (0);
- iov->iov_len -= nbytes;
- iov->iov_base = (char *)iov->iov_base + nbytes;
- } else if (errno != EINTR) {
- return (-1);
- }
- goto again;
-}
-
-static int
-sock_write(int s, void *buf, size_t size)
-{
- struct iovec iov;
- int ret;
-
- iov.iov_base = buf;
- iov.iov_len = size;
- ret = sock_writev(s, &iov, 1);
- return (ret);
-}
-
-static ssize_t
-sock_read(int s, void *buf, size_t size)
-{
- ssize_t nbytes;
-
-again:
- nbytes = read(s, buf, size);
- if (nbytes == -1 && errno == EINTR)
- goto again;
- return (nbytes);
-}
-
-static int
-sock_readwait(int s, void *buf, size_t size)
-{
- char *cp;
- ssize_t nbytes;
- size_t left;
-
- cp = buf;
- left = size;
- while (left > 0) {
- nbytes = sock_read(s, cp, left);
- if (nbytes == 0) {
- errno = ECONNRESET;
- return (-1);
- }
- if (nbytes < 0)
- return (-1);
- left -= nbytes;
- cp += nbytes;
- }
- return (0);
-}
-
-static void
-mux_lock(struct mux *m)
-{
- int error;
-
- error = pthread_mutex_lock(&m->lock);
- assert(!error);
-}
-
-static void
-mux_unlock(struct mux *m)
-{
- int error;
-
- error = pthread_mutex_unlock(&m->lock);
- assert(!error);
-}
-
-/* Create a TCP multiplexer on the given socket. */
-struct mux *
-mux_open(int sock, struct chan **chan)
-{
- struct mux *m;
- struct chan *chan0;
- int error;
-
- m = xmalloc(sizeof(struct mux));
- memset(m->channels, 0, sizeof(m->channels));
- m->nchans = 0;
- m->closed = 0;
- m->status = -1;
- m->socket = sock;
-
- m->sender_waiting = 0;
- m->sender_lastid = 0;
- m->sender_ready = 0;
- pthread_mutex_init(&m->lock, NULL);
- pthread_cond_init(&m->done, NULL);
- pthread_cond_init(&m->sender_newwork, NULL);
- pthread_cond_init(&m->sender_started, NULL);
-
- error = mux_init(m);
- if (error)
- goto bad;
- chan0 = chan_connect(m, 0);
- if (chan0 == NULL)
- goto bad;
- *chan = chan0;
- return (m);
-bad:
- mux_shutdown(m, NULL, STATUS_FAILURE);
- (void)mux_close(m);
- return (NULL);
-}
-
-int
-mux_close(struct mux *m)
-{
- struct chan *chan;
- int i, status;
-
- assert(m->closed);
- for (i = 0; i < m->nchans; i++) {
- chan = m->channels[i];
- if (chan != NULL)
- chan_free(chan);
- }
- pthread_cond_destroy(&m->sender_started);
- pthread_cond_destroy(&m->sender_newwork);
- pthread_cond_destroy(&m->done);
- pthread_mutex_destroy(&m->lock);
- status = m->status;
- free(m);
- return (status);
-}
-
-/* Close a channel. */
-int
-chan_close(struct chan *chan)
-{
-
- chan_lock(chan);
- if (chan->state == CS_ESTABLISHED) {
- chan->state = CS_WRCLOSED;
- chan->flags |= CF_CLOSE;
- } else if (chan->state == CS_RDCLOSED) {
- chan->state = CS_CLOSED;
- chan->flags |= CF_CLOSE;
- } else if (chan->state == CS_WRCLOSED || chan->state == CS_CLOSED) {
- chan_unlock(chan);
- return (0);
- } else {
- chan_unlock(chan);
- return (-1);
- }
- chan_unlock(chan);
- sender_wakeup(chan->mux);
- return (0);
-}
-
-void
-chan_wait(struct chan *chan)
-{
-
- chan_lock(chan);
- while (chan->state != CS_CLOSED)
- pthread_cond_wait(&chan->rdready, &chan->lock);
- chan_unlock(chan);
-}
-
-/* Returns the ID of an available channel in the listening state. */
-int
-chan_listen(struct mux *m)
-{
- struct chan *chan;
- int i;
-
- mux_lock(m);
- for (i = 0; i < m->nchans; i++) {
- chan = m->channels[i];
- chan_lock(chan);
- if (chan->state == CS_UNUSED) {
- mux_unlock(m);
- chan->state = CS_LISTENING;
- chan_unlock(chan);
- return (i);
- }
- chan_unlock(chan);
- }
- mux_unlock(m);
- chan = chan_new(m);
- chan->state = CS_LISTENING;
- i = chan_insert(m, chan);
- if (i == -1)
- chan_free(chan);
- return (i);
-}
-
-struct chan *
-chan_accept(struct mux *m, int id)
-{
- struct chan *chan;
-
- chan = chan_get(m, id);
- while (chan->state == CS_LISTENING)
- pthread_cond_wait(&chan->rdready, &chan->lock);
- if (chan->state != CS_ESTABLISHED) {
- errno = ECONNRESET;
- chan_unlock(chan);
- return (NULL);
- }
- chan_unlock(chan);
- return (chan);
-}
-
-/* Read bytes from a channel. */
-ssize_t
-chan_read(struct chan *chan, void *buf, size_t size)
-{
- char *cp;
- size_t count, n;
-
- cp = buf;
- chan_lock(chan);
- for (;;) {
- if (chan->state == CS_RDCLOSED || chan->state == CS_CLOSED) {
- chan_unlock(chan);
- return (0);
- }
- if (chan->state != CS_ESTABLISHED &&
- chan->state != CS_WRCLOSED) {
- chan_unlock(chan);
- errno = EBADF;
- return (-1);
- }
- count = buf_count(chan->recvbuf);
- if (count > 0)
- break;
- pthread_cond_wait(&chan->rdready, &chan->lock);
- }
- n = min(count, size);
- buf_get(chan->recvbuf, cp, n);
- chan->recvseq += n;
- chan->flags |= CF_WINDOW;
- chan_unlock(chan);
- /* We need to wake up the sender so that it sends a window update. */
- sender_wakeup(chan->mux);
- return (n);
-}
-
-/* Write bytes to a channel. */
-ssize_t
-chan_write(struct chan *chan, const void *buf, size_t size)
-{
- const char *cp;
- size_t avail, n, pos;
-
- pos = 0;
- cp = buf;
- chan_lock(chan);
- while (pos < size) {
- for (;;) {
- if (chan->state != CS_ESTABLISHED &&
- chan->state != CS_RDCLOSED) {
- chan_unlock(chan);
- errno = EPIPE;
- return (-1);
- }
- avail = buf_avail(chan->sendbuf);
- if (avail > 0)
- break;
- pthread_cond_wait(&chan->wrready, &chan->lock);
- }
- n = min(avail, size - pos);
- buf_put(chan->sendbuf, cp + pos, n);
- pos += n;
- }
- chan_unlock(chan);
- sender_wakeup(chan->mux);
- return (size);
-}
-
-/*
- * Internal channel API.
- */
-
-static struct chan *
-chan_connect(struct mux *m, int id)
-{
- struct chan *chan;
-
- chan = chan_get(m, id);
- if (chan->state != CS_UNUSED) {
- chan_unlock(chan);
- return (NULL);
- }
- chan->state = CS_CONNECTING;
- chan->flags |= CF_CONNECT;
- chan_unlock(chan);
- sender_wakeup(m);
- chan_lock(chan);
- while (chan->state == CS_CONNECTING)
- pthread_cond_wait(&chan->wrready, &chan->lock);
- if (chan->state != CS_ESTABLISHED) {
- chan_unlock(chan);
- return (NULL);
- }
- chan_unlock(chan);
- return (chan);
-}
-
-/*
- * Get a channel from its ID, creating it if necessary.
- * The channel is returned locked.
- */
-static struct chan *
-chan_get(struct mux *m, int id)
-{
- struct chan *chan;
-
- assert(id < MUX_MAXCHAN);
- mux_lock(m);
- chan = m->channels[id];
- if (chan == NULL) {
- chan = chan_new(m);
- m->channels[id] = chan;
- m->nchans++;
- }
- chan_lock(chan);
- mux_unlock(m);
- return (chan);
-}
-
-/* Lock a channel. */
-static void
-chan_lock(struct chan *chan)
-{
- int error;
-
- error = pthread_mutex_lock(&chan->lock);
- assert(!error);
-}
-
-/* Unlock a channel. */
-static void
-chan_unlock(struct chan *chan)
-{
- int error;
-
- error = pthread_mutex_unlock(&chan->lock);
- assert(!error);
-}
-
-/*
- * Create a new channel.
- */
-static struct chan *
-chan_new(struct mux *m)
-{
- struct chan *chan;
-
- chan = xmalloc(sizeof(struct chan));
- chan->state = CS_UNUSED;
- chan->flags = 0;
- chan->mux = m;
- chan->sendbuf = buf_new(CHAN_SBSIZE);
- chan->sendseq = 0;
- chan->sendwin = 0;
- chan->sendmss = 0;
- chan->recvbuf = buf_new(CHAN_RBSIZE);
- chan->recvseq = 0;
- chan->recvmss = CHAN_MAXSEGSIZE;
- pthread_mutex_init(&chan->lock, NULL);
- pthread_cond_init(&chan->rdready, NULL);
- pthread_cond_init(&chan->wrready, NULL);
- return (chan);
-}
-
-/* Free any resources associated with a channel. */
-static void
-chan_free(struct chan *chan)
-{
-
- pthread_cond_destroy(&chan->rdready);
- pthread_cond_destroy(&chan->wrready);
- pthread_mutex_destroy(&chan->lock);
- buf_free(chan->recvbuf);
- buf_free(chan->sendbuf);
- free(chan);
-}
-
-/* Insert the new channel in the channel list. */
-static int
-chan_insert(struct mux *m, struct chan *chan)
-{
- int i;
-
- mux_lock(m);
- for (i = 0; i < MUX_MAXCHAN; i++) {
- if (m->channels[i] == NULL) {
- m->channels[i] = chan;
- m->nchans++;
- mux_unlock(m);
- return (i);
- }
- }
- errno = ENOBUFS;
- return (-1);
-}
-
-/*
- * Initialize the multiplexer protocol.
- *
- * This means negotiating protocol version and starting
- * the receiver and sender threads.
- */
-static int
-mux_init(struct mux *m)
-{
- struct mux_header mh;
- int error;
-
- mh.type = MUX_STARTUPREQ;
- mh.mh_startup.version = htons(MUX_PROTOVER);
- error = sock_write(m->socket, &mh, MUX_STARTUPHDRSZ);
- if (error)
- return (-1);
- error = sock_readwait(m->socket, &mh, MUX_STARTUPHDRSZ);
- if (error)
- return (-1);
- if (mh.type != MUX_STARTUPREP ||
- ntohs(mh.mh_startup.version) != MUX_PROTOVER)
- return (-1);
- mux_lock(m);
- error = pthread_create(&m->sender, NULL, sender_loop, m);
- if (error) {
- mux_unlock(m);
- return (-1);
- }
- /*
- * Make sure the sender thread has run and is waiting for new work
- * before going on. Otherwise, it might lose the race and a
- * request, which will cause a deadlock.
- */
- while (!m->sender_ready)
- pthread_cond_wait(&m->sender_started, &m->lock);
-
- mux_unlock(m);
- error = pthread_create(&m->receiver, NULL, receiver_loop, m);
- if (error)
- return (-1);
- return (0);
-}
-
-/*
- * Close all the channels, terminate the sender and receiver thread.
- * This is an important function because it is used every time we need
- * to wake up all the worker threads to abort the program.
- *
- * This function accepts an error message that will be printed if the
- * multiplexer wasn't already closed. This is useful because it ensures
- * that only the first error message will be printed, and that it will
- * be printed before doing the actual shutdown work. If this is a
- * normal shutdown, NULL can be passed instead.
- *
- * The "status" parameter of the first mux_shutdown() call is retained
- * and then returned by mux_close(), so that the main thread can know
- * what type of error happened in the end, if any.
- */
-void
-mux_shutdown(struct mux *m, const char *errmsg, int status)
-{
- pthread_t self, sender, receiver;
- struct chan *chan;
- const char *name;
- void *val;
- int i, ret;
-
- mux_lock(m);
- if (m->closed) {
- mux_unlock(m);
- return;
- }
- m->closed = 1;
- m->status = status;
- self = pthread_self();
- sender = m->sender;
- receiver = m->receiver;
- if (errmsg != NULL) {
- if (pthread_equal(self, receiver))
- name = "Receiver";
- else if (pthread_equal(self, sender))
- name = "Sender";
- else
- name = NULL;
- if (name == NULL)
- lprintf(-1, "%s\n", errmsg);
- else
- lprintf(-1, "%s: %s\n", name, errmsg);
- }
-
- for (i = 0; i < MUX_MAXCHAN; i++) {
- if (m->channels[i] != NULL) {
- chan = m->channels[i];
- chan_lock(chan);
- if (chan->state != CS_UNUSED) {
- chan->state = CS_CLOSED;
- chan->flags = 0;
- pthread_cond_broadcast(&chan->rdready);
- pthread_cond_broadcast(&chan->wrready);
- }
- chan_unlock(chan);
- }
- }
- mux_unlock(m);
-
- if (!pthread_equal(self, receiver)) {
- ret = pthread_cancel(receiver);
- assert(!ret);
- pthread_join(receiver, &val);
- assert(val == PTHREAD_CANCELED);
- }
- if (!pthread_equal(self, sender)) {
- ret = pthread_cancel(sender);
- assert(!ret);
- pthread_join(sender, &val);
- assert(val == PTHREAD_CANCELED);
- }
-}
-
-static void
-sender_wakeup(struct mux *m)
-{
- int waiting;
-
- mux_lock(m);
- waiting = m->sender_waiting;
- mux_unlock(m);
- /*
- * We don't care about the race here: if the sender was
- * waiting and is not anymore, we'll just send a useless
- * signal; if he wasn't waiting then he won't go to sleep
- * before having sent what we want him to.
- */
- if (waiting)
- pthread_cond_signal(&m->sender_newwork);
-}
-
-static void *
-sender_loop(void *arg)
-{
- struct iovec iov[3];
- struct mux_header mh;
- struct mux *m;
- struct chan *chan;
- struct buf *buf;
- uint32_t winsize;
- uint16_t hdrsize, size, len;
- int error, id, iovcnt, what = 0;
-
- m = (struct mux *)arg;
- what = 0;
-again:
- id = sender_waitforwork(m, &what);
- chan = chan_get(m, id);
- hdrsize = size = 0;
- switch (what) {
- case CF_CONNECT:
- mh.type = MUX_CONNECT;
- mh.mh_connect.id = id;
- mh.mh_connect.mss = htons(chan->recvmss);
- mh.mh_connect.window = htonl(chan->recvseq +
- chan->recvbuf->size);
- hdrsize = MUX_CONNECTHDRSZ;
- break;
- case CF_ACCEPT:
- mh.type = MUX_ACCEPT;
- mh.mh_accept.id = id;
- mh.mh_accept.mss = htons(chan->recvmss);
- mh.mh_accept.window = htonl(chan->recvseq +
- chan->recvbuf->size);
- hdrsize = MUX_ACCEPTHDRSZ;
- break;
- case CF_RESET:
- mh.type = MUX_RESET;
- mh.mh_reset.id = id;
- hdrsize = MUX_RESETHDRSZ;
- break;
- case CF_WINDOW:
- mh.type = MUX_WINDOW;
- mh.mh_window.id = id;
- mh.mh_window.window = htonl(chan->recvseq +
- chan->recvbuf->size);
- hdrsize = MUX_WINDOWHDRSZ;
- break;
- case CF_DATA:
- mh.type = MUX_DATA;
- mh.mh_data.id = id;
- size = min(buf_count(chan->sendbuf), chan->sendmss);
- winsize = chan->sendwin - chan->sendseq;
- if (winsize < size)
- size = winsize;
- mh.mh_data.len = htons(size);
- hdrsize = MUX_DATAHDRSZ;
- break;
- case CF_CLOSE:
- mh.type = MUX_CLOSE;
- mh.mh_close.id = id;
- hdrsize = MUX_CLOSEHDRSZ;
- break;
- }
- if (size > 0) {
- assert(mh.type == MUX_DATA);
- /*
- * Older FreeBSD versions (and maybe other OSes) have the
- * iov_base field defined as char *. Cast to char * to
- * silence a warning in this case.
- */
- iov[0].iov_base = (char *)&mh;
- iov[0].iov_len = hdrsize;
- iovcnt = 1;
- /* We access the buffer directly to avoid some copying. */
- buf = chan->sendbuf;
- len = min(size, buf->size + 1 - buf->out);
- iov[iovcnt].iov_base = buf->data + buf->out;
- iov[iovcnt].iov_len = len;
- iovcnt++;
- if (size > len) {
- /* Wrapping around. */
- iov[iovcnt].iov_base = buf->data;
- iov[iovcnt].iov_len = size - len;
- iovcnt++;
- }
- /*
- * Since we're the only thread sending bytes from the
- * buffer and modifying buf->out, it's safe to unlock
- * here during I/O. It avoids keeping the channel lock
- * too long, since write() might block.
- */
- chan_unlock(chan);
- error = sock_writev(m->socket, iov, iovcnt);
- if (error)
- goto bad;
- chan_lock(chan);
- chan->sendseq += size;
- buf->out += size;
- if (buf->out > buf->size)
- buf->out -= buf->size + 1;
- pthread_cond_signal(&chan->wrready);
- chan_unlock(chan);
- } else {
- chan_unlock(chan);
- error = sock_write(m->socket, &mh, hdrsize);
- if (error)
- goto bad;
- }
- goto again;
-bad:
- if (error == EPIPE)
- mux_shutdown(m, strerror(errno), STATUS_TRANSIENTFAILURE);
- else
- mux_shutdown(m, strerror(errno), STATUS_FAILURE);
- return (NULL);
-}
-
-static void
-sender_cleanup(void *arg)
-{
- struct mux *m;
-
- m = (struct mux *)arg;
- mux_unlock(m);
-}
-
-static int
-sender_waitforwork(struct mux *m, int *what)
-{
- int id;
-
- mux_lock(m);
- pthread_cleanup_push(sender_cleanup, m);
- if (!m->sender_ready) {
- pthread_cond_signal(&m->sender_started);
- m->sender_ready = 1;
- }
- while ((id = sender_scan(m, what)) == -1) {
- m->sender_waiting = 1;
- pthread_cond_wait(&m->sender_newwork, &m->lock);
- }
- m->sender_waiting = 0;
- pthread_cleanup_pop(1);
- return (id);
-}
-
-/*
- * Scan for work to do for the sender. Has to be called with
- * the multiplexer lock held.
- */
-static int
-sender_scan(struct mux *m, int *what)
-{
- struct chan *chan;
- int id;
-
- if (m->nchans <= 0)
- return (-1);
- id = m->sender_lastid;
- do {
- id++;
- if (id >= m->nchans)
- id = 0;
- chan = m->channels[id];
- chan_lock(chan);
- if (chan->state != CS_UNUSED) {
- if (chan->sendseq != chan->sendwin &&
- buf_count(chan->sendbuf) > 0)
- chan->flags |= CF_DATA;
- if (chan->flags) {
- /* By order of importance. */
- if (chan->flags & CF_CONNECT)
- *what = CF_CONNECT;
- else if (chan->flags & CF_ACCEPT)
- *what = CF_ACCEPT;
- else if (chan->flags & CF_RESET)
- *what = CF_RESET;
- else if (chan->flags & CF_WINDOW)
- *what = CF_WINDOW;
- else if (chan->flags & CF_DATA)
- *what = CF_DATA;
- else if (chan->flags & CF_CLOSE)
- *what = CF_CLOSE;
- chan->flags &= ~*what;
- chan_unlock(chan);
- m->sender_lastid = id;
- return (id);
- }
- }
- chan_unlock(chan);
- } while (id != m->sender_lastid);
- return (-1);
-}
-
-/* Read the rest of a packet header depending on its type. */
-#define SOCK_READREST(s, mh, hsize) \
- sock_readwait(s, (char *)&mh + sizeof(mh.type), (hsize) - sizeof(mh.type))
-
-void *
-receiver_loop(void *arg)
-{
- struct mux_header mh;
- struct mux *m;
- struct chan *chan;
- struct buf *buf;
- uint16_t size, len;
- int error;
-
- m = (struct mux *)arg;
- while ((error = sock_readwait(m->socket, &mh.type,
- sizeof(mh.type))) == 0) {
- switch (mh.type) {
- case MUX_CONNECT:
- error = SOCK_READREST(m->socket, mh, MUX_CONNECTHDRSZ);
- if (error)
- goto bad;
- chan = chan_get(m, mh.mh_connect.id);
- if (chan->state == CS_LISTENING) {
- chan->state = CS_ESTABLISHED;
- chan->sendmss = ntohs(mh.mh_connect.mss);
- chan->sendwin = ntohl(mh.mh_connect.window);
- chan->flags |= CF_ACCEPT;
- pthread_cond_signal(&chan->rdready);
- } else
- chan->flags |= CF_RESET;
- chan_unlock(chan);
- sender_wakeup(m);
- break;
- case MUX_ACCEPT:
- error = SOCK_READREST(m->socket, mh, MUX_ACCEPTHDRSZ);
- if (error)
- goto bad;
- chan = chan_get(m, mh.mh_accept.id);
- if (chan->state == CS_CONNECTING) {
- chan->sendmss = ntohs(mh.mh_accept.mss);
- chan->sendwin = ntohl(mh.mh_accept.window);
- chan->state = CS_ESTABLISHED;
- pthread_cond_signal(&chan->wrready);
- chan_unlock(chan);
- } else {
- chan->flags |= CF_RESET;
- chan_unlock(chan);
- sender_wakeup(m);
- }
- break;
- case MUX_RESET:
- error = SOCK_READREST(m->socket, mh, MUX_RESETHDRSZ);
- if (error)
- goto bad;
- goto badproto;
- case MUX_WINDOW:
- error = SOCK_READREST(m->socket, mh, MUX_WINDOWHDRSZ);
- if (error)
- goto bad;
- chan = chan_get(m, mh.mh_window.id);
- if (chan->state == CS_ESTABLISHED ||
- chan->state == CS_RDCLOSED) {
- chan->sendwin = ntohl(mh.mh_window.window);
- chan_unlock(chan);
- sender_wakeup(m);
- } else {
- chan_unlock(chan);
- }
- break;
- case MUX_DATA:
- error = SOCK_READREST(m->socket, mh, MUX_DATAHDRSZ);
- if (error)
- goto bad;
- chan = chan_get(m, mh.mh_data.id);
- len = ntohs(mh.mh_data.len);
- buf = chan->recvbuf;
- if ((chan->state != CS_ESTABLISHED &&
- chan->state != CS_WRCLOSED) ||
- (len > buf_avail(buf) ||
- len > chan->recvmss)) {
- chan_unlock(chan);
- goto badproto;
- return (NULL);
- }
- /*
- * Similarly to the sender code, it's safe to
- * unlock the channel here.
- */
- chan_unlock(chan);
- size = min(buf->size + 1 - buf->in, len);
- error = sock_readwait(m->socket,
- buf->data + buf->in, size);
- if (error)
- goto bad;
- if (len > size) {
- /* Wrapping around. */
- error = sock_readwait(m->socket,
- buf->data, len - size);
- if (error)
- goto bad;
- }
- chan_lock(chan);
- buf->in += len;
- if (buf->in > buf->size)
- buf->in -= buf->size + 1;
- pthread_cond_signal(&chan->rdready);
- chan_unlock(chan);
- break;
- case MUX_CLOSE:
- error = SOCK_READREST(m->socket, mh, MUX_CLOSEHDRSZ);
- if (error)
- goto bad;
- chan = chan_get(m, mh.mh_close.id);
- if (chan->state == CS_ESTABLISHED)
- chan->state = CS_RDCLOSED;
- else if (chan->state == CS_WRCLOSED)
- chan->state = CS_CLOSED;
- else
- goto badproto;
- pthread_cond_signal(&chan->rdready);
- chan_unlock(chan);
- break;
- default:
- goto badproto;
- }
- }
-bad:
- if (errno == ECONNRESET || errno == ECONNABORTED)
- mux_shutdown(m, strerror(errno), STATUS_TRANSIENTFAILURE);
- else
- mux_shutdown(m, strerror(errno), STATUS_FAILURE);
- return (NULL);
-badproto:
- mux_shutdown(m, "Protocol error", STATUS_FAILURE);
- return (NULL);
-}
-
-/*
- * Circular buffers API.
- */
-
-static struct buf *
-buf_new(size_t size)
-{
- struct buf *buf;
-
- buf = xmalloc(sizeof(struct buf));
- buf->data = xmalloc(size + 1);
- buf->size = size;
- buf->in = 0;
- buf->out = 0;
- return (buf);
-}
-
-static void
-buf_free(struct buf *buf)
-{
-
- free(buf->data);
- free(buf);
-}
-
-/* Number of bytes stored in the buffer. */
-static size_t
-buf_count(struct buf *buf)
-{
- size_t count;
-
- if (buf->in >= buf->out)
- count = buf->in - buf->out;
- else
- count = buf->size + 1 + buf->in - buf->out;
- return (count);
-}
-
-/* Number of bytes available in the buffer. */
-static size_t
-buf_avail(struct buf *buf)
-{
- size_t avail;
-
- if (buf->out > buf->in)
- avail = buf->out - buf->in - 1;
- else
- avail = buf->size + buf->out - buf->in;
- return (avail);
-}
-
-static void
-buf_put(struct buf *buf, const void *data, size_t size)
-{
- const char *cp;
- size_t len;
-
- assert(size > 0);
- assert(buf_avail(buf) >= size);
- cp = data;
- len = buf->size + 1 - buf->in;
- if (len < size) {
- /* Wrapping around. */
- memcpy(buf->data + buf->in, cp, len);
- memcpy(buf->data, cp + len, size - len);
- } else {
- /* Not wrapping around. */
- memcpy(buf->data + buf->in, cp, size);
- }
- buf->in += size;
- if (buf->in > buf->size)
- buf->in -= buf->size + 1;
-}
-
-static void
-buf_get(struct buf *buf, void *data, size_t size)
-{
- char *cp;
- size_t len;
-
- assert(size > 0);
- assert(buf_count(buf) >= size);
- cp = data;
- len = buf->size + 1 - buf->out;
- if (len < size) {
- /* Wrapping around. */
- memcpy(cp, buf->data + buf->out, len);
- memcpy(cp + len, buf->data, size - len);
- } else {
- /* Not wrapping around. */
- memcpy(cp, buf->data + buf->out, size);
- }
- buf->out += size;
- if (buf->out > buf->size)
- buf->out -= buf->size + 1;
-}
diff --git a/usr.bin/csup/mux.h b/usr.bin/csup/mux.h
deleted file mode 100644
index ff36083..0000000
--- a/usr.bin/csup/mux.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*-
- * Copyright (c) 2003-2004, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#ifndef _MUX_H_
-#define _MUX_H_
-
-struct mux;
-struct chan;
-
-struct mux *mux_open(int, struct chan **);
-void mux_shutdown(struct mux *, const char *, int);
-int mux_close(struct mux *);
-
-void chan_wait(struct chan *);
-int chan_listen(struct mux *);
-struct chan *chan_accept(struct mux *, int);
-ssize_t chan_read(struct chan *, void *, size_t);
-ssize_t chan_write(struct chan *, const void *, size_t);
-int chan_close(struct chan *);
-
-#endif /* !_MUX_H_ */
diff --git a/usr.bin/csup/pathcomp.c b/usr.bin/csup/pathcomp.c
deleted file mode 100644
index 380d042..0000000
--- a/usr.bin/csup/pathcomp.c
+++ /dev/null
@@ -1,182 +0,0 @@
-/*-
- * Copyright (c) 2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "misc.h"
-#include "pathcomp.h"
-
-struct pathcomp {
- char *target;
- size_t targetlen;
- char *trashed;
- char *prev;
- size_t prevlen;
- size_t goal;
- size_t curlen;
-};
-
-struct pathcomp *
-pathcomp_new(void)
-{
- struct pathcomp *pc;
-
- pc = xmalloc(sizeof(struct pathcomp));
- pc->curlen = 0;
- pc->target = NULL;
- pc->targetlen = 0;
- pc->trashed = NULL;
- pc->prev = NULL;
- pc->prevlen = 0;
- return (pc);
-}
-
-int
-pathcomp_put(struct pathcomp *pc, int type, char *path)
-{
- char *cp;
-
- assert(pc->target == NULL);
- if (*path == '/')
- return (-1);
-
- switch (type) {
- case PC_DIRDOWN:
- pc->target = path;
- pc->targetlen = strlen(path);
- break;
- case PC_FILE:
- case PC_DIRUP:
- cp = strrchr(path, '/');
- pc->target = path;
- if (cp != NULL)
- pc->targetlen = cp - path;
- else
- pc->targetlen = 0;
- break;
- }
- if (pc->prev != NULL)
- pc->goal = commonpathlength(pc->prev, pc->prevlen, pc->target,
- pc->targetlen);
- else
- pc->goal = 0;
- if (pc->curlen == pc->goal) /* No need to go up. */
- pc->goal = pc->targetlen;
- return (0);
-}
-
-int
-pathcomp_get(struct pathcomp *pc, int *type, char **name)
-{
- char *cp;
- size_t slashpos, start;
-
- if (pc->curlen > pc->goal) { /* Going up. */
- assert(pc->prev != NULL);
- pc->prev[pc->curlen] = '\0';
- cp = pc->prev + pc->curlen - 1;
- while (cp >= pc->prev) {
- if (*cp == '/')
- break;
- cp--;
- }
- if (cp >= pc->prev)
- slashpos = cp - pc->prev;
- else
- slashpos = 0;
- pc->curlen = slashpos;
- if (pc->curlen <= pc->goal) { /* Done going up. */
- assert(pc->curlen == pc->goal);
- pc->goal = pc->targetlen;
- }
- *type = PC_DIRUP;
- *name = pc->prev;
- return (1);
- } else if (pc->curlen < pc->goal) { /* Going down. */
- /* Restore the previously overwritten '/' character. */
- if (pc->trashed != NULL) {
- *pc->trashed = '/';
- pc->trashed = NULL;
- }
- if (pc->curlen == 0)
- start = pc->curlen;
- else
- start = pc->curlen + 1;
- slashpos = start;
- while (slashpos < pc->goal) {
- if (pc->target[slashpos] == '/')
- break;
- slashpos++;
- }
- if (pc->target[slashpos] != '\0') {
- assert(pc->target[slashpos] == '/');
- pc->trashed = pc->target + slashpos;
- pc->target[slashpos] = '\0';
- }
- pc->curlen = slashpos;
- *type = PC_DIRDOWN;
- *name = pc->target;
- return (1);
- } else { /* Done. */
- if (pc->target != NULL) {
- if (pc->trashed != NULL) {
- *pc->trashed = '/';
- pc->trashed = NULL;
- }
- if (pc->prev != NULL)
- free(pc->prev);
- pc->prev = xmalloc(pc->targetlen + 1);
- memcpy(pc->prev, pc->target, pc->targetlen);
- pc->prev[pc->targetlen] = '\0';
- pc->prevlen = pc->targetlen;
- pc->target = NULL;
- pc->targetlen = 0;
- }
- return (0);
- }
-}
-
-void
-pathcomp_finish(struct pathcomp *pc)
-{
-
- pc->target = NULL;
- pc->targetlen = 0;
- pc->goal = 0;
-}
-
-void
-pathcomp_free(struct pathcomp *pc)
-{
-
- if (pc->prev != NULL)
- free(pc->prev);
- free(pc);
-}
diff --git a/usr.bin/csup/proto.c b/usr.bin/csup/proto.c
deleted file mode 100644
index 3b578e5..0000000
--- a/usr.bin/csup/proto.c
+++ /dev/null
@@ -1,1006 +0,0 @@
-/*-
- * Copyright (c) 2003-2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <sys/param.h>
-#include <sys/select.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/queue.h>
-
-#include <assert.h>
-#include <err.h>
-#include <errno.h>
-#include <inttypes.h>
-#include <netdb.h>
-#include <pthread.h>
-#include <signal.h>
-#include <stdarg.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "auth.h"
-#include "config.h"
-#include "detailer.h"
-#include "fattr.h"
-#include "fixups.h"
-#include "globtree.h"
-#include "keyword.h"
-#include "lister.h"
-#include "misc.h"
-#include "mux.h"
-#include "proto.h"
-#include "stream.h"
-#include "threads.h"
-#include "updater.h"
-
-struct killer {
- pthread_t thread;
- sigset_t sigset;
- struct mux *mux;
- int killedby;
-};
-
-static void killer_start(struct killer *, struct mux *);
-static void *killer_run(void *);
-static void killer_stop(struct killer *);
-
-static int proto_waitconnect(int);
-static int proto_greet(struct config *);
-static int proto_negproto(struct config *);
-static int proto_fileattr(struct config *);
-static int proto_xchgcoll(struct config *);
-static struct mux *proto_mux(struct config *);
-
-static int proto_escape(struct stream *, const char *);
-static void proto_unescape(char *);
-
-static int
-proto_waitconnect(int s)
-{
- fd_set readfd;
- socklen_t len;
- int error, rv, soerror;
-
- FD_ZERO(&readfd);
- FD_SET(s, &readfd);
-
- do {
- rv = select(s + 1, &readfd, NULL, NULL, NULL);
- } while (rv == -1 && errno == EINTR);
- if (rv == -1)
- return (-1);
- /* Check that the connection was really successful. */
- len = sizeof(soerror);
- error = getsockopt(s, SOL_SOCKET, SO_ERROR, &soerror, &len);
- if (error) {
- /* We have no choice but faking an error here. */
- errno = ECONNREFUSED;
- return (-1);
- }
- if (soerror) {
- errno = soerror;
- return (-1);
- }
- return (0);
-}
-
-/* Connect to the CVSup server. */
-int
-proto_connect(struct config *config, int family, uint16_t port)
-{
- char addrbuf[NI_MAXHOST];
- /* Enough to hold sizeof("cvsup") or any port number. */
- char servname[8];
- struct addrinfo *res, *ai, hints;
- int error, opt, s;
-
- s = -1;
- if (port != 0)
- snprintf(servname, sizeof(servname), "%d", port);
- else {
- strncpy(servname, "cvsup", sizeof(servname) - 1);
- servname[sizeof(servname) - 1] = '\0';
- }
- memset(&hints, 0, sizeof(hints));
- hints.ai_family = family;
- hints.ai_socktype = SOCK_STREAM;
- error = getaddrinfo(config->host, servname, &hints, &res);
- /*
- * Try with the hardcoded port number for OSes that don't
- * have cvsup defined in the /etc/services file.
- */
- if (error == EAI_SERVICE) {
- strncpy(servname, "5999", sizeof(servname) - 1);
- servname[sizeof(servname) - 1] = '\0';
- error = getaddrinfo(config->host, servname, &hints, &res);
- }
- if (error) {
- lprintf(0, "Name lookup failure for \"%s\": %s\n", config->host,
- gai_strerror(error));
- return (STATUS_TRANSIENTFAILURE);
- }
- for (ai = res; ai != NULL; ai = ai->ai_next) {
- s = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
- if (s != -1) {
- error = 0;
- if (config->laddr != NULL) {
- opt = 1;
- (void)setsockopt(s, SOL_SOCKET, SO_REUSEADDR,
- &opt, sizeof(opt));
- error = bind(s, config->laddr,
- config->laddrlen);
- }
- if (!error) {
- error = connect(s, ai->ai_addr, ai->ai_addrlen);
- if (error && errno == EINTR)
- error = proto_waitconnect(s);
- }
- if (error)
- close(s);
- }
- (void)getnameinfo(ai->ai_addr, ai->ai_addrlen, addrbuf,
- sizeof(addrbuf), NULL, 0, NI_NUMERICHOST);
- if (s == -1 || error) {
- lprintf(0, "Cannot connect to %s: %s\n", addrbuf,
- strerror(errno));
- continue;
- }
- lprintf(1, "Connected to %s\n", addrbuf);
- freeaddrinfo(res);
- config->socket = s;
- return (STATUS_SUCCESS);
- }
- freeaddrinfo(res);
- return (STATUS_TRANSIENTFAILURE);
-}
-
-/* Greet the server. */
-static int
-proto_greet(struct config *config)
-{
- char *line, *cmd, *msg, *swver;
- struct stream *s;
-
- s = config->server;
- line = stream_getln(s, NULL);
- cmd = proto_get_ascii(&line);
- if (cmd == NULL)
- goto bad;
- if (strcmp(cmd, "OK") == 0) {
- (void)proto_get_ascii(&line); /* major number */
- (void)proto_get_ascii(&line); /* minor number */
- swver = proto_get_ascii(&line);
- } else if (strcmp(cmd, "!") == 0) {
- msg = proto_get_rest(&line);
- if (msg == NULL)
- goto bad;
- lprintf(-1, "Rejected by server: %s\n", msg);
- return (STATUS_TRANSIENTFAILURE);
- } else
- goto bad;
- lprintf(2, "Server software version: %s\n",
- swver != NULL ? swver : ".");
- return (STATUS_SUCCESS);
-bad:
- lprintf(-1, "Invalid greeting from server\n");
- return (STATUS_FAILURE);
-}
-
-/* Negotiate protocol version with the server. */
-static int
-proto_negproto(struct config *config)
-{
- struct stream *s;
- char *cmd, *line, *msg;
- int error, maj, min;
-
- s = config->server;
- proto_printf(s, "PROTO %d %d %s\n", PROTO_MAJ, PROTO_MIN, PROTO_SWVER);
- stream_flush(s);
- line = stream_getln(s, NULL);
- cmd = proto_get_ascii(&line);
- if (cmd == NULL || line == NULL)
- goto bad;
- if (strcmp(cmd, "!") == 0) {
- msg = proto_get_rest(&line);
- lprintf(-1, "Protocol negotiation failed: %s\n", msg);
- return (1);
- } else if (strcmp(cmd, "PROTO") != 0)
- goto bad;
- error = proto_get_int(&line, &maj, 10);
- if (!error)
- error = proto_get_int(&line, &min, 10);
- if (error)
- goto bad;
- if (maj != PROTO_MAJ || min != PROTO_MIN) {
- lprintf(-1, "Server protocol version %d.%d not supported "
- "by client\n", maj, min);
- return (STATUS_FAILURE);
- }
- return (STATUS_SUCCESS);
-bad:
- lprintf(-1, "Invalid PROTO command from server\n");
- return (STATUS_FAILURE);
-}
-
-/*
- * File attribute support negotiation.
- */
-static int
-proto_fileattr(struct config *config)
-{
- fattr_support_t support;
- struct stream *s;
- char *line, *cmd;
- int error, i, n, attr;
-
- s = config->server;
- lprintf(2, "Negotiating file attribute support\n");
- proto_printf(s, "ATTR %d\n", FT_NUMBER);
- for (i = 0; i < FT_NUMBER; i++)
- proto_printf(s, "%x\n", fattr_supported(i));
- proto_printf(s, ".\n");
- stream_flush(s);
- line = stream_getln(s, NULL);
- if (line == NULL)
- goto bad;
- cmd = proto_get_ascii(&line);
- error = proto_get_int(&line, &n, 10);
- if (error || line != NULL || strcmp(cmd, "ATTR") != 0 || n > FT_NUMBER)
- goto bad;
- for (i = 0; i < n; i++) {
- line = stream_getln(s, NULL);
- if (line == NULL)
- goto bad;
- error = proto_get_int(&line, &attr, 16);
- if (error)
- goto bad;
- support[i] = fattr_supported(i) & attr;
- }
- for (i = n; i < FT_NUMBER; i++)
- support[i] = 0;
- line = stream_getln(s, NULL);
- if (line == NULL || strcmp(line, ".") != 0)
- goto bad;
- memcpy(config->fasupport, support, sizeof(config->fasupport));
- return (STATUS_SUCCESS);
-bad:
- lprintf(-1, "Protocol error negotiating attribute support\n");
- return (STATUS_FAILURE);
-}
-
-/*
- * Exchange collection information.
- */
-static int
-proto_xchgcoll(struct config *config)
-{
- struct coll *coll;
- struct stream *s;
- struct globtree *diraccept, *dirrefuse;
- struct globtree *fileaccept, *filerefuse;
- char *line, *cmd, *collname, *pat;
- char *msg, *release, *ident, *rcskey, *prefix;
- size_t i, len;
- int error, flags, options;
-
- s = config->server;
- lprintf(2, "Exchanging collection information\n");
- STAILQ_FOREACH(coll, &config->colls, co_next) {
- if (coll->co_options & CO_SKIP)
- continue;
- proto_printf(s, "COLL %s %s %o %d\n", coll->co_name,
- coll->co_release, coll->co_umask, coll->co_options);
- for (i = 0; i < pattlist_size(coll->co_accepts); i++) {
- proto_printf(s, "ACC %s\n",
- pattlist_get(coll->co_accepts, i));
- }
- for (i = 0; i < pattlist_size(coll->co_refusals); i++) {
- proto_printf(s, "REF %s\n",
- pattlist_get(coll->co_refusals, i));
- }
- proto_printf(s, ".\n");
- }
- proto_printf(s, ".\n");
- stream_flush(s);
-
- STAILQ_FOREACH(coll, &config->colls, co_next) {
- if (coll->co_options & CO_SKIP)
- continue;
- coll->co_norsync = globtree_false();
- line = stream_getln(s, NULL);
- if (line == NULL)
- goto bad;
- cmd = proto_get_ascii(&line);
- collname = proto_get_ascii(&line);
- release = proto_get_ascii(&line);
- error = proto_get_int(&line, &options, 10);
- if (error || line != NULL)
- goto bad;
- if (strcmp(cmd, "COLL") != 0 ||
- strcmp(collname, coll->co_name) != 0 ||
- strcmp(release, coll->co_release) != 0)
- goto bad;
- coll->co_options =
- (coll->co_options | (options & CO_SERVMAYSET)) &
- ~(~options & CO_SERVMAYCLEAR);
- while ((line = stream_getln(s, NULL)) != NULL) {
- if (strcmp(line, ".") == 0)
- break;
- cmd = proto_get_ascii(&line);
- if (cmd == NULL)
- goto bad;
- if (strcmp(cmd, "!") == 0) {
- msg = proto_get_rest(&line);
- if (msg == NULL)
- goto bad;
- lprintf(-1, "Server message: %s\n", msg);
- } else if (strcmp(cmd, "PRFX") == 0) {
- prefix = proto_get_ascii(&line);
- if (prefix == NULL || line != NULL)
- goto bad;
- coll->co_cvsroot = xstrdup(prefix);
- } else if (strcmp(cmd, "KEYALIAS") == 0) {
- ident = proto_get_ascii(&line);
- rcskey = proto_get_ascii(&line);
- if (rcskey == NULL || line != NULL)
- goto bad;
- error = keyword_alias(coll->co_keyword, ident,
- rcskey);
- if (error)
- goto bad;
- } else if (strcmp(cmd, "KEYON") == 0) {
- ident = proto_get_ascii(&line);
- if (ident == NULL || line != NULL)
- goto bad;
- error = keyword_enable(coll->co_keyword, ident);
- if (error)
- goto bad;
- } else if (strcmp(cmd, "KEYOFF") == 0) {
- ident = proto_get_ascii(&line);
- if (ident == NULL || line != NULL)
- goto bad;
- error = keyword_disable(coll->co_keyword,
- ident);
- if (error)
- goto bad;
- } else if (strcmp(cmd, "NORS") == 0) {
- pat = proto_get_ascii(&line);
- if (pat == NULL || line != NULL)
- goto bad;
- coll->co_norsync = globtree_or(coll->co_norsync,
- globtree_match(pat, FNM_PATHNAME));
- } else if (strcmp(cmd, "RNORS") == 0) {
- pat = proto_get_ascii(&line);
- if (pat == NULL || line != NULL)
- goto bad;
- coll->co_norsync = globtree_or(coll->co_norsync,
- globtree_match(pat, FNM_PATHNAME |
- FNM_LEADING_DIR));
- } else
- goto bad;
- }
- if (line == NULL)
- goto bad;
- keyword_prepare(coll->co_keyword);
-
- diraccept = globtree_true();
- fileaccept = globtree_true();
- dirrefuse = globtree_false();
- filerefuse = globtree_false();
-
- if (pattlist_size(coll->co_accepts) > 0) {
- globtree_free(diraccept);
- globtree_free(fileaccept);
- diraccept = globtree_false();
- fileaccept = globtree_false();
- flags = FNM_PATHNAME | FNM_LEADING_DIR |
- FNM_PREFIX_DIRS;
- for (i = 0; i < pattlist_size(coll->co_accepts); i++) {
- pat = pattlist_get(coll->co_accepts, i);
- diraccept = globtree_or(diraccept,
- globtree_match(pat, flags));
-
- len = strlen(pat);
- if (coll->co_options & CO_CHECKOUTMODE &&
- (len == 0 || pat[len - 1] != '*')) {
- /* We must modify the pattern so that it
- refers to the RCS file, rather than
- the checked-out file. */
- xasprintf(&pat, "%s,v", pat);
- fileaccept = globtree_or(fileaccept,
- globtree_match(pat, flags));
- free(pat);
- } else {
- fileaccept = globtree_or(fileaccept,
- globtree_match(pat, flags));
- }
- }
- }
-
- for (i = 0; i < pattlist_size(coll->co_refusals); i++) {
- pat = pattlist_get(coll->co_refusals, i);
- dirrefuse = globtree_or(dirrefuse,
- globtree_match(pat, 0));
- len = strlen(pat);
- if (coll->co_options & CO_CHECKOUTMODE &&
- (len == 0 || pat[len - 1] != '*')) {
- /* We must modify the pattern so that it refers
- to the RCS file, rather than the checked-out
- file. */
- xasprintf(&pat, "%s,v", pat);
- filerefuse = globtree_or(filerefuse,
- globtree_match(pat, 0));
- free(pat);
- } else {
- filerefuse = globtree_or(filerefuse,
- globtree_match(pat, 0));
- }
- }
-
- coll->co_dirfilter = globtree_and(diraccept,
- globtree_not(dirrefuse));
- coll->co_filefilter = globtree_and(fileaccept,
- globtree_not(filerefuse));
-
- /* Set up a mask of file attributes that we don't want to sync
- with the server. */
- if (!(coll->co_options & CO_SETOWNER))
- coll->co_attrignore |= FA_OWNER | FA_GROUP;
- if (!(coll->co_options & CO_SETMODE))
- coll->co_attrignore |= FA_MODE;
- if (!(coll->co_options & CO_SETFLAGS))
- coll->co_attrignore |= FA_FLAGS;
- }
- return (STATUS_SUCCESS);
-bad:
- lprintf(-1, "Protocol error during collection exchange\n");
- return (STATUS_FAILURE);
-}
-
-static struct mux *
-proto_mux(struct config *config)
-{
- struct mux *m;
- struct stream *s, *wr;
- struct chan *chan0, *chan1;
- int id;
-
- s = config->server;
- lprintf(2, "Establishing multiplexed-mode data connection\n");
- proto_printf(s, "MUX\n");
- stream_flush(s);
- m = mux_open(config->socket, &chan0);
- if (m == NULL) {
- lprintf(-1, "Cannot open the multiplexer\n");
- return (NULL);
- }
- id = chan_listen(m);
- if (id == -1) {
- lprintf(-1, "ChannelMux.Listen failed: %s\n", strerror(errno));
- mux_close(m);
- return (NULL);
- }
- wr = stream_open(chan0, NULL, (stream_writefn_t *)chan_write, NULL);
- proto_printf(wr, "CHAN %d\n", id);
- stream_close(wr);
- chan1 = chan_accept(m, id);
- if (chan1 == NULL) {
- lprintf(-1, "ChannelMux.Accept failed: %s\n", strerror(errno));
- mux_close(m);
- return (NULL);
- }
- config->chan0 = chan0;
- config->chan1 = chan1;
- return (m);
-}
-
-/*
- * Initializes the connection to the CVSup server, that is handle
- * the protocol negotiation, logging in, exchanging file attributes
- * support and collections information, and finally run the update
- * session.
- */
-int
-proto_run(struct config *config)
-{
- struct thread_args lister_args;
- struct thread_args detailer_args;
- struct thread_args updater_args;
- struct thread_args *args;
- struct killer killer;
- struct threads *workers;
- struct mux *m;
- int i, status;
-
- /*
- * We pass NULL for the close() function because we'll reuse
- * the socket after the stream is closed.
- */
- config->server = stream_open_fd(config->socket, stream_read_fd,
- stream_write_fd, NULL);
- status = proto_greet(config);
- if (status == STATUS_SUCCESS)
- status = proto_negproto(config);
- if (status == STATUS_SUCCESS)
- status = auth_login(config);
- if (status == STATUS_SUCCESS)
- status = proto_fileattr(config);
- if (status == STATUS_SUCCESS)
- status = proto_xchgcoll(config);
- if (status != STATUS_SUCCESS)
- return (status);
-
- /* Multi-threaded action starts here. */
- m = proto_mux(config);
- if (m == NULL)
- return (STATUS_FAILURE);
-
- stream_close(config->server);
- config->server = NULL;
- config->fixups = fixups_new();
- killer_start(&killer, m);
-
- /* Start the worker threads. */
- workers = threads_new();
- args = &lister_args;
- args->config = config;
- args->status = -1;
- args->errmsg = NULL;
- args->rd = NULL;
- args->wr = stream_open(config->chan0,
- NULL, (stream_writefn_t *)chan_write, NULL);
- threads_create(workers, lister, args);
-
- args = &detailer_args;
- args->config = config;
- args->status = -1;
- args->errmsg = NULL;
- args->rd = stream_open(config->chan0,
- (stream_readfn_t *)chan_read, NULL, NULL);
- args->wr = stream_open(config->chan1,
- NULL, (stream_writefn_t *)chan_write, NULL);
- threads_create(workers, detailer, args);
-
- args = &updater_args;
- args->config = config;
- args->status = -1;
- args->errmsg = NULL;
- args->rd = stream_open(config->chan1,
- (stream_readfn_t *)chan_read, NULL, NULL);
- args->wr = NULL;
- threads_create(workers, updater, args);
-
- lprintf(2, "Running\n");
- /* Wait for all the worker threads to finish. */
- status = STATUS_SUCCESS;
- for (i = 0; i < 3; i++) {
- args = threads_wait(workers);
- if (args->rd != NULL)
- stream_close(args->rd);
- if (args->wr != NULL)
- stream_close(args->wr);
- if (args->status != STATUS_SUCCESS) {
- assert(args->errmsg != NULL);
- if (status == STATUS_SUCCESS) {
- status = args->status;
- /* Shutdown the multiplexer to wake up all
- the other threads. */
- mux_shutdown(m, args->errmsg, status);
- }
- free(args->errmsg);
- }
- }
- threads_free(workers);
- if (status == STATUS_SUCCESS) {
- lprintf(2, "Shutting down connection to server\n");
- chan_close(config->chan0);
- chan_close(config->chan1);
- chan_wait(config->chan0);
- chan_wait(config->chan1);
- mux_shutdown(m, NULL, STATUS_SUCCESS);
- }
- killer_stop(&killer);
- fixups_free(config->fixups);
- status = mux_close(m);
- if (status == STATUS_SUCCESS) {
- lprintf(1, "Finished successfully\n");
- } else if (status == STATUS_INTERRUPTED) {
- lprintf(-1, "Interrupted\n");
- if (killer.killedby != -1)
- kill(getpid(), killer.killedby);
- }
- return (status);
-}
-
-/*
- * Write a string into the stream, escaping characters as needed.
- * Characters escaped:
- *
- * SPACE -> "\_"
- * TAB -> "\t"
- * NEWLINE -> "\n"
- * CR -> "\r"
- * \ -> "\\"
- */
-static int
-proto_escape(struct stream *wr, const char *s)
-{
- size_t len;
- ssize_t n;
- char c;
-
- /* Handle characters that need escaping. */
- do {
- len = strcspn(s, " \t\r\n\\");
- n = stream_write(wr, s, len);
- if (n == -1)
- return (-1);
- c = s[len];
- switch (c) {
- case ' ':
- n = stream_write(wr, "\\_", 2);
- break;
- case '\t':
- n = stream_write(wr, "\\t", 2);
- break;
- case '\r':
- n = stream_write(wr, "\\r", 2);
- break;
- case '\n':
- n = stream_write(wr, "\\n", 2);
- break;
- case '\\':
- n = stream_write(wr, "\\\\", 2);
- break;
- }
- if (n == -1)
- return (-1);
- s += len + 1;
- } while (c != '\0');
- return (0);
-}
-
-/*
- * A simple printf() implementation specifically tailored for csup.
- * List of the supported formats:
- *
- * %c Print a char.
- * %d or %i Print an int as decimal.
- * %x Print an int as hexadecimal.
- * %o Print an int as octal.
- * %t Print a time_t as decimal.
- * %s Print a char * escaping some characters as needed.
- * %S Print a char * without escaping.
- * %f Print an encoded struct fattr *.
- * %F Print an encoded struct fattr *, specifying the supported
- * attributes.
- */
-int
-proto_printf(struct stream *wr, const char *format, ...)
-{
- fattr_support_t *support;
- long long longval;
- struct fattr *fa;
- const char *fmt;
- va_list ap;
- char *cp, *s, *attr;
- ssize_t n;
- size_t size;
- off_t off;
- int rv, val, ignore;
- char c;
-
- n = 0;
- rv = 0;
- fmt = format;
- va_start(ap, format);
- while ((cp = strchr(fmt, '%')) != NULL) {
- if (cp > fmt) {
- n = stream_write(wr, fmt, cp - fmt);
- if (n == -1) {
- va_end(ap);
- return (-1);
- }
- }
- if (*++cp == '\0')
- goto done;
- switch (*cp) {
- case 'c':
- c = va_arg(ap, int);
- rv = stream_printf(wr, "%c", c);
- break;
- case 'd':
- case 'i':
- val = va_arg(ap, int);
- rv = stream_printf(wr, "%d", val);
- break;
- case 'x':
- val = va_arg(ap, int);
- rv = stream_printf(wr, "%x", val);
- break;
- case 'o':
- val = va_arg(ap, int);
- rv = stream_printf(wr, "%o", val);
- break;
- case 'O':
- off = va_arg(ap, off_t);
- rv = stream_printf(wr, "%" PRId64, off);
- break;
- case 'S':
- s = va_arg(ap, char *);
- assert(s != NULL);
- rv = stream_printf(wr, "%s", s);
- break;
- case 's':
- s = va_arg(ap, char *);
- assert(s != NULL);
- rv = proto_escape(wr, s);
- break;
- case 't':
- longval = (long long)va_arg(ap, time_t);
- rv = stream_printf(wr, "%lld", longval);
- break;
- case 'f':
- fa = va_arg(ap, struct fattr *);
- attr = fattr_encode(fa, NULL, 0);
- rv = proto_escape(wr, attr);
- free(attr);
- break;
- case 'F':
- fa = va_arg(ap, struct fattr *);
- support = va_arg(ap, fattr_support_t *);
- ignore = va_arg(ap, int);
- attr = fattr_encode(fa, *support, ignore);
- rv = proto_escape(wr, attr);
- free(attr);
- break;
- case 'z':
- size = va_arg(ap, size_t);
- rv = stream_printf(wr, "%zu", size);
- break;
-
- case '%':
- n = stream_write(wr, "%", 1);
- if (n == -1) {
- va_end(ap);
- return (-1);
- }
- break;
- }
- if (rv == -1) {
- va_end(ap);
- return (-1);
- }
- fmt = cp + 1;
- }
- if (*fmt != '\0') {
- rv = stream_printf(wr, "%s", fmt);
- if (rv == -1) {
- va_end(ap);
- return (-1);
- }
- }
-done:
- va_end(ap);
- return (0);
-}
-
-/*
- * Unescape the string, see proto_escape().
- */
-static void
-proto_unescape(char *s)
-{
- char *cp, *cp2;
-
- cp = s;
- while ((cp = strchr(cp, '\\')) != NULL) {
- switch (cp[1]) {
- case '_':
- *cp = ' ';
- break;
- case 't':
- *cp = '\t';
- break;
- case 'r':
- *cp = '\r';
- break;
- case 'n':
- *cp = '\n';
- break;
- case '\\':
- *cp = '\\';
- break;
- default:
- *cp = *(cp + 1);
- }
- cp2 = ++cp;
- while (*cp2 != '\0') {
- *cp2 = *(cp2 + 1);
- cp2++;
- }
- }
-}
-
-/*
- * Get an ascii token in the string.
- */
-char *
-proto_get_ascii(char **s)
-{
- char *ret;
-
- ret = strsep(s, " ");
- if (ret == NULL)
- return (NULL);
- /* Make sure we disallow 0-length fields. */
- if (*ret == '\0') {
- *s = NULL;
- return (NULL);
- }
- proto_unescape(ret);
- return (ret);
-}
-
-/*
- * Get the rest of the string.
- */
-char *
-proto_get_rest(char **s)
-{
- char *ret;
-
- if (s == NULL)
- return (NULL);
- ret = *s;
- proto_unescape(ret);
- *s = NULL;
- return (ret);
-}
-
-/*
- * Get an int token.
- */
-int
-proto_get_int(char **s, int *val, int base)
-{
- char *cp;
- int error;
-
- cp = proto_get_ascii(s);
- if (cp == NULL)
- return (-1);
- error = asciitoint(cp, val, base);
- return (error);
-}
-
-/*
- * Get a size_t token.
- */
-int
-proto_get_sizet(char **s, size_t *val, int base)
-{
- unsigned long long tmp;
- char *cp, *end;
-
- cp = proto_get_ascii(s);
- if (cp == NULL)
- return (-1);
- errno = 0;
- tmp = strtoll(cp, &end, base);
- if (errno || *end != '\0')
- return (-1);
- *val = (size_t)tmp;
- return (0);
-}
-
-/*
- * Get a time_t token.
- *
- * Ideally, we would use an intmax_t and strtoimax() here, but strtoll()
- * is more portable and 64bits should be enough for a timestamp.
- */
-int
-proto_get_time(char **s, time_t *val)
-{
- long long tmp;
- char *cp, *end;
-
- cp = proto_get_ascii(s);
- if (cp == NULL)
- return (-1);
- errno = 0;
- tmp = strtoll(cp, &end, 10);
- if (errno || *end != '\0')
- return (-1);
- *val = (time_t)tmp;
- return (0);
-}
-
-/* Start the killer thread. It is used to protect against some signals
- during the multi-threaded run so that we can gracefully fail. */
-static void
-killer_start(struct killer *k, struct mux *m)
-{
- int error;
-
- k->mux = m;
- k->killedby = -1;
- sigemptyset(&k->sigset);
- sigaddset(&k->sigset, SIGINT);
- sigaddset(&k->sigset, SIGHUP);
- sigaddset(&k->sigset, SIGTERM);
- sigaddset(&k->sigset, SIGPIPE);
- pthread_sigmask(SIG_BLOCK, &k->sigset, NULL);
- error = pthread_create(&k->thread, NULL, killer_run, k);
- if (error)
- err(1, "pthread_create");
-}
-
-/* The main loop of the killer thread. */
-static void *
-killer_run(void *arg)
-{
- struct killer *k;
- int error, sig, old;
-
- k = arg;
-again:
- error = sigwait(&k->sigset, &sig);
- assert(!error);
- if (sig == SIGINT || sig == SIGHUP || sig == SIGTERM) {
- if (k->killedby == -1) {
- k->killedby = sig;
- /* Ensure we don't get canceled during the shutdown. */
- pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &old);
- mux_shutdown(k->mux, "Cleaning up ...",
- STATUS_INTERRUPTED);
- pthread_setcancelstate(old, NULL);
- }
- }
- goto again;
-}
-
-/* Stop the killer thread. */
-static void
-killer_stop(struct killer *k)
-{
- void *val;
- int error;
-
- error = pthread_cancel(k->thread);
- assert(!error);
- pthread_join(k->thread, &val);
- assert(val == PTHREAD_CANCELED);
- pthread_sigmask(SIG_UNBLOCK, &k->sigset, NULL);
-}
diff --git a/usr.bin/csup/rcsfile.c b/usr.bin/csup/rcsfile.c
deleted file mode 100644
index 5397932..0000000
--- a/usr.bin/csup/rcsfile.c
+++ /dev/null
@@ -1,1414 +0,0 @@
-/*-
- * Copyright (c) 2007-2009, Ulf Lilleengen <lulf@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <sys/queue.h>
-
-#include <assert.h>
-#include <err.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "diff.h"
-#include "keyword.h"
-#include "misc.h"
-#include "proto.h"
-#include "rcsfile.h"
-#include "rcsparse.h"
-#include "stream.h"
-
-#define BUF_SIZE_DEFAULT 128
-
-/*
- * RCS parser library. This is the part of the library that handles the
- * importing, editing and exporting of RCS files. It currently supports only the
- * part of the RCS file specification that is needed for csup (for instance,
- * newphrases are not supported), and assumes that you can store the whole RCS
- * file in memory.
- */
-
-/*
- * Linked list for string tokens.
- */
-struct string {
- char *str;
- STAILQ_ENTRY(string) string_next;
-};
-
-/*
- * Linked list of tags and revision numbers, in the RCS file header.
- */
-struct tag {
- char *tag;
- char *revnum;
- STAILQ_ENTRY(tag) tag_next;
-};
-
-/*
- * A RCS delta. The delta is identified by a revision number, and contains the
- * most important RCS attributes that is needed by csup. It also contains
- * pointers to other nodes in the RCS file delta structure.
- */
-struct delta {
- char *revdate;
- char *revnum;
- char *author;
- char *state;
- struct buf *log;
- struct buf *text;
- int placeholder;
- struct delta *diffbase;
- struct delta *prev;
-
- LIST_ENTRY(delta) delta_next;
- STAILQ_ENTRY(delta) delta_prev;
- LIST_ENTRY(delta) table_next;
- STAILQ_ENTRY(delta) stack_next;
- LIST_HEAD(, branch) branchlist;
- LIST_ENTRY(delta) branch_next_date;
-};
-
-/*
- * A branch data structure containing information about deltas in the branch as
- * well as a base revision number.
- */
-struct branch {
- char *revnum;
- LIST_HEAD(, delta) deltalist; /* Next delta in our branch. */
- LIST_ENTRY(branch) branch_next;
-};
-
-/*
- * The rcsfile structure is the "main" structure of the RCS parser library. It
- * contains administrative data as well as pointers to the deltas within the
- * file.
- */
-struct rcsfile {
- char *name;
- char *head;
- char *branch; /* Default branch. */
- char *cvsroot;
- char *colltag;
- STAILQ_HEAD(, string) accesslist;
- STAILQ_HEAD(, tag) taglist;
- int strictlock;
- char *comment;
- int expand;
- int ro;
- struct branch *trunk; /* The tip delta. */
-
- LIST_HEAD(, delta) deltatable;
-
- char *desc;
-};
-
-static void rcsfile_freedelta(struct delta *);
-static void rcsfile_insertdelta(struct branch *, struct delta *,
- int);
-static struct delta *rcsfile_createdelta(char *);
-static int rcsfile_write_deltatext(struct rcsfile *,
- struct stream *);
-static int rcsfile_puttext(struct rcsfile *, struct stream *,
- struct delta *, struct delta *);
-static struct branch *rcsfile_getbranch(struct rcsfile *, char *);
-static void rcsfile_insertsorteddelta(struct rcsfile *,
- struct delta *);
-static struct stream *rcsfile_getdeltatext(struct rcsfile *, struct delta *,
- struct buf **);
-static int rcsdelta_writestring(char *, size_t, struct stream *);
-static void rcsdelta_insertbranch(struct delta *, struct branch *);
-
-/* Space formatting of RCS file. */
-const char *head_space = "\t";
-const char *branch_space = "\t";
-const char *tag_space = "\t";
-const char *date_space = "\t";
-const char *auth_space = "\t";
-const char *state_space = "\t";
-const char *next_space = "\t";
-const char *branches_space = "\t";
-const char *comment_space ="\t";
-const char *expand_space = "\t";
-
-void print_stream(struct stream *);
-
-/* Print the contents of a stream, for debugging. */
-void
-print_stream(struct stream *s)
-{
- char *line;
-
- line = stream_getln(s, NULL);
- while (line != NULL) {
- lprintf(-1, "%s\n", line);
- line = stream_getln(s, NULL);
- }
- lprintf(-1, "\n");
-}
-
-/*
- * Parse rcsfile from path and return a pointer to it.
- */
-struct rcsfile *
-rcsfile_frompath(const char *path, const char *name, const char *cvsroot,
- const char *colltag, int ro)
-{
- struct rcsfile *rf;
- FILE *infp;
- int error;
-
- if (path == NULL || name == NULL || cvsroot == NULL || colltag == NULL)
- return (NULL);
-
- rf = xmalloc(sizeof(struct rcsfile));
- rf->name = xstrdup(name);
- rf->cvsroot = xstrdup(cvsroot);
- rf->colltag = xstrdup(colltag);
-
- /* Initialize head branch. */
- rf->trunk = xmalloc(sizeof(struct branch));
- rf->trunk->revnum = xstrdup("1");
- LIST_INIT(&rf->trunk->deltalist);
- /* Initialize delta list. */
- LIST_INIT(&rf->deltatable);
- /* Initialize tag list. */
- STAILQ_INIT(&rf->taglist);
- /* Initialize accesslist. */
- STAILQ_INIT(&rf->accesslist);
-
- /* Initialize all fields. */
- rf->head = NULL;
- rf->branch = NULL;
- rf->strictlock = 0;
- rf->comment = NULL;
- rf->expand = EXPAND_DEFAULT;
- rf->desc = NULL;
- rf->ro = ro;
-
- infp = fopen(path, "r");
- if (infp == NULL) {
- lprintf(-1, "Cannot open \"%s\": %s\n", path, strerror(errno));
- rcsfile_free(rf);
- return (NULL);
- }
- error = rcsparse_run(rf, infp, ro);
- fclose(infp);
- if (error) {
- lprintf(-1, "Error parsing \"%s\"\n", name);
- rcsfile_free(rf);
- return (NULL);
- }
- return (rf);
-}
-
-/*
- * Write content of rcsfile to server. Assumes we have a complete RCS file
- * loaded.
- */
-int
-rcsfile_send_details(struct rcsfile *rf, struct stream *wr)
-{
- struct delta *d;
- struct tag *t;
- const char *keyword;
- int error;
-
- assert(rf != NULL);
-
- error = proto_printf(wr, "V %s\n", rf->name);
- if (error)
- return(error);
-
- /* Write default branch. */
- if (rf->branch == NULL)
- error = proto_printf(wr, "b\n");
- else
- error = proto_printf(wr, "B %s\n", rf->branch);
- if (error)
- return(error);
-
- /* Write deltas to server. */
- error = proto_printf(wr, "D\n");
- if (error)
- return(error);
-
- LIST_FOREACH(d, &rf->deltatable, table_next) {
- error = proto_printf(wr, "%s %s\n", d->revnum, d->revdate);
- if (error)
- return(error);
- }
- error = proto_printf(wr, ".\n");
-
- if (error)
- return(error);
- /* Write expand. */
- if (rf->expand != EXPAND_DEFAULT) {
- keyword = keyword_encode_expand(rf->expand);
- if (keyword != NULL) {
- error = proto_printf(wr, "E %s\n",
- keyword_encode_expand(rf->expand));
- if (error)
- return(error);
- }
- }
-
- /* Write tags to server. */
- error = proto_printf(wr, "T\n");
- if (error)
- return(error);
- STAILQ_FOREACH(t, &rf->taglist, tag_next) {
- error = proto_printf(wr, "%s %s\n", t->tag, t->revnum);
- if (error)
- return(error);
- }
- error = proto_printf(wr, ".\n");
- if (error)
- return(error);
- error = proto_printf(wr, ".\n");
- return (error);
-}
-
-/*
- * Write a RCS file to disk represented by the destination stream. Keep track of
- * deltas with a stack and an inverted stack.
- */
-int
-rcsfile_write(struct rcsfile *rf, struct stream *dest)
-{
- STAILQ_HEAD(, delta) deltastack;
- STAILQ_HEAD(, delta) deltalist_inverted;
- struct tag *t;
- struct branch *b;
- struct delta *d, *d_tmp, *d_next;
- int error;
-
- /* First write head. */
- d = LIST_FIRST(&rf->trunk->deltalist);
- if (stream_printf(dest, "head%s%s;\n", head_space, d->revnum) < 0)
- return (-1);
-
- /* Write branch, if we have. */
- if (rf->branch != NULL) {
- if (stream_printf(dest, "branch%s%s;\n", branch_space,
- rf->branch) < 0)
- return (-1);
- }
-
- /* Write access. */
- if (stream_printf(dest, "access") < 0)
- return (-1);
-#if 0
- if (!STAILQ_EMPTY(&rf->accesslist)) {
- /*
- * XXX: Write out access. This doesn't seem to be necessary for
- * the time being.
- */
- }
-#endif
- if (stream_printf(dest, ";\n") < 0)
- return (-1);
-
- /* Write out taglist. */
- if (stream_printf(dest, "symbols") < 0)
- return (-1);
- if (!STAILQ_EMPTY(&rf->taglist)) {
- STAILQ_FOREACH(t, &rf->taglist, tag_next) {
- if (stream_printf(dest, "\n%s%s:%s", tag_space, t->tag,
- t->revnum) < 0)
- return (-1);
- }
- }
-
- /* Write out locks and strict. */
- if (stream_printf(dest, ";\nlocks;") < 0)
- return (-1);
- if (rf->strictlock) {
- if (stream_printf(dest, " strict;") < 0)
- return (-1);
- }
- if (stream_printf(dest, "\n") < 0)
- return (-1);
-
- /* Write out the comment. */
- if (rf->comment != NULL) {
- if (stream_printf(dest, "comment%s%s;\n", comment_space,
- rf->comment) < 0)
- return (-1);
- }
- if (rf->expand != EXPAND_DEFAULT) {
- if (stream_printf(dest, "expand%s@%s@;\n", expand_space,
- keyword_encode_expand(rf->expand)) < 0)
- return (-1);
- }
-
- if (stream_printf(dest, "\n\n") < 0)
- return (-1);
-
- /*
- * Write out deltas. We use a stack where we push the appropriate deltas
- * that is to be written out during the loop.
- */
- STAILQ_INIT(&deltastack);
- d = LIST_FIRST(&rf->trunk->deltalist);
- STAILQ_INSERT_HEAD(&deltastack, d, stack_next);
- while (!STAILQ_EMPTY(&deltastack)) {
- d = STAILQ_FIRST(&deltastack);
- STAILQ_REMOVE_HEAD(&deltastack, stack_next);
- /* Do not write out placeholders just to be safe. */
- if (d->placeholder)
- continue;
- if (stream_printf(dest, "%s\n", d->revnum) < 0)
- return (-1);
- if (stream_printf(dest, "date%s%s;%sauthor %s;%sstate",
- date_space, d->revdate, auth_space, d->author,
- state_space) < 0)
- return (-1);
- if (d->state != NULL) {
- if (stream_printf(dest, " %s", d->state) < 0)
- return (-1);
- }
- if (stream_printf(dest, ";\nbranches") < 0)
- return (-1);
- /*
- * Write out our branches. Add them to a reversed list for use
- * later when we write out the text.
- */
- STAILQ_INIT(&deltalist_inverted);
- LIST_FOREACH(b, &d->branchlist, branch_next) {
- d_tmp = LIST_FIRST(&b->deltalist);
- STAILQ_INSERT_HEAD(&deltalist_inverted, d_tmp, delta_prev);
- STAILQ_INSERT_HEAD(&deltastack, d_tmp, stack_next);
- }
-
- /* Push branch heads on stack. */
- STAILQ_FOREACH(d_tmp, &deltalist_inverted, delta_prev) {
- if (d_tmp == NULL) {
- lprintf(2, "Empty branch!\n");
- return (-1);
- }
- if (stream_printf(dest, "\n%s%s", branches_space,
- d_tmp->revnum) < 0)
- return (-1);
- }
-
- if (stream_printf(dest, ";\nnext%s", next_space) < 0)
- return (-1);
- /* Push next delta on stack. */
- d_next = LIST_NEXT(d, delta_next);
- if (d_next != NULL) {
- if (stream_printf(dest, "%s", d_next->revnum) < 0)
- return (-1);
- STAILQ_INSERT_HEAD(&deltastack, d_next, stack_next);
- }
- if (stream_printf(dest, ";\n\n") < 0)
- return (-1);
- }
- /* Write out desc. */
- if (stream_printf(dest, "\ndesc\n@@") < 0)
- return (-1);
- d = LIST_FIRST(&rf->trunk->deltalist);
-
- /* Write out deltatexts. */
- error = rcsfile_write_deltatext(rf, dest);
- if (stream_printf(dest, "\n") < 0)
- return (-1);
- return (error);
-}
-
-/*
- * Write out deltatexts of a delta and it's subbranches recursively.
- */
-int
-rcsfile_write_deltatext(struct rcsfile *rf, struct stream *dest)
-{
- STAILQ_HEAD(, delta) deltastack;
- LIST_HEAD(, delta) branchlist_datesorted;
- struct delta *d, *d_tmp, *d_next, *d_tmp2, *d_tmp3;
- struct stream *in;
- struct branch *b;
- size_t size;
- char *line;
- int error;
-
- error = 0;
- STAILQ_INIT(&deltastack);
- d = LIST_FIRST(&rf->trunk->deltalist);
- d->prev = NULL;
- STAILQ_INSERT_HEAD(&deltastack, d, stack_next);
- while (!STAILQ_EMPTY(&deltastack)) {
- d = STAILQ_FIRST(&deltastack);
- STAILQ_REMOVE_HEAD(&deltastack, stack_next);
- /* Do not write out placeholders just to be safe. */
- if (d->placeholder)
- return (0);
- if (stream_printf(dest, "\n\n\n%s\n", d->revnum) < 0)
- return (-1);
- if (stream_printf(dest, "log\n@") < 0)
- return (-1);
- in = stream_open_buf(d->log);
- line = stream_getln(in, &size);
- while (line != NULL) {
- if (stream_write(dest, line, size) == -1)
- return (-1);
- line = stream_getln(in, &size);
- }
- stream_close(in);
- if (stream_printf(dest, "@\ntext\n@") < 0)
- return (-1);
- error = rcsfile_puttext(rf, dest, d, d->prev);
- if (error)
- return (error);
- if (stream_printf(dest, "@") < 0)
- return (-1);
-
- LIST_INIT(&branchlist_datesorted);
- d_next = LIST_NEXT(d, delta_next);
- if (d_next != NULL) {
- d_next->prev = d;
- /*
- * If it's trunk, treat it like the oldest, if not treat
- * it like a child.
- */
- if (rcsrev_istrunk(d_next->revnum))
- STAILQ_INSERT_HEAD(&deltastack, d_next,
- stack_next);
- else
- LIST_INSERT_HEAD(&branchlist_datesorted, d_next,
- branch_next_date);
- }
-
- /*
- * First, we need to sort our branches based on their date to
- * take into account some self-hacked RCS files.
- */
- LIST_FOREACH(b, &d->branchlist, branch_next) {
- d_tmp = LIST_FIRST(&b->deltalist);
- if (LIST_EMPTY(&branchlist_datesorted)) {
- LIST_INSERT_HEAD(&branchlist_datesorted, d_tmp,
- branch_next_date);
- continue;
- }
-
- d_tmp2 = LIST_FIRST(&branchlist_datesorted);
- if (rcsnum_cmp(d_tmp->revdate, d_tmp2->revdate) <= 0) {
- LIST_INSERT_BEFORE(d_tmp2, d_tmp,
- branch_next_date);
- continue;
- }
- while ((d_tmp3 = LIST_NEXT(d_tmp2, branch_next_date))
- != NULL) {
- if (rcsnum_cmp(d_tmp->revdate, d_tmp3->revdate)
- <= 0)
- break;
- d_tmp2 = d_tmp3;
- }
- LIST_INSERT_AFTER(d_tmp2, d_tmp, branch_next_date);
- }
- /*
- * Invert the deltalist of a branch, since we're writing them
- * the opposite way.
- */
- LIST_FOREACH(d_tmp, &branchlist_datesorted, branch_next_date) {
- d_tmp->prev = d;
- STAILQ_INSERT_HEAD(&deltastack, d_tmp, stack_next);
- }
- }
- return (0);
-}
-
-/*
- * Generates text given a delta and a diffbase.
- */
-static int
-rcsfile_puttext(struct rcsfile *rf, struct stream *dest, struct delta *d,
- struct delta *diffbase)
-{
- struct stream *in, *rd, *orig;
- struct keyword *k;
- struct diffinfo dibuf, *di;
- struct buf *b;
- size_t size;
- char *line;
- int error;
-
- di = &dibuf;
- b = NULL;
- error = 0;
-
- /* Write if the diffbase is the previous */
- if (d->diffbase == diffbase) {
-
- /* Write out the text. */
- in = stream_open_buf(d->text);
- line = stream_getln(in, &size);
- while (line != NULL) {
- if (stream_write(dest, line, size) == -1) {
- error = -1;
- goto cleanup;
- }
- line = stream_getln(in, &size);
- }
- stream_close(in);
- /* We need to apply diff to produce text, this is probably HEAD. */
- } else if (diffbase == NULL) {
- /* Apply diff. */
- orig = rcsfile_getdeltatext(rf, d, &b);
- if (orig == NULL) {
- error = -1;
- goto cleanup;
- }
- line = stream_getln(orig, &size);
- while (line != NULL) {
- if (stream_write(dest, line, size) == -1) {
- error = -1;
- goto cleanup;
- }
- line = stream_getln(orig, &size);
- }
- stream_close(orig);
- /*
- * A new head was probably added, and now the previous HEAD must be
- * changed to include the diff instead.
- */
- } else if (diffbase->diffbase == d) {
- /* Get reverse diff. */
- orig = rcsfile_getdeltatext(rf, d, &b);
- if (orig == NULL) {
- error = -1;
- goto cleanup;
- }
- di->di_rcsfile = rf->name;
- di->di_cvsroot = rf->cvsroot;
- di->di_revnum = d->revnum;
- di->di_revdate = d->revdate;
- di->di_author = d->author;
- di->di_tag = rf->colltag;
- di->di_state = d->state;
- di->di_expand = EXPAND_OLD;
- k = keyword_new();
-
- rd = stream_open_buf(diffbase->text);
- error = diff_reverse(rd, orig, dest, k, di);
- if (error) {
- lprintf(-1, "Error applying reverse diff: %d\n", error);
- goto cleanup;
- }
- keyword_free(k);
- stream_close(rd);
- stream_close(orig);
- }
-cleanup:
- if (b != NULL)
- buf_free(b);
- return (error);
-}
-
-/*
- * Return a stream with an applied diff of a delta.
- * XXX: extra overhead on the last apply. Could write directly to file, but
- * makes things complicated though.
- */
-static struct stream *
-rcsfile_getdeltatext(struct rcsfile *rf, struct delta *d, struct buf **buf_dest)
-{
- struct diffinfo dibuf, *di;
- struct stream *orig, *dest, *rd;
- struct buf *buf_orig;
- struct keyword *k;
- int error;
-
- buf_orig = NULL;
- error = 0;
-
- /*
- * If diffbase is NULL or we are head (the old head), we have a normal
- * complete deltatext.
- */
- if (d->diffbase == NULL && !strcmp(rf->head, d->revnum)) {
- orig = stream_open_buf(d->text);
- return (orig);
- }
-
- di = &dibuf;
- /* If not, we need to apply our diff to that of our diffbase. */
- orig = rcsfile_getdeltatext(rf, d->diffbase, &buf_orig);
- if (orig == NULL)
- return (NULL);
-
- /*
- * Now that we are sure we have a complete deltatext in ret, let's apply
- * our diff to it.
- */
- *buf_dest = buf_new(BUF_SIZE_DEFAULT);
- dest = stream_open_buf(*buf_dest);
-
- di->di_rcsfile = rf->name;
- di->di_cvsroot = rf->cvsroot;
- di->di_revnum = d->revnum;
- di->di_revdate = d->revdate;
- di->di_author = d->author;
- di->di_tag = rf->colltag;
- di->di_state = d->state;
- di->di_expand = EXPAND_OLD;
- rd = stream_open_buf(d->text);
- k = keyword_new();
- error = diff_apply(rd, orig, dest, k, di, 0);
- stream_flush(dest);
- stream_close(rd);
- stream_close(orig);
- stream_close(dest);
- keyword_free(k);
- if (buf_orig != NULL)
- buf_free(buf_orig);
- if (error) {
- lprintf(-1, "Error applying diff: %d\n", error);
- return (NULL);
- }
-
- /* Now reopen the stream for the reading. */
- dest = stream_open_buf(*buf_dest);
- return (dest);
-}
-
-/* Print content of rcsfile. Useful for debugging. */
-void
-rcsfile_print(struct rcsfile *rf)
-{
- struct delta *d;
- struct tag *t;
- struct string *s;
- struct stream *in;
- char *line;
-
- lprintf(1, "\n");
- if (rf->name != NULL)
- lprintf(1, "name: '%s'\n", rf->name);
- if (rf->head != NULL)
- lprintf(1, "head: '%s'\n", rf->head);
- if (rf->branch != NULL)
- lprintf(1, "branch: '%s'\n", rf->branch);
- lprintf(1, "Access: ");
- STAILQ_FOREACH(s, &rf->accesslist, string_next)
- lprintf(1, "'%s' ", s->str);
- lprintf(1, "\n");
-
- /* Print all tags. */
- STAILQ_FOREACH(t, &rf->taglist, tag_next) {
- lprintf(1, "Tag: ");
- if (t->tag != NULL)
- lprintf(1, "name: %s ", t->tag);
- if (t->revnum != NULL)
- lprintf(1, "rev: %s", t->revnum);
- lprintf(1, "\n");
- }
-
- if (rf->strictlock)
- lprintf(1, "Strict!\n");
- if (rf->comment != NULL)
- lprintf(1, "comment: '%s'\n", rf->comment);
- if (rf->expand != EXPAND_DEFAULT)
- lprintf(1, "expand: '%s'\n", keyword_encode_expand(rf->expand));
-
- /* Print all deltas. */
- LIST_FOREACH(d, &rf->deltatable, table_next) {
- lprintf(1, "Delta: ");
- if (d->revdate != NULL)
- lprintf(1, "date: %s ", d->revdate);
- if (d->revnum != NULL)
- lprintf(1, "rev: %s", d->revnum);
- if (d->author != NULL)
- lprintf(1, "author: %s", d->author);
- if (d->state != NULL)
- lprintf(1, "state: %s", d->state);
-
- lprintf(1, "Text:\n");
- in = stream_open_buf(d->text);
- line = stream_getln(in, NULL);
- while (line != NULL) {
- lprintf(1, "TEXT: %s\n", line);
- line = stream_getln(in, NULL);
- }
- stream_close(in);
- lprintf(1, "\n");
- }
-
- if (rf->desc != NULL)
- lprintf(1, "desc: '%s'\n", rf->desc);
-}
-
-/* Free all memory associated with a struct rcsfile. */
-void
-rcsfile_free(struct rcsfile *rf)
-{
- struct delta *d;
- struct tag *t;
- struct string *s;
-
- if (rf->name != NULL)
- free(rf->name);
- if (rf->head != NULL)
- free(rf->head);
- if (rf->branch != NULL)
- free(rf->branch);
- if (rf->cvsroot != NULL)
- free(rf->cvsroot);
- if (rf->colltag != NULL)
- free(rf->colltag);
-
- /* Free all access ids. */
- while (!STAILQ_EMPTY(&rf->accesslist)) {
- s = STAILQ_FIRST(&rf->accesslist);
- STAILQ_REMOVE_HEAD(&rf->accesslist, string_next);
- if (s->str != NULL)
- free(s->str);
- free(s);
- }
-
- /* Free all tags. */
- while (!STAILQ_EMPTY(&rf->taglist)) {
- t = STAILQ_FIRST(&rf->taglist);
- STAILQ_REMOVE_HEAD(&rf->taglist, tag_next);
- if (t->tag != NULL)
- free(t->tag);
- if (t->revnum != NULL)
- free(t->revnum);
- free(t);
- }
-
- if (rf->comment != NULL)
- free(rf->comment);
-
- /* Free all deltas in global list */
- while (!LIST_EMPTY(&rf->deltatable)) {
- d = LIST_FIRST(&rf->deltatable);
- if (!rf->ro)
- LIST_REMOVE(d, delta_next);
- LIST_REMOVE(d, table_next);
- rcsfile_freedelta(d);
- }
-
- /* Free global branch. */
- if (rf->trunk->revnum != NULL)
- free(rf->trunk->revnum);
- free(rf->trunk);
-
- if (rf->desc != NULL)
- free(rf->desc);
-
- free(rf);
-}
-
-/*
- * Free a RCS delta.
- */
-static void
-rcsfile_freedelta(struct delta *d)
-{
- struct branch *b;
-
- if (d->revdate != NULL)
- free(d->revdate);
- if (d->revnum != NULL)
- free(d->revnum);
- if (d->author != NULL)
- free(d->author);
- if (d->state != NULL)
- free(d->state);
- if (d->log != NULL)
- buf_free(d->log);
- if (d->text != NULL)
- buf_free(d->text);
-
- /* Free all subbranches of a delta. */
- while (!LIST_EMPTY(&d->branchlist)) {
- b = LIST_FIRST(&d->branchlist);
- LIST_REMOVE(b, branch_next);
- free(b->revnum);
- free(b);
- }
- free(d);
-}
-
-/*
- * Functions for editing RCS deltas.
- */
-
-/* Add a new entry to the access list. */
-void
-rcsfile_addaccess(struct rcsfile *rf, char *id)
-{
- struct string *s;
-
- s = xmalloc(sizeof(struct string));
- s->str = xstrdup(id);
- STAILQ_INSERT_TAIL(&rf->accesslist, s, string_next);
-}
-
-/* Add a tag to a RCS file. */
-void
-rcsfile_addtag(struct rcsfile *rf, char *tag, char *revnum)
-{
- struct tag *t;
-
- t = xmalloc(sizeof(struct tag));
- t->tag = xstrdup(tag);
- t->revnum = xstrdup(revnum);
-
- STAILQ_INSERT_HEAD(&rf->taglist, t, tag_next);
-}
-
-/* Import a tag to a RCS file. */
-void
-rcsfile_importtag(struct rcsfile *rf, char *tag, char *revnum)
-{
- struct tag *t;
-
- t = xmalloc(sizeof(struct tag));
- t->tag = xstrdup(tag);
- t->revnum = xstrdup(revnum);
-
- STAILQ_INSERT_TAIL(&rf->taglist, t, tag_next);
-}
-
-/*
- * Delete a revision from the global delta list and the branch it is in. Csup
- * will tell us to delete the tags involved.
- */
-void
-rcsfile_deleterev(struct rcsfile *rf, char *revname)
-{
- struct delta *d;
-
- d = rcsfile_getdelta(rf, revname);
- if (!rf->ro)
- LIST_REMOVE(d, delta_next);
- LIST_REMOVE(d, table_next);
- rcsfile_freedelta(d);
-}
-
-/* Delete a tag from the tag list. */
-void
-rcsfile_deletetag(struct rcsfile *rf, char *tag, char *revnum)
-{
- struct tag *t;
-
- STAILQ_FOREACH(t, &rf->taglist, tag_next) {
- if ((strcmp(tag, t->tag) == 0) &&
- (strcmp(revnum, t->revnum) == 0)) {
- STAILQ_REMOVE(&rf->taglist, t, tag, tag_next);
- free(t->tag);
- free(t->revnum);
- free(t);
- return;
- }
- }
-}
-
-/*
- * Searches the global deltalist for a delta.
- */
-struct delta *
-rcsfile_getdelta(struct rcsfile *rf, char *revnum)
-{
- struct delta *d;
-
- LIST_FOREACH(d, &rf->deltatable, table_next) {
- if (strcmp(revnum, d->revnum) == 0)
- return (d);
- }
- return (NULL);
-}
-
-/* Set rcsfile head. */
-void
-rcsfile_setval(struct rcsfile *rf, int field, char *val)
-{
- size_t len;
-
- switch (field) {
- case RCSFILE_HEAD:
- if (rf->head != NULL)
- free(rf->head);
- rf->head = xstrdup(val);
- break;
- case RCSFILE_BRANCH:
- if (rf->branch != NULL)
- free(rf->branch);
- rf->branch = (val == NULL) ? NULL : xstrdup(val);
- break;
- case RCSFILE_STRICT:
- if (val != NULL)
- rf->strictlock = 1;
- break;
- case RCSFILE_COMMENT:
- if (rf->comment != NULL)
- free(rf->comment);
- rf->comment = xstrdup(val);
- break;
- case RCSFILE_EXPAND:
- len = strlen(val) - 1;
- val++;
- val[len - 1] = '\0';
- rf->expand = keyword_decode_expand(val);
- break;
- case RCSFILE_DESC:
- if (rf->desc != NULL)
- free(rf->desc);
- rf->desc = xstrdup(val);
- break;
- default:
- lprintf(-1, "Setting invalid RCSfile value.\n");
- break;
- }
-}
-
-/* Create and initialize a delta. */
-static struct delta *
-rcsfile_createdelta(char *revnum)
-{
- struct delta *d;
-
- d = xmalloc(sizeof(struct delta));
- d->revnum = xstrdup(revnum);
- d->revdate = NULL;
- d->state = NULL;
- d->author = NULL;
- d->log = buf_new(BUF_SIZE_DEFAULT);
- d->text = buf_new(BUF_SIZE_DEFAULT);
- d->diffbase = NULL;
-
- LIST_INIT(&d->branchlist);
- return (d);
-}
-
-/* Add a delta to a imported delta tree. Used by the updater. */
-struct delta *
-rcsfile_addelta(struct rcsfile *rf, char *revnum, char *revdate, char *author,
- char *diffbase)
-{
- struct branch *b;
- struct delta *d, *d_bp, *d_next;
- char *brev, *bprev;
- int trunk;
-
- d_next = NULL;
- d = rcsfile_getdelta(rf, revnum);
- if (d != NULL) {
- lprintf(-1, "Delta %s already exists!\n", revnum);
- return (NULL);
- }
- d = rcsfile_createdelta(revnum);
- d->placeholder = 0;
- d->revdate = xstrdup(revdate);
- d->author = xstrdup(author);
- d->diffbase = rcsfile_getdelta(rf, diffbase);
-
- /* If it's trunk, insert it in the head branch list. */
- b = rcsrev_istrunk(d->revnum) ? rf->trunk :
- rcsfile_getbranch(rf, d->revnum);
-
- /*
- * We didn't find a branch, check if we can find a branchpoint and
- * create a branch there.
- */
- if (b == NULL) {
- brev = rcsrev_prefix(d->revnum);
- bprev = rcsrev_prefix(brev);
-
- d_bp = rcsfile_getdelta(rf, bprev);
- free(bprev);
- if (d_bp == NULL) {
- lprintf(-1, "No branch point for adding delta %s\n",
- d->revnum);
- return (NULL);
- }
-
- /* Create the branch and insert in delta. */
- b = xmalloc(sizeof(struct branch));
- b->revnum = brev;
- LIST_INIT(&b->deltalist);
- rcsdelta_insertbranch(d_bp, b);
- }
-
- /* Insert both into the tree, and into the lookup list. */
- trunk = rcsrev_istrunk(d->revnum);
- rcsfile_insertdelta(b, d, trunk);
- rcsfile_insertsorteddelta(rf, d);
- return (d);
-}
-
-/* Adds a delta to a rcsfile struct. Used by the parser. */
-void
-rcsfile_importdelta(struct rcsfile *rf, char *revnum, char *revdate, char *author,
- char *state, char *next)
-{
- struct branch *b;
- struct delta *d, *d_bp, *d_next;
- char *brev, *bprev;
- int trunk;
-
- d_next = NULL;
- d = rcsfile_getdelta(rf, revnum);
-
- if (d == NULL) {
- /* If not, we'll just create a new entry. */
- d = rcsfile_createdelta(revnum);
- d->placeholder = 0;
- } else {
- if (d->placeholder == 0) {
- lprintf(-1, "Trying to import already existing delta\n");
- return;
- }
- }
- /*
- * If already exists, assume that only revnum is filled out, and set the
- * rest of the fields. This should be an OK assumption given that we can
- * be sure internally that the structure is sufficiently initialized so
- * we won't have any unfreed memory.
- */
- d->revdate = xstrdup(revdate);
- d->author = xstrdup(author);
- if (state != NULL)
- d->state = xstrdup(state);
-
- /* If we have a next, create a placeholder for it. */
- if (next != NULL) {
- d_next = rcsfile_createdelta(next);
- d_next->placeholder = 1;
- /* Diffbase should be the previous. */
- d_next->diffbase = d;
- }
-
- /* If we're opening read-only, do minimal work. */
- if (rf->ro) {
- if (!d->placeholder)
- rcsfile_insertsorteddelta(rf, d);
- else
- d->placeholder = 0;
- if (d_next != NULL)
- rcsfile_insertsorteddelta(rf, d_next);
- return;
- }
-
- /* If it's trunk, insert it in the head branch list. */
- b = rcsrev_istrunk(d->revnum) ? rf->trunk : rcsfile_getbranch(rf,
- d->revnum);
-
- /*
- * We didn't find a branch, check if we can find a branchpoint and
- * create a branch there.
- */
- if (b == NULL) {
- brev = rcsrev_prefix(d->revnum);
- bprev = rcsrev_prefix(brev);
-
- d_bp = rcsfile_getdelta(rf, bprev);
- free(bprev);
- if (d_bp == NULL) {
- lprintf(-1, "No branch point for adding delta %s\n",
- d->revnum);
- return;
- }
-
- /* Create the branch and insert in delta. */
- b = xmalloc(sizeof(struct branch));
- b->revnum = brev;
- LIST_INIT(&b->deltalist);
- rcsdelta_insertbranch(d_bp, b);
- }
-
- /* Insert if not a placeholder. */
- if (!d->placeholder) {
- /* Insert both into the tree, and into the lookup list. */
- if (rcsrev_istrunk(d->revnum))
- rcsfile_insertdelta(b, d, 1);
- else {
- rcsfile_insertdelta(b, d, 0);
- /*
- * On import we need to set the diffbase to our
- * branchpoint for writing out later.
- */
- if (LIST_FIRST(&b->deltalist) == d) {
- brev = rcsrev_prefix(d->revnum);
- bprev = rcsrev_prefix(brev);
- d_bp = rcsfile_getdelta(rf, bprev);
- /* This should really not happen. */
- assert(d_bp != NULL);
- d->diffbase = d_bp;
- free(brev);
- free(bprev);
- }
- }
- rcsfile_insertsorteddelta(rf, d);
- } else /* Not a placeholder anymore. */ {
- d->placeholder = 0;
- /* Put it into the tree. */
- trunk = rcsrev_istrunk(d->revnum);
- rcsfile_insertdelta(b, d, trunk);
- }
-
- /* If we have a next, insert the placeholder into the lookup list. */
- if (d_next != NULL)
- rcsfile_insertsorteddelta(rf, d_next);
-}
-
-/*
- * Find the branch of a revision number.
- */
-static struct branch *
-rcsfile_getbranch(struct rcsfile *rf, char *revnum)
-{
- struct branch *b;
- struct delta *d;
- char *branchrev, *bprev;
-
- branchrev = rcsrev_prefix(revnum);
- bprev = rcsrev_prefix(branchrev);
- d = rcsfile_getdelta(rf, bprev);
- free(bprev);
- LIST_FOREACH(b, &d->branchlist, branch_next) {
- if(rcsnum_cmp(b->revnum, branchrev) == 0) {
- free(branchrev);
- return (b);
- }
- }
- free(branchrev);
- return (NULL);
-}
-
-/* Insert a branch into a delta, sorted by branch revision date. */
-static void
-rcsdelta_insertbranch(struct delta *d, struct branch *b)
-{
- struct branch *b_iter;
-
- /* If it's empty, insert into head. */
- if (LIST_EMPTY(&d->branchlist)) {
- LIST_INSERT_HEAD(&d->branchlist, b, branch_next);
- return;
- }
-
- /* Just put it in before the revdate that is lower. */
- LIST_FOREACH(b_iter, &d->branchlist, branch_next) {
- if (rcsnum_cmp(b->revnum, b_iter->revnum) > 0) {
- LIST_INSERT_BEFORE(b_iter, b, branch_next);
- return;
- }
- if (LIST_NEXT(b_iter, branch_next) == NULL)
- break;
- }
- /* Insert after last element. */
- LIST_INSERT_AFTER(b_iter, b, branch_next);
-}
-
-/* Insert a delta into the correct place in the table of the rcsfile. */
-static void
-rcsfile_insertsorteddelta(struct rcsfile *rf, struct delta *d)
-{
- struct delta *d2;
-
- /* If it's empty, insert into head. */
- if (LIST_EMPTY(&rf->deltatable)) {
- LIST_INSERT_HEAD(&rf->deltatable, d, table_next);
- return;
- }
-
- /* Just put it in before the revdate that is lower. */
- LIST_FOREACH(d2, &rf->deltatable, table_next) {
- if (rcsnum_cmp(d->revnum, d2->revnum) <= 0) {
- LIST_INSERT_BEFORE(d2, d, table_next);
- return;
- }
- if (LIST_NEXT(d2, table_next) == NULL)
- break;
- }
- /* Insert after last element. */
- LIST_INSERT_AFTER(d2, d, table_next);
-}
-
-/*
- * Insert a delta into the correct place in branch. A trunk branch will have
- * different ordering scheme and be sorted by revision number, but a normal
- * branch will be sorted by date to maintain compatibility with branches that
- * is "hand-hacked".
- */
-static void
-rcsfile_insertdelta(struct branch *b, struct delta *d, int trunk)
-{
- struct delta *d2;
-
- /* If it's empty, insert into head. */
- if (LIST_EMPTY(&b->deltalist)) {
- LIST_INSERT_HEAD(&b->deltalist, d, delta_next);
- return;
- }
-
- /*
- * Just put it in before the revnum that is lower. Sort trunk branch by
- * branchnum but the subbranches after deltadate.
- */
- LIST_FOREACH(d2, &b->deltalist, delta_next) {
- if (trunk) {
- if (rcsnum_cmp(d->revnum, d2->revnum) >= 0) {
- LIST_INSERT_BEFORE(d2, d, delta_next);
- return;
- }
- } else {
- /* XXX: here we depend on the date being set, but it
- * should be before this is called anyway. */
- if (rcsnum_cmp(d->revnum, d2->revnum) < 0) {
- LIST_INSERT_BEFORE(d2, d, delta_next);
- return;
- }
- }
- if (LIST_NEXT(d2, delta_next) == NULL)
- break;
- }
- /* Insert after last element. */
- LIST_INSERT_AFTER(d2, d, delta_next);
-}
-
-
-/* Add logtext to a delta. Assume the delta already exists. */
-int
-rcsdelta_addlog(struct delta *d, char *log, int len)
-{
- struct stream *dest;
- int nbytes;
-
- assert(d != NULL);
- /* Strip away '@' at beginning and end. */
- log++;
- len--;
- log[len - 1] = '\0';
- dest = stream_open_buf(d->log);
- nbytes = stream_write(dest, log, len - 1);
- stream_close(dest);
- return ((nbytes == -1) ? -1 : 0);
-}
-
-/* Add deltatext to a delta. Assume the delta already exists. */
-int
-rcsdelta_addtext(struct delta *d, char *text, int len)
-{
- struct stream *dest;
- int nbytes;
-
- assert(d != NULL);
- /* Strip away '@' at beginning and end. */
- text++;
- len--;
- text[len - 1] = '\0';
-
- dest = stream_open_buf(d->text);
- nbytes = stream_write(dest, text, len - 1);
- stream_close(dest);
- return ((nbytes == -1) ? -1 : 0);
-}
-
-/* Add a deltatext logline to a delta. */
-int
-rcsdelta_appendlog(struct delta *d, char *logline, size_t size)
-{
- struct stream *dest;
- int error;
-
- assert(d != NULL);
- dest = stream_open_buf(d->log);
- error = rcsdelta_writestring(logline, size, dest);
- stream_close(dest);
- return (error);
-}
-
-/* Add a deltatext textline to a delta. */
-int
-rcsdelta_appendtext(struct delta *d, char *textline, size_t size)
-{
- struct stream *dest;
- int error;
-
- assert(d != NULL);
- dest = stream_open_buf(d->text);
- error = rcsdelta_writestring(textline, size, dest);
- stream_close(dest);
- return (error);
-}
-
-static int
-rcsdelta_writestring(char *textline, size_t size, struct stream *dest)
-{
- char buf[3];
- size_t i;
- int count;
-
- for (i = 0; i < size; i++) {
- buf[0] = textline[i];
- buf[1] = '\0';
- count = 1;
- /* Expand @'s */
- if (buf[0] == '@') {
- buf[1] = '@';
- buf[2] = '\0';
- count = 2;
- }
- if (stream_write(dest, buf, count) == -1)
- return (-1);
- }
- return (0);
-}
-
-/* Set delta state. */
-void
-rcsdelta_setstate(struct delta *d, char *state)
-{
-
- if (d->state != NULL)
- free(state);
- if (state != NULL) {
- d->state = xstrdup(state);
- return;
- }
- d->state = NULL;
-}
-
-/* Truncate the deltalog with a certain offset. */
-void
-rcsdelta_truncatelog(struct delta *d, off_t offset)
-{
-
- stream_truncate_buf(d->log, offset);
-}
-
-/* Truncate the deltatext with a certain offset. */
-void
-rcsdelta_truncatetext(struct delta *d, off_t offset)
-{
-
- stream_truncate_buf(d->text, offset);
-}
diff --git a/usr.bin/csup/rcsfile.h b/usr.bin/csup/rcsfile.h
deleted file mode 100644
index 096ac96..0000000
--- a/usr.bin/csup/rcsfile.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*-
- * Copyright (c) 2007-2009, Ulf Lilleengen <lulf@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#ifndef _RCSFILE_H_
-#define _RCSFILE_H_
-
-/* RCSFILE fields. */
-#define RCSFILE_HEAD 0
-#define RCSFILE_BRANCH 1
-#define RCSFILE_STRICT 2
-#define RCSFILE_COMMENT 3
-#define RCSFILE_EXPAND 4
-#define RCSFILE_DESC 5
-
-struct rcsfile;
-struct delta;
-struct stream;
-
-/* Fetching, sending and writing an RCS file. */
-struct rcsfile *rcsfile_frompath(const char *, const char *, const char *,
- const char *, int);
-int rcsfile_send_details(struct rcsfile *, struct stream *);
-int rcsfile_write(struct rcsfile *, struct stream *);
-void rcsfile_print(struct rcsfile *);
-void rcsfile_free(struct rcsfile *);
-
-/* Used for adding and setting rcsfile values. */
-void rcsfile_addaccess(struct rcsfile *, char *);
-void rcsfile_addtag(struct rcsfile *, char *, char *);
-void rcsfile_importtag(struct rcsfile *, char *, char *);
-void rcsfile_deleterev(struct rcsfile *, char *);
-void rcsfile_deletetag(struct rcsfile *, char *, char *);
-struct delta *rcsfile_getdelta(struct rcsfile *, char *);
-void rcsfile_setval(struct rcsfile *, int, char *);
-
-/* Functions used for operating on RCS deltas. */
-struct delta *rcsfile_addelta(struct rcsfile *, char *, char *, char *,
- char *);
-void rcsfile_importdelta(struct rcsfile *, char *, char *, char *,
- char *, char *);
-
-int rcsdelta_addlog(struct delta *, char *, int);
-int rcsdelta_addtext(struct delta *, char *, int);
-int rcsdelta_appendlog(struct delta *, char *, size_t);
-int rcsdelta_appendtext(struct delta *, char *, size_t);
-void rcsdelta_setstate(struct delta *, char *);
-void rcsdelta_truncatetext(struct delta *, off_t);
-void rcsdelta_truncatelog(struct delta *, off_t);
-#endif /* !_RCSFILE_H_ */
diff --git a/usr.bin/csup/rcsparse.c b/usr.bin/csup/rcsparse.c
deleted file mode 100644
index bd46381..0000000
--- a/usr.bin/csup/rcsparse.c
+++ /dev/null
@@ -1,366 +0,0 @@
-/*-
- * Copyright (c) 2008-2009, Ulf Lilleengen <lulf@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <sys/queue.h>
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "misc.h"
-#include "rcsfile.h"
-#include "rcsparse.h"
-#include "rcstokenizer.h"
-
-/*
- * This is an RCS-parser using lex for tokenizing and makes sure the RCS syntax
- * is correct as it constructs an RCS file that is used by csup.
- */
-
-static void asserttoken(yyscan_t *, int);
-static int parse_admin(struct rcsfile *, yyscan_t *);
-static int parse_deltas(struct rcsfile *, yyscan_t *, int);
-static int parse_deltatexts(struct rcsfile *, yyscan_t *, int);
-static char *duptext(yyscan_t *, int *);
-
-struct string {
- char *str;
- STAILQ_ENTRY(string) next;
-};
-
-static void
-asserttoken(yyscan_t *sp, int token)
-{
- int t;
-
- t = token;
- t = rcslex(*sp);
- assert(t == token);
-}
-
-static char *
-duptext(yyscan_t *sp, int *arglen)
-{
- char *tmp, *val;
- int len;
-
- tmp = rcsget_text(*sp);
- len = rcsget_leng(*sp);
- val = xmalloc(len + 1);
- memcpy(val, tmp, len);
- val[len] = '\0';
- if (arglen != NULL)
- *arglen = len;
- return (val);
-}
-
-/*
- * Start up parser, and use the rcsfile hook to add objects.
- */
-int
-rcsparse_run(struct rcsfile *rf, FILE *infp, int ro)
-{
- yyscan_t scanner;
- char *desc;
- int error, tok;
-
- error = 0;
- rcslex_init(&scanner);
- rcsset_in(infp, scanner);
- tok = parse_admin(rf, &scanner);
- tok = parse_deltas(rf, &scanner, tok);
- assert(tok == KEYWORD);
- asserttoken(&scanner, STRING);
- desc = duptext(&scanner, NULL);
- rcsfile_setval(rf, RCSFILE_DESC, desc);
- free(desc);
- tok = rcslex(scanner);
- /* Parse deltatexts if we need to edit. */
- if (!ro) {
- error = parse_deltatexts(rf, &scanner, tok);
- if (error)
- return (error);
- }
- rcslex_destroy(scanner);
- return (0);
-}
-
-/*
- * Parse the admin part of a RCS file.
- */
-static int
-parse_admin(struct rcsfile *rf, yyscan_t *sp)
-{
- char *branch, *comment, *expand, *head, *id, *revnum, *tag, *tmp;
- int strict, token;
-
- strict = 0;
- branch = NULL;
-
- /* head {num}; */
- asserttoken(sp, KEYWORD);
- asserttoken(sp, NUM);
- head = duptext(sp, NULL);
- rcsfile_setval(rf, RCSFILE_HEAD, head);
- free(head);
- asserttoken(sp, SEMIC);
-
- /* { branch {num}; } */
- token = rcslex(*sp);
- if (token == KEYWORD_TWO) {
- asserttoken(sp, NUM);
- branch = duptext(sp, NULL);
- rcsfile_setval(rf, RCSFILE_BRANCH, branch);
- free(branch);
- asserttoken(sp, SEMIC);
- token = rcslex(*sp);
- }
-
- /* access {id]*; */
- assert(token == KEYWORD);
- token = rcslex(*sp);
- while (token == ID) {
- id = duptext(sp, NULL);
- rcsfile_addaccess(rf, id);
- free(id);
- token = rcslex(*sp);
- }
- assert(token == SEMIC);
-
- /* symbols {sym : num}*; */
- asserttoken(sp, KEYWORD);
- token = rcslex(*sp);
- while (token == ID) {
- tag = duptext(sp, NULL);
- asserttoken(sp, COLON);
- asserttoken(sp, NUM);
- revnum = duptext(sp, NULL);
- rcsfile_importtag(rf, tag, revnum);
- free(tag);
- free(revnum);
- token = rcslex(*sp);
- }
- assert(token == SEMIC);
-
- /* locks {id : num}*; */
- asserttoken(sp, KEYWORD);
- token = rcslex(*sp);
- while (token == ID) {
- /* XXX: locks field is skipped */
- asserttoken(sp, COLON);
- asserttoken(sp, NUM);
- token = rcslex(*sp);
- }
- assert(token == SEMIC);
- token = rcslex(*sp);
- while (token == KEYWORD) {
- tmp = rcsget_text(*sp);
-
- /* {strict ;} */
- if (!strcmp(tmp, "strict")) {
- rcsfile_setval(rf, RCSFILE_STRICT, tmp);
- asserttoken(sp, SEMIC);
- /* { comment {string}; } */
- } else if (!strcmp(tmp, "comment")) {
- token = rcslex(*sp);
- if (token == STRING) {
- comment = duptext(sp, NULL);
- rcsfile_setval(rf, RCSFILE_COMMENT, comment);
- free(comment);
- }
- asserttoken(sp, SEMIC);
- /* { expand {string}; } */
- } else if (!strcmp(tmp, "expand")) {
- token = rcslex(*sp);
- if (token == STRING) {
- expand = duptext(sp, NULL);
- rcsfile_setval(rf, RCSFILE_EXPAND, expand);
- free(expand);
- }
- asserttoken(sp, SEMIC);
- }
- /* {newphrase }* */
- token = rcslex(*sp);
- while (token == ID) {
- token = rcslex(*sp);
- /* XXX: newphrases ignored */
- while (token == ID || token == NUM || token == STRING ||
- token == COLON) {
- token = rcslex(*sp);
- }
- asserttoken(sp, SEMIC);
- token = rcslex(*sp);
- }
- }
- return (token);
-}
-
-/*
- * Parse RCS deltas.
- */
-static int
-parse_deltas(struct rcsfile *rf, yyscan_t *sp, int token)
-{
- STAILQ_HEAD(, string) branchlist;
- char *revnum, *revdate, *author, *state, *next;
-
- /* In case we don't have deltas. */
- if (token != NUM)
- return (token);
- do {
- next = NULL;
- state = NULL;
-
- /* num */
- assert(token == NUM);
- revnum = duptext(sp, NULL);
- /* date num; */
- asserttoken(sp, KEYWORD);
- asserttoken(sp, NUM);
- revdate = duptext(sp, NULL);
- asserttoken(sp, SEMIC);
- /* author id; */
- asserttoken(sp, KEYWORD);
- asserttoken(sp, ID);
- author = duptext(sp, NULL);
- asserttoken(sp, SEMIC);
- /* state {id}; */
- asserttoken(sp, KEYWORD);
- token = rcslex(*sp);
- if (token == ID) {
- state = duptext(sp, NULL);
- token = rcslex(*sp);
- }
- assert(token == SEMIC);
- /* branches {num}*; */
- asserttoken(sp, KEYWORD);
- token = rcslex(*sp);
- STAILQ_INIT(&branchlist);
- while (token == NUM)
- token = rcslex(*sp);
- assert(token == SEMIC);
- /* next {num}; */
- asserttoken(sp, KEYWORD);
- token = rcslex(*sp);
- if (token == NUM) {
- next = duptext(sp, NULL);
- token = rcslex(*sp);
- }
- assert(token == SEMIC);
- /* {newphrase }* */
- token = rcslex(*sp);
- while (token == ID) {
- token = rcslex(*sp);
- /* XXX: newphrases ignored. */
- while (token == ID || token == NUM || token == STRING ||
- token == COLON) {
- token = rcslex(*sp);
- }
- asserttoken(sp, SEMIC);
- token = rcslex(*sp);
- }
- rcsfile_importdelta(rf, revnum, revdate, author, state, next);
- free(revnum);
- free(revdate);
- free(author);
- if (state != NULL)
- free(state);
- if (next != NULL)
- free(next);
- } while (token == NUM);
-
- return (token);
-}
-
-/*
- * Parse RCS deltatexts.
- */
-static int
-parse_deltatexts(struct rcsfile *rf, yyscan_t *sp, int token)
-{
- struct delta *d;
- char *log, *revnum, *text;
- int error, len;
-
- error = 0;
- /* In case we don't have deltatexts. */
- if (token != NUM)
- return (-1);
- do {
- /* num */
- assert(token == NUM);
- revnum = duptext(sp, NULL);
- /* Get delta we're adding text to. */
- d = rcsfile_getdelta(rf, revnum);
- free(revnum);
-
- /*
- * XXX: The RCS file is corrupt, but lie and say it is ok.
- * If it is actually broken, then the MD5 mismatch will
- * trigger a fixup.
- */
- if (d == NULL)
- return (0);
-
- /* log string */
- asserttoken(sp, KEYWORD);
- asserttoken(sp, STRING);
- log = duptext(sp, &len);
- error = rcsdelta_addlog(d, log, len);
- free(log);
- if (error)
- return (-1);
- /* { newphrase }* */
- token = rcslex(*sp);
- while (token == ID) {
- token = rcslex(*sp);
- /* XXX: newphrases ignored. */
- while (token == ID || token == NUM || token == STRING ||
- token == COLON) {
- token = rcslex(*sp);
- }
- asserttoken(sp, SEMIC);
- token = rcslex(*sp);
- }
- /* text string */
- assert(token == KEYWORD);
- asserttoken(sp, STRING);
- text = duptext(sp, &len);
- error = rcsdelta_addtext(d, text, len);
- /*
- * If this happens, something is wrong with the RCS file, and it
- * should be resent.
- */
- free(text);
- if (error)
- return (-1);
- token = rcslex(*sp);
- } while (token == NUM);
-
- return (0);
-}
diff --git a/usr.bin/csup/rcsparse.h b/usr.bin/csup/rcsparse.h
deleted file mode 100644
index 01b0156..0000000
--- a/usr.bin/csup/rcsparse.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*-
- * Copyright (c) 2008-2009, Ulf Lilleengen <lulf@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#ifndef _RCSPARSE_H_
-#define _RCSPARSE_H_
-#define ID 0
-#define NUM 1
-#define KEYWORD 2
-#define KEYWORD_TWO 3
-#define STRING 4
-#define SEMIC 5
-#define COLON 6
-
-struct rcsfile;
-int rcsparse_run(struct rcsfile *, FILE *, int);
-#endif /* !_RCSPARSE_H_ */
diff --git a/usr.bin/csup/rcstokenizer.h b/usr.bin/csup/rcstokenizer.h
deleted file mode 100644
index 66ea724..0000000
--- a/usr.bin/csup/rcstokenizer.h
+++ /dev/null
@@ -1,333 +0,0 @@
-#ifndef rcsHEADER_H
-#define rcsHEADER_H 1
-#define rcsIN_HEADER 1
-
-#line 6 "rcstokenizer.h"
-
-#define YY_INT_ALIGNED short int
-
-/* A lexical scanner generated by flex */
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
-#if YY_FLEX_SUBMINOR_VERSION > 0
-#define FLEX_BETA
-#endif
-
-/* First, we deal with platform-specific or compiler-specific issues. */
-
-/* begin standard C headers. */
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-
-/* end standard C headers. */
-
-/* flex integer type definitions */
-
-#ifndef FLEXINT_H
-#define FLEXINT_H
-
-/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
-
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-
-/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types.
- */
-#ifndef __STDC_LIMIT_MACROS
-#define __STDC_LIMIT_MACROS 1
-#endif
-
-#include <inttypes.h>
-typedef int8_t flex_int8_t;
-typedef uint8_t flex_uint8_t;
-typedef int16_t flex_int16_t;
-typedef uint16_t flex_uint16_t;
-typedef int32_t flex_int32_t;
-typedef uint32_t flex_uint32_t;
-#else
-typedef signed char flex_int8_t;
-typedef short int flex_int16_t;
-typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
-typedef unsigned short int flex_uint16_t;
-typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
-
-/* Limits of integral types. */
-#ifndef INT8_MIN
-#define INT8_MIN (-128)
-#endif
-#ifndef INT16_MIN
-#define INT16_MIN (-32767-1)
-#endif
-#ifndef INT32_MIN
-#define INT32_MIN (-2147483647-1)
-#endif
-#ifndef INT8_MAX
-#define INT8_MAX (127)
-#endif
-#ifndef INT16_MAX
-#define INT16_MAX (32767)
-#endif
-#ifndef INT32_MAX
-#define INT32_MAX (2147483647)
-#endif
-#ifndef UINT8_MAX
-#define UINT8_MAX (255U)
-#endif
-#ifndef UINT16_MAX
-#define UINT16_MAX (65535U)
-#endif
-#ifndef UINT32_MAX
-#define UINT32_MAX (4294967295U)
-#endif
-
-#endif /* ! FLEXINT_H */
-
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else /* ! __cplusplus */
-
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
-
-#define YY_USE_CONST
-
-#endif /* defined (__STDC__) */
-#endif /* ! __cplusplus */
-
-#ifdef YY_USE_CONST
-#define yyconst const
-#else
-#define yyconst
-#endif
-
-/* An opaque pointer. */
-#ifndef YY_TYPEDEF_YY_SCANNER_T
-#define YY_TYPEDEF_YY_SCANNER_T
-typedef void* yyscan_t;
-#endif
-
-/* For convenience, these vars (plus the bison vars far below)
- are macros in the reentrant scanner. */
-#define yyin yyg->yyin_r
-#define yyout yyg->yyout_r
-#define yyextra yyg->yyextra_r
-#define yyleng yyg->yyleng_r
-#define yytext yyg->yytext_r
-#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
-#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
-#define yy_flex_debug yyg->yy_flex_debug_r
-
-/* Size of default input buffer. */
-#ifndef YY_BUF_SIZE
-#define YY_BUF_SIZE 16384
-#endif
-
-#ifndef YY_TYPEDEF_YY_BUFFER_STATE
-#define YY_TYPEDEF_YY_BUFFER_STATE
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-#endif
-
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
-#ifndef YY_STRUCT_YY_BUFFER_STATE
-#define YY_STRUCT_YY_BUFFER_STATE
-struct yy_buffer_state
- {
- FILE *yy_input_file;
-
- char *yy_ch_buf; /* input buffer */
- char *yy_buf_pos; /* current position in input buffer */
-
- /* Size of input buffer in bytes, not including room for EOB
- * characters.
- */
- yy_size_t yy_buf_size;
-
- /* Number of characters read into yy_ch_buf, not including EOB
- * characters.
- */
- int yy_n_chars;
-
- /* Whether we "own" the buffer - i.e., we know we created it,
- * and can realloc() it to grow it, and should free() it to
- * delete it.
- */
- int yy_is_our_buffer;
-
- /* Whether this is an "interactive" input source; if so, and
- * if we're using stdio for input, then we want to use getc()
- * instead of fread(), to make sure we stop fetching input after
- * each newline.
- */
- int yy_is_interactive;
-
- /* Whether we're considered to be at the beginning of a line.
- * If so, '^' rules will be active on the next match, otherwise
- * not.
- */
- int yy_at_bol;
-
- int yy_bs_lineno; /**< The line count. */
- int yy_bs_column; /**< The column count. */
-
- /* Whether to try to fill the input buffer when we reach the
- * end of it.
- */
- int yy_fill_buffer;
-
- int yy_buffer_status;
-
- };
-#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-
-void rcsrestart (FILE *input_file ,yyscan_t yyscanner );
-void rcs_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-YY_BUFFER_STATE rcs_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
-void rcs_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void rcs_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void rcspush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-void rcspop_buffer_state (yyscan_t yyscanner );
-
-YY_BUFFER_STATE rcs_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
-YY_BUFFER_STATE rcs_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE rcs_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
-
-void *rcsalloc (yy_size_t ,yyscan_t yyscanner );
-void *rcsrealloc (void *,yy_size_t ,yyscan_t yyscanner );
-void rcsfree (void * ,yyscan_t yyscanner );
-
-/* Begin user sect3 */
-
-#define rcswrap(n) 1
-#define YY_SKIP_YYWRAP
-
-#define yytext_ptr yytext_r
-
-#ifdef YY_HEADER_EXPORT_START_CONDITIONS
-#define INITIAL 0
-
-#endif
-
-#ifndef YY_NO_UNISTD_H
-/* Special case for "unistd.h", since it is non-ANSI. We include it way
- * down here because we want the user's section 1 to have been scanned first.
- * The user has a chance to override it with an option.
- */
-#include <unistd.h>
-#endif
-
-#ifndef YY_EXTRA_TYPE
-#define YY_EXTRA_TYPE void *
-#endif
-
-int rcslex_init (yyscan_t* scanner);
-
-int rcslex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
-
-/* Accessor methods to globals.
- These are made visible to non-reentrant scanners for convenience. */
-
-int rcslex_destroy (yyscan_t yyscanner );
-
-int rcsget_debug (yyscan_t yyscanner );
-
-void rcsset_debug (int debug_flag ,yyscan_t yyscanner );
-
-YY_EXTRA_TYPE rcsget_extra (yyscan_t yyscanner );
-
-void rcsset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
-
-FILE *rcsget_in (yyscan_t yyscanner );
-
-void rcsset_in (FILE * in_str ,yyscan_t yyscanner );
-
-FILE *rcsget_out (yyscan_t yyscanner );
-
-void rcsset_out (FILE * out_str ,yyscan_t yyscanner );
-
-int rcsget_leng (yyscan_t yyscanner );
-
-char *rcsget_text (yyscan_t yyscanner );
-
-int rcsget_lineno (yyscan_t yyscanner );
-
-void rcsset_lineno (int line_number ,yyscan_t yyscanner );
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#ifdef __cplusplus
-extern "C" int rcswrap (yyscan_t yyscanner );
-#else
-extern int rcswrap (yyscan_t yyscanner );
-#endif
-#endif
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
-#endif
-
-#ifndef YY_NO_INPUT
-
-#endif
-
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#define YY_READ_BUF_SIZE 8192
-#endif
-
-/* Number of entries by which start-condition stack grows. */
-#ifndef YY_START_STACK_INCR
-#define YY_START_STACK_INCR 25
-#endif
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#define YY_DECL_IS_OURS 1
-
-extern int rcslex (yyscan_t yyscanner);
-
-#define YY_DECL int rcslex (yyscan_t yyscanner)
-#endif /* !YY_DECL */
-
-/* yy_get_previous_state - get the state just before the EOB char was reached */
-
-#undef YY_NEW_FILE
-#undef YY_FLUSH_BUFFER
-#undef yy_set_bol
-#undef yy_new_buffer
-#undef yy_set_interactive
-#undef YY_DO_BEFORE_ACTION
-
-#ifdef YY_DECL_IS_OURS
-#undef YY_DECL_IS_OURS
-#undef YY_DECL
-#endif
-
-#line 73 "rcstokenizer.l"
-
-
-#line 332 "rcstokenizer.h"
-#undef rcsIN_HEADER
-#endif /* rcsHEADER_H */
diff --git a/usr.bin/csup/rsyncfile.c b/usr.bin/csup/rsyncfile.c
deleted file mode 100644
index 7680bcc..0000000
--- a/usr.bin/csup/rsyncfile.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/*-
- * Copyright (c) 2008-2009, Ulf Lilleengen <lulf@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-#include "misc.h"
-#include "rsyncfile.h"
-
-#define MINBLOCKSIZE 1024
-#define MAXBLOCKSIZE (16 * 1024)
-#define RECEIVEBUFFERSIZE (15 * 1024)
-#define BLOCKINFOSIZE 26
-#define SEARCHREGION 10
-#define MAXBLOCKS (RECEIVEBUFFERSIZE / BLOCKINFOSIZE)
-
-#define CHAR_OFFSET 3
-#define RSUM_SIZE 9
-
-struct rsyncfile {
- char *start;
- char *buf;
- char *end;
- size_t blocksize;
- size_t fsize;
- int fd;
-
- char *blockptr;
- int blocknum;
- char blockmd5[MD5_DIGEST_SIZE];
- char rsumstr[RSUM_SIZE];
- uint32_t rsum;
-};
-
-static size_t rsync_chooseblocksize(size_t);
-static uint32_t rsync_rollsum(char *, size_t);
-
-/* Open a file and initialize variable for rsync operation. */
-struct rsyncfile *
-rsync_open(char *path, size_t blocksize, int rdonly)
-{
- struct rsyncfile *rf;
- struct stat st;
- int error;
-
- rf = xmalloc(sizeof(*rf));
- error = stat(path, &st);
- if (error) {
- free(rf);
- return (NULL);
- }
- rf->fsize = st.st_size;
-
- rf->fd = open(path, rdonly ? O_RDONLY : O_RDWR);
- if (rf->fd < 0) {
- free(rf);
- return (NULL);
- }
- rf->buf = mmap(0, rf->fsize, PROT_READ, MAP_SHARED, rf->fd, 0);
- if (rf->buf == MAP_FAILED) {
- free(rf);
- return (NULL);
- }
- rf->start = rf->buf;
- rf->end = rf->buf + rf->fsize;
- rf->blocksize = (blocksize == 0 ? rsync_chooseblocksize(rf->fsize) :
- blocksize);
- rf->blockptr = rf->buf;
- rf->blocknum = 0;
- return (rf);
-}
-
-/* Close and free all resources related to an rsync file transfer. */
-int
-rsync_close(struct rsyncfile *rf)
-{
- int error;
-
- error = munmap(rf->buf, rf->fsize);
- if (error)
- return (error);
- close(rf->fd);
- free(rf);
- return (0);
-}
-
-/*
- * Choose the most appropriate block size for an rsync transfer. Modeled
- * algorithm after cvsup.
- */
-static size_t
-rsync_chooseblocksize(size_t fsize)
-{
- size_t bestrem, blocksize, bs, hisearch, losearch, rem;
-
- blocksize = fsize / MAXBLOCKS;
- losearch = blocksize - SEARCHREGION;
- hisearch = blocksize + SEARCHREGION;
-
- if (losearch < MINBLOCKSIZE) {
- losearch = MINBLOCKSIZE;
- hisearch = losearch + (2 * SEARCHREGION);
- } else if (hisearch > MAXBLOCKSIZE) {
- hisearch = MAXBLOCKSIZE;
- losearch = hisearch - (2 * SEARCHREGION);
- }
-
- bestrem = MAXBLOCKSIZE;
- for (bs = losearch; bs <= hisearch; bs++) {
- rem = fsize % bs;
- if (rem < bestrem) {
- bestrem = rem;
- blocksize = bs;
- }
- }
- return (bestrem);
-}
-
-/* Get the next rsync block of a file. */
-int
-rsync_nextblock(struct rsyncfile *rf)
-{
- MD5_CTX ctx;
- size_t blocksize;
-
- if (rf->blockptr >= rf->end)
- return (0);
- blocksize = min((size_t)(rf->end - rf->blockptr), rf->blocksize);
- /* Calculate MD5 of the block. */
- MD5_Init(&ctx);
- MD5_Update(&ctx, rf->blockptr, blocksize);
- MD5_End(rf->blockmd5, &ctx);
-
- rf->rsum = rsync_rollsum(rf->blockptr, blocksize);
- snprintf(rf->rsumstr, RSUM_SIZE, "%x", rf->rsum);
- rf->blocknum++;
- rf->blockptr += blocksize;
- return (1);
-}
-
-/* Get the rolling checksum of a file. */
-static uint32_t
-rsync_rollsum(char *buf, size_t len)
-{
- uint32_t a, b;
- char *ptr, *limit;
-
- a = b = 0;
- ptr = buf;
- limit = buf + len;
-
- while (ptr < limit) {
- a += *ptr + CHAR_OFFSET;
- b += a;
- ptr++;
- }
- return ((b << 16) | a);
-}
-
-/* Get running sum so far. */
-char *
-rsync_rsum(struct rsyncfile *rf)
-{
-
- return (rf->rsumstr);
-}
-
-/* Get MD5 of current block. */
-char *
-rsync_blockmd5(struct rsyncfile *rf)
-{
-
- return (rf->blockmd5);
-}
-
-/* Accessor for blocksize. */
-size_t
-rsync_blocksize(struct rsyncfile *rf)
-{
-
- return (rf->blocksize);
-}
-
-/* Accessor for filesize. */
-size_t
-rsync_filesize(struct rsyncfile *rf)
-{
-
- return (rf->fsize);
-}
diff --git a/usr.bin/csup/rsyncfile.h b/usr.bin/csup/rsyncfile.h
deleted file mode 100644
index 2c41a28..0000000
--- a/usr.bin/csup/rsyncfile.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*-
- * Copyright (c) 2008-2009, Ulf Lilleengen <lulf@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#ifndef _RSYNCFILE_H_
-#define _RSYNCFILE_H_
-
-struct rsyncfile;
-struct rsyncfile *rsync_open(char *, size_t, int);
-int rsync_nextblock(struct rsyncfile *);
-char *rsync_rsum(struct rsyncfile *);
-char *rsync_blockmd5(struct rsyncfile *);
-int rsync_close(struct rsyncfile *);
-size_t rsync_blocksize(struct rsyncfile *);
-size_t rsync_filesize(struct rsyncfile *);
-
-#endif /* !_RSYNCFILE_H_ */
diff --git a/usr.bin/csup/status.c b/usr.bin/csup/status.c
deleted file mode 100644
index 9cc02db..0000000
--- a/usr.bin/csup/status.c
+++ /dev/null
@@ -1,875 +0,0 @@
-/*-
- * Copyright (c) 2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <sys/queue.h>
-
-#include <assert.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "config.h"
-#include "fattr.h"
-#include "misc.h"
-#include "pathcomp.h"
-#include "proto.h"
-#include "status.h"
-#include "stream.h"
-
-#define STATUS_VERSION 5
-
-/* Internal error codes. */
-#define STATUS_ERR_READ (-1)
-#define STATUS_ERR_WRITE (-2)
-#define STATUS_ERR_PARSE (-3)
-#define STATUS_ERR_UNSORTED (-4)
-#define STATUS_ERR_TRUNC (-5)
-#define STATUS_ERR_BOGUS_DIRUP (-6)
-#define STATUS_ERR_BAD_TYPE (-7)
-#define STATUS_ERR_RENAME (-8)
-
-static struct status *status_new(char *, time_t, struct stream *);
-static struct statusrec *status_rd(struct status *);
-static struct statusrec *status_rdraw(struct status *, char **);
-static int status_wr(struct status *, struct statusrec *);
-static int status_wrraw(struct status *, struct statusrec *,
- char *);
-static struct status *status_fromrd(char *, struct stream *);
-static struct status *status_fromnull(char *);
-static void status_free(struct status *);
-
-static void statusrec_init(struct statusrec *);
-static void statusrec_fini(struct statusrec *);
-static int statusrec_cook(struct statusrec *, char *);
-static int statusrec_cmp(struct statusrec *, struct statusrec *);
-
-struct status {
- char *path;
- char *tempfile;
- int error;
- int suberror;
- struct pathcomp *pc;
- struct statusrec buf;
- struct statusrec *previous;
- struct statusrec *current;
- struct stream *rd;
- struct stream *wr;
- time_t scantime;
- int eof;
- int linenum;
- int depth;
- int dirty;
-};
-
-static void
-statusrec_init(struct statusrec *sr)
-{
-
- memset(sr, 0, sizeof(*sr));
-}
-
-static int
-statusrec_cook(struct statusrec *sr, char *line)
-{
- char *clientattr, *serverattr;
-
- switch (sr->sr_type) {
- case SR_FILEDEAD:
- case SR_FILELIVE:
- clientattr = proto_get_ascii(&line);
- if (clientattr == NULL || line != NULL)
- return (-1);
- sr->sr_clientattr = fattr_decode(clientattr);
- if (sr->sr_clientattr == NULL)
- return (-1);
- break;
- case SR_DIRDOWN:
- /* Nothing to do. */
- if (line != NULL)
- return (-1);
- break;
- case SR_CHECKOUTLIVE:
- sr->sr_tag = proto_get_ascii(&line);
- sr->sr_date = proto_get_ascii(&line);
- serverattr = proto_get_ascii(&line);
- sr->sr_revnum = proto_get_ascii(&line);
- sr->sr_revdate = proto_get_ascii(&line);
- clientattr = proto_get_ascii(&line);
- if (clientattr == NULL || line != NULL)
- return (-1);
- sr->sr_serverattr = fattr_decode(serverattr);
- if (sr->sr_serverattr == NULL)
- return (-1);
- sr->sr_clientattr = fattr_decode(clientattr);
- if (sr->sr_clientattr == NULL) {
- fattr_free(sr->sr_serverattr);
- return (-1);
- }
- break;
- case SR_CHECKOUTDEAD:
- sr->sr_tag = proto_get_ascii(&line);
- sr->sr_date = proto_get_ascii(&line);
- serverattr = proto_get_ascii(&line);
- if (serverattr == NULL || line != NULL)
- return (-1);
- sr->sr_serverattr = fattr_decode(serverattr);
- if (sr->sr_serverattr == NULL)
- return (-1);
- break;
- case SR_DIRUP:
- clientattr = proto_get_ascii(&line);
- if (clientattr == NULL || line != NULL)
- return (-1);
- sr->sr_clientattr = fattr_decode(clientattr);
- if (sr->sr_clientattr == NULL)
- return (-1);
- break;
- default:
- return (-1);
- }
- return (0);
-}
-
-static struct statusrec *
-status_rd(struct status *st)
-{
- struct statusrec *sr;
- char *line;
- int error;
-
- sr = status_rdraw(st, &line);
- if (sr == NULL)
- return (NULL);
- error = statusrec_cook(sr, line);
- if (error) {
- st->error = STATUS_ERR_PARSE;
- return (NULL);
- }
- return (sr);
-}
-
-static struct statusrec *
-status_rdraw(struct status *st, char **linep)
-{
- struct statusrec sr;
- char *cmd, *line, *file;
-
- if (st->rd == NULL || st->eof)
- return (NULL);
- line = stream_getln(st->rd, NULL);
- if (line == NULL) {
- if (stream_eof(st->rd)) {
- if (st->depth != 0) {
- st->error = STATUS_ERR_TRUNC;
- return (NULL);
- }
- st->eof = 1;
- return (NULL);
- }
- st->error = STATUS_ERR_READ;
- st->suberror = errno;
- return (NULL);
- }
- st->linenum++;
- cmd = proto_get_ascii(&line);
- file = proto_get_ascii(&line);
- if (file == NULL || strlen(cmd) != 1) {
- st->error = STATUS_ERR_PARSE;
- return (NULL);
- }
-
- switch (cmd[0]) {
- case 'A':
- sr.sr_type = SR_FILELIVE;
- break;
- case 'D':
- sr.sr_type = SR_DIRDOWN;
- st->depth++;
- break;
- case 'C':
- sr.sr_type = SR_CHECKOUTLIVE;
- break;
- case 'c':
- sr.sr_type = SR_CHECKOUTDEAD;
- break;
- case 'U':
- sr.sr_type = SR_DIRUP;
- if (st->depth <= 0) {
- st->error = STATUS_ERR_BOGUS_DIRUP;
- return (NULL);
- }
- st->depth--;
- break;
- case 'V':
- sr.sr_type = SR_FILELIVE;
- break;
- case 'v':
- sr.sr_type = SR_FILEDEAD;
- break;
- default:
- st->error = STATUS_ERR_BAD_TYPE;
- st->suberror = cmd[0];
- return (NULL);
- }
-
- sr.sr_file = xstrdup(file);
- if (st->previous != NULL &&
- statusrec_cmp(st->previous, &sr) >= 0) {
- st->error = STATUS_ERR_UNSORTED;
- free(sr.sr_file);
- return (NULL);
- }
-
- if (st->previous == NULL) {
- st->previous = &st->buf;
- } else {
- statusrec_fini(st->previous);
- statusrec_init(st->previous);
- }
- st->previous->sr_type = sr.sr_type;
- st->previous->sr_file = sr.sr_file;
- *linep = line;
- return (st->previous);
-}
-
-static int
-status_wr(struct status *st, struct statusrec *sr)
-{
- struct pathcomp *pc;
- const struct fattr *fa;
- char *name;
- int error, type, usedirupattr;
-
- pc = st->pc;
- error = 0;
- usedirupattr = 0;
- if (sr->sr_type == SR_DIRDOWN) {
- pathcomp_put(pc, PC_DIRDOWN, sr->sr_file);
- } else if (sr->sr_type == SR_DIRUP) {
- pathcomp_put(pc, PC_DIRUP, sr->sr_file);
- usedirupattr = 1;
- } else {
- pathcomp_put(pc, PC_FILE, sr->sr_file);
- }
-
- while (pathcomp_get(pc, &type, &name)) {
- if (type == PC_DIRDOWN) {
- error = proto_printf(st->wr, "D %s\n", name);
- } else if (type == PC_DIRUP) {
- if (usedirupattr)
- fa = sr->sr_clientattr;
- else
- fa = fattr_bogus;
- usedirupattr = 0;
- error = proto_printf(st->wr, "U %s %f\n", name, fa);
- }
- if (error)
- goto bad;
- }
-
- switch (sr->sr_type) {
- case SR_DIRDOWN:
- case SR_DIRUP:
- /* Already emitted above. */
- break;
- case SR_CHECKOUTLIVE:
- error = proto_printf(st->wr, "C %s %s %s %f %s %s %f\n",
- sr->sr_file, sr->sr_tag, sr->sr_date, sr->sr_serverattr,
- sr->sr_revnum, sr->sr_revdate, sr->sr_clientattr);
- break;
- case SR_CHECKOUTDEAD:
- error = proto_printf(st->wr, "c %s %s %s %f\n", sr->sr_file,
- sr->sr_tag, sr->sr_date, sr->sr_serverattr);
- break;
- case SR_FILELIVE:
- error = proto_printf(st->wr, "V %s %f\n", sr->sr_file,
- sr->sr_clientattr);
- break;
- case SR_FILEDEAD:
- error = proto_printf(st->wr, "v %s %f\n", sr->sr_file,
- sr->sr_clientattr);
- break;
- }
- if (error)
- goto bad;
- return (0);
-bad:
- st->error = STATUS_ERR_WRITE;
- st->suberror = errno;
- return (-1);
-}
-
-static int
-status_wrraw(struct status *st, struct statusrec *sr, char *line)
-{
- char *name;
- char cmd;
- int error, ret, type;
-
- if (st->wr == NULL)
- return (0);
-
- /*
- * Keep the compressor in sync. At this point, the necessary
- * DirDowns and DirUps should have already been emitted, so the
- * compressor should return exactly one value in the PC_DIRDOWN
- * and PC_DIRUP case and none in the PC_FILE case.
- */
- if (sr->sr_type == SR_DIRDOWN)
- pathcomp_put(st->pc, PC_DIRDOWN, sr->sr_file);
- else if (sr->sr_type == SR_DIRUP)
- pathcomp_put(st->pc, PC_DIRUP, sr->sr_file);
- else
- pathcomp_put(st->pc, PC_FILE, sr->sr_file);
- if (sr->sr_type == SR_DIRDOWN || sr->sr_type == SR_DIRUP) {
- ret = pathcomp_get(st->pc, &type, &name);
- assert(ret);
- if (sr->sr_type == SR_DIRDOWN)
- assert(type == PC_DIRDOWN);
- else
- assert(type == PC_DIRUP);
- }
- ret = pathcomp_get(st->pc, &type, &name);
- assert(!ret);
-
- switch (sr->sr_type) {
- case SR_DIRDOWN:
- cmd = 'D';
- break;
- case SR_DIRUP:
- cmd = 'U';
- break;
- case SR_CHECKOUTLIVE:
- cmd = 'C';
- break;
- case SR_CHECKOUTDEAD:
- cmd = 'c';
- break;
- case SR_FILELIVE:
- cmd = 'V';
- break;
- case SR_FILEDEAD:
- cmd = 'v';
- break;
- default:
- assert(0);
- return (-1);
- }
- if (sr->sr_type == SR_DIRDOWN)
- error = proto_printf(st->wr, "%c %S\n", cmd, sr->sr_file);
- else
- error = proto_printf(st->wr, "%c %s %S\n", cmd, sr->sr_file,
- line);
- if (error) {
- st->error = STATUS_ERR_WRITE;
- st->suberror = errno;
- return (-1);
- }
- return (0);
-}
-
-static void
-statusrec_fini(struct statusrec *sr)
-{
-
- fattr_free(sr->sr_serverattr);
- fattr_free(sr->sr_clientattr);
- free(sr->sr_file);
-}
-
-static int
-statusrec_cmp(struct statusrec *a, struct statusrec *b)
-{
- size_t lena, lenb;
-
- if (a->sr_type == SR_DIRUP || b->sr_type == SR_DIRUP) {
- lena = strlen(a->sr_file);
- lenb = strlen(b->sr_file);
- if (a->sr_type == SR_DIRUP &&
- ((lena < lenb && b->sr_file[lena] == '/') || lena == lenb)
- && strncmp(a->sr_file, b->sr_file, lena) == 0)
- return (1);
- if (b->sr_type == SR_DIRUP &&
- ((lenb < lena && a->sr_file[lenb] == '/') || lenb == lena)
- && strncmp(a->sr_file, b->sr_file, lenb) == 0)
- return (-1);
- }
- return (pathcmp(a->sr_file, b->sr_file));
-}
-
-static struct status *
-status_new(char *path, time_t scantime, struct stream *file)
-{
- struct status *st;
-
- st = xmalloc(sizeof(struct status));
- st->path = path;
- st->error = 0;
- st->suberror = 0;
- st->tempfile = NULL;
- st->scantime = scantime;
- st->rd = file;
- st->wr = NULL;
- st->previous = NULL;
- st->current = NULL;
- st->dirty = 0;
- st->eof = 0;
- st->linenum = 0;
- st->depth = 0;
- st->pc = pathcomp_new();
- statusrec_init(&st->buf);
- return (st);
-}
-
-static void
-status_free(struct status *st)
-{
-
- if (st->previous != NULL)
- statusrec_fini(st->previous);
- if (st->rd != NULL)
- stream_close(st->rd);
- if (st->wr != NULL)
- stream_close(st->wr);
- if (st->tempfile != NULL)
- free(st->tempfile);
- free(st->path);
- pathcomp_free(st->pc);
- free(st);
-}
-
-static struct status *
-status_fromrd(char *path, struct stream *file)
-{
- struct status *st;
- char *id, *line;
- time_t scantime;
- int error, ver;
-
- /* Get the first line of the file and validate it. */
- line = stream_getln(file, NULL);
- if (line == NULL) {
- stream_close(file);
- return (NULL);
- }
- id = proto_get_ascii(&line);
- error = proto_get_int(&line, &ver, 10);
- if (error) {
- stream_close(file);
- return (NULL);
- }
- error = proto_get_time(&line, &scantime);
- if (error || line != NULL) {
- stream_close(file);
- return (NULL);
- }
-
- if (strcmp(id, "F") != 0 || ver != STATUS_VERSION) {
- stream_close(file);
- return (NULL);
- }
-
- st = status_new(path, scantime, file);
- st->linenum = 1;
- return (st);
-}
-
-static struct status *
-status_fromnull(char *path)
-{
- struct status *st;
-
- st = status_new(path, -1, NULL);
- st->eof = 1;
- return (st);
-}
-
-/*
- * Open the status file. If scantime is not -1, the file is opened
- * for updating, otherwise, it is opened read-only. If the status file
- * couldn't be opened, NULL is returned and errmsg is set to the error
- * message.
- */
-struct status *
-status_open(struct coll *coll, time_t scantime, char **errmsg)
-{
- struct status *st;
- struct stream *file;
- struct fattr *fa;
- char *destpath, *path;
- int error, rv;
-
- path = coll_statuspath(coll);
- file = stream_open_file(path, O_RDONLY);
- if (file == NULL) {
- if (errno != ENOENT) {
- xasprintf(errmsg, "Could not open \"%s\": %s\n",
- path, strerror(errno));
- free(path);
- return (NULL);
- }
- st = status_fromnull(path);
- } else {
- st = status_fromrd(path, file);
- if (st == NULL) {
- xasprintf(errmsg, "Error in \"%s\": Bad header line",
- path);
- free(path);
- return (NULL);
- }
- }
-
- if (scantime != -1) {
- /* Open for writing too. */
- xasprintf(&destpath, "%s/%s/%s/", coll->co_base,
- coll->co_colldir, coll->co_name);
- st->tempfile = tempname(destpath);
- if (mkdirhier(destpath, coll->co_umask) != 0) {
- xasprintf(errmsg, "Cannot create directories leading "
- "to \"%s\": %s", destpath, strerror(errno));
- free(destpath);
- status_free(st);
- return (NULL);
- }
- free(destpath);
- st->wr = stream_open_file(st->tempfile,
- O_CREAT | O_TRUNC | O_WRONLY, 0644);
- if (st->wr == NULL) {
- xasprintf(errmsg, "Cannot create \"%s\": %s",
- st->tempfile, strerror(errno));
- status_free(st);
- return (NULL);
- }
- fa = fattr_new(FT_FILE, -1);
- fattr_mergedefault(fa);
- fattr_umask(fa, coll->co_umask);
- rv = fattr_install(fa, st->tempfile, NULL);
- fattr_free(fa);
- if (rv == -1) {
- xasprintf(errmsg,
- "Cannot set attributes for \"%s\": %s",
- st->tempfile, strerror(errno));
- status_free(st);
- return (NULL);
- }
- if (scantime != st->scantime)
- st->dirty = 1;
- error = proto_printf(st->wr, "F %d %t\n", STATUS_VERSION,
- scantime);
- if (error) {
- st->error = STATUS_ERR_WRITE;
- st->suberror = errno;
- *errmsg = status_errmsg(st);
- status_free(st);
- return (NULL);
- }
- }
- return (st);
-}
-
-/*
- * Get an entry from the status file. If name is NULL, the next entry
- * is returned. If name is not NULL, the entry matching this name is
- * returned, or NULL if it couldn't be found. If deleteto is set to 1,
- * all the entries read from the status file while looking for the
- * given name are deleted.
- */
-int
-status_get(struct status *st, char *name, int isdirup, int deleteto,
- struct statusrec **psr)
-{
- struct statusrec key;
- struct statusrec *sr;
- char *line;
- int c, error;
-
- if (st->eof)
- return (0);
-
- if (st->error)
- return (-1);
-
- if (name == NULL) {
- sr = status_rd(st);
- if (sr == NULL) {
- if (st->error)
- return (-1);
- return (0);
- }
- *psr = sr;
- return (1);
- }
-
- if (st->current != NULL) {
- sr = st->current;
- st->current = NULL;
- } else {
- sr = status_rd(st);
- if (sr == NULL) {
- if (st->error)
- return (-1);
- return (0);
- }
- }
-
- key.sr_file = name;
- if (isdirup)
- key.sr_type = SR_DIRUP;
- else
- key.sr_type = SR_CHECKOUTLIVE;
-
- c = statusrec_cmp(sr, &key);
- if (c < 0) {
- if (st->wr != NULL && !deleteto) {
- error = status_wr(st, sr);
- if (error)
- return (-1);
- }
- /* Loop until we find the good entry. */
- for (;;) {
- sr = status_rdraw(st, &line);
- if (sr == NULL) {
- if (st->error)
- return (-1);
- return (0);
- }
- c = statusrec_cmp(sr, &key);
- if (c >= 0)
- break;
- if (st->wr != NULL && !deleteto) {
- error = status_wrraw(st, sr, line);
- if (error)
- return (-1);
- }
- }
- error = statusrec_cook(sr, line);
- if (error) {
- st->error = STATUS_ERR_PARSE;
- return (-1);
- }
- }
- st->current = sr;
- if (c != 0)
- return (0);
- *psr = sr;
- return (1);
-}
-
-/*
- * Put this entry into the status file. If an entry with the same name
- * existed in the status file, it is replaced by this one, otherwise,
- * the entry is added to the status file.
- */
-int
-status_put(struct status *st, struct statusrec *sr)
-{
- struct statusrec *old;
- int error, ret;
-
- ret = status_get(st, sr->sr_file, sr->sr_type == SR_DIRUP, 0, &old);
- if (ret == -1)
- return (-1);
- if (ret) {
- if (old->sr_type == SR_DIRDOWN) {
- /* DirUp should never match DirDown */
- assert(old->sr_type != SR_DIRUP);
- if (sr->sr_type == SR_CHECKOUTLIVE ||
- sr->sr_type == SR_CHECKOUTDEAD) {
- /* We are replacing a directory with a file.
- Delete all entries inside the directory we
- are replacing. */
- ret = status_get(st, sr->sr_file, 1, 1, &old);
- if (ret == -1)
- return (-1);
- assert(ret);
- }
- } else
- st->current = NULL;
- }
- st->dirty = 1;
- error = status_wr(st, sr);
- if (error)
- return (-1);
- return (0);
-}
-
-/*
- * Delete the specified entry from the status file.
- */
-int
-status_delete(struct status *st, char *name, int isdirup)
-{
- struct statusrec *sr;
- int ret;
-
- ret = status_get(st, name, isdirup, 0, &sr);
- if (ret == -1)
- return (-1);
- if (ret) {
- st->current = NULL;
- st->dirty = 1;
- }
- return (0);
-}
-
-/*
- * Check whether we hit the end of file.
- */
-int
-status_eof(struct status *st)
-{
-
- return (st->eof);
-}
-
-/*
- * Returns the error message if there was an error, otherwise returns
- * NULL. The error message is allocated dynamically and needs to be
- * freed by the caller after use.
- */
-char *
-status_errmsg(struct status *st)
-{
- char *errmsg;
-
- if (!st->error)
- return (NULL);
- switch (st->error) {
- case STATUS_ERR_READ:
- xasprintf(&errmsg, "Read failure on \"%s\": %s",
- st->path, strerror(st->suberror));
- break;
- case STATUS_ERR_WRITE:
- xasprintf(&errmsg, "Write failure on \"%s\": %s",
- st->tempfile, strerror(st->suberror));
- break;
- case STATUS_ERR_PARSE:
- xasprintf(&errmsg, "Error in \"%s\": %d: "
- "Could not parse status record", st->path, st->linenum);
- break;
- case STATUS_ERR_UNSORTED:
- xasprintf(&errmsg, "Error in \"%s\": %d: "
- "File is not sorted properly", st->path, st->linenum);
- break;
- case STATUS_ERR_TRUNC:
- xasprintf(&errmsg, "Error in \"%s\": "
- "File is truncated", st->path);
- break;
- case STATUS_ERR_BOGUS_DIRUP:
- xasprintf(&errmsg, "Error in \"%s\": %d: "
- "\"U\" entry has no matching \"D\"", st->path, st->linenum);
- break;
- case STATUS_ERR_BAD_TYPE:
- xasprintf(&errmsg, "Error in \"%s\": %d: "
- "Invalid file type \"%c\"", st->path, st->linenum,
- st->suberror);
- break;
- case STATUS_ERR_RENAME:
- xasprintf(&errmsg, "Cannot rename \"%s\" to \"%s\": %s",
- st->tempfile, st->path, strerror(st->suberror));
- break;
- default:
- assert(0);
- return (NULL);
- }
- return (errmsg);
-}
-
-/*
- * Close the status file and free any resource associated with it.
- * It is OK to pass NULL for errmsg only if the status file was
- * opened read-only. If it wasn't opened read-only, status_close()
- * can produce an error and errmsg is not allowed to be NULL. If
- * there was no errors, errmsg is set to NULL.
- */
-void
-status_close(struct status *st, char **errmsg)
-{
- struct statusrec *sr;
- char *line, *name;
- int error, type;
-
- if (st->wr != NULL) {
- if (st->dirty) {
- if (st->current != NULL) {
- error = status_wr(st, st->current);
- if (error) {
- *errmsg = status_errmsg(st);
- goto bad;
- }
- st->current = NULL;
- }
- /* Copy the rest of the file. */
- while ((sr = status_rdraw(st, &line)) != NULL) {
- error = status_wrraw(st, sr, line);
- if (error) {
- *errmsg = status_errmsg(st);
- goto bad;
- }
- }
- if (st->error) {
- *errmsg = status_errmsg(st);
- goto bad;
- }
-
- /* Close off all the open directories. */
- pathcomp_finish(st->pc);
- while (pathcomp_get(st->pc, &type, &name)) {
- assert(type == PC_DIRUP);
- error = proto_printf(st->wr, "U %s %f\n",
- name, fattr_bogus);
- if (error) {
- st->error = STATUS_ERR_WRITE;
- st->suberror = errno;
- *errmsg = status_errmsg(st);
- goto bad;
- }
- }
-
- /* Rename tempfile. */
- error = rename(st->tempfile, st->path);
- if (error) {
- st->error = STATUS_ERR_RENAME;
- st->suberror = errno;
- *errmsg = status_errmsg(st);
- goto bad;
- }
- } else {
- /* Just discard the tempfile. */
- unlink(st->tempfile);
- }
- *errmsg = NULL;
- }
- status_free(st);
- return;
-bad:
- status_free(st);
-}
diff --git a/usr.bin/csup/status.h b/usr.bin/csup/status.h
deleted file mode 100644
index 86efdda..0000000
--- a/usr.bin/csup/status.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*-
- * Copyright (c) 2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#ifndef _STATUS_H_
-#define _STATUS_H_
-
-#include <time.h>
-
-struct coll;
-struct fattr;
-struct status;
-
-#define SR_DIRDOWN 0
-#define SR_CHECKOUTLIVE 1
-#define SR_CHECKOUTDEAD 2
-#define SR_FILELIVE 3
-#define SR_FILEDEAD 4
-#define SR_DIRUP 5
-
-struct statusrec {
- int sr_type;
- char *sr_file;
- char *sr_tag;
- char *sr_date;
- char *sr_revnum;
- char *sr_revdate;
-
- /*
- * "clientrttr" contains the attributes of the client's file if there
- * is one. "serverattr" contains the attributes of the corresponding
- * file on the server. In CVS mode, these are identical. But in
- * checkout mode, "clientattr" represents the checked-out file while
- * "serverattr" represents the corresponding RCS file on the server.
- */
- struct fattr *sr_serverattr;
- struct fattr *sr_clientattr;
-};
-
-struct status *status_open(struct coll *, time_t, char **);
-int status_get(struct status *, char *, int, int,
- struct statusrec **);
-int status_put(struct status *, struct statusrec *);
-int status_eof(struct status *);
-char *status_errmsg(struct status *);
-int status_delete(struct status *, char *, int);
-void status_close(struct status *, char **);
-
-#endif /* !_STATUS_H_ */
diff --git a/usr.bin/csup/stream.c b/usr.bin/csup/stream.c
deleted file mode 100644
index aa229b4..0000000
--- a/usr.bin/csup/stream.c
+++ /dev/null
@@ -1,1303 +0,0 @@
-/*-
- * Copyright (c) 2003-2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include <assert.h>
-#include <zlib.h>
-#include <err.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "misc.h"
-#include "stream.h"
-
-/*
- * Simple stream API to make my life easier. If the fgetln() and
- * funopen() functions were standard and if funopen() wasn't using
- * wrong types for the function pointers, I could have just used
- * stdio, but life sucks.
- *
- * For now, streams are always block-buffered.
- */
-
-/*
- * Try to quiet warnings as much as possible with GCC while staying
- * compatible with other compilers.
- */
-#ifndef __unused
-#if defined(__GNUC__) && (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-#define __unused __attribute__((__unused__))
-#else
-#define __unused
-#endif
-#endif
-
-/*
- * Flags passed to the flush methods.
- *
- * STREAM_FLUSH_CLOSING is passed during the last flush call before
- * closing a stream. This allows the zlib filter to emit the EOF
- * marker as appropriate. In all other cases, STREAM_FLUSH_NORMAL
- * should be passed.
- *
- * These flags are completely unused in the default flush method,
- * but they are very important for the flush method of the zlib
- * filter.
- */
-typedef enum {
- STREAM_FLUSH_NORMAL,
- STREAM_FLUSH_CLOSING
-} stream_flush_t;
-
-/*
- * This is because buf_new() will always allocate size + 1 bytes,
- * so our buffer sizes will still be power of 2 values.
- */
-#define STREAM_BUFSIZ 1023
-
-struct buf {
- char *buf;
- size_t size;
- size_t in;
- size_t off;
-};
-
-struct stream {
- void *cookie;
- int fd;
- int buf;
- struct buf *rdbuf;
- struct buf *wrbuf;
- stream_readfn_t *readfn;
- stream_writefn_t *writefn;
- stream_closefn_t *closefn;
- int eof;
- struct stream_filter *filter;
- void *fdata;
-};
-
-typedef int stream_filter_initfn_t(struct stream *, void *);
-typedef void stream_filter_finifn_t(struct stream *);
-typedef int stream_filter_flushfn_t(struct stream *, struct buf *,
- stream_flush_t);
-typedef ssize_t stream_filter_fillfn_t(struct stream *, struct buf *);
-
-struct stream_filter {
- stream_filter_t id;
- stream_filter_initfn_t *initfn;
- stream_filter_finifn_t *finifn;
- stream_filter_fillfn_t *fillfn;
- stream_filter_flushfn_t *flushfn;
-};
-
-/* Low-level buffer API. */
-#define buf_avail(buf) ((buf)->size - (buf)->off - (buf)->in)
-#define buf_count(buf) ((buf)->in)
-#define buf_size(buf) ((buf)->size)
-
-static void buf_more(struct buf *, size_t);
-static void buf_less(struct buf *, size_t);
-static void buf_grow(struct buf *, size_t);
-
-/* Internal stream functions. */
-static ssize_t stream_fill(struct stream *);
-static ssize_t stream_fill_default(struct stream *, struct buf *);
-static int stream_flush_int(struct stream *, stream_flush_t);
-static int stream_flush_default(struct stream *, struct buf *,
- stream_flush_t);
-
-/* Filters specific functions. */
-static struct stream_filter *stream_filter_lookup(stream_filter_t);
-static int stream_filter_init(struct stream *, void *);
-static void stream_filter_fini(struct stream *);
-
-/* The zlib stream filter declarations. */
-#define ZFILTER_EOF 1 /* Got Z_STREAM_END. */
-
-struct zfilter {
- int flags;
- struct buf *rdbuf;
- struct buf *wrbuf;
- z_stream *rdstate;
- z_stream *wrstate;
-};
-
-static int zfilter_init(struct stream *, void *);
-static void zfilter_fini(struct stream *);
-static ssize_t zfilter_fill(struct stream *, struct buf *);
-static int zfilter_flush(struct stream *, struct buf *,
- stream_flush_t);
-
-/* The MD5 stream filter. */
-struct md5filter {
- MD5_CTX ctx;
- char *md5;
- char lastc;
-#define PRINT 1
-#define WS 2
-#define STRING 3
-#define SEEN 4
- int state;
-};
-
-static int md5filter_init(struct stream *, void *);
-static void md5filter_fini(struct stream *);
-static ssize_t md5filter_fill(struct stream *, struct buf *);
-static int md5filter_flush(struct stream *, struct buf *,
- stream_flush_t);
-static int md5rcsfilter_flush(struct stream *, struct buf *,
- stream_flush_t);
-
-/* The available stream filters. */
-struct stream_filter stream_filters[] = {
- {
- STREAM_FILTER_NULL,
- NULL,
- NULL,
- stream_fill_default,
- stream_flush_default
- },
- {
- STREAM_FILTER_ZLIB,
- zfilter_init,
- zfilter_fini,
- zfilter_fill,
- zfilter_flush
- },
- {
- STREAM_FILTER_MD5,
- md5filter_init,
- md5filter_fini,
- md5filter_fill,
- md5filter_flush
- },
- {
- STREAM_FILTER_MD5RCS,
- md5filter_init,
- md5filter_fini,
- md5filter_fill,
- md5rcsfilter_flush
- }
-
-};
-
-
-/* Create a new buffer. */
-struct buf *
-buf_new(size_t size)
-{
- struct buf *buf;
-
- buf = xmalloc(sizeof(struct buf));
- /*
- * We keep one spare byte so that stream_getln() can put a '\0'
- * there in case the stream doesn't have an ending newline.
- */
- buf->buf = xmalloc(size + 1);
- memset(buf->buf, 0, size + 1);
- buf->size = size;
- buf->in = 0;
- buf->off = 0;
- return (buf);
-}
-
-/*
- * Grow the size of the buffer. If "need" is 0, bump its size to the
- * next power of 2 value. Otherwise, bump it to the next power of 2
- * value bigger than "need".
- */
-static void
-buf_grow(struct buf *buf, size_t need)
-{
-
- if (need == 0)
- buf->size = buf->size * 2 + 1; /* Account for the spare byte. */
- else {
- assert(need > buf->size);
- while (buf->size < need)
- buf->size = buf->size * 2 + 1;
- }
- buf->buf = xrealloc(buf->buf, buf->size + 1);
-}
-
-/* Make more room in the buffer if needed. */
-static void
-buf_prewrite(struct buf *buf)
-{
-
- if (buf_count(buf) == buf_size(buf))
- buf_grow(buf, 0);
- if (buf_count(buf) > 0 && buf_avail(buf) == 0) {
- memmove(buf->buf, buf->buf + buf->off, buf_count(buf));
- buf->off = 0;
- }
-}
-
-/* Account for "n" bytes being added in the buffer. */
-static void
-buf_more(struct buf *buf, size_t n)
-{
-
- assert(n <= buf_avail(buf));
- buf->in += n;
-}
-
-/* Account for "n" bytes having been read in the buffer. */
-static void
-buf_less(struct buf *buf, size_t n)
-{
-
- assert(n <= buf_count(buf));
- buf->in -= n;
- if (buf->in == 0)
- buf->off = 0;
- else
- buf->off += n;
-}
-
-/* Free a buffer. */
-void
-buf_free(struct buf *buf)
-{
-
- free(buf->buf);
- free(buf);
-}
-
-static struct stream *
-stream_new(stream_readfn_t *readfn, stream_writefn_t *writefn,
- stream_closefn_t *closefn)
-{
- struct stream *stream;
-
- stream = xmalloc(sizeof(struct stream));
- if (readfn == NULL && writefn == NULL) {
- errno = EINVAL;
- return (NULL);
- }
- if (readfn != NULL)
- stream->rdbuf = buf_new(STREAM_BUFSIZ);
- else
- stream->rdbuf = NULL;
- if (writefn != NULL)
- stream->wrbuf = buf_new(STREAM_BUFSIZ);
- else
- stream->wrbuf = NULL;
- stream->cookie = NULL;
- stream->fd = -1;
- stream->buf = 0;
- stream->readfn = readfn;
- stream->writefn = writefn;
- stream->closefn = closefn;
- stream->filter = stream_filter_lookup(STREAM_FILTER_NULL);
- stream->fdata = NULL;
- stream->eof = 0;
- return (stream);
-}
-
-/* Create a new stream associated with a void *. */
-struct stream *
-stream_open(void *cookie, stream_readfn_t *readfn, stream_writefn_t *writefn,
- stream_closefn_t *closefn)
-{
- struct stream *stream;
-
- stream = stream_new(readfn, writefn, closefn);
- stream->cookie = cookie;
- return (stream);
-}
-
-/* Associate a file descriptor with a stream. */
-struct stream *
-stream_open_fd(int fd, stream_readfn_t *readfn, stream_writefn_t *writefn,
- stream_closefn_t *closefn)
-{
- struct stream *stream;
-
- stream = stream_new(readfn, writefn, closefn);
- stream->cookie = &stream->fd;
- stream->fd = fd;
- return (stream);
-}
-
-/* Associate a buf with a stream. */
-struct stream *
-stream_open_buf(struct buf *b)
-{
- struct stream *stream;
-
- stream = stream_new(stream_read_buf, stream_append_buf, stream_close_buf);
- stream->cookie = b;
- stream->buf = 1;
- b->in = 0;
- return (stream);
-}
-
-/*
- * Truncate a buffer, just decrease offset pointer.
- * XXX: this can be dangerous if not used correctly.
- */
-void
-stream_truncate_buf(struct buf *b, off_t off)
-{
- b->off += off;
-}
-
-/* Like open() but returns a stream. */
-struct stream *
-stream_open_file(const char *path, int flags, ...)
-{
- struct stream *stream;
- stream_readfn_t *readfn;
- stream_writefn_t *writefn;
- va_list ap;
- mode_t mode;
- int fd;
-
- va_start(ap, flags);
- if (flags & O_CREAT) {
- /*
- * GCC says I should not be using mode_t here since it's
- * promoted to an int when passed through `...'.
- */
- mode = va_arg(ap, int);
- fd = open(path, flags, mode);
- } else
- fd = open(path, flags);
- va_end(ap);
- if (fd == -1)
- return (NULL);
-
- flags &= O_ACCMODE;
- if (flags == O_RDONLY) {
- readfn = stream_read_fd;
- writefn = NULL;
- } else if (flags == O_WRONLY) {
- readfn = NULL;
- writefn = stream_write_fd;
- } else if (flags == O_RDWR) {
- assert(flags == O_RDWR);
- readfn = stream_read_fd;
- writefn = stream_write_fd;
- } else {
- errno = EINVAL;
- close(fd);
- return (NULL);
- }
-
- stream = stream_open_fd(fd, readfn, writefn, stream_close_fd);
- if (stream == NULL)
- close(fd);
- return (stream);
-}
-
-/* Return the file descriptor associated with this stream, or -1. */
-int
-stream_fileno(struct stream *stream)
-{
-
- return (stream->fd);
-}
-
-/* Convenience read function for character buffers. */
-ssize_t
-stream_read_buf(void *cookie, void *buf, size_t size)
-{
- struct buf *b;
- size_t avail;
-
- /* Use in to be read offset. */
- b = (struct buf *)cookie;
- /* Just return what we have if the request is to large. */
- avail = b->off - b->in;
- if (avail < size) {
- memcpy(buf, (b->buf + b->in), avail);
- b->in += avail;
- return (avail);
- }
- memcpy(buf, (b->buf + b->in), size);
- b->in += size;
- return (size);
-}
-
-/* Convenience write function for appending character buffers. */
-ssize_t
-stream_append_buf(void *cookie, const void *buf, size_t size)
-{
- struct buf *b;
- size_t avail;
-
- /* Use off to be write offset. */
- b = (struct buf *)cookie;
-
- avail = b->size - b->off;
- if (size > avail)
- buf_grow(b, b->size + size);
- memcpy((b->buf + b->off), buf, size);
- b->off += size;
- b->buf[b->off] = '\0';
- return (size);
-}
-
-/* Convenience close function for freeing character buffers. */
-int
-stream_close_buf(void *cookie)
-{
- void *data;
-
- data = cookie;
- /* Basically a NOP. */
- return (0);
-}
-
-/* Convenience read function for file descriptors. */
-ssize_t
-stream_read_fd(void *cookie, void *buf, size_t size)
-{
- ssize_t nbytes;
- int fd;
-
- fd = *(int *)cookie;
- nbytes = read(fd, buf, size);
- return (nbytes);
-}
-
-/* Convenience write function for file descriptors. */
-ssize_t
-stream_write_fd(void *cookie, const void *buf, size_t size)
-{
- ssize_t nbytes;
- int fd;
-
- fd = *(int *)cookie;
- nbytes = write(fd, buf, size);
- return (nbytes);
-}
-
-/* Convenience close function for file descriptors. */
-int
-stream_close_fd(void *cookie)
-{
- int fd, ret;
-
- fd = *(int *)cookie;
- ret = close(fd);
- return (ret);
-}
-
-/* Read some bytes from the stream. */
-ssize_t
-stream_read(struct stream *stream, void *buf, size_t size)
-{
- struct buf *rdbuf;
- ssize_t ret;
- size_t n;
-
- rdbuf = stream->rdbuf;
- if (buf_count(rdbuf) == 0) {
- ret = stream_fill(stream);
- if (ret <= 0)
- return (-1);
- }
- n = min(size, buf_count(rdbuf));
- memcpy(buf, rdbuf->buf + rdbuf->off, n);
- buf_less(rdbuf, n);
- return (n);
-}
-
-/* A blocking stream_read call. */
-ssize_t
-stream_read_blocking(struct stream *stream, void *buf, size_t size)
-{
- struct buf *rdbuf;
- ssize_t ret;
- size_t n;
-
- rdbuf = stream->rdbuf;
- while (buf_count(rdbuf) <= size) {
- ret = stream_fill(stream);
- if (ret <= 0)
- return (-1);
- }
- /* XXX: Should be at least size bytes in the buffer, right? */
- /* Just do this to make sure. */
- n = min(size, buf_count(rdbuf));
- memcpy(buf, rdbuf->buf + rdbuf->off, n);
- buf_less(rdbuf, n);
- return (n);
-}
-
-/*
- * Read a line from the stream and return a pointer to it.
- *
- * If "len" is non-NULL, the length of the string will be put into it.
- * The pointer is only valid until the next stream API call. The line
- * can be modified by the caller, provided he doesn't write before or
- * after it.
- *
- * This is somewhat similar to the BSD fgetln() function, except that
- * "len" can be NULL here. In that case the string is terminated by
- * overwriting the '\n' character with a NUL character. If it's the
- * last line in the stream and it has no ending newline, we can still
- * add '\0' after it, because we keep one spare byte in the buffers.
- *
- * However, be warned that one can't handle binary lines properly
- * without knowing the size of the string since those can contain
- * NUL characters.
- */
-char *
-stream_getln(struct stream *stream, size_t *len)
-{
- struct buf *buf;
- char *cp, *line;
- ssize_t n;
- size_t done, size;
-
- buf = stream->rdbuf;
- if (buf_count(buf) == 0) {
- n = stream_fill(stream);
- if (n <= 0)
- return (NULL);
- }
- cp = memchr(buf->buf + buf->off, '\n', buf_count(buf));
- for (done = buf_count(buf); cp == NULL; done += n) {
- n = stream_fill(stream);
- if (n < 0)
- return (NULL);
- if (n == 0)
- /* Last line of the stream. */
- cp = buf->buf + buf->off + buf->in - 1;
- else
- cp = memchr(buf->buf + buf->off + done, '\n',
- buf_count(buf) - done);
- }
- line = buf->buf + buf->off;
- assert(cp >= line);
- size = cp - line + 1;
- buf_less(buf, size);
- if (len != NULL) {
- *len = size;
- } else {
- /* Terminate the string when len == NULL. */
- if (line[size - 1] == '\n')
- line[size - 1] = '\0';
- else
- line[size] = '\0';
- }
- return (line);
-}
-
-/* Write some bytes to a stream. */
-ssize_t
-stream_write(struct stream *stream, const void *src, size_t nbytes)
-{
- struct buf *buf;
- int error;
-
- buf = stream->wrbuf;
- if (nbytes > buf_size(buf))
- buf_grow(buf, nbytes);
- if (nbytes > buf_avail(buf)) {
- error = stream_flush_int(stream, STREAM_FLUSH_NORMAL);
- if (error)
- return (-1);
- }
- memcpy(buf->buf + buf->off + buf->in, src, nbytes);
- buf_more(buf, nbytes);
- return (nbytes);
-}
-
-/* Formatted output to a stream. */
-int
-stream_printf(struct stream *stream, const char *fmt, ...)
-{
- struct buf *buf;
- va_list ap;
- int error, ret;
-
- buf = stream->wrbuf;
-again:
- va_start(ap, fmt);
- ret = vsnprintf(buf->buf + buf->off + buf->in, buf_avail(buf), fmt, ap);
- va_end(ap);
- if (ret < 0)
- return (ret);
- if ((unsigned)ret >= buf_avail(buf)) {
- if ((unsigned)ret >= buf_size(buf))
- buf_grow(buf, ret + 1);
- if ((unsigned)ret >= buf_avail(buf)) {
- error = stream_flush_int(stream, STREAM_FLUSH_NORMAL);
- if (error)
- return (-1);
- }
- goto again;
- }
- buf_more(buf, ret);
- return (ret);
-}
-
-/* Flush the entire write buffer of the stream. */
-int
-stream_flush(struct stream *stream)
-{
- int error;
-
- error = stream_flush_int(stream, STREAM_FLUSH_NORMAL);
- return (error);
-}
-
-/* Internal flush API. */
-static int
-stream_flush_int(struct stream *stream, stream_flush_t how)
-{
- struct buf *buf;
- int error;
-
- buf = stream->wrbuf;
- error = (*stream->filter->flushfn)(stream, buf, how);
- assert(buf_count(buf) == 0);
- return (error);
-}
-
-/* The default flush method. */
-static int
-stream_flush_default(struct stream *stream, struct buf *buf,
- stream_flush_t __unused how)
-{
- ssize_t n;
-
- while (buf_count(buf) > 0) {
- do {
- n = (*stream->writefn)(stream->cookie,
- buf->buf + buf->off, buf_count(buf));
- } while (n == -1 && errno == EINTR);
- if (n <= 0)
- return (-1);
- buf_less(buf, n);
- }
- return (0);
-}
-
-/* Flush the write buffer and call fsync() on the file descriptor. */
-int
-stream_sync(struct stream *stream)
-{
- int error;
-
- if (stream->fd == -1) {
- errno = EINVAL;
- return (-1);
- }
- error = stream_flush_int(stream, STREAM_FLUSH_NORMAL);
- if (error)
- return (-1);
- error = fsync(stream->fd);
- return (error);
-}
-
-/* Like truncate() but on a stream. */
-int
-stream_truncate(struct stream *stream, off_t size)
-{
- int error;
-
- if (stream->fd == -1) {
- errno = EINVAL;
- return (-1);
- }
- error = stream_flush_int(stream, STREAM_FLUSH_NORMAL);
- if (error)
- return (-1);
- error = ftruncate(stream->fd, size);
- return (error);
-}
-
-/* Like stream_truncate() except the off_t parameter is an offset. */
-int
-stream_truncate_rel(struct stream *stream, off_t off)
-{
- struct stat sb;
- int error;
-
- if (stream->buf) {
- stream_truncate_buf(stream->cookie, off);
- return (0);
- }
- if (stream->fd == -1) {
- errno = EINVAL;
- return (-1);
- }
- error = stream_flush_int(stream, STREAM_FLUSH_NORMAL);
- if (error)
- return (-1);
- error = fstat(stream->fd, &sb);
- if (error)
- return (-1);
- error = stream_truncate(stream, sb.st_size + off);
- return (error);
-}
-
-/* Rewind the stream. */
-int
-stream_rewind(struct stream *stream)
-{
- int error;
-
- if (stream->fd == -1) {
- errno = EINVAL;
- return (-1);
- }
- if (stream->rdbuf != NULL)
- buf_less(stream->rdbuf, buf_count(stream->rdbuf));
- if (stream->wrbuf != NULL) {
- error = stream_flush_int(stream, STREAM_FLUSH_NORMAL);
- if (error)
- return (error);
- }
- error = lseek(stream->fd, 0, SEEK_SET);
- return (error);
-}
-
-/* Return EOF status. */
-int
-stream_eof(struct stream *stream)
-{
-
- return (stream->eof);
-}
-
-/* Close a stream and free any resources held by it. */
-int
-stream_close(struct stream *stream)
-{
- int error;
-
- if (stream == NULL)
- return (0);
-
- error = 0;
- if (stream->wrbuf != NULL)
- error = stream_flush_int(stream, STREAM_FLUSH_CLOSING);
- stream_filter_fini(stream);
- if (stream->closefn != NULL)
- /*
- * We might overwrite a previous error from stream_flush(),
- * but we have no choice, because wether it had worked or
- * not, we need to close the file descriptor.
- */
- error = (*stream->closefn)(stream->cookie);
- if (stream->rdbuf != NULL)
- buf_free(stream->rdbuf);
- if (stream->wrbuf != NULL)
- buf_free(stream->wrbuf);
- free(stream);
- return (error);
-}
-
-/* The default fill method. */
-static ssize_t
-stream_fill_default(struct stream *stream, struct buf *buf)
-{
- ssize_t n;
-
- if (stream->eof)
- return (0);
- assert(buf_avail(buf) > 0);
- n = (*stream->readfn)(stream->cookie, buf->buf + buf->off + buf->in,
- buf_avail(buf));
- if (n < 0)
- return (-1);
- if (n == 0) {
- stream->eof = 1;
- return (0);
- }
- buf_more(buf, n);
- return (n);
-}
-
-/*
- * Refill the read buffer. This function is not permitted to return
- * without having made more bytes available, unless there was an error.
- * Moreover, stream_fill() returns the number of bytes added.
- */
-static ssize_t
-stream_fill(struct stream *stream)
-{
- struct stream_filter *filter;
- struct buf *buf;
-#ifndef NDEBUG
- size_t oldcount;
-#endif
- ssize_t n;
-
- filter = stream->filter;
- buf = stream->rdbuf;
- buf_prewrite(buf);
-#ifndef NDEBUG
- oldcount = buf_count(buf);
-#endif
- n = (*filter->fillfn)(stream, buf);
- assert((n > 0 && n == (signed)(buf_count(buf) - oldcount)) ||
- (n <= 0 && buf_count(buf) == oldcount));
- return (n);
-}
-
-/*
- * Lookup a stream filter.
- *
- * We are not supposed to get passed an invalid filter id, since
- * filter ids are an enum type and we don't have invalid filter
- * ids in the enum :-). Thus, we are not checking for out of
- * bounds access here. If it happens, it's the caller's fault
- * anyway.
- */
-static struct stream_filter *
-stream_filter_lookup(stream_filter_t id)
-{
- struct stream_filter *filter;
-
- filter = stream_filters;
- while (filter->id != id)
- filter++;
- return (filter);
-}
-
-static int
-stream_filter_init(struct stream *stream, void *data)
-{
- struct stream_filter *filter;
- int error;
-
- filter = stream->filter;
- if (filter->initfn == NULL)
- return (0);
- error = (*filter->initfn)(stream, data);
- return (error);
-}
-
-static void
-stream_filter_fini(struct stream *stream)
-{
- struct stream_filter *filter;
-
- filter = stream->filter;
- if (filter->finifn != NULL)
- (*filter->finifn)(stream);
-}
-
-/*
- * Start a filter on a stream.
- */
-int
-stream_filter_start(struct stream *stream, stream_filter_t id, void *data)
-{
- struct stream_filter *filter;
- int error;
-
- filter = stream->filter;
- if (id == filter->id)
- return (0);
- stream_filter_fini(stream);
- stream->filter = stream_filter_lookup(id);
- stream->fdata = NULL;
- error = stream_filter_init(stream, data);
- return (error);
-}
-
-
-/* Stop a filter, this is equivalent to setting the null filter. */
-void
-stream_filter_stop(struct stream *stream)
-{
-
- stream_filter_start(stream, STREAM_FILTER_NULL, NULL);
-}
-
-/* The zlib stream filter implementation. */
-
-/* Take no chances with zlib... */
-static void *
-zfilter_alloc(void __unused *opaque, unsigned int items, unsigned int size)
-{
-
- return (xmalloc(items * size));
-}
-
-static void
-zfilter_free(void __unused *opaque, void *ptr)
-{
-
- free(ptr);
-}
-
-static int
-zfilter_init(struct stream *stream, void __unused *data)
-{
- struct zfilter *zf;
- struct buf *buf;
- z_stream *state;
- int rv;
-
- zf = xmalloc(sizeof(struct zfilter));
- memset(zf, 0, sizeof(struct zfilter));
- if (stream->rdbuf != NULL) {
- state = xmalloc(sizeof(z_stream));
- state->zalloc = zfilter_alloc;
- state->zfree = zfilter_free;
- state->opaque = Z_NULL;
- rv = inflateInit(state);
- if (rv != Z_OK)
- errx(1, "inflateInit: %s", state->msg);
- buf = buf_new(buf_size(stream->rdbuf));
- zf->rdbuf = stream->rdbuf;
- stream->rdbuf = buf;
- zf->rdstate = state;
- }
- if (stream->wrbuf != NULL) {
- state = xmalloc(sizeof(z_stream));
- state->zalloc = zfilter_alloc;
- state->zfree = zfilter_free;
- state->opaque = Z_NULL;
- rv = deflateInit(state, Z_DEFAULT_COMPRESSION);
- if (rv != Z_OK)
- errx(1, "deflateInit: %s", state->msg);
- buf = buf_new(buf_size(stream->wrbuf));
- zf->wrbuf = stream->wrbuf;
- stream->wrbuf = buf;
- zf->wrstate = state;
- }
- stream->fdata = zf;
- return (0);
-}
-
-static void
-zfilter_fini(struct stream *stream)
-{
- struct zfilter *zf;
- struct buf *zbuf;
- z_stream *state;
- ssize_t n;
-
- zf = stream->fdata;
- if (zf->rdbuf != NULL) {
- state = zf->rdstate;
- zbuf = zf->rdbuf;
- /*
- * Even if it has produced all the bytes, zlib sometimes
- * hasn't seen the EOF marker, so we need to call inflate()
- * again to make sure we have eaten all the zlib'ed bytes.
- */
- if ((zf->flags & ZFILTER_EOF) == 0) {
- n = zfilter_fill(stream, stream->rdbuf);
- assert(n == 0 && zf->flags & ZFILTER_EOF);
- }
- inflateEnd(state);
- free(state);
- buf_free(stream->rdbuf);
- stream->rdbuf = zbuf;
- }
- if (zf->wrbuf != NULL) {
- state = zf->wrstate;
- zbuf = zf->wrbuf;
- /*
- * Compress the remaining bytes in the buffer, if any,
- * and emit an EOF marker as appropriate. We ignore
- * the error because we can't do anything about it at
- * this point, and it can happen if we're getting
- * disconnected.
- */
- (void)zfilter_flush(stream, stream->wrbuf,
- STREAM_FLUSH_CLOSING);
- deflateEnd(state);
- free(state);
- buf_free(stream->wrbuf);
- stream->wrbuf = zbuf;
- }
- free(zf);
-}
-
-static int
-zfilter_flush(struct stream *stream, struct buf *buf, stream_flush_t how)
-{
- struct zfilter *zf;
- struct buf *zbuf;
- z_stream *state;
- size_t lastin, lastout, ate, prod;
- int done, error, flags, rv;
-
- zf = stream->fdata;
- state = zf->wrstate;
- zbuf = zf->wrbuf;
-
- if (how == STREAM_FLUSH_NORMAL)
- flags = Z_SYNC_FLUSH;
- else
- flags = Z_FINISH;
-
- done = 0;
- rv = Z_OK;
-
-again:
- /*
- * According to zlib.h, we should have at least 6 bytes
- * available when using deflate() with Z_SYNC_FLUSH.
- */
- if ((buf_avail(zbuf) < 6 && flags == Z_SYNC_FLUSH) ||
- rv == Z_BUF_ERROR || buf_avail(buf) == 0) {
- error = stream_flush_default(stream, zbuf, how);
- if (error)
- return (error);
- }
-
- state->next_in = (Bytef *)(buf->buf + buf->off);
- state->avail_in = buf_count(buf);
- state->next_out = (Bytef *)(zbuf->buf + zbuf->off + zbuf->in);
- state->avail_out = buf_avail(zbuf);
- lastin = state->avail_in;
- lastout = state->avail_out;
- rv = deflate(state, flags);
- if (rv != Z_BUF_ERROR && rv != Z_OK && rv != Z_STREAM_END)
- errx(1, "deflate: %s", state->msg);
- ate = lastin - state->avail_in;
- prod = lastout - state->avail_out;
- buf_less(buf, ate);
- buf_more(zbuf, prod);
- if ((flags == Z_SYNC_FLUSH && buf_count(buf) > 0) ||
- (flags == Z_FINISH && rv != Z_STREAM_END) ||
- (rv == Z_BUF_ERROR))
- goto again;
-
- assert(rv == Z_OK || (rv == Z_STREAM_END && flags == Z_FINISH));
- error = stream_flush_default(stream, zbuf, how);
- return (error);
-}
-
-static ssize_t
-zfilter_fill(struct stream *stream, struct buf *buf)
-{
- struct zfilter *zf;
- struct buf *zbuf;
- z_stream *state;
- size_t lastin, lastout, new;
- ssize_t n;
- int rv;
-
- zf = stream->fdata;
- state = zf->rdstate;
- zbuf = zf->rdbuf;
-
- assert(buf_avail(buf) > 0);
- if (buf_count(zbuf) == 0) {
- n = stream_fill_default(stream, zbuf);
- if (n <= 0)
- return (n);
- }
-again:
- assert(buf_count(zbuf) > 0);
- state->next_in = (Bytef *)(zbuf->buf + zbuf->off);
- state->avail_in = buf_count(zbuf);
- state->next_out = (Bytef *)(buf->buf + buf->off + buf->in);
- state->avail_out = buf_avail(buf);
- lastin = state->avail_in;
- lastout = state->avail_out;
- rv = inflate(state, Z_SYNC_FLUSH);
- buf_less(zbuf, lastin - state->avail_in);
- new = lastout - state->avail_out;
- if (new == 0 && rv != Z_STREAM_END) {
- n = stream_fill_default(stream, zbuf);
- if (n == -1)
- return (-1);
- if (n == 0)
- return (0);
- goto again;
- }
- if (rv != Z_STREAM_END && rv != Z_OK)
- errx(1, "inflate: %s", state->msg);
- if (rv == Z_STREAM_END)
- zf->flags |= ZFILTER_EOF;
- buf_more(buf, new);
- return (new);
-}
-
-/* The MD5 stream filter implementation. */
-static int
-md5filter_init(struct stream *stream, void *data)
-{
- struct md5filter *mf;
-
- mf = xmalloc(sizeof(struct md5filter));
- MD5_Init(&mf->ctx);
- mf->md5 = data;
- mf->lastc = ';';
- mf->state = PRINT;
- stream->fdata = mf;
- return (0);
-}
-
-static void
-md5filter_fini(struct stream *stream)
-{
- struct md5filter *mf;
-
- mf = stream->fdata;
- MD5_End(mf->md5, &mf->ctx);
- free(stream->fdata);
-}
-
-static ssize_t
-md5filter_fill(struct stream *stream, struct buf *buf)
-{
- ssize_t n;
-
- assert(buf_avail(buf) > 0);
- n = stream_fill_default(stream, buf);
- return (n);
-}
-
-static int
-md5filter_flush(struct stream *stream, struct buf *buf, stream_flush_t how)
-{
- struct md5filter *mf;
- int error;
-
- mf = stream->fdata;
- MD5_Update(&mf->ctx, buf->buf + buf->off, buf->in);
- error = stream_flush_default(stream, buf, how);
- return (error);
-}
-
-/* MD5 flush for RCS, where whitespaces are omitted. */
-static int
-md5rcsfilter_flush(struct stream *stream, struct buf *buf, stream_flush_t how)
-{
- struct md5filter *mf;
- char *ptr, *end;
- char *start;
- char space[2];
- int error;
-
- mf = stream->fdata;
- space[0] = ' ';
- space[1] = '\0';
- ptr = buf->buf + buf->off;
- end = buf->buf + buf->off + buf->in;
-
-#define IS_WS(var) ((var) == ' ' || (var) == '\n' || (var) == '\t' || \
- (var) == '\010' || (var) == '\013' || (var) == '\f' || \
- (var) == '\r')
-
-#define IS_SPECIAL(var) ((var) == '$' || (var) == ',' || (var) == ':' || \
- (var) == ';' || (var) == '@')
-
-#define IS_PRINT(var) (!IS_WS(var) && (var) != '@')
-
- /* XXX: We can do better than this state machine. */
- while (ptr < end) {
- switch (mf->state) {
- /* Outside RCS statements. */
- case PRINT:
- start = ptr;
- while (ptr < end && IS_PRINT(*ptr)) {
- mf->lastc = *ptr;
- ptr++;
- }
- MD5_Update(&mf->ctx, start, (ptr - start));
- if (ptr < end) {
- if (*ptr == '@') {
- MD5_Update(&mf->ctx, ptr, 1);
- ptr++;
- mf->state = STRING;
- } else {
- mf->state = WS;
- }
- }
- break;
- case WS:
- while (ptr < end && IS_WS(*ptr)) {
- ptr++;
- }
- if (ptr < end) {
- if (*ptr == '@') {
- if (mf->lastc == '@') {
- MD5_Update(&mf->ctx,
- space, 1);
- }
- MD5_Update(&mf->ctx, ptr, 1);
- ptr++;
- mf->state = STRING;
- } else {
- if (!IS_SPECIAL(*ptr) &&
- !IS_SPECIAL(mf->lastc)) {
- MD5_Update(&mf->ctx,
- space, 1);
- }
- mf->state = PRINT;
- }
- }
- break;
- case STRING:
- start = ptr;
- while (ptr < end && *ptr != '@') {
- ptr++;
- }
- MD5_Update(&mf->ctx, start, (ptr - start));
- if (ptr < end) {
- MD5_Update(&mf->ctx, ptr, 1);
- ptr++;
- mf->state = SEEN;
- }
- break;
- case SEEN:
- if (*ptr == '@') {
- MD5_Update(&mf->ctx, ptr, 1);
- ptr++;
- mf->state = STRING;
- } else if(IS_WS(*ptr)) {
- mf->lastc = '@';
- mf->state = WS;
- } else {
- mf->state = PRINT;
- }
- break;
- default:
- err(1, "Invalid state");
- break;
- }
- }
-
- error = stream_flush_default(stream, buf, how);
- return (error);
-}
-
diff --git a/usr.bin/csup/stream.h b/usr.bin/csup/stream.h
deleted file mode 100644
index 2128635..0000000
--- a/usr.bin/csup/stream.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*-
- * Copyright (c) 2003-2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#ifndef _STREAM_H_
-#define _STREAM_H_
-
-#include "misc.h"
-
-/* Stream filters. */
-typedef enum {
- STREAM_FILTER_NULL,
- STREAM_FILTER_ZLIB,
- STREAM_FILTER_MD5,
- STREAM_FILTER_MD5RCS
-} stream_filter_t;
-
-struct stream;
-struct buf;
-
-typedef ssize_t stream_readfn_t(void *, void *, size_t);
-typedef ssize_t stream_writefn_t(void *, const void *, size_t);
-typedef int stream_closefn_t(void *);
-
-/* Convenience functions for handling file descriptors. */
-stream_readfn_t stream_read_fd;
-stream_writefn_t stream_write_fd;
-stream_closefn_t stream_close_fd;
-
-/* Convenience functions for handling character buffers. */
-stream_readfn_t stream_read_buf;
-stream_writefn_t stream_append_buf;
-stream_closefn_t stream_close_buf;
-
-struct stream *stream_open(void *, stream_readfn_t *, stream_writefn_t *,
- stream_closefn_t *);
-struct stream *stream_open_fd(int, stream_readfn_t *, stream_writefn_t *,
- stream_closefn_t *);
-struct stream *stream_open_buf(struct buf *);
-struct stream *stream_open_file(const char *, int, ...);
-int stream_fileno(struct stream *);
-ssize_t stream_read(struct stream *, void *, size_t);
-ssize_t stream_read_blocking(struct stream *, void *, size_t);
-ssize_t stream_write(struct stream *, const void *, size_t);
-char *stream_getln(struct stream *, size_t *);
-int stream_printf(struct stream *, const char *, ...)
- __printflike(2, 3);
-int stream_flush(struct stream *);
-int stream_sync(struct stream *);
-int stream_truncate(struct stream *, off_t);
-void stream_truncate_buf(struct buf *, off_t);
-int stream_truncate_rel(struct stream *, off_t);
-int stream_rewind(struct stream *);
-int stream_eof(struct stream *);
-int stream_close(struct stream *);
-int stream_filter_start(struct stream *, stream_filter_t, void *);
-void stream_filter_stop(struct stream *);
-
-struct buf *buf_new(size_t);
-void buf_free(struct buf *);
-#endif /* !_STREAM_H_ */
diff --git a/usr.bin/csup/threads.c b/usr.bin/csup/threads.c
deleted file mode 100644
index 34e6e32..0000000
--- a/usr.bin/csup/threads.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*-
- * Copyright (c) 2004-2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <sys/queue.h>
-
-#include <assert.h>
-#include <err.h>
-#include <pthread.h>
-#include <stdlib.h>
-
-#include "misc.h"
-#include "threads.h"
-
-/*
- * This API is a wrapper around the pthread(3) API, which mainly
- * allows me to wait for multiple threads to exit. We use a
- * condition variable to signal a thread's death. All threads
- * created with this API have a common entry/exit point, so we
- * don't need to add any code in the threads themselves.
- */
-
-/* Structure describing a thread. */
-struct thread {
- pthread_t thread;
- void *(*start)(void *);
- void *data;
- struct threads *threads;
- LIST_ENTRY(thread) runlist;
- STAILQ_ENTRY(thread) deadlist;
-};
-
-/* A set of threads. */
-struct threads {
- pthread_mutex_t threads_mtx;
- pthread_cond_t thread_exited;
- LIST_HEAD(, thread) threads_running;
- STAILQ_HEAD(, thread) threads_dead;
-};
-
-static void *thread_start(void *); /* Common entry point for threads. */
-
-static void threads_lock(struct threads *);
-static void threads_unlock(struct threads *);
-
-static void
-threads_lock(struct threads *tds)
-{
- int error;
-
- error = pthread_mutex_lock(&tds->threads_mtx);
- assert(!error);
-}
-
-static void
-threads_unlock(struct threads *tds)
-{
- int error;
-
- error = pthread_mutex_unlock(&tds->threads_mtx);
- assert(!error);
-}
-
-/* Create a new set of threads. */
-struct threads *
-threads_new(void)
-{
- struct threads *tds;
-
- tds = xmalloc(sizeof(struct threads));
- pthread_mutex_init(&tds->threads_mtx, NULL);
- pthread_cond_init(&tds->thread_exited, NULL);
- LIST_INIT(&tds->threads_running);
- STAILQ_INIT(&tds->threads_dead);
- return (tds);
-}
-
-/* Create a new thread in this set. */
-void
-threads_create(struct threads *tds, void *(*start)(void *), void *data)
-{
- pthread_attr_t attr;
- struct thread *td;
- int error;
-
- td = xmalloc(sizeof(struct thread));
- td->threads = tds;
- td->start = start;
- td->data = data;
- /* We don't use pthread_join() to wait for the threads to finish. */
- pthread_attr_init(&attr);
- pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
- threads_lock(tds);
- error = pthread_create(&td->thread, &attr, thread_start, td);
- if (error)
- err(1, "pthread_create");
- LIST_INSERT_HEAD(&tds->threads_running, td, runlist);
- threads_unlock(tds);
-}
-
-/* Wait for a thread in the set to exit, and return its data pointer. */
-void *
-threads_wait(struct threads *tds)
-{
- struct thread *td;
- void *data;
-
- threads_lock(tds);
- while (STAILQ_EMPTY(&tds->threads_dead)) {
- assert(!LIST_EMPTY(&tds->threads_running));
- pthread_cond_wait(&tds->thread_exited, &tds->threads_mtx);
- }
- td = STAILQ_FIRST(&tds->threads_dead);
- STAILQ_REMOVE_HEAD(&tds->threads_dead, deadlist);
- threads_unlock(tds);
- data = td->data;
- free(td);
- return (data);
-}
-
-/* Free a threads set. */
-void
-threads_free(struct threads *tds)
-{
-
- assert(LIST_EMPTY(&tds->threads_running));
- assert(STAILQ_EMPTY(&tds->threads_dead));
- pthread_cond_destroy(&tds->thread_exited);
- pthread_mutex_destroy(&tds->threads_mtx);
- free(tds);
-}
-
-/*
- * Common entry point for threads. This just calls the real start
- * routine, and then signals the thread's death, after having
- * removed the thread from the list.
- */
-static void *
-thread_start(void *data)
-{
- struct threads *tds;
- struct thread *td;
-
- td = data;
- tds = td->threads;
- td->start(td->data);
- threads_lock(tds);
- LIST_REMOVE(td, runlist);
- STAILQ_INSERT_TAIL(&tds->threads_dead, td, deadlist);
- pthread_cond_signal(&tds->thread_exited);
- threads_unlock(tds);
- return (NULL);
-}
diff --git a/usr.bin/csup/threads.h b/usr.bin/csup/threads.h
deleted file mode 100644
index 66153ce..0000000
--- a/usr.bin/csup/threads.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*-
- * Copyright (c) 2004, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#ifndef _THREADS_H_
-#define _THREADS_H_
-
-struct threads;
-
-struct threads *threads_new(void);
-void threads_create(struct threads *, void *(*)(void *), void *);
-void *threads_wait(struct threads *);
-void threads_free(struct threads *);
-
-#endif /* !_THREADS_H_ */
diff --git a/usr.bin/csup/token.h b/usr.bin/csup/token.h
deleted file mode 100644
index 0dc3ec0..0000000
--- a/usr.bin/csup/token.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- * Copyright (c) 2003-2004, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#ifndef _TOKEN_H_
-#define _TOKEN_H_
-
-void yyerror(const char *);
-int yylex(void);
-int yyparse(void);
-
-/* Parsing tokens. */
-#define PT_BASE 0
-#define PT_DATE 1
-#define PT_HOST 2
-#define PT_PREFIX 3
-#define PT_RELEASE 4
-#define PT_TAG 5
-#define PT_UMASK 6
-#define PT_COMPRESS 7
-#define PT_DELETE 8
-#define PT_USE_REL_SUFFIX 9
-#define PT_LIST 10
-#define PT_NORSYNC 11
-
-#endif /* !_TOKEN_H_ */
diff --git a/usr.bin/csup/updater.c b/usr.bin/csup/updater.c
deleted file mode 100644
index e95ec10..0000000
--- a/usr.bin/csup/updater.c
+++ /dev/null
@@ -1,2043 +0,0 @@
-/*-
- * Copyright (c) 2003-2006, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include <assert.h>
-#include <err.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "config.h"
-#include "diff.h"
-#include "fattr.h"
-#include "fixups.h"
-#include "keyword.h"
-#include "updater.h"
-#include "misc.h"
-#include "mux.h"
-#include "proto.h"
-#include "rcsfile.h"
-#include "status.h"
-#include "stream.h"
-
-/* Internal error codes. */
-#define UPDATER_ERR_PROTO (-1) /* Protocol error. */
-#define UPDATER_ERR_MSG (-2) /* Error is in updater->errmsg. */
-#define UPDATER_ERR_READ (-3) /* Error reading from server. */
-#define UPDATER_ERR_DELETELIM (-4) /* File deletion limit exceeded. */
-
-#define BUFSIZE 4096
-
-/* Everything needed to update a file. */
-struct file_update {
- struct statusrec srbuf;
- char *destpath;
- char *temppath;
- char *origpath;
- char *coname; /* Points somewhere in destpath. */
- char *wantmd5;
- struct coll *coll;
- struct status *st;
- /* Those are only used for diff updating. */
- char *author;
- struct stream *orig;
- struct stream *to;
- int attic;
- int expand;
-};
-
-struct updater {
- struct config *config;
- struct stream *rd;
- char *errmsg;
- int deletecount;
-};
-
-static struct file_update *fup_new(struct coll *, struct status *);
-static int fup_prepare(struct file_update *, char *, int);
-static void fup_cleanup(struct file_update *);
-static void fup_free(struct file_update *);
-
-static void updater_prunedirs(char *, char *);
-static int updater_batch(struct updater *, int);
-static int updater_docoll(struct updater *, struct file_update *, int);
-static int updater_delete(struct updater *, struct file_update *);
-static void updater_deletefile(const char *);
-static int updater_checkout(struct updater *, struct file_update *, int);
-static int updater_addfile(struct updater *, struct file_update *,
- char *, int);
-int updater_addelta(struct rcsfile *, struct stream *, char *);
-static int updater_setattrs(struct updater *, struct file_update *,
- char *, char *, char *, char *, char *, struct fattr *);
-static int updater_setdirattrs(struct updater *, struct coll *,
- struct file_update *, char *, char *);
-static int updater_updatefile(struct updater *, struct file_update *fup,
- const char *, int);
-static int updater_updatenode(struct updater *, struct coll *,
- struct file_update *, char *, char *);
-static int updater_diff(struct updater *, struct file_update *);
-static int updater_diff_batch(struct updater *, struct file_update *);
-static int updater_diff_apply(struct updater *, struct file_update *,
- char *);
-static int updater_rcsedit(struct updater *, struct file_update *, char *,
- char *);
-int updater_append_file(struct updater *, struct file_update *,
- off_t);
-static int updater_rsync(struct updater *, struct file_update *, size_t);
-static int updater_read_checkout(struct stream *, struct stream *);
-
-static struct file_update *
-fup_new(struct coll *coll, struct status *st)
-{
- struct file_update *fup;
-
- fup = xmalloc(sizeof(struct file_update));
- memset(fup, 0, sizeof(*fup));
- fup->coll = coll;
- fup->st = st;
- return (fup);
-}
-
-static int
-fup_prepare(struct file_update *fup, char *name, int attic)
-{
- struct coll *coll;
-
- coll = fup->coll;
- fup->attic = 0;
- fup->origpath = NULL;
-
- if (coll->co_options & CO_CHECKOUTMODE)
- fup->destpath = checkoutpath(coll->co_prefix, name);
- else {
- fup->destpath = cvspath(coll->co_prefix, name, attic);
- fup->origpath = atticpath(coll->co_prefix, name);
- /* If they're equal, we don't need special care. */
- if (fup->origpath != NULL &&
- strcmp(fup->origpath, fup->destpath) == 0) {
- free(fup->origpath);
- fup->origpath = NULL;
- }
- fup->attic = attic;
- }
- if (fup->destpath == NULL)
- return (-1);
- fup->coname = fup->destpath + coll->co_prefixlen + 1;
- return (0);
-}
-
-/* Called after each file update to reinit the structure. */
-static void
-fup_cleanup(struct file_update *fup)
-{
- struct statusrec *sr;
-
- sr = &fup->srbuf;
-
- if (fup->destpath != NULL) {
- free(fup->destpath);
- fup->destpath = NULL;
- }
- if (fup->temppath != NULL) {
- free(fup->temppath);
- fup->temppath = NULL;
- }
- if (fup->origpath != NULL) {
- free(fup->origpath);
- fup->origpath = NULL;
- }
- fup->coname = NULL;
- if (fup->author != NULL) {
- free(fup->author);
- fup->author = NULL;
- }
- fup->expand = 0;
- if (fup->wantmd5 != NULL) {
- free(fup->wantmd5);
- fup->wantmd5 = NULL;
- }
- if (fup->orig != NULL) {
- stream_close(fup->orig);
- fup->orig = NULL;
- }
- if (fup->to != NULL) {
- stream_close(fup->to);
- fup->to = NULL;
- }
- if (sr->sr_file != NULL)
- free(sr->sr_file);
- if (sr->sr_tag != NULL)
- free(sr->sr_tag);
- if (sr->sr_date != NULL)
- free(sr->sr_date);
- if (sr->sr_revnum != NULL)
- free(sr->sr_revnum);
- if (sr->sr_revdate != NULL)
- free(sr->sr_revdate);
- fattr_free(sr->sr_clientattr);
- fattr_free(sr->sr_serverattr);
- memset(sr, 0, sizeof(*sr));
-}
-
-static void
-fup_free(struct file_update *fup)
-{
-
- fup_cleanup(fup);
- free(fup);
-}
-
-void *
-updater(void *arg)
-{
- struct thread_args *args;
- struct updater upbuf, *up;
- int error;
-
- args = arg;
-
- up = &upbuf;
- up->config = args->config;
- up->rd = args->rd;
- up->errmsg = NULL;
- up->deletecount = 0;
-
- error = updater_batch(up, 0);
-
- /*
- * Make sure to close the fixups even in case of an error,
- * so that the detailer thread doesn't block indefinitely.
- */
- fixups_close(up->config->fixups);
- if (!error)
- error = updater_batch(up, 1);
- switch (error) {
- case UPDATER_ERR_PROTO:
- xasprintf(&args->errmsg, "Updater failed: Protocol error");
- args->status = STATUS_FAILURE;
- break;
- case UPDATER_ERR_MSG:
- xasprintf(&args->errmsg, "Updater failed: %s", up->errmsg);
- free(up->errmsg);
- args->status = STATUS_FAILURE;
- break;
- case UPDATER_ERR_READ:
- if (stream_eof(up->rd)) {
- xasprintf(&args->errmsg, "Updater failed: "
- "Premature EOF from server");
- } else {
- xasprintf(&args->errmsg, "Updater failed: "
- "Network read failure: %s", strerror(errno));
- }
- args->status = STATUS_TRANSIENTFAILURE;
- break;
- case UPDATER_ERR_DELETELIM:
- xasprintf(&args->errmsg, "Updater failed: "
- "File deletion limit exceeded");
- args->status = STATUS_FAILURE;
- break;
- default:
- assert(error == 0);
- args->status = STATUS_SUCCESS;
- };
- return (NULL);
-}
-
-static int
-updater_batch(struct updater *up, int isfixups)
-{
- struct stream *rd;
- struct coll *coll;
- struct status *st;
- struct file_update *fup;
- char *line, *cmd, *errmsg, *collname, *release;
- int error;
-
- rd = up->rd;
- STAILQ_FOREACH(coll, &up->config->colls, co_next) {
- if (coll->co_options & CO_SKIP)
- continue;
- umask(coll->co_umask);
- line = stream_getln(rd, NULL);
- if (line == NULL)
- return (UPDATER_ERR_READ);
- cmd = proto_get_ascii(&line);
- collname = proto_get_ascii(&line);
- release = proto_get_ascii(&line);
- if (release == NULL || line != NULL)
- return (UPDATER_ERR_PROTO);
- if (strcmp(cmd, "COLL") != 0 ||
- strcmp(collname, coll->co_name) != 0 ||
- strcmp(release, coll->co_release) != 0)
- return (UPDATER_ERR_PROTO);
-
- if (!isfixups)
- lprintf(1, "Updating collection %s/%s\n", coll->co_name,
- coll->co_release);
-
- if (coll->co_options & CO_COMPRESS)
- stream_filter_start(rd, STREAM_FILTER_ZLIB, NULL);
-
- st = status_open(coll, coll->co_scantime, &errmsg);
- if (st == NULL) {
- up->errmsg = errmsg;
- return (UPDATER_ERR_MSG);
- }
- fup = fup_new(coll, st);
- error = updater_docoll(up, fup, isfixups);
- status_close(st, &errmsg);
- fup_free(fup);
- if (errmsg != NULL) {
- /* Discard previous error. */
- if (up->errmsg != NULL)
- free(up->errmsg);
- up->errmsg = errmsg;
- return (UPDATER_ERR_MSG);
- }
- if (error)
- return (error);
-
- if (coll->co_options & CO_COMPRESS)
- stream_filter_stop(rd);
- }
- line = stream_getln(rd, NULL);
- if (line == NULL)
- return (UPDATER_ERR_READ);
- if (strcmp(line, ".") != 0)
- return (UPDATER_ERR_PROTO);
- return (0);
-}
-
-static int
-updater_docoll(struct updater *up, struct file_update *fup, int isfixups)
-{
- struct stream *rd;
- struct coll *coll;
- struct statusrec srbuf, *sr;
- struct fattr *rcsattr, *tmp;
- char *attr, *cmd, *blocksize, *line, *msg;
- char *name, *tag, *date, *revdate;
- char *expand, *wantmd5, *revnum;
- char *optstr, *rcsopt, *pos;
- time_t t;
- off_t position;
- int attic, error, needfixupmsg;
-
- error = 0;
- rd = up->rd;
- coll = fup->coll;
- needfixupmsg = isfixups;
- while ((line = stream_getln(rd, NULL)) != NULL) {
- if (strcmp(line, ".") == 0)
- break;
- memset(&srbuf, 0, sizeof(srbuf));
- if (needfixupmsg) {
- lprintf(1, "Applying fixups for collection %s/%s\n",
- coll->co_name, coll->co_release);
- needfixupmsg = 0;
- }
- cmd = proto_get_ascii(&line);
- if (cmd == NULL || strlen(cmd) != 1)
- return (UPDATER_ERR_PROTO);
- switch (cmd[0]) {
- case 'T':
- /* Update recorded information for checked-out file. */
- name = proto_get_ascii(&line);
- tag = proto_get_ascii(&line);
- date = proto_get_ascii(&line);
- revnum = proto_get_ascii(&line);
- revdate = proto_get_ascii(&line);
- attr = proto_get_ascii(&line);
- if (attr == NULL || line != NULL)
- return (UPDATER_ERR_PROTO);
-
- rcsattr = fattr_decode(attr);
- if (rcsattr == NULL)
- return (UPDATER_ERR_PROTO);
-
- error = fup_prepare(fup, name, 0);
- if (error)
- return (UPDATER_ERR_PROTO);
- error = updater_setattrs(up, fup, name, tag, date,
- revnum, revdate, rcsattr);
- fattr_free(rcsattr);
- if (error)
- return (error);
- break;
- case 'c':
- /* Checkout dead file. */
- name = proto_get_ascii(&line);
- tag = proto_get_ascii(&line);
- date = proto_get_ascii(&line);
- attr = proto_get_ascii(&line);
- if (attr == NULL || line != NULL)
- return (UPDATER_ERR_PROTO);
-
- error = fup_prepare(fup, name, 0);
- if (error)
- return (UPDATER_ERR_PROTO);
- /* Theoritically, the file does not exist on the client.
- Just to make sure, we'll delete it here, if it
- exists. */
- if (access(fup->destpath, F_OK) == 0) {
- error = updater_delete(up, fup);
- if (error)
- return (error);
- }
-
- sr = &srbuf;
- sr->sr_type = SR_CHECKOUTDEAD;
- sr->sr_file = name;
- sr->sr_tag = tag;
- sr->sr_date = date;
- sr->sr_serverattr = fattr_decode(attr);
- if (sr->sr_serverattr == NULL)
- return (UPDATER_ERR_PROTO);
-
- error = status_put(fup->st, sr);
- fattr_free(sr->sr_serverattr);
- if (error) {
- up->errmsg = status_errmsg(fup->st);
- return (UPDATER_ERR_MSG);
- }
- break;
- case 'U':
- /* Update live checked-out file. */
- name = proto_get_ascii(&line);
- tag = proto_get_ascii(&line);
- date = proto_get_ascii(&line);
- proto_get_ascii(&line); /* XXX - oldRevNum */
- proto_get_ascii(&line); /* XXX - fromAttic */
- proto_get_ascii(&line); /* XXX - logLines */
- expand = proto_get_ascii(&line);
- attr = proto_get_ascii(&line);
- wantmd5 = proto_get_ascii(&line);
- if (wantmd5 == NULL || line != NULL)
- return (UPDATER_ERR_PROTO);
-
- sr = &fup->srbuf;
- sr->sr_type = SR_CHECKOUTLIVE;
- sr->sr_file = xstrdup(name);
- sr->sr_date = xstrdup(date);
- sr->sr_tag = xstrdup(tag);
- sr->sr_serverattr = fattr_decode(attr);
- if (sr->sr_serverattr == NULL)
- return (UPDATER_ERR_PROTO);
-
- fup->expand = keyword_decode_expand(expand);
- if (fup->expand == -1)
- return (UPDATER_ERR_PROTO);
- error = fup_prepare(fup, name, 0);
- if (error)
- return (UPDATER_ERR_PROTO);
-
- fup->wantmd5 = xstrdup(wantmd5);
- fup->temppath = tempname(fup->destpath);
- error = updater_diff(up, fup);
- if (error)
- return (error);
- break;
- case 'u':
- /* Update dead checked-out file. */
- name = proto_get_ascii(&line);
- tag = proto_get_ascii(&line);
- date = proto_get_ascii(&line);
- attr = proto_get_ascii(&line);
- if (attr == NULL || line != NULL)
- return (UPDATER_ERR_PROTO);
-
- error = fup_prepare(fup, name, 0);
- if (error)
- return (UPDATER_ERR_PROTO);
- error = updater_delete(up, fup);
- if (error)
- return (error);
- sr = &srbuf;
- sr->sr_type = SR_CHECKOUTDEAD;
- sr->sr_file = name;
- sr->sr_tag = tag;
- sr->sr_date = date;
- sr->sr_serverattr = fattr_decode(attr);
- if (sr->sr_serverattr == NULL)
- return (UPDATER_ERR_PROTO);
- error = status_put(fup->st, sr);
- fattr_free(sr->sr_serverattr);
- if (error) {
- up->errmsg = status_errmsg(fup->st);
- return (UPDATER_ERR_MSG);
- }
- break;
- case 'C':
- case 'Y':
- /* Checkout file. */
- name = proto_get_ascii(&line);
- tag = proto_get_ascii(&line);
- date = proto_get_ascii(&line);
- revnum = proto_get_ascii(&line);
- revdate = proto_get_ascii(&line);
- attr = proto_get_ascii(&line);
- if (attr == NULL || line != NULL)
- return (UPDATER_ERR_PROTO);
-
- sr = &fup->srbuf;
- sr->sr_type = SR_CHECKOUTLIVE;
- sr->sr_file = xstrdup(name);
- sr->sr_tag = xstrdup(tag);
- sr->sr_date = xstrdup(date);
- sr->sr_revnum = xstrdup(revnum);
- sr->sr_revdate = xstrdup(revdate);
- sr->sr_serverattr = fattr_decode(attr);
- if (sr->sr_serverattr == NULL)
- return (UPDATER_ERR_PROTO);
-
- t = rcsdatetotime(revdate);
- if (t == -1)
- return (UPDATER_ERR_PROTO);
-
- sr->sr_clientattr = fattr_new(FT_FILE, t);
- tmp = fattr_forcheckout(sr->sr_serverattr,
- coll->co_umask);
- fattr_override(sr->sr_clientattr, tmp, FA_MASK);
- fattr_free(tmp);
- fattr_mergedefault(sr->sr_clientattr);
- error = fup_prepare(fup, name, 0);
- if (error)
- return (UPDATER_ERR_PROTO);
- fup->temppath = tempname(fup->destpath);
- if (*cmd == 'Y')
- error = updater_checkout(up, fup, 1);
- else
- error = updater_checkout(up, fup, 0);
- if (error)
- return (error);
- break;
- case 'D':
- /* Delete file. */
- name = proto_get_ascii(&line);
- if (name == NULL || line != NULL)
- return (UPDATER_ERR_PROTO);
- error = fup_prepare(fup, name, 0);
- if (error)
- return (UPDATER_ERR_PROTO);
- error = updater_delete(up, fup);
- if (error)
- return (error);
- error = status_delete(fup->st, name, 0);
- if (error) {
- up->errmsg = status_errmsg(fup->st);
- return (UPDATER_ERR_MSG);
- }
- break;
- case 'A':
- case 'a':
- case 'R':
- name = proto_get_ascii(&line);
- attr = proto_get_ascii(&line);
- if (name == NULL || attr == NULL || line != NULL)
- return (UPDATER_ERR_PROTO);
- attic = (cmd[0] == 'a');
- error = fup_prepare(fup, name, attic);
- if (error)
- return (UPDATER_ERR_PROTO);
-
- fup->temppath = tempname(fup->destpath);
- sr = &fup->srbuf;
- sr->sr_type = attic ? SR_FILEDEAD : SR_FILELIVE;
- sr->sr_file = xstrdup(name);
- sr->sr_serverattr = fattr_decode(attr);
- if (sr->sr_serverattr == NULL)
- return (UPDATER_ERR_PROTO);
- if (attic)
- lprintf(1, " Create %s -> Attic\n", name);
- else
- lprintf(1, " Create %s\n", name);
- error = updater_addfile(up, fup, attr, 0);
- if (error)
- return (error);
- break;
- case 'r':
- name = proto_get_ascii(&line);
- attr = proto_get_ascii(&line);
- blocksize = proto_get_ascii(&line);
- wantmd5 = proto_get_ascii(&line);
- if (name == NULL || attr == NULL || blocksize == NULL ||
- wantmd5 == NULL) {
- return (UPDATER_ERR_PROTO);
- }
- error = fup_prepare(fup, name, 0);
- if (error)
- return (UPDATER_ERR_PROTO);
- fup->wantmd5 = xstrdup(wantmd5);
- fup->temppath = tempname(fup->destpath);
- sr = &fup->srbuf;
- sr->sr_file = xstrdup(name);
- sr->sr_serverattr = fattr_decode(attr);
- sr->sr_type = SR_FILELIVE;
- if (sr->sr_serverattr == NULL)
- return (UPDATER_ERR_PROTO);
- error = updater_rsync(up, fup, strtol(blocksize, NULL,
- 10));
- if (error)
- return (error);
- break;
- case 'I':
- /*
- * Create directory and add DirDown entry in status
- * file.
- */
- name = proto_get_ascii(&line);
- if (name == NULL || line != NULL)
- return (UPDATER_ERR_PROTO);
- error = fup_prepare(fup, name, 0);
- if (error)
- return (UPDATER_ERR_PROTO);
- sr = &fup->srbuf;
- sr->sr_type = SR_DIRDOWN;
- sr->sr_file = xstrdup(name);
- sr->sr_serverattr = NULL;
- sr->sr_clientattr = fattr_new(FT_DIRECTORY, -1);
- fattr_mergedefault(sr->sr_clientattr);
-
- error = mkdirhier(fup->destpath, coll->co_umask);
- if (error)
- return (UPDATER_ERR_PROTO);
- if (access(fup->destpath, F_OK) != 0) {
- lprintf(1, " Mkdir %s\n", name);
- error = fattr_makenode(sr->sr_clientattr,
- fup->destpath);
- if (error)
- return (UPDATER_ERR_PROTO);
- }
- error = status_put(fup->st, sr);
- if (error) {
- up->errmsg = status_errmsg(fup->st);
- return (UPDATER_ERR_MSG);
- }
- break;
- case 'i':
- /* Remove DirDown entry in status file. */
- name = proto_get_ascii(&line);
- if (name == NULL || line != NULL)
- return (UPDATER_ERR_PROTO);
- error = fup_prepare(fup, name, 0);
- if (error)
- return (UPDATER_ERR_PROTO);
- error = status_delete(fup->st, name, 0);
- if (error) {
- up->errmsg = status_errmsg(fup->st);
- return (UPDATER_ERR_MSG);
- }
- break;
- case 'J':
- /*
- * Set attributes of directory and update DirUp entry in
- * status file.
- */
- name = proto_get_ascii(&line);
- if (name == NULL)
- return (UPDATER_ERR_PROTO);
- attr = proto_get_ascii(&line);
- if (attr == NULL || line != NULL)
- return (UPDATER_ERR_PROTO);
- error = fup_prepare(fup, name, 0);
- if (error)
- return (UPDATER_ERR_PROTO);
- error = updater_setdirattrs(up, coll, fup, name, attr);
- if (error)
- return (error);
- break;
- case 'j':
- /*
- * Remove directory and delete its DirUp entry in status
- * file.
- */
- name = proto_get_ascii(&line);
- if (name == NULL || line != NULL)
- return (UPDATER_ERR_PROTO);
- error = fup_prepare(fup, name, 0);
- if (error)
- return (UPDATER_ERR_PROTO);
- lprintf(1, " Rmdir %s\n", name);
- updater_deletefile(fup->destpath);
- error = status_delete(fup->st, name, 0);
- if (error) {
- up->errmsg = status_errmsg(fup->st);
- return (UPDATER_ERR_MSG);
- }
- break;
- case 'L':
- case 'l':
- name = proto_get_ascii(&line);
- if (name == NULL)
- return (UPDATER_ERR_PROTO);
- attr = proto_get_ascii(&line);
- if (attr == NULL || line != NULL)
- return (UPDATER_ERR_PROTO);
- attic = (cmd[0] == 'l');
- sr = &fup->srbuf;
- sr->sr_type = attic ? SR_FILEDEAD : SR_FILELIVE;
- sr->sr_file = xstrdup(name);
- sr->sr_serverattr = fattr_decode(attr);
- sr->sr_clientattr = fattr_decode(attr);
- if (sr->sr_serverattr == NULL ||
- sr->sr_clientattr == NULL)
- return (UPDATER_ERR_PROTO);
-
- /* Save space. Described in detail in updatefile. */
- if (!(fattr_getmask(sr->sr_clientattr) & FA_LINKCOUNT)
- || fattr_getlinkcount(sr->sr_clientattr) <= 1)
- fattr_maskout(sr->sr_clientattr,
- FA_DEV | FA_INODE);
- fattr_maskout(sr->sr_clientattr, FA_FLAGS);
- error = status_put(fup->st, sr);
- if (error) {
- up->errmsg = status_errmsg(fup->st);
- return (UPDATER_ERR_MSG);
- }
- break;
- case 'N':
- case 'n':
- name = proto_get_ascii(&line);
- attr = proto_get_ascii(&line);
- if (name == NULL || attr == NULL || line != NULL)
- return (UPDATER_ERR_PROTO);
- attic = (cmd[0] == 'n');
- error = fup_prepare(fup, name, attic);
- if (error)
- return (UPDATER_ERR_PROTO);
- sr = &fup->srbuf;
- sr->sr_type = (attic ? SR_FILEDEAD : SR_FILELIVE);
- sr->sr_file = xstrdup(name);
- sr->sr_serverattr = fattr_decode(attr);
- sr->sr_clientattr = fattr_new(FT_SYMLINK, -1);
- fattr_mergedefault(sr->sr_clientattr);
- fattr_maskout(sr->sr_clientattr, FA_FLAGS);
- error = updater_updatenode(up, coll, fup, name, attr);
- if (error)
- return (error);
- break;
- case 'V':
- case 'v':
- name = proto_get_ascii(&line);
- attr = proto_get_ascii(&line);
- optstr = proto_get_ascii(&line);
- wantmd5 = proto_get_ascii(&line);
- rcsopt = NULL; /* XXX: Not supported. */
- if (attr == NULL || line != NULL || wantmd5 == NULL)
- return (UPDATER_ERR_PROTO);
- attic = (cmd[0] == 'v');
- error = fup_prepare(fup, name, attic);
- if (error)
- return (UPDATER_ERR_PROTO);
- fup->temppath = tempname(fup->destpath);
- fup->wantmd5 = xstrdup(wantmd5);
- sr = &fup->srbuf;
- sr->sr_type = attic ? SR_FILEDEAD : SR_FILELIVE;
- sr->sr_file = xstrdup(name);
- sr->sr_serverattr = fattr_decode(attr);
- if (sr->sr_serverattr == NULL)
- return (UPDATER_ERR_PROTO);
-
- error = updater_rcsedit(up, fup, name, rcsopt);
- if (error)
- return (error);
- break;
- case 'X':
- case 'x':
- name = proto_get_ascii(&line);
- attr = proto_get_ascii(&line);
- if (name == NULL || attr == NULL || line != NULL)
- return (UPDATER_ERR_PROTO);
- attic = (cmd[0] == 'x');
- error = fup_prepare(fup, name, attic);
- if (error)
- return (UPDATER_ERR_PROTO);
-
- fup->temppath = tempname(fup->destpath);
- sr = &fup->srbuf;
- sr->sr_type = attic ? SR_FILEDEAD : SR_FILELIVE;
- sr->sr_file = xstrdup(name);
- sr->sr_serverattr = fattr_decode(attr);
- if (sr->sr_serverattr == NULL)
- return (UPDATER_ERR_PROTO);
- lprintf(1, " Fixup %s\n", name);
- error = updater_addfile(up, fup, attr, 1);
- if (error)
- return (error);
- break;
- case 'Z':
- name = proto_get_ascii(&line);
- attr = proto_get_ascii(&line);
- pos = proto_get_ascii(&line);
- if (name == NULL || attr == NULL || pos == NULL ||
- line != NULL)
- return (UPDATER_ERR_PROTO);
- error = fup_prepare(fup, name, 0);
- fup->temppath = tempname(fup->destpath);
- sr = &fup->srbuf;
- sr->sr_type = SR_FILELIVE;
- sr->sr_file = xstrdup(name);
- sr->sr_serverattr = fattr_decode(attr);
- if (sr->sr_serverattr == NULL)
- return (UPDATER_ERR_PROTO);
- position = strtol(pos, NULL, 10);
- lprintf(1, " Append to %s\n", name);
- error = updater_append_file(up, fup, position);
- if (error)
- return (error);
- break;
- case '!':
- /* Warning from server. */
- msg = proto_get_rest(&line);
- if (msg == NULL)
- return (UPDATER_ERR_PROTO);
- lprintf(-1, "Server warning: %s\n", msg);
- break;
- default:
- return (UPDATER_ERR_PROTO);
- }
- fup_cleanup(fup);
- }
- if (line == NULL)
- return (UPDATER_ERR_READ);
- return (0);
-}
-
-/* Delete file. */
-static int
-updater_delete(struct updater *up, struct file_update *fup)
-{
- struct config *config;
- struct coll *coll;
-
- config = up->config;
- coll = fup->coll;
- if (coll->co_options & CO_DELETE) {
- lprintf(1, " Delete %s\n", fup->coname);
- if (config->deletelim >= 0 &&
- up->deletecount >= config->deletelim)
- return (UPDATER_ERR_DELETELIM);
- up->deletecount++;
- updater_deletefile(fup->destpath);
- if (coll->co_options & CO_CHECKOUTMODE)
- updater_prunedirs(coll->co_prefix, fup->destpath);
- } else {
- lprintf(1," NoDelete %s\n", fup->coname);
- }
- return (0);
-}
-
-static void
-updater_deletefile(const char *path)
-{
- int error;
-
- error = fattr_delete(path);
- if (error && errno != ENOENT) {
- lprintf(-1, "Cannot delete \"%s\": %s\n",
- path, strerror(errno));
- }
-}
-
-static int
-updater_setattrs(struct updater *up, struct file_update *fup, char *name,
- char *tag, char *date, char *revnum, char *revdate, struct fattr *rcsattr)
-{
- struct statusrec sr;
- struct status *st;
- struct coll *coll;
- struct fattr *fileattr, *fa;
- char *path;
- int error, rv;
-
- coll = fup->coll;
- st = fup->st;
- path = fup->destpath;
-
- fileattr = fattr_frompath(path, FATTR_NOFOLLOW);
- if (fileattr == NULL) {
- /* The file has vanished. */
- error = status_delete(st, name, 0);
- if (error) {
- up->errmsg = status_errmsg(st);
- return (UPDATER_ERR_MSG);
- }
- return (0);
- }
- fa = fattr_forcheckout(rcsattr, coll->co_umask);
- fattr_override(fileattr, fa, FA_MASK);
- fattr_free(fa);
-
- rv = fattr_install(fileattr, path, NULL);
- if (rv == -1) {
- lprintf(1, " SetAttrs %s\n", fup->coname);
- fattr_free(fileattr);
- xasprintf(&up->errmsg, "Cannot set attributes for \"%s\": %s",
- path, strerror(errno));
- return (UPDATER_ERR_MSG);
- }
- if (rv == 1) {
- lprintf(1, " SetAttrs %s\n", fup->coname);
- fattr_free(fileattr);
- fileattr = fattr_frompath(path, FATTR_NOFOLLOW);
- if (fileattr == NULL) {
- /* We're being very unlucky. */
- error = status_delete(st, name, 0);
- if (error) {
- up->errmsg = status_errmsg(st);
- return (UPDATER_ERR_MSG);
- }
- return (0);
- }
- }
-
- fattr_maskout(fileattr, FA_COIGNORE);
-
- sr.sr_type = SR_CHECKOUTLIVE;
- sr.sr_file = name;
- sr.sr_tag = tag;
- sr.sr_date = date;
- sr.sr_revnum = revnum;
- sr.sr_revdate = revdate;
- sr.sr_clientattr = fileattr;
- sr.sr_serverattr = rcsattr;
-
- error = status_put(st, &sr);
- fattr_free(fileattr);
- if (error) {
- up->errmsg = status_errmsg(st);
- return (UPDATER_ERR_MSG);
- }
- return (0);
-}
-
-static int
-updater_updatefile(struct updater *up, struct file_update *fup,
- const char *md5, int isfixup)
-{
- struct coll *coll;
- struct status *st;
- struct statusrec *sr;
- struct fattr *fileattr;
- int error, rv;
-
- coll = fup->coll;
- sr = &fup->srbuf;
- st = fup->st;
-
- if (strcmp(fup->wantmd5, md5) != 0) {
- if (isfixup) {
- lprintf(-1, "%s: Checksum mismatch -- "
- "file not updated\n", fup->destpath);
- } else {
- lprintf(-1, "%s: Checksum mismatch -- "
- "will transfer entire file\n", fup->destpath);
- fixups_put(up->config->fixups, fup->coll, sr->sr_file);
- }
- if (coll->co_options & CO_KEEPBADFILES)
- lprintf(-1, "Bad version saved in %s\n", fup->temppath);
- else
- updater_deletefile(fup->temppath);
- return (0);
- }
-
- fattr_umask(sr->sr_clientattr, coll->co_umask);
- rv = fattr_install(sr->sr_clientattr, fup->destpath, fup->temppath);
- if (rv == -1) {
- xasprintf(&up->errmsg, "Cannot install \"%s\" to \"%s\": %s",
- fup->temppath, fup->destpath, strerror(errno));
- return (UPDATER_ERR_MSG);
- }
-
- /* XXX Executes */
- /*
- * We weren't necessarily able to set all the file attributes to the
- * desired values, and any executes may have altered the attributes.
- * To make sure we record the actual attribute values, we fetch
- * them from the file.
- *
- * However, we preserve the link count as received from the
- * server. This is important for preserving hard links in mirror
- * mode.
- */
- fileattr = fattr_frompath(fup->destpath, FATTR_NOFOLLOW);
- if (fileattr == NULL) {
- xasprintf(&up->errmsg, "Cannot stat \"%s\": %s", fup->destpath,
- strerror(errno));
- return (UPDATER_ERR_MSG);
- }
- fattr_override(fileattr, sr->sr_clientattr, FA_LINKCOUNT);
- fattr_free(sr->sr_clientattr);
- sr->sr_clientattr = fileattr;
-
- /*
- * To save space, don't write out the device and inode unless
- * the link count is greater than 1. These attributes are used
- * only for detecting hard links. If the link count is 1 then we
- * know there aren't any hard links.
- */
- if (!(fattr_getmask(sr->sr_clientattr) & FA_LINKCOUNT) ||
- fattr_getlinkcount(sr->sr_clientattr) <= 1)
- fattr_maskout(sr->sr_clientattr, FA_DEV | FA_INODE);
-
- if (coll->co_options & CO_CHECKOUTMODE)
- fattr_maskout(sr->sr_clientattr, FA_COIGNORE);
-
- error = status_put(st, sr);
- if (error) {
- up->errmsg = status_errmsg(st);
- return (UPDATER_ERR_MSG);
- }
- return (0);
-}
-
-/*
- * Update attributes of a directory.
- */
-static int
-updater_setdirattrs(struct updater *up, struct coll *coll,
- struct file_update *fup, char *name, char *attr)
-{
- struct statusrec *sr;
- struct fattr *fa;
- int error, rv;
-
- sr = &fup->srbuf;
- sr->sr_type = SR_DIRUP;
- sr->sr_file = xstrdup(name);
- sr->sr_clientattr = fattr_decode(attr);
- sr->sr_serverattr = fattr_decode(attr);
- if (sr->sr_clientattr == NULL || sr->sr_serverattr == NULL)
- return (UPDATER_ERR_PROTO);
- fattr_mergedefault(sr->sr_clientattr);
- fattr_umask(sr->sr_clientattr, coll->co_umask);
- rv = fattr_install(sr->sr_clientattr, fup->destpath, NULL);
- lprintf(1, " SetAttrs %s\n", name);
- if (rv == -1) {
- xasprintf(&up->errmsg, "Cannot install \"%s\" to \"%s\": %s",
- fup->temppath, fup->destpath, strerror(errno));
- return (UPDATER_ERR_MSG);
- }
- /*
- * Now, make sure they were set and record what was set in the status
- * file.
- */
- fa = fattr_frompath(fup->destpath, FATTR_NOFOLLOW);
- if (fa == NULL) {
- xasprintf(&up->errmsg, "Cannot open \%s\": %s", fup->destpath,
- strerror(errno));
- return (UPDATER_ERR_MSG);
- }
- fattr_free(sr->sr_clientattr);
- fattr_maskout(fa, FA_FLAGS);
- sr->sr_clientattr = fa;
- error = status_put(fup->st, sr);
- if (error) {
- up->errmsg = status_errmsg(fup->st);
- return (UPDATER_ERR_MSG);
- }
-
- return (0);
-}
-
-static int
-updater_diff(struct updater *up, struct file_update *fup)
-{
- char md5[MD5_DIGEST_SIZE];
- struct coll *coll;
- struct statusrec *sr;
- struct fattr *fa, *tmp;
- char *author, *path, *revnum, *revdate;
- char *line, *cmd;
- int error;
-
- coll = fup->coll;
- sr = &fup->srbuf;
- path = fup->destpath;
-
- lprintf(1, " Edit %s\n", fup->coname);
- while ((line = stream_getln(up->rd, NULL)) != NULL) {
- if (strcmp(line, ".") == 0)
- break;
- cmd = proto_get_ascii(&line);
- if (cmd == NULL || strcmp(cmd, "D") != 0)
- return (UPDATER_ERR_PROTO);
- revnum = proto_get_ascii(&line);
- proto_get_ascii(&line); /* XXX - diffbase */
- revdate = proto_get_ascii(&line);
- author = proto_get_ascii(&line);
- if (author == NULL || line != NULL)
- return (UPDATER_ERR_PROTO);
- if (sr->sr_revnum != NULL)
- free(sr->sr_revnum);
- if (sr->sr_revdate != NULL)
- free(sr->sr_revdate);
- if (fup->author != NULL)
- free(fup->author);
- sr->sr_revnum = xstrdup(revnum);
- sr->sr_revdate = xstrdup(revdate);
- fup->author = xstrdup(author);
- if (fup->orig == NULL) {
- /* First patch, the "origin" file is the one we have. */
- fup->orig = stream_open_file(path, O_RDONLY);
- if (fup->orig == NULL) {
- xasprintf(&up->errmsg, "%s: Cannot open: %s",
- path, strerror(errno));
- return (UPDATER_ERR_MSG);
- }
- } else {
- /* Subsequent patches. */
- stream_close(fup->orig);
- fup->orig = fup->to;
- stream_rewind(fup->orig);
- unlink(fup->temppath);
- free(fup->temppath);
- fup->temppath = tempname(path);
- }
- fup->to = stream_open_file(fup->temppath,
- O_RDWR | O_CREAT | O_TRUNC, 0600);
- if (fup->to == NULL) {
- xasprintf(&up->errmsg, "%s: Cannot open: %s",
- fup->temppath, strerror(errno));
- return (UPDATER_ERR_MSG);
- }
- lprintf(2, " Add delta %s %s %s\n", sr->sr_revnum,
- sr->sr_revdate, fup->author);
- error = updater_diff_batch(up, fup);
- if (error)
- return (error);
- }
- if (line == NULL)
- return (UPDATER_ERR_READ);
-
- fa = fattr_frompath(path, FATTR_FOLLOW);
- tmp = fattr_forcheckout(sr->sr_serverattr, coll->co_umask);
- fattr_override(fa, tmp, FA_MASK);
- fattr_free(tmp);
- fattr_maskout(fa, FA_MODTIME);
- sr->sr_clientattr = fa;
-
- if (MD5_File(fup->temppath, md5) == -1) {
- xasprintf(&up->errmsg,
- "Cannot calculate checksum for \"%s\": %s",
- path, strerror(errno));
- return (UPDATER_ERR_MSG);
- }
- error = updater_updatefile(up, fup, md5, 0);
- return (error);
-}
-
-/*
- * Edit a file and add delta.
- */
-static int
-updater_diff_batch(struct updater *up, struct file_update *fup)
-{
- struct stream *rd;
- char *cmd, *line, *state, *tok;
- int error;
-
- state = NULL;
- rd = up->rd;
- while ((line = stream_getln(rd, NULL)) != NULL) {
- if (strcmp(line, ".") == 0)
- break;
- cmd = proto_get_ascii(&line);
- if (cmd == NULL || strlen(cmd) != 1) {
- error = UPDATER_ERR_PROTO;
- goto bad;
- }
- switch (cmd[0]) {
- case 'L':
- line = stream_getln(rd, NULL);
- /* XXX - We're just eating the log for now. */
- while (line != NULL && strcmp(line, ".") != 0 &&
- strcmp(line, ".+") != 0)
- line = stream_getln(rd, NULL);
- if (line == NULL) {
- error = UPDATER_ERR_READ;
- goto bad;
- }
- break;
- case 'S':
- tok = proto_get_ascii(&line);
- if (tok == NULL || line != NULL) {
- error = UPDATER_ERR_PROTO;
- goto bad;
- }
- if (state != NULL)
- free(state);
- state = xstrdup(tok);
- break;
- case 'T':
- error = updater_diff_apply(up, fup, state);
- if (error)
- goto bad;
- break;
- default:
- error = UPDATER_ERR_PROTO;
- goto bad;
- }
- }
- if (line == NULL) {
- error = UPDATER_ERR_READ;
- goto bad;
- }
- if (state != NULL)
- free(state);
- return (0);
-bad:
- if (state != NULL)
- free(state);
- return (error);
-}
-
-int
-updater_diff_apply(struct updater *up, struct file_update *fup, char *state)
-{
- struct diffinfo dibuf, *di;
- struct coll *coll;
- struct statusrec *sr;
- int error;
-
- coll = fup->coll;
- sr = &fup->srbuf;
- di = &dibuf;
-
- di->di_rcsfile = sr->sr_file;
- di->di_cvsroot = coll->co_cvsroot;
- di->di_revnum = sr->sr_revnum;
- di->di_revdate = sr->sr_revdate;
- di->di_author = fup->author;
- di->di_tag = sr->sr_tag;
- di->di_state = state;
- di->di_expand = fup->expand;
-
- error = diff_apply(up->rd, fup->orig, fup->to, coll->co_keyword, di, 1);
- if (error) {
- /* XXX Bad error message */
- xasprintf(&up->errmsg, "Bad diff from server");
- return (UPDATER_ERR_MSG);
- }
- return (0);
-}
-
-/* Update or create a node. */
-static int
-updater_updatenode(struct updater *up, struct coll *coll,
- struct file_update *fup, char *name, char *attr)
-{
- struct fattr *fa, *fileattr;
- struct status *st;
- struct statusrec *sr;
- int error, rv;
-
- sr = &fup->srbuf;
- st = fup->st;
- fa = fattr_decode(attr);
-
- if (fattr_type(fa) == FT_SYMLINK) {
- lprintf(1, " Symlink %s -> %s\n", name,
- fattr_getlinktarget(fa));
- } else {
- lprintf(1, " Mknod %s\n", name);
- }
-
- /* Create directory. */
- error = mkdirhier(fup->destpath, coll->co_umask);
- if (error)
- return (UPDATER_ERR_PROTO);
-
- /* If it does not exist, create it. */
- if (access(fup->destpath, F_OK) != 0)
- fattr_makenode(fa, fup->destpath);
-
- /*
- * Coming from attic? I don't think this is a problem since we have
- * determined attic before we call this function (Look at UpdateNode in
- * cvsup).
- */
- fattr_umask(fa, coll->co_umask);
- rv = fattr_install(fa, fup->destpath, fup->temppath);
- if (rv == -1) {
- xasprintf(&up->errmsg, "Cannot update attributes on "
- "\"%s\": %s", fup->destpath, strerror(errno));
- return (UPDATER_ERR_MSG);
- }
- /*
- * XXX: Executes not implemented. Have not encountered much use for it
- * yet.
- */
- /*
- * We weren't necessarily able to set all the file attributes to the
- * desired values, and any executes may have altered the attributes.
- * To make sure we record the actual attribute values, we fetch
- * them from the file.
- *
- * However, we preserve the link count as received from the
- * server. This is important for preserving hard links in mirror
- * mode.
- */
- fileattr = fattr_frompath(fup->destpath, FATTR_NOFOLLOW);
- if (fileattr == NULL) {
- xasprintf(&up->errmsg, "Cannot stat \"%s\": %s", fup->destpath,
- strerror(errno));
- return (UPDATER_ERR_MSG);
- }
- fattr_override(fileattr, sr->sr_clientattr, FA_LINKCOUNT);
- fattr_free(sr->sr_clientattr);
- sr->sr_clientattr = fileattr;
-
- /*
- * To save space, don't write out the device and inode unless
- * the link count is greater than 1. These attributes are used
- * only for detecting hard links. If the link count is 1 then we
- * know there aren't any hard links.
- */
- if (!(fattr_getmask(sr->sr_clientattr) & FA_LINKCOUNT) ||
- fattr_getlinkcount(sr->sr_clientattr) <= 1)
- fattr_maskout(sr->sr_clientattr, FA_DEV | FA_INODE);
-
- /* If it is a symlink, write only out it's path. */
- if (fattr_type(fa) == FT_SYMLINK) {
- fattr_maskout(sr->sr_clientattr, ~(FA_FILETYPE |
- FA_LINKTARGET));
- }
- fattr_maskout(sr->sr_clientattr, FA_FLAGS);
- error = status_put(st, sr);
- if (error) {
- up->errmsg = status_errmsg(st);
- return (UPDATER_ERR_MSG);
- }
- fattr_free(fa);
-
- return (0);
-}
-
-/*
- * Fetches a new file in CVS mode.
- */
-static int
-updater_addfile(struct updater *up, struct file_update *fup, char *attr,
- int isfixup)
-{
- struct coll *coll;
- struct stream *to;
- struct statusrec *sr;
- struct fattr *fa;
- char buf[BUFSIZE];
- char md5[MD5_DIGEST_SIZE];
- ssize_t nread;
- off_t fsize, remains;
- char *cmd, *line, *path;
- int error;
-
- coll = fup->coll;
- path = fup->destpath;
- sr = &fup->srbuf;
- fa = fattr_decode(attr);
- fsize = fattr_filesize(fa);
-
- error = mkdirhier(path, coll->co_umask);
- if (error)
- return (UPDATER_ERR_PROTO);
- to = stream_open_file(fup->temppath, O_WRONLY | O_CREAT | O_TRUNC, 0755);
- if (to == NULL) {
- xasprintf(&up->errmsg, "%s: Cannot create: %s",
- fup->temppath, strerror(errno));
- return (UPDATER_ERR_MSG);
- }
- stream_filter_start(to, STREAM_FILTER_MD5, md5);
- remains = fsize;
- do {
- nread = stream_read(up->rd, buf, (BUFSIZE > remains ?
- remains : BUFSIZE));
- if (nread == -1)
- return (UPDATER_ERR_PROTO);
- remains -= nread;
- if (stream_write(to, buf, nread) == -1)
- goto bad;
- } while (remains > 0);
- stream_close(to);
- line = stream_getln(up->rd, NULL);
- if (line == NULL)
- return (UPDATER_ERR_PROTO);
- /* Check for EOF. */
- if (!(*line == '.' || (strncmp(line, ".<", 2) != 0)))
- return (UPDATER_ERR_PROTO);
- line = stream_getln(up->rd, NULL);
- if (line == NULL)
- return (UPDATER_ERR_PROTO);
-
- cmd = proto_get_ascii(&line);
- fup->wantmd5 = proto_get_ascii(&line);
- if (fup->wantmd5 == NULL || line != NULL || strcmp(cmd, "5") != 0)
- return (UPDATER_ERR_PROTO);
-
- sr->sr_clientattr = fattr_frompath(fup->temppath, FATTR_NOFOLLOW);
- if (sr->sr_clientattr == NULL)
- return (UPDATER_ERR_PROTO);
- fattr_override(sr->sr_clientattr, sr->sr_serverattr,
- FA_MODTIME | FA_MASK);
- error = updater_updatefile(up, fup, md5, isfixup);
- fup->wantmd5 = NULL; /* So that it doesn't get freed. */
- return (error);
-bad:
- xasprintf(&up->errmsg, "%s: Cannot write: %s", fup->temppath,
- strerror(errno));
- return (UPDATER_ERR_MSG);
-}
-
-static int
-updater_checkout(struct updater *up, struct file_update *fup, int isfixup)
-{
- char md5[MD5_DIGEST_SIZE];
- struct statusrec *sr;
- struct coll *coll;
- struct stream *to;
- ssize_t nbytes;
- size_t size;
- char *cmd, *path, *line;
- int error, first;
-
- coll = fup->coll;
- sr = &fup->srbuf;
- path = fup->destpath;
-
- if (isfixup)
- lprintf(1, " Fixup %s\n", fup->coname);
- else
- lprintf(1, " Checkout %s\n", fup->coname);
- error = mkdirhier(path, coll->co_umask);
- if (error) {
- xasprintf(&up->errmsg,
- "Cannot create directories leading to \"%s\": %s",
- path, strerror(errno));
- return (UPDATER_ERR_MSG);
- }
-
- to = stream_open_file(fup->temppath,
- O_WRONLY | O_CREAT | O_TRUNC, 0600);
- if (to == NULL) {
- xasprintf(&up->errmsg, "%s: Cannot create: %s",
- fup->temppath, strerror(errno));
- return (UPDATER_ERR_MSG);
- }
- stream_filter_start(to, STREAM_FILTER_MD5, md5);
- line = stream_getln(up->rd, &size);
- first = 1;
- while (line != NULL) {
- if (line[size - 1] == '\n')
- size--;
- if ((size == 1 && *line == '.') ||
- (size == 2 && memcmp(line, ".+", 2) == 0))
- break;
- if (size >= 2 && memcmp(line, "..", 2) == 0) {
- size--;
- line++;
- }
- if (!first) {
- nbytes = stream_write(to, "\n", 1);
- if (nbytes == -1)
- goto bad;
- }
- nbytes = stream_write(to, line, size);
- if (nbytes == -1)
- goto bad;
- line = stream_getln(up->rd, &size);
- first = 0;
- }
- if (line == NULL) {
- stream_close(to);
- return (UPDATER_ERR_READ);
- }
- if (size == 1 && *line == '.') {
- nbytes = stream_write(to, "\n", 1);
- if (nbytes == -1)
- goto bad;
- }
- stream_close(to);
- /* Get the checksum line. */
- line = stream_getln(up->rd, NULL);
- if (line == NULL)
- return (UPDATER_ERR_READ);
- cmd = proto_get_ascii(&line);
- fup->wantmd5 = proto_get_ascii(&line);
- if (fup->wantmd5 == NULL || line != NULL || strcmp(cmd, "5") != 0)
- return (UPDATER_ERR_PROTO);
- error = updater_updatefile(up, fup, md5, isfixup);
- fup->wantmd5 = NULL; /* So that it doesn't get freed. */
- if (error)
- return (error);
- return (0);
-bad:
- xasprintf(&up->errmsg, "%s: Cannot write: %s", fup->temppath,
- strerror(errno));
- return (UPDATER_ERR_MSG);
-}
-
-/*
- * Remove all empty directories below file.
- * This function will trash the path passed to it.
- */
-static void
-updater_prunedirs(char *base, char *file)
-{
- char *cp;
- int error;
-
- while ((cp = strrchr(file, '/')) != NULL) {
- *cp = '\0';
- if (strcmp(base, file) == 0)
- return;
- error = rmdir(file);
- if (error)
- return;
- }
-}
-
-/*
- * Edit an RCS file.
- */
-static int
-updater_rcsedit(struct updater *up, struct file_update *fup, char *name,
- char *rcsopt)
-{
- struct coll *coll;
- struct stream *dest;
- struct statusrec *sr;
- struct status *st;
- struct rcsfile *rf;
- struct fattr *oldfattr;
- char md5[MD5_DIGEST_SIZE];
- char *branch, *cmd, *expand, *line, *path, *revnum, *tag, *temppath;
- int error;
-
- coll = fup->coll;
- sr = &fup->srbuf;
- st = fup->st;
- temppath = fup->temppath;
- path = fup->origpath != NULL ? fup->origpath : fup->destpath;
- error = 0;
-
- /* If the path is new, we must create the Attic dir if needed. */
- if (fup->origpath != NULL) {
- error = mkdirhier(fup->destpath, coll->co_umask);
- if (error) {
- xasprintf(&up->errmsg, "Unable to create Attic dir for "
- "%s\n", fup->origpath);
- return (UPDATER_ERR_MSG);
- }
- }
- /*
- * XXX: we could avoid parsing overhead if we're reading ahead before we
- * parse the file.
- */
- oldfattr = fattr_frompath(path, FATTR_NOFOLLOW);
- if (oldfattr == NULL) {
- xasprintf(&up->errmsg, "%s: Cannot get attributes: %s", path,
- strerror(errno));
- return (UPDATER_ERR_MSG);
- }
- fattr_merge(sr->sr_serverattr, oldfattr);
- rf = NULL;
-
- /* Macro for making touching an RCS file faster. */
-#define UPDATER_OPENRCS(rf, up, path, name, cvsroot, tag) do { \
- if ((rf) == NULL) { \
- lprintf(1, " Edit %s", fup->coname); \
- if (fup->attic) \
- lprintf(1, " -> Attic"); \
- lprintf(1, "\n"); \
- (rf) = rcsfile_frompath((path), (name), (cvsroot), \
- (tag), 0); \
- if ((rf) == NULL) { \
- xasprintf(&(up)->errmsg, \
- "Error reading rcsfile %s\n", (name)); \
- return (UPDATER_ERR_MSG); \
- } \
- } \
-} while (0)
-
- while ((line = stream_getln(up->rd, NULL)) != NULL) {
- if (strcmp(line, ".") == 0)
- break;
- cmd = proto_get_ascii(&line);
- if (cmd == NULL) {
- lprintf(-1, "Error editing %s\n", name);
- return (UPDATER_ERR_PROTO);
- }
- switch(cmd[0]) {
- case 'B':
- branch = proto_get_ascii(&line);
- if (branch == NULL || line != NULL)
- return (UPDATER_ERR_PROTO);
- UPDATER_OPENRCS(rf, up, path, name,
- coll->co_cvsroot, coll->co_tag);
- break;
- case 'b':
- UPDATER_OPENRCS(rf, up, path, name,
- coll->co_cvsroot, coll->co_tag);
- rcsfile_setval(rf, RCSFILE_BRANCH, NULL);
- break;
- case 'D':
- UPDATER_OPENRCS(rf, up, path, name,
- coll->co_cvsroot, coll->co_tag);
- error = updater_addelta(rf, up->rd, line);
- if (error)
- return (error);
- break;
- case 'd':
- revnum = proto_get_ascii(&line);
- if (revnum == NULL || line != NULL)
- return (UPDATER_ERR_PROTO);
- UPDATER_OPENRCS(rf, up, path, name,
- coll->co_cvsroot, coll->co_tag);
- rcsfile_deleterev(rf, revnum);
- break;
- case 'E':
- expand = proto_get_ascii(&line);
- if (expand == NULL || line != NULL)
- return (UPDATER_ERR_PROTO);
- UPDATER_OPENRCS(rf, up, path, name,
- coll->co_cvsroot, coll->co_tag);
- rcsfile_setval(rf, RCSFILE_EXPAND, expand);
- break;
- case 'T':
- tag = proto_get_ascii(&line);
- revnum = proto_get_ascii(&line);
- if (tag == NULL || revnum == NULL ||
- line != NULL)
- return (UPDATER_ERR_PROTO);
- UPDATER_OPENRCS(rf, up, path, name,
- coll->co_cvsroot, coll->co_tag);
- rcsfile_addtag(rf, tag, revnum);
- break;
- case 't':
- tag = proto_get_ascii(&line);
- revnum = proto_get_ascii(&line);
- if (tag == NULL || revnum == NULL ||
- line != NULL)
- return (UPDATER_ERR_PROTO);
- UPDATER_OPENRCS(rf, up, path, name,
- coll->co_cvsroot, coll->co_tag);
- rcsfile_deletetag(rf, tag, revnum);
- break;
- default:
- return (UPDATER_ERR_PROTO);
- }
- }
-
- if (rf == NULL) {
- fattr_maskout(oldfattr, ~FA_MODTIME);
- if (fattr_equal(oldfattr, sr->sr_serverattr))
- lprintf(1, " SetAttrs %s", fup->coname);
- else
- lprintf(1, " Touch %s", fup->coname);
- /* Install new attributes. */
- fattr_umask(sr->sr_serverattr, coll->co_umask);
- fattr_install(sr->sr_serverattr, fup->destpath, NULL);
- if (fup->attic)
- lprintf(1, " -> Attic");
- lprintf(1, "\n");
- fattr_free(oldfattr);
- goto finish;
- }
-
- /* Write and rename temp file. */
- dest = stream_open_file(fup->temppath,
- O_RDWR | O_CREAT | O_TRUNC, 0600);
- if (dest == NULL) {
- xasprintf(&up->errmsg, "Error opening file %s for writing: %s\n",
- fup->temppath, strerror(errno));
- return (UPDATER_ERR_MSG);
- }
- stream_filter_start(dest, STREAM_FILTER_MD5RCS, md5);
- error = rcsfile_write(rf, dest);
- stream_close(dest);
- rcsfile_free(rf);
- if (error) {
- xasprintf(&up->errmsg, "%s: Cannot write: %s", fup->temppath,
- strerror(errno));
- return (UPDATER_ERR_MSG);
- }
-
-finish:
- sr->sr_clientattr = fattr_frompath(path, FATTR_NOFOLLOW);
- if (sr->sr_clientattr == NULL) {
- xasprintf(&up->errmsg, "%s: Cannot get attributes: %s",
- fup->destpath, strerror(errno));
- return (UPDATER_ERR_MSG);
- }
- fattr_override(sr->sr_clientattr, sr->sr_serverattr,
- FA_MODTIME | FA_MASK);
- if (rf != NULL) {
- error = updater_updatefile(up, fup, md5, 0);
- fup->wantmd5 = NULL; /* So that it doesn't get freed. */
- if (error)
- return (error);
- } else {
- /* Record its attributes since we touched it. */
- if (!(fattr_getmask(sr->sr_clientattr) & FA_LINKCOUNT) ||
- fattr_getlinkcount(sr->sr_clientattr) <= 1)
- fattr_maskout(sr->sr_clientattr, FA_DEV | FA_INODE);
- error = status_put(st, sr);
- if (error) {
- up->errmsg = status_errmsg(st);
- return (UPDATER_ERR_MSG);
- }
- }
-
- /* In this case, we need to remove the old file afterwards. */
- /* XXX: Can we be sure that a file not edited is moved? I don't think
- * this is a problem, since if a file is moved, it should be edited to
- * show if it's dead or not.
- */
- if (fup->origpath != NULL)
- updater_deletefile(fup->origpath);
- return (0);
-}
-
-/*
- * Add a delta to a RCS file.
- */
-int
-updater_addelta(struct rcsfile *rf, struct stream *rd, char *cmdline)
-{
- struct delta *d;
- size_t size;
- char *author, *cmd, *diffbase, *line, *logline;
- char *revdate, *revnum, *state, *textline;
-
- revnum = proto_get_ascii(&cmdline);
- diffbase = proto_get_ascii(&cmdline);
- revdate = proto_get_ascii(&cmdline);
- author = proto_get_ascii(&cmdline);
- size = 0;
-
- if (revnum == NULL || revdate == NULL || author == NULL)
- return (UPDATER_ERR_PROTO);
-
- /* First add the delta so we have it. */
- d = rcsfile_addelta(rf, revnum, revdate, author, diffbase);
- if (d == NULL) {
- lprintf(-1, "Error adding delta %s\n", revnum);
- return (UPDATER_ERR_READ);
- }
- while ((line = stream_getln(rd, NULL)) != NULL) {
- if (strcmp(line, ".") == 0)
- break;
- cmd = proto_get_ascii(&line);
- switch (cmd[0]) {
- case 'L':
- /* Do the same as in 'C' command. */
- logline = stream_getln(rd, &size);
- while (logline != NULL) {
- if (size == 2 && *logline == '.')
- break;
- if (size == 3 &&
- memcmp(logline, ".+", 2) == 0) {
- rcsdelta_truncatelog(d, -1);
- break;
- }
- if (size >= 3 &&
- memcmp(logline, "..", 2) == 0) {
- size--;
- logline++;
- }
- if (rcsdelta_appendlog(d, logline, size)
- < 0)
- return (-1);
- logline = stream_getln(rd, &size);
- }
- break;
- case 'N':
- case 'n':
- /* XXX: Not supported. */
- break;
- case 'S':
- state = proto_get_ascii(&line);
- if (state == NULL)
- return (UPDATER_ERR_PROTO);
- rcsdelta_setstate(d, state);
- break;
- case 'T':
- /* Do the same as in 'C' command. */
- textline = stream_getln(rd, &size);
- while (textline != NULL) {
- if (size == 2 && *textline == '.')
- break;
- if (size == 3 &&
- memcmp(textline, ".+", 2) == 0) {
- /* Truncate newline. */
- rcsdelta_truncatetext(d, -1);
- break;
- }
- if (size >= 3 &&
- memcmp(textline, "..", 2) == 0) {
- size--;
- textline++;
- }
- if (rcsdelta_appendtext(d, textline,
- size) < 0)
- return (-1);
- textline = stream_getln(rd, &size);
- }
- break;
- }
- }
-
- return (0);
-}
-
-int
-updater_append_file(struct updater *up, struct file_update *fup, off_t pos)
-{
- struct fattr *fa;
- struct stream *to;
- struct statusrec *sr;
- ssize_t nread;
- off_t bytes;
- char buf[BUFSIZE], md5[MD5_DIGEST_SIZE];
- char *line, *cmd;
- int error, fd;
-
- sr = &fup->srbuf;
- fa = sr->sr_serverattr;
- to = stream_open_file(fup->temppath, O_WRONLY | O_CREAT | O_TRUNC,
- 0755);
- if (to == NULL) {
- xasprintf(&up->errmsg, "%s: Cannot open: %s", fup->temppath,
- strerror(errno));
- return (UPDATER_ERR_MSG);
- }
- fd = open(fup->destpath, O_RDONLY);
- if (fd < 0) {
- xasprintf(&up->errmsg, "%s: Cannot open: %s", fup->destpath,
- strerror(errno));
- return (UPDATER_ERR_MSG);
- }
-
- stream_filter_start(to, STREAM_FILTER_MD5, md5);
- /* First write the existing content. */
- while ((nread = read(fd, buf, BUFSIZE)) > 0) {
- if (stream_write(to, buf, nread) == -1)
- goto bad;
- }
- if (nread == -1) {
- xasprintf(&up->errmsg, "%s: Error reading: %s", fup->destpath,
- strerror(errno));
- return (UPDATER_ERR_MSG);
- }
- close(fd);
-
- bytes = fattr_filesize(fa) - pos;
- /* Append the new data. */
- do {
- nread = stream_read(up->rd, buf,
- (BUFSIZE > bytes) ? bytes : BUFSIZE);
- if (nread == -1)
- return (UPDATER_ERR_PROTO);
- bytes -= nread;
- if (stream_write(to, buf, nread) == -1)
- goto bad;
- } while (bytes > 0);
- stream_close(to);
-
- line = stream_getln(up->rd, NULL);
- if (line == NULL)
- return (UPDATER_ERR_PROTO);
- /* Check for EOF. */
- if (!(*line == '.' || (strncmp(line, ".<", 2) != 0)))
- return (UPDATER_ERR_PROTO);
- line = stream_getln(up->rd, NULL);
- if (line == NULL)
- return (UPDATER_ERR_PROTO);
-
- cmd = proto_get_ascii(&line);
- fup->wantmd5 = proto_get_ascii(&line);
- if (fup->wantmd5 == NULL || line != NULL || strcmp(cmd, "5") != 0)
- return (UPDATER_ERR_PROTO);
-
- sr->sr_clientattr = fattr_frompath(fup->destpath, FATTR_NOFOLLOW);
- if (sr->sr_clientattr == NULL)
- return (UPDATER_ERR_PROTO);
- fattr_override(sr->sr_clientattr, sr->sr_serverattr,
- FA_MODTIME | FA_MASK);
- error = updater_updatefile(up, fup, md5, 0);
- fup->wantmd5 = NULL; /* So that it doesn't get freed. */
- return (error);
-bad:
- xasprintf(&up->errmsg, "%s: Cannot write: %s", fup->temppath,
- strerror(errno));
- return (UPDATER_ERR_MSG);
-}
-
-/*
- * Read file data from stream of checkout commands, and write it to the
- * destination.
- */
-static int
-updater_read_checkout(struct stream *src, struct stream *dest)
-{
- ssize_t nbytes;
- size_t size;
- char *line;
- int first;
-
- first = 1;
- line = stream_getln(src, &size);
- while (line != NULL) {
- if (line[size - 1] == '\n')
- size--;
- if ((size == 1 && *line == '.') ||
- (size == 2 && strncmp(line, ".+", 2) == 0))
- break;
- if (size >= 2 && strncmp(line, "..", 2) == 0) {
- size--;
- line++;
- }
- if (!first) {
- nbytes = stream_write(dest, "\n", 1);
- if (nbytes == -1)
- return (UPDATER_ERR_MSG);
- }
- nbytes = stream_write(dest, line, size);
- if (nbytes == -1)
- return (UPDATER_ERR_MSG);
- line = stream_getln(src, &size);
- first = 0;
- }
- if (line == NULL)
- return (UPDATER_ERR_READ);
- if (size == 1 && *line == '.') {
- nbytes = stream_write(dest, "\n", 1);
- if (nbytes == -1)
- return (UPDATER_ERR_MSG);
- }
- return (0);
-}
-
-/* Update file using the rsync protocol. */
-static int
-updater_rsync(struct updater *up, struct file_update *fup, size_t blocksize)
-{
- struct statusrec *sr;
- struct stream *to;
- char md5[MD5_DIGEST_SIZE];
- ssize_t nbytes;
- size_t blocknum, blockstart, blockcount;
- char *buf, *line;
- int error, orig;
-
- sr = &fup->srbuf;
-
- lprintf(1, " Rsync %s\n", fup->coname);
- /* First open all files that we are going to work on. */
- to = stream_open_file(fup->temppath, O_WRONLY | O_CREAT | O_TRUNC,
- 0600);
- if (to == NULL) {
- xasprintf(&up->errmsg, "%s: Cannot create: %s",
- fup->temppath, strerror(errno));
- return (UPDATER_ERR_MSG);
- }
- orig = open(fup->destpath, O_RDONLY);
- if (orig < 0) {
- xasprintf(&up->errmsg, "%s: Cannot open: %s",
- fup->destpath, strerror(errno));
- return (UPDATER_ERR_MSG);
- }
- stream_filter_start(to, STREAM_FILTER_MD5, md5);
-
- error = updater_read_checkout(up->rd, to);
- if (error) {
- xasprintf(&up->errmsg, "%s: Cannot write: %s", fup->temppath,
- strerror(errno));
- return (error);
- }
-
- /* Buffer must contain blocksize bytes. */
- buf = xmalloc(blocksize);
- /* Done with the initial text, read and write chunks. */
- line = stream_getln(up->rd, NULL);
- while (line != NULL) {
- if (strcmp(line, ".") == 0)
- break;
- error = UPDATER_ERR_PROTO;
- if (proto_get_sizet(&line, &blockstart, 10) != 0)
- goto bad;
- if (proto_get_sizet(&line, &blockcount, 10) != 0)
- goto bad;
- /* Read blocks from original file. */
- lseek(orig, (blocksize * blockstart), SEEK_SET);
- error = UPDATER_ERR_MSG;
- for (blocknum = 0; blocknum < blockcount; blocknum++) {
- nbytes = read(orig, buf, blocksize);
- if (nbytes < 0) {
- xasprintf(&up->errmsg, "%s: Cannot read: %s",
- fup->destpath, strerror(errno));
- goto bad;
- }
- nbytes = stream_write(to, buf, nbytes);
- if (nbytes == -1) {
- xasprintf(&up->errmsg, "%s: Cannot write: %s",
- fup->temppath, strerror(errno));
- goto bad;
- }
- }
- /* Get the remaining text from the server. */
- error = updater_read_checkout(up->rd, to);
- if (error) {
- xasprintf(&up->errmsg, "%s: Cannot write: %s",
- fup->temppath, strerror(errno));
- goto bad;
- }
- line = stream_getln(up->rd, NULL);
- }
- stream_close(to);
- close(orig);
-
- sr->sr_clientattr = fattr_frompath(fup->destpath, FATTR_NOFOLLOW);
- if (sr->sr_clientattr == NULL)
- return (UPDATER_ERR_PROTO);
- fattr_override(sr->sr_clientattr, sr->sr_serverattr,
- FA_MODTIME | FA_MASK);
-
- error = updater_updatefile(up, fup, md5, 0);
- fup->wantmd5 = NULL; /* So that it doesn't get freed. */
-bad:
- free(buf);
- return (error);
-}
diff --git a/usr.bin/csup/updater.h b/usr.bin/csup/updater.h
deleted file mode 100644
index b71c9c5..0000000
--- a/usr.bin/csup/updater.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*-
- * Copyright (c) 2003-2004, Maxime Henrion <mux@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#ifndef _UPDATER_H_
-#define _UPDATER_H_
-
-void *updater(void *);
-
-#endif /* !_UPDATER_H_ */
diff --git a/usr.bin/ctags/Makefile.depend b/usr.bin/ctags/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/ctags/Makefile.depend
+++ b/usr.bin/ctags/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/ctlstat/Makefile.depend b/usr.bin/ctlstat/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/ctlstat/Makefile.depend
+++ b/usr.bin/ctlstat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/cut/Makefile.depend b/usr.bin/cut/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/cut/Makefile.depend
+++ b/usr.bin/cut/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/dc/Makefile.depend b/usr.bin/dc/Makefile.depend
index e41f74a..9d5105e 100644
--- a/usr.bin/dc/Makefile.depend
+++ b/usr.bin/dc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/dirname/Makefile.depend b/usr.bin/dirname/Makefile.depend
index 461e710..9cb890b 100644
--- a/usr.bin/dirname/Makefile.depend
+++ b/usr.bin/dirname/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/du/Makefile.depend b/usr.bin/du/Makefile.depend
index 0eab23f..58f9a33 100644
--- a/usr.bin/du/Makefile.depend
+++ b/usr.bin/du/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/ee/Makefile.depend b/usr.bin/ee/Makefile.depend
index 195b2e8..072cd05 100644
--- a/usr.bin/ee/Makefile.depend
+++ b/usr.bin/ee/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/elf2aout/Makefile.depend b/usr.bin/elf2aout/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/elf2aout/Makefile.depend
+++ b/usr.bin/elf2aout/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/elfdump/Makefile.depend b/usr.bin/elfdump/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/elfdump/Makefile.depend
+++ b/usr.bin/elfdump/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/enigma/Makefile.depend b/usr.bin/enigma/Makefile.depend
index 50d097b..4d4fe05 100644
--- a/usr.bin/enigma/Makefile.depend
+++ b/usr.bin/enigma/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/env/Makefile.depend b/usr.bin/env/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/env/Makefile.depend
+++ b/usr.bin/env/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/expand/Makefile.depend b/usr.bin/expand/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/expand/Makefile.depend
+++ b/usr.bin/expand/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/expand/expand.1 b/usr.bin/expand/expand.1
index 6be9995..2a5cb91 100644
--- a/usr.bin/expand/expand.1
+++ b/usr.bin/expand/expand.1
@@ -28,7 +28,7 @@
.\" @(#)expand.1 8.1 (Berkeley) 6/9/93
.\" $FreeBSD$
.\"
-.Dd October 13, 2006
+.Dd June 6, 2015
.Dt EXPAND 1
.Os
.Sh NAME
@@ -110,5 +110,5 @@ utilities conform to
.Sh HISTORY
The
.Nm
-command appeared in
-.Bx 3.0 .
+utility first appeared in
+.Bx 1 .
diff --git a/usr.bin/false/Makefile.depend b/usr.bin/false/Makefile.depend
index 461e710..9cb890b 100644
--- a/usr.bin/false/Makefile.depend
+++ b/usr.bin/false/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/fetch/Makefile.depend b/usr.bin/fetch/Makefile.depend
index db99553..30112de 100644
--- a/usr.bin/fetch/Makefile.depend
+++ b/usr.bin/fetch/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/file/Makefile.depend b/usr.bin/file/Makefile.depend
index b647c4f..4057a4c 100644
--- a/usr.bin/file/Makefile.depend
+++ b/usr.bin/file/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/file2c/Makefile.depend b/usr.bin/file2c/Makefile.depend
index 461e710..9cb890b 100644
--- a/usr.bin/file2c/Makefile.depend
+++ b/usr.bin/file2c/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/find/Makefile.depend b/usr.bin/find/Makefile.depend
index 50f3680..e907014 100644
--- a/usr.bin/find/Makefile.depend
+++ b/usr.bin/find/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/finger/Makefile.depend b/usr.bin/finger/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/finger/Makefile.depend
+++ b/usr.bin/finger/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/fmt/Makefile.depend b/usr.bin/fmt/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/fmt/Makefile.depend
+++ b/usr.bin/fmt/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/fold/Makefile.depend b/usr.bin/fold/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/fold/Makefile.depend
+++ b/usr.bin/fold/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/fold/fold.1 b/usr.bin/fold/fold.1
index 94372ba..b23e838 100644
--- a/usr.bin/fold/fold.1
+++ b/usr.bin/fold/fold.1
@@ -28,7 +28,7 @@
.\" @(#)fold.1 8.1 (Berkeley) 6/6/93
.\" $FreeBSD$
.\"
-.Dd December 15, 2006
+.Dd June 6, 2015
.Dt FOLD 1
.Os
.Sh NAME
@@ -84,6 +84,33 @@ The
.Nm
utility conforms to
.St -p1003.1-2001 .
+.Sh HISTORY
+The
+.Nm
+utility first appeared in
+.Bx 1 .
+It was rewritten for
+.Bx 4.3 Reno
+to improve speed and modernize style.
+The
+.Fl b
+and
+.Fl s
+options were added to
+.Nx 1.0
+for
+.St -p1003.2
+compliance.
+.Sh AUTHORS
+.An -nosplit
+.An Bill Joy
+wrote the original version of
+.Nm
+on June 28, 1977.
+.An Kevin Ruddy
+rewrote the command in 1990, and
+.An J. T. Conklin
+added the missing options in 1993.
.Sh BUGS
If underlining (see
.Xr ul 1 )
diff --git a/usr.bin/from/Makefile.depend b/usr.bin/from/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/from/Makefile.depend
+++ b/usr.bin/from/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/fstat/Makefile.depend b/usr.bin/fstat/Makefile.depend
index 00df5bd..5cba1bd 100644
--- a/usr.bin/fstat/Makefile.depend
+++ b/usr.bin/fstat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/fsync/Makefile.depend b/usr.bin/fsync/Makefile.depend
index 461e710..9cb890b 100644
--- a/usr.bin/fsync/Makefile.depend
+++ b/usr.bin/fsync/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/ftp/Makefile.depend b/usr.bin/ftp/Makefile.depend
index e2fa4c7..d6c8db8 100644
--- a/usr.bin/ftp/Makefile.depend
+++ b/usr.bin/ftp/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/gcore/Makefile.depend b/usr.bin/gcore/Makefile.depend
index 997f3ba..8df34bc 100644
--- a/usr.bin/gcore/Makefile.depend
+++ b/usr.bin/gcore/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/gencat/Makefile.depend b/usr.bin/gencat/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/usr.bin/gencat/Makefile.depend
+++ b/usr.bin/gencat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/getconf/Makefile.depend b/usr.bin/getconf/Makefile.depend
index a3ff6bb..c15e42c 100644
--- a/usr.bin/getconf/Makefile.depend
+++ b/usr.bin/getconf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/getent/Makefile.depend b/usr.bin/getent/Makefile.depend
index 0337134..1eb0f33 100644
--- a/usr.bin/getent/Makefile.depend
+++ b/usr.bin/getent/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/getopt/Makefile.depend b/usr.bin/getopt/Makefile.depend
index 461e710..9cb890b 100644
--- a/usr.bin/getopt/Makefile.depend
+++ b/usr.bin/getopt/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/gprof/Makefile.depend b/usr.bin/gprof/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/gprof/Makefile.depend
+++ b/usr.bin/gprof/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/grep/Makefile.depend b/usr.bin/grep/Makefile.depend
index 7ccf682..65b372e 100644
--- a/usr.bin/grep/Makefile.depend
+++ b/usr.bin/grep/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/gzip/Makefile.depend b/usr.bin/gzip/Makefile.depend
index 8d5c65c..f3f02a1 100644
--- a/usr.bin/gzip/Makefile.depend
+++ b/usr.bin/gzip/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/head/Makefile.depend b/usr.bin/head/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/head/Makefile.depend
+++ b/usr.bin/head/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/hexdump/Makefile.depend b/usr.bin/hexdump/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/hexdump/Makefile.depend
+++ b/usr.bin/hexdump/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/host/Makefile.depend b/usr.bin/host/Makefile.depend
index 9b18a04..0c13258 100644
--- a/usr.bin/host/Makefile.depend
+++ b/usr.bin/host/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/id/Makefile.depend b/usr.bin/id/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/id/Makefile.depend
+++ b/usr.bin/id/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/indent/Makefile.depend b/usr.bin/indent/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/indent/Makefile.depend
+++ b/usr.bin/indent/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/ipcrm/Makefile.depend b/usr.bin/ipcrm/Makefile.depend
index 7a06b0f..a1ac545 100644
--- a/usr.bin/ipcrm/Makefile.depend
+++ b/usr.bin/ipcrm/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/ipcs/Makefile.depend b/usr.bin/ipcs/Makefile.depend
index 7a06b0f..a1ac545 100644
--- a/usr.bin/ipcs/Makefile.depend
+++ b/usr.bin/ipcs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/join/Makefile.depend b/usr.bin/join/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/join/Makefile.depend
+++ b/usr.bin/join/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/jot/Makefile.depend b/usr.bin/jot/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/jot/Makefile.depend
+++ b/usr.bin/jot/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/kdump/Makefile b/usr.bin/kdump/Makefile
index 601192b..3dbab6b2 100644
--- a/usr.bin/kdump/Makefile
+++ b/usr.bin/kdump/Makefile
@@ -3,10 +3,6 @@
.include <src.opts.mk>
-.if (${MACHINE_ARCH} == "amd64")
-SFX= 32
-.endif
-
.PATH: ${.CURDIR}/../ktrace
PROG= kdump
@@ -30,6 +26,9 @@ CLEANFILES= ioctl.c kdump_subr.c kdump_subr.h
.if (${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386")
CLEANFILES+= linux_syscalls.c
.endif
+.if (${MACHINE_ARCH} == "amd64")
+CLEANFILES+= linux32_syscalls.c
+.endif
ioctl.c: mkioctls
env MACHINE=${MACHINE} CPP="${CPP}" \
@@ -43,7 +42,11 @@ kdump_subr.c: mksubr kdump_subr.h
sh ${.CURDIR}/mksubr ${DESTDIR}${INCLUDEDIR} >${.TARGET}
.if (${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386")
sh ${.CURDIR}/../../sys/kern/makesyscalls.sh \
- ${.CURDIR}/../../sys/${MACHINE_ARCH}/linux${SFX}/syscalls.master ${.CURDIR}/linux_syscalls.conf
+ ${.CURDIR}/../../sys/${MACHINE_ARCH}/linux/syscalls.master ${.CURDIR}/linux_syscalls.conf
+.endif
+.if (${MACHINE_ARCH} == "amd64")
+ sh ${.CURDIR}/../../sys/kern/makesyscalls.sh \
+ ${.CURDIR}/../../sys/${MACHINE_ARCH}/linux32/syscalls.master ${.CURDIR}/linux32_syscalls.conf
.endif
.include <bsd.prog.mk>
diff --git a/usr.bin/kdump/Makefile.depend b/usr.bin/kdump/Makefile.depend
index 8d18e4c..a2afa1e 100644
--- a/usr.bin/kdump/Makefile.depend
+++ b/usr.bin/kdump/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
index a46fe65..2f6c1e7 100644
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -146,13 +146,11 @@ static struct ktr_header ktr_header;
#if defined(__amd64__) || defined(__i386__)
-void linux_ktrsyscall(struct ktr_syscall *);
-void linux_ktrsysret(struct ktr_sysret *);
+void linux_ktrsyscall(struct ktr_syscall *, u_int);
+void linux_ktrsysret(struct ktr_sysret *, u_int);
extern const char *linux_syscallnames[];
#include <linux_syscalls.c>
-static int nlinux_syscalls = sizeof(linux_syscallnames) / \
- sizeof(linux_syscallnames[0]);
/*
* from linux.h
@@ -172,6 +170,12 @@ static int bsd_to_linux_errno[ELAST + 1] = {
};
#endif
+#if defined(__amd64__)
+extern const char *linux32_syscallnames[];
+
+#include <linux32_syscalls.c>
+#endif
+
struct proc_info
{
TAILQ_ENTRY(proc_info) info;
@@ -400,7 +404,8 @@ main(int argc, char *argv[])
case KTR_SYSCALL:
#if defined(__amd64__) || defined(__i386__)
if ((sv_flags & SV_ABI_MASK) == SV_ABI_LINUX)
- linux_ktrsyscall((struct ktr_syscall *)m);
+ linux_ktrsyscall((struct ktr_syscall *)m,
+ sv_flags);
else
#endif
ktrsyscall((struct ktr_syscall *)m, sv_flags);
@@ -408,7 +413,8 @@ main(int argc, char *argv[])
case KTR_SYSRET:
#if defined(__amd64__) || defined(__i386__)
if ((sv_flags & SV_ABI_MASK) == SV_ABI_LINUX)
- linux_ktrsysret((struct ktr_sysret *)m);
+ linux_ktrsysret((struct ktr_sysret *)m,
+ sv_flags);
else
#endif
ktrsysret((struct ktr_sysret *)m, sv_flags);
@@ -1970,16 +1976,28 @@ ktrfaultend(struct ktr_faultend *ktr)
}
#if defined(__amd64__) || defined(__i386__)
+
+#if defined(__amd64__)
+#define NLINUX_SYSCALLS(v) ((v) & SV_ILP32 ? \
+ nitems(linux32_syscallnames) : nitems(linux_syscallnames))
+#define LINUX_SYSCALLNAMES(v, i) ((v) & SV_ILP32 ? \
+ linux32_syscallnames[i] : linux_syscallnames[i])
+#else
+#define NLINUX_SYSCALLS(v) (nitems(linux_syscallnames))
+#define LINUX_SYSCALLNAMES(v, i) (linux_syscallnames[i])
+#endif
+
void
-linux_ktrsyscall(struct ktr_syscall *ktr)
+linux_ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags)
{
int narg = ktr->ktr_narg;
+ unsigned code = ktr->ktr_code;
register_t *ip;
- if (ktr->ktr_code >= nlinux_syscalls || ktr->ktr_code < 0)
+ if (ktr->ktr_code < 0 || code >= NLINUX_SYSCALLS(sv_flags))
printf("[%d]", ktr->ktr_code);
else {
- printf("%s", linux_syscallnames[ktr->ktr_code]);
+ printf("%s", LINUX_SYSCALLNAMES(sv_flags, ktr->ktr_code));
if (syscallno)
printf("[%d]", ktr->ktr_code);
}
@@ -1994,16 +2012,16 @@ linux_ktrsyscall(struct ktr_syscall *ktr)
}
void
-linux_ktrsysret(struct ktr_sysret *ktr)
+linux_ktrsysret(struct ktr_sysret *ktr, u_int sv_flags)
{
register_t ret = ktr->ktr_retval;
+ unsigned code = ktr->ktr_code;
int error = ktr->ktr_error;
- int code = ktr->ktr_code;
- if (code >= nlinux_syscalls || code < 0)
- printf("[%d] ", code);
+ if (ktr->ktr_code < 0 || code >= NLINUX_SYSCALLS(sv_flags))
+ printf("[%d] ", ktr->ktr_code);
else {
- printf("%s", linux_syscallnames[code]);
+ printf("%s ", LINUX_SYSCALLNAMES(sv_flags, code));
if (syscallno)
printf("[%d]", code);
printf(" ");
diff --git a/usr.bin/kdump/linux32_syscalls.conf b/usr.bin/kdump/linux32_syscalls.conf
new file mode 100644
index 0000000..66a67fd
--- /dev/null
+++ b/usr.bin/kdump/linux32_syscalls.conf
@@ -0,0 +1,11 @@
+# $FreeBSD$
+sysnames="linux32_syscalls.c"
+sysproto="/dev/null"
+sysproto_h=_LINUX32_SYSPROTO_H_
+syshdr="/dev/null"
+syssw="/dev/null"
+sysmk="/dev/null"
+syscallprefix="LINUX32_SYS_"
+switchname="/dev/null"
+namesname="linux32_syscallnames"
+systrace="/dev/null"
diff --git a/usr.bin/keylogin/Makefile b/usr.bin/keylogin/Makefile
index 2dab249..786efae 100644
--- a/usr.bin/keylogin/Makefile
+++ b/usr.bin/keylogin/Makefile
@@ -4,6 +4,4 @@ PROG= keylogin
LIBADD= rpcsvc
-WARNS?= 0
-
.include <bsd.prog.mk>
diff --git a/usr.bin/keylogin/Makefile.depend b/usr.bin/keylogin/Makefile.depend
index 9e3ced9..c8383bd 100644
--- a/usr.bin/keylogin/Makefile.depend
+++ b/usr.bin/keylogin/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/keylogout/Makefile.depend b/usr.bin/keylogout/Makefile.depend
index c3bc1bd..ddd5dbd 100644
--- a/usr.bin/keylogout/Makefile.depend
+++ b/usr.bin/keylogout/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/killall/Makefile.depend b/usr.bin/killall/Makefile.depend
index 6c3f8b8..41ef6ec 100644
--- a/usr.bin/killall/Makefile.depend
+++ b/usr.bin/killall/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/ktrace/Makefile.depend b/usr.bin/ktrace/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/ktrace/Makefile.depend
+++ b/usr.bin/ktrace/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/ktrdump/Makefile.depend b/usr.bin/ktrdump/Makefile.depend
index 7a06b0f..a1ac545 100644
--- a/usr.bin/ktrdump/Makefile.depend
+++ b/usr.bin/ktrdump/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/lam/Makefile.depend b/usr.bin/lam/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/lam/Makefile.depend
+++ b/usr.bin/lam/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/last/Makefile.depend b/usr.bin/last/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/last/Makefile.depend
+++ b/usr.bin/last/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/last/last.1 b/usr.bin/last/last.1
index e552dd6..19e0f0b 100644
--- a/usr.bin/last/last.1
+++ b/usr.bin/last/last.1
@@ -28,7 +28,7 @@
.\" @(#)last.1 8.1 (Berkeley) 6/6/93
.\" $FreeBSD$
.\"
-.Dd January 21, 2010
+.Dd June 6, 2015
.Dt LAST 1
.Os
.Sh NAME
@@ -202,10 +202,15 @@ login data base
.Xr ac 8 ,
.Xr lastlogin 8
.Sh HISTORY
-A
.Nm
-utility appeared in
-.Bx 3.0 .
+utility first appeared in
+.Bx 1 .
+.Sh AUTHORS
+.An -nosplit
+The original version was written by
+.An Howard P. Katseff ;
+.An Keith Bostic
+rewrote it in 1986/87 to add functionality and to improve code quality.
.Sh BUGS
If a login shell should terminate abnormally for some reason, it is likely
that a logout record will not be written to the
diff --git a/usr.bin/lastcomm/Makefile.depend b/usr.bin/lastcomm/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/lastcomm/Makefile.depend
+++ b/usr.bin/lastcomm/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/ldd/Makefile.depend b/usr.bin/ldd/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/usr.bin/ldd/Makefile.depend
+++ b/usr.bin/ldd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/leave/Makefile.depend b/usr.bin/leave/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/leave/Makefile.depend
+++ b/usr.bin/leave/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/less/Makefile.depend b/usr.bin/less/Makefile.depend
index 195b2e8..072cd05 100644
--- a/usr.bin/less/Makefile.depend
+++ b/usr.bin/less/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/lessecho/Makefile.depend b/usr.bin/lessecho/Makefile.depend
index 0e27a75..23b58e0 100644
--- a/usr.bin/lessecho/Makefile.depend
+++ b/usr.bin/lessecho/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/lesskey/Makefile.depend b/usr.bin/lesskey/Makefile.depend
index 0e27a75..23b58e0 100644
--- a/usr.bin/lesskey/Makefile.depend
+++ b/usr.bin/lesskey/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/lex/Makefile.depend b/usr.bin/lex/Makefile.depend
index 1ff4094..738376b 100644
--- a/usr.bin/lex/Makefile.depend
+++ b/usr.bin/lex/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/lex/lib/Makefile.depend b/usr.bin/lex/lib/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.bin/lex/lib/Makefile.depend
+++ b/usr.bin/lex/lib/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/limits/Makefile.depend b/usr.bin/limits/Makefile.depend
index 0eab23f..58f9a33 100644
--- a/usr.bin/limits/Makefile.depend
+++ b/usr.bin/limits/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/locale/Makefile.depend b/usr.bin/locale/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/locale/Makefile.depend
+++ b/usr.bin/locale/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/locate/bigram/Makefile.depend b/usr.bin/locate/bigram/Makefile.depend
index 461e710..9cb890b 100644
--- a/usr.bin/locate/bigram/Makefile.depend
+++ b/usr.bin/locate/bigram/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/locate/code/Makefile.depend b/usr.bin/locate/code/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/locate/code/Makefile.depend
+++ b/usr.bin/locate/code/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/locate/locate/Makefile.depend b/usr.bin/locate/locate/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/usr.bin/locate/locate/Makefile.depend
+++ b/usr.bin/locate/locate/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/lock/Makefile.depend b/usr.bin/lock/Makefile.depend
index 50d097b..4d4fe05 100644
--- a/usr.bin/lock/Makefile.depend
+++ b/usr.bin/lock/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/lockf/Makefile.depend b/usr.bin/lockf/Makefile.depend
index 461e710..9cb890b 100644
--- a/usr.bin/lockf/Makefile.depend
+++ b/usr.bin/lockf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/logger/Makefile.depend b/usr.bin/logger/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/logger/Makefile.depend
+++ b/usr.bin/logger/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/login/Makefile.depend b/usr.bin/login/Makefile.depend
index 497ebf6..85813bf 100644
--- a/usr.bin/login/Makefile.depend
+++ b/usr.bin/login/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/logins/Makefile.depend b/usr.bin/logins/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/logins/Makefile.depend
+++ b/usr.bin/logins/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/logname/Makefile.depend b/usr.bin/logname/Makefile.depend
index 461e710..9cb890b 100644
--- a/usr.bin/logname/Makefile.depend
+++ b/usr.bin/logname/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/look/Makefile.depend b/usr.bin/look/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/look/Makefile.depend
+++ b/usr.bin/look/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/lorder/Makefile.depend b/usr.bin/lorder/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.bin/lorder/Makefile.depend
+++ b/usr.bin/lorder/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/lsvfs/Makefile.depend b/usr.bin/lsvfs/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/lsvfs/Makefile.depend
+++ b/usr.bin/lsvfs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/lzmainfo/Makefile.depend b/usr.bin/lzmainfo/Makefile.depend
index 24bdb3f..987c487 100644
--- a/usr.bin/lzmainfo/Makefile.depend
+++ b/usr.bin/lzmainfo/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/m4/Makefile.depend b/usr.bin/m4/Makefile.depend
index fe894c4..f5fa771 100644
--- a/usr.bin/m4/Makefile.depend
+++ b/usr.bin/m4/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/mail/Makefile b/usr.bin/mail/Makefile
index da3e433..ea2338b 100644
--- a/usr.bin/mail/Makefile
+++ b/usr.bin/mail/Makefile
@@ -11,7 +11,7 @@ EFILES= mail.rc
LINKS= ${BINDIR}/mail ${BINDIR}/Mail ${BINDIR}/mail ${BINDIR}/mailx
MLINKS= mail.1 Mail.1 mail.1 mailx.1
-WARNS?= 1
+WARNS?= 2
.PATH: ${.CURDIR}/misc
diff --git a/usr.bin/mail/Makefile.depend b/usr.bin/mail/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/mail/Makefile.depend
+++ b/usr.bin/mail/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/mail/main.c b/usr.bin/mail/main.c
index 31372d0..0699a55 100644
--- a/usr.bin/mail/main.c
+++ b/usr.bin/mail/main.c
@@ -28,7 +28,7 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1980, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
diff --git a/usr.bin/make/Makefile.depend b/usr.bin/make/Makefile.depend
index eba5cd5..2f3ce42 100644
--- a/usr.bin/make/Makefile.depend
+++ b/usr.bin/make/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/makewhatis/Makefile.depend b/usr.bin/makewhatis/Makefile.depend
index 08808f4..d209adb 100644
--- a/usr.bin/makewhatis/Makefile.depend
+++ b/usr.bin/makewhatis/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/man/Makefile b/usr.bin/man/Makefile
index 3e37b59..7057b2e 100644
--- a/usr.bin/man/Makefile
+++ b/usr.bin/man/Makefile
@@ -1,11 +1,17 @@
# $FreeBSD$
+.include <src.opts.mk>
+
SCRIPTS= man.sh
-LINKS= ${BINDIR}/man ${BINDIR}/apropos \
- ${BINDIR}/man ${BINDIR}/manpath \
- ${BINDIR}/man ${BINDIR}/whatis
+LINKS= ${BINDIR}/man ${BINDIR}/manpath
-MAN= man.1 manpath.1 apropos.1 man.conf.5
+MAN= man.1 manpath.1 man.conf.5
+
+.if ${MK_MANDOCDB} == no
+LINKS+= ${BINDIR}/man ${BINDIR}/apropos \
+ ${BINDIR}/man ${BINDIR}/whatis
+MAN+= apropos.1
MLINKS= apropos.1 whatis.1
+.endif
.include <bsd.prog.mk>
diff --git a/usr.bin/man/Makefile.depend b/usr.bin/man/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.bin/man/Makefile.depend
+++ b/usr.bin/man/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/mandoc/Makefile b/usr.bin/mandoc/Makefile
index cdb512b..faa46ed 100644
--- a/usr.bin/mandoc/Makefile
+++ b/usr.bin/mandoc/Makefile
@@ -1,5 +1,7 @@
# $FreeBSD$
+.include <src.opts.mk>
+
MDOCMLDIR= ${.CURDIR}/../../contrib/mdocml
.PATH: ${MDOCMLDIR}
@@ -7,7 +9,14 @@ PROG= mandoc
FILES= example.style.css style.css
FILESDIR= ${SHAREDIR}/mdocml
MAN= mandoc.1 eqn.7 mandoc_char.7 tbl.7 man.7 mdoc.7 # roff.7
-MLINKS= mandoc.1 mdocml.1
+MLINKS= mandoc.1 mdocml.1
+.if ${MK_MANDOCDB} != no
+MAN+= apropos.1 makewhatis.8
+MLINKS+= apropos.1 whatis.1
+LINKS= ${BINDIR}/mandoc ${BINDIR}/whatis \
+ ${BINDIR}/mandoc ${BINDIR}/makewhatis \
+ ${BINDIR}/mandoc ${BINDIR}/apropos
+.endif
LIBMAN_SRCS= man.c \
man_hash.c \
@@ -75,6 +84,6 @@ WARNS?= 2
CFLAGS+= -DHAVE_CONFIG_H \
-I${.CURDIR}/../../lib/libohash/ \
-I${.CURDIR}/../../contrib/sqlite3
-LIBADD= ohash sqlite3
+LIBADD= ohash sqlite3 z
.include <bsd.prog.mk>
diff --git a/usr.bin/mandoc/Makefile.depend b/usr.bin/mandoc/Makefile.depend
index 6845b5f..66bb233 100644
--- a/usr.bin/mandoc/Makefile.depend
+++ b/usr.bin/mandoc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/mesg/Makefile.depend b/usr.bin/mesg/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/mesg/Makefile.depend
+++ b/usr.bin/mesg/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/minigzip/Makefile.depend b/usr.bin/minigzip/Makefile.depend
index 08808f4..d209adb 100644
--- a/usr.bin/minigzip/Makefile.depend
+++ b/usr.bin/minigzip/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/ministat/Makefile.depend b/usr.bin/ministat/Makefile.depend
index 8a1da00..c9f9d52 100644
--- a/usr.bin/ministat/Makefile.depend
+++ b/usr.bin/ministat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/mkcsmapper_static/Makefile b/usr.bin/mkcsmapper_static/Makefile
index 12f8317..b2a1a13 100644
--- a/usr.bin/mkcsmapper_static/Makefile
+++ b/usr.bin/mkcsmapper_static/Makefile
@@ -7,7 +7,6 @@ SRCS= citrus_bcs.c citrus_db_factory.c citrus_db_hash.c \
citrus_lookup_factory.c citrus_pivot_factory.c
MAN=
NO_SHARED= yes
-NO_WARNS= yes
build-tools: mkcsmapper_static
diff --git a/usr.bin/mkcsmapper_static/Makefile.depend b/usr.bin/mkcsmapper_static/Makefile.depend
index ff5f11f..911a48d 100644
--- a/usr.bin/mkcsmapper_static/Makefile.depend
+++ b/usr.bin/mkcsmapper_static/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/mkdep/Makefile.depend b/usr.bin/mkdep/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.bin/mkdep/Makefile.depend
+++ b/usr.bin/mkdep/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/mkesdb_static/Makefile b/usr.bin/mkesdb_static/Makefile
index 7254723..613b25e 100644
--- a/usr.bin/mkesdb_static/Makefile
+++ b/usr.bin/mkesdb_static/Makefile
@@ -7,7 +7,6 @@ SRCS= citrus_bcs.c citrus_db_factory.c citrus_db_hash.c \
citrus_lookup_factory.c
MAN=
NO_SHARED= yes
-NO_WARNS= yes
build-tools: mkesdb_static
diff --git a/usr.bin/mkfifo/Makefile.depend b/usr.bin/mkfifo/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/mkfifo/Makefile.depend
+++ b/usr.bin/mkfifo/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/mkimg/tests/img-1x1-4096-apm.vhdf.gz.uu b/usr.bin/mkimg/tests/img-1x1-4096-apm.vhdf.gz.uu
index 3e83de7..754920fd 100644
--- a/usr.bin/mkimg/tests/img-1x1-4096-apm.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-1x1-4096-apm.vhdf.gz.uu
@@ -1,15 +1,15 @@
# $FreeBSD$
begin 644 img-1x1-4096-apm.vhdf.gz
-M'XL(".W%'50``VEM9RTQ>#$M-#`Y-BUA<&TN=FAD9BYO=70`K571:L(P%'WW
-M*R[L35A)DYM;][@Q?1O(9,]:;2N%J<4)VT,_?DF3V-16<2/I)23<YO3DG.26
-M,=,`4(+DP%0P&Z+IV_E%0#U]CU1CD6OUR(#%MU9=AXLN6CT:&T"NTY(!9KUU
-MP@>,NXEZ_G8):.`T/XPA83IH`R3OXO=<59_Y`!P/M5T#)_KL9-&,8X"$0X)`
-M3[:G`BC7:<MN6:7'4WDJ#_NE@T,%1YE>G/R%W2ZM!MG)P-[BG=Y.[(!;P*ZW
-MX/AAZ+.'C1VDA5=&J$`.4@`B\$P1ESJGYCW`V3'/7Q:OCQ^SA:\?8F!^=(=^
-MW-//7!)?/_#Y46C]Z*9^B8`D&3B;K7Y?W^8@.GZ!]8N9U8^E`_WU1#V/NH\!
-M1`L8C"'9ZDS"WG4MHG`U8.(#\M;>!G!SV.>;4_GCWV"RU;DHAD.OYT+_"R@!
-MGC8E)M-CC]_#=#LN=UL'YZJ?^[#R^FSQY2ZIN]V9,KB!7+7L1%\D\M5;(S"$
-M..YLW+);^>H9.#QO-B]@+1N:+CJ33F*P-FNXIOKY+__76P-'@8^*^E&.?@&@
-'6R\`T@<`````
+M'XL("+F;>54``VEM9RTQ>#$M-#`Y-BUA<&TN=FAD9BYO=70`K57+:L,P$+SG
+M*[;T%JC18R6YQX8FMT)H*/163&RGAB8Q::`]N/]>R9)B^9&0%LL;8['6>'9F
+MI1!B!P`*$`R(#N*"4>`(S;P34,V?(SUN,'*CFE@P2BZL.@\7=48UF5I`9M*"
+M`*:]=3P$I.U$M7SJ`EHXPP\I*&)"KD&*J_@]E.5'-@#'QBK7PO$^.Y'7SQ1`
+M,5`(\M[=90XR,VG'[JU,#L?B6.QW;QX.-9Q,S6+U%W;;I!QD)T;V%J_T-O9-
+MZ0#;WH+GAV/W'M9V2".\-D(',A`<$(&EFK@P.3WO`2X.639;/=Z]+%:A?H@C
+M\Y-7Z,<"_>PF"?6#D)\<6S]Y43_%0:F!WFST^_RRC>CYC:P?)4X_D@S<SR>J
+M9=2^+"`ZP-$8(I.Q24ON]KH1D?LS(`X!66-O#;C>[[+UL?@.=["!,P[G^7"8
+M]8R;_P*I@"7U$9.:YX#?[7PS+;8;#^=//_]A[?7)XFZ5.B'CIMR%-KB&G+V?
+MV/&^2,TJ_5.ZSQ$H;17NV&F8Z*==+)Z*S7(0<4W31VO22ABXU[89%JX^_<*7
+4_^NMA9,CMTI"R.076*/W'M('````
`
end
diff --git a/usr.bin/mkimg/tests/img-1x1-4096-bsd.vhdf.gz.uu b/usr.bin/mkimg/tests/img-1x1-4096-bsd.vhdf.gz.uu
index 6660765..76af0f8 100644
--- a/usr.bin/mkimg/tests/img-1x1-4096-bsd.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-1x1-4096-bsd.vhdf.gz.uu
@@ -1,13 +1,14 @@
# $FreeBSD$
begin 644 img-1x1-4096-bsd.vhdf.gz
-M'XL("._%'50``VEM9RTQ>#$M-#`Y-BUB<V0N=FAD9BYO=70`K91-;X,P#(;O
-M_`I+N_6`DI`8>JW6G2=-VJX%"E4/W2X[[)`?OQ@"Q'RUFPA1!'+\\-I.+$0[
-M`+0"D<^LRP9[B/ECHUW4T!0!30K:@$'(W'8Q3/;!#/;C^!Z'PWJ<7/-:QL6C
-MT>'4/5PO6#Z"2\A+,DHRX)8,+4YXEAAP>DV=RX2H_A2LV2IW76VSD5]89Y`U
-MR#.(S-L4!_;UA4'??BI#L7!7],$TW)QP*=\O`YRZ$RYP7+%:VW5U8JJNW+@8
-MR?AF/'AS"<)O;HM3VS8"U706=P+=KNFZ;+"O,7]:H/;`S3*(OO=A`E@#5H"&
-MWE,-N(<T"X&*GR1;?GU6Y??U)ZPPX:@@=3T_R5\E=%LP!9733_!,[X&^I^-E
-M=[U=.ES7JKH?:Z2D&P?1DW"1A_MR>'MND*=!73)-$H;9*S0(#5*RP+VZ$S_.
-IA--]L%4-A6ED=I-],,-LJR*<$2.O_]:VQ>'&1\4=ON@7D=A:0S`'````
+M'XL("+R;>54``VEM9RTQ>#$M-#`Y-BUB<V0N=FAD9BYO=70`K93!3H0P$(;O
+M/,48;VM"VJ$MW2MQ/9N8J%>6A74/ZL6#!WQW.T"A`PN[&DJ!DNE\_#/35HBV
+M`2@$D9]YSAOJ+.97'6VBAH8$U"DH#=J`==/%T-D',]0ON^<X;'6'DTM>\[AX
+MU#P.+^%ZP?(:7$)>P<Q$`<H>-V=H<.JF1=';X]22.I<)4?XI6+U6[GQM[<@O
+MK#/@'D0!PG8VY$"J[QT-8-"WG<I`%NZ"/IB&FQ,NY?-E@,,+X0+'[1=KNZC.
+MUS;$%2L7(QGOC"MW+D'XSFUQN.Y!@,W)XE:@FS5]SAOJQYA?+5!UP-4RJ-!8
+M,IL$3`6F!*-IG"HP6TAM"$2^DNKB\Z,LOD[?884)1P6IJO.=_#&AW6)2P)Q^
+M8@XT#O3=[HZ;T_O1X_Q1Y7^L#"5=.XB:A.L,Q@[A/F1/]PTR>^O5)=,D#5[N
+M3@\@%$C)`N_4.4S\PX-5?;!E!=HV,GUG'\Q`N-?Q444X+49>_ZUMBS,K+Y5<
++B.@7"Y_:'#`'````
`
end
diff --git a/usr.bin/mkimg/tests/img-1x1-4096-ebr.vhdf.gz.uu b/usr.bin/mkimg/tests/img-1x1-4096-ebr.vhdf.gz.uu
index f298a70..c46cfba 100644
--- a/usr.bin/mkimg/tests/img-1x1-4096-ebr.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-1x1-4096-ebr.vhdf.gz.uu
@@ -1,14 +1,15 @@
# $FreeBSD$
begin 644 img-1x1-4096-ebr.vhdf.gz
-M'XL("/#%'50``VEM9RTQ>#$M-#`Y-BUE8G(N=FAD9BYO=70`K96Q;H,P$(;W
-M/,5%W3)$MK$/LD9-YTI5VS5`(,J0=NG0@8>OC3'Q82"D,A@P.M_'?[ZS8<P>
-M`/H:;=.&9CLXFM5FU=)X\3"PKD>!%E=J+SU`MUQU'=T8]W"<@>#3^M8^[A0[
-MW/HQH%*0YP'PW>D3QDL*8/G(?=K0[+?T[/5)`U0I2`4*(1-+`_X\?(RE0_)8
-M\V=QXAZN%\R7X!+CY8WT*V/:T-S*Q#X=3LZITPA6/12LBEQ[,AOX^7D&IE=)
-M"2SK;(("^_S"3=\NE"%(N#/Z(`PW-[B4CN<>3MP)%RBNF,WMO+IUJ*Z,G`PU
-M7!D+5ZZ!T)5K<2+N1B#:G457H!X5WJ<-S>N6GA8H.V"T&<3N5X0)8`U8`2K3
-M3R7@#M+,!PI:24WY_565/Y=?/\,&Q_L_1]B,OTC,:L$41&X^@B?3]_0]'<Z;
-MR_7L<&ZK<A^6:"9=:8@,PD4:[LO^[;E%'F_JDG"2T)^]0@*3P#D)O%-WI.6,
-I[3[O@JUJ*%0KTS7R0@RC6Y7!*3;P^F]N+0XCEXJNO=4?V8%!.+\(````
+M'XL("+^;>54``VEM9RTQ>#$M-#`Y-BUE8G(N=FAD9BYO=70`K94]<X,P#(;W
+M_`KENF7@;&$;9\TUG7O7Z\=*"*09VBX=.M#_7@OS86,@2<]@P)RLAU>6;!BS
+M!X"Y)MN\H4Y&1[W:K!H:/]P,K*I)H,45QLL,,"V7;<<TQAT<9X!\7M_:Q1UC
+MAUO=!I02\CP`/G?ZD+P$`LLG[O.&>I?X9Z]/$%!F("1(!1JO#?AU_S*5#L%C
+MS9_%X25<+YA?@TO)RQGI5L:\H1[*Q#X[G%A29Q"LO"E8&;GVA![YN7D&9E9)
+M`4RW-O2!?7YAT+<-9:`7[H(^",/-"9?YX[F#PPOA@H\[+.9V6=TZ5%=$3H8<
+MKXPK5RY!_)5K<1AW(\!F9S$5:$:%]WE#_9CXIP6*%AAM!@4J36:5@JI`E:`D
+M]3,!:@N9=H'H5U)=?'V6Q??YQ\TPX7C_YP@;^6-*JT5E@#E]1!VI[^B[VY\V
+MYX]3A^NVJN[#0M&D2P,10;C&H/00[L/NZ;Y![MY[=6DX28.7N;(C,`&<>X&W
+MZ@PF^?6#%7VP9052-S*[YKUX!L*]C;<JPDDV\OIO;BU.12Z5G+'5'\M!HE._
+#"```
`
end
diff --git a/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdf.gz.uu b/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdf.gz.uu
index 0c18ed8..b84dcdd 100644
--- a/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdf.gz.uu
@@ -1,19 +1,19 @@
# $FreeBSD$
begin 644 img-1x1-4096-gpt.vhdf.gz
-M'XL("/'%'50``VEM9RTQ>#$M-#`Y-BUG<'0N=FAD9BYO=70`K9<[;]PP#(#W
-M^Q4LNJ6HH_?IE@`-F@#=TD>V#O%#"C+DBJ(=.OC'5Y3LL^23C%XAFS!TH/F9
-MI$G11T@X``0#TF:N9<5XVZ3GN+O:>1KM+@.ZYZ,+*V#C@`'7.R5A>(\Q8.TD
-MA'JK8.R$DV7M<<URD";"#;'52LJ*&-<$W!RNO0PH);3M&?!Q]H_YUR%!*!`'
-M8.Y^`H*"9"#%">=CEWWLW]W])WCX\.4;PKXOX3+JE`,#W4-_`-NMO*/_'F[`
-M.8<P^\QF@^5%W'4>QQ$W;.!R4L:)+:M00Y<$*TEJI6,K;J#C8%MHAP+N9H53
-ME2M/H+I3L.]!&9`4>HN+00&E`-JUB?80!LRY>(`]!=8A<#Q^;HX!]K[Y^6[R
-M3]"I(G)25I2R)[!4B"Z%N\?:W@P74AROG3V-V9/5LG>8BB4G944Q>VW(7CY)
-MF+U<ZSK<E+7F38KKZF:/^JGA^L/MW^?7LF)\:-(S`,4$K.:AM+:OV!V(J]@=
-MB*O8'8BKVAT(K-@=B*O8'8BKV!V(J]H=#FA(O2&..*P]KL%0V'/HTJHIC^-1
-M-[^"8]=)N(9MC?Z-(9Y_&:;B$$?<YA"WIA3LB;,*MN(01US5(:ZFSV_%0?G^
-M4A+7>P'*M92.@6RI&0_L?QQ-__OE3YP]Y7=F6#Z25X+VC&-A*M<B+3Y$#;B.
-M_'M[]WSU\OH\X]@4U?Q@K&A7Q0XBSL)5:;CWMU\_>N33XEUFFU)Q]CH!1.`6
-M$P<^>?>4EHKR7T!SL,:"EFA[DN1'HL@6,N)\J<0W_^^[#;C:I>+^&NS^`N3M
-&#A:S#0``
+M'XL(",*;>54``VEM9RTQ>#$M-#`Y-BUG<'0N=FAD9BYO=70`K98[;]M`#,=W
+M?PH:78H4%>ZMTQ(@1F.@6_K:NDBRE&2(@P`=.JC?O>2=7B?KA+HX^2S(H/@3
+M_SQ2-&/^`%`"6+ERCANZ0Q9^NMW-SM%X=1T0GT\A+(`9`CVN1B,3=$_30-OV
+MBW'GY9VE`L'[ZP&7C8?:9S/<:?2Z7''##.>/26Y['5!K*,L+X(\A/N&V0X,R
+MH`H0>#\#Q4$+T&K$.:VZGL=W?_P,#W=?OQ/LYR17<#36`NH<"@&\6$3'_UVN
+MQV%`(.4RVP-.QG!ROXZ3A.,;N+4%'8_@U):7KZ%KQ&H6>MFYEVR@DM"64)XB
+MN-L%SB2N/$7FRD!>@VE`<ZA;NC@9X!S`8IM8!Q$@,,0"<DQT1<#N_"4[>]C'
+M[.U#'Y_B?46LK;@AECU%I<)L3&Y.M;TI%T*<3)T]2]G3R;)7],6RMN*&:/9*
+MG[WU)%'V5ENF&[*6[4-<E39[W$T-[`]\?U^>XX;N(0L_'JAZ8+((E3`INX-P
+M";N#<`F[@W!)NX.`";N#<`F[@W`)NX-P2;L#@8:E&^*$<T,<YP]F7Q(T"",Z
+MCBF^(Z%D*->(K=$?'^*1S3`)ASCA-H>X%!MBW2$68A,.<<(E'>((M&0V$HSK
+M+Z/I.E=@L*7L'"BFFG'`^O7<U+^>?R^R9ZE4QC_)BT7^0E)A&FR1DAYB3G0]
+MB^_=_>/-\\OC@!.]JN'!5-%8Q0A1%W+18.PD]WCX]LDA#T]C="NOJ<D+OSEN
+M@Z)7S%QX'QUBLC^A6#6*;5H0EGS'%?P(#(1[OU)YUI7*_.;_W5N/2UTJ)6.[
+)OZ@^X(6S#0``
`
end
diff --git a/usr.bin/mkimg/tests/img-1x1-4096-mbr.vhdf.gz.uu b/usr.bin/mkimg/tests/img-1x1-4096-mbr.vhdf.gz.uu
index 171e991..04d78d5 100644
--- a/usr.bin/mkimg/tests/img-1x1-4096-mbr.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-1x1-4096-mbr.vhdf.gz.uu
@@ -1,15 +1,15 @@
# $FreeBSD$
begin 644 img-1x1-4096-mbr.vhdf.gz
-M'XL("/+%'50``VEM9RTQ>#$M-#`Y-BUM8G(N=FAD9BYO=70`K96Q;H,P$(;W
-M/,5%W3(@^[`/LD9-YTI5VS5`(,J0=NG0@8>OC3'8.)"D,AQ@=/;'?[ZS8<P<
-M``*!%5?N\XYVE_AGN]JL.AHO'P/F#)HF`"8*:'"5PJD.R@K9-Y0Q#EJXNI1Q
-M!LC[MC%HD_%8)P[N.(P*;=[AXA*#L^$VCP&EA*((@.]6'\9.A]!`F8&0(`ER
-MO#?@S_W')&"#X['FS^#P%FX0S._!I7J4T].MC'E'.Y:)>5J<6%*G$*Q^*%@9
-MN?9$/AGGYAF86B45L+SWH0\<\@NCOFTH`[UP%_1!&&ZA<9G?GSLXO!$N^+AR
-M,;?+ZM:ANBIR,N1T9=RY<C7$7[D&AW$W`NQV%E6!JE=XGW>TKXE_&J#H@=%F
-MD/I?$:5`#5`-)'4[$T!;R'(7B'XEM=7W5UW]G'_=#&L<'_X<H>GQF.K50AE@
-MH3]"1]UV]#WM3YOSY61Q=JNR'Q:D)UTJB`C")3_<E]W;<X<\C.K2<)+(G;U2
-M`!/`N1=XK^[@ES-U^[P-MFZ@E)U,:]Z+Y[BZ56F<9)-1_\VMP5'D4E&UM_H#
-(GF2M3+\(````
+M'XL(",:;>54``VEM9RTQ>#$M-#`Y-BUM8G(N=FAD9BYO=70`K94]<\,@#(;W
+M_`KUNF7P`09,UES3N7>]?JS$L=,,;9<.'=S_7LGX`TSM)#UBV2$G]/@5$H0Q
+M]P&0`IC]XSGO:+99>#6K]:JE\?UU0,.@KB-@AD"'*Q&'$]"LZ@9HC`,)QQN-
+M,Q"\&SN#)AL_-YF'.PQ1L<T[?%SF<'VZ]75`I<#:"/C4ZQ.IRR$)J`J0"I0&
+M(RY-^&7W/$G8X7BJ]7,X<0XW".:7X'**\F;ZG3'O:,8V<=\]3BZI0P2KKDI6
+M)>X]:29Q?IV!X2XI@9G.)T+@4%\8]6UB&2)(=T$?Q.E:PA7A?.[AQ)ET(<3M
+M%VN[K.XF5E<F+H::[HP+=RY!PIWK<"+M02#:DP4[$&?%SWE'\Y"%EP/*#IAL
+M!:70AMPZ!UV#KD`K&A<2]`8*XP-%V$E-^?E1E5^G;[_"A./#/T=L%"]RVBVZ
+M`&'I)?I`8T_?[>ZX/KT?>UQ_5/4OEIH672%$1NFB0YLQW?OMXUV+W+X-ZO)X
+MD<8HO(L#,`F<!XEWZA"3_83)RB'9J@9E6IF]!3\"!^%>IT<5X12;1/VWM@ZG
+/$[>*96SU"XRD3B>_"```
`
end
diff --git a/usr.bin/mkimg/tests/img-1x1-4096-pc98.vhdf.gz.uu b/usr.bin/mkimg/tests/img-1x1-4096-pc98.vhdf.gz.uu
index 49a64aa..2cfff46 100644
--- a/usr.bin/mkimg/tests/img-1x1-4096-pc98.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-1x1-4096-pc98.vhdf.gz.uu
@@ -1,14 +1,14 @@
# $FreeBSD$
begin 644 img-1x1-4096-pc98.vhdf.gz
-M'XL("//%'50``VEM9RTQ>#$M-#`Y-BUP8SDX+G9H9&8N;W5T`*V5L6Z#,!"&
-M]SS%1=TR1/BP#UBCIG.EJNT:0B'*T';IT(&'KVU,\&$@266PD-'AC__WV><D
-MZ2X`B9"4$\_Y0+O;\KM=;5:6)IK[@$I!&0)?-=#BT.@K)%02=&_4H&F&Q@+M
-M=G3U.*&#(<B-F@U,X)Q=&7G^T!I6&4@%BB#'6Q6^[]\F#&,\PQT.K^$N@L4M
-MN-2,\K[4:E%<<'.!#K=VK/6`DTOJ-"*I[S*KXBX6Q'PTSL\S)'H-5Y#D+H8<
-M>,DO#/J*4`8RNPOZ(+1;&ES&OQ<>#J_8!8X[+N9V6=TZ5%=%3D8ZWADW[EP#
-MX3NWPV'<0B!M9=8KT-3(X#D?:)^W_.Z`T@&CS2"YLX-2H`:H!E*FGTF@`K+<
-M!R)?26WU_557/^=?/\,&)T85W6]F/*9FMU`&6)J?T(?I>_H>]J?-^?/4X_I2
-MU?]8DIETI2$RL$O<[M/NY=$B#X.Z-)PD\F?OJ$\H"4(PXT[=@2]GLOGMS=8-
-D')65V3?VP@*3I<K@5#(:]=_<=CB*O%3TJ;;Z`TU!^3)P"```
+M'XL(",F;>54``VEM9RTQ>#$M-#`Y-BUP8SDX+G9H9&8N;W5T`*V4/4_#,!"&
+M]_Z*J]@Z1/;E[+AK19F1$!]K"$GI`"P,#.&_X\NG'3=IBYRXD:O+/7E?GWU"
+MM!<`(8C\Q',^4.\2_ZY7FU5#D]5U0*4@#X&/%MC@D/5M"0H".YL,J*IQ>($Z
+MF5P]3MI@".JR9@,G<)U=BKQ^V!A6&9`"I<'@I0J?]T\G#&,\PRT.S^$&P?(2
+M7,I9SIM6+<H!-Q=H<>N.M1YQM*3.(D1YE5D5=[,@FDF>6V<0=@\7($P70Q\X
+MU!=&?=M0!GIV%_1!:#=G7.:_+QT<GK$+/NYUL;;+ZM:ANB)R,=+IR;CPY#+$
+M/[DM#N,V`FHZL]V!W".#YWR@OD_\NP52!XRV@H3:<%BGH"O0)6C%\XQ`;R$S
+M+A#]G5077Y]E\7W\<2O,.#GIZ.[@?$SYM.@,,.>/Z#>>._IN]H?-\>/0X_I6
+MU7^8-"^ZLA`*[-J`-J/=N]W#;8/<O0_JTG"1QBS[R]Y`$$CI&>_464SRZYNE
+IP6Q9@3*-S'YX?[P`XUZFK8IQ2DRR_EO;%J<C;Y5<B-4?7X$:67`(````
`
end
diff --git a/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.vhdf.gz.uu b/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.vhdf.gz.uu
index bcf2071..098c281 100644
--- a/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.vhdf.gz.uu
@@ -1,14 +1,14 @@
# $FreeBSD$
begin 644 img-1x1-4096-vtoc8.vhdf.gz
-M'XL("/7%'50``VEM9RTQ>#$M-#`Y-BUV=&]C."YV:&1F+F]U=`"ME,MN@S`0
-M1??YBBMUEP7R<PC;JLVN4J7^0""8J(NV4M5%%_[XVK%)L'$>JC"#!1KF>*X]
-M#&-A`(I0"Y#VI@2TA%*0Y!P]G']NL-MO8Q[?GNBE"L.N`HP[9S&$77/8*AMV
-MM8[`31+'KP,W8`V8*`(#KCE'-3=QU_(+N'8IN0'7W8LC-_?H#8S)<+L);K_P
-M8?"97`-WX/(^(,OE<B]79M_S.%_`.8=EL_P"[BQ73$)$@N.E[%"%.\7U)UR>
-MXPVQK)B=6;14^'`OKF_1&4@)J6<XJ2-.^"CMOF\+\V6'?:W2*Y2*BL#%:H]B
-MHR()&D#FV*LD:@5J4&^F0)$<,^S^Z]/L?]Y_I_M'L5$-0]E\O'!-T"U20[1^
-M$>K]\R2_A^?#^OWC,.)$5#4N[%KJJ9/F*BF5NW5]=/QU1YR<;Q)-=Z]38`J<
-M)\)C=KNT6#Q.G<2:`9T^ICE:\I(XBK7G<9IE4?\O98^CA4O%U=[J#P!,R,C=
-#!@``
+M'XL(",R;>54``VEM9RTQ>#$M-#`Y-BUV=&]C."YV:&1F+F]U=`"ME$]/A#`0
+MQ>_[*9YZVP-IAU+@NM&]F9AX\2@+9=V#FA@/'O"[.Z6PT,+^B:$4`GG,K_/:
+MR0CA!J`T4H).[%2$)(92B!4+%5B?3C3;+V,VS_?J,7*C63F89'$V1)P3FB@8
+MS6K=`3,O3IX'9A`Y!,T"'2X?HO*+N'/Y.5RQE%V'VUV+T_RL4!D8$^!>1[AR
+MX<.0$[L&?.`DVV*Y!+Q1@5UI[;K@\(3E*1P+S0#R<8-=&H60AY-SV2%RMX^K
+M!ER0XX7=\_/K<6;14I'UM;BJP,Z`""*>X&Y['-FHA/\O9IZGA>8I\B]7*JH#
+M+E9[BG1F91U#U]"F[54Q4@6=(\W&0/*.&4WY^6'*[\//>/\LSC:JNIZ?-IZX
+M"?(B*:BPB^C*OH_RNWO8KP_O^QY'G:M^86ZIQTX:NF1!9X/=+??1%KEY.V87
+M3S=IB.([Y<:L(*5GO,N.,=&O;U8=S9H:2=:FV4_OPQ,L[B6L/8M+1!#U_U*V
+1.+UPJ11"K/X`5,-&%]T&````
`
end
diff --git a/usr.bin/mkimg/tests/img-1x1-512-apm.vhdf.gz.uu b/usr.bin/mkimg/tests/img-1x1-512-apm.vhdf.gz.uu
index 189b488..b793e81 100644
--- a/usr.bin/mkimg/tests/img-1x1-512-apm.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-1x1-512-apm.vhdf.gz.uu
@@ -1,15 +1,15 @@
# $FreeBSD$
begin 644 img-1x1-512-apm.vhdf.gz
-M'XL(".7%'50``VEM9RTQ>#$M-3$R+6%P;2YV:&1F+F]U=`"M54UOPC`,O?,K
-M+.V&M*I-'(<=-PUND]#0SE!HBRH-J!C2=NB/7SYI2@MB4U,K2N3F]?G9<>/8
-M#@`4(!C$RF)GW,S-_L*@GKY':L21'_7(@B6W3EV'BRY&/1I;0*;=(@;,.N=X
-M")BT'?7\[1+0PFE^F(",M=$&2-S%[[FJ/O,>.#94N!:.=]F)PJP3`,E`(M"3
-MFZD`RK7;L5M6Z?%4GLK#?NGA4,%1I@_+O[#;I54O.S%P;O'.W*);,`?8SBUX
-M?CAT[:%)!VGA52*4(0/!`1%8IH@+[5/[#N#LF.<OB]?'C]DBU`]Q8'YTAWXL
-MT,]>DE`_"/G1T/K13?TD!RE[:K/1[^O;%J+G-[1^$Z=?G/;,UQWU/&H_%A`=
-MX&`,R75GXNZN:Q&Y[P&3$)`UZ36`F\,^WYS*G_`&D^O.1=%O^CSC^E]`$EAJ
-M6DRFUP&_A^EV7.ZV'LYW/_]AE>MSBB^CI':X,Y5@`[EJV/&N2!2JMT9=RTG2
-M"MRQ6X7J63@\!YL7L!:&IK?6IN7H[<T:SG2_\.7_YM;"T<"EHGZ4HU\LKXQY
-$T@<`````
+M'XL("*2;>54``VEM9RTQ>#$M-3$R+6%P;2YV:&1F+F]U=`"ME5UKPC`4AN_]
+M%6?L3EA)DY.DNYQ,[P8R&>QN%-NZPM3BA.VB^^_+ITT_%#<:CZ7E-(]OWG,2
+M";$#`#EP"D0%<4%C8`C-<R>@GC]':MQ@Y$8]L;"87)AU'A=U1CV96B#5:4X`
+ML]X\%@+C=J)>/G6!%J?U80R2Z!!K$/PJ?0]5]9$/X.A8R[4XUE?'"W,?`T@*
+M$D'<NZLH0.0Z[=2]5>GA6![+_>[-XU#A1*8GR[^HVZ;5H#H^<FWQRMJB;TH'
+M;-<6O#X<N_?0E$-HXU4A5"`%S@`1:*:$<YU3SSW@XI#GL]7CW<MB%?J'.+(^
+M<85_-/#/;I+0/PCUB;']$Q?]DPRD'.C-QK_/+]N(7M_8_B7./Y(.7,\GZF74
+M_E@@.N!H"I$*`Q3,[75M(O-G0!(":5->`USO=_GZ6'Z'.UCC=(6+8CCT?,KT
+M?X&00%-SQ&3Z/M!W.]],R^W&X_SIYW]8U?I4XNXJ54(DS7(7JL`&.7L_J6-]
+MDYI9ZBLSW<MQW%JX4Z<PT4][L7A:;%X`3XQ,'ZV'5D+C7MO%L#AS^H4O_[>V
+1%B=&;I64D,DOU%=49]('````
`
end
diff --git a/usr.bin/mkimg/tests/img-1x1-512-bsd.vhdf.gz.uu b/usr.bin/mkimg/tests/img-1x1-512-bsd.vhdf.gz.uu
index 7edc3a0..203face 100644
--- a/usr.bin/mkimg/tests/img-1x1-512-bsd.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-1x1-512-bsd.vhdf.gz.uu
@@ -1,13 +1,14 @@
# $FreeBSD$
begin 644 img-1x1-512-bsd.vhdf.gz
-M'XL(".;%'50``VEM9RTQ>#$M-3$R+6)S9"YV:&1F+F]U=`"ME$UO@S`,AN_\
-M"DN[]8"2D!AZK=:=)TW:K@4*50_=+COLD!^_&`+$?+6;"%$$<OSPVDXL1#L`
-MM`*1SZS+!GN(^6.C7=30%`%-"MJ`0<C<=C%,]L$,]N/X'H?#>IQ<\UK&Q:/1
-MX=0]7"]8/H)+R$LR2C+@E@PM3GB6&'!Z39W+A*C^%*S9*G==;;.17UAGD#7(
-M,XC,VQ0']O6%0=]^*D.Q<%?TP33<G'`IWR\#G+H3+G!<L5K;=75BJJ[<N!C)
-M^&8\>',)PF]NBU/;-@+5=!9W`MVNZ;ILL*\Q?UJ@]L#-,HB^]V$"6`-6@(;>
-M4PVXAS0+@8J?)%M^?5;E]_4GK##AJ"!U/3_)7R5T6S`%E=-/\$SO@;ZGXV5W
-MO5TZ7->JNA]KI*0;!]&3<)&'^W)X>VZ0IT%=,DT2AMDK-`@-4K+`O;H3/\Z$
-HTWVP50V%:61VDWTPPVRK(IP1(Z__UK;%X<9'Q1V^Z!>1V%I#,`<`````
+M'XL("*>;>54``VEM9RTQ>#$M-3$R+6)S9"YV:&1F+F]U=`"ME,%.A#`0AN\\
+MQ1AO:T+:H2W=*W$]FYBH5Y:%=0_JQ8,'?'<[0*$#"[L:2H&2Z7S\,]-6B+8!
+M*`21GWG.&^HLYE<=;:*&A@34*2@-VH!UT\70V0<SU"^[YSAL=8>32U[SN'C4
+M/`XOX7K!\AI<0E[!S$0!RAXW9VAPZJ9%T=OCU)(ZEPE1_BE8O5;N?&WMR"^L
+M,^`>1`'"=C;D0*KO'0U@T+>=RD`6[H(^F(:;$R[E\V6`PPOA`L?M%VN[J,[7
+M-L05*Q<C&>^,*W<N0?C.;7&X[D&`S<GB5J";-7W.&^K'F%\M4'7`U3*HT%@R
+MFP1,!:8$HVF<*C!;2&T(1+Z2ZN+SHRR^3M]AA0E'!:FJ\YW\,:'=8E+`G'YB
+M#C0.]-WNCIO3^]'C_%'E?ZP,)5T[B)J$ZPS&#N$^9$_W#3)[Z]4ETR0-7NY.
+M#R`42,D"[]0Y3/S#@U5]L&4%VC8R?6<?S$"XU_%113@M1E[_K6V+,RLOE5R(
+*Z!<+G]H<,`<`````
`
end
diff --git a/usr.bin/mkimg/tests/img-1x1-512-ebr.vhdf.gz.uu b/usr.bin/mkimg/tests/img-1x1-512-ebr.vhdf.gz.uu
index c7d0a81..45c1d9b 100644
--- a/usr.bin/mkimg/tests/img-1x1-512-ebr.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-1x1-512-ebr.vhdf.gz.uu
@@ -1,14 +1,15 @@
# $FreeBSD$
begin 644 img-1x1-512-ebr.vhdf.gz
-M'XL(".?%'50``VEM9RTQ>#$M-3$R+65B<BYV:&1F+F]U=`"ME;%N@S`0AO<\
-MQ47=,D2VL0^R1DWG2E7;-4`@RI!VZ="!AZ^-,?%A(*0R&#`ZW\=_OK-AS!X`
-M^AIMTX9F.SB:U6;5TGCQ,+"N1X$65VHO/4"W7'4=W1CW<)R!X-/ZUC[N%#O<
-M^C&@4I#G`?#=Z1/&2PI@^<A]VM#LM_3L]4D#5"E(!0HA$TL#_CQ\C*5#\ECS
-M9W'B'JX7S)?@$N/EC?0K8]K0W,K$/AU.SJG3"%8]%*R*7'LR&_CY>0:F5TD)
-M+.ML@@+[_,)-WRZ4(4BX,_H@##<WN)2.YQY.W`D7**Z8S>V\NG6HKHR<##5<
-M&0M7KH'0E6MQ(NY&(-J=15>@'A7>IPW-ZY:>%B@[8+09Q.Y7A`E@#5@!*M-/
-M)>`.TLP'"EI)3?G]594_EU\_PP;'^S]'V(R_2,QJP11$;CZ")]/W]#T=SIO+
-M]>QP;JMR'Y9H)EUIB`S"11KNR_[MN44>;^J2<)+0G[U"`I/`.0F\4W>DY8SM
-H/N^"K6HH5"O3-?)"#*-;E<$I-O#Z;VXM#B.7BJZ]U1_9@4$XOP@`````
+M'XL("*J;>54``VEM9RTQ>#$M-3$R+65B<BYV:&1F+F]U=`"ME3US@S`,AO?\
+M"N6Z9>!L81MGS36=>]?KQTH(I!G:+ATZT/]>"_-A8R!)SV#`G*R'5Y9L&+,'
+M@+DFV[RA3D9'O=JL&AH_W`RLJDF@Q17&RPPP+9=MQS3&'1QG@'Q>W]K%'6.'
+M6]T&E!+R/``^=_J0O`0"RR?N\X9ZE_AGKT\04&8@)$@%&J\-^'7_,I4.P6/-
+MG\7A)5POF%^#2\G+&>E6QKRA'LK$/CN<6%)G$*R\*5@9N?:$'OFY>09F5DD!
+M3+<V](%]?F'0MPUEH!?N@CX(P\T)E_GCN8/#"^&"CSLLYG99W3I45T1.AARO
+MC"M7+D'\E6MQ&'<CP&9G,15H1H7W>4/]F/BG!8H6&&T&!2I-9I6"JD"5H"3U
+M,P%J"YEV@>A74EU\?9;%]_G'S3#A>/_G"!OY8TJK166`.7U$':GOZ+O;GS;G
+MCU.'Z[:J[L-"T:1+`Q%!N,:@]!#NP^[IOD'NWGMU:3A)@Y>YLB,P`9Q[@;?J
+M#";Y]8,5?;!E!5(W,KOFO7@&PKV-MRK"23;R^F]N+4Y%+I6<L=4?RT&B4[\(
+"````
`
end
diff --git a/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdf.gz.uu b/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdf.gz.uu
index 7e6c736..5990d3c 100644
--- a/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdf.gz.uu
@@ -1,18 +1,19 @@
# $FreeBSD$
begin 644 img-1x1-512-gpt.vhdf.gz
-M'XL(".G%'50``VEM9RTQ>#$M-3$R+6=P="YV:&1F+F]U=`"METMOU#`0@._[
-M*P;U5D2P'=O)'EO12MS*Z]9#\["KE6`1$@<.^?%X_"!VU@X4.1E%64W\99X9
-M+R'N`.`,R)"YEA7+;9.>R^'Z8&ET?!G0O!]-V``;`W2XR2@)PV>4`JV]$&I7
-MN<5&6K+>6URS'J2)<'.\:B-E18QK'"ZXJU\&%`*&X0+X)=C';#H$<`G\",P\
-M3X!3$`P$_X.SOHLIMN_N_CT\W'S\C+#'U5U&C5+-0%J01]#SQCI:=O>T<=?A
-MC$$8?::SSK9%W-MM]!RN1=R\@\M)&<?W5KD:^K?<.IP@Z:H^7M4+Z!G(">:A
-MB/N:X&3ERN.H'B5T$T@%@L*D\6:60*FQS[1);R$,F,G[$3H*;$3@<O[0G!WL
-M3?/CM;>/4U\1.2DK2M'C;*\BT*B_N`LIKJT=O1ZC)ZI%[^B+)2=E13%Z@XM>
-M/DAH5*YU#<Y'K7F5XL;*T9.H-OUAOM^7U[)B>6C2TP&Y!U:S4&@]5>P.Q%7L
-M#L15[`[$5>T.!%;L#L15[`[$5>P.Q%7M#@-4I-X01YRMO<XFH(51I684Q_$2
-M$A'&9<"QO=&_,\3SR5`5ASCB=H>X5D5GP[%QMN(01US5(2[]]EN:W9GM+RGP
-MON.X6>OZ&,C6FK'`Z?M933]/O^+H(8ZZBL@*KF<M%J;L@`WX$CGC?63?U=WS
-M]>G;<\`Q[U5X,5:TJ6(#X1?NRM3=^]M/[RSR:;4N\YF2<?1&#H3C)R9VW%OW
-ME):*M#N@X*S2F$O"5TE^)(IL(2/.EDK\\/_FUN%JEXKY:W#X#1@%S56S#0``
+M'XL("*V;>54``VEM9RTQ>#$M-3$R+6=P="YV:&1F+F]U=`"ME4N/U#`,@._S
+M*SS:"UI$E3B/9FXP8E=P6V"Y<>ES60D&(7'@4/X[<9(^TFD&=I4T4V7D^*OM
+MV#%C?@!(!%9MO-."X5C$S["[WCD:KY\&M-\G$U;`P@(]KK%"AK2GZZ#OPV3<
+M:7EE(0%Y6(^X8AIR7RQP[:1U/M."!<Z/V=W^:4"EH*K.@)]'^]`=AP*I01X`
+M[7X&DH-"4'+".5]5L[3OYO8]W+WY>$^P+[.[R*VP;T$:$`B\7UG'D^Z^PY6[
+M'F<-`B'6T1YQ(H43^W7T/$X0CE_`;4T8>`(G+VGY'/J_L_4XQ6(ML]0R"@R"
+M;J"MDKAO$4YGSCQ)XEI#V8#N0'%H>EJT&CBW]MDR,0Z"@"VP`Y0VT#4!A].'
+MXN1AKXJ?+X-]DH>,V)II02IZ$B]E!!GU#W<AQHG<T3,4/94M>H>0+%LS+4A&
+MK_+1VPX2&;59,L,8M6(?X^K,T=,DMO5A[^_S=UHPW!7QXX$R`+-9*%'GK`["
+M9:P.PF6L#L)EK0X"9JP.PF6L#L)EK`["9:T."W3)G*F)$\XU\9[B7`N0*S.2
+M[9CL>TTH$;NK\5+K3S?QQ&'HC$V<<!>;N$B?;1BX<C9C$R=<UB9N@8;$6H!V
+M]:45K4L)VI:460)QSAD';'Z<NN;7X^]5]$Q(E<U)^B@H,74)6-%'=$OKA7U7
+M-P_7C]\?1AP&K\8/4T;;++80>>:N%6@SNWM[_/36(8]?)^LVKJE9R_Y*>YE(
+MNF*6C@?K+*;X$SLK)V>['M"0[C2C/Y&`<"\V,L^X5%EN?N[9>ESN5*D8V_T%
+(**T"\+,-````
`
end
diff --git a/usr.bin/mkimg/tests/img-1x1-512-mbr.vhdf.gz.uu b/usr.bin/mkimg/tests/img-1x1-512-mbr.vhdf.gz.uu
index b9c8a97..fcecea2 100644
--- a/usr.bin/mkimg/tests/img-1x1-512-mbr.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-1x1-512-mbr.vhdf.gz.uu
@@ -1,15 +1,15 @@
# $FreeBSD$
begin 644 img-1x1-512-mbr.vhdf.gz
-M'XL(".K%'50``VEM9RTQ>#$M-3$R+6UB<BYV:&1F+F]U=`"ME;%N@S`0AO<\
-MQ47=,B#[L`^R1DWG2E7;-4`@RI!VZ="!AZ^-,=@XD*0R'&!T]L=_OK-AS!P`
-M`H$55^[SCG:7^&>[VJPZ&B\?`^8,FB8`)@IH<)7"J0[*"MDWE#$.6KBZE'$&
-MR/NV,6B3\5@G#NXXC`IMWN'B$H.SX3:/`:6$H@B`[U8?QDZ'T$"9@9`@"7*\
-M-^#/_<<D8(/CL>;/X/`6;A#,[\&E>I33TZV,>4<[EHEY6IQ84J<0K'XH6!FY
-M]D0^&>?F&9A:)16PO/>A#QSR"Z.^;2@#O7`7]$$8;J%QF=^?.SB\$2[XN'(Q
-MM\OJUJ&Z*G(RY'1EW+ER-<1?N0:'<3<"['8658&J5WB?=[2OB7\:H.B!T6:0
-M^E\1I4`-4`TD=3L30%O(<A>(?B6UU?=77?V<?]T,:QP?_ARAZ?&8ZM5"&6"A
-M/T)'W7;T/>U/F_/E9'%VJ[(?%J0G72J(",(E/]R7W=MSASR,ZM)PDLB=O5(`
-M$\"Y%WBO[N"7,W7[O`VV;J"4G4QKWHOGN+I5:9QDDU'_S:W!4>124;6W^@.>
-'9*U,OP@`````
+M'XL("+";>54``VEM9RTQ>#$M-3$R+6UB<BYV:&1F+F]U=`"ME3USPR`,AO?\
+M"O6Z9?`!!DS67-.Y=[U^K,2QTPQMEPX=W/]>R?@#3.TD/6+9(2?T^!42A#'W
+M`9`"F/WC.>]HMEEX-:OUJJ7Q_75`PZ"N(V"&0(<K$8<3T*SJ!FB,`PG'&XTS
+M$+P;.X,F&S\WF8<[#%&QS3M\7.9P?;KU=4"EP-H(^-3K$ZG+(0FH"I`*E`8C
+M+DWX9?<\2=CA>*KU<SAQ#C<(YI?@<HKR9OJ=,>]HQC9QWSU.+JE#!*NN2E8E
+M[CUI)G%^G8'A+BF!F<XG0N!07QCU;6(9(DAW01_$Z5K"%>%\[N'$F70AQ.T7
+M:[NL[B965R8NAIKNC`MW+D'"G>MP(NU!(-J3!3L09\7/>4?SD(67`\H.F&P%
+MI="&W#H'78.N0"L:%Q+T!@KC`T7824WY^5&57Z=OO\*$X\,_1VP4+W+:+;H`
+M8>DE^D!C3]_M[K@^O1][7']4]2^6FA9=(41&Z:)#FS'=^^WC78O<O@WJ\GB1
+MQBB\BP,P"9P'B7?J$)/]A,G*(=FJ!F5:F;T%/P('X5ZG1Q7A%)M$_;>V#J<3
+.MXIE;/4+C*1.)[\(````
`
end
diff --git a/usr.bin/mkimg/tests/img-1x1-512-pc98.vhdf.gz.uu b/usr.bin/mkimg/tests/img-1x1-512-pc98.vhdf.gz.uu
index 94e27d6..f54ce7f 100644
--- a/usr.bin/mkimg/tests/img-1x1-512-pc98.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-1x1-512-pc98.vhdf.gz.uu
@@ -1,14 +1,14 @@
# $FreeBSD$
begin 644 img-1x1-512-pc98.vhdf.gz
-M'XL(".O%'50``VEM9RTQ>#$M-3$R+7!C.3@N=FAD9BYO=70`K96Q;H,P$(;W
-M/,5%W3)$^+`/6*.F<Z6J[1I"(<K0=NG0@8>O;4SP82!)9;"0T>&/__?9YR3I
-M+@")D)03S_E`N]ORNUUM5I8FFON`2D$9`E\UT.+0Z"LD5!)T;]2@:8;&`NUV
-M=/4XH8,AR(V:#4S@G%T9>?[0&E892`6*(,=;%;[OWR8,8SS#'0ZOX2Z"Q2VX
-MU(SROM1J45QP<X$.MW:L]8"32^HT(JGO,JOB+A;$?#3.SS,D>@U7D.0NAAQX
-MR2\,^HI0!C*["_H@M%L:7,:_%QX.K]@%CCLNYG99W3I45T5.1CK>&3?N7`/A
-M.[?#8=Q"(&UEUBO0U,C@.1]HG[?\[H#2`:/-(+FS@U*@!J@&4J:?2:`"LMP'
-M(E]);?7]55<_YU\_PP8G1A7=;V8\IF:W4`98FI_0A^E[^A[VI\WY\]3C^E+5
-M_UB2F72E(3*P2]SNT^[ET2(/@[HTG"3R9^^H3R@)0C#C3MV!+V>R^>W-U@T<
-CE979-_;"`I.ERN!4,AKUW]QV.(J\5/2IMOH#34'Y,G`(````
+M'XL("+2;>54``VEM9RTQ>#$M-3$R+7!C.3@N=FAD9BYO=70`K90]3\,P$(;W
+M_HJKV#I$]N7LN&M%F9$0'VL(2>D`+`P,X;_CRZ<=-VF+G+B1J\L]>5^??4*T
+M%P`AB/S$<SY0[Q+_KE>;54.3U75`I2`/@8\6V."0]6T)"@([FPRHJG%X@3J9
+M7#U.VF`(ZK)F`R=PG5V*O'[8&%89D`*EP>"E"I_W3R<,8SS#+0[/X0;!\A)<
+MREG.FU8MR@$W%VAQZXZU'G&TI,XB1'F5615WLR":29Y;9Q!V#Q<@3!=#'SC4
+M%T9]VU`&>G87]$%H-V=<YK\O'1R>L0L^[G6QMLOJUJ&Z(G(QTNG)N/#D,L0_
+MN2T.XS8":CJSW8'<(X/G?*"^3_R[!5('C+:"A-IP6*>@*]`E:,7SC$!O(3,N
+M$/V=5!=?GV7Q??QQ*\PX.>GH[N!\3/FTZ`PPYX_H-YX[^F[VA\WQX]#C^E;5
+M?Y@T+[JR$`KLVH`VH]V[W<-M@]R]#^K2<)'&+/O+WD`02.D9[]193/+KFZ7!
+H;%F!,HW,?GA_O`#C7J:MBG%*3++^6]L6IR-OE5R(U1]?@1I9<`@`````
`
end
diff --git a/usr.bin/mkimg/tests/img-1x1-512-vtoc8.vhdf.gz.uu b/usr.bin/mkimg/tests/img-1x1-512-vtoc8.vhdf.gz.uu
index bb8e698..63b7b65 100644
--- a/usr.bin/mkimg/tests/img-1x1-512-vtoc8.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-1x1-512-vtoc8.vhdf.gz.uu
@@ -1,14 +1,14 @@
# $FreeBSD$
begin 644 img-1x1-512-vtoc8.vhdf.gz
-M'XL(".S%'50``VEM9RTQ>#$M-3$R+79T;V,X+G9H9&8N;W5T`*V4RVZ#,!!%
-M]_F**W67!?)S"-NJS:Y2I?Y`()BHB[92U447_OC:L4FP<1ZJ,(,%&N9XKCT,
-M8V$`BE`+D/:F!+2$4I#D'#V<?VZPVV]C'M^>Z*4*PZX"C#MG,81=<]@J&W:U
-MCL!-$L>O`S=@#9@H`@.N.4<U-W'7\@NX=BFY`=?=BR,W]^@-C,EPNPENO_!A
-M\)E<`W?@\CX@R^5R+U=FW_,X7\`YAV6S_`+N+%=,0D2"XZ7L4(4[Q?4G7)[C
-M#;&LF)U9M%3X<"^N;]$92`FI9SBI(T[X*.V^;POS98=]K=(KE(J*P,5JCV*C
-M(@D:0.;8JR1J!6I0;Z9`D1PS[/[KT^Q_WG^G^T>Q40U#V7R\<$W0+5)#M'X1
-MZOWS)+^'Y\/Z_>,PXD14-2[L6NJID^8J*96[=7UT_'5'G)QO$DUWKU-@"IPG
-MPF-VN[18/$Z=Q)H!G3ZF.5KRDCB*M>=QFF51_R]ECZ.%2\75WNH/`$S(R-T&
-"````
+M'XL("+>;>54``VEM9RTQ>#$M-3$R+79T;V,X+G9H9&8N;W5T`*V43T^$,!#%
+M[_LIGGK;`VF'4N"ZT;V9F'CQ*`MEW8.:&`\>\+L[I;#0POZ)H10"><RO\]K)
+M".$&H#12@D[L5(0DAE*(%0L56)].--LO8S;/]^HQ<J-9.9AD<39$G!.:*!C-
+M:MT!,R].G@=F$#D$S0(=+A^B\HNX<_DY7+&478?;78O3_*Q0&1@3X%Y'N'+A
+MPY`3NP9\X"3;8KD$O%&!76GMNN#PA.4I'`O-`/)Q@UT:A9"'DW/9(7*WCZL&
+M7)#CA=WS\^MQ9M%2D?6UN*K`SH`((I[@;GL<V:B$_R]FGJ>%YBGR+U<JJ@,N
+M5GN*=&9E'4/7T*;M53%2!9TCS<9`\HX93?GY8<KOP\]X_RS.-JJZGI\VGK@)
+M\B(IJ+"+Z,J^C_*[>]BO#^_['D>=JWYA;JG'3AJZ9$%G@]TM]]$6N7D[9A=/
+M-VF(XCOEQJP@I6>\RXXQT:]O5AW-FAI)UJ;93^_#$RSN):P]BTM$$/7_4K8X
+0O7"I%$*L_@!4PT87W08`````
`
end
diff --git a/usr.bin/mkimg/tests/img-63x255-4096-apm.vhdf.gz.uu b/usr.bin/mkimg/tests/img-63x255-4096-apm.vhdf.gz.uu
index e1b6626..24ca4e7 100644
--- a/usr.bin/mkimg/tests/img-63x255-4096-apm.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-63x255-4096-apm.vhdf.gz.uu
@@ -1,15 +1,15 @@
# $FreeBSD$
begin 644 img-63x255-4096-apm.vhdf.gz
-M'XL("/_%'50``VEM9RTV,W@R-34M-#`Y-BUA<&TN=FAD9BYO=70`K57);L(P
-M$+WS%2/UAM3(\3*FIRXJW"JAHIXA(@F*5""B2.TA'U^OX"P@6MF,+$<3/]Z\
-M9T\(L0.`"Q`4B`KB@IGY_-P):*;OB1HD\:,96;#TVJ[+<$EG-*.Q!:0Z+0CP
-MO+>/A8!I.]',W[J`%D[SXRE(H@/7@.(F?L]U_5D,P-%8Y5HXUF<G2K-.`20%
-MR0$?W(PE8*'3CMVRS@['ZECM=TL/QQ4<YGJS_`N[;58/LA.1O>4W>CMQ"^H`
-MV]Z"Y\=CGSUN[$`MO#)"!:<@&'`.-%?$A<ZIYQ[@[%`4+XO7^X_9(M2/\\C\
-M\`;]:*"?O22A?A#RP]CZX57])`,I!\[F6;^O;WL0/;_(^J7$Z4>R@?ERHIDG
-M[9\%Y`XP&D-TW1F9N^M:1.9[P"0$I&=[#>!ZORO6Q^HGO,'HNG-9#H?>3YG^
-M%J`$FID6D^MUP.]NNAE7VXV'\]W/_['R^F1QMTILESM3!AO(U9D=ZXN$'?44
-M3U:V"G?L5F9^#(OEIV*+$KBEZ:/UT$IHN*>V&1;.=+_PY?]Z:^$P\E%1'\K1
-)+TV"K"_2!P``
+M'XL("&NF>54``VEM9RTV,W@R-34M-#`Y-BUA<&TN=FAD9BYO=70`K55=:\(P
+M%'WW5US8F["2YM.];&Q,WP8RV;.4-I7"U.*$[:'^]^73IA^*&XF7D'*;TW//
+M2:X(V0%`&3`,2`5R023D*;3/O8!F_IZH\9CXT4PL6(JN[+H,E_1&,YE:0*S3
+M#`$M!OM(")AV$\WRK0]HX30_FH)`.G@.G-W$[[FN/^4('(Y5KH4C0W:L-&ME
+MAL`@*/`'-_,2N-1IQVY=9X=C=:SVN[6'HPJ.%WJS^`N[;5:/LF.1O:4W>CMS
+M"^P`N]Z"YT=CGSUJ[.!:>&6$"HJ!$:`4<*&(,YU3SP/`Q4'*E]7K_<=B%>I'
+M:61^_`;]<*"?O22A?A#RX['UXU?U$P2$&#F;K7Y?W_8@>GZ1]4N1TP]E(_/E
+M1+-,NC\+2!U@-(:BF)GNQXF[ZUI$XGO`+`3$K;T&,-_O9'ZL?L(;K.&TPV4Y
+M'GH_)OJ_@`O`F6DQA5X'_.[FFVFUW7@XW_W\AY779XO[58H"9K@M=Z$,-I"G
+MEAT9BM3NLM]1/$G9*=RQ.YGY*2R6GHN5TG`,HO_<)D9[LX8SW2]\^;_>6C@>
+/^:BH9CKY!5KF!832!P``
`
end
diff --git a/usr.bin/mkimg/tests/img-63x255-4096-bsd.vhdf.gz.uu b/usr.bin/mkimg/tests/img-63x255-4096-bsd.vhdf.gz.uu
index 1605f5a..5b09216 100644
--- a/usr.bin/mkimg/tests/img-63x255-4096-bsd.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-63x255-4096-bsd.vhdf.gz.uu
@@ -1,14 +1,14 @@
# $FreeBSD$
begin 644 img-63x255-4096-bsd.vhdf.gz
-M'XL("`#&'50``VEM9RTV,W@R-34M-#`Y-BUB<V0N=FAD9BYO=70`K90[3\,P
-M$(#W_(J3V#I$?L==:%519B0DF$-PJ@[`PL#@'X\OB1M?G@C%=J)8=_?E'O8Q
-MU@X`)8"5$^]Y@3_E=/ILES4T@4!=@-*@#=B@SOI%-D3@7\\O>3I\A^-+5O.X
-M?#`B3JSAHL.RGL,=$IP,PCK19#RQJCA(U^_5!.X^/,<>IY:\"YE@;DHP&ZS>
-M*G>QMG9@E]89N`,N@=E.)BCP5E_H_=N/W1`DW`7_8!QNB;B"ZO,$)U;"!8I[
-M0QPGRGT)5[)W''M7;5P,.;P9?[RY"*$WM\6);1N!:#I+.(%!:_R>%_BGG,X6
-MJ#K@9AFT7>\S$DP-QH'1^%TH,'LH;`H4]"3YZNO35=_7G[3"B.-M,YA<:"\D
-MWA93@"CQ)^8=OQ/_[LZ7W?7C$G&Q5<4?*X-)UP&B1N%:&N[CZ?EAZ)T<)\F2
-M[''T,VU[(7"2O4.*4[=@G6M:(.\7V1#!9*M"G&8#J__6ML69C8]*.'S9+_P)
-&SWLP!P``
+M'XL("&VF>54``VEM9RTV,W@R-34M-#`Y-BUB<V0N=FAD9BYO=70`K90[;\,@
+M$(!W_XJ3NF6P>.,LB10UG2M5:F?7QE&&MDN'#LY_+Q@3'\:/JC+&"'3<QSW@
+M"/$-0#`@Y<0X+VA/>?RUV2[K:,P!I08A02HH['8R]&@1"=JW\VN.6]OCZ)+6
+M/"X?M8!C:[A@,&_F<$>$XU;8H)V$(JV*`C?]`L\1[N#_@!-+UME($#,EF'56
+M;A6[D-MBI(?S#-0`Y4"*7L9BX#V_,-BW3\U@D;L+]D'J;NEP.MY/$8ZMN`LQ
+M[MWA4#ZC%*Y$[Y!:5VV<##Y^&7]\N0X2OUR/8]L6`M95%GL#[:YTG!>TSWG\
+M>:#H@9M%4-=%5ZH4!]6`,J"DFVL!:@^ZP$`6WZ2V^OHTU??U!V?8X:@O!I/=
+MZ3/N7HO2P$IWB*K='-GW<+[LKA^7@`NE*APLE`NZM!"1N*OKOM1ZW-/IY;%#
+MW@;K>!JD0<N?8^W$9<\ZWEMWZ\8C=E;<G36FLQ'U\7H03)8JAY-DI/7?W'J<
+/VOBJ"$*R7\Y^^\XP!P``
`
end
diff --git a/usr.bin/mkimg/tests/img-63x255-4096-ebr.vhdf.gz.uu b/usr.bin/mkimg/tests/img-63x255-4096-ebr.vhdf.gz.uu
index c48c7d2..8048b55 100644
--- a/usr.bin/mkimg/tests/img-63x255-4096-ebr.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-63x255-4096-ebr.vhdf.gz.uu
@@ -1,15 +1,15 @@
# $FreeBSD$
begin 644 img-63x255-4096-ebr.vhdf.gz
-M'XL("%_N+50``VEM9RTV,W@R-34M-#`Y-BUE8G(N=FAD9BYO=70`K94[;\,@
-M$(#W_(J3NF6(``,F2R)%3>=*5=O9<7&4H>W2H8-_?#EC',[&>508C$`'G^_%
-MF3'_`+@WV><%[6KTM(OEHJ/QP_U`G@1Z7(VG.&ZK%(Y%@TL<!USMUC:AW]8U
-M]VQBW$=N<YO[@$I!54V`KT$_D3D<I46Q%,"JQ#@O:'<KV@+0=`FC2I`*E`8C
-M;M7P??^6B*]A/)?!'B>NX8+"/H-2N&V$*YRPB7;Z3.Q/Q7D7SR/<QK\!)R]I
-MYSS!;$HP:ZS*FRS&-7HNCC-P"[P`9GJ9H,`AOG#6;SU50Q!S+^@'4W,KQ)5T
-M/X]PXHJY0'&'H;(D0GC%>YNI=G7F8/#QS;CQYB*$WER/$WD+P;JK+"X#W:[I
-M."]HGU>T>:#L@=D\:/I_FRY`-Z`M:(7S4H)>0VEBH*"9U-;?7[;^.?W&$48<
-M]\4@V?&\*/"VZ!)$A1_1'SB/]'O8'Y>GSV/`A5(5/BPU.ETYB)R8:ZBY3[N7
-MQ[%VQ=1)AGB/HYYQV7.&$^]M8YP<C+6V*X'\W,F"")*E"G&*C4[]-[8>IS.G
-.BOOO+OX`/$*Q[A`)````
+M'XL("'&F>54``VEM9RTV,W@R-34M-#`Y-BUE8G(N=FAD9BYO=70`K90];\,@
+M$(;W_(J3NF6(``-VED2*FLZ5JK:S[>`H0]JE0P?_^-Z%X(#!^:@`&]D^>/P>
+M=QQCM@'@G;RF#?UBU/K9?':B\>9Q($\"+:ZE59RFU8K&HJ-7&@=<B^\FH6^-
+M'=O*Q^URN]L]!E0*ZCH"OCM](G,X2D-F*8#5B7':T&\687?`ZI0PJ@2I0&FH
+MQ+T*/[<?B?A6C.=RV.+$+9P3;#,HA5M[N`*-G3?39N)YE9]W_K.'6]G;X>0U
+M=;@3S*0,D\ZJO,E280_7^7$&;H`7P*JS383`(;YPT;>,98C`W2OZ(':W)EP9
+MSN<>3MQP%T)<,U261`AO[-XJ5M=F#@8?GXP[3RY!PI-K<2)O(5B>*@MF(,Z*
+MQVE#_[H(NP7*,S#;#G8-,M&L"]`=:`-:T7,I02^AK'R@"#.I;[^_3/MS^/4C
+M3#ANBT'RHO6BH-.B2Q`U_43OZ-G3][3=SP_'O<.Y4N5^+#5MND*(C-SM&F#R
+MXN[+YNUYK*Z(-^FRRKJ).OVRAU^"W5O[.#DX:XR3Z:[@)3`D2Q7A%!NM^F]L
+1+4YG3A7-V.P/(8K+DQ`)````
`
end
diff --git a/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhdf.gz.uu b/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhdf.gz.uu
index 820c91d..ce2279b 100644
--- a/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhdf.gz.uu
@@ -1,19 +1,19 @@
# $FreeBSD$
begin 644 img-63x255-4096-gpt.vhdf.gz
-M'XL("`/&'50``VEM9RTV,W@R-34M-#`Y-BUG<'0N=FAD9BYO=70`K9<[;]PP
-M#,?W^Q0LLJ6HHK=]2XL&38!NZ6OK$#^D($.O*-JA@S]\1<EWEGR2T0MD$X8/
-MM'[FGR9-'Z5A`Y`<:)<YEAW3+4GW:7>]\S367P9T]\<05D#B@`$W."?E>(TQ
-M8.ULE/E58;$S09=SCR/+1DF$&^-5*RL[8AP)N*-<>QE0*>BZ,^"W8WS</PX%
-M4H/<`W?74Y`,%`<E3SBO70UQ?'?W'^'A_>>O"/N^R.7,.4<.[0##'FR_BH[]
-MO]R`<P%A]KG-BA5%W$T>)Q`W;N!R5L;)K56AABX1JVBZJHU7"0.]`-M!-Q9P
-M;U<X7;GR)+I[#<T`VH!B,%@\&34P!M"Z-FD]A`-W(>ZA8<![!$Z'3^008&_(
-MK]=S?)+-%9&SLJ.4/8FE0MN2W`9K>U,NI#A1.WLM9D]5R]Y^+I:<E1W%['4A
-M>_DD8?9RK>MP<];(JQ37U\T>\U/#]8=[?Y\?RX[I@:1[`,H96"U"9>U0L3L0
-M5[$[$%>Q.Q!7M3L06+$[$%>Q.Q!7L3L05[4['-#0>D,<<5A[H@7#H!'0IU53
-M'L=32WZ'P&X2N89OC?Z-(9Y_&*;B$$?<YA"WIB3VQ%F)K3C$$5=UB.OY\UL+
-MT+Z_M,+S1H)V+=7&0+[4C`<./P]F^//\-\Z>]F]F6#Z25X;KN<#"U*Y%.KR)
-M'O$\BN_J[NGZ^<?3$<=G5<<;8T6[*G80>297IW+O;[]\\,C');K,:TJOLN?B
-M%#81/D?WZ(_O8K'R)-98<,JI7"SYD3BRA8PX7RKQQ2]]M@%7NU3<7X/=/VC0
-&,#.S#0``
+M'XL("'2F>54``VEM9RTV,W@R-34M-#`Y-BUG<'0N=FAD9BYO=70`K99-;]P@
+M$(;O^RNFZBU5$6#`[&6K1$VDWM*O6R^VL:,<LE6E'GK8_/?.@+T&K[&Z%6MD
+M>37FX9UAQ@/GX0>@)/!FY9XWG.Y8>IUV-SM/$^UU0%R?)"R`#($!UZ&12WJG
+M[V$8QL&%GQ4F=P*J?GR><&S^'5B$<^=9ER-OB'$LX"9WA^N`6D/37`"_3_JD
+MWPX-RH#:@\3W.2@!6H)69YSW77>QOON'3_!X^^4;P7[,[DI!(AS8!CH#M5NH
+M$QONOJ;N!AP*`MR01;0G7)7%'9;1"[@*C6V_@5L;>9S:FA5RZ-_V-N`T3V?9
+M>!9J;BL8&FA<!G=8X$SAS%-D;G%7.S`]:`'=0`_.@!``%LO$>H@$B1+W4`N0
+M+0%/Q\_L&&#OV:]WHSXEQHQ8&WE#+GJ*4H7;G+LUY?:FNY#BJM+1LQ0]72QZ
+M^S%9UD;>D(U>$Z*W'B2*WEKI(FZ,&GN3XMJRT1.^:V!]X/?[\IXWG!Y9>@6@
+M&H'%%-:N[@M6!^$*5@?A"E8'X8I6!P$+5@?A"E8'X0I6!^&*5D?M;#A3E6GB
+MA*/<$WL0"H::6GDB(]N.9WV'V%W+Y5;KWVCBJYMA><$F3KC-)MX.USI;L(D3
+MKF@31Z`_[YD*C*\OH^FY5F"PI&P,E'/.>&#W\]AWOY__+*+GSWOG0_)BT'Q9
+M46(:+)&&%C&.GB-];^^?;IY?GB:<'+V:%J:,QBQ&B+IP%T^75L[N/MQ]_>B1
+MK[.ZE<_4/"NL@SJK(7%\5!?.HQ]B9]79V=Z!0XUJ'LF?Q)!+Y'#>BU_^W[T-
+0N-*I@N>]W5^),'<SLPT`````
`
end
diff --git a/usr.bin/mkimg/tests/img-63x255-4096-mbr.vhdf.gz.uu b/usr.bin/mkimg/tests/img-63x255-4096-mbr.vhdf.gz.uu
index 1e1f537..209001e 100644
--- a/usr.bin/mkimg/tests/img-63x255-4096-mbr.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-63x255-4096-mbr.vhdf.gz.uu
@@ -1,15 +1,15 @@
# $FreeBSD$
begin 644 img-63x255-4096-mbr.vhdf.gz
-M'XL("&+N+50``VEM9RTV,W@R-34M-#`Y-BUM8G(N=FAD9BYO=70`K94];\,@
-M$(;W_(J3NF6P``,F2R)%3>=*5=O9<7"4(>W2H8-_?.^,[8"Q\U%A",(Z>/(>
-M=YP9<P^`%,#*B7'>T&RSL#6+Y:*E\?UC0,.`\0B8(=#A*L3A`I19*AKSFEYI
-M)`.C7N&[[>:N0X.$;(,-GW7FX0[#KKC/&UJ<_US<K1\#*@5E&0'?>WWBJHS'
-M]14V<7Q-FS"J`*E`:3#B7H6?NX^10H?CJ1QV.'$+UPMV&32%VWBX'(VUM])E
-M8K?+SSM_[N'6[M?CY#5U>!+,3AEFG55ID\5@"_?Y<09N@>?`3&<3(7"(+UST
-MK6(9(G#WBCZ(W2T)5X3KN8<3-]R%$+<?*LM$"&^<WCI65R4.!A_?C#MO+D'"
-MF^MP(FTA6+65!3,05\7CO*%YS<+F@+(#)CM!TWW;=`ZZ!FU!*YH7$O0*"N,#
-M19A)3?7]9:N?TZ\?8<)Q5PPF.^T7.=T678`HZ4_T@>:>OJ?=<7DZ'WM<7ZKZ
-M/Y::#ETA1$;NFM#=E^W;\UA='A^2"4Z/DTZ_[*'CP>EM?)P<G+6V+8'\TH.7
-=P#!9J@BGV&C7?V/K<#IQJN!W=_$'S:-I2Q`)````
+M'XL("'BF>54``VEM9RTV,W@R-34M-#`Y-BUM8G(N=FAD9BYO=70`K90];\,@
+M$(;W_(J3NF6P``-VED2*FLZ5JK:S[>`H0]JE0P?_^-X98X.Q\U'9$(1S\/@]
+M[CC&[`,@!;!B8IPW-/LD;,UJO6IIO'P,F#-@/`(F"+2X"G&X`&46BL:TIE<:
+MR<"H5_ANNKGMT"`AV6'#9YMXN&._*^[SAA;G/X.[]6-`I:`H(N"[TR>NRGA<
+M7V86CF_>)HS*0"I0&G)QK\+/P\=(H<7QI1RV.'$+YP3;#)K"[3Q<BL;:6VDS
+ML=OEYYT_]W!;^W,X>4T=G@0S4X999]6RR9)C"_?Y<09N@*?`\LXF0F`?7QCT
+M;6(9(G#WBCZ(W2T(EX7KN8<3-]R%$%?VE64BA#=.;QNKJQ8.!A_?C#MO+D'"
+MFVMQ8ME"L&DK"V8@KHK'>4/SFH3-`F4'7.P$ZQ*9:-8IZ!JT`:UHGDG0&\AR
+M'RC"3&JJ[R]3_9Q__0@3CMMB,-EIOTCIMN@,1$$?T4>:>_J>#J?U^7)R.%>J
+MW(>EID-7")&1NW4)3`[NONS?GL?JTOB0AEW63=3IESW\)SB]G8^3O;/&.)FN
+?!R^!8;)4$4ZQT:[_QM;B],*IHAE;_0'0:Q,V$`D`````
`
end
diff --git a/usr.bin/mkimg/tests/img-63x255-4096-pc98.vhdf.gz.uu b/usr.bin/mkimg/tests/img-63x255-4096-pc98.vhdf.gz.uu
index 8662222..2bc05e1 100644
--- a/usr.bin/mkimg/tests/img-63x255-4096-pc98.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-63x255-4096-pc98.vhdf.gz.uu
@@ -1,15 +1,15 @@
# $FreeBSD$
begin 644 img-63x255-4096-pc98.vhdf.gz
-M'XL("&3N+50``VEM9RTV,W@R-34M-#`Y-BUP8SDX+G9H9&8N;W5T`*V5.V^#
-M,!#']WR*D[IE0'YCED2*FLZ5JK8SI2;*D';IT($/7QL;XL.01V5,B-'A'_][
-M^"#$'P""`:EGKLN&;E?@T:W6JYY&V_N`4D*=`E\ML,<QIZ\2T`BPL\D)O.UG
-M-#%T13BVX7_`46M,06'5HF'$%2,NN"LRQX^1BT+N5UB:S`IUKU"6("1(!9K=
-MJO!]_S91Z''94N)Q[!IN$!R*9P:WC7#<&MOHR;C8H*'`3;B)YQ%NXW\#3EQ2
-M9R-!S)QAT5F9MUBT'7A=G&>@!B@'HH.-8>"87SCKJU(9#+E[01^D[M8.5^+G
-M:81C5]P%C/MPN"B?*(57HK=)U369DT&G.^/&G>L@>.=Z',O;"*J^L]@*=%T\
-MN2X;NN<"#P\4`9@M@CI\W10'U8(RH*2;EP)4!:6.@0Q74M=\?YGFY_@;9]CA
-MJ&\&LZ=;S[C;+:H$5KN7J$\WC_0][`_KX^DPX(96-;Q8*!=T:2$B<5=C=Y]V
-M+X]3=3P-DD;1HTYGW/:LXRAZVQ@G1F>-Z5L@/9_H!AEF6Y7#23)9]=_<>IS*
-/7"KVP[OZ`WO*69D2"0``
+M'XL("'RF>54``VEM9RTV,W@R-34M-#`Y-BUP8SDX+G9H9&8N;W5T`*V4.V^#
+M,!#']WR*D[IE0'X#2R)%3>=*5=N94!-E:+MTZ,"'KP_;Q,:01V5,B.'PC_\]
+M?(38`T`P(,W,==G0[XIX]*OU:J#1[CZ@E-"DP%<#''`,]=4"6@%F-CF!=\.,
+M)H:^<,?6_7L<-<84Y%8M&D9<,>*<NR)S_!BY*.1^A:7.K+`:%,H2A`2IH&*W
+M*GS?OTT46ERVE%@<NX;S@EWQS."V`8X;8Q>\&18;M!2X=C?A/,!M[,_CQ"5U
+M)A)$SQD6G95YBZ4R(UX7YAFH!LJ!5,[&8N"87SCKJU,9+'+W@CY(W6T05\;O
+MTP#'KK@+,>Z`N""?40JO1&^3JFLS)X-.=\:-.Q<A\<ZU.):W$=1#9S$5B%T\
+MN2X;^N<B'A8H'#!;!+N#[<Z*@^I`:5`2YZ4`54-9A4`65U+??G_I]N?T&V88
+M<=0V@]D3US..NT65P!K\B/K`>:#O87]<GSZ/'N=;E?^P4!AT:2`B<;<[`!%G
+M=Y]V+X]3=3P-TGF5==/H#-N>>1)%;QOBQ.BLUEZF/Z.;R##;JA`GR635?W-K
+0<2ISJ2A"5G]F`B/D$@D`````
`
end
diff --git a/usr.bin/mkimg/tests/img-63x255-4096-vtoc8.vhdf.gz.uu b/usr.bin/mkimg/tests/img-63x255-4096-vtoc8.vhdf.gz.uu
index d5ecd33..433c602 100644
--- a/usr.bin/mkimg/tests/img-63x255-4096-vtoc8.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-63x255-4096-vtoc8.vhdf.gz.uu
@@ -1,14 +1,14 @@
# $FreeBSD$
begin 644 img-63x255-4096-vtoc8.vhdf.gz
-M'XL("`?&'50``VEM9RTV,W@R-34M-#`Y-BUV=&]C."YV:&1F+F]U=`"ME+UN
-MPR`4A?<\Q9&Z98C,C[$]1>I/MDJ5^@*U#409VDI5APY^^&*P8R#832-CA(C@
-M?)Q++C?+7`.X0$$A\KYSBIR!<S`*,#.3,%NBCN[PI=3]ZR-ESSO;NHV#$;-X
-MN7]0S2YTNZAUF^T`+`,=60:6R"ID-`ETN&I257_BEOPY7+U6N`[77(L39I20
-M"DI%N#</UZ[\9Y"+<!6(F[`;PB5CN&S:K'4_,CV'(Q-N'^.F<&FDHICT"7=(
-MNI-G7-."LU"U&.Q#"J=6316BK\7)&HW)$P+=SN/HHHG_IDHA2PO,S:XZ,<XO
-M="^[\'/`9@"NY9"40^43#$)#*%O\&`H.4:$H?2`-\@9=^_FAVN_3CW>#%M=7
-M/I.]R=[KJ:FEYI`"M.X/$;*?>_[NGH[;T_MQQ-$AJO%@4Z//I3E^$F48[L$4
-MYM@=BR_)5[DW:'PR'3X:__;V/HZ?@S4%2#?6YMB#'\%"*OLL+L\BU<UOP^+$
-/RJEB<F_S"YNC6FHN!P``
+M'XL("'^F>54``VEM9RTV,W@R-34M-#`Y-BUV=&]C."YV:&1F+F]U=`"ME,EN
+MPR`0AN]YBI%ZRR%B,\:G2EURJU2I+U#;0)1#6ZGJ(0<>OBQV,`2[:62,$-8P
+M'__8,X-0&`",0TV`5VXR`A4%QH`2`&IW$NR1;(+9?ROU\/9$Z,O.#[,),&R-
+ME^<'KUF#V67#;+8#4"1^>!DH`#6`2!$8<$WT:O[$+>D+N':M<`.NNQ;'[2I!
+M*E`JP[U/</W*/P-?A*L`APV](5P\ADOC8:W=2O4<#D?<?8Z+X9+,BT#T+ZB#
+MHCIYQG4],)IZ+0;[6,*I55,%ZVMQLH7.Y@D&W<_CR**(_Z9*+84'5O946UCG
+M#>9UESX!V`W`M13B6@CNS)P"U\"5;WX4:@:\@5I,@23)&S#]UZ?J?XZGR1?T
+M.-?Y;/86I_,GMI?:2VH@K;N$2[>?Z+M[/FR/'X<11X:HQHMMCSZWYKPDK&#!
+M8[A[VY@]\A35T?PC3;U"#5J=5*=%8T;,6&XCCIV#5=+7+(XS>4D,I>SSN`IE
+57C?7AL?QE5-%(+3Y!5F3,44N!P``
`
end
diff --git a/usr.bin/mkimg/tests/img-63x255-512-apm.vhdf.gz.uu b/usr.bin/mkimg/tests/img-63x255-512-apm.vhdf.gz.uu
index 6096dac..ebcf736 100644
--- a/usr.bin/mkimg/tests/img-63x255-512-apm.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-63x255-512-apm.vhdf.gz.uu
@@ -1,15 +1,15 @@
# $FreeBSD$
begin 644 img-63x255-512-apm.vhdf.gz
-M'XL("/;%'50``VEM9RTV,W@R-34M-3$R+6%P;2YV:&1F+F]U=`"M54UKPD`0
-MO?LK!GH3&I+=R<2>^D'U5I!*SQI,(H&JP0KM(3^^^ZF[211;=AV6#9-]OGEO
-M=Q+'>@!@"BF#6$1L@JOY_-P):*?OD1AQ9$<[TF#)M5V7X:+.:$=C#<AD.HT!
-MB]X^[@(F?J*=OW4!-9SDAPEDL0Q:`Z4W\7MNFL]R`(Z%*E?#\3Z[M%+K!"!C
-MD"'0@YFI`BIEVK!;-OGA6!_K_6YIX5#`42$W9W]AM\V;079I8&_Q1F_1+)@!
-M]+T%RP]#GSU4=I`47A@A`AFD'!"!%8)X*G/BN0<X.Y3ER^+U_F.V</5##,R/
-M;M"/.?KI2^+J!RX_"JT?7=4OXY!E`V?SK-_7MSZ(EE]H_29&OS@?F"\GVGGD
-M_S0@&L!@#,ET9^+FKDL1N>T!$Q>0G>U5@.O]KEP?ZQ_W!I/ISE4U''(_X_);
-M0!FP7+680JX=?G?3S;C>;BR<[7[VCX77)XN[59)?[DP8K"!79W:\+Q)UU!,\
-M>>45;MBMU/SH%HNG8LL*4-.TX3UX"0GWY)NAX53W<U_^K[<:C@(?%?&A'/T"
-(P78/5M('````
+M'XL("%>E>54``VEM9RTV,W@R-34M-3$R+6%P;2YV:&1F+F]U=`"M55UKPC`4
+M??=77-B;L)+FT[UL;$S?!C+9LY0VE<+4XH3MH?[WY=.F'XH;B9>0<IO3<\])
+MK@C9`4`9,`Q(!7)!).0IM,^]@&;^GJCQF/C13"Q8BJ[LN@R7]$8SF5I`K-,,
+M`2T&^T@(F'83S?*M#VCA-#^:@D`Z>`Z<W<3ON:X_Y0@<CE6NA2-#=JPT:V6&
+MP"`H\`<W\Q*XU&G';EUGAV-UK/:[M8>C"HX7>K/X"[MM5H^R8Y&]I3=Z2]T"
+M.\"NM^#YT=AGCQH[N!9>&:&"8F`$*`5<*.),Y]3S`'!QD/)E]7K_L5B%^E$:
+MF1^_03\<Z&<O2:@?A/QX;/WX5?T$`2%&SF:KW]>W/8B>7VS]9DX_E(W,EQ/-
+M,NG^+"!U@-$8BF)FNA\G[JYK$8GO`;,0$+?V&L!\OY/YL?H);["&TPZ7Y7CH
+M_9CH_P(N`&>FQ11Z'?"[FV^FU7;CX7SW\Q]67I\M[E<I"ICAMMR%,MA`GEIV
+M9"A2N\M^1_$D9:=PQ^YDYJ>P6'HN5DK#,8C^<YL8[<T:SG2_\.7_>FOA>.2C
+-HH[?Y!?6$J;]T@<`````
`
end
diff --git a/usr.bin/mkimg/tests/img-63x255-512-bsd.vhdf.gz.uu b/usr.bin/mkimg/tests/img-63x255-512-bsd.vhdf.gz.uu
index c102a9f..9df781c 100644
--- a/usr.bin/mkimg/tests/img-63x255-512-bsd.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-63x255-512-bsd.vhdf.gz.uu
@@ -1,14 +1,14 @@
# $FreeBSD$
begin 644 img-63x255-512-bsd.vhdf.gz
-M'XL("/?%'50``VEM9RTV,W@R-34M-3$R+6)S9"YV:&1F+F]U=`"ME#M/PS`0
-M@/?\BI/8.D1^QUUH55%F)"280W"J#L#"P.`?CR^)&U^>",5VHEAW]^4>]C'6
-M#@`E@)43[WF!/^5T^FR7-32!0%V`TJ`-V*#.^D4V1.!?SR]Y.GR'XTM6\[A\
-M,").K.&BP[*>PQT2G`S".M%D/+&J.$C7[]4$[CX\QQZGEKP+F6!N2C`;K-XJ
-M=[&V=F"7UAFX`RZ!V4XF*/!67^C]VX_=$"3<!?]@'&Z)N(+J\P0G5L(%BGM#
-M'"?*?0E7LG<<>U=M7`PYO!E_O+D(H3>WQ8EM&X%H.DLX@4%K_)X7^*><SA:H
-M.N!F&;1=[S,23`W&@='X72@P>RAL"A3T)/GJZ]-5W]>?M,*(XVTSF%QH+R3>
-M%E.`*/$GYAV_$__NSI?=]>,2<;%5Q1\K@TG7`:)&X5H:[N/I^6'HG1PGR9+L
-M<?0S;7LA<)*]0XI3MV"=:UH@[Q?9$,%DJT*<9@.K_]:VQ9F-CTHX?-DO_`G/
-%>S`'````
+M'XL("%JE>54``VEM9RTV,W@R-34M-3$R+6)S9"YV:&1F+F]U=`"ME#MOPR`0
+M@'?_BI.Z9;!XXRR)%#6=*U5J9]?&48:V2X<.SG\O&!,?QH^J,L8(=-S'/>`(
+M\0U`,"#EQ#@O:$]Y_+79+NMHS`&E!B%!*BCL=C+T:!$)VK?S:XY;V^/HDM8\
+M+A^U@&-KN&`P;^9P1X3C5MB@G80BK8H"-_T"SQ'NX/^`$TO6V4@0,R68=59N
+M%;N0VV*DA_,,U`#E0(I>QF+@/;\PV+=/S6"1NPOV0>INZ7`ZWD\1CJVX"S'N
+MW>%0/J,4KD3OD%I7;9P,/GX9?WRY#A*_7(]CVQ8"UE46>P/MKG2<%[3/>?QY
+MH.B!FT50UT57JA0'U8`RH*2;:P%J#[K`0!;?I+;Z^C35]_4'9]CAJ"\&D]WI
+M,^Y>B]+`2G>(JMT<V?=PONRN'Y>`"Z4J'"R4"[JT$)&XJ^N^U'K<T^GEL4/>
+M!NMX&J1!RY]C[<1ESSK>6W?KQB-V5MR=-::S$?7Q>A!,EBJ'DV2D]=_<>IS:
+.^*H(0K)?SG[[SC`'````
`
end
diff --git a/usr.bin/mkimg/tests/img-63x255-512-ebr.vhdf.gz.uu b/usr.bin/mkimg/tests/img-63x255-512-ebr.vhdf.gz.uu
index edf4354..0a93429 100644
--- a/usr.bin/mkimg/tests/img-63x255-512-ebr.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-63x255-512-ebr.vhdf.gz.uu
@@ -1,15 +1,15 @@
# $FreeBSD$
begin 644 img-63x255-512-ebr.vhdf.gz
-M'XL("%/N+50``VEM9RTV,W@R-34M-3$R+65B<BYV:&1F+F]U=`"ME3MOPR`0
-M@/?\BI.Z98@``R9+(D5-YTI5V]EQ<92A[=*A@W]\.6,<SL9Y5!B,0`>?[\69
-M,?\`N#?9YP7M:O2TB^6BH_'#_4">!'I<C:<X;JL4CD6#2QP'7.W6-J'?UC7W
-M;&+<1VYSF_N`2D%538"O03^1.1RE1;$4P*K$."]H=RO:`M!T":-*D`J4!B-N
-MU?!]_Y:(KV$\E\$>)Z[A@L(^@U*X;80KG+")=OI,[$_%>1?/(]S&OP$G+VGG
-M/,%L2C!KK,J;+,8U>BZ.,W`+O`!F>IF@P"&^<-9O/55#$',OZ`=3<RO$E70_
-MCW#BBKE`<8>ALB1">,5[FZEV=>9@\/'-N/'F(H3>7(\3>0O!NJLL+@/=KNDX
-M+VB?5[1YH.R!V3QH^G^;+D`WH"UHA?-2@EY#:6*@H)G4UM]?MOXY_<811ASW
-MQ2#9\;PH\+;H$D2%']$?.(_T>]@?EZ?/8\"%4A4^+#4Z73F(G)AKJ+E/NY?'
-ML7;%U$F&>(^CGG'9<X83[VUCG!R,M;8K@?S<R8((DJ4*<8J-3OTWMAZG,Z>*
--^^\N_@`\0K'N$`D`````
+M'XL("%JF>54``VEM9RTV,W@R-34M-3$R+65B<BYV:&1F+F]U=`"ME#UOPR`0
+MAO?\BI.Z98@``W:61(J:SI6JMK/MX"A#VJ5#!__XWH7@@,'YJ``;V3YX_!YW
+M'&.V`>"=O*8-_6+4^ME\=J+QYG$@3P(MKJ55G*;5BL:BHU<:!UR+[R:A;XT=
+MV\K'[7*[VST&5`KJ.@*^.WTB<SA*0V8I@-6)<=K0;Q9A=\#JE#"J!*E`::C$
+MO0H_MQ^)^%:,YW+8XL0MG!-L,RB%6WNX`HV=-]-FXGF5GW?^LX=;V=OAY#5U
+MN!/,I`R3SJJ\R5)A#]?Y<09N@!?`JK--A,`AOG#1MXQEB,#=*_H@=K<F7!G.
+MYQY.W'`70EPS5)9$"&_LWBI6UV8.!A^?C#M/+D'"DVMQ(F\A6)XJ"V8@SHK'
+M:4/_N@B[!<HS,-L.=@TRT:P+T!UH`UK1<RE!+Z&L?*`(,ZEOO[],^W/X]2-,
+M.&Z+0?*B]:*@TZ)+$#7]1._HV=/WM-W/#\>]P[E2Y7XL-6VZ0HB,W.T:8/+B
+M[LOF[7FLKH@WZ;+*NHDZ_;*'7X+=6_LX.3AKC)/IKN`E,"1+%>$4&ZWZ;VPM
+03F=.%<W8[`\ABLN3$`D`````
`
end
diff --git a/usr.bin/mkimg/tests/img-63x255-512-gpt.vhdf.gz.uu b/usr.bin/mkimg/tests/img-63x255-512-gpt.vhdf.gz.uu
index b9a9b8a..9aebe79 100644
--- a/usr.bin/mkimg/tests/img-63x255-512-gpt.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-63x255-512-gpt.vhdf.gz.uu
@@ -1,19 +1,19 @@
# $FreeBSD$
begin 644 img-63x255-512-gpt.vhdf.gz
-M'XL("/G%'50``VEM9RTV,W@R-34M-3$R+6=P="YV:&1F+F]U=`"METUOU#`0
-MAN_[*P9Q*R+8CNUD3XB*5N)6/GKCT'S8U4JP"(D#A_QX9NRDL;-VH,B)%7DU
-M\9-YQS.9+&/^`)`"6)>XY@W3=16?T^'JX&B\?QX0GT\N;(`5`CUN0",3=(\Q
-M8.T\&'>K_&(<-5OG#E>M!ZL"W!BNVHR\(<15'K?(M<\#*@5==P&\7_P3;CL4
-M2`WR"`+O9R`Y*`%*/N&<=C6$_MW<?H"[=Y^^$.SK*E=P-)H16`WZ"';<>,?S
-M<D\;N1Z'#E'TA4V*K;.X-]OH>5Q-N'$'EQIYG-Q;Y7/HW_;6XQ2+5[7AJE9!
-M*T`/,'99W+<(IPMGGB1SKZ$90!M0'`9+DU$#Y^@?EDGK(`($[OL1&@ZB)^!T
-M_EB=/>QU]?/5[)_D<T:D1MZ0BYX4>QE!3OU%+L2XNG3T6HJ>*A:]XYPLJ9$W
-M9*/7^>BE@T1.I4H7<7/4JA<QKB\</4UFK`]\?U]>\X;IKHI/#Y0SL)B'RMJA
-M8'40KF!U$*Y@=1"N:'40L&!U$*Y@=1"N8'40KFAU(-"P<DV<<"[W&K<!-?0F
-M=B/;CJ=E(Y9VN>#$7NO?:>+IS3`%FSCA=INX-5FQR[$16[")$ZYH$]?SY[?&
-MKS-77UK1O)'TL=:T(5"L.>.`PX^S&7Z=?H?1(QSW&9$<M%[4E)BZ`='10_1(
-M\\"_ES>/5Z?OCPM.S*J6!U-&8Q8C1%[(U;'<V^O/[QWR8?4N\9K2F^BAG[6-
-MA,_>/;CKVU"L?!)K+*!R)M<1_8@,R40FG$N5\.;_W5N/*YTJ^-?@\`>4./-P
-$LPT`````
+M'XL("%VF>54``VEM9RTV,W@R-34M-3$R+6=P="YV:&1F+F]U=`"MEDUOU#`0
+MAN_[*P8A<2BJ93NVX[TLHJ*5N!4HXL(EB9.J$BQ"XH#$]K\S8^?+V3C0RALK
+MRFKBQ^^,9S+F//P`E`1>K=S3AM,5BZ_3[F+G::)^&A#7)PD+($-@P#5HY)+>
+M:5OHNGYPX6>%R8V`HNV?!QR;?@<VP[EQUOE(&^8X%G"#N]W3@%I#59T!/P_Z
+MI-\.#<J`VH/$]SDH`5J"5B/.^ZZ;N;[KF_=P^_;C'<&^3NY*@<8"HZ?!&"CK
+MA3J1<E>R[D_L;L"A(,`-641[P!7)Z!V6T0NX`HUUNX%;&VF<VIH5<NC_]C;@
+M-(]GV?DLJ\%*,`VX*HG[%N%,YLQ39*YQ5QLP+6@!34</SH`0J`_+Q'J(!.F`
+M[Z$4(&L"GHX?V#'`+MG/U[T^)?J,6!MI0RIZ2FYE!(GZA[L0XXK<T;,4/9TM
+M>OL^6=9&VI",7A6BMQXD$K56NHCKH\9>Q+@Z<_0,F;$^\/M]?D\;3K<LO@)0
+M]<!L"DM7MAFK@W`9JX-P&:N#<%FK@X`9JX-P&:N#<!FK@W!9JZ-T-IRI\C1Q
+MPE'N20/[&G0)MHEE)-OQZ17[$H0=YNY:+K=:_T837]T,RS,V<<)M-O&Z2SD[
+M<A;.9FSBA,O:Q!'HSWNF`./KRVAZ+A48+"D[!\HI9SRP^7%LFU\/OQ?1\^>]
+M\9"\&#1?%I28I@19T2+&T?-,W\OK^XN'[_<#3O9>#0M31F,6(T2=N5LZ"N;H
+M[LW5IW<>^3BI6_E,3;/".JBSZ"+'>W6/_OYF[JP:G6T=.-2HIA']B0RI1`[G
+7O?G+S]W;@,N=*M@E=W\!E(LU`;,-````
`
end
diff --git a/usr.bin/mkimg/tests/img-63x255-512-mbr.vhdf.gz.uu b/usr.bin/mkimg/tests/img-63x255-512-mbr.vhdf.gz.uu
index 0ba7533..75debd4 100644
--- a/usr.bin/mkimg/tests/img-63x255-512-mbr.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-63x255-512-mbr.vhdf.gz.uu
@@ -1,15 +1,15 @@
# $FreeBSD$
begin 644 img-63x255-512-mbr.vhdf.gz
-M'XL("%;N+50``VEM9RTV,W@R-34M-3$R+6UB<BYV:&1F+F]U=`"ME3UOPR`0
-MAO?\BI.Z9;```R9+(D5-YTI5V]EQ<)0A[=*A@W]\[XSM@+'S46$(PCIX\AYW
-MG!ES#X`4P,J)<=[0;+.P-8OEHJ7Q_6-`PX#Q")@AT.$JQ.$"E%DJ&O.:7FDD
-M`Z->X;OMYJY#@X1L@PV?=>;A#L.NN,\;6IS_7-RM'P,J!649`=][?>*JC,?U
-M%39Q?$V;,*H`J4!I,.)>A9^[CY%"A^.I''8X<0O7"W89-(7;>+@<C;6WTF5B
-MM\O/.W_NX=;NU^/D-75X$LQ.&6:=56F3Q6`+]_EQ!FZ!Y\!,9Q,A<(@O7/2M
-M8ADB</>*/HC=+0E7A.NYAQ,WW(40MQ\JRT0(;YS>.E97)0X&']^,.V\N0<*;
-MZW`B;2%8M94%,Q!7Q>.\H7G-PN:`L@,F.T'3?=MT#KH&;4$KFA<2]`H*XP-%
-MF$E-]?UEJY_3KQ]APG%7#"8[[1<YW19=@"CI3_2!YIZ^I]UQ>3H?>UQ?JOH_
-MEIH.72%$1NZ:T-V7[=OS6%T>'Y()3H^33K_LH>/!Z6U\G!R<M;8M@?S2@Y?`
-<,%FJ"*?8:-=_8^MP.G&JX'=W\0?-HVE+$`D`````
+M'XL("&&F>54``VEM9RTV,W@R-34M-3$R+6UB<BYV:&1F+F]U=`"ME#UOPR`0
+MAO?\BI.Z9;```W:61(J:SI6JMK/MX"A#VJ5#!__XWAEC@['S4=D0A'/P^#WN
+M.,;L`R`%L&)BG#<T^R1LS6J]:FF\?`R8,V`\`B8(M+@*<;@`91:*QK2F5QK)
+MP*A7^&ZZN>W0("'98<-GFWBX8[\K[O.&%N<_@[OU8T"EH"@BX+O3)Z[*>%Q?
+M9A:.;]XFC,I`*E`:<G&OPL_#QTBAQ?&E'+8X<0OG!-L,FL+M/%R*QMI;:3.Q
+MV^7GG3_W<%O[<SAY31V>!#-3AEEGU;+)DF,+]_EQ!FZ`I\#RSB9"8!]?&/1M
+M8ADB</>*/HC=+0B7A>NYAQ,WW(405_:592*$-TYO&ZNK%@X&']^,.V\N0<*;
+M:W%BV4*P:2L+9B"NBL=Y0_.:A,T"90=<[`3K$IEHUBGH&K0!K6B>2=`;R'(?
+M*,),:JKO+U/]G'_]"!..VV(PV6F_2.FVZ`Q$01_11YI[^IX.I_7Y<G(X5ZK<
+MAZ6F0U<(D9&[=0E,#NZ^[-^>Q^K2^)"&7=9-U.F7/?PG.+V=CY.]L\8XF:X'
+>+X%ALE013K'1KO_&UN+TPJFB&5O]`=!K$S80"0``
`
end
diff --git a/usr.bin/mkimg/tests/img-63x255-512-pc98.vhdf.gz.uu b/usr.bin/mkimg/tests/img-63x255-512-pc98.vhdf.gz.uu
index 5600c7a..cb329a1 100644
--- a/usr.bin/mkimg/tests/img-63x255-512-pc98.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-63x255-512-pc98.vhdf.gz.uu
@@ -1,15 +1,15 @@
# $FreeBSD$
begin 644 img-63x255-512-pc98.vhdf.gz
-M'XL("%CN+50``VEM9RTV,W@R-34M-3$R+7!C.3@N=FAD9BYO=70`K94[;X,P
-M$,?W?(J3NF5`?F.61(J:SI6JMC.E)LJ0=NG0@0]?&QOBPY!'94R(T>$?_WOX
-M(,0?`((!J6>NRX9N5^#1K=:KGD;;^X!20IT"7RVPQS&GKQ+0"+"SR0F\[6<T
-M,71%.+;A?\!1:TQ!8=6B8<05(RZX*S+'CY&+0NY76)K,"G6O4)8@)$@%FMVJ
-M\'W_-E'H<=E2XG'L&FX0'(IG!K>-<-P:V^C)N-B@H<!-N(GG$6[C?P-.7%)G
-M(T',G&'169FW6+0=>%V<9Z`&*`>B@XUAX)A?..NK4AD,N7M!'Z3NU@Y7XN=I
-MA&-7W`6,^W"X*)\HA5>BMTG5-9F30:<[X\:=ZR!XYWH<R]L(JKZSV`IT73RY
-M+ANZYP(/#Q0!F"V".GS=%`?5@C*@I)N7`E0%I8Z!#%=2UWQ_F>;G^!MGV.&H
-M;P:SIUO/N-LMJ@16NY>H3S>/]#WL#^OCZ3#@AE8UO%@H%W1I(2)Q5V-WGW8O
-MCU-U/`V21M&C3F?<]JSC*'K;&"=&9XWI6R`]G^@&&69;E<-),EGUW]QZG,I<
-.*O;#N_H#>\I9F1()````
+M'XL("&6F>54``VEM9RTV,W@R-34M-3$R+7!C.3@N=FAD9BYO=70`K90[;X,P
+M$,?W?(J3NF5`?@-+(D5-YTI5VYE0$V5HNW3HP(>O#]O$QI!'94R(X?"/_SU\
+MA-@#0#`@S<QUV=#OBGCTJ_5JH-'N/J"4T*3`5P,<<`SUU0):`68V.8%WPXPF
+MAKYPQ];]>QPUQA3D5BT:1EPQXIR[(G/\&+DHY'Z%I<ZLL!H4RA*$!*F@8K<J
+M?-^_311:7+:46!R[AO."7?',X+8!CAMC%[P9%ANT%+AV-^$\P&WLS^/$)74F
+M$D3/&1:=E7F+I3(C7A?F&:@&RH%4SL9BX)A?..NK4QDL<O>"/DC=;1!7QN_3
+M`,>NN`LQ[H"X()]1"J]$;Y.J:S,G@TYWQHT[%R'QSK4XEK<1U$-G,16(73RY
+M+AOZYR(>%B@<,%L$NX/MSHJ#ZD!I4!+GI0!50UF%0!974M]^?^GVY_0;9AAQ
+MU#:#V1/7,XZ[197`&OR(^L!YH.]A?UR?/H\>YUN5_[!0&'1I(")QMSL`$6=W
+MGW8OCU-U/`W2>95UT^@,VYYY$D5O&^+$Z*S67J8_HYO(,-NJ$"?)9-5_<VMQ
+/*G.I*$)6?V8"(^02"0``
`
end
diff --git a/usr.bin/mkimg/tests/img-63x255-512-vtoc8.vhdf.gz.uu b/usr.bin/mkimg/tests/img-63x255-512-vtoc8.vhdf.gz.uu
index d8c4d3d..cc939bc 100644
--- a/usr.bin/mkimg/tests/img-63x255-512-vtoc8.vhdf.gz.uu
+++ b/usr.bin/mkimg/tests/img-63x255-512-vtoc8.vhdf.gz.uu
@@ -1,14 +1,14 @@
# $FreeBSD$
begin 644 img-63x255-512-vtoc8.vhdf.gz
-M'XL("/[%'50``VEM9RTV,W@R-34M-3$R+79T;V,X+G9H9&8N;W5T`*V4O6[#
-M(!2%]SS%D;IEB,R/L3U%ZD^V2I7Z`K4-1!G:2E6'#G[X8K!C(-A-(V.$B.!\
-MG$LN-\M<`[A`02'ROG.*G(%S,`HP,Y,P6Z*.[O"EU/WK(V7/.]NZC8,1LWBY
-M?U#-+G2[J'6;[0`L`QU9!I;(*F0T"72X:E)5?^*6_#E<O5:X#M=<BQ-FE)`*
-M2D6X-P_7KOQGD(MP%8B;L!O")6.X;-JL=3\R/8<C$VX?XZ9P::2BF/0)=TBZ
-MDV=<TX*S4+48[$,*IU9-%:*OQ<D:C<D3`MW.X^BBB?^F2B%+"\S-KCHQSB]T
-M+[OP<\!F`*[ED)1#Y1,,0D,H6_P8"@Y1H2A](`WR!EW[^:':[]./=X,6UU<^
-MD[W)WNNIJ:7FD`*T[@\1LI][_NZ>CMO3^W'$T2&J\6!3H\^E.7X291CNP13F
-MV!V++\E7N3=H?#(=/AK_]O8^CI^#-05(-];FV(,?P4(J^RPNSR+5S6_#XL3*
-.J6)R;_,+FZ-::BX'````
+M'XL("&BF>54``VEM9RTV,W@R-34M-3$R+79T;V,X+G9H9&8N;W5T`*V4R6[#
+M(!"&[WF*D7K+(6(SQJ=*77*K5*DO4-M`E$-;J>HA!QZ^+'8P!+MI9(P0UC`?
+M_]@S@U`8`(Q#38!7;C("%07&@!(`:G<2[)%L@ME_*_7P]D3HR\X/LPDP;(V7
+MYP>O68/99<-LM@-0)'YX&2@`-8!($1AP3?1J_L0MZ0NX=JUP`ZZ[%L?M*D$J
+M4"K#O4]P_<H_`U^$JP"'#;TA7#R&2^-AK=U*]1P.1]Q]CHOADLR+0/0OJ(.B
+M.GG&=3TPFGHM!OM8PJE54P7K:W&RA<[F"0;=S^/(HHC_IDHMA0=6]E1;6.<-
+MYG67/@'8#<"U%.):".[,G`+7P)5O?A1J!KR!6DR!),D;,/W7I^I_CJ?)%_0X
+MU_EL]A:G\R>VE]I+:B"MNX1+MY_HNWL^;(\?AQ%'AJC&BVV//K?FO"2L8,%C
+MN'O;F#WR%-71_"--O4(-6IU4IT5C1LQ8;B..G8-5TM<LCC-Y20RE[/.X"F5>
+4-]>&Q_&54T4@M/D%69,Q12X'````
`
end
diff --git a/usr.bin/mkimg/vhd.c b/usr.bin/mkimg/vhd.c
index 6b9d6a0..6860c16 100644
--- a/usr.bin/mkimg/vhd.c
+++ b/usr.bin/mkimg/vhd.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014 Marcel Moolenaar
+ * Copyright (c) 2014, 2015 Marcel Moolenaar
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -62,6 +62,12 @@ __FBSDID("$FreeBSD$");
#define VHD_SECTOR_SIZE 512
#define VHD_BLOCK_SIZE (4096 * VHD_SECTOR_SIZE) /* 2MB blocks */
+struct vhd_geom {
+ uint16_t cylinders;
+ uint8_t heads;
+ uint8_t sectors;
+};
+
struct vhd_footer {
uint64_t cookie;
#define VHD_FOOTER_COOKIE 0x636f6e6563746978ULL
@@ -80,9 +86,7 @@ struct vhd_footer {
#define VHD_CREATOR_OS 0x46425344
uint64_t original_size;
uint64_t current_size;
- uint16_t cylinders;
- uint8_t heads;
- uint8_t sectors;
+ struct vhd_geom geometry;
uint32_t disk_type;
#define VHD_DISK_TYPE_FIXED 2
#define VHD_DISK_TYPE_DYNAMIC 3
@@ -111,46 +115,48 @@ vhd_checksum(void *buf, size_t sz)
}
static void
-vhd_geometry(struct vhd_footer *footer, uint64_t image_size)
+vhd_geometry(uint64_t image_size, struct vhd_geom *geom)
{
lba_t imgsz;
long cth;
+ imgsz = image_size / VHD_SECTOR_SIZE;
+
/* Respect command line options if possible. */
if (nheads > 1 && nheads < 256 &&
nsecs > 1 && nsecs < 256 &&
ncyls < 65536) {
- be16enc(&footer->cylinders, ncyls);
- footer->heads = nheads;
- footer->sectors = nsecs;
+ geom->cylinders = (ncyls != 0) ? ncyls :
+ imgsz / (nheads * nsecs);
+ geom->heads = nheads;
+ geom->sectors = nsecs;
return;
}
- imgsz = image_size / VHD_SECTOR_SIZE;
if (imgsz > 65536 * 16 * 255)
imgsz = 65536 * 16 * 255;
if (imgsz >= 65535 * 16 * 63) {
- be16enc(&footer->cylinders, imgsz / (16 * 255));
- footer->heads = 16;
- footer->sectors = 255;
+ geom->cylinders = imgsz / (16 * 255);
+ geom->heads = 16;
+ geom->sectors = 255;
return;
}
- footer->sectors = 17;
+ geom->sectors = 17;
cth = imgsz / 17;
- footer->heads = (cth + 1023) / 1024;
- if (footer->heads < 4)
- footer->heads = 4;
- if (cth >= (footer->heads * 1024) || footer->heads > 16) {
- footer->heads = 16;
- footer->sectors = 31;
+ geom->heads = (cth + 1023) / 1024;
+ if (geom->heads < 4)
+ geom->heads = 4;
+ if (cth >= (geom->heads * 1024) || geom->heads > 16) {
+ geom->heads = 16;
+ geom->sectors = 31;
cth = imgsz / 31;
}
- if (cth >= (footer->heads * 1024)) {
- footer->heads = 16;
- footer->sectors = 63;
+ if (cth >= (geom->heads * 1024)) {
+ geom->heads = 16;
+ geom->sectors = 63;
cth = imgsz / 63;
}
- be16enc(&footer->cylinders, cth / footer->heads);
+ geom->cylinders = cth / geom->heads;
}
static uint32_t
@@ -198,7 +204,8 @@ vhd_make_footer(struct vhd_footer *footer, uint64_t image_size,
be32enc(&footer->creator_os, VHD_CREATOR_OS);
be64enc(&footer->original_size, image_size);
be64enc(&footer->current_size, image_size);
- vhd_geometry(footer, image_size);
+ vhd_geometry(image_size, &footer->geometry);
+ be16enc(&footer->geometry.cylinders, footer->geometry.cylinders);
be32enc(&footer->disk_type, disk_type);
mkimg_uuid(&id);
vhd_uuid_enc(&footer->id, &id);
@@ -206,23 +213,6 @@ vhd_make_footer(struct vhd_footer *footer, uint64_t image_size,
}
/*
- * We round the image size to 2MB for both the dynamic and
- * fixed VHD formats. For dynamic VHD, this is needed to
- * have the image size be a multiple of the grain size. For
- * fixed VHD this is not really needed, but makes sure that
- * it's easy to convert from fixed VHD to dynamic VHD.
- */
-static int
-vhd_resize(lba_t imgsz)
-{
- uint64_t imagesz;
-
- imagesz = imgsz * secsz;
- imagesz = (imagesz + VHD_BLOCK_SIZE - 1) & ~(VHD_BLOCK_SIZE - 1);
- return (image_set_size(imagesz / secsz));
-}
-
-/*
* PART 2: Dynamic VHD support
*
* Notes:
@@ -262,6 +252,16 @@ _Static_assert(sizeof(struct vhd_dyn_header) == VHD_SECTOR_SIZE * 2,
#endif
static int
+vhd_dyn_resize(lba_t imgsz)
+{
+ uint64_t imagesz;
+
+ imagesz = imgsz * secsz;
+ imagesz = (imagesz + VHD_BLOCK_SIZE - 1) & ~(VHD_BLOCK_SIZE - 1);
+ return (image_set_size(imagesz / secsz));
+}
+
+static int
vhd_dyn_write(int fd)
{
struct vhd_footer footer;
@@ -349,17 +349,36 @@ vhd_dyn_write(int fd)
static struct mkimg_format vhd_dyn_format = {
.name = "vhd",
.description = "Virtual Hard Disk",
- .resize = vhd_resize,
+ .resize = vhd_dyn_resize,
.write = vhd_dyn_write,
};
FORMAT_DEFINE(vhd_dyn_format);
/*
- * PART 2: Fixed VHD
+ * PART 3: Fixed VHD
*/
static int
+vhd_fix_resize(lba_t imgsz)
+{
+ struct vhd_geom geom;
+ int64_t imagesz;
+
+ imgsz *= secsz;
+ imagesz = imgsz;
+ while (1) {
+ vhd_geometry(imagesz, &geom);
+ imagesz = (int64_t)geom.cylinders * geom.heads *
+ geom.sectors * VHD_SECTOR_SIZE;
+ if (imagesz >= imgsz)
+ break;
+ imagesz += geom.heads * geom.sectors * VHD_SECTOR_SIZE;
+ }
+ return (image_set_size(imagesz / secsz));
+}
+
+static int
vhd_fix_write(int fd)
{
struct vhd_footer footer;
@@ -379,7 +398,7 @@ vhd_fix_write(int fd)
static struct mkimg_format vhd_fix_format = {
.name = "vhdf",
.description = "Fixed Virtual Hard Disk",
- .resize = vhd_resize,
+ .resize = vhd_fix_resize,
.write = vhd_fix_write,
};
diff --git a/usr.bin/mklocale/Makefile.depend b/usr.bin/mklocale/Makefile.depend
index 28150b2..00205d3 100644
--- a/usr.bin/mklocale/Makefile.depend
+++ b/usr.bin/mklocale/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/mkstr/Makefile.depend b/usr.bin/mkstr/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/mkstr/Makefile.depend
+++ b/usr.bin/mkstr/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/mkstr/mkstr.1 b/usr.bin/mkstr/mkstr.1
index bc5f7115..09a277e 100644
--- a/usr.bin/mkstr/mkstr.1
+++ b/usr.bin/mkstr/mkstr.1
@@ -28,7 +28,7 @@
.\" @(#)mkstr.1 8.1 (Berkeley) 6/6/93
.\" $FreeBSD$
.\"
-.Dd November 1, 2002
+.Dd June 6, 2015
.Dt MKSTR 1
.Os
.Sh NAME
@@ -118,10 +118,16 @@ error(a1, a2, a3, a4)
.Xr xstr 1 ,
.Xr lseek 2
.Sh HISTORY
-An
+The
.Nm
-utility appeared in
-.Bx 3.0 .
+utility first appeared in
+.Bx 1 .
+.Sh AUTHORS
+.An -nosplit
+.An Bill Joy
+and
+.An Chuck Haley ,
+1977.
.Sh BUGS
The
.Nm
diff --git a/usr.bin/mkstr/mkstr.c b/usr.bin/mkstr/mkstr.c
index 9f64d0cc..2025eff 100644
--- a/usr.bin/mkstr/mkstr.c
+++ b/usr.bin/mkstr/mkstr.c
@@ -76,8 +76,8 @@ __FBSDID("$FreeBSD$");
* existing error message file for recompilation of single routines.
*/
-FILE *mesgread, *mesgwrite;
-char name[100], *np;
+static FILE *mesgread, *mesgwrite;
+static char name[100], *np;
void copystr(void);
int fgetNUL(char *, int, FILE *);
@@ -267,7 +267,7 @@ inithash(void)
#define NBUCKETS 511
-struct hash {
+static struct hash {
long hval;
unsigned hpt;
struct hash *hnext;
diff --git a/usr.bin/mktemp/Makefile.depend b/usr.bin/mktemp/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/mktemp/Makefile.depend
+++ b/usr.bin/mktemp/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/mkulzma/Makefile.depend b/usr.bin/mkulzma/Makefile.depend
index 24bdb3f..987c487 100644
--- a/usr.bin/mkulzma/Makefile.depend
+++ b/usr.bin/mkulzma/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/mkuzip/Makefile.depend b/usr.bin/mkuzip/Makefile.depend
index 08808f4..d209adb 100644
--- a/usr.bin/mkuzip/Makefile.depend
+++ b/usr.bin/mkuzip/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/msgs/Makefile.depend b/usr.bin/msgs/Makefile.depend
index 3e23976..59bc828 100644
--- a/usr.bin/msgs/Makefile.depend
+++ b/usr.bin/msgs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/mt/Makefile.depend b/usr.bin/mt/Makefile.depend
index 01c9b2e..81381e2 100644
--- a/usr.bin/mt/Makefile.depend
+++ b/usr.bin/mt/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/nc/Makefile.depend b/usr.bin/nc/Makefile.depend
index 1001142..27cbf26 100644
--- a/usr.bin/nc/Makefile.depend
+++ b/usr.bin/nc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/ncal/Makefile.depend b/usr.bin/ncal/Makefile.depend
index 543b33c..1841f7d 100644
--- a/usr.bin/ncal/Makefile.depend
+++ b/usr.bin/ncal/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/netstat/Makefile.depend b/usr.bin/netstat/Makefile.depend
index d7e0a95..fb0bf8c 100644
--- a/usr.bin/netstat/Makefile.depend
+++ b/usr.bin/netstat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/newgrp/Makefile.depend b/usr.bin/newgrp/Makefile.depend
index fd2fd3a..d8297c2 100644
--- a/usr.bin/newgrp/Makefile.depend
+++ b/usr.bin/newgrp/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/newkey/Makefile.depend b/usr.bin/newkey/Makefile.depend
index 3739603..bae15c2 100644
--- a/usr.bin/newkey/Makefile.depend
+++ b/usr.bin/newkey/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/nfsstat/Makefile.depend b/usr.bin/nfsstat/Makefile.depend
index 7a06b0f..a1ac545 100644
--- a/usr.bin/nfsstat/Makefile.depend
+++ b/usr.bin/nfsstat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/nice/Makefile.depend b/usr.bin/nice/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/nice/Makefile.depend
+++ b/usr.bin/nice/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/nl/Makefile.depend b/usr.bin/nl/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/nl/Makefile.depend
+++ b/usr.bin/nl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/nohup/Makefile.depend b/usr.bin/nohup/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/nohup/Makefile.depend
+++ b/usr.bin/nohup/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/opieinfo/Makefile.depend b/usr.bin/opieinfo/Makefile.depend
index 172eaaa..0466610 100644
--- a/usr.bin/opieinfo/Makefile.depend
+++ b/usr.bin/opieinfo/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/opiekey/Makefile.depend b/usr.bin/opiekey/Makefile.depend
index 172eaaa..0466610 100644
--- a/usr.bin/opiekey/Makefile.depend
+++ b/usr.bin/opiekey/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/opiepasswd/Makefile.depend b/usr.bin/opiepasswd/Makefile.depend
index 172eaaa..0466610 100644
--- a/usr.bin/opiepasswd/Makefile.depend
+++ b/usr.bin/opiepasswd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/pagesize/Makefile.depend b/usr.bin/pagesize/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.bin/pagesize/Makefile.depend
+++ b/usr.bin/pagesize/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/pamtest/Makefile.depend b/usr.bin/pamtest/Makefile.depend
index d6d3563..80d4de2 100644
--- a/usr.bin/pamtest/Makefile.depend
+++ b/usr.bin/pamtest/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/passwd/Makefile.depend b/usr.bin/passwd/Makefile.depend
index 4aae750..1078f33 100644
--- a/usr.bin/passwd/Makefile.depend
+++ b/usr.bin/passwd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/paste/Makefile.depend b/usr.bin/paste/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/paste/Makefile.depend
+++ b/usr.bin/paste/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/pathchk/Makefile.depend b/usr.bin/pathchk/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/pathchk/Makefile.depend
+++ b/usr.bin/pathchk/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/perror/Makefile.depend b/usr.bin/perror/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/perror/Makefile.depend
+++ b/usr.bin/perror/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/pr/Makefile.depend b/usr.bin/pr/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/pr/Makefile.depend
+++ b/usr.bin/pr/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/printenv/Makefile.depend b/usr.bin/printenv/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/printenv/Makefile.depend
+++ b/usr.bin/printenv/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/printf/Makefile.depend b/usr.bin/printf/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/printf/Makefile.depend
+++ b/usr.bin/printf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/procstat/Makefile.depend b/usr.bin/procstat/Makefile.depend
index 4f77d12..588a394 100644
--- a/usr.bin/procstat/Makefile.depend
+++ b/usr.bin/procstat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/quota/Makefile.depend b/usr.bin/quota/Makefile.depend
index e8ee261..88d0220 100644
--- a/usr.bin/quota/Makefile.depend
+++ b/usr.bin/quota/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/rctl/Makefile.depend b/usr.bin/rctl/Makefile.depend
index 0eab23f..58f9a33 100644
--- a/usr.bin/rctl/Makefile.depend
+++ b/usr.bin/rctl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/renice/Makefile.depend b/usr.bin/renice/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/renice/Makefile.depend
+++ b/usr.bin/renice/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/rev/Makefile.depend b/usr.bin/rev/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/rev/Makefile.depend
+++ b/usr.bin/rev/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/revoke/Makefile.depend b/usr.bin/revoke/Makefile.depend
index 461e710..9cb890b 100644
--- a/usr.bin/revoke/Makefile.depend
+++ b/usr.bin/revoke/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/rlogin/Makefile.depend b/usr.bin/rlogin/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/rlogin/Makefile.depend
+++ b/usr.bin/rlogin/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/rpcgen/Makefile.depend b/usr.bin/rpcgen/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/rpcgen/Makefile.depend
+++ b/usr.bin/rpcgen/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/rpcinfo/Makefile.depend b/usr.bin/rpcinfo/Makefile.depend
index 0337134..1eb0f33 100644
--- a/usr.bin/rpcinfo/Makefile.depend
+++ b/usr.bin/rpcinfo/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/rs/Makefile.depend b/usr.bin/rs/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/rs/Makefile.depend
+++ b/usr.bin/rs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/rsh/Makefile b/usr.bin/rsh/Makefile
index d7c26a5..2005f23 100644
--- a/usr.bin/rsh/Makefile
+++ b/usr.bin/rsh/Makefile
@@ -4,8 +4,6 @@
PROG= rsh
CFLAGS+=-I${.CURDIR}/../../libexec/rlogind
-WARNS?= 2
-
BINOWN= root
BINMODE=4555
diff --git a/usr.bin/rsh/Makefile.depend b/usr.bin/rsh/Makefile.depend
index 0eab23f..58f9a33 100644
--- a/usr.bin/rsh/Makefile.depend
+++ b/usr.bin/rsh/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/rsh/rsh.c b/usr.bin/rsh/rsh.c
index a19539a..5fa33e2 100644
--- a/usr.bin/rsh/rsh.c
+++ b/usr.bin/rsh/rsh.c
@@ -77,10 +77,10 @@ __FBSDID("$FreeBSD$");
/*
* rsh - remote shell
*/
-int rfd2;
+static int rfd2;
-int family = PF_UNSPEC;
-char rlogin[] = "rlogin";
+static int family = PF_UNSPEC;
+static char rlogin[] = "rlogin";
void connect_timeout(int);
char *copyargs(char * const *);
diff --git a/usr.bin/rup/Makefile b/usr.bin/rup/Makefile
index 4b5131e..54e114e 100644
--- a/usr.bin/rup/Makefile
+++ b/usr.bin/rup/Makefile
@@ -2,8 +2,7 @@
PROG= rup
-WARNS?= 1
-
+WARNS?= 3
LIBADD= rpcsvc
.include <bsd.prog.mk>
diff --git a/usr.bin/rup/Makefile.depend b/usr.bin/rup/Makefile.depend
index 4825590..bdd7bc2 100644
--- a/usr.bin/rup/Makefile.depend
+++ b/usr.bin/rup/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/ruptime/Makefile.depend b/usr.bin/ruptime/Makefile.depend
index 725077b..26cae4e 100644
--- a/usr.bin/ruptime/Makefile.depend
+++ b/usr.bin/ruptime/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/rusers/Makefile.depend b/usr.bin/rusers/Makefile.depend
index 4825590..bdd7bc2 100644
--- a/usr.bin/rusers/Makefile.depend
+++ b/usr.bin/rusers/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/rwall/Makefile.depend b/usr.bin/rwall/Makefile.depend
index c3bc1bd..ddd5dbd 100644
--- a/usr.bin/rwall/Makefile.depend
+++ b/usr.bin/rwall/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/rwho/Makefile.depend b/usr.bin/rwho/Makefile.depend
index 725077b..26cae4e 100644
--- a/usr.bin/rwho/Makefile.depend
+++ b/usr.bin/rwho/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/script/Makefile.depend b/usr.bin/script/Makefile.depend
index 0eab23f..58f9a33 100644
--- a/usr.bin/script/Makefile.depend
+++ b/usr.bin/script/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/sed/Makefile.depend b/usr.bin/sed/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/sed/Makefile.depend
+++ b/usr.bin/sed/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/seq/Makefile.depend b/usr.bin/seq/Makefile.depend
index 8a1da00..c9f9d52 100644
--- a/usr.bin/seq/Makefile.depend
+++ b/usr.bin/seq/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/setchannel/Makefile.depend b/usr.bin/setchannel/Makefile.depend
index a839545..f52ca95 100644
--- a/usr.bin/setchannel/Makefile.depend
+++ b/usr.bin/setchannel/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/shar/Makefile.depend b/usr.bin/shar/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.bin/shar/Makefile.depend
+++ b/usr.bin/shar/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/showmount/Makefile.depend b/usr.bin/showmount/Makefile.depend
index c3bc1bd..ddd5dbd 100644
--- a/usr.bin/showmount/Makefile.depend
+++ b/usr.bin/showmount/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/smbutil/Makefile.depend b/usr.bin/smbutil/Makefile.depend
index f09f976..a1b4494 100644
--- a/usr.bin/smbutil/Makefile.depend
+++ b/usr.bin/smbutil/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/sockstat/Makefile.depend b/usr.bin/sockstat/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/usr.bin/sockstat/Makefile.depend
+++ b/usr.bin/sockstat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/sort/Makefile.depend b/usr.bin/sort/Makefile.depend
index 1c63973..bbb63ce 100644
--- a/usr.bin/sort/Makefile.depend
+++ b/usr.bin/sort/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/split/Makefile.depend b/usr.bin/split/Makefile.depend
index 0eab23f..58f9a33 100644
--- a/usr.bin/split/Makefile.depend
+++ b/usr.bin/split/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/ssh-copy-id/Makefile.depend b/usr.bin/ssh-copy-id/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.bin/ssh-copy-id/Makefile.depend
+++ b/usr.bin/ssh-copy-id/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/stat/Makefile.depend b/usr.bin/stat/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/stat/Makefile.depend
+++ b/usr.bin/stat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/stdbuf/Makefile.depend b/usr.bin/stdbuf/Makefile.depend
index 461e710..9cb890b 100644
--- a/usr.bin/stdbuf/Makefile.depend
+++ b/usr.bin/stdbuf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/su/Makefile.depend b/usr.bin/su/Makefile.depend
index 497ebf6..85813bf 100644
--- a/usr.bin/su/Makefile.depend
+++ b/usr.bin/su/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/svn/lib/libapr/Makefile.depend b/usr.bin/svn/lib/libapr/Makefile.depend
index 90e44e2..402745d 100644
--- a/usr.bin/svn/lib/libapr/Makefile.depend
+++ b/usr.bin/svn/lib/libapr/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/svn/lib/libapr_util/Makefile.depend b/usr.bin/svn/lib/libapr_util/Makefile.depend
index 4d5963b..9caf2d1 100644
--- a/usr.bin/svn/lib/libapr_util/Makefile.depend
+++ b/usr.bin/svn/lib/libapr_util/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/svn/lib/libserf/Makefile.depend b/usr.bin/svn/lib/libserf/Makefile.depend
index ebe4414..b8e3639 100644
--- a/usr.bin/svn/lib/libserf/Makefile.depend
+++ b/usr.bin/svn/lib/libserf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/svn/lib/libsvn_client/Makefile.depend b/usr.bin/svn/lib/libsvn_client/Makefile.depend
index 639d45d..ccd19e5 100644
--- a/usr.bin/svn/lib/libsvn_client/Makefile.depend
+++ b/usr.bin/svn/lib/libsvn_client/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/svn/lib/libsvn_delta/Makefile.depend b/usr.bin/svn/lib/libsvn_delta/Makefile.depend
index 4c8e09d..35add0c 100644
--- a/usr.bin/svn/lib/libsvn_delta/Makefile.depend
+++ b/usr.bin/svn/lib/libsvn_delta/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/svn/lib/libsvn_diff/Makefile.depend b/usr.bin/svn/lib/libsvn_diff/Makefile.depend
index 639d45d..ccd19e5 100644
--- a/usr.bin/svn/lib/libsvn_diff/Makefile.depend
+++ b/usr.bin/svn/lib/libsvn_diff/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/svn/lib/libsvn_fs/Makefile.depend b/usr.bin/svn/lib/libsvn_fs/Makefile.depend
index 639d45d..ccd19e5 100644
--- a/usr.bin/svn/lib/libsvn_fs/Makefile.depend
+++ b/usr.bin/svn/lib/libsvn_fs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/svn/lib/libsvn_fs_fs/Makefile.depend b/usr.bin/svn/lib/libsvn_fs_fs/Makefile.depend
index 639d45d..ccd19e5 100644
--- a/usr.bin/svn/lib/libsvn_fs_fs/Makefile.depend
+++ b/usr.bin/svn/lib/libsvn_fs_fs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/svn/lib/libsvn_fs_util/Makefile.depend b/usr.bin/svn/lib/libsvn_fs_util/Makefile.depend
index 639d45d..ccd19e5 100644
--- a/usr.bin/svn/lib/libsvn_fs_util/Makefile.depend
+++ b/usr.bin/svn/lib/libsvn_fs_util/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/svn/lib/libsvn_ra/Makefile.depend b/usr.bin/svn/lib/libsvn_ra/Makefile.depend
index 639d45d..ccd19e5 100644
--- a/usr.bin/svn/lib/libsvn_ra/Makefile.depend
+++ b/usr.bin/svn/lib/libsvn_ra/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/svn/lib/libsvn_ra_local/Makefile.depend b/usr.bin/svn/lib/libsvn_ra_local/Makefile.depend
index 639d45d..ccd19e5 100644
--- a/usr.bin/svn/lib/libsvn_ra_local/Makefile.depend
+++ b/usr.bin/svn/lib/libsvn_ra_local/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/svn/lib/libsvn_ra_serf/Makefile.depend b/usr.bin/svn/lib/libsvn_ra_serf/Makefile.depend
index 4d5963b..9caf2d1 100644
--- a/usr.bin/svn/lib/libsvn_ra_serf/Makefile.depend
+++ b/usr.bin/svn/lib/libsvn_ra_serf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/svn/lib/libsvn_ra_svn/Makefile.depend b/usr.bin/svn/lib/libsvn_ra_svn/Makefile.depend
index 639d45d..ccd19e5 100644
--- a/usr.bin/svn/lib/libsvn_ra_svn/Makefile.depend
+++ b/usr.bin/svn/lib/libsvn_ra_svn/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/svn/lib/libsvn_repos/Makefile.depend b/usr.bin/svn/lib/libsvn_repos/Makefile.depend
index 639d45d..ccd19e5 100644
--- a/usr.bin/svn/lib/libsvn_repos/Makefile.depend
+++ b/usr.bin/svn/lib/libsvn_repos/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/svn/lib/libsvn_subr/Makefile.depend b/usr.bin/svn/lib/libsvn_subr/Makefile.depend
index dba394d..365567e 100644
--- a/usr.bin/svn/lib/libsvn_subr/Makefile.depend
+++ b/usr.bin/svn/lib/libsvn_subr/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/svn/lib/libsvn_wc/Makefile.depend b/usr.bin/svn/lib/libsvn_wc/Makefile.depend
index 639d45d..ccd19e5 100644
--- a/usr.bin/svn/lib/libsvn_wc/Makefile.depend
+++ b/usr.bin/svn/lib/libsvn_wc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/svn/svn/Makefile.depend b/usr.bin/svn/svn/Makefile.depend
index d0700e5..ccbe233 100644
--- a/usr.bin/svn/svn/Makefile.depend
+++ b/usr.bin/svn/svn/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/svn/svnadmin/Makefile.depend b/usr.bin/svn/svnadmin/Makefile.depend
index 78e5746..6a83703 100644
--- a/usr.bin/svn/svnadmin/Makefile.depend
+++ b/usr.bin/svn/svnadmin/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/svn/svndumpfilter/Makefile.depend b/usr.bin/svn/svndumpfilter/Makefile.depend
index 78e5746..6a83703 100644
--- a/usr.bin/svn/svndumpfilter/Makefile.depend
+++ b/usr.bin/svn/svndumpfilter/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/svn/svnlook/Makefile.depend b/usr.bin/svn/svnlook/Makefile.depend
index bac5038..327a76e 100644
--- a/usr.bin/svn/svnlook/Makefile.depend
+++ b/usr.bin/svn/svnlook/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/svn/svnmucc/Makefile.depend b/usr.bin/svn/svnmucc/Makefile.depend
index ec3d47e..eb9e68b 100644
--- a/usr.bin/svn/svnmucc/Makefile.depend
+++ b/usr.bin/svn/svnmucc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/svn/svnrdump/Makefile.depend b/usr.bin/svn/svnrdump/Makefile.depend
index d0700e5..ccbe233 100644
--- a/usr.bin/svn/svnrdump/Makefile.depend
+++ b/usr.bin/svn/svnrdump/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/svn/svnserve/Makefile.depend b/usr.bin/svn/svnserve/Makefile.depend
index ac3b82c..978f241 100644
--- a/usr.bin/svn/svnserve/Makefile.depend
+++ b/usr.bin/svn/svnserve/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/svn/svnsync/Makefile.depend b/usr.bin/svn/svnsync/Makefile.depend
index ac3b82c..978f241 100644
--- a/usr.bin/svn/svnsync/Makefile.depend
+++ b/usr.bin/svn/svnsync/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/svn/svnversion/Makefile.depend b/usr.bin/svn/svnversion/Makefile.depend
index 7d30edf..ca6c01c 100644
--- a/usr.bin/svn/svnversion/Makefile.depend
+++ b/usr.bin/svn/svnversion/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/systat/Makefile b/usr.bin/systat/Makefile
index 672aadc..bb279d5 100644
--- a/usr.bin/systat/Makefile
+++ b/usr.bin/systat/Makefile
@@ -14,7 +14,7 @@ SRCS+= icmp6.c ip6.c
CFLAGS+= -DINET6
.endif
-WARNS?= 0
+WARNS?= 1
LIBADD= ncursesw m devstat kvm
diff --git a/usr.bin/systat/Makefile.depend b/usr.bin/systat/Makefile.depend
index e18561d..3e4daea 100644
--- a/usr.bin/systat/Makefile.depend
+++ b/usr.bin/systat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c
index e0e627a..fd93830 100644
--- a/usr.bin/systat/main.c
+++ b/usr.bin/systat/main.c
@@ -138,7 +138,6 @@ main(int argc, char **argv)
{
char errbuf[_POSIX2_LINE_MAX], dummy;
size_t size;
- double t;
struct cmdentry *cmd = NULL;
(void) setlocale(LC_ALL, "");
diff --git a/usr.bin/tabs/Makefile.depend b/usr.bin/tabs/Makefile.depend
index 3e23976..59bc828 100644
--- a/usr.bin/tabs/Makefile.depend
+++ b/usr.bin/tabs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/tail/Makefile.depend b/usr.bin/tail/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/tail/Makefile.depend
+++ b/usr.bin/tail/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/talk/Makefile.depend b/usr.bin/talk/Makefile.depend
index 2bac29f..618a09d 100644
--- a/usr.bin/talk/Makefile.depend
+++ b/usr.bin/talk/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/tar/Makefile.depend b/usr.bin/tar/Makefile.depend
index 2b9c4f7..4e7906b 100644
--- a/usr.bin/tar/Makefile.depend
+++ b/usr.bin/tar/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/tcopy/Makefile.depend b/usr.bin/tcopy/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/tcopy/Makefile.depend
+++ b/usr.bin/tcopy/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/tee/Makefile.depend b/usr.bin/tee/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/tee/Makefile.depend
+++ b/usr.bin/tee/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/telnet/Makefile.depend b/usr.bin/telnet/Makefile.depend
index 90349d5..6578e9f 100644
--- a/usr.bin/telnet/Makefile.depend
+++ b/usr.bin/telnet/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/tftp/Makefile.depend b/usr.bin/tftp/Makefile.depend
index e2fa4c7..d6c8db8 100644
--- a/usr.bin/tftp/Makefile.depend
+++ b/usr.bin/tftp/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/time/Makefile.depend b/usr.bin/time/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/time/Makefile.depend
+++ b/usr.bin/time/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/timeout/Makefile.depend b/usr.bin/timeout/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/timeout/Makefile.depend
+++ b/usr.bin/timeout/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/tip/tip/Makefile.depend b/usr.bin/tip/tip/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/tip/tip/Makefile.depend
+++ b/usr.bin/tip/tip/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/top/Makefile b/usr.bin/top/Makefile
index edeb47f..9e62b4f 100644
--- a/usr.bin/top/Makefile
+++ b/usr.bin/top/Makefile
@@ -31,8 +31,8 @@ sigdesc.h: ${SIGCONV_AWK} ${SIGNAL_H}
awk -f ${SIGCONV_AWK} < ${SIGNAL_H} > ${.TARGET}
CLEANFILES+= top.local.h top.x
-.SUFFIXES: .X .x .H .h
-.X.x .H.h:
+.SUFFIXES: .xs .x .hs .h
+.xs.x .hs.h:
@${ECHO} Making ${.TARGET} from ${.IMPSRC}
@sed -e's,%LoadMax%,5.0,g' \
-e's,%TableSize%,20011,g' \
diff --git a/usr.bin/top/Makefile.depend b/usr.bin/top/Makefile.depend
index 00a1826..9d6b4ed 100644
--- a/usr.bin/top/Makefile.depend
+++ b/usr.bin/top/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/touch/Makefile.depend b/usr.bin/touch/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/touch/Makefile.depend
+++ b/usr.bin/touch/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/tput/Makefile.depend b/usr.bin/tput/Makefile.depend
index 3e23976..59bc828 100644
--- a/usr.bin/tput/Makefile.depend
+++ b/usr.bin/tput/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/tr/Makefile.depend b/usr.bin/tr/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/tr/Makefile.depend
+++ b/usr.bin/tr/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/true/Makefile.depend b/usr.bin/true/Makefile.depend
index 1a3b3a2..43d71f8 100644
--- a/usr.bin/true/Makefile.depend
+++ b/usr.bin/true/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/truncate/Makefile.depend b/usr.bin/truncate/Makefile.depend
index 0eab23f..58f9a33 100644
--- a/usr.bin/truncate/Makefile.depend
+++ b/usr.bin/truncate/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/truss/Makefile.depend.amd64 b/usr.bin/truss/Makefile.depend.amd64
index 277bd6c..f14f937 100644
--- a/usr.bin/truss/Makefile.depend.amd64
+++ b/usr.bin/truss/Makefile.depend.amd64
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/tset/Makefile.depend b/usr.bin/tset/Makefile.depend
index 3e23976..59bc828 100644
--- a/usr.bin/tset/Makefile.depend
+++ b/usr.bin/tset/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/tset/tset.1 b/usr.bin/tset/tset.1
index f0935b7..5f2641f 100644
--- a/usr.bin/tset/tset.1
+++ b/usr.bin/tset/tset.1
@@ -28,7 +28,7 @@
.\" @(#)tset.1 8.1 (Berkeley) 6/9/93
.\" $FreeBSD$
.\"
-.Dd June 9, 1993
+.Dd June 6, 2015
.Dt TSET 1
.Os
.Sh NAME
@@ -400,5 +400,22 @@ older terminal interfaces.
.Sh HISTORY
The
.Nm
-command appeared in
-.Bx 3.0 .
+and
+.Nm reset
+utilities first appeared in
+.Bx 1 .
+.Sh AUTHORS
+.An -nosplit
+The original version of
+.Nm tset
+was written by
+.An Eric P. Allman
+in October 1977, and
+.Nm reset
+was originally written by
+.An Kurt Shoens .
+The current version also contains code by
+.An Zeyd M. Ben-Halim ,
+.An Eric S. Raymond ,
+and
+.An Thomas E. Dickey .
diff --git a/usr.bin/tsort/Makefile.depend b/usr.bin/tsort/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/tsort/Makefile.depend
+++ b/usr.bin/tsort/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/tty/Makefile.depend b/usr.bin/tty/Makefile.depend
index 461e710..9cb890b 100644
--- a/usr.bin/tty/Makefile.depend
+++ b/usr.bin/tty/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/ul/Makefile.depend b/usr.bin/ul/Makefile.depend
index 3e23976..59bc828 100644
--- a/usr.bin/ul/Makefile.depend
+++ b/usr.bin/ul/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/uname/Makefile.depend b/usr.bin/uname/Makefile.depend
index 461e710..9cb890b 100644
--- a/usr.bin/uname/Makefile.depend
+++ b/usr.bin/uname/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/unexpand/Makefile.depend b/usr.bin/unexpand/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/unexpand/Makefile.depend
+++ b/usr.bin/unexpand/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/unifdef/Makefile.depend b/usr.bin/unifdef/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/unifdef/Makefile.depend
+++ b/usr.bin/unifdef/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/uniq/Makefile.depend b/usr.bin/uniq/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/uniq/Makefile.depend
+++ b/usr.bin/uniq/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/units/Makefile.depend b/usr.bin/units/Makefile.depend
index f9ea659..3d92039 100644
--- a/usr.bin/units/Makefile.depend
+++ b/usr.bin/units/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/unvis/Makefile.depend b/usr.bin/unvis/Makefile.depend
index 461e710..9cb890b 100644
--- a/usr.bin/unvis/Makefile.depend
+++ b/usr.bin/unvis/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/unzip/Makefile.depend b/usr.bin/unzip/Makefile.depend
index 2b9c4f7..4e7906b 100644
--- a/usr.bin/unzip/Makefile.depend
+++ b/usr.bin/unzip/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/usbhidaction/Makefile.depend b/usr.bin/usbhidaction/Makefile.depend
index 37c3dc6..3a42599 100644
--- a/usr.bin/usbhidaction/Makefile.depend
+++ b/usr.bin/usbhidaction/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/usbhidctl/Makefile.depend b/usr.bin/usbhidctl/Makefile.depend
index 37c3dc6..3a42599 100644
--- a/usr.bin/usbhidctl/Makefile.depend
+++ b/usr.bin/usbhidctl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/users/Makefile.depend b/usr.bin/users/Makefile.depend
index 534d27d..b602708 100644
--- a/usr.bin/users/Makefile.depend
+++ b/usr.bin/users/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/uudecode/Makefile.depend b/usr.bin/uudecode/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/usr.bin/uudecode/Makefile.depend
+++ b/usr.bin/uudecode/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/uuencode/Makefile.depend b/usr.bin/uuencode/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/usr.bin/uuencode/Makefile.depend
+++ b/usr.bin/uuencode/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/vacation/Makefile.depend b/usr.bin/vacation/Makefile.depend
index f32c7f3..1b8e038 100644
--- a/usr.bin/vacation/Makefile.depend
+++ b/usr.bin/vacation/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/vgrind/Makefile.depend b/usr.bin/vgrind/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/vgrind/Makefile.depend
+++ b/usr.bin/vgrind/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/vgrind/RETEST/Makefile.depend b/usr.bin/vgrind/RETEST/Makefile.depend
index a839545..f52ca95 100644
--- a/usr.bin/vgrind/RETEST/Makefile.depend
+++ b/usr.bin/vgrind/RETEST/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.bin/vgrind/regexp.c b/usr.bin/vgrind/regexp.c
index cd57835..8390cf1 100644
--- a/usr.bin/vgrind/regexp.c
+++ b/usr.bin/vgrind/regexp.c
@@ -91,7 +91,7 @@ STRNCMP(register char *s1, register char *s2, register int len)
* internal format.
*
* Either meta symbols (\a \d or \p) or character strings or
- * operations ( alternation or perenthesizing ) can be
+ * operations ( alternation or parenthesizing ) can be
* specified. Each starts with a descriptor byte. The descriptor
* byte has STR set for strings, META set for meta symbols
* and OPER set for operations.
@@ -110,7 +110,7 @@ STRNCMP(register char *s1, register char *s2, register int len)
* character count
* the string
*
- * operatins := descriptor
+ * operations := descriptor
* symbol
* character count
*/
diff --git a/usr.bin/vgrind/vgrindefs.c b/usr.bin/vgrind/vgrindefs.c
index c48a048..3c310a9 100644
--- a/usr.bin/vgrind/vgrindefs.c
+++ b/usr.bin/vgrind/vgrindefs.c
@@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$");
#define MAXHOP 32 /* max number of tc= indirections */
#include <ctype.h>
+#include <fcntl.h>
+#include <string.h>
#include <unistd.h>
/*
@@ -308,7 +310,7 @@ tdecode(register char *str, char **area)
register int c;
cp = *area;
- while (c = *str++) {
+ while ((c = *str++)) {
if (c == ':' && *(cp-1) != '\\')
break;
*cp++ = c;
diff --git a/usr.bin/vi/Makefile.depend b/usr.bin/vi/Makefile.depend
index 5865b43..57c7034 100644
--- a/usr.bin/vi/Makefile.depend
+++ b/usr.bin/vi/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/vis/Makefile.depend b/usr.bin/vis/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/vis/Makefile.depend
+++ b/usr.bin/vis/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/vmstat/Makefile.depend b/usr.bin/vmstat/Makefile.depend
index 3597f70..2322cbf 100644
--- a/usr.bin/vmstat/Makefile.depend
+++ b/usr.bin/vmstat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/vmstat/vmstat.8 b/usr.bin/vmstat/vmstat.8
index 4566ad2..93e75b9 100644
--- a/usr.bin/vmstat/vmstat.8
+++ b/usr.bin/vmstat/vmstat.8
@@ -37,7 +37,7 @@
.Sh SYNOPSIS
.Nm
.\" .Op Fl fimst
-.Op Fl afHhimPsz
+.Op Fl afHhimoPsz
.Op Fl M Ar core Op Fl N Ar system
.Op Fl c Ar count
.Op Fl n Ar devs
@@ -119,6 +119,9 @@ Report on the usage of kernel dynamic memory allocated using
by type.
.It Fl n
Change the maximum number of disks to display from the default of 2.
+.It Fl o
+Display a list of virtual memory objects in the system and the resident
+memory used by each object.
.It Fl P
Report per-cpu system/user/idle cpu statistics.
.It Fl p
diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c
index 9049e44..0a3054a 100644
--- a/usr.bin/vmstat/vmstat.c
+++ b/usr.bin/vmstat/vmstat.c
@@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$");
#include <sys/resource.h>
#include <sys/sysctl.h>
#include <sys/time.h>
+#include <sys/user.h>
#include <sys/vmmeter.h>
#include <sys/pcpu.h>
@@ -143,12 +144,14 @@ static kvm_t *kd;
#define TIMESTAT 0x10
#define VMSTAT 0x20
#define ZMEMSTAT 0x40
+#define OBJSTAT 0x80
static void cpustats(void);
static void pcpustats(int, u_long, int);
static void devstats(void);
static void doforkst(void);
static void dointr(unsigned int, int);
+static void doobjstat(void);
static void dosum(void);
static void dovmstat(unsigned int, int);
static void domemstat_malloc(void);
@@ -181,7 +184,7 @@ main(int argc, char *argv[])
interval = reps = todo = 0;
maxshowdevs = 2;
hflag = isatty(1);
- while ((c = getopt(argc, argv, "ac:fhHiM:mN:n:Pp:stw:z")) != -1) {
+ while ((c = getopt(argc, argv, "ac:fhHiM:mN:n:oPp:stw:z")) != -1) {
switch (c) {
case 'a':
aflag++;
@@ -220,6 +223,9 @@ main(int argc, char *argv[])
errx(1, "number of devices %d is < 0",
maxshowdevs);
break;
+ case 'o':
+ todo |= OBJSTAT;
+ break;
case 'p':
if (devstat_buildmatch(optarg, &matches, &num_matches) != 0)
errx(1, "%s", devstat_errbuf);
@@ -320,6 +326,8 @@ retry_nlist:
domemstat_zone();
if (todo & SUMSTAT)
dosum();
+ if (todo & OBJSTAT)
+ doobjstat();
#ifdef notyet
if (todo & TIMESTAT)
dotimes();
@@ -1396,6 +1404,129 @@ domemstat_zone(void)
printf("\n");
}
+static void
+display_object(struct kinfo_vmobject *kvo)
+{
+ const char *str;
+
+ printf("%5jd ", (uintmax_t)kvo->kvo_resident);
+ printf("%5jd ", (uintmax_t)kvo->kvo_active);
+ printf("%5jd ", (uintmax_t)kvo->kvo_inactive);
+ printf("%3d ", kvo->kvo_ref_count);
+ printf("%3d ", kvo->kvo_shadow_count);
+ switch (kvo->kvo_memattr) {
+#ifdef VM_MEMATTR_UNCACHEABLE
+ case VM_MEMATTR_UNCACHEABLE:
+ str = "UC";
+ break;
+#endif
+#ifdef VM_MEMATTR_WRITE_COMBINING
+ case VM_MEMATTR_WRITE_COMBINING:
+ str = "WC";
+ break;
+#endif
+#ifdef VM_MEMATTR_WRITE_THROUGH
+ case VM_MEMATTR_WRITE_THROUGH:
+ str = "WT";
+ break;
+#endif
+#ifdef VM_MEMATTR_WRITE_PROTECTED
+ case VM_MEMATTR_WRITE_PROTECTED:
+ str = "WP";
+ break;
+#endif
+#ifdef VM_MEMATTR_WRITE_BACK
+ case VM_MEMATTR_WRITE_BACK:
+ str = "WB";
+ break;
+#endif
+#ifdef VM_MEMATTR_WEAK_UNCACHEABLE
+ case VM_MEMATTR_WEAK_UNCACHEABLE:
+ str = "UC-";
+ break;
+#endif
+#ifdef VM_MEMATTR_WB_WA
+ case VM_MEMATTR_WB_WA:
+ str = "WB";
+ break;
+#endif
+#ifdef VM_MEMATTR_NOCACHE
+ case VM_MEMATTR_NOCACHE:
+ str = "NC";
+ break;
+#endif
+#ifdef VM_MEMATTR_DEVICE
+ case VM_MEMATTR_DEVICE:
+ str = "DEV";
+ break;
+#endif
+#ifdef VM_MEMATTR_CACHEABLE
+ case VM_MEMATTR_CACHEABLE:
+ str = "C";
+ break;
+#endif
+#ifdef VM_MEMATTR_PREFETCHABLE
+ case VM_MEMATTR_PREFETCHABLE:
+ str = "PRE";
+ break;
+#endif
+ default:
+ str = "??";
+ break;
+ }
+ printf("%-3s ", str);
+ switch (kvo->kvo_type) {
+ case KVME_TYPE_NONE:
+ str = "--";
+ break;
+ case KVME_TYPE_DEFAULT:
+ str = "df";
+ break;
+ case KVME_TYPE_VNODE:
+ str = "vn";
+ break;
+ case KVME_TYPE_SWAP:
+ str = "sw";
+ break;
+ case KVME_TYPE_DEVICE:
+ str = "dv";
+ break;
+ case KVME_TYPE_PHYS:
+ str = "ph";
+ break;
+ case KVME_TYPE_DEAD:
+ str = "dd";
+ break;
+ case KVME_TYPE_SG:
+ str = "sg";
+ break;
+ case KVME_TYPE_UNKNOWN:
+ default:
+ str = "??";
+ break;
+ }
+ printf("%-2s ", str);
+ printf("%-s\n", kvo->kvo_path);
+}
+
+static void
+doobjstat(void)
+{
+ struct kinfo_vmobject *kvo;
+ int cnt, i;
+
+ kvo = kinfo_getvmobject(&cnt);
+ if (kvo == NULL) {
+ warn("Failed to fetch VM object list");
+ return;
+ }
+ printf("%5s %5s %5s %3s %3s %3s %2s %s\n", "RES", "ACT", "INACT",
+ "REF", "SHD", "CM", "TP", "PATH");
+ for (i = 0; i < cnt; i++)
+ display_object(&kvo[i]);
+ free(kvo);
+}
+
/*
* kread reads something from the kernel, given its nlist index.
*/
@@ -1448,7 +1579,7 @@ static void
usage(void)
{
(void)fprintf(stderr, "%s%s",
- "usage: vmstat [-afHhimPsz] [-M core [-N system]] [-c count] [-n devs]\n",
+ "usage: vmstat [-afHhimoPsz] [-M core [-N system]] [-c count] [-n devs]\n",
" [-p type,if,pass] [-w wait] [disks] [wait [count]]\n");
exit(1);
}
diff --git a/usr.bin/vtfontcvt/Makefile b/usr.bin/vtfontcvt/Makefile
index a9802f7..cfb271b 100644
--- a/usr.bin/vtfontcvt/Makefile
+++ b/usr.bin/vtfontcvt/Makefile
@@ -3,6 +3,4 @@
PROG= vtfontcvt
MAN8= vtfontcvt.8
-WARNS?= 6
-
.include <bsd.prog.mk>
diff --git a/usr.bin/vtfontcvt/Makefile.depend b/usr.bin/vtfontcvt/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/vtfontcvt/Makefile.depend
+++ b/usr.bin/vtfontcvt/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/w/Makefile.depend b/usr.bin/w/Makefile.depend
index f23127b..e03ca69 100644
--- a/usr.bin/w/Makefile.depend
+++ b/usr.bin/w/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/wall/Makefile.depend b/usr.bin/wall/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/wall/Makefile.depend
+++ b/usr.bin/wall/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/wc/Makefile.depend b/usr.bin/wc/Makefile.depend
index e934058..9b71a67 100644
--- a/usr.bin/wc/Makefile.depend
+++ b/usr.bin/wc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/what/Makefile.depend b/usr.bin/what/Makefile.depend
index 461e710..9cb890b 100644
--- a/usr.bin/what/Makefile.depend
+++ b/usr.bin/what/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/whereis/Makefile.depend b/usr.bin/whereis/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/whereis/Makefile.depend
+++ b/usr.bin/whereis/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/which/Makefile.depend b/usr.bin/which/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/which/Makefile.depend
+++ b/usr.bin/which/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/who/Makefile.depend b/usr.bin/who/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/who/Makefile.depend
+++ b/usr.bin/who/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/whois/Makefile.depend b/usr.bin/whois/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/usr.bin/whois/Makefile.depend
+++ b/usr.bin/whois/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/write/Makefile.depend b/usr.bin/write/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/write/Makefile.depend
+++ b/usr.bin/write/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/xargs/Makefile.depend b/usr.bin/xargs/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/xargs/Makefile.depend
+++ b/usr.bin/xargs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/xinstall/Makefile.depend b/usr.bin/xinstall/Makefile.depend
index 64f9704..b4491b50 100644
--- a/usr.bin/xinstall/Makefile.depend
+++ b/usr.bin/xinstall/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/xinstall/Makefile.depend.host b/usr.bin/xinstall/Makefile.depend.host
index 8f7b4a4..35734ab 100644
--- a/usr.bin/xinstall/Makefile.depend.host
+++ b/usr.bin/xinstall/Makefile.depend.host
@@ -1,7 +1,7 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- gnu/usr.bin/binutils/ld \
lib/libmd \
diff --git a/usr.bin/xlint/lint1/Makefile.depend b/usr.bin/xlint/lint1/Makefile.depend
index 65d8b0e..b252e82 100644
--- a/usr.bin/xlint/lint1/Makefile.depend
+++ b/usr.bin/xlint/lint1/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/xlint/lint2/Makefile.depend b/usr.bin/xlint/lint2/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/xlint/lint2/Makefile.depend
+++ b/usr.bin/xlint/lint2/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/xlint/llib/Makefile.depend b/usr.bin/xlint/llib/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.bin/xlint/llib/Makefile.depend
+++ b/usr.bin/xlint/llib/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/xlint/xlint/Makefile.depend b/usr.bin/xlint/xlint/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/xlint/xlint/Makefile.depend
+++ b/usr.bin/xlint/xlint/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/xstr/Makefile.depend b/usr.bin/xstr/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/xstr/Makefile.depend
+++ b/usr.bin/xstr/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/xz/Makefile.depend b/usr.bin/xz/Makefile.depend
index 24bdb3f..987c487 100644
--- a/usr.bin/xz/Makefile.depend
+++ b/usr.bin/xz/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/xzdec/Makefile.depend b/usr.bin/xzdec/Makefile.depend
index 24bdb3f..987c487 100644
--- a/usr.bin/xzdec/Makefile.depend
+++ b/usr.bin/xzdec/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/yacc/Makefile.depend b/usr.bin/yacc/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.bin/yacc/Makefile.depend
+++ b/usr.bin/yacc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/yes/Makefile.depend b/usr.bin/yes/Makefile.depend
index 461e710..9cb890b 100644
--- a/usr.bin/yes/Makefile.depend
+++ b/usr.bin/yes/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/ypcat/Makefile.depend b/usr.bin/ypcat/Makefile.depend
index c3bc1bd..ddd5dbd 100644
--- a/usr.bin/ypcat/Makefile.depend
+++ b/usr.bin/ypcat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/ypmatch/Makefile.depend b/usr.bin/ypmatch/Makefile.depend
index c3bc1bd..ddd5dbd 100644
--- a/usr.bin/ypmatch/Makefile.depend
+++ b/usr.bin/ypmatch/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.bin/ypwhich/Makefile.depend b/usr.bin/ypwhich/Makefile.depend
index f0ca83a..c0b7a14 100644
--- a/usr.bin/ypwhich/Makefile.depend
+++ b/usr.bin/ypwhich/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ac/Makefile.depend b/usr.sbin/ac/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/ac/Makefile.depend
+++ b/usr.sbin/ac/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/accton/Makefile.depend b/usr.sbin/accton/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/accton/Makefile.depend
+++ b/usr.sbin/accton/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/acpi/acpiconf/Makefile.depend b/usr.sbin/acpi/acpiconf/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/acpi/acpiconf/Makefile.depend
+++ b/usr.sbin/acpi/acpiconf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/acpi/acpidb/Makefile.depend b/usr.sbin/acpi/acpidb/Makefile.depend
index 67ddfab..7b92dbd 100644
--- a/usr.sbin/acpi/acpidb/Makefile.depend
+++ b/usr.sbin/acpi/acpidb/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/acpi/acpidump/Makefile.depend b/usr.sbin/acpi/acpidump/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/acpi/acpidump/Makefile.depend
+++ b/usr.sbin/acpi/acpidump/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/acpi/iasl/Makefile.depend b/usr.sbin/acpi/iasl/Makefile.depend
index dee2668..ef1c922 100644
--- a/usr.sbin/acpi/iasl/Makefile.depend
+++ b/usr.sbin/acpi/iasl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/adduser/Makefile.depend b/usr.sbin/adduser/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.sbin/adduser/Makefile.depend
+++ b/usr.sbin/adduser/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/amd/amd/Makefile.depend b/usr.sbin/amd/amd/Makefile.depend
index 0b56bb6..c0afb66 100644
--- a/usr.sbin/amd/amd/Makefile.depend
+++ b/usr.sbin/amd/amd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/amd/amq/Makefile.depend b/usr.sbin/amd/amq/Makefile.depend
index 69a5323..30890ab 100644
--- a/usr.sbin/amd/amq/Makefile.depend
+++ b/usr.sbin/amd/amq/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/amd/fixmount/Makefile.depend b/usr.sbin/amd/fixmount/Makefile.depend
index e2e7c16..4ed4920 100644
--- a/usr.sbin/amd/fixmount/Makefile.depend
+++ b/usr.sbin/amd/fixmount/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/amd/fsinfo/Makefile.depend b/usr.sbin/amd/fsinfo/Makefile.depend
index 8fc2a2d..5d30d8b 100644
--- a/usr.sbin/amd/fsinfo/Makefile.depend
+++ b/usr.sbin/amd/fsinfo/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/amd/hlfsd/Makefile.depend b/usr.sbin/amd/hlfsd/Makefile.depend
index 69a5323..30890ab 100644
--- a/usr.sbin/amd/hlfsd/Makefile.depend
+++ b/usr.sbin/amd/hlfsd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/amd/include/Makefile.depend b/usr.sbin/amd/include/Makefile.depend
index ba382d2..50936ca 100644
--- a/usr.sbin/amd/include/Makefile.depend
+++ b/usr.sbin/amd/include/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/amd/libamu/Makefile.depend b/usr.sbin/amd/libamu/Makefile.depend
index 0cbbcfc..ee19de4 100644
--- a/usr.sbin/amd/libamu/Makefile.depend
+++ b/usr.sbin/amd/libamu/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/amd/mk-amd-map/Makefile.depend b/usr.sbin/amd/mk-amd-map/Makefile.depend
index 69a5323..30890ab 100644
--- a/usr.sbin/amd/mk-amd-map/Makefile.depend
+++ b/usr.sbin/amd/mk-amd-map/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/amd/pawd/Makefile.depend b/usr.sbin/amd/pawd/Makefile.depend
index 69a5323..30890ab 100644
--- a/usr.sbin/amd/pawd/Makefile.depend
+++ b/usr.sbin/amd/pawd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/amd/scripts/Makefile.depend b/usr.sbin/amd/scripts/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.sbin/amd/scripts/Makefile.depend
+++ b/usr.sbin/amd/scripts/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/amd/wire-test/Makefile.depend b/usr.sbin/amd/wire-test/Makefile.depend
index 69a5323..30890ab 100644
--- a/usr.sbin/amd/wire-test/Makefile.depend
+++ b/usr.sbin/amd/wire-test/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ancontrol/Makefile.depend b/usr.sbin/ancontrol/Makefile.depend
index 7a472ed..6a2d406 100644
--- a/usr.sbin/ancontrol/Makefile.depend
+++ b/usr.sbin/ancontrol/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/apm/Makefile.depend b/usr.sbin/apm/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/apm/Makefile.depend
+++ b/usr.sbin/apm/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/apmd/Makefile.depend b/usr.sbin/apmd/Makefile.depend
index 554c4cc..6596113 100644
--- a/usr.sbin/apmd/Makefile.depend
+++ b/usr.sbin/apmd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.sbin/arp/Makefile.depend b/usr.sbin/arp/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/usr.sbin/arp/Makefile.depend
+++ b/usr.sbin/arp/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/asf/Makefile.depend b/usr.sbin/asf/Makefile.depend
index 7a06b0f..a1ac545 100644
--- a/usr.sbin/asf/Makefile.depend
+++ b/usr.sbin/asf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/audit/Makefile.depend b/usr.sbin/audit/Makefile.depend
index 4cce057..97143a8 100644
--- a/usr.sbin/audit/Makefile.depend
+++ b/usr.sbin/audit/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/auditd/Makefile.depend b/usr.sbin/auditd/Makefile.depend
index 9cdfa5e..ae040b6 100644
--- a/usr.sbin/auditd/Makefile.depend
+++ b/usr.sbin/auditd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/auditreduce/Makefile.depend b/usr.sbin/auditreduce/Makefile.depend
index 4cce057..97143a8 100644
--- a/usr.sbin/auditreduce/Makefile.depend
+++ b/usr.sbin/auditreduce/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/authpf/Makefile.depend b/usr.sbin/authpf/Makefile.depend
index 42acde0..fb0a041 100644
--- a/usr.sbin/authpf/Makefile.depend
+++ b/usr.sbin/authpf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c
index 47a7699..ee0f106 100644
--- a/usr.sbin/bhyve/bhyverun.c
+++ b/usr.sbin/bhyve/bhyverun.c
@@ -100,7 +100,7 @@ static struct vm_exit vmexit[VM_MAXCPU];
struct bhyvestats {
uint64_t vmexit_bogus;
- uint64_t vmexit_bogus_switch;
+ uint64_t vmexit_reqidle;
uint64_t vmexit_hlt;
uint64_t vmexit_pause;
uint64_t vmexit_mtrap;
@@ -461,6 +461,17 @@ vmexit_bogus(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu)
}
static int
+vmexit_reqidle(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu)
+{
+
+ assert(vmexit->inst_length == 0);
+
+ stats.vmexit_reqidle++;
+
+ return (VMEXIT_CONTINUE);
+}
+
+static int
vmexit_hlt(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu)
{
@@ -571,6 +582,7 @@ static vmexit_handler_t handler[VM_EXITCODE_MAX] = {
[VM_EXITCODE_VMX] = vmexit_vmx,
[VM_EXITCODE_SVM] = vmexit_svm,
[VM_EXITCODE_BOGUS] = vmexit_bogus,
+ [VM_EXITCODE_REQIDLE] = vmexit_reqidle,
[VM_EXITCODE_RDMSR] = vmexit_rdmsr,
[VM_EXITCODE_WRMSR] = vmexit_wrmsr,
[VM_EXITCODE_MTRAP] = vmexit_mtrap,
diff --git a/usr.sbin/bluetooth/ath3kfw/Makefile.depend b/usr.sbin/bluetooth/ath3kfw/Makefile.depend
index d089be9..3ddb39c 100644
--- a/usr.sbin/bluetooth/ath3kfw/Makefile.depend
+++ b/usr.sbin/bluetooth/ath3kfw/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bluetooth/bcmfw/Makefile.depend b/usr.sbin/bluetooth/bcmfw/Makefile.depend
index 7fbd5c8..92ae034 100644
--- a/usr.sbin/bluetooth/bcmfw/Makefile.depend
+++ b/usr.sbin/bluetooth/bcmfw/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bluetooth/bt3cfw/Makefile.depend b/usr.sbin/bluetooth/bt3cfw/Makefile.depend
index 7fbd5c8..92ae034 100644
--- a/usr.sbin/bluetooth/bt3cfw/Makefile.depend
+++ b/usr.sbin/bluetooth/bt3cfw/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bluetooth/bthidcontrol/Makefile.depend b/usr.sbin/bluetooth/bthidcontrol/Makefile.depend
index 384ab1c..32222f2 100644
--- a/usr.sbin/bluetooth/bthidcontrol/Makefile.depend
+++ b/usr.sbin/bluetooth/bthidcontrol/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bluetooth/bthidd/Makefile.depend b/usr.sbin/bluetooth/bthidd/Makefile.depend
index ddbc43a..a1ed9d7 100644
--- a/usr.sbin/bluetooth/bthidd/Makefile.depend
+++ b/usr.sbin/bluetooth/bthidd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bluetooth/btpand/Makefile.depend b/usr.sbin/bluetooth/btpand/Makefile.depend
index 19a9ab8..4633528 100644
--- a/usr.sbin/bluetooth/btpand/Makefile.depend
+++ b/usr.sbin/bluetooth/btpand/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bluetooth/hccontrol/Makefile.depend b/usr.sbin/bluetooth/hccontrol/Makefile.depend
index af90191..5d21038 100644
--- a/usr.sbin/bluetooth/hccontrol/Makefile.depend
+++ b/usr.sbin/bluetooth/hccontrol/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bluetooth/hcsecd/Makefile.depend b/usr.sbin/bluetooth/hcsecd/Makefile.depend
index 58768ba..4a1ee3f 100644
--- a/usr.sbin/bluetooth/hcsecd/Makefile.depend
+++ b/usr.sbin/bluetooth/hcsecd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bluetooth/hcseriald/Makefile.depend b/usr.sbin/bluetooth/hcseriald/Makefile.depend
index 7fbd5c8..92ae034 100644
--- a/usr.sbin/bluetooth/hcseriald/Makefile.depend
+++ b/usr.sbin/bluetooth/hcseriald/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bluetooth/l2control/Makefile.depend b/usr.sbin/bluetooth/l2control/Makefile.depend
index af90191..5d21038 100644
--- a/usr.sbin/bluetooth/l2control/Makefile.depend
+++ b/usr.sbin/bluetooth/l2control/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bluetooth/l2ping/Makefile.depend b/usr.sbin/bluetooth/l2ping/Makefile.depend
index c0f9b0b..179dbbe 100644
--- a/usr.sbin/bluetooth/l2ping/Makefile.depend
+++ b/usr.sbin/bluetooth/l2ping/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bluetooth/rfcomm_pppd/Makefile.depend b/usr.sbin/bluetooth/rfcomm_pppd/Makefile.depend
index 2e984a3..8fea47e 100644
--- a/usr.sbin/bluetooth/rfcomm_pppd/Makefile.depend
+++ b/usr.sbin/bluetooth/rfcomm_pppd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bluetooth/sdpcontrol/Makefile.depend b/usr.sbin/bluetooth/sdpcontrol/Makefile.depend
index 2e984a3..8fea47e 100644
--- a/usr.sbin/bluetooth/sdpcontrol/Makefile.depend
+++ b/usr.sbin/bluetooth/sdpcontrol/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bluetooth/sdpd/Makefile.depend b/usr.sbin/bluetooth/sdpd/Makefile.depend
index 2bde7d0..ce65fbb 100644
--- a/usr.sbin/bluetooth/sdpd/Makefile.depend
+++ b/usr.sbin/bluetooth/sdpd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/boot0cfg/Makefile.depend b/usr.sbin/boot0cfg/Makefile.depend
index 5d7ba23..851372c 100644
--- a/usr.sbin/boot0cfg/Makefile.depend
+++ b/usr.sbin/boot0cfg/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/boot98cfg/Makefile.depend b/usr.sbin/boot98cfg/Makefile.depend
index 25f093b..4c7271b 100644
--- a/usr.sbin/boot98cfg/Makefile.depend
+++ b/usr.sbin/boot98cfg/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.sbin/bootparamd/bootparamd/Makefile.depend b/usr.sbin/bootparamd/bootparamd/Makefile.depend
index 13f1710..a1d24b5 100644
--- a/usr.sbin/bootparamd/bootparamd/Makefile.depend
+++ b/usr.sbin/bootparamd/bootparamd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bootparamd/callbootd/Makefile.depend b/usr.sbin/bootparamd/callbootd/Makefile.depend
index 25e6eb5..e34ede1 100644
--- a/usr.sbin/bootparamd/callbootd/Makefile.depend
+++ b/usr.sbin/bootparamd/callbootd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bsdconfig/packages/Makefile.depend b/usr.sbin/bsdconfig/packages/Makefile.depend
index 57b7e10..d14a02b 100644
--- a/usr.sbin/bsdconfig/packages/Makefile.depend
+++ b/usr.sbin/bsdconfig/packages/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.sbin/bsdconfig/packages/include/Makefile.depend b/usr.sbin/bsdconfig/packages/include/Makefile.depend
index 57b7e10..d14a02b 100644
--- a/usr.sbin/bsdconfig/packages/include/Makefile.depend
+++ b/usr.sbin/bsdconfig/packages/include/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.sbin/bsdconfig/share/packages/Makefile.depend b/usr.sbin/bsdconfig/share/packages/Makefile.depend
index 57b7e10..d14a02b 100644
--- a/usr.sbin/bsdconfig/share/packages/Makefile.depend
+++ b/usr.sbin/bsdconfig/share/packages/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.sbin/bsdinstall/Makefile.depend b/usr.sbin/bsdinstall/Makefile.depend
index 29fda55..3af2d7f 100644
--- a/usr.sbin/bsdinstall/Makefile.depend
+++ b/usr.sbin/bsdinstall/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.sbin/bsdinstall/distextract/Makefile.depend b/usr.sbin/bsdinstall/distextract/Makefile.depend
index fd582bd..d7411cc 100644
--- a/usr.sbin/bsdinstall/distextract/Makefile.depend
+++ b/usr.sbin/bsdinstall/distextract/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bsdinstall/distfetch/Makefile.depend b/usr.sbin/bsdinstall/distfetch/Makefile.depend
index 570d72b..5dca986 100644
--- a/usr.sbin/bsdinstall/distfetch/Makefile.depend
+++ b/usr.sbin/bsdinstall/distfetch/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bsdinstall/partedit/Makefile.depend b/usr.sbin/bsdinstall/partedit/Makefile.depend
index 5faa884..c0a768d 100644
--- a/usr.sbin/bsdinstall/partedit/Makefile.depend
+++ b/usr.sbin/bsdinstall/partedit/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bsdinstall/scripts/Makefile.depend b/usr.sbin/bsdinstall/scripts/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.sbin/bsdinstall/scripts/Makefile.depend
+++ b/usr.sbin/bsdinstall/scripts/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bsnmpd/bsnmpd/Makefile.depend b/usr.sbin/bsnmpd/bsnmpd/Makefile.depend
index 06a2ce9..3df74f7 100644
--- a/usr.sbin/bsnmpd/bsnmpd/Makefile.depend
+++ b/usr.sbin/bsnmpd/bsnmpd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bsnmpd/gensnmptree/Makefile.depend b/usr.sbin/bsnmpd/gensnmptree/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/bsnmpd/gensnmptree/Makefile.depend
+++ b/usr.sbin/bsnmpd/gensnmptree/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bsnmpd/modules/Makefile.depend b/usr.sbin/bsnmpd/modules/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.sbin/bsnmpd/modules/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bsnmpd/modules/snmp_atm/Makefile.depend b/usr.sbin/bsnmpd/modules/snmp_atm/Makefile.depend
index 185b16d..a511f26 100644
--- a/usr.sbin/bsnmpd/modules/snmp_atm/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/snmp_atm/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bsnmpd/modules/snmp_bridge/Makefile.depend b/usr.sbin/bsnmpd/modules/snmp_bridge/Makefile.depend
index fbc9960..24fcca9 100644
--- a/usr.sbin/bsnmpd/modules/snmp_bridge/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/snmp_bridge/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bsnmpd/modules/snmp_hast/Makefile.depend b/usr.sbin/bsnmpd/modules/snmp_hast/Makefile.depend
index 38dee6b..419cddd 100644
--- a/usr.sbin/bsnmpd/modules/snmp_hast/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/snmp_hast/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile.depend b/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile.depend
index 547ee26..d6b14d8 100644
--- a/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bsnmpd/modules/snmp_lm75/Makefile.depend b/usr.sbin/bsnmpd/modules/snmp_lm75/Makefile.depend
index df4c4ec..98ed0f6 100644
--- a/usr.sbin/bsnmpd/modules/snmp_lm75/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/snmp_lm75/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile.depend b/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile.depend
index 94ed3b4..25da87b 100644
--- a/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bsnmpd/modules/snmp_netgraph/Makefile.depend b/usr.sbin/bsnmpd/modules/snmp_netgraph/Makefile.depend
index 2a32124..547a1b8 100644
--- a/usr.sbin/bsnmpd/modules/snmp_netgraph/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/snmp_netgraph/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bsnmpd/modules/snmp_pf/Makefile.depend b/usr.sbin/bsnmpd/modules/snmp_pf/Makefile.depend
index 5709a18..868588e 100644
--- a/usr.sbin/bsnmpd/modules/snmp_pf/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/snmp_pf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bsnmpd/modules/snmp_target/Makefile.depend b/usr.sbin/bsnmpd/modules/snmp_target/Makefile.depend
index 502a3eb..7b6ccee 100644
--- a/usr.sbin/bsnmpd/modules/snmp_target/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/snmp_target/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bsnmpd/modules/snmp_usm/Makefile.depend b/usr.sbin/bsnmpd/modules/snmp_usm/Makefile.depend
index 70fef42..143eb6b 100644
--- a/usr.sbin/bsnmpd/modules/snmp_usm/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/snmp_usm/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile.depend b/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile.depend
index 7c2d43e..c3e56fe 100644
--- a/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bsnmpd/modules/snmp_wlan/Makefile.depend b/usr.sbin/bsnmpd/modules/snmp_wlan/Makefile.depend
index 13b962f..5e42346 100644
--- a/usr.sbin/bsnmpd/modules/snmp_wlan/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/snmp_wlan/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bsnmpd/tools/bsnmptools/Makefile.depend b/usr.sbin/bsnmpd/tools/bsnmptools/Makefile.depend
index 79d62f8..0aeb983 100644
--- a/usr.sbin/bsnmpd/tools/bsnmptools/Makefile.depend
+++ b/usr.sbin/bsnmpd/tools/bsnmptools/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/bsnmpd/tools/libbsnmptools/Makefile.depend b/usr.sbin/bsnmpd/tools/libbsnmptools/Makefile.depend
index 2e72cb6..06abcea 100644
--- a/usr.sbin/bsnmpd/tools/libbsnmptools/Makefile.depend
+++ b/usr.sbin/bsnmpd/tools/libbsnmptools/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/btxld/Makefile.depend b/usr.sbin/btxld/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/btxld/Makefile.depend
+++ b/usr.sbin/btxld/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/cdcontrol/Makefile.depend b/usr.sbin/cdcontrol/Makefile.depend
index e2fa4c7..d6c8db8 100644
--- a/usr.sbin/cdcontrol/Makefile.depend
+++ b/usr.sbin/cdcontrol/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/chkgrp/Makefile.depend b/usr.sbin/chkgrp/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/chkgrp/Makefile.depend
+++ b/usr.sbin/chkgrp/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/chown/Makefile.depend b/usr.sbin/chown/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/chown/Makefile.depend
+++ b/usr.sbin/chown/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/chroot/Makefile.depend b/usr.sbin/chroot/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/chroot/Makefile.depend
+++ b/usr.sbin/chroot/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ckdist/Makefile.depend b/usr.sbin/ckdist/Makefile.depend
index c0953ba..064e492 100644
--- a/usr.sbin/ckdist/Makefile.depend
+++ b/usr.sbin/ckdist/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/clear_locks/Makefile.depend b/usr.sbin/clear_locks/Makefile.depend
index 9e3ced9..c8383bd 100644
--- a/usr.sbin/clear_locks/Makefile.depend
+++ b/usr.sbin/clear_locks/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/config/Makefile.depend b/usr.sbin/config/Makefile.depend
index f5f35fe..b443a43 100644
--- a/usr.sbin/config/Makefile.depend
+++ b/usr.sbin/config/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/cpucontrol/Makefile.depend b/usr.sbin/cpucontrol/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/cpucontrol/Makefile.depend
+++ b/usr.sbin/cpucontrol/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/crashinfo/Makefile.depend b/usr.sbin/crashinfo/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.sbin/crashinfo/Makefile.depend
+++ b/usr.sbin/crashinfo/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/cron/cron/Makefile.depend b/usr.sbin/cron/cron/Makefile.depend
index 34a5890..b21f78a 100644
--- a/usr.sbin/cron/cron/Makefile.depend
+++ b/usr.sbin/cron/cron/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/cron/crontab/Makefile.depend b/usr.sbin/cron/crontab/Makefile.depend
index 5c1a1ba..a1bc9b1 100644
--- a/usr.sbin/cron/crontab/Makefile.depend
+++ b/usr.sbin/cron/crontab/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/cron/lib/Makefile.depend b/usr.sbin/cron/lib/Makefile.depend
index 217d6b6..cf2961c 100644
--- a/usr.sbin/cron/lib/Makefile.depend
+++ b/usr.sbin/cron/lib/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/crunch/crunchgen/Makefile.depend b/usr.sbin/crunch/crunchgen/Makefile.depend
index 3235da4..11f6434 100644
--- a/usr.sbin/crunch/crunchgen/Makefile.depend
+++ b/usr.sbin/crunch/crunchgen/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/crunch/crunchide/Makefile.depend b/usr.sbin/crunch/crunchide/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/crunch/crunchide/Makefile.depend
+++ b/usr.sbin/crunch/crunchide/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ctladm/Makefile.depend b/usr.sbin/ctladm/Makefile.depend
index f187a06..f96ac2f 100644
--- a/usr.sbin/ctladm/Makefile.depend
+++ b/usr.sbin/ctladm/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ctld/login.c b/usr.sbin/ctld/login.c
index c6b83d9..8029130 100644
--- a/usr.sbin/ctld/login.c
+++ b/usr.sbin/ctld/login.c
@@ -557,7 +557,7 @@ login_negotiate_key(struct pdu *request, const char *name,
tmp = conn->conn_data_segment_limit;
}
conn->conn_max_data_segment_length = tmp;
- keys_add_int(response_keys, name, tmp);
+ keys_add_int(response_keys, name, conn->conn_data_segment_limit);
} else if (strcmp(name, "MaxBurstLength") == 0) {
tmp = strtoul(value, NULL, 10);
if (tmp <= 0) {
diff --git a/usr.sbin/ctm/ctm/Makefile.depend b/usr.sbin/ctm/ctm/Makefile.depend
index c0953ba..064e492 100644
--- a/usr.sbin/ctm/ctm/Makefile.depend
+++ b/usr.sbin/ctm/ctm/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ctm/ctm_dequeue/Makefile.depend b/usr.sbin/ctm/ctm_dequeue/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/ctm/ctm_dequeue/Makefile.depend
+++ b/usr.sbin/ctm/ctm_dequeue/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ctm/ctm_rmail/Makefile.depend b/usr.sbin/ctm/ctm_rmail/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/ctm/ctm_rmail/Makefile.depend
+++ b/usr.sbin/ctm/ctm_rmail/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ctm/ctm_smail/Makefile.depend b/usr.sbin/ctm/ctm_smail/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/ctm/ctm_smail/Makefile.depend
+++ b/usr.sbin/ctm/ctm_smail/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/daemon/Makefile.depend b/usr.sbin/daemon/Makefile.depend
index 5d48cd0..0f77a15 100644
--- a/usr.sbin/daemon/Makefile.depend
+++ b/usr.sbin/daemon/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/dconschat/Makefile.depend b/usr.sbin/dconschat/Makefile.depend
index 0bca328..e2e70c8 100644
--- a/usr.sbin/dconschat/Makefile.depend
+++ b/usr.sbin/dconschat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/devinfo/Makefile.depend b/usr.sbin/devinfo/Makefile.depend
index fabd6f5..a6afa47 100644
--- a/usr.sbin/devinfo/Makefile.depend
+++ b/usr.sbin/devinfo/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/digictl/Makefile.depend b/usr.sbin/digictl/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/digictl/Makefile.depend
+++ b/usr.sbin/digictl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/diskinfo/Makefile.depend b/usr.sbin/diskinfo/Makefile.depend
index 0eab23f..58f9a33 100644
--- a/usr.sbin/diskinfo/Makefile.depend
+++ b/usr.sbin/diskinfo/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/dumpcis/Makefile.depend b/usr.sbin/dumpcis/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/dumpcis/Makefile.depend
+++ b/usr.sbin/dumpcis/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/editmap/Makefile.depend b/usr.sbin/editmap/Makefile.depend
index c1c3567..afbd086 100644
--- a/usr.sbin/editmap/Makefile.depend
+++ b/usr.sbin/editmap/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/edquota/Makefile.depend b/usr.sbin/edquota/Makefile.depend
index 0eab23f..58f9a33 100644
--- a/usr.sbin/edquota/Makefile.depend
+++ b/usr.sbin/edquota/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/eeprom/Makefile.depend b/usr.sbin/eeprom/Makefile.depend
index a839545..f52ca95 100644
--- a/usr.sbin/eeprom/Makefile.depend
+++ b/usr.sbin/eeprom/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.sbin/etcupdate/Makefile.depend b/usr.sbin/etcupdate/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.sbin/etcupdate/Makefile.depend
+++ b/usr.sbin/etcupdate/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/extattr/Makefile.depend b/usr.sbin/extattr/Makefile.depend
index 0eab23f..58f9a33 100644
--- a/usr.sbin/extattr/Makefile.depend
+++ b/usr.sbin/extattr/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/extattrctl/Makefile.depend b/usr.sbin/extattrctl/Makefile.depend
index 0eab23f..58f9a33 100644
--- a/usr.sbin/extattrctl/Makefile.depend
+++ b/usr.sbin/extattrctl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/fdcontrol/Makefile.depend b/usr.sbin/fdcontrol/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/fdcontrol/Makefile.depend
+++ b/usr.sbin/fdcontrol/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/fdformat/Makefile.depend b/usr.sbin/fdformat/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/fdformat/Makefile.depend
+++ b/usr.sbin/fdformat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/fdread/Makefile.depend b/usr.sbin/fdread/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/fdread/Makefile.depend
+++ b/usr.sbin/fdread/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/fdwrite/Makefile.depend b/usr.sbin/fdwrite/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/fdwrite/Makefile.depend
+++ b/usr.sbin/fdwrite/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/fifolog/fifolog_create/Makefile.depend b/usr.sbin/fifolog/fifolog_create/Makefile.depend
index 9d81660..2a0e9d7 100644
--- a/usr.sbin/fifolog/fifolog_create/Makefile.depend
+++ b/usr.sbin/fifolog/fifolog_create/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/fifolog/fifolog_reader/Makefile.depend b/usr.sbin/fifolog/fifolog_reader/Makefile.depend
index 0e1e70f..50fc7bd 100644
--- a/usr.sbin/fifolog/fifolog_reader/Makefile.depend
+++ b/usr.sbin/fifolog/fifolog_reader/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/fifolog/fifolog_writer/Makefile.depend b/usr.sbin/fifolog/fifolog_writer/Makefile.depend
index 0e1e70f..50fc7bd 100644
--- a/usr.sbin/fifolog/fifolog_writer/Makefile.depend
+++ b/usr.sbin/fifolog/fifolog_writer/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/fifolog/lib/Makefile.depend b/usr.sbin/fifolog/lib/Makefile.depend
index 0979e86..f91d860 100644
--- a/usr.sbin/fifolog/lib/Makefile.depend
+++ b/usr.sbin/fifolog/lib/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/flowctl/Makefile.depend b/usr.sbin/flowctl/Makefile.depend
index e8a95b2..4fa00ad 100644
--- a/usr.sbin/flowctl/Makefile.depend
+++ b/usr.sbin/flowctl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/freebsd-update/Makefile.depend b/usr.sbin/freebsd-update/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.sbin/freebsd-update/Makefile.depend
+++ b/usr.sbin/freebsd-update/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/fwcontrol/Makefile.depend b/usr.sbin/fwcontrol/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/usr.sbin/fwcontrol/Makefile.depend
+++ b/usr.sbin/fwcontrol/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/getfmac/Makefile.depend b/usr.sbin/getfmac/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/getfmac/Makefile.depend
+++ b/usr.sbin/getfmac/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/getpmac/Makefile.depend b/usr.sbin/getpmac/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/getpmac/Makefile.depend
+++ b/usr.sbin/getpmac/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/gpioctl/Makefile.depend b/usr.sbin/gpioctl/Makefile.depend
index e08b369..712b56e 100644
--- a/usr.sbin/gpioctl/Makefile.depend
+++ b/usr.sbin/gpioctl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/gssd/Makefile.depend b/usr.sbin/gssd/Makefile.depend
index 0921534..63f755c 100644
--- a/usr.sbin/gssd/Makefile.depend
+++ b/usr.sbin/gssd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/gstat/Makefile.depend b/usr.sbin/gstat/Makefile.depend
index d5a0688..c24e161 100644
--- a/usr.sbin/gstat/Makefile.depend
+++ b/usr.sbin/gstat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/i2c/Makefile.depend b/usr.sbin/i2c/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/i2c/Makefile.depend
+++ b/usr.sbin/i2c/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ifmcstat/Makefile.depend b/usr.sbin/ifmcstat/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/usr.sbin/ifmcstat/Makefile.depend
+++ b/usr.sbin/ifmcstat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/inetd/Makefile.depend b/usr.sbin/inetd/Makefile.depend
index 0d1aa30..cc94252 100644
--- a/usr.sbin/inetd/Makefile.depend
+++ b/usr.sbin/inetd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/iostat/Makefile.depend b/usr.sbin/iostat/Makefile.depend
index 9ef8628..bfcafb7 100644
--- a/usr.sbin/iostat/Makefile.depend
+++ b/usr.sbin/iostat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ip6addrctl/Makefile.depend b/usr.sbin/ip6addrctl/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/ip6addrctl/Makefile.depend
+++ b/usr.sbin/ip6addrctl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ipfwpcap/Makefile.depend b/usr.sbin/ipfwpcap/Makefile.depend
index 2fabd86..268320b 100644
--- a/usr.sbin/ipfwpcap/Makefile.depend
+++ b/usr.sbin/ipfwpcap/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/jail/Makefile.depend b/usr.sbin/jail/Makefile.depend
index 0be151a..28c1ed0 100644
--- a/usr.sbin/jail/Makefile.depend
+++ b/usr.sbin/jail/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/jexec/Makefile.depend b/usr.sbin/jexec/Makefile.depend
index 7efb123..b92a98a 100644
--- a/usr.sbin/jexec/Makefile.depend
+++ b/usr.sbin/jexec/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/jls/Makefile.depend b/usr.sbin/jls/Makefile.depend
index 490339f..4131fa7 100644
--- a/usr.sbin/jls/Makefile.depend
+++ b/usr.sbin/jls/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/kbdcontrol/Makefile.depend b/usr.sbin/kbdcontrol/Makefile.depend
index 3888b66..523c8ae 100644
--- a/usr.sbin/kbdcontrol/Makefile.depend
+++ b/usr.sbin/kbdcontrol/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/kbdmap/Makefile.depend b/usr.sbin/kbdmap/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/kbdmap/Makefile.depend
+++ b/usr.sbin/kbdmap/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/keyserv/Makefile.depend b/usr.sbin/keyserv/Makefile.depend
index e1219df..839d12b 100644
--- a/usr.sbin/keyserv/Makefile.depend
+++ b/usr.sbin/keyserv/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/kgmon/Makefile.depend b/usr.sbin/kgmon/Makefile.depend
index 7a06b0f..a1ac545 100644
--- a/usr.sbin/kgmon/Makefile.depend
+++ b/usr.sbin/kgmon/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/kgzip/Makefile.depend b/usr.sbin/kgzip/Makefile.depend
index a839545..f52ca95 100644
--- a/usr.sbin/kgzip/Makefile.depend
+++ b/usr.sbin/kgzip/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.sbin/kldxref/Makefile.depend b/usr.sbin/kldxref/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/kldxref/Makefile.depend
+++ b/usr.sbin/kldxref/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/lastlogin/Makefile.depend b/usr.sbin/lastlogin/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/lastlogin/Makefile.depend
+++ b/usr.sbin/lastlogin/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/lmcconfig/Makefile.depend b/usr.sbin/lmcconfig/Makefile.depend
index 7fbd5c8..92ae034 100644
--- a/usr.sbin/lmcconfig/Makefile.depend
+++ b/usr.sbin/lmcconfig/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/lpr/chkprintcap/Makefile.depend b/usr.sbin/lpr/chkprintcap/Makefile.depend
index f0ff87f..5d7143d 100644
--- a/usr.sbin/lpr/chkprintcap/Makefile.depend
+++ b/usr.sbin/lpr/chkprintcap/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/lpr/common_source/Makefile.depend b/usr.sbin/lpr/common_source/Makefile.depend
index f2b0559..56ba329 100644
--- a/usr.sbin/lpr/common_source/Makefile.depend
+++ b/usr.sbin/lpr/common_source/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/lpr/filters.ru/Makefile.depend b/usr.sbin/lpr/filters.ru/Makefile.depend
index 29fda55..3af2d7f 100644
--- a/usr.sbin/lpr/filters.ru/Makefile.depend
+++ b/usr.sbin/lpr/filters.ru/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.sbin/lpr/filters.ru/koi2855/Makefile.depend b/usr.sbin/lpr/filters.ru/koi2855/Makefile.depend
index 461e710..9cb890b 100644
--- a/usr.sbin/lpr/filters.ru/koi2855/Makefile.depend
+++ b/usr.sbin/lpr/filters.ru/koi2855/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/lpr/filters.ru/koi2alt/Makefile.depend b/usr.sbin/lpr/filters.ru/koi2alt/Makefile.depend
index 461e710..9cb890b 100644
--- a/usr.sbin/lpr/filters.ru/koi2alt/Makefile.depend
+++ b/usr.sbin/lpr/filters.ru/koi2alt/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/lpr/filters/Makefile.depend b/usr.sbin/lpr/filters/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/lpr/filters/Makefile.depend
+++ b/usr.sbin/lpr/filters/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/lpr/lp/Makefile.depend b/usr.sbin/lpr/lp/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.sbin/lpr/lp/Makefile.depend
+++ b/usr.sbin/lpr/lp/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/lpr/lpc/Makefile.depend b/usr.sbin/lpr/lpc/Makefile.depend
index 2a56692..69f631f 100644
--- a/usr.sbin/lpr/lpc/Makefile.depend
+++ b/usr.sbin/lpr/lpc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/lpr/lpd/Makefile.depend b/usr.sbin/lpr/lpd/Makefile.depend
index fc22c92..42a1eb5 100644
--- a/usr.sbin/lpr/lpd/Makefile.depend
+++ b/usr.sbin/lpr/lpd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/lpr/lpq/Makefile.depend b/usr.sbin/lpr/lpq/Makefile.depend
index f0ff87f..5d7143d 100644
--- a/usr.sbin/lpr/lpq/Makefile.depend
+++ b/usr.sbin/lpr/lpq/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/lpr/lpr/Makefile.depend b/usr.sbin/lpr/lpr/Makefile.depend
index f0ff87f..5d7143d 100644
--- a/usr.sbin/lpr/lpr/Makefile.depend
+++ b/usr.sbin/lpr/lpr/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/lpr/lprm/Makefile.depend b/usr.sbin/lpr/lprm/Makefile.depend
index f0ff87f..5d7143d 100644
--- a/usr.sbin/lpr/lprm/Makefile.depend
+++ b/usr.sbin/lpr/lprm/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/lpr/lptest/Makefile.depend b/usr.sbin/lpr/lptest/Makefile.depend
index 461e710..9cb890b 100644
--- a/usr.sbin/lpr/lptest/Makefile.depend
+++ b/usr.sbin/lpr/lptest/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/lpr/pac/Makefile.depend b/usr.sbin/lpr/pac/Makefile.depend
index f0ff87f..5d7143d 100644
--- a/usr.sbin/lpr/pac/Makefile.depend
+++ b/usr.sbin/lpr/pac/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/lptcontrol/Makefile.depend b/usr.sbin/lptcontrol/Makefile.depend
index 461e710..9cb890b 100644
--- a/usr.sbin/lptcontrol/Makefile.depend
+++ b/usr.sbin/lptcontrol/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/mailstats/Makefile.depend b/usr.sbin/mailstats/Makefile.depend
index 5286cc4..9bf3d52 100644
--- a/usr.sbin/mailstats/Makefile.depend
+++ b/usr.sbin/mailstats/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/mailwrapper/Makefile.depend b/usr.sbin/mailwrapper/Makefile.depend
index 0eab23f..58f9a33 100644
--- a/usr.sbin/mailwrapper/Makefile.depend
+++ b/usr.sbin/mailwrapper/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/makefs/Makefile.depend b/usr.sbin/makefs/Makefile.depend
index 73094ef..51e7dfa 100644
--- a/usr.sbin/makefs/Makefile.depend
+++ b/usr.sbin/makefs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/makemap/Makefile.depend b/usr.sbin/makemap/Makefile.depend
index 76d8a0a..f159c6f 100644
--- a/usr.sbin/makemap/Makefile.depend
+++ b/usr.sbin/makemap/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/manctl/Makefile.depend b/usr.sbin/manctl/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.sbin/manctl/Makefile.depend
+++ b/usr.sbin/manctl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/memcontrol/Makefile.depend b/usr.sbin/memcontrol/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/memcontrol/Makefile.depend
+++ b/usr.sbin/memcontrol/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/mergemaster/Makefile.depend b/usr.sbin/mergemaster/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.sbin/mergemaster/Makefile.depend
+++ b/usr.sbin/mergemaster/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/mfiutil/Makefile.depend b/usr.sbin/mfiutil/Makefile.depend
index 0eab23f..58f9a33 100644
--- a/usr.sbin/mfiutil/Makefile.depend
+++ b/usr.sbin/mfiutil/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/mixer/Makefile.depend b/usr.sbin/mixer/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/mixer/Makefile.depend
+++ b/usr.sbin/mixer/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/mld6query/Makefile.depend b/usr.sbin/mld6query/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/usr.sbin/mld6query/Makefile.depend
+++ b/usr.sbin/mld6query/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/mlxcontrol/Makefile.depend b/usr.sbin/mlxcontrol/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/mlxcontrol/Makefile.depend
+++ b/usr.sbin/mlxcontrol/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/mount_smbfs/Makefile.depend b/usr.sbin/mount_smbfs/Makefile.depend
index 18a3d5f..179190c 100644
--- a/usr.sbin/mount_smbfs/Makefile.depend
+++ b/usr.sbin/mount_smbfs/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.sbin/mountd/Makefile.depend b/usr.sbin/mountd/Makefile.depend
index 8dd4123..0a49c9e 100644
--- a/usr.sbin/mountd/Makefile.depend
+++ b/usr.sbin/mountd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/moused/Makefile.depend b/usr.sbin/moused/Makefile.depend
index aa7dc3b..a79b1eb 100644
--- a/usr.sbin/moused/Makefile.depend
+++ b/usr.sbin/moused/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/mptable/Makefile.depend b/usr.sbin/mptable/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/mptable/Makefile.depend
+++ b/usr.sbin/mptable/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/mptutil/Makefile.depend b/usr.sbin/mptutil/Makefile.depend
index 1448d0f..48a48dd 100644
--- a/usr.sbin/mptutil/Makefile.depend
+++ b/usr.sbin/mptutil/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/mtest/Makefile.depend b/usr.sbin/mtest/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/usr.sbin/mtest/Makefile.depend
+++ b/usr.sbin/mtest/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/mtree/Makefile.depend b/usr.sbin/mtree/Makefile.depend
index c0953ba..064e492 100644
--- a/usr.sbin/mtree/Makefile.depend
+++ b/usr.sbin/mtree/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ndiscvt/Makefile.depend b/usr.sbin/ndiscvt/Makefile.depend
index fdf924d..f55c806 100644
--- a/usr.sbin/ndiscvt/Makefile.depend
+++ b/usr.sbin/ndiscvt/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ndp/Makefile.depend b/usr.sbin/ndp/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/usr.sbin/ndp/Makefile.depend
+++ b/usr.sbin/ndp/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/newsyslog/Makefile.depend b/usr.sbin/newsyslog/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/newsyslog/Makefile.depend
+++ b/usr.sbin/newsyslog/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/nfscbd/Makefile.depend b/usr.sbin/nfscbd/Makefile.depend
index 84cc2df..1061516 100644
--- a/usr.sbin/nfscbd/Makefile.depend
+++ b/usr.sbin/nfscbd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/nfsd/Makefile.depend b/usr.sbin/nfsd/Makefile.depend
index f0ca83a..c0b7a14 100644
--- a/usr.sbin/nfsd/Makefile.depend
+++ b/usr.sbin/nfsd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/nfsdumpstate/Makefile.depend b/usr.sbin/nfsdumpstate/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/usr.sbin/nfsdumpstate/Makefile.depend
+++ b/usr.sbin/nfsdumpstate/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/nfsrevoke/Makefile.depend b/usr.sbin/nfsrevoke/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/nfsrevoke/Makefile.depend
+++ b/usr.sbin/nfsrevoke/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/nfsuserd/Makefile.depend b/usr.sbin/nfsuserd/Makefile.depend
index 84cc2df..1061516 100644
--- a/usr.sbin/nfsuserd/Makefile.depend
+++ b/usr.sbin/nfsuserd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ngctl/Makefile.depend b/usr.sbin/ngctl/Makefile.depend
index 610056c..a0a9832 100644
--- a/usr.sbin/ngctl/Makefile.depend
+++ b/usr.sbin/ngctl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/nghook/Makefile.depend b/usr.sbin/nghook/Makefile.depend
index 7fbd5c8..92ae034 100644
--- a/usr.sbin/nghook/Makefile.depend
+++ b/usr.sbin/nghook/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/nmtree/Makefile.depend b/usr.sbin/nmtree/Makefile.depend
index 5e66545..d8f68b0 100644
--- a/usr.sbin/nmtree/Makefile.depend
+++ b/usr.sbin/nmtree/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.sbin/nologin/Makefile.depend b/usr.sbin/nologin/Makefile.depend
index d80b3a4..cae7e64 100644
--- a/usr.sbin/nologin/Makefile.depend
+++ b/usr.sbin/nologin/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/nscd/Makefile.depend b/usr.sbin/nscd/Makefile.depend
index d76fafd..eec69a4 100644
--- a/usr.sbin/nscd/Makefile.depend
+++ b/usr.sbin/nscd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ntp/Makefile.inc b/usr.sbin/ntp/Makefile.inc
index 755fbee..274ec39 100644
--- a/usr.sbin/ntp/Makefile.inc
+++ b/usr.sbin/ntp/Makefile.inc
@@ -11,7 +11,7 @@ NTPDEFS= -DSYS_FREEBSD
CFLAGS+= ${NTPDEFS} ${DEFS_LOCAL} ${CLOCKDEFS}
.if ${MK_OPENSSL} != "no" && !defined(RELEASE_CRUNCH)
-CFLAGS+= -DOPENSSL
+CFLAGS+= -DOPENSSL -DUSE_OPENSSL_CRYPTO_RAND -DAUTOKEY
.endif
WARNS?= 0
diff --git a/usr.sbin/ntp/config.h b/usr.sbin/ntp/config.h
index 8bcf6e6..a5b5b43 100644
--- a/usr.sbin/ntp/config.h
+++ b/usr.sbin/ntp/config.h
@@ -9,7 +9,7 @@
/* #undef ADJTIME_IS_ACCURATE */
/* Support NTP Autokey protocol? */
-#define AUTOKEY 1
+/* #define AUTOKEY 1 */
/* why not HAVE_P_S? */
/* #undef CALL_PTHREAD_SETCONCURRENCY */
@@ -1578,7 +1578,7 @@ typedef unsigned int uintptr_t;
#define USE_FSETOWNCTTY 1
/* Use OpenSSL's crypto random functions */
-#define USE_OPENSSL_CRYPTO_RAND 1
+/* #define USE_OPENSSL_CRYPTO_RAND 1 */
/* OK to use snprintb()? */
/* #undef USE_SNPRINTB */
diff --git a/usr.sbin/ntp/doc/Makefile.depend b/usr.sbin/ntp/doc/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.sbin/ntp/doc/Makefile.depend
+++ b/usr.sbin/ntp/doc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ntp/libntp/Makefile.depend b/usr.sbin/ntp/libntp/Makefile.depend
index 8c3f055..3214852 100644
--- a/usr.sbin/ntp/libntp/Makefile.depend
+++ b/usr.sbin/ntp/libntp/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ntp/libntpevent/Makefile.depend b/usr.sbin/ntp/libntpevent/Makefile.depend
index 7a3afd2..39fece6 100644
--- a/usr.sbin/ntp/libntpevent/Makefile.depend
+++ b/usr.sbin/ntp/libntpevent/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ntp/libopts/Makefile.depend b/usr.sbin/ntp/libopts/Makefile.depend
index 15a1f9c..18be76b 100644
--- a/usr.sbin/ntp/libopts/Makefile.depend
+++ b/usr.sbin/ntp/libopts/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ntp/libparse/Makefile.depend b/usr.sbin/ntp/libparse/Makefile.depend
index 469861b..4bf31bd 100644
--- a/usr.sbin/ntp/libparse/Makefile.depend
+++ b/usr.sbin/ntp/libparse/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ntp/ntp-keygen/Makefile b/usr.sbin/ntp/ntp-keygen/Makefile
index 3c29f9b..d3f10f3 100644
--- a/usr.sbin/ntp/ntp-keygen/Makefile
+++ b/usr.sbin/ntp/ntp-keygen/Makefile
@@ -23,7 +23,7 @@ CFLAGS+= -I${.CURDIR}/../../../contrib/ntp/include \
LIBADD+= ntp opts pthread
.if ${MK_OPENSSL} != "no"
-LIBADD+= md crypto
+LIBADD+= crypto
.endif
.include <bsd.prog.mk>
diff --git a/usr.sbin/ntp/ntp-keygen/Makefile.depend b/usr.sbin/ntp/ntp-keygen/Makefile.depend
index 05e51c1..47e365e 100644
--- a/usr.sbin/ntp/ntp-keygen/Makefile.depend
+++ b/usr.sbin/ntp/ntp-keygen/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ntp/ntpd/Makefile b/usr.sbin/ntp/ntpd/Makefile
index 8da2c68..9f80b15 100644
--- a/usr.sbin/ntp/ntpd/Makefile
+++ b/usr.sbin/ntp/ntpd/Makefile
@@ -35,10 +35,12 @@ CFLAGS+= -I${.CURDIR}/../../../contrib/ntp/ntpd \
-I${.CURDIR}/../ \
-I${.CURDIR}
-LIBADD= parse ntp m rt opts md pthread
+LIBADD= parse ntp m opts pthread
.if ${MK_OPENSSL} != "no"
LIBADD+= crypto
+.else
+LIBADD+= md
.endif
CLEANFILES+= .version version.c
diff --git a/usr.sbin/ntp/ntpd/Makefile.depend b/usr.sbin/ntp/ntpd/Makefile.depend
index 5898bba..c2cd9f7 100644
--- a/usr.sbin/ntp/ntpd/Makefile.depend
+++ b/usr.sbin/ntp/ntpd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ntp/ntpdate/Makefile b/usr.sbin/ntp/ntpdate/Makefile
index 8fdd8f7..10352e8 100644
--- a/usr.sbin/ntp/ntpdate/Makefile
+++ b/usr.sbin/ntp/ntpdate/Makefile
@@ -14,10 +14,12 @@ CFLAGS+= -I${.CURDIR}/../../../contrib/ntp/include \
-I${.CURDIR}/../../../contrib/ntp/lib/isc/pthreads/include \
-I${.CURDIR}/../
-LIBADD= rt ntp m pthread
+LIBADD= ntp m pthread
.if ${MK_OPENSSL} != "no"
-LIBADD+= md ssl crypto
+LIBADD+= crypto
+.else
+LIBADD+= md
.endif
CLEANFILES+= .version version.c
diff --git a/usr.sbin/ntp/ntpdate/Makefile.depend b/usr.sbin/ntp/ntpdate/Makefile.depend
index b4a3b1a..986d60f 100644
--- a/usr.sbin/ntp/ntpdate/Makefile.depend
+++ b/usr.sbin/ntp/ntpdate/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ntp/ntpdc/Makefile b/usr.sbin/ntp/ntpdc/Makefile
index 2129c20..f19211a 100644
--- a/usr.sbin/ntp/ntpdc/Makefile
+++ b/usr.sbin/ntp/ntpdc/Makefile
@@ -18,12 +18,14 @@ CFLAGS+= -I${.CURDIR}/../../../contrib/ntp/include \
-I${.CURDIR}/../../../lib/libc/${MACHINE_ARCH} \
-I${.CURDIR}/../ -I${.CURDIR}
-LIBADD= edit md ntp m readline opts ncurses pthread
+LIBADD= edit ntp m opts pthread
CFLAGS+= -DHAVE_LIBEDIT -DHAVE_READLINE_READLINE_H \
-I${DESTDIR}/${INCLUDEDIR}/edit
.if ${MK_OPENSSL} != "no"
-LIBADD+= ssl crypto
+LIBADD+= crypto
+.else
+LIBADD+= md
.endif
CLEANFILES+= .version version.c
diff --git a/usr.sbin/ntp/ntpdc/Makefile.depend b/usr.sbin/ntp/ntpdc/Makefile.depend
index 309a452..ffa29bb 100644
--- a/usr.sbin/ntp/ntpdc/Makefile.depend
+++ b/usr.sbin/ntp/ntpdc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ntp/ntpq/Makefile b/usr.sbin/ntp/ntpq/Makefile
index d512cff..f9901a0 100644
--- a/usr.sbin/ntp/ntpq/Makefile
+++ b/usr.sbin/ntp/ntpq/Makefile
@@ -21,10 +21,12 @@ CFLAGS+= -I${.CURDIR}/../../../contrib/ntp/include \
-I${.CURDIR}/../../../contrib/ntp/sntp/libopts \
-I${.CURDIR}/../
-LIBADD+= edit md ntp opts m pthread
+LIBADD+= edit ntp opts m pthread
.if ${MK_OPENSSL} != "no"
-LIBADD+= ssl crypto
+LIBADD+= crypto
+.else
+LIBADD+= md
.endif
CFLAGS+= -DHAVE_LIBEDIT -DHAVE_READLINE_READLINE_H \
diff --git a/usr.sbin/ntp/ntpq/Makefile.depend b/usr.sbin/ntp/ntpq/Makefile.depend
index 79264b8..ac816a3 100644
--- a/usr.sbin/ntp/ntpq/Makefile.depend
+++ b/usr.sbin/ntp/ntpq/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ntp/ntptime/Makefile.depend b/usr.sbin/ntp/ntptime/Makefile.depend
index 18087aa..a231d4a 100644
--- a/usr.sbin/ntp/ntptime/Makefile.depend
+++ b/usr.sbin/ntp/ntptime/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ntp/sntp/Makefile b/usr.sbin/ntp/sntp/Makefile
index eba7b83..ce5c01d 100644
--- a/usr.sbin/ntp/sntp/Makefile
+++ b/usr.sbin/ntp/sntp/Makefile
@@ -23,7 +23,9 @@ CFLAGS+= -I${.CURDIR}/../../../contrib/ntp/include \
LIBADD= m opts ntp ntpevent pthread
.if ${MK_OPENSSL} != "no"
-LIBADD+= md ssl crypto
+LIBADD+= crypto
+.else
+LIBADD+= md
.endif
.include <bsd.prog.mk>
diff --git a/usr.sbin/ntp/sntp/Makefile.depend b/usr.sbin/ntp/sntp/Makefile.depend
index 36eddd0..d849eed 100644
--- a/usr.sbin/ntp/sntp/Makefile.depend
+++ b/usr.sbin/ntp/sntp/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ofwdump/Makefile.depend b/usr.sbin/ofwdump/Makefile.depend
index a839545..f52ca95 100644
--- a/usr.sbin/ofwdump/Makefile.depend
+++ b/usr.sbin/ofwdump/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.sbin/pc-sysinstall/backend-partmanager/Makefile.depend b/usr.sbin/pc-sysinstall/backend-partmanager/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.sbin/pc-sysinstall/backend-partmanager/Makefile.depend
+++ b/usr.sbin/pc-sysinstall/backend-partmanager/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/pc-sysinstall/backend-query/Makefile.depend b/usr.sbin/pc-sysinstall/backend-query/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.sbin/pc-sysinstall/backend-query/Makefile.depend
+++ b/usr.sbin/pc-sysinstall/backend-query/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/pc-sysinstall/backend/Makefile.depend b/usr.sbin/pc-sysinstall/backend/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.sbin/pc-sysinstall/backend/Makefile.depend
+++ b/usr.sbin/pc-sysinstall/backend/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/pc-sysinstall/conf/Makefile.depend b/usr.sbin/pc-sysinstall/conf/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.sbin/pc-sysinstall/conf/Makefile.depend
+++ b/usr.sbin/pc-sysinstall/conf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/pc-sysinstall/doc/Makefile.depend b/usr.sbin/pc-sysinstall/doc/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.sbin/pc-sysinstall/doc/Makefile.depend
+++ b/usr.sbin/pc-sysinstall/doc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/pc-sysinstall/examples/Makefile.depend b/usr.sbin/pc-sysinstall/examples/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.sbin/pc-sysinstall/examples/Makefile.depend
+++ b/usr.sbin/pc-sysinstall/examples/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/pc-sysinstall/pc-sysinstall/Makefile.depend b/usr.sbin/pc-sysinstall/pc-sysinstall/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.sbin/pc-sysinstall/pc-sysinstall/Makefile.depend
+++ b/usr.sbin/pc-sysinstall/pc-sysinstall/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/pciconf/Makefile.depend b/usr.sbin/pciconf/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/pciconf/Makefile.depend
+++ b/usr.sbin/pciconf/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/periodic/Makefile.depend b/usr.sbin/periodic/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.sbin/periodic/Makefile.depend
+++ b/usr.sbin/periodic/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/pkg/Makefile.depend b/usr.sbin/pkg/Makefile.depend
index 097f7fb..98b04b08 100644
--- a/usr.sbin/pkg/Makefile.depend
+++ b/usr.sbin/pkg/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/pmcannotate/Makefile.depend b/usr.sbin/pmcannotate/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/pmcannotate/Makefile.depend
+++ b/usr.sbin/pmcannotate/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/pmccontrol/Makefile.depend b/usr.sbin/pmccontrol/Makefile.depend
index 8d14713..d29a358 100644
--- a/usr.sbin/pmccontrol/Makefile.depend
+++ b/usr.sbin/pmccontrol/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/pmcstat/Makefile.depend b/usr.sbin/pmcstat/Makefile.depend
index e970bdb..a3f7225 100644
--- a/usr.sbin/pmcstat/Makefile.depend
+++ b/usr.sbin/pmcstat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/pmcstat/pmcstat.8 b/usr.sbin/pmcstat/pmcstat.8
index 6478241..25ff7a6 100644
--- a/usr.sbin/pmcstat/pmcstat.8
+++ b/usr.sbin/pmcstat/pmcstat.8
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 8, 2015
+.Dd May 27, 2015
.Dt PMCSTAT 8
.Os
.Sh NAME
@@ -246,8 +246,8 @@ Argument
.Ar cpu-spec
is a comma separated list of CPU numbers, or the literal
.Sq *
-denoting all unhalted CPUs.
-The default is to allocate system mode PMCs on all unhalted
+denoting all available CPUs.
+The default is to allocate system mode PMCs on all available
CPUs.
.It Fl d
Toggle between process mode PMCs measuring events for the target
diff --git a/usr.sbin/pmcstat/pmcstat.c b/usr.sbin/pmcstat/pmcstat.c
index c7f36bc..c51c5fa 100644
--- a/usr.sbin/pmcstat/pmcstat.c
+++ b/usr.sbin/pmcstat/pmcstat.c
@@ -116,11 +116,10 @@ struct pmcstat_args args;
static void
pmcstat_clone_event_descriptor(struct pmcstat_ev *ev, const cpuset_t *cpumask)
{
- int cpu, mcpu;
+ int cpu;
struct pmcstat_ev *ev_clone;
- mcpu = sizeof(*cpumask) * NBBY;
- for (cpu = 0; cpu < mcpu; cpu++) {
+ for (cpu = 0; cpu < CPU_SETSIZE; cpu++) {
if (!CPU_ISSET(cpu, cpumask))
continue;
@@ -161,6 +160,7 @@ pmcstat_get_cpumask(const char *cpuspec, cpuset_t *cpumask)
CPU_SET(cpu, cpumask);
s = end + strspn(end, ", \t");
} while (*s);
+ assert(!CPU_EMPTY(cpumask));
}
void
@@ -550,10 +550,10 @@ pmcstat_topexit(void)
int
main(int argc, char **argv)
{
- cpuset_t cpumask;
+ cpuset_t cpumask, rootmask;
double interval;
double duration;
- int hcpu, option, npmc, ncpu;
+ int option, npmc;
int c, check_driver_stats, current_sampling_count;
int do_callchain, do_descendants, do_logproccsw, do_logprocexit;
int do_print, do_read;
@@ -618,14 +618,13 @@ main(int argc, char **argv)
err(EX_OSERR, "ERROR: Cannot determine path of running kernel");
/*
- * The initial CPU mask specifies all non-halted CPUS in the
- * system.
+ * The initial CPU mask specifies the root mask of this process
+ * which is usually all CPUs in the system.
*/
- len = sizeof(int);
- if (sysctlbyname("hw.ncpu", &ncpu, &len, NULL, 0) < 0)
- err(EX_OSERR, "ERROR: Cannot determine the number of CPUs");
- for (hcpu = 0; hcpu < ncpu; hcpu++)
- CPU_SET(hcpu, &cpumask);
+ if (cpuset_getaffinity(CPU_LEVEL_ROOT, CPU_WHICH_PID, -1,
+ sizeof(rootmask), &rootmask) == -1)
+ err(EX_OSERR, "ERROR: Cannot determine the root set of CPUs");
+ CPU_COPY(&rootmask, &cpumask);
while ((option = getopt(argc, argv,
"CD:EF:G:M:NO:P:R:S:TWa:c:df:gk:l:m:n:o:p:qr:s:t:vw:z:")) != -1)
@@ -642,11 +641,9 @@ main(int argc, char **argv)
break;
case 'c': /* CPU */
-
- if (optarg[0] == '*' && optarg[1] == '\0') {
- for (hcpu = 0; hcpu < ncpu; hcpu++)
- CPU_SET(hcpu, &cpumask);
- } else
+ if (optarg[0] == '*' && optarg[1] == '\0')
+ CPU_COPY(&rootmask, &cpumask);
+ else
pmcstat_get_cpumask(optarg, &cpumask);
args.pa_flags |= FLAGS_HAS_CPUMASK;
@@ -771,13 +768,9 @@ main(int argc, char **argv)
else
ev->ev_count = -1;
- if (option == 'S' || option == 's') {
- hcpu = sizeof(cpumask) * NBBY;
- for (hcpu--; hcpu >= 0; hcpu--)
- if (CPU_ISSET(hcpu, &cpumask))
- break;
- ev->ev_cpu = hcpu;
- } else
+ if (option == 'S' || option == 's')
+ ev->ev_cpu = CPU_FFS(&cpumask);
+ else
ev->ev_cpu = PMC_CPU_ANY;
ev->ev_flags = 0;
@@ -804,11 +797,9 @@ main(int argc, char **argv)
STAILQ_INSERT_TAIL(&args.pa_events, ev, ev_next);
if (option == 's' || option == 'S') {
- hcpu = CPU_ISSET(ev->ev_cpu, &cpumask);
CPU_CLR(ev->ev_cpu, &cpumask);
pmcstat_clone_event_descriptor(ev, &cpumask);
- if (hcpu != 0)
- CPU_SET(ev->ev_cpu, &cpumask);
+ CPU_SET(ev->ev_cpu, &cpumask);
}
break;
diff --git a/usr.sbin/pnpinfo/Makefile.depend b/usr.sbin/pnpinfo/Makefile.depend
index a839545..f52ca95 100644
--- a/usr.sbin/pnpinfo/Makefile.depend
+++ b/usr.sbin/pnpinfo/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.sbin/portsnap/make_index/Makefile.depend b/usr.sbin/portsnap/make_index/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/portsnap/make_index/Makefile.depend
+++ b/usr.sbin/portsnap/make_index/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/portsnap/phttpget/Makefile.depend b/usr.sbin/portsnap/phttpget/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/portsnap/phttpget/Makefile.depend
+++ b/usr.sbin/portsnap/phttpget/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/portsnap/portsnap/Makefile.depend b/usr.sbin/portsnap/portsnap/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.sbin/portsnap/portsnap/Makefile.depend
+++ b/usr.sbin/portsnap/portsnap/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/powerd/Makefile.depend b/usr.sbin/powerd/Makefile.depend
index 0eab23f..58f9a33 100644
--- a/usr.sbin/powerd/Makefile.depend
+++ b/usr.sbin/powerd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ppp/Makefile.depend b/usr.sbin/ppp/Makefile.depend
index 858fe08..250763c 100644
--- a/usr.sbin/ppp/Makefile.depend
+++ b/usr.sbin/ppp/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/pppctl/Makefile.depend b/usr.sbin/pppctl/Makefile.depend
index 8f071a8..93d2803 100644
--- a/usr.sbin/pppctl/Makefile.depend
+++ b/usr.sbin/pppctl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/praliases/Makefile.depend b/usr.sbin/praliases/Makefile.depend
index b2feaa7..0cd5be8 100644
--- a/usr.sbin/praliases/Makefile.depend
+++ b/usr.sbin/praliases/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/praudit/Makefile.depend b/usr.sbin/praudit/Makefile.depend
index 4cce057..97143a8 100644
--- a/usr.sbin/praudit/Makefile.depend
+++ b/usr.sbin/praudit/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/procctl/Makefile.depend b/usr.sbin/procctl/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/procctl/Makefile.depend
+++ b/usr.sbin/procctl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/pstat/Makefile.depend b/usr.sbin/pstat/Makefile.depend
index 1692857..e01f8c7 100644
--- a/usr.sbin/pstat/Makefile.depend
+++ b/usr.sbin/pstat/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/pw/Makefile b/usr.sbin/pw/Makefile
index 69953da..4bcf691 100644
--- a/usr.sbin/pw/Makefile
+++ b/usr.sbin/pw/Makefile
@@ -6,7 +6,7 @@ SRCS= pw.c pw_conf.c pw_user.c pw_group.c pw_log.c pw_nis.c pw_vpw.c \
grupd.c pwupd.c fileupd.c psdate.c \
bitmap.c cpdir.c rm_r.c
-WARNS?= 2
+WARNS?= 3
LIBADD= crypt util sbuf
diff --git a/usr.sbin/pw/Makefile.depend b/usr.sbin/pw/Makefile.depend
index b4cd016..392fb60 100644
--- a/usr.sbin/pw/Makefile.depend
+++ b/usr.sbin/pw/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/pw/grupd.c b/usr.sbin/pw/grupd.c
index 74cc390..d52a345 100644
--- a/usr.sbin/pw/grupd.c
+++ b/usr.sbin/pw/grupd.c
@@ -39,28 +39,14 @@ static const char rcsid[] =
#include "pwupd.h"
-static char * grpath = _PATH_PWD;
-
-int
-setgrdir(const char * dir)
-{
- if (dir == NULL)
- return -1;
- else
- grpath = strdup(dir);
- if (grpath == NULL)
- return -1;
-
- return 0;
-}
-
char *
getgrpath(const char * file)
{
static char pathbuf[MAXPATHLEN];
- snprintf(pathbuf, sizeof pathbuf, "%s/%s", grpath, file);
- return pathbuf;
+ snprintf(pathbuf, sizeof pathbuf, "%s/%s", conf.etcpath, file);
+
+ return (pathbuf);
}
static int
@@ -76,7 +62,7 @@ gr_update(struct group * grp, char const * group)
if (group != NULL)
old_gr = GETGRNAM(group);
- if (gr_init(grpath, NULL))
+ if (gr_init(conf.etcpath, NULL))
err(1, "gr_init()");
if ((pfd = gr_lock()) == -1) {
@@ -116,9 +102,6 @@ chggrent(char const * login, struct group * grp)
int
delgrent(struct group * grp)
{
- char group[MAXLOGNAME];
-
- strlcpy(group, grp->gr_name, MAXLOGNAME);
- return gr_update(NULL, group);
+ return (gr_update(NULL, grp->gr_name));
}
diff --git a/usr.sbin/pw/pw.8 b/usr.sbin/pw/pw.8
index 076f2eb..9074313 100644
--- a/usr.sbin/pw/pw.8
+++ b/usr.sbin/pw/pw.8
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 29, 2012
+.Dd June 3, 2015
.Dt PW 8
.Os
.Sh NAME
@@ -32,6 +32,7 @@
.Nd create, remove, modify & display system users and groups
.Sh SYNOPSIS
.Nm
+.Op Fl R Ar rootdir
.Op Fl V Ar etcdir
.Ar useradd
.Op name|uid
@@ -57,6 +58,7 @@
.Op Fl P
.Op Fl Y
.Nm
+.Op Fl R Ar rootdir
.Op Fl V Ar etcdir
.Ar useradd
.Op name|uid
@@ -76,6 +78,7 @@
.Op Fl s Ar shell
.Op Fl y Ar path
.Nm
+.Op Fl R Ar rootdir
.Op Fl V Ar etcdir
.Ar userdel
.Op name|uid
@@ -84,6 +87,7 @@
.Op Fl r
.Op Fl Y
.Nm
+.Op Fl R Ar rootdir
.Op Fl V Ar etcdir
.Ar usermod
.Op name|uid
@@ -109,6 +113,7 @@
.Op Fl P
.Op Fl Y
.Nm
+.Op Fl R Ar rootdir
.Op Fl V Ar etcdir
.Ar usershow
.Op name|uid
@@ -119,11 +124,13 @@
.Op Fl 7
.Op Fl a
.Nm
+.Op Fl R Ar rootdir
.Op Fl V Ar etcdir
.Ar usernext
.Op Fl C Ar config
.Op Fl q
.Nm
+.Op Fl R Ar rootdir
.Op Fl V Ar etcdir
.Ar groupadd
.Op group|gid
@@ -138,6 +145,7 @@
.Op Fl P
.Op Fl Y
.Nm
+.Op Fl R Ar rootdir
.Op Fl V Ar etcdir
.Ar groupdel
.Op group|gid
@@ -145,6 +153,7 @@
.Op Fl g Ar gid
.Op Fl Y
.Nm
+.Op Fl R Ar rootdir
.Op Fl V Ar etcdir
.Ar groupmod
.Op group|gid
@@ -161,6 +170,7 @@
.Op Fl P
.Op Fl Y
.Nm
+.Op Fl R Ar rootdir
.Op Fl V Ar etcdir
.Ar groupshow
.Op group|gid
@@ -170,17 +180,20 @@
.Op Fl P
.Op Fl a
.Nm
+.Op Fl R Ar rootdir
.Op Fl V Ar etcdir
.Ar groupnext
.Op Fl C Ar config
.Op Fl q
.Nm
+.Op Fl R Ar rootdir
.Op Fl V Ar etcdir
.Ar lock
.Op name|uid
.Op Fl C Ar config
.Op Fl q
.Nm
+.Op Fl R Ar rootdir
.Op Fl V Ar etcdir
.Ar unlock
.Op name|uid
@@ -246,6 +259,12 @@ options.
.Pp
The following flags are common to most or all modes of operation:
.Bl -tag -width "-G grouplist"
+.It Fl R Ar rootdir
+Specifies an alternate root directory within which
+.Nm
+will operate.
+Any paths specified will be relative to
+.Va rootdir .
.It Fl V Ar etcdir
This flag sets an alternate location for the password, group and configuration files,
and may be used to maintain a user/group database in an alternate location.
diff --git a/usr.sbin/pw/pw.c b/usr.sbin/pw/pw.c
index ff48db7..30fb55b 100644
--- a/usr.sbin/pw/pw.c
+++ b/usr.sbin/pw/pw.c
@@ -33,6 +33,7 @@ static const char rcsid[] =
#include <fcntl.h>
#include <locale.h>
#include <paths.h>
+#include <stdbool.h>
#include <sys/wait.h>
#include "pw.h"
@@ -56,7 +57,7 @@ static const char *Combo2[] = {
struct pwf PWF =
{
- 0,
+ PWF_REGULAR,
setpwent,
endpwent,
getpwent,
@@ -71,7 +72,7 @@ struct pwf PWF =
};
struct pwf VPWF =
{
- 1,
+ PWF_ALT,
vsetpwent,
vendpwent,
vgetpwent,
@@ -84,6 +85,8 @@ struct pwf VPWF =
vgetgrnam,
};
+struct pwconf conf;
+
static struct cargs arglist;
static int getindex(const char *words[], const char *word);
@@ -96,36 +99,45 @@ main(int argc, char *argv[])
int ch;
int mode = -1;
int which = -1;
+ long id = -1;
char *config = NULL;
- struct userconf *cnf;
struct stat st;
+ const char *errstr;
+ char arg, *name;
+ bool relocated, nis;
static const char *opts[W_NUM][M_NUM] =
{
{ /* user */
- "V:C:qn:u:c:d:e:p:g:G:mM:k:s:oL:i:w:h:H:Db:NPy:Y",
- "V:C:qn:u:rY",
- "V:C:qn:u:c:d:e:p:g:G:mM:l:k:s:w:L:h:H:FNPY",
- "V:C:qn:u:FPa7",
- "V:C:q",
- "V:C:q",
- "V:C:q"
+ "R:V:C:qn:u:c:d:e:p:g:G:mM:k:s:oL:i:w:h:H:Db:NPy:Y",
+ "R:V:C:qn:u:rY",
+ "R:V:C:qn:u:c:d:e:p:g:G:mM:l:k:s:w:L:h:H:FNPY",
+ "R:V:C:qn:u:FPa7",
+ "R:V:C:q",
+ "R:V:C:q",
+ "R:V:C:q"
},
{ /* grp */
- "V:C:qn:g:h:H:M:opNPY",
- "V:C:qn:g:Y",
- "V:C:qn:d:g:l:h:H:FM:m:NPY",
- "V:C:qn:g:FPa",
- "V:C:q"
+ "R:V:C:qn:g:h:H:M:opNPY",
+ "R:V:C:qn:g:Y",
+ "R:V:C:qn:d:g:l:h:H:FM:m:NPY",
+ "R:V:C:qn:g:FPa",
+ "R:V:C:q"
}
};
- static int (*funcs[W_NUM]) (struct userconf * _cnf, int _mode, struct cargs * _args) =
+ static int (*funcs[W_NUM]) (int _mode, char *_name, long _id,
+ struct cargs * _args) =
{ /* Request handlers */
pw_user,
pw_group
};
+ name = NULL;
+ relocated = nis = false;
+ memset(&conf, 0, sizeof(conf));
+ strlcpy(conf.etcpath, _PATH_PWD, sizeof(conf.etcpath));
+
LIST_INIT(&arglist);
(void)setlocale(LC_ALL, "");
@@ -141,7 +153,12 @@ main(int argc, char *argv[])
/*
* Special case, allow pw -V<dir> <operation> [args] for scripts etc.
*/
- if (argv[1][1] == 'V') {
+ arg = argv[1][1];
+ if (arg == 'V' || arg == 'R') {
+ if (relocated)
+ errx(EXIT_FAILURE, "Both '-R' and '-V' "
+ "specified, only one accepted");
+ relocated = true;
optarg = &argv[1][2];
if (*optarg == '\0') {
if (stat(argv[2], &st) != 0)
@@ -155,7 +172,14 @@ main(int argc, char *argv[])
++argv;
--argc;
}
- addarg(&arglist, 'V', optarg);
+ memcpy(&PWF, &VPWF, sizeof PWF);
+ if (arg == 'R') {
+ strlcpy(conf.rootdir, optarg,
+ sizeof(conf.rootdir));
+ PWF._altdir = PWF_ROOTDIR;
+ }
+ snprintf(conf.etcpath, sizeof(conf.etcpath),
+ "%s%s", optarg, arg == 'R' ? "/etc" : "");
} else
break;
}
@@ -170,9 +194,15 @@ main(int argc, char *argv[])
mode = tmp % M_NUM;
} else if (strcmp(argv[1], "help") == 0 && argv[2] == NULL)
cmdhelp(mode, which);
- else if (which != -1 && mode != -1)
- addarg(&arglist, 'n', argv[1]);
- else
+ else if (which != -1 && mode != -1) {
+ if (strspn(argv[1], "0123456789") == strlen(argv[1])) {
+ id = strtonum(argv[1], 0, LONG_MAX, &errstr);
+ if (errstr != NULL)
+ errx(EX_USAGE, "Bad id '%s': %s",
+ argv[1], errstr);
+ } else
+ name = argv[1];
+ } else
errx(EX_USAGE, "unknown keyword `%s'", argv[1]);
++argv;
--argc;
@@ -191,17 +221,82 @@ main(int argc, char *argv[])
optarg = NULL;
while ((ch = getopt(argc, argv, opts[which][mode])) != -1) {
- if (ch == '?')
+ switch (ch) {
+ case '?':
errx(EX_USAGE, "unknown switch");
- else
+ break;
+ case '7':
+ conf.v7 = true;
+ break;
+ case 'C':
+ conf.config = optarg;
+ config = conf.config;
+ break;
+ case 'N':
+ conf.dryrun = true;
+ break;
+ case 'l':
+ if (strlen(optarg) >= MAXLOGNAME)
+ errx(EX_USAGE, "new name too long: %s", optarg);
+ conf.newname = optarg;
+ break;
+ case 'P':
+ conf.pretty = true;
+ break;
+ case 'Y':
+ nis = true;
+ break;
+ case 'g':
+ if (which == 0) { /* for user* */
+ addarg(&arglist, 'g', optarg);
+ break;
+ }
+ if (strspn(optarg, "0123456789") != strlen(optarg))
+ errx(EX_USAGE, "-g expects a number");
+ id = strtonum(optarg, 0, LONG_MAX, &errstr);
+ if (errstr != NULL)
+ errx(EX_USAGE, "Bad id '%s': %s", optarg,
+ errstr);
+ break;
+ case 'u':
+ if (strspn(optarg, "0123456789,") != strlen(optarg))
+ errx(EX_USAGE, "-u expects a number");
+ if (strchr(optarg, ',') != NULL) {
+ addarg(&arglist, 'u', optarg);
+ break;
+ }
+ id = strtonum(optarg, 0, LONG_MAX, &errstr);
+ if (errstr != NULL)
+ errx(EX_USAGE, "Bad id '%s': %s", optarg,
+ errstr);
+ break;
+ case 'n':
+ if (strspn(optarg, "0123456789") != strlen(optarg)) {
+ name = optarg;
+ break;
+ }
+ id = strtonum(optarg, 0, LONG_MAX, &errstr);
+ if (errstr != NULL)
+ errx(EX_USAGE, "Bad id '%s': %s", optarg,
+ errstr);
+ break;
+ case 'o':
+ conf.checkduplicate = true;
+ break;
+ default:
addarg(&arglist, ch, optarg);
+ break;
+ }
optarg = NULL;
}
+ if (name != NULL && strlen(name) >= MAXLOGNAME)
+ errx(EX_USAGE, "name too long: %s", name);
+
/*
* Must be root to attempt an update
*/
- if (geteuid() != 0 && mode != M_PRINT && mode != M_NEXT && getarg(&arglist, 'N')==NULL)
+ if (geteuid() != 0 && mode != M_PRINT && mode != M_NEXT && !conf.dryrun)
errx(EX_NOPERM, "you must be root to run this program");
/*
@@ -215,33 +310,24 @@ main(int argc, char *argv[])
* Set our base working path if not overridden
*/
- config = getarg(&arglist, 'C') ? getarg(&arglist, 'C')->val : NULL;
-
- if (getarg(&arglist, 'V') != NULL) {
- char * etcpath = getarg(&arglist, 'V')->val;
- if (*etcpath) {
- if (config == NULL) { /* Only override config location if -C not specified */
- config = malloc(MAXPATHLEN);
- snprintf(config, MAXPATHLEN, "%s/pw.conf", etcpath);
- }
- memcpy(&PWF, &VPWF, sizeof PWF);
- setpwdir(etcpath);
- setgrdir(etcpath);
- }
+ if (config == NULL) { /* Only override config location if -C not specified */
+ asprintf(&config, "%s/pw.conf", conf.etcpath);
+ if (config == NULL)
+ errx(EX_OSERR, "out of memory");
}
/*
* Now, let's do the common initialisation
*/
- cnf = read_userconfig(config);
+ conf.userconf = read_userconfig(config);
- ch = funcs[which] (cnf, mode, &arglist);
+ ch = funcs[which] (mode, name, id, &arglist);
/*
* If everything went ok, and we've been asked to update
* the NIS maps, then do it now
*/
- if (ch == EXIT_SUCCESS && getarg(&arglist, 'Y') != NULL) {
+ if (ch == EXIT_SUCCESS && nis) {
pid_t pid;
fflush(NULL);
@@ -259,7 +345,7 @@ main(int argc, char *argv[])
if ((i = WEXITSTATUS(i)) != 0)
errx(ch, "make exited with status %d", i);
else
- pw_log(cnf, mode, which, "NIS maps updated");
+ pw_log(conf.userconf, mode, which, "NIS maps updated");
}
}
return ch;
@@ -302,6 +388,7 @@ cmdhelp(int mode, int which)
{
"usage: pw useradd [name] [switches]\n"
"\t-V etcdir alternate /etc location\n"
+ "\t-R rootir alternate root directory\n"
"\t-C config configuration file\n"
"\t-q quiet operation\n"
" Adding users:\n"
@@ -324,6 +411,7 @@ cmdhelp(int mode, int which)
"\t-N no update\n"
" Setting defaults:\n"
"\t-V etcdir alternate /etc location\n"
+ "\t-R rootir alternate root directory\n"
"\t-D set user defaults\n"
"\t-b dir default home root dir\n"
"\t-e period default expiry period\n"
@@ -340,12 +428,14 @@ cmdhelp(int mode, int which)
"\t-y path set NIS passwd file path\n",
"usage: pw userdel [uid|name] [switches]\n"
"\t-V etcdir alternate /etc location\n"
+ "\t-R rootir alternate root directory\n"
"\t-n name login name\n"
"\t-u uid user id\n"
"\t-Y update NIS maps\n"
"\t-r remove home & contents\n",
"usage: pw usermod [uid|name] [switches]\n"
"\t-V etcdir alternate /etc location\n"
+ "\t-R rootir alternate root directory\n"
"\t-C config configuration file\n"
"\t-q quiet operation\n"
"\t-F force add if no user\n"
@@ -369,6 +459,7 @@ cmdhelp(int mode, int which)
"\t-N no update\n",
"usage: pw usershow [uid|name] [switches]\n"
"\t-V etcdir alternate /etc location\n"
+ "\t-R rootir alternate root directory\n"
"\t-n name login name\n"
"\t-u uid user id\n"
"\t-F force print\n"
@@ -377,6 +468,7 @@ cmdhelp(int mode, int which)
"\t-7 print in v7 format\n",
"usage: pw usernext [switches]\n"
"\t-V etcdir alternate /etc location\n"
+ "\t-R rootir alternate root directory\n"
"\t-C config configuration file\n"
"\t-q quiet operation\n",
"usage pw: lock [switches]\n"
@@ -391,6 +483,7 @@ cmdhelp(int mode, int which)
{
"usage: pw groupadd [group|gid] [switches]\n"
"\t-V etcdir alternate /etc location\n"
+ "\t-R rootir alternate root directory\n"
"\t-C config configuration file\n"
"\t-q quiet operation\n"
"\t-n group group name\n"
@@ -401,11 +494,13 @@ cmdhelp(int mode, int which)
"\t-N no update\n",
"usage: pw groupdel [group|gid] [switches]\n"
"\t-V etcdir alternate /etc location\n"
+ "\t-R rootir alternate root directory\n"
"\t-n name group name\n"
"\t-g gid group id\n"
"\t-Y update NIS maps\n",
"usage: pw groupmod [group|gid] [switches]\n"
"\t-V etcdir alternate /etc location\n"
+ "\t-R rootir alternate root directory\n"
"\t-C config configuration file\n"
"\t-q quiet operation\n"
"\t-F force add if not exists\n"
@@ -419,6 +514,7 @@ cmdhelp(int mode, int which)
"\t-N no update\n",
"usage: pw groupshow [group|gid] [switches]\n"
"\t-V etcdir alternate /etc location\n"
+ "\t-R rootir alternate root directory\n"
"\t-n name group name\n"
"\t-g gid group id\n"
"\t-F force print\n"
@@ -426,6 +522,7 @@ cmdhelp(int mode, int which)
"\t-a print all accounting groups\n",
"usage: pw groupnext [switches]\n"
"\t-V etcdir alternate /etc location\n"
+ "\t-R rootir alternate root directory\n"
"\t-C config configuration file\n"
"\t-q quiet operation\n"
}
diff --git a/usr.sbin/pw/pw.h b/usr.sbin/pw/pw.h
index a1ed0c4..6239004 100644
--- a/usr.sbin/pw/pw.h
+++ b/usr.sbin/pw/pw.h
@@ -72,30 +72,6 @@ struct carg
LIST_HEAD(cargs, carg);
-struct userconf
-{
- int default_password; /* Default password for new users? */
- int reuse_uids; /* Reuse uids? */
- int reuse_gids; /* Reuse gids? */
- char *nispasswd; /* Path to NIS version of the passwd file */
- char *dotdir; /* Where to obtain skeleton files */
- char *newmail; /* Mail to send to new accounts */
- char *logfile; /* Where to log changes */
- char *home; /* Where to create home directory */
- mode_t homemode; /* Home directory permissions */
- char *shelldir; /* Where shells are located */
- char **shells; /* List of shells */
- char *shell_default; /* Default shell */
- char *default_group; /* Default group number */
- char **groups; /* Default (additional) groups */
- char *default_class; /* Default user class */
- uid_t min_uid, max_uid; /* Allowed range of uids */
- gid_t min_gid, max_gid; /* Allowed range of gids */
- int expire_days; /* Days to expiry */
- int password_days; /* Days to password expiry */
- int numgroups; /* (internal) size of default_group array */
-};
-
#define _DEF_DIRMODE (S_IRWXU | S_IRWXG | S_IRWXO)
#define _PATH_PW_CONF "/etc/pw.conf"
#define _UC_MAXLINE 1024
@@ -106,9 +82,9 @@ int write_userconfig(char const * file);
struct carg *addarg(struct cargs * _args, int ch, char *argstr);
struct carg *getarg(struct cargs * _args, int ch);
-int pw_user(struct userconf * cnf, int mode, struct cargs * _args);
-int pw_group(struct userconf * cnf, int mode, struct cargs * _args);
-char *pw_checkname(u_char *name, int gecos);
+int pw_user(int mode, char *name, long id, struct cargs * _args);
+int pw_group(int mode, char *name, long id, struct cargs * _args);
+char *pw_checkname(char *name, int gecos);
int addnispwent(const char *path, struct passwd *pwd);
int delnispwent(const char *path, const char *login);
diff --git a/usr.sbin/pw/pw_conf.c b/usr.sbin/pw/pw_conf.c
index 99d3e8f..24c0650 100644
--- a/usr.sbin/pw/pw_conf.c
+++ b/usr.sbin/pw/pw_conf.c
@@ -241,126 +241,127 @@ read_userconfig(char const * file)
if (file == NULL)
file = _PATH_PW_CONF;
- if ((fp = fopen(file, "r")) != NULL) {
- while ((linelen = getline(&buf, &linecap, fp)) > 0) {
- if (*buf && (p = strtok(buf, " \t\r\n=")) != NULL && *p != '#') {
- static char const toks[] = " \t\r\n,=";
- char *q = strtok(NULL, toks);
- int i = 0;
- mode_t *modeset;
-
- while (i < _UC_FIELDS && strcmp(p, kwds[i]) != 0)
- ++i;
+ if ((fp = fopen(file, "r")) == NULL)
+ return (&config);
+
+ while ((linelen = getline(&buf, &linecap, fp)) > 0) {
+ if (*buf && (p = strtok(buf, " \t\r\n=")) != NULL && *p != '#') {
+ static char const toks[] = " \t\r\n,=";
+ char *q = strtok(NULL, toks);
+ int i = 0;
+ mode_t *modeset;
+
+ while (i < _UC_FIELDS && strcmp(p, kwds[i]) != 0)
+ ++i;
#if debugging
- if (i == _UC_FIELDS)
- printf("Got unknown kwd `%s' val=`%s'\n", p, q ? q : "");
- else
- printf("Got kwd[%s]=%s\n", p, q);
+ if (i == _UC_FIELDS)
+ printf("Got unknown kwd `%s' val=`%s'\n", p, q ? q : "");
+ else
+ printf("Got kwd[%s]=%s\n", p, q);
#endif
- switch (i) {
- case _UC_DEFAULTPWD:
- config.default_password = boolean_val(q, 1);
- break;
- case _UC_REUSEUID:
- config.reuse_uids = boolean_val(q, 0);
- break;
- case _UC_REUSEGID:
- config.reuse_gids = boolean_val(q, 0);
- break;
- case _UC_NISPASSWD:
- config.nispasswd = (q == NULL || !boolean_val(q, 1))
- ? NULL : newstr(q);
- break;
- case _UC_DOTDIR:
- config.dotdir = (q == NULL || !boolean_val(q, 1))
- ? NULL : newstr(q);
- break;
+ switch (i) {
+ case _UC_DEFAULTPWD:
+ config.default_password = boolean_val(q, 1);
+ break;
+ case _UC_REUSEUID:
+ config.reuse_uids = boolean_val(q, 0);
+ break;
+ case _UC_REUSEGID:
+ config.reuse_gids = boolean_val(q, 0);
+ break;
+ case _UC_NISPASSWD:
+ config.nispasswd = (q == NULL || !boolean_val(q, 1))
+ ? NULL : newstr(q);
+ break;
+ case _UC_DOTDIR:
+ config.dotdir = (q == NULL || !boolean_val(q, 1))
+ ? NULL : newstr(q);
+ break;
case _UC_NEWMAIL:
- config.newmail = (q == NULL || !boolean_val(q, 1))
- ? NULL : newstr(q);
- break;
- case _UC_LOGFILE:
- config.logfile = (q == NULL || !boolean_val(q, 1))
- ? NULL : newstr(q);
- break;
- case _UC_HOMEROOT:
- config.home = (q == NULL || !boolean_val(q, 1))
- ? "/home" : newstr(q);
- break;
- case _UC_HOMEMODE:
- modeset = setmode(q);
- config.homemode = (q == NULL || !boolean_val(q, 1))
- ? _DEF_DIRMODE : getmode(modeset, _DEF_DIRMODE);
- free(modeset);
- break;
- case _UC_SHELLPATH:
- config.shelldir = (q == NULL || !boolean_val(q, 1))
- ? "/bin" : newstr(q);
- break;
- case _UC_SHELLS:
- for (i = 0; i < _UC_MAXSHELLS && q != NULL; i++, q = strtok(NULL, toks))
- system_shells[i] = newstr(q);
- if (i > 0)
- while (i < _UC_MAXSHELLS)
- system_shells[i++] = NULL;
- break;
- case _UC_DEFAULTSHELL:
- config.shell_default = (q == NULL || !boolean_val(q, 1))
- ? (char *) bourne_shell : newstr(q);
- break;
- case _UC_DEFAULTGROUP:
- q = unquote(q);
- config.default_group = (q == NULL || !boolean_val(q, 1) || GETGRNAM(q) == NULL)
- ? NULL : newstr(q);
- break;
- case _UC_EXTRAGROUPS:
- for (i = 0; q != NULL; q = strtok(NULL, toks)) {
- if (extendarray(&config.groups, &config.numgroups, i + 2) != -1)
- config.groups[i++] = newstr(q);
- }
- if (i > 0)
- while (i < config.numgroups)
- config.groups[i++] = NULL;
- break;
- case _UC_DEFAULTCLASS:
- config.default_class = (q == NULL || !boolean_val(q, 1))
- ? NULL : newstr(q);
- break;
- case _UC_MINUID:
- if ((q = unquote(q)) != NULL && isdigit(*q))
- config.min_uid = (uid_t) atol(q);
- break;
- case _UC_MAXUID:
- if ((q = unquote(q)) != NULL && isdigit(*q))
- config.max_uid = (uid_t) atol(q);
- break;
- case _UC_MINGID:
- if ((q = unquote(q)) != NULL && isdigit(*q))
- config.min_gid = (gid_t) atol(q);
- break;
- case _UC_MAXGID:
- if ((q = unquote(q)) != NULL && isdigit(*q))
- config.max_gid = (gid_t) atol(q);
- break;
- case _UC_EXPIRE:
- if ((q = unquote(q)) != NULL && isdigit(*q))
- config.expire_days = atoi(q);
- break;
- case _UC_PASSWORD:
- if ((q = unquote(q)) != NULL && isdigit(*q))
- config.password_days = atoi(q);
- break;
- case _UC_FIELDS:
- case _UC_NONE:
- break;
+ config.newmail = (q == NULL || !boolean_val(q, 1))
+ ? NULL : newstr(q);
+ break;
+ case _UC_LOGFILE:
+ config.logfile = (q == NULL || !boolean_val(q, 1))
+ ? NULL : newstr(q);
+ break;
+ case _UC_HOMEROOT:
+ config.home = (q == NULL || !boolean_val(q, 1))
+ ? "/home" : newstr(q);
+ break;
+ case _UC_HOMEMODE:
+ modeset = setmode(q);
+ config.homemode = (q == NULL || !boolean_val(q, 1))
+ ? _DEF_DIRMODE : getmode(modeset, _DEF_DIRMODE);
+ free(modeset);
+ break;
+ case _UC_SHELLPATH:
+ config.shelldir = (q == NULL || !boolean_val(q, 1))
+ ? "/bin" : newstr(q);
+ break;
+ case _UC_SHELLS:
+ for (i = 0; i < _UC_MAXSHELLS && q != NULL; i++, q = strtok(NULL, toks))
+ system_shells[i] = newstr(q);
+ if (i > 0)
+ while (i < _UC_MAXSHELLS)
+ system_shells[i++] = NULL;
+ break;
+ case _UC_DEFAULTSHELL:
+ config.shell_default = (q == NULL || !boolean_val(q, 1))
+ ? (char *) bourne_shell : newstr(q);
+ break;
+ case _UC_DEFAULTGROUP:
+ q = unquote(q);
+ config.default_group = (q == NULL || !boolean_val(q, 1) || GETGRNAM(q) == NULL)
+ ? NULL : newstr(q);
+ break;
+ case _UC_EXTRAGROUPS:
+ for (i = 0; q != NULL; q = strtok(NULL, toks)) {
+ if (extendarray(&config.groups, &config.numgroups, i + 2) != -1)
+ config.groups[i++] = newstr(q);
}
+ if (i > 0)
+ while (i < config.numgroups)
+ config.groups[i++] = NULL;
+ break;
+ case _UC_DEFAULTCLASS:
+ config.default_class = (q == NULL || !boolean_val(q, 1))
+ ? NULL : newstr(q);
+ break;
+ case _UC_MINUID:
+ if ((q = unquote(q)) != NULL && isdigit(*q))
+ config.min_uid = (uid_t) atol(q);
+ break;
+ case _UC_MAXUID:
+ if ((q = unquote(q)) != NULL && isdigit(*q))
+ config.max_uid = (uid_t) atol(q);
+ break;
+ case _UC_MINGID:
+ if ((q = unquote(q)) != NULL && isdigit(*q))
+ config.min_gid = (gid_t) atol(q);
+ break;
+ case _UC_MAXGID:
+ if ((q = unquote(q)) != NULL && isdigit(*q))
+ config.max_gid = (gid_t) atol(q);
+ break;
+ case _UC_EXPIRE:
+ if ((q = unquote(q)) != NULL && isdigit(*q))
+ config.expire_days = atoi(q);
+ break;
+ case _UC_PASSWORD:
+ if ((q = unquote(q)) != NULL && isdigit(*q))
+ config.password_days = atoi(q);
+ break;
+ case _UC_FIELDS:
+ case _UC_NONE:
+ break;
}
}
- if (linecap > 0)
- free(buf);
- fclose(fp);
}
- return &config;
+ free(buf);
+ fclose(fp);
+
+ return (&config);
}
@@ -452,19 +453,19 @@ write_userconfig(char const * file)
config.default_class : "");
break;
case _UC_MINUID:
- sbuf_printf(buf, "%lu", (unsigned long) config.min_uid);
+ sbuf_printf(buf, "%u", config.min_uid);
quote = 0;
break;
case _UC_MAXUID:
- sbuf_printf(buf, "%lu", (unsigned long) config.max_uid);
+ sbuf_printf(buf, "%u", config.max_uid);
quote = 0;
break;
case _UC_MINGID:
- sbuf_printf(buf, "%lu", (unsigned long) config.min_gid);
+ sbuf_printf(buf, "%u", config.min_gid);
quote = 0;
break;
case _UC_MAXGID:
- sbuf_printf(buf, "%lu", (unsigned long) config.max_gid);
+ sbuf_printf(buf, "%u", config.max_gid);
quote = 0;
break;
case _UC_EXPIRE:
diff --git a/usr.sbin/pw/pw_group.c b/usr.sbin/pw/pw_group.c
index b20ce88..b9cce0d 100644
--- a/usr.sbin/pw/pw_group.c
+++ b/usr.sbin/pw/pw_group.c
@@ -44,20 +44,18 @@ static const char rcsid[] =
static struct passwd *lookup_pwent(const char *user);
static void delete_members(char ***members, int *grmembers, int *i,
struct carg *arg, struct group *grp);
-static int print_group(struct group * grp, int pretty);
-static gid_t gr_gidpolicy(struct userconf * cnf, struct cargs * args);
+static int print_group(struct group * grp);
+static gid_t gr_gidpolicy(struct userconf * cnf, long id);
int
-pw_group(struct userconf * cnf, int mode, struct cargs * args)
+pw_group(int mode, char *name, long id, struct cargs * args)
{
int rc;
- struct carg *a_newname = getarg(args, 'l');
- struct carg *a_name = getarg(args, 'n');
- struct carg *a_gid = getarg(args, 'g');
struct carg *arg;
struct group *grp = NULL;
int grmembers = 0;
char **members = NULL;
+ struct userconf *cnf = conf.userconf;
static struct group fakegroup =
{
@@ -67,11 +65,6 @@ pw_group(struct userconf * cnf, int mode, struct cargs * args)
NULL
};
- if (a_gid != NULL) {
- if (strspn(a_gid->val, "0123456789") != strlen(a_gid->val))
- errx(EX_USAGE, "-g expects a number");
- }
-
if (mode == M_LOCK || mode == M_UNLOCK)
errx(EX_USAGE, "'lock' command is not available for groups");
@@ -80,86 +73,79 @@ pw_group(struct userconf * cnf, int mode, struct cargs * args)
* next gid to stdout
*/
if (mode == M_NEXT) {
- gid_t next = gr_gidpolicy(cnf, args);
+ gid_t next = gr_gidpolicy(cnf, id);
if (getarg(args, 'q'))
return next;
- printf("%ld\n", (long)next);
+ printf("%u\n", next);
return EXIT_SUCCESS;
}
if (mode == M_PRINT && getarg(args, 'a')) {
- int pretty = getarg(args, 'P') != NULL;
-
SETGRENT();
while ((grp = GETGRENT()) != NULL)
- print_group(grp, pretty);
+ print_group(grp);
ENDGRENT();
return EXIT_SUCCESS;
}
- if (a_gid == NULL) {
- if (a_name == NULL)
- errx(EX_DATAERR, "group name or id required");
+ if (id < 0 && name == NULL)
+ errx(EX_DATAERR, "group name or id required");
- if (mode != M_ADD && grp == NULL && isdigit((unsigned char)*a_name->val)) {
- (a_gid = a_name)->ch = 'g';
- a_name = NULL;
- }
- }
- grp = (a_name != NULL) ? GETGRNAM(a_name->val) : GETGRGID((gid_t) atoi(a_gid->val));
+ grp = (name != NULL) ? GETGRNAM(name) : GETGRGID(id);
if (mode == M_UPDATE || mode == M_DELETE || mode == M_PRINT) {
- if (a_name == NULL && grp == NULL) /* Try harder */
- grp = GETGRGID(atoi(a_gid->val));
+ if (name == NULL && grp == NULL) /* Try harder */
+ grp = GETGRGID(id);
if (grp == NULL) {
if (mode == M_PRINT && getarg(args, 'F')) {
char *fmems[1];
fmems[0] = NULL;
- fakegroup.gr_name = a_name ? a_name->val : "nogroup";
- fakegroup.gr_gid = a_gid ? (gid_t) atol(a_gid->val) : -1;
+ fakegroup.gr_name = name ? name : "nogroup";
+ fakegroup.gr_gid = (gid_t) id;
fakegroup.gr_mem = fmems;
- return print_group(&fakegroup, getarg(args, 'P') != NULL);
+ return print_group(&fakegroup);
}
- errx(EX_DATAERR, "unknown group `%s'", a_name ? a_name->val : a_gid->val);
+ if (name == NULL)
+ errx(EX_DATAERR, "unknown group `%s'", name);
+ else
+ errx(EX_DATAERR, "unknown group `%ld'", id);
}
- if (a_name == NULL) /* Needed later */
- a_name = addarg(args, 'n', grp->gr_name);
+ if (name == NULL) /* Needed later */
+ name = grp->gr_name;
/*
* Handle deletions now
*/
if (mode == M_DELETE) {
- gid_t gid = grp->gr_gid;
-
rc = delgrent(grp);
if (rc == -1)
- err(EX_IOERR, "group '%s' not available (NIS?)", grp->gr_name);
+ err(EX_IOERR, "group '%s' not available (NIS?)",
+ name);
else if (rc != 0) {
- warn("group update");
- return EX_IOERR;
+ err(EX_IOERR, "group update");
}
- pw_log(cnf, mode, W_GROUP, "%s(%ld) removed", a_name->val, (long) gid);
+ pw_log(cnf, mode, W_GROUP, "%s(%ld) removed", name, id);
return EXIT_SUCCESS;
} else if (mode == M_PRINT)
- return print_group(grp, getarg(args, 'P') != NULL);
+ return print_group(grp);
- if (a_gid)
- grp->gr_gid = (gid_t) atoi(a_gid->val);
+ if (id > 0)
+ grp->gr_gid = (gid_t) id;
- if (a_newname != NULL)
- grp->gr_name = pw_checkname((u_char *)a_newname->val, 0);
+ if (conf.newname != NULL)
+ grp->gr_name = pw_checkname(conf.newname, 0);
} else {
- if (a_name == NULL) /* Required */
+ if (name == NULL) /* Required */
errx(EX_DATAERR, "group name required");
else if (grp != NULL) /* Exists */
- errx(EX_DATAERR, "group name `%s' already exists", a_name->val);
+ errx(EX_DATAERR, "group name `%s' already exists", name);
extendarray(&members, &grmembers, 200);
members[0] = NULL;
grp = &fakegroup;
- grp->gr_name = pw_checkname((u_char *)a_name->val, 0);
+ grp->gr_name = pw_checkname(name, 0);
grp->gr_passwd = "*";
- grp->gr_gid = gr_gidpolicy(cnf, args);
+ grp->gr_gid = gr_gidpolicy(cnf, id);
grp->gr_mem = members;
}
@@ -201,10 +187,8 @@ pw_group(struct userconf * cnf, int mode, struct cargs * args)
fputc('\n', stdout);
fflush(stdout);
}
- if (b < 0) {
- warn("-h file descriptor");
- return EX_OSERR;
- }
+ if (b < 0)
+ err(EX_OSERR, "-h file descriptor");
line[b] = '\0';
if ((p = strpbrk(line, " \t\r\n")) != NULL)
*p = '\0';
@@ -260,29 +244,30 @@ pw_group(struct userconf * cnf, int mode, struct cargs * args)
grp->gr_mem = members;
}
- if (getarg(args, 'N') != NULL)
- return print_group(grp, getarg(args, 'P') != NULL);
+ if (conf.dryrun)
+ return print_group(grp);
if (mode == M_ADD && (rc = addgrent(grp)) != 0) {
if (rc == -1)
- warnx("group '%s' already exists", grp->gr_name);
+ errx(EX_IOERR, "group '%s' already exists",
+ grp->gr_name);
else
- warn("group update");
- return EX_IOERR;
- } else if (mode == M_UPDATE && (rc = chggrent(a_name->val, grp)) != 0) {
+ err(EX_IOERR, "group update");
+ } else if (mode == M_UPDATE && (rc = chggrent(name, grp)) != 0) {
if (rc == -1)
- warnx("group '%s' not available (NIS?)", grp->gr_name);
+ errx(EX_IOERR, "group '%s' not available (NIS?)",
+ grp->gr_name);
else
- warn("group update");
- return EX_IOERR;
+ err(EX_IOERR, "group update");
}
- arg = a_newname != NULL ? a_newname : a_name;
+ if (conf.newname != NULL)
+ name = conf.newname;
/* grp may have been invalidated */
- if ((grp = GETGRNAM(arg->val)) == NULL)
+ if ((grp = GETGRNAM(name)) == NULL)
errx(EX_SOFTWARE, "group disappeared during update");
- pw_log(cnf, mode, W_GROUP, "%s(%ld)", grp->gr_name, (long) grp->gr_gid);
+ pw_log(cnf, mode, W_GROUP, "%s(%u)", grp->gr_name, grp->gr_gid);
free(members);
@@ -351,20 +336,19 @@ delete_members(char ***members, int *grmembers, int *i, struct carg *arg,
static gid_t
-gr_gidpolicy(struct userconf * cnf, struct cargs * args)
+gr_gidpolicy(struct userconf * cnf, long id)
{
struct group *grp;
gid_t gid = (gid_t) - 1;
- struct carg *a_gid = getarg(args, 'g');
/*
* Check the given gid, if any
*/
- if (a_gid != NULL) {
- gid = (gid_t) atol(a_gid->val);
+ if (id > 0) {
+ gid = (gid_t) id;
- if ((grp = GETGRGID(gid)) != NULL && getarg(args, 'o') == NULL)
- errx(EX_DATAERR, "gid `%ld' has already been allocated", (long) grp->gr_gid);
+ if ((grp = GETGRGID(gid)) != NULL && conf.checkduplicate)
+ errx(EX_DATAERR, "gid `%u' has already been allocated", grp->gr_gid);
} else {
struct bitmap bm;
@@ -414,9 +398,9 @@ gr_gidpolicy(struct userconf * cnf, struct cargs * args)
static int
-print_group(struct group * grp, int pretty)
+print_group(struct group * grp)
{
- if (!pretty) {
+ if (!conf.pretty) {
char *buf = NULL;
buf = gr_make(grp);
diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c
index b058aab..c3b2751 100644
--- a/usr.sbin/pw/pw_user.c
+++ b/usr.sbin/pw/pw_user.c
@@ -51,9 +51,11 @@ static const char rcsid[] =
static char locked_str[] = "*LOCKED*";
-static int print_user(struct passwd * pwd, int pretty, int v7);
-static uid_t pw_uidpolicy(struct userconf * cnf, struct cargs * args);
-static uid_t pw_gidpolicy(struct userconf * cnf, struct cargs * args, char *nam, gid_t prefer);
+static int delete_user(struct userconf *cnf, struct passwd *pwd,
+ char *name, int delete, int mode);
+static int print_user(struct passwd * pwd);
+static uid_t pw_uidpolicy(struct userconf * cnf, long id);
+static uid_t pw_gidpolicy(struct cargs * args, char *nam, gid_t prefer);
static time_t pw_pwdpolicy(struct userconf * cnf, struct cargs * args);
static time_t pw_exppolicy(struct userconf * cnf, struct cargs * args);
static char *pw_homepolicy(struct userconf * cnf, struct cargs * args, char const * user);
@@ -63,6 +65,27 @@ static char *shell_path(char const * path, char *shells[], char *sh);
static void rmat(uid_t uid);
static void rmopie(char const * name);
+static void
+create_and_populate_homedir(int mode, struct passwd *pwd)
+{
+ char *homedir, *dotdir;
+ struct userconf *cnf = conf.userconf;
+
+ homedir = dotdir = NULL;
+
+ if (conf.rootdir[0] != '\0') {
+ asprintf(&homedir, "%s/%s", conf.rootdir, pwd->pw_dir);
+ if (homedir == NULL)
+ errx(EX_OSERR, "out of memory");
+ asprintf(&dotdir, "%s/%s", conf.rootdir, cnf->dotdir);
+ }
+
+ copymkdir(homedir ? homedir : pwd->pw_dir, dotdir ? dotdir: cnf->dotdir,
+ cnf->homemode, pwd->pw_uid, pwd->pw_gid);
+ pw_log(cnf, mode, W_USER, "%s(%u) home %s made", pwd->pw_name,
+ pwd->pw_uid, pwd->pw_dir);
+}
+
/*-
* -C config configuration file
* -q quiet operation
@@ -96,18 +119,18 @@ static void rmopie(char const * name);
*/
int
-pw_user(struct userconf * cnf, int mode, struct cargs * args)
+pw_user(int mode, char *name, long id, struct cargs * args)
{
int rc, edited = 0;
char *p = NULL;
char *passtmp;
- struct carg *a_name;
- struct carg *a_uid;
struct carg *arg;
struct passwd *pwd = NULL;
struct group *grp;
struct stat st;
+ struct userconf *cnf;
char line[_PASSWORD_LEN+1];
+ char path[MAXPATHLEN];
FILE *fp;
char *dmode_c;
void *set = NULL;
@@ -129,6 +152,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
#endif
};
+ cnf = conf.userconf;
/*
* With M_NEXT, we only need to return the
@@ -136,11 +160,11 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
*/
if (mode == M_NEXT)
{
- uid_t next = pw_uidpolicy(cnf, args);
+ uid_t next = pw_uidpolicy(cnf, id);
if (getarg(args, 'q'))
return next;
- printf("%ld:", (long)next);
- pw_group(cnf, mode, args);
+ printf("%u:", next);
+ pw_group(mode, name, -1, args);
return EXIT_SUCCESS;
}
@@ -240,7 +264,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
}
}
if ((arg = getarg(args, 'L')) != NULL)
- cnf->default_class = pw_checkname((u_char *)arg->val, 0);
+ cnf->default_class = pw_checkname(arg->val, 0);
if ((arg = getarg(args, 'G')) != NULL && arg->val) {
int i = 0;
@@ -268,7 +292,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
if ((arg = getarg(args, 'w')) != NULL)
cnf->default_password = boolean_val(arg->val, cnf->default_password);
if (mode == M_ADD && getarg(args, 'D')) {
- if (getarg(args, 'n') != NULL)
+ if (name != NULL)
errx(EX_DATAERR, "can't combine `-D' with `-n name'");
if ((arg = getarg(args, 'u')) != NULL && (p = strtok(arg->val, ", \t")) != NULL) {
if ((cnf->min_uid = (uid_t) atoi(p)) == 0)
@@ -283,46 +307,24 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
cnf->max_gid = 32000;
}
- arg = getarg(args, 'C');
- if (write_userconfig(arg ? arg->val : NULL))
- return EXIT_SUCCESS;
- warn("config update");
- return EX_IOERR;
+ if (write_userconfig(conf.config))
+ return (EXIT_SUCCESS);
+ err(EX_IOERR, "config udpate");
}
if (mode == M_PRINT && getarg(args, 'a')) {
- int pretty = getarg(args, 'P') != NULL;
- int v7 = getarg(args, '7') != NULL;
SETPWENT();
while ((pwd = GETPWENT()) != NULL)
- print_user(pwd, pretty, v7);
+ print_user(pwd);
ENDPWENT();
return EXIT_SUCCESS;
}
- if ((a_name = getarg(args, 'n')) != NULL)
- pwd = GETPWNAM(pw_checkname((u_char *)a_name->val, 0));
- a_uid = getarg(args, 'u');
+ if (name != NULL)
+ pwd = GETPWNAM(pw_checkname(name, 0));
- if (a_uid == NULL) {
- if (a_name == NULL)
- errx(EX_DATAERR, "user name or id required");
-
- /*
- * Determine whether 'n' switch is name or uid - we don't
- * really don't really care which we have, but we need to
- * know.
- */
- if (mode != M_ADD && pwd == NULL
- && strspn(a_name->val, "0123456789") == strlen(a_name->val)
- && *a_name->val) {
- (a_uid = a_name)->ch = 'u';
- a_name = NULL;
- }
- } else {
- if (strspn(a_uid->val, "0123456789") != strlen(a_uid->val))
- errx(EX_USAGE, "-u expects a number");
- }
+ if (id < 0 && name == NULL)
+ errx(EX_DATAERR, "user name or id required");
/*
* Update, delete & print require that the user exists
@@ -330,24 +332,22 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
if (mode == M_UPDATE || mode == M_DELETE ||
mode == M_PRINT || mode == M_LOCK || mode == M_UNLOCK) {
- if (a_name == NULL && pwd == NULL) /* Try harder */
- pwd = GETPWUID(atoi(a_uid->val));
+ if (name == NULL && pwd == NULL) /* Try harder */
+ pwd = GETPWUID(id);
if (pwd == NULL) {
if (mode == M_PRINT && getarg(args, 'F')) {
- fakeuser.pw_name = a_name ? a_name->val : "nouser";
- fakeuser.pw_uid = a_uid ? (uid_t) atol(a_uid->val) : -1;
- return print_user(&fakeuser,
- getarg(args, 'P') != NULL,
- getarg(args, '7') != NULL);
+ fakeuser.pw_name = name ? name : "nouser";
+ fakeuser.pw_uid = (uid_t) id;
+ return print_user(&fakeuser);
}
- if (a_name == NULL)
- errx(EX_NOUSER, "no such uid `%s'", a_uid->val);
- errx(EX_NOUSER, "no such user `%s'", a_name->val);
+ if (name == NULL)
+ errx(EX_NOUSER, "no such uid `%ld'", id);
+ errx(EX_NOUSER, "no such user `%s'", name);
}
- if (a_name == NULL) /* May be needed later */
- a_name = addarg(args, 'n', newstr(pwd->pw_name));
+ if (name == NULL)
+ name = pwd->pw_name;
/*
* The M_LOCK and M_UNLOCK functions simply add or remove
@@ -372,130 +372,24 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
errx(EX_DATAERR, "user '%s' is not locked", pwd->pw_name);
pwd->pw_passwd += sizeof(locked_str)-1;
edited = 1;
- } else if (mode == M_DELETE) {
- /*
- * Handle deletions now
- */
- char file[MAXPATHLEN];
- char home[MAXPATHLEN];
- uid_t uid = pwd->pw_uid;
- struct group *gr;
- char grname[LOGNAMESIZE];
-
- if (strcmp(pwd->pw_name, "root") == 0)
- errx(EX_DATAERR, "cannot remove user 'root'");
-
- if (!PWALTDIR()) {
- /*
- * Remove opie record from /etc/opiekeys
- */
-
- rmopie(pwd->pw_name);
-
- /*
- * Remove crontabs
- */
- snprintf(file, sizeof(file), "/var/cron/tabs/%s", pwd->pw_name);
- if (access(file, F_OK) == 0) {
- snprintf(file, sizeof(file), "crontab -u %s -r", pwd->pw_name);
- system(file);
- }
- }
- /*
- * Save these for later, since contents of pwd may be
- * invalidated by deletion
- */
- snprintf(file, sizeof(file), "%s/%s", _PATH_MAILDIR, pwd->pw_name);
- strlcpy(home, pwd->pw_dir, sizeof(home));
- gr = GETGRGID(pwd->pw_gid);
- if (gr != NULL)
- strlcpy(grname, gr->gr_name, LOGNAMESIZE);
- else
- grname[0] = '\0';
-
- rc = delpwent(pwd);
- if (rc == -1)
- err(EX_IOERR, "user '%s' does not exist", pwd->pw_name);
- else if (rc != 0) {
- warn("passwd update");
- return EX_IOERR;
- }
-
- if (cnf->nispasswd && *cnf->nispasswd=='/') {
- rc = delnispwent(cnf->nispasswd, a_name->val);
- if (rc == -1)
- warnx("WARNING: user '%s' does not exist in NIS passwd", pwd->pw_name);
- else if (rc != 0)
- warn("WARNING: NIS passwd update");
- /* non-fatal */
- }
-
- grp = GETGRNAM(a_name->val);
- if (grp != NULL &&
- (grp->gr_mem == NULL || *grp->gr_mem == NULL) &&
- strcmp(a_name->val, grname) == 0)
- delgrent(GETGRNAM(a_name->val));
- SETGRENT();
- while ((grp = GETGRENT()) != NULL) {
- int i, j;
- char group[MAXLOGNAME];
- if (grp->gr_mem != NULL) {
- for (i = 0; grp->gr_mem[i] != NULL; i++) {
- if (!strcmp(grp->gr_mem[i], a_name->val)) {
- for (j = i; grp->gr_mem[j] != NULL; j++)
- grp->gr_mem[j] = grp->gr_mem[j+1];
- strlcpy(group, grp->gr_name, MAXLOGNAME);
- chggrent(group, grp);
- }
- }
- }
- }
- ENDGRENT();
-
- pw_log(cnf, mode, W_USER, "%s(%ld) account removed", a_name->val, (long) uid);
-
- if (!PWALTDIR()) {
- /*
- * Remove mail file
- */
- remove(file);
-
- /*
- * Remove at jobs
- */
- if (getpwuid(uid) == NULL)
- rmat(uid);
-
- /*
- * Remove home directory and contents
- */
- if (getarg(args, 'r') != NULL && *home == '/' && getpwuid(uid) == NULL) {
- if (stat(home, &st) != -1) {
- rm_r(home, uid);
- pw_log(cnf, mode, W_USER, "%s(%ld) home '%s' %sremoved",
- a_name->val, (long) uid, home,
- stat(home, &st) == -1 ? "" : "not completely ");
- }
- }
- }
- return EXIT_SUCCESS;
- } else if (mode == M_PRINT)
- return print_user(pwd,
- getarg(args, 'P') != NULL,
- getarg(args, '7') != NULL);
+ } else if (mode == M_DELETE)
+ return (delete_user(cnf, pwd, name,
+ getarg(args, 'r') != NULL, mode));
+ else if (mode == M_PRINT)
+ return print_user(pwd);
/*
* The rest is edit code
*/
- if ((arg = getarg(args, 'l')) != NULL) {
+ if (conf.newname != NULL) {
if (strcmp(pwd->pw_name, "root") == 0)
errx(EX_DATAERR, "can't rename `root' account");
- pwd->pw_name = pw_checkname((u_char *)arg->val, 0);
+ pwd->pw_name = pw_checkname(conf.newname, 0);
edited = 1;
}
- if ((arg = getarg(args, 'u')) != NULL && isdigit((unsigned char)*arg->val)) {
- pwd->pw_uid = (uid_t) atol(arg->val);
+ if (id > 0 && isdigit((unsigned char)*arg->val)) {
+ pwd->pw_uid = (uid_t)id;
edited = 1;
if (pwd->pw_uid != 0 && strcmp(pwd->pw_name, "root") == 0)
errx(EX_DATAERR, "can't change uid of `root' account");
@@ -596,19 +490,19 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
* Add code
*/
- if (a_name == NULL) /* Required */
+ if (name == NULL) /* Required */
errx(EX_DATAERR, "login name required");
- else if ((pwd = GETPWNAM(a_name->val)) != NULL) /* Exists */
- errx(EX_DATAERR, "login name `%s' already exists", a_name->val);
+ else if ((pwd = GETPWNAM(name)) != NULL) /* Exists */
+ errx(EX_DATAERR, "login name `%s' already exists", name);
/*
* Now, set up defaults for a new user
*/
pwd = &fakeuser;
- pwd->pw_name = a_name->val;
+ pwd->pw_name = name;
pwd->pw_class = cnf->default_class ? cnf->default_class : "";
- pwd->pw_uid = pw_uidpolicy(cnf, args);
- pwd->pw_gid = pw_gidpolicy(cnf, args, pwd->pw_name, (gid_t) pwd->pw_uid);
+ pwd->pw_uid = pw_uidpolicy(cnf, id);
+ pwd->pw_gid = pw_gidpolicy(args, pwd->pw_name, (gid_t) pwd->pw_uid);
pwd->pw_change = pw_pwdpolicy(cnf, args);
pwd->pw_expire = pw_exppolicy(cnf, args);
pwd->pw_dir = pw_homepolicy(cnf, args, pwd->pw_name);
@@ -628,7 +522,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
* Shared add/edit code
*/
if ((arg = getarg(args, 'c')) != NULL) {
- char *gecos = pw_checkname((u_char *)arg->val, 1);
+ char *gecos = pw_checkname(arg->val, 1);
if (strcmp(pwd->pw_gecos, gecos) != 0) {
pwd->pw_gecos = gecos;
edited = 1;
@@ -672,11 +566,9 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
fputc('\n', stdout);
fflush(stdout);
}
- if (b < 0) {
- warn("-%c file descriptor", precrypt ? 'H' :
- 'h');
- return EX_IOERR;
- }
+ if (b < 0)
+ err(EX_IOERR, "-%c file descriptor",
+ precrypt ? 'H' : 'h');
line[b] = '\0';
if ((p = strpbrk(line, "\r\n")) != NULL)
*p = '\0';
@@ -701,21 +593,17 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
/*
* Special case: -N only displays & exits
*/
- if (getarg(args, 'N') != NULL)
- return print_user(pwd,
- getarg(args, 'P') != NULL,
- getarg(args, '7') != NULL);
+ if (conf.dryrun)
+ return print_user(pwd);
if (mode == M_ADD) {
edited = 1; /* Always */
rc = addpwent(pwd);
- if (rc == -1) {
- warnx("user '%s' already exists", pwd->pw_name);
- return EX_IOERR;
- } else if (rc != 0) {
- warn("passwd file update");
- return EX_IOERR;
- }
+ if (rc == -1)
+ errx(EX_IOERR, "user '%s' already exists",
+ pwd->pw_name);
+ else if (rc != 0)
+ err(EX_IOERR, "passwd file update");
if (cnf->nispasswd && *cnf->nispasswd=='/') {
rc = addnispwent(cnf->nispasswd, pwd);
if (rc == -1)
@@ -726,16 +614,13 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
}
} else if (mode == M_UPDATE || mode == M_LOCK || mode == M_UNLOCK) {
if (edited) { /* Only updated this if required */
- rc = chgpwent(a_name->val, pwd);
- if (rc == -1) {
- warnx("user '%s' does not exist (NIS?)", pwd->pw_name);
- return EX_IOERR;
- } else if (rc != 0) {
- warn("passwd file update");
- return EX_IOERR;
- }
+ rc = chgpwent(name, pwd);
+ if (rc == -1)
+ errx(EX_IOERR, "user '%s' does not exist (NIS?)", pwd->pw_name);
+ else if (rc != 0)
+ err(EX_IOERR, "passwd file update");
if ( cnf->nispasswd && *cnf->nispasswd=='/') {
- rc = chgnispwent(cnf->nispasswd, a_name->val, pwd);
+ rc = chgnispwent(cnf->nispasswd, name, pwd);
if (rc == -1)
warn("User '%s' not found in NIS passwd", pwd->pw_name);
else
@@ -787,21 +672,21 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
/* go get a current version of pwd */
- pwd = GETPWNAM(a_name->val);
+ pwd = GETPWNAM(name);
if (pwd == NULL) {
/* This will fail when we rename, so special case that */
- if (mode == M_UPDATE && (arg = getarg(args, 'l')) != NULL) {
- a_name->val = arg->val; /* update new name */
- pwd = GETPWNAM(a_name->val); /* refetch renamed rec */
+ if (mode == M_UPDATE && conf.newname != NULL) {
+ name = conf.newname; /* update new name */
+ pwd = GETPWNAM(name); /* refetch renamed rec */
}
}
if (pwd == NULL) /* can't go on without this */
- errx(EX_NOUSER, "user '%s' disappeared during update", a_name->val);
+ errx(EX_NOUSER, "user '%s' disappeared during update", name);
grp = GETGRGID(pwd->pw_gid);
- pw_log(cnf, mode, W_USER, "%s(%ld):%s(%ld):%s:%s:%s",
- pwd->pw_name, (long) pwd->pw_uid,
- grp ? grp->gr_name : "unknown", (long) (grp ? grp->gr_gid : -1),
+ pw_log(cnf, mode, W_USER, "%s(%u):%s(%u):%s:%s:%s",
+ pwd->pw_name, pwd->pw_uid,
+ grp ? grp->gr_name : "unknown", (grp ? grp->gr_gid : (uid_t)-1),
pwd->pw_gecos, pwd->pw_dir, pwd->pw_shell);
/*
@@ -810,11 +695,13 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
* doesn't hurt anything to create the empty mailfile
*/
if (mode == M_ADD) {
- if (!PWALTDIR()) {
- snprintf(line, sizeof(line), "%s/%s", _PATH_MAILDIR, pwd->pw_name);
- close(open(line, O_RDWR | O_CREAT, 0600)); /* Preserve contents &
+ if (PWALTDIR() != PWF_ALT) {
+ arg = getarg(args, 'R');
+ snprintf(path, sizeof(path), "%s%s/%s",
+ arg ? arg->val : "", _PATH_MAILDIR, pwd->pw_name);
+ close(open(path, O_RDWR | O_CREAT, 0600)); /* Preserve contents &
* mtime */
- chown(line, pwd->pw_uid, pwd->pw_gid);
+ chown(path, pwd->pw_uid, pwd->pw_gid);
}
}
@@ -823,12 +710,9 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
* that this also `works' for editing users if -m is used, but
* existing files will *not* be overwritten.
*/
- if (!PWALTDIR() && getarg(args, 'm') != NULL && pwd->pw_dir && *pwd->pw_dir == '/' && pwd->pw_dir[1]) {
- copymkdir(pwd->pw_dir, cnf->dotdir, cnf->homemode, pwd->pw_uid, pwd->pw_gid);
- pw_log(cnf, mode, W_USER, "%s(%ld) home %s made",
- pwd->pw_name, (long) pwd->pw_uid, pwd->pw_dir);
- }
-
+ if (PWALTDIR() != PWF_ALT && getarg(args, 'm') != NULL && pwd->pw_dir &&
+ *pwd->pw_dir == '/' && pwd->pw_dir[1])
+ create_and_populate_homedir(mode, pwd);
/*
* Finally, send mail to the new user as well, if we are asked to
@@ -845,8 +729,8 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
fputs(line, pfp);
}
pclose(pfp);
- pw_log(cnf, mode, W_USER, "%s(%ld) new user mail sent",
- pwd->pw_name, (long) pwd->pw_uid);
+ pw_log(cnf, mode, W_USER, "%s(%u) new user mail sent",
+ pwd->pw_name, pwd->pw_uid);
}
fclose(fp);
}
@@ -856,20 +740,19 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
static uid_t
-pw_uidpolicy(struct userconf * cnf, struct cargs * args)
+pw_uidpolicy(struct userconf * cnf, long id)
{
struct passwd *pwd;
uid_t uid = (uid_t) - 1;
- struct carg *a_uid = getarg(args, 'u');
/*
* Check the given uid, if any
*/
- if (a_uid != NULL) {
- uid = (uid_t) atol(a_uid->val);
+ if (id > 0) {
+ uid = (uid_t) id;
- if ((pwd = GETPWUID(uid)) != NULL && getarg(args, 'o') == NULL)
- errx(EX_DATAERR, "uid `%ld' has already been allocated", (long) pwd->pw_uid);
+ if ((pwd = GETPWUID(uid)) != NULL && conf.checkduplicate)
+ errx(EX_DATAERR, "uid `%u' has already been allocated", pwd->pw_uid);
} else {
struct bitmap bm;
@@ -912,11 +795,12 @@ pw_uidpolicy(struct userconf * cnf, struct cargs * args)
static uid_t
-pw_gidpolicy(struct userconf * cnf, struct cargs * args, char *nam, gid_t prefer)
+pw_gidpolicy(struct cargs * args, char *nam, gid_t prefer)
{
struct group *grp;
gid_t gid = (uid_t) - 1;
struct carg *a_gid = getarg(args, 'g');
+ struct userconf *cnf = conf.userconf;
/*
* If no arg given, see if default can help out
@@ -943,7 +827,6 @@ pw_gidpolicy(struct userconf * cnf, struct cargs * args, char *nam, gid_t prefer
char tmp[32];
LIST_INIT(&grpargs);
- addarg(&grpargs, 'n', nam);
/*
* We need to auto-create a group with the user's name. We
@@ -958,15 +841,13 @@ pw_gidpolicy(struct userconf * cnf, struct cargs * args, char *nam, gid_t prefer
snprintf(tmp, sizeof(tmp), "%u", prefer);
addarg(&grpargs, 'g', tmp);
}
- if (getarg(args, 'N'))
- {
- addarg(&grpargs, 'N', NULL);
+ if (conf.dryrun) {
addarg(&grpargs, 'q', NULL);
- gid = pw_group(cnf, M_NEXT, &grpargs);
+ gid = pw_group(M_NEXT, nam, -1, &grpargs);
}
else
{
- pw_group(cnf, M_ADD, &grpargs);
+ pw_group(M_ADD, nam, -1, &grpargs);
if ((grp = GETGRNAM(nam)) != NULL)
gid = grp->gr_gid;
}
@@ -1121,7 +1002,7 @@ pw_password(struct userconf * cnf, struct cargs * args, char const * user)
* We give this information back to the user
*/
if (getarg(args, 'h') == NULL && getarg(args, 'H') == NULL &&
- getarg(args, 'N') == NULL) {
+ !conf.dryrun) {
if (isatty(STDOUT_FILENO))
printf("Password for '%s' is: ", user);
printf("%s\n", pwbuf);
@@ -1143,17 +1024,124 @@ pw_password(struct userconf * cnf, struct cargs * args, char const * user)
return pw_pwcrypt(pwbuf);
}
+static int
+delete_user(struct userconf *cnf, struct passwd *pwd, char *name,
+ int delete, int mode)
+{
+ char file[MAXPATHLEN];
+ char home[MAXPATHLEN];
+ uid_t uid = pwd->pw_uid;
+ struct group *gr, *grp;
+ char grname[LOGNAMESIZE];
+ int rc;
+ struct stat st;
+
+ if (strcmp(pwd->pw_name, "root") == 0)
+ errx(EX_DATAERR, "cannot remove user 'root'");
+
+ if (!PWALTDIR()) {
+ /*
+ * Remove opie record from /etc/opiekeys
+ */
+
+ rmopie(pwd->pw_name);
+
+ /*
+ * Remove crontabs
+ */
+ snprintf(file, sizeof(file), "/var/cron/tabs/%s", pwd->pw_name);
+ if (access(file, F_OK) == 0) {
+ snprintf(file, sizeof(file), "crontab -u %s -r", pwd->pw_name);
+ system(file);
+ }
+ }
+ /*
+ * Save these for later, since contents of pwd may be
+ * invalidated by deletion
+ */
+ snprintf(file, sizeof(file), "%s/%s", _PATH_MAILDIR, pwd->pw_name);
+ strlcpy(home, pwd->pw_dir, sizeof(home));
+ gr = GETGRGID(pwd->pw_gid);
+ if (gr != NULL)
+ strlcpy(grname, gr->gr_name, LOGNAMESIZE);
+ else
+ grname[0] = '\0';
+
+ rc = delpwent(pwd);
+ if (rc == -1)
+ err(EX_IOERR, "user '%s' does not exist", pwd->pw_name);
+ else if (rc != 0)
+ err(EX_IOERR, "passwd update");
+
+ if (cnf->nispasswd && *cnf->nispasswd=='/') {
+ rc = delnispwent(cnf->nispasswd, name);
+ if (rc == -1)
+ warnx("WARNING: user '%s' does not exist in NIS passwd", pwd->pw_name);
+ else if (rc != 0)
+ warn("WARNING: NIS passwd update");
+ /* non-fatal */
+ }
+
+ grp = GETGRNAM(name);
+ if (grp != NULL &&
+ (grp->gr_mem == NULL || *grp->gr_mem == NULL) &&
+ strcmp(name, grname) == 0)
+ delgrent(GETGRNAM(name));
+ SETGRENT();
+ while ((grp = GETGRENT()) != NULL) {
+ int i, j;
+ char group[MAXLOGNAME];
+ if (grp->gr_mem == NULL)
+ continue;
+
+ for (i = 0; grp->gr_mem[i] != NULL; i++) {
+ if (strcmp(grp->gr_mem[i], name) != 0)
+ continue;
+
+ for (j = i; grp->gr_mem[j] != NULL; j++)
+ grp->gr_mem[j] = grp->gr_mem[j+1];
+ strlcpy(group, grp->gr_name, MAXLOGNAME);
+ chggrent(group, grp);
+ }
+ }
+ ENDGRENT();
+
+ pw_log(cnf, mode, W_USER, "%s(%u) account removed", name, uid);
+
+ if (!PWALTDIR()) {
+ /*
+ * Remove mail file
+ */
+ remove(file);
+
+ /*
+ * Remove at jobs
+ */
+ if (getpwuid(uid) == NULL)
+ rmat(uid);
+
+ /*
+ * Remove home directory and contents
+ */
+ if (delete && *home == '/' && getpwuid(uid) == NULL &&
+ stat(home, &st) != -1) {
+ rm_r(home, uid);
+ pw_log(cnf, mode, W_USER, "%s(%u) home '%s' %sremoved",
+ name, uid, home,
+ stat(home, &st) == -1 ? "" : "not completely ");
+ }
+ }
+
+ return (EXIT_SUCCESS);
+}
static int
-print_user(struct passwd * pwd, int pretty, int v7)
+print_user(struct passwd * pwd)
{
- if (!pretty) {
+ if (!conf.pretty) {
char *buf;
- if (!v7)
- pwd->pw_passwd = (pwd->pw_passwd == NULL) ? "" : "*";
-
- buf = v7 ? pw_make_v7(pwd) : pw_make(pwd);
+ buf = conf.v7 ? pw_make_v7(pwd) : pw_make(pwd);
printf("%s\n", buf);
free(buf);
} else {
@@ -1193,14 +1181,14 @@ print_user(struct passwd * pwd, int pretty, int v7)
strftime(acexpire, sizeof acexpire, "%c", tptr);
if (pwd->pw_change > (time_t)0 && (tptr = localtime(&pwd->pw_change)) != NULL)
strftime(pwexpire, sizeof pwexpire, "%c", tptr);
- printf("Login Name: %-15s #%-12ld Group: %-15s #%ld\n"
+ printf("Login Name: %-15s #%-12u Group: %-15s #%u\n"
" Full Name: %s\n"
" Home: %-26.26s Class: %s\n"
" Shell: %-26.26s Office: %s\n"
"Work Phone: %-26.26s Home Phone: %s\n"
"Acc Expire: %-26.26s Pwd Expire: %s\n",
- pwd->pw_name, (long) pwd->pw_uid,
- grp ? grp->gr_name : "(invalid)", (long) pwd->pw_gid,
+ pwd->pw_name, pwd->pw_uid,
+ grp ? grp->gr_name : "(invalid)", pwd->pw_gid,
uname, pwd->pw_dir, pwd->pw_class,
pwd->pw_shell, office, wphone, hphone,
acexpire, pwexpire);
@@ -1227,11 +1215,11 @@ print_user(struct passwd * pwd, int pretty, int v7)
return EXIT_SUCCESS;
}
-char *
-pw_checkname(u_char *name, int gecos)
+char *
+pw_checkname(char *name, int gecos)
{
char showch[8];
- u_char const *badchars, *ch, *showtype;
+ const char *badchars, *ch, *showtype;
int reject;
ch = name;
@@ -1282,7 +1270,8 @@ pw_checkname(u_char *name, int gecos)
if (!gecos && (ch - name) > LOGNAMESIZE)
errx(EX_DATAERR, "name too long `%s' (max is %d)", name,
LOGNAMESIZE);
- return (char *)name;
+
+ return (name);
}
diff --git a/usr.sbin/pw/pwupd.c b/usr.sbin/pw/pwupd.c
index 710e901..f9e1959 100644
--- a/usr.sbin/pw/pwupd.c
+++ b/usr.sbin/pw/pwupd.c
@@ -44,28 +44,12 @@ static const char rcsid[] =
#include "pwupd.h"
-static char pathpwd[] = _PATH_PWD;
-static char * pwpath = pathpwd;
-
-int
-setpwdir(const char * dir)
-{
- if (dir == NULL)
- return (-1);
- else
- pwpath = strdup(dir);
- if (pwpath == NULL)
- return (-1);
-
- return (0);
-}
-
char *
getpwpath(char const * file)
{
static char pathbuf[MAXPATHLEN];
- snprintf(pathbuf, sizeof pathbuf, "%s/%s", pwpath, file);
+ snprintf(pathbuf, sizeof pathbuf, "%s/%s", conf.etcpath, file);
return (pathbuf);
}
@@ -80,9 +64,9 @@ pwdb_check(void)
args[i++] = _PATH_PWD_MKDB;
args[i++] = "-C";
- if (pwpath != pathpwd) {
+ if (strcmp(conf.etcpath, _PATH_PWD) != 0) {
args[i++] = "-d";
- args[i++] = pwpath;
+ args[i++] = conf.etcpath;
}
args[i++] = getpwpath(_MASTERPASSWD);
args[i] = NULL;
@@ -117,7 +101,7 @@ pw_update(struct passwd * pwd, char const * user)
if (user != NULL)
old_pw = GETPWNAM(user);
- if (pw_init(pwpath, NULL))
+ if (pw_init(conf.etcpath, NULL))
err(1, "pw_init()");
if ((pfd = pw_lock()) == -1) {
pw_fini();
@@ -162,9 +146,6 @@ chgpwent(char const * login, struct passwd * pwd)
int
delpwent(struct passwd * pwd)
{
- char login[MAXLOGNAME];
-
- strlcpy(login, pwd->pw_name, MAXLOGNAME);
- return (pw_update(NULL, login));
+ return (pw_update(NULL, pwd->pw_name));
}
diff --git a/usr.sbin/pw/pwupd.h b/usr.sbin/pw/pwupd.h
index d6e39ce..8f46e7d 100644
--- a/usr.sbin/pw/pwupd.h
+++ b/usr.sbin/pw/pwupd.h
@@ -29,11 +29,13 @@
#ifndef _PWUPD_H_
#define _PWUPD_H_
+#include <sys/cdefs.h>
+#include <sys/param.h>
#include <sys/types.h>
+
#include <pwd.h>
#include <grp.h>
-
-#include <sys/cdefs.h>
+#include <stdbool.h>
#if defined(__FreeBSD__)
#define RET_SETGRENT int
@@ -41,8 +43,7 @@
#define RET_SETGRENT void
#endif
-struct pwf
-{
+struct pwf {
int _altdir;
void (*_setpwent)(void);
void (*_endpwent)(void);
@@ -56,8 +57,44 @@ struct pwf
struct group * (*_getgrnam)(const char * nam);
};
+struct userconf {
+ int default_password; /* Default password for new users? */
+ int reuse_uids; /* Reuse uids? */
+ int reuse_gids; /* Reuse gids? */
+ char *nispasswd; /* Path to NIS version of the passwd file */
+ char *dotdir; /* Where to obtain skeleton files */
+ char *newmail; /* Mail to send to new accounts */
+ char *logfile; /* Where to log changes */
+ char *home; /* Where to create home directory */
+ mode_t homemode; /* Home directory permissions */
+ char *shelldir; /* Where shells are located */
+ char **shells; /* List of shells */
+ char *shell_default; /* Default shell */
+ char *default_group; /* Default group number */
+ char **groups; /* Default (additional) groups */
+ char *default_class; /* Default user class */
+ uid_t min_uid, max_uid; /* Allowed range of uids */
+ gid_t min_gid, max_gid; /* Allowed range of gids */
+ int expire_days; /* Days to expiry */
+ int password_days; /* Days to password expiry */
+ int numgroups; /* (internal) size of default_group array */
+};
+
+struct pwconf {
+ char rootdir[MAXPATHLEN];
+ char etcpath[MAXPATHLEN];
+ char *newname;
+ char *config;
+ bool dryrun;
+ bool pretty;
+ bool v7;
+ bool checkduplicate;
+ struct userconf *userconf;
+};
+
extern struct pwf PWF;
extern struct pwf VPWF;
+extern struct pwconf conf;
#define SETPWENT() PWF._setpwent()
#define ENDPWENT() PWF._endpwent()
@@ -71,6 +108,10 @@ extern struct pwf VPWF;
#define GETGRGID(gid) PWF._getgrgid(gid)
#define GETGRNAM(nam) PWF._getgrnam(nam)
+#define PWF_REGULAR 0
+#define PWF_ALT 1
+#define PWF_ROOTDIR 2
+
#define PWALTDIR() PWF._altdir
#ifndef _PATH_PWD
#define _PATH_PWD "/etc"
@@ -87,15 +128,12 @@ int addpwent(struct passwd * pwd);
int delpwent(struct passwd * pwd);
int chgpwent(char const * login, struct passwd * pwd);
-int setpwdir(const char * dir);
char * getpwpath(char const * file);
int addgrent(struct group * grp);
int delgrent(struct group * grp);
int chggrent(char const * name, struct group * grp);
-int editgroups(char *name, char **groups);
-int setgrdir(const char * dir);
char * getgrpath(const char *file);
void vsetpwent(void);
diff --git a/usr.sbin/pw/tests/Makefile b/usr.sbin/pw/tests/Makefile
index 37d9c71..193b8ab 100644
--- a/usr.sbin/pw/tests/Makefile
+++ b/usr.sbin/pw/tests/Makefile
@@ -7,6 +7,7 @@ TESTSDIR= ${TESTSBASE}/usr.sbin/pw
ATF_TESTS_SH= pw_etcdir \
pw_lock \
+ pw_config \
pw_groupdel \
pw_groupmod \
pw_useradd \
@@ -18,7 +19,8 @@ ATF_TESTS_SH= pw_etcdir \
TEST_METADATA.${tp}+= required_user="root"
.endfor
-FILES= group helper_functions.shin master.passwd
+FILES= group helper_functions.shin master.passwd pw.conf \
+ pw-modified.conf
FILESDIR= ${TESTSDIR}
ATF_TESTS_SH+= pw_test
diff --git a/usr.sbin/pw/tests/pw-modified.conf b/usr.sbin/pw/tests/pw-modified.conf
new file mode 100644
index 0000000..84f44e7
--- /dev/null
+++ b/usr.sbin/pw/tests/pw-modified.conf
@@ -0,0 +1,62 @@
+#
+# pw.conf - user/group configuration defaults
+#
+
+# Password for new users? no=nologin yes=loginid none=blank random=random
+defaultpasswd = "no"
+
+# Reuse gaps in uid sequence? (yes or no)
+reuseuids = "no"
+
+# Reuse gaps in gid sequence? (yes or no)
+reusegids = "no"
+
+# Path to the NIS passwd file (blank or 'no' for none)
+nispasswd =
+
+# Obtain default dotfiles from this directory
+skeleton = "/usr/share/skel"
+
+# Mail this file to new user (/etc/newuser.msg or no)
+newmail = "no"
+
+# Log add/change/remove information in this file
+logfile = "/var/log/userlog"
+
+# Root directory in which $HOME directory is created
+home = "/home"
+
+# Mode for the new $HOME directory, will be modified by umask
+homemode = 0777
+
+# Colon separated list of directories containing valid shells
+shellpath = "/bin"
+
+# Comma separated list of available shells (without paths)
+shells = "sh","csh","tcsh"
+
+# Default shell (without path)
+defaultshell = "sh"
+
+# Default group (leave blank for new group per user)
+defaultgroup = ""
+
+# Extra groups for new users
+extragroups =
+
+# Default login class for new users
+defaultclass = ""
+
+# Range of valid default user ids
+minuid = 2000
+maxuid = 5000
+
+# Range of valid default group ids
+mingid = 2100
+maxgid = 6000
+
+# Days after which account expires (0=disabled)
+expire_days = 0
+
+# Days after which password expires (0=disabled)
+password_days = 0
diff --git a/usr.sbin/pw/tests/pw.conf b/usr.sbin/pw/tests/pw.conf
new file mode 100644
index 0000000..4e493f6
--- /dev/null
+++ b/usr.sbin/pw/tests/pw.conf
@@ -0,0 +1,62 @@
+#
+# pw.conf - user/group configuration defaults
+#
+
+# Password for new users? no=nologin yes=loginid none=blank random=random
+defaultpasswd = "no"
+
+# Reuse gaps in uid sequence? (yes or no)
+reuseuids = "no"
+
+# Reuse gaps in gid sequence? (yes or no)
+reusegids = "no"
+
+# Path to the NIS passwd file (blank or 'no' for none)
+nispasswd =
+
+# Obtain default dotfiles from this directory
+skeleton = "/usr/share/skel"
+
+# Mail this file to new user (/etc/newuser.msg or no)
+newmail = "no"
+
+# Log add/change/remove information in this file
+logfile = "/var/log/userlog"
+
+# Root directory in which $HOME directory is created
+home = "/home"
+
+# Mode for the new $HOME directory, will be modified by umask
+homemode = 0777
+
+# Colon separated list of directories containing valid shells
+shellpath = "/bin"
+
+# Comma separated list of available shells (without paths)
+shells = "sh","csh","tcsh"
+
+# Default shell (without path)
+defaultshell = "sh"
+
+# Default group (leave blank for new group per user)
+defaultgroup = ""
+
+# Extra groups for new users
+extragroups =
+
+# Default login class for new users
+defaultclass = ""
+
+# Range of valid default user ids
+minuid = 1000
+maxuid = 32000
+
+# Range of valid default group ids
+mingid = 1000
+maxgid = 32000
+
+# Days after which account expires (0=disabled)
+expire_days = 0
+
+# Days after which password expires (0=disabled)
+password_days = 0
diff --git a/usr.sbin/pw/tests/pw_config.sh b/usr.sbin/pw/tests/pw_config.sh
new file mode 100755
index 0000000..fb6489a
--- /dev/null
+++ b/usr.sbin/pw/tests/pw_config.sh
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+# Import helper functions
+. $(atf_get_srcdir)/helper_functions.shin
+
+atf_test_case generate_config
+generate_config_body() {
+ atf_check -s exit:0 \
+ ${PW} useradd -D -C ${HOME}/foo.conf
+ atf_check -o file:$(atf_get_srcdir)/pw.conf \
+ cat ${HOME}/foo.conf
+}
+
+atf_test_case modify_config_uid_gid_boundaries
+modify_config_uid_gid_boundaries_body() {
+ atf_check -s exit:0 \
+ ${PW} useradd -D -C ${HOME}/foo.conf \
+ -u 2000,5000 -i 2100,6000
+ atf_check -o file:$(atf_get_srcdir)/pw-modified.conf \
+ cat ${HOME}/foo.conf
+}
+
+atf_init_test_cases() {
+ atf_add_test_case generate_config
+ atf_add_test_case modify_config_uid_gid_boundaries
+}
diff --git a/usr.sbin/pw/tests/pw_groupmod.sh b/usr.sbin/pw/tests/pw_groupmod.sh
index ad7ad0a..9ea8a6d 100755
--- a/usr.sbin/pw/tests/pw_groupmod.sh
+++ b/usr.sbin/pw/tests/pw_groupmod.sh
@@ -71,10 +71,21 @@ do_not_duplicate_group_on_gid_change_body() {
atf_check -o inline:"testgroup:*:12345:\n" -s exit:0 -x grep "^testgroup" ${HOME}/group
}
+atf_test_case groupmod_rename
+groupmod_rename_body() {
+ populate_etc_skel
+
+ atf_check -s exit:0 ${PW} groupadd foo
+ atf_check -s exit:0 ${PW} groupmod foo -l bar
+ atf_check -s exit:0 -o match:"^bar:.*" \
+ grep "^bar:.*" ${HOME}/group
+}
+
atf_init_test_cases() {
atf_add_test_case groupmod_user
atf_add_test_case groupmod_invalid_user
atf_add_test_case groupmod_bug_193704
atf_add_test_case usermod_bug_185666
atf_add_test_case do_not_duplicate_group_on_gid_change
+ atf_add_test_case groupmod_rename
}
diff --git a/usr.sbin/pw/tests/pw_useradd.sh b/usr.sbin/pw/tests/pw_useradd.sh
index 48612ed..27a8624 100755
--- a/usr.sbin/pw/tests/pw_useradd.sh
+++ b/usr.sbin/pw/tests/pw_useradd.sh
@@ -169,12 +169,19 @@ user_add_password_expiration_date_relative_body() {
atf_fail "Expiration time($TIME) was not within $EPOCH - $BUF seconds."
}
+atf_test_case user_add_name_too_long
+user_add_name_too_long_body() {
+ populate_etc_skel
+ atf_check -e match:"too long" -s exit:64 \
+ ${PW} useradd name_very_vert_very_very_very_long
+}
+
atf_init_test_cases() {
atf_add_test_case user_add
atf_add_test_case user_add_noupdate
atf_add_test_case user_add_comments
atf_add_test_case user_add_comments_noupdate
- atf_add_test_case user_add_comments_invalid
+ atf_add_test_case user_add_comments_invalid
atf_add_test_case user_add_comments_invalid_noupdate
atf_add_test_case user_add_homedir
atf_add_test_case user_add_account_expiration_epoch
@@ -185,4 +192,5 @@ atf_init_test_cases() {
atf_add_test_case user_add_password_expiration_date_numeric
atf_add_test_case user_add_password_expiration_date_month
atf_add_test_case user_add_password_expiration_date_relative
+ atf_add_test_case user_add_name_too_long
}
diff --git a/usr.sbin/pw/tests/pw_usermod.sh b/usr.sbin/pw/tests/pw_usermod.sh
index 88bd316..dbc6481 100755
--- a/usr.sbin/pw/tests/pw_usermod.sh
+++ b/usr.sbin/pw/tests/pw_usermod.sh
@@ -100,13 +100,34 @@ user_mod_name_noupdate_body() {
grep "^foo:.*" $HOME/master.passwd
}
+atf_test_case user_mod_rename
+user_mod_rename_body() {
+ populate_etc_skel
+
+ atf_check -s exit:0 ${PW} useradd foo
+ atf_check -s exit:0 ${PW} usermod foo -l bar
+ atf_check -s exit:0 -o match:"^bar:.*" \
+ grep "^bar:.*" ${HOME}/master.passwd
+}
+
+atf_test_case user_mod_rename_too_long
+user_mod_rename_too_long_body() {
+ populate_etc_skel
+
+ atf_check -s exit:0 ${PW} useradd foo
+ atf_check -s exit:64 -e match:"too long" ${PW} usermod foo \
+ -l name_very_very_very_very_very_long
+}
+
atf_init_test_cases() {
atf_add_test_case user_mod
atf_add_test_case user_mod_noupdate
atf_add_test_case user_mod_comments
atf_add_test_case user_mod_comments_noupdate
- atf_add_test_case user_mod_comments_invalid
- atf_add_test_case user_mod_comments_invalid_noupdate
- atf_add_test_case user_mod_name
+ atf_add_test_case user_mod_comments_invalid
+ atf_add_test_case user_mod_comments_invalid_noupdate
+ atf_add_test_case user_mod_rename
atf_add_test_case user_mod_name_noupdate
+ atf_add_test_case user_mod_rename
+ atf_add_test_case user_mod_rename_too_long
}
diff --git a/usr.sbin/pwd_mkdb/Makefile.depend b/usr.sbin/pwd_mkdb/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/usr.sbin/pwd_mkdb/Makefile.depend
+++ b/usr.sbin/pwd_mkdb/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.8 b/usr.sbin/pwd_mkdb/pwd_mkdb.8
index 209f06e..9af5ea9 100644
--- a/usr.sbin/pwd_mkdb/pwd_mkdb.8
+++ b/usr.sbin/pwd_mkdb/pwd_mkdb.8
@@ -36,7 +36,7 @@
.Nd "generate the password databases"
.Sh SYNOPSIS
.Nm
-.Op Fl BCiLNp
+.Op Fl BCilLNp
.Op Fl d Ar directory
.Op Fl s Ar cachesize
.Op Fl u Ar username
@@ -61,14 +61,10 @@ different from the historic Version 7 style format.
.Pp
The options are as follows:
.Bl -tag -width flag
-.It Fl B
-Store data in big-endian format.
.It Fl C
Check if the password file is in the correct format.
Do not
change, add, or remove any files.
-.It Fl L
-Store data in little-endian format.
.It Fl N
Tell
.Nm
@@ -116,6 +112,34 @@ encrypted password and the insecure version has an asterisk (``*'')
The databases are used by the C library password routines (see
.Xr getpwent 3 ) .
.Pp
+By default,
+the
+.Nm
+utility generates new,
+machine independent format
+.Pq v4
+entries only.
+For compatibility with
+.Fx 5.0
+and earlier releases,
+the
+.Fl l
+option may be specified,
+which enables generation of legacy format
+.Pq v3
+entries.
+The legacy format entries are endianness dependent.
+.Pp
+The following options may be specified and will affect the
+generation of legacy entries.
+.Pp
+.Bl -tag -width flag
+.It Fl B
+Store data in big-endian format.
+.It Fl L
+Store data in little-endian format.
+.El
+.Pp
The
.Nm
utility exits zero on success, non-zero on failure.
diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.c b/usr.sbin/pwd_mkdb/pwd_mkdb.c
index 0ba68a5..69a2fae 100644
--- a/usr.sbin/pwd_mkdb/pwd_mkdb.c
+++ b/usr.sbin/pwd_mkdb/pwd_mkdb.c
@@ -112,15 +112,15 @@ main(int argc, char *argv[])
char sbuf2[MAXPATHLEN];
char *username;
u_int method, methoduid;
- int Cflag, dflag, iflag;
+ int Cflag, dflag, iflag, lflag;
int nblock = 0;
- iflag = dflag = Cflag = 0;
+ iflag = dflag = Cflag = lflag = 0;
strcpy(prefix, _PATH_PWD);
makeold = 0;
username = NULL;
oldfp = NULL;
- while ((ch = getopt(argc, argv, "BCLNd:ips:u:v")) != -1)
+ while ((ch = getopt(argc, argv, "BCLlNd:ips:u:v")) != -1)
switch(ch) {
case 'B': /* big-endian output */
openinfo.lorder = BIG_ENDIAN;
@@ -128,6 +128,9 @@ main(int argc, char *argv[])
case 'C': /* verify only */
Cflag = 1;
break;
+ case 'l': /* generate legacy entries */
+ lflag = 1;
+ break;
case 'L': /* little-endian output */
openinfo.lorder = LITTLE_ENDIAN;
break;
@@ -465,94 +468,96 @@ main(int argc, char *argv[])
error("put");
}
- /* Create insecure data. (legacy version) */
- p = buf;
- COMPACT(pwd.pw_name);
- COMPACT("*");
- LSCALAR(pwd.pw_uid);
- LSCALAR(pwd.pw_gid);
- LSCALAR(pwd.pw_change);
- COMPACT(pwd.pw_class);
- COMPACT(pwd.pw_gecos);
- COMPACT(pwd.pw_dir);
- COMPACT(pwd.pw_shell);
- LSCALAR(pwd.pw_expire);
- LSCALAR(pwd.pw_fields);
- data.size = p - buf;
-
- /* Create secure data. (legacy version) */
- p = sbuf;
- COMPACT(pwd.pw_name);
- COMPACT(pwd.pw_passwd);
- LSCALAR(pwd.pw_uid);
- LSCALAR(pwd.pw_gid);
- LSCALAR(pwd.pw_change);
- COMPACT(pwd.pw_class);
- COMPACT(pwd.pw_gecos);
- COMPACT(pwd.pw_dir);
- COMPACT(pwd.pw_shell);
- LSCALAR(pwd.pw_expire);
- LSCALAR(pwd.pw_fields);
- sdata.size = p - sbuf;
-
- /* Store insecure by name. */
- tbuf[0] = LEGACY_VERSION(_PW_KEYBYNAME);
- len = strlen(pwd.pw_name);
- memmove(tbuf + 1, pwd.pw_name, len);
- key.size = len + 1;
- if ((dp->put)(dp, &key, &data, method) == -1)
- error("put");
-
- /* Store insecure by number. */
- tbuf[0] = LEGACY_VERSION(_PW_KEYBYNUM);
- store = HTOL(cnt);
- memmove(tbuf + 1, &store, sizeof(store));
- key.size = sizeof(store) + 1;
- if ((dp->put)(dp, &key, &data, method) == -1)
- error("put");
-
- /* Store insecure by uid. */
- tbuf[0] = LEGACY_VERSION(_PW_KEYBYUID);
- store = HTOL(pwd.pw_uid);
- memmove(tbuf + 1, &store, sizeof(store));
- key.size = sizeof(store) + 1;
- if ((dp->put)(dp, &key, &data, methoduid) == -1)
- error("put");
+ if (lflag) {
+ /* Create insecure data. (legacy version) */
+ p = buf;
+ COMPACT(pwd.pw_name);
+ COMPACT("*");
+ LSCALAR(pwd.pw_uid);
+ LSCALAR(pwd.pw_gid);
+ LSCALAR(pwd.pw_change);
+ COMPACT(pwd.pw_class);
+ COMPACT(pwd.pw_gecos);
+ COMPACT(pwd.pw_dir);
+ COMPACT(pwd.pw_shell);
+ LSCALAR(pwd.pw_expire);
+ LSCALAR(pwd.pw_fields);
+ data.size = p - buf;
+
+ /* Create secure data. (legacy version) */
+ p = sbuf;
+ COMPACT(pwd.pw_name);
+ COMPACT(pwd.pw_passwd);
+ LSCALAR(pwd.pw_uid);
+ LSCALAR(pwd.pw_gid);
+ LSCALAR(pwd.pw_change);
+ COMPACT(pwd.pw_class);
+ COMPACT(pwd.pw_gecos);
+ COMPACT(pwd.pw_dir);
+ COMPACT(pwd.pw_shell);
+ LSCALAR(pwd.pw_expire);
+ LSCALAR(pwd.pw_fields);
+ sdata.size = p - sbuf;
+
+ /* Store insecure by name. */
+ tbuf[0] = LEGACY_VERSION(_PW_KEYBYNAME);
+ len = strlen(pwd.pw_name);
+ memmove(tbuf + 1, pwd.pw_name, len);
+ key.size = len + 1;
+ if ((dp->put)(dp, &key, &data, method) == -1)
+ error("put");
- /* Store secure by name. */
- tbuf[0] = LEGACY_VERSION(_PW_KEYBYNAME);
- len = strlen(pwd.pw_name);
- memmove(tbuf + 1, pwd.pw_name, len);
- key.size = len + 1;
- if ((sdp->put)(sdp, &key, &sdata, method) == -1)
- error("put");
+ /* Store insecure by number. */
+ tbuf[0] = LEGACY_VERSION(_PW_KEYBYNUM);
+ store = HTOL(cnt);
+ memmove(tbuf + 1, &store, sizeof(store));
+ key.size = sizeof(store) + 1;
+ if ((dp->put)(dp, &key, &data, method) == -1)
+ error("put");
- /* Store secure by number. */
- tbuf[0] = LEGACY_VERSION(_PW_KEYBYNUM);
- store = HTOL(cnt);
- memmove(tbuf + 1, &store, sizeof(store));
- key.size = sizeof(store) + 1;
- if ((sdp->put)(sdp, &key, &sdata, method) == -1)
- error("put");
+ /* Store insecure by uid. */
+ tbuf[0] = LEGACY_VERSION(_PW_KEYBYUID);
+ store = HTOL(pwd.pw_uid);
+ memmove(tbuf + 1, &store, sizeof(store));
+ key.size = sizeof(store) + 1;
+ if ((dp->put)(dp, &key, &data, methoduid) == -1)
+ error("put");
- /* Store secure by uid. */
- tbuf[0] = LEGACY_VERSION(_PW_KEYBYUID);
- store = HTOL(pwd.pw_uid);
- memmove(tbuf + 1, &store, sizeof(store));
- key.size = sizeof(store) + 1;
- if ((sdp->put)(sdp, &key, &sdata, methoduid) == -1)
- error("put");
+ /* Store secure by name. */
+ tbuf[0] = LEGACY_VERSION(_PW_KEYBYNAME);
+ len = strlen(pwd.pw_name);
+ memmove(tbuf + 1, pwd.pw_name, len);
+ key.size = len + 1;
+ if ((sdp->put)(sdp, &key, &sdata, method) == -1)
+ error("put");
- /* Store insecure and secure special plus and special minus */
- if (pwd.pw_name[0] == '+' || pwd.pw_name[0] == '-') {
- tbuf[0] = LEGACY_VERSION(_PW_KEYYPBYNUM);
- store = HTOL(ypcnt);
+ /* Store secure by number. */
+ tbuf[0] = LEGACY_VERSION(_PW_KEYBYNUM);
+ store = HTOL(cnt);
memmove(tbuf + 1, &store, sizeof(store));
key.size = sizeof(store) + 1;
- if ((dp->put)(dp, &key, &data, method) == -1)
- error("put");
if ((sdp->put)(sdp, &key, &sdata, method) == -1)
error("put");
+
+ /* Store secure by uid. */
+ tbuf[0] = LEGACY_VERSION(_PW_KEYBYUID);
+ store = HTOL(pwd.pw_uid);
+ memmove(tbuf + 1, &store, sizeof(store));
+ key.size = sizeof(store) + 1;
+ if ((sdp->put)(sdp, &key, &sdata, methoduid) == -1)
+ error("put");
+
+ /* Store insecure and secure special plus and special minus */
+ if (pwd.pw_name[0] == '+' || pwd.pw_name[0] == '-') {
+ tbuf[0] = LEGACY_VERSION(_PW_KEYYPBYNUM);
+ store = HTOL(ypcnt);
+ memmove(tbuf + 1, &store, sizeof(store));
+ key.size = sizeof(store) + 1;
+ if ((dp->put)(dp, &key, &data, method) == -1)
+ error("put");
+ if ((sdp->put)(sdp, &key, &sdata, method) == -1)
+ error("put");
+ }
}
}
/* Create original format password file entry */
@@ -583,12 +588,14 @@ main(int argc, char *argv[])
error("put");
if ((sdp->put)(sdp, &key, &data, method) == -1)
error("put");
- tbuf[0] = LEGACY_VERSION(_PW_KEYYPENABLED);
- key.size = 1;
- if ((dp->put)(dp, &key, &data, method) == -1)
- error("put");
- if ((sdp->put)(sdp, &key, &data, method) == -1)
- error("put");
+ if (lflag) {
+ tbuf[0] = LEGACY_VERSION(_PW_KEYYPENABLED);
+ key.size = 1;
+ if ((dp->put)(dp, &key, &data, method) == -1)
+ error("put");
+ if ((sdp->put)(sdp, &key, &data, method) == -1)
+ error("put");
+ }
}
if ((dp->close)(dp) == -1)
diff --git a/usr.sbin/quot/Makefile.depend b/usr.sbin/quot/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/quot/Makefile.depend
+++ b/usr.sbin/quot/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/quotaon/Makefile.depend b/usr.sbin/quotaon/Makefile.depend
index 0eab23f..58f9a33 100644
--- a/usr.sbin/quotaon/Makefile.depend
+++ b/usr.sbin/quotaon/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/rarpd/Makefile.depend b/usr.sbin/rarpd/Makefile.depend
index 45371c5..7de116d 100644
--- a/usr.sbin/rarpd/Makefile.depend
+++ b/usr.sbin/rarpd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/repquota/Makefile.depend b/usr.sbin/repquota/Makefile.depend
index 0eab23f..58f9a33 100644
--- a/usr.sbin/repquota/Makefile.depend
+++ b/usr.sbin/repquota/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/rip6query/Makefile.depend b/usr.sbin/rip6query/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/usr.sbin/rip6query/Makefile.depend
+++ b/usr.sbin/rip6query/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/rmt/Makefile.depend b/usr.sbin/rmt/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/rmt/Makefile.depend
+++ b/usr.sbin/rmt/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/route6d/Makefile.depend b/usr.sbin/route6d/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/usr.sbin/route6d/Makefile.depend
+++ b/usr.sbin/route6d/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/rpc.lockd/Makefile.depend b/usr.sbin/rpc.lockd/Makefile.depend
index c7b269b..2e2391d 100644
--- a/usr.sbin/rpc.lockd/Makefile.depend
+++ b/usr.sbin/rpc.lockd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/rpc.statd/Makefile.depend b/usr.sbin/rpc.statd/Makefile.depend
index 37fc024..a356b97 100644
--- a/usr.sbin/rpc.statd/Makefile.depend
+++ b/usr.sbin/rpc.statd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/rpc.umntall/Makefile.depend b/usr.sbin/rpc.umntall/Makefile.depend
index c3bc1bd..ddd5dbd 100644
--- a/usr.sbin/rpc.umntall/Makefile.depend
+++ b/usr.sbin/rpc.umntall/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/rpc.yppasswdd/Makefile.depend b/usr.sbin/rpc.yppasswdd/Makefile.depend
index 8aa26a1..ffc93ca 100644
--- a/usr.sbin/rpc.yppasswdd/Makefile.depend
+++ b/usr.sbin/rpc.yppasswdd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/rpc.ypupdated/Makefile.depend b/usr.sbin/rpc.ypupdated/Makefile.depend
index 17de37a..11b2940 100644
--- a/usr.sbin/rpc.ypupdated/Makefile.depend
+++ b/usr.sbin/rpc.ypupdated/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/rpc.ypxfrd/Makefile.depend b/usr.sbin/rpc.ypxfrd/Makefile.depend
index cfed9fe..08d54b2 100644
--- a/usr.sbin/rpc.ypxfrd/Makefile.depend
+++ b/usr.sbin/rpc.ypxfrd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/rpcbind/Makefile.depend b/usr.sbin/rpcbind/Makefile.depend
index 77d6c82..0944291 100644
--- a/usr.sbin/rpcbind/Makefile.depend
+++ b/usr.sbin/rpcbind/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/rrenumd/Makefile.depend b/usr.sbin/rrenumd/Makefile.depend
index 7860279..13367d0 100644
--- a/usr.sbin/rrenumd/Makefile.depend
+++ b/usr.sbin/rrenumd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/rtadvctl/Makefile.depend b/usr.sbin/rtadvctl/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/usr.sbin/rtadvctl/Makefile.depend
+++ b/usr.sbin/rtadvctl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/rtadvd/Makefile.depend b/usr.sbin/rtadvd/Makefile.depend
index 45371c5..7de116d 100644
--- a/usr.sbin/rtadvd/Makefile.depend
+++ b/usr.sbin/rtadvd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/rtprio/Makefile.depend b/usr.sbin/rtprio/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/rtprio/Makefile.depend
+++ b/usr.sbin/rtprio/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/rtsold/Makefile.depend b/usr.sbin/rtsold/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/usr.sbin/rtsold/Makefile.depend
+++ b/usr.sbin/rtsold/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/rwhod/Makefile.depend b/usr.sbin/rwhod/Makefile.depend
index 39abfa7..e77ca8d 100644
--- a/usr.sbin/rwhod/Makefile.depend
+++ b/usr.sbin/rwhod/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/sa/Makefile.depend b/usr.sbin/sa/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/sa/Makefile.depend
+++ b/usr.sbin/sa/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/sendmail/Makefile.depend b/usr.sbin/sendmail/Makefile.depend
index 549e803..a272438 100644
--- a/usr.sbin/sendmail/Makefile.depend
+++ b/usr.sbin/sendmail/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/service/Makefile.depend b/usr.sbin/service/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.sbin/service/Makefile.depend
+++ b/usr.sbin/service/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/services_mkdb/Makefile.depend b/usr.sbin/services_mkdb/Makefile.depend
index 0eab23f..58f9a33 100644
--- a/usr.sbin/services_mkdb/Makefile.depend
+++ b/usr.sbin/services_mkdb/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/setfib/Makefile.depend b/usr.sbin/setfib/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/setfib/Makefile.depend
+++ b/usr.sbin/setfib/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/setfmac/Makefile.depend b/usr.sbin/setfmac/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/setfmac/Makefile.depend
+++ b/usr.sbin/setfmac/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/setpmac/Makefile.depend b/usr.sbin/setpmac/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/setpmac/Makefile.depend
+++ b/usr.sbin/setpmac/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/sicontrol/Makefile.depend b/usr.sbin/sicontrol/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/sicontrol/Makefile.depend
+++ b/usr.sbin/sicontrol/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/smbmsg/Makefile.depend b/usr.sbin/smbmsg/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/smbmsg/Makefile.depend
+++ b/usr.sbin/smbmsg/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/snapinfo/Makefile.depend b/usr.sbin/snapinfo/Makefile.depend
index 6ce72cc..99cf113 100644
--- a/usr.sbin/snapinfo/Makefile.depend
+++ b/usr.sbin/snapinfo/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/spkrtest/Makefile.depend b/usr.sbin/spkrtest/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.sbin/spkrtest/Makefile.depend
+++ b/usr.sbin/spkrtest/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/spray/Makefile.depend b/usr.sbin/spray/Makefile.depend
index 9e3ced9..c8383bd 100644
--- a/usr.sbin/spray/Makefile.depend
+++ b/usr.sbin/spray/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/syslogd/Makefile.depend b/usr.sbin/syslogd/Makefile.depend
index 45371c5..7de116d 100644
--- a/usr.sbin/syslogd/Makefile.depend
+++ b/usr.sbin/syslogd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/tcpdchk/Makefile.depend b/usr.sbin/tcpdchk/Makefile.depend
index 57b0fdf..e314de5 100644
--- a/usr.sbin/tcpdchk/Makefile.depend
+++ b/usr.sbin/tcpdchk/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/tcpdmatch/Makefile.depend b/usr.sbin/tcpdmatch/Makefile.depend
index 57b0fdf..e314de5 100644
--- a/usr.sbin/tcpdmatch/Makefile.depend
+++ b/usr.sbin/tcpdmatch/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/tcpdrop/Makefile.depend b/usr.sbin/tcpdrop/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/tcpdrop/Makefile.depend
+++ b/usr.sbin/tcpdrop/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/tcpdump/tcpdump/Makefile.depend b/usr.sbin/tcpdump/tcpdump/Makefile.depend
index f604a95..481ce6b 100644
--- a/usr.sbin/tcpdump/tcpdump/Makefile.depend
+++ b/usr.sbin/tcpdump/tcpdump/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/timed/timed/Makefile.depend b/usr.sbin/timed/timed/Makefile.depend
index d7b30c2..c0e7169 100644
--- a/usr.sbin/timed/timed/Makefile.depend
+++ b/usr.sbin/timed/timed/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/timed/timedc/Makefile.depend b/usr.sbin/timed/timedc/Makefile.depend
index 39abfa7..e77ca8d 100644
--- a/usr.sbin/timed/timedc/Makefile.depend
+++ b/usr.sbin/timed/timedc/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/traceroute/Makefile.depend b/usr.sbin/traceroute/Makefile.depend
index a7f7247..60e14c2 100644
--- a/usr.sbin/traceroute/Makefile.depend
+++ b/usr.sbin/traceroute/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/traceroute6/Makefile.depend b/usr.sbin/traceroute6/Makefile.depend
index 1001142..27cbf26 100644
--- a/usr.sbin/traceroute6/Makefile.depend
+++ b/usr.sbin/traceroute6/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/trpt/Makefile.depend b/usr.sbin/trpt/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/usr.sbin/trpt/Makefile.depend
+++ b/usr.sbin/trpt/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/tzsetup/Makefile.depend b/usr.sbin/tzsetup/Makefile.depend
index bf205a7..5e97e25 100644
--- a/usr.sbin/tzsetup/Makefile.depend
+++ b/usr.sbin/tzsetup/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/uathload/Makefile.depend b/usr.sbin/uathload/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/uathload/Makefile.depend
+++ b/usr.sbin/uathload/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ugidfw/Makefile.depend b/usr.sbin/ugidfw/Makefile.depend
index 2d9aa72..24a1de9 100644
--- a/usr.sbin/ugidfw/Makefile.depend
+++ b/usr.sbin/ugidfw/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/uhsoctl/Makefile.depend b/usr.sbin/uhsoctl/Makefile.depend
index 45371c5..7de116d 100644
--- a/usr.sbin/uhsoctl/Makefile.depend
+++ b/usr.sbin/uhsoctl/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/usbconfig/Makefile.depend b/usr.sbin/usbconfig/Makefile.depend
index d089be9..3ddb39c 100644
--- a/usr.sbin/usbconfig/Makefile.depend
+++ b/usr.sbin/usbconfig/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/usbdump/Makefile.depend b/usr.sbin/usbdump/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/usbdump/Makefile.depend
+++ b/usr.sbin/usbdump/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/utx/Makefile.depend b/usr.sbin/utx/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/utx/Makefile.depend
+++ b/usr.sbin/utx/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/vidcontrol/Makefile.depend b/usr.sbin/vidcontrol/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/vidcontrol/Makefile.depend
+++ b/usr.sbin/vidcontrol/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/vipw/Makefile.depend b/usr.sbin/vipw/Makefile.depend
index 0eab23f..58f9a33 100644
--- a/usr.sbin/vipw/Makefile.depend
+++ b/usr.sbin/vipw/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/wake/Makefile.depend b/usr.sbin/wake/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/wake/Makefile.depend
+++ b/usr.sbin/wake/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/watch/Makefile.depend b/usr.sbin/watch/Makefile.depend
index 3e23976..59bc828 100644
--- a/usr.sbin/watch/Makefile.depend
+++ b/usr.sbin/watch/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/watchdogd/Makefile.depend b/usr.sbin/watchdogd/Makefile.depend
index aa7dc3b..a79b1eb 100644
--- a/usr.sbin/watchdogd/Makefile.depend
+++ b/usr.sbin/watchdogd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/wlandebug/Makefile.depend b/usr.sbin/wlandebug/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/wlandebug/Makefile.depend
+++ b/usr.sbin/wlandebug/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/wlconfig/Makefile.depend b/usr.sbin/wlconfig/Makefile.depend
index a839545..f52ca95 100644
--- a/usr.sbin/wlconfig/Makefile.depend
+++ b/usr.sbin/wlconfig/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
diff --git a/usr.sbin/wpa/hostapd/Makefile.depend b/usr.sbin/wpa/hostapd/Makefile.depend
index ced01a8..8d486ac 100644
--- a/usr.sbin/wpa/hostapd/Makefile.depend
+++ b/usr.sbin/wpa/hostapd/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/wpa/hostapd_cli/Makefile.depend b/usr.sbin/wpa/hostapd_cli/Makefile.depend
index 45371c5..7de116d 100644
--- a/usr.sbin/wpa/hostapd_cli/Makefile.depend
+++ b/usr.sbin/wpa/hostapd_cli/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/wpa/ndis_events/Makefile.depend b/usr.sbin/wpa/ndis_events/Makefile.depend
index 007ffdd..54c1f6f 100644
--- a/usr.sbin/wpa/ndis_events/Makefile.depend
+++ b/usr.sbin/wpa/ndis_events/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/wpa/wpa_cli/Makefile.depend b/usr.sbin/wpa/wpa_cli/Makefile.depend
index 45371c5..7de116d 100644
--- a/usr.sbin/wpa/wpa_cli/Makefile.depend
+++ b/usr.sbin/wpa/wpa_cli/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/wpa/wpa_passphrase/Makefile.depend b/usr.sbin/wpa/wpa_passphrase/Makefile.depend
index 45371c5..7de116d 100644
--- a/usr.sbin/wpa/wpa_passphrase/Makefile.depend
+++ b/usr.sbin/wpa/wpa_passphrase/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/wpa/wpa_supplicant/Makefile.depend b/usr.sbin/wpa/wpa_supplicant/Makefile.depend
index ced01a8..8d486ac 100644
--- a/usr.sbin/wpa/wpa_supplicant/Makefile.depend
+++ b/usr.sbin/wpa/wpa_supplicant/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/yp_mkdb/Makefile.depend b/usr.sbin/yp_mkdb/Makefile.depend
index c3bc1bd..ddd5dbd 100644
--- a/usr.sbin/yp_mkdb/Makefile.depend
+++ b/usr.sbin/yp_mkdb/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ypbind/Makefile.depend b/usr.sbin/ypbind/Makefile.depend
index f0ca83a..c0b7a14 100644
--- a/usr.sbin/ypbind/Makefile.depend
+++ b/usr.sbin/ypbind/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/yppoll/Makefile.depend b/usr.sbin/yppoll/Makefile.depend
index c3bc1bd..ddd5dbd 100644
--- a/usr.sbin/yppoll/Makefile.depend
+++ b/usr.sbin/yppoll/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/yppoll/yppoll.8 b/usr.sbin/yppoll/yppoll.8
index d466fd3..c08a4e5 100644
--- a/usr.sbin/yppoll/yppoll.8
+++ b/usr.sbin/yppoll/yppoll.8
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 25, 1994
+.Dd May 31, 2015
.Dt YPPOLL 8
.Os
.Sh NAME
@@ -35,7 +35,7 @@
.Nd ask version of YP map from YP server
.Sh SYNOPSIS
.Nm
-.Op Fl h Ar host
+.\".Op Fl h Ar host
.Op Fl d Ar domain
.Ar mapname
.Sh DESCRIPTION
@@ -48,15 +48,15 @@ server for
.Pp
The options are as follows:
.Bl -tag -width indent
-.It Fl h Ar host
-Ask the YP server process running on
-.Ar host
-for information about
-.Ar mapname .
-If
-.Ar host
-is not specified, the server polled is the default server returned by
-.Xr ypwhich 1 .
+.\".It Fl h Ar host
+.\"Ask the YP server process running on
+.\".Ar host
+.\"for information about
+.\".Ar mapname .
+.\"If
+.\".Ar host
+.\"is not specified, the server polled is the default server returned by
+.\".Xr ypwhich 1 .
.It Fl d Ar domain
Use the YP domain
.Ar domain
diff --git a/usr.sbin/yppoll/yppoll.c b/usr.sbin/yppoll/yppoll.c
index e35087c..34ba18b 100644
--- a/usr.sbin/yppoll/yppoll.c
+++ b/usr.sbin/yppoll/yppoll.c
@@ -49,7 +49,11 @@ __FBSDID("$FreeBSD$");
static void
usage(void)
{
+#if 0
fprintf(stderr, "usage: yppoll [-h host] [-d domainname] mapname\n");
+#else
+ fprintf(stderr, "usage: yppoll [-d domainname] mapname\n");
+#endif
exit(1);
}
@@ -57,7 +61,9 @@ int
main(int argc, char *argv[])
{
char *domainname;
+#if 0
char *hostname = "localhost";
+#endif
char *inmap, *master;
int order;
int c, r;
@@ -71,7 +77,11 @@ main(int argc, char *argv[])
domainname = optarg;
break;
case 'h':
+#if 0
hostname = optarg;
+#else
+ /* does nothing */
+#endif
break;
case '?':
usage();
diff --git a/usr.sbin/yppush/Makefile.depend b/usr.sbin/yppush/Makefile.depend
index 96ccaed..3d736ab 100644
--- a/usr.sbin/yppush/Makefile.depend
+++ b/usr.sbin/yppush/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/yppush/yppush_main.c b/usr.sbin/yppush/yppush_main.c
index df1dbe4..6c66515 100644
--- a/usr.sbin/yppush/yppush_main.c
+++ b/usr.sbin/yppush/yppush_main.c
@@ -137,11 +137,11 @@ yppush_show_status(ypxfrstat status, unsigned long tid)
job->tid);
}
- if (status != YPPUSH_SUCC || verbose) {
+ if (status != YPXFR_SUCC || verbose) {
yp_error("transfer of map %s to server %s %s",
- job->map, job->server, status == YPPUSH_SUCC ?
+ job->map, job->server, status == YPXFR_SUCC ?
"succeeded" : "failed");
- yp_error("status returned by ypxfr: %s", status > YPPUSH_AGE ?
+ yp_error("status returned by ypxfr: %s", status > YPXFR_AGE ?
yppusherr_string(status) :
ypxfrerr_string(status));
}
@@ -365,7 +365,7 @@ create udp handle to NIS server"));
* request to the internal list, send the YPPROC_XFR request to ypserv
* do other magic things.
*/
-int
+static int
yp_push(char *server, char *map, unsigned long tid)
{
unsigned long prognum;
@@ -433,7 +433,7 @@ yp_push(char *server, char *map, unsigned long tid)
* Called for each entry in the ypservers map from yp_get_map(), which
* is our private yp_all() routine.
*/
-int
+static int
yppush_foreach(int status, char *key, int keylen, char *val, int vallen,
char *data)
{
diff --git a/usr.sbin/ypserv/Makefile.depend b/usr.sbin/ypserv/Makefile.depend
index b3d7ce8..5283d7e 100644
--- a/usr.sbin/ypserv/Makefile.depend
+++ b/usr.sbin/ypserv/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/ypset/Makefile.depend b/usr.sbin/ypset/Makefile.depend
index f0ca83a..c0b7a14 100644
--- a/usr.sbin/ypset/Makefile.depend
+++ b/usr.sbin/ypset/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/zic/zdump/Makefile.depend b/usr.sbin/zic/zdump/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/zic/zdump/Makefile.depend
+++ b/usr.sbin/zic/zdump/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/zic/zic/Makefile.depend b/usr.sbin/zic/zic/Makefile.depend
index f4b5142..3646e2e 100644
--- a/usr.sbin/zic/zic/Makefile.depend
+++ b/usr.sbin/zic/zic/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/usr.sbin/zzz/Makefile.depend b/usr.sbin/zzz/Makefile.depend
index 11aba52..f80275d 100644
--- a/usr.sbin/zzz/Makefile.depend
+++ b/usr.sbin/zzz/Makefile.depend
@@ -1,3 +1,4 @@
+# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
OpenPOWER on IntegriCloud